diff --git a/frontend/src/api/accounts.js b/frontend/src/api/accounts.js index d28af1007..2b299ac05 100644 --- a/frontend/src/api/accounts.js +++ b/frontend/src/api/accounts.js @@ -20,5 +20,8 @@ export default { }, patch (accountId, data) { return repository.patch(`${resource}/${accountId}/`, data) + }, + delete (accountId, data) { + return repository.post(`${resource}/${accountId}/delete/`, data) } } diff --git a/frontend/src/api/aliases.js b/frontend/src/api/aliases.js new file mode 100644 index 000000000..469ef4b7b --- /dev/null +++ b/frontend/src/api/aliases.js @@ -0,0 +1,24 @@ +import repository from './repository' + +const resource = 'aliases' + +export default { + get (aliasId) { + return repository.get(`${resource}/${aliasId}/`) + }, + getRandomAddress () { + return repository.get(`${resource}/random_address/`) + }, + validate (data) { + return repository.post(`${resource}/validate/`, data) + }, + create (data) { + return repository.post(`${resource}/`, data) + }, + patch (aliasId, data) { + return repository.patch(`${resource}/${aliasId}/`, data) + }, + delete (aliasId) { + return repository.delete(`${resource}/${aliasId}/`) + } +} diff --git a/frontend/src/api/parameters.js b/frontend/src/api/parameters.js index b4c6358e4..a18069dde 100644 --- a/frontend/src/api/parameters.js +++ b/frontend/src/api/parameters.js @@ -6,13 +6,13 @@ export default { getApplications () { return repository.get(`/${resource}/applications/`) }, - getAppliction (app) { + getApplication (app) { return repository.get(`/${resource}/${app}/`) }, getApplicationStructure (app) { return repository.get(`/${resource}/structure/?app=${app}`) }, saveApplication (app, data) { - return repository.post(`/${resource}/${app}/`, data) + return repository.put(`/${resource}/${app}/`, data) } } diff --git a/frontend/src/components/domains/DomainAliasForm.vue b/frontend/src/components/domains/DomainAliasForm.vue index f8615f9cd..0ccf82d77 100644 --- a/frontend/src/components/domains/DomainAliasForm.vue +++ b/frontend/src/components/domains/DomainAliasForm.vue @@ -10,9 +10,11 @@ name="name" rules="required" > + @@ -21,14 +23,16 @@ name="target" rules="required" > + -
- - - - - General - - - DNS - - - Limitations - - - Options - - - Summary - - - mdi-close - - - - -
- New domain / - General -
- -
- - Next - -
-
- -
- New domain / - DNS -
- -
- - Back - - - Next - -
-
- -
- New domain / - Limitations -
- -
- - Back - - - Next - -
-
- -
- New domain / - Options -
- -
- - Back - - - Next - -
-
- -
Summary
- -
- - Confirm and create - -
-
-
-
- -
+ + + + + + - - diff --git a/frontend/src/components/identities/AccountCreationForm.vue b/frontend/src/components/identities/AccountCreationForm.vue index 840366c09..4f1bfb822 100644 --- a/frontend/src/components/identities/AccountCreationForm.vue +++ b/frontend/src/components/identities/AccountCreationForm.vue @@ -1,143 +1,44 @@ diff --git a/frontend/src/components/tools/EmailField.vue b/frontend/src/components/tools/EmailField.vue index d50a3c133..be289951d 100644 --- a/frontend/src/components/tools/EmailField.vue +++ b/frontend/src/components/tools/EmailField.vue @@ -4,6 +4,7 @@ ref="input" v-model="input" outlined + dense v-bind="$attrs" v-on="$listeners" @input="update" @@ -31,7 +32,13 @@ import { mapGetters } from 'vuex' export default { - props: ['value'], + props: { + value: String, + allowAdd: { + type: Boolean, + default: false + } + }, computed: { ...mapGetters({ domains: 'identities/domains' @@ -75,6 +82,8 @@ export default { // on enter or tab if (this.filteredDomains.length > 0) { this.selectDomain(this.filteredDomains[this.selectionIndex]) + } else if (this.allowAdd) { + this.selectDomain() } e.preventDefault() } else if (keyCode === 27) { @@ -100,7 +109,9 @@ export default { } }, selectDomain (domain) { - this.input = this.input.split('@')[0] + '@' + domain.name + if (domain !== undefined) { + this.input = this.input.split('@')[0] + '@' + domain.name + } this.showMenu = false this.$emit('input', this.input) this.$emit('domain-selected') @@ -108,7 +119,11 @@ export default { update (value) { if (this.input.indexOf('@') !== -1) { this.domainSearch = this.input.split('@')[1] - this.showMenu = true + if (this.allowAdd) { + this.showMenu = this.filteredDomains.length > 0 + } else { + this.showMenu = true + } } else { this.showMenu = false } @@ -132,6 +147,11 @@ export default { this.$nextTick(() => { this.updateMinWidthProperty() }) + }, + watch: { + value (newValue) { + this.input = newValue + } } } diff --git a/frontend/src/router/index.js b/frontend/src/router/index.js index 8e3b6274f..855650e31 100644 --- a/frontend/src/router/index.js +++ b/frontend/src/router/index.js @@ -57,7 +57,14 @@ const routes = [ requiresAuth: true } }, - + { + path: '/identities/aliases/:id/edit', + name: 'AliasEdit', + component: () => import('../views/identities/AliasEdit.vue'), + meta: { + requiresAuth: true + } + }, { path: '/parameters/:app', name: 'ParametersEdit', diff --git a/frontend/src/views/identities/AliasEdit.vue b/frontend/src/views/identities/AliasEdit.vue new file mode 100644 index 000000000..54d26ed41 --- /dev/null +++ b/frontend/src/views/identities/AliasEdit.vue @@ -0,0 +1,28 @@ + + + diff --git a/frontend/src/views/identities/Identities.vue b/frontend/src/views/identities/Identities.vue index 0a6890cb3..88d79fd63 100644 --- a/frontend/src/views/identities/Identities.vue +++ b/frontend/src/views/identities/Identities.vue @@ -20,7 +20,7 @@ Account - + Alias @@ -37,24 +37,39 @@ > + + +