open-consul/ui/packages/consul-ui/app/components/role-form/index.hbs
John Cowen 489b60105f
ui: Move control of login modal to use JS rather than HTML (label/id) (#9883)
* Add before and after skip links portals

* Move EmptyState and ErrorState to use a @login action/function

* Move page title setting to the Route component

* Add Routes and Outlets everywhere, and use those to access login modal

* Add some aria-labels to the modals

* Docs

* Remove the label/input now we no longer need it, fixup pageobject

* Add basic modal docs

* Switch out old toggle names for ids

* Wrap nspace Route template in a Route component

* type > class
2021-04-06 13:40:40 +01:00

37 lines
1.2 KiB
Handlebars

{{yield}}
<fieldset
class="role-form"
disabled={{if (not (can "write role" item=item)) "disabled"}}
data-test-role-form
...attributes
>
<label class="type-text{{if item.error.Name ' has-error'}}">
<span>Name</span>
<input type="text" value={{item.Name}} name="role[Name]" autofocus="autofocus" oninput={{action 'change'}} />
<em>
Maximum 256 characters. May only include letters (uppercase and/or lowercase) and/or numbers. Must be unique.
</em>
{{#if item.error.Name}}
<strong>{{item.error.Name.validation}}</strong>
{{/if}}
</label>
<label class="type-text">
<span>Description (Optional)</span>
<textarea name="role[Description]" value={{item.Description}} oninput={{action 'change'}}></textarea>
</label>
</fieldset>
{{!TODO: temporary policies id, look at the inception token modals and get rid of id="policies" and use something else}}
<fieldset id="policies" class="policies">
<h2>Policies</h2>
{{#yield-slot name='policy' params=(block-params item)}}
{{yield}}
{{else}}
<PolicySelector
@disabled={{not (can "write role" item=item)}}
@dc={{dc}}
@nspace={{nspace}}
@items={{item.Policies}}
/>
{{/yield-slot}}
</fieldset>