diff --git a/web/components/headers/global-issues.tsx b/web/components/headers/global-issues.tsx index 7c41ba327..5be966906 100644 --- a/web/components/headers/global-issues.tsx +++ b/web/components/headers/global-issues.tsx @@ -41,6 +41,7 @@ export const GlobalIssuesHeader: React.FC = observer((props) => { globalViewFilters: globalViewFiltersStore, workspaceFilter: workspaceFilterStore, workspace: workspaceStore, + workspaceMember: { workspaceMembers }, project: projectStore, } = useMobxStore(); @@ -145,7 +146,7 @@ export const GlobalIssuesHeader: React.FC = observer((props) => { handleFiltersUpdate={handleFiltersUpdate} layoutDisplayFiltersOptions={ISSUE_DISPLAY_FILTERS_BY_LAYOUT.my_issues.spreadsheet} labels={workspaceStore.workspaceLabels ?? undefined} - members={workspaceStore.workspaceMembers?.map((m) => m.member) ?? undefined} + members={workspaceMembers?.map((m) => m.member) ?? undefined} projects={workspaceSlug ? projectStore.projects[workspaceSlug.toString()] : undefined} /> diff --git a/web/components/issues/issue-layouts/filters/applied-filters/roots/global-view-root.tsx b/web/components/issues/issue-layouts/filters/applied-filters/roots/global-view-root.tsx index ad1712b55..9bc94b0c9 100644 --- a/web/components/issues/issue-layouts/filters/applied-filters/roots/global-view-root.tsx +++ b/web/components/issues/issue-layouts/filters/applied-filters/roots/global-view-root.tsx @@ -22,6 +22,7 @@ export const GlobalViewsAppliedFiltersRoot = observer(() => { globalViewFilters: globalViewFiltersStore, project: projectStore, workspace: workspaceStore, + workspaceMember: { workspaceMembers }, } = useMobxStore(); const viewDetails = globalViewId ? globalViewsStore.globalViewDetails[globalViewId.toString()] : undefined; @@ -101,7 +102,7 @@ export const GlobalViewsAppliedFiltersRoot = observer(() => { handleClearAllFilters={handleClearAllFilters} handleRemoveFilter={handleRemoveFilter} labels={workspaceStore.workspaceLabels ?? undefined} - members={workspaceStore.workspaceMembers?.map((m) => m.member)} + members={workspaceMembers?.map((m) => m.member)} projects={workspaceSlug ? projectStore.projects[workspaceSlug.toString()] : undefined} /> {storedFilters && viewDetails && areFiltersDifferent(storedFilters, viewDetails.query_data.filters ?? {}) && ( diff --git a/web/components/issues/issue-layouts/properties/assignee.tsx b/web/components/issues/issue-layouts/properties/assignee.tsx index 6b95b7e1d..c3d550055 100644 --- a/web/components/issues/issue-layouts/properties/assignee.tsx +++ b/web/components/issues/issue-layouts/properties/assignee.tsx @@ -39,18 +39,19 @@ export const IssuePropertyAssignee: React.FC = observer( multiple = false, noLabelBorder = false, } = props; - - const { workspace: workspaceStore, project: projectStore } = useMobxStore(); + // store + const { + workspace: workspaceStore, + project: projectStore, + workspaceMember: { workspaceMembers, fetchWorkspaceMembers }, + } = useMobxStore(); const workspaceSlug = workspaceStore?.workspaceSlug; - + // states const [query, setQuery] = useState(""); - const [referenceElement, setReferenceElement] = useState(null); const [popperElement, setPopperElement] = useState(null); const [isLoading, setIsLoading] = useState(false); - const workspaceMembers = workspaceSlug ? workspaceStore?.workspaceMembers : undefined; - const fetchProjectMembers = () => { setIsLoading(true); if (workspaceSlug && projectId) @@ -59,10 +60,9 @@ export const IssuePropertyAssignee: React.FC = observer( projectStore.fetchProjectMembers(workspaceSlug, projectId).then(() => setIsLoading(false)); }; - const fetchWorkspaceMembers = () => { + const getWorkspaceMembers = () => { setIsLoading(true); - if (workspaceSlug) - workspaceSlug && workspaceStore.fetchWorkspaceMembers(workspaceSlug).then(() => setIsLoading(false)); + if (workspaceSlug) workspaceSlug && fetchWorkspaceMembers(workspaceSlug).then(() => setIsLoading(false)); }; const options = (workspaceMembers ?? [])?.map((member) => ({ @@ -151,7 +151,7 @@ export const IssuePropertyAssignee: React.FC = observer( className={`flex items-center justify-between gap-1 w-full text-xs ${ disabled ? "cursor-not-allowed text-custom-text-200" : "cursor-pointer hover:bg-custom-background-80" } ${buttonClassName}`} - onClick={() => !workspaceMembers && fetchWorkspaceMembers()} + onClick={() => !workspaceMembers && getWorkspaceMembers()} > {label} {!hideDropdownArrow && !disabled &&