add setting for board name, implement saving settings
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user