Simplify submenu logic for due date notifications
Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
@@ -34,56 +34,53 @@
|
|||||||
style="opacity: 0.5" />
|
style="opacity: 0.5" />
|
||||||
|
|
||||||
<template v-if="!deleted" slot="actions">
|
<template v-if="!deleted" slot="actions">
|
||||||
<ActionButton v-if="!showDueSettings"
|
<template v-if="!isDueSubmenuActive">
|
||||||
|
<ActionButton
|
||||||
icon="icon-more"
|
icon="icon-more"
|
||||||
:close-after-click="true"
|
:close-after-click="true"
|
||||||
@click="actionDetails">
|
@click="actionDetails">
|
||||||
{{ t('deck', 'Board details') }}
|
{{ t('deck', 'Board details') }}
|
||||||
</ActionButton>
|
</ActionButton>
|
||||||
<ActionButton v-if="canManage && !board.archived && !showDueSettings"
|
<ActionButton v-if="canManage"
|
||||||
icon="icon-rename"
|
icon="icon-rename"
|
||||||
:close-after-click="true"
|
:close-after-click="true"
|
||||||
@click="actionEdit">
|
@click="actionEdit">
|
||||||
{{ t('deck', 'Edit board') }}
|
{{ t('deck', 'Edit board') }}
|
||||||
</ActionButton>
|
</ActionButton>
|
||||||
<ActionButton v-if="canManage && !board.archived && !showDueSettings"
|
<ActionButton v-if="canManage"
|
||||||
icon="icon-clone"
|
icon="icon-clone"
|
||||||
:close-after-click="true"
|
:close-after-click="true"
|
||||||
@click="actionClone">
|
@click="actionClone">
|
||||||
{{ t('deck', 'Clone board') }}
|
{{ t('deck', 'Clone board') }}
|
||||||
</ActionButton>
|
</ActionButton>
|
||||||
<ActionButton v-if="canManage && board.archived && !showDueSettings"
|
<ActionButton v-if="canManage"
|
||||||
icon="icon-archive"
|
icon="icon-archive"
|
||||||
:close-after-click="true"
|
:close-after-click="true"
|
||||||
@click="actionUnarchive">
|
@click="actionUnarchive">
|
||||||
{{ t('deck', 'Unarchive board') }}
|
{{ t('deck', 'Unarchive board') }}
|
||||||
</ActionButton>
|
</ActionButton>
|
||||||
<ActionButton v-if="canManage && !board.archived && !showDueSettings"
|
<ActionButton v-if="canManage"
|
||||||
icon="icon-archive"
|
icon="icon-archive"
|
||||||
:close-after-click="true"
|
:close-after-click="true"
|
||||||
@click="actionArchive">
|
@click="actionArchive">
|
||||||
{{ t('deck', 'Archive board') }}
|
{{ t('deck', 'Archive board') }}
|
||||||
</ActionButton>
|
</ActionButton>
|
||||||
|
|
||||||
<!-- Due date reminder settings -->
|
<ActionButton v-if="board.acl.length === 0" :icon="board.settings['notify-due'] === 'off' ? 'icon-sound' : 'icon-sound-off'" @click="board.settings['notify-due'] === 'off' ? updateSetting('notify-due', 'all') : updateSetting('notify-due', 'off')">
|
||||||
|
|
||||||
<ActionButton v-if="showDueSettings"
|
|
||||||
:icon="updateDueSetting ? 'icon-loading-small' : 'icon-view-previous'"
|
|
||||||
:disabled="updateDueSetting"
|
|
||||||
@click="showDueSettings=false">
|
|
||||||
{{ t('deck', 'Due date reminders') }}
|
|
||||||
</ActionButton>
|
|
||||||
<ActionButton v-else-if="board.acl.length > 0"
|
|
||||||
:title="t('deck', 'Due date reminders')"
|
|
||||||
:icon="dueDateReminderIcon"
|
|
||||||
@click="showDueSettings=true">
|
|
||||||
{{ dueDateReminderText }}
|
|
||||||
</ActionButton>
|
|
||||||
<ActionButton v-else :icon="board.settings['notify-due'] === 'off' ? 'icon-sound' : 'icon-sound-off'" @click="board.settings['notify-due'] === 'off' ? updateSetting('notify-due', 'all') : updateSetting('notify-due', 'off')">
|
|
||||||
{{ board.settings['notify-due'] === 'off' ? t('deck', 'Turn on due date reminders') : t('deck', 'Turn off due date reminders') }}
|
{{ board.settings['notify-due'] === 'off' ? t('deck', 'Turn on due date reminders') : t('deck', 'Turn off due date reminders') }}
|
||||||
</ActionButton>
|
</ActionButton>
|
||||||
|
</template>
|
||||||
|
|
||||||
<ActionButton v-if="showDueSettings"
|
<!-- Due date reminder settings -->
|
||||||
|
<template v-if="isDueSubmenuActive">
|
||||||
|
<ActionButton
|
||||||
|
:icon="updateDueSetting ? 'icon-loading-small' : 'icon-view-previous'"
|
||||||
|
:disabled="updateDueSetting"
|
||||||
|
@click="isDueSubmenuActive=false">
|
||||||
|
{{ t('deck', 'Due date reminders') }}
|
||||||
|
</ActionButton>
|
||||||
|
|
||||||
|
<ActionButton
|
||||||
name="notification"
|
name="notification"
|
||||||
icon="icon-sound"
|
icon="icon-sound"
|
||||||
:disabled="updateDueSetting"
|
:disabled="updateDueSetting"
|
||||||
@@ -91,7 +88,7 @@
|
|||||||
@click="updateSetting('notify-due', 'all')">
|
@click="updateSetting('notify-due', 'all')">
|
||||||
{{ t('deck', 'All cards') }}
|
{{ t('deck', 'All cards') }}
|
||||||
</ActionButton>
|
</ActionButton>
|
||||||
<ActionButton v-if="showDueSettings"
|
<ActionButton
|
||||||
name="notification"
|
name="notification"
|
||||||
icon="icon-user"
|
icon="icon-user"
|
||||||
:disabled="updateDueSetting"
|
:disabled="updateDueSetting"
|
||||||
@@ -99,7 +96,7 @@
|
|||||||
@click="updateSetting('notify-due', 'assigned')">
|
@click="updateSetting('notify-due', 'assigned')">
|
||||||
{{ t('deck', 'Assigned cards') }}
|
{{ t('deck', 'Assigned cards') }}
|
||||||
</ActionButton>
|
</ActionButton>
|
||||||
<ActionButton v-if="showDueSettings"
|
<ActionButton
|
||||||
name="notification"
|
name="notification"
|
||||||
icon="icon-sound-off"
|
icon="icon-sound-off"
|
||||||
:disabled="updateDueSetting"
|
:disabled="updateDueSetting"
|
||||||
@@ -107,8 +104,15 @@
|
|||||||
@click="updateSetting('notify-due', 'off')">
|
@click="updateSetting('notify-due', 'off')">
|
||||||
{{ t('deck', 'No notifications') }}
|
{{ t('deck', 'No notifications') }}
|
||||||
</ActionButton>
|
</ActionButton>
|
||||||
|
</template>
|
||||||
|
<ActionButton v-else-if="board.acl.length > 0"
|
||||||
|
:title="t('deck', 'Due date reminders')"
|
||||||
|
:icon="dueDateReminderIcon"
|
||||||
|
@click="isDueSubmenuActive=true">
|
||||||
|
{{ dueDateReminderText }}
|
||||||
|
</ActionButton>
|
||||||
|
|
||||||
<ActionButton v-if="canManage && !showDueSettings"
|
<ActionButton v-if="canManage && !isDueSubmenuActive"
|
||||||
icon="icon-delete"
|
icon="icon-delete"
|
||||||
:close-after-click="true"
|
:close-after-click="true"
|
||||||
@click="actionDelete">
|
@click="actionDelete">
|
||||||
@@ -161,7 +165,7 @@ export default {
|
|||||||
undoTimeoutHandle: null,
|
undoTimeoutHandle: null,
|
||||||
editTitle: '',
|
editTitle: '',
|
||||||
editColor: '',
|
editColor: '',
|
||||||
showDueSettings: false,
|
isDueSubmenuActive: false,
|
||||||
updateDueSetting: null,
|
updateDueSetting: null,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -182,7 +186,7 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
canManage() {
|
canManage() {
|
||||||
return this.board.permissions.PERMISSION_MANAGE
|
return this.board.permissions.PERMISSION_MANAGE && !this.board.archived
|
||||||
},
|
},
|
||||||
dueDateReminderIcon() {
|
dueDateReminderIcon() {
|
||||||
if (this.board.settings['notify-due'] === 'all') {
|
if (this.board.settings['notify-due'] === 'all') {
|
||||||
@@ -304,7 +308,7 @@ export default {
|
|||||||
const setting = {}
|
const setting = {}
|
||||||
setting['board:' + this.board.id + ':' + key] = value
|
setting['board:' + this.board.id + ':' + key] = value
|
||||||
await this.$store.dispatch('setConfig', setting)
|
await this.$store.dispatch('setConfig', setting)
|
||||||
this.showDueSettings = false
|
this.isDueSubmenuActive = false
|
||||||
this.updateDueSetting = null
|
this.updateDueSetting = null
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user