claire bontempo 4ac07e1d97
UI: HDS adoption replace <ConfirmAction> component (#21520)
* replace confirm-action dropdown with button+modal

* add modal frame to sidebar

* fix weird paragraph indent

* pass button text as arg

* add warning color to rotate modals

* update seal action and config ssh

* cleanup confirm action

* edit form

* add dropdown arg

* put back seal text

* put back confirm button text

* fix toolbar stylinggp

* popup member group

* move up title

* finish popup- components

* keymgmt

* fix modal button logic

* remaining app template components

* add period for angel

* vault cluster items

* add button text assertion

* remaining instances

* remove arg for passing confirm text

* contextual confirm action components

* delete old components

* update docs

* ammend dropdown loading states, add getter for confirm button color

* address feedback

* remove @disabled arg and add @disabledMessage

* add changelog;

* mfa tests

* update test selectors

* lol cleanup selectors

* start confirm action tests WIP

* move dropdown class directly to component

* add default color of isInDropdown

* final cleanup

* add tests

* remove @buttonColor as arg for dropdown

* update confirm action tests

* updae modals with disabled message

* refactor provider edit test
2023-11-17 23:44:21 +00:00

73 lines
1.9 KiB
Handlebars

{{!
Copyright (c) HashiCorp, Inc.
SPDX-License-Identifier: BUSL-1.1
~}}
<PageHeader as |p|>
<p.top>
<Page::Breadcrumbs @breadcrumbs={{@breadcrumbs}} />
</p.top>
<p.levelLeft>
<h1 class="title is-3" data-test-header-title>
{{@model.name}}
</h1>
</p.levelLeft>
</PageHeader>
<Toolbar>
<ToolbarActions>
{{#if @model.canDelete}}
<ConfirmAction
@buttonText="Delete role"
class="toolbar-button"
@buttonColor="secondary"
@onConfirmAction={{this.delete}}
data-test-delete
/>
<div class="toolbar-separator"></div>
{{/if}}
{{#if @model.canGenerateCreds}}
<ToolbarLink @route="roles.role.credentials" data-test-generate-credentials>
Generate credentials
</ToolbarLink>
{{/if}}
{{#if @model.canEdit}}
<ToolbarLink @route="roles.role.edit" data-test-edit>
Edit role
</ToolbarLink>
{{/if}}
</ToolbarActions>
</Toolbar>
{{#each @model.filteredFormFields as |field|}}
{{#let (get @model field.name) as |value|}}
<InfoTableRow
data-test-filtered-field
@label={{field.options.label}}
@value={{if (eq field.options.editType "ttl") (format-duration value) value}}
/>
{{/let}}
{{/each}}
{{#if @model.generatedRoleRules}}
<div class="has-top-margin-xl" data-test-generated-role-rules>
<h2 class="title is-4">Generated role rules</h2>
<JsonEditor
@title="Role rules"
@value={{@model.generatedRoleRules}}
@mode="ruby"
@readOnly={{true}}
@showToolbar={{true}}
@theme="hashi auto-height"
/>
</div>
{{/if}}
{{#each this.extraFields as |field|}}
<div class="has-top-margin-xl" data-test-extra-fields={{field.label}}>
<h2 class="title is-4 is-marginless">{{field.label}}</h2>
{{#each-in (get @model field.key) as |key value|}}
<InfoTableRow @label={{key}} @value={{value}} />
{{/each-in}}
</div>
{{/each}}