forked from github/plane
chore: kanban refactoring
This commit is contained in:
parent
d3a9a764dc
commit
8d86087fee
@ -36,6 +36,8 @@ export const AllBoards: React.FC<Props> = ({
|
|||||||
}) => {
|
}) => {
|
||||||
const { groupByProperty: selectedGroup, groupedIssues, showEmptyGroups } = viewProps;
|
const { groupByProperty: selectedGroup, groupedIssues, showEmptyGroups } = viewProps;
|
||||||
|
|
||||||
|
console.log("viewProps", viewProps);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{groupedIssues ? (
|
{groupedIssues ? (
|
||||||
|
11
web/components/kanban-layout/index.tsx
Normal file
11
web/components/kanban-layout/index.tsx
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
import React from "react";
|
||||||
|
|
||||||
|
export const KanbanInitLayout = () => {
|
||||||
|
console.log("");
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div>
|
||||||
|
<div>Hello</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
82
web/store/kanban.ts
Normal file
82
web/store/kanban.ts
Normal file
@ -0,0 +1,82 @@
|
|||||||
|
import { observable, action, computed, makeObservable, runInAction } from "mobx";
|
||||||
|
// types
|
||||||
|
import { RootStore } from "./root";
|
||||||
|
// services
|
||||||
|
|
||||||
|
export interface IKanbanStore {
|
||||||
|
loader: boolean;
|
||||||
|
error: any | null;
|
||||||
|
|
||||||
|
// current issue view
|
||||||
|
issueView?: "kanban";
|
||||||
|
|
||||||
|
// filters
|
||||||
|
priority?: null;
|
||||||
|
state?: null;
|
||||||
|
assignees?: null;
|
||||||
|
createdBy?: null;
|
||||||
|
labels?: null;
|
||||||
|
startDate?: null;
|
||||||
|
dueDate?: null;
|
||||||
|
userSelectedParams?: {
|
||||||
|
assignees: undefined | string;
|
||||||
|
created_by: undefined | string;
|
||||||
|
group_by: undefined | string;
|
||||||
|
labels: undefined | string;
|
||||||
|
order_by: undefined | string;
|
||||||
|
priority: undefined | string;
|
||||||
|
start_date: undefined | string;
|
||||||
|
state: undefined | string;
|
||||||
|
sub_issue: boolean;
|
||||||
|
target_date: undefined | string;
|
||||||
|
type: undefined | string;
|
||||||
|
};
|
||||||
|
|
||||||
|
// display properties
|
||||||
|
displayProperties?: {
|
||||||
|
assignee: boolean;
|
||||||
|
attachment_count: boolean;
|
||||||
|
created_on: boolean;
|
||||||
|
due_date: boolean;
|
||||||
|
estimate: boolean;
|
||||||
|
key: boolean;
|
||||||
|
labels: boolean;
|
||||||
|
link: boolean;
|
||||||
|
priority: boolean;
|
||||||
|
start_date: boolean;
|
||||||
|
state: boolean;
|
||||||
|
sub_issue_count: boolean;
|
||||||
|
updated_on: boolean;
|
||||||
|
};
|
||||||
|
|
||||||
|
// extra's
|
||||||
|
showEmptyGroups?: boolean;
|
||||||
|
|
||||||
|
issues?: null;
|
||||||
|
}
|
||||||
|
|
||||||
|
class KanbanStore implements IKanbanStore {
|
||||||
|
loader: boolean = false;
|
||||||
|
error: any | null = null;
|
||||||
|
|
||||||
|
// root store
|
||||||
|
rootStore;
|
||||||
|
// service
|
||||||
|
projectPublishService = null;
|
||||||
|
|
||||||
|
constructor(_rootStore: RootStore) {
|
||||||
|
makeObservable(this, {
|
||||||
|
// observable
|
||||||
|
loader: observable,
|
||||||
|
error: observable,
|
||||||
|
|
||||||
|
// action
|
||||||
|
// computed
|
||||||
|
});
|
||||||
|
|
||||||
|
this.rootStore = _rootStore;
|
||||||
|
this.projectPublishService = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export default KanbanStore;
|
@ -5,6 +5,7 @@ import UserStore from "./user";
|
|||||||
import ThemeStore from "./theme";
|
import ThemeStore from "./theme";
|
||||||
import IssuesStore from "./issues";
|
import IssuesStore from "./issues";
|
||||||
import ProjectPublishStore, { IProjectPublishStore } from "./project-publish";
|
import ProjectPublishStore, { IProjectPublishStore } from "./project-publish";
|
||||||
|
import KanbanStore from "./kanban";
|
||||||
|
|
||||||
enableStaticRendering(typeof window === "undefined");
|
enableStaticRendering(typeof window === "undefined");
|
||||||
|
|
||||||
@ -13,11 +14,13 @@ export class RootStore {
|
|||||||
theme;
|
theme;
|
||||||
projectPublish: IProjectPublishStore;
|
projectPublish: IProjectPublishStore;
|
||||||
issues: IssuesStore;
|
issues: IssuesStore;
|
||||||
|
kanban: KanbanStore;
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
this.user = new UserStore(this);
|
this.user = new UserStore(this);
|
||||||
this.theme = new ThemeStore(this);
|
this.theme = new ThemeStore(this);
|
||||||
this.projectPublish = new ProjectPublishStore(this);
|
this.projectPublish = new ProjectPublishStore(this);
|
||||||
this.issues = new IssuesStore(this);
|
this.issues = new IssuesStore(this);
|
||||||
|
this.kanban = new KanbanStore(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user