2018-10-19 15:17:02 +00:00
|
|
|
<form>
|
2020-06-23 16:58:43 +00:00
|
|
|
<PolicyForm @form={{form}} @nspace={{nspace}} @item={{item}}>
|
2019-05-01 18:09:29 +00:00
|
|
|
{{!don't show template selection here, i.e. Service Identity}}
|
2020-02-19 19:26:38 +00:00
|
|
|
<BlockSlot @name="template" />
|
|
|
|
</PolicyForm>
|
2018-10-19 15:17:02 +00:00
|
|
|
{{#if (not create) }}
|
2020-02-19 19:26:38 +00:00
|
|
|
<TokenList @caption="Applied to the following tokens:" @items={{items}} />
|
2018-10-19 15:17:02 +00:00
|
|
|
{{/if}}
|
|
|
|
<div>
|
|
|
|
{{#if create }}
|
|
|
|
{{! we only need to check for an empty name here as ember munges autofocus, once we have autofocus back revisit this}}
|
|
|
|
<button type="submit" {{ action "create" item}} disabled={{if (or item.isPristine item.isInvalid (eq item.Name '')) 'disabled'}}>Save</button>
|
|
|
|
{{ else }}
|
|
|
|
<button type="submit" {{ action "update" item}} disabled={{if item.isInvalid 'disabled'}}>Save</button>
|
|
|
|
{{/if}}
|
|
|
|
<button type="reset" {{ action "cancel" item}}>Cancel</button>
|
|
|
|
{{# if (not create) }}
|
2020-02-19 19:26:38 +00:00
|
|
|
<ConfirmationDialog @message="Are you sure you want to delete this Policy?">
|
|
|
|
<BlockSlot @name="action" as |confirm|>
|
2018-10-19 15:17:02 +00:00
|
|
|
<button type="button" data-test-delete class="type-delete" {{action confirm 'delete' item}}>Delete</button>
|
2020-02-19 19:26:38 +00:00
|
|
|
</BlockSlot>
|
|
|
|
<BlockSlot @name="dialog" as |execute cancel message|>
|
2018-10-19 15:17:02 +00:00
|
|
|
{{#if (gt items.length 0)}}
|
2020-03-06 14:10:34 +00:00
|
|
|
<ModalDialog
|
|
|
|
data-test-delete-modal
|
|
|
|
@onclose={{action cancel}}
|
|
|
|
>
|
2020-02-19 19:26:38 +00:00
|
|
|
<BlockSlot @name="header">
|
2018-10-19 15:17:02 +00:00
|
|
|
<h2>Policy in Use</h2>
|
2020-02-19 19:26:38 +00:00
|
|
|
</BlockSlot>
|
|
|
|
<BlockSlot @name="body">
|
2018-10-19 15:17:02 +00:00
|
|
|
<p>
|
2019-05-01 18:09:29 +00:00
|
|
|
This Policy is currently in use. If you choose to delete this Policy, it will be removed from the following <strong>{{items.length}} Tokens</strong>:
|
2018-10-19 15:17:02 +00:00
|
|
|
</p>
|
2020-02-19 19:26:38 +00:00
|
|
|
<TokenList @items={{items}} @target="_blank" />
|
2018-10-19 15:17:02 +00:00
|
|
|
<p>
|
|
|
|
This action cannot be undone. {{message}}
|
|
|
|
</p>
|
2020-02-19 19:26:38 +00:00
|
|
|
</BlockSlot>
|
|
|
|
<BlockSlot @name="actions" as |close|>
|
2018-10-19 15:17:02 +00:00
|
|
|
<button type="button" class="type-delete" {{action execute}}>Yes, Delete</button>
|
|
|
|
<button type="button" class="type-cancel" {{action close}}>Cancel</button>
|
2020-02-19 19:26:38 +00:00
|
|
|
</BlockSlot>
|
2020-03-06 14:10:34 +00:00
|
|
|
</ModalDialog>
|
2018-10-19 15:17:02 +00:00
|
|
|
{{else}}
|
2020-02-19 19:26:38 +00:00
|
|
|
<DeleteConfirmation @message={{message}} @execute={{execute}} @cancel={{cancel}} />
|
2018-10-19 15:17:02 +00:00
|
|
|
{{/if}}
|
2020-02-19 19:26:38 +00:00
|
|
|
</BlockSlot>
|
|
|
|
</ConfirmationDialog>
|
2018-10-19 15:17:02 +00:00
|
|
|
{{/if}}
|
|
|
|
</div>
|
|
|
|
</form>
|