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

81 lines
2.3 KiB
Handlebars
Raw Normal View History

{{!
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
2021-09-16 14:03:26 -07:00
'flight-icons/svg/x-circle-16'
2021-08-25 10:52:20 -04:00
(if
2021-09-16 14:03:26 -07:00
@model.isPrivate
'flight-icons/svg/lock-16'
'flight-icons/svg/check-circle-16'
2021-08-25 10:52:20 -04:00
)
}}
@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-methods-dropdown as |dd|>
<dd.ToggleButton @text={{t 'actions.manage'}} @color='secondary' />
2022-08-11 15:37:44 -07:00
{{#if @model.isPrimary}}
<dd.Interactive
@text={{t 'resources.auth-method.actions.remove-as-primary'}}
{{on 'click' (fn @removeAsPrimary @model)}}
/>
2022-08-11 15:37:44 -07:00
{{else}}
<dd.Interactive
@text={{t 'resources.auth-method.actions.make-primary'}}
{{on 'click' (fn @makePrimary @model)}}
/>
2021-03-26 12:47:49 -04:00
{{/if}}
2022-01-31 12:02:37 -05:00
{{#if (can 'create model' @model collection='accounts')}}
<dd.Interactive
@text={{t 'resources.account.actions.create'}}
2021-09-03 10:22:54 -07:00
@route='scopes.scope.auth-methods.auth-method.accounts.new'
@model={{@model}}
/>
2021-09-03 10:22:54 -07:00
{{/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}}
/>
2021-11-10 07:32:40 -08:00
{{/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)}}
/>
2021-08-16 13:31:28 -07:00
{{/if}}
</Hds::Dropdown>