[PE-93] regression: mentions in space app, entity search (#6250)
* fix: mentions in space app * fix: user entity filter
This commit is contained in:
parent
d2c0940f04
commit
33acb9e8ed
2 changed files with 2 additions and 11 deletions
|
|
@ -274,11 +274,7 @@ class SearchEndpoint(BaseAPIView):
|
|||
q |= Q(**{f"{field}__icontains": query})
|
||||
users = (
|
||||
ProjectMember.objects.filter(
|
||||
q,
|
||||
member=self.request.user,
|
||||
is_active=True,
|
||||
project_id=project_id,
|
||||
workspace__slug=slug,
|
||||
q, is_active=True, project_id=project_id, workspace__slug=slug
|
||||
)
|
||||
.annotate(
|
||||
member__avatar_url=Case(
|
||||
|
|
|
|||
|
|
@ -1,6 +1,4 @@
|
|||
import { observer } from "mobx-react";
|
||||
import Link from "next/link";
|
||||
import { useParams } from "next/navigation";
|
||||
// helpers
|
||||
import { cn } from "@/helpers/common.helper";
|
||||
// hooks
|
||||
|
|
@ -12,14 +10,11 @@ type Props = {
|
|||
|
||||
export const EditorUserMention: React.FC<Props> = observer((props) => {
|
||||
const { id } = props;
|
||||
// params
|
||||
const { workspaceSlug } = useParams();
|
||||
// store hooks
|
||||
const { data: currentUser } = useUser();
|
||||
const { getMemberById } = useMember();
|
||||
// derived values
|
||||
const userDetails = getMemberById(id);
|
||||
const profileLink = `/${workspaceSlug}/profile/${id}`;
|
||||
|
||||
if (!userDetails) {
|
||||
return (
|
||||
|
|
@ -35,7 +30,7 @@ export const EditorUserMention: React.FC<Props> = observer((props) => {
|
|||
"bg-custom-primary-100/20 text-custom-primary-100": id === currentUser?.id,
|
||||
})}
|
||||
>
|
||||
<Link href={profileLink}>@{userDetails?.member__display_name}</Link>
|
||||
@{userDetails?.member__display_name}
|
||||
</div>
|
||||
);
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue