implement task version history

This commit is contained in:
marlon-erler
2024-07-24 15:57:02 +02:00
parent 47fa0938e9
commit a87f025ea0
8 changed files with 152 additions and 20 deletions
+9
View File
@@ -13,3 +13,12 @@ export const StringToOption: React.StateItemConverter<string> = (
) => {
return Option(string, string, false);
};
export const VersionIdToOption: React.StateItemConverter<string> = (
versionId: string
) => {
const [date, rest] = versionId.split("T");
const [time] = rest.split(".");
const readableName = `${date} ${time}`;
return Option(readableName, versionId, false);
};
+16
View File
@@ -1,5 +1,7 @@
import * as React from "bloatless-react";
import { StringToOption, VersionIdToOption } from "../Components/option";
import { DangerousActionButton } from "../Components/dangerousActionButton";
import TaskViewModel from "../../ViewModel/Pages/taskViewModel";
import { translations } from "../translations";
@@ -11,6 +13,20 @@ export function TaskSettingsModal(taskViewModel: TaskViewModel) {
<main>
<h2>{translations.chatPage.task.taskSettingsHeadline}</h2>
<label class="tile flex-no">
<span class="icon">history</span>
<div>
<span>{translations.general.fileVersionLabel}</span>
<select
bind:value={taskViewModel.selectedVersionId}
children:append={[taskViewModel.versionIds, VersionIdToOption]}
></select>
<span class="icon">arrow_drop_down</span>
</div>
</label>
<hr></hr>
<label class="tile flex-no">
<span class="icon">label</span>
<div>
+5 -3
View File
@@ -1,13 +1,15 @@
const englishTranslations = {
general: {
deleteItemButtonAudioLabel: "delete item",
abortButton: "Abort",
closeButton: "Close",
confirmButton: "Confirm",
saveButton: "Save",
setButton: "Set",
fileVersionLabel: "Version",
},
regional: {
@@ -134,7 +136,7 @@ const englishTranslations = {
createBoardButtonAudioLabel: "create board",
///
noBoardSelected: "No board selected",
boardNotFound: "Board not found",