{{#child-selector repo=repo dc=dc nspace=nspace type="policy" placeholder="Search for policy" items=items}} {{yield}} {{#block-slot name='label'}} Apply an existing policy {{/block-slot}} {{#block-slot name='create'}} {{#yield-slot name='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 name='header'}}

New Policy

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

{{message}}

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