open-nomad/ui/app/templates/components/two-step-button.hbs

35 lines
1 KiB
Handlebars
Raw Normal View History

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