Commit d41ce99e authored by Janis Streib's avatar Janis Streib 🦉
Browse files

ADD: delete account (ta)

parent 6ed3ce62
Pipeline #117221 passed with stages
in 5 minutes and 3 seconds
......@@ -158,19 +158,6 @@
<b-button variant="outline-secondary" @click="cancel">
Abbrechen
</b-button>
<b-button id="button-delete-account" variant="danger">
Löschen
</b-button>
<b-popover ref="popoverAccountDelete" target="button-delete-account" triggers="click"
placement="bottom">
<template v-slot:title>Account wirklich löschen?</template>
<b-button variant="danger" :disabled="waiting" @click="deleteAccount">
Löschen
</b-button>
<b-button variant="outline-secondary" @click="$refs.popoverAccountDelete.$emit('close')">
Abbrechen
</b-button>
</b-popover>
<b-button variant="primary" :disabled="waiting" @click="editAccount">
Änderungen übernehmen
</b-button>
......@@ -285,15 +272,25 @@
</b-col>
<b-col lg="2">
<template v-if="account.parent_login_name !== account.login_name">
<b-button block variant="outline-primary"
:id="'button-edit-account-' + account.login_name"
@click="showModalEditAccount(account)">
<font-awesome-icon :icon="['far', 'edit']"/>
</b-button>
<b-tooltip placement="bottom" :target="'button-edit-account-' + account.login_name"
triggers="hover" variant="primary">
Konto bearbeiten
</b-tooltip>
<b-button-group class="d-flex">
<b-button @click="deleteAccount(account)" variant="outline-danger"
:id="'button-delete-account-' + account.login_name">
<font-awesome-icon :icon="['far', 'trash-alt']"></font-awesome-icon>
</b-button>
<b-tooltip :target="'button-delete-account-' + account.login_name" triggers="hover"
variant="danger" placement="left">
Konto löschen
</b-tooltip>
<b-button variant="outline-primary"
:id="'button-edit-account-' + account.login_name"
@click="showModalEditAccount(account)">
<font-awesome-icon :icon="['far', 'edit']"/>
</b-button>
<b-tooltip placement="bottom" :target="'button-edit-account-' + account.login_name"
triggers="hover" variant="primary">
Konto bearbeiten
</b-tooltip>
</b-button-group>
</template>
</b-col>
</b-row>
......@@ -618,41 +615,16 @@ export default {
this.waiting = false
})
},
deleteAccount() {
this.waiting = true
AccountService.delete(this.$store.state.netdb_axios_config, {
do_delete_references: true,
login_name_old: this.new_account.login_name
}).then(() => {
this.$bvModal.hide('modal-edit-account')
this.fetchData()
this.waiting = false
}).catch(error => {
this.modal_alert_content = error.response.data.error.type.text_descr
this.show_modal_alert = true
this.waiting = false
})
},
createToken() {
this.waiting = true
TokenService.create(this.$store.state.netdb_axios_config, {
description_new: this.new_token.description,
login_name_new: this.new_token.login_name,
expiration_date_new: this.new_token.expiration_date
}).then(response => {
this.$bvModal.hide('modal-create-token')
this.token = response.data[0][0].token
this.$bvModal.show('modal-token')
this.fetchData()
this.waiting = false
}).catch(error => {
this.modal_alert_content = error.response.data.error.type.text_descr
this.show_modal_alert = true
this.waiting = false
})
deleteAccount(item) {
const ta = transactionutil.generateDeleteElement('cntl.mgr', AccountService.deleteParamsList(), item, 'Unterkonto ' + item.login_name)
this.$store.commit('addTransactionElement', ta)
this.$emit('commited', ta)
if (!this.isMobile() && !this.$store.state.show_sidebar) {
this.$store.state.show_sidebar = true
}
},
deleteToken(item) {
const ta = transactionutil.generateDeleteElement('cntl.wapi_auth', TokenService.deleteParamsList(), item, 'Toekn aus Unterkonto ' + item.login_name)
const ta = transactionutil.generateDeleteElement('cntl.wapi_auth', TokenService.deleteParamsList(), item, 'Token aus Unterkonto ' + item.login_name)
this.$store.commit('addTransactionElement', ta)
this.$emit('commited', ta)
if (!this.isMobile() && !this.$store.state.show_sidebar) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment