Merge pull request #33035 from nextcloud/backport/31345/stable23

This commit is contained in:
John Molakvoæ 2022-07-07 11:49:31 +02:00 committed by GitHub
commit 2397ce22c4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 14 additions and 10 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -54,7 +54,6 @@
<Actions
class="email__actions"
:aria-label="t('settings', 'Email options')"
:disabled="deleteDisabled"
:force-menu="true">
<ActionButton
:aria-label="deleteEmailLabel"

View file

@ -48,8 +48,9 @@
<template v-if="additionalEmails.length">
<em class="additional-emails-label">{{ t('settings', 'Additional emails') }}</em>
<!-- TODO use unique key for additional email when uniqueness can be guaranteed, see https://github.com/nextcloud/server/issues/26866 -->
<Email v-for="(additionalEmail, index) in additionalEmails"
:key="index"
:key="additionalEmail.key"
:index="index"
:scope.sync="additionalEmail.scope"
:email.sync="additionalEmail.value"
@ -87,7 +88,7 @@ export default {
data() {
return {
accountProperty: ACCOUNT_PROPERTY_READABLE_ENUM.EMAIL,
additionalEmails,
additionalEmails: additionalEmails.map(properties => ({ ...properties, key: this.generateUniqueKey() })),
displayNameChangeSupported,
primaryEmail,
savePrimaryEmailScope,
@ -121,7 +122,7 @@ export default {
methods: {
onAddAdditionalEmail() {
if (this.isValidSection) {
this.additionalEmails.push({ value: '', scope: DEFAULT_ADDITIONAL_EMAIL_SCOPE })
this.additionalEmails.push({ value: '', scope: DEFAULT_ADDITIONAL_EMAIL_SCOPE, key: this.generateUniqueKey() })
}
},
@ -186,6 +187,10 @@ export default {
this.logger.error(errorMessage, error)
}
},
generateUniqueKey() {
return Math.random().toString(36).substring(2)
},
},
}
</script>