standardize use of public keyword
This commit is contained in:
@@ -11,9 +11,7 @@ import ConnectionViewModel from "../Global/connectionViewModel";
|
||||
import NotificationViewModel from "../Global/notificationViewModel";
|
||||
|
||||
export default class ChatListViewModel {
|
||||
settingsViewModel: SettingsViewModel;
|
||||
notificationViewModel: NotificationViewModel;
|
||||
connectionViewModel: ConnectionViewModel;
|
||||
|
||||
// data
|
||||
chatIndexManager: IndexManager<ChatViewModel> = new IndexManager(
|
||||
@@ -99,12 +97,10 @@ export default class ChatListViewModel {
|
||||
// init
|
||||
constructor(
|
||||
public coreViewModel: CoreViewModel,
|
||||
settingsViewModel: SettingsViewModel,
|
||||
connectionViewModel: ConnectionViewModel,
|
||||
public settingsViewModel: SettingsViewModel,
|
||||
public connectionViewModel: ConnectionViewModel,
|
||||
) {
|
||||
this.settingsViewModel = settingsViewModel;
|
||||
this.notificationViewModel = new NotificationViewModel(this);
|
||||
this.connectionViewModel = connectionViewModel;
|
||||
|
||||
this.loadChats();
|
||||
}
|
||||
|
||||
@@ -12,8 +12,6 @@ import CoreViewModel from "../Global/coreViewModel";
|
||||
import MessagePageViewModel from "../Pages/messagePageViewModel";
|
||||
|
||||
export default class ChatMessageViewModel {
|
||||
messagePageViewModel: MessagePageViewModel;
|
||||
|
||||
// data
|
||||
chatMessage: ChatMessage;
|
||||
channel: string;
|
||||
@@ -126,12 +124,10 @@ export default class ChatMessageViewModel {
|
||||
// init
|
||||
constructor(
|
||||
public coreViewModel: CoreViewModel,
|
||||
messagePageViewModel: MessagePageViewModel,
|
||||
public messagePageViewModel: MessagePageViewModel,
|
||||
chatMessage: ChatMessage,
|
||||
sentByUser: boolean,
|
||||
) {
|
||||
this.messagePageViewModel = messagePageViewModel;
|
||||
|
||||
this.chatMessage = chatMessage;
|
||||
this.sentByUser = sentByUser;
|
||||
this.loadData();
|
||||
|
||||
@@ -24,13 +24,6 @@ import ConnectionViewModel from "../Global/connectionViewModel";
|
||||
import NotificationViewModel from "../Global/notificationViewModel";
|
||||
|
||||
export default class ChatViewModel {
|
||||
chatModel: ChatModel;
|
||||
|
||||
settingsViewModel: SettingsViewModel;
|
||||
notificationViewModel: NotificationViewModel;
|
||||
connectionViewModel: ConnectionViewModel;
|
||||
chatListViewModel: ChatListViewModel;
|
||||
|
||||
calendarViewModel: CalendarPageViewModel;
|
||||
taskPageViewModel: TaskPageViewModel;
|
||||
messagePageViewModel: MessagePageViewModel;
|
||||
@@ -132,19 +125,12 @@ export default class ChatViewModel {
|
||||
// init
|
||||
constructor(
|
||||
public coreViewModel: CoreViewModel,
|
||||
chatModel: ChatModel,
|
||||
settingsViewModel: SettingsViewModel,
|
||||
notificationViewModel: NotificationViewModel,
|
||||
connectionViewModel: ConnectionViewModel,
|
||||
chatListViewModel: ChatListViewModel,
|
||||
public chatModel: ChatModel,
|
||||
public settingsViewModel: SettingsViewModel,
|
||||
public notificationViewModel: NotificationViewModel,
|
||||
public connectionViewModel: ConnectionViewModel,
|
||||
public chatListViewModel: ChatListViewModel,
|
||||
) {
|
||||
// models
|
||||
this.chatModel = chatModel;
|
||||
this.settingsViewModel = settingsViewModel;
|
||||
this.connectionViewModel = connectionViewModel;
|
||||
this.notificationViewModel = notificationViewModel;
|
||||
this.chatListViewModel = chatListViewModel;
|
||||
|
||||
// page viewModels
|
||||
this.calendarViewModel = new CalendarPageViewModel(
|
||||
coreViewModel,
|
||||
|
||||
@@ -8,7 +8,6 @@ import StorageModel, {
|
||||
filePaths,
|
||||
} from "../../Model/Global/storageModel";
|
||||
|
||||
import ChatListModel from "../../Model/Chat/chatListModel";
|
||||
import ChatModel from "../../Model/Chat/chatModel";
|
||||
import CoreViewModel from "./coreViewModel";
|
||||
|
||||
|
||||
@@ -4,8 +4,6 @@ import ChatListViewModel from "../Chat/chatListViewModel";
|
||||
import { ChatPageTypes } from "../Chat/chatViewModel";
|
||||
|
||||
export default class NotificationViewModel {
|
||||
chatListViewModel: ChatListViewModel;
|
||||
|
||||
// data
|
||||
seenMessageIds = new Set<string>();
|
||||
messagesInMarquee: Notification[] = [];
|
||||
@@ -78,9 +76,7 @@ export default class NotificationViewModel {
|
||||
};
|
||||
|
||||
// init
|
||||
constructor(chatListViewModel: ChatListViewModel) {
|
||||
this.chatListViewModel = chatListViewModel;
|
||||
}
|
||||
constructor(public chatListViewModel: ChatListViewModel) {}
|
||||
|
||||
// util
|
||||
static createNotification(message: ChatMessage): Notification {
|
||||
|
||||
@@ -15,13 +15,6 @@ import TaskPageViewModel from "./taskPageViewModel";
|
||||
import TaskViewModel from "./taskViewModel";
|
||||
|
||||
export default class BoardViewModel extends TaskContainingPageViewModel {
|
||||
boardsAndTasksModel: BoardsAndTasksModel;
|
||||
|
||||
taskPageViewModel: TaskPageViewModel;
|
||||
|
||||
// data
|
||||
boardInfo: BoardInfoFileContent;
|
||||
|
||||
// state
|
||||
name: React.State<string> = new React.State("");
|
||||
color: React.State<Colors> = new React.State<any>(Colors.Standard);
|
||||
@@ -248,17 +241,12 @@ export default class BoardViewModel extends TaskContainingPageViewModel {
|
||||
constructor(
|
||||
public coreViewModel: CoreViewModel,
|
||||
public chatViewModel: ChatViewModel,
|
||||
boardsAndTasksModel: BoardsAndTasksModel,
|
||||
taskPageViewModel: TaskPageViewModel,
|
||||
boardInfo: BoardInfoFileContent,
|
||||
public boardsAndTasksModel: BoardsAndTasksModel,
|
||||
public taskPageViewModel: TaskPageViewModel,
|
||||
public boardInfo: BoardInfoFileContent,
|
||||
) {
|
||||
super(coreViewModel, chatViewModel, boardsAndTasksModel);
|
||||
|
||||
// set
|
||||
this.boardsAndTasksModel = boardsAndTasksModel;
|
||||
this.taskPageViewModel = taskPageViewModel;
|
||||
this.boardInfo = boardInfo;
|
||||
|
||||
// load
|
||||
this.loadListRelevantData();
|
||||
|
||||
|
||||
@@ -14,9 +14,6 @@ import TaskViewModel from "./taskViewModel";
|
||||
export const CALENDAR_EVENT_BOARD_ID = "events";
|
||||
|
||||
export default class CalendarPageViewModel extends TaskContainingPageViewModel {
|
||||
calendarModel: CalendarModel;
|
||||
boardsAndTasksModel: BoardsAndTasksModel;
|
||||
|
||||
// data
|
||||
get monthString(): string {
|
||||
return CalendarModel.getMonthString(
|
||||
@@ -188,8 +185,8 @@ export default class CalendarPageViewModel extends TaskContainingPageViewModel {
|
||||
constructor(
|
||||
public coreViewModel: CoreViewModel,
|
||||
public chatViewModel: ChatViewModel,
|
||||
calendarModel: CalendarModel,
|
||||
boardsAndTasksModel: BoardsAndTasksModel,
|
||||
public calendarModel: CalendarModel,
|
||||
public boardsAndTasksModel: BoardsAndTasksModel,
|
||||
) {
|
||||
super(coreViewModel, chatViewModel, boardsAndTasksModel);
|
||||
|
||||
|
||||
@@ -10,8 +10,6 @@ import ChatViewModel from "../Chat/chatViewModel";
|
||||
import CoreViewModel from "../Global/coreViewModel";
|
||||
|
||||
export default class MessagePageViewModel {
|
||||
chatViewModel: ChatViewModel;
|
||||
|
||||
// state
|
||||
chatMessageViewModels: React.MapState<ChatMessageViewModel> =
|
||||
new React.MapState();
|
||||
@@ -97,10 +95,8 @@ export default class MessagePageViewModel {
|
||||
// init
|
||||
constructor(
|
||||
public coreViewModel: CoreViewModel,
|
||||
chatViewModel: ChatViewModel,
|
||||
public chatViewModel: ChatViewModel,
|
||||
) {
|
||||
this.chatViewModel = chatViewModel;
|
||||
|
||||
this.cannotSendMessage = React.createProxyState(
|
||||
[
|
||||
this.chatViewModel.settingsViewModel.username,
|
||||
|
||||
@@ -5,8 +5,6 @@ import { Colors } from "../../colors";
|
||||
import CoreViewModel from "../Global/coreViewModel";
|
||||
|
||||
export default class SettingsPageViewModel {
|
||||
chatViewModel: ChatViewModel;
|
||||
|
||||
// state
|
||||
primaryChannel: React.State<string> = new React.State("");
|
||||
primaryChannelInput: React.State<string> = new React.State("");
|
||||
@@ -113,9 +111,8 @@ export default class SettingsPageViewModel {
|
||||
// init
|
||||
constructor(
|
||||
public coreViewModel: CoreViewModel,
|
||||
chatViewModel: ChatViewModel,
|
||||
public chatViewModel: ChatViewModel,
|
||||
) {
|
||||
this.chatViewModel = chatViewModel;
|
||||
this.loadListRelevantData();
|
||||
|
||||
this.cannotSetEncryptionKey = React.createProxyState(
|
||||
|
||||
@@ -10,8 +10,6 @@ import { IndexManager } from "../../Model/Utility/utility";
|
||||
import TaskViewModel from "./taskViewModel";
|
||||
|
||||
export default class TaskContainingPageViewModel {
|
||||
boardsAndTasksModel: BoardsAndTasksModel;
|
||||
|
||||
// state
|
||||
taskIndexManager: IndexManager<TaskViewModel> = new IndexManager(
|
||||
(taskViewModel: TaskViewModel) => taskViewModel.sortingString,
|
||||
@@ -60,8 +58,6 @@ export default class TaskContainingPageViewModel {
|
||||
constructor(
|
||||
public coreViewModel: CoreViewModel,
|
||||
public chatViewModel: ChatViewModel,
|
||||
boardsAndTasksModel: BoardsAndTasksModel,
|
||||
) {
|
||||
this.boardsAndTasksModel = boardsAndTasksModel;
|
||||
}
|
||||
public boardsAndTasksModel: BoardsAndTasksModel,
|
||||
) {}
|
||||
}
|
||||
|
||||
@@ -8,11 +8,8 @@ import BoardViewModel from "./boardViewModel";
|
||||
import ChatViewModel from "../Chat/chatViewModel";
|
||||
import CoreViewModel from "../Global/coreViewModel";
|
||||
import { IndexManager } from "../../Model/Utility/utility";
|
||||
import StorageModel from "../../Model/Global/storageModel";
|
||||
|
||||
export default class TaskPageViewModel {
|
||||
boardsAndTasksModel: BoardsAndTasksModel;
|
||||
|
||||
// data
|
||||
boardIndexManager: IndexManager<BoardViewModel> = new IndexManager(
|
||||
(boardViewModel: BoardViewModel) => boardViewModel.name.value,
|
||||
@@ -155,16 +152,14 @@ export default class TaskPageViewModel {
|
||||
constructor(
|
||||
public coreViewModel: CoreViewModel,
|
||||
public chatViewModel: ChatViewModel,
|
||||
boardModel: BoardsAndTasksModel,
|
||||
public boardsAndTasksModel: BoardsAndTasksModel,
|
||||
) {
|
||||
this.boardsAndTasksModel = boardModel;
|
||||
|
||||
this.chatViewModel = chatViewModel;
|
||||
|
||||
this.loadData();
|
||||
|
||||
// handlers
|
||||
boardModel.boardHandlerManager.addHandler(
|
||||
boardsAndTasksModel.boardHandlerManager.addHandler(
|
||||
(boardInfoFileContent: BoardInfoFileContent) => {
|
||||
this.showBoardInList(boardInfoFileContent);
|
||||
this.updateBoardIndices();
|
||||
|
||||
@@ -11,13 +11,6 @@ import TaskContainingPageViewModel from "./taskContainingPageViewModel";
|
||||
import { allowDrag } from "../../View/utility";
|
||||
|
||||
export default class TaskViewModel {
|
||||
boardsAndTasksModel: BoardsAndTasksModel;
|
||||
|
||||
containingModel: TaskContainingPageViewModel;
|
||||
|
||||
// data
|
||||
task: TaskFileContent;
|
||||
|
||||
get sortingString(): string {
|
||||
const splitDate: string[] = this.date.value.split("-");
|
||||
const year = padZero(splitDate[0], 4);
|
||||
@@ -213,15 +206,10 @@ export default class TaskViewModel {
|
||||
constructor(
|
||||
public coreViewModel: CoreViewModel,
|
||||
public chatViewModel: ChatViewModel,
|
||||
boardsAndTasksModel: BoardsAndTasksModel,
|
||||
containingModel: TaskContainingPageViewModel,
|
||||
taskFileContent: TaskFileContent,
|
||||
public boardsAndTasksModel: BoardsAndTasksModel,
|
||||
public containingModel: TaskContainingPageViewModel,
|
||||
public task: TaskFileContent,
|
||||
) {
|
||||
this.boardsAndTasksModel = boardsAndTasksModel;
|
||||
this.containingModel = containingModel;
|
||||
|
||||
this.task = taskFileContent;
|
||||
|
||||
// load
|
||||
this.loadAllData();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user