2023-03-01 09:39:41 -06:00
|
|
|
{{!
|
|
|
|
|
Copyright (c) HashiCorp, Inc.
|
2024-05-31 11:29:24 -07:00
|
|
|
SPDX-License-Identifier: BUSL-1.1
|
2023-03-01 09:39:41 -06:00
|
|
|
}}
|
|
|
|
|
|
2023-07-27 14:25:40 -07:00
|
|
|
{{#if (or @model.isOIDC @model.isLDAP)}}
|
2024-11-19 13:03:29 -08:00
|
|
|
<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>
|
|
|
|
|
|
2021-06-01 22:29:19 -04:00
|
|
|
{{/if}}
|
|
|
|
|
|
2024-10-25 15:58:09 -05:00
|
|
|
<Hds::Dropdown data-test-manage-auth-method as |dd|>
|
2024-08-26 15:30:57 -04:00
|
|
|
<dd.ToggleButton @text={{t 'actions.manage'}} @color='secondary' />
|
2022-08-11 15:37:44 -07:00
|
|
|
{{#if @model.isPrimary}}
|
2024-11-19 11:32:06 -08:00
|
|
|
<dd.Interactive {{on 'click' (fn @removeAsPrimary @model)}}>
|
|
|
|
|
{{t 'resources.auth-method.actions.remove-as-primary'}}
|
|
|
|
|
</dd.Interactive>
|
2022-08-11 15:37:44 -07:00
|
|
|
{{else}}
|
2024-11-19 11:32:06 -08:00
|
|
|
<dd.Interactive {{on 'click' (fn @makePrimary @model)}}>
|
|
|
|
|
{{t 'resources.auth-method.actions.make-primary'}}
|
|
|
|
|
</dd.Interactive>
|
2021-03-26 12:47:49 -04:00
|
|
|
{{/if}}
|
2022-01-31 12:02:37 -05:00
|
|
|
{{#if (can 'create model' @model collection='accounts')}}
|
2024-08-26 15:30:57 -04:00
|
|
|
<dd.Interactive
|
2021-09-03 10:22:54 -07:00
|
|
|
@route='scopes.scope.auth-methods.auth-method.accounts.new'
|
|
|
|
|
@model={{@model}}
|
2024-11-19 11:32:06 -08:00
|
|
|
>
|
|
|
|
|
{{t 'resources.account.actions.create'}}
|
|
|
|
|
</dd.Interactive>
|
2021-09-03 10:22:54 -07:00
|
|
|
{{/if}}
|
2022-08-12 09:27:02 -07:00
|
|
|
{{#if (can 'create model' @model collection='managed-groups')}}
|
2023-07-28 13:52:04 -07:00
|
|
|
{{#if (or @model.isOIDC @model.isLDAP)}}
|
2024-08-26 15:30:57 -04:00
|
|
|
<dd.Interactive
|
2022-08-12 09:27:02 -07:00
|
|
|
@route='scopes.scope.auth-methods.auth-method.managed-groups.new'
|
|
|
|
|
@model={{@model}}
|
2024-11-19 11:32:06 -08:00
|
|
|
>
|
|
|
|
|
{{t 'resources.managed-group.actions.create'}}
|
|
|
|
|
</dd.Interactive>
|
2021-11-10 07:32:40 -08:00
|
|
|
{{/if}}
|
|
|
|
|
{{/if}}
|
|
|
|
|
|
2023-05-22 15:46:13 -07:00
|
|
|
{{#if (can 'delete auth-method' @model)}}
|
2024-08-26 15:30:57 -04:00
|
|
|
<dd.Separator />
|
2024-11-19 11:32:06 -08:00
|
|
|
<dd.Interactive @color='critical' {{on 'click' (fn @delete @model)}}>
|
|
|
|
|
{{t 'resources.auth-method.actions.delete'}}
|
|
|
|
|
</dd.Interactive>
|
2021-08-16 13:31:28 -07:00
|
|
|
{{/if}}
|
2024-08-26 15:30:57 -04:00
|
|
|
</Hds::Dropdown>
|