integrate CalendarModel

This commit is contained in:
marlon-erler
2024-07-25 19:14:30 +02:00
parent 0c6609afb5
commit 3fa3945b0d
4 changed files with 56 additions and 15 deletions
-3
View File
@@ -220,9 +220,6 @@ export default class BoardsAndTasksModel {
this.chatModel = chatModel;
this.fileModel = fileModel;
this.storageModel = storageModel;
// handlers
fileModel.fileContentHandlerManager.addHandler(this.handleFileContent);
}
// utility
+1 -6
View File
@@ -14,8 +14,6 @@ export default class CalendarModel {
storageModel: StorageModel;
fileModel: FileModel;
boardsAndTasksModel: BoardsAndTasksModel;
// paths
getBasePath = (): string[] => {
return this.fileModel.getModelContainerPath(FileModelSubPath.ModelCalendar);
@@ -63,12 +61,9 @@ export default class CalendarModel {
// init
constructor(
storageModel: StorageModel,
fileModel: FileModel,
boardsAndTasksModel: BoardsAndTasksModel
) {
fileModel: FileModel, ) {
this.storageModel = storageModel;
this.fileModel = fileModel;
this.boardsAndTasksModel = boardsAndTasksModel;
}
// utility
+4 -3
View File
@@ -11,6 +11,7 @@ import {
import StorageModel, { StorageModelSubPath, filePaths } from "../Global/storageModel";
import BoardsAndTasksModel from "./boardsAndTasksModel";
import CalendarModel from "./calendarModel";
import ChatModel from "../Chat/chatModel";
import { v4 } from "uuid";
@@ -19,8 +20,7 @@ export default class FileModel {
storageModel: StorageModel;
boardsAndTasksModel: BoardsAndTasksModel;
fileContentHandlerManager: HandlerManager<FileContent<string>> = new HandlerManager();
calendarModel: CalendarModel;
// paths
getBasePath = (): string[] => {
@@ -65,7 +65,7 @@ export default class FileModel {
if (didStore == false) return;
this.boardsAndTasksModel.handleFileContent(fileContent);
this.fileContentHandlerManager.trigger(fileContent);
this.calendarModel.handleFileContent(fileContent);
};
// methods
@@ -142,6 +142,7 @@ export default class FileModel {
this.storageModel = storageModel;
this.boardsAndTasksModel = new BoardsAndTasksModel(this.storageModel, chatModel, this);
this.calendarModel = new CalendarModel(this.storageModel, this);
}
// utility