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
+20 -2
View File
@@ -5,12 +5,12 @@ import {
checkMatchesObjectStructure,
} from "../Utility/typeSafety";
import FileModel, { FileContent, FileModelSubPath } from "./fileModel";
import { v4, version } from "uuid";
import ChatModel from "../Chat/chatModel";
import { Color } from "../../colors";
import { HandlerManager } from "../Utility/utility";
import StorageModel from "../Global/storageModel";
import { v4 } from "uuid";
export default class BoardModel {
storageModel: StorageModel;
@@ -169,12 +169,30 @@ export default class BoardModel {
return fileIds;
};
getTaskFileContent = (taskId: string): TaskFileContent | null => {
listTaskVersionIds = (taskId: string): string[] => {
const versionIds: string[] = this.fileModel.listFileContentIds(taskId);
return versionIds;
};
getLatestTaskFileContent = (taskId: string): TaskFileContent | null => {
const taskFileContentOrNull: TaskFileContent | null =
this.fileModel.getLatestFileContent(taskId, TaskFileContentReference);
return taskFileContentOrNull;
};
getSpecificTaskFileContent = (
taskId: string,
versionId: string
): TaskFileContent | null => {
const taskFileContentOrNull: TaskFileContent | null =
this.fileModel.getFileContent(
taskId,
versionId,
TaskFileContentReference
);
return taskFileContentOrNull;
};
deleteTask = (boardId: string, taskId: string): void => {
const taskFilePath: string[] = this.getTaskFilePath(taskId);
const taskReferencePath: string[] = this.getTaskReferencePath(