vault/ui/app/templates/components/oidc/assignment-form.hbs
claire bontempo 56a10bb10f
UI: Implement new policy SS + modal designs (#17749)
* refactor ss+modal to accept multiple models

* create policy form

* cleanup and fix test

* add tabs to policy modal form

* add search select with modal to entity form

* update group form;

* allow modal to fit-content

* add changelog

* add check for policy create ability

* add id so tests pass

* filter out root option

* fix test

* add cleanup method

* add ACL policy link

* cleanup from comments

* refactor sending action to parent

* refactor, data down actions up!

* cleanup comments

* form field refactor

* add ternary to options

* update tests

* Remodel component structure for clearer logic

Includes fixing the wizard

* address comments

* cleanup args

* refactor inline oidc assignment form

* add line break

* cleanup comments

* fix tests

* add policy template to ss+modal test

* cleanup =true from test

* final cleanup!!!!!!

* actual final cleanup

* fix typo, please be done

Co-authored-by: Chelsea Shaw <82459713+hashishaw@users.noreply.github.com>
2022-11-18 17:29:04 -08:00

64 lines
2.0 KiB
Handlebars

<form {{on "submit" (perform this.save)}}>
<div class="box is-sideless is-fullwidth is-marginless">
<MessageError @errorMessage={{this.errorBanner}} class="has-top-margin-s" />
<FormFieldLabel for="name" @label="Name" />
<input
autocomplete="off"
spellcheck="false"
value={{@model.name}}
disabled={{not @model.isNew}}
class="input field {{if this.modelValidations.name.errors 'has-error-border'}}"
{{on "input" this.handleOperation}}
data-test-input="name"
/>
{{#if this.modelValidations.name.errors}}
<AlertInline @type="danger" @message={{join ", " this.modelValidations.name.errors}} />
{{/if}}
<SearchSelect
@id="entities"
@label="Entities"
@placeholder="Search"
@models={{array "identity/entity"}}
@inputValue={{@model.entityIds}}
@shouldRenderName={{true}}
@onChange={{this.onEntitiesSelect}}
@disallowNewItems={{true}}
@fallbackComponent="string-list"
data-test-search-select="entities"
/>
<SearchSelect
@id="groups"
@label="Groups"
@placeholder="Search"
@models={{array "identity/group"}}
@inputValue={{@model.groupIds}}
@shouldRenderName={{true}}
@onChange={{this.onGroupsSelect}}
@disallowNewItems={{true}}
@fallbackComponent="string-list"
data-test-search-select="groups"
/>
</div>
<div class="has-top-padding-s">
<button
type="submit"
class="button is-primary {{if this.save.isRunning 'is-loading'}}"
disabled={{this.save.isRunning}}
data-test-oidc-assignment-save
>
{{if @model.isNew "Create" "Update"}}
</button>
<button
type="button"
class="button has-left-margin-s"
disabled={{this.save.isRunning}}
{{on "click" this.cancel}}
data-test-oidc-assignment-cancel
>
Cancel
</button>
{{#if this.modelValidations.targets.errors}}
<AlertInline @type="danger" @message={{join ", " this.modelValidations.targets.errors}} @paddingTop={{true}} />
{{/if}}
</div>
</form>