dynamically add boards to view
This commit is contained in:
Vendored
+5
-4
@@ -571,6 +571,7 @@
|
|||||||
createBoard = (name) => {
|
createBoard = (name) => {
|
||||||
const boardInfoFileContent = _TaskModel.createBoardInfoFileContent(v4_default(), name, "standard" /* Standard */);
|
const boardInfoFileContent = _TaskModel.createBoardInfoFileContent(v4_default(), name, "standard" /* Standard */);
|
||||||
this.updateBoard(boardInfoFileContent);
|
this.updateBoard(boardInfoFileContent);
|
||||||
|
return boardInfoFileContent;
|
||||||
};
|
};
|
||||||
updateBoard = (boardInfoFileContent) => {
|
updateBoard = (boardInfoFileContent) => {
|
||||||
this.storeBoard(boardInfoFileContent);
|
this.storeBoard(boardInfoFileContent);
|
||||||
@@ -591,8 +592,8 @@
|
|||||||
};
|
};
|
||||||
listBoardIds = () => {
|
listBoardIds = () => {
|
||||||
const boardContainerPath = this.getBoardContainerPath();
|
const boardContainerPath = this.getBoardContainerPath();
|
||||||
const boardNames = this.storageModel.list(boardContainerPath);
|
const boardIds = this.storageModel.list(boardContainerPath);
|
||||||
return boardNames;
|
return boardIds;
|
||||||
};
|
};
|
||||||
getBoardInfo = (fileId) => {
|
getBoardInfo = (fileId) => {
|
||||||
const boardInfoFileContentOrNull = this.fileModel.getLatestFileContent(
|
const boardInfoFileContentOrNull = this.fileModel.getLatestFileContent(
|
||||||
@@ -1409,9 +1410,9 @@
|
|||||||
// methods
|
// methods
|
||||||
createBoard = () => {
|
createBoard = () => {
|
||||||
if (this.cannotCreateBoard.value == true) return;
|
if (this.cannotCreateBoard.value == true) return;
|
||||||
this.taskModel.createBoard(this.newBoardNameInput.value);
|
const boardInfoFileContent = this.taskModel.createBoard(this.newBoardNameInput.value);
|
||||||
this.newBoardNameInput.value = "";
|
this.newBoardNameInput.value = "";
|
||||||
this.loadData();
|
this.boards.add(boardInfoFileContent);
|
||||||
};
|
};
|
||||||
// view
|
// view
|
||||||
showBoard = (boardInfo) => {
|
showBoard = (boardInfo) => {
|
||||||
|
|||||||
@@ -68,10 +68,11 @@ export default class TaskModel {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// boards
|
// boards
|
||||||
createBoard = (name: string): void => {
|
createBoard = (name: string): BoardInfoFileContent => {
|
||||||
const boardInfoFileContent: BoardInfoFileContent =
|
const boardInfoFileContent: BoardInfoFileContent =
|
||||||
TaskModel.createBoardInfoFileContent(v4(), name, Color.Standard);
|
TaskModel.createBoardInfoFileContent(v4(), name, Color.Standard);
|
||||||
this.updateBoard(boardInfoFileContent);
|
this.updateBoard(boardInfoFileContent);
|
||||||
|
return boardInfoFileContent;
|
||||||
};
|
};
|
||||||
|
|
||||||
updateBoard = (boardInfoFileContent: BoardInfoFileContent): void => {
|
updateBoard = (boardInfoFileContent: BoardInfoFileContent): void => {
|
||||||
@@ -100,8 +101,8 @@ export default class TaskModel {
|
|||||||
|
|
||||||
listBoardIds = (): string[] => {
|
listBoardIds = (): string[] => {
|
||||||
const boardContainerPath: string[] = this.getBoardContainerPath();
|
const boardContainerPath: string[] = this.getBoardContainerPath();
|
||||||
const boardNames: string[] = this.storageModel.list(boardContainerPath);
|
const boardIds: string[] = this.storageModel.list(boardContainerPath);
|
||||||
return boardNames;
|
return boardIds;
|
||||||
};
|
};
|
||||||
|
|
||||||
getBoardInfo = (fileId: string): BoardInfoFileContent | null => {
|
getBoardInfo = (fileId: string): BoardInfoFileContent | null => {
|
||||||
|
|||||||
@@ -37,10 +37,11 @@ export default class TaskPageViewModel {
|
|||||||
createBoard = (): void => {
|
createBoard = (): void => {
|
||||||
if (this.cannotCreateBoard.value == true) return;
|
if (this.cannotCreateBoard.value == true) return;
|
||||||
|
|
||||||
this.taskModel.createBoard(this.newBoardNameInput.value);
|
const boardInfoFileContent: BoardInfoFileContent =
|
||||||
|
this.taskModel.createBoard(this.newBoardNameInput.value);
|
||||||
this.newBoardNameInput.value = "";
|
this.newBoardNameInput.value = "";
|
||||||
|
|
||||||
this.loadData();
|
this.boards.add(boardInfoFileContent);
|
||||||
};
|
};
|
||||||
|
|
||||||
// view
|
// view
|
||||||
|
|||||||
Reference in New Issue
Block a user