rename TaskModel to BoardModel for accuracy
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
// thile file is responsible for managing task files within chats.
|
// thile file is responsible for managing boards within chats and tasks within boards.
|
||||||
|
|
||||||
import {
|
import {
|
||||||
DATA_VERSION,
|
DATA_VERSION,
|
||||||
@@ -12,7 +12,7 @@ import { HandlerManager } from "../Utility/utility";
|
|||||||
import StorageModel from "../Global/storageModel";
|
import StorageModel from "../Global/storageModel";
|
||||||
import { v4 } from "uuid";
|
import { v4 } from "uuid";
|
||||||
|
|
||||||
export default class TaskModel {
|
export default class BoardModel {
|
||||||
storageModel: StorageModel;
|
storageModel: StorageModel;
|
||||||
chatModel: ChatModel;
|
chatModel: ChatModel;
|
||||||
fileModel: FileModel;
|
fileModel: FileModel;
|
||||||
@@ -82,7 +82,7 @@ export default class TaskModel {
|
|||||||
// boards
|
// boards
|
||||||
createBoard = (name: string): BoardInfoFileContent => {
|
createBoard = (name: string): BoardInfoFileContent => {
|
||||||
const boardInfoFileContent: BoardInfoFileContent =
|
const boardInfoFileContent: BoardInfoFileContent =
|
||||||
TaskModel.createBoardInfoFileContent(v4(), name, Color.Standard);
|
BoardModel.createBoardInfoFileContent(v4(), name, Color.Standard);
|
||||||
this.updateBoard(boardInfoFileContent);
|
this.updateBoard(boardInfoFileContent);
|
||||||
return boardInfoFileContent;
|
return boardInfoFileContent;
|
||||||
};
|
};
|
||||||
@@ -129,7 +129,7 @@ export default class TaskModel {
|
|||||||
|
|
||||||
//tasks
|
//tasks
|
||||||
createTask = (boardId: string, name: string): void => {
|
createTask = (boardId: string, name: string): void => {
|
||||||
const taskFileContent: TaskFileContent = TaskModel.createTaskFileContent(
|
const taskFileContent: TaskFileContent = BoardModel.createTaskFileContent(
|
||||||
v4(),
|
v4(),
|
||||||
name,
|
name,
|
||||||
boardId
|
boardId
|
||||||
@@ -9,15 +9,15 @@ import {
|
|||||||
} from "../Utility/utility";
|
} from "../Utility/utility";
|
||||||
import StorageModel, { filePaths } from "../Global/storageModel";
|
import StorageModel, { filePaths } from "../Global/storageModel";
|
||||||
|
|
||||||
|
import BoardModel from "./boadModel";
|
||||||
import ChatModel from "../Chat/chatModel";
|
import ChatModel from "../Chat/chatModel";
|
||||||
import TaskModel from "./taskModel";
|
|
||||||
import { v4 } from "uuid";
|
import { v4 } from "uuid";
|
||||||
|
|
||||||
export default class FileModel {
|
export default class FileModel {
|
||||||
chatModel: ChatModel;
|
chatModel: ChatModel;
|
||||||
storageModel: StorageModel;
|
storageModel: StorageModel;
|
||||||
|
|
||||||
taskModel: TaskModel;
|
taskModel: BoardModel;
|
||||||
|
|
||||||
fileContentHandlerManager: HandlerManager<FileContent<string>> = new HandlerManager();
|
fileContentHandlerManager: HandlerManager<FileContent<string>> = new HandlerManager();
|
||||||
|
|
||||||
@@ -140,7 +140,7 @@ export default class FileModel {
|
|||||||
this.chatModel = chatModel;
|
this.chatModel = chatModel;
|
||||||
this.storageModel = storageModel;
|
this.storageModel = storageModel;
|
||||||
|
|
||||||
this.taskModel = new TaskModel(this.storageModel, chatModel, this);
|
this.taskModel = new BoardModel(this.storageModel, chatModel, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
// utility
|
// utility
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import * as React from "bloatless-react";
|
import * as React from "bloatless-react";
|
||||||
|
|
||||||
import TaskModel, { BoardInfoFileContent } from "../../Model/Files/taskModel";
|
import BoardModel, { BoardInfoFileContent } from "../../Model/Files/boadModel";
|
||||||
|
|
||||||
import { Color } from "../../colors";
|
import { Color } from "../../colors";
|
||||||
import StorageModel from "../../Model/Global/storageModel";
|
import StorageModel from "../../Model/Global/storageModel";
|
||||||
@@ -79,7 +79,7 @@ export default class BoardViewModel {
|
|||||||
// methods
|
// methods
|
||||||
saveSettings = (): void => {
|
saveSettings = (): void => {
|
||||||
const newBoardInfoFileContent: BoardInfoFileContent =
|
const newBoardInfoFileContent: BoardInfoFileContent =
|
||||||
TaskModel.createBoardInfoFileContent(
|
BoardModel.createBoardInfoFileContent(
|
||||||
this.boardInfo.fileId,
|
this.boardInfo.fileId,
|
||||||
this.name.value,
|
this.name.value,
|
||||||
this.color.value
|
this.color.value
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
import * as React from "bloatless-react";
|
import * as React from "bloatless-react";
|
||||||
|
|
||||||
import TaskModel, {
|
import BoardModel, {
|
||||||
BoardInfoFileContent,
|
BoardInfoFileContent,
|
||||||
BoardInfoFileContentReference,
|
BoardInfoFileContentReference,
|
||||||
} from "../../Model/Files/taskModel";
|
} from "../../Model/Files/boadModel";
|
||||||
|
|
||||||
import BoardViewModel from "./boardViewModel";
|
import BoardViewModel from "./boardViewModel";
|
||||||
import ChatViewModel from "../Chat/chatViewModel";
|
import ChatViewModel from "../Chat/chatViewModel";
|
||||||
@@ -14,7 +14,7 @@ import { checkMatchesObjectStructure } from "../../Model/Utility/typeSafety";
|
|||||||
|
|
||||||
export default class TaskPageViewModel {
|
export default class TaskPageViewModel {
|
||||||
storageModel: StorageModel;
|
storageModel: StorageModel;
|
||||||
taskModel: TaskModel;
|
taskModel: BoardModel;
|
||||||
|
|
||||||
chatViewModel: ChatViewModel;
|
chatViewModel: ChatViewModel;
|
||||||
|
|
||||||
@@ -153,7 +153,7 @@ export default class TaskPageViewModel {
|
|||||||
|
|
||||||
// init
|
// init
|
||||||
constructor(
|
constructor(
|
||||||
taskModel: TaskModel,
|
taskModel: BoardModel,
|
||||||
storageModel: StorageModel,
|
storageModel: StorageModel,
|
||||||
chatViewModel: ChatViewModel
|
chatViewModel: ChatViewModel
|
||||||
) {
|
) {
|
||||||
|
|||||||
Reference in New Issue
Block a user