diff --git a/web/components/inbox/inbox-filter/filters/members.tsx b/web/components/inbox/inbox-filter/filters/members.tsx index f2776104b..f86c385e7 100644 --- a/web/components/inbox/inbox-filter/filters/members.tsx +++ b/web/components/inbox/inbox-filter/filters/members.tsx @@ -6,7 +6,7 @@ import { Avatar, Loader } from "@plane/ui"; // components import { FilterHeader, FilterOption } from "@/components/issues"; // hooks -import { useMember, useProjectInbox } from "@/hooks/store"; +import { useMember, useProjectInbox, useUser } from "@/hooks/store"; type Props = { filterKey: TInboxIssueFilterMemberKeys; @@ -20,6 +20,7 @@ export const FilterMember: FC = observer((props: Props) => { // hooks const { inboxFilters, handleInboxIssueFilters } = useProjectInbox(); const { getUserDetails } = useMember(); + const { currentUser } = useUser(); // states const [itemsToRender, setItemsToRender] = useState(5); const [previewEnabled, setPreviewEnabled] = useState(true); @@ -34,6 +35,7 @@ export const FilterMember: FC = observer((props: Props) => { return sortBy(filteredOptions, [ (memberId) => !filterValue.includes(memberId), + (memberId) => memberId !== currentUser?.id, (memberId) => getUserDetails(memberId)?.display_name.toLowerCase(), ]); // eslint-disable-next-line react-hooks/exhaustive-deps @@ -71,7 +73,7 @@ export const FilterMember: FC = observer((props: Props) => { isChecked={filterValue?.includes(member.id) ? true : false} onClick={() => handleInboxIssueFilters(filterKey, handleFilterValue(member.id))} icon={} - title={member.display_name} + title={currentUser?.id === member.id ? "You" : member?.display_name} /> ); })} diff --git a/web/components/issues/issue-layouts/filters/header/filters/assignee.tsx b/web/components/issues/issue-layouts/filters/header/filters/assignee.tsx index e7edaebc8..860a4a087 100644 --- a/web/components/issues/issue-layouts/filters/header/filters/assignee.tsx +++ b/web/components/issues/issue-layouts/filters/header/filters/assignee.tsx @@ -4,7 +4,7 @@ import { observer } from "mobx-react-lite"; // hooks import { Avatar, Loader } from "@plane/ui"; import { FilterHeader, FilterOption } from "@/components/issues"; -import { useMember } from "@/hooks/store"; +import { useMember, useUser } from "@/hooks/store"; // components // ui @@ -22,16 +22,18 @@ export const FilterAssignees: React.FC = observer((props: Props) => { const [previewEnabled, setPreviewEnabled] = useState(true); // store hooks const { getUserDetails } = useMember(); + const { currentUser } = useUser(); const appliedFiltersCount = appliedFilters?.length ?? 0; const sortedOptions = useMemo(() => { - const filteredOptions = (memberIds || []).filter( - (memberId) => getUserDetails(memberId)?.display_name.toLowerCase().includes(searchQuery.toLowerCase()) + const filteredOptions = (memberIds || []).filter((memberId) => + getUserDetails(memberId)?.display_name.toLowerCase().includes(searchQuery.toLowerCase()) ); return sortBy(filteredOptions, [ (memberId) => !(appliedFilters ?? []).includes(memberId), + (memberId) => memberId !== currentUser?.id, (memberId) => getUserDetails(memberId)?.display_name.toLowerCase(), ]); // eslint-disable-next-line react-hooks/exhaustive-deps @@ -66,7 +68,7 @@ export const FilterAssignees: React.FC = observer((props: Props) => { isChecked={appliedFilters?.includes(member.id) ? true : false} onClick={() => handleUpdate(member.id)} icon={} - title={member.display_name} + title={currentUser?.id === member.id ? "You" : member?.display_name} /> ); })} diff --git a/web/components/issues/issue-layouts/filters/header/filters/created-by.tsx b/web/components/issues/issue-layouts/filters/header/filters/created-by.tsx index 071f3c03a..9f37d8737 100644 --- a/web/components/issues/issue-layouts/filters/header/filters/created-by.tsx +++ b/web/components/issues/issue-layouts/filters/header/filters/created-by.tsx @@ -4,7 +4,7 @@ import { observer } from "mobx-react-lite"; // hooks import { Avatar, Loader } from "@plane/ui"; import { FilterHeader, FilterOption } from "@/components/issues"; -import { useMember } from "@/hooks/store"; +import { useMember, useUser } from "@/hooks/store"; // components // ui @@ -22,14 +22,16 @@ export const FilterCreatedBy: React.FC = observer((props: Props) => { const [previewEnabled, setPreviewEnabled] = useState(true); // store hooks const { getUserDetails } = useMember(); + const { currentUser } = useUser(); const sortedOptions = useMemo(() => { - const filteredOptions = (memberIds || []).filter( - (memberId) => getUserDetails(memberId)?.display_name.toLowerCase().includes(searchQuery.toLowerCase()) + const filteredOptions = (memberIds || []).filter((memberId) => + getUserDetails(memberId)?.display_name.toLowerCase().includes(searchQuery.toLowerCase()) ); return sortBy(filteredOptions, [ (memberId) => !(appliedFilters ?? []).includes(memberId), + (memberId) => memberId !== currentUser?.id, (memberId) => getUserDetails(memberId)?.display_name.toLowerCase(), ]); // eslint-disable-next-line react-hooks/exhaustive-deps @@ -66,7 +68,7 @@ export const FilterCreatedBy: React.FC = observer((props: Props) => { isChecked={appliedFilters?.includes(member.id) ? true : false} onClick={() => handleUpdate(member.id)} icon={} - title={member.display_name} + title={currentUser?.id === member.id ? "You" : member?.display_name} /> ); })} diff --git a/web/components/issues/issue-layouts/filters/header/filters/mentions.tsx b/web/components/issues/issue-layouts/filters/header/filters/mentions.tsx index b1b070434..9ad75399a 100644 --- a/web/components/issues/issue-layouts/filters/header/filters/mentions.tsx +++ b/web/components/issues/issue-layouts/filters/header/filters/mentions.tsx @@ -4,7 +4,7 @@ import { observer } from "mobx-react-lite"; // hooks import { Loader, Avatar } from "@plane/ui"; import { FilterHeader, FilterOption } from "@/components/issues"; -import { useMember } from "@/hooks/store"; +import { useMember, useUser } from "@/hooks/store"; // components // ui @@ -22,16 +22,18 @@ export const FilterMentions: React.FC = observer((props: Props) => { const [previewEnabled, setPreviewEnabled] = useState(true); // store hooks const { getUserDetails } = useMember(); + const { currentUser } = useUser(); const appliedFiltersCount = appliedFilters?.length ?? 0; const sortedOptions = useMemo(() => { - const filteredOptions = (memberIds || []).filter( - (memberId) => getUserDetails(memberId)?.display_name.toLowerCase().includes(searchQuery.toLowerCase()) + const filteredOptions = (memberIds || []).filter((memberId) => + getUserDetails(memberId)?.display_name.toLowerCase().includes(searchQuery.toLowerCase()) ); return sortBy(filteredOptions, [ (memberId) => !(appliedFilters ?? []).includes(memberId), + (memberId) => memberId !== currentUser?.id, (memberId) => getUserDetails(memberId)?.display_name.toLowerCase(), ]); // eslint-disable-next-line react-hooks/exhaustive-deps @@ -66,7 +68,7 @@ export const FilterMentions: React.FC = observer((props: Props) => { isChecked={appliedFilters?.includes(member.id) ? true : false} onClick={() => handleUpdate(member.id)} icon={} - title={member.display_name} + title={currentUser?.id === member.id ? "You" : member?.display_name} /> ); })}