diff --git a/src/background.js b/src/background.js index 8d664ff..b68c9cb 100644 --- a/src/background.js +++ b/src/background.js @@ -2,7 +2,7 @@ /* global __static */ import {app, BrowserWindow, Menu, protocol} from 'electron'; -import {createProtocol, installVueDevtools} from 'vue-cli-plugin-electron-builder/lib'; +import {createProtocol, } from 'vue-cli-plugin-electron-builder/lib'; import windowRepository from './windowRepository'; import installExtension from 'electron-devtools-installer'; @@ -94,10 +94,9 @@ app.on('activate', () => { // Some APIs can only be used after this event occurs. app.on('ready', () => { installExtension('nhdogjmejiglipccpnnnanhbledajbpd') - .then((name) => console.log(`Added Extension: ${name}`)) - .catch((err) => console.log('An error occurred: ', err)); + .then((name) => console.log(`Added Extension: ${name}`)) + .catch((err) => console.log('An error occurred: ', err)); createWindow(); - }); // Exit cleanly on request from parent process in development mode. diff --git a/src/components/board/BoardContent.vue b/src/components/board/BoardContent.vue index 68fdc74..5941482 100644 --- a/src/components/board/BoardContent.vue +++ b/src/components/board/BoardContent.vue @@ -116,7 +116,7 @@ if (!item.isDone) { return true; } - return this.board.showDone; + return this.board.showDone && this.board.showImportant; }, scheduleScroll (itemId) { setTimeout(() => { diff --git a/src/components/board/boardSettingsBar/BoardSettings.vue b/src/components/board/boardSettingsBar/BoardSettings.vue index 62a7394..debccc7 100644 --- a/src/components/board/boardSettingsBar/BoardSettings.vue +++ b/src/components/board/boardSettingsBar/BoardSettings.vue @@ -2,12 +2,14 @@
+
+ + diff --git a/src/components/board/item/ActionButtons.vue b/src/components/board/item/ActionButtons.vue index c482ec4..8af34b2 100644 --- a/src/components/board/item/ActionButtons.vue +++ b/src/components/board/item/ActionButtons.vue @@ -34,7 +34,7 @@ props: ['isImportant'], data(){ return{ - localisImportant: this.isImportant + } }, methods: { @@ -50,11 +50,9 @@ this.moveToBottom(); break; case "markUnimportant": - this.Important = true; this.changeToFalse(); break; case "markImportant": - this.Important = false; this.changeToTure(); break; } diff --git a/src/repositories/boardsRepository.js b/src/repositories/boardsRepository.js index d5a677e..b9cbe28 100644 --- a/src/repositories/boardsRepository.js +++ b/src/repositories/boardsRepository.js @@ -12,6 +12,7 @@ function defaultBoard() { label: "Default board", prependNewItem: false, showDone: false, + showImportant: false, showProgress: false }; } @@ -74,6 +75,7 @@ export default { .insert({ label: boardName, showDone: false, + showImportant: false, showProgress: false, prependNewItem: defaults.prependNewItems, items: [], @@ -119,6 +121,7 @@ export default { .insert({ label: newName, showDone: false, + showImportant: false, showProgress: false, prependNewItem: false, items, @@ -210,6 +213,7 @@ export default { progress: progressCount(board), prependNewItem: board.prependNewItem, showDone: board.showDone, + showImportant: board.showImportant, showProgress: board.showProgress }; }); @@ -357,6 +361,20 @@ export default { db.set("activeBoard", boardId) .write(); }, + switchShowImportant(boardId, value) { + const board = db + .get("boards") + .find({id: boardId}); + + const oldBoardVal = board.cloneDeep().value(); + + const res = board + .assign({showImportant: value}) + .write(); + const newBoardVal = board.cloneDeep().value(); + syncRepository.addToSyncQueue(oldBoardVal, newBoardVal); + return res; + }, switchShowDone(boardId, value) { const board = db .get("boards") diff --git a/src/store/modules/boards.js b/src/store/modules/boards.js index ed3531a..30250da 100644 --- a/src/store/modules/boards.js +++ b/src/store/modules/boards.js @@ -45,6 +45,9 @@ const mutations = { SWITCH_SHOW_DONE(state, {showDone}) { state.activeBoard.showDone = showDone; }, + SWITCH_SHOW_IMPORTANT(state, {showImportant}) { + state.activeBoard.showImportant = showImportant; + }, SWITCH_SHOW_PROGRESS(state, val) { state.activeBoard.showProgress = val; } @@ -138,6 +141,10 @@ const actions = { boardsRepository.switchShowDone(boardId, showDone); commit("SWITCH_SHOW_DONE", {boardId, showDone}); }, + switchShowImportant({commit}, {boardId, showImportant}) { + boardsRepository.switchShowImportant(boardId, showImportant); + commit("SWITCH_SHOW_IMPORTANT", {boardId, showImportant}); + }, switchShowProgress({commit}, {boardId, val}) { itemsRepository.switchShowProgress(boardId, val); commit("SWITCH_SHOW_PROGRESS", val);