+ @confirmTitle="Remove metadata?"
+ @confirmMessage="This data may be used outside of Vault."
+ @confirmButtonText="Remove"
+ @onConfirmAction={{action "performTransaction" model key}}
+ >
Remove
- {{#confirm-action
- onConfirmAction=(action "seal")
- confirmMessage=(concat "Are you sure you want to seal " model.cluster.name "?")
- confirmButtonText="Seal"
- buttonClasses="button is-primary"
- cancelButtonText="Cancel"
- data-test-seal=true
- }}
+
Seal
- {{/confirm-action}}
+
{{else}}
* ```
*
- * @property {Func} onConfirmAction=null - The action to take upon confirming.
- * @property {String} [confirmMessage=Are you sure you want to do this?] - The message to display upon confirming.
+ * @property {Func} [onConfirmAction=null] - The action to take upon confirming.
+ * @property {String} [confirmTitle=Delete this?] - The title to display when confirming.
+ * @property {String} [confirmMessage=Are you sure you want to do this?] - The message to display when confirming.
* @property {String} [confirmButtonText=Delete] - The confirm button text.
* @property {String} [cancelButtonText=Cancel] - The cancel button text.
+ * @property {String} [disabledTitle=Can't delete this yet] - The title to display when the button is disabled.
* @property {String} [disabledMessage=Complete the form to complete this action] - The message to display when the button is disabled.
*
*/
export default Component.extend({
- tagName: 'span',
- classNames: ['confirm-action'],
- layout: hbs`
- {{#if showConfirm ~}}
-
- {{if disabled disabledMessage confirmMessage}}
- {{confirmButtonText}}
- {{cancelButtonText}}
-
- {{else}}
-
- {{yield}}
-
- {{~/if}}
- `,
-
- disabled: false,
- disabledMessage: 'Complete the form to complete this action',
- showConfirm: false,
- messageClasses: 'is-size-8 has-text-grey',
- confirmButtonClasses: 'is-danger is-outlined button',
- containerClasses: '',
- buttonClasses: 'button',
+ layout,
+ tagName: '',
+ supportsDataTestProperties: true,
buttonText: 'Delete',
- confirmMessage: 'Are you sure you want to do this?',
+ confirmTitle: 'Delete this?',
+ confirmMessage: 'You will not be able to recover it later.',
confirmButtonText: 'Delete',
- cancelButtonClasses: 'button',
cancelButtonText: 'Cancel',
- // the action to take when we confirm
+ disabledTitle: "Can't delete this yet",
+ disabledMessage: 'Complete the form to complete this action',
+ horizontalPosition: 'auto-right',
+ verticalPosition: 'below',
+ disabled: false,
+ showConfirm: false,
onConfirmAction: null,
actions: {
diff --git a/ui/lib/core/addon/templates/components/confirm-action.hbs b/ui/lib/core/addon/templates/components/confirm-action.hbs
new file mode 100644
index 000000000000..f37151ceea1d
--- /dev/null
+++ b/ui/lib/core/addon/templates/components/confirm-action.hbs
@@ -0,0 +1,55 @@
+