2019-05-01 18:09:29 +00:00
|
|
|
{{#modal-dialog data-test-role-form onclose=(action (mut state) 'role') name="new-role-toggle"}}
|
2020-01-15 09:15:54 +00:00
|
|
|
{{#block-slot name='header'}}
|
2019-05-01 18:09:29 +00:00
|
|
|
{{#if (eq state 'role')}}
|
|
|
|
<h2>New Role</h2>
|
|
|
|
{{else}}
|
|
|
|
<h2>New Policy</h2>
|
|
|
|
{{/if}}
|
|
|
|
{{/block-slot}}
|
2020-01-15 09:15:54 +00:00
|
|
|
{{#block-slot name='body'}}
|
2019-05-01 18:09:29 +00:00
|
|
|
|
2019-05-08 09:01:26 +00:00
|
|
|
<input id="{{name}}_state_role" type="radio" name="{{name}}[state]" value="role" checked={{if (eq state 'role') 'checked'}} onchange={{action 'change'}} />
|
2019-05-01 18:09:29 +00:00
|
|
|
{{#role-form form=form dc=dc}}
|
2020-01-15 09:15:54 +00:00
|
|
|
{{#block-slot name='policy'}}
|
2019-05-01 18:09:29 +00:00
|
|
|
|
|
|
|
{{#policy-selector source=source dc=dc items=item.Policies}}
|
2020-01-15 09:15:54 +00:00
|
|
|
{{#block-slot name='trigger'}}
|
2019-05-01 18:09:29 +00:00
|
|
|
<label for="{{name}}_state_policy" data-test-create-policy class="type-dialog">
|
|
|
|
<span>Create new policy</span>
|
|
|
|
</label>
|
|
|
|
{{/block-slot}}
|
|
|
|
{{/policy-selector}}
|
|
|
|
|
|
|
|
{{/block-slot}}
|
|
|
|
{{/role-form}}
|
|
|
|
|
2019-05-08 09:01:26 +00:00
|
|
|
<input id="{{name}}_state_policy" type="radio" name="{{name}}[state]" value="policy" checked={{if (eq state 'policy') 'checked'}} onchange={{action 'change'}} />
|
2019-05-01 18:09:29 +00:00
|
|
|
{{policy-form data-test-policy-form name="role[policy]" form=policyForm dc=dc}}
|
|
|
|
|
|
|
|
{{/block-slot}}
|
2020-01-15 09:15:54 +00:00
|
|
|
{{#block-slot name='actions' as |close|}}
|
2019-05-01 18:09:29 +00:00
|
|
|
|
|
|
|
{{#if (eq state 'role')}}
|
|
|
|
<button type="submit" {{action 'save' item items (queue (action close) (action 'reset'))}} disabled={{if (or item.isSaving item.isPristine item.isInvalid) 'disabled'}}>
|
|
|
|
{{#if item.isSaving }}
|
|
|
|
<div class="progress indeterminate"></div>
|
|
|
|
{{/if}}
|
|
|
|
<span>Create and apply</span>
|
|
|
|
</button>
|
|
|
|
<button type="reset" disabled={{if item.isSaving 'disabled'}} {{action (queue (action close) (action 'reset'))}}>Cancel</button>
|
|
|
|
{{else}}
|
|
|
|
<button type="submit" {{action 'dispatch' 'save' (array policy item.Policies (action (mut state) 'role'))}} disabled={{if (or policy.isSaving policy.isPristine policy.isInvalid) 'disabled'}}>
|
|
|
|
{{#if policy.isSaving }}
|
|
|
|
<div class="progress indeterminate"></div>
|
|
|
|
{{/if}}
|
|
|
|
<span>Create and apply</span>
|
|
|
|
</button>
|
|
|
|
<button type="reset" disabled={{if policy.isSaving 'disabled'}} {{action (mut state) 'role'}}>Cancel</button>
|
|
|
|
{{/if}}
|
|
|
|
|
|
|
|
{{/block-slot}}
|
|
|
|
{{/modal-dialog}}
|
|
|
|
|
2019-12-17 18:47:37 +00:00
|
|
|
{{#child-selector repo=repo dc=dc nspace=nspace type="role" placeholder="Search for role" items=items}}
|
2020-01-15 09:15:54 +00:00
|
|
|
{{#block-slot name='label'}}
|
2019-05-01 18:09:29 +00:00
|
|
|
Apply an existing role
|
|
|
|
{{/block-slot}}
|
2020-01-15 09:15:54 +00:00
|
|
|
{{#block-slot name='create'}}
|
2019-05-01 18:09:29 +00:00
|
|
|
<label class="type-dialog" for="new-role-toggle">
|
|
|
|
<span>Create new role</span>
|
|
|
|
</label>
|
|
|
|
|
|
|
|
{{/block-slot}}
|
2020-01-15 09:15:54 +00:00
|
|
|
{{#block-slot name='option' as |option|}}
|
2019-05-01 18:09:29 +00:00
|
|
|
{{option.Name}}
|
|
|
|
{{/block-slot}}
|
2020-01-15 09:15:54 +00:00
|
|
|
{{#block-slot name='set'}}
|
2019-05-01 18:09:29 +00:00
|
|
|
{{#tabular-collection
|
|
|
|
data-test-roles
|
|
|
|
rows=5
|
|
|
|
items=(sort-by 'CreateTime:desc' 'Name:asc' items) as |item index|
|
|
|
|
}}
|
2020-01-15 09:15:54 +00:00
|
|
|
{{#block-slot name='header'}}
|
2019-05-01 18:09:29 +00:00
|
|
|
<th>Name</th>
|
|
|
|
<th>Description</th>
|
|
|
|
{{/block-slot}}
|
2020-01-15 09:15:54 +00:00
|
|
|
{{#block-slot name='row'}}
|
2019-05-01 18:09:29 +00:00
|
|
|
<td>
|
|
|
|
<a href={{href-to 'dc.acls.roles.edit' item.ID}}>{{item.Name}}</a>
|
|
|
|
</td>
|
|
|
|
<td>
|
|
|
|
{{item.Description}}
|
|
|
|
</td>
|
|
|
|
{{/block-slot}}
|
2020-01-15 09:15:54 +00:00
|
|
|
{{#block-slot name='actions' as |index change checked|}}
|
2020-01-22 12:08:29 +00:00
|
|
|
{{#popover-menu expanded=(if (eq checked index) true false) onchange=(action change index) keyboardAccess=false}}
|
|
|
|
{{#block-slot name='trigger'}}
|
|
|
|
More
|
|
|
|
{{/block-slot}}
|
|
|
|
{{#block-slot name='menu' as |confirm send keypressClick|}}
|
|
|
|
<li role="none">
|
|
|
|
<a role="menuitem" tabindex="-1" href={{href-to 'dc.acls.roles.edit' item.ID}}>Edit</a>
|
|
|
|
</li>
|
|
|
|
<li role="none" class="dangerous">
|
|
|
|
<label for={{confirm}} role="menuitem" tabindex="-1" onkeypress={{keypressClick}} data-test-delete>Remove</label>
|
|
|
|
<div role="menu">
|
|
|
|
<div class="confirmation-alert warning">
|
|
|
|
<div>
|
|
|
|
<header>
|
|
|
|
Confirm Remove
|
|
|
|
</header>
|
|
|
|
<p>
|
|
|
|
Are you sure you want to remove this role?
|
|
|
|
</p>
|
|
|
|
</div>
|
|
|
|
<ul>
|
|
|
|
<li class="dangerous">
|
|
|
|
<button tabindex="-1" type="button" class="type-delete" onclick={{action send 'remove' item items}}>Remove</button>
|
2019-05-01 18:09:29 +00:00
|
|
|
</li>
|
|
|
|
<li>
|
2020-01-22 12:08:29 +00:00
|
|
|
<label for={{confirm}}>Cancel</label>
|
2019-05-01 18:09:29 +00:00
|
|
|
</li>
|
2020-01-22 12:08:29 +00:00
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</li>
|
2019-05-01 18:09:29 +00:00
|
|
|
{{/block-slot}}
|
2020-01-22 12:08:29 +00:00
|
|
|
{{/popover-menu}}
|
2019-05-01 18:09:29 +00:00
|
|
|
{{/block-slot}}
|
|
|
|
{{/tabular-collection}}
|
|
|
|
{{/block-slot}}
|
|
|
|
{{/child-selector}}
|