Files
threshold-ui/ui/admin/app/components/auth-methods/auth-method/actions/index.hbs
T
Lauren 5555603a5c [Retire] Rose::Dropdown (#2858)
* remove dropdown styling

* remove rose/dropdown child component integration tests

* refactor tests, delete tests

* remove rose dropdown component from addons/

* refactor tests, delete tests

* run yarn format

* remove additional rose dropdown files from addons

* remove ref to rose dropdown from readme

* remove skipped test, comment states no longer relevant

* remove unused ref to rose-header-dropdown selector

* refactor tests using .rose-dropdown selector, cleanup

* run yarn format

* add selector to commonSelectors, refactor more tests

* nest .hds-dropdown selector in place of .rose-dropdown

* revert @use dropdpwn

* remove line, styling already applied on btn selector

* removed unused dropdown-radio-btn selector
2025-06-02 14:06:06 -04:00

64 lines
2.0 KiB
Handlebars

{{!
Copyright (c) HashiCorp, Inc.
SPDX-License-Identifier: BUSL-1.1
}}
{{#if (or @model.isOIDC @model.isLDAP)}}
<Hds::Dropdown class='change-state' data-test-change-state as |dd|>
<dd.Title @text={{t 'actions.change-state'}} />
<dd.ToggleButton
@text={{t (concat 'states.' @model.state)}}
@color='secondary'
@icon={{if
@model.isInactive
'x-circle'
(if @model.isPrivate 'lock' 'check-circle')
}}
/>
{{#each @model.options.state as |state|}}
<dd.Radio
checked={{eq @model.state state}}
@value={{state}}
{{on 'change' (fn @changeState @model state)}}
>
{{t (concat 'states.' state)}}
</dd.Radio>
{{/each}}
</Hds::Dropdown>
{{/if}}
<Hds::Dropdown data-test-manage-auth-method as |dd|>
<dd.ToggleButton @text={{t 'actions.manage'}} @color='secondary' />
{{#if @model.isPrimary}}
<dd.Interactive {{on 'click' (fn @removeAsPrimary @model)}}>
{{t 'resources.auth-method.actions.remove-as-primary'}}
</dd.Interactive>
{{else}}
<dd.Interactive {{on 'click' (fn @makePrimary @model)}}>
{{t 'resources.auth-method.actions.make-primary'}}
</dd.Interactive>
{{/if}}
{{#if (can 'create model' @model collection='accounts')}}
<dd.Interactive
@route='scopes.scope.auth-methods.auth-method.accounts.new'
@model={{@model}}
>
{{t 'resources.account.actions.create'}}
</dd.Interactive>
{{/if}}
{{#if (can 'create model' @model collection='managed-groups')}}
{{#if (or @model.isOIDC @model.isLDAP)}}
<dd.Interactive
@route='scopes.scope.auth-methods.auth-method.managed-groups.new'
@model={{@model}}
>
{{t 'resources.managed-group.actions.create'}}
</dd.Interactive>
{{/if}}
{{/if}}
{{#if (can 'delete auth-method' @model)}}
<dd.Separator />
<dd.Interactive @color='critical' {{on 'click' (fn @delete @model)}}>
{{t 'resources.auth-method.actions.delete'}}
</dd.Interactive>
{{/if}}
</Hds::Dropdown>