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 -8
View File
@@ -1408,8 +1408,18 @@
this.isPresentingSettingsModal.value = true;
};
hideSettings = () => {
this.saveSettings();
this.isPresentingSettingsModal.value = false;
};
// methods
saveSettings = () => {
const newBoardInfoFileContent = TaskModel.createBoardInfoFileContent(
this.boardInfo.fileId,
this.name.value,
this.color.value
);
this.taskPageViewModel.updateBoard(newBoardInfoFileContent);
};
// load
loadListRelevantData = () => {
this.name.value = this.boardInfo.name;
@@ -1456,6 +1466,9 @@
this.newBoardNameInput.value = "";
this.showBoardInList(boardInfoFileContent);
};
updateBoard = (boardInfoFileContent) => {
this.taskModel.updateBoard(boardInfoFileContent);
};
// view
showBoardInList = (boardInfo) => {
const boardViewModel = new BoardViewModel(this, boardInfo);
@@ -2018,14 +2031,7 @@
// src/View/Modals/boardSettingsModal.tsx
function BoardSettingsModal(boardViewModel) {
return /* @__PURE__ */ createElement("div", { class: "modal", "toggle:open": boardViewModel.isPresentingSettingsModal }, /* @__PURE__ */ createElement("div", null, /* @__PURE__ */ createElement("main", null, /* @__PURE__ */ createElement("h2", null, translations.chatPage.message.messageInfoHeadline)), /* @__PURE__ */ createElement(
"button",
{
"on:click": boardViewModel.hideSettings
},
translations.general.closeButton,
/* @__PURE__ */ createElement("span", { class: "icon" }, "close")
)));
return /* @__PURE__ */ createElement("div", { class: "modal", "toggle:open": boardViewModel.isPresentingSettingsModal }, /* @__PURE__ */ createElement("div", null, /* @__PURE__ */ createElement("main", null, /* @__PURE__ */ createElement("h2", null, translations.chatPage.task.boardSettingsHeadline), /* @__PURE__ */ createElement("label", { class: "tile flex-no" }, /* @__PURE__ */ createElement("span", { class: "icon" }, "label"), /* @__PURE__ */ createElement("div", null, /* @__PURE__ */ createElement("span", null, translations.chatPage.task.boardNameInputLabel), /* @__PURE__ */ createElement("input", { "bind:value": boardViewModel.name })))), /* @__PURE__ */ createElement("button", { "on:click": boardViewModel.hideSettings }, translations.general.closeButton, /* @__PURE__ */ createElement("span", { class: "icon" }, "close"))));
}
// src/View/ChatPages/boardPage.tsx