feat: 🎸 Add credential store delete CRUD operation
This commit is contained in:
1 parent
c45357bf25
commit
fce79d46d7
6 files changed
+41
-2
No files matched your search
@@ -467,6 +467,7 @@ export default function () {
|
||||
this.get('/credential-stores/:id');
|
||||
this.post('/credential-stores');
|
||||
this.patch('/credential-stores/:id');
|
||||
this.del('/credential-stores/:id');
|
||||
|
||||
// credential-libraries
|
||||
|
||||
|
||||
@@ -278,4 +278,4 @@ credential-library:
|
||||
messages:
|
||||
none:
|
||||
title: No Credential Libraries Available
|
||||
description: No Credential Libraries available in this credential store.
|
||||
description: No Credential Libraries available in this credential store.
|
||||
@@ -1,6 +1,7 @@
|
||||
import Route from '@ember/routing/route';
|
||||
import { action } from '@ember/object';
|
||||
import loading from 'ember-loading/decorator';
|
||||
import { confirm } from 'core/decorators/confirm';
|
||||
import { notifySuccess, notifyError } from 'core/decorators/notify';
|
||||
|
||||
export default class ScopesScopeCredentialStoresRoute extends Route {
|
||||
@@ -44,4 +45,19 @@ export default class ScopesScopeCredentialStoresRoute extends Route {
|
||||
credentialStore.rollbackAttributes();
|
||||
if (isNew) this.transitionTo('scopes.scope.credential-stores');
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes the credential store and redirects to index
|
||||
* @param {CredentialStoreModel} credentialStore
|
||||
*/
|
||||
@action
|
||||
@loading
|
||||
@confirm('questions.delete-confirm')
|
||||
@notifyError(({ message }) => message, { catch: true })
|
||||
@notifySuccess('notifications.delete-success')
|
||||
async delete(credentialStore) {
|
||||
await credentialStore.destroyRecord();
|
||||
await this.replaceWith('scopes.scope.credential-stores');
|
||||
this.refresh();
|
||||
}
|
||||
}
|
||||
@@ -25,5 +25,10 @@ export default class ScopesScopeCredentialStoresCredentialStoreRoute extends Rou
|
||||
into: 'scopes/scope/credential-stores/credential-store',
|
||||
outlet: 'navigation',
|
||||
});
|
||||
|
||||
this.render('scopes/scope/credential-stores/credential-store/-actions', {
|
||||
into: 'scopes/scope/credential-stores/credential-store',
|
||||
outlet: 'actions',
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -15,7 +15,7 @@
|
||||
</page.navigation>
|
||||
|
||||
<page.actions>
|
||||
{{!-- {{outlet 'actions'}} --}}
|
||||
{{outlet 'actions'}}
|
||||
</page.actions>
|
||||
|
||||
<page.body>
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
<Rose::Dropdown
|
||||
@text={{t 'actions.manage'}}
|
||||
@dropdownRight={{true}}
|
||||
as |dropdown|
|
||||
>
|
||||
<dropdown.link @route='scopes.scope.credential-stores.new' @model={{@model}}>
|
||||
{{t 'resources.credential-store.actions.create'}}
|
||||
</dropdown.link>
|
||||
<dropdown.separator />
|
||||
<dropdown.button
|
||||
@style='danger'
|
||||
@disabled={{@model.canSave}}
|
||||
{{on 'click' (route-action 'delete' @model)}}
|
||||
>
|
||||
{{t 'resources.credential-store.actions.delete'}}
|
||||
</dropdown.button>
|
||||
</Rose::Dropdown>
|
||||
Reference in new issue
Block a user