add type annotations, improve ui
This commit is contained in:
@@ -65,6 +65,8 @@ export default class BoardViewModel extends TaskContainingPageViewModel {
|
||||
this.color.value,
|
||||
);
|
||||
this.taskPageViewModel.updateBoard(newBoardInfoFileContent);
|
||||
|
||||
this.taskPageViewModel.selectBoard(this);
|
||||
};
|
||||
|
||||
applyColor = (): void => {
|
||||
@@ -305,8 +307,10 @@ export default class BoardViewModel extends TaskContainingPageViewModel {
|
||||
|
||||
// keystrokes
|
||||
this.registerKeyStroke(CommonKeys.Filter, this.showFilterModal);
|
||||
this.registerKeyStroke(CommonKeys.CloseOrCancel, this.hideFilterModal);
|
||||
this.registerKeyStroke(CommonKeys.Reset, this.resetFilter);
|
||||
this.registerKeyStroke(CommonKeys.CloseOrCancel, this.hideFilterModal);
|
||||
this.registerKeyStroke(CommonKeys.Settings, this.showSettings);
|
||||
this.registerKeyStroke(CommonKeys.Apply, this.hideSettings);
|
||||
|
||||
this.taskPageViewModel.registerContext(this.boardInfo.fileId, this);
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ export default class TaskPageViewModel extends ContextHost<string> {
|
||||
getBasePath = (): string[] => {
|
||||
return [...this.boardsAndTasksModel.getViewPath()];
|
||||
};
|
||||
getBoardViewPath = (boardId): string[] => {
|
||||
getBoardViewPath = (boardId: string): string[] => {
|
||||
return [...this.getBasePath(), boardId];
|
||||
};
|
||||
getLastUsedBoardPath = (): string[] => {
|
||||
|
||||
@@ -18,16 +18,16 @@ export default class TaskViewModel extends Context {
|
||||
// util
|
||||
get sortingString(): string {
|
||||
const splitDate: string[] = this.date.value.split("-");
|
||||
const year = padZero(splitDate[0], 4);
|
||||
const month = padZero(splitDate[1], 2);
|
||||
const date = padZero(splitDate[2], 2);
|
||||
const year: string = padZero(splitDate[0], 4);
|
||||
const month: string = padZero(splitDate[1], 2);
|
||||
const date: string = padZero(splitDate[2], 2);
|
||||
|
||||
const splitTime: string[] = this.time.value.split(":");
|
||||
const hour = padZero(splitTime[0], 2);
|
||||
const minute = padZero(splitTime[1], 2);
|
||||
const hour: string = padZero(splitTime[0], 2);
|
||||
const minute: string = padZero(splitTime[1], 2);
|
||||
|
||||
const priorityNumber = parseInt(this.priority.value);
|
||||
const invertedPriority = 100 - priorityNumber;
|
||||
const priorityNumber: number = parseInt(this.priority.value);
|
||||
const invertedPriority: number = 100 - priorityNumber;
|
||||
|
||||
return (
|
||||
year +
|
||||
@@ -168,7 +168,9 @@ export default class TaskViewModel extends Context {
|
||||
loadVersionIds = (): void => {
|
||||
const versionIds: string[] =
|
||||
this.boardsAndTasksModel.listTaskVersionIds(this.task.fileId);
|
||||
const sortedVersionIds = versionIds.sort(localeCompare).reverse();
|
||||
const sortedVersionIds: string[] = versionIds
|
||||
.sort(localeCompare)
|
||||
.reverse();
|
||||
this.versionIds.clear();
|
||||
this.versionIds.add(...sortedVersionIds);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user