diff --git a/apps/settings/src/components/PersonalInfo/DisplayNameSection/DisplayName.vue b/apps/settings/src/components/PersonalInfo/DisplayNameSection/DisplayName.vue
new file mode 100644
index 00000000000..1f32f55dcf7
--- /dev/null
+++ b/apps/settings/src/components/PersonalInfo/DisplayNameSection/DisplayName.vue
@@ -0,0 +1,167 @@
+
+
+
+
+
+
+
+
+
diff --git a/apps/settings/src/components/PersonalInfo/DisplayNameSection/DisplayNameSection.vue b/apps/settings/src/components/PersonalInfo/DisplayNameSection/DisplayNameSection.vue
new file mode 100644
index 00000000000..100e7fad876
--- /dev/null
+++ b/apps/settings/src/components/PersonalInfo/DisplayNameSection/DisplayNameSection.vue
@@ -0,0 +1,100 @@
+
+
+
+
+
+
+
+
+
diff --git a/apps/settings/src/components/PersonalInfo/EmailSection/Email.vue b/apps/settings/src/components/PersonalInfo/EmailSection/Email.vue
index faca83821e2..6c0a98d26f9 100644
--- a/apps/settings/src/components/PersonalInfo/EmailSection/Email.vue
+++ b/apps/settings/src/components/PersonalInfo/EmailSection/Email.vue
@@ -21,7 +21,7 @@
-
+
-
+
-
+
+
+
@@ -75,8 +79,10 @@ import ActionButton from '@nextcloud/vue/dist/Components/ActionButton'
import { showError } from '@nextcloud/dialogs'
import debounce from 'debounce'
-import FederationControl from './FederationControl'
-import { savePrimaryEmail, saveAdditionalEmail, updateAdditionalEmail, removeAdditionalEmail } from '../../../service/PersonalInfoService'
+import FederationControl from '../shared/FederationControl'
+
+import { ACCOUNT_PROPERTY_READABLE_ENUM } from '../../../constants/AccountPropertyConstants'
+import { savePrimaryEmail, saveAdditionalEmail, saveAdditionalEmailScope, updateAdditionalEmail, removeAdditionalEmail } from '../../../service/PersonalInfo/EmailService'
export default {
name: 'Email',
@@ -92,60 +98,62 @@ export default {
type: String,
required: true,
},
- scope: {
- type: String,
- required: true,
+ index: {
+ type: Number,
+ default: 0,
},
primary: {
type: Boolean,
default: false,
},
- index: {
- type: Number,
- default: 0,
+ scope: {
+ type: String,
+ required: true,
},
},
data() {
return {
+ accountProperty: ACCOUNT_PROPERTY_READABLE_ENUM.EMAIL,
initialEmail: this.email,
localScope: this.scope,
+ saveAdditionalEmailScope,
showCheckmarkIcon: false,
showErrorIcon: false,
}
},
computed: {
- inputName() {
+ deleteDisabled() {
if (this.primary) {
- return 'email'
+ return this.email === ''
}
- return 'additionalEmail[]'
+ return this.email !== '' && !this.isValid()
},
- inputPlaceholder() {
+ deleteEmailLabel() {
if (this.primary) {
- return t('settings', 'Your email address')
+ return t('settings', 'Remove primary email')
}
- return t('settings', 'Additional email address {index}', { index: this.index + 1 })
+ return t('settings', 'Delete email')
},
federationDisabled() {
return !this.initialEmail
},
- deleteDisabled() {
+ inputName() {
if (this.primary) {
- return this.email === ''
+ return 'email'
}
- return this.email !== '' && !this.isValid()
+ return 'additionalEmail[]'
},
- deleteEmailLabel() {
+ inputPlaceholder() {
if (this.primary) {
- return t('settings', 'Remove primary email')
+ return t('settings', 'Your email address')
}
- return t('settings', 'Delete email')
+ return t('settings', 'Additional email address {index}', { index: this.index + 1 })
},
},
@@ -157,7 +165,7 @@ export default {
methods: {
onEmailChange(e) {
- this.$emit('update:email', e.target.value)
+ this.$emit('update:email', e.target.value.trim())
// $nextTick() ensures that references to this.email further down the chain give the correct non-outdated value
this.$nextTick(() => this.debounceEmailChange())
},
@@ -227,13 +235,9 @@ export default {
}
},
- isValid() {
- return /^\S+$/.test(this.email)
- },
-
handleDeleteAdditionalEmail(status) {
if (status === 'ok') {
- this.$emit('deleteAdditionalEmail')
+ this.$emit('delete-additional-email')
} else {
this.handleResponse('error', 'Unable to delete additional email address', {})
}
@@ -253,6 +257,10 @@ export default {
}
},
+ isValid() {
+ return /^\S+$/.test(this.email)
+ },
+
onScopeChange(scope) {
this.$emit('update:scope', scope)
},
@@ -261,7 +269,7 @@ export default {
diff --git a/apps/settings/src/components/PersonalInfo/EmailSection/EmailSection.vue b/apps/settings/src/components/PersonalInfo/EmailSection/EmailSection.vue
index 57e9ac60357..7b4a7b8f4eb 100644
--- a/apps/settings/src/components/PersonalInfo/EmailSection/EmailSection.vue
+++ b/apps/settings/src/components/PersonalInfo/EmailSection/EmailSection.vue
@@ -25,10 +25,14 @@
class="section"
@submit.stop.prevent="() => {}">
+ @add-additional="onAddAdditionalEmail" />
+ @delete-additional-email="onDeleteAdditionalEmail(index)" />
@@ -54,14 +58,14 @@
diff --git a/apps/settings/src/components/PersonalInfo/EmailSection/HeaderBar.vue b/apps/settings/src/components/PersonalInfo/shared/HeaderBar.vue
similarity index 65%
rename from apps/settings/src/components/PersonalInfo/EmailSection/HeaderBar.vue
rename to apps/settings/src/components/PersonalInfo/shared/HeaderBar.vue
index 7d2b1ab76b6..dcbbc2d09d7 100644
--- a/apps/settings/src/components/PersonalInfo/EmailSection/HeaderBar.vue
+++ b/apps/settings/src/components/PersonalInfo/shared/HeaderBar.vue
@@ -21,44 +21,66 @@
-