add setting for board name, implement saving settings

This commit is contained in:
marlon-erler
2024-07-23 13:19:08 +02:00
parent 3eb823c305
commit 79bda74049
4 changed files with 45 additions and 13 deletions
+14 -1
View File
@@ -1,6 +1,7 @@
import * as React from "bloatless-react";
import { BoardInfoFileContent } from "../../Model/Files/taskModel";
import TaskModel, { BoardInfoFileContent } from "../../Model/Files/taskModel";
import { Color } from "../../colors";
import TaskPageViewModel from "./taskPageViewModel";
@@ -30,9 +31,21 @@ export default class BoardViewModel {
};
hideSettings = (): void => {
this.saveSettings();
this.isPresentingSettingsModal.value = false;
};
// methods
saveSettings = (): void => {
const newBoardInfoFileContent: BoardInfoFileContent =
TaskModel.createBoardInfoFileContent(
this.boardInfo.fileId,
this.name.value,
this.color.value
);
this.taskPageViewModel.updateBoard(newBoardInfoFileContent);
};
// load
loadListRelevantData = (): void => {
this.name.value = this.boardInfo.name;
+4
View File
@@ -53,6 +53,10 @@ export default class TaskPageViewModel {
this.showBoardInList(boardInfoFileContent);
};
updateBoard = (boardInfoFileContent: BoardInfoFileContent): void => {
this.taskModel.updateBoard(boardInfoFileContent);
};
// view
showBoardInList = (boardInfo: BoardInfoFileContent): void => {
const boardViewModel: BoardViewModel = new BoardViewModel(this, boardInfo);