From 3ba8b3622d5f17bc48078090d6a8917fd6ed12f4 Mon Sep 17 00:00:00 2001 From: "clairebontempo@gmail.com" Date: Thu, 29 Jun 2023 19:49:17 -0700 Subject: [PATCH 01/42] replace confirm-action dropdown with button+modal --- .../core/addon/components/confirm-action.hbs | 93 ++++++++----------- .../core/addon/components/confirm-action.js | 68 +++----------- 2 files changed, 55 insertions(+), 106 deletions(-) diff --git a/ui/lib/core/addon/components/confirm-action.hbs b/ui/lib/core/addon/components/confirm-action.hbs index b8225d6bdc6f..f724fa1c6d8a 100644 --- a/ui/lib/core/addon/components/confirm-action.hbs +++ b/ui/lib/core/addon/components/confirm-action.hbs @@ -1,53 +1,40 @@ -
- - - {{yield}} - {{#if (eq @buttonClasses "toolbar-link")}} - - {{/if}} - - -
-
-
- - {{this.confirmTitle}} -
-

- {{this.confirmMessage}} -

-
-
- - -
-
-
-
-
\ No newline at end of file + + +{{#if this.showConfirmModal}} + + + {{or @confirmTitle "Are you sure?"}} + + +

+ {{or @confirmMessage "You will not be able to recover it later."}} +

+
+ + + + + + +
+{{/if}} \ No newline at end of file diff --git a/ui/lib/core/addon/components/confirm-action.js b/ui/lib/core/addon/components/confirm-action.js index 715540d267a8..fe45ae96305b 100644 --- a/ui/lib/core/addon/components/confirm-action.js +++ b/ui/lib/core/addon/components/confirm-action.js @@ -21,70 +21,32 @@ import { tracked } from '@glimmer/tracking'; * * ``` * - * @param {Func} [onConfirmAction=null] - The action to take upon confirming. - * @param {String} [confirmTitle=Delete this?] - The title to display when confirming. + * @param {Func} onConfirmAction - The action to take upon confirming. + * @param {String} [confirmTitle=Delete this?] - The title to display in the confirmation modal. * @param {String} [confirmMessage=You will not be able to recover it later.] - The message to display when confirming. * @param {String} [confirmButtonText=Delete] - The confirm button text. * @param {String} [cancelButtonText=Cancel] - The cancel button text. * @param {String} [buttonClasses] - A string to indicate the button class. - * @param {String} [horizontalPosition=auto-right] - For the position of the dropdown. - * @param {String} [verticalPosition=below] - For the position of the dropdown. - * @param {Boolean} [isRunning=false] - If action is still running disable the confirm. - * @param {Boolean} [disable=false] - To disable the confirm action. + * @param {Boolean} [isRunning] - Disables the confirm button if action is still running + * @param {Boolean} [disabled] - To disable the confirm button. * */ export default class ConfirmActionComponent extends Component { - @tracked showConfirm = false; + @tracked showConfirmModal = false; - get horizontalPosition() { - return this.args.horizontalPosition || 'auto-right'; - } - - get verticalPosition() { - return this.args.verticalPosition || 'below'; - } - - get isRunning() { - return this.args.isRunning || false; - } - - get disabled() { - return this.args.disabled || false; - } - - get confirmTitle() { - return this.args.confirmTitle || 'Delete this?'; - } - - get confirmMessage() { - return this.args.confirmMessage || 'You will not be able to recover it later.'; - } - - get confirmButtonText() { - return this.args.confirmButtonText || 'Delete'; - } - - get cancelButtonText() { - return this.args.cancelButtonText || 'Cancel'; + constructor() { + super(...arguments); + assert( + ' component expects @onConfirmAction arg to be a function', + typeof this.args.onConfirmAction === 'function' + ); } @action - toggleConfirm() { - // toggle - this.showConfirm = !this.showConfirm; - } - - @action - onConfirm(actions) { - const confirmAction = this.args.onConfirmAction; - - if (typeof confirmAction !== 'function') { - assert('confirm-action components expects `onConfirmAction` attr to be a function'); - } else { - confirmAction(); - // close the dropdown content - actions.close(); - } + async onConfirm() { + await this.args.onConfirmAction(); + // close modal after destructive operation + this.showConfirmModal = false; } } From 9c69e5d1be5b36acad960bf8d4968a5d1b0fa97c Mon Sep 17 00:00:00 2001 From: "clairebontempo@gmail.com" Date: Thu, 29 Jun 2023 19:50:54 -0700 Subject: [PATCH 02/42] add modal frame to sidebar --- ui/app/components/sidebar/frame.hbs | 1 + 1 file changed, 1 insertion(+) diff --git a/ui/app/components/sidebar/frame.hbs b/ui/app/components/sidebar/frame.hbs index 63986925604b..58876184226c 100644 --- a/ui/app/components/sidebar/frame.hbs +++ b/ui/app/components/sidebar/frame.hbs @@ -39,6 +39,7 @@ + {{! outlet for app content }} From 4d26f1232bfa78b607b2ca3b7cd0c01cba74ee9b Mon Sep 17 00:00:00 2001 From: "clairebontempo@gmail.com" Date: Thu, 29 Jun 2023 20:06:12 -0700 Subject: [PATCH 03/42] fix weird paragraph indent --- ui/lib/core/addon/components/confirm-action.hbs | 6 ++---- ui/lib/core/addon/components/confirm-action.js | 4 ++++ 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/ui/lib/core/addon/components/confirm-action.hbs b/ui/lib/core/addon/components/confirm-action.hbs index f724fa1c6d8a..0db264ba2043 100644 --- a/ui/lib/core/addon/components/confirm-action.hbs +++ b/ui/lib/core/addon/components/confirm-action.hbs @@ -7,14 +7,12 @@ /> {{#if this.showConfirmModal}} - + {{or @confirmTitle "Are you sure?"}} -

- {{or @confirmMessage "You will not be able to recover it later."}} -

+

{{this.confirmMessage}}

diff --git a/ui/lib/core/addon/components/confirm-action.js b/ui/lib/core/addon/components/confirm-action.js index fe45ae96305b..fa4ab27955ba 100644 --- a/ui/lib/core/addon/components/confirm-action.js +++ b/ui/lib/core/addon/components/confirm-action.js @@ -43,6 +43,10 @@ export default class ConfirmActionComponent extends Component { ); } + get confirmMessage() { + return this.args.confirmMessage || 'You will not be able to recover it later.'; + } + @action async onConfirm() { await this.args.onConfirmAction(); From 8ef70fe1d1591f9095a96f715103136cc65d7dad Mon Sep 17 00:00:00 2001 From: "clairebontempo@gmail.com" Date: Thu, 29 Jun 2023 20:59:17 -0700 Subject: [PATCH 04/42] pass button text as arg --- .../components/configure-ssh-secret.hbs | 4 +--- .../components/database-connection.hbs | 10 ++++----- .../components/database-role-edit.hbs | 5 ++--- .../templates/components/generated-item.hbs | 6 ++--- .../components/identity/edit-form.hbs | 6 ++--- .../components/identity/popup-members.hbs | 5 ++--- .../components/identity/popup-metadata.hbs | 5 ++--- .../components/identity/popup-policy.hbs | 6 ++--- .../templates/components/keymgmt/key-edit.hbs | 10 ++++----- .../components/keymgmt/provider-edit.hbs | 5 ++--- ui/app/templates/components/role-aws-edit.hbs | 4 +--- ui/app/templates/components/role-ssh-edit.hbs | 4 +--- .../components/secret-delete-menu.hbs | 8 ++----- .../components/transform-role-edit.hbs | 5 ++--- .../components/transit-form-edit.hbs | 4 +--- .../components/transit-key-actions.hbs | 5 ++--- .../vault/cluster/access/leases/list.hbs | 10 ++++----- .../vault/cluster/access/leases/show.hbs | 5 ++--- .../access/mfa/methods/method/index.hbs | 4 +--- .../oidc/assignments/assignment/details.hbs | 5 ++--- .../access/oidc/clients/client/details.hbs | 5 ++--- .../cluster/access/oidc/keys/key/details.hbs | 10 ++++----- .../oidc/providers/provider/details.hbs | 5 ++--- .../access/oidc/scopes/scope/details.hbs | 5 ++--- .../templates/vault/cluster/policy/edit.hbs | 4 +--- .../templates/vault/cluster/settings/seal.hbs | 5 ++--- .../core/addon/components/confirm-action.js | 6 ++--- .../kmip/addon/templates/credentials/show.hbs | 5 ++--- ui/lib/kmip/addon/templates/role.hbs | 5 ++--- .../addon/components/page/role/details.hbs | 9 +++++--- .../page/pki-certificate-details.hbs | 5 ++--- .../addon/components/page/pki-key-details.hbs | 4 +--- .../components/page/pki-role-details.hbs | 4 +--- .../templates/mode/secondaries/index.hbs | 5 ++--- .../templates/mode/secondaries/revoke.hbs | 5 ++--- .../components/confirm-action-test.js | 22 ++----------------- 36 files changed, 77 insertions(+), 143 deletions(-) diff --git a/ui/app/templates/components/configure-ssh-secret.hbs b/ui/app/templates/components/configure-ssh-secret.hbs index 8e61dc38e92b..1dc29f79c8fb 100644 --- a/ui/app/templates/components/configure-ssh-secret.hbs +++ b/ui/app/templates/components/configure-ssh-secret.hbs @@ -32,9 +32,7 @@ @buttonClasses="button" @confirmMessage="This will remove the CA certificate information." @onConfirmAction={{this.delete}} - > - Delete -
+ /> {{else}} diff --git a/ui/app/templates/components/database-connection.hbs b/ui/app/templates/components/database-connection.hbs index 60cdcadc2e65..f92c2c3a87c8 100644 --- a/ui/app/templates/components/database-connection.hbs +++ b/ui/app/templates/components/database-connection.hbs @@ -31,15 +31,14 @@ {{/if}} {{#if @model.canReset}} - Reset connection - + /> {{/if}} {{#if (or @model.canReset @model.canDelete)}}
@@ -47,15 +46,14 @@ {{#if @model.canRotateRoot}} {{! template-lint-disable quotes }} - Rotate root credentials - + /> {{! template-lint-enable }} {{/if}} {{#if @model.canAddRole}} diff --git a/ui/app/templates/components/database-role-edit.hbs b/ui/app/templates/components/database-role-edit.hbs index 95b8bae09f47..f17f3e1348aa 100644 --- a/ui/app/templates/components/database-role-edit.hbs +++ b/ui/app/templates/components/database-role-edit.hbs @@ -20,15 +20,14 @@ {{#if @model.canDelete}} - Delete role - + />
{{/if}} {{#if (and @model.canRotateRoleCredentials (eq @model.type "static"))}} diff --git a/ui/app/templates/components/generated-item.hbs b/ui/app/templates/components/generated-item.hbs index 4e777e482077..c022c6033ccd 100644 --- a/ui/app/templates/components/generated-item.hbs +++ b/ui/app/templates/components/generated-item.hbs @@ -33,15 +33,13 @@ - Delete - {{this.itemType}} - + />
- Delete - {{this.model.identityType}} - + />
{{/if}} diff --git a/ui/app/templates/components/identity/popup-members.hbs b/ui/app/templates/components/identity/popup-members.hbs index 3f826c18e312..cff66e0f5058 100644 --- a/ui/app/templates/components/identity/popup-members.hbs +++ b/ui/app/templates/components/identity/popup-members.hbs @@ -3,13 +3,12 @@ diff --git a/ui/app/templates/components/identity/popup-metadata.hbs b/ui/app/templates/components/identity/popup-metadata.hbs index 4be9be44ca1b..6b3157f5c1c5 100644 --- a/ui/app/templates/components/identity/popup-metadata.hbs +++ b/ui/app/templates/components/identity/popup-metadata.hbs @@ -3,14 +3,13 @@ diff --git a/ui/app/templates/components/identity/popup-policy.hbs b/ui/app/templates/components/identity/popup-policy.hbs index 3459d0f5192f..bbd75fc3b988 100644 --- a/ui/app/templates/components/identity/popup-policy.hbs +++ b/ui/app/templates/components/identity/popup-policy.hbs @@ -13,14 +13,12 @@
  • - Remove from - {{this.model.identityType}} - + />
  • diff --git a/ui/app/templates/components/keymgmt/key-edit.hbs b/ui/app/templates/components/keymgmt/key-edit.hbs index e642f6ea673b..e28d91ed62ab 100644 --- a/ui/app/templates/components/keymgmt/key-edit.hbs +++ b/ui/app/templates/components/keymgmt/key-edit.hbs @@ -72,6 +72,7 @@ {{/if}} {{#if @model.provider}} - Remove key - + /> {{/if}} {{#if (or @model.canDelete @model.provider)}}
    {{/if}} - Rotate key - + /> {{#if @model.canEdit}} - Delete provider - + /> {{#if @model.keys.length}} diff --git a/ui/app/templates/components/role-aws-edit.hbs b/ui/app/templates/components/role-aws-edit.hbs index 119535b56e64..dabd15c580e5 100644 --- a/ui/app/templates/components/role-aws-edit.hbs +++ b/ui/app/templates/components/role-aws-edit.hbs @@ -27,9 +27,7 @@ {{#if this.model.canDelete}} - - Delete role - +
    {{/if}} {{#if this.model.canGenerate}} diff --git a/ui/app/templates/components/role-ssh-edit.hbs b/ui/app/templates/components/role-ssh-edit.hbs index 7e9d36a3baa6..deeb9b36f403 100644 --- a/ui/app/templates/components/role-ssh-edit.hbs +++ b/ui/app/templates/components/role-ssh-edit.hbs @@ -26,9 +26,7 @@ {{#if this.model.canDelete}} - - Delete role - +
    {{/if}} {{#if (eq this.model.keyType "otp")}} diff --git a/ui/app/templates/components/secret-delete-menu.hbs b/ui/app/templates/components/secret-delete-menu.hbs index b9aee8427916..2c479cab40df 100644 --- a/ui/app/templates/components/secret-delete-menu.hbs +++ b/ui/app/templates/components/secret-delete-menu.hbs @@ -23,9 +23,7 @@ @confirmMessage="Deleting this secret removes read access, but the underlying data will not be removed and can be undeleted later." @onConfirmAction={{action "handleDelete" (if this.canSoftDeleteSecretData "soft-delete" "delete-latest-version")}} data-test-secret-v2-delete="true" - > - Delete -
    + /> {{/if}} {{/if}} {{/if}} @@ -138,8 +136,6 @@ @confirmMessage="You will not be able to recover this secret data later." @onConfirmAction={{action "handleDelete" "v1"}} data-test-secret-v1-delete="true" - > - Delete -
    + />
    {{/if}} \ No newline at end of file diff --git a/ui/app/templates/components/transform-role-edit.hbs b/ui/app/templates/components/transform-role-edit.hbs index b54661cd13ec..4252e006cfc8 100644 --- a/ui/app/templates/components/transform-role-edit.hbs +++ b/ui/app/templates/components/transform-role-edit.hbs @@ -27,15 +27,14 @@ {{#if this.capabilities.canDelete}} - Delete role - + />
    {{/if}} {{#if this.capabilities.canUpdate}} diff --git a/ui/app/templates/components/transit-form-edit.hbs b/ui/app/templates/components/transit-form-edit.hbs index 220145c87b4a..cd731da23488 100644 --- a/ui/app/templates/components/transit-form-edit.hbs +++ b/ui/app/templates/components/transit-form-edit.hbs @@ -98,9 +98,7 @@ {{#if (and @key.canDelete @capabilities.canDelete)}} - - Delete transit key - + {{/if}} \ No newline at end of file diff --git a/ui/app/templates/components/transit-key-actions.hbs b/ui/app/templates/components/transit-key-actions.hbs index c7bb6f030813..757906af7176 100644 --- a/ui/app/templates/components/transit-key-actions.hbs +++ b/ui/app/templates/components/transit-key-actions.hbs @@ -1,15 +1,14 @@ {{#if (eq this.selectedAction "rotate")}} {{#if this.key.canRotate}} - Rotate encryption key - + /> {{/if}} {{else}} diff --git a/ui/app/templates/vault/cluster/access/leases/list.hbs b/ui/app/templates/vault/cluster/access/leases/list.hbs index 017da9cac6fa..812be2af6072 100644 --- a/ui/app/templates/vault/cluster/access/leases/list.hbs +++ b/ui/app/templates/vault/cluster/access/leases/list.hbs @@ -55,28 +55,26 @@
    {{#if (and this.capabilities.forceRevokePrefix.canUpdate (not this.confirmingRevoke))}} - Force revoke prefix - + /> {{/if}}
    {{#if (and this.capabilities.revokePrefix.canUpdate (not this.confirmingForceRevoke))}} - Revoke prefix - + /> {{/if}}
    {{/if}} diff --git a/ui/app/templates/vault/cluster/access/leases/show.hbs b/ui/app/templates/vault/cluster/access/leases/show.hbs index 7f55c0c27f43..6e77b1630f8f 100644 --- a/ui/app/templates/vault/cluster/access/leases/show.hbs +++ b/ui/app/templates/vault/cluster/access/leases/show.hbs @@ -21,15 +21,14 @@ - Revoke lease - + /> {{/if}} diff --git a/ui/app/templates/vault/cluster/access/mfa/methods/method/index.hbs b/ui/app/templates/vault/cluster/access/mfa/methods/method/index.hbs index bcbd77bd831a..95ff574d0762 100644 --- a/ui/app/templates/vault/cluster/access/mfa/methods/method/index.hbs +++ b/ui/app/templates/vault/cluster/access/mfa/methods/method/index.hbs @@ -46,9 +46,7 @@ @confirmTitle="Are you sure?" @confirmMessage="Deleting this MFA configuration is permanent, and it will no longer be available." @confirmButtonText="Delete" - > - Delete -
    + /> {{#if @model.canDelete}} - Delete assignment - + />
    {{/if}} {{#if @model.canEdit}} diff --git a/ui/app/templates/vault/cluster/access/oidc/clients/client/details.hbs b/ui/app/templates/vault/cluster/access/oidc/clients/client/details.hbs index b40addd213fc..7fd5b05db901 100644 --- a/ui/app/templates/vault/cluster/access/oidc/clients/client/details.hbs +++ b/ui/app/templates/vault/cluster/access/oidc/clients/client/details.hbs @@ -3,14 +3,13 @@ {{#if this.model.canDelete}} - Delete application - + />
    {{/if}} {{#if this.model.canEdit}} diff --git a/ui/app/templates/vault/cluster/access/oidc/keys/key/details.hbs b/ui/app/templates/vault/cluster/access/oidc/keys/key/details.hbs index 837279042f4c..e784e34ad8a1 100644 --- a/ui/app/templates/vault/cluster/access/oidc/keys/key/details.hbs +++ b/ui/app/templates/vault/cluster/access/oidc/keys/key/details.hbs @@ -4,6 +4,7 @@ - Delete key - + /> {{#if (eq this.model.name "default")}} @@ -27,6 +26,7 @@ {{/if}} {{#if this.model.canRotate}} - Rotate key - + /> {{/if}} {{#if this.model.canEdit}} diff --git a/ui/app/templates/vault/cluster/access/oidc/providers/provider/details.hbs b/ui/app/templates/vault/cluster/access/oidc/providers/provider/details.hbs index 377d9623df67..01cc0a048c4c 100644 --- a/ui/app/templates/vault/cluster/access/oidc/providers/provider/details.hbs +++ b/ui/app/templates/vault/cluster/access/oidc/providers/provider/details.hbs @@ -5,15 +5,14 @@ - Delete provider - + /> {{#if (eq this.model.name "default")}} diff --git a/ui/app/templates/vault/cluster/access/oidc/scopes/scope/details.hbs b/ui/app/templates/vault/cluster/access/oidc/scopes/scope/details.hbs index 3021c4b20cf4..5a2b100de692 100644 --- a/ui/app/templates/vault/cluster/access/oidc/scopes/scope/details.hbs +++ b/ui/app/templates/vault/cluster/access/oidc/scopes/scope/details.hbs @@ -33,14 +33,13 @@ {{#if this.model.canDelete}} - Delete scope - + />
    {{/if}} {{#if this.model.canEdit}} diff --git a/ui/app/templates/vault/cluster/policy/edit.hbs b/ui/app/templates/vault/cluster/policy/edit.hbs index bd057e4e9f3d..f3eba912bb58 100644 --- a/ui/app/templates/vault/cluster/policy/edit.hbs +++ b/ui/app/templates/vault/cluster/policy/edit.hbs @@ -30,9 +30,7 @@ @confirmMessage="This may affect access to Vault data." @onConfirmAction={{this.deletePolicy}} data-test-policy-delete="true" - > - Delete - + />
    {{/if}} diff --git a/ui/app/templates/vault/cluster/settings/seal.hbs b/ui/app/templates/vault/cluster/settings/seal.hbs index 586e38a350b0..2110040dd61a 100644 --- a/ui/app/templates/vault/cluster/settings/seal.hbs +++ b/ui/app/templates/vault/cluster/settings/seal.hbs @@ -16,6 +16,7 @@
    - Seal - + />
    {{else}} diff --git a/ui/lib/core/addon/components/confirm-action.js b/ui/lib/core/addon/components/confirm-action.js index fa4ab27955ba..44564eb6e139 100644 --- a/ui/lib/core/addon/components/confirm-action.js +++ b/ui/lib/core/addon/components/confirm-action.js @@ -15,10 +15,10 @@ import { tracked } from '@glimmer/tracking'; * @example * ```js * { console.log('Action!') } }} - * @confirmMessage="Are you sure you want to delete this config?"> - * Delete - * + * @confirmMessage="Are you sure you want to delete this config?" + * /> * ``` * * @param {Func} onConfirmAction - The action to take upon confirming. diff --git a/ui/lib/kmip/addon/templates/credentials/show.hbs b/ui/lib/kmip/addon/templates/credentials/show.hbs index 4b24fd20d470..acf44c1a3d37 100644 --- a/ui/lib/kmip/addon/templates/credentials/show.hbs +++ b/ui/lib/kmip/addon/templates/credentials/show.hbs @@ -12,15 +12,14 @@ {{#if this.model.deletePath.canDelete}} - Revoke credentials - + />
    {{/if}} diff --git a/ui/lib/kmip/addon/templates/role.hbs b/ui/lib/kmip/addon/templates/role.hbs index 373e470032f8..48b7322db043 100644 --- a/ui/lib/kmip/addon/templates/role.hbs +++ b/ui/lib/kmip/addon/templates/role.hbs @@ -3,13 +3,12 @@ {{#if this.model.updatePath.canUpdate}} - Delete role - + />
    {{/if}} {{#if this.model.updatePath.canUpdate}} diff --git a/ui/lib/kubernetes/addon/components/page/role/details.hbs b/ui/lib/kubernetes/addon/components/page/role/details.hbs index 9001a7c781fd..1373192aaded 100644 --- a/ui/lib/kubernetes/addon/components/page/role/details.hbs +++ b/ui/lib/kubernetes/addon/components/page/role/details.hbs @@ -12,9 +12,12 @@ {{#if @model.canDelete}} - - Delete role - +
    {{/if}} {{#if @model.canGenerateCreds}} diff --git a/ui/lib/pki/addon/components/page/pki-certificate-details.hbs b/ui/lib/pki/addon/components/page/pki-certificate-details.hbs index ba79e7ad610e..bacd559707c1 100644 --- a/ui/lib/pki/addon/components/page/pki-certificate-details.hbs +++ b/ui/lib/pki/addon/components/page/pki-certificate-details.hbs @@ -6,14 +6,13 @@ {{#if @model.canRevoke}} - Revoke certificate - + /> {{/if}}
    diff --git a/ui/lib/pki/addon/components/page/pki-key-details.hbs b/ui/lib/pki/addon/components/page/pki-key-details.hbs index 09453bd4352e..b8ef9beac56c 100644 --- a/ui/lib/pki/addon/components/page/pki-key-details.hbs +++ b/ui/lib/pki/addon/components/page/pki-key-details.hbs @@ -7,9 +7,7 @@ @confirmTitle="Delete key?" @confirmButtonText="Delete" data-test-pki-key-delete - > - Delete - + />
    {{/if}} {{#if @key.privateKey}} diff --git a/ui/lib/pki/addon/components/page/pki-role-details.hbs b/ui/lib/pki/addon/components/page/pki-role-details.hbs index 71e2e9e4af67..7fbdbe3292bc 100644 --- a/ui/lib/pki/addon/components/page/pki-role-details.hbs +++ b/ui/lib/pki/addon/components/page/pki-role-details.hbs @@ -7,9 +7,7 @@ @confirmTitle="Delete role?" @confirmButtonText="Delete" data-test-pki-role-delete - > - Delete - + />
    {{/if}} {{#if @role.canGenerateCert}} diff --git a/ui/lib/replication/addon/templates/mode/secondaries/index.hbs b/ui/lib/replication/addon/templates/mode/secondaries/index.hbs index 6c4584eac37f..0ebb0c354cca 100644 --- a/ui/lib/replication/addon/templates/mode/secondaries/index.hbs +++ b/ui/lib/replication/addon/templates/mode/secondaries/index.hbs @@ -41,15 +41,14 @@ {{#if this.model.canRevokeSecondary}}
  • - Revoke - + />
  • {{/if}} diff --git a/ui/lib/replication/addon/templates/mode/secondaries/revoke.hbs b/ui/lib/replication/addon/templates/mode/secondaries/revoke.hbs index e183e6af6b6f..7f11202d7ae1 100644 --- a/ui/lib/replication/addon/templates/mode/secondaries/revoke.hbs +++ b/ui/lib/replication/addon/templates/mode/secondaries/revoke.hbs @@ -18,6 +18,7 @@
    - Revoke - + />
    {{#unless this.isRevoking}} diff --git a/ui/tests/integration/components/confirm-action-test.js b/ui/tests/integration/components/confirm-action-test.js index 9b30c33266f2..b88ef66b6d79 100644 --- a/ui/tests/integration/components/confirm-action-test.js +++ b/ui/tests/integration/components/confirm-action-test.js @@ -12,33 +12,15 @@ import sinon from 'sinon'; module('Integration | Component | confirm-action', function (hooks) { setupRenderingTest(hooks); - test('it renders and on click shows the correct icon', async function (assert) { - const confirmAction = sinon.spy(); - this.set('onConfirm', confirmAction); - await render(hbs` - - DELETE - - `); - assert.dom('[data-test-icon="chevron-down"]').exists('Icon is pointing down'); - await click('[data-test-confirm-action-trigger="true"]'); - assert.dom('[data-test-icon="chevron-up"]').exists('Icon is now pointing up'); - assert.dom('[data-test-confirm-action-title]').hasText('Delete this?'); - }); - test('it closes the confirmation modal on successful delete', async function (assert) { const confirmAction = sinon.spy(); this.set('onConfirm', confirmAction); await render(hbs` - DELETE - + /> `); await click('[data-test-confirm-action-trigger="true"]'); await click('[data-test-confirm-cancel-button="true"]'); From e956d3432df43acbf1065aef8a4240e9a7301c0e Mon Sep 17 00:00:00 2001 From: "clairebontempo@gmail.com" Date: Thu, 29 Jun 2023 21:10:12 -0700 Subject: [PATCH 05/42] add warning color to rotate modals --- ui/app/templates/components/database-connection.hbs | 1 + ui/app/templates/components/keymgmt/key-edit.hbs | 1 + ui/app/templates/components/transform-role-edit.hbs | 1 - ui/app/templates/components/transit-key-actions.hbs | 1 + ui/app/templates/vault/cluster/access/leases/list.hbs | 4 ++-- .../vault/cluster/access/mfa/methods/method/index.hbs | 1 - .../vault/cluster/access/oidc/keys/key/details.hbs | 1 + ui/lib/core/addon/components/confirm-action.hbs | 10 ++++++++-- ui/lib/core/addon/components/confirm-action.js | 3 ++- 9 files changed, 16 insertions(+), 7 deletions(-) diff --git a/ui/app/templates/components/database-connection.hbs b/ui/app/templates/components/database-connection.hbs index f92c2c3a87c8..6d2833fa8dfe 100644 --- a/ui/app/templates/components/database-connection.hbs +++ b/ui/app/templates/components/database-connection.hbs @@ -52,6 +52,7 @@ @confirmTitle="Rotate credentials?" @confirmMessage='This will rotate the "root" user credentials stored for the database connection. The password will not be accessible once rotated.' @confirmButtonText="Rotate" + @color="warning" data-test-database-connection-rotate /> {{! template-lint-enable }} diff --git a/ui/app/templates/components/keymgmt/key-edit.hbs b/ui/app/templates/components/keymgmt/key-edit.hbs index e28d91ed62ab..71ec7d744fe7 100644 --- a/ui/app/templates/components/keymgmt/key-edit.hbs +++ b/ui/app/templates/components/keymgmt/key-edit.hbs @@ -92,6 +92,7 @@ @confirmTitle="Rotate this key?" @confirmMessage="After rotation, all key actions will default to using the newest version of the key." @confirmButtonText="Rotate" + @color="warning" @isRunning={{this.rotateKey.isRunning}} data-test-keymgmt-key-rotate /> diff --git a/ui/app/templates/components/transform-role-edit.hbs b/ui/app/templates/components/transform-role-edit.hbs index 4252e006cfc8..23715c314d6f 100644 --- a/ui/app/templates/components/transform-role-edit.hbs +++ b/ui/app/templates/components/transform-role-edit.hbs @@ -30,7 +30,6 @@ @buttonText="Delete role" @buttonClasses="toolbar-link" @onConfirmAction={{action "delete"}} - @confirmTitle="Are you sure?" @confirmMessage="Deleting this role means that you’ll need to recreate it and reassign any existing transformations to use it again." @confirmButtonText="Delete" data-test-transformation-role-delete diff --git a/ui/app/templates/components/transit-key-actions.hbs b/ui/app/templates/components/transit-key-actions.hbs index 757906af7176..fa4d3bcff86e 100644 --- a/ui/app/templates/components/transit-key-actions.hbs +++ b/ui/app/templates/components/transit-key-actions.hbs @@ -6,6 +6,7 @@ @confirmTitle="Rotate this key?" @confirmMessage="After rotation, all key actions will default to using the newest version of the key." @confirmButtonText="Rotate" + @color="warning" @onConfirmAction={{action "doSubmit"}} data-test-transit-key-rotate="true" /> diff --git a/ui/app/templates/vault/cluster/access/leases/list.hbs b/ui/app/templates/vault/cluster/access/leases/list.hbs index 812be2af6072..8595ac8a0244 100644 --- a/ui/app/templates/vault/cluster/access/leases/list.hbs +++ b/ui/app/templates/vault/cluster/access/leases/list.hbs @@ -58,7 +58,7 @@ @buttonText="Force revoke prefix" @buttonClasses="toolbar-link" @confirmTitle="Disable this?" - @confirmMessage={{concat "All leases under this one will also be removed and disregard any errors encountered."}} + @confirmMessage="All leases under this one will also be removed and disregard any errors encountered." @confirmButtonText="Revoke" @onConfirmAction={{action "revokePrefix" this.baseKey.id true}} /> @@ -70,7 +70,7 @@ @buttonText="Revoke prefix" @buttonClasses="toolbar-link" @confirmTitle="Revoke this?" - @confirmMessage={{concat "All leases under this one will also be removed"}} + @confirmMessage="All leases under this one will also be removed" @confirmButtonText="Revoke" @onConfirmAction={{action "revokePrefix" this.baseKey.id}} data-test-lease-revoke-prefix="true" diff --git a/ui/app/templates/vault/cluster/access/mfa/methods/method/index.hbs b/ui/app/templates/vault/cluster/access/mfa/methods/method/index.hbs index 95ff574d0762..a22cde6711e2 100644 --- a/ui/app/templates/vault/cluster/access/mfa/methods/method/index.hbs +++ b/ui/app/templates/vault/cluster/access/mfa/methods/method/index.hbs @@ -43,7 +43,6 @@ @buttonClasses="toolbar-link" @disabled={{not (is-empty this.model.enforcements)}} @onConfirmAction={{this.deleteMethod}} - @confirmTitle="Are you sure?" @confirmMessage="Deleting this MFA configuration is permanent, and it will no longer be available." @confirmButtonText="Delete" /> diff --git a/ui/app/templates/vault/cluster/access/oidc/keys/key/details.hbs b/ui/app/templates/vault/cluster/access/oidc/keys/key/details.hbs index e784e34ad8a1..3dfe02661859 100644 --- a/ui/app/templates/vault/cluster/access/oidc/keys/key/details.hbs +++ b/ui/app/templates/vault/cluster/access/oidc/keys/key/details.hbs @@ -33,6 +33,7 @@ @confirmTitle="Rotate this key?" @confirmMessage="After rotation, a new public/private key pair will be generated." @confirmButtonText="Rotate" + @color="warning" @isRunning={{this.rotateKey.isRunning}} /> {{/if}} diff --git a/ui/lib/core/addon/components/confirm-action.hbs b/ui/lib/core/addon/components/confirm-action.hbs index 0db264ba2043..f9b199eff3bd 100644 --- a/ui/lib/core/addon/components/confirm-action.hbs +++ b/ui/lib/core/addon/components/confirm-action.hbs @@ -7,7 +7,13 @@ /> {{#if this.showConfirmModal}} - + {{or @confirmTitle "Are you sure?"}} @@ -21,7 +27,7 @@ disabled={{or @disabled @isRunning}} @icon={{if @isRunning "loading"}} type="button" - @color="critical" + @color={{or @color "critical"}} @text={{or @confirmButtonText "Delete"}} {{on "click" this.onConfirm}} /> diff --git a/ui/lib/core/addon/components/confirm-action.js b/ui/lib/core/addon/components/confirm-action.js index 44564eb6e139..f328139cddd5 100644 --- a/ui/lib/core/addon/components/confirm-action.js +++ b/ui/lib/core/addon/components/confirm-action.js @@ -22,13 +22,14 @@ import { tracked } from '@glimmer/tracking'; * ``` * * @param {Func} onConfirmAction - The action to take upon confirming. - * @param {String} [confirmTitle=Delete this?] - The title to display in the confirmation modal. + * @param {String} [confirmTitle=Are you sure?] - The title to display in the confirmation modal. * @param {String} [confirmMessage=You will not be able to recover it later.] - The message to display when confirming. * @param {String} [confirmButtonText=Delete] - The confirm button text. * @param {String} [cancelButtonText=Cancel] - The cancel button text. * @param {String} [buttonClasses] - A string to indicate the button class. * @param {Boolean} [isRunning] - Disables the confirm button if action is still running * @param {Boolean} [disabled] - To disable the confirm button. + * @param {String} [color=critical] - Changes the color of modal and confirm button * */ From 4395212fe552f97ce3c16588a31f49ab72e972ca Mon Sep 17 00:00:00 2001 From: "clairebontempo@gmail.com" Date: Wed, 15 Nov 2023 16:33:51 -0800 Subject: [PATCH 06/42] update seal action and config ssh --- ui/app/components/seal-action.hbs | 8 ++------ ui/app/templates/components/configure-ssh-secret.hbs | 3 ++- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/ui/app/components/seal-action.hbs b/ui/app/components/seal-action.hbs index ae966e676f6f..b3c8e8b0b53c 100644 --- a/ui/app/components/seal-action.hbs +++ b/ui/app/components/seal-action.hbs @@ -21,14 +21,10 @@
    - Seal - + @buttonText="Seal" + />
    \ No newline at end of file diff --git a/ui/app/templates/components/configure-ssh-secret.hbs b/ui/app/templates/components/configure-ssh-secret.hbs index 60e74c1b0ef9..a1b51dcb802d 100644 --- a/ui/app/templates/components/configure-ssh-secret.hbs +++ b/ui/app/templates/components/configure-ssh-secret.hbs @@ -27,7 +27,8 @@
    From b87960449f5f114a6f7eeabc8cbbda1cafe64b26 Mon Sep 17 00:00:00 2001 From: "clairebontempo@gmail.com" Date: Wed, 15 Nov 2023 16:34:02 -0800 Subject: [PATCH 07/42] cleanup confirm action --- ui/lib/core/addon/components/confirm-action.hbs | 17 +++++------------ ui/lib/core/addon/components/confirm-action.js | 9 +++++---- 2 files changed, 10 insertions(+), 16 deletions(-) diff --git a/ui/lib/core/addon/components/confirm-action.hbs b/ui/lib/core/addon/components/confirm-action.hbs index d5351a447fd9..fc3886f82ecf 100644 --- a/ui/lib/core/addon/components/confirm-action.hbs +++ b/ui/lib/core/addon/components/confirm-action.hbs @@ -2,19 +2,19 @@ Copyright (c) HashiCorp, Inc. SPDX-License-Identifier: BUSL-1.1 ~}} + {{#if this.showConfirmModal}} @@ -30,18 +30,11 @@ data-test-confirm-button disabled={{or @disabled @isRunning}} @icon={{if @isRunning "loading"}} - type="button" @color={{or @color "critical"}} - @text={{or @confirmButtonText "Delete"}} + @text="Confirm" {{on "click" this.onConfirm}} /> - + diff --git a/ui/lib/core/addon/components/confirm-action.js b/ui/lib/core/addon/components/confirm-action.js index 235e4af7bc1f..61804948c6d1 100644 --- a/ui/lib/core/addon/components/confirm-action.js +++ b/ui/lib/core/addon/components/confirm-action.js @@ -10,7 +10,9 @@ import { tracked } from '@glimmer/tracking'; /** * @module ConfirmAction - * `ConfirmAction` is a button followed by a pop up confirmation message and button used to prevent users from performing actions they do not intend to. + * ConfirmAction is a button that opens a modal containing a confirmation message with confirm or cancel action. + * Splattributes are spread to the button element to apply styling directly without adding extra args. + * The default button is the same as Hds::Button which is primary blue * * @example * ```js @@ -24,9 +26,8 @@ import { tracked } from '@glimmer/tracking'; * @param {Func} onConfirmAction - The action to take upon confirming. * @param {String} [confirmTitle=Are you sure?] - The title to display in the confirmation modal. * @param {String} [confirmMessage=You will not be able to recover it later.] - The message to display when confirming. - * @param {String} [confirmButtonText=Delete] - The confirm button text. - * @param {String} [cancelButtonText=Cancel] - The cancel button text. - * @param {String} [buttonClasses] - A string to indicate the button class. + * @param {String} buttonText - Text for the button that triggers modal to open. + * @param {String} buttonColor - Color of button that triggers modal. Default is primary, other options are secondary, tertiary, and critical * @param {Boolean} [isRunning] - Disables the confirm button if action is still running * @param {Boolean} [disabled] - To disable the confirm button. * @param {String} [color=critical] - Changes the color of modal and confirm button From 3e3ea307916907db4952a9afb78151111fca2f8d Mon Sep 17 00:00:00 2001 From: "clairebontempo@gmail.com" Date: Wed, 15 Nov 2023 16:35:37 -0800 Subject: [PATCH 08/42] edit form --- ui/app/templates/components/identity/edit-form.hbs | 2 +- ui/lib/core/addon/components/confirm-action.hbs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ui/app/templates/components/identity/edit-form.hbs b/ui/app/templates/components/identity/edit-form.hbs index 5c4bc9c26c2c..7af821eb4e29 100644 --- a/ui/app/templates/components/identity/edit-form.hbs +++ b/ui/app/templates/components/identity/edit-form.hbs @@ -7,8 +7,8 @@ diff --git a/ui/lib/core/addon/components/confirm-action.hbs b/ui/lib/core/addon/components/confirm-action.hbs index fc3886f82ecf..a3e142e88278 100644 --- a/ui/lib/core/addon/components/confirm-action.hbs +++ b/ui/lib/core/addon/components/confirm-action.hbs @@ -5,10 +5,10 @@ {{#if this.showConfirmModal}} From ffd2c5ae8527325ce12ffd3e035e4a5380f1acfb Mon Sep 17 00:00:00 2001 From: "clairebontempo@gmail.com" Date: Wed, 15 Nov 2023 17:09:59 -0800 Subject: [PATCH 09/42] add dropdown arg --- ui/app/styles/components/popup-menu.scss | 12 ++++++++++ .../core/addon/components/confirm-action.hbs | 23 +++++++++++++------ .../core/addon/components/confirm-action.js | 8 +++---- ui/lib/kv/addon/components/page/list.hbs | 20 ++++++++-------- 4 files changed, 41 insertions(+), 22 deletions(-) diff --git a/ui/app/styles/components/popup-menu.scss b/ui/app/styles/components/popup-menu.scss index 1ce0216cd4f5..0c57e3c04ed5 100644 --- a/ui/app/styles/components/popup-menu.scss +++ b/ui/app/styles/components/popup-menu.scss @@ -48,6 +48,18 @@ width: 100%; } + // TODO HDS polish - temp styling fix for ConfirmAction dropdown buttons + // so they match other dropdown elements until we replace popup-menu with Hds::Dropdown + .hds-confirm-action-critical { + &:hover { + background-color: $ui-gray-050; + } + div { + font-size: $size-7; + font-weight: $font-weight-semibold; + } + } + button.link, .ember-power-select-option, .ember-power-select-option[aria-current='true'], diff --git a/ui/lib/core/addon/components/confirm-action.hbs b/ui/lib/core/addon/components/confirm-action.hbs index a3e142e88278..dcf931d27f48 100644 --- a/ui/lib/core/addon/components/confirm-action.hbs +++ b/ui/lib/core/addon/components/confirm-action.hbs @@ -3,13 +3,22 @@ SPDX-License-Identifier: BUSL-1.1 ~}} - +{{#if @isInDropdown}} + +{{else}} + +{{/if}} {{#if this.showConfirmModal}} * ``` * - * @param {Func} onConfirmAction - The action to take upon confirming. + * @param {Function} onConfirmAction - The action to take upon confirming. * @param {String} [confirmTitle=Are you sure?] - The title to display in the confirmation modal. * @param {String} [confirmMessage=You will not be able to recover it later.] - The message to display when confirming. * @param {String} buttonText - Text for the button that triggers modal to open. - * @param {String} buttonColor - Color of button that triggers modal. Default is primary, other options are secondary, tertiary, and critical + * @param {String} [color='critical'] - Color of button that triggers modal. Default is critical, other options are secondary, tertiary, and primary * @param {Boolean} [isRunning] - Disables the confirm button if action is still running - * @param {Boolean} [disabled] - To disable the confirm button. - * @param {String} [color=critical] - Changes the color of modal and confirm button + * @param {Boolean} [disabled] - Disables the modal's confirm button. + * @param {String} [modalColor=critical] - Changes the color of modal and confirm button * */ diff --git a/ui/lib/kv/addon/components/page/list.hbs b/ui/lib/kv/addon/components/page/list.hbs index 3f95ea4b1a14..c08909fccb33 100644 --- a/ui/lib/kv/addon/components/page/list.hbs +++ b/ui/lib/kv/addon/components/page/list.hbs @@ -101,17 +101,15 @@ {{/if}} {{#if metadata.canDeleteMetadata}} -
  • - - Permanently delete - -
  • + {{/if}} {{/if}} From 1c819002224e5c45c70146dee75f96afa93b9b2b Mon Sep 17 00:00:00 2001 From: "clairebontempo@gmail.com" Date: Wed, 15 Nov 2023 19:10:08 -0800 Subject: [PATCH 10/42] put back seal text --- ui/app/components/seal-action.hbs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ui/app/components/seal-action.hbs b/ui/app/components/seal-action.hbs index b3c8e8b0b53c..8b31becbeca1 100644 --- a/ui/app/components/seal-action.hbs +++ b/ui/app/components/seal-action.hbs @@ -21,10 +21,11 @@
    \ No newline at end of file From 2c73e4a0b7ca76ae640581f0ec8d11ba99c5cd45 Mon Sep 17 00:00:00 2001 From: "clairebontempo@gmail.com" Date: Wed, 15 Nov 2023 19:10:44 -0800 Subject: [PATCH 11/42] put back confirm button text --- ui/lib/core/addon/components/confirm-action.hbs | 10 +++++----- ui/lib/core/addon/components/confirm-action.js | 5 +++-- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/ui/lib/core/addon/components/confirm-action.hbs b/ui/lib/core/addon/components/confirm-action.hbs index dcf931d27f48..c0c917db7eee 100644 --- a/ui/lib/core/addon/components/confirm-action.hbs +++ b/ui/lib/core/addon/components/confirm-action.hbs @@ -6,7 +6,7 @@ {{#if @isInDropdown}} @@ -14,7 +14,7 @@ @@ -23,7 +23,7 @@ {{#if this.showConfirmModal}} @@ -39,8 +39,8 @@ data-test-confirm-button disabled={{or @disabled @isRunning}} @icon={{if @isRunning "loading"}} - @color={{or @color "critical"}} - @text="Confirm" + @color={{or @modalColor "critical"}} + @text={{or @confirmButtonText "Confirm"}} {{on "click" this.onConfirm}} /> diff --git a/ui/lib/core/addon/components/confirm-action.js b/ui/lib/core/addon/components/confirm-action.js index 166c6f6c5ea2..a7a1cff248cf 100644 --- a/ui/lib/core/addon/components/confirm-action.js +++ b/ui/lib/core/addon/components/confirm-action.js @@ -27,10 +27,11 @@ import { tracked } from '@glimmer/tracking'; * @param {String} [confirmTitle=Are you sure?] - The title to display in the confirmation modal. * @param {String} [confirmMessage=You will not be able to recover it later.] - The message to display when confirming. * @param {String} buttonText - Text for the button that triggers modal to open. - * @param {String} [color='critical'] - Color of button that triggers modal. Default is critical, other options are secondary, tertiary, and primary + * @param {String} [buttonColor] - Color of button that triggers modal. Default is primary, other options are secondary, tertiary, and critical + * @param {String} [modalColor=critical] - Modal banner theme, styles modal confirm button and banner color + * @param {String} [confirmButtonText=Confirm] - Text for button inside modal that confirms the action * @param {Boolean} [isRunning] - Disables the confirm button if action is still running * @param {Boolean} [disabled] - Disables the modal's confirm button. - * @param {String} [modalColor=critical] - Changes the color of modal and confirm button * */ From 8b59da6773f531b2319844e42f62caf3518872ef Mon Sep 17 00:00:00 2001 From: "clairebontempo@gmail.com" Date: Wed, 15 Nov 2023 19:37:25 -0800 Subject: [PATCH 12/42] fix toolbar stylinggp --- ui/app/templates/components/identity/edit-form.hbs | 2 ++ ui/lib/core/addon/components/confirm-action.hbs | 1 + 2 files changed, 3 insertions(+) diff --git a/ui/app/templates/components/identity/edit-form.hbs b/ui/app/templates/components/identity/edit-form.hbs index 7af821eb4e29..c631ba68d132 100644 --- a/ui/app/templates/components/identity/edit-form.hbs +++ b/ui/app/templates/components/identity/edit-form.hbs @@ -8,7 +8,9 @@ diff --git a/ui/lib/core/addon/components/confirm-action.hbs b/ui/lib/core/addon/components/confirm-action.hbs index c0c917db7eee..fc57ddc33e0a 100644 --- a/ui/lib/core/addon/components/confirm-action.hbs +++ b/ui/lib/core/addon/components/confirm-action.hbs @@ -24,6 +24,7 @@ From 72be6c9d092ce4c8fb8cbfbf55571869af045d9f Mon Sep 17 00:00:00 2001 From: "clairebontempo@gmail.com" Date: Wed, 15 Nov 2023 19:44:01 -0800 Subject: [PATCH 13/42] popup member group --- ui/app/templates/components/identity/popup-members.hbs | 6 ++++-- ui/lib/core/addon/components/confirm-action.hbs | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/ui/app/templates/components/identity/popup-members.hbs b/ui/app/templates/components/identity/popup-members.hbs index 31670fea9d38..4e81757ee12e 100644 --- a/ui/app/templates/components/identity/popup-members.hbs +++ b/ui/app/templates/components/identity/popup-members.hbs @@ -9,8 +9,10 @@
  • diff --git a/ui/lib/core/addon/components/confirm-action.hbs b/ui/lib/core/addon/components/confirm-action.hbs index fc57ddc33e0a..99ab22966052 100644 --- a/ui/lib/core/addon/components/confirm-action.hbs +++ b/ui/lib/core/addon/components/confirm-action.hbs @@ -32,7 +32,7 @@ {{or @confirmTitle "Are you sure?"}} -

    {{this.confirmMessage}}

    + {{this.confirmMessage}}
    From 9fc8854eb1890a5b28e0ead6840dc5a9c8c428bd Mon Sep 17 00:00:00 2001 From: "clairebontempo@gmail.com" Date: Wed, 15 Nov 2023 19:46:17 -0800 Subject: [PATCH 14/42] move up title --- ui/app/templates/components/identity/popup-members.hbs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/app/templates/components/identity/popup-members.hbs b/ui/app/templates/components/identity/popup-members.hbs index 4e81757ee12e..957f5b8e40cb 100644 --- a/ui/app/templates/components/identity/popup-members.hbs +++ b/ui/app/templates/components/identity/popup-members.hbs @@ -9,8 +9,8 @@
  • Date: Wed, 15 Nov 2023 19:54:18 -0800 Subject: [PATCH 15/42] finish popup- components --- ui/app/templates/components/identity/popup-metadata.hbs | 5 +++-- ui/app/templates/components/identity/popup-policy.hbs | 6 ++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/ui/app/templates/components/identity/popup-metadata.hbs b/ui/app/templates/components/identity/popup-metadata.hbs index 61da27ef900c..0c82c43b449c 100644 --- a/ui/app/templates/components/identity/popup-metadata.hbs +++ b/ui/app/templates/components/identity/popup-metadata.hbs @@ -9,10 +9,11 @@
  • diff --git a/ui/app/templates/components/identity/popup-policy.hbs b/ui/app/templates/components/identity/popup-policy.hbs index 9f107a6a3cc1..d0848dde4892 100644 --- a/ui/app/templates/components/identity/popup-policy.hbs +++ b/ui/app/templates/components/identity/popup-policy.hbs @@ -19,8 +19,10 @@
  • From 93419befbfdf90c0201771a8260182b810b5a3fb Mon Sep 17 00:00:00 2001 From: "clairebontempo@gmail.com" Date: Wed, 15 Nov 2023 20:07:58 -0800 Subject: [PATCH 16/42] keymgmt --- ui/app/templates/components/keymgmt/key-edit.hbs | 7 +++++-- ui/lib/core/addon/components/confirm-action.hbs | 2 +- ui/lib/core/addon/components/confirm-action.js | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/ui/app/templates/components/keymgmt/key-edit.hbs b/ui/app/templates/components/keymgmt/key-edit.hbs index 9239a951042c..87cffed72637 100644 --- a/ui/app/templates/components/keymgmt/key-edit.hbs +++ b/ui/app/templates/components/keymgmt/key-edit.hbs @@ -76,7 +76,8 @@ {{#if @model.provider}} diff --git a/ui/lib/core/addon/components/confirm-action.js b/ui/lib/core/addon/components/confirm-action.js index a7a1cff248cf..98649c7fb322 100644 --- a/ui/lib/core/addon/components/confirm-action.js +++ b/ui/lib/core/addon/components/confirm-action.js @@ -28,7 +28,7 @@ import { tracked } from '@glimmer/tracking'; * @param {String} [confirmMessage=You will not be able to recover it later.] - The message to display when confirming. * @param {String} buttonText - Text for the button that triggers modal to open. * @param {String} [buttonColor] - Color of button that triggers modal. Default is primary, other options are secondary, tertiary, and critical - * @param {String} [modalColor=critical] - Modal banner theme, styles modal confirm button and banner color + * @param {String} [modalColor=critical] - Styles modal color, if 'critical' confirm button is styled as well. Possible values: critical, warning or neutral * @param {String} [confirmButtonText=Confirm] - Text for button inside modal that confirms the action * @param {Boolean} [isRunning] - Disables the confirm button if action is still running * @param {Boolean} [disabled] - Disables the modal's confirm button. From 422566752005a32e10fb982fb987c62d201dc648 Mon Sep 17 00:00:00 2001 From: "clairebontempo@gmail.com" Date: Wed, 15 Nov 2023 20:15:50 -0800 Subject: [PATCH 17/42] fix modal button logic --- ui/app/templates/components/keymgmt/key-edit.hbs | 2 +- ui/app/templates/components/keymgmt/provider-edit.hbs | 2 +- ui/lib/core/addon/components/confirm-action.hbs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ui/app/templates/components/keymgmt/key-edit.hbs b/ui/app/templates/components/keymgmt/key-edit.hbs index 87cffed72637..1dec3e21bf08 100644 --- a/ui/app/templates/components/keymgmt/key-edit.hbs +++ b/ui/app/templates/components/keymgmt/key-edit.hbs @@ -75,8 +75,8 @@ {{/if}} {{#if @model.provider}} From 3c755771b9ea0df01bcd76f64c2f1a1df607c0c2 Mon Sep 17 00:00:00 2001 From: "clairebontempo@gmail.com" Date: Wed, 15 Nov 2023 20:33:29 -0800 Subject: [PATCH 18/42] remaining app template components --- ui/app/templates/components/configure-ssh-secret.hbs | 6 ++---- ui/app/templates/components/database-connection.hbs | 8 +++++--- ui/app/templates/components/database-role-edit.hbs | 3 ++- ui/app/templates/components/generated-item.hbs | 6 +++--- ui/app/templates/components/keymgmt/provider-edit.hbs | 1 + ui/app/templates/components/role-aws-edit.hbs | 7 ++++++- ui/app/templates/components/role-ssh-edit.hbs | 7 ++++++- ui/app/templates/components/secret-edit-toolbar.hbs | 8 ++++---- ui/app/templates/components/transform-role-edit.hbs | 3 ++- ui/app/templates/components/transit-form-edit.hbs | 2 +- ui/app/templates/components/transit-key-actions.hbs | 9 ++++----- 11 files changed, 36 insertions(+), 24 deletions(-) diff --git a/ui/app/templates/components/configure-ssh-secret.hbs b/ui/app/templates/components/configure-ssh-secret.hbs index a1b51dcb802d..25e8d199321a 100644 --- a/ui/app/templates/components/configure-ssh-secret.hbs +++ b/ui/app/templates/components/configure-ssh-secret.hbs @@ -22,17 +22,15 @@
  • -
    + -
    -
    -
    +
    {{else}}
    diff --git a/ui/app/templates/components/database-connection.hbs b/ui/app/templates/components/database-connection.hbs index 2057ed5a6d28..a3d64b539415 100644 --- a/ui/app/templates/components/database-connection.hbs +++ b/ui/app/templates/components/database-connection.hbs @@ -36,7 +36,8 @@ {{#if @model.canReset}} {{! template-lint-enable }} diff --git a/ui/app/templates/components/database-role-edit.hbs b/ui/app/templates/components/database-role-edit.hbs index 60e8d1663f6f..69e87123a174 100644 --- a/ui/app/templates/components/database-role-edit.hbs +++ b/ui/app/templates/components/database-role-edit.hbs @@ -26,7 +26,8 @@ {{#if @model.canDelete}}
    {{#if this.model.canDelete}} - +
    {{/if}} {{#if this.model.canGenerate}} diff --git a/ui/app/templates/components/role-ssh-edit.hbs b/ui/app/templates/components/role-ssh-edit.hbs index 85eab871d7a1..6a70d1cefe6d 100644 --- a/ui/app/templates/components/role-ssh-edit.hbs +++ b/ui/app/templates/components/role-ssh-edit.hbs @@ -31,7 +31,12 @@ {{#if this.model.canDelete}} - +
    {{/if}} {{#if (eq this.model.keyType "otp")}} diff --git a/ui/app/templates/components/secret-edit-toolbar.hbs b/ui/app/templates/components/secret-edit-toolbar.hbs index 7ee4e2ff541a..b1a5b469c31e 100644 --- a/ui/app/templates/components/secret-edit-toolbar.hbs +++ b/ui/app/templates/components/secret-edit-toolbar.hbs @@ -20,14 +20,14 @@ {{#if (and (eq @mode "show") @model.canDelete)}} - Delete - + />
    {{/if}} {{#if (and (eq @mode "show") @canUpdateSecret)}} diff --git a/ui/app/templates/components/transform-role-edit.hbs b/ui/app/templates/components/transform-role-edit.hbs index 01e849b86894..d9ec6744b63d 100644 --- a/ui/app/templates/components/transform-role-edit.hbs +++ b/ui/app/templates/components/transform-role-edit.hbs @@ -33,7 +33,8 @@ {{#if this.capabilities.canDelete}} {{#if (and @key.canDelete @capabilities.canDelete)}} - + {{/if}} \ No newline at end of file diff --git a/ui/app/templates/components/transit-key-actions.hbs b/ui/app/templates/components/transit-key-actions.hbs index c70e0a726211..3a845ca9bc69 100644 --- a/ui/app/templates/components/transit-key-actions.hbs +++ b/ui/app/templates/components/transit-key-actions.hbs @@ -7,16 +7,15 @@ {{#if this.key.canRotate}} - Rotate encryption key - + /> {{/if}} {{else}} From de38317b1cb54a8ca27270009d0c18e44610eecb Mon Sep 17 00:00:00 2001 From: "clairebontempo@gmail.com" Date: Wed, 15 Nov 2023 20:37:32 -0800 Subject: [PATCH 19/42] add period for angel --- .../templates/components/keymgmt/provider-edit.hbs | 1 + .../templates/vault/cluster/access/leases/list.hbs | 14 +++++++------- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/ui/app/templates/components/keymgmt/provider-edit.hbs b/ui/app/templates/components/keymgmt/provider-edit.hbs index 38884ad2666e..dd3cff522d67 100644 --- a/ui/app/templates/components/keymgmt/provider-edit.hbs +++ b/ui/app/templates/components/keymgmt/provider-edit.hbs @@ -52,6 +52,7 @@ {{/if}} @@ -70,12 +70,12 @@ {{#if (and this.capabilities.revokePrefix.canUpdate (not this.confirmingForceRevoke))}} {{/if}} From 65917e42818a8f2caa73579e37dd8d660c86ce0c Mon Sep 17 00:00:00 2001 From: "clairebontempo@gmail.com" Date: Wed, 15 Nov 2023 20:47:30 -0800 Subject: [PATCH 20/42] vault cluster items --- ui/app/templates/vault/cluster/access/leases/show.hbs | 8 ++++---- .../vault/cluster/access/mfa/methods/method/index.hbs | 5 +++-- .../access/oidc/assignments/assignment/details.hbs | 4 ++-- .../cluster/access/oidc/clients/client/details.hbs | 4 ++-- .../vault/cluster/access/oidc/keys/key/details.hbs | 10 +++++----- .../cluster/access/oidc/providers/provider/details.hbs | 4 ++-- .../vault/cluster/access/oidc/scopes/scope/details.hbs | 4 ++-- ui/app/templates/vault/cluster/policy/edit.hbs | 8 +++++--- 8 files changed, 25 insertions(+), 22 deletions(-) diff --git a/ui/app/templates/vault/cluster/access/leases/show.hbs b/ui/app/templates/vault/cluster/access/leases/show.hbs index 8a26c80bc9be..1ba691170150 100644 --- a/ui/app/templates/vault/cluster/access/leases/show.hbs +++ b/ui/app/templates/vault/cluster/access/leases/show.hbs @@ -27,12 +27,12 @@
    diff --git a/ui/app/templates/vault/cluster/access/mfa/methods/method/index.hbs b/ui/app/templates/vault/cluster/access/mfa/methods/method/index.hbs index 1fbd2eb49335..7ba5c7e2b96e 100644 --- a/ui/app/templates/vault/cluster/access/mfa/methods/method/index.hbs +++ b/ui/app/templates/vault/cluster/access/mfa/methods/method/index.hbs @@ -45,11 +45,12 @@
    diff --git a/ui/app/templates/vault/cluster/access/oidc/clients/client/details.hbs b/ui/app/templates/vault/cluster/access/oidc/clients/client/details.hbs index c2d8b8c21ff2..5452016f0792 100644 --- a/ui/app/templates/vault/cluster/access/oidc/clients/client/details.hbs +++ b/ui/app/templates/vault/cluster/access/oidc/clients/client/details.hbs @@ -9,11 +9,11 @@
    {{/if}} diff --git a/ui/app/templates/vault/cluster/access/oidc/keys/key/details.hbs b/ui/app/templates/vault/cluster/access/oidc/keys/key/details.hbs index 00034ab27e08..ac1a8f01b8c3 100644 --- a/ui/app/templates/vault/cluster/access/oidc/keys/key/details.hbs +++ b/ui/app/templates/vault/cluster/access/oidc/keys/key/details.hbs @@ -12,11 +12,11 @@ @buttonText="Delete key" data-test-oidc-key-delete @disabled={{eq this.model.name "default"}} - @buttonClasses="toolbar-link" + class="toolbar-button" + @buttonColor="secondary" @onConfirmAction={{this.delete}} @confirmTitle="Delete key?" @confirmMessage="This key will be permanently deleted. You will not be able to recover it." - @confirmButtonText="Delete" /> {{#if (eq this.model.name "default")}} @@ -33,12 +33,12 @@ {{/if}} diff --git a/ui/app/templates/vault/cluster/access/oidc/providers/provider/details.hbs b/ui/app/templates/vault/cluster/access/oidc/providers/provider/details.hbs index 3f59472f7ba1..084ad6e81a9c 100644 --- a/ui/app/templates/vault/cluster/access/oidc/providers/provider/details.hbs +++ b/ui/app/templates/vault/cluster/access/oidc/providers/provider/details.hbs @@ -12,11 +12,11 @@ data-test-oidc-provider-delete @buttonText="Delete provider" @disabled={{eq this.model.name "default"}} - @buttonClasses="toolbar-link" + class="toolbar-button" + @buttonColor="secondary" @onConfirmAction={{this.delete}} @confirmTitle="Delete provider?" @confirmMessage="This provider will be permanently deleted. You will need to re-create it to use it again." - @confirmButtonText="Delete" /> {{#if (eq this.model.name "default")}} diff --git a/ui/app/templates/vault/cluster/access/oidc/scopes/scope/details.hbs b/ui/app/templates/vault/cluster/access/oidc/scopes/scope/details.hbs index 41c476c1f782..2ab49a2f45bf 100644 --- a/ui/app/templates/vault/cluster/access/oidc/scopes/scope/details.hbs +++ b/ui/app/templates/vault/cluster/access/oidc/scopes/scope/details.hbs @@ -39,11 +39,11 @@
    {{/if}} diff --git a/ui/app/templates/vault/cluster/policy/edit.hbs b/ui/app/templates/vault/cluster/policy/edit.hbs index 6a828ba34393..248d670bb5c2 100644 --- a/ui/app/templates/vault/cluster/policy/edit.hbs +++ b/ui/app/templates/vault/cluster/policy/edit.hbs @@ -31,10 +31,12 @@ {{#if (and (not-eq this.model.id "default") this.capabilities.canDelete)}}
    {{/if}} From 89ab510ef69711dc5723c769f92eed173f9e6e94 Mon Sep 17 00:00:00 2001 From: "clairebontempo@gmail.com" Date: Wed, 15 Nov 2023 20:49:31 -0800 Subject: [PATCH 21/42] add button text assertion --- ui/lib/core/addon/components/confirm-action.js | 1 + 1 file changed, 1 insertion(+) diff --git a/ui/lib/core/addon/components/confirm-action.js b/ui/lib/core/addon/components/confirm-action.js index 98649c7fb322..a3002487914b 100644 --- a/ui/lib/core/addon/components/confirm-action.js +++ b/ui/lib/core/addon/components/confirm-action.js @@ -44,6 +44,7 @@ export default class ConfirmActionComponent extends Component { ' component expects @onConfirmAction arg to be a function', typeof this.args.onConfirmAction === 'function' ); + assert(`@buttonText is required for ConfirmAction components`, this.args.buttonText); } get confirmMessage() { From 3210bf452696baf6de8e9c51690d3fa886a55100 Mon Sep 17 00:00:00 2001 From: "clairebontempo@gmail.com" Date: Wed, 15 Nov 2023 20:55:15 -0800 Subject: [PATCH 22/42] remaining instances --- .../kmip/addon/templates/credentials/show.hbs | 5 ++--- ui/lib/kmip/addon/templates/role.hbs | 6 +++--- .../addon/components/page/role/details.hbs | 3 ++- .../addon/components/page/configuration.hbs | 10 +++++----- .../addon/components/page/library/details.hbs | 10 +++++++--- .../addon/components/page/role/details.hbs | 20 +++++++++++-------- .../page/pki-certificate-details.hbs | 4 ++-- .../addon/components/page/pki-key-details.hbs | 5 +++-- .../components/page/pki-role-details.hbs | 5 +++-- .../templates/mode/secondaries/index.hbs | 6 +++--- .../templates/mode/secondaries/revoke.hbs | 3 --- 11 files changed, 42 insertions(+), 35 deletions(-) diff --git a/ui/lib/kmip/addon/templates/credentials/show.hbs b/ui/lib/kmip/addon/templates/credentials/show.hbs index c8b7d021449b..2688857e76e2 100644 --- a/ui/lib/kmip/addon/templates/credentials/show.hbs +++ b/ui/lib/kmip/addon/templates/credentials/show.hbs @@ -18,12 +18,11 @@ {{#if this.model.deletePath.canDelete}}
    {{/if}} diff --git a/ui/lib/kmip/addon/templates/role.hbs b/ui/lib/kmip/addon/templates/role.hbs index 48462f73693a..81b1cacdba24 100644 --- a/ui/lib/kmip/addon/templates/role.hbs +++ b/ui/lib/kmip/addon/templates/role.hbs @@ -9,10 +9,10 @@ {{#if this.model.updatePath.canUpdate}}
    {{/if}} diff --git a/ui/lib/kubernetes/addon/components/page/role/details.hbs b/ui/lib/kubernetes/addon/components/page/role/details.hbs index 0ea66a6361c3..bca262ab230e 100644 --- a/ui/lib/kubernetes/addon/components/page/role/details.hbs +++ b/ui/lib/kubernetes/addon/components/page/role/details.hbs @@ -19,7 +19,8 @@ {{#if @model.canDelete}} diff --git a/ui/lib/ldap/addon/components/page/configuration.hbs b/ui/lib/ldap/addon/components/page/configuration.hbs index 685d8317baee..0d18a7e20698 100644 --- a/ui/lib/ldap/addon/components/page/configuration.hbs +++ b/ui/lib/ldap/addon/components/page/configuration.hbs @@ -7,16 +7,16 @@ <:toolbarActions> {{#if @configModel}} - Rotate root - + /> {{/if}} {{if @configModel "Edit configuration" "Configure LDAP"}} diff --git a/ui/lib/ldap/addon/components/page/library/details.hbs b/ui/lib/ldap/addon/components/page/library/details.hbs index fd47468eac25..3cab5f8ac137 100644 --- a/ui/lib/ldap/addon/components/page/library/details.hbs +++ b/ui/lib/ldap/addon/components/page/library/details.hbs @@ -26,9 +26,13 @@ {{#if @model.canDelete}} - - Delete library - + {{#if @model.canEdit}}
    {{/if}} diff --git a/ui/lib/ldap/addon/components/page/role/details.hbs b/ui/lib/ldap/addon/components/page/role/details.hbs index 520b6ff3ec3d..95b620d76acf 100644 --- a/ui/lib/ldap/addon/components/page/role/details.hbs +++ b/ui/lib/ldap/addon/components/page/role/details.hbs @@ -17,9 +17,13 @@ {{#if @model.canDelete}} - - Delete role - +
    {{/if}} {{#if @model.canReadCreds}} @@ -29,16 +33,16 @@ {{/if}} {{#if @model.canRotateStaticCreds}} - Rotate credentials - + /> {{/if}} {{#if @model.canEdit}} diff --git a/ui/lib/pki/addon/components/page/pki-certificate-details.hbs b/ui/lib/pki/addon/components/page/pki-certificate-details.hbs index 4c506958e7ec..174a9fa992c3 100644 --- a/ui/lib/pki/addon/components/page/pki-certificate-details.hbs +++ b/ui/lib/pki/addon/components/page/pki-certificate-details.hbs @@ -12,10 +12,10 @@ {{#if @model.canRevoke}} {{/if}} diff --git a/ui/lib/pki/addon/components/page/pki-key-details.hbs b/ui/lib/pki/addon/components/page/pki-key-details.hbs index 06229f67045b..211539b5c54f 100644 --- a/ui/lib/pki/addon/components/page/pki-key-details.hbs +++ b/ui/lib/pki/addon/components/page/pki-key-details.hbs @@ -7,10 +7,11 @@ {{#if @canDelete}}
    diff --git a/ui/lib/pki/addon/components/page/pki-role-details.hbs b/ui/lib/pki/addon/components/page/pki-role-details.hbs index fe83c3e9ff17..28feede76481 100644 --- a/ui/lib/pki/addon/components/page/pki-role-details.hbs +++ b/ui/lib/pki/addon/components/page/pki-role-details.hbs @@ -7,10 +7,11 @@ {{#if @role.canDelete}}
    diff --git a/ui/lib/replication/addon/templates/mode/secondaries/index.hbs b/ui/lib/replication/addon/templates/mode/secondaries/index.hbs index 7485e46b6245..256531c0bd97 100644 --- a/ui/lib/replication/addon/templates/mode/secondaries/index.hbs +++ b/ui/lib/replication/addon/templates/mode/secondaries/index.hbs @@ -47,11 +47,11 @@
  • diff --git a/ui/lib/replication/addon/templates/mode/secondaries/revoke.hbs b/ui/lib/replication/addon/templates/mode/secondaries/revoke.hbs index 72ca46f2349d..a33c8b8bba31 100644 --- a/ui/lib/replication/addon/templates/mode/secondaries/revoke.hbs +++ b/ui/lib/replication/addon/templates/mode/secondaries/revoke.hbs @@ -24,13 +24,10 @@
    From 6b9ed1652aa88ca61627c836d2fb74575e9aeb4c Mon Sep 17 00:00:00 2001 From: "clairebontempo@gmail.com" Date: Wed, 15 Nov 2023 21:05:11 -0800 Subject: [PATCH 23/42] remove arg for passing confirm text --- ui/app/components/seal-action.hbs | 1 - ui/app/templates/components/database-connection.hbs | 2 -- ui/app/templates/components/database-role-edit.hbs | 1 - ui/app/templates/components/keymgmt/key-edit.hbs | 2 -- ui/app/templates/components/transform-role-edit.hbs | 1 - ui/app/templates/components/transit-key-actions.hbs | 1 - ui/lib/core/addon/components/confirm-action.hbs | 2 +- ui/lib/core/addon/components/confirm-action.js | 1 - ui/tests/integration/components/confirm-action-test.js | 1 - 9 files changed, 1 insertion(+), 11 deletions(-) diff --git a/ui/app/components/seal-action.hbs b/ui/app/components/seal-action.hbs index 8b31becbeca1..b01e6b518422 100644 --- a/ui/app/components/seal-action.hbs +++ b/ui/app/components/seal-action.hbs @@ -24,7 +24,6 @@ @buttonText="Seal" @confirmTitle="Seal this cluster?" @confirmMessage="You will not be able to read or write any data until the cluster is unsealed again." - @confirmButtonText="Seal" @onConfirmAction={{this.handleSeal}} data-test-seal /> diff --git a/ui/app/templates/components/database-connection.hbs b/ui/app/templates/components/database-connection.hbs index a3d64b539415..fef202ec9e64 100644 --- a/ui/app/templates/components/database-connection.hbs +++ b/ui/app/templates/components/database-connection.hbs @@ -41,7 +41,6 @@ @onConfirmAction={{action "reset"}} @confirmTitle="Reset connection?" @confirmMessage="This will close the connection and its underlying plugin and restart it with the configuration stored in the barrier." - @confirmButtonText="Reset" data-test-database-connection-reset /> {{/if}} @@ -57,7 +56,6 @@ @onConfirmAction={{this.rotate}} @confirmTitle="Rotate credentials?" @confirmMessage='This will rotate the "root" user credentials stored for the database connection. The password will not be accessible once rotated.' - @confirmButtonText="Rotate" @modalColor="warning" data-test-database-connection-rotate /> diff --git a/ui/app/templates/components/database-role-edit.hbs b/ui/app/templates/components/database-role-edit.hbs index 69e87123a174..8e63faebe02d 100644 --- a/ui/app/templates/components/database-role-edit.hbs +++ b/ui/app/templates/components/database-role-edit.hbs @@ -31,7 +31,6 @@ @onConfirmAction={{action "delete"}} @confirmTitle="Delete role?" @confirmMessage="This role will be permanently deleted. You will need to recreate it to use it again." - @confirmButtonText="Delete" data-test-database-role-delete />
    diff --git a/ui/app/templates/components/keymgmt/key-edit.hbs b/ui/app/templates/components/keymgmt/key-edit.hbs index 1dec3e21bf08..7b05249809e5 100644 --- a/ui/app/templates/components/keymgmt/key-edit.hbs +++ b/ui/app/templates/components/keymgmt/key-edit.hbs @@ -81,7 +81,6 @@ @onConfirmAction={{perform this.removeKey}} @confirmTitle="Remove this key?" @confirmMessage="This will remove all versions of the key from the KMS provider. The key will stay in Vault." - @confirmButtonText="Remove" @isRunning={{this.removeKey.isRunning}} data-test-keymgmt-key-remove /> @@ -97,7 +96,6 @@ @onConfirmAction={{perform this.rotateKey}} @confirmTitle="Rotate this key?" @confirmMessage="After rotation, all key actions will default to using the newest version of the key." - @confirmButtonText="Rotate" @color="warning" @isRunning={{this.rotateKey.isRunning}} data-test-keymgmt-key-rotate diff --git a/ui/app/templates/components/transform-role-edit.hbs b/ui/app/templates/components/transform-role-edit.hbs index d9ec6744b63d..5ac7c69253ed 100644 --- a/ui/app/templates/components/transform-role-edit.hbs +++ b/ui/app/templates/components/transform-role-edit.hbs @@ -37,7 +37,6 @@ @buttonColor="secondary" @onConfirmAction={{action "delete"}} @confirmMessage="Deleting this role means that you’ll need to recreate it and reassign any existing transformations to use it again." - @confirmButtonText="Delete" data-test-transformation-role-delete />
    diff --git a/ui/app/templates/components/transit-key-actions.hbs b/ui/app/templates/components/transit-key-actions.hbs index 3a845ca9bc69..be489d67d4ab 100644 --- a/ui/app/templates/components/transit-key-actions.hbs +++ b/ui/app/templates/components/transit-key-actions.hbs @@ -11,7 +11,6 @@ @buttonColor="secondary" @confirmTitle="Rotate this key?" @confirmMessage="After rotation, all key actions will default to using the newest version of the key." - @confirmButtonText="Rotate" @modalColor="warning" @onConfirmAction={{action "doSubmit"}} data-test-transit-key-rotate diff --git a/ui/lib/core/addon/components/confirm-action.hbs b/ui/lib/core/addon/components/confirm-action.hbs index 9b1ef4e799de..1ed41f1bb2c4 100644 --- a/ui/lib/core/addon/components/confirm-action.hbs +++ b/ui/lib/core/addon/components/confirm-action.hbs @@ -41,7 +41,7 @@ disabled={{or @disabled @isRunning}} @icon={{if @isRunning "loading"}} @color={{if (or (not @modalColor) (eq @modalColor "critical")) "critical" "primary"}} - @text={{or @confirmButtonText "Confirm"}} + @text="Confirm" {{on "click" this.onConfirm}} /> diff --git a/ui/lib/core/addon/components/confirm-action.js b/ui/lib/core/addon/components/confirm-action.js index a3002487914b..4d8251da47ba 100644 --- a/ui/lib/core/addon/components/confirm-action.js +++ b/ui/lib/core/addon/components/confirm-action.js @@ -29,7 +29,6 @@ import { tracked } from '@glimmer/tracking'; * @param {String} buttonText - Text for the button that triggers modal to open. * @param {String} [buttonColor] - Color of button that triggers modal. Default is primary, other options are secondary, tertiary, and critical * @param {String} [modalColor=critical] - Styles modal color, if 'critical' confirm button is styled as well. Possible values: critical, warning or neutral - * @param {String} [confirmButtonText=Confirm] - Text for button inside modal that confirms the action * @param {Boolean} [isRunning] - Disables the confirm button if action is still running * @param {Boolean} [disabled] - Disables the modal's confirm button. * diff --git a/ui/tests/integration/components/confirm-action-test.js b/ui/tests/integration/components/confirm-action-test.js index b8cac5a4d9eb..4487c49c3d4f 100644 --- a/ui/tests/integration/components/confirm-action-test.js +++ b/ui/tests/integration/components/confirm-action-test.js @@ -19,7 +19,6 @@ module('Integration | Component | confirm-action', function (hooks) { `); await click('[data-test-confirm-action-trigger="true"]'); From 5b6c0e7e7a236d8afb46520d4992068ecf33ada5 Mon Sep 17 00:00:00 2001 From: "clairebontempo@gmail.com" Date: Thu, 16 Nov 2023 02:09:40 -0600 Subject: [PATCH 24/42] contextual confirm action components --- ui/app/components/sidebar/user-menu.hbs | 143 +++++++++--------- ui/app/styles/components/popup-menu.scss | 1 + .../components/generated-item-list.hbs | 40 ++--- .../components/identity/popup-alias.hbs | 67 ++++---- .../components/raft-storage-overview.hbs | 29 ++-- .../components/secret-list/aws-role-item.hbs | 87 ++++++----- .../templates/components/secret-list/item.hbs | 92 ++++++----- .../components/secret-list/ssh-role-item.hbs | 141 ++++++++--------- .../vault/cluster/access/identity/index.hbs | 112 +++++++------- .../vault/cluster/access/methods.hbs | 50 +++--- .../vault/cluster/access/namespaces/index.hbs | 37 ++--- .../vault/cluster/policies/index.hbs | 84 +++++----- .../vault/cluster/secrets/backends.hbs | 45 +++--- .../addon/templates/credentials/index.hbs | 25 +-- ui/lib/kmip/addon/templates/scope/roles.hbs | 24 +-- ui/lib/kmip/addon/templates/scopes/index.hbs | 27 ++-- .../addon/components/page/roles.hbs | 21 ++- .../ldap/addon/components/page/libraries.hbs | 22 +-- ui/lib/ldap/addon/components/page/roles.hbs | 43 +++--- 19 files changed, 555 insertions(+), 535 deletions(-) diff --git a/ui/app/components/sidebar/user-menu.hbs b/ui/app/components/sidebar/user-menu.hbs index fb49462ab4fa..ee6ac1b60206 100644 --- a/ui/app/components/sidebar/user-menu.hbs +++ b/ui/app/components/sidebar/user-menu.hbs @@ -15,83 +15,80 @@ - - \ No newline at end of file diff --git a/ui/app/styles/components/popup-menu.scss b/ui/app/styles/components/popup-menu.scss index 0c57e3c04ed5..94071a2fae45 100644 --- a/ui/app/styles/components/popup-menu.scss +++ b/ui/app/styles/components/popup-menu.scss @@ -55,6 +55,7 @@ background-color: $ui-gray-050; } div { + margin-left: -$spacing-4; font-size: $size-7; font-weight: $font-weight-semibold; } diff --git a/ui/app/templates/components/generated-item-list.hbs b/ui/app/templates/components/generated-item-list.hbs index ecb9bdf61c54..7bbb6cd06188 100644 --- a/ui/app/templates/components/generated-item-list.hbs +++ b/ui/app/templates/components/generated-item-list.hbs @@ -75,7 +75,7 @@ {{list.item.id}} - +
  • View @@ -88,25 +88,25 @@ {{singularize this.itemType}}
  • -
  • - -
  • +
    {{/if}} diff --git a/ui/app/templates/components/identity/popup-alias.hbs b/ui/app/templates/components/identity/popup-alias.hbs index 78817fb173ce..4b8c10e4bc98 100644 --- a/ui/app/templates/components/identity/popup-alias.hbs +++ b/ui/app/templates/components/identity/popup-alias.hbs @@ -4,41 +4,44 @@ ~}} - - {{#let (get this.params "0") as |item|}} - + {{/let}} \ No newline at end of file diff --git a/ui/app/templates/components/raft-storage-overview.hbs b/ui/app/templates/components/raft-storage-overview.hbs index 011423ec6881..6c7755ae7974 100644 --- a/ui/app/templates/components/raft-storage-overview.hbs +++ b/ui/app/templates/components/raft-storage-overview.hbs @@ -81,22 +81,19 @@ - - - + diff --git a/ui/app/templates/components/secret-list/aws-role-item.hbs b/ui/app/templates/components/secret-list/aws-role-item.hbs index 62ac42976f80..f922797652e9 100644 --- a/ui/app/templates/components/secret-list/aws-role-item.hbs +++ b/ui/app/templates/components/secret-list/aws-role-item.hbs @@ -24,55 +24,58 @@
    - -
    diff --git a/ui/app/templates/components/secret-list/item.hbs b/ui/app/templates/components/secret-list/item.hbs index 548afa8963b7..3001db1f935a 100644 --- a/ui/app/templates/components/secret-list/item.hbs +++ b/ui/app/templates/components/secret-list/item.hbs @@ -31,58 +31,56 @@
    - -
    diff --git a/ui/app/templates/components/secret-list/ssh-role-item.hbs b/ui/app/templates/components/secret-list/ssh-role-item.hbs index 10f654c9973c..e43d0bb047ee 100644 --- a/ui/app/templates/components/secret-list/ssh-role-item.hbs +++ b/ui/app/templates/components/secret-list/ssh-role-item.hbs @@ -37,85 +37,88 @@
    {{#if (eq @backendType "ssh")}} - - {{/if}}
    diff --git a/ui/app/templates/vault/cluster/access/identity/index.hbs b/ui/app/templates/vault/cluster/access/identity/index.hbs index 19b51620ecc5..6f4788859210 100644 --- a/ui/app/templates/vault/cluster/access/identity/index.hbs +++ b/ui/app/templates/vault/cluster/access/identity/index.hbs @@ -33,63 +33,71 @@
    - -
    diff --git a/ui/app/templates/vault/cluster/access/methods.hbs b/ui/app/templates/vault/cluster/access/methods.hbs index a2074297fbb2..55d7a17980b9 100644 --- a/ui/app/templates/vault/cluster/access/methods.hbs +++ b/ui/app/templates/vault/cluster/access/methods.hbs @@ -84,36 +84,34 @@
    - -
    diff --git a/ui/app/templates/vault/cluster/access/namespaces/index.hbs b/ui/app/templates/vault/cluster/access/namespaces/index.hbs index a9d5bf54b3de..27c4610a2e75 100644 --- a/ui/app/templates/vault/cluster/access/namespaces/index.hbs +++ b/ui/app/templates/vault/cluster/access/namespaces/index.hbs @@ -36,7 +36,7 @@ {{list.item.id}} - + {{#let (concat this.currentNamespace (if this.currentNamespace "/") list.item.id) as |targetNamespace|}} {{#if (includes targetNamespace this.accessibleNamespaces)}}
  • @@ -46,23 +46,24 @@
  • {{/if}} {{/let}} -
  • - -
  • +
    {{/if}} diff --git a/ui/app/templates/vault/cluster/policies/index.hbs b/ui/app/templates/vault/cluster/policies/index.hbs index 0aa5c28fafde..e1d180e97ec2 100644 --- a/ui/app/templates/vault/cluster/policies/index.hbs +++ b/ui/app/templates/vault/cluster/policies/index.hbs @@ -92,53 +92,53 @@
    - -
    diff --git a/ui/app/templates/vault/cluster/secrets/backends.hbs b/ui/app/templates/vault/cluster/secrets/backends.hbs index 44dc3e440ecb..698a3d59128b 100644 --- a/ui/app/templates/vault/cluster/secrets/backends.hbs +++ b/ui/app/templates/vault/cluster/secrets/backends.hbs @@ -96,30 +96,27 @@ {{! meatball sandwich menu }}
    - - - +
    diff --git a/ui/lib/kmip/addon/templates/credentials/index.hbs b/ui/lib/kmip/addon/templates/credentials/index.hbs index 86eb6d7fb7f8..f146587027ff 100644 --- a/ui/lib/kmip/addon/templates/credentials/index.hbs +++ b/ui/lib/kmip/addon/templates/credentials/index.hbs @@ -64,21 +64,26 @@ {{list.item.id}} - +
  • View credentials
  • {{#if list.item.deletePath.canDelete}} - - + + + {{else}} + - + {{/if}} {{/if}}
    diff --git a/ui/lib/kmip/addon/templates/scope/roles.hbs b/ui/lib/kmip/addon/templates/scope/roles.hbs index ea9372274074..b152b31c2cad 100644 --- a/ui/lib/kmip/addon/templates/scope/roles.hbs +++ b/ui/lib/kmip/addon/templates/scope/roles.hbs @@ -70,7 +70,7 @@ {{list.item.id}} - +
  • View credentials @@ -89,12 +89,18 @@ {{/if}} {{#if list.item.updatePath.canDelete}} - - + +
  • + {{else}} + - + {{/if}} {{/if}}
    diff --git a/ui/lib/kmip/addon/templates/scopes/index.hbs b/ui/lib/kmip/addon/templates/scopes/index.hbs index f316e159f1bb..e66373ec75c9 100644 --- a/ui/lib/kmip/addon/templates/scopes/index.hbs +++ b/ui/lib/kmip/addon/templates/scopes/index.hbs @@ -59,21 +59,26 @@ {{list.item.id}} - +
  • View scope
  • {{#if list.item.updatePath.canDelete}} - - + + + {{else}} + - + {{/if}} {{/if}}
    diff --git a/ui/lib/kubernetes/addon/components/page/roles.hbs b/ui/lib/kubernetes/addon/components/page/roles.hbs index 826e769fffea..bf82952fafc3 100644 --- a/ui/lib/kubernetes/addon/components/page/roles.hbs +++ b/ui/lib/kubernetes/addon/components/page/roles.hbs @@ -40,7 +40,7 @@ {{role.name}} - + {{#if role.rolesPath.isLoading}}
  • @@ -68,16 +68,15 @@ Edit
  • -
  • - -
  • + {{/if}}
    diff --git a/ui/lib/ldap/addon/components/page/libraries.hbs b/ui/lib/ldap/addon/components/page/libraries.hbs index b98c9b9a803d..f61dc537927f 100644 --- a/ui/lib/ldap/addon/components/page/libraries.hbs +++ b/ui/lib/ldap/addon/components/page/libraries.hbs @@ -46,7 +46,7 @@ {{library.name}} - + {{#if library.libraryPath.isLoading}}
  • @@ -75,16 +75,16 @@
  • {{#if library.canDelete}} -
  • - -
  • + {{/if}} {{/if}}
    diff --git a/ui/lib/ldap/addon/components/page/roles.hbs b/ui/lib/ldap/addon/components/page/roles.hbs index 0c3a35ce5947..6b510868afa2 100644 --- a/ui/lib/ldap/addon/components/page/roles.hbs +++ b/ui/lib/ldap/addon/components/page/roles.hbs @@ -53,7 +53,7 @@ {{role.name}} - + {{#if role.rolePath.isLoading}}
  • @@ -82,17 +82,17 @@
  • {{#if role.canRotateStaticCreds}} -
  • - -
  • + {{/if}}
  • {{#if role.canDelete}} -
  • - -
  • + {{/if}} {{/if}}
    From 16fbe1aec1fc89bec306f2757114c584ff8e8fd7 Mon Sep 17 00:00:00 2001 From: "clairebontempo@gmail.com" Date: Thu, 16 Nov 2023 02:10:12 -0600 Subject: [PATCH 25/42] delete old components --- ui/app/styles/components/confirm.scss | 139 ------------------ ui/app/styles/core.scss | 1 - ui/lib/core/addon/components/confirm.js | 72 --------- .../core/addon/components/confirm/message.js | 59 -------- .../addon/templates/components/confirm.hbs | 23 --- .../templates/components/confirm/message.hbs | 40 ----- .../components/list-item/popup-menu.hbs | 12 +- ui/lib/core/app/components/confirm.js | 6 - ui/lib/core/app/components/confirm/message.js | 6 - .../integration/components/confirm-test.js | 107 -------------- 10 files changed, 5 insertions(+), 460 deletions(-) delete mode 100644 ui/app/styles/components/confirm.scss delete mode 100644 ui/lib/core/addon/components/confirm.js delete mode 100644 ui/lib/core/addon/components/confirm/message.js delete mode 100644 ui/lib/core/addon/templates/components/confirm.hbs delete mode 100644 ui/lib/core/addon/templates/components/confirm/message.hbs delete mode 100644 ui/lib/core/app/components/confirm.js delete mode 100644 ui/lib/core/app/components/confirm/message.js delete mode 100644 ui/tests/integration/components/confirm-test.js diff --git a/ui/app/styles/components/confirm.scss b/ui/app/styles/components/confirm.scss deleted file mode 100644 index 65f56a6291a0..000000000000 --- a/ui/app/styles/components/confirm.scss +++ /dev/null @@ -1,139 +0,0 @@ -/** - * Copyright (c) HashiCorp, Inc. - * SPDX-License-Identifier: BUSL-1.1 - */ - -.confirm-wrapper { - position: relative; - overflow: hidden; - border-radius: $radius; - box-shadow: $box-shadow, $box-shadow-middle; -} - -.confirm { - transition: transform $speed; - padding-top: 2px; -} - -.show-confirm { - transform: translateX(-100%); - transition: transform $speed; -} - -.confirm.show-confirm { - visibility: hidden; -} - -.confirm-overlay { - position: absolute; - background-color: white; - top: 0; - left: 100%; - width: 100%; -} - -.confirm, -.confirm-overlay { - button.link, - a { - background-color: $white; - color: $grey-darkest; - - &:hover { - background-color: $ui-gray-050; - color: $ui-gray-900; - } - - &.is-active { - background-color: $blue-500; - color: $blue; - } - - &.is-destroy { - color: $red; - - &:hover { - background-color: $red; - color: $white; - } - } - - &.disabled { - opacity: 0.5; - - &:hover { - background: transparent; - cursor: default; - } - } - } -} - -.confirm-action span .button { - display: block; - margin: 0.25rem auto; - width: 95%; -} - -.confirm-action > span { - @include from($mobile) { - align-items: center; - display: flex; - } - - * { - margin-left: $spacing-12; - } - - .confirm-action-text:not(.is-block) { - text-align: right; - - @include until($mobile) { - display: block; - margin-bottom: $spacing-12; - text-align: left; - } - } - .confirm-action-text.is-block { - text-align: left; - } -} - -.confirm-action-message { - margin: 0; - - .message { - border: 0; - font-size: $size-8; - line-height: 1.33; - margin: 0; - } - - .message-title { - font-size: 1rem; - } - - .hs-icon { - color: $yellow; - } - - p { - font-weight: $font-weight-semibold; - margin-left: $spacing-24; - padding-left: $spacing-4; - padding-top: 0; - } - - .confirm-action-options { - border-top: $light-border; - display: flex; - padding: $spacing-4; - - .link { - flex: 1; - text-align: center; - width: auto; - padding: $spacing-8; - } - } -} diff --git a/ui/app/styles/core.scss b/ui/app/styles/core.scss index e0fced4b6fba..92d50091f681 100644 --- a/ui/app/styles/core.scss +++ b/ui/app/styles/core.scss @@ -61,7 +61,6 @@ @import './components/calendar-widget'; @import './components/cluster-banners'; @import './components/codemirror'; -@import './components/confirm'; @import './components/console-ui-panel'; @import './components/control-group'; @import './components/doc-link'; diff --git a/ui/lib/core/addon/components/confirm.js b/ui/lib/core/addon/components/confirm.js deleted file mode 100644 index 9d621f60f83b..000000000000 --- a/ui/lib/core/addon/components/confirm.js +++ /dev/null @@ -1,72 +0,0 @@ -/** - * Copyright (c) HashiCorp, Inc. - * SPDX-License-Identifier: BUSL-1.1 - */ - -import Component from '@ember/component'; -import { computed } from '@ember/object'; -import layout from '../templates/components/confirm'; -import { next } from '@ember/runloop'; - -/** - * @module Confirm - * `Confirm` components prevent users from performing actions they do not intend to by showing a confirmation message as an overlay. This is a contextual component that should always be rendered with a `Message` which triggers the message. - * - * @example - * ```js - *
    - * - * - * - *
    - * ``` - */ - -export default Component.extend({ - layout, - openTrigger: null, - height: 0, - focusTrigger: null, - wormholeReference: null, - wormholeId: computed('elementId', function () { - return `confirm-${this.elementId}`; - }), - didInsertElement() { - this._super(...arguments); - this.set('wormholeReference', this.element.querySelector(`#${this.wormholeId}`)); - }, - didRender() { - this._super(...arguments); - this.updateHeight(); - }, - updateHeight: function () { - const height = this.openTrigger - ? this.element.querySelector('.confirm-overlay').clientHeight - : this.element.querySelector('.confirm').clientHeight; - this.element.querySelector('.confirm-wrapper').style = `height: ${height}px;`; - }, - actions: { - onTrigger: function (itemId, e) { - this.set('openTrigger', itemId); - - // store a reference to the trigger so we can focus the element - // after clicking cancel - this.set('focusTrigger', e.target); - this.updateHeight(); - }, - onCancel: function () { - this.set('openTrigger', ''); - this.updateHeight(); - - next(() => { - this.focusTrigger.focus(); - this.set('focusTrigger', null); - }); - }, - }, -}); diff --git a/ui/lib/core/addon/components/confirm/message.js b/ui/lib/core/addon/components/confirm/message.js deleted file mode 100644 index 02cbe08b6de3..000000000000 --- a/ui/lib/core/addon/components/confirm/message.js +++ /dev/null @@ -1,59 +0,0 @@ -/** - * Copyright (c) HashiCorp, Inc. - * SPDX-License-Identifier: BUSL-1.1 - */ - -import Component from '@ember/component'; -import { computed } from '@ember/object'; -import layout from '../../templates/components/confirm/message'; - -/** - * @module Message - * `Message` components trigger and display a confirmation message. They should only be used within a `Confirm` component. - * - * @example - * ```js - *
    - * - * - * - *
    - * ``` - * - * @property id=null {ID} - A unique identifier used to bind a trigger to a confirmation message. - * @property onConfirm=null {Func} - The action to take when the user clicks the confirm button. - * @property [triggerText='Delete'] {String} - The text on the trigger button. - * @property [title='Delete this?'] {String} - The header text to display in the confirmation message. - * @property [message='You will not be able to recover it later.'] {String} - The message to display above the confirm and cancel buttons. - * @property [confirmButtonText='Delete'] {String} - The text to display on the confirm button. - * @property [cancelButtonText='Cancel'] {String} - The text to display on the cancel button. - */ - -export default Component.extend({ - layout, - tagName: '', - renderedTrigger: null, - id: null, - onCancel() {}, - onConfirm() {}, - resetTrigger() {}, - title: 'Delete this?', - message: 'You will not be able to recover it later.', - triggerText: 'Delete', - confirmButtonText: 'Delete', - cancelButtonText: 'Cancel', - showConfirm: computed('id', 'renderedTrigger', function () { - return this.renderedTrigger === this.id; - }), - actions: { - onConfirm() { - this.onConfirm(); - this.resetTrigger(); - }, - }, -}); diff --git a/ui/lib/core/addon/templates/components/confirm.hbs b/ui/lib/core/addon/templates/components/confirm.hbs deleted file mode 100644 index bf6a32d698ac..000000000000 --- a/ui/lib/core/addon/templates/components/confirm.hbs +++ /dev/null @@ -1,23 +0,0 @@ -{{! - Copyright (c) HashiCorp, Inc. - SPDX-License-Identifier: BUSL-1.1 -~}} - -
    -
    - {{yield - (hash - Message=(component - "confirm/message" - renderedTrigger=(readonly this.openTrigger) - wormholeReference=this.wormholeReference - onCancel=(action "onCancel") - onTrigger=(action "onTrigger") - resetTrigger=(action (mut this.openTrigger) "") - ) - ) - }} -
    -
    -
    -
    \ No newline at end of file diff --git a/ui/lib/core/addon/templates/components/confirm/message.hbs b/ui/lib/core/addon/templates/components/confirm/message.hbs deleted file mode 100644 index f3c9e5c39a4b..000000000000 --- a/ui/lib/core/addon/templates/components/confirm/message.hbs +++ /dev/null @@ -1,40 +0,0 @@ -{{! - Copyright (c) HashiCorp, Inc. - SPDX-License-Identifier: BUSL-1.1 -~}} - -{{#if this.showConfirm}} - {{#maybe-in-element this.wormholeReference false}} -
    -
    -
    - - {{this.title}} -
    -

    - {{this.message}} -

    -
    -
    - {{! TODO Hds::Button replacement - skipping because modal will replace this confirm inline-popup menu }} - - -
    -
    - {{/maybe-in-element}} -{{/if}} -{{! TODO Hds::Button replacement - skipping because modal will replace this confirm inline-popup menu }} - \ No newline at end of file diff --git a/ui/lib/core/addon/templates/components/list-item/popup-menu.hbs b/ui/lib/core/addon/templates/components/list-item/popup-menu.hbs index 22e52da8a083..91188fa5088c 100644 --- a/ui/lib/core/addon/templates/components/list-item/popup-menu.hbs +++ b/ui/lib/core/addon/templates/components/list-item/popup-menu.hbs @@ -5,13 +5,11 @@ {{#if this.hasMenu}} - - - + {{else}} {{yield this.item}} diff --git a/ui/lib/core/app/components/confirm.js b/ui/lib/core/app/components/confirm.js deleted file mode 100644 index 70b4d0ad4e6a..000000000000 --- a/ui/lib/core/app/components/confirm.js +++ /dev/null @@ -1,6 +0,0 @@ -/** - * Copyright (c) HashiCorp, Inc. - * SPDX-License-Identifier: BUSL-1.1 - */ - -export { default } from 'core/components/confirm'; diff --git a/ui/lib/core/app/components/confirm/message.js b/ui/lib/core/app/components/confirm/message.js deleted file mode 100644 index b8cd364e7c5c..000000000000 --- a/ui/lib/core/app/components/confirm/message.js +++ /dev/null @@ -1,6 +0,0 @@ -/** - * Copyright (c) HashiCorp, Inc. - * SPDX-License-Identifier: BUSL-1.1 - */ - -export { default } from 'core/components/confirm/message'; diff --git a/ui/tests/integration/components/confirm-test.js b/ui/tests/integration/components/confirm-test.js deleted file mode 100644 index f5406c0f7e7d..000000000000 --- a/ui/tests/integration/components/confirm-test.js +++ /dev/null @@ -1,107 +0,0 @@ -/** - * Copyright (c) HashiCorp, Inc. - * SPDX-License-Identifier: BUSL-1.1 - */ - -import { module, test } from 'qunit'; -import { setupRenderingTest } from 'ember-qunit'; -import { render, click } from '@ember/test-helpers'; -import hbs from 'htmlbars-inline-precompile'; -import sinon from 'sinon'; - -module('Integration | Component | Confirm', function (hooks) { - setupRenderingTest(hooks); - - hooks.beforeEach(function () { - this.set('id', 'foo'); - this.set('title', 'Are you sure?'); - this.set('message', 'You will not be able to recover this item later.'); - this.set('triggerText', 'Click me!'); - this.set('onConfirm', sinon.spy()); - }); - - test('it renders', async function (assert) { - await render(hbs` - - - - `); - - assert.dom('.confirm-wrapper').exists(); - assert.dom('.confirm').containsText(this.triggerText); - }); - - test('does not show the confirmation message until it is triggered', async function (assert) { - await render(hbs` - - - - `); - assert.dom('.confirm-overlay').doesNotContainText(this.message); - - await click('[data-test-confirm-action-trigger]'); - - assert.dom('.confirm-overlay').containsText(this.title); - assert.dom('.confirm-overlay').containsText(this.message); - }); - - test('it calls onConfirm when the confirm button is clicked', async function (assert) { - await render(hbs` - - - - `); - await click('[data-test-confirm-action-trigger]'); - await click('[data-test-confirm-button=true]'); - - assert.ok(this.onConfirm.calledOnce); - }); - - test('it shows only the active triggers message', async function (assert) { - await render(hbs` - - - - - `); - - await click(`[data-test-confirm-action-trigger=${this.id}]`); - assert.dom('.confirm-overlay').containsText(this.title); - assert.dom('.confirm-overlay').containsText(this.message); - - await click('[data-test-confirm-cancel-button]'); - - await click("[data-test-confirm-action-trigger='bar']"); - assert.dom('.confirm-overlay').containsText('Wow'); - assert.dom('.confirm-overlay').containsText('Bazinga!'); - }); -}); From 69f2952ca24a04ce1991a7f3cc2e01c261f5509e Mon Sep 17 00:00:00 2001 From: "clairebontempo@gmail.com" Date: Thu, 16 Nov 2023 02:16:45 -0600 Subject: [PATCH 26/42] update docs --- .../core/addon/components/confirm-action.js | 35 +++++++++++++------ 1 file changed, 25 insertions(+), 10 deletions(-) diff --git a/ui/lib/core/addon/components/confirm-action.js b/ui/lib/core/addon/components/confirm-action.js index 4d8251da47ba..43cb1ef53a69 100644 --- a/ui/lib/core/addon/components/confirm-action.js +++ b/ui/lib/core/addon/components/confirm-action.js @@ -12,23 +12,38 @@ import { tracked } from '@glimmer/tracking'; * @module ConfirmAction * ConfirmAction is a button that opens a modal containing a confirmation message with confirm or cancel action. * Splattributes are spread to the button element to apply styling directly without adding extra args. - * The default button is the same as Hds::Button which is primary blue + * The default button is the same as Hds::Button which is primary blue. + * * * @example - * ```js - * { console.log('Action!') } }} - * @confirmMessage="Are you sure you want to delete this config?" - * /> +// in dropdown + + + // in toolbar + * ``` * * @param {Function} onConfirmAction - The action to take upon confirming. * @param {String} [confirmTitle=Are you sure?] - The title to display in the confirmation modal. * @param {String} [confirmMessage=You will not be able to recover it later.] - The message to display when confirming. - * @param {String} buttonText - Text for the button that triggers modal to open. - * @param {String} [buttonColor] - Color of button that triggers modal. Default is primary, other options are secondary, tertiary, and critical - * @param {String} [modalColor=critical] - Styles modal color, if 'critical' confirm button is styled as well. Possible values: critical, warning or neutral + * @param {Boolean} isInDropdown - If true styles for dropdowns by rendering inside `
  • ` elements via ` Date: Thu, 16 Nov 2023 10:44:51 -0600 Subject: [PATCH 27/42] ammend dropdown loading states, add getter for confirm button color --- .../core/addon/components/confirm-action.hbs | 2 +- .../core/addon/components/confirm-action.js | 5 ++ ui/lib/core/addon/components/menu-loader.hbs | 12 ----- ui/lib/core/app/components/menu-loader.js | 6 --- .../addon/templates/credentials/index.hbs | 48 +++++++++--------- ui/lib/kmip/addon/templates/scope/roles.hbs | 18 +++---- ui/lib/kmip/addon/templates/scopes/index.hbs | 50 +++++++++---------- 7 files changed, 61 insertions(+), 80 deletions(-) delete mode 100644 ui/lib/core/addon/components/menu-loader.hbs delete mode 100644 ui/lib/core/app/components/menu-loader.js diff --git a/ui/lib/core/addon/components/confirm-action.hbs b/ui/lib/core/addon/components/confirm-action.hbs index 1ed41f1bb2c4..cc490bd22a26 100644 --- a/ui/lib/core/addon/components/confirm-action.hbs +++ b/ui/lib/core/addon/components/confirm-action.hbs @@ -40,7 +40,7 @@ data-test-confirm-button disabled={{or @disabled @isRunning}} @icon={{if @isRunning "loading"}} - @color={{if (or (not @modalColor) (eq @modalColor "critical")) "critical" "primary"}} + @color={{this.confirmButtonColor}} @text="Confirm" {{on "click" this.onConfirm}} /> diff --git a/ui/lib/core/addon/components/confirm-action.js b/ui/lib/core/addon/components/confirm-action.js index 43cb1ef53a69..3fe030cd44a4 100644 --- a/ui/lib/core/addon/components/confirm-action.js +++ b/ui/lib/core/addon/components/confirm-action.js @@ -65,6 +65,11 @@ export default class ConfirmActionComponent extends Component { return this.args.confirmMessage || 'You will not be able to recover it later.'; } + get confirmButtonColor() { + // only change from default of primary if modal is 'critical' + return this.args.modalColor === 'critical' ? 'critical' : 'primary'; + } + @action async onConfirm() { await this.args.onConfirmAction(); diff --git a/ui/lib/core/addon/components/menu-loader.hbs b/ui/lib/core/addon/components/menu-loader.hbs deleted file mode 100644 index 32f65c3c811a..000000000000 --- a/ui/lib/core/addon/components/menu-loader.hbs +++ /dev/null @@ -1,12 +0,0 @@ -{{! - Copyright (c) HashiCorp, Inc. - SPDX-License-Identifier: BUSL-1.1 -~}} - -
  • - {{#if @loadingParam}} - - {{else}} - {{yield}} - {{/if}} -
  • \ No newline at end of file diff --git a/ui/lib/core/app/components/menu-loader.js b/ui/lib/core/app/components/menu-loader.js deleted file mode 100644 index bf5584d7e354..000000000000 --- a/ui/lib/core/app/components/menu-loader.js +++ /dev/null @@ -1,6 +0,0 @@ -/** - * Copyright (c) HashiCorp, Inc. - * SPDX-License-Identifier: BUSL-1.1 - */ - -export { default } from 'core/components/menu-loader'; diff --git a/ui/lib/kmip/addon/templates/credentials/index.hbs b/ui/lib/kmip/addon/templates/credentials/index.hbs index f146587027ff..2b0d13f7b2a5 100644 --- a/ui/lib/kmip/addon/templates/credentials/index.hbs +++ b/ui/lib/kmip/addon/templates/credentials/index.hbs @@ -70,31 +70,29 @@ View credentials - {{#if list.item.deletePath.canDelete}} - {{#if list.item.deletePath.isPending}} -
  • - -
  • - {{else}} - - {{/if}} + {{#if list.item.deletePath.isPending}} +
  • + +
  • + {{else if list.item.deletePath.canDelete}} + {{/if}}
    diff --git a/ui/lib/kmip/addon/templates/scope/roles.hbs b/ui/lib/kmip/addon/templates/scope/roles.hbs index b152b31c2cad..8d087eb806dc 100644 --- a/ui/lib/kmip/addon/templates/scope/roles.hbs +++ b/ui/lib/kmip/addon/templates/scope/roles.hbs @@ -81,19 +81,17 @@ View role - {{#if list.item.updatePath.canUpdate}} - + {{#if list.item.updatePath.isPending}} +
  • + +
  • + {{else}} + {{#if list.item.updatePath.canUpdate}} Edit role -
    - {{/if}} - {{#if list.item.updatePath.canDelete}} - {{#if list.item.updatePath.isPending}} -
  • - -
  • - {{else}} + {{/if}} + {{#if list.item.updatePath.canDelete}} - {{#if list.item.updatePath.canDelete}} - {{#if list.item.updatePath.isPending}} -
  • - -
  • - {{else}} - - {{/if}} + {{#if list.item.updatePath.isPending}} +
  • + +
  • + {{else if list.item.updatePath.canDelete}} + {{/if}}
    From ff4fcc9ec6c4325a3e4828cd97ea4e46dde401fd Mon Sep 17 00:00:00 2001 From: "clairebontempo@gmail.com" Date: Thu, 16 Nov 2023 10:56:50 -0600 Subject: [PATCH 28/42] address feedback --- ui/app/templates/vault/cluster/access/leases/list.hbs | 2 +- ui/lib/core/addon/components/confirm-action.hbs | 2 +- ui/lib/core/addon/components/confirm-action.js | 5 ++--- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/ui/app/templates/vault/cluster/access/leases/list.hbs b/ui/app/templates/vault/cluster/access/leases/list.hbs index 64984463af1a..c6782dc79513 100644 --- a/ui/app/templates/vault/cluster/access/leases/list.hbs +++ b/ui/app/templates/vault/cluster/access/leases/list.hbs @@ -61,7 +61,7 @@ class="toolbar-button" @buttonColor="secondary" @confirmTitle="Revoke this?" - @confirmMessage="All leases under this one will also be removed and disregard any errors encountered." + @confirmMessage="All leases under this one will also be removed and any errors encountered will be disregarded." @onConfirmAction={{action "revokePrefix" this.baseKey.id true}} /> {{/if}} diff --git a/ui/lib/core/addon/components/confirm-action.hbs b/ui/lib/core/addon/components/confirm-action.hbs index cc490bd22a26..0586b5956e0a 100644 --- a/ui/lib/core/addon/components/confirm-action.hbs +++ b/ui/lib/core/addon/components/confirm-action.hbs @@ -40,7 +40,7 @@ data-test-confirm-button disabled={{or @disabled @isRunning}} @icon={{if @isRunning "loading"}} - @color={{this.confirmButtonColor}} + @color={{if (eq this.modalColor "critical") "critical" "primary"}} @text="Confirm" {{on "click" this.onConfirm}} /> diff --git a/ui/lib/core/addon/components/confirm-action.js b/ui/lib/core/addon/components/confirm-action.js index 3fe030cd44a4..92621b346f78 100644 --- a/ui/lib/core/addon/components/confirm-action.js +++ b/ui/lib/core/addon/components/confirm-action.js @@ -65,9 +65,8 @@ export default class ConfirmActionComponent extends Component { return this.args.confirmMessage || 'You will not be able to recover it later.'; } - get confirmButtonColor() { - // only change from default of primary if modal is 'critical' - return this.args.modalColor === 'critical' ? 'critical' : 'primary'; + get modalColor() { + return this.args.modalColor || 'critical'; } @action From 0f1c9384b4c14d69974ea517b74431b9e4a4dd0e Mon Sep 17 00:00:00 2001 From: "clairebontempo@gmail.com" Date: Thu, 16 Nov 2023 13:26:36 -0600 Subject: [PATCH 29/42] remove @disabled arg and add @disabledMessage --- .../components/keymgmt/provider-edit.hbs | 38 ++++++++----------- .../mfa/mfa-login-enforcement-form.hbs | 3 +- .../access/mfa/methods/method/index.hbs | 17 +++++---- .../cluster/access/oidc/keys/key/details.hbs | 32 +++++----------- .../oidc/providers/provider/details.hbs | 32 +++++----------- .../core/addon/components/confirm-action.hbs | 7 +++- .../core/addon/components/confirm-action.js | 6 ++- .../addon/components/page/configuration.hbs | 2 +- .../addon/components/page/role/details.hbs | 2 +- .../templates/mode/secondaries/revoke.hbs | 3 +- .../oidc-config/clients-keys-test.js | 2 +- .../oidc-config/providers-scopes-test.js | 2 +- ui/tests/helpers/oidc-config.js | 14 +++---- .../components/keymgmt/provider-edit-test.js | 17 ++++++--- 14 files changed, 80 insertions(+), 97 deletions(-) diff --git a/ui/app/templates/components/keymgmt/provider-edit.hbs b/ui/app/templates/components/keymgmt/provider-edit.hbs index dd3cff522d67..21a82ee42a7b 100644 --- a/ui/app/templates/components/keymgmt/provider-edit.hbs +++ b/ui/app/templates/components/keymgmt/provider-edit.hbs @@ -47,28 +47,22 @@ {{#if @model.canDelete}} - - - - - {{#if @model.keys.length}} - -
    - This provider cannot be deleted until all - {{@model.keys.length}} - key(s) distributed to it are revoked. This can be done from the Keys tab. -
    -
    - {{/if}} -
    + {{/if}} {{#if (and @model.canDelete (or @model.canListKeys @model.canEdit))}}
    diff --git a/ui/app/templates/components/mfa/mfa-login-enforcement-form.hbs b/ui/app/templates/components/mfa/mfa-login-enforcement-form.hbs index dd3a64cf6edb..d657a83384fc 100644 --- a/ui/app/templates/components/mfa/mfa-login-enforcement-form.hbs +++ b/ui/app/templates/components/mfa/mfa-login-enforcement-form.hbs @@ -78,6 +78,7 @@ {{/each}}