2018-10-19 15:17:02 +00:00
|
|
|
<form>
|
|
|
|
{{#if (not (token/is-legacy item))}}
|
|
|
|
{{partial 'dc/acls/tokens/fieldsets'}}
|
|
|
|
{{else}}
|
|
|
|
{{partial 'dc/acls/tokens/fieldsets-legacy'}}
|
|
|
|
{{/if}}
|
|
|
|
{{!TODO: Make this into a slotted component}}
|
|
|
|
<div>
|
|
|
|
{{#if create }}
|
|
|
|
{{! new tokens can be saved without you filling anything in, old tokens remain using isPristine }}
|
|
|
|
<button type="submit" {{ action "create" item}} disabled={{if (or (and (token/is-legacy item) item.isPristine) item.isInvalid) '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>
|
2019-01-23 13:51:36 +00:00
|
|
|
{{# if (and (not create) (not (token/is-anonymous item)) (not-eq item.AccessorID token.AccessorID) ) }}
|
2018-10-19 15:17:02 +00:00
|
|
|
{{#confirmation-dialog message='Are you sure you want to delete this Token?'}}
|
2020-01-15 09:15:54 +00:00
|
|
|
{{#block-slot 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>
|
|
|
|
{{/block-slot}}
|
2020-01-15 09:15:54 +00:00
|
|
|
{{#block-slot name='dialog' as |execute cancel message|}}
|
2018-10-19 15:17:02 +00:00
|
|
|
{{delete-confirmation message=message execute=execute cancel=cancel}}
|
|
|
|
{{/block-slot}}
|
|
|
|
{{/confirmation-dialog}}
|
|
|
|
{{/if}}
|
|
|
|
</div>
|
|
|
|
</form>
|