plane/web/store/view/root.store.ts

84 lines
2.1 KiB
TypeScript
Raw Normal View History

// stores
import { ViewRootStore } from "./view-root.store";
2024-01-30 08:56:59 +00:00
// services
2024-02-02 08:22:38 +00:00
import {
WorkspacePrivateViewService,
WorkspacePublicViewService,
ProjectPublicViewService,
ProjectPrivateViewService,
2024-02-02 08:22:38 +00:00
WorkspaceFiltersService,
ProjectFiltersService,
} from "services/view";
2024-01-30 08:56:59 +00:00
// types
import { RootStore } from "store/root.store";
// constants
2024-02-14 14:36:59 +00:00
import { EViewPageType, VIEW_TYPES } from "constants/view";
2024-01-30 08:56:59 +00:00
2024-02-02 08:22:38 +00:00
export class GlobalViewRootStore {
workspacePrivateViewStore: ViewRootStore;
workspacePublicViewStore: ViewRootStore;
projectPrivateViewStore: ViewRootStore;
projectPublicViewStore: ViewRootStore;
2024-01-30 08:56:59 +00:00
constructor(private store: RootStore) {
const workspacePrivateDefaultViews: any[] = [
2024-02-05 14:39:17 +00:00
{
id: "assigned",
name: "Assigned",
is_local_view: true,
},
{
id: "created",
name: "Created",
is_local_view: true,
},
{
id: "subscribed",
name: "Subscribed",
is_local_view: true,
},
];
const workspacePublicDefaultViews: any[] = [
{
id: "all-issues",
name: "All Issues",
is_local_view: true,
},
];
2024-02-05 14:39:17 +00:00
this.workspacePrivateViewStore = new ViewRootStore(
this.store,
workspacePrivateDefaultViews,
new WorkspacePrivateViewService(),
new WorkspaceFiltersService(),
2024-02-14 14:36:59 +00:00
EViewPageType.ALL,
VIEW_TYPES.WORKSPACE_PRIVATE_VIEWS
2024-02-02 08:22:38 +00:00
);
this.workspacePublicViewStore = new ViewRootStore(
this.store,
workspacePublicDefaultViews,
new WorkspacePublicViewService(),
new WorkspaceFiltersService(),
2024-02-14 14:36:59 +00:00
EViewPageType.ALL,
VIEW_TYPES.WORKSPACE_PUBLIC_VIEWS
2024-02-02 08:22:38 +00:00
);
this.projectPrivateViewStore = new ViewRootStore(
this.store,
undefined,
new ProjectPrivateViewService(),
new ProjectFiltersService(),
2024-02-14 14:36:59 +00:00
EViewPageType.PROJECT,
VIEW_TYPES.PROJECT_PRIVATE_VIEWS
2024-02-02 08:22:38 +00:00
);
this.projectPublicViewStore = new ViewRootStore(
this.store,
undefined,
new ProjectPublicViewService(),
new ProjectFiltersService(),
2024-02-14 14:36:59 +00:00
EViewPageType.PROJECT,
VIEW_TYPES.PROJECT_PUBLIC_VIEWS
2024-02-02 08:22:38 +00:00
);
2024-01-30 08:56:59 +00:00
}
}