refactor: 💡 Update manage dropdown for host-catalogs (#2456)
* refactor: 💡 Update manage dropdown for host-catalogs ✅ Closes: https://hashicorp.atlassian.net/browse/ICU-14664 * refactor: 💡 Refactored tests ✅ Closes: https://hashicorp.atlassian.net/browse/ICU-14664 * refactor: 💡 Refactored test ✅ Closes: https://hashicorp.atlassian.net/browse/ICU-14664 --------- Co-authored-by: Cameron Perera <cameron.perera@hashicorp.com>
This commit is contained in:
1 parent
333eebd731
commit
a3082e97e6
5 files changed
+46
-32
No files matched your search
@@ -3,35 +3,28 @@
|
||||
SPDX-License-Identifier: BUSL-1.1
|
||||
}}
|
||||
|
||||
<Rose::Dropdown
|
||||
@text={{t 'actions.manage'}}
|
||||
@dropdownRight={{true}}
|
||||
as |dropdown|
|
||||
>
|
||||
<Hds::Dropdown data-test-manage-host-catalogs-dropdown as |dd|>
|
||||
<dd.ToggleButton @text={{t 'actions.manage'}} @color='secondary' />
|
||||
{{#if (can 'create model' @model collection='hosts')}}
|
||||
<dropdown.link
|
||||
<dd.Interactive
|
||||
@route='scopes.scope.host-catalogs.host-catalog.hosts.new'
|
||||
@model={{@model}}
|
||||
>
|
||||
{{t 'resources.host.actions.create'}}
|
||||
</dropdown.link>
|
||||
@text={{t 'resources.host.actions.create'}}
|
||||
/>
|
||||
{{/if}}
|
||||
{{#if (can 'create model' @model collection='host-sets')}}
|
||||
<dropdown.link
|
||||
<dd.Interactive
|
||||
@route='scopes.scope.host-catalogs.host-catalog.host-sets.new'
|
||||
@model={{@model}}
|
||||
>
|
||||
{{t 'resources.host-set.actions.create'}}
|
||||
</dropdown.link>
|
||||
@text={{t 'resources.host-set.actions.create'}}
|
||||
/>
|
||||
{{/if}}
|
||||
{{#if (can 'delete model' @model)}}
|
||||
<dropdown.separator />
|
||||
<dropdown.button
|
||||
@style='danger'
|
||||
@disabled={{@model.canSave}}
|
||||
<dd.Separator />
|
||||
<dd.Interactive
|
||||
@text={{t 'resources.host-catalog.actions.delete'}}
|
||||
@color='critical'
|
||||
{{on 'click' (fn @delete @model)}}
|
||||
>
|
||||
{{t 'resources.host-catalog.actions.delete'}}
|
||||
</dropdown.button>
|
||||
/>
|
||||
{{/if}}
|
||||
</Rose::Dropdown>
|
||||
</Hds::Dropdown>
|
||||
Reference in new issue
Block a user