diff --git a/web/components/headers/cycle-issues.tsx b/web/components/headers/cycle-issues.tsx index 3f177cded..fea9e7019 100644 --- a/web/components/headers/cycle-issues.tsx +++ b/web/components/headers/cycle-issues.tsx @@ -30,12 +30,12 @@ export const CycleIssuesHeader: React.FC = observer(() => { issueFilter: issueFilterStore, cycle: cycleStore, cycleIssueFilter: cycleIssueFilterStore, - project: projectStore, + project: { currentProjectDetails }, + projectLabel: { projectLabels }, projectMember: { projectMembers }, projectState: projectStateStore, commandPalette: commandPaletteStore, } = useMobxStore(); - const { currentProjectDetails } = projectStore; const activeLayout = issueFilterStore.userDisplayFilters.layout; @@ -178,7 +178,7 @@ export const CycleIssuesHeader: React.FC = observer(() => { layoutDisplayFiltersOptions={ activeLayout ? ISSUE_DISPLAY_FILTERS_BY_LAYOUT.issues[activeLayout] : undefined } - labels={projectStore.labels?.[projectId?.toString() ?? ""] ?? undefined} + labels={projectLabels ?? undefined} members={projectMembers?.map((m) => m.member)} states={projectStateStore.states?.[projectId?.toString() ?? ""] ?? undefined} /> diff --git a/web/components/headers/module-issues.tsx b/web/components/headers/module-issues.tsx index cea8093bf..6bb5ba84e 100644 --- a/web/components/headers/module-issues.tsx +++ b/web/components/headers/module-issues.tsx @@ -30,13 +30,13 @@ export const ModuleIssuesHeader: React.FC = observer(() => { issueFilter: issueFilterStore, module: moduleStore, moduleFilter: moduleFilterStore, - project: projectStore, + project: { currentProjectDetails }, + projectLabel: { projectLabels }, projectMember: { projectMembers }, projectState: projectStateStore, commandPalette: commandPaletteStore, } = useMobxStore(); const activeLayout = issueFilterStore.userDisplayFilters.layout; - const { currentProjectDetails } = projectStore; const { setValue, storedValue } = useLocalStorage("module_sidebar_collapsed", "false"); @@ -177,7 +177,7 @@ export const ModuleIssuesHeader: React.FC = observer(() => { layoutDisplayFiltersOptions={ activeLayout ? ISSUE_DISPLAY_FILTERS_BY_LAYOUT.issues[activeLayout] : undefined } - labels={projectStore.labels?.[projectId?.toString() ?? ""] ?? undefined} + labels={projectLabels ?? undefined} members={projectMembers?.map((m) => m.member)} states={projectStateStore.states?.[projectId?.toString() ?? ""] ?? undefined} /> diff --git a/web/components/headers/project-archived-issues.tsx b/web/components/headers/project-archived-issues.tsx index 4c2d9f354..8f8a4063d 100644 --- a/web/components/headers/project-archived-issues.tsx +++ b/web/components/headers/project-archived-issues.tsx @@ -21,14 +21,13 @@ export const ProjectArchivedIssuesHeader: FC = observer(() => { const { workspaceSlug, projectId } = router.query; const { - project: projectStore, + project: { currentProjectDetails }, + projectLabel: { projectLabels }, projectMember: { projectMembers }, archivedIssueFilters: archivedIssueFiltersStore, projectState: projectStateStore, } = useMobxStore(); - const { currentProjectDetails } = projectStore; - // for archived issues list layout is the only option const activeLayout = "list"; @@ -119,7 +118,7 @@ export const ProjectArchivedIssuesHeader: FC = observer(() => { layoutDisplayFiltersOptions={ activeLayout ? ISSUE_DISPLAY_FILTERS_BY_LAYOUT.archived_issues[activeLayout] : undefined } - labels={projectStore.labels?.[projectId?.toString() ?? ""] ?? undefined} + labels={projectLabels ?? undefined} members={projectMembers?.map((m) => m.member)} states={projectStateStore.states?.[projectId?.toString() ?? ""] ?? undefined} /> diff --git a/web/components/headers/project-issues.tsx b/web/components/headers/project-issues.tsx index 1b418d6f4..bb816ff87 100644 --- a/web/components/headers/project-issues.tsx +++ b/web/components/headers/project-issues.tsx @@ -25,7 +25,8 @@ export const ProjectIssuesHeader: React.FC = observer(() => { const { issueFilter: issueFilterStore, - project: projectStore, + project: { currentProjectDetails }, + projectLabel: { projectLabels }, projectMember: { projectMembers }, projectState: projectStateStore, inbox: inboxStore, @@ -92,7 +93,6 @@ export const ProjectIssuesHeader: React.FC = observer(() => { }, [issueFilterStore, projectId, workspaceSlug] ); - const { currentProjectDetails } = projectStore; const inboxDetails = projectId ? inboxStore.inboxesList?.[projectId.toString()]?.[0] : undefined; @@ -178,7 +178,7 @@ export const ProjectIssuesHeader: React.FC = observer(() => { layoutDisplayFiltersOptions={ activeLayout ? ISSUE_DISPLAY_FILTERS_BY_LAYOUT.issues[activeLayout] : undefined } - labels={projectStore.labels?.[projectId?.toString() ?? ""] ?? undefined} + labels={projectLabels ?? undefined} members={projectMembers?.map((m) => m.member)} states={projectStateStore.states?.[projectId?.toString() ?? ""] ?? undefined} /> diff --git a/web/components/headers/project-view-issues.tsx b/web/components/headers/project-view-issues.tsx index 7e899d851..6a4742e99 100644 --- a/web/components/headers/project-view-issues.tsx +++ b/web/components/headers/project-view-issues.tsx @@ -22,14 +22,13 @@ export const ProjectViewIssuesHeader: React.FC = observer(() => { const { issueFilter: issueFilterStore, projectViewFilters: projectViewFiltersStore, - project: projectStore, + project: { currentProjectDetails }, + projectLabel: { projectLabels }, projectMember: { projectMembers }, projectState: projectStateStore, projectViews: projectViewsStore, } = useMobxStore(); - const { currentProjectDetails } = projectStore; - const storedFilters = viewId ? projectViewFiltersStore.storedFilters[viewId.toString()] : undefined; const activeLayout = issueFilterStore.userDisplayFilters.layout; @@ -163,7 +162,7 @@ export const ProjectViewIssuesHeader: React.FC = observer(() => { layoutDisplayFiltersOptions={ activeLayout ? ISSUE_DISPLAY_FILTERS_BY_LAYOUT.issues[activeLayout] : undefined } - labels={projectStore.labels?.[projectId?.toString() ?? ""] ?? undefined} + labels={projectLabels ?? undefined} members={projectMembers?.map((m) => m.member)} states={projectStateStore.states?.[projectId?.toString() ?? ""] ?? undefined} /> diff --git a/web/components/issues/issue-layouts/filters/applied-filters/filters-list.tsx b/web/components/issues/issue-layouts/filters/applied-filters/filters-list.tsx index f7672ac75..89f9e41c0 100644 --- a/web/components/issues/issue-layouts/filters/applied-filters/filters-list.tsx +++ b/web/components/issues/issue-layouts/filters/applied-filters/filters-list.tsx @@ -15,13 +15,13 @@ import { X } from "lucide-react"; // helpers import { replaceUnderscoreIfSnakeCase } from "helpers/string.helper"; // types -import { IIssueFilterOptions, IIssueLabels, IProject, IState, IUserLite } from "types"; +import { IIssueFilterOptions, IIssueLabel, IProject, IState, IUserLite } from "types"; type Props = { appliedFilters: IIssueFilterOptions; handleClearAllFilters: () => void; handleRemoveFilter: (key: keyof IIssueFilterOptions, value: string | null) => void; - labels?: IIssueLabels[] | undefined; + labels?: IIssueLabel[] | undefined; members?: IUserLite[] | undefined; projects?: IProject[] | undefined; states?: IState[] | undefined; diff --git a/web/components/issues/issue-layouts/filters/applied-filters/label.tsx b/web/components/issues/issue-layouts/filters/applied-filters/label.tsx index ee597575f..d96bb4fd1 100644 --- a/web/components/issues/issue-layouts/filters/applied-filters/label.tsx +++ b/web/components/issues/issue-layouts/filters/applied-filters/label.tsx @@ -3,11 +3,11 @@ import { observer } from "mobx-react-lite"; // icons import { X } from "lucide-react"; // types -import { IIssueLabels } from "types"; +import { IIssueLabel } from "types"; type Props = { handleRemove: (val: string) => void; - labels: IIssueLabels[] | undefined; + labels: IIssueLabel[] | undefined; values: string[]; }; diff --git a/web/components/issues/issue-layouts/filters/applied-filters/roots/archived-issue.tsx b/web/components/issues/issue-layouts/filters/applied-filters/roots/archived-issue.tsx index 32e5a4a21..f733d3a87 100644 --- a/web/components/issues/issue-layouts/filters/applied-filters/roots/archived-issue.tsx +++ b/web/components/issues/issue-layouts/filters/applied-filters/roots/archived-issue.tsx @@ -14,7 +14,7 @@ export const ArchivedIssueAppliedFiltersRoot: React.FC = observer(() => { const { archivedIssueFilters: archivedIssueFiltersStore, - project: projectStore, + projectLabel: { projectLabels }, projectMember: { projectMembers }, projectState: projectStateStore, } = useMobxStore(); @@ -77,7 +77,7 @@ export const ArchivedIssueAppliedFiltersRoot: React.FC = observer(() => { appliedFilters={appliedFilters} handleClearAllFilters={handleClearAllFilters} handleRemoveFilter={handleRemoveFilter} - labels={projectStore.labels?.[projectId?.toString() ?? ""] ?? []} + labels={projectLabels ?? []} members={projectMembers?.map((m) => m.member)} states={projectStateStore.states?.[projectId?.toString() ?? ""]} /> diff --git a/web/components/issues/issue-layouts/filters/applied-filters/roots/cycle-root.tsx b/web/components/issues/issue-layouts/filters/applied-filters/roots/cycle-root.tsx index 2bd0ffdfe..5e71dc96b 100644 --- a/web/components/issues/issue-layouts/filters/applied-filters/roots/cycle-root.tsx +++ b/web/components/issues/issue-layouts/filters/applied-filters/roots/cycle-root.tsx @@ -12,7 +12,7 @@ export const CycleAppliedFiltersRoot: React.FC = observer(() => { const { workspaceSlug, projectId, cycleId } = router.query; const { - project: projectStore, + projectLabel: { projectLabels }, projectMember: { projectMembers }, cycleIssueFilter: cycleIssueFilterStore, projectState: projectStateStore, @@ -72,7 +72,7 @@ export const CycleAppliedFiltersRoot: React.FC = observer(() => { appliedFilters={appliedFilters} handleClearAllFilters={handleClearAllFilters} handleRemoveFilter={handleRemoveFilter} - labels={projectStore.labels?.[projectId?.toString() ?? ""] ?? []} + labels={projectLabels ?? []} members={projectMembers?.map((m) => m.member)} states={projectStateStore.states?.[projectId?.toString() ?? ""]} /> diff --git a/web/components/issues/issue-layouts/filters/applied-filters/roots/module-root.tsx b/web/components/issues/issue-layouts/filters/applied-filters/roots/module-root.tsx index 6a5cd6944..bb7e924ff 100644 --- a/web/components/issues/issue-layouts/filters/applied-filters/roots/module-root.tsx +++ b/web/components/issues/issue-layouts/filters/applied-filters/roots/module-root.tsx @@ -13,7 +13,7 @@ export const ModuleAppliedFiltersRoot: React.FC = observer(() => { const { workspaceSlug, projectId, moduleId } = router.query; const { - project: projectStore, + projectLabel: { projectLabels }, moduleFilter: moduleFilterStore, projectState: projectStateStore, projectMember: { projectMembers }, @@ -73,7 +73,7 @@ export const ModuleAppliedFiltersRoot: React.FC = observer(() => { appliedFilters={appliedFilters} handleClearAllFilters={handleClearAllFilters} handleRemoveFilter={handleRemoveFilter} - labels={projectStore.labels?.[projectId?.toString() ?? ""] ?? []} + labels={projectLabels ?? []} members={projectMembers?.map((m) => m.member)} states={projectStateStore.states?.[projectId?.toString() ?? ""]} /> diff --git a/web/components/issues/issue-layouts/filters/applied-filters/roots/project-root.tsx b/web/components/issues/issue-layouts/filters/applied-filters/roots/project-root.tsx index 26f475733..8b12b9b11 100644 --- a/web/components/issues/issue-layouts/filters/applied-filters/roots/project-root.tsx +++ b/web/components/issues/issue-layouts/filters/applied-filters/roots/project-root.tsx @@ -14,7 +14,7 @@ export const ProjectAppliedFiltersRoot: React.FC = observer(() => { const { issueFilter: issueFilterStore, - project: projectStore, + projectLabel: { projectLabels }, projectState: projectStateStore, projectMember: { projectMembers }, } = useMobxStore(); @@ -77,7 +77,7 @@ export const ProjectAppliedFiltersRoot: React.FC = observer(() => { appliedFilters={appliedFilters} handleClearAllFilters={handleClearAllFilters} handleRemoveFilter={handleRemoveFilter} - labels={projectStore.labels?.[projectId?.toString() ?? ""] ?? []} + labels={projectLabels ?? []} members={projectMembers?.map((m) => m.member)} states={projectStateStore.states?.[projectId?.toString() ?? ""]} /> diff --git a/web/components/issues/issue-layouts/filters/applied-filters/roots/project-view-root.tsx b/web/components/issues/issue-layouts/filters/applied-filters/roots/project-view-root.tsx index 5f797a6ce..65462d277 100644 --- a/web/components/issues/issue-layouts/filters/applied-filters/roots/project-view-root.tsx +++ b/web/components/issues/issue-layouts/filters/applied-filters/roots/project-view-root.tsx @@ -18,7 +18,7 @@ export const ProjectViewAppliedFiltersRoot: React.FC = observer(() => { const { workspaceSlug, projectId, viewId } = router.query; const { - project: projectStore, + projectLabel: { projectLabels }, projectMember: { projectMembers }, projectState: projectStateStore, projectViews: projectViewsStore, @@ -99,7 +99,7 @@ export const ProjectViewAppliedFiltersRoot: React.FC = observer(() => { appliedFilters={appliedFilters} handleClearAllFilters={handleClearAllFilters} handleRemoveFilter={handleRemoveFilter} - labels={projectStore.labels?.[projectId?.toString() ?? ""] ?? []} + labels={projectLabels ?? []} members={projectMembers?.map((m) => m.member)} states={projectStateStore.states?.[projectId?.toString() ?? ""]} /> diff --git a/web/components/issues/issue-layouts/filters/header/filters/filters-selection.tsx b/web/components/issues/issue-layouts/filters/header/filters/filters-selection.tsx index 781e7fcd5..612b6fcdb 100644 --- a/web/components/issues/issue-layouts/filters/header/filters/filters-selection.tsx +++ b/web/components/issues/issue-layouts/filters/header/filters/filters-selection.tsx @@ -15,7 +15,7 @@ import { FilterTargetDate, } from "components/issues"; // types -import { IIssueFilterOptions, IIssueLabels, IProject, IState, IUserLite } from "types"; +import { IIssueFilterOptions, IIssueLabel, IProject, IState, IUserLite } from "types"; // constants import { ILayoutDisplayFiltersOptions } from "constants/issue"; @@ -23,7 +23,7 @@ type Props = { filters: IIssueFilterOptions; handleFiltersUpdate: (key: keyof IIssueFilterOptions, value: string | string[]) => void; layoutDisplayFiltersOptions: ILayoutDisplayFiltersOptions | undefined; - labels?: IIssueLabels[] | undefined; + labels?: IIssueLabel[] | undefined; members?: IUserLite[] | undefined; projects?: IProject[] | undefined; states?: IState[] | undefined; diff --git a/web/components/issues/issue-layouts/filters/header/filters/labels.tsx b/web/components/issues/issue-layouts/filters/header/filters/labels.tsx index 764d29951..a12659cdd 100644 --- a/web/components/issues/issue-layouts/filters/header/filters/labels.tsx +++ b/web/components/issues/issue-layouts/filters/header/filters/labels.tsx @@ -5,7 +5,7 @@ import { FilterHeader, FilterOption } from "components/issues"; // ui import { Loader } from "@plane/ui"; // types -import { IIssueLabels } from "types"; +import { IIssueLabel } from "types"; const LabelIcons = ({ color }: { color: string }) => ( @@ -14,7 +14,7 @@ const LabelIcons = ({ color }: { color: string }) => ( type Props = { appliedFilters: string[] | null; handleUpdate: (val: string) => void; - labels: IIssueLabels[] | undefined; + labels: IIssueLabel[] | undefined; searchQuery: string; }; diff --git a/web/components/issues/issue-layouts/kanban/roots/cycle-root.tsx b/web/components/issues/issue-layouts/kanban/roots/cycle-root.tsx index a060ed213..fad4d814e 100644 --- a/web/components/issues/issue-layouts/kanban/roots/cycle-root.tsx +++ b/web/components/issues/issue-layouts/kanban/roots/cycle-root.tsx @@ -23,6 +23,7 @@ export const CycleKanBanLayout: React.FC = observer(() => { // store const { project: projectStore, + projectLabel: { projectLabels }, projectMember: { projectMembers }, projectState: projectStateStore, cycleIssue: cycleIssueStore, @@ -99,7 +100,6 @@ export const CycleKanBanLayout: React.FC = observer(() => { const states = projectStateStore?.projectStates || null; const priorities = ISSUE_PRIORITIES || null; - const labels = projectStore?.projectLabels || null; const stateGroups = ISSUE_STATE_GROUPS || null; const projects = workspaceSlug ? projectStore?.projects[workspaceSlug.toString()] || null : null; // const estimates = @@ -137,7 +137,7 @@ export const CycleKanBanLayout: React.FC = observer(() => { states={states} stateGroups={stateGroups} priorities={priorities} - labels={labels} + labels={projectLabels} members={projectMembers?.map((m) => m.member) ?? null} projects={projects} showEmptyGroup={userDisplayFilters?.show_empty_groups || true} @@ -164,7 +164,7 @@ export const CycleKanBanLayout: React.FC = observer(() => { states={states} stateGroups={stateGroups} priorities={priorities} - labels={labels} + labels={projectLabels} members={projectMembers?.map((m) => m.member) ?? null} projects={projects} showEmptyGroup={userDisplayFilters?.show_empty_groups || true} diff --git a/web/components/issues/issue-layouts/kanban/roots/module-root.tsx b/web/components/issues/issue-layouts/kanban/roots/module-root.tsx index 7a25f835c..a3429ef64 100644 --- a/web/components/issues/issue-layouts/kanban/roots/module-root.tsx +++ b/web/components/issues/issue-layouts/kanban/roots/module-root.tsx @@ -21,7 +21,8 @@ export const ModuleKanBanLayout: React.FC = observer(() => { const { workspaceSlug, moduleId } = router.query; // store const { - project: projectStore, + project: { workspaceProjects }, + projectLabel: { projectLabels }, projectMember: { projectMembers }, projectState: projectStateStore, moduleIssue: moduleIssueStore, @@ -97,9 +98,7 @@ export const ModuleKanBanLayout: React.FC = observer(() => { const states = projectStateStore?.projectStates || null; const priorities = ISSUE_PRIORITIES || null; - const labels = projectStore?.projectLabels || null; const stateGroups = ISSUE_STATE_GROUPS || null; - const projects = workspaceSlug ? projectStore?.projects[workspaceSlug.toString()] || null : null; // const estimates = // currentProjectDetails?.estimate !== null // ? projectStore.projectEstimates?.find((e) => e.id === currentProjectDetails?.estimate) || null @@ -135,9 +134,9 @@ export const ModuleKanBanLayout: React.FC = observer(() => { states={states} stateGroups={stateGroups} priorities={priorities} - labels={labels} + labels={projectLabels} members={projectMembers?.map((m) => m.member) ?? null} - projects={projects} + projects={workspaceProjects} showEmptyGroup={userDisplayFilters?.show_empty_groups || true} isDragStarted={isDragStarted} /> @@ -162,9 +161,9 @@ export const ModuleKanBanLayout: React.FC = observer(() => { states={states} stateGroups={stateGroups} priorities={priorities} - labels={labels} + labels={projectLabels} members={projectMembers?.map((m) => m.member) ?? null} - projects={projects} + projects={workspaceProjects} showEmptyGroup={userDisplayFilters?.show_empty_groups || true} isDragStarted={isDragStarted} /> diff --git a/web/components/issues/issue-layouts/kanban/roots/project-root.tsx b/web/components/issues/issue-layouts/kanban/roots/project-root.tsx index 8f34dee71..070d13a89 100644 --- a/web/components/issues/issue-layouts/kanban/roots/project-root.tsx +++ b/web/components/issues/issue-layouts/kanban/roots/project-root.tsx @@ -21,7 +21,8 @@ export const KanBanLayout: React.FC = observer(() => { const { workspaceSlug } = router.query as { workspaceSlug: string }; const { - project: projectStore, + project: { workspaceProjects }, + projectLabel: { projectLabels }, projectMember: { projectMembers }, projectState: projectStateStore, issue: issueStore, @@ -29,7 +30,6 @@ export const KanBanLayout: React.FC = observer(() => { issueKanBanView: issueKanBanViewStore, issueDetail: issueDetailStore, } = useMobxStore(); - const { currentProjectDetails } = projectStore; const issues = issueStore?.getIssues; @@ -92,13 +92,11 @@ export const KanBanLayout: React.FC = observer(() => { const states = projectStateStore?.projectStates || null; const priorities = ISSUE_PRIORITIES || null; - const labels = projectStore?.projectLabels || null; const stateGroups = ISSUE_STATE_GROUPS || null; - const projects = workspaceSlug ? projectStore?.projects?.[workspaceSlug] || null : null; - const estimates = - currentProjectDetails?.estimate !== null - ? projectStore.projectEstimates?.find((e) => e.id === currentProjectDetails?.estimate) || null - : null; + // const estimates = + // currentProjectDetails?.estimate !== null + // ? projectStore.projectEstimates?.find((e) => e.id === currentProjectDetails?.estimate) || null + // : null; return ( <> @@ -129,9 +127,9 @@ export const KanBanLayout: React.FC = observer(() => { states={states} stateGroups={stateGroups} priorities={priorities} - labels={labels} + labels={projectLabels} members={projectMembers?.map((m) => m.member) ?? null} - projects={projects} + projects={workspaceProjects} enableQuickIssueCreate showEmptyGroup={userDisplayFilters?.show_empty_groups || true} isDragStarted={isDragStarted} @@ -156,9 +154,9 @@ export const KanBanLayout: React.FC = observer(() => { states={states} stateGroups={stateGroups} priorities={priorities} - labels={labels} + labels={projectLabels} members={projectMembers?.map((m) => m.member) ?? null} - projects={projects} + projects={workspaceProjects} showEmptyGroup={userDisplayFilters?.show_empty_groups || true} isDragStarted={isDragStarted} /> diff --git a/web/components/issues/issue-layouts/kanban/roots/project-view-root.tsx b/web/components/issues/issue-layouts/kanban/roots/project-view-root.tsx index 6751f3145..c03b50934 100644 --- a/web/components/issues/issue-layouts/kanban/roots/project-view-root.tsx +++ b/web/components/issues/issue-layouts/kanban/roots/project-view-root.tsx @@ -56,7 +56,7 @@ export const ProjectViewKanBanLayout: React.FC = observer(() => { const states = projectStateStore?.projectStates || null; const priorities = ISSUE_PRIORITIES || null; - const labels = projectStore?.projectLabels || null; + // const labels = projectStore?.projectLabels || null; const stateGroups = ISSUE_STATE_GROUPS || null; const projects = projectStateStore?.projectStates || null; const estimates = null; diff --git a/web/components/issues/issue-layouts/kanban/swimlanes.tsx b/web/components/issues/issue-layouts/kanban/swimlanes.tsx index e25ddea3d..7162025e0 100644 --- a/web/components/issues/issue-layouts/kanban/swimlanes.tsx +++ b/web/components/issues/issue-layouts/kanban/swimlanes.tsx @@ -5,7 +5,7 @@ import { KanBanGroupByHeaderRoot } from "./headers/group-by-root"; import { KanBanSubGroupByHeaderRoot } from "./headers/sub-group-by-root"; import { KanBan } from "./default"; // types -import { IIssue, IIssueDisplayProperties, IIssueLabels, IProject, IState, IUserLite } from "types"; +import { IIssue, IIssueDisplayProperties, IIssueLabel, IProject, IState, IUserLite } from "types"; // constants import { getValueFromObject } from "constants/issue"; @@ -63,7 +63,7 @@ interface ISubGroupSwimlane extends ISubGroupSwimlaneHeader { states: IState[] | null; stateGroups: any; priorities: any; - labels: IIssueLabels[] | null; + labels: IIssueLabel[] | null; members: IUserLite[] | null; projects: IProject[] | null; issues: any; @@ -181,7 +181,7 @@ export interface IKanBanSwimLanes { states: IState[] | null; stateGroups: any; priorities: any; - labels: IIssueLabels[] | null; + labels: IIssueLabel[] | null; members: IUserLite[] | null; projects: IProject[] | null; isDragStarted?: boolean; diff --git a/web/components/issues/issue-layouts/list/default.tsx b/web/components/issues/issue-layouts/list/default.tsx index b9d13a92b..4f2d215db 100644 --- a/web/components/issues/issue-layouts/list/default.tsx +++ b/web/components/issues/issue-layouts/list/default.tsx @@ -4,7 +4,7 @@ import { observer } from "mobx-react-lite"; import { ListGroupByHeaderRoot } from "./headers/group-by-root"; import { IssueBlocksList, ListInlineCreateIssueForm } from "components/issues"; // types -import { IEstimatePoint, IIssue, IIssueDisplayProperties, IIssueLabels, IProject, IState, IUserLite } from "types"; +import { IEstimatePoint, IIssue, IIssueDisplayProperties, IIssueLabel, IProject, IState, IUserLite } from "types"; // constants import { getValueFromObject } from "constants/issue"; @@ -88,7 +88,7 @@ export interface IList { quickActions: (group_by: string | null, issue: IIssue) => React.ReactNode; displayProperties: IIssueDisplayProperties; states: IState[] | null; - labels: IIssueLabels[] | null; + labels: IIssueLabel[] | null; members: IUserLite[] | null; projects: IProject[] | null; stateGroups: any; diff --git a/web/components/issues/issue-layouts/list/roots/archived-issue-root.tsx b/web/components/issues/issue-layouts/list/roots/archived-issue-root.tsx index 396f7b508..a029ceda2 100644 --- a/web/components/issues/issue-layouts/list/roots/archived-issue-root.tsx +++ b/web/components/issues/issue-layouts/list/roots/archived-issue-root.tsx @@ -19,6 +19,7 @@ export const ArchivedIssueListLayout: FC = observer(() => { const { project: projectStore, + projectLabel: { projectLabels }, projectMember: { projectMembers }, projectState: projectStateStore, archivedIssues: archivedIssueStore, @@ -42,7 +43,6 @@ export const ArchivedIssueListLayout: FC = observer(() => { const states = projectStateStore?.projectStates || null; const priorities = ISSUE_PRIORITIES || null; - const labels = projectStore?.projectLabels || null; const stateGroups = ISSUE_STATE_GROUPS || null; const projects = workspaceSlug ? projectStore?.projects[workspaceSlug.toString()] || null : null; const estimates = @@ -64,7 +64,7 @@ export const ArchivedIssueListLayout: FC = observer(() => { states={states} stateGroups={stateGroups} priorities={priorities} - labels={labels} + labels={projectLabels} members={projectMembers?.map((m) => m.member) ?? null} projects={projects} estimates={estimates?.points ? orderArrayBy(estimates.points, "key") : null} diff --git a/web/components/issues/issue-layouts/list/roots/cycle-root.tsx b/web/components/issues/issue-layouts/list/roots/cycle-root.tsx index 608607ab8..b92a57fa8 100644 --- a/web/components/issues/issue-layouts/list/roots/cycle-root.tsx +++ b/web/components/issues/issue-layouts/list/roots/cycle-root.tsx @@ -21,6 +21,7 @@ export const CycleListLayout: React.FC = observer(() => { // store const { project: projectStore, + projectLabel: { projectLabels }, projectMember: { projectMembers }, projectState: projectStateStore, issueFilter: issueFilterStore, @@ -59,7 +60,6 @@ export const CycleListLayout: React.FC = observer(() => { const states = projectStateStore?.projectStates || null; const priorities = ISSUE_PRIORITIES || null; - const labels = projectStore?.projectLabels || null; const stateGroups = ISSUE_STATE_GROUPS || null; const projects = workspaceSlug ? projectStore?.projects[workspaceSlug.toString()] || null : null; const estimates = @@ -85,7 +85,7 @@ export const CycleListLayout: React.FC = observer(() => { states={states} stateGroups={stateGroups} priorities={priorities} - labels={labels} + labels={projectLabels} members={projectMembers?.map((m) => m.member) ?? null} projects={projects} estimates={estimates?.points ? orderArrayBy(estimates.points, "key") : null} diff --git a/web/components/issues/issue-layouts/list/roots/module-root.tsx b/web/components/issues/issue-layouts/list/roots/module-root.tsx index 1619112f1..7fa1f4718 100644 --- a/web/components/issues/issue-layouts/list/roots/module-root.tsx +++ b/web/components/issues/issue-layouts/list/roots/module-root.tsx @@ -21,6 +21,7 @@ export const ModuleListLayout: React.FC = observer(() => { const { project: projectStore, + projectLabel: { projectLabels }, projectMember: { projectMembers }, projectState: projectStateStore, issueFilter: issueFilterStore, @@ -59,7 +60,6 @@ export const ModuleListLayout: React.FC = observer(() => { const states = projectStateStore?.projectStates || null; const priorities = ISSUE_PRIORITIES || null; - const labels = projectStore?.projectLabels || null; const stateGroups = ISSUE_STATE_GROUPS || null; const projects = workspaceSlug ? projectStore?.projects[workspaceSlug.toString()] || null : null; const estimates = @@ -85,7 +85,7 @@ export const ModuleListLayout: React.FC = observer(() => { states={states} stateGroups={stateGroups} priorities={priorities} - labels={labels} + labels={projectLabels} members={projectMembers?.map((m) => m.member) ?? null} projects={projects} estimates={estimates?.points ? orderArrayBy(estimates.points, "key") : null} diff --git a/web/components/issues/issue-layouts/list/roots/project-root.tsx b/web/components/issues/issue-layouts/list/roots/project-root.tsx index beec14008..cc78145f0 100644 --- a/web/components/issues/issue-layouts/list/roots/project-root.tsx +++ b/web/components/issues/issue-layouts/list/roots/project-root.tsx @@ -20,6 +20,7 @@ export const ListLayout: FC = observer(() => { // store const { project: projectStore, + projectLabel: { projectLabels }, projectMember: { projectMembers }, projectState: projectStateStore, issue: issueStore, @@ -49,7 +50,6 @@ export const ListLayout: FC = observer(() => { const states = projectStateStore?.projectStates || null; const priorities = ISSUE_PRIORITIES || null; - const labels = projectStore?.projectLabels || null; const stateGroups = ISSUE_STATE_GROUPS || null; const projects = workspaceSlug ? projectStore?.projects[workspaceSlug.toString()] || null : null; const estimates = @@ -80,7 +80,7 @@ export const ListLayout: FC = observer(() => { states={states} stateGroups={stateGroups} priorities={priorities} - labels={labels} + labels={projectLabels} members={projectMembers?.map((m) => m.member) ?? null} projects={projects} enableQuickIssueCreate diff --git a/web/components/issues/issue-layouts/list/roots/project-view-root.tsx b/web/components/issues/issue-layouts/list/roots/project-view-root.tsx index a5dc76352..66c2828a8 100644 --- a/web/components/issues/issue-layouts/list/roots/project-view-root.tsx +++ b/web/components/issues/issue-layouts/list/roots/project-view-root.tsx @@ -30,7 +30,7 @@ export const ProjectViewListLayout: React.FC = observer(() => { const states = projectStateStore?.projectStates || null; const priorities = ISSUE_PRIORITIES || null; - const labels = projectStore?.projectLabels || null; + // const labels = projectStore?.projectLabels || null; const stateGroups = ISSUE_STATE_GROUPS || null; const projects = projectStateStore?.projectStates || null; const estimates = null; diff --git a/web/components/issues/issue-layouts/properties/labels.tsx b/web/components/issues/issue-layouts/properties/labels.tsx index 16589bf2d..2d1411196 100644 --- a/web/components/issues/issue-layouts/properties/labels.tsx +++ b/web/components/issues/issue-layouts/properties/labels.tsx @@ -1,8 +1,6 @@ import { Fragment, useState } from "react"; - import { observer } from "mobx-react-lite"; import { useMobxStore } from "lib/mobx/store-provider"; - // hooks import { usePopper } from "react-popper"; // components @@ -44,7 +42,10 @@ export const IssuePropertyLabels: React.FC = observer((pro noLabelBorder = false, } = props; - const { workspace: workspaceStore, project: projectStore }: RootStore = useMobxStore(); + const { + workspace: workspaceStore, + projectLabel: { fetchProjectLabels, projectLabels }, + }: RootStore = useMobxStore(); const workspaceSlug = workspaceStore?.workspaceSlug; const [query, setQuery] = useState(""); @@ -53,12 +54,9 @@ export const IssuePropertyLabels: React.FC = observer((pro const [popperElement, setPopperElement] = useState(null); const [isLoading, setIsLoading] = useState(false); - const projectLabels = projectId && projectStore?.labels?.[projectId]; - - const fetchProjectLabels = () => { + const fetchLabels = () => { setIsLoading(true); - if (workspaceSlug && projectId) - projectStore.fetchProjectLabels(workspaceSlug, projectId).then(() => setIsLoading(false)); + if (workspaceSlug && projectId) fetchProjectLabels(workspaceSlug, projectId).then(() => setIsLoading(false)); }; const options = (projectLabels ? projectLabels : []).map((label) => ({ @@ -169,7 +167,7 @@ export const IssuePropertyLabels: React.FC = observer((pro ? "cursor-pointer" : "cursor-pointer hover:bg-custom-background-80" } ${buttonClassName}`} - onClick={() => !projectLabels && fetchProjectLabels()} + onClick={() => !projectLabels && fetchLabels()} > {label} {!hideDropdownArrow && !disabled &&