diff --git a/src/Model/Files/boardModel.ts b/src/Model/Files/boardModel.ts index 6f40fa47..8c19f556 100644 --- a/src/Model/Files/boardModel.ts +++ b/src/Model/Files/boardModel.ts @@ -243,12 +243,12 @@ export interface TaskFileContent extends FileContent<"task"> { name: string; boardId: string; - category?: string; - status?: string; - description?: string; + category?: string; + status?: string; priority?: string; + date?: string; time?: string; } diff --git a/src/View/Modals/taskSettingsModal.tsx b/src/View/Modals/taskSettingsModal.tsx new file mode 100644 index 00000000..e02f582d --- /dev/null +++ b/src/View/Modals/taskSettingsModal.tsx @@ -0,0 +1,87 @@ +import * as React from "bloatless-react"; + +import { DangerousActionButton } from "../Components/dangerousActionButton"; +import TaskViewModel from "../../ViewModel/Pages/taskViewModel"; +import { translations } from "../translations"; + +export function TaskSettingsModal(taskViewModal: TaskViewModel) { + return ( + + ); +} diff --git a/src/View/translations.ts b/src/View/translations.ts index 21e3857e..5cfa7a43 100644 --- a/src/View/translations.ts +++ b/src/View/translations.ts @@ -1,10 +1,12 @@ const englishTranslations = { general: { - closeButton: "Close", deleteItemButtonAudioLabel: "delete item", + abortButton: "Abort", + closeButton: "Close", + confirmButton: "Confirm", - + saveButton: "Save", setButton: "Set", }, @@ -151,10 +153,21 @@ const englishTranslations = { /// boardSettingsHeadline: "Board Settings", - boardNameInputLabel: "Board name", - deleteBoardButton: "Delete board and all tasks", + + /// + + taskNameLabel: "Title", + + taskCategoryLabel: "Category", + taskStatusLabel: "Status", + taskPriorityLabel: "Priority", + + taskDescriptionLabel: "Description", + + taskDateLabel: "Date", + taskTimeLabel: "Time", }, }, }; diff --git a/src/ViewModel/Pages/taskViewModel.ts b/src/ViewModel/Pages/taskViewModel.ts index 2718868f..f5928f2e 100644 --- a/src/ViewModel/Pages/taskViewModel.ts +++ b/src/ViewModel/Pages/taskViewModel.ts @@ -1,8 +1,6 @@ import * as React from "bloatless-react"; -import BoardModel, { - TaskFileContent, -} from "../../Model/Files/boardModel"; +import BoardModel, { TaskFileContent } from "../../Model/Files/boardModel"; import BoardViewModel from "./boardViewModel"; @@ -22,15 +20,31 @@ export default class TaskViewModel { // state name: React.State = new React.State(""); - category: React.State = new React.State(""); - status: React.State = new React.State(""); - description: React.State = new React.State(""); + category: React.State = new React.State(""); + status: React.State = new React.State(""); priority: React.State = new React.State(""); + date: React.State = new React.State(""); time: React.State = new React.State(""); + isPresentingSettingsModal: React.State = new React.State(false); + + // view + showSettings = (): void => { + this.isPresentingSettingsModal.value = true; + }; + + hideSettings = (): void => { + this.isPresentingSettingsModal.value = false; + }; + + hideSettingsAndSave = (): void => { + this.hideSettings(); + this.save(); + }; + // storage save = (): void => { const newTaskFileContent: TaskFileContent = @@ -40,9 +54,9 @@ export default class TaskViewModel { this.boardViewModel.boardInfo.fileId ); + newTaskFileContent.description = this.description.value; newTaskFileContent.status = this.status.value; newTaskFileContent.category = this.category.value; - newTaskFileContent.description = this.description.value; newTaskFileContent.priority = this.priority.value; newTaskFileContent.date = this.date.value; newTaskFileContent.time = this.time.value; @@ -54,13 +68,12 @@ export default class TaskViewModel { // load loadAllData = (): void => { this.name.value = this.task.name; + this.description.value = this.task.description ?? ""; this.category.value = this.task.category ?? ""; this.status.value = this.task.status ?? ""; - - this.description.value = this.task.description ?? ""; - this.priority.value = this.task.priority ?? ""; + this.date.value = this.task.date ?? ""; this.time.value = this.task.time ?? ""; };