chore: kanban refactoring

This commit is contained in:
gurusainath 2023-09-04 13:07:55 +05:30
parent d3a9a764dc
commit 8d86087fee
4 changed files with 98 additions and 0 deletions

View File

@ -36,6 +36,8 @@ export const AllBoards: React.FC<Props> = ({
}) => {
const { groupByProperty: selectedGroup, groupedIssues, showEmptyGroups } = viewProps;
console.log("viewProps", viewProps);
return (
<>
{groupedIssues ? (

View 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
View 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;

View File

@ -5,6 +5,7 @@ import UserStore from "./user";
import ThemeStore from "./theme";
import IssuesStore from "./issues";
import ProjectPublishStore, { IProjectPublishStore } from "./project-publish";
import KanbanStore from "./kanban";
enableStaticRendering(typeof window === "undefined");
@ -13,11 +14,13 @@ export class RootStore {
theme;
projectPublish: IProjectPublishStore;
issues: IssuesStore;
kanban: KanbanStore;
constructor() {
this.user = new UserStore(this);
this.theme = new ThemeStore(this);
this.projectPublish = new ProjectPublishStore(this);
this.issues = new IssuesStore(this);
this.kanban = new KanbanStore(this);
}
}