chore: add scope delete capability
This commit is contained in:
2 files changed
+29
-18
No files matched your search
@@ -36,25 +36,27 @@
|
||||
</Rose::Nav::Tabs>
|
||||
</page.navigation>
|
||||
|
||||
<page.actions>
|
||||
<Rose::Dropdown
|
||||
@text='{{t 'actions.manage'}}'
|
||||
@dropdownRight={{true}}
|
||||
as |dropdown|
|
||||
>
|
||||
<dropdown.button
|
||||
@style='danger'
|
||||
@disabled={{@model.canSave}}
|
||||
{{on 'click' (route-action 'delete' @model)}}
|
||||
{{#if (can 'delete model' @model)}}
|
||||
<page.actions>
|
||||
<Rose::Dropdown
|
||||
@text='{{t 'actions.manage'}}'
|
||||
@dropdownRight={{true}}
|
||||
as |dropdown|
|
||||
>
|
||||
{{#if @model.isOrg}}
|
||||
{{t 'resources.org.actions.delete'}}
|
||||
{{else}}
|
||||
{{t 'resources.project.actions.delete'}}
|
||||
{{/if}}
|
||||
</dropdown.button>
|
||||
</Rose::Dropdown>
|
||||
</page.actions>
|
||||
<dropdown.button
|
||||
@style='danger'
|
||||
@disabled={{@model.canSave}}
|
||||
{{on 'click' (route-action 'delete' @model)}}
|
||||
>
|
||||
{{#if @model.isOrg}}
|
||||
{{t 'resources.org.actions.delete'}}
|
||||
{{else}}
|
||||
{{t 'resources.project.actions.delete'}}
|
||||
{{/if}}
|
||||
</dropdown.button>
|
||||
</Rose::Dropdown>
|
||||
</page.actions>
|
||||
{{/if}}
|
||||
|
||||
<page.body>
|
||||
<Form::Scope
|
||||
|
||||
@@ -83,6 +83,15 @@ module('Acceptance | scopes | delete', function (hooks) {
|
||||
assert.equal(getScopeCount('org'), orgScopeCount - 1);
|
||||
});
|
||||
|
||||
test('cannot delete scope without proper authorization', async function (assert) {
|
||||
assert.expect(1);
|
||||
instances.scopes.org.update({ authorized_actions: [] });
|
||||
await visit(urls.orgScopeEdit);
|
||||
assert.notOk(
|
||||
find('.rose-layout-page-actions .rose-dropdown-button-danger')
|
||||
);
|
||||
});
|
||||
|
||||
test('can accept delete scope via dialog', async function (assert) {
|
||||
assert.expect(2);
|
||||
const confirmService = this.owner.lookup('service:confirm');
|
||||
|
||||
Reference in new issue
Block a user