Files
threshold-ui/ui/admin/app/components/auth-methods/auth-method/actions/index.hbs
T
Cameron Perera e842eb001d Icu 14039 accounts list, read, and set-password test (#2537)
* test: 💍 update test selectors for accounts list

✅ Closes: https://hashicorp.atlassian.net/browse/ICU-14039

* test: 💍 update test selectors for accounts read

✅ Closes: https://hashicorp.atlassian.net/browse/ICU-14039

* test: 💍 update test selectors for accounts set password

✅ Closes: https://hashicorp.atlassian.net/browse/ICU-14039
2024-10-25 15:58:09 -05:00

81 lines
2.3 KiB
Handlebars

{{!
Copyright (c) HashiCorp, Inc.
SPDX-License-Identifier: BUSL-1.1
}}
{{#if (or @model.isOIDC @model.isLDAP)}}
<Rose::Dropdown
@text={{t (concat 'states.' @model.state)}}
@icon={{if
@model.isInactive
'flight-icons/svg/x-circle-16'
(if
@model.isPrivate
'flight-icons/svg/lock-16'
'flight-icons/svg/check-circle-16'
)
}}
@dropdownRight={{true}}
as |dropdown|
>
<dropdown.section @title={{t 'actions.change-state'}}>
<Rose::Form as |form|>
<form.radioGroup
@name='theme'
@selectedValue={{@model.state}}
@changed={{fn @changeState @model}}
as |radioGroup|
>
{{#each @model.options.state as |state|}}
<dropdown.item>
<radioGroup.radio
@label={{t (concat 'states.' state)}}
@value={{state}}
/>
</dropdown.item>
{{/each}}
</form.radioGroup>
</Rose::Form>
</dropdown.section>
</Rose::Dropdown>
{{/if}}
<Hds::Dropdown data-test-manage-auth-method as |dd|>
<dd.ToggleButton @text={{t 'actions.manage'}} @color='secondary' />
{{#if @model.isPrimary}}
<dd.Interactive
@text={{t 'resources.auth-method.actions.remove-as-primary'}}
{{on 'click' (fn @removeAsPrimary @model)}}
/>
{{else}}
<dd.Interactive
@text={{t 'resources.auth-method.actions.make-primary'}}
{{on 'click' (fn @makePrimary @model)}}
/>
{{/if}}
{{#if (can 'create model' @model collection='accounts')}}
<dd.Interactive
@text={{t 'resources.account.actions.create'}}
@route='scopes.scope.auth-methods.auth-method.accounts.new'
@model={{@model}}
/>
{{/if}}
{{#if (can 'create model' @model collection='managed-groups')}}
{{#if (or @model.isOIDC @model.isLDAP)}}
<dd.Interactive
@text={{t 'resources.managed-group.actions.create'}}
@route='scopes.scope.auth-methods.auth-method.managed-groups.new'
@model={{@model}}
/>
{{/if}}
{{/if}}
{{#if (can 'delete auth-method' @model)}}
<dd.Separator />
<dd.Interactive
@text={{t 'resources.auth-method.actions.delete'}}
@color='critical'
{{on 'click' (fn @delete @model)}}
/>
{{/if}}
</Hds::Dropdown>