From ec7dfde3413f4056e50ac853b4b2545d77b032a7 Mon Sep 17 00:00:00 2001 From: Atul Tameshwari Date: Fri, 19 Jun 2026 15:53:03 +0530 Subject: [PATCH 1/7] refactor: remove unused store files and update import paths across the application --- apps/web/ce/store/analytics.store.ts | 15 ------------- apps/web/ce/store/cycle/index.ts | 7 ------ apps/web/ce/store/global-view.store.ts | 7 ------ .../store/issue/issue-details/root.store.ts | 22 ------------------- apps/web/ce/store/power-k.store.ts | 19 ---------------- apps/web/ce/store/project-inbox.store.ts | 7 ------ apps/web/ce/store/project-view.store.ts | 7 ------ apps/web/ce/store/state.store.ts | 7 ------ apps/web/core/hooks/store/use-analytics.ts | 2 +- apps/web/core/hooks/store/use-cycle.ts | 2 +- apps/web/core/hooks/store/use-global-view.ts | 2 +- apps/web/core/hooks/store/use-issue-detail.ts | 2 +- apps/web/core/hooks/store/use-power-k.ts | 2 +- .../web/core/hooks/store/use-project-inbox.ts | 2 +- .../web/core/hooks/store/use-project-state.ts | 2 +- apps/web/core/hooks/store/use-project-view.ts | 2 +- .../store/issue/issue-details/root.store.ts | 2 +- apps/web/core/store/issue/root.store.ts | 4 ++-- apps/web/core/store/pages/base-page.ts | 2 +- .../store/pages/extended-base-page.ts | 6 ++--- apps/web/core/store/root.store.ts | 12 +++++----- 21 files changed, 21 insertions(+), 112 deletions(-) delete mode 100644 apps/web/ce/store/analytics.store.ts delete mode 100644 apps/web/ce/store/cycle/index.ts delete mode 100644 apps/web/ce/store/global-view.store.ts delete mode 100644 apps/web/ce/store/issue/issue-details/root.store.ts delete mode 100644 apps/web/ce/store/power-k.store.ts delete mode 100644 apps/web/ce/store/project-inbox.store.ts delete mode 100644 apps/web/ce/store/project-view.store.ts delete mode 100644 apps/web/ce/store/state.store.ts rename apps/web/{ce => core}/store/pages/extended-base-page.ts (69%) diff --git a/apps/web/ce/store/analytics.store.ts b/apps/web/ce/store/analytics.store.ts deleted file mode 100644 index 9ae14f9b658..00000000000 --- a/apps/web/ce/store/analytics.store.ts +++ /dev/null @@ -1,15 +0,0 @@ -/** - * Copyright (c) 2023-present Plane Software, Inc. and contributors - * SPDX-License-Identifier: AGPL-3.0-only - * See the LICENSE file for details. - */ - -import type { IBaseAnalyticsStore } from "@/store/analytics.store"; -import { BaseAnalyticsStore } from "@/store/analytics.store"; - -// eslint-disable-next-line @typescript-eslint/no-empty-object-type -export interface IAnalyticsStore extends IBaseAnalyticsStore { - //observables -} - -export class AnalyticsStore extends BaseAnalyticsStore {} diff --git a/apps/web/ce/store/cycle/index.ts b/apps/web/ce/store/cycle/index.ts deleted file mode 100644 index 884a0e71b8b..00000000000 --- a/apps/web/ce/store/cycle/index.ts +++ /dev/null @@ -1,7 +0,0 @@ -/** - * Copyright (c) 2023-present Plane Software, Inc. and contributors - * SPDX-License-Identifier: AGPL-3.0-only - * See the LICENSE file for details. - */ - -export type { ICycleStore } from "@/store/cycle.store"; diff --git a/apps/web/ce/store/global-view.store.ts b/apps/web/ce/store/global-view.store.ts deleted file mode 100644 index 069b4fcd350..00000000000 --- a/apps/web/ce/store/global-view.store.ts +++ /dev/null @@ -1,7 +0,0 @@ -/** - * Copyright (c) 2023-present Plane Software, Inc. and contributors - * SPDX-License-Identifier: AGPL-3.0-only - * See the LICENSE file for details. - */ - -export * from "@/store/global-view.store"; diff --git a/apps/web/ce/store/issue/issue-details/root.store.ts b/apps/web/ce/store/issue/issue-details/root.store.ts deleted file mode 100644 index 1b96b49e1d6..00000000000 --- a/apps/web/ce/store/issue/issue-details/root.store.ts +++ /dev/null @@ -1,22 +0,0 @@ -/** - * Copyright (c) 2023-present Plane Software, Inc. and contributors - * SPDX-License-Identifier: AGPL-3.0-only - * See the LICENSE file for details. - */ - -import { makeObservable } from "mobx"; -import type { TIssueServiceType } from "@plane/types"; -import type { IIssueDetail as IIssueDetailCore } from "@/store/issue/issue-details/root.store"; -import { IssueDetail as IssueDetailCore } from "@/store/issue/issue-details/root.store"; -import type { IIssueRootStore } from "@/store/issue/root.store"; - -export type IIssueDetail = IIssueDetailCore; - -export class IssueDetail extends IssueDetailCore { - constructor(rootStore: IIssueRootStore, serviceType: TIssueServiceType) { - super(rootStore, serviceType); - makeObservable(this, { - // observables - }); - } -} diff --git a/apps/web/ce/store/power-k.store.ts b/apps/web/ce/store/power-k.store.ts deleted file mode 100644 index 9528c5e1664..00000000000 --- a/apps/web/ce/store/power-k.store.ts +++ /dev/null @@ -1,19 +0,0 @@ -/** - * Copyright (c) 2023-present Plane Software, Inc. and contributors - * SPDX-License-Identifier: AGPL-3.0-only - * See the LICENSE file for details. - */ - -import { makeObservable } from "mobx"; -// types -import type { IBasePowerKStore } from "@/store/base-power-k.store"; -import { BasePowerKStore } from "@/store/base-power-k.store"; - -export type IPowerKStore = IBasePowerKStore; - -export class PowerKStore extends BasePowerKStore implements IPowerKStore { - constructor() { - super(); - makeObservable(this, {}); - } -} diff --git a/apps/web/ce/store/project-inbox.store.ts b/apps/web/ce/store/project-inbox.store.ts deleted file mode 100644 index 3adbb186273..00000000000 --- a/apps/web/ce/store/project-inbox.store.ts +++ /dev/null @@ -1,7 +0,0 @@ -/** - * Copyright (c) 2023-present Plane Software, Inc. and contributors - * SPDX-License-Identifier: AGPL-3.0-only - * See the LICENSE file for details. - */ - -export * from "@/store/inbox/project-inbox.store"; diff --git a/apps/web/ce/store/project-view.store.ts b/apps/web/ce/store/project-view.store.ts deleted file mode 100644 index 0763fb66532..00000000000 --- a/apps/web/ce/store/project-view.store.ts +++ /dev/null @@ -1,7 +0,0 @@ -/** - * Copyright (c) 2023-present Plane Software, Inc. and contributors - * SPDX-License-Identifier: AGPL-3.0-only - * See the LICENSE file for details. - */ - -export * from "@/store/project-view.store"; diff --git a/apps/web/ce/store/state.store.ts b/apps/web/ce/store/state.store.ts deleted file mode 100644 index b27221268a6..00000000000 --- a/apps/web/ce/store/state.store.ts +++ /dev/null @@ -1,7 +0,0 @@ -/** - * Copyright (c) 2023-present Plane Software, Inc. and contributors - * SPDX-License-Identifier: AGPL-3.0-only - * See the LICENSE file for details. - */ - -export * from "@/store/state.store"; diff --git a/apps/web/core/hooks/store/use-analytics.ts b/apps/web/core/hooks/store/use-analytics.ts index 6982f28c453..2ec50a6d663 100644 --- a/apps/web/core/hooks/store/use-analytics.ts +++ b/apps/web/core/hooks/store/use-analytics.ts @@ -8,7 +8,7 @@ import { useContext } from "react"; // mobx store import { StoreContext } from "@/lib/store-context"; // types -import type { IAnalyticsStore } from "@/plane-web/store/analytics.store"; +import type { IBaseAnalyticsStore as IAnalyticsStore } from "@/store/analytics.store"; export const useAnalytics = (): IAnalyticsStore => { const context = useContext(StoreContext); diff --git a/apps/web/core/hooks/store/use-cycle.ts b/apps/web/core/hooks/store/use-cycle.ts index 810b9406878..7e22fc80cfc 100644 --- a/apps/web/core/hooks/store/use-cycle.ts +++ b/apps/web/core/hooks/store/use-cycle.ts @@ -8,7 +8,7 @@ import { useContext } from "react"; // mobx store import { StoreContext } from "@/lib/store-context"; // types -import type { ICycleStore } from "@/plane-web/store/cycle"; +import type { ICycleStore } from "@/store/cycle.store"; export const useCycle = (): ICycleStore => { const context = useContext(StoreContext); diff --git a/apps/web/core/hooks/store/use-global-view.ts b/apps/web/core/hooks/store/use-global-view.ts index 10ef617a17d..e8ece7daf5a 100644 --- a/apps/web/core/hooks/store/use-global-view.ts +++ b/apps/web/core/hooks/store/use-global-view.ts @@ -8,7 +8,7 @@ import { useContext } from "react"; // mobx store import { StoreContext } from "@/lib/store-context"; // types -import type { IGlobalViewStore } from "@/plane-web/store/global-view.store"; +import type { IGlobalViewStore } from "@/store/global-view.store"; export const useGlobalView = (): IGlobalViewStore => { const context = useContext(StoreContext); diff --git a/apps/web/core/hooks/store/use-issue-detail.ts b/apps/web/core/hooks/store/use-issue-detail.ts index 1d83949f860..a8a4f8a7811 100644 --- a/apps/web/core/hooks/store/use-issue-detail.ts +++ b/apps/web/core/hooks/store/use-issue-detail.ts @@ -10,7 +10,7 @@ import { EIssueServiceType } from "@plane/types"; // mobx store import { StoreContext } from "@/lib/store-context"; // types -import type { IIssueDetail } from "@/plane-web/store/issue/issue-details/root.store"; +import type { IIssueDetail } from "@/store/issue/issue-details/root.store"; export const useIssueDetail = (serviceType: TIssueServiceType = EIssueServiceType.ISSUES): IIssueDetail => { const context = useContext(StoreContext); diff --git a/apps/web/core/hooks/store/use-power-k.ts b/apps/web/core/hooks/store/use-power-k.ts index 5a5025d3a5a..e6597cfae20 100644 --- a/apps/web/core/hooks/store/use-power-k.ts +++ b/apps/web/core/hooks/store/use-power-k.ts @@ -8,7 +8,7 @@ import { useContext } from "react"; // mobx store import { StoreContext } from "@/lib/store-context"; // types -import type { IPowerKStore } from "@/plane-web/store/power-k.store"; +import type { IBasePowerKStore as IPowerKStore } from "@/store/base-power-k.store"; export const usePowerK = (): IPowerKStore => { const context = useContext(StoreContext); diff --git a/apps/web/core/hooks/store/use-project-inbox.ts b/apps/web/core/hooks/store/use-project-inbox.ts index 18296aa7656..6b452359094 100644 --- a/apps/web/core/hooks/store/use-project-inbox.ts +++ b/apps/web/core/hooks/store/use-project-inbox.ts @@ -7,7 +7,7 @@ import { useContext } from "react"; // mobx store import { StoreContext } from "@/lib/store-context"; -import type { IProjectInboxStore } from "@/plane-web/store/project-inbox.store"; +import type { IProjectInboxStore } from "@/store/inbox/project-inbox.store"; export const useProjectInbox = (): IProjectInboxStore => { const context = useContext(StoreContext); diff --git a/apps/web/core/hooks/store/use-project-state.ts b/apps/web/core/hooks/store/use-project-state.ts index 3bfbf2b82c5..3221bf136b1 100644 --- a/apps/web/core/hooks/store/use-project-state.ts +++ b/apps/web/core/hooks/store/use-project-state.ts @@ -8,7 +8,7 @@ import { useContext } from "react"; // mobx store import { StoreContext } from "@/lib/store-context"; // Plane-web -import type { IStateStore } from "@/plane-web/store/state.store"; +import type { IStateStore } from "@/store/state.store"; export const useProjectState = (): IStateStore => { const context = useContext(StoreContext); diff --git a/apps/web/core/hooks/store/use-project-view.ts b/apps/web/core/hooks/store/use-project-view.ts index d26dc0ee45c..b552947ffe1 100644 --- a/apps/web/core/hooks/store/use-project-view.ts +++ b/apps/web/core/hooks/store/use-project-view.ts @@ -8,7 +8,7 @@ import { useContext } from "react"; // mobx store import { StoreContext } from "@/lib/store-context"; // types -import type { IProjectViewStore } from "@/plane-web/store/project-view.store"; +import type { IProjectViewStore } from "@/store/project-view.store"; export const useProjectView = (): IProjectViewStore => { const context = useContext(StoreContext); diff --git a/apps/web/core/store/issue/issue-details/root.store.ts b/apps/web/core/store/issue/issue-details/root.store.ts index c8688e362fb..89eb5c389a5 100644 --- a/apps/web/core/store/issue/issue-details/root.store.ts +++ b/apps/web/core/store/issue/issue-details/root.store.ts @@ -126,7 +126,7 @@ export interface IIssueDetail relation: IIssueRelationStore; } -export abstract class IssueDetail implements IIssueDetail { +export class IssueDetail implements IIssueDetail { // observables peekIssue: TPeekIssue | undefined = undefined; relationKey: TIssueRelationTypes | null = null; diff --git a/apps/web/core/store/issue/root.store.ts b/apps/web/core/store/issue/root.store.ts index d8632f311d5..13de55c7c3a 100644 --- a/apps/web/core/store/issue/root.store.ts +++ b/apps/web/core/store/issue/root.store.ts @@ -12,8 +12,8 @@ import { EIssueServiceType } from "@plane/types"; // plane web store import type { IProjectEpics, IProjectEpicsFilter } from "@/plane-web/store/issue/epic"; import { ProjectEpics, ProjectEpicsFilter } from "@/plane-web/store/issue/epic"; -import type { IIssueDetail } from "@/plane-web/store/issue/issue-details/root.store"; -import { IssueDetail } from "@/plane-web/store/issue/issue-details/root.store"; +import type { IIssueDetail } from "@/store/issue/issue-details/root.store"; +import { IssueDetail } from "@/store/issue/issue-details/root.store"; import type { ITeamIssuesFilter, ITeamIssues } from "@/plane-web/store/issue/team"; import { TeamIssues, TeamIssuesFilter } from "@/plane-web/store/issue/team"; import type { ITeamProjectWorkItemsFilter } from "@/plane-web/store/issue/team-project/filter.store"; diff --git a/apps/web/core/store/pages/base-page.ts b/apps/web/core/store/pages/base-page.ts index 1cde3950bf5..05a994aa55e 100644 --- a/apps/web/core/store/pages/base-page.ts +++ b/apps/web/core/store/pages/base-page.ts @@ -11,7 +11,7 @@ import { EPageAccess } from "@plane/constants"; import type { TChangeHandlerProps } from "@plane/propel/emoji-icon-picker"; import type { TDocumentPayload, TLogoProps, TNameDescriptionLoader, TPage } from "@plane/types"; // plane web store -import { ExtendedBasePage } from "@/plane-web/store/pages/extended-base-page"; +import { ExtendedBasePage } from "@/store/pages/extended-base-page"; import type { RootStore } from "@/plane-web/store/root.store"; // local imports import { PageEditorInstance } from "./page-editor-info"; diff --git a/apps/web/ce/store/pages/extended-base-page.ts b/apps/web/core/store/pages/extended-base-page.ts similarity index 69% rename from apps/web/ce/store/pages/extended-base-page.ts rename to apps/web/core/store/pages/extended-base-page.ts index 3144ef647b8..b9890d8aa8a 100644 --- a/apps/web/ce/store/pages/extended-base-page.ts +++ b/apps/web/core/store/pages/extended-base-page.ts @@ -5,7 +5,7 @@ */ import type { TPage, TPageExtended } from "@plane/types"; -import type { RootStore } from "@/plane-web/store/root.store"; +import type { CoreRootStore } from "@/store/root.store"; import type { TBasePageServices } from "@/store/pages/base-page"; export type TExtendedPageInstance = TPageExtended & { @@ -13,8 +13,8 @@ export type TExtendedPageInstance = TPageExtended & { }; export class ExtendedBasePage implements TExtendedPageInstance { - // eslint-disable-next-line @typescript-eslint/no-unused-vars - constructor(store: RootStore, page: TPage, services: TBasePageServices) {} + // oxlint-disable-next-line no-useless-constructor oxlint-disable-next-line no-unused-vars + constructor(store: CoreRootStore, page: TPage, services: TBasePageServices) {} get asJSONExtended(): TExtendedPageInstance["asJSONExtended"] { return {}; diff --git a/apps/web/core/store/root.store.ts b/apps/web/core/store/root.store.ts index 3b950a9c645..ed908fe8b0f 100644 --- a/apps/web/core/store/root.store.ts +++ b/apps/web/core/store/root.store.ts @@ -10,15 +10,15 @@ import { FALLBACK_LANGUAGE, setLanguage } from "@plane/i18n"; import type { IWorkItemFilterStore } from "@plane/shared-state"; import { WorkItemFilterStore } from "@plane/shared-state"; // plane web store -import type { IAnalyticsStore } from "@/plane-web/store/analytics.store"; -import { AnalyticsStore } from "@/plane-web/store/analytics.store"; +import type { IBaseAnalyticsStore as IAnalyticsStore } from "@/store/analytics.store"; +import { BaseAnalyticsStore as AnalyticsStore } from "@/store/analytics.store"; +import type { IBasePowerKStore as IPowerKStore } from "@/store/base-power-k.store"; +import { BasePowerKStore as PowerKStore } from "@/store/base-power-k.store"; +import type { IStateStore } from "@/store/state.store"; +import { StateStore } from "@/store/state.store"; import type { ICommandPaletteStore } from "@/plane-web/store/command-palette.store"; import { CommandPaletteStore } from "@/plane-web/store/command-palette.store"; -import { PowerKStore } from "@/plane-web/store/power-k.store"; -import type { IPowerKStore } from "@/plane-web/store/power-k.store"; import type { RootStore } from "@/plane-web/store/root.store"; -import type { IStateStore } from "@/plane-web/store/state.store"; -import { StateStore } from "@/plane-web/store/state.store"; import { WorkspaceRootStore } from "@/plane-web/store/workspace"; // stores import type { ICycleStore } from "./cycle.store"; From c68728c570e73b7b256c7871d6369b7851b81f16 Mon Sep 17 00:00:00 2001 From: Atul Tameshwari Date: Fri, 19 Jun 2026 16:11:53 +0530 Subject: [PATCH 2/7] refactor: remove unused store files and update import paths across the core module --- apps/web/ce/store/command-palette.store.ts | 33 ------------ .../store/issue/helpers/base-issue-store.ts | 10 ---- .../store/issue/helpers/base-issue.store.ts | 10 ---- .../ce/store/issue/helpers/filter-utils.ts | 9 ---- .../ce/store/member/project-member.store.ts | 50 ------------------- apps/web/ce/store/user/permission.store.ts | 34 ------------- apps/web/ce/store/workspace/index.ts | 24 --------- .../hooks/store/estimates/use-estimate.ts | 2 +- .../core/hooks/store/use-command-palette.ts | 2 +- .../core/hooks/store/user/user-permissions.ts | 2 +- apps/web/core/store/analytics.store.ts | 2 +- .../core/store/base-command-palette.store.ts | 15 +++++- apps/web/core/store/base-power-k.store.ts | 2 +- .../{ce => core}/store/estimates/estimate.ts | 7 --- .../store/estimates/project-estimate.store.ts | 4 +- .../store/issue/helpers/base-issues.store.ts | 18 ++++++- .../helpers/issue-filter-helper.store.ts | 4 +- .../issue/issue-details/activity.store.ts | 2 +- .../store/issue/issue-details/root.store.ts | 4 +- apps/web/core/store/member/index.ts | 4 +- .../project/base-project-member.store.ts | 23 +++++---- apps/web/core/store/root.store.ts | 6 +-- .../core/store/user/base-permissions.store.ts | 18 ++++--- apps/web/core/store/user/index.ts | 4 +- apps/web/core/store/workspace/index.ts | 11 ++-- 25 files changed, 81 insertions(+), 219 deletions(-) delete mode 100644 apps/web/ce/store/command-palette.store.ts delete mode 100644 apps/web/ce/store/issue/helpers/base-issue-store.ts delete mode 100644 apps/web/ce/store/issue/helpers/base-issue.store.ts delete mode 100644 apps/web/ce/store/issue/helpers/filter-utils.ts delete mode 100644 apps/web/ce/store/member/project-member.store.ts delete mode 100644 apps/web/ce/store/user/permission.store.ts delete mode 100644 apps/web/ce/store/workspace/index.ts rename apps/web/{ce => core}/store/estimates/estimate.ts (95%) rename apps/web/{ce => core}/store/issue/issue-details/activity.store.ts (99%) diff --git a/apps/web/ce/store/command-palette.store.ts b/apps/web/ce/store/command-palette.store.ts deleted file mode 100644 index 9d5ff8a01de..00000000000 --- a/apps/web/ce/store/command-palette.store.ts +++ /dev/null @@ -1,33 +0,0 @@ -/** - * Copyright (c) 2023-present Plane Software, Inc. and contributors - * SPDX-License-Identifier: AGPL-3.0-only - * See the LICENSE file for details. - */ - -import { computed, makeObservable } from "mobx"; -// types / constants -import type { IBaseCommandPaletteStore } from "@/store/base-command-palette.store"; -import { BaseCommandPaletteStore } from "@/store/base-command-palette.store"; - -export interface ICommandPaletteStore extends IBaseCommandPaletteStore { - // computed - isAnyModalOpen: boolean; -} - -export class CommandPaletteStore extends BaseCommandPaletteStore implements ICommandPaletteStore { - constructor() { - super(); - makeObservable(this, { - // computed - isAnyModalOpen: computed, - }); - } - - /** - * Checks whether any modal is open or not in the base command palette. - * @returns boolean - */ - get isAnyModalOpen(): boolean { - return Boolean(super.getCoreModalsState()); - } -} diff --git a/apps/web/ce/store/issue/helpers/base-issue-store.ts b/apps/web/ce/store/issue/helpers/base-issue-store.ts deleted file mode 100644 index 236235a8256..00000000000 --- a/apps/web/ce/store/issue/helpers/base-issue-store.ts +++ /dev/null @@ -1,10 +0,0 @@ -/** - * Copyright (c) 2023-present Plane Software, Inc. and contributors - * SPDX-License-Identifier: AGPL-3.0-only - * See the LICENSE file for details. - */ - -import type { TIssue } from "@plane/types"; -import { getIssueIds } from "@/store/issue/helpers/base-issues-utils"; - -export const workItemSortWithOrderByExtended = (array: TIssue[], _key?: string) => getIssueIds(array); diff --git a/apps/web/ce/store/issue/helpers/base-issue.store.ts b/apps/web/ce/store/issue/helpers/base-issue.store.ts deleted file mode 100644 index 236235a8256..00000000000 --- a/apps/web/ce/store/issue/helpers/base-issue.store.ts +++ /dev/null @@ -1,10 +0,0 @@ -/** - * Copyright (c) 2023-present Plane Software, Inc. and contributors - * SPDX-License-Identifier: AGPL-3.0-only - * See the LICENSE file for details. - */ - -import type { TIssue } from "@plane/types"; -import { getIssueIds } from "@/store/issue/helpers/base-issues-utils"; - -export const workItemSortWithOrderByExtended = (array: TIssue[], _key?: string) => getIssueIds(array); diff --git a/apps/web/ce/store/issue/helpers/filter-utils.ts b/apps/web/ce/store/issue/helpers/filter-utils.ts deleted file mode 100644 index 66ce7435503..00000000000 --- a/apps/web/ce/store/issue/helpers/filter-utils.ts +++ /dev/null @@ -1,9 +0,0 @@ -/** - * Copyright (c) 2023-present Plane Software, Inc. and contributors - * SPDX-License-Identifier: AGPL-3.0-only - * See the LICENSE file for details. - */ - -import type { IIssueDisplayFilterOptions } from "@plane/types"; - -export const getEnabledDisplayFilters = (displayFilters: IIssueDisplayFilterOptions) => displayFilters; diff --git a/apps/web/ce/store/member/project-member.store.ts b/apps/web/ce/store/member/project-member.store.ts deleted file mode 100644 index 6f534a150f3..00000000000 --- a/apps/web/ce/store/member/project-member.store.ts +++ /dev/null @@ -1,50 +0,0 @@ -/** - * Copyright (c) 2023-present Plane Software, Inc. and contributors - * SPDX-License-Identifier: AGPL-3.0-only - * See the LICENSE file for details. - */ - -import { computedFn } from "mobx-utils"; -import type { EUserProjectRoles } from "@plane/types"; -// plane imports -// plane web imports -import type { RootStore } from "@/plane-web/store/root.store"; -// store -import type { IMemberRootStore } from "@/store/member"; -import type { IBaseProjectMemberStore } from "@/store/member/project/base-project-member.store"; -import { BaseProjectMemberStore } from "@/store/member/project/base-project-member.store"; - -export type IProjectMemberStore = IBaseProjectMemberStore; - -export class ProjectMemberStore extends BaseProjectMemberStore implements IProjectMemberStore { - constructor(_memberRoot: IMemberRootStore, rootStore: RootStore) { - super(_memberRoot, rootStore); - } - - /** - * @description Returns the highest role from the project membership - * @param { string } userId - * @param { string } projectId - * @returns { EUserProjectRoles | undefined } - */ - getUserProjectRole = computedFn((userId: string, projectId: string): EUserProjectRoles | undefined => - this.getRoleFromProjectMembership(userId, projectId) - ); - - /** - * @description Returns the role from the project membership - * @param projectId - * @param userId - * @param role - */ - getProjectMemberRoleForUpdate = (_projectId: string, _userId: string, role: EUserProjectRoles): EUserProjectRoles => - role; - - /** - * @description Processes the removal of a member from a project - * This method handles the cleanup of member data from the project member map - * @param projectId - The ID of the project to remove the member from - * @param userId - The ID of the user to remove from the project - */ - processMemberRemoval = (projectId: string, userId: string) => this.handleMemberRemoval(projectId, userId); -} diff --git a/apps/web/ce/store/user/permission.store.ts b/apps/web/ce/store/user/permission.store.ts deleted file mode 100644 index 42b5dd4cca7..00000000000 --- a/apps/web/ce/store/user/permission.store.ts +++ /dev/null @@ -1,34 +0,0 @@ -/** - * Copyright (c) 2023-present Plane Software, Inc. and contributors - * SPDX-License-Identifier: AGPL-3.0-only - * See the LICENSE file for details. - */ - -import { computedFn } from "mobx-utils"; -import type { EUserPermissions } from "@plane/constants"; -import type { RootStore } from "@/plane-web/store/root.store"; -import { BaseUserPermissionStore } from "@/store/user/base-permissions.store"; -import type { IBaseUserPermissionStore } from "@/store/user/base-permissions.store"; - -export type IUserPermissionStore = IBaseUserPermissionStore; - -export class UserPermissionStore extends BaseUserPermissionStore implements IUserPermissionStore { - constructor(store: RootStore) { - super(store); - } - - /** - * @description Returns the project role from the workspace - * @param { string } workspaceSlug - * @param { string } projectId - * @returns { EUserPermissions | undefined } - */ - getProjectRoleByWorkspaceSlugAndProjectId = computedFn( - (workspaceSlug: string, projectId?: string): EUserPermissions | undefined => - this.getProjectRole(workspaceSlug, projectId) - ); - - fetchWorkspaceLevelProjectEntities = (workspaceSlug: string, projectId: string): void => { - void this.store.projectRoot.project.fetchProjectDetails(workspaceSlug, projectId); - }; -} diff --git a/apps/web/ce/store/workspace/index.ts b/apps/web/ce/store/workspace/index.ts deleted file mode 100644 index b2745636455..00000000000 --- a/apps/web/ce/store/workspace/index.ts +++ /dev/null @@ -1,24 +0,0 @@ -/** - * Copyright (c) 2023-present Plane Software, Inc. and contributors - * SPDX-License-Identifier: AGPL-3.0-only - * See the LICENSE file for details. - */ - -// store -import { BaseWorkspaceRootStore } from "@/store/workspace"; -import type { RootStore } from "@/plane-web/store/root.store"; - -export class WorkspaceRootStore extends BaseWorkspaceRootStore { - constructor(_rootStore: RootStore) { - super(_rootStore); - } - - // actions - /** - * Mutate workspace members activity - * @param workspaceSlug - */ - mutateWorkspaceMembersActivity = async (_workspaceSlug: string) => { - // No-op in default/CE version - }; -} diff --git a/apps/web/core/hooks/store/estimates/use-estimate.ts b/apps/web/core/hooks/store/estimates/use-estimate.ts index e01f3f44ddf..2a6604961f0 100644 --- a/apps/web/core/hooks/store/estimates/use-estimate.ts +++ b/apps/web/core/hooks/store/estimates/use-estimate.ts @@ -8,7 +8,7 @@ import { useContext } from "react"; // mobx store import { StoreContext } from "@/lib/store-context"; // mobx store -import type { IEstimate } from "@/plane-web/store/estimates/estimate"; +import type { IEstimate } from "@/store/estimates/estimate"; export const useEstimate = (estimateId: string | undefined): IEstimate => { const context = useContext(StoreContext); diff --git a/apps/web/core/hooks/store/use-command-palette.ts b/apps/web/core/hooks/store/use-command-palette.ts index e08e2b76534..88692735c13 100644 --- a/apps/web/core/hooks/store/use-command-palette.ts +++ b/apps/web/core/hooks/store/use-command-palette.ts @@ -8,7 +8,7 @@ import { useContext } from "react"; // mobx store import { StoreContext } from "@/lib/store-context"; // types -import type { ICommandPaletteStore } from "@/plane-web/store/command-palette.store"; +import type { ICommandPaletteStore } from "@/store/base-command-palette.store"; export const useCommandPalette = (): ICommandPaletteStore => { const context = useContext(StoreContext); diff --git a/apps/web/core/hooks/store/user/user-permissions.ts b/apps/web/core/hooks/store/user/user-permissions.ts index 548e2aaafe8..e53296050e3 100644 --- a/apps/web/core/hooks/store/user/user-permissions.ts +++ b/apps/web/core/hooks/store/user/user-permissions.ts @@ -8,7 +8,7 @@ import { useContext } from "react"; // mobx store import { StoreContext } from "@/lib/store-context"; // plane web imports -import type { IUserPermissionStore } from "@/plane-web/store/user/permission.store"; +import type { IUserPermissionStore } from "@/store/user/base-permissions.store"; export const useUserPermissions = (): IUserPermissionStore => { const context = useContext(StoreContext); diff --git a/apps/web/core/store/analytics.store.ts b/apps/web/core/store/analytics.store.ts index ca1ffc1409a..b7e122c3174 100644 --- a/apps/web/core/store/analytics.store.ts +++ b/apps/web/core/store/analytics.store.ts @@ -31,7 +31,7 @@ export interface IBaseAnalyticsStore { updateIsEpic: (isEpic: boolean) => void; } -export abstract class BaseAnalyticsStore implements IBaseAnalyticsStore { +export class BaseAnalyticsStore implements IBaseAnalyticsStore { //observables currentTab: TAnalyticsTabsBase = "overview"; selectedProjects: string[] = []; diff --git a/apps/web/core/store/base-command-palette.store.ts b/apps/web/core/store/base-command-palette.store.ts index e5fe61b344e..7b9fb56e869 100644 --- a/apps/web/core/store/base-command-palette.store.ts +++ b/apps/web/core/store/base-command-palette.store.ts @@ -4,7 +4,7 @@ * See the LICENSE file for details. */ -import { observable, action, makeObservable, runInAction } from "mobx"; +import { observable, action, computed, makeObservable, runInAction } from "mobx"; import { computedFn } from "mobx-utils"; // plane imports import type { TCreateModalStoreTypes, TCreatePageModal } from "@plane/constants"; @@ -20,6 +20,8 @@ export interface ModalData { } export interface IBaseCommandPaletteStore { + // computed + isAnyModalOpen: boolean; // observables isCreateProjectModalOpen: boolean; isCreateCycleModalOpen: boolean; @@ -52,7 +54,7 @@ export interface IBaseCommandPaletteStore { toggleProfileSettingsModal: (value: { activeTab?: TProfileSettingsTabs | null; isOpen?: boolean }) => void; } -export abstract class BaseCommandPaletteStore implements IBaseCommandPaletteStore { +export class BaseCommandPaletteStore implements IBaseCommandPaletteStore { // observables isCreateProjectModalOpen: boolean = false; isCreateCycleModalOpen: boolean = false; @@ -99,9 +101,14 @@ export abstract class BaseCommandPaletteStore implements IBaseCommandPaletteStor toggleAllStickiesModal: action, toggleProjectListOpen: action, toggleProfileSettingsModal: action, + isAnyModalOpen: computed, }); } + get isAnyModalOpen(): boolean { + return Boolean(this.getCoreModalsState()); + } + /** * Returns whether any base modal is open * @protected - allows access from child classes @@ -277,3 +284,7 @@ export abstract class BaseCommandPaletteStore implements IBaseCommandPaletteStor }); }; } + +// Aliases so consumers can keep using CommandPaletteStore / ICommandPaletteStore +export type ICommandPaletteStore = IBaseCommandPaletteStore; +export { BaseCommandPaletteStore as CommandPaletteStore }; diff --git a/apps/web/core/store/base-power-k.store.ts b/apps/web/core/store/base-power-k.store.ts index ded57f3e6bf..379ecf96feb 100644 --- a/apps/web/core/store/base-power-k.store.ts +++ b/apps/web/core/store/base-power-k.store.ts @@ -35,7 +35,7 @@ export interface IBasePowerKStore { toggleShortcutsListModal: (value?: boolean) => void; } -export abstract class BasePowerKStore implements IBasePowerKStore { +export class BasePowerKStore implements IBasePowerKStore { // observables isPowerKModalOpen: boolean = false; isShortcutsListModalOpen: boolean = false; diff --git a/apps/web/ce/store/estimates/estimate.ts b/apps/web/core/store/estimates/estimate.ts similarity index 95% rename from apps/web/ce/store/estimates/estimate.ts rename to apps/web/core/store/estimates/estimate.ts index 805c00df8da..7e654940a05 100644 --- a/apps/web/ce/store/estimates/estimate.ts +++ b/apps/web/core/store/estimates/estimate.ts @@ -135,13 +135,6 @@ export class Estimate implements IEstimate { }); // actions - /** - * @description create an estimate point - * @param { string } workspaceSlug - * @param { string } projectId - * @param { Partial } payload - * @returns { IEstimatePointType | undefined } - */ creteEstimatePoint = async ( workspaceSlug: string, projectId: string, diff --git a/apps/web/core/store/estimates/project-estimate.store.ts b/apps/web/core/store/estimates/project-estimate.store.ts index 519e0805cfc..bfbe066de36 100644 --- a/apps/web/core/store/estimates/project-estimate.store.ts +++ b/apps/web/core/store/estimates/project-estimate.store.ts @@ -12,8 +12,8 @@ import type { IEstimate as IEstimateType, IEstimateFormData, TEstimateSystemKeys // plane web services import estimateService from "@/services/estimate.service"; // plane web store -import type { IEstimate } from "@/plane-web/store/estimates/estimate"; -import { Estimate } from "@/plane-web/store/estimates/estimate"; +import type { IEstimate } from "@/store/estimates/estimate"; +import { Estimate } from "@/store/estimates/estimate"; // store import type { CoreRootStore } from "../root.store"; diff --git a/apps/web/core/store/issue/helpers/base-issues.store.ts b/apps/web/core/store/issue/helpers/base-issues.store.ts index 023f6590da8..09c24d25f45 100644 --- a/apps/web/core/store/issue/helpers/base-issues.store.ts +++ b/apps/web/core/store/issue/helpers/base-issues.store.ts @@ -30,7 +30,6 @@ import { EIssueServiceType, EIssueLayoutTypes } from "@plane/types"; // helpers import { convertToISODateString } from "@plane/utils"; // plane web imports -import { workItemSortWithOrderByExtended } from "@/plane-web/store/issue/helpers/base-issue.store"; // services import { CycleService } from "@/services/cycle.service"; import { IssueArchiveService, IssueService } from "@/services/issue"; @@ -329,6 +328,7 @@ export abstract class BaseIssuesStore implements IBaseIssuesStore { // The Issue Property corresponding to the order by value get orderByKey() { + // oxlint-disable-next-line no-shadow const orderBy = this.orderBy; if (!orderBy) return; @@ -537,6 +537,7 @@ export abstract class BaseIssuesStore implements IBaseIssuesStore { this.addIssue(response, shouldUpdateList); // If shouldUpdateList is true, call fetchParentStats + // oxlint-disable-next-line no-unused-expressions shouldUpdateList && (await this.fetchParentStats(workspaceSlug, projectId)); return response; @@ -762,6 +763,7 @@ export abstract class BaseIssuesStore implements IBaseIssuesStore { try { const getIssueById = this.rootIssueStore.issues.getIssueById; runInAction(() => { + // oxlint-disable-next-line no-shadow for (const update of updates) { const dates: Partial = {}; if (update.start_date) dates.start_date = update.start_date; @@ -784,6 +786,7 @@ export abstract class BaseIssuesStore implements IBaseIssuesStore { await this.issueService.updateIssueDates(workspaceSlug, projectId, updates); } catch (e) { runInAction(() => { + // oxlint-disable-next-line no-shadow for (const update of issueDatesBeforeChange) { const dates: Partial = {}; if (update.start_date) dates.start_date = update.start_date; @@ -858,6 +861,7 @@ export abstract class BaseIssuesStore implements IBaseIssuesStore { runInAction(() => { // If cycle Id is the current cycle Id, then, remove issue from list of issueIds + // oxlint-disable-next-line no-unused-expressions this.cycleId === cycleId && this.removeIssueFromList(issueId); }); @@ -988,6 +992,7 @@ export abstract class BaseIssuesStore implements IBaseIssuesStore { runInAction(() => { // if module Id is the current Module Id, then, add issue to list of issueIds + // oxlint-disable-next-line no-unused-expressions this.moduleId === moduleId && issueIds.forEach((issueId) => this.addIssueToList(issueId)); }); @@ -1016,6 +1021,7 @@ export abstract class BaseIssuesStore implements IBaseIssuesStore { runInAction(() => { // if module Id is the current Module Id, then remove issue from list of issueIds + // oxlint-disable-next-line no-unused-expressions this.moduleId === moduleId && issueIds.forEach((issueId) => this.removeIssueFromList(issueId)); }); @@ -1089,6 +1095,7 @@ export abstract class BaseIssuesStore implements IBaseIssuesStore { // remove the new issue id to the module issues removeModuleIds.forEach((moduleId) => { // If module Id is equal to current module Id, them remove Issue from List + // oxlint-disable-next-line no-unused-expressions this.moduleId === moduleId && this.removeIssueFromList(issueId); currentModuleIds = pull(currentModuleIds, moduleId); }); @@ -1196,6 +1203,7 @@ export abstract class BaseIssuesStore implements IBaseIssuesStore { updateIssueList( issue?: TIssue, issueBeforeUpdate?: TIssue, + // oxlint-disable-next-line no-shadow action?: EIssueGroupedAction.ADD | EIssueGroupedAction.DELETE ) { if (!issue && !issueBeforeUpdate) return; @@ -1379,6 +1387,7 @@ export abstract class BaseIssuesStore implements IBaseIssuesStore { set(this.groupedIssueCount, [ALL_ISSUES], groupedIssueCount[ALL_ISSUES]); // loop through the groups of groupedIssues. + // oxlint-disable-next-line no-shadow for (const groupId in groupedIssues) { const issueGroup = groupedIssues[groupId]; const issueGroupCount = groupedIssueCount[groupId]; @@ -1392,6 +1401,7 @@ export abstract class BaseIssuesStore implements IBaseIssuesStore { if (storeUpdated) continue; // if issueGroup is not a string, loop through the sub group Issues + // oxlint-disable-next-line no-shadow for (const subGroupId in issueGroup) { const issueSubGroup = (issueGroup as TGroupedIssues)[subGroupId]; const issueSubGroupCount = groupedIssueCount[getGroupKey(groupId, subGroupId)]; @@ -1436,6 +1446,7 @@ export abstract class BaseIssuesStore implements IBaseIssuesStore { accumulateIssueUpdates( accumulator: { [key: string]: EIssueGroupedAction }, path: string[], + // oxlint-disable-next-line no-shadow action: EIssueGroupedAction ) { const [groupId, subGroupId] = path; @@ -1470,6 +1481,7 @@ export abstract class BaseIssuesStore implements IBaseIssuesStore { updateUpdateAccumulator( accumulator: { [key: string]: EIssueGroupedAction }, key: string, + // oxlint-disable-next-line no-shadow action: EIssueGroupedAction ) { // if the key for accumulator is undefined, they update it with the action @@ -1494,6 +1506,7 @@ export abstract class BaseIssuesStore implements IBaseIssuesStore { updateIssueCount(accumulatedUpdatesForCount: { [key: string]: EIssueGroupedAction }) { const updateKeys = Object.keys(accumulatedUpdatesForCount); for (const updateKey of updateKeys) { + // oxlint-disable-next-line no-shadow const update = accumulatedUpdatesForCount[updateKey]; if (!update) continue; @@ -1515,6 +1528,7 @@ export abstract class BaseIssuesStore implements IBaseIssuesStore { getUpdateDetails = ( issue?: Partial, issueBeforeUpdate?: Partial, + // oxlint-disable-next-line no-shadow action?: EIssueGroupedAction.ADD | EIssueGroupedAction.DELETE ): { path: string[]; action: EIssueGroupedAction }[] => { // check the before and after states to return if there needs to be a re-sorting of issueId list if the issue property that orderBy depends on has changed @@ -1935,7 +1949,7 @@ export abstract class BaseIssuesStore implements IBaseIssuesStore { ); default: - return workItemSortWithOrderByExtended(array, key); + return getIssueIds(array); } }; diff --git a/apps/web/core/store/issue/helpers/issue-filter-helper.store.ts b/apps/web/core/store/issue/helpers/issue-filter-helper.store.ts index fc7e9255dc9..b89801f2878 100644 --- a/apps/web/core/store/issue/helpers/issue-filter-helper.store.ts +++ b/apps/web/core/store/issue/helpers/issue-filter-helper.store.ts @@ -30,7 +30,6 @@ import { EIssueLayoutTypes } from "@plane/types"; import { getComputedDisplayFilters, getComputedDisplayProperties } from "@plane/utils"; // lib import { storage } from "@/lib/local-storage"; -import { getEnabledDisplayFilters } from "@/plane-web/store/issue/helpers/filter-utils"; interface ILocalStoreIssueFilters { key: EIssuesStoreType; @@ -68,6 +67,7 @@ export interface IIssueFilterHelperStore { } export class IssueFilterHelperStore implements IIssueFilterHelperStore { + // oxlint-disable-next-line no-useless-constructor constructor() {} /** @@ -185,7 +185,7 @@ export class IssueFilterHelperStore implements IIssueFilterHelperStore { defaultValues?: IIssueDisplayFilterOptions ): IIssueDisplayFilterOptions => { const computedFilters = getComputedDisplayFilters(displayFilters, defaultValues); - return getEnabledDisplayFilters(computedFilters); + return computedFilters; }; /** diff --git a/apps/web/ce/store/issue/issue-details/activity.store.ts b/apps/web/core/store/issue/issue-details/activity.store.ts similarity index 99% rename from apps/web/ce/store/issue/issue-details/activity.store.ts rename to apps/web/core/store/issue/issue-details/activity.store.ts index a9f4b0a5e5e..6687aebc350 100644 --- a/apps/web/ce/store/issue/issue-details/activity.store.ts +++ b/apps/web/core/store/issue/issue-details/activity.store.ts @@ -18,7 +18,6 @@ import type { TIssueServiceType, } from "@plane/types"; import { EIssueServiceType } from "@plane/types"; -// plane web constants // services import { IssueActivityService } from "@/services/issue"; // store @@ -160,6 +159,7 @@ export class IssueActivityStore implements IIssueActivityStore { const activityIds = activities.map((activity) => activity.id); runInAction(() => { + // oxlint-disable-next-line no-shadow update(this.activities, issueId, (currentActivityIds) => { if (!currentActivityIds) return activityIds; return uniq(concat(currentActivityIds, activityIds)); diff --git a/apps/web/core/store/issue/issue-details/root.store.ts b/apps/web/core/store/issue/issue-details/root.store.ts index 89eb5c389a5..9d3ceb15263 100644 --- a/apps/web/core/store/issue/issue-details/root.store.ts +++ b/apps/web/core/store/issue/issue-details/root.store.ts @@ -18,12 +18,12 @@ import type { TWorkItemWidgets, } from "@plane/types"; // plane web store -import { IssueActivityStore } from "@/plane-web/store/issue/issue-details/activity.store"; +import { IssueActivityStore } from "./activity.store"; import type { IIssueActivityStore, IIssueActivityStoreActions, TActivityLoader, -} from "@/plane-web/store/issue/issue-details/activity.store"; +} from "./activity.store"; import type { IIssueRootStore } from "../root.store"; import { IssueAttachmentStore } from "./attachment.store"; import type { IIssueAttachmentStore, IIssueAttachmentStoreActions } from "./attachment.store"; diff --git a/apps/web/core/store/member/index.ts b/apps/web/core/store/member/index.ts index fcce4e1feed..cc0c98b0d3f 100644 --- a/apps/web/core/store/member/index.ts +++ b/apps/web/core/store/member/index.ts @@ -9,8 +9,8 @@ import { computedFn } from "mobx-utils"; // plane imports import type { IUserLite } from "@plane/types"; // plane web imports -import type { IProjectMemberStore } from "@/plane-web/store/member/project-member.store"; -import { ProjectMemberStore } from "@/plane-web/store/member/project-member.store"; +import type { IProjectMemberStore } from "@/store/member/project/base-project-member.store"; +import { ProjectMemberStore } from "@/store/member/project/base-project-member.store"; import type { RootStore } from "@/plane-web/store/root.store"; // local imports import type { IWorkspaceMemberStore } from "./workspace/workspace-member.store"; diff --git a/apps/web/core/store/member/project/base-project-member.store.ts b/apps/web/core/store/member/project/base-project-member.store.ts index 701089a09e2..140dc398b6e 100644 --- a/apps/web/core/store/member/project/base-project-member.store.ts +++ b/apps/web/core/store/member/project/base-project-member.store.ts @@ -84,7 +84,7 @@ export interface IBaseProjectMemberStore { removeMemberFromProject: (workspaceSlug: string, projectId: string, userId: string) => Promise; } -export abstract class BaseProjectMemberStore implements IBaseProjectMemberStore { +export class BaseProjectMemberStore implements IBaseProjectMemberStore { // observables projectMemberFetchStatusMap: { [projectId: string]: boolean; @@ -204,7 +204,9 @@ export abstract class BaseProjectMemberStore implements IBaseProjectMemberStore * @param { string } projectId - The ID of the project * @returns { EUserProjectRoles | undefined } The user's role in the project, or undefined if not found */ - abstract getUserProjectRole: (userId: string, projectId: string) => EUserProjectRoles | undefined; + getUserProjectRole = computedFn((userId: string, projectId: string): EUserProjectRoles | undefined => + this.getRoleFromProjectMembership(userId, projectId) + ); /** * @description get the details of a project member @@ -329,16 +331,13 @@ export abstract class BaseProjectMemberStore implements IBaseProjectMemberStore }); /** - * @description update the role of a member in a project + * @description Returns the role to use when updating a project member * @param projectId * @param userId * @param role */ - abstract getProjectMemberRoleForUpdate: ( - projectId: string, - userId: string, - role: EUserProjectRoles - ) => EUserProjectRoles; + getProjectMemberRoleForUpdate = (_projectId: string, _userId: string, role: EUserProjectRoles): EUserProjectRoles => + role; /** * @description update the role of a member in a project @@ -417,11 +416,10 @@ export abstract class BaseProjectMemberStore implements IBaseProjectMemberStore /** * @description Processes the removal of a member from a project - * This abstract method handles the cleanup of member data from the project member map * @param projectId - The ID of the project to remove the member from * @param userId - The ID of the user to remove from the project */ - abstract processMemberRemoval: (projectId: string, userId: string) => void; + processMemberRemoval = (projectId: string, userId: string) => this.handleMemberRemoval(projectId, userId); /** * @description remove a member from a project @@ -432,6 +430,7 @@ export abstract class BaseProjectMemberStore implements IBaseProjectMemberStore removeMemberFromProject = async (workspaceSlug: string, projectId: string, userId: string) => { const memberDetails = this.getProjectMemberDetails(userId, projectId); if (!memberDetails || !memberDetails?.id) throw new Error("Member not found"); + // oxlint-disable-next-line promise/always-return await this.projectMemberService.deleteProjectMember(workspaceSlug, projectId, memberDetails?.id).then(() => { runInAction(() => { this.processMemberRemoval(projectId, userId); @@ -496,3 +495,7 @@ export abstract class BaseProjectMemberStore implements IBaseProjectMemberStore } }; } + +// Aliases so consumers can keep using ProjectMemberStore / IProjectMemberStore +export type IProjectMemberStore = IBaseProjectMemberStore; +export { BaseProjectMemberStore as ProjectMemberStore }; diff --git a/apps/web/core/store/root.store.ts b/apps/web/core/store/root.store.ts index ed908fe8b0f..80d944a7732 100644 --- a/apps/web/core/store/root.store.ts +++ b/apps/web/core/store/root.store.ts @@ -16,10 +16,10 @@ import type { IBasePowerKStore as IPowerKStore } from "@/store/base-power-k.stor import { BasePowerKStore as PowerKStore } from "@/store/base-power-k.store"; import type { IStateStore } from "@/store/state.store"; import { StateStore } from "@/store/state.store"; -import type { ICommandPaletteStore } from "@/plane-web/store/command-palette.store"; -import { CommandPaletteStore } from "@/plane-web/store/command-palette.store"; +import type { ICommandPaletteStore } from "@/store/base-command-palette.store"; +import { CommandPaletteStore } from "@/store/base-command-palette.store"; import type { RootStore } from "@/plane-web/store/root.store"; -import { WorkspaceRootStore } from "@/plane-web/store/workspace"; +import { WorkspaceRootStore } from "@/store/workspace"; // stores import type { ICycleStore } from "./cycle.store"; import { CycleStore } from "./cycle.store"; diff --git a/apps/web/core/store/user/base-permissions.store.ts b/apps/web/core/store/user/base-permissions.store.ts index 8810ab26cdc..df56559831a 100644 --- a/apps/web/core/store/user/base-permissions.store.ts +++ b/apps/web/core/store/user/base-permissions.store.ts @@ -64,7 +64,7 @@ export interface IBaseUserPermissionStore { * @description This store is used to handle permission layer for the currently logged user. * It manages workspace and project level permissions, roles and access control. */ -export abstract class BaseUserPermissionStore implements IBaseUserPermissionStore { +export class BaseUserPermissionStore implements IBaseUserPermissionStore { loader: boolean = false; // constants workspaceUserInfo: Record = {}; @@ -150,10 +150,10 @@ export abstract class BaseUserPermissionStore implements IBaseUserPermissionStor * @param { string } projectId * @returns { EUserPermissions | undefined } */ - abstract getProjectRoleByWorkspaceSlugAndProjectId: ( - workspaceSlug: string, - projectId?: string - ) => EUserPermissions | undefined; + getProjectRoleByWorkspaceSlugAndProjectId = computedFn( + (workspaceSlug: string, projectId?: string): EUserPermissions | undefined => + this.getProjectRole(workspaceSlug, projectId) + ); /** * @description Fetches project-level entities that are not automatically loaded by the project wrapper. @@ -162,7 +162,9 @@ export abstract class BaseUserPermissionStore implements IBaseUserPermissionStor * @param { string } projectId * @returns { Promise } */ - abstract fetchWorkspaceLevelProjectEntities: (workspaceSlug: string, projectId: string) => void; + fetchWorkspaceLevelProjectEntities = (workspaceSlug: string, projectId: string): void => { + void this.store.projectRoot.project.fetchProjectDetails(workspaceSlug, projectId); + }; /** * @description Returns whether the user has the permission to access a page @@ -353,3 +355,7 @@ export abstract class BaseUserPermissionStore implements IBaseUserPermissionStor } }; } + +// Aliases so consumers can keep using UserPermissionStore / IUserPermissionStore +export type IUserPermissionStore = IBaseUserPermissionStore; +export { BaseUserPermissionStore as UserPermissionStore }; diff --git a/apps/web/core/store/user/index.ts b/apps/web/core/store/user/index.ts index 7181a6ed17f..bdebabc8eb3 100644 --- a/apps/web/core/store/user/index.ts +++ b/apps/web/core/store/user/index.ts @@ -11,8 +11,8 @@ import { EUserPermissions, API_BASE_URL } from "@plane/constants"; import type { IUser, TUserPermissions } from "@plane/types"; // plane web imports import type { RootStore } from "@/plane-web/store/root.store"; -import type { IUserPermissionStore } from "@/plane-web/store/user/permission.store"; -import { UserPermissionStore } from "@/plane-web/store/user/permission.store"; +import type { IUserPermissionStore } from "@/store/user/base-permissions.store"; +import { UserPermissionStore } from "@/store/user/base-permissions.store"; // services import { AuthService } from "@/services/auth.service"; import { UserService } from "@/services/user.service"; diff --git a/apps/web/core/store/workspace/index.ts b/apps/web/core/store/workspace/index.ts index 746c8699919..27bb4701e72 100644 --- a/apps/web/core/store/workspace/index.ts +++ b/apps/web/core/store/workspace/index.ts @@ -70,7 +70,7 @@ export interface IWorkspaceRootStore { home: IHomeStore; } -export abstract class BaseWorkspaceRootStore implements IWorkspaceRootStore { +export class BaseWorkspaceRootStore implements IWorkspaceRootStore { loader: boolean = false; // observables workspaces: Record = {}; @@ -383,8 +383,13 @@ export abstract class BaseWorkspaceRootStore implements IWorkspaceRootStore { }; /** - * Mutate workspace members activity + * Mutate workspace members activity — no-op in CE * @param workspaceSlug */ - abstract mutateWorkspaceMembersActivity(workspaceSlug: string): Promise; + mutateWorkspaceMembersActivity = async (_workspaceSlug: string): Promise => { + // No-op in default/CE version + }; } + +// Alias so consumers can keep using WorkspaceRootStore +export { BaseWorkspaceRootStore as WorkspaceRootStore }; From b496d21728b9c5af23b98fb0eec3ca6c0c83528e Mon Sep 17 00:00:00 2001 From: Atul Tameshwari Date: Fri, 19 Jun 2026 16:26:02 +0530 Subject: [PATCH 3/7] refactor: remove unused issue filter and store files, and update import paths in the core module --- apps/web/ce/store/issue/epic/filter.store.ts | 22 ------- apps/web/ce/store/issue/epic/index.ts | 8 --- apps/web/ce/store/issue/epic/issue.store.ts | 21 ------- .../store/issue/team-project/filter.store.ts | 19 ------ apps/web/ce/store/issue/team-project/index.ts | 8 --- .../store/issue/team-project/issue.store.ts | 20 ------ .../ce/store/issue/team-views/filter.store.ts | 19 ------ apps/web/ce/store/issue/team-views/index.ts | 8 --- .../ce/store/issue/team-views/issue.store.ts | 20 ------ apps/web/ce/store/issue/team/filter.store.ts | 19 ------ apps/web/ce/store/issue/team/index.ts | 8 --- apps/web/ce/store/issue/team/issue.store.ts | 20 ------ .../ce/store/issue/workspace/issue.store.ts | 7 --- apps/web/core/hooks/store/use-issues.ts | 24 +++---- apps/web/core/store/issue/root.store.ts | 63 ++++++++----------- 15 files changed, 35 insertions(+), 251 deletions(-) delete mode 100644 apps/web/ce/store/issue/epic/filter.store.ts delete mode 100644 apps/web/ce/store/issue/epic/index.ts delete mode 100644 apps/web/ce/store/issue/epic/issue.store.ts delete mode 100644 apps/web/ce/store/issue/team-project/filter.store.ts delete mode 100644 apps/web/ce/store/issue/team-project/index.ts delete mode 100644 apps/web/ce/store/issue/team-project/issue.store.ts delete mode 100644 apps/web/ce/store/issue/team-views/filter.store.ts delete mode 100644 apps/web/ce/store/issue/team-views/index.ts delete mode 100644 apps/web/ce/store/issue/team-views/issue.store.ts delete mode 100644 apps/web/ce/store/issue/team/filter.store.ts delete mode 100644 apps/web/ce/store/issue/team/index.ts delete mode 100644 apps/web/ce/store/issue/team/issue.store.ts delete mode 100644 apps/web/ce/store/issue/workspace/issue.store.ts diff --git a/apps/web/ce/store/issue/epic/filter.store.ts b/apps/web/ce/store/issue/epic/filter.store.ts deleted file mode 100644 index be441707cb3..00000000000 --- a/apps/web/ce/store/issue/epic/filter.store.ts +++ /dev/null @@ -1,22 +0,0 @@ -/** - * Copyright (c) 2023-present Plane Software, Inc. and contributors - * SPDX-License-Identifier: AGPL-3.0-only - * See the LICENSE file for details. - */ - -import type { IProjectIssuesFilter } from "@/store/issue/project"; -import { ProjectIssuesFilter } from "@/store/issue/project"; -import type { IIssueRootStore } from "@/store/issue/root.store"; - -// @ts-nocheck - This class will never be used, extending similar class to avoid type errors -export type IProjectEpicsFilter = IProjectIssuesFilter; - -// @ts-nocheck - This class will never be used, extending similar class to avoid type errors -export class ProjectEpicsFilter extends ProjectIssuesFilter implements IProjectEpicsFilter { - constructor(_rootStore: IIssueRootStore) { - super(_rootStore); - - // root store - this.rootIssueStore = _rootStore; - } -} diff --git a/apps/web/ce/store/issue/epic/index.ts b/apps/web/ce/store/issue/epic/index.ts deleted file mode 100644 index a21a791fefc..00000000000 --- a/apps/web/ce/store/issue/epic/index.ts +++ /dev/null @@ -1,8 +0,0 @@ -/** - * Copyright (c) 2023-present Plane Software, Inc. and contributors - * SPDX-License-Identifier: AGPL-3.0-only - * See the LICENSE file for details. - */ - -export * from "./filter.store"; -export * from "./issue.store"; diff --git a/apps/web/ce/store/issue/epic/issue.store.ts b/apps/web/ce/store/issue/epic/issue.store.ts deleted file mode 100644 index b6761eac89f..00000000000 --- a/apps/web/ce/store/issue/epic/issue.store.ts +++ /dev/null @@ -1,21 +0,0 @@ -/** - * Copyright (c) 2023-present Plane Software, Inc. and contributors - * SPDX-License-Identifier: AGPL-3.0-only - * See the LICENSE file for details. - */ - -import type { IProjectIssues } from "@/store/issue/project"; -import { ProjectIssues } from "@/store/issue/project"; -import type { IIssueRootStore } from "@/store/issue/root.store"; -import type { IProjectEpicsFilter } from "./filter.store"; - -// @ts-nocheck - This class will never be used, extending similar class to avoid type errors - -export type IProjectEpics = IProjectIssues; - -// @ts-nocheck - This class will never be used, extending similar class to avoid type errors -export class ProjectEpics extends ProjectIssues implements IProjectEpics { - constructor(_rootStore: IIssueRootStore, issueFilterStore: IProjectEpicsFilter) { - super(_rootStore, issueFilterStore); - } -} diff --git a/apps/web/ce/store/issue/team-project/filter.store.ts b/apps/web/ce/store/issue/team-project/filter.store.ts deleted file mode 100644 index 45d5324c891..00000000000 --- a/apps/web/ce/store/issue/team-project/filter.store.ts +++ /dev/null @@ -1,19 +0,0 @@ -/** - * Copyright (c) 2023-present Plane Software, Inc. and contributors - * SPDX-License-Identifier: AGPL-3.0-only - * See the LICENSE file for details. - */ - -import type { IProjectIssuesFilter } from "@/store/issue/project"; -import { ProjectIssuesFilter } from "@/store/issue/project"; -import type { IIssueRootStore } from "@/store/issue/root.store"; - -// @ts-nocheck - This class will never be used, extending similar class to avoid type errors -export type ITeamProjectWorkItemsFilter = IProjectIssuesFilter; - -// @ts-nocheck - This class will never be used, extending similar class to avoid type errors -export class TeamProjectWorkItemsFilter extends ProjectIssuesFilter implements ITeamProjectWorkItemsFilter { - constructor(_rootStore: IIssueRootStore) { - super(_rootStore); - } -} diff --git a/apps/web/ce/store/issue/team-project/index.ts b/apps/web/ce/store/issue/team-project/index.ts deleted file mode 100644 index a21a791fefc..00000000000 --- a/apps/web/ce/store/issue/team-project/index.ts +++ /dev/null @@ -1,8 +0,0 @@ -/** - * Copyright (c) 2023-present Plane Software, Inc. and contributors - * SPDX-License-Identifier: AGPL-3.0-only - * See the LICENSE file for details. - */ - -export * from "./filter.store"; -export * from "./issue.store"; diff --git a/apps/web/ce/store/issue/team-project/issue.store.ts b/apps/web/ce/store/issue/team-project/issue.store.ts deleted file mode 100644 index fa27134901d..00000000000 --- a/apps/web/ce/store/issue/team-project/issue.store.ts +++ /dev/null @@ -1,20 +0,0 @@ -/** - * Copyright (c) 2023-present Plane Software, Inc. and contributors - * SPDX-License-Identifier: AGPL-3.0-only - * See the LICENSE file for details. - */ - -import type { IProjectIssues } from "@/store/issue/project"; -import { ProjectIssues } from "@/store/issue/project"; -import type { IIssueRootStore } from "@/store/issue/root.store"; -import type { ITeamProjectWorkItemsFilter } from "./filter.store"; - -// @ts-nocheck - This class will never be used, extending similar class to avoid type errors -export type ITeamProjectWorkItems = IProjectIssues; - -// @ts-nocheck - This class will never be used, extending similar class to avoid type errors -export class TeamProjectWorkItems extends ProjectIssues implements ITeamProjectWorkItems { - constructor(_rootStore: IIssueRootStore, teamProjectWorkItemsFilterStore: ITeamProjectWorkItemsFilter) { - super(_rootStore, teamProjectWorkItemsFilterStore); - } -} diff --git a/apps/web/ce/store/issue/team-views/filter.store.ts b/apps/web/ce/store/issue/team-views/filter.store.ts deleted file mode 100644 index 133f98da4d7..00000000000 --- a/apps/web/ce/store/issue/team-views/filter.store.ts +++ /dev/null @@ -1,19 +0,0 @@ -/** - * Copyright (c) 2023-present Plane Software, Inc. and contributors - * SPDX-License-Identifier: AGPL-3.0-only - * See the LICENSE file for details. - */ - -import type { IProjectViewIssuesFilter } from "@/store/issue/project-views"; -import { ProjectViewIssuesFilter } from "@/store/issue/project-views"; -import type { IIssueRootStore } from "@/store/issue/root.store"; - -// @ts-nocheck - This class will never be used, extending similar class to avoid type errors -export type ITeamViewIssuesFilter = IProjectViewIssuesFilter; - -// @ts-nocheck - This class will never be used, extending similar class to avoid type errors -export class TeamViewIssuesFilter extends ProjectViewIssuesFilter implements IProjectViewIssuesFilter { - constructor(_rootStore: IIssueRootStore) { - super(_rootStore); - } -} diff --git a/apps/web/ce/store/issue/team-views/index.ts b/apps/web/ce/store/issue/team-views/index.ts deleted file mode 100644 index a21a791fefc..00000000000 --- a/apps/web/ce/store/issue/team-views/index.ts +++ /dev/null @@ -1,8 +0,0 @@ -/** - * Copyright (c) 2023-present Plane Software, Inc. and contributors - * SPDX-License-Identifier: AGPL-3.0-only - * See the LICENSE file for details. - */ - -export * from "./filter.store"; -export * from "./issue.store"; diff --git a/apps/web/ce/store/issue/team-views/issue.store.ts b/apps/web/ce/store/issue/team-views/issue.store.ts deleted file mode 100644 index 610520007f9..00000000000 --- a/apps/web/ce/store/issue/team-views/issue.store.ts +++ /dev/null @@ -1,20 +0,0 @@ -/** - * Copyright (c) 2023-present Plane Software, Inc. and contributors - * SPDX-License-Identifier: AGPL-3.0-only - * See the LICENSE file for details. - */ - -import type { IProjectViewIssues } from "@/store/issue/project-views"; -import { ProjectViewIssues } from "@/store/issue/project-views"; -import type { IIssueRootStore } from "@/store/issue/root.store"; -import type { ITeamViewIssuesFilter } from "./filter.store"; - -// @ts-nocheck - This class will never be used, extending similar class to avoid type errors -export type ITeamViewIssues = IProjectViewIssues; - -// @ts-nocheck - This class will never be used, extending similar class to avoid type errors -export class TeamViewIssues extends ProjectViewIssues implements IProjectViewIssues { - constructor(_rootStore: IIssueRootStore, teamViewFilterStore: ITeamViewIssuesFilter) { - super(_rootStore, teamViewFilterStore); - } -} diff --git a/apps/web/ce/store/issue/team/filter.store.ts b/apps/web/ce/store/issue/team/filter.store.ts deleted file mode 100644 index 20842d2a327..00000000000 --- a/apps/web/ce/store/issue/team/filter.store.ts +++ /dev/null @@ -1,19 +0,0 @@ -/** - * Copyright (c) 2023-present Plane Software, Inc. and contributors - * SPDX-License-Identifier: AGPL-3.0-only - * See the LICENSE file for details. - */ - -import type { IProjectIssuesFilter } from "@/store/issue/project"; -import { ProjectIssuesFilter } from "@/store/issue/project"; -import type { IIssueRootStore } from "@/store/issue/root.store"; - -// @ts-nocheck - This class will never be used, extending similar class to avoid type errors -export type ITeamIssuesFilter = IProjectIssuesFilter; - -// @ts-nocheck - This class will never be used, extending similar class to avoid type errors -export class TeamIssuesFilter extends ProjectIssuesFilter implements IProjectIssuesFilter { - constructor(_rootStore: IIssueRootStore) { - super(_rootStore); - } -} diff --git a/apps/web/ce/store/issue/team/index.ts b/apps/web/ce/store/issue/team/index.ts deleted file mode 100644 index a21a791fefc..00000000000 --- a/apps/web/ce/store/issue/team/index.ts +++ /dev/null @@ -1,8 +0,0 @@ -/** - * Copyright (c) 2023-present Plane Software, Inc. and contributors - * SPDX-License-Identifier: AGPL-3.0-only - * See the LICENSE file for details. - */ - -export * from "./filter.store"; -export * from "./issue.store"; diff --git a/apps/web/ce/store/issue/team/issue.store.ts b/apps/web/ce/store/issue/team/issue.store.ts deleted file mode 100644 index a24515c23cb..00000000000 --- a/apps/web/ce/store/issue/team/issue.store.ts +++ /dev/null @@ -1,20 +0,0 @@ -/** - * Copyright (c) 2023-present Plane Software, Inc. and contributors - * SPDX-License-Identifier: AGPL-3.0-only - * See the LICENSE file for details. - */ - -import type { IProjectIssues } from "@/store/issue/project"; -import { ProjectIssues } from "@/store/issue/project"; -import type { IIssueRootStore } from "@/store/issue/root.store"; -import type { ITeamIssuesFilter } from "./filter.store"; - -// @ts-nocheck - This class will never be used, extending similar class to avoid type errors -export type ITeamIssues = IProjectIssues; - -// @ts-nocheck - This class will never be used, extending similar class to avoid type errors -export class TeamIssues extends ProjectIssues implements IProjectIssues { - constructor(_rootStore: IIssueRootStore, teamIssueFilterStore: ITeamIssuesFilter) { - super(_rootStore, teamIssueFilterStore); - } -} diff --git a/apps/web/ce/store/issue/workspace/issue.store.ts b/apps/web/ce/store/issue/workspace/issue.store.ts deleted file mode 100644 index 0862be70c1b..00000000000 --- a/apps/web/ce/store/issue/workspace/issue.store.ts +++ /dev/null @@ -1,7 +0,0 @@ -/** - * Copyright (c) 2023-present Plane Software, Inc. and contributors - * SPDX-License-Identifier: AGPL-3.0-only - * See the LICENSE file for details. - */ - -export * from "@/store/issue/workspace/issue.store"; diff --git a/apps/web/core/hooks/store/use-issues.ts b/apps/web/core/hooks/store/use-issues.ts index 816397d8409..3c8a1afdf76 100644 --- a/apps/web/core/hooks/store/use-issues.ts +++ b/apps/web/core/hooks/store/use-issues.ts @@ -9,14 +9,8 @@ import { merge } from "lodash-es"; import type { TIssueMap } from "@plane/types"; import { EIssuesStoreType } from "@plane/types"; import { StoreContext } from "@/lib/store-context"; -// plane web types -import type { IProjectEpics, IProjectEpicsFilter } from "@/plane-web/store/issue/epic"; -// types -import type { ITeamIssues, ITeamIssuesFilter } from "@/plane-web/store/issue/team"; -import type { ITeamProjectWorkItemsFilter, ITeamProjectWorkItems } from "@/plane-web/store/issue/team-project"; -import type { ITeamViewIssues, ITeamViewIssuesFilter } from "@/plane-web/store/issue/team-views"; -import type { IWorkspaceIssues } from "@/plane-web/store/issue/workspace/issue.store"; import type { IArchivedIssues, IArchivedIssuesFilter } from "@/store/issue/archived"; +import type { IWorkspaceIssues } from "@/store/issue/workspace/issue.store"; import type { ICycleIssues, ICycleIssuesFilter } from "@/store/issue/cycle"; import type { IModuleIssues, IModuleIssuesFilter } from "@/store/issue/module"; import type { IProfileIssues, IProfileIssuesFilter } from "@/store/issue/profile"; @@ -44,8 +38,8 @@ export type TStoreIssues = { issuesFilter: IProfileIssuesFilter; }; [EIssuesStoreType.TEAM]: defaultIssueStore & { - issues: ITeamIssues; - issuesFilter: ITeamIssuesFilter; + issues: IProjectIssues; + issuesFilter: IProjectIssuesFilter; }; [EIssuesStoreType.PROJECT]: defaultIssueStore & { issues: IProjectIssues; @@ -60,8 +54,8 @@ export type TStoreIssues = { issuesFilter: IModuleIssuesFilter; }; [EIssuesStoreType.TEAM_VIEW]: defaultIssueStore & { - issues: ITeamViewIssues; - issuesFilter: ITeamViewIssuesFilter; + issues: IProjectViewIssues; + issuesFilter: IProjectViewIssuesFilter; }; [EIssuesStoreType.PROJECT_VIEW]: defaultIssueStore & { issues: IProjectViewIssues; @@ -76,12 +70,12 @@ export type TStoreIssues = { issuesFilter: IProjectIssuesFilter; }; [EIssuesStoreType.EPIC]: defaultIssueStore & { - issues: IProjectEpics; - issuesFilter: IProjectEpicsFilter; + issues: IProjectIssues; + issuesFilter: IProjectIssuesFilter; }; [EIssuesStoreType.TEAM_PROJECT_WORK_ITEMS]: defaultIssueStore & { - issues: ITeamProjectWorkItems; - issuesFilter: ITeamProjectWorkItemsFilter; + issues: IProjectIssues; + issuesFilter: IProjectIssuesFilter; }; }; diff --git a/apps/web/core/store/issue/root.store.ts b/apps/web/core/store/issue/root.store.ts index 13de55c7c3a..bb1fadff978 100644 --- a/apps/web/core/store/issue/root.store.ts +++ b/apps/web/core/store/issue/root.store.ts @@ -10,21 +10,8 @@ import { autorun, makeObservable, observable } from "mobx"; import type { ICycle, IIssueLabel, IModule, IProject, IState, IUserLite, TIssueServiceType } from "@plane/types"; import { EIssueServiceType } from "@plane/types"; // plane web store -import type { IProjectEpics, IProjectEpicsFilter } from "@/plane-web/store/issue/epic"; -import { ProjectEpics, ProjectEpicsFilter } from "@/plane-web/store/issue/epic"; import type { IIssueDetail } from "@/store/issue/issue-details/root.store"; import { IssueDetail } from "@/store/issue/issue-details/root.store"; -import type { ITeamIssuesFilter, ITeamIssues } from "@/plane-web/store/issue/team"; -import { TeamIssues, TeamIssuesFilter } from "@/plane-web/store/issue/team"; -import type { ITeamProjectWorkItemsFilter } from "@/plane-web/store/issue/team-project/filter.store"; -import { TeamProjectWorkItemsFilter } from "@/plane-web/store/issue/team-project/filter.store"; -import type { ITeamProjectWorkItems } from "@/plane-web/store/issue/team-project/issue.store"; -import { TeamProjectWorkItems } from "@/plane-web/store/issue/team-project/issue.store"; -import type { ITeamViewIssues, ITeamViewIssuesFilter } from "@/plane-web/store/issue/team-views"; -import { TeamViewIssues, TeamViewIssuesFilter } from "@/plane-web/store/issue/team-views"; -// root store -import type { IWorkspaceIssues } from "@/plane-web/store/issue/workspace/issue.store"; -import { WorkspaceIssues } from "@/plane-web/store/issue/workspace/issue.store"; import type { RootStore } from "@/plane-web/store/root.store"; import type { IWorkspaceMembership } from "@/store/member/workspace/workspace-member.store"; // issues data store @@ -48,6 +35,8 @@ import type { IProjectViewIssuesFilter, IProjectViewIssues } from "./project-vie import { ProjectViewIssuesFilter, ProjectViewIssues } from "./project-views"; import type { IWorkspaceIssuesFilter } from "./workspace"; import { WorkspaceIssuesFilter } from "./workspace"; +import type { IWorkspaceIssues } from "./workspace/issue.store"; +import { WorkspaceIssues } from "./workspace/issue.store"; import type { IWorkspaceDraftIssues, IWorkspaceDraftIssuesFilter } from "./workspace-draft"; import { WorkspaceDraftIssues, WorkspaceDraftIssuesFilter } from "./workspace-draft"; @@ -88,8 +77,8 @@ export interface IIssueRootStore { profileIssuesFilter: IProfileIssuesFilter; profileIssues: IProfileIssues; - teamIssuesFilter: ITeamIssuesFilter; - teamIssues: ITeamIssues; + teamIssuesFilter: IProjectIssuesFilter; + teamIssues: IProjectIssues; projectIssuesFilter: IProjectIssuesFilter; projectIssues: IProjectIssues; @@ -100,11 +89,11 @@ export interface IIssueRootStore { moduleIssuesFilter: IModuleIssuesFilter; moduleIssues: IModuleIssues; - teamViewIssuesFilter: ITeamViewIssuesFilter; - teamViewIssues: ITeamViewIssues; + teamViewIssuesFilter: IProjectViewIssuesFilter; + teamViewIssues: IProjectViewIssues; - teamProjectWorkItemsFilter: ITeamProjectWorkItemsFilter; - teamProjectWorkItems: ITeamProjectWorkItems; + teamProjectWorkItemsFilter: IProjectIssuesFilter; + teamProjectWorkItems: IProjectIssues; projectViewIssuesFilter: IProjectViewIssuesFilter; projectViewIssues: IProjectViewIssues; @@ -115,8 +104,8 @@ export interface IIssueRootStore { issueKanBanView: IIssueKanBanViewStore; issueCalendarView: ICalendarStore; - projectEpicsFilter: IProjectEpicsFilter; - projectEpics: IProjectEpics; + projectEpicsFilter: IProjectIssuesFilter; + projectEpics: IProjectIssues; } export class IssueRootStore implements IIssueRootStore { @@ -156,8 +145,8 @@ export class IssueRootStore implements IIssueRootStore { profileIssuesFilter: IProfileIssuesFilter; profileIssues: IProfileIssues; - teamIssuesFilter: ITeamIssuesFilter; - teamIssues: ITeamIssues; + teamIssuesFilter: IProjectIssuesFilter; + teamIssues: IProjectIssues; projectIssuesFilter: IProjectIssuesFilter; projectIssues: IProjectIssues; @@ -168,14 +157,14 @@ export class IssueRootStore implements IIssueRootStore { moduleIssuesFilter: IModuleIssuesFilter; moduleIssues: IModuleIssues; - teamViewIssuesFilter: ITeamViewIssuesFilter; - teamViewIssues: ITeamViewIssues; + teamViewIssuesFilter: IProjectViewIssuesFilter; + teamViewIssues: IProjectViewIssues; projectViewIssuesFilter: IProjectViewIssuesFilter; projectViewIssues: IProjectViewIssues; - teamProjectWorkItemsFilter: ITeamProjectWorkItemsFilter; - teamProjectWorkItems: ITeamProjectWorkItems; + teamProjectWorkItemsFilter: IProjectIssuesFilter; + teamProjectWorkItems: IProjectIssues; archivedIssuesFilter: IArchivedIssuesFilter; archivedIssues: IArchivedIssues; @@ -183,8 +172,8 @@ export class IssueRootStore implements IIssueRootStore { issueKanBanView: IIssueKanBanViewStore; issueCalendarView: ICalendarStore; - projectEpicsFilter: IProjectEpicsFilter; - projectEpics: IProjectEpics; + projectEpicsFilter: IProjectIssuesFilter; + projectEpics: IProjectIssues; constructor(rootStore: RootStore, serviceType: TIssueServiceType = EIssueServiceType.ISSUES) { makeObservable(this, { @@ -250,8 +239,8 @@ export class IssueRootStore implements IIssueRootStore { this.projectIssuesFilter = new ProjectIssuesFilter(this); this.projectIssues = new ProjectIssues(this, this.projectIssuesFilter); - this.teamIssuesFilter = new TeamIssuesFilter(this); - this.teamIssues = new TeamIssues(this, this.teamIssuesFilter); + this.teamIssuesFilter = new ProjectIssuesFilter(this); + this.teamIssues = new ProjectIssues(this, this.teamIssuesFilter); this.cycleIssuesFilter = new CycleIssuesFilter(this); this.cycleIssues = new CycleIssues(this, this.cycleIssuesFilter); @@ -259,14 +248,14 @@ export class IssueRootStore implements IIssueRootStore { this.moduleIssuesFilter = new ModuleIssuesFilter(this); this.moduleIssues = new ModuleIssues(this, this.moduleIssuesFilter); - this.teamViewIssuesFilter = new TeamViewIssuesFilter(this); - this.teamViewIssues = new TeamViewIssues(this, this.teamViewIssuesFilter); + this.teamViewIssuesFilter = new ProjectViewIssuesFilter(this); + this.teamViewIssues = new ProjectViewIssues(this, this.teamViewIssuesFilter); this.projectViewIssuesFilter = new ProjectViewIssuesFilter(this); this.projectViewIssues = new ProjectViewIssues(this, this.projectViewIssuesFilter); - this.teamProjectWorkItemsFilter = new TeamProjectWorkItemsFilter(this); - this.teamProjectWorkItems = new TeamProjectWorkItems(this, this.teamProjectWorkItemsFilter); + this.teamProjectWorkItemsFilter = new ProjectIssuesFilter(this); + this.teamProjectWorkItems = new ProjectIssues(this, this.teamProjectWorkItemsFilter); this.archivedIssuesFilter = new ArchivedIssuesFilter(this); this.archivedIssues = new ArchivedIssues(this, this.archivedIssuesFilter); @@ -274,7 +263,7 @@ export class IssueRootStore implements IIssueRootStore { this.issueKanBanView = new IssueKanBanViewStore(this); this.issueCalendarView = new CalendarStore(this); - this.projectEpicsFilter = new ProjectEpicsFilter(this); - this.projectEpics = new ProjectEpics(this, this.projectEpicsFilter); + this.projectEpicsFilter = new ProjectIssuesFilter(this); + this.projectEpics = new ProjectIssues(this, this.projectEpicsFilter); } } From 1fca1d1bbebcc9f383a302818f6050d6c0350258 Mon Sep 17 00:00:00 2001 From: Atul Tameshwari Date: Fri, 19 Jun 2026 16:47:19 +0530 Subject: [PATCH 4/7] refactor: update import paths for timeline store files and introduce new base timeline store --- apps/web/ce/store/root.store.ts | 4 ++-- apps/web/core/hooks/use-timeline-chart.ts | 5 ++--- .../web/{ce => core}/store/timeline/base-timeline.store.ts | 2 +- apps/web/core/store/timeline/issues-timeline.store.ts | 7 +++---- apps/web/core/store/timeline/modules-timeline.store.ts | 7 +++---- .../index.ts => core/store/timeline/timeline.store.ts} | 2 +- 6 files changed, 12 insertions(+), 15 deletions(-) rename apps/web/{ce => core}/store/timeline/base-timeline.store.ts (99%) rename apps/web/{ce/store/timeline/index.ts => core/store/timeline/timeline.store.ts} (95%) diff --git a/apps/web/ce/store/root.store.ts b/apps/web/ce/store/root.store.ts index 9eadadf7259..e1f0c0f7441 100644 --- a/apps/web/ce/store/root.store.ts +++ b/apps/web/ce/store/root.store.ts @@ -6,8 +6,8 @@ // store import { CoreRootStore } from "@/store/root.store"; -import type { ITimelineStore } from "./timeline"; -import { TimeLineStore } from "./timeline"; +import type { ITimelineStore } from "@/store/timeline/timeline.store"; +import { TimeLineStore } from "@/store/timeline/timeline.store"; export class RootStore extends CoreRootStore { timelineStore: ITimelineStore; diff --git a/apps/web/core/hooks/use-timeline-chart.ts b/apps/web/core/hooks/use-timeline-chart.ts index ce9d1d88f07..291362f96f2 100644 --- a/apps/web/core/hooks/use-timeline-chart.ts +++ b/apps/web/core/hooks/use-timeline-chart.ts @@ -9,9 +9,8 @@ import { useContext } from "react"; import { GANTT_TIMELINE_TYPE, type TTimelineTypeCore, type TTimelineType } from "@plane/types"; // lib import { StoreContext } from "@/lib/store-context"; -// plane-web store types -import type { IBaseTimelineStore } from "@/plane-web/store/timeline/base-timeline.store"; -import type { ITimelineStore } from "@/plane-web/store/timeline"; +import type { IBaseTimelineStore } from "@/store/timeline/base-timeline.store"; +import type { ITimelineStore } from "@/store/timeline/timeline.store"; import { useTimeLineType } from "../components/gantt-chart/contexts"; export const getTimelineStore = ( diff --git a/apps/web/ce/store/timeline/base-timeline.store.ts b/apps/web/core/store/timeline/base-timeline.store.ts similarity index 99% rename from apps/web/ce/store/timeline/base-timeline.store.ts rename to apps/web/core/store/timeline/base-timeline.store.ts index b97b2ff7e14..820f548c905 100644 --- a/apps/web/ce/store/timeline/base-timeline.store.ts +++ b/apps/web/core/store/timeline/base-timeline.store.ts @@ -24,7 +24,7 @@ import { } from "@/components/gantt-chart/views/helpers"; // helpers // store -import type { RootStore } from "@/plane-web/store/root.store"; +import type { CoreRootStore as RootStore } from "@/store/root.store"; // types type BlockData = { diff --git a/apps/web/core/store/timeline/issues-timeline.store.ts b/apps/web/core/store/timeline/issues-timeline.store.ts index 9320bf06a3b..3d7bdc92050 100644 --- a/apps/web/core/store/timeline/issues-timeline.store.ts +++ b/apps/web/core/store/timeline/issues-timeline.store.ts @@ -5,10 +5,9 @@ */ import { autorun } from "mobx"; -// Plane-web -import type { RootStore } from "@/plane-web/store/root.store"; -import type { IBaseTimelineStore } from "@/plane-web/store/timeline/base-timeline.store"; -import { BaseTimeLineStore } from "@/plane-web/store/timeline/base-timeline.store"; +import type { CoreRootStore as RootStore } from "@/store/root.store"; +import type { IBaseTimelineStore } from "@/store/timeline/base-timeline.store"; +import { BaseTimeLineStore } from "@/store/timeline/base-timeline.store"; export interface IIssuesTimeLineStore extends IBaseTimelineStore { isDependencyEnabled: boolean; diff --git a/apps/web/core/store/timeline/modules-timeline.store.ts b/apps/web/core/store/timeline/modules-timeline.store.ts index 0b5f0317cee..66989b61855 100644 --- a/apps/web/core/store/timeline/modules-timeline.store.ts +++ b/apps/web/core/store/timeline/modules-timeline.store.ts @@ -5,10 +5,9 @@ */ import { autorun } from "mobx"; -// Store -import type { RootStore } from "@/plane-web/store/root.store"; -import { BaseTimeLineStore } from "@/plane-web/store/timeline/base-timeline.store"; -import type { IBaseTimelineStore } from "@/plane-web/store/timeline/base-timeline.store"; +import type { CoreRootStore as RootStore } from "@/store/root.store"; +import { BaseTimeLineStore } from "@/store/timeline/base-timeline.store"; +import type { IBaseTimelineStore } from "@/store/timeline/base-timeline.store"; export interface IModulesTimeLineStore extends IBaseTimelineStore { isDependencyEnabled: boolean; diff --git a/apps/web/ce/store/timeline/index.ts b/apps/web/core/store/timeline/timeline.store.ts similarity index 95% rename from apps/web/ce/store/timeline/index.ts rename to apps/web/core/store/timeline/timeline.store.ts index 7fe482b93f1..b68d25afa8b 100644 --- a/apps/web/ce/store/timeline/index.ts +++ b/apps/web/core/store/timeline/timeline.store.ts @@ -4,7 +4,7 @@ * See the LICENSE file for details. */ -import type { RootStore } from "@/plane-web/store/root.store"; +import type { CoreRootStore as RootStore } from "@/store/root.store"; import { IssuesTimeLineStore } from "@/store/timeline/issues-timeline.store"; import type { IIssuesTimeLineStore } from "@/store/timeline/issues-timeline.store"; import { ModulesTimeLineStore } from "@/store/timeline/modules-timeline.store"; From 0294af972b2f8987e6f72d476f57e18fb7e121c9 Mon Sep 17 00:00:00 2001 From: Atul Tameshwari Date: Fri, 19 Jun 2026 17:08:39 +0530 Subject: [PATCH 5/7] refactor: remove deprecated root store file and update import paths across the application --- apps/web/ce/store/root.store.ts | 20 ------------ apps/web/core/lib/store-context.tsx | 2 +- apps/web/core/store/issue/root.store.ts | 2 +- apps/web/core/store/member/index.ts | 2 +- .../project/base-project-member.store.ts | 2 +- .../workspace/workspace-member.store.ts | 5 ++- apps/web/core/store/pages/base-page.ts | 2 +- .../core/store/pages/project-page.store.ts | 2 +- apps/web/core/store/pages/project-page.ts | 2 +- apps/web/core/store/root.store.ts | 32 +++++++++++-------- apps/web/core/store/state.store.ts | 4 ++- .../core/store/user/base-permissions.store.ts | 2 +- apps/web/core/store/user/index.ts | 2 +- apps/web/tsconfig.json | 1 - 14 files changed, 35 insertions(+), 45 deletions(-) delete mode 100644 apps/web/ce/store/root.store.ts diff --git a/apps/web/ce/store/root.store.ts b/apps/web/ce/store/root.store.ts deleted file mode 100644 index e1f0c0f7441..00000000000 --- a/apps/web/ce/store/root.store.ts +++ /dev/null @@ -1,20 +0,0 @@ -/** - * Copyright (c) 2023-present Plane Software, Inc. and contributors - * SPDX-License-Identifier: AGPL-3.0-only - * See the LICENSE file for details. - */ - -// store -import { CoreRootStore } from "@/store/root.store"; -import type { ITimelineStore } from "@/store/timeline/timeline.store"; -import { TimeLineStore } from "@/store/timeline/timeline.store"; - -export class RootStore extends CoreRootStore { - timelineStore: ITimelineStore; - - constructor() { - super(); - - this.timelineStore = new TimeLineStore(this); - } -} diff --git a/apps/web/core/lib/store-context.tsx b/apps/web/core/lib/store-context.tsx index 6a5f5c2102e..661d393b925 100644 --- a/apps/web/core/lib/store-context.tsx +++ b/apps/web/core/lib/store-context.tsx @@ -7,7 +7,7 @@ import type { ReactElement } from "react"; import { createContext } from "react"; // plane web store -import { RootStore } from "@/plane-web/store/root.store"; +import { RootStore } from "@/store/root.store"; export let rootStore = new RootStore(); diff --git a/apps/web/core/store/issue/root.store.ts b/apps/web/core/store/issue/root.store.ts index bb1fadff978..f0e6ffeabb0 100644 --- a/apps/web/core/store/issue/root.store.ts +++ b/apps/web/core/store/issue/root.store.ts @@ -12,7 +12,7 @@ import { EIssueServiceType } from "@plane/types"; // plane web store import type { IIssueDetail } from "@/store/issue/issue-details/root.store"; import { IssueDetail } from "@/store/issue/issue-details/root.store"; -import type { RootStore } from "@/plane-web/store/root.store"; +import type { RootStore } from "@/store/root.store"; import type { IWorkspaceMembership } from "@/store/member/workspace/workspace-member.store"; // issues data store import type { IArchivedIssuesFilter, IArchivedIssues } from "./archived"; diff --git a/apps/web/core/store/member/index.ts b/apps/web/core/store/member/index.ts index cc0c98b0d3f..10474ab2b16 100644 --- a/apps/web/core/store/member/index.ts +++ b/apps/web/core/store/member/index.ts @@ -11,7 +11,7 @@ import type { IUserLite } from "@plane/types"; // plane web imports import type { IProjectMemberStore } from "@/store/member/project/base-project-member.store"; import { ProjectMemberStore } from "@/store/member/project/base-project-member.store"; -import type { RootStore } from "@/plane-web/store/root.store"; +import type { RootStore } from "@/store/root.store"; // local imports import type { IWorkspaceMemberStore } from "./workspace/workspace-member.store"; import { WorkspaceMemberStore } from "./workspace/workspace-member.store"; diff --git a/apps/web/core/store/member/project/base-project-member.store.ts b/apps/web/core/store/member/project/base-project-member.store.ts index 140dc398b6e..5ec4c090ecd 100644 --- a/apps/web/core/store/member/project/base-project-member.store.ts +++ b/apps/web/core/store/member/project/base-project-member.store.ts @@ -17,7 +17,7 @@ import type { TProjectMembership, } from "@plane/types"; // plane web imports -import type { RootStore } from "@/plane-web/store/root.store"; +import type { RootStore } from "@/store/root.store"; // services import { ProjectMemberService, ProjectService } from "@/services/project"; // store diff --git a/apps/web/core/store/member/workspace/workspace-member.store.ts b/apps/web/core/store/member/workspace/workspace-member.store.ts index cad57f0aa22..aac30627bc4 100644 --- a/apps/web/core/store/member/workspace/workspace-member.store.ts +++ b/apps/web/core/store/member/workspace/workspace-member.store.ts @@ -20,7 +20,7 @@ import type { IUserStore } from "@/store/user"; import type { IMemberRootStore } from "../index.ts"; import type { IWorkspaceMemberFiltersStore } from "./workspace-member-filters.store"; import { WorkspaceMemberFiltersStore } from "./workspace-member-filters.store"; -import type { RootStore } from "@/plane-web/store/root.store"; +import type { RootStore } from "@/store/root.store"; export interface IWorkspaceMembership { id: string; @@ -282,6 +282,7 @@ export class WorkspaceMemberStore implements IWorkspaceMemberStore { removeMemberFromWorkspace = async (workspaceSlug: string, userId: string) => { const memberDetails = this.getWorkspaceMemberDetails(userId); if (!memberDetails) throw new Error("Member not found"); + // oxlint-disable-next-line promise/always-return await this.workspaceService.deleteWorkspaceMember(workspaceSlug, memberDetails?.id).then(() => { runInAction(() => { set(this.workspaceMemberMap, [workspaceSlug, userId, "is_active"], false); @@ -323,6 +324,7 @@ export class WorkspaceMemberStore implements IWorkspaceMemberStore { invitationId: string, data: Partial ) => { + // oxlint-disable-next-line no-unsafe-optional-chaining const originalMemberInvitations = [...this.workspaceMemberInvitations?.[workspaceSlug]]; // in case of error, we will revert back to original members try { const memberInvitations = originalMemberInvitations?.map((invitation) => ({ @@ -349,6 +351,7 @@ export class WorkspaceMemberStore implements IWorkspaceMemberStore { * @param memberId */ deleteMemberInvitation = async (workspaceSlug: string, invitationId: string) => + // oxlint-disable-next-line promise/always-return await this.workspaceService.deleteWorkspaceInvitations(workspaceSlug.toString(), invitationId).then(() => { runInAction(() => { this.workspaceMemberInvitations[workspaceSlug] = this.workspaceMemberInvitations[workspaceSlug].filter( diff --git a/apps/web/core/store/pages/base-page.ts b/apps/web/core/store/pages/base-page.ts index 05a994aa55e..1936a6bd2c3 100644 --- a/apps/web/core/store/pages/base-page.ts +++ b/apps/web/core/store/pages/base-page.ts @@ -12,7 +12,7 @@ import type { TChangeHandlerProps } from "@plane/propel/emoji-icon-picker"; import type { TDocumentPayload, TLogoProps, TNameDescriptionLoader, TPage } from "@plane/types"; // plane web store import { ExtendedBasePage } from "@/store/pages/extended-base-page"; -import type { RootStore } from "@/plane-web/store/root.store"; +import type { RootStore } from "@/store/root.store"; // local imports import { PageEditorInstance } from "./page-editor-info"; diff --git a/apps/web/core/store/pages/project-page.store.ts b/apps/web/core/store/pages/project-page.store.ts index abb48ab9178..4076aeaace0 100644 --- a/apps/web/core/store/pages/project-page.store.ts +++ b/apps/web/core/store/pages/project-page.store.ts @@ -15,7 +15,7 @@ import { EUserProjectRoles } from "@plane/types"; import { filterPagesByPageType, getPageName, orderPages, shouldFilterPage } from "@plane/utils"; // plane web constants // plane web store -import type { RootStore } from "@/plane-web/store/root.store"; +import type { RootStore } from "@/store/root.store"; // services import { ProjectPageService } from "@/services/page"; // store diff --git a/apps/web/core/store/pages/project-page.ts b/apps/web/core/store/pages/project-page.ts index b3cc1c9922a..5b31fa340b9 100644 --- a/apps/web/core/store/pages/project-page.ts +++ b/apps/web/core/store/pages/project-page.ts @@ -10,7 +10,7 @@ import { computedFn } from "mobx-utils"; import { EPageAccess, EUserPermissions } from "@plane/constants"; import type { TPage } from "@plane/types"; // plane web store -import type { RootStore } from "@/plane-web/store/root.store"; +import type { RootStore } from "@/store/root.store"; // services import { ProjectPageService } from "@/services/page"; const projectPageService = new ProjectPageService(); diff --git a/apps/web/core/store/root.store.ts b/apps/web/core/store/root.store.ts index 80d944a7732..ebca38e41ad 100644 --- a/apps/web/core/store/root.store.ts +++ b/apps/web/core/store/root.store.ts @@ -18,8 +18,9 @@ import type { IStateStore } from "@/store/state.store"; import { StateStore } from "@/store/state.store"; import type { ICommandPaletteStore } from "@/store/base-command-palette.store"; import { CommandPaletteStore } from "@/store/base-command-palette.store"; -import type { RootStore } from "@/plane-web/store/root.store"; import { WorkspaceRootStore } from "@/store/workspace"; +import type { ITimelineStore } from "./timeline/timeline.store"; +import { TimeLineStore } from "./timeline/timeline.store"; // stores import type { ICycleStore } from "./cycle.store"; import { CycleStore } from "./cycle.store"; @@ -101,29 +102,30 @@ export class CoreRootStore { editorAssetStore: IEditorAssetStore; workItemFilters: IWorkItemFilterStore; powerK: IPowerKStore; + timelineStore: ITimelineStore; constructor() { this.router = new RouterStore(); this.commandPalette = new CommandPaletteStore(); this.instance = new InstanceStore(); - this.user = new UserStore(this as unknown as RootStore); + this.user = new UserStore(this); this.theme = new ThemeStore(); - this.workspaceRoot = new WorkspaceRootStore(this as unknown as RootStore); + this.workspaceRoot = new WorkspaceRootStore(this); this.projectRoot = new ProjectRootStore(this); - this.memberRoot = new MemberRootStore(this as unknown as RootStore); + this.memberRoot = new MemberRootStore(this); this.cycle = new CycleStore(this); this.cycleFilter = new CycleFilterStore(this); this.module = new ModulesStore(this); this.moduleFilter = new ModuleFilterStore(this); this.projectView = new ProjectViewStore(this); this.globalView = new GlobalViewStore(this); - this.issue = new IssueRootStore(this as unknown as RootStore); - this.state = new StateStore(this as unknown as RootStore); + this.issue = new IssueRootStore(this); + this.state = new StateStore(this); this.label = new LabelStore(this); this.dashboard = new DashboardStore(this); this.multipleSelect = new MultipleSelectStore(); this.projectInbox = new ProjectInboxStore(this); - this.projectPages = new ProjectPageStore(this as unknown as RootStore); + this.projectPages = new ProjectPageStore(this); this.projectEstimate = new ProjectEstimateStore(this); this.workspaceNotification = new WorkspaceNotificationStore(this); this.favorite = new FavoriteStore(this); @@ -132,6 +134,7 @@ export class CoreRootStore { this.analytics = new AnalyticsStore(); this.workItemFilters = new WorkItemFilterStore(); this.powerK = new PowerKStore(); + this.timelineStore = new TimeLineStore(this); } resetOnSignOut() { @@ -141,22 +144,22 @@ export class CoreRootStore { this.router = new RouterStore(); this.commandPalette = new CommandPaletteStore(); this.instance = new InstanceStore(); - this.user = new UserStore(this as unknown as RootStore); - this.workspaceRoot = new WorkspaceRootStore(this as unknown as RootStore); + this.user = new UserStore(this); + this.workspaceRoot = new WorkspaceRootStore(this); this.projectRoot = new ProjectRootStore(this); - this.memberRoot = new MemberRootStore(this as unknown as RootStore); + this.memberRoot = new MemberRootStore(this); this.cycle = new CycleStore(this); this.cycleFilter = new CycleFilterStore(this); this.module = new ModulesStore(this); this.moduleFilter = new ModuleFilterStore(this); this.projectView = new ProjectViewStore(this); this.globalView = new GlobalViewStore(this); - this.issue = new IssueRootStore(this as unknown as RootStore); - this.state = new StateStore(this as unknown as RootStore); + this.issue = new IssueRootStore(this); + this.state = new StateStore(this); this.label = new LabelStore(this); this.dashboard = new DashboardStore(this); this.projectInbox = new ProjectInboxStore(this); - this.projectPages = new ProjectPageStore(this as unknown as RootStore); + this.projectPages = new ProjectPageStore(this); this.multipleSelect = new MultipleSelectStore(); this.projectEstimate = new ProjectEstimateStore(this); this.workspaceNotification = new WorkspaceNotificationStore(this); @@ -165,5 +168,8 @@ export class CoreRootStore { this.editorAssetStore = new EditorAssetStore(); this.workItemFilters = new WorkItemFilterStore(); this.powerK = new PowerKStore(); + this.timelineStore = new TimeLineStore(this); } } + +export { CoreRootStore as RootStore }; diff --git a/apps/web/core/store/state.store.ts b/apps/web/core/store/state.store.ts index 1e2ad567321..a8c28bd7d5d 100644 --- a/apps/web/core/store/state.store.ts +++ b/apps/web/core/store/state.store.ts @@ -14,7 +14,7 @@ import type { IIntakeState, IState } from "@plane/types"; import { sortStates } from "@plane/utils"; // plane web import { ProjectStateService } from "@/services/project/project-state.service"; -import type { RootStore } from "@/plane-web/store/root.store"; +import type { RootStore } from "@/store/root.store"; export interface IStateStore { //Loaders @@ -126,6 +126,7 @@ export class StateStore implements IStateStore { // Ensure all STATE_GROUPS are present const allGroups = Object.keys(STATE_GROUPS).reduce( (acc, group) => ({ + // oxlint-disable-next-line oxc/no-accumulating-spread ...acc, [group]: groupedStates[group] || [], }), @@ -307,6 +308,7 @@ export class StateStore implements IStateStore { */ deleteState = async (workspaceSlug: string, projectId: string, stateId: string) => { if (!this.stateMap?.[stateId]) return; + // oxlint-disable-next-line promise/always-return await this.stateService.deleteState(workspaceSlug, projectId, stateId).then(() => { runInAction(() => { delete this.stateMap[stateId]; diff --git a/apps/web/core/store/user/base-permissions.store.ts b/apps/web/core/store/user/base-permissions.store.ts index df56559831a..7afa71aad52 100644 --- a/apps/web/core/store/user/base-permissions.store.ts +++ b/apps/web/core/store/user/base-permissions.store.ts @@ -18,7 +18,7 @@ import type { EUserProjectRoles, IUserProjectsRole, IWorkspaceMemberMe, TProject import { EUserWorkspaceRoles } from "@plane/types"; // plane web imports import { WorkspaceService } from "@/services/workspace.service"; -import type { RootStore } from "@/plane-web/store/root.store"; +import type { RootStore } from "@/store/root.store"; // services import projectMemberService from "@/services/project/project-member.service"; import userService from "@/services/user.service"; diff --git a/apps/web/core/store/user/index.ts b/apps/web/core/store/user/index.ts index bdebabc8eb3..6dfb2f78ad9 100644 --- a/apps/web/core/store/user/index.ts +++ b/apps/web/core/store/user/index.ts @@ -10,7 +10,7 @@ import { action, makeObservable, observable, runInAction, computed } from "mobx" import { EUserPermissions, API_BASE_URL } from "@plane/constants"; import type { IUser, TUserPermissions } from "@plane/types"; // plane web imports -import type { RootStore } from "@/plane-web/store/root.store"; +import type { RootStore } from "@/store/root.store"; import type { IUserPermissionStore } from "@/store/user/base-permissions.store"; import { UserPermissionStore } from "@/store/user/base-permissions.store"; // services diff --git a/apps/web/tsconfig.json b/apps/web/tsconfig.json index 2646a6599f6..0a35dbbd576 100644 --- a/apps/web/tsconfig.json +++ b/apps/web/tsconfig.json @@ -6,7 +6,6 @@ "@/app/*": ["./app/*"], "@/helpers/*": ["./helpers/*"], "@/styles/*": ["./styles/*"], - "@/plane-web/*": ["./ce/*"], "package.json": ["./package.json"] }, "strictNullChecks": true, From 89f78c04ee3fb309d4be4f17350a596b1c881340 Mon Sep 17 00:00:00 2001 From: Atul Tameshwari Date: Fri, 19 Jun 2026 17:24:39 +0530 Subject: [PATCH 6/7] refactor: update import paths for store files and correct root store type references --- apps/web/core/store/pages/project-page.store.ts | 3 +-- apps/web/core/store/timeline/base-timeline.store.ts | 2 +- apps/web/core/store/timeline/issues-timeline.store.ts | 2 +- apps/web/core/store/timeline/modules-timeline.store.ts | 2 +- apps/web/core/store/timeline/timeline.store.ts | 2 +- 5 files changed, 5 insertions(+), 6 deletions(-) diff --git a/apps/web/core/store/pages/project-page.store.ts b/apps/web/core/store/pages/project-page.store.ts index 4076aeaace0..4fc70ea7f88 100644 --- a/apps/web/core/store/pages/project-page.store.ts +++ b/apps/web/core/store/pages/project-page.store.ts @@ -15,7 +15,6 @@ import { EUserProjectRoles } from "@plane/types"; import { filterPagesByPageType, getPageName, orderPages, shouldFilterPage } from "@plane/utils"; // plane web constants // plane web store -import type { RootStore } from "@/store/root.store"; // services import { ProjectPageService } from "@/services/page"; // store @@ -81,7 +80,7 @@ export class ProjectPageStore implements IProjectPageStore { service: ProjectPageService; rootStore: CoreRootStore; - constructor(private store: RootStore) { + constructor(private store: CoreRootStore) { makeObservable(this, { // observables loader: observable.ref, diff --git a/apps/web/core/store/timeline/base-timeline.store.ts b/apps/web/core/store/timeline/base-timeline.store.ts index 820f548c905..d5b1a55ecc5 100644 --- a/apps/web/core/store/timeline/base-timeline.store.ts +++ b/apps/web/core/store/timeline/base-timeline.store.ts @@ -24,7 +24,7 @@ import { } from "@/components/gantt-chart/views/helpers"; // helpers // store -import type { CoreRootStore as RootStore } from "@/store/root.store"; +import type { RootStore } from "@/store/root.store"; // types type BlockData = { diff --git a/apps/web/core/store/timeline/issues-timeline.store.ts b/apps/web/core/store/timeline/issues-timeline.store.ts index 3d7bdc92050..54a502b0ffd 100644 --- a/apps/web/core/store/timeline/issues-timeline.store.ts +++ b/apps/web/core/store/timeline/issues-timeline.store.ts @@ -5,7 +5,7 @@ */ import { autorun } from "mobx"; -import type { CoreRootStore as RootStore } from "@/store/root.store"; +import type { RootStore } from "@/store/root.store"; import type { IBaseTimelineStore } from "@/store/timeline/base-timeline.store"; import { BaseTimeLineStore } from "@/store/timeline/base-timeline.store"; diff --git a/apps/web/core/store/timeline/modules-timeline.store.ts b/apps/web/core/store/timeline/modules-timeline.store.ts index 66989b61855..7df60f2bcbb 100644 --- a/apps/web/core/store/timeline/modules-timeline.store.ts +++ b/apps/web/core/store/timeline/modules-timeline.store.ts @@ -5,7 +5,7 @@ */ import { autorun } from "mobx"; -import type { CoreRootStore as RootStore } from "@/store/root.store"; +import type { RootStore } from "@/store/root.store"; import { BaseTimeLineStore } from "@/store/timeline/base-timeline.store"; import type { IBaseTimelineStore } from "@/store/timeline/base-timeline.store"; diff --git a/apps/web/core/store/timeline/timeline.store.ts b/apps/web/core/store/timeline/timeline.store.ts index b68d25afa8b..b74e9cc59e4 100644 --- a/apps/web/core/store/timeline/timeline.store.ts +++ b/apps/web/core/store/timeline/timeline.store.ts @@ -4,7 +4,7 @@ * See the LICENSE file for details. */ -import type { CoreRootStore as RootStore } from "@/store/root.store"; +import type { RootStore } from "@/store/root.store"; import { IssuesTimeLineStore } from "@/store/timeline/issues-timeline.store"; import type { IIssuesTimeLineStore } from "@/store/timeline/issues-timeline.store"; import { ModulesTimeLineStore } from "@/store/timeline/modules-timeline.store"; From 09b373e0d7f1234f4329e0685b741b5be80ffb13 Mon Sep 17 00:00:00 2001 From: Atul Tameshwari Date: Fri, 19 Jun 2026 17:31:53 +0530 Subject: [PATCH 7/7] refactor: standardize import comments and remove 'plane-web' artifacts across various components --- .../(all)/[workspaceSlug]/(projects)/extended-sidebar.tsx | 2 +- apps/web/core/components/issues/delete-issue-modal.tsx | 2 -- .../issues/issue-detail-widgets/relations/content.tsx | 5 ++--- .../issue-detail-widgets/relations/quick-action-button.tsx | 3 ++- .../issues/issue-detail-widgets/relations/title.tsx | 2 +- .../issue-activity/activity/actions/relation.tsx | 5 +++-- .../components/issues/issue-layouts/kanban/kanban-group.tsx | 6 +++--- .../issues/issue-layouts/list/headers/group-by-card.tsx | 3 +-- .../components/issues/issue-layouts/list/list-group.tsx | 5 ++--- apps/web/core/components/issues/relations/issue-list.tsx | 1 - .../core/components/project/create/common-attributes.tsx | 5 +---- apps/web/core/hooks/store/use-project-state.ts | 1 - .../core/store/member/workspace/workspace-member.store.ts | 1 - 13 files changed, 16 insertions(+), 25 deletions(-) diff --git a/apps/web/app/(all)/[workspaceSlug]/(projects)/extended-sidebar.tsx b/apps/web/app/(all)/[workspaceSlug]/(projects)/extended-sidebar.tsx index 4235585ec90..c8f5eb82f5b 100644 --- a/apps/web/app/(all)/[workspaceSlug]/(projects)/extended-sidebar.tsx +++ b/apps/web/app/(all)/[workspaceSlug]/(projects)/extended-sidebar.tsx @@ -14,7 +14,7 @@ import type { EUserWorkspaceRoles } from "@plane/types"; import { useAppTheme } from "@/hooks/store/use-app-theme"; import { useUserPermissions } from "@/hooks/store/user"; import { useWorkspaceNavigationPreferences } from "@/hooks/use-navigation-preferences"; -// plane-web imports +// components import { ExtendedSidebarItem } from "@/components/workspace/sidebar/extended-sidebar-item"; import { ExtendedSidebarWrapper } from "./extended-sidebar-wrapper"; diff --git a/apps/web/core/components/issues/delete-issue-modal.tsx b/apps/web/core/components/issues/delete-issue-modal.tsx index bf789d41a8b..9b70e5c7478 100644 --- a/apps/web/core/components/issues/delete-issue-modal.tsx +++ b/apps/web/core/components/issues/delete-issue-modal.tsx @@ -14,12 +14,10 @@ import { TOAST_TYPE, setToast } from "@plane/propel/toast"; import type { TDeDupeIssue, TIssue } from "@plane/types"; // ui import { AlertModalCore } from "@plane/ui"; -// constants // hooks import { useIssues } from "@/hooks/store/use-issues"; import { useProject } from "@/hooks/store/use-project"; import { useUser, useUserPermissions } from "@/hooks/store/user"; -// plane-web type Props = { isOpen: boolean; diff --git a/apps/web/core/components/issues/issue-detail-widgets/relations/content.tsx b/apps/web/core/components/issues/issue-detail-widgets/relations/content.tsx index 59d8d9d67c4..b552380d184 100644 --- a/apps/web/core/components/issues/issue-detail-widgets/relations/content.tsx +++ b/apps/web/core/components/issues/issue-detail-widgets/relations/content.tsx @@ -13,11 +13,10 @@ import { EIssueServiceType } from "@plane/types"; import { Collapsible } from "@plane/ui"; // components import { CreateUpdateIssueModal } from "@/components/issues/issue-modal/modal"; +import { useTimeLineRelationOptions } from "@/components/relations"; +import { CreateUpdateEpicModal } from "@/components/epic-modal"; // hooks import { useIssueDetail } from "@/hooks/store/use-issue-detail"; -// Plane-web -import { CreateUpdateEpicModal } from "@/components/epic-modal"; -import { useTimeLineRelationOptions } from "@/components/relations"; // helper import { DeleteIssueModal } from "../../delete-issue-modal"; import { RelationIssueList } from "../../relations/issue-list"; diff --git a/apps/web/core/components/issues/issue-detail-widgets/relations/quick-action-button.tsx b/apps/web/core/components/issues/issue-detail-widgets/relations/quick-action-button.tsx index 685f9a49850..c2f41bcf3fa 100644 --- a/apps/web/core/components/issues/issue-detail-widgets/relations/quick-action-button.tsx +++ b/apps/web/core/components/issues/issue-detail-widgets/relations/quick-action-button.tsx @@ -14,8 +14,9 @@ import type { TIssueServiceType } from "@plane/types"; import { CustomMenu } from "@plane/ui"; // hooks import { useIssueDetail } from "@/hooks/store/use-issue-detail"; -// Plane-web +// components import { useTimeLineRelationOptions } from "@/components/relations"; +// types import type { TIssueRelationTypes } from "@plane/types"; type Props = { diff --git a/apps/web/core/components/issues/issue-detail-widgets/relations/title.tsx b/apps/web/core/components/issues/issue-detail-widgets/relations/title.tsx index 1bdf8b4cb28..75e8084958f 100644 --- a/apps/web/core/components/issues/issue-detail-widgets/relations/title.tsx +++ b/apps/web/core/components/issues/issue-detail-widgets/relations/title.tsx @@ -12,7 +12,7 @@ import { EIssueServiceType } from "@plane/types"; import { CollapsibleButton } from "@plane/ui"; // hooks import { useIssueDetail } from "@/hooks/store/use-issue-detail"; -// Plane-web +// components import { useTimeLineRelationOptions } from "@/components/relations"; // local imports import { RelationActionButton } from "./quick-action-button"; diff --git a/apps/web/core/components/issues/issue-detail/issue-activity/activity/actions/relation.tsx b/apps/web/core/components/issues/issue-detail/issue-activity/activity/actions/relation.tsx index 9377d35ce9d..992e3625c12 100644 --- a/apps/web/core/components/issues/issue-detail/issue-activity/activity/actions/relation.tsx +++ b/apps/web/core/components/issues/issue-detail/issue-activity/activity/actions/relation.tsx @@ -5,11 +5,12 @@ */ import { observer } from "mobx-react"; +// types +import type { TIssueRelationTypes } from "@plane/types"; // hooks import { useIssueDetail } from "@/hooks/store/use-issue-detail"; -// Plane-web +// components import { useTimeLineRelationOptions } from "@/components/relations"; -import type { TIssueRelationTypes } from "@plane/types"; // local helpers import { IssueActivityBlockComponent } from "./"; import { getRelationActivityContent } from "./helpers/activity"; diff --git a/apps/web/core/components/issues/issue-layouts/kanban/kanban-group.tsx b/apps/web/core/components/issues/issue-layouts/kanban/kanban-group.tsx index 785abeeb60f..a3dbcb1fe0f 100644 --- a/apps/web/core/components/issues/issue-layouts/kanban/kanban-group.tsx +++ b/apps/web/core/components/issues/issue-layouts/kanban/kanban-group.tsx @@ -28,6 +28,7 @@ import type { import { EIssueLayoutTypes } from "@plane/types"; import { cn } from "@plane/utils"; import type { GroupDropLocation } from "@/components/issues/issue-layouts/utils"; +// components import { highlightIssueOnDrop, getSourceFromDropPayload, @@ -35,13 +36,12 @@ import { getIssueBlockId, } from "@/components/issues/issue-layouts/utils"; import { KanbanIssueBlockLoader } from "@/components/ui/loader/layouts/kanban-layout-loader"; +import { useWorkFlowFDragNDrop } from "@/components/workflow"; // hooks import { useProjectState } from "@/hooks/store/use-project-state"; import { useIntersectionObserver } from "@/hooks/use-intersection-observer"; import { useIssuesStore } from "@/hooks/use-issue-layout-store"; -// Plane-web -import { useWorkFlowFDragNDrop } from "@/components/workflow"; -// +// local imports import { GroupDragOverlay } from "../group-drag-overlay"; import type { TRenderQuickActions } from "../list/list-view-types"; import { KanbanQuickAddIssueButton, QuickAddIssueRoot } from "../quick-add"; diff --git a/apps/web/core/components/issues/issue-layouts/list/headers/group-by-card.tsx b/apps/web/core/components/issues/issue-layouts/list/headers/group-by-card.tsx index 1ffb393a6c1..43614f859c4 100644 --- a/apps/web/core/components/issues/issue-layouts/list/headers/group-by-card.tsx +++ b/apps/web/core/components/issues/issue-layouts/list/headers/group-by-card.tsx @@ -19,11 +19,10 @@ import { cn } from "@plane/utils"; import { ExistingIssuesListModal } from "@/components/core/modals/existing-issues-list-modal"; import { MultipleSelectGroupAction } from "@/components/core/multiple-select"; import { CreateUpdateIssueModal } from "@/components/issues/issue-modal/modal"; +import { CreateUpdateEpicModal } from "@/components/epic-modal"; // constants import { useIssueStoreType } from "@/hooks/use-issue-layout-store"; import type { TSelectionHelper } from "@/hooks/use-multiple-select"; -// plane-web -import { CreateUpdateEpicModal } from "@/components/epic-modal"; interface IHeaderGroupByCard { groupID: string; diff --git a/apps/web/core/components/issues/issue-layouts/list/list-group.tsx b/apps/web/core/components/issues/issue-layouts/list/list-group.tsx index 1af3f642ce8..548918f3a0f 100644 --- a/apps/web/core/components/issues/issue-layouts/list/list-group.tsx +++ b/apps/web/core/components/issues/issue-layouts/list/list-group.tsx @@ -27,14 +27,13 @@ import { Row } from "@plane/ui"; import { cn } from "@plane/utils"; // components import { ListLoaderItemRow } from "@/components/ui/loader/layouts/list-layout-loader"; +import { useWorkFlowFDragNDrop } from "@/components/workflow"; // hooks import { useProjectState } from "@/hooks/store/use-project-state"; import { useIntersectionObserver } from "@/hooks/use-intersection-observer"; import { useIssuesStore } from "@/hooks/use-issue-layout-store"; import type { TSelectionHelper } from "@/hooks/use-multiple-select"; -// Plane-web -import { useWorkFlowFDragNDrop } from "@/components/workflow"; -// +// local imports import { GroupDragOverlay } from "../group-drag-overlay"; import { ListQuickAddIssueButton, QuickAddIssueRoot } from "../quick-add"; import type { GroupDropLocation } from "../utils"; diff --git a/apps/web/core/components/issues/relations/issue-list.tsx b/apps/web/core/components/issues/relations/issue-list.tsx index 6a6e52a4d8c..1da83ae2a1a 100644 --- a/apps/web/core/components/issues/relations/issue-list.tsx +++ b/apps/web/core/components/issues/relations/issue-list.tsx @@ -9,7 +9,6 @@ import { observer } from "mobx-react"; // plane imports import type { TIssue, TIssueServiceType } from "@plane/types"; import { EIssueServiceType } from "@plane/types"; -// Plane-web imports import type { TIssueRelationTypes } from "@plane/types"; // local imports import { RelationIssueListItem } from "./issue-list-item"; diff --git a/apps/web/core/components/project/create/common-attributes.tsx b/apps/web/core/components/project/create/common-attributes.tsx index 6dace57734e..ec995a5a4a8 100644 --- a/apps/web/core/components/project/create/common-attributes.tsx +++ b/apps/web/core/components/project/create/common-attributes.tsx @@ -11,14 +11,11 @@ import { InfoIcon } from "@plane/propel/icons"; // plane imports import { ETabIndices } from "@plane/constants"; import { useTranslation } from "@plane/i18n"; +import type { TProject } from "@plane/types"; // ui import { Tooltip } from "@plane/propel/tooltip"; import { Input, TextArea } from "@plane/ui"; import { cn, projectIdentifierSanitizer, getTabIndex } from "@plane/utils"; -// plane utils -// helpers -// plane-web types -import type { TProject } from "@plane/types"; type Props = { setValue: UseFormSetValue; diff --git a/apps/web/core/hooks/store/use-project-state.ts b/apps/web/core/hooks/store/use-project-state.ts index 3221bf136b1..566461e8cbc 100644 --- a/apps/web/core/hooks/store/use-project-state.ts +++ b/apps/web/core/hooks/store/use-project-state.ts @@ -7,7 +7,6 @@ import { useContext } from "react"; // mobx store import { StoreContext } from "@/lib/store-context"; -// Plane-web import type { IStateStore } from "@/store/state.store"; export const useProjectState = (): IStateStore => { diff --git a/apps/web/core/store/member/workspace/workspace-member.store.ts b/apps/web/core/store/member/workspace/workspace-member.store.ts index aac30627bc4..2c394a71193 100644 --- a/apps/web/core/store/member/workspace/workspace-member.store.ts +++ b/apps/web/core/store/member/workspace/workspace-member.store.ts @@ -10,7 +10,6 @@ import { computedFn } from "mobx-utils"; // types import type { EUserPermissions } from "@plane/constants"; import type { IWorkspaceBulkInviteFormData, IWorkspaceMember, IWorkspaceMemberInvitation } from "@plane/types"; -// plane-web constants // services import { WorkspaceService } from "@/services/workspace.service"; // types