vault/ui/app/components/database-role-setting-form.hbs
Vault Automation a5b65edbcc
VAULT-41682 - Updates header to add title tag and centre align with icon (#12166) (#12174)
* VAULT-41682 - update header to add title tag and centre align with icon

* Fixed linting error

Co-authored-by: mohit-hashicorp <mohit.ojha@hashicorp.com>
2026-02-05 21:03:10 +05:30

66 lines
No EOL
2.9 KiB
Handlebars

{{!
Copyright IBM Corp. 2016, 2025
SPDX-License-Identifier: BUSL-1.1
}}
<div class="box is-sideless is-fullwidth is-marginless" data-test-role-settings-section>
<h3 class="title is-5">Role settings</h3>
{{#if this.settingFields}}
<div class="form-section">
{{#each this.settingFields as |attr|}}
{{#if (and (eq @mode "edit") (includes attr.name (array "skip_import_rotation" "username")))}}
{{#if (eq attr.name "skip_import_rotation")}}
<ReadonlyFormField @attr={{attr}} @value={{not (get @model attr.name)}} />
{{else}}
<ReadonlyFormField @attr={{attr}} @value={{get @model attr.name}} />
{{/if}}
{{else if (and (eq @mode "edit") (eq attr.name "password"))}}
<EnableInput
data-test-enable-field={{attr.name}}
class="field"
@attr={{attr}}
{{! password field is disabled on edit once password has been rotated }}
@disabled={{(not (eq (get @model "last_vault_rotation") undefined))}}
>
<FormField @attr={{attr}} @model={{@model}} />
</EnableInput>
{{else}}
<FormField data-test-field={{true}} @attr={{attr}} @model={{@model}} @modelValidations={{@modelValidations}} />
{{#if (and (eq attr.name "skip_import_rotation") this.isOverridden)}}
<Hds::Alert @type="inline" @color="warning" class="has-top-margin-negative-s" as |A|>
<A.Title>Warning</A.Title>
<A.Description>This will override the connection default for this role.</A.Description>
</Hds::Alert>
{{/if}}
{{/if}}
{{/each}}
</div>
{{else}}
<Hds::ApplicationState @align="center" class="top-padding-32 bottom-padding-32" as |A|>
<A.Header data-test-empty-state-title @title="No role type selected" @titleTag="h2" />
<A.Body data-test-empty-state-message @text="Select a type of role to be able to configure it" />
</Hds::ApplicationState>
{{/if}}
</div>
{{! template-lint-configure simple-unless "warn" }}
{{#unless (and @roleType (not this.statementFields))}}
<div class="box is-sideless is-fullwidth is-marginless" data-test-statements-section>
<h3 class="title is-5">Statements</h3>
{{#if this.statementFields}}
<div class="form-section">
{{#each this.statementFields as |attr|}}
<FormField data-test-field={{true}} @attr={{attr}} @model={{@model}} />
{{/each}}
</div>
{{else}}
<Hds::ApplicationState @align="center" class="top-padding-32 bottom-padding-32" as |A|>
<A.Header data-test-empty-state-title @title="No role type selected" @titleTag="h2" />
<A.Body
data-test-empty-state-message
@text="Select a type of role to be able to add statements for creation, revocation, and/or rotation."
/>
</Hds::ApplicationState>
{{/if}}
</div>
{{/unless}}