{{#child-selector repo=repo dc=dc nspace=nspace type="policy" placeholder="Search for policy" items=items}} {{yield}} {{#block-slot 'label'}} Apply an existing policy {{/block-slot}} {{#block-slot 'create'}} {{#yield-slot 'trigger'}} {{yield}} {{else}} {{!TODO: potentially call trigger something else}} {{!the modal has to go here so that if you provide a slot to trigger it doesn't get rendered}} {{#modal-dialog data-test-policy-form onopen=(action 'open') name="new-policy-toggle"}} {{#block-slot 'header'}}

New Policy

{{/block-slot}} {{#block-slot 'body'}} {{policy-form form=form dc=dc}} {{/block-slot}} {{#block-slot 'actions' as |close|}} {{/block-slot}} {{/modal-dialog}} {{/yield-slot}} {{/block-slot}} {{#block-slot 'option' as |option|}} {{option.Name}} {{/block-slot}} {{#block-slot 'set'}} {{#tabular-details data-test-policies onchange=(action 'loadItem') items=(sort-by 'CreateTime:desc' 'Name:asc' items) as |item index| }} {{#block-slot 'header'}} Name Datacenters {{/block-slot}} {{#block-slot 'row'}} {{#if item.ID }} {{item.Name}} {{else}} {{item.Name}} {{/if}} {{if (not item.isSaving) (join ', ' (policy/datacenters item)) 'Saving...'}} {{/block-slot}} {{#block-slot 'details'}}
{{#confirmation-dialog message='Are you sure you want to remove this policy from this token?'}} {{#block-slot 'action' as |confirm|}} {{/block-slot}} {{#block-slot 'dialog' as |execute cancel message|}}

{{message}}

{{/block-slot}} {{/confirmation-dialog}}
{{/block-slot}} {{/tabular-details}} {{/block-slot}} {{/child-selector}}