rename all enums to plural
This commit is contained in:
Vendored
+11
-11
@@ -730,16 +730,16 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
// src/colors.ts
|
// src/colors.ts
|
||||||
var Color = /* @__PURE__ */ ((Color2) => {
|
var Colors = /* @__PURE__ */ ((Colors2) => {
|
||||||
Color2["Standard"] = "standard";
|
Colors2["Standard"] = "standard";
|
||||||
Color2["Coral"] = "coral";
|
Colors2["Coral"] = "coral";
|
||||||
Color2["Yellow"] = "yellow";
|
Colors2["Yellow"] = "yellow";
|
||||||
Color2["Green"] = "green";
|
Colors2["Green"] = "green";
|
||||||
Color2["LightBlue"] = "lightblue";
|
Colors2["LightBlue"] = "lightblue";
|
||||||
Color2["Blue"] = "blue";
|
Colors2["Blue"] = "blue";
|
||||||
Color2["purple"] = "purple";
|
Colors2["purple"] = "purple";
|
||||||
return Color2;
|
return Colors2;
|
||||||
})(Color || {});
|
})(Colors || {});
|
||||||
|
|
||||||
// node_modules/uuid/dist/esm-browser/stringify.js
|
// node_modules/uuid/dist/esm-browser/stringify.js
|
||||||
var byteToHex = [];
|
var byteToHex = [];
|
||||||
@@ -4180,7 +4180,7 @@
|
|||||||
|
|
||||||
// src/View/Components/colorPicker.tsx
|
// src/View/Components/colorPicker.tsx
|
||||||
function ColorPicker(selectedColor) {
|
function ColorPicker(selectedColor) {
|
||||||
return /* @__PURE__ */ createElement("div", { class: "flex-row gap width-input" }, ...Object.values(Color).map((color) => {
|
return /* @__PURE__ */ createElement("div", { class: "flex-row gap width-input" }, ...Object.values(Colors).map((color) => {
|
||||||
const isSelected = createProxyState(
|
const isSelected = createProxyState(
|
||||||
[selectedColor],
|
[selectedColor],
|
||||||
() => selectedColor.value == color
|
() => selectedColor.value == color
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import ChatModel, { ChatMessage } from "./chatModel";
|
import ChatModel, { ChatMessage } from "./chatModel";
|
||||||
import StorageModel, {
|
import StorageModel, {
|
||||||
StorageModelSubPath,
|
StorageModelSubPaths,
|
||||||
filePaths,
|
filePaths,
|
||||||
} from "../Global/storageModel";
|
} from "../Global/storageModel";
|
||||||
|
|
||||||
@@ -81,7 +81,7 @@ export default class ChatListModel {
|
|||||||
// load
|
// load
|
||||||
loadChats = (): void => {
|
loadChats = (): void => {
|
||||||
const chatDir = StorageModel.getPath(
|
const chatDir = StorageModel.getPath(
|
||||||
StorageModelSubPath.Chat,
|
StorageModelSubPaths.Chat,
|
||||||
filePaths.chat.base,
|
filePaths.chat.base,
|
||||||
);
|
);
|
||||||
const chatIds = this.storageModel.list(chatDir);
|
const chatIds = this.storageModel.list(chatDir);
|
||||||
|
|||||||
+16
-16
@@ -15,13 +15,13 @@ import {
|
|||||||
stringify,
|
stringify,
|
||||||
} from "../Utility/utility";
|
} from "../Utility/utility";
|
||||||
import StorageModel, {
|
import StorageModel, {
|
||||||
StorageModelSubPath,
|
StorageModelSubPaths,
|
||||||
filePaths,
|
filePaths,
|
||||||
} from "../Global/storageModel";
|
} from "../Global/storageModel";
|
||||||
import { decryptString, encryptString } from "../Utility/crypto";
|
import { decryptString, encryptString } from "../Utility/crypto";
|
||||||
|
|
||||||
import ChatListModel from "./chatListModel";
|
import ChatListModel from "./chatListModel";
|
||||||
import { Color } from "../../colors";
|
import { Colors } from "../../colors";
|
||||||
import ConnectionModel from "../Global/connectionModel";
|
import ConnectionModel from "../Global/connectionModel";
|
||||||
import SettingsModel from "../Global/settingsModel";
|
import SettingsModel from "../Global/settingsModel";
|
||||||
import { v4 } from "uuid";
|
import { v4 } from "uuid";
|
||||||
@@ -37,7 +37,7 @@ export default class ChatModel {
|
|||||||
// data
|
// data
|
||||||
id: string;
|
id: string;
|
||||||
info: ChatInfo;
|
info: ChatInfo;
|
||||||
color: Color;
|
color: Colors;
|
||||||
|
|
||||||
chatMessageHandlerManager: HandlerManager<ChatMessage> =
|
chatMessageHandlerManager: HandlerManager<ChatMessage> =
|
||||||
new HandlerManager();
|
new HandlerManager();
|
||||||
@@ -51,28 +51,28 @@ export default class ChatModel {
|
|||||||
// paths
|
// paths
|
||||||
getBasePath = (): string[] => {
|
getBasePath = (): string[] => {
|
||||||
return StorageModel.getPath(
|
return StorageModel.getPath(
|
||||||
StorageModelSubPath.Chat,
|
StorageModelSubPaths.Chat,
|
||||||
filePaths.chat.chatBase(this.id),
|
filePaths.chat.chatBase(this.id),
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
getInfoPath = (): string[] => {
|
getInfoPath = (): string[] => {
|
||||||
return StorageModel.getPath(
|
return StorageModel.getPath(
|
||||||
StorageModelSubPath.Chat,
|
StorageModelSubPaths.Chat,
|
||||||
filePaths.chat.info(this.id),
|
filePaths.chat.info(this.id),
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
getColorPath = (): string[] => {
|
getColorPath = (): string[] => {
|
||||||
return StorageModel.getPath(
|
return StorageModel.getPath(
|
||||||
StorageModelSubPath.Chat,
|
StorageModelSubPaths.Chat,
|
||||||
filePaths.chat.color(this.id),
|
filePaths.chat.color(this.id),
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
getMessageDirPath = (): string[] => {
|
getMessageDirPath = (): string[] => {
|
||||||
return StorageModel.getPath(
|
return StorageModel.getPath(
|
||||||
StorageModelSubPath.Chat,
|
StorageModelSubPaths.Chat,
|
||||||
filePaths.chat.messages(this.id),
|
filePaths.chat.messages(this.id),
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
@@ -83,7 +83,7 @@ export default class ChatModel {
|
|||||||
|
|
||||||
getReactionDirPath = (): string[] => {
|
getReactionDirPath = (): string[] => {
|
||||||
return StorageModel.getPath(
|
return StorageModel.getPath(
|
||||||
StorageModelSubPath.Chat,
|
StorageModelSubPaths.Chat,
|
||||||
filePaths.chat.reactions(this.id),
|
filePaths.chat.reactions(this.id),
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
@@ -100,7 +100,7 @@ export default class ChatModel {
|
|||||||
);
|
);
|
||||||
if (chatMessage == null) return;
|
if (chatMessage == null) return;
|
||||||
|
|
||||||
chatMessage.status = ChatMessageStatus.Received;
|
chatMessage.status = ChatMessageStatuses.Received;
|
||||||
|
|
||||||
this.addMessage(chatMessage);
|
this.addMessage(chatMessage);
|
||||||
this.setReadStatus(true);
|
this.setReadStatus(true);
|
||||||
@@ -123,7 +123,7 @@ export default class ChatModel {
|
|||||||
};
|
};
|
||||||
|
|
||||||
handleMessageSent = (chatMessage: ChatMessage): void => {
|
handleMessageSent = (chatMessage: ChatMessage): void => {
|
||||||
chatMessage.status = ChatMessageStatus.Sent;
|
chatMessage.status = ChatMessageStatuses.Sent;
|
||||||
this.addMessage(chatMessage);
|
this.addMessage(chatMessage);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -144,7 +144,7 @@ export default class ChatModel {
|
|||||||
this.storeInfo();
|
this.storeInfo();
|
||||||
};
|
};
|
||||||
|
|
||||||
setColor = (color: Color): void => {
|
setColor = (color: Colors): void => {
|
||||||
this.color = color;
|
this.color = color;
|
||||||
this.storeColor();
|
this.storeColor();
|
||||||
};
|
};
|
||||||
@@ -277,7 +277,7 @@ export default class ChatModel {
|
|||||||
const path: string[] = this.getColorPath();
|
const path: string[] = this.getColorPath();
|
||||||
const color: string | null = this.storageModel.read(path);
|
const color: string | null = this.storageModel.read(path);
|
||||||
if (!color) {
|
if (!color) {
|
||||||
this.color = Color.Standard;
|
this.color = Colors.Standard;
|
||||||
} else {
|
} else {
|
||||||
this.color = color as any;
|
this.color = color as any;
|
||||||
}
|
}
|
||||||
@@ -386,7 +386,7 @@ export default class ChatModel {
|
|||||||
body,
|
body,
|
||||||
dateSent: createTimestamp(),
|
dateSent: createTimestamp(),
|
||||||
|
|
||||||
status: ChatMessageStatus.Outbox,
|
status: ChatMessageStatuses.Outbox,
|
||||||
stringifiedFile: "",
|
stringifiedFile: "",
|
||||||
};
|
};
|
||||||
if (fileContent != undefined) {
|
if (fileContent != undefined) {
|
||||||
@@ -455,7 +455,7 @@ export interface ChatInfo extends ValidObject {
|
|||||||
hasUnreadMessages: boolean;
|
hasUnreadMessages: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export enum ChatMessageStatus {
|
export enum ChatMessageStatuses {
|
||||||
Outbox = "outbox",
|
Outbox = "outbox",
|
||||||
Sent = "sent",
|
Sent = "sent",
|
||||||
Received = "received",
|
Received = "received",
|
||||||
@@ -470,7 +470,7 @@ export interface ChatMessage extends ValidObject {
|
|||||||
body: string;
|
body: string;
|
||||||
dateSent: string;
|
dateSent: string;
|
||||||
|
|
||||||
status: ChatMessageStatus;
|
status: ChatMessageStatuses;
|
||||||
|
|
||||||
stringifiedFile: string;
|
stringifiedFile: string;
|
||||||
}
|
}
|
||||||
@@ -504,7 +504,7 @@ export const ChatMessageReference: ChatMessage = {
|
|||||||
body: "",
|
body: "",
|
||||||
dateSent: "",
|
dateSent: "",
|
||||||
|
|
||||||
status: "" as ChatMessageStatus,
|
status: "" as ChatMessageStatuses,
|
||||||
|
|
||||||
stringifiedFile: "",
|
stringifiedFile: "",
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import FileModel, { FileContent, FileModelSubPath } from "./fileModel";
|
|||||||
|
|
||||||
import CalendarModel from "./calendarModel";
|
import CalendarModel from "./calendarModel";
|
||||||
import ChatModel from "../Chat/chatModel";
|
import ChatModel from "../Chat/chatModel";
|
||||||
import { Color } from "../../colors";
|
import { Colors } from "../../colors";
|
||||||
import { HandlerManager } from "../Utility/utility";
|
import { HandlerManager } from "../Utility/utility";
|
||||||
import SettingsModel from "../Global/settingsModel";
|
import SettingsModel from "../Global/settingsModel";
|
||||||
import StorageModel from "../Global/storageModel";
|
import StorageModel from "../Global/storageModel";
|
||||||
@@ -96,7 +96,7 @@ export default class BoardsAndTasksModel {
|
|||||||
BoardsAndTasksModel.createBoardInfoFileContent(
|
BoardsAndTasksModel.createBoardInfoFileContent(
|
||||||
v4(),
|
v4(),
|
||||||
name,
|
name,
|
||||||
Color.Standard,
|
Colors.Standard,
|
||||||
);
|
);
|
||||||
return boardInfoFileContent;
|
return boardInfoFileContent;
|
||||||
};
|
};
|
||||||
@@ -256,7 +256,7 @@ export default class BoardsAndTasksModel {
|
|||||||
static createBoardInfoFileContent = (
|
static createBoardInfoFileContent = (
|
||||||
fileId: string,
|
fileId: string,
|
||||||
name: string,
|
name: string,
|
||||||
color: Color,
|
color: Colors,
|
||||||
): BoardInfoFileContent => {
|
): BoardInfoFileContent => {
|
||||||
const fileContent: FileContent<"board-info"> =
|
const fileContent: FileContent<"board-info"> =
|
||||||
FileModel.createFileContent(fileId, "board-info");
|
FileModel.createFileContent(fileId, "board-info");
|
||||||
@@ -294,7 +294,7 @@ export enum TaskModelSubPaths {
|
|||||||
// types
|
// types
|
||||||
export interface BoardInfoFileContent extends FileContent<"board-info"> {
|
export interface BoardInfoFileContent extends FileContent<"board-info"> {
|
||||||
name: string;
|
name: string;
|
||||||
color: Color;
|
color: Colors;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface TaskFileContent extends FileContent<"task"> {
|
export interface TaskFileContent extends FileContent<"task"> {
|
||||||
@@ -322,7 +322,7 @@ export const BoardInfoFileContentReference: BoardInfoFileContent = {
|
|||||||
type: "board-info",
|
type: "board-info",
|
||||||
|
|
||||||
name: "",
|
name: "",
|
||||||
color: "" as Color,
|
color: "" as Colors,
|
||||||
};
|
};
|
||||||
|
|
||||||
export const TaskFileContentReference: TaskFileContent = {
|
export const TaskFileContentReference: TaskFileContent = {
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
import { DATA_VERSION, ValidObject } from "../Utility/typeSafety";
|
import { DATA_VERSION, ValidObject } from "../Utility/typeSafety";
|
||||||
import StorageModel, {
|
import StorageModel, {
|
||||||
StorageModelSubPath,
|
StorageModelSubPaths,
|
||||||
filePaths,
|
filePaths,
|
||||||
} from "../Global/storageModel";
|
} from "../Global/storageModel";
|
||||||
import {
|
import {
|
||||||
@@ -27,7 +27,7 @@ export default class FileModel {
|
|||||||
// paths
|
// paths
|
||||||
getBasePath = (): string[] => {
|
getBasePath = (): string[] => {
|
||||||
return StorageModel.getPath(
|
return StorageModel.getPath(
|
||||||
StorageModelSubPath.Chat,
|
StorageModelSubPaths.Chat,
|
||||||
filePaths.chat.files(this.chatModel.id),
|
filePaths.chat.files(this.chatModel.id),
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
import { ChatMessage, ChatMessageReference } from "../Chat/chatModel";
|
import { ChatMessage, ChatMessageReference } from "../Chat/chatModel";
|
||||||
import { HandlerManager, stringify } from "../Utility/utility";
|
import { HandlerManager, stringify } from "../Utility/utility";
|
||||||
import StorageModel, { StorageModelSubPath, filePaths } from "./storageModel";
|
import StorageModel, { StorageModelSubPaths, filePaths } from "./storageModel";
|
||||||
import UDNFrontend, { Message } from "udn-frontend";
|
import UDNFrontend, { Message } from "udn-frontend";
|
||||||
|
|
||||||
export default class ConnectionModel {
|
export default class ConnectionModel {
|
||||||
@@ -55,7 +55,7 @@ export default class ConnectionModel {
|
|||||||
|
|
||||||
// do not reconnect
|
// do not reconnect
|
||||||
const reconnectAddressPath: string[] = StorageModel.getPath(
|
const reconnectAddressPath: string[] = StorageModel.getPath(
|
||||||
StorageModelSubPath.ConnectionModel,
|
StorageModelSubPaths.ConnectionModel,
|
||||||
filePaths.connectionModel.reconnectAddress,
|
filePaths.connectionModel.reconnectAddress,
|
||||||
);
|
);
|
||||||
this.storageModel.remove(reconnectAddressPath);
|
this.storageModel.remove(reconnectAddressPath);
|
||||||
@@ -74,7 +74,7 @@ export default class ConnectionModel {
|
|||||||
// mailbox
|
// mailbox
|
||||||
getMailboxPath = (address: string): string[] => {
|
getMailboxPath = (address: string): string[] => {
|
||||||
const mailboxDirPath = StorageModel.getPath(
|
const mailboxDirPath = StorageModel.getPath(
|
||||||
StorageModelSubPath.ConnectionModel,
|
StorageModelSubPaths.ConnectionModel,
|
||||||
filePaths.connectionModel.mailboxes,
|
filePaths.connectionModel.mailboxes,
|
||||||
);
|
);
|
||||||
const mailboxFilePath = [...mailboxDirPath, address];
|
const mailboxFilePath = [...mailboxDirPath, address];
|
||||||
@@ -122,7 +122,7 @@ export default class ConnectionModel {
|
|||||||
// outbox
|
// outbox
|
||||||
getOutboxPath = (): string[] => {
|
getOutboxPath = (): string[] => {
|
||||||
return StorageModel.getPath(
|
return StorageModel.getPath(
|
||||||
StorageModelSubPath.ConnectionModel,
|
StorageModelSubPaths.ConnectionModel,
|
||||||
filePaths.connectionModel.outbox,
|
filePaths.connectionModel.outbox,
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
@@ -192,7 +192,7 @@ export default class ConnectionModel {
|
|||||||
// storage
|
// storage
|
||||||
getPreviousAddressPath = (): string[] => {
|
getPreviousAddressPath = (): string[] => {
|
||||||
return StorageModel.getPath(
|
return StorageModel.getPath(
|
||||||
StorageModelSubPath.ConnectionModel,
|
StorageModelSubPaths.ConnectionModel,
|
||||||
filePaths.connectionModel.previousAddresses,
|
filePaths.connectionModel.previousAddresses,
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
@@ -204,7 +204,7 @@ export default class ConnectionModel {
|
|||||||
|
|
||||||
getReconnectAddressPath = (): string[] => {
|
getReconnectAddressPath = (): string[] => {
|
||||||
return StorageModel.getPath(
|
return StorageModel.getPath(
|
||||||
StorageModelSubPath.ConnectionModel,
|
StorageModelSubPaths.ConnectionModel,
|
||||||
filePaths.connectionModel.reconnectAddress,
|
filePaths.connectionModel.reconnectAddress,
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// this file is responsible for all settings.
|
// this file is responsible for all settings.
|
||||||
|
|
||||||
import StorageModel, { StorageModelSubPath, filePaths } from "./storageModel";
|
import StorageModel, { StorageModelSubPaths, filePaths } from "./storageModel";
|
||||||
|
|
||||||
export default class SettingsModel {
|
export default class SettingsModel {
|
||||||
storageModel: StorageModel;
|
storageModel: StorageModel;
|
||||||
@@ -13,7 +13,7 @@ export default class SettingsModel {
|
|||||||
setName(newValue: string): void {
|
setName(newValue: string): void {
|
||||||
this.username = newValue;
|
this.username = newValue;
|
||||||
const path = StorageModel.getPath(
|
const path = StorageModel.getPath(
|
||||||
StorageModelSubPath.SettingsModel,
|
StorageModelSubPaths.SettingsModel,
|
||||||
filePaths.settingsModel.username,
|
filePaths.settingsModel.username,
|
||||||
);
|
);
|
||||||
this.storageModel.write(path, newValue);
|
this.storageModel.write(path, newValue);
|
||||||
@@ -22,7 +22,7 @@ export default class SettingsModel {
|
|||||||
setFirstDayOfWeek(newValue: string): void {
|
setFirstDayOfWeek(newValue: string): void {
|
||||||
this.firstDayOfWeek = newValue;
|
this.firstDayOfWeek = newValue;
|
||||||
const path = StorageModel.getPath(
|
const path = StorageModel.getPath(
|
||||||
StorageModelSubPath.SettingsModel,
|
StorageModelSubPaths.SettingsModel,
|
||||||
filePaths.settingsModel.firstDayOfWeek,
|
filePaths.settingsModel.firstDayOfWeek,
|
||||||
);
|
);
|
||||||
this.storageModel.write(path, newValue);
|
this.storageModel.write(path, newValue);
|
||||||
@@ -31,7 +31,7 @@ export default class SettingsModel {
|
|||||||
// load
|
// load
|
||||||
loadUsernam(): void {
|
loadUsernam(): void {
|
||||||
const path = StorageModel.getPath(
|
const path = StorageModel.getPath(
|
||||||
StorageModelSubPath.SettingsModel,
|
StorageModelSubPaths.SettingsModel,
|
||||||
filePaths.settingsModel.username,
|
filePaths.settingsModel.username,
|
||||||
);
|
);
|
||||||
const content = this.storageModel.read(path);
|
const content = this.storageModel.read(path);
|
||||||
@@ -40,7 +40,7 @@ export default class SettingsModel {
|
|||||||
|
|
||||||
loadFirstDayofWeek(): void {
|
loadFirstDayofWeek(): void {
|
||||||
const path = StorageModel.getPath(
|
const path = StorageModel.getPath(
|
||||||
StorageModelSubPath.SettingsModel,
|
StorageModelSubPaths.SettingsModel,
|
||||||
filePaths.settingsModel.firstDayOfWeek,
|
filePaths.settingsModel.firstDayOfWeek,
|
||||||
);
|
);
|
||||||
const content = this.storageModel.read(path);
|
const content = this.storageModel.read(path);
|
||||||
|
|||||||
@@ -212,7 +212,7 @@ export default class StorageModel {
|
|||||||
};
|
};
|
||||||
|
|
||||||
static getPath(
|
static getPath(
|
||||||
locationName: StorageModelSubPath,
|
locationName: StorageModelSubPaths,
|
||||||
filePath: string[],
|
filePath: string[],
|
||||||
): string[] {
|
): string[] {
|
||||||
return [DATA_VERSION, locationName, ...filePath];
|
return [DATA_VERSION, locationName, ...filePath];
|
||||||
@@ -223,7 +223,7 @@ export default class StorageModel {
|
|||||||
export type StorageEntry = { [key: string]: StorageEntry };
|
export type StorageEntry = { [key: string]: StorageEntry };
|
||||||
|
|
||||||
// locations
|
// locations
|
||||||
export enum StorageModelSubPath {
|
export enum StorageModelSubPaths {
|
||||||
Chat = "chat",
|
Chat = "chat",
|
||||||
|
|
||||||
ConnectionModel = "connection",
|
ConnectionModel = "connection",
|
||||||
|
|||||||
+5
-5
@@ -6,7 +6,7 @@ import {
|
|||||||
} from "../Model/Files/boardsAndTasksModel";
|
} from "../Model/Files/boardsAndTasksModel";
|
||||||
import ChatModel, {
|
import ChatModel, {
|
||||||
ChatMessage,
|
ChatMessage,
|
||||||
ChatMessageStatus,
|
ChatMessageStatuses,
|
||||||
} from "../Model/Chat/chatModel";
|
} from "../Model/Chat/chatModel";
|
||||||
import {
|
import {
|
||||||
getLocalStorageItemAndClear,
|
getLocalStorageItemAndClear,
|
||||||
@@ -114,7 +114,7 @@ export default class v1Upgrader {
|
|||||||
|
|
||||||
const addMessages = (
|
const addMessages = (
|
||||||
potentialMessages: any[],
|
potentialMessages: any[],
|
||||||
status: ChatMessageStatus,
|
status: ChatMessageStatuses,
|
||||||
) => {
|
) => {
|
||||||
for (const potentialMessage of potentialMessages) {
|
for (const potentialMessage of potentialMessages) {
|
||||||
const isV1ChatMessage: boolean = checkMatchesObjectStructure(
|
const isV1ChatMessage: boolean = checkMatchesObjectStructure(
|
||||||
@@ -139,7 +139,7 @@ export default class v1Upgrader {
|
|||||||
stringifiedFile: "",
|
stringifiedFile: "",
|
||||||
};
|
};
|
||||||
chatModel.addMessage(convertedChatMessage);
|
chatModel.addMessage(convertedChatMessage);
|
||||||
if (status == ChatMessageStatus.Outbox) {
|
if (status == ChatMessageStatuses.Outbox) {
|
||||||
this.connectionModel.sendMessageOrStore(
|
this.connectionModel.sendMessageOrStore(
|
||||||
convertedChatMessage,
|
convertedChatMessage,
|
||||||
);
|
);
|
||||||
@@ -147,8 +147,8 @@ export default class v1Upgrader {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
addMessages(potentialMessages, ChatMessageStatus.Received);
|
addMessages(potentialMessages, ChatMessageStatuses.Received);
|
||||||
addMessages(potentialMessagesInOutbox, ChatMessageStatus.Outbox);
|
addMessages(potentialMessagesInOutbox, ChatMessageStatuses.Outbox);
|
||||||
|
|
||||||
// objects
|
// objects
|
||||||
const objectsString: string =
|
const objectsString: string =
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import * as React from "bloatless-react";
|
import * as React from "bloatless-react";
|
||||||
|
|
||||||
import BoardViewModel, {
|
import BoardViewModel, {
|
||||||
BoardPageType,
|
BoardPageTypes,
|
||||||
} from "../../ViewModel/Pages/boardViewModel";
|
} from "../../ViewModel/Pages/boardViewModel";
|
||||||
|
|
||||||
import { BoardKanbanPage } from "./boardKanbanPage";
|
import { BoardKanbanPage } from "./boardKanbanPage";
|
||||||
@@ -22,10 +22,10 @@ export function BoardPage(boardViewModel: BoardViewModel) {
|
|||||||
[boardViewModel.selectedPage],
|
[boardViewModel.selectedPage],
|
||||||
() => {
|
() => {
|
||||||
switch (boardViewModel.selectedPage.value) {
|
switch (boardViewModel.selectedPage.value) {
|
||||||
case BoardPageType.Kanban: {
|
case BoardPageTypes.Kanban: {
|
||||||
return BoardKanbanPage(boardViewModel);
|
return BoardKanbanPage(boardViewModel);
|
||||||
}
|
}
|
||||||
case BoardPageType.StatusGrid: {
|
case BoardPageTypes.StatusGrid: {
|
||||||
return BoardStatusGridPage(boardViewModel);
|
return BoardStatusGridPage(boardViewModel);
|
||||||
}
|
}
|
||||||
default: {
|
default: {
|
||||||
@@ -102,19 +102,19 @@ export function BoardPage(boardViewModel: BoardViewModel) {
|
|||||||
{BoardViewToggleButton(
|
{BoardViewToggleButton(
|
||||||
translations.chatPage.task.listViewButtonAudioLabel,
|
translations.chatPage.task.listViewButtonAudioLabel,
|
||||||
"view_list",
|
"view_list",
|
||||||
BoardPageType.List,
|
BoardPageTypes.List,
|
||||||
boardViewModel,
|
boardViewModel,
|
||||||
)}
|
)}
|
||||||
{BoardViewToggleButton(
|
{BoardViewToggleButton(
|
||||||
translations.chatPage.task.kanbanViewButtonAudioLabel,
|
translations.chatPage.task.kanbanViewButtonAudioLabel,
|
||||||
"view_kanban",
|
"view_kanban",
|
||||||
BoardPageType.Kanban,
|
BoardPageTypes.Kanban,
|
||||||
boardViewModel,
|
boardViewModel,
|
||||||
)}
|
)}
|
||||||
{BoardViewToggleButton(
|
{BoardViewToggleButton(
|
||||||
translations.chatPage.task.statusViewButtonAudioLabel,
|
translations.chatPage.task.statusViewButtonAudioLabel,
|
||||||
"grid_view",
|
"grid_view",
|
||||||
BoardPageType.StatusGrid,
|
BoardPageTypes.StatusGrid,
|
||||||
boardViewModel,
|
boardViewModel,
|
||||||
)}
|
)}
|
||||||
</span>
|
</span>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import * as React from "bloatless-react";
|
import * as React from "bloatless-react";
|
||||||
|
|
||||||
import { Color } from "../../colors";
|
import { Colors } from "../../colors";
|
||||||
import { ColorPicker } from "../Components/colorPicker";
|
import { ColorPicker } from "../Components/colorPicker";
|
||||||
import { DangerousActionButton } from "../Components/dangerousActionButton";
|
import { DangerousActionButton } from "../Components/dangerousActionButton";
|
||||||
import { DeletableListItem } from "../Components/deletableListItem";
|
import { DeletableListItem } from "../Components/deletableListItem";
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import * as React from "bloatless-react";
|
import * as React from "bloatless-react";
|
||||||
|
|
||||||
import BoardViewModel, {
|
import BoardViewModel, {
|
||||||
BoardPageType,
|
BoardPageTypes,
|
||||||
} from "../../ViewModel/Pages/boardViewModel";
|
} from "../../ViewModel/Pages/boardViewModel";
|
||||||
|
|
||||||
import { RibbonButton } from "./ribbonButton";
|
import { RibbonButton } from "./ribbonButton";
|
||||||
@@ -9,7 +9,7 @@ import { RibbonButton } from "./ribbonButton";
|
|||||||
export function BoardViewToggleButton(
|
export function BoardViewToggleButton(
|
||||||
label: string,
|
label: string,
|
||||||
icon: string,
|
icon: string,
|
||||||
page: BoardPageType,
|
page: BoardPageTypes,
|
||||||
boardViewModel: BoardViewModel,
|
boardViewModel: BoardViewModel,
|
||||||
) {
|
) {
|
||||||
function select() {
|
function select() {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import * as React from "bloatless-react";
|
import * as React from "bloatless-react";
|
||||||
|
|
||||||
import { ChatMessageInfoModal } from "../Modals/chatMessageInfoModal";
|
import { ChatMessageInfoModal } from "../Modals/chatMessageInfoModal";
|
||||||
import { ChatMessageStatus } from "../../Model/Chat/chatModel";
|
import { ChatMessageStatuses } from "../../Model/Chat/chatModel";
|
||||||
import ChatMessageViewModel from "../../ViewModel/Chat/chatMessageViewModel";
|
import ChatMessageViewModel from "../../ViewModel/Chat/chatMessageViewModel";
|
||||||
import { translations } from "../translations";
|
import { translations } from "../translations";
|
||||||
import { MessageReactionButtonRow } from "./messageReactionButtonRow";
|
import { MessageReactionButtonRow } from "./messageReactionButtonRow";
|
||||||
@@ -11,11 +11,11 @@ export function ChatMessage(chatMessageViewModel: ChatMessageViewModel) {
|
|||||||
[chatMessageViewModel.status],
|
[chatMessageViewModel.status],
|
||||||
() => {
|
() => {
|
||||||
switch (chatMessageViewModel.status.value) {
|
switch (chatMessageViewModel.status.value) {
|
||||||
case ChatMessageStatus.Outbox:
|
case ChatMessageStatuses.Outbox:
|
||||||
return "hourglass_top";
|
return "hourglass_top";
|
||||||
case ChatMessageStatus.Sent:
|
case ChatMessageStatuses.Sent:
|
||||||
return "check";
|
return "check";
|
||||||
case ChatMessageStatus.Received:
|
case ChatMessageStatuses.Received:
|
||||||
return "done_all";
|
return "done_all";
|
||||||
default:
|
default:
|
||||||
return "warning";
|
return "warning";
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import * as React from "bloatless-react";
|
import * as React from "bloatless-react";
|
||||||
|
|
||||||
import ChatViewModel, {
|
import ChatViewModel, {
|
||||||
ChatPageType,
|
ChatPageTypes,
|
||||||
} from "../../ViewModel/Chat/chatViewModel";
|
} from "../../ViewModel/Chat/chatViewModel";
|
||||||
|
|
||||||
import { RibbonButton } from "./ribbonButton";
|
import { RibbonButton } from "./ribbonButton";
|
||||||
@@ -9,7 +9,7 @@ import { RibbonButton } from "./ribbonButton";
|
|||||||
export function ChatViewToggleButton(
|
export function ChatViewToggleButton(
|
||||||
label: string,
|
label: string,
|
||||||
icon: string,
|
icon: string,
|
||||||
page: ChatPageType,
|
page: ChatPageTypes,
|
||||||
chatViewModel: ChatViewModel,
|
chatViewModel: ChatViewModel,
|
||||||
) {
|
) {
|
||||||
function select() {
|
function select() {
|
||||||
@@ -22,7 +22,7 @@ export function ChatViewToggleButton(
|
|||||||
);
|
);
|
||||||
|
|
||||||
const isHighlighted = new React.State(false);
|
const isHighlighted = new React.State(false);
|
||||||
if (page == ChatPageType.Messages) {
|
if (page == ChatPageTypes.Messages) {
|
||||||
chatViewModel.hasUnreadMessages.subscribe(
|
chatViewModel.hasUnreadMessages.subscribe(
|
||||||
(hasUnreadMessages) => (isHighlighted.value = hasUnreadMessages),
|
(hasUnreadMessages) => (isHighlighted.value = hasUnreadMessages),
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
import * as React from "bloatless-react";
|
import * as React from "bloatless-react";
|
||||||
|
|
||||||
import { Color } from "../../colors";
|
import { Colors } from "../../colors";
|
||||||
|
|
||||||
export function ColorPicker(selectedColor: React.State<Color>) {
|
export function ColorPicker(selectedColor: React.State<Colors>) {
|
||||||
return (
|
return (
|
||||||
<div class="flex-row gap width-input">
|
<div class="flex-row gap width-input">
|
||||||
{...Object.values(Color).map((color) => {
|
{...Object.values(Colors).map((color) => {
|
||||||
const isSelected = React.createProxyState(
|
const isSelected = React.createProxyState(
|
||||||
[selectedColor],
|
[selectedColor],
|
||||||
() => selectedColor.value == color,
|
() => selectedColor.value == color,
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import * as React from "bloatless-react";
|
import * as React from "bloatless-react";
|
||||||
|
|
||||||
import BoardViewModel, {
|
import BoardViewModel, {
|
||||||
BoardPageType,
|
BoardPageTypes,
|
||||||
} from "../../ViewModel/Pages/boardViewModel";
|
} from "../../ViewModel/Pages/boardViewModel";
|
||||||
|
|
||||||
export function RibbonButton(
|
export function RibbonButton(
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import * as React from "bloatless-react";
|
import * as React from "bloatless-react";
|
||||||
|
|
||||||
import FileTransferViewModel, {
|
import FileTransferViewModel, {
|
||||||
FileTransferModal,
|
FileTransferModals,
|
||||||
FileTransferOption,
|
FileTransferOption,
|
||||||
} from "../../ViewModel/Global/fileTransferViewModel";
|
} from "../../ViewModel/Global/fileTransferViewModel";
|
||||||
|
|
||||||
@@ -38,7 +38,7 @@ function DirectionSelectionModal(
|
|||||||
[fileTransferViewModel.presentedModal],
|
[fileTransferViewModel.presentedModal],
|
||||||
() =>
|
() =>
|
||||||
fileTransferViewModel.presentedModal.value ==
|
fileTransferViewModel.presentedModal.value ==
|
||||||
FileTransferModal.DirectionSelection,
|
FileTransferModals.DirectionSelection,
|
||||||
);
|
);
|
||||||
|
|
||||||
const isDisconnected = React.createProxyState(
|
const isDisconnected = React.createProxyState(
|
||||||
@@ -156,7 +156,7 @@ function FileSelectionModal(fileTransferViewModel: FileTransferViewModel) {
|
|||||||
[fileTransferViewModel.presentedModal],
|
[fileTransferViewModel.presentedModal],
|
||||||
() =>
|
() =>
|
||||||
fileTransferViewModel.presentedModal.value ==
|
fileTransferViewModel.presentedModal.value ==
|
||||||
FileTransferModal.FileSelection,
|
FileTransferModals.FileSelection,
|
||||||
);
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -222,7 +222,7 @@ function TransferDataDisplayModal(
|
|||||||
[fileTransferViewModel.presentedModal],
|
[fileTransferViewModel.presentedModal],
|
||||||
() =>
|
() =>
|
||||||
fileTransferViewModel.presentedModal.value ==
|
fileTransferViewModel.presentedModal.value ==
|
||||||
FileTransferModal.TransferDataDisplay,
|
FileTransferModals.TransferDataDisplay,
|
||||||
);
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -295,7 +295,7 @@ function TransferDisplayModal(fileTransferViewModel: FileTransferViewModel) {
|
|||||||
[fileTransferViewModel.presentedModal],
|
[fileTransferViewModel.presentedModal],
|
||||||
() =>
|
() =>
|
||||||
fileTransferViewModel.presentedModal.value ==
|
fileTransferViewModel.presentedModal.value ==
|
||||||
FileTransferModal.TransferDisplay,
|
FileTransferModals.TransferDisplay,
|
||||||
);
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -361,7 +361,7 @@ function TransferDataInputModal(fileTransferViewModel: FileTransferViewModel) {
|
|||||||
[fileTransferViewModel.presentedModal],
|
[fileTransferViewModel.presentedModal],
|
||||||
() =>
|
() =>
|
||||||
fileTransferViewModel.presentedModal.value ==
|
fileTransferViewModel.presentedModal.value ==
|
||||||
FileTransferModal.TransferDataInput,
|
FileTransferModals.TransferDataInput,
|
||||||
);
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -446,7 +446,7 @@ function DataReceptionModal(fileTransferViewModel: FileTransferViewModel) {
|
|||||||
[fileTransferViewModel.presentedModal],
|
[fileTransferViewModel.presentedModal],
|
||||||
() =>
|
() =>
|
||||||
fileTransferViewModel.presentedModal.value ==
|
fileTransferViewModel.presentedModal.value ==
|
||||||
FileTransferModal.ReceptionDisplay,
|
FileTransferModals.ReceptionDisplay,
|
||||||
);
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import "./homePage.css";
|
|||||||
|
|
||||||
import * as React from "bloatless-react";
|
import * as React from "bloatless-react";
|
||||||
|
|
||||||
import ChatViewModel, { ChatPageType } from "../ViewModel/Chat/chatViewModel";
|
import ChatViewModel, { ChatPageTypes } from "../ViewModel/Chat/chatViewModel";
|
||||||
|
|
||||||
import { CalendarPage } from "./ChatPages/calendarPage";
|
import { CalendarPage } from "./ChatPages/calendarPage";
|
||||||
import { ChatViewToggleButton } from "./Components/chatViewToggleButton";
|
import { ChatViewToggleButton } from "./Components/chatViewToggleButton";
|
||||||
@@ -18,13 +18,13 @@ export function ChatPage(chatViewModel: ChatViewModel) {
|
|||||||
chatViewModel.closeSubPages();
|
chatViewModel.closeSubPages();
|
||||||
|
|
||||||
switch (chatViewModel.selectedPage.value) {
|
switch (chatViewModel.selectedPage.value) {
|
||||||
case ChatPageType.Settings: {
|
case ChatPageTypes.Settings: {
|
||||||
return SettingsPage(chatViewModel.settingsPageViewModel);
|
return SettingsPage(chatViewModel.settingsPageViewModel);
|
||||||
}
|
}
|
||||||
case ChatPageType.Tasks: {
|
case ChatPageTypes.Tasks: {
|
||||||
return TaskPage(chatViewModel.taskPageViewModel);
|
return TaskPage(chatViewModel.taskPageViewModel);
|
||||||
}
|
}
|
||||||
case ChatPageType.Calendar: {
|
case ChatPageTypes.Calendar: {
|
||||||
return CalendarPage(chatViewModel.calendarViewModel);
|
return CalendarPage(chatViewModel.calendarViewModel);
|
||||||
}
|
}
|
||||||
default: {
|
default: {
|
||||||
@@ -88,25 +88,25 @@ export function ChatPage(chatViewModel: ChatViewModel) {
|
|||||||
{ChatViewToggleButton(
|
{ChatViewToggleButton(
|
||||||
translations.chatPage.pages.calendar,
|
translations.chatPage.pages.calendar,
|
||||||
"calendar_month",
|
"calendar_month",
|
||||||
ChatPageType.Calendar,
|
ChatPageTypes.Calendar,
|
||||||
chatViewModel,
|
chatViewModel,
|
||||||
)}
|
)}
|
||||||
{ChatViewToggleButton(
|
{ChatViewToggleButton(
|
||||||
translations.chatPage.pages.tasks,
|
translations.chatPage.pages.tasks,
|
||||||
"task_alt",
|
"task_alt",
|
||||||
ChatPageType.Tasks,
|
ChatPageTypes.Tasks,
|
||||||
chatViewModel,
|
chatViewModel,
|
||||||
)}
|
)}
|
||||||
{ChatViewToggleButton(
|
{ChatViewToggleButton(
|
||||||
translations.chatPage.pages.messages,
|
translations.chatPage.pages.messages,
|
||||||
"forum",
|
"forum",
|
||||||
ChatPageType.Messages,
|
ChatPageTypes.Messages,
|
||||||
chatViewModel,
|
chatViewModel,
|
||||||
)}
|
)}
|
||||||
{ChatViewToggleButton(
|
{ChatViewToggleButton(
|
||||||
translations.chatPage.pages.settings,
|
translations.chatPage.pages.settings,
|
||||||
"settings",
|
"settings",
|
||||||
ChatPageType.Settings,
|
ChatPageTypes.Settings,
|
||||||
chatViewModel,
|
chatViewModel,
|
||||||
)}
|
)}
|
||||||
</span>
|
</span>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import {
|
|||||||
ChatMessage,
|
ChatMessage,
|
||||||
ChatMessageReaction,
|
ChatMessageReaction,
|
||||||
ChatMessageReactionReference,
|
ChatMessageReactionReference,
|
||||||
ChatMessageStatus,
|
ChatMessageStatuses,
|
||||||
ReactionSymbols,
|
ReactionSymbols,
|
||||||
} from "../../Model/Chat/chatModel";
|
} from "../../Model/Chat/chatModel";
|
||||||
|
|
||||||
@@ -20,7 +20,7 @@ export default class ChatMessageViewModel {
|
|||||||
sender: string;
|
sender: string;
|
||||||
dateSent: string;
|
dateSent: string;
|
||||||
body: React.State<string> = new React.State("");
|
body: React.State<string> = new React.State("");
|
||||||
status: React.State<ChatMessageStatus | any> = new React.State<any>(
|
status: React.State<ChatMessageStatuses | any> = new React.State<any>(
|
||||||
undefined,
|
undefined,
|
||||||
);
|
);
|
||||||
sentByUser: boolean;
|
sentByUser: boolean;
|
||||||
|
|||||||
@@ -8,12 +8,12 @@ import ChatModel, {
|
|||||||
ChatMessageReaction,
|
ChatMessageReaction,
|
||||||
} from "../../Model/Chat/chatModel";
|
} from "../../Model/Chat/chatModel";
|
||||||
import StorageModel, {
|
import StorageModel, {
|
||||||
StorageModelSubPath,
|
StorageModelSubPaths,
|
||||||
filePaths,
|
filePaths,
|
||||||
} from "../../Model/Global/storageModel";
|
} from "../../Model/Global/storageModel";
|
||||||
|
|
||||||
import ChatListViewModel from "./chatListViewModel";
|
import ChatListViewModel from "./chatListViewModel";
|
||||||
import { Color } from "../../colors";
|
import { Colors } from "../../colors";
|
||||||
import CoreViewModel from "../Global/coreViewModel";
|
import CoreViewModel from "../Global/coreViewModel";
|
||||||
import { Entry } from "../../View/Components/option";
|
import { Entry } from "../../View/Components/option";
|
||||||
import MessagePageViewModel from "../Pages/messagePageViewModel";
|
import MessagePageViewModel from "../Pages/messagePageViewModel";
|
||||||
@@ -38,9 +38,9 @@ export default class ChatViewModel {
|
|||||||
settingsPageViewModel: SettingsPageViewModel;
|
settingsPageViewModel: SettingsPageViewModel;
|
||||||
|
|
||||||
// state
|
// state
|
||||||
displayedColor: React.State<Color> = new React.State<any>(Color.Standard);
|
displayedColor: React.State<Colors> = new React.State<any>(Colors.Standard);
|
||||||
selectedPage: React.State<ChatPageType> = new React.State<any>(
|
selectedPage: React.State<ChatPageTypes> = new React.State<any>(
|
||||||
ChatPageType.Messages,
|
ChatPageTypes.Messages,
|
||||||
);
|
);
|
||||||
|
|
||||||
index: React.State<number> = new React.State(0);
|
index: React.State<number> = new React.State(0);
|
||||||
@@ -59,12 +59,12 @@ export default class ChatViewModel {
|
|||||||
|
|
||||||
closeSubPages = (): void => {};
|
closeSubPages = (): void => {};
|
||||||
|
|
||||||
setColor = (color: Color): void => {
|
setColor = (color: Colors): void => {
|
||||||
this.setDisplayedColor(color);
|
this.setDisplayedColor(color);
|
||||||
this.chatModel.setColor(color);
|
this.chatModel.setColor(color);
|
||||||
};
|
};
|
||||||
|
|
||||||
setDisplayedColor = (color: Color): void => {
|
setDisplayedColor = (color: Colors): void => {
|
||||||
this.displayedColor.value = color;
|
this.displayedColor.value = color;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -81,7 +81,7 @@ export default class ChatViewModel {
|
|||||||
// load
|
// load
|
||||||
loadPageSelection = (): void => {
|
loadPageSelection = (): void => {
|
||||||
const path: string[] = StorageModel.getPath(
|
const path: string[] = StorageModel.getPath(
|
||||||
StorageModelSubPath.Chat,
|
StorageModelSubPaths.Chat,
|
||||||
filePaths.chat.lastUsedPage(this.chatModel.id),
|
filePaths.chat.lastUsedPage(this.chatModel.id),
|
||||||
);
|
);
|
||||||
const lastUsedPage: string | null = this.storageModel.read(path);
|
const lastUsedPage: string | null = this.storageModel.read(path);
|
||||||
@@ -106,7 +106,7 @@ export default class ChatViewModel {
|
|||||||
updateReadStatus = (): void => {
|
updateReadStatus = (): void => {
|
||||||
if (
|
if (
|
||||||
this.chatListViewModel.selectedChat.value == this &&
|
this.chatListViewModel.selectedChat.value == this &&
|
||||||
this.selectedPage.value == ChatPageType.Messages
|
this.selectedPage.value == ChatPageTypes.Messages
|
||||||
) {
|
) {
|
||||||
this.chatModel.setReadStatus(false);
|
this.chatModel.setReadStatus(false);
|
||||||
}
|
}
|
||||||
@@ -123,7 +123,7 @@ export default class ChatViewModel {
|
|||||||
[this.selectedPage, this.chatListViewModel.selectedChat],
|
[this.selectedPage, this.chatListViewModel.selectedChat],
|
||||||
() => {
|
() => {
|
||||||
if (this.chatListViewModel.selectedChat.value != this) return;
|
if (this.chatListViewModel.selectedChat.value != this) return;
|
||||||
if (this.selectedPage.value != ChatPageType.Messages) return;
|
if (this.selectedPage.value != ChatPageTypes.Messages) return;
|
||||||
this.setReadStatus(false);
|
this.setReadStatus(false);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
@@ -194,7 +194,7 @@ export default class ChatViewModel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// types
|
// types
|
||||||
export enum ChatPageType {
|
export enum ChatPageTypes {
|
||||||
Settings = "settings",
|
Settings = "settings",
|
||||||
Messages = "messages",
|
Messages = "messages",
|
||||||
Tasks = "tasks",
|
Tasks = "tasks",
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import FileTransferModel, {
|
|||||||
TransferData,
|
TransferData,
|
||||||
} from "../../Model/Global/fileTransferModel";
|
} from "../../Model/Global/fileTransferModel";
|
||||||
import StorageModel, {
|
import StorageModel, {
|
||||||
StorageModelSubPath,
|
StorageModelSubPaths,
|
||||||
filePaths,
|
filePaths,
|
||||||
} from "../../Model/Global/storageModel";
|
} from "../../Model/Global/storageModel";
|
||||||
|
|
||||||
@@ -17,7 +17,7 @@ export default class FileTransferViewModel {
|
|||||||
chatListModel: ChatListModel;
|
chatListModel: ChatListModel;
|
||||||
|
|
||||||
// state
|
// state
|
||||||
presentedModal: React.State<FileTransferModal | undefined> =
|
presentedModal: React.State<FileTransferModals | undefined> =
|
||||||
new React.State<any>(undefined);
|
new React.State<any>(undefined);
|
||||||
|
|
||||||
generalFileOptions: React.ListState<FileTransferOption> =
|
generalFileOptions: React.ListState<FileTransferOption> =
|
||||||
@@ -86,14 +86,14 @@ export default class FileTransferViewModel {
|
|||||||
{
|
{
|
||||||
label: translations.dataTransferModal.connectionData,
|
label: translations.dataTransferModal.connectionData,
|
||||||
path: StorageModel.getPath(
|
path: StorageModel.getPath(
|
||||||
StorageModelSubPath.ConnectionModel,
|
StorageModelSubPaths.ConnectionModel,
|
||||||
filePaths.connectionModel.previousAddresses,
|
filePaths.connectionModel.previousAddresses,
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: translations.dataTransferModal.settingsData,
|
label: translations.dataTransferModal.settingsData,
|
||||||
path: StorageModel.getPath(
|
path: StorageModel.getPath(
|
||||||
StorageModelSubPath.SettingsModel,
|
StorageModelSubPaths.SettingsModel,
|
||||||
[],
|
[],
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
@@ -117,22 +117,22 @@ export default class FileTransferViewModel {
|
|||||||
|
|
||||||
// view
|
// view
|
||||||
showDirectionSelectionModal = (): void => {
|
showDirectionSelectionModal = (): void => {
|
||||||
this.presentedModal.value = FileTransferModal.DirectionSelection;
|
this.presentedModal.value = FileTransferModals.DirectionSelection;
|
||||||
this.getOptions();
|
this.getOptions();
|
||||||
};
|
};
|
||||||
|
|
||||||
showFileSelectionModal = (): void => {
|
showFileSelectionModal = (): void => {
|
||||||
this.presentedModal.value = FileTransferModal.FileSelection;
|
this.presentedModal.value = FileTransferModals.FileSelection;
|
||||||
};
|
};
|
||||||
|
|
||||||
showTransferDataModal = (): void => {
|
showTransferDataModal = (): void => {
|
||||||
this.presentedModal.value = FileTransferModal.TransferDataDisplay;
|
this.presentedModal.value = FileTransferModals.TransferDataDisplay;
|
||||||
this.getTransferData();
|
this.getTransferData();
|
||||||
this.fileTransferModel.prepareToSend();
|
this.fileTransferModel.prepareToSend();
|
||||||
};
|
};
|
||||||
|
|
||||||
initiateTransfer = (): void => {
|
initiateTransfer = (): void => {
|
||||||
this.presentedModal.value = FileTransferModal.TransferDisplay;
|
this.presentedModal.value = FileTransferModals.TransferDisplay;
|
||||||
this.didNotFinishSending.value = true;
|
this.didNotFinishSending.value = true;
|
||||||
this.filePathsSent.clear();
|
this.filePathsSent.clear();
|
||||||
|
|
||||||
@@ -148,11 +148,11 @@ export default class FileTransferViewModel {
|
|||||||
};
|
};
|
||||||
|
|
||||||
showTransferDataInputModal = (): void => {
|
showTransferDataInputModal = (): void => {
|
||||||
this.presentedModal.value = FileTransferModal.TransferDataInput;
|
this.presentedModal.value = FileTransferModals.TransferDataInput;
|
||||||
};
|
};
|
||||||
|
|
||||||
prepareReceivingData = (): void => {
|
prepareReceivingData = (): void => {
|
||||||
this.presentedModal.value = FileTransferModal.ReceptionDisplay;
|
this.presentedModal.value = FileTransferModals.ReceptionDisplay;
|
||||||
this.filePathsReceived.clear();
|
this.filePathsReceived.clear();
|
||||||
|
|
||||||
const transferData: TransferData = {
|
const transferData: TransferData = {
|
||||||
@@ -189,7 +189,7 @@ export interface FileTransferOption {
|
|||||||
path: string[];
|
path: string[];
|
||||||
}
|
}
|
||||||
|
|
||||||
export enum FileTransferModal {
|
export enum FileTransferModals {
|
||||||
DirectionSelection,
|
DirectionSelection,
|
||||||
|
|
||||||
// sending
|
// sending
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import * as React from "bloatless-react";
|
import * as React from "bloatless-react";
|
||||||
import ChatModel, { ChatMessage } from "../../Model/Chat/chatModel";
|
import ChatModel, { ChatMessage } from "../../Model/Chat/chatModel";
|
||||||
import ChatListViewModel from "../Chat/chatListViewModel";
|
import ChatListViewModel from "../Chat/chatListViewModel";
|
||||||
import { ChatPageType } from "../Chat/chatViewModel";
|
import { ChatPageTypes } from "../Chat/chatViewModel";
|
||||||
|
|
||||||
export default class NotificationViewModel {
|
export default class NotificationViewModel {
|
||||||
chatListViewModel: ChatListViewModel;
|
chatListViewModel: ChatListViewModel;
|
||||||
@@ -25,7 +25,7 @@ export default class NotificationViewModel {
|
|||||||
this.chatListViewModel.selectedChat.value.selectedPage.value;
|
this.chatListViewModel.selectedChat.value.selectedPage.value;
|
||||||
if (
|
if (
|
||||||
notification.chat == currentChat &&
|
notification.chat == currentChat &&
|
||||||
currentPage == ChatPageType.Messages
|
currentPage == ChatPageTypes.Messages
|
||||||
)
|
)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@@ -43,7 +43,7 @@ export default class NotificationViewModel {
|
|||||||
(chat) => chat.chatModel.info.primaryChannel == notification.chat,
|
(chat) => chat.chatModel.info.primaryChannel == notification.chat,
|
||||||
);
|
);
|
||||||
chat.open();
|
chat.open();
|
||||||
chat.selectedPage.value = ChatPageType.Messages;
|
chat.selectedPage.value = ChatPageTypes.Messages;
|
||||||
};
|
};
|
||||||
|
|
||||||
// loop
|
// loop
|
||||||
|
|||||||
@@ -5,8 +5,8 @@ import BoardsAndTasksModel, {
|
|||||||
TaskFileContent,
|
TaskFileContent,
|
||||||
} from "../../Model/Files/boardsAndTasksModel";
|
} from "../../Model/Files/boardsAndTasksModel";
|
||||||
|
|
||||||
import ChatViewModel, { ChatPageType } from "../Chat/chatViewModel";
|
import ChatViewModel, { ChatPageTypes } from "../Chat/chatViewModel";
|
||||||
import { Color } from "../../colors";
|
import { Colors } from "../../colors";
|
||||||
import CoreViewModel from "../Global/coreViewModel";
|
import CoreViewModel from "../Global/coreViewModel";
|
||||||
import SearchViewModel from "../Utility/searchViewModel";
|
import SearchViewModel from "../Utility/searchViewModel";
|
||||||
import StorageModel from "../../Model/Global/storageModel";
|
import StorageModel from "../../Model/Global/storageModel";
|
||||||
@@ -25,12 +25,12 @@ export default class BoardViewModel extends TaskContainingPageViewModel {
|
|||||||
|
|
||||||
// state
|
// state
|
||||||
name: React.State<string> = new React.State("");
|
name: React.State<string> = new React.State("");
|
||||||
color: React.State<Color> = new React.State<any>(Color.Standard);
|
color: React.State<Colors> = new React.State<any>(Colors.Standard);
|
||||||
|
|
||||||
index: React.State<number> = new React.State(0);
|
index: React.State<number> = new React.State(0);
|
||||||
|
|
||||||
selectedPage: React.State<BoardPageType> = new React.State<any>(
|
selectedPage: React.State<BoardPageTypes> = new React.State<any>(
|
||||||
BoardPageType.List,
|
BoardPageTypes.List,
|
||||||
);
|
);
|
||||||
|
|
||||||
isSelected: React.State<boolean>;
|
isSelected: React.State<boolean>;
|
||||||
@@ -49,15 +49,15 @@ export default class BoardViewModel extends TaskContainingPageViewModel {
|
|||||||
};
|
};
|
||||||
|
|
||||||
getLastUsedBoardPath = (): string[] => {
|
getLastUsedBoardPath = (): string[] => {
|
||||||
return [...this.getBasePath(), BoardViewModelSubPath.LastUsedView];
|
return [...this.getBasePath(), BoardViewModelSubPaths.LastUsedView];
|
||||||
};
|
};
|
||||||
|
|
||||||
getPreviousSearchesPath = (): string[] => {
|
getPreviousSearchesPath = (): string[] => {
|
||||||
return [...this.getBasePath(), BoardViewModelSubPath.PreviousSearches];
|
return [...this.getBasePath(), BoardViewModelSubPaths.PreviousSearches];
|
||||||
};
|
};
|
||||||
|
|
||||||
getLastSearchPath = (): string[] => {
|
getLastSearchPath = (): string[] => {
|
||||||
return [...this.getBasePath(), BoardViewModelSubPath.LastSearch];
|
return [...this.getBasePath(), BoardViewModelSubPaths.LastSearch];
|
||||||
};
|
};
|
||||||
|
|
||||||
// settings
|
// settings
|
||||||
@@ -112,7 +112,7 @@ export default class BoardViewModel extends TaskContainingPageViewModel {
|
|||||||
const lastUsedView: string | null = this.storageModel.read(path);
|
const lastUsedView: string | null = this.storageModel.read(path);
|
||||||
if (lastUsedView == null) return;
|
if (lastUsedView == null) return;
|
||||||
|
|
||||||
this.selectedPage.value = lastUsedView as BoardPageType;
|
this.selectedPage.value = lastUsedView as BoardPageTypes;
|
||||||
};
|
};
|
||||||
|
|
||||||
handleNewSearch = (searchTerm: string): void => {
|
handleNewSearch = (searchTerm: string): void => {
|
||||||
@@ -273,7 +273,7 @@ export default class BoardViewModel extends TaskContainingPageViewModel {
|
|||||||
|
|
||||||
this.color.subscribe(() => {
|
this.color.subscribe(() => {
|
||||||
if (this.isSelected.value == false) return;
|
if (this.isSelected.value == false) return;
|
||||||
if (this.chatViewModel.selectedPage.value != ChatPageType.Tasks) return;
|
if (this.chatViewModel.selectedPage.value != ChatPageTypes.Tasks) return;
|
||||||
this.applyColor();
|
this.applyColor();
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -304,14 +304,14 @@ export default class BoardViewModel extends TaskContainingPageViewModel {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export enum BoardViewModelSubPath {
|
export enum BoardViewModelSubPaths {
|
||||||
LastUsedView = "last-used-view",
|
LastUsedView = "last-used-view",
|
||||||
PreviousSearches = "previous-searches",
|
PreviousSearches = "previous-searches",
|
||||||
LastSearch = "last-search",
|
LastSearch = "last-search",
|
||||||
}
|
}
|
||||||
|
|
||||||
// types
|
// types
|
||||||
export enum BoardPageType {
|
export enum BoardPageTypes {
|
||||||
List = "list",
|
List = "list",
|
||||||
Kanban = "kanban",
|
Kanban = "kanban",
|
||||||
StatusGrid = "status-grid",
|
StatusGrid = "status-grid",
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import * as React from "bloatless-react";
|
import * as React from "bloatless-react";
|
||||||
|
|
||||||
import ChatViewModel from "../Chat/chatViewModel";
|
import ChatViewModel from "../Chat/chatViewModel";
|
||||||
import { Color } from "../../colors";
|
import { Colors } from "../../colors";
|
||||||
import CoreViewModel from "../Global/coreViewModel";
|
import CoreViewModel from "../Global/coreViewModel";
|
||||||
|
|
||||||
export default class SettingsPageViewModel {
|
export default class SettingsPageViewModel {
|
||||||
@@ -21,7 +21,7 @@ export default class SettingsPageViewModel {
|
|||||||
this.shouldShowEncryptionKey.value == true ? "text" : "password",
|
this.shouldShowEncryptionKey.value == true ? "text" : "password",
|
||||||
);
|
);
|
||||||
|
|
||||||
color: React.State<Color> = new React.State<any>(Color.Standard);
|
color: React.State<Colors> = new React.State<any>(Colors.Standard);
|
||||||
|
|
||||||
// guards
|
// guards
|
||||||
cannotSetPrimaryChannel: React.State<boolean> = React.createProxyState(
|
cannotSetPrimaryChannel: React.State<boolean> = React.createProxyState(
|
||||||
@@ -74,7 +74,7 @@ export default class SettingsPageViewModel {
|
|||||||
this.encryptionKeyInput.callSubscriptions();
|
this.encryptionKeyInput.callSubscriptions();
|
||||||
};
|
};
|
||||||
|
|
||||||
applyColor = (newColor: Color): void => {
|
applyColor = (newColor: Colors): void => {
|
||||||
this.chatViewModel.setColor(newColor);
|
this.chatViewModel.setColor(newColor);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
export enum Color {
|
export enum Colors {
|
||||||
Standard = "standard",
|
Standard = "standard",
|
||||||
Coral = "coral",
|
Coral = "coral",
|
||||||
Yellow = "yellow",
|
Yellow = "yellow",
|
||||||
|
|||||||
Reference in New Issue
Block a user