112
112
</div >
113
113
114
114
<h4 >{{ t('mail', 'Search in body') }}</h4 >
115
- <p v-if =" loadingPrioritySettings" class =" app-settings" >
116
- {{ prioritySettingsText }}
117
- </p >
118
- <p v-else class =" app-settings" >
119
- <input id =" priority-inbox-toggle"
120
- class =" checkbox"
121
- type =" checkbox"
115
+ <p class =" app-settings" >
116
+ <NcCheckboxRadioSwitch id =" priority-inbox-toggle"
122
117
:checked =" searchPriorityBody"
123
- @change =" onToggleSearchPriorityBody" >
124
- <label for =" priority-inbox-toggle" >{{ prioritySettingsText }}</label >
118
+ :loading =" loadingPrioritySettings"
119
+ @update:checked =" onToggleSearchPriorityBody" >
120
+ {{ prioritySettingsText }}
121
+ </NcCheckboxRadioSwitch >
125
122
</p >
126
123
127
124
<h4 >{{ t('mail', 'Reply text position') }}</h4 >
128
- <p v-if =" loadingReplySettings" class =" app-settings reply-settings" >
129
- <IconLoading :size =" 16" />
130
- {{ replySettingsText }}
131
- </p >
132
- <p v-else class =" app-settings" >
133
- <input id =" bottom-reply-enabled"
134
- class =" checkbox"
135
- type =" checkbox"
125
+ <p class =" app-settings reply-settings" >
126
+ <NcCheckboxRadioSwitch id =" bottom-reply-enabled"
136
127
:checked =" useBottomReplies"
137
- @change =" onToggleButtonReplies" >
138
- <label for =" bottom-reply-enabled" >{{ replySettingsText }}</label >
128
+ :loading =" loadingReplySettings"
129
+ @update:checked =" onToggleButtonReplies" >
130
+ {{ replySettingsText }}
131
+ </NcCheckboxRadioSwitch >
139
132
</p >
140
133
141
134
<h4 >{{ t('mail', 'Gravatar settings') }}</h4 >
142
- <p v-if =" loadingAvatarSettings" class =" app-settings avatar-settings" >
143
- <IconLoading :size =" 16" />
144
- {{ t('mail', 'Use Gravatar and favicon avatars') }}
145
- </p >
146
- <p v-else class =" app-settings" >
147
- <input id =" gravatar-enabled"
148
- class =" checkbox"
149
- type =" checkbox"
135
+ <p class =" app-settings avatar-settings" >
136
+ <NcCheckboxRadioSwitch id =" gravatar-enabled"
150
137
:checked =" useExternalAvatars"
151
- @change =" onToggleExternalAvatars" >
152
- <label for =" gravatar-enabled" >{{ t('mail', 'Use Gravatar and favicon avatars') }}</label >
138
+ :loading =" loadingAvatarSettings"
139
+ @update:checked =" onToggleExternalAvatars" >
140
+ {{ t('mail', 'Use Gravatar and favicon avatars') }}
141
+ </NcCheckboxRadioSwitch >
153
142
</p >
154
143
155
144
<h4 >{{ t('mail', 'Mailto') }}</h4 >
185
174
<p class =" settings-hint" >
186
175
{{ t('mail', 'Allow the app to collect data about your interactions. Based on this data, the app will adapt to your preferences. The data will only be stored locally.') }}
187
176
</p >
188
- <p v-if =" loadingOptOutSettings" class =" app-settings" >
189
- <IconLoading :size =" 16" />
190
- {{ optOutSettingsText }}
191
- </p >
192
- <p v-else class =" app-settings" >
193
- <input id =" data-collection-toggle"
194
- class =" checkbox"
195
- type =" checkbox"
177
+ <p class =" app-settings" >
178
+ <NcCheckboxRadioSwitch id =" data-collection-toggle"
196
179
:checked =" useDataCollection"
197
- @change =" onToggleCollectData" >
198
- <label for =" data-collection-toggle" >{{ optOutSettingsText }}</label >
180
+ :loading =" loadingOptOutSettings"
181
+ @update:checked =" onToggleCollectData" >
182
+ {{ optOutSettingsText }}
183
+ </NcCheckboxRadioSwitch >
199
184
</p >
200
185
201
186
<h4 >{{ t('mail', 'Trusted senders') }}</h4 >
206
191
{{ t('mail', 'Highlight external email addresses by enabling this feature, manage your internal addresses and domains to ensure recognized contacts stay unmarked.') }}
207
192
</p >
208
193
<p class =" app-settings" >
209
- <input id =" internal-address-toggle"
210
- class =" checkbox"
211
- type =" checkbox"
194
+ <NcCheckboxRadioSwitch id =" internal-address-toggle"
212
195
:checked =" useInternalAddresses"
213
- @change =" onToggleInternalAddress" >
214
- <label for =" internal-address-toggle" >{{ internalAddressText }}</label >
196
+ :loading =" loadingInternalAddresses"
197
+ @update:checked =" onToggleInternalAddress" >
198
+ {{ internalAddressText }}
199
+ </NcCheckboxRadioSwitch >
215
200
</p >
216
201
<InternalAddress />
217
202
256
241
</NcAppSettingsSection >
257
242
258
243
<NcAppSettingsSection id =" autotagging-settings" :name =" t('mail', 'Assistance features')" >
259
- <p v-if =" toggleAutoTagging" class =" app-settings" >
260
- <IconLoading :size =" 16" />
261
- </p >
262
- <p v-else class =" app-settings" >
263
- <input id =" auto-tagging-toggle"
264
- class =" checkbox"
265
- type =" checkbox"
244
+ <p class =" app-settings" >
245
+ <NcCheckboxRadioSwitch id =" auto-tagging-toggle"
266
246
:checked =" useAutoTagging"
267
- @change =" onToggleAutoTagging" >
268
- <label for =" auto-tagging-toggle" >{{ autoTaggingText }}</label >
247
+ :loading =" toggleAutoTagging"
248
+ @update:checked =" onToggleAutoTagging" >
249
+ {{ autoTaggingText }}
250
+ </NcCheckboxRadioSwitch >
269
251
</p >
270
252
<p v-if =" followUpFeatureAvailable" class =" app-settings" >
271
- <input id =" follow-up-reminder-toggle"
272
- class =" checkbox"
273
- type =" checkbox"
253
+ <NcCheckboxRadioSwitch id =" follow-up-reminder-toggle"
274
254
:checked =" useFollowUpReminders"
275
- @change =" onToggleFollowUpReminders" >
276
- <label for =" follow-up-reminder-toggle" >{{ followUpReminderText }}</label >
255
+ :loading =" loadingFollowUpReminders"
256
+ @update:checked =" onToggleFollowUpReminders" >
257
+ {{ followUpReminderText }}
258
+ </NcCheckboxRadioSwitch >
277
259
</p >
278
260
</NcAppSettingsSection >
279
261
<NcAppSettingsSection id =" about-settings" :name =" t('mail', 'About')" >
@@ -365,7 +347,7 @@ import { generateUrl } from '@nextcloud/router'
365
347
import { showError } from ' @nextcloud/dialogs'
366
348
import CompactMode from ' vue-material-design-icons/ReorderHorizontal.vue'
367
349
368
- import { NcAppSettingsSection , NcAppSettingsDialog , NcButton , NcLoadingIcon as IconLoading , NcCheckboxRadioSwitch , NcDialog , NcInputField } from ' @nextcloud/vue'
350
+ import { NcAppSettingsSection , NcAppSettingsDialog , NcButton , NcCheckboxRadioSwitch , NcDialog , NcInputField } from ' @nextcloud/vue'
369
351
import TextEditor from ' ./TextEditor.vue'
370
352
import IconAdd from ' vue-material-design-icons/Plus.vue'
371
353
import IconEmail from ' vue-material-design-icons/EmailOutline.vue'
@@ -392,7 +374,6 @@ export default {
392
374
NcButton,
393
375
IconEmail,
394
376
IconAdd,
395
- IconLoading,
396
377
IconLock,
397
378
IconClose,
398
379
IconCheck,
@@ -423,6 +404,7 @@ export default {
423
404
// eslint-disable-next-line
424
405
optOutSettingsText: t (' mail' , ' Activate' ),
425
406
loadingOptOutSettings: false ,
407
+ loadingInternalAddresses: false ,
426
408
// eslint-disable-next-line
427
409
replySettingsText: t (' mail' , ' Put my text to the bottom of a reply instead of on top of it.' ),
428
410
loadingReplySettings: false ,
@@ -432,6 +414,7 @@ export default {
432
414
followUpReminderText: t (' mail' , ' Remind about messages that require a reply but received none' ),
433
415
internalAddressText: t (' mail' , ' Use internal addresses' ),
434
416
toggleAutoTagging: false ,
417
+ loadingFollowUpReminders: false ,
435
418
displaySmimeCertificateModal: false ,
436
419
sortOrder: ' newest' ,
437
420
showSettings: false ,
@@ -539,49 +522,50 @@ export default {
539
522
async onOpen () {
540
523
this .showSettings = true
541
524
},
542
- onToggleButtonReplies (e ) {
525
+ onToggleButtonReplies (atBottom ) {
543
526
this .loadingReplySettings = true
544
527
545
528
this .mainStore .savePreference ({
546
529
key: ' reply-mode' ,
547
- value: e . target . checked ? ' bottom' : ' top' ,
530
+ value: atBottom ? ' bottom' : ' top' ,
548
531
})
549
532
.catch ((error ) => Logger .error (' could not save preferences' , { error }))
550
533
.then (() => {
551
534
this .loadingReplySettings = false
552
535
})
553
536
},
554
- onToggleExternalAvatars (e ) {
537
+ onToggleExternalAvatars (enabled ) {
555
538
this .loadingAvatarSettings = true
556
539
557
540
this .mainStore .savePreference ({
558
541
key: ' external-avatars' ,
559
- value: e . target . checked ? ' true' : ' false' ,
542
+ value: enabled ? ' true' : ' false' ,
560
543
})
561
544
.catch ((error ) => Logger .error (' could not save preferences' , { error }))
562
545
.then (() => {
563
546
this .loadingAvatarSettings = false
564
547
})
565
548
},
566
- async onToggleSearchPriorityBody (e ) {
549
+ async onToggleSearchPriorityBody (enabled ) {
567
550
this .loadingPrioritySettings = true
551
+
568
552
try {
569
553
await this .mainStore .savePreference ({
570
554
key: ' search-priority-body' ,
571
- value: e . target . checked ? ' true' : ' false' ,
555
+ value: enabled ? ' true' : ' false' ,
572
556
})
573
557
} catch (error) {
574
558
Logger .error (' could not save preferences' , { error })
575
559
} finally {
576
560
this .loadingPrioritySettings = false
577
561
}
578
562
},
579
- onToggleCollectData (e ) {
563
+ onToggleCollectData (collect ) {
580
564
this .loadingOptOutSettings = true
581
565
582
566
this .mainStore .savePreference ({
583
567
key: ' collect-data' ,
584
- value: e . target . checked ? ' true' : ' false' ,
568
+ value: collect ? ' true' : ' false' ,
585
569
})
586
570
.catch ((error ) => Logger .error (' could not save preferences' , { error }))
587
571
.then (() => {
@@ -603,13 +587,13 @@ export default {
603
587
showError (t (' mail' , ' Could not update preference' ))
604
588
}
605
589
},
606
- async onToggleAutoTagging (e ) {
590
+ async onToggleAutoTagging (enabled ) {
607
591
this .toggleAutoTagging = true
608
592
609
593
try {
610
594
await this .mainStore .savePreference ({
611
595
key: ' tag-classified-messages' ,
612
- value: e . target . checked ? ' true' : ' false' ,
596
+ value: enabled ? ' true' : ' false' ,
613
597
})
614
598
} catch (error) {
615
599
Logger .error (' could not save preferences' , { error })
@@ -619,26 +603,34 @@ export default {
619
603
this .toggleAutoTagging = false
620
604
}
621
605
},
622
- async onToggleFollowUpReminders (e ) {
606
+ async onToggleFollowUpReminders (enabled ) {
607
+ this .loadingFollowUpReminders = true
608
+
623
609
try {
624
610
await this .mainStore .savePreference ({
625
611
key: ' follow-up-reminders' ,
626
- value: e . target . checked ? ' true' : ' false' ,
612
+ value: enabled ? ' true' : ' false' ,
627
613
})
628
614
} catch (error) {
629
615
Logger .error (' Could not save preferences' , { error })
630
616
showError (t (' mail' , ' Could not update preference' ))
617
+ } finally {
618
+ this .loadingFollowUpReminders = false
631
619
}
632
620
},
633
- async onToggleInternalAddress (e ) {
621
+ async onToggleInternalAddress (enabled ) {
622
+ this .loadingInternalAddresses = true
623
+
634
624
try {
635
625
await this .mainStore .savePreference ({
636
626
key: ' internal-addresses' ,
637
- value: e . target . checked ? ' true' : ' false' ,
627
+ value: enabled ? ' true' : ' false' ,
638
628
})
639
629
} catch (error) {
640
630
Logger .error (' Could not save preferences' , { error })
641
631
showError (t (' mail' , ' Could not update preference' ))
632
+ } finally {
633
+ this .loadingInternalAddresses = false
642
634
}
643
635
},
644
636
registerProtocolHandler () {
@@ -681,12 +673,6 @@ export default {
681
673
</script >
682
674
683
675
<style lang="scss" scoped>
684
- p .app-settings span .loading-icon {
685
- display : inline-block ;
686
- vertical-align : middle ;
687
- padding : var (--default-grid-baseline ) 0 ;
688
- }
689
-
690
676
p .app-settings {
691
677
padding : calc (var (--default-grid-baseline ) * 2 ) 0 ;
692
678
}
@@ -771,10 +757,6 @@ p.app-settings {
771
757
.app-settings-section {
772
758
list-style : none ;
773
759
}
774
- // align it with the checkbox
775
- .internal_address {
776
- margin-inline-start : 3px ;
777
- }
778
760
779
761
.text-block-buttons {
780
762
width : 100% ;
0 commit comments