Files
upstream-plane/apps/space/store/root.store.ts
upstream-mirror 23059a1de3
Some checks failed
CodeQL / Analyze (javascript) (push) Failing after 16s
CodeQL / Analyze (python) (push) Failing after 3s
i18n sync check / check:sync (push) Failing after 3s
React Doctor / react-doctor (push) Failing after 16s
Branch Build CE / Build-Push Admin Docker Image (${{ matrix.arch }}) (push) Has been cancelled
Branch Build CE / Merge Admin Manifest (push) Has been cancelled
Branch Build CE / Build-Push Web Docker Image (${{ matrix.arch }}) (push) Has been cancelled
Branch Build CE / Merge Web Manifest (push) Has been cancelled
Branch Build CE / Build-Push Space Docker Image (${{ matrix.arch }}) (push) Has been cancelled
Branch Build CE / Merge Proxy Manifest (push) Has been cancelled
Branch Build CE / Merge Space Manifest (push) Has been cancelled
Branch Build CE / Prepare AIO Assets (push) Has been cancelled
Branch Build CE / Build Setup (push) Has been cancelled
Branch Build CE / Build-Push Live Collaboration Docker Image (${{ matrix.arch }}) (push) Has been cancelled
Branch Build CE / Merge Live Collaboration Manifest (push) Has been cancelled
Branch Build CE / Build-Push API Server Docker Image (${{ matrix.arch }}) (push) Has been cancelled
Branch Build CE / Merge API Server Manifest (push) Has been cancelled
Branch Build CE / Build-Push Proxy Docker Image (${{ matrix.arch }}) (push) Has been cancelled
Branch Build CE / Build-Push AIO Docker Image (${{ matrix.arch }}) (push) Has been cancelled
Branch Build CE / Merge AIO Manifest (push) Has been cancelled
Branch Build CE / Upload Build Assets (push) Has been cancelled
Branch Build CE / Build Release (push) Has been cancelled
snapshot of https://github.com/makeplane/plane.git @ d868349a55de79979eb8b98701bf1702c67ad634 (2026-09-15)
2026-09-15 15:14:58 +05:00

83 lines
3.0 KiB
TypeScript

/**
* Copyright (c) 2023-present Plane Software, Inc. and contributors
* SPDX-License-Identifier: AGPL-3.0-only
* See the LICENSE file for details.
*/
import { enableStaticRendering } from "mobx-react";
// store imports
import type { IInstanceStore } from "@/store/instance.store";
import { InstanceStore } from "@/store/instance.store";
import type { IIssueDetailStore } from "@/store/issue-detail.store";
import { IssueDetailStore } from "@/store/issue-detail.store";
import type { IIssueStore } from "@/store/issue.store";
import { IssueStore } from "@/store/issue.store";
import type { IUserStore } from "@/store/user.store";
import { UserStore } from "@/store/user.store";
import type { ICycleStore } from "./cycle.store";
import { CycleStore } from "./cycle.store";
import type { IIssueFilterStore } from "./issue-filters.store";
import { IssueFilterStore } from "./issue-filters.store";
import type { IIssueLabelStore } from "./label.store";
import { LabelStore } from "./label.store";
import type { IIssueMemberStore } from "./members.store";
import { MemberStore } from "./members.store";
import type { IIssueModuleStore } from "./module.store";
import { ModuleStore } from "./module.store";
import type { IPublishListStore } from "./publish/publish_list.store";
import { PublishListStore } from "./publish/publish_list.store";
import type { IStateStore } from "./state.store";
import { StateStore } from "./state.store";
enableStaticRendering(typeof window === "undefined");
export class RootStore {
instance: IInstanceStore;
user: IUserStore;
issue: IIssueStore;
issueDetail: IIssueDetailStore;
state: IStateStore;
label: IIssueLabelStore;
module: IIssueModuleStore;
member: IIssueMemberStore;
cycle: ICycleStore;
issueFilter: IIssueFilterStore;
publishList: IPublishListStore;
constructor() {
this.instance = new InstanceStore(this);
this.user = new UserStore(this);
this.issue = new IssueStore(this);
this.issueDetail = new IssueDetailStore(this);
this.state = new StateStore(this);
this.label = new LabelStore(this);
this.module = new ModuleStore(this);
this.member = new MemberStore(this);
this.cycle = new CycleStore(this);
this.issueFilter = new IssueFilterStore(this);
this.publishList = new PublishListStore(this);
}
// eslint-disable-next-line @typescript-eslint/no-explicit-any
hydrate = (data: any) => {
if (!data) return;
this.instance.hydrate(data?.instance || undefined);
this.user.hydrate(data?.user || undefined);
};
reset() {
localStorage.setItem("theme", "system");
this.instance = new InstanceStore(this);
this.user = new UserStore(this);
this.issue = new IssueStore(this);
this.issueDetail = new IssueDetailStore(this);
this.state = new StateStore(this);
this.label = new LabelStore(this);
this.module = new ModuleStore(this);
this.member = new MemberStore(this);
this.cycle = new CycleStore(this);
this.issueFilter = new IssueFilterStore(this);
this.publishList = new PublishListStore(this);
}
}