2020-09-30 11:33:01 +00:00
|
|
|
<div
|
|
|
|
...attributes
|
|
|
|
class="consul-intention-permission-header-form"
|
|
|
|
>
|
2020-10-08 15:02:31 +00:00
|
|
|
<FormGroup
|
|
|
|
@name={{name}}
|
|
|
|
as |group|>
|
2020-09-30 11:33:01 +00:00
|
|
|
|
2020-10-08 15:02:31 +00:00
|
|
|
{{yield (hash
|
|
|
|
submit=(action 'submit' changeset)
|
|
|
|
reset=(action 'reset' changeset)
|
2020-09-30 11:33:01 +00:00
|
|
|
|
2020-10-08 15:02:31 +00:00
|
|
|
isDirty=(and changeset.isValid changeset.isDirty)
|
|
|
|
changeset=changeset
|
|
|
|
)}}
|
2020-09-30 11:33:01 +00:00
|
|
|
|
2020-10-08 15:02:31 +00:00
|
|
|
<fieldset>
|
|
|
|
<div>
|
|
|
|
<group.Element
|
|
|
|
@name="HeaderType"
|
|
|
|
@type="select"
|
|
|
|
as |el|>
|
|
|
|
<el.Label>Header type</el.Label>
|
2020-09-30 11:33:01 +00:00
|
|
|
<PowerSelect
|
|
|
|
@options={{headerTypes}}
|
|
|
|
@selected={{headerType}}
|
|
|
|
@onChange={{action 'change' 'HeaderType' changeset}} as |Type|>
|
|
|
|
{{get headerLabels Type}}
|
|
|
|
</PowerSelect>
|
2020-10-08 15:02:31 +00:00
|
|
|
</group.Element>
|
|
|
|
|
|
|
|
|
|
|
|
<group.Element
|
|
|
|
@name="Name"
|
|
|
|
@error={{changeset-get changeset 'error.Name'}}
|
|
|
|
as |el|>
|
|
|
|
<el.Label>Header name</el.Label>
|
|
|
|
<el.Text
|
|
|
|
@value={{changeset-get changeset 'Name'}}
|
|
|
|
oninput={{action 'change' 'Name' changeset}}
|
|
|
|
/>
|
|
|
|
<State @state={{el.state}} @matches="error">
|
|
|
|
<el.Error>
|
|
|
|
{{changeset-get changeset 'error.Name.validation'}}
|
|
|
|
</el.Error>
|
|
|
|
</State>
|
|
|
|
</group.Element>
|
2020-09-30 11:33:01 +00:00
|
|
|
|
|
|
|
{{#if shouldShowValueField}}
|
2020-10-08 15:02:31 +00:00
|
|
|
<group.Element
|
|
|
|
@name="Value"
|
|
|
|
@error={{changeset-get changeset 'error.Value'}}
|
|
|
|
as |el|>
|
|
|
|
<el.Label>Header {{lowercase (get headerLabels headerType)}}</el.Label>
|
|
|
|
<el.Text
|
|
|
|
@value={{changeset-get changeset 'Value'}}
|
|
|
|
oninput={{action 'change' 'Value' changeset}}
|
|
|
|
/>
|
|
|
|
<State @state={{el.state}} @matches="error">
|
|
|
|
<el.Error>
|
|
|
|
{{changeset-get changeset 'error.Value.validation'}}
|
|
|
|
</el.Error>
|
|
|
|
</State>
|
|
|
|
</group.Element>
|
2020-09-30 11:33:01 +00:00
|
|
|
{{/if}}
|
|
|
|
|
2020-10-08 15:02:31 +00:00
|
|
|
</div>
|
|
|
|
</fieldset>
|
|
|
|
</FormGroup>
|
2020-09-30 11:33:01 +00:00
|
|
|
</div>
|