Skip to content

Commit e6e5dd9

Browse files
committed
Move to icon buttons
Signed-off-by: Julius Härtl <jus@bitgrid.net>
1 parent 07b8b3b commit e6e5dd9

2 files changed

Lines changed: 36 additions & 15 deletions

File tree

src/components/navigation/AppNavigationBoard.vue

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -68,24 +68,28 @@
6868
<ActionButton :icon="!showDueSettings ? 'icon-notifications-dark' : 'icon-view-previous' " @click="showDueSettings=!showDueSettings">
6969
{{ t('deck', 'Due date reminders') }}
7070
</ActionButton>
71-
<ActionRadio v-if="showDueSettings"
71+
72+
<ActionButton v-if="showDueSettings"
7273
name="notification"
73-
:checked="board.settings['notify-due'] === 'all'"
74-
@change="updateSetting('notify-due', 'all')">
74+
icon="icon-sound"
75+
:class="{ 'forced-active': board.settings['notify-due'] === 'all' }"
76+
@click="updateSetting('notify-due', 'all')">
7577
{{ t('deck', 'All cards') }}
76-
</ActionRadio>
77-
<ActionRadio v-if="showDueSettings"
78+
</ActionButton>
79+
<ActionButton v-if="showDueSettings"
7880
name="notification"
79-
:checked="board.settings['notify-due'] === 'assigned'"
80-
@change="updateSetting('notify-due', 'assigned')">
81+
icon="icon-user"
82+
:class="{ 'forced-active': board.settings['notify-due'] === 'assigned' }"
83+
@click="updateSetting('notify-due', 'assigned')">
8184
{{ t('deck', 'Assigned cards') }}
82-
</ActionRadio>
83-
<ActionRadio v-if="showDueSettings"
85+
</ActionButton>
86+
<ActionButton v-if="showDueSettings"
8487
name="notification"
85-
:checked="board.settings['notify-due'] === 'off'"
86-
@change="updateSetting('notify-due', 'off')">
88+
icon="icon-sound-off"
89+
:class="{ 'forced-active': board.settings['notify-due'] === 'off' }"
90+
@click="updateSetting('notify-due', 'off')">
8791
{{ t('deck', 'No notifications') }}
88-
</ActionRadio>
92+
</ActionButton>
8993

9094
<ActionButton v-if="canManage && !showDueSettings"
9195
icon="icon-delete"
@@ -108,7 +112,7 @@
108112
</template>
109113

110114
<script>
111-
import { AppNavigationIconBullet, AppNavigationCounter, AppNavigationItem, ColorPicker, Actions, ActionButton, ActionRadio } from '@nextcloud/vue'
115+
import { AppNavigationIconBullet, AppNavigationCounter, AppNavigationItem, ColorPicker, Actions, ActionButton } from '@nextcloud/vue'
112116
import ClickOutside from 'vue-click-outside'
113117
114118
export default {
@@ -120,7 +124,6 @@ export default {
120124
ColorPicker,
121125
Actions,
122126
ActionButton,
123-
ActionRadio,
124127
},
125128
directives: {
126129
ClickOutside,
@@ -299,4 +302,8 @@ export default {
299302
background-size: 14px;
300303
}
301304
}
305+
306+
.forced-active {
307+
box-shadow: inset 4px 0 var(--color-primary-element);
308+
}
302309
</style>

src/store/main.js

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,21 @@ export default new Vuex.Store({
138138
},
139139
mutations: {
140140
SET_CONFIG(state, { key, value }) {
141-
Vue.set(state.config, key, value)
141+
const [scope, id, configKey] = key.split(':', 3)
142+
let indexExisting = -1
143+
switch (scope) {
144+
case 'board':
145+
indexExisting = state.boards.findIndex((b) => {
146+
return id === '' + b.id
147+
})
148+
149+
if (indexExisting > -1) {
150+
Vue.set(state.boards[indexExisting].settings, configKey, value)
151+
}
152+
break
153+
default:
154+
Vue.set(state.config, key, value)
155+
}
142156
},
143157
setSearchQuery(state, searchQuery) {
144158
state.searchQuery = searchQuery

0 commit comments

Comments
 (0)