open-nomad/ui/app/templates/components/two-step-button.hbs
Buck Doyle 244157786a
Add explicit this to templates (#8388)
This is the result of running the no-implicit-this-codemod, some manual fixes,
and the addition of a linting rule to prevent future ambiguity.
2020-07-09 15:19:07 -05:00

36 lines
1.1 KiB
Handlebars

{{#if this.isIdle}}
<button
data-test-idle-button
type="button"
class="button {{if this.isInfoAction "is-warning" "is-danger is-outlined"}} is-important is-small"
disabled={{this.disabled}}
onclick={{action "promptForConfirmation"}}>
{{this.idleText}}
</button>
{{else if this.isPendingConfirmation}}
<span
data-test-confirmation-message
class="confirmation-text {{if this.isInfoAction "inherit-color"}} {{if this.alignRight "is-right-aligned"}}">
{{this.confirmationMessage}}
</span>
<button
data-test-cancel-button
type="button"
class="button {{if this.isInfoAction "is-danger is-important" "is-dark"}} is-outlined is-small"
disabled={{this.awaitingConfirmation}}
onclick={{action (queue
(action "setToIdle")
(action this.onCancel)
)}}>
{{this.cancelText}}
</button>
<button
data-test-confirm-button
class="button {{if this.isInfoAction "is-warning" "is-danger"}} is-small {{if this.awaitingConfirmation "is-loading"}}"
disabled={{this.awaitingConfirmation}}
onclick={{action "confirm"}}
type="button">
{{this.confirmText}}
</button>
{{/if}}