Files
threshold-ui/ui/admin/app/components/auth-methods/auth-method/actions/index.hbs
T

79 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 {{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>