open-vault/ui/app/templates/components/form-field-groups-loop.hbs
Angel Garbarino 3e9bb12dc2
replace last two partials (#11765)
* replace last two partials

* cleanup

* modify test to cover new component

* only on ca role run new function

* help with inconsistent failure on enterprise test

* small changes to help with flaky test locally

* add js docs
2021-06-07 12:11:46 -06:00

28 lines
887 B
Handlebars

{{#each @model.fieldGroups as |fieldGroup|}}
{{#each-in fieldGroup as |group fields|}}
{{#if (eq group "default")}}
{{#each fields as |attr|}}
{{#unless (and (not-eq @mode "create") (eq attr.name "name"))}}
{{form-field data-test-field attr=attr model=@model}}
{{/unless}}
{{/each}}
{{else}}
<ToggleButton
@class="is-block"
@toggleAttr={{concat "show" (camelize group)}}
@toggleTarget={{this}}
@openLabel={{concat "Hide " group}}
@closedLabel={{group}}
@data-test-toggle-group={{group}}
/>
{{#if (get this (concat "show" (camelize group)))}}
<div class="box is-marginless">
{{#each fields as |attr|}}
{{form-field data-test-field attr=attr model=@model}}
{{/each}}
</div>
{{/if}}
{{/if}}
{{/each-in}}
{{/each}}