1515 @input =" updateColor " >
1616 <div :style =" { backgroundColor: '#' + editingLabel.color }" class =" color0 icon-colorpicker" />
1717 </NcColorPicker >
18- <input v-model =" editingLabel.title" type =" text" >
18+ <NcCheckboxRadioSwitch v-model =" editingLabelIsImportant "
19+ type="switch">
20+ {{ t('deck', 'Important') }}
21+ </NcCheckboxRadioSwitch >
22+ <input v-model =" editingLabel.title" type =" text" style =" margin-right : 20px ;" >
1923 <input :disabled =" !editLabelObjValidated"
2024 type =" submit"
2125 value =" "
3438 </template >
3539 <template v-else >
3640 <div v-if =" canManage && !isArchived" class =" label-title" @click =" clickEdit(label)" >
37- <span :style =" { backgroundColor: `#${label.color}`, color: textColor(label.color) }" >{{ label.title }}</span >
41+ <span :style =" {
42+ backgroundColor: `#${label.color}`,
43+ color: textColor(label.color),
44+ fontWeight: label.customSettings.isImportant ? 'bold' : 'normal'
45+ }" >{{ label.title }}</span >
3846 </div >
3947 <div v-else class =" label-title" >
40- <span :style =" { backgroundColor: `#${label.color}`, color: textColor(label.color) }" >{{ label.title }}</span >
48+ <span :style =" {
49+ backgroundColor: `#${label.color}`,
50+ color: textColor(label.color),
51+ fontWeight: label.customSettings.isImportant ? 'bold' : 'normal'
52+ }" >{{ label.title }}</span >
4153 </div >
4254
4355 <NcActions v-if =" canManage && ! isArchived " >
6274 @input =" updateColor " >
6375 <div :style =" { backgroundColor: '#' + addLabelObj.color }" class =" color0 icon-colorpicker" />
6476 </NcColorPicker >
65- <input v-model =" addLabelObj.title" type =" text" >
77+ <NcCheckboxRadioSwitch v-model =" addLabelIsImportant "
78+ type="switch">
79+ {{ t('deck', 'Important') }}
80+ </NcCheckboxRadioSwitch >
81+ <input v-model =" addLabelObj.title" type =" text" style =" margin-right : 20px ;" >
6682 <input :disabled =" !addLabelObjValidated"
6783 type =" submit"
6884 value =" "
88104
89105import { mapGetters } from ' vuex'
90106import Color from ' ../../mixins/color.js'
91- import { NcColorPicker , NcActions , NcActionButton } from ' @nextcloud/vue'
107+ import { NcColorPicker , NcActions , NcActionButton , NcCheckboxRadioSwitch } from ' @nextcloud/vue'
92108
93109export default {
94110 name: ' TagsTabSidebar' ,
95111 components: {
96112 NcColorPicker,
97113 NcActions,
98114 NcActionButton,
115+ NcCheckboxRadioSwitch,
99116 },
100117 mixins: [Color],
101118 data () {
@@ -139,7 +156,22 @@ export default {
139156 labelsSorted () {
140157 return [... this .labels ].sort ((a , b ) => a .title .localeCompare (b .title ))
141158 },
142-
159+ addLabelIsImportant: {
160+ get () {
161+ return this .addLabelObj ? .customSettings ? .isImportant || false
162+ },
163+ set (isImportant ) {
164+ this .addLabelObj .customSettings = { ... this .addLabelObj .customSettings , isImportant }
165+ },
166+ },
167+ editingLabelIsImportant: {
168+ get () {
169+ return this .editingLabel ? .customSettings ? .isImportant
170+ },
171+ set (isImportant ) {
172+ this .editingLabel .customSettings = { ... this .editingLabel .customSettings , isImportant }
173+ },
174+ },
143175 },
144176 methods: {
145177 updateColor (c ) {
@@ -157,15 +189,23 @@ export default {
157189 this .$store .dispatch (' removeLabelFromCurrentBoard' , id)
158190 },
159191 updateLabel (label ) {
160- this .$store .dispatch (' updateLabelFromCurrentBoard' , this .editingLabel )
192+ const payload = {
193+ ... this .editingLabel ,
194+ customSettings: { ... this .editingLabel .customSettings },
195+ }
196+ this .$store .dispatch (' updateLabelFromCurrentBoard' , payload)
161197 this .editingLabelId = null
162198 },
163199 clickShowAddLabel () {
164- this .addLabelObj = { cardId: null , color: this .defaultColors [Math .floor (Math .random () * this .defaultColors .length )], title: ' ' }
200+ this .addLabelObj = { cardId: null , color: this .defaultColors [Math .floor (Math .random () * this .defaultColors .length )], title: ' ' , customSettings : {} }
165201 this .addLabel = true
166202 },
167203 clickAddLabel () {
168- this .$store .dispatch (' addLabelToCurrentBoard' , this .addLabelObj )
204+ const payload = {
205+ ... this .addLabelObj ,
206+ customSettings: { ... this .addLabelObj .customSettings },
207+ }
208+ this .$store .dispatch (' addLabelToCurrentBoard' , payload)
169209 this .addLabel = false
170210 this .addLabelObj = null
171211 },
0 commit comments