John Cowen 8986b6ad7b ui: Move to new ember nested file structure for components (#7403)
* ui: Move components to the new nested structure

* Move data-test attribute to the correct HTML element

We don't currently rely on this, but was incorrectly placed on the input
rather than the label tag

* Fix up left over curly bracket components that were causing issues

For some reason the combination of:

1. Old style curly bracket components
2. data-test-* attributes
3. Moving to the new component file structure

Meant that our data-test-* selectors where no longer being rendered.
Whilst this had no effect on the app, it meant our tests suite could no
longer select DOM elements in order to assert various things.

Moving the old style curly bracket components to the new style XML/Angle
bracket format fixes the issue

* Update ui-v2/app/templates/dc/nodes/-services.hbs

Co-Authored-By: Greg Hoin <1416421+gregone@users.noreply.github.com>

* Update ui-v2/app/templates/dc/nodes/-services.hbs

Co-Authored-By: Greg Hoin <1416421+gregone@users.noreply.github.com>

Co-authored-by: Greg Hoin <1416421+gregone@users.noreply.github.com>
2020-05-12 17:14:15 +00:00

53 lines
2.4 KiB
Handlebars

<form>
<PolicyForm @form={{form}} @item={{item}}>
{{!don't show template selection here, i.e. Service Identity}}
<BlockSlot @name="template" />
</PolicyForm>
{{#if (not create) }}
<TokenList @caption="Applied to the following tokens:" @items={{items}} />
{{/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) }}
<ConfirmationDialog @message="Are you sure you want to delete this Policy?">
<BlockSlot @name="action" as |confirm|>
<button type="button" data-test-delete class="type-delete" {{action confirm 'delete' item}}>Delete</button>
</BlockSlot>
<BlockSlot @name="dialog" as |execute cancel message|>
{{#if (gt items.length 0)}}
<ModalDialog
data-test-delete-modal
@onclose={{action cancel}}
>
<BlockSlot @name="header">
<h2>Policy in Use</h2>
</BlockSlot>
<BlockSlot @name="body">
<p>
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>:
</p>
<TokenList @items={{items}} @target="_blank" />
<p>
This action cannot be undone. {{message}}
</p>
</BlockSlot>
<BlockSlot @name="actions" as |close|>
<button type="button" class="type-delete" {{action execute}}>Yes, Delete</button>
<button type="button" class="type-cancel" {{action close}}>Cancel</button>
</BlockSlot>
</ModalDialog>
{{else}}
<DeleteConfirmation @message={{message}} @execute={{execute}} @cancel={{cancel}} />
{{/if}}
</BlockSlot>
</ConfirmationDialog>
{{/if}}
</div>
</form>