vault/ui/lib/ldap/addon/components/page/configure.hbs
Angel Garbarino a51c5ed362
Clean up button test selectors (#30694)
* clean up selectors file and then update testButton to buttonByAttr

* a lot but not really in the scheme of things

* fix component test failures

* fix acceptance test failures

* fix namespace selector

* clean up remaining tests

* another test

* last test

* small changes, but I have test failures

* a mess in custom messages, really hard to test because of test pollution.

* make data-test-submit vs data-test-save

* change other-methods to sign in with other methods

* clean up of failing test

* buttonByAttr to button

* clean up test pollution on config messages

* sweep of clean ups

* another round of small cleanups

* fix some message things, remaining oidc issue?

* use a runCmd to better delete things

* fix to amend for recent auth test changes

* remove skip
2025-06-10 16:25:34 -04:00

113 lines
3.4 KiB
Handlebars
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{{!
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">Configure LDAP</h1>
</p.levelLeft>
</PageHeader>
<hr class="is-marginless has-background-gray-200" />
<form class="has-top-margin-l" {{on "submit" (perform this.save)}}>
<Hds::Form::RadioCard::Group @name="schema options" as |RadioGroup|>
{{#each this.schemaOptions as |option|}}
<RadioGroup.RadioCard
@checked={{eq option.value @model.schema}}
{{on "change" (fn (mut @model.schema) option.value)}}
data-test-radio-card={{option.title}}
as |Card|
>
<Card.Icon @name={{option.icon}} />
<Card.Label>{{option.title}}</Card.Label>
<Card.Description>{{option.description}}</Card.Description>
</RadioGroup.RadioCard>
{{/each}}
</Hds::Form::RadioCard::Group>
<div class="has-top-margin-xl">
<MessageError @errorMessage={{this.error}} />
<h2 class="title is-4">Schema Options</h2>
<hr class="has-background-gray-200" />
{{#if @model.schema}}
<div class="has-top-margin-l">
<FormFieldGroups @model={{@model}} @groupName="formFieldGroups" @modelValidations={{this.modelValidations}} />
</div>
{{else}}
<EmptyState
class="is-shadowless has-top-margin-l"
@title="Choose an option"
@message="Pick an option above to see available configuration options"
/>
{{/if}}
</div>
<hr class="has-background-gray-200 has-top-margin-l" />
<div class="has-top-margin-l has-bottom-margin-l is-flex">
<Hds::Button
@text="Save"
data-test-config-save
type="submit"
disabled={{or this.save.isRunning (not @model.schema)}}
{{on "click" (perform this.save)}}
/>
<Hds::Button
@text="Back"
@color="secondary"
class="has-left-margin-xs"
data-test-config-cancel
disabled={{or this.save.isRunning this.fetchInferred.isRunning}}
{{on "click" this.cancel}}
/>
{{#if this.invalidFormMessage}}
<AlertInline
@type="danger"
class="has-top-padding-s"
@message={{this.invalidFormMessage}}
data-test-invalid-form-message
/>
{{/if}}
</div>
</form>
{{#if this.showRotatePrompt}}
<Hds::Modal id="ldap-rotate-password-modal" @onClose={{fn (mut this.showRotatePrompt) false}} as |M|>
<M.Header @icon="info">
Rotate your root password?
</M.Header>
<M.Body>
<p>
Its best practice to rotate the administrator (root) password immediately after the initial configuration of the
LDAP engine. The rotation will update the password both in Vault and your directory server. Once rotated,
<span class="has-text-weight-semibold">only Vault knows the new root password.</span>
</p>
<br />
<p>
Would you like to rotate your new credentials? You can also do this later.
</p>
</M.Body>
<M.Footer>
<Hds::ButtonSet>
<Hds::Button
@text="Save and rotate"
{{on "click" (fn (perform this.save) null true)}}
data-test-button="Save and rotate"
/>
<Hds::Button
@text="Save without rotating"
@color="secondary"
{{on "click" (fn (perform this.save) null false)}}
data-test-button="Save without rotating"
/>
</Hds::ButtonSet>
</M.Footer>
</Hds::Modal>
{{/if}}