Commit 80d8fdfe authored by Janis Streib's avatar Janis Streib 🦉
Browse files

ADD: toknes: transactions create

parent 4806ef53
Pipeline #117227 passed with stages
in 6 minutes and 10 seconds
......@@ -87,7 +87,7 @@
</b-input-group>
</b-col>
<b-col lg="3" sm="*">
<b-button block variant="outline-success" v-b-modal.modal-create-account class="shadow">
<b-button block variant="outline-success" @click="createAccount" class="shadow">
Unterkonto erstellen
</b-button>
</b-col>
......@@ -278,7 +278,7 @@
<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">
variant="danger" placement="bottom">
Konto löschen
</b-tooltip>
<b-button variant="outline-primary"
......@@ -356,6 +356,11 @@
:presets="db_editor_presets"
:non_optionals_order="['login_name', 'description', 'expiration_date', 'do_refresh_token']"
></DBEditor>
<DBEditor object_fq_name="cntl.mgr" modal_id="account_editor" :object_function="db_editor_function"
:old_data="db_editor_old_data"
:presets="db_editor_presets"
:non_optionals_order="['description', 'do_copy_roles', 'allow_data_manipulation']"
></DBEditor>
</Loading>
</div>
</template>
......@@ -367,7 +372,7 @@ import TokenService from '@/api-services.gen/cntl.wapi_auth'
import ApiUtil from '@/util/apiutil'
import '@/util/colorutil'
import DateTimePicker from '../../components/DateTimePicker'
import Mgr2RoleService from '@/api-services.gen/cntl.mgr2role'
// import Mgr2RoleService from '@/api-services.gen/cntl.mgr2role'
import RoleService from '@/api-services.gen/cntl.role'
import Loading from '../../components/Loading'
import CopyField from '../../components/CopyField'
......@@ -380,7 +385,7 @@ export default {
data() {
return {
db_editor_old_data: null,
db_editor_presets: null,
db_editor_presets: {},
db_editor_function: 'update',
tokens_by_account: null,
roles_by_account: null,
......@@ -555,34 +560,9 @@ export default {
}
},
createAccount() {
this.waiting = true
AccountService.create(this.$store.state.netdb_axios_config, {
do_copy_assignments_new: true,
description_new: this.new_account.description,
allow_data_manipulation_new: true,
do_copy_roles_new: this.new_account.do_copy_roles
}).then((response) => {
if (!this.new_account.do_copy_roles) {
this.new_account.login_name = response.data[0][0].login_name
const roles = []
this.new_account.roles.forEach(role => {
roles.push(role.fq_name)
})
Mgr2RoleService.bulk_update(this.$store.state.netdb_axios_config, {
mgr_login_name_old: this.new_account.login_name,
role_fq_name_list_old: [],
role_fq_name_list_new: roles
}).then(() => {
this.$bvModal.hide('modal-create-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
})
this.db_editor_old_data = this.db_editor_presets = {}
this.db_editor_function = 'create'
this.$bvModal.show('account_editor')
},
editAccount() {
this.waiting = true
......
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