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

94 lines
2.4 KiB
Handlebars
Raw Normal View History

{{!
Copyright (c) HashiCorp, Inc.
SPDX-License-Identifier: MPL-2.0
}}
{{#if @model.isOIDC}}
<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={{route-action 'changeState'}}
as |radioGroup|
>
2022-01-14 16:56:59 -05:00
{{#each @model.options.oidc.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}}
<Rose::Dropdown
2022-09-07 16:21:27 -04:00
@text={{t 'actions.manage'}}
@dropdownRight={{true}}
as |dropdown|
>
2022-08-11 15:37:44 -07:00
{{#if @model.isPrimary}}
<dropdown.button
@disabled={{@model.canSave}}
{{on 'click' (route-action 'removeAsPrimary' @model)}}
>
{{t 'resources.auth-method.actions.remove-as-primary'}}
</dropdown.button>
{{else}}
<dropdown.button
@disabled={{@model.canSave}}
{{on 'click' (route-action 'makePrimary' @model)}}
>
{{t 'resources.auth-method.actions.make-primary'}}
</dropdown.button>
2021-03-26 12:47:49 -04:00
{{/if}}
2022-01-31 12:02:37 -05:00
{{#if (can 'create model' @model collection='accounts')}}
2021-09-03 10:22:54 -07:00
<dropdown.link
@route='scopes.scope.auth-methods.auth-method.accounts.new'
@model={{@model}}
>
{{t 'resources.account.actions.create'}}
</dropdown.link>
{{/if}}
{{#if (can 'create model' @model collection='managed-groups')}}
{{#if @model.isOIDC}}
<dropdown.link
@route='scopes.scope.auth-methods.auth-method.managed-groups.new'
@model={{@model}}
>
{{t 'resources.managed-group.actions.create'}}
</dropdown.link>
2021-11-10 07:32:40 -08:00
{{/if}}
{{/if}}
{{#if (can 'delete auth-method' @model)}}
2021-08-16 13:31:28 -07:00
<dropdown.separator />
<dropdown.button
@style='danger'
@disabled={{@model.canSave}}
{{on 'click' (route-action 'delete' @model)}}
>
{{t 'resources.auth-method.actions.delete'}}
</dropdown.button>
{{/if}}
2022-10-06 11:41:12 -04:00
</Rose::Dropdown>