mirror of
https://github.com/makeplane/plane
synced 2025-08-07 19:59:33 +00:00
Compare commits
3 Commits
fix/active
...
chore/root
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
950b7a8f46 | ||
|
|
98a0742d5c | ||
|
|
efbd23838e |
8
web/ce/store/root.store.ts
Normal file
8
web/ce/store/root.store.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
// store
|
||||
import { CoreRootStore } from "@/store/root.store";
|
||||
|
||||
export class RootStore extends CoreRootStore {
|
||||
constructor() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
@@ -9,10 +9,10 @@ import { DeletePageModal } from "@/components/pages";
|
||||
// helpers
|
||||
import { copyUrlToClipboard } from "@/helpers/string.helper";
|
||||
// store
|
||||
import { IPageStore } from "@/store/pages/page.store";
|
||||
import { IPage } from "@/store/pages/page";
|
||||
|
||||
type Props = {
|
||||
page: IPageStore;
|
||||
page: IPage;
|
||||
pageLink: string;
|
||||
parentRef: React.RefObject<HTMLElement>;
|
||||
};
|
||||
|
||||
@@ -22,7 +22,7 @@ import { usePageFilters } from "@/hooks/use-page-filters";
|
||||
// services
|
||||
import { FileService } from "@/services/file.service";
|
||||
// store
|
||||
import { IPageStore } from "@/store/pages/page.store";
|
||||
import { IPage } from "@/store/pages/page";
|
||||
|
||||
const fileService = new FileService();
|
||||
|
||||
@@ -30,7 +30,7 @@ type Props = {
|
||||
editorRef: React.RefObject<EditorRefApi>;
|
||||
readOnlyEditorRef: React.RefObject<EditorReadOnlyRefApi>;
|
||||
markings: IMarking[];
|
||||
page: IPageStore;
|
||||
page: IPage;
|
||||
sidePeekVisible: boolean;
|
||||
handleEditorReady: (value: boolean) => void;
|
||||
handleReadOnlyEditorReady: (value: boolean) => void;
|
||||
|
||||
@@ -15,12 +15,12 @@ import { renderFormattedDate } from "@/helpers/date-time.helper";
|
||||
// hooks
|
||||
import { useInstance } from "@/hooks/store";
|
||||
// store
|
||||
import { IPageStore } from "@/store/pages/page.store";
|
||||
import { IPage } from "@/store/pages/page";
|
||||
|
||||
type Props = {
|
||||
editorRef: React.RefObject<EditorRefApi>;
|
||||
handleDuplicatePage: () => void;
|
||||
page: IPageStore;
|
||||
page: IPage;
|
||||
readOnlyEditorRef: React.RefObject<EditorReadOnlyRefApi>;
|
||||
};
|
||||
|
||||
|
||||
@@ -4,10 +4,10 @@ import { Calendar, History, Info } from "lucide-react";
|
||||
// helpers
|
||||
import { renderFormattedDate } from "@/helpers/date-time.helper";
|
||||
// store
|
||||
import { IPageStore } from "@/store/pages/page.store";
|
||||
import { IPage } from "@/store/pages/page";
|
||||
|
||||
type Props = {
|
||||
page: IPageStore;
|
||||
page: IPage;
|
||||
};
|
||||
|
||||
export const PageInfoPopover: React.FC<Props> = (props) => {
|
||||
|
||||
@@ -5,14 +5,14 @@ import { PageExtraOptions, PageSummaryPopover, PageToolbar } from "@/components/
|
||||
// hooks
|
||||
import { usePageFilters } from "@/hooks/use-page-filters";
|
||||
// store
|
||||
import { IPageStore } from "@/store/pages/page.store";
|
||||
import { IPage } from "@/store/pages/page";
|
||||
|
||||
type Props = {
|
||||
editorRef: React.RefObject<EditorRefApi>;
|
||||
readOnlyEditorRef: React.RefObject<EditorReadOnlyRefApi>;
|
||||
handleDuplicatePage: () => void;
|
||||
markings: IMarking[];
|
||||
page: IPageStore;
|
||||
page: IPage;
|
||||
sidePeekVisible: boolean;
|
||||
setSidePeekVisible: (sidePeekState: boolean) => void;
|
||||
editorReady: boolean;
|
||||
|
||||
@@ -11,14 +11,13 @@ import { copyTextToClipboard, copyUrlToClipboard } from "@/helpers/string.helper
|
||||
// hooks
|
||||
import { useAppRouter } from "@/hooks/store";
|
||||
import { usePageFilters } from "@/hooks/use-page-filters";
|
||||
|
||||
// store
|
||||
import { IPageStore } from "@/store/pages/page.store";
|
||||
import { IPage } from "@/store/pages/page";
|
||||
|
||||
type Props = {
|
||||
editorRef: EditorRefApi | EditorReadOnlyRefApi | null;
|
||||
handleDuplicatePage: () => void;
|
||||
page: IPageStore;
|
||||
page: IPage;
|
||||
};
|
||||
|
||||
export const PageOptionsDropdown: React.FC<Props> = observer((props) => {
|
||||
|
||||
@@ -7,14 +7,14 @@ import { cn } from "@/helpers/common.helper";
|
||||
// hooks
|
||||
import { usePageFilters } from "@/hooks/use-page-filters";
|
||||
// store
|
||||
import { IPageStore } from "@/store/pages/page.store";
|
||||
import { IPage } from "@/store/pages/page";
|
||||
|
||||
type Props = {
|
||||
editorRef: React.RefObject<EditorRefApi>;
|
||||
readOnlyEditorRef: React.RefObject<EditorReadOnlyRefApi>;
|
||||
handleDuplicatePage: () => void;
|
||||
markings: IMarking[];
|
||||
page: IPageStore;
|
||||
page: IPage;
|
||||
sidePeekVisible: boolean;
|
||||
setSidePeekVisible: (sidePeekState: boolean) => void;
|
||||
editorReady: boolean;
|
||||
|
||||
@@ -2,13 +2,13 @@ import { useContext } from "react";
|
||||
// mobx store
|
||||
import { StoreContext } from "@/lib/store-context";
|
||||
// mobx store
|
||||
import { IPageStore } from "@/store/pages/page.store";
|
||||
import { IPage } from "@/store/pages/page";
|
||||
|
||||
export const usePage = (pageId: string | undefined): IPageStore => {
|
||||
export const usePage = (pageId: string | undefined): IPage => {
|
||||
const context = useContext(StoreContext);
|
||||
if (context === undefined) throw new Error("usePage must be used within StoreProvider");
|
||||
|
||||
if (!pageId) return {} as IPageStore;
|
||||
if (!pageId) return {} as IPage;
|
||||
|
||||
return context.projectPages.data?.[pageId] ?? {};
|
||||
};
|
||||
|
||||
@@ -7,12 +7,12 @@ import { EditorRefApi, generateJSONfromHTML } from "@plane/editor-core";
|
||||
import useReloadConfirmations from "@/hooks/use-reload-confirmation";
|
||||
// services
|
||||
import { ProjectPageService } from "@/services/page";
|
||||
import { IPageStore } from "@/store/pages/page.store";
|
||||
import { IPage } from "@/store/pages/page";
|
||||
const projectPageService = new ProjectPageService();
|
||||
|
||||
type Props = {
|
||||
editorRef: React.RefObject<EditorRefApi>;
|
||||
page: IPageStore;
|
||||
page: IPage;
|
||||
projectId: string | string[] | undefined;
|
||||
workspaceSlug: string | string[] | undefined;
|
||||
};
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
"use client";
|
||||
|
||||
import { ReactElement, createContext } from "react";
|
||||
// mobx store
|
||||
import { RootStore } from "@/store/root.store";
|
||||
// plane web store
|
||||
import { RootStore } from "@/plane-web/store/root.store";
|
||||
|
||||
export let rootStore = new RootStore();
|
||||
|
||||
|
||||
@@ -8,13 +8,13 @@ import { ICycle, CycleDateCheckData, TCyclePlotType } from "@plane/types";
|
||||
// helpers
|
||||
import { orderCycles, shouldFilterCycle } from "@/helpers/cycle.helper";
|
||||
import { getDate } from "@/helpers/date-time.helper";
|
||||
// plane web store
|
||||
import { RootStore } from "@/plane-web/store/root.store";
|
||||
// services
|
||||
import { CycleService } from "@/services/cycle.service";
|
||||
import { CycleArchiveService } from "@/services/cycle_archive.service";
|
||||
import { IssueService } from "@/services/issue";
|
||||
import { ProjectService } from "@/services/project";
|
||||
// store
|
||||
import { RootStore } from "@/store/root.store";
|
||||
|
||||
export interface ICycleStore {
|
||||
// loaders
|
||||
|
||||
@@ -3,8 +3,8 @@ import { action, computed, observable, makeObservable, runInAction, reaction } f
|
||||
import { computedFn } from "mobx-utils";
|
||||
// types
|
||||
import { TCycleDisplayFilters, TCycleFilters, TCycleFiltersByState } from "@plane/types";
|
||||
// store
|
||||
import { RootStore } from "@/store/root.store";
|
||||
// plane web store
|
||||
import { RootStore } from "@/plane-web/store/root.store";
|
||||
|
||||
export interface ICycleFilterStore {
|
||||
// observables
|
||||
|
||||
@@ -10,10 +10,10 @@ import {
|
||||
TWidgetKeys,
|
||||
TWidgetStatsRequestParams,
|
||||
} from "@plane/types";
|
||||
// plane web store
|
||||
import { RootStore } from "@/plane-web/store/root.store";
|
||||
// services
|
||||
import { DashboardService } from "@/services/dashboard.service";
|
||||
// stores
|
||||
import { RootStore } from "@/store/root.store";
|
||||
|
||||
export interface IDashboardStore {
|
||||
// error states
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
import set from "lodash/set";
|
||||
import { action, computed, makeObservable, observable, runInAction } from "mobx";
|
||||
// types
|
||||
import { IEstimate, IEstimatePoint as IEstimatePointType } from "@plane/types";
|
||||
// plane web store
|
||||
import { RootStore } from "@/plane-web/store/root.store";
|
||||
// services
|
||||
import estimateService from "@/services/project/estimate.service";
|
||||
// store
|
||||
import { RootStore } from "@/store/root.store";
|
||||
|
||||
type TErrorCodes = {
|
||||
status: string;
|
||||
|
||||
@@ -3,6 +3,7 @@ import set from "lodash/set";
|
||||
import unset from "lodash/unset";
|
||||
import { action, computed, makeObservable, observable, runInAction } from "mobx";
|
||||
import { computedFn } from "mobx-utils";
|
||||
// types
|
||||
import {
|
||||
IEstimate as IEstimateType,
|
||||
IEstimatePoint as IEstimatePointType,
|
||||
@@ -10,11 +11,12 @@ import {
|
||||
IEstimateFormData,
|
||||
TEstimatePointsObject,
|
||||
} from "@plane/types";
|
||||
// plane web store
|
||||
import { RootStore } from "@/plane-web/store/root.store";
|
||||
// services
|
||||
import estimateService from "@/services/project/estimate.service";
|
||||
// store
|
||||
import { IEstimatePoint, EstimatePoint } from "@/store/estimates/estimate-point";
|
||||
import { RootStore } from "@/store/root.store";
|
||||
|
||||
type TErrorCodes = {
|
||||
status: string;
|
||||
|
||||
@@ -4,12 +4,14 @@ import unset from "lodash/unset";
|
||||
import update from "lodash/update";
|
||||
import { action, computed, makeObservable, observable, runInAction } from "mobx";
|
||||
import { computedFn } from "mobx-utils";
|
||||
// types
|
||||
import { IEstimate as IEstimateType, IEstimateFormData } from "@plane/types";
|
||||
// plane web store
|
||||
import { RootStore } from "@/plane-web/store/root.store";
|
||||
// services
|
||||
import estimateService from "@/services/project/estimate.service";
|
||||
// store
|
||||
import { IEstimate, Estimate } from "@/store/estimates/estimate";
|
||||
import { RootStore } from "@/store/root.store";
|
||||
|
||||
type TEstimateLoader = "init-loader" | "mutation-loader" | undefined;
|
||||
type TErrorCodes = {
|
||||
|
||||
@@ -14,7 +14,8 @@ import {
|
||||
getWorkspaceEventPayload,
|
||||
getPageEventPayload,
|
||||
} from "@/constants/event-tracker";
|
||||
import { RootStore } from "./root.store";
|
||||
// plane web store
|
||||
import { RootStore } from "@/plane-web/store/root.store";
|
||||
|
||||
export interface IEventTrackerStore {
|
||||
// properties
|
||||
|
||||
@@ -7,10 +7,10 @@ import { computedFn } from "mobx-utils";
|
||||
import { IIssueFilterOptions, IWorkspaceView } from "@plane/types";
|
||||
// constants
|
||||
import { EIssueFilterType } from "@/constants/issue";
|
||||
// plane web store
|
||||
import { RootStore } from "@/plane-web/store/root.store";
|
||||
// services
|
||||
import { WorkspaceService } from "@/services/workspace.service";
|
||||
// types
|
||||
import { RootStore } from "@/store/root.store";
|
||||
|
||||
export interface IGlobalViewStore {
|
||||
// observables
|
||||
|
||||
@@ -4,11 +4,11 @@ import { makeObservable, observable, runInAction, action } from "mobx";
|
||||
import { TIssue, TInboxIssue, TInboxIssueStatus, TInboxDuplicateIssueDetails } from "@plane/types";
|
||||
// helpers
|
||||
import { EInboxIssueStatus } from "@/helpers/inbox.helper";
|
||||
// plane web store
|
||||
import { RootStore } from "@/plane-web/store/root.store";
|
||||
// services
|
||||
import { InboxIssueService } from "@/services/inbox";
|
||||
import { IssueService } from "@/services/issue";
|
||||
// root store
|
||||
import { RootStore } from "@/store/root.store";
|
||||
|
||||
export interface IInboxIssueStore {
|
||||
isLoading: boolean;
|
||||
@@ -44,7 +44,12 @@ export class InboxIssueStore implements IInboxIssueStore {
|
||||
inboxIssueService;
|
||||
issueService;
|
||||
|
||||
constructor(workspaceSlug: string, projectId: string, data: TInboxIssue, private store: RootStore) {
|
||||
constructor(
|
||||
workspaceSlug: string,
|
||||
projectId: string,
|
||||
data: TInboxIssue,
|
||||
private store: RootStore
|
||||
) {
|
||||
this.id = data.id;
|
||||
this.status = data.status;
|
||||
this.issue = data?.issue;
|
||||
|
||||
@@ -15,11 +15,12 @@ import {
|
||||
} from "@plane/types";
|
||||
// helpers
|
||||
import { EInboxIssueCurrentTab, EInboxIssueStatus, EPastDurationFilters, getCustomDates } from "@/helpers/inbox.helper";
|
||||
// plane web store
|
||||
import { RootStore } from "@/plane-web/store/root.store";
|
||||
// services
|
||||
import { InboxIssueService } from "@/services/inbox";
|
||||
// root store
|
||||
import { IInboxIssueStore, InboxIssueStore } from "@/store/inbox/inbox-issue.store";
|
||||
import { RootStore } from "@/store/root.store";
|
||||
|
||||
type TLoader =
|
||||
| "init-loading"
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
import { action, computed, makeObservable, observable } from "mobx";
|
||||
import { computedFn } from "mobx-utils";
|
||||
import { IssueRootStore } from "./root.store";
|
||||
import { TIssueGroupByOptions } from "@plane/types";
|
||||
import { DRAG_ALLOWED_GROUPS } from "@/constants/issue";
|
||||
// types
|
||||
import { TIssueGroupByOptions } from "@plane/types";
|
||||
// constants
|
||||
import { DRAG_ALLOWED_GROUPS } from "@/constants/issue";
|
||||
// store
|
||||
import { IssueRootStore } from "./root.store";
|
||||
|
||||
export interface IIssueKanBanViewStore {
|
||||
kanBanToggle: {
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
import isEmpty from "lodash/isEmpty";
|
||||
import { autorun, makeObservable, observable } from "mobx";
|
||||
import { ICycle, IIssueLabel, IModule, IProject, IState, IUserLite } from "@plane/types";
|
||||
// plane web store
|
||||
import { RootStore } from "@/plane-web/store/root.store";
|
||||
// root store
|
||||
import { IWorkspaceMembership } from "@/store/member/workspace-member.store";
|
||||
import { RootStore } from "../root.store";
|
||||
import { IStateStore, StateStore } from "../state.store";
|
||||
// issues data store
|
||||
import { IArchivedIssuesFilter, ArchivedIssuesFilter, IArchivedIssues, ArchivedIssues } from "./archived";
|
||||
|
||||
@@ -6,10 +6,10 @@ import { computedFn } from "mobx-utils";
|
||||
import { IIssueLabel, IIssueLabelTree } from "@plane/types";
|
||||
// helpers
|
||||
import { buildTree } from "@/helpers/array.helper";
|
||||
// plane web store
|
||||
import { RootStore } from "@/plane-web/store/root.store";
|
||||
// services
|
||||
import { IssueLabelService } from "@/services/issue";
|
||||
// store
|
||||
import { RootStore } from "@/store/root.store";
|
||||
|
||||
export interface ILabelStore {
|
||||
//Loaders
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import { action, makeObservable, observable } from "mobx";
|
||||
// types
|
||||
import { IUserLite } from "@plane/types";
|
||||
import { RootStore } from "@/store/root.store";
|
||||
// plane web store
|
||||
import { RootStore } from "@/plane-web/store/root.store";
|
||||
import { IProjectMemberStore, ProjectMemberStore } from "./project-member.store";
|
||||
import { IWorkspaceMemberStore, WorkspaceMemberStore } from "./workspace-member.store";
|
||||
|
||||
|
||||
@@ -6,10 +6,11 @@ import { computedFn } from "mobx-utils";
|
||||
import { IProjectBulkAddFormData, IProjectMember, IProjectMembership, IUserLite } from "@plane/types";
|
||||
// constants
|
||||
import { EUserProjectRoles } from "@/constants/project";
|
||||
// plane web store
|
||||
import { RootStore } from "@/plane-web/store/root.store";
|
||||
// services
|
||||
import { ProjectMemberService } from "@/services/project";
|
||||
// store
|
||||
import { RootStore } from "@/store/root.store";
|
||||
import { IRouterStore } from "@/store/router.store";
|
||||
import { IUserStore } from "@/store/user";
|
||||
import { IMemberRootStore } from ".";
|
||||
|
||||
@@ -6,10 +6,11 @@ import { computedFn } from "mobx-utils";
|
||||
import { IWorkspaceBulkInviteFormData, IWorkspaceMember, IWorkspaceMemberInvitation } from "@plane/types";
|
||||
// constants
|
||||
import { EUserWorkspaceRoles } from "@/constants/workspace";
|
||||
// plane web store
|
||||
import { RootStore } from "@/plane-web/store/root.store";
|
||||
// services
|
||||
import { WorkspaceService } from "@/services/workspace.service";
|
||||
// types
|
||||
import { RootStore } from "@/store/root.store";
|
||||
import { IRouterStore } from "@/store/router.store";
|
||||
import { IUserStore } from "@/store/user";
|
||||
import { IMemberRootStore } from ".";
|
||||
|
||||
@@ -8,12 +8,12 @@ import { computedFn } from "mobx-utils";
|
||||
import { IModule, ILinkDetails, TModulePlotType } from "@plane/types";
|
||||
// helpers
|
||||
import { orderModules, shouldFilterModule } from "@/helpers/module.helper";
|
||||
// plane web store
|
||||
import { RootStore } from "@/plane-web/store/root.store";
|
||||
// services
|
||||
import { ModuleService } from "@/services/module.service";
|
||||
import { ModuleArchiveService } from "@/services/module_archive.service";
|
||||
import { ProjectService } from "@/services/project";
|
||||
// store
|
||||
import { RootStore } from "@/store/root.store";
|
||||
|
||||
export interface IModuleStore {
|
||||
//Loaders
|
||||
|
||||
@@ -3,8 +3,8 @@ import { action, computed, observable, makeObservable, runInAction, reaction } f
|
||||
import { computedFn } from "mobx-utils";
|
||||
// types
|
||||
import { TModuleDisplayFilters, TModuleFilters, TModuleFiltersByState } from "@plane/types";
|
||||
// store
|
||||
import { RootStore } from "@/store/root.store";
|
||||
// plane web store
|
||||
import { RootStore } from "@/plane-web/store/root.store";
|
||||
|
||||
export interface IModuleFilterStore {
|
||||
// observables
|
||||
|
||||
@@ -5,13 +5,14 @@ import { TLogoProps, TPage } from "@plane/types";
|
||||
// constants
|
||||
import { EPageAccess } from "@/constants/page";
|
||||
import { EUserProjectRoles } from "@/constants/project";
|
||||
// plane web store
|
||||
import { RootStore } from "@/plane-web/store/root.store";
|
||||
// services
|
||||
import { ProjectPageService } from "@/services/page";
|
||||
import { RootStore } from "../root.store";
|
||||
|
||||
export type TLoader = "submitting" | "submitted" | "saved";
|
||||
|
||||
export interface IPageStore extends TPage {
|
||||
export interface IPage extends TPage {
|
||||
// observables
|
||||
isSubmitting: TLoader;
|
||||
// computed
|
||||
@@ -43,7 +44,7 @@ export interface IPageStore extends TPage {
|
||||
removeFromFavorites: () => Promise<void>;
|
||||
}
|
||||
|
||||
export class PageStore implements IPageStore {
|
||||
export class Page implements IPage {
|
||||
// loaders
|
||||
isSubmitting: TLoader = "saved";
|
||||
// page properties
|
||||
@@ -6,11 +6,12 @@ import { computedFn } from "mobx-utils";
|
||||
import { TPage, TPageFilters, TPageNavigationTabs } from "@plane/types";
|
||||
// helpers
|
||||
import { filterPagesByPageType, getPageName, orderPages, shouldFilterPage } from "@/helpers/page.helper";
|
||||
// plane web store
|
||||
import { RootStore } from "@/plane-web/store/root.store";
|
||||
// services
|
||||
import { ProjectPageService } from "@/services/page";
|
||||
// store
|
||||
import { IPageStore, PageStore } from "@/store/pages/page.store";
|
||||
import { RootStore } from "../root.store";
|
||||
import { IPage, Page } from "@/store/pages/page";
|
||||
|
||||
type TLoader = "init-loader" | "mutation-loader" | undefined;
|
||||
|
||||
@@ -19,7 +20,7 @@ type TError = { title: string; description: string };
|
||||
export interface IProjectPageStore {
|
||||
// observables
|
||||
loader: TLoader;
|
||||
data: Record<string, IPageStore>; // pageId => PageStore
|
||||
data: Record<string, IPage>; // pageId => Page
|
||||
error: TError | undefined;
|
||||
filters: TPageFilters;
|
||||
// computed
|
||||
@@ -27,7 +28,7 @@ export interface IProjectPageStore {
|
||||
// helper actions
|
||||
getCurrentProjectPageIds: (pageType: TPageNavigationTabs) => string[] | undefined;
|
||||
getCurrentProjectFilteredPageIds: (pageType: TPageNavigationTabs) => string[] | undefined;
|
||||
pageById: (pageId: string) => IPageStore | undefined;
|
||||
pageById: (pageId: string) => IPage | undefined;
|
||||
updateFilters: <T extends keyof TPageFilters>(filterKey: T, filterValue: TPageFilters[T]) => void;
|
||||
clearAllFilters: () => void;
|
||||
// actions
|
||||
@@ -40,7 +41,7 @@ export interface IProjectPageStore {
|
||||
export class ProjectPageStore implements IProjectPageStore {
|
||||
// observables
|
||||
loader: TLoader = "init-loader";
|
||||
data: Record<string, IPageStore> = {}; // pageId => PageStore
|
||||
data: Record<string, IPage> = {}; // pageId => Page
|
||||
error: TError | undefined = undefined;
|
||||
filters: TPageFilters = {
|
||||
searchQuery: "",
|
||||
@@ -161,7 +162,7 @@ export class ProjectPageStore implements IProjectPageStore {
|
||||
|
||||
const pages = await this.service.fetchAll(workspaceSlug, projectId);
|
||||
runInAction(() => {
|
||||
for (const page of pages) if (page?.id) set(this.data, [page.id], new PageStore(this.store, page));
|
||||
for (const page of pages) if (page?.id) set(this.data, [page.id], new Page(this.store, page));
|
||||
this.loader = undefined;
|
||||
});
|
||||
|
||||
@@ -195,7 +196,7 @@ export class ProjectPageStore implements IProjectPageStore {
|
||||
|
||||
const page = await this.service.fetchById(workspaceSlug, projectId, pageId);
|
||||
runInAction(() => {
|
||||
if (page?.id) set(this.data, [page.id], new PageStore(this.store, page));
|
||||
if (page?.id) set(this.data, [page.id], new Page(this.store, page));
|
||||
this.loader = undefined;
|
||||
});
|
||||
|
||||
@@ -228,7 +229,7 @@ export class ProjectPageStore implements IProjectPageStore {
|
||||
|
||||
const page = await this.service.create(workspaceSlug, projectId, pageData);
|
||||
runInAction(() => {
|
||||
if (page?.id) set(this.data, [page.id], new PageStore(this.store, page));
|
||||
if (page?.id) set(this.data, [page.id], new Page(this.store, page));
|
||||
this.loader = undefined;
|
||||
});
|
||||
|
||||
|
||||
@@ -3,9 +3,10 @@ import { observable, action, makeObservable, runInAction, computed } from "mobx"
|
||||
import { computedFn } from "mobx-utils";
|
||||
// types
|
||||
import { IProjectView } from "@plane/types";
|
||||
// plane web store
|
||||
import { RootStore } from "@/plane-web/store/root.store";
|
||||
// services
|
||||
import { ViewService } from "@/services/view.service";
|
||||
import { RootStore } from "@/store/root.store";
|
||||
|
||||
export interface IProjectViewStore {
|
||||
//Loaders
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { RootStore } from "@/store/root.store";
|
||||
// plane web store
|
||||
import { RootStore } from "@/plane-web/store/root.store";
|
||||
import { IProjectPublishStore, ProjectPublishStore } from "./project-publish.store";
|
||||
import { IProjectStore, ProjectStore } from "./project.store";
|
||||
import { IProjectFilterStore, ProjectFilterStore } from "./project_filter.store";
|
||||
|
||||
@@ -6,11 +6,11 @@ import { computedFn } from "mobx-utils";
|
||||
import { IProject } from "@plane/types";
|
||||
// helpers
|
||||
import { orderProjects, shouldFilterProject } from "@/helpers/project.helper";
|
||||
// plane web store
|
||||
import { RootStore } from "@/plane-web/store/root.store";
|
||||
// services
|
||||
import { IssueLabelService, IssueService } from "@/services/issue";
|
||||
import { ProjectService, ProjectStateService, ProjectArchiveService } from "@/services/project";
|
||||
// store
|
||||
import { RootStore } from "../root.store";
|
||||
|
||||
export interface IProjectStore {
|
||||
// observables
|
||||
|
||||
@@ -3,8 +3,8 @@ import { action, computed, observable, makeObservable, runInAction, reaction } f
|
||||
import { computedFn } from "mobx-utils";
|
||||
// types
|
||||
import { TProjectDisplayFilters, TProjectFilters, TProjectAppliedDisplayFilterKeys } from "@plane/types";
|
||||
// store
|
||||
import { RootStore } from "@/store/root.store";
|
||||
// plane web store
|
||||
import { RootStore } from "@/plane-web/store/root.store";
|
||||
|
||||
export interface IProjectFilterStore {
|
||||
// observables
|
||||
|
||||
@@ -26,7 +26,7 @@ import { IWorkspaceRootStore, WorkspaceRootStore } from "./workspace";
|
||||
|
||||
enableStaticRendering(typeof window === "undefined");
|
||||
|
||||
export class RootStore {
|
||||
export class CoreRootStore {
|
||||
workspaceRoot: IWorkspaceRootStore;
|
||||
projectRoot: IProjectRootStore;
|
||||
memberRoot: IMemberRootStore;
|
||||
|
||||
@@ -2,14 +2,14 @@ import groupBy from "lodash/groupBy";
|
||||
import set from "lodash/set";
|
||||
import { makeObservable, observable, computed, action, runInAction } from "mobx";
|
||||
import { computedFn } from "mobx-utils";
|
||||
import { IState } from "@plane/types";
|
||||
// store
|
||||
import { sortStates } from "@/helpers/state.helper";
|
||||
import { ProjectStateService } from "@/services/project";
|
||||
import { RootStore } from "./root.store";
|
||||
// types
|
||||
// services
|
||||
import { IState } from "@plane/types";
|
||||
// helpers
|
||||
import { sortStates } from "@/helpers/state.helper";
|
||||
// plane web store
|
||||
import { RootStore } from "@/plane-web/store/root.store";
|
||||
// services
|
||||
import { ProjectStateService } from "@/services/project";
|
||||
|
||||
export interface IStateStore {
|
||||
//Loaders
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { action, observable, makeObservable } from "mobx";
|
||||
// store types
|
||||
import { RootStore } from "@/store/root.store";
|
||||
// plane web store
|
||||
import { RootStore } from "@/plane-web/store/root.store";
|
||||
|
||||
export interface IThemeStore {
|
||||
// observables
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
import set from "lodash/set";
|
||||
import { makeObservable, observable } from "mobx";
|
||||
// types
|
||||
import { IUserAccount } from "@plane/types";
|
||||
// plane web store
|
||||
import { RootStore } from "@/plane-web/store/root.store";
|
||||
// services
|
||||
import { UserService } from "@/services/user.service";
|
||||
// stores
|
||||
import { RootStore } from "@/store/root.store";
|
||||
|
||||
export interface IAccountStore {
|
||||
// observables
|
||||
|
||||
@@ -5,11 +5,12 @@ import { action, makeObservable, observable, runInAction } from "mobx";
|
||||
import { IUser } from "@plane/types";
|
||||
// helpers
|
||||
import { API_BASE_URL } from "@/helpers/common.helper";
|
||||
// plane web store
|
||||
import { RootStore } from "@/plane-web/store/root.store";
|
||||
// services
|
||||
import { AuthService } from "@/services/auth.service";
|
||||
import { UserService } from "@/services/user.service";
|
||||
// stores
|
||||
import { RootStore } from "@/store/root.store";
|
||||
import { IAccountStore } from "@/store/user/account.store";
|
||||
import { ProfileStore, IUserProfileStore } from "@/store/user/profile.store";
|
||||
import { IUserMembershipStore, UserMembershipStore } from "@/store/user/user-membership.store";
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
import cloneDeep from "lodash/cloneDeep";
|
||||
import set from "lodash/set";
|
||||
import { action, makeObservable, observable, runInAction } from "mobx";
|
||||
// services
|
||||
import { UserService } from "@/services/user.service";
|
||||
// types
|
||||
import { IUserTheme, TUserProfile } from "@plane/types";
|
||||
import { RootStore } from "@/store/root.store";
|
||||
// plane web store
|
||||
import { RootStore } from "@/plane-web/store/root.store";
|
||||
// services
|
||||
import { UserService } from "@/services/user.service";
|
||||
|
||||
type TError = {
|
||||
status: string;
|
||||
|
||||
@@ -5,12 +5,12 @@ import { IWorkspaceMemberMe, IProjectMember, IUserProjectsRole } from "@plane/ty
|
||||
// constants
|
||||
import { EUserProjectRoles } from "@/constants/project";
|
||||
import { EUserWorkspaceRoles } from "@/constants/workspace";
|
||||
// plane web store
|
||||
import { RootStore } from "@/plane-web/store/root.store";
|
||||
// services
|
||||
import { ProjectMemberService } from "@/services/project";
|
||||
import { UserService } from "@/services/user.service";
|
||||
import { WorkspaceService } from "@/services/workspace.service";
|
||||
// store
|
||||
import { RootStore } from "../root.store";
|
||||
|
||||
export interface IUserMembershipStore {
|
||||
// observables
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
// mobx
|
||||
import { action, observable, makeObservable, runInAction } from "mobx";
|
||||
import { computedFn } from "mobx-utils";
|
||||
import { APITokenService } from "@/services/api_token.service";
|
||||
import { IApiToken } from "@plane/types";
|
||||
import { RootStore } from "../root.store";
|
||||
// types
|
||||
import { IApiToken } from "@plane/types";
|
||||
// plane web store
|
||||
import { RootStore } from "@/plane-web/store/root.store";
|
||||
// services
|
||||
import { APITokenService } from "@/services/api_token.service";
|
||||
|
||||
export interface IApiTokenStore {
|
||||
// observables
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
import set from "lodash/set";
|
||||
import { action, computed, observable, makeObservable, runInAction } from "mobx";
|
||||
import { IWorkspace } from "@plane/types";
|
||||
import { WorkspaceService } from "@/services/workspace.service";
|
||||
import { RootStore } from "../root.store";
|
||||
// types
|
||||
import { IWorkspace } from "@plane/types";
|
||||
// plane web store
|
||||
import { RootStore } from "@/plane-web/store/root.store";
|
||||
// services
|
||||
import { WorkspaceService } from "@/services/workspace.service";
|
||||
// sub-stores
|
||||
import { ApiTokenStore, IApiTokenStore } from "./api-token.store";
|
||||
import { IWebhookStore, WebhookStore } from "./webhook.store";
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
// mobx
|
||||
import { action, observable, makeObservable, computed, runInAction } from "mobx";
|
||||
import { computedFn } from "mobx-utils";
|
||||
// types
|
||||
import { IWebhook } from "@plane/types";
|
||||
// plane web store
|
||||
import { RootStore } from "@/plane-web/store/root.store";
|
||||
// services
|
||||
import { WebhookService } from "@/services/webhook.service";
|
||||
import { RootStore } from "../root.store";
|
||||
|
||||
export interface IWebhookStore {
|
||||
// observables
|
||||
|
||||
Reference in New Issue
Block a user