reorganize models
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
import StorageModel, { storageKeys } from "./storageModel";
|
||||
import StorageModel, { storageKeys } from "../Global/storageModel";
|
||||
|
||||
import ChatModel from "./chatModel";
|
||||
import ConnectionModel from "./connectionModel";
|
||||
import ConnectionModel from "../Global/connectionModel";
|
||||
import { Message } from "udn-frontend";
|
||||
import SettingsModel from "./settingsModel";
|
||||
import { localeCompare } from "./Utility/utility";
|
||||
import SettingsModel from "../Global/settingsModel";
|
||||
import { localeCompare } from "../Utility/utility";
|
||||
import { v4 } from "uuid";
|
||||
|
||||
export default class ChatListModel {
|
||||
@@ -1,19 +1,19 @@
|
||||
// this file is responsible for managing chats.
|
||||
|
||||
import { DATA_VERSION, ValidObject } from "./Utility/typeSafety";
|
||||
import FileModel, { File } from "./fileModel";
|
||||
import StorageModel, { storageKeys } from "./storageModel";
|
||||
import { DATA_VERSION, ValidObject } from "../Utility/typeSafety";
|
||||
import FileModel, { File } from "../Files/fileModel";
|
||||
import StorageModel, { storageKeys } from "../Global/storageModel";
|
||||
import {
|
||||
createTimestamp,
|
||||
parseValidObject,
|
||||
stringify,
|
||||
} from "./Utility/utility";
|
||||
import { decryptString, encryptString } from "./Utility/crypto";
|
||||
} from "../Utility/utility";
|
||||
import { decryptString, encryptString } from "../Utility/crypto";
|
||||
|
||||
import ChatListModel from "./chatListModel";
|
||||
import { Color } from "../ViewModel/colors";
|
||||
import ConnectionModel from "./connectionModel";
|
||||
import SettingsModel from "./settingsModel";
|
||||
import { Color } from "../../ViewModel/colors";
|
||||
import ConnectionModel from "../Global/connectionModel";
|
||||
import SettingsModel from "../Global/settingsModel";
|
||||
import { v4 } from "uuid";
|
||||
|
||||
export default class ChatModel {
|
||||
@@ -1,10 +1,10 @@
|
||||
// this file is responsible for managing files within chats.
|
||||
|
||||
import { DATA_VERSION, ValidObject } from "./Utility/typeSafety";
|
||||
import StorageModel, { storageKeys } from "./storageModel";
|
||||
import { parseValidObject, stringify } from "./Utility/utility";
|
||||
import { DATA_VERSION, ValidObject } from "../Utility/typeSafety";
|
||||
import StorageModel, { storageKeys } from "../Global/storageModel";
|
||||
import { parseValidObject, stringify } from "../Utility/utility";
|
||||
|
||||
import ChatModel from "./chatModel";
|
||||
import ChatModel from "../Chat/chatModel";
|
||||
import { v4 } from "uuid";
|
||||
|
||||
export default class FileModel {
|
||||
@@ -0,0 +1,20 @@
|
||||
// thile file is responsible for managing task files within chats.
|
||||
|
||||
import { FileContent } from "./fileModel";
|
||||
|
||||
export default class TaskFileModel {}
|
||||
|
||||
// types
|
||||
export interface TaskFileContent extends FileContent {
|
||||
type: "task",
|
||||
|
||||
board: string;
|
||||
category?: string;
|
||||
status?: string;
|
||||
|
||||
description?: string;
|
||||
|
||||
priority?: number;
|
||||
date?: string;
|
||||
time?: string;
|
||||
}
|
||||
@@ -1,10 +1,10 @@
|
||||
// this file is responsible for managing UDN connections.
|
||||
|
||||
import { ChatMessage, ChatMessageReference } from "./chatModel";
|
||||
import { ChatMessage, ChatMessageReference } from "../Chat/chatModel";
|
||||
import StorageModel, { storageKeys } from "./storageModel";
|
||||
import UDNFrontend, { Message } from "udn-frontend";
|
||||
|
||||
import { stringify } from "./Utility/utility";
|
||||
import { stringify } from "../Utility/utility";
|
||||
|
||||
export default class ConnectionModel {
|
||||
udn: UDNFrontend;
|
||||
@@ -4,8 +4,8 @@ import {
|
||||
DATA_VERSION,
|
||||
ValidObject,
|
||||
checkMatchesObjectStructure,
|
||||
} from "./Utility/typeSafety";
|
||||
import { localeCompare, parseValidObject, stringify } from "./Utility/utility";
|
||||
} from "../Utility/typeSafety";
|
||||
import { localeCompare, parseValidObject, stringify } from "../Utility/utility";
|
||||
|
||||
export const PATH_COMPONENT_SEPARATOR = "\\";
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import * as React from "bloatless-react";
|
||||
|
||||
import { ChatMessageInfoModal } from "./chatMessageInfoModal";
|
||||
import { ChatMessageStatus } from "../../Model/chatModel";
|
||||
import ChatMessageViewModel from "../../Model/chatMessageViewModel";
|
||||
import { ChatMessageStatus } from "../../Model/Chat/chatModel";
|
||||
import ChatMessageViewModel from "../../ViewModel/chatMessageViewModel";
|
||||
import { translations } from "../translations";
|
||||
|
||||
export function ChatMessage(chatMessageViewModel: ChatMessageViewModel) {
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
import * as React from "bloatless-react";
|
||||
|
||||
import StorageModel, {
|
||||
PATH_COMPONENT_SEPARATOR,
|
||||
} from "../../Model/storageModel";
|
||||
import StorageModel, { PATH_COMPONENT_SEPARATOR } from "../../Model/Global/storageModel";
|
||||
|
||||
import StorageViewModel from "../../ViewModel/storageViewModel";
|
||||
|
||||
|
||||
@@ -2,12 +2,9 @@ import "./fileBrowser.css";
|
||||
|
||||
import * as React from "bloatless-react";
|
||||
|
||||
import StorageModel, {
|
||||
PATH_COMPONENT_SEPARATOR,
|
||||
} from "../../Model/storageModel";
|
||||
|
||||
import { DangerousActionButton } from "./dangerousActionButton";
|
||||
import { DirectoryItemList } from "./directoryItemList";
|
||||
import { PATH_COMPONENT_SEPARATOR } from "../../Model/Global/storageModel";
|
||||
import StorageViewModel from "../../ViewModel/storageViewModel";
|
||||
import { translations } from "../translations";
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import * as React from "bloatless-react";
|
||||
|
||||
import ChatListModel from "../Model/chatListModel";
|
||||
import ChatListModel from "../Model/Chat/chatListModel";
|
||||
import ChatModel from "../Model/chatModel";
|
||||
import ChatViewModel from "./chatViewModel";
|
||||
import SettingsViewModel from "./settingsViewModel";
|
||||
import StorageModel from "../Model/storageModel";
|
||||
import StorageModel from "../Model/Global/storageModel";
|
||||
|
||||
export default class ChatListViewModel {
|
||||
chatListModel: ChatListModel;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
import * as React from "bloatless-react";
|
||||
|
||||
import { ChatMessage, ChatMessageStatus } from "../Model/chatModel";
|
||||
import { ChatMessage, ChatMessageStatus } from "../Model/Chat/chatModel";
|
||||
|
||||
import ChatViewModel from "./chatViewModel";
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import * as React from "bloatless-react";
|
||||
|
||||
import ChatModel, { ChatMessage } from "../Model/chatModel";
|
||||
import StorageModel, { storageKeys } from "../Model/storageModel";
|
||||
import ChatModel, { ChatMessage } from "../Model/Chat/chatModel";
|
||||
import StorageModel, { storageKeys } from "../Model/Global/storageModel";
|
||||
|
||||
import ChatListViewModel from "./chatListViewModel";
|
||||
import ChatMessageViewModel from "./chatMessageViewModel";
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import * as React from "bloatless-react";
|
||||
|
||||
import ConnectionModel from "../Model/connectionModel";
|
||||
import ConnectionModel from "../Model/Global/connectionModel";
|
||||
|
||||
export default class ConnectionViewModel {
|
||||
connectionModel: ConnectionModel;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import * as React from "bloatless-react";
|
||||
|
||||
import SettingsModel from "../Model/settingsModel";
|
||||
import SettingsModel from "../Model/Global/settingsModel";
|
||||
|
||||
export default class SettingsViewModel {
|
||||
settingsModel: SettingsModel;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import * as React from "bloatless-react";
|
||||
|
||||
import StorageModel, { PATH_COMPONENT_SEPARATOR } from "../Model/storageModel";
|
||||
import StorageModel, { PATH_COMPONENT_SEPARATOR } from "../Model/Global/storageModel";
|
||||
|
||||
import { translations } from "../View/translations";
|
||||
|
||||
|
||||
+4
-4
@@ -3,17 +3,17 @@ import "./colors.css";
|
||||
|
||||
import * as React from "bloatless-react";
|
||||
|
||||
import ChatListModel from "./Model/chatListModel";
|
||||
import ChatListModel from "./Model/Chat/chatListModel";
|
||||
import ChatListViewModel from "./ViewModel/chatListViewModel";
|
||||
import { ChatPageWrapper } from "./View/chatPageWrapper";
|
||||
import { ConnectionModal } from "./View/Modals/connectionModal";
|
||||
import ConnectionModel from "./Model/connectionModel";
|
||||
import ConnectionModel from "./Model/Global/connectionModel";
|
||||
import ConnectionViewModel from "./ViewModel/connectionViewModel";
|
||||
import { HomePage } from "./View/homePage";
|
||||
import SettingsModel from "./Model/settingsModel";
|
||||
import SettingsModel from "./Model/Global/settingsModel";
|
||||
import SettingsViewModel from "./ViewModel/settingsViewModel";
|
||||
import { StorageModal } from "./View/Modals/storageModal";
|
||||
import StorageModel from "./Model/storageModel";
|
||||
import StorageModel from "./Model/Global/storageModel";
|
||||
import StorageViewModel from "./ViewModel/storageViewModel";
|
||||
|
||||
// models
|
||||
|
||||
Reference in New Issue
Block a user