diff --git a/l10n/de.js b/l10n/de.js index bb9b27081b..0cad7004d2 100644 --- a/l10n/de.js +++ b/l10n/de.js @@ -411,6 +411,8 @@ OC.L10N.register( "Save" : "Speichern", "Today" : "Heute", "Tomorrow" : "Morgen", - "No due" : "Kein Fälligkeitsdatum" + "No due" : "Kein Fälligkeitsdatum", + "Set as default board" : "Als Standard-Board festlegen", + "Remove as default board" : "Als Standard-Board entfernen" }, "nplurals=2; plural=(n != 1);"); diff --git a/l10n/de.json b/l10n/de.json index e2610f4257..0923008321 100644 --- a/l10n/de.json +++ b/l10n/de.json @@ -409,6 +409,8 @@ "Save" : "Speichern", "Today" : "Heute", "Tomorrow" : "Morgen", - "No due" : "Kein Fälligkeitsdatum" + "No due" : "Kein Fälligkeitsdatum", + "Set as default board" : "Als Standard-Board festlegen", + "Remove as default board" : "Als Standard-Board entfernen" },"pluralForm" :"nplurals=2; plural=(n != 1);" } \ No newline at end of file diff --git a/l10n/de_DE.js b/l10n/de_DE.js index aa943e66fb..2c02c8f4b6 100644 --- a/l10n/de_DE.js +++ b/l10n/de_DE.js @@ -411,6 +411,8 @@ OC.L10N.register( "Save" : "Speichern", "Today" : "Heute", "Tomorrow" : "Morgen", - "No due" : "Kein Fälligkeitsdatum" + "No due" : "Kein Fälligkeitsdatum", + "Set as default board" : "Als Standard-Board festlegen", + "Remove as default board" : "Als Standard-Board entfernen" }, "nplurals=2; plural=(n != 1);"); diff --git a/l10n/de_DE.json b/l10n/de_DE.json index bb289a6d6a..0ae2053ff3 100644 --- a/l10n/de_DE.json +++ b/l10n/de_DE.json @@ -409,6 +409,8 @@ "Save" : "Speichern", "Today" : "Heute", "Tomorrow" : "Morgen", - "No due" : "Kein Fälligkeitsdatum" + "No due" : "Kein Fälligkeitsdatum", + "Set as default board" : "Als Standard-Board festlegen", + "Remove as default board" : "Als Standard-Board entfernen" },"pluralForm" :"nplurals=2; plural=(n != 1);" } \ No newline at end of file diff --git a/l10n/en_GB.js b/l10n/en_GB.js index c4f5771c69..7a9e9e1137 100644 --- a/l10n/en_GB.js +++ b/l10n/en_GB.js @@ -411,6 +411,8 @@ OC.L10N.register( "Save" : "Save", "Today" : "Today", "Tomorrow" : "Tomorrow", - "No due" : "No due" + "No due" : "No due", + "Set as default board" : "Set as default board", + "Remove as default board" : "Remove as default board" }, "nplurals=2; plural=(n != 1);"); diff --git a/l10n/en_GB.json b/l10n/en_GB.json index 05200cc663..176ce08e59 100644 --- a/l10n/en_GB.json +++ b/l10n/en_GB.json @@ -409,6 +409,8 @@ "Save" : "Save", "Today" : "Today", "Tomorrow" : "Tomorrow", - "No due" : "No due" + "No due" : "No due", + "Set as default board" : "Set as default board", + "Remove as default board" : "Remove as default board" },"pluralForm" :"nplurals=2; plural=(n != 1);" } \ No newline at end of file diff --git a/src/components/navigation/AppNavigationBoard.vue b/src/components/navigation/AppNavigationBoard.vue index 740999f9bf..4fac039ce1 100644 --- a/src/components/navigation/AppNavigationBoard.vue +++ b/src/components/navigation/AppNavigationBoard.vue @@ -72,6 +72,13 @@ {{ board.settings['notify-due'] === 'off' ? t('deck', 'Turn on due date reminders') : t('deck', 'Turn off due date reminders') }} + + + {{ isDefaultBoard ? t('deck', 'Remove as default board') : t('deck', 'Set as default board') }} + @@ -172,6 +179,8 @@ import LeaveIcon from 'vue-material-design-icons/ExitRun.vue' import AccountIcon from 'vue-material-design-icons/AccountOutline.vue' import CloseIcon from 'vue-material-design-icons/Close.vue' import CheckIcon from 'vue-material-design-icons/Check.vue' +import PinIcon from 'vue-material-design-icons/Pin.vue' +import PinOffIcon from 'vue-material-design-icons/PinOff.vue' import { loadState } from '@nextcloud/initial-state' import { emit } from '@nextcloud/event-bus' @@ -198,6 +207,8 @@ export default { CloneIcon, CloseIcon, CheckIcon, + PinIcon, + PinOffIcon, LeaveIcon, BoardCloneModal, BoardExportModal, @@ -231,6 +242,7 @@ export default { cloneModalOpen: false, exportModalOpen: false, currentUser: getCurrentUser(), + defaultBoardId: localStorage.getItem('deck.defaultBoardId'), } }, computed: { @@ -275,6 +287,9 @@ export default { } return '' }, + isDefaultBoard() { + return this.defaultBoardId === String(this.board.id) + }, }, watch: {}, mounted() { @@ -282,6 +297,15 @@ export default { this.popupItem = this.$el }, methods: { + toggleDefaultBoard() { + if (this.isDefaultBoard) { + localStorage.removeItem('deck.defaultBoardId') + this.defaultBoardId = null + } else { + localStorage.setItem('deck.defaultBoardId', String(this.board.id)) + this.defaultBoardId = String(this.board.id) + } + }, unDelete() { clearTimeout(this.undoTimeoutHandle) this.boardApi.unDeleteBoard(this.board) diff --git a/src/router.js b/src/router.js index e4f206cf9f..f311410cbb 100644 --- a/src/router.js +++ b/src/router.js @@ -155,6 +155,14 @@ router.beforeEach((to, from, next) => { next(path) return } + // Redirect to the pinned default board if set and navigating to the main route + if (to.name === 'main') { + const defaultBoardId = localStorage.getItem('deck.defaultBoardId') + if (defaultBoardId) { + next({ name: 'board', params: { id: parseInt(defaultBoardId, 10) } }) + return + } + } next() })