Skip to content

Commit 2f1289a

Browse files
authored
Merge pull request #8095 from nextcloud/backport/8093/stable34
[stable34] fix: Replace icon attributes with template slots
2 parents 8ec040d + 678bd87 commit 2f1289a

2 files changed

Lines changed: 76 additions & 24 deletions

File tree

src/components/cards/CardMenuEntries.vue

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,28 +24,36 @@
2424
{{ t('deck', 'Edit title') }}
2525
</NcActionButton>
2626
<NcActionButton v-if="canEdit && !isCurrentUserAssigned"
27-
icon="icon-user"
2827
:close-after-click="true"
2928
@click="assignCardToMe()">
29+
<template #icon>
30+
<AccountPlusIcon :size="20" decorative />
31+
</template>
3032
{{ t('deck', 'Assign to me') }}
3133
</NcActionButton>
3234
<NcActionButton v-if="canEdit && isCurrentUserAssigned"
33-
icon="icon-user"
3435
:close-after-click="true"
3536
@click="unassignCardFromMe()">
37+
<template #icon>
38+
<AccountMinusIcon :size="20" decorative />
39+
</template>
3640
{{ t('deck', 'Unassign myself') }}
3741
</NcActionButton>
3842
<NcActionButton v-if="canEdit"
39-
icon="icon-checkmark"
4043
:close-after-click="true"
4144
:disabled="isInDoneColumn && !!card.done"
4245
@click="changeCardDoneStatus()">
46+
<template #icon>
47+
<CheckIcon :size="20" decorative />
48+
</template>
4349
{{ card.done ? t('deck', 'Mark as not done') : t('deck', 'Mark as done') }}
4450
</NcActionButton>
4551
<NcActionButton v-if="canEdit"
46-
icon="icon-external"
4752
:close-after-click="true"
4853
@click="openCardMoveDialog">
54+
<template #icon>
55+
<OpenInNewIcon :size="20" decorative />
56+
</template>
4957
{{ t('deck', 'Move/copy card') }}
5058
</NcActionButton>
5159
<NcActionButton v-for="action in cardActions"
@@ -62,9 +70,11 @@
6270
{{ card.archived ? t('deck', 'Unarchive card') : t('deck', 'Archive card') }}
6371
</NcActionButton>
6472
<NcActionButton v-if="canEdit"
65-
icon="icon-delete"
6673
:close-after-click="true"
6774
@click="deleteCard()">
75+
<template #icon>
76+
<DeleteIcon :size="20" decorative />
77+
</template>
6878
{{ t('deck', 'Delete card') }}
6979
</NcActionButton>
7080
</div>
@@ -76,6 +86,11 @@ import ArchiveIcon from 'vue-material-design-icons/ArchiveOutline.vue'
7686
import CardBulletedIcon from 'vue-material-design-icons/CardBulletedOutline.vue'
7787
import PencilIcon from 'vue-material-design-icons/PencilOutline.vue'
7888
import SelectColor from 'vue-material-design-icons/Circle.vue'
89+
import AccountPlusIcon from 'vue-material-design-icons/AccountPlusOutline.vue'
90+
import AccountMinusIcon from 'vue-material-design-icons/AccountMinusOutline.vue'
91+
import CheckIcon from 'vue-material-design-icons/Check.vue'
92+
import OpenInNewIcon from 'vue-material-design-icons/OpenInNew.vue'
93+
import DeleteIcon from 'vue-material-design-icons/Delete.vue'
7994
import { generateUrl } from '@nextcloud/router'
8095
import { getCurrentUser } from '@nextcloud/auth'
8196
import { showUndo } from '@nextcloud/dialogs'
@@ -86,7 +101,7 @@ import { useActionsStore } from '../../stores/actions.js'
86101
87102
export default {
88103
name: 'CardMenuEntries',
89-
components: { NcColorPicker, NcActionButton, ArchiveIcon, CardBulletedIcon, PencilIcon, SelectColor },
104+
components: { NcColorPicker, NcActionButton, ArchiveIcon, CardBulletedIcon, PencilIcon, SelectColor, AccountPlusIcon, AccountMinusIcon, CheckIcon, OpenInNewIcon, DeleteIcon },
90105
props: {
91106
card: {
92107
type: Object,

src/components/navigation/AppNavigationBoard.vue

Lines changed: 55 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,19 @@
2828

2929
<template v-if="!deleted" slot="actions">
3030
<template v-if="!isDueSubmenuActive">
31-
<NcActionButton icon="icon-info"
32-
:close-after-click="true"
31+
<NcActionButton :close-after-click="true"
3332
@click="actionDetails">
33+
<template #icon>
34+
<InformationOutlineIcon :size="20" decorative />
35+
</template>
3436
{{ t('deck', 'Board details') }}
3537
</NcActionButton>
3638
<NcActionButton v-if="canManage && !board.archived"
37-
icon="icon-rename"
3839
:close-after-click="true"
3940
@click="actionEdit">
41+
<template #icon>
42+
<PencilIcon :size="20" decorative />
43+
</template>
4044
{{ t('deck', 'Edit board') }}
4145
</NcActionButton>
4246
<NcActionButton v-if="canCreate && !board.archived"
@@ -64,12 +68,18 @@
6468
{{ t('deck', 'Archive board') }}
6569
</NcActionButton>
6670
<NcActionButton v-if="canManage && !board.archived"
67-
icon="icon-download"
6871
:close-after-click="true"
6972
@click="actionExport">
73+
<template #icon>
74+
<DownloadIcon :size="20" decorative />
75+
</template>
7076
{{ t('deck', 'Export board') }}
7177
</NcActionButton>
72-
<NcActionButton v-if="!board.archived && 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')">
78+
<NcActionButton v-if="!board.archived && board.acl?.length === 0" @click="board.settings['notify-due'] === 'off' ? updateSetting('notify-due', 'all') : updateSetting('notify-due', 'off')">
79+
<template #icon>
80+
<BellOutlineIcon v-if="board.settings['notify-due'] === 'off'" :size="20" decorative />
81+
<BellOffOutlineIcon v-else :size="20" decorative />
82+
</template>
7383
{{ board.settings['notify-due'] === 'off' ? t('deck', 'Turn on due date reminders') : t('deck', 'Turn off due date reminders') }}
7484
</NcActionButton>
7585
<NcActionButton :close-after-click="true" @click="toggleDefaultBoard">
@@ -83,50 +93,62 @@
8393

8494
<!-- Due date reminder settings -->
8595
<template v-if="isDueSubmenuActive">
86-
<NcActionButton :icon="updateDueSetting ? 'icon-loading-small' : 'icon-view-previous'"
87-
:disabled="updateDueSetting"
96+
<NcActionButton :disabled="updateDueSetting"
8897
@click="isDueSubmenuActive=false">
98+
<template #icon>
99+
<NcLoadingIcon v-if="updateDueSetting" :size="20" />
100+
<ChevronLeftIcon v-else :size="20" decorative />
101+
</template>
89102
{{ t('deck', 'Due date reminders') }}
90103
</NcActionButton>
91104

92105
<NcActionButton name="notification"
93-
icon="icon-sound"
94106
:disabled="updateDueSetting"
95107
:class="{ 'forced-active': board.settings['notify-due'] === 'all' }"
96108
@click="updateSetting('notify-due', 'all')">
109+
<template #icon>
110+
<BellOutlineIcon :size="20" decorative />
111+
</template>
97112
{{ t('deck', 'All cards') }}
98113
</NcActionButton>
99114
<NcActionButton name="notification"
100-
icon="icon-user"
101115
:disabled="updateDueSetting"
102116
:class="{ 'forced-active': board.settings['notify-due'] === 'assigned' }"
103117
@click="updateSetting('notify-due', 'assigned')">
118+
<template #icon>
119+
<AccountIcon :size="20" decorative />
120+
</template>
104121
{{ t('deck', 'Assigned cards') }}
105122
</NcActionButton>
106123
<NcActionButton name="notification"
107-
icon="icon-sound-off"
108124
:disabled="updateDueSetting"
109125
:class="{ 'forced-active': board.settings['notify-due'] === 'off' }"
110126
@click="updateSetting('notify-due', 'off')">
127+
<template #icon>
128+
<BellOffOutlineIcon :size="20" decorative />
129+
</template>
111130
{{ t('deck', 'No notifications') }}
112131
</NcActionButton>
113132
</template>
114133
<NcActionButton v-else-if="!board.archived && board.acl?.length > 0"
115134
:name="t('deck', 'Due date reminders')"
116-
:icon="dueDateReminderIcon"
117135
@click="isDueSubmenuActive=true">
136+
<template #icon>
137+
<component :is="dueDateReminderIcon" :size="20" decorative />
138+
</template>
118139
{{ dueDateReminderText }}
119140
</NcActionButton>
120141

121142
<NcActionButton v-if="canManage && !isDueSubmenuActive"
122-
icon="icon-delete"
123143
:close-after-click="true"
124144
@click="actionDelete">
145+
<template #icon>
146+
<DeleteIcon :size="20" decorative />
147+
</template>
125148
{{ t('deck', 'Delete board') }}
126149
</NcActionButton>
127150

128151
<NcActionButton v-if="canLeave && !isDueSubmenuActive"
129-
icon="icon-delete"
130152
:close-after-click="true"
131153
@click="actionLeave">
132154
<template #icon>
@@ -171,7 +193,7 @@
171193
</template>
172194

173195
<script>
174-
import { NcAppNavigationIconBullet, NcAppNavigationItem, NcColorPicker, NcButton, NcTextField, NcActionButton } from '@nextcloud/vue'
196+
import { NcAppNavigationIconBullet, NcAppNavigationItem, NcColorPicker, NcButton, NcTextField, NcActionButton, NcLoadingIcon } from '@nextcloud/vue'
175197
import ClickOutside from 'vue-click-outside'
176198
import ArchiveIcon from 'vue-material-design-icons/ArchiveOutline.vue'
177199
import CloneIcon from 'vue-material-design-icons/ContentDuplicate.vue'
@@ -181,6 +203,13 @@ import CloseIcon from 'vue-material-design-icons/Close.vue'
181203
import CheckIcon from 'vue-material-design-icons/Check.vue'
182204
import PinIcon from 'vue-material-design-icons/Pin.vue'
183205
import PinOffIcon from 'vue-material-design-icons/PinOff.vue'
206+
import InformationOutlineIcon from 'vue-material-design-icons/InformationOutline.vue'
207+
import PencilIcon from 'vue-material-design-icons/PencilOutline.vue'
208+
import DownloadIcon from 'vue-material-design-icons/Download.vue'
209+
import DeleteIcon from 'vue-material-design-icons/Delete.vue'
210+
import ChevronLeftIcon from 'vue-material-design-icons/ChevronLeft.vue'
211+
import BellOutlineIcon from 'vue-material-design-icons/BellOutline.vue'
212+
import BellOffOutlineIcon from 'vue-material-design-icons/BellOffOutline.vue'
184213
185214
import { loadState } from '@nextcloud/initial-state'
186215
import { emit } from '@nextcloud/event-bus'
@@ -202,6 +231,7 @@ export default {
202231
NcButton,
203232
NcTextField,
204233
NcActionButton,
234+
NcLoadingIcon,
205235
AccountIcon,
206236
ArchiveIcon,
207237
CloneIcon,
@@ -210,6 +240,13 @@ export default {
210240
PinIcon,
211241
PinOffIcon,
212242
LeaveIcon,
243+
InformationOutlineIcon,
244+
PencilIcon,
245+
DownloadIcon,
246+
DeleteIcon,
247+
ChevronLeftIcon,
248+
BellOutlineIcon,
249+
BellOffOutlineIcon,
213250
BoardCloneModal,
214251
BoardExportModal,
215252
},
@@ -269,13 +306,13 @@ export default {
269306
},
270307
dueDateReminderIcon() {
271308
if (this.board.settings['notify-due'] === 'all') {
272-
return 'icon-sound'
309+
return 'BellOutlineIcon'
273310
} else if (this.board.settings['notify-due'] === 'assigned') {
274-
return 'icon-user'
311+
return 'AccountIcon'
275312
} else if (this.board.settings['notify-due'] === 'off') {
276-
return 'icon-sound-off'
313+
return 'BellOffOutlineIcon'
277314
}
278-
return ''
315+
return 'BellOutlineIcon'
279316
},
280317
dueDateReminderText() {
281318
if (this.board.settings['notify-due'] === 'all') {

0 commit comments

Comments
 (0)