prepare CalendarPageViewModel, allow TaskViewModel to be used by BoardViewModel or CalendarPageViewModel

This commit is contained in:
marlon-erler
2024-07-25 19:32:46 +02:00
parent 3fa3945b0d
commit 03dc649e89
8 changed files with 334 additions and 171 deletions
+12 -1
View File
@@ -1,8 +1,12 @@
import * as React from "bloatless-react";
import ChatModel, { ChatMessage } from "../../Model/Chat/chatModel";
import StorageModel, { StorageModelSubPath, filePaths } from "../../Model/Global/storageModel";
import StorageModel, {
StorageModelSubPath,
filePaths,
} from "../../Model/Global/storageModel";
import CalendarPageViewModel from "../Pages/calendarPageViewModel";
import ChatListViewModel from "./chatListViewModel";
import { Color } from "../../colors";
import CoreViewModel from "../Global/coreViewModel";
@@ -17,6 +21,7 @@ export default class ChatViewModel {
settingsViewModel: SettingsViewModel;
chatListViewModel: ChatListViewModel;
calendarViewModel: CalendarPageViewModel;
taskPageViewModel: TaskPageViewModel;
messagePageViewModel: MessagePageViewModel;
settingsPageViewModel: SettingsPageViewModel;
@@ -91,6 +96,12 @@ export default class ChatViewModel {
this.chatListViewModel = chatListViewModel;
// page viewModels
this.calendarViewModel = new CalendarPageViewModel(
coreViewModel,
this.storageModel,
this.chatModel.fileModel.calendarModel,
this.chatModel.fileModel.boardsAndTasksModel
);
this.taskPageViewModel = new TaskPageViewModel(
this.coreViewModel,
this.storageModel,