From fbdeda6cedef1ca007df351c43be359795a4568d Mon Sep 17 00:00:00 2001 From: Chelsea Shaw Date: Wed, 24 Jan 2024 16:36:29 -0600 Subject: [PATCH 01/58] Move confirm-modal to its own component so it can be used with dropdowns --- .../core/addon/components/confirm-modal.hbs | 40 +++++++++++++++++++ .../addon/components/confirmation-modal.js | 3 +- ui/lib/core/app/components/confirm-modal.js | 1 + 3 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 ui/lib/core/addon/components/confirm-modal.hbs create mode 100644 ui/lib/core/app/components/confirm-modal.js diff --git a/ui/lib/core/addon/components/confirm-modal.hbs b/ui/lib/core/addon/components/confirm-modal.hbs new file mode 100644 index 000000000000..1c8fb15b315d --- /dev/null +++ b/ui/lib/core/addon/components/confirm-modal.hbs @@ -0,0 +1,40 @@ + + {{#if @disabledMessage}} + + Not allowed + + + {{@disabledMessage}} + + + + + {{else}} + + {{or @confirmTitle "Are you sure?"}} + + + {{@confirmMessage}} + + + + + + + + {{/if}} + \ No newline at end of file diff --git a/ui/lib/core/addon/components/confirmation-modal.js b/ui/lib/core/addon/components/confirmation-modal.js index 06878dfefd35..6a5a4bd6b6b6 100644 --- a/ui/lib/core/addon/components/confirmation-modal.js +++ b/ui/lib/core/addon/components/confirmation-modal.js @@ -5,7 +5,8 @@ import Component from '@glimmer/component'; /** * @module ConfirmationModal - * ConfirmationModal components wrap the component to present a critical (red) type-to-confirm modal. + * ConfirmationModal components wrap the component to present a critical (red) type-to-confirm modal + * which require the user to type something to confirm the action. * They are used for extremely destructive actions that require extra consideration before confirming. * * @example diff --git a/ui/lib/core/app/components/confirm-modal.js b/ui/lib/core/app/components/confirm-modal.js new file mode 100644 index 000000000000..96b3a726e313 --- /dev/null +++ b/ui/lib/core/app/components/confirm-modal.js @@ -0,0 +1 @@ +export { default } from 'core/components/confirm-modal'; From aa3b8ee31df0456859cf6c45fe2438e0234f05fe Mon Sep 17 00:00:00 2001 From: Chelsea Shaw Date: Wed, 24 Jan 2024 16:38:47 -0600 Subject: [PATCH 02/58] Refactor popup-metadata component --- ui/app/components/identity/popup-metadata.js | 65 ++++++++++++------- .../components/identity/item-metadata.hbs | 2 +- .../components/identity/popup-metadata.hbs | 31 ++++----- 3 files changed, 57 insertions(+), 41 deletions(-) diff --git a/ui/app/components/identity/popup-metadata.js b/ui/app/components/identity/popup-metadata.js index c9097f2e596b..2c8fe683e223 100644 --- a/ui/app/components/identity/popup-metadata.js +++ b/ui/app/components/identity/popup-metadata.js @@ -3,32 +3,47 @@ * SPDX-License-Identifier: BUSL-1.1 */ -import Base from './_popup-base'; -import { computed } from '@ember/object'; -import { alias } from '@ember/object/computed'; +import { action } from '@ember/object'; +import { service } from '@ember/service'; +import Component from '@glimmer/component'; +import { tracked } from '@glimmer/tracking'; -export default Base.extend({ - model: alias('params.firstObject'), - key: computed('params', function () { - return this.params.objectAt(1); - }), +export default class IdentityPopupMetadata extends Component { + @service flashMessages; + @tracked showConfirmModal = false; - messageArgs(model, key) { - return [model, key]; - }, + onSuccess() { + if (this.args.onSuccess) { + this.args.onSuccess(); + } + this.flashMessages.success(`Successfully removed '${this.args.key}' from metadata`); + } + onError(err) { + if (this.args.onError) { + this.args.onError(this.args.model, this.args.key); + } + const error = this.errorMessage(err); + this.flashMessages.error(`There was a problem removing '${this.args.key}' from the metadata - ${error}`); + } - successMessage(model, key) { - return `Successfully removed '${key}' from metadata`; - }, - errorMessage(e, model, key) { - const error = e.errors ? e.errors.join(' ') : e.message; - return `There was a problem removing '${key}' from the metadata - ${error}`; - }, + transaction() { + const metadata = this.args.model.metadata; + delete metadata[this.args.key]; + this.args.model.metadata = { ...metadata }; + return this.args.model.save(); + } - transaction(model, key) { - const metadata = model.metadata; - delete metadata[key]; - model.set('metadata', { ...metadata }); - return model.save(); - }, -}); + @action + async removeMetadata() { + try { + await this.transaction(); + this.onSuccess(); + } catch (e) { + this.onError(e); + } + const metadata = this.args.model.metadata; + delete metadata[this.args.key]; + this.args.model.metadata = { ...metadata }; + return this.args.model.save(); + } +} diff --git a/ui/app/templates/components/identity/item-metadata.hbs b/ui/app/templates/components/identity/item-metadata.hbs index 6fe217e45968..a9012398ef93 100644 --- a/ui/app/templates/components/identity/item-metadata.hbs +++ b/ui/app/templates/components/identity/item-metadata.hbs @@ -16,7 +16,7 @@
{{#if @model.canEdit}} - + {{/if}}
diff --git a/ui/app/templates/components/identity/popup-metadata.hbs b/ui/app/templates/components/identity/popup-metadata.hbs index c40109151ea0..ebbee6487a12 100644 --- a/ui/app/templates/components/identity/popup-metadata.hbs +++ b/ui/app/templates/components/identity/popup-metadata.hbs @@ -3,18 +3,19 @@ SPDX-License-Identifier: BUSL-1.1 ~}} - - - \ No newline at end of file +
+ + + + +
+ +{{#if this.showConfirmModal}} + +{{/if}} \ No newline at end of file From 4acacd0092b20862c2cad9955dfad67692d8ea24 Mon Sep 17 00:00:00 2001 From: Chelsea Shaw Date: Wed, 24 Jan 2024 16:48:55 -0600 Subject: [PATCH 03/58] Refactor popup-members component --- ui/app/components/identity/popup-members.js | 76 +++++++++++-------- .../components/identity/item-members.hbs | 4 +- .../components/identity/popup-members.hbs | 31 ++++---- 3 files changed, 61 insertions(+), 50 deletions(-) diff --git a/ui/app/components/identity/popup-members.js b/ui/app/components/identity/popup-members.js index cd6bffb917f2..6ce06ed36cb6 100644 --- a/ui/app/components/identity/popup-members.js +++ b/ui/app/components/identity/popup-members.js @@ -3,37 +3,47 @@ * SPDX-License-Identifier: BUSL-1.1 */ -import { alias } from '@ember/object/computed'; -import { computed } from '@ember/object'; -import Base from './_popup-base'; - -export default Base.extend({ - model: alias('params.firstObject'), - - groupArray: computed('params', function () { - return this.params.objectAt(1); - }), - - memberId: computed('params', function () { - return this.params.objectAt(2); - }), - - messageArgs(/*model, groupArray, memberId*/) { - return [...arguments]; - }, - - successMessage(model, groupArray, memberId) { - return `Successfully removed '${memberId}' from the group`; - }, - - errorMessage(e, model, groupArray, memberId) { +import Component from '@glimmer/component'; +import { action } from '@ember/object'; +import { service } from '@ember/service'; +import { tracked } from '@glimmer/tracking'; + +export default class IdentityPopupMembers extends Component { + @service flashMessages; + @tracked showConfirmModal = false; + + onSuccess() { + if (this.args.onSuccess) { + this.args.onSuccess(); + } + this.flashMessages.success(`Successfully removed '${this.args.memberId}' from the group`); + } + onError(err) { + if (this.args.onError) { + this.args.onError(this.args.model, this.args.memberId); + } + const error = this.errorMessage(err); + this.flashMessages.error(error); + } + + errorMessage(e) { const error = e.errors ? e.errors.join(' ') : e.message; - return `There was a problem removing '${memberId}' from the group - ${error}`; - }, - - transaction(model, groupArray, memberId) { - const members = model.get(groupArray); - model.set(groupArray, members.without(memberId)); - return model.save(); - }, -}); + return `There was a problem removing '${this.args.memberId}' from the group - ${error}`; + } + + transaction() { + const members = this.args.model[this.args.groupArray]; + this.args.model[this.args.groupArray] = members.without(this.args.memberId); + return this.args.model.save(); + } + + @action + async removeGroup() { + try { + await this.transaction(); + this.onSuccess(); + } catch (e) { + this.onError(e); + } + } +} diff --git a/ui/app/templates/components/identity/item-members.hbs b/ui/app/templates/components/identity/item-members.hbs index e153e9a068a6..3b149199f04e 100644 --- a/ui/app/templates/components/identity/item-members.hbs +++ b/ui/app/templates/components/identity/item-members.hbs @@ -18,7 +18,7 @@
{{#if @model.canEdit}} - + {{/if}}
@@ -38,7 +38,7 @@
{{#if @model.canEdit}} - + {{/if}}
diff --git a/ui/app/templates/components/identity/popup-members.hbs b/ui/app/templates/components/identity/popup-members.hbs index 0fd07c556127..740913b92fe2 100644 --- a/ui/app/templates/components/identity/popup-members.hbs +++ b/ui/app/templates/components/identity/popup-members.hbs @@ -3,18 +3,19 @@ SPDX-License-Identifier: BUSL-1.1 ~}} - - - \ No newline at end of file +
+ + + + +
+ +{{#if this.showConfirmModal}} + +{{/if}} \ No newline at end of file From 60c07fd033c3010fd1fdf6eb10daadedfa1508da Mon Sep 17 00:00:00 2001 From: Chelsea Shaw Date: Wed, 24 Jan 2024 16:49:09 -0600 Subject: [PATCH 04/58] cleanup, confirm-action uses confirm-modal --- ui/app/components/identity/popup-metadata.js | 11 ++--- .../core/addon/components/confirm-action.hbs | 45 +++---------------- 2 files changed, 13 insertions(+), 43 deletions(-) diff --git a/ui/app/components/identity/popup-metadata.js b/ui/app/components/identity/popup-metadata.js index 2c8fe683e223..c94221d192f9 100644 --- a/ui/app/components/identity/popup-metadata.js +++ b/ui/app/components/identity/popup-metadata.js @@ -23,7 +23,12 @@ export default class IdentityPopupMetadata extends Component { this.args.onError(this.args.model, this.args.key); } const error = this.errorMessage(err); - this.flashMessages.error(`There was a problem removing '${this.args.key}' from the metadata - ${error}`); + this.flashMessages.error(error); + } + + errorMessage(e) { + const error = e.errors ? e.errors.join(' ') : e.message; + return `There was a problem removing '${this.args.key}' from the metadata - ${error}`; } transaction() { @@ -41,9 +46,5 @@ export default class IdentityPopupMetadata extends Component { } catch (e) { this.onError(e); } - const metadata = this.args.model.metadata; - delete metadata[this.args.key]; - this.args.model.metadata = { ...metadata }; - return this.args.model.save(); } } diff --git a/ui/lib/core/addon/components/confirm-action.hbs b/ui/lib/core/addon/components/confirm-action.hbs index 2c22eedd8ea8..15a685c491de 100644 --- a/ui/lib/core/addon/components/confirm-action.hbs +++ b/ui/lib/core/addon/components/confirm-action.hbs @@ -25,44 +25,13 @@ {{/if}} {{#if this.showConfirmModal}} - - {{#if @disabledMessage}} - - Not allowed - - - {{@disabledMessage}} - - - - - {{else}} - - {{or @confirmTitle "Are you sure?"}} - - - {{this.confirmMessage}} - - - - - - - - {{/if}} - + @onConfirm={{this.onConfirm}} + @confirmTitle={{@confirmTitle}} + @confirmMessage={{this.confirmMessage}} + @disabledMessage={{@disabledMessage}} + @isRunning={{this.isRunning}} + /> {{/if}} \ No newline at end of file From 8ced2ddf71c6bc3c3724b53fcf8a88515ce6080c Mon Sep 17 00:00:00 2001 From: Chelsea Shaw Date: Wed, 24 Jan 2024 17:22:03 -0600 Subject: [PATCH 05/58] Refactor PopupAlias --- ui/app/components/identity/popup-alias.js | 51 +++++++++----- .../components/identity/item-aliases.hbs | 2 +- .../components/identity/popup-alias.hbs | 70 ++++++++----------- .../cluster/access/identity/aliases/index.hbs | 2 +- 4 files changed, 64 insertions(+), 61 deletions(-) diff --git a/ui/app/components/identity/popup-alias.js b/ui/app/components/identity/popup-alias.js index 3579039738da..919cb74ed42e 100644 --- a/ui/app/components/identity/popup-alias.js +++ b/ui/app/components/identity/popup-alias.js @@ -3,25 +3,38 @@ * SPDX-License-Identifier: BUSL-1.1 */ -import Base from './_popup-base'; +import Component from '@glimmer/component'; +import { service } from '@ember/service'; +import { tracked } from '@glimmer/tracking'; +import { action } from '@ember/object'; +import errorMessage from 'vault/utils/error-message'; -export default Base.extend({ - messageArgs(model) { - const type = model.get('identityType'); - const id = model.id; - return [type, id]; - }, +export default class IdentityPopupAlias extends Component { + @service flashMessages; + @tracked showConfirmModal = false; - successMessage(type, id) { - return `Successfully deleted ${type}: ${id}`; - }, + onSuccess(type, id) { + if (this.args.onSuccess) { + this.args.onSuccess(); + } + this.flashMessages.success(`Successfully deleted ${type}: ${id}`); + } + onError(err, type, id) { + if (this.args.onError) { + this.args.onError(); + } + const error = errorMessage(err); + this.flashMessages.danger(`There was a problem deleting ${type}: ${id} - ${error}`); + } - errorMessage(e, type, id) { - const error = e.errors ? e.errors.join(' ') : e.message; - return `There was a problem deleting ${type}: ${id} - ${error}`; - }, - - transaction(model) { - return model.destroyRecord(); - }, -}); + @action + async deleteAlias() { + const { identityType, id } = this.args.item; + try { + await this.args.item.destroyRecord(); + this.onSuccess(identityType, id); + } catch (e) { + this.onError(e, identityType, id); + } + } +} diff --git a/ui/app/templates/components/identity/item-aliases.hbs b/ui/app/templates/components/identity/item-aliases.hbs index ccc6a0fee457..f0fffc814c1d 100644 --- a/ui/app/templates/components/identity/item-aliases.hbs +++ b/ui/app/templates/components/identity/item-aliases.hbs @@ -24,7 +24,7 @@
- +
diff --git a/ui/app/templates/components/identity/popup-alias.hbs b/ui/app/templates/components/identity/popup-alias.hbs index ffeb2d9572eb..dcee9c52726b 100644 --- a/ui/app/templates/components/identity/popup-alias.hbs +++ b/ui/app/templates/components/identity/popup-alias.hbs @@ -3,43 +3,33 @@ SPDX-License-Identifier: BUSL-1.1 ~}} - - {{#let (get this.params "0") as |item|}} - - {{/let}} - \ No newline at end of file +
+ + + + {{#if @item.updatePath.isPending}} + + + + {{else}} + {{#if @item.canEdit}} + + {{/if}} + {{#if @item.canDelete}} + + {{/if}} + {{/if}} + +
+ +{{#if this.showConfirmModal}} + +{{/if}} \ No newline at end of file diff --git a/ui/app/templates/vault/cluster/access/identity/aliases/index.hbs b/ui/app/templates/vault/cluster/access/identity/aliases/index.hbs index d3d2183d6821..6dca7b8eafd5 100644 --- a/ui/app/templates/vault/cluster/access/identity/aliases/index.hbs +++ b/ui/app/templates/vault/cluster/access/identity/aliases/index.hbs @@ -31,7 +31,7 @@
- +
From 2a5ca5e9f93fd8b1577753451664a491d9924a63 Mon Sep 17 00:00:00 2001 From: Chelsea Shaw Date: Wed, 24 Jan 2024 17:27:18 -0600 Subject: [PATCH 06/58] cleanup, test selectors --- ui/app/components/identity/popup-members.js | 23 ++++++++----------- ui/app/components/identity/popup-metadata.js | 23 ++++++++----------- .../components/identity/popup-alias.hbs | 7 +++++- .../components/identity/popup-members.hbs | 7 +++++- .../components/identity/popup-metadata.hbs | 2 +- 5 files changed, 33 insertions(+), 29 deletions(-) diff --git a/ui/app/components/identity/popup-members.js b/ui/app/components/identity/popup-members.js index 6ce06ed36cb6..fdafd79dba9b 100644 --- a/ui/app/components/identity/popup-members.js +++ b/ui/app/components/identity/popup-members.js @@ -7,28 +7,24 @@ import Component from '@glimmer/component'; import { action } from '@ember/object'; import { service } from '@ember/service'; import { tracked } from '@glimmer/tracking'; +import errorMessage from 'vault/utils/error-message'; export default class IdentityPopupMembers extends Component { @service flashMessages; @tracked showConfirmModal = false; - onSuccess() { + onSuccess(memberId) { if (this.args.onSuccess) { this.args.onSuccess(); } - this.flashMessages.success(`Successfully removed '${this.args.memberId}' from the group`); + this.flashMessages.success(`Successfully removed '${memberId}' from the group`); } - onError(err) { + onError(err, memberId) { if (this.args.onError) { - this.args.onError(this.args.model, this.args.memberId); + this.args.onError(); } - const error = this.errorMessage(err); - this.flashMessages.error(error); - } - - errorMessage(e) { - const error = e.errors ? e.errors.join(' ') : e.message; - return `There was a problem removing '${this.args.memberId}' from the group - ${error}`; + const error = errorMessage(err); + this.flashMessages.danger(`There was a problem removing '${memberId}' from the group - ${error}`); } transaction() { @@ -39,11 +35,12 @@ export default class IdentityPopupMembers extends Component { @action async removeGroup() { + const memberId = this.args.memberId; try { await this.transaction(); - this.onSuccess(); + this.onSuccess(memberId); } catch (e) { - this.onError(e); + this.onError(e, memberId); } } } diff --git a/ui/app/components/identity/popup-metadata.js b/ui/app/components/identity/popup-metadata.js index c94221d192f9..2089f4a90e9c 100644 --- a/ui/app/components/identity/popup-metadata.js +++ b/ui/app/components/identity/popup-metadata.js @@ -7,28 +7,24 @@ import { action } from '@ember/object'; import { service } from '@ember/service'; import Component from '@glimmer/component'; import { tracked } from '@glimmer/tracking'; +import errorMessage from 'vault/utils/error-message'; export default class IdentityPopupMetadata extends Component { @service flashMessages; @tracked showConfirmModal = false; - onSuccess() { + onSuccess(key) { if (this.args.onSuccess) { this.args.onSuccess(); } - this.flashMessages.success(`Successfully removed '${this.args.key}' from metadata`); + this.flashMessages.success(`Successfully removed '${key}' from metadata`); } - onError(err) { + onError(err, key) { if (this.args.onError) { - this.args.onError(this.args.model, this.args.key); + this.args.onError(); } - const error = this.errorMessage(err); - this.flashMessages.error(error); - } - - errorMessage(e) { - const error = e.errors ? e.errors.join(' ') : e.message; - return `There was a problem removing '${this.args.key}' from the metadata - ${error}`; + const error = errorMessage(err); + this.flashMessages.danger(`There was a problem removing '${key}' from the metadata - ${error}`); } transaction() { @@ -40,11 +36,12 @@ export default class IdentityPopupMetadata extends Component { @action async removeMetadata() { + const key = this.args.key; try { await this.transaction(); - this.onSuccess(); + this.onSuccess(key); } catch (e) { - this.onError(e); + this.onError(e, key); } } } diff --git a/ui/app/templates/components/identity/popup-alias.hbs b/ui/app/templates/components/identity/popup-alias.hbs index dcee9c52726b..b73c9a728db0 100644 --- a/ui/app/templates/components/identity/popup-alias.hbs +++ b/ui/app/templates/components/identity/popup-alias.hbs @@ -5,7 +5,12 @@
- + - +
diff --git a/ui/app/templates/components/identity/popup-metadata.hbs b/ui/app/templates/components/identity/popup-metadata.hbs index ebbee6487a12..9954f1c78534 100644 --- a/ui/app/templates/components/identity/popup-metadata.hbs +++ b/ui/app/templates/components/identity/popup-metadata.hbs @@ -5,7 +5,7 @@
- +
From 3fe23e9804ebfcd80297a7b45d4a3288b61a4678 Mon Sep 17 00:00:00 2001 From: Chelsea Shaw Date: Wed, 24 Jan 2024 17:55:36 -0600 Subject: [PATCH 07/58] refactor popup-policy --- ui/app/components/identity/popup-policy.js | 65 ++++++++++++------- .../components/identity/item-policies.hbs | 2 +- .../components/identity/popup-policy.hbs | 52 ++++++++------- 3 files changed, 68 insertions(+), 51 deletions(-) diff --git a/ui/app/components/identity/popup-policy.js b/ui/app/components/identity/popup-policy.js index 94eb5d9244ee..9c0ffe8c3916 100644 --- a/ui/app/components/identity/popup-policy.js +++ b/ui/app/components/identity/popup-policy.js @@ -3,32 +3,47 @@ * SPDX-License-Identifier: BUSL-1.1 */ -import { alias } from '@ember/object/computed'; -import { computed } from '@ember/object'; -import Base from './_popup-base'; +import Component from '@glimmer/component'; +import { action } from '@ember/object'; +import { service } from '@ember/service'; +import errorMessage from 'vault/utils/error-message'; +import { tracked } from '@glimmer/tracking'; -export default Base.extend({ - model: alias('params.firstObject'), - policyName: computed('params', function () { - return this.params.objectAt(1); - }), +export default class IdentityPopupPolicy extends Component { + @service flashMessages; + @tracked showConfirmModal = false; - messageArgs(model, policyName) { - return [model, policyName]; - }, + onSuccess(policyName, modelId) { + if (this.args.onSuccess) { + this.args.onSuccess(); + } + this.flashMessages.success(`Successfully removed '${policyName}' policy from ${modelId} `); + } + onError(err, policyName) { + if (this.args.onError) { + this.args.onError(); + } + const error = errorMessage(err); + this.flashMessages.danger(`There was a problem removing '${policyName}' policy - ${error}`); + } - successMessage(model, policyName) { - return `Successfully removed '${policyName}' policy from ${model.id} `; - }, + transaction() { + const policies = this.args.model.policies; + this.args.model.policies = policies.without(this.args.policyName); + return this.args.model.save(); + } - errorMessage(e, model, policyName) { - const error = e.errors ? e.errors.join(' ') : e.message; - return `There was a problem removing '${policyName}' policy - ${error}`; - }, - - transaction(model, policyName) { - const policies = model.get('policies'); - model.set('policies', policies.without(policyName)); - return model.save(); - }, -}); + @action + async removePolicy() { + const { + policyName, + model: { id }, + } = this.args; + try { + await this.transaction(); + this.onSuccess(policyName, id); + } catch (e) { + this.onError(e, policyName); + } + } +} diff --git a/ui/app/templates/components/identity/item-policies.hbs b/ui/app/templates/components/identity/item-policies.hbs index e94df943a7ee..987859059900 100644 --- a/ui/app/templates/components/identity/item-policies.hbs +++ b/ui/app/templates/components/identity/item-policies.hbs @@ -17,7 +17,7 @@
{{#if @model.canEdit}} - + {{/if}}
diff --git a/ui/app/templates/components/identity/popup-policy.hbs b/ui/app/templates/components/identity/popup-policy.hbs index fc77051cc602..eef6d33d5829 100644 --- a/ui/app/templates/components/identity/popup-policy.hbs +++ b/ui/app/templates/components/identity/popup-policy.hbs @@ -3,28 +3,30 @@ SPDX-License-Identifier: BUSL-1.1 ~}} - - - \ No newline at end of file +
+ + + + + + +
+ +{{#if this.showConfirmModal}} + +{{/if}} \ No newline at end of file From 0764acf0f7f71d1d4701a1c6a5b3ce5d56e3b0ca Mon Sep 17 00:00:00 2001 From: Chelsea Shaw Date: Wed, 24 Jan 2024 17:55:44 -0600 Subject: [PATCH 08/58] remove popup-base --- ui/app/components/identity/_popup-base.js | 46 ----------------------- 1 file changed, 46 deletions(-) delete mode 100644 ui/app/components/identity/_popup-base.js diff --git a/ui/app/components/identity/_popup-base.js b/ui/app/components/identity/_popup-base.js deleted file mode 100644 index f7ef118a9541..000000000000 --- a/ui/app/components/identity/_popup-base.js +++ /dev/null @@ -1,46 +0,0 @@ -/** - * Copyright (c) HashiCorp, Inc. - * SPDX-License-Identifier: BUSL-1.1 - */ - -import { inject as service } from '@ember/service'; -import { assert } from '@ember/debug'; -import Component from '@ember/component'; - -export default Component.extend({ - tagName: '', - flashMessages: service(), - params: null, - successMessage() { - return 'Save was successful'; - }, - errorMessage() { - return 'There was an error saving'; - }, - onError(model) { - if (model && model.rollbackAttributes) { - model.rollbackAttributes(); - } - }, - onSuccess() {}, - // override and return a promise - transaction() { - assert('override transaction call in an extension of popup-base', false); - }, - - actions: { - performTransaction() { - const args = [...arguments]; - const messageArgs = this.messageArgs(...args); - return this.transaction(...args) - .then(() => { - this.onSuccess(); - this.flashMessages.success(this.successMessage(...messageArgs)); - }) - .catch((e) => { - this.onError(...messageArgs); - this.flashMessages.success(this.errorMessage(e, ...messageArgs)); - }); - }, - }, -}); From 0e40f2537fc9bb89f30d641cd22cbaaf0fcb0790 Mon Sep 17 00:00:00 2001 From: Chelsea Shaw Date: Thu, 25 Jan 2024 10:03:28 -0600 Subject: [PATCH 09/58] replace popup-menu in mfa components --- .../mfa/login-enforcement-list-item.hbs | 44 +++++++++---------- .../components/mfa/method-list-item.hbs | 44 +++++++++---------- .../mfa/enforcements/enforcement/index.hbs | 25 ++++++----- 3 files changed, 54 insertions(+), 59 deletions(-) diff --git a/ui/app/templates/components/mfa/login-enforcement-list-item.hbs b/ui/app/templates/components/mfa/login-enforcement-list-item.hbs index 544e0980d6aa..1827e60c27b5 100644 --- a/ui/app/templates/components/mfa/login-enforcement-list-item.hbs +++ b/ui/app/templates/components/mfa/login-enforcement-list-item.hbs @@ -19,30 +19,26 @@
- - - + + + + +
diff --git a/ui/app/templates/components/mfa/method-list-item.hbs b/ui/app/templates/components/mfa/method-list-item.hbs index baff7ab01e66..75a719a5a3e6 100644 --- a/ui/app/templates/components/mfa/method-list-item.hbs +++ b/ui/app/templates/components/mfa/method-list-item.hbs @@ -30,30 +30,26 @@
- - - + + + + +
diff --git a/ui/app/templates/vault/cluster/access/mfa/enforcements/enforcement/index.hbs b/ui/app/templates/vault/cluster/access/mfa/enforcements/enforcement/index.hbs index a93bce4935de..f84bd9eb9860 100644 --- a/ui/app/templates/vault/cluster/access/mfa/enforcements/enforcement/index.hbs +++ b/ui/app/templates/vault/cluster/access/mfa/enforcements/enforcement/index.hbs @@ -83,17 +83,20 @@ {{#if target.link}}
- - - + + + +
{{/if}} From b3ebb65b87f3e8c47b93818c11ef601834ddab49 Mon Sep 17 00:00:00 2001 From: Chelsea Shaw Date: Thu, 25 Jan 2024 10:08:06 -0600 Subject: [PATCH 10/58] replace popup-menu in secret-list --- ui/app/components/secret-list/item.js | 6 ++ .../templates/components/secret-list/item.hbs | 96 +++++++++---------- 2 files changed, 52 insertions(+), 50 deletions(-) create mode 100644 ui/app/components/secret-list/item.js diff --git a/ui/app/components/secret-list/item.js b/ui/app/components/secret-list/item.js new file mode 100644 index 000000000000..f43050bd2541 --- /dev/null +++ b/ui/app/components/secret-list/item.js @@ -0,0 +1,6 @@ +import Component from '@glimmer/component'; +import { tracked } from '@glimmer/tracking'; + +export default class SecretListItemComponent extends Component { + @tracked showConfirmModal = false; +} diff --git a/ui/app/templates/components/secret-list/item.hbs b/ui/app/templates/components/secret-list/item.hbs index 652d96444100..a4dc40ddcdf5 100644 --- a/ui/app/templates/components/secret-list/item.hbs +++ b/ui/app/templates/components/secret-list/item.hbs @@ -30,56 +30,52 @@
- - - + {{/if}} + {{/if}} +
- \ No newline at end of file + + +{{#if this.showConfirmModal}} + +{{/if}} \ No newline at end of file From 496c95db8324e721db82914078c48bf974fe37f9 Mon Sep 17 00:00:00 2001 From: Chelsea Shaw Date: Thu, 25 Jan 2024 10:13:28 -0600 Subject: [PATCH 11/58] replace popup-menu in transit-form-show --- .../components/transit-form-show.hbs | 24 +++++++------------ 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/ui/app/templates/components/transit-form-show.hbs b/ui/app/templates/components/transit-form-show.hbs index f08210e264f9..559be499fc2a 100644 --- a/ui/app/templates/components/transit-form-show.hbs +++ b/ui/app/templates/components/transit-form-show.hbs @@ -151,21 +151,15 @@
- - - + + + +
From fdff18f91bb1bb7c8b6fa6152b03a046161310d4 Mon Sep 17 00:00:00 2001 From: Chelsea Shaw Date: Thu, 25 Jan 2024 10:15:00 -0600 Subject: [PATCH 12/58] replace popup-menu on ssh-role-item --- .../components/secret-list/ssh-role-item.js | 6 + .../components/secret-list/ssh-role-item.hbs | 163 +++++++++--------- 2 files changed, 86 insertions(+), 83 deletions(-) create mode 100644 ui/app/components/secret-list/ssh-role-item.js diff --git a/ui/app/components/secret-list/ssh-role-item.js b/ui/app/components/secret-list/ssh-role-item.js new file mode 100644 index 000000000000..808e47c11e5e --- /dev/null +++ b/ui/app/components/secret-list/ssh-role-item.js @@ -0,0 +1,6 @@ +import Component from '@glimmer/component'; +import { tracked } from '@glimmer/tracking'; + +export default class SecretListSshRoleItemComponent extends Component { + @tracked showConfirmModal = false; +} 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 26294b6683f2..aa6c295704e8 100644 --- a/ui/app/templates/components/secret-list/ssh-role-item.hbs +++ b/ui/app/templates/components/secret-list/ssh-role-item.hbs @@ -36,89 +36,86 @@
{{#if (eq @backendType "ssh")}} - - - + + + {{#if (eq @item.keyType "otp")}} + {{#if @item.generatePath.isPending}} + + + + {{else if @item.canGenerate}} + + {{/if}} + {{else if (eq @item.keyType "ca")}} + {{#if @item.signPath.isPending}} + + + + {{else if @item.canGenerate}} + + {{/if}} + {{/if}} + {{#if @loadingToggleZeroAddress}} + + + + {{else if @item.canEditZeroAddress}} + + {{/if}} + {{#if @item.updatePath.isPending}} + + + + {{else}} + {{#if @item.canRead}} + + {{/if}} + {{#if @item.canEdit}} + + {{/if}} + {{#if @item.canDelete}} + + {{/if}} + {{/if}} + {{/if}}
- \ No newline at end of file + + +{{#if this.showConfirmModal}} + +{{/if}} \ No newline at end of file From 77ee6bacc85bf5cf3986353512ba079722e0b8b4 Mon Sep 17 00:00:00 2001 From: Chelsea Shaw Date: Thu, 25 Jan 2024 10:17:05 -0600 Subject: [PATCH 13/58] replace popup-menu in aws-role-item --- .../components/secret-list/aws-role-item.js | 6 + .../components/secret-list/aws-role-item.hbs | 108 +++++++++--------- 2 files changed, 61 insertions(+), 53 deletions(-) create mode 100644 ui/app/components/secret-list/aws-role-item.js diff --git a/ui/app/components/secret-list/aws-role-item.js b/ui/app/components/secret-list/aws-role-item.js new file mode 100644 index 000000000000..8b665d1ebc42 --- /dev/null +++ b/ui/app/components/secret-list/aws-role-item.js @@ -0,0 +1,6 @@ +import Component from '@glimmer/component'; +import { tracked } from '@glimmer/tracking'; + +export default class SecretListAwsRoleItemComponent extends Component { + @tracked showConfirmModal = false; +} 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 10a67616b30b..a995f16e4f15 100644 --- a/ui/app/templates/components/secret-list/aws-role-item.hbs +++ b/ui/app/templates/components/secret-list/aws-role-item.hbs @@ -23,58 +23,60 @@
- - - + + + {{#if @item.generatePath.isPending}} + + + + {{else if @item.canGenerate}} + + {{/if}} + {{#if @item.updatePath.isPending}} + + + + {{else}} + {{#if @item.canRead}} + + {{/if}} + {{#if @item.canEdit}} + + {{/if}} + {{#if @item.canDelete}} + + {{/if}} + {{/if}} +
- \ No newline at end of file + + +{{#if this.showConfirmModal}} + +{{/if}} \ No newline at end of file From 68701501dc2c6e55514c6381dc9ac9052530fdd7 Mon Sep 17 00:00:00 2001 From: Chelsea Shaw Date: Thu, 25 Jan 2024 10:17:25 -0600 Subject: [PATCH 14/58] replace popup-menu in database-list-item --- .../secret-list/database-list-item.hbs | 113 +++++++----------- 1 file changed, 42 insertions(+), 71 deletions(-) diff --git a/ui/app/templates/components/secret-list/database-list-item.hbs b/ui/app/templates/components/secret-list/database-list-item.hbs index 8a65fc9297e9..fff82f106706 100644 --- a/ui/app/templates/components/secret-list/database-list-item.hbs +++ b/ui/app/templates/components/secret-list/database-list-item.hbs @@ -26,77 +26,48 @@
- - - + + + {{#if @item.canEdit}} + + {{/if}} + {{#if @item.canEditRole}} + + {{/if}} + {{#if @item.canReset}} + + {{/if}} + {{#if (and (eq @item.type "dynamic") @item.canGenerateCredentials)}} + + {{else if (and (eq @item.type "static") @item.canGetCredentials)}} + + {{/if}} + {{#if (and @item.canRotateRoleCredentials (eq this.keyTypeValue "static"))}} + + {{/if}} + {{#if @item.canRotateRoot}} + + {{/if}} +
\ No newline at end of file From cb489d6b266c9f879d6416d74cfc016661e990e6 Mon Sep 17 00:00:00 2001 From: Chelsea Shaw Date: Thu, 25 Jan 2024 10:17:39 -0600 Subject: [PATCH 15/58] add confirm-modal test --- .../core/addon/components/confirm-modal.hbs | 3 +- .../components/confirm-modal-test.js | 32 +++++++++++++++++++ 2 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 ui/tests/integration/components/confirm-modal-test.js diff --git a/ui/lib/core/addon/components/confirm-modal.hbs b/ui/lib/core/addon/components/confirm-modal.hbs index 1c8fb15b315d..9df4942c3490 100644 --- a/ui/lib/core/addon/components/confirm-modal.hbs +++ b/ui/lib/core/addon/components/confirm-modal.hbs @@ -4,6 +4,7 @@ @color={{or @color "warning"}} @size="small" @onClose={{@onClose}} + data-test-confirm-modal as |M| > {{#if @disabledMessage}} @@ -21,7 +22,7 @@ {{or @confirmTitle "Are you sure?"}} - {{@confirmMessage}} + {{or @confirmMessage "You will not be able to recover it later."}} diff --git a/ui/tests/integration/components/confirm-modal-test.js b/ui/tests/integration/components/confirm-modal-test.js new file mode 100644 index 000000000000..266b2c1e7a9d --- /dev/null +++ b/ui/tests/integration/components/confirm-modal-test.js @@ -0,0 +1,32 @@ +import { module, test } from 'qunit'; +import { setupRenderingTest } from 'vault/tests/helpers'; +import { click, render } from '@ember/test-helpers'; +import { hbs } from 'ember-cli-htmlbars'; +import sinon from 'sinon'; + +module('Integration | Component | confirm-modal', function (hooks) { + setupRenderingTest(hooks); + + hooks.beforeEach(function () { + this.onConfirm = sinon.spy(); + this.onClose = sinon.spy(); + }); + + test('it renders a reasonable default', async function (assert) { + await render(hbs``); + assert + .dom('[data-test-confirm-modal]') + .hasClass('hds-modal--color-warning', 'renders warning modal color'); + assert + .dom('[data-test-confirm-button]') + .hasClass('hds-button--color-primary', 'renders primary confirm button'); + assert.dom('[data-test-confirm-action-title]').hasText('Are you sure?', 'renders default title'); + assert + .dom('[data-test-confirm-action-message]') + .hasText('You will not be able to recover it later.', 'renders default body text'); + await click('[data-test-confirm-cancel-button]'); + assert.ok(this.onClose.called, 'calls the onClose action when Cancel is clicked'); + await click('[data-test-confirm-button]'); + assert.ok(this.onConfirm.called, 'calls the onConfirm action when Confirm is clicked'); + }); +}); From c4d300b5b8cde8ae855d7c2b395619e1dfd16f88 Mon Sep 17 00:00:00 2001 From: Chelsea Shaw Date: Thu, 25 Jan 2024 13:44:00 -0600 Subject: [PATCH 16/58] Update popup-menu on oidc/client-list, plus tests --- ui/app/models/oidc/client.js | 6 +-- .../templates/components/oidc/client-list.hbs | 52 +++++++++---------- .../components/oidc/client-list-test.js | 49 +++++++++++++++++ 3 files changed, 78 insertions(+), 29 deletions(-) create mode 100644 ui/tests/integration/components/oidc/client-list-test.js diff --git a/ui/app/models/oidc/client.js b/ui/app/models/oidc/client.js index 2829d29b50d7..be4761ed68b3 100644 --- a/ui/app/models/oidc/client.js +++ b/ui/app/models/oidc/client.js @@ -101,12 +101,12 @@ export default class OidcClientModel extends Model { // CAPABILITIES // @lazyCapabilities(apiPath`identity/oidc/client/${'name'}`, 'name') clientPath; get canRead() { - return this.clientPath.get('canRead'); + return this.clientPath.get('canRead') !== false; } get canEdit() { - return this.clientPath.get('canUpdate'); + return this.clientPath.get('canUpdate') !== false; } get canDelete() { - return this.clientPath.get('canDelete'); + return this.clientPath.get('canDelete') !== false; } } diff --git a/ui/app/templates/components/oidc/client-list.hbs b/ui/app/templates/components/oidc/client-list.hbs index 3473e135f3ae..137ad2e39584 100644 --- a/ui/app/templates/components/oidc/client-list.hbs +++ b/ui/app/templates/components/oidc/client-list.hbs @@ -24,32 +24,32 @@
- - - + {{#if (or client.canRead client.canEdit)}} + + + {{#if client.canRead}} + + {{/if}} + {{#if client.canEdit}} + + {{/if}} + + {{/if}}
diff --git a/ui/tests/integration/components/oidc/client-list-test.js b/ui/tests/integration/components/oidc/client-list-test.js new file mode 100644 index 000000000000..b8c2f26460d0 --- /dev/null +++ b/ui/tests/integration/components/oidc/client-list-test.js @@ -0,0 +1,49 @@ +import { module, test } from 'qunit'; +import { setupRenderingTest } from 'vault/tests/helpers'; +import { setupMirage } from 'ember-cli-mirage/test-support'; +import { click, render } from '@ember/test-helpers'; +import { hbs } from 'ember-cli-htmlbars'; +import { overrideCapabilities } from 'vault/tests/helpers/oidc-config'; +import { allowAllCapabilitiesStub } from 'vault/tests/helpers/stubs'; + +module('Integration | Component | oidc/client-list', function (hooks) { + setupRenderingTest(hooks); + setupMirage(hooks); + + hooks.beforeEach(function () { + this.store = this.owner.lookup('service:store'); + this.store.createRecord('oidc/client', { name: 'first-client' }); + this.store.createRecord('oidc/client', { name: 'second-client' }); + this.model = this.store.peekAll('oidc/client'); + }); + + test('it renders list of clients', async function (assert) { + this.server.post('/sys/capabilities-self', allowAllCapabilitiesStub(['read', 'update'])); + await render(hbs``); + + assert.dom('[data-test-oidc-client-linked-block]').exists({ count: 2 }, 'Two clients are rendered'); + assert.dom('[data-test-oidc-client-linked-block="first-client"]').exists('First client is rendered'); + assert.dom('[data-test-oidc-client-linked-block="second-client"]').exists('Second client is rendered'); + + await click('[data-test-oidc-client-linked-block="first-client"] [data-test-popup-menu-trigger]'); + assert.dom('[data-test-oidc-client-menu-link="details"]').exists('Details link is rendered'); + assert.dom('[data-test-oidc-client-menu-link="edit"]').exists('Edit link is rendered'); + }); + + test('it renders popup menu based on permissions', async function (assert) { + this.server.post('/sys/capabilities-self', (schema, req) => { + const { paths } = JSON.parse(req.requestBody); + if (paths[0] === 'identity/oidc/client/first-client') { + return overrideCapabilities('identity/oidc/client/first-client', ['read']); + } else { + return overrideCapabilities('identity/oidc/client/second-client', ['deny']); + } + }); + await render(hbs``); + + assert.dom('[data-test-popup-menu-trigger]').exists({ count: 1 }, 'Only one popup menu is rendered'); + await click('[data-test-popup-menu-trigger]'); + assert.dom('[data-test-oidc-client-menu-link="details"]').exists('Details link is rendered'); + assert.dom('[data-test-oidc-client-menu-link="edit"]').doesNotExist('Edit link is not rendered'); + }); +}); From ed98c4d1cb5b12d6ac6ef294e6ca2eb35ec3e0b2 Mon Sep 17 00:00:00 2001 From: Chelsea Shaw Date: Thu, 25 Jan 2024 16:50:45 -0600 Subject: [PATCH 17/58] replace popup-menu in oidc/provider-list, with test --- ui/app/models/oidc/provider.js | 6 +-- .../components/oidc/provider-list.hbs | 52 +++++++++---------- .../components/oidc/provider-list-test.js | 50 ++++++++++++++++++ 3 files changed, 79 insertions(+), 29 deletions(-) create mode 100644 ui/tests/integration/components/oidc/provider-list-test.js diff --git a/ui/app/models/oidc/provider.js b/ui/app/models/oidc/provider.js index c2d72dff3158..36ed9d9334c9 100644 --- a/ui/app/models/oidc/provider.js +++ b/ui/app/models/oidc/provider.js @@ -53,12 +53,12 @@ export default class OidcProviderModel extends Model { @lazyCapabilities(apiPath`identity/oidc/provider/${'name'}`, 'name') providerPath; get canRead() { - return this.providerPath.get('canRead'); + return this.providerPath.get('canRead') !== false; } get canEdit() { - return this.providerPath.get('canUpdate'); + return this.providerPath.get('canUpdate') !== false; } get canDelete() { - return this.providerPath.get('canDelete'); + return this.providerPath.get('canDelete') !== false; } } diff --git a/ui/app/templates/components/oidc/provider-list.hbs b/ui/app/templates/components/oidc/provider-list.hbs index 401f69039306..4c8a131b1433 100644 --- a/ui/app/templates/components/oidc/provider-list.hbs +++ b/ui/app/templates/components/oidc/provider-list.hbs @@ -24,32 +24,32 @@
- - - + {{#if (or provider.canRead provider.canEdit)}} + + + {{#if provider.canRead}} + + {{/if}} + {{#if provider.canEdit}} + + {{/if}} + + {{/if}}
diff --git a/ui/tests/integration/components/oidc/provider-list-test.js b/ui/tests/integration/components/oidc/provider-list-test.js new file mode 100644 index 000000000000..6b803b7f973a --- /dev/null +++ b/ui/tests/integration/components/oidc/provider-list-test.js @@ -0,0 +1,50 @@ +import { module, test } from 'qunit'; +import { setupRenderingTest } from 'vault/tests/helpers'; +import { setupMirage } from 'ember-cli-mirage/test-support'; +import { click, render } from '@ember/test-helpers'; +import { hbs } from 'ember-cli-htmlbars'; +import { overrideCapabilities } from 'vault/tests/helpers/oidc-config'; +import { allowAllCapabilitiesStub } from 'vault/tests/helpers/stubs'; + +module('Integration | Component | oidc/provider-list', function (hooks) { + setupRenderingTest(hooks); + setupMirage(hooks); + + hooks.beforeEach(function () { + this.store = this.owner.lookup('service:store'); + this.store.createRecord('oidc/provider', { name: 'first-provider', issuer: 'foobar' }); + this.store.createRecord('oidc/provider', { name: 'second-provider', issuer: 'foobar' }); + this.model = this.store.peekAll('oidc/provider'); + }); + + test('it renders list of providers', async function (assert) { + this.server.post('/sys/capabilities-self', allowAllCapabilitiesStub(['read', 'update'])); + await render(hbs``); + + assert.dom('[data-test-oidc-provider-linked-block]').exists({ count: 2 }, 'Two clients are rendered'); + assert.dom('[data-test-oidc-provider-linked-block="first-provider"]').exists('First client is rendered'); + assert + .dom('[data-test-oidc-provider-linked-block="second-provider"]') + .exists('Second client is rendered'); + + await click('[data-test-oidc-provider-linked-block="first-provider"] [data-test-popup-menu-trigger]'); + assert.dom('[data-test-oidc-provider-menu-link="details"]').exists('Details link is rendered'); + assert.dom('[data-test-oidc-provider-menu-link="edit"]').exists('Edit link is rendered'); + }); + + test('it renders popup menu based on permissions', async function (assert) { + this.server.post('/sys/capabilities-self', (schema, req) => { + const { paths } = JSON.parse(req.requestBody); + if (paths[0] === 'identity/oidc/provider/first-provider') { + return overrideCapabilities('identity/oidc/provider/first-provider', ['read']); + } else { + return overrideCapabilities('identity/oidc/provider/second-provider', ['deny']); + } + }); + await render(hbs``); + assert.dom('[data-test-popup-menu-trigger]').exists({ count: 1 }, 'Only one popup menu is rendered'); + await click('[data-test-popup-menu-trigger]'); + assert.dom('[data-test-oidc-provider-menu-link="details"]').exists('Details link is rendered'); + assert.dom('[data-test-oidc-provider-menu-link="edit"]').doesNotExist('Edit link is not rendered'); + }); +}); From 0914966cda2d0deed8a0f43e47819b9bfd926897 Mon Sep 17 00:00:00 2001 From: Chelsea Shaw Date: Thu, 25 Jan 2024 17:40:10 -0600 Subject: [PATCH 18/58] replace popup-menu on transform list items --- .../secret-list/transform-list-item.hbs | 52 +++++----- .../transform-transformation-item.hbs | 94 +++++++------------ 2 files changed, 56 insertions(+), 90 deletions(-) diff --git a/ui/app/templates/components/secret-list/transform-list-item.hbs b/ui/app/templates/components/secret-list/transform-list-item.hbs index 2b7bf38718f8..18c176ac0db7 100644 --- a/ui/app/templates/components/secret-list/transform-list-item.hbs +++ b/ui/app/templates/components/secret-list/transform-list-item.hbs @@ -25,26 +25,20 @@
{{#if (or @item.updatePath.canRead @item.updatePath.canUpdate)}} - - - + + + {{#if @item.updatePath.canRead}} + + {{/if}} + {{#if @item.updatePath.canUpdate}} + + {{/if}} + {{/if}}
@@ -55,17 +49,13 @@
{{#if this.isBuiltin}} - - - {{@item.id}} - - -
- This is a built-in HashiCorp - {{@itemType}}. It can't be viewed or edited. -
-
-
+ + {{@item.id}} + {{else}} {{@item.id}} {{/if}} diff --git a/ui/app/templates/components/secret-list/transform-transformation-item.hbs b/ui/app/templates/components/secret-list/transform-transformation-item.hbs index 798902453083..30095e1cb0e1 100644 --- a/ui/app/templates/components/secret-list/transform-transformation-item.hbs +++ b/ui/app/templates/components/secret-list/transform-transformation-item.hbs @@ -3,66 +3,42 @@ SPDX-License-Identifier: BUSL-1.1 ~}} -{{! CBS TODO do not let click if !canRead }} -{{#if (eq @options.item "transformation")}} - -
-
- - - {{if (eq @item.id " ") "(self)" (or @item.keyWithoutParent @item.id)}} - -
-
- {{#if (or @item.updatePath.canRead @item.updatePath.canUpdate)}} - - - - {{/if}} -
-
-
-{{else}} -
-
-
+ +
+
+ {{if (eq @item.id " ") "(self)" (or @item.keyWithoutParent @item.id)}} -
+ +
+
+ {{#if (or @item.updatePath.canRead @item.updatePath.canUpdate)}} + + + {{#if @item.updatePath.canRead}} + + {{/if}} + {{#if @item.updatePath.canUpdate}} + + {{/if}} + + {{/if}}
-{{/if}} \ No newline at end of file + \ No newline at end of file From 7e881573e970f425710a9a898c668195d0171a88 Mon Sep 17 00:00:00 2001 From: Chelsea Shaw Date: Thu, 25 Jan 2024 17:40:28 -0600 Subject: [PATCH 19/58] replace popup-menu on kv list component --- ui/lib/kv/addon/components/page/list.hbs | 90 ++++++++++++------------ ui/lib/kv/addon/components/page/list.js | 1 + 2 files changed, 45 insertions(+), 46 deletions(-) diff --git a/ui/lib/kv/addon/components/page/list.hbs b/ui/lib/kv/addon/components/page/list.hbs index ff9436c2f03a..36d1507fcc7c 100644 --- a/ui/lib/kv/addon/components/page/list.hbs +++ b/ui/lib/kv/addon/components/page/list.hbs @@ -71,57 +71,55 @@
- - - + + + {{#if metadata.pathIsDirectory}} + + {{else}} + + {{#if metadata.canReadMetadata}} + + {{/if}} + {{#if metadata.canCreateVersionData}} + + {{/if}} + {{#if metadata.canDeleteMetadata}} + + {{/if}} + {{/if}} +
{{/each}} + {{#if this.deleteSecretModal}} + + {{/if}} {{! Pagination }} Date: Thu, 25 Jan 2024 17:47:55 -0600 Subject: [PATCH 20/58] replace popup-menu on kv version list --- .../page/secret/metadata/version-history.hbs | 46 +++++++++---------- 1 file changed, 21 insertions(+), 25 deletions(-) diff --git a/ui/lib/kv/addon/components/page/secret/metadata/version-history.hbs b/ui/lib/kv/addon/components/page/secret/metadata/version-history.hbs index 7e10188acaae..ef4eacf1e81c 100644 --- a/ui/lib/kv/addon/components/page/secret/metadata/version-history.hbs +++ b/ui/lib/kv/addon/components/page/secret/metadata/version-history.hbs @@ -70,31 +70,27 @@
- - - + + + + {{#if (and @metadata.canCreateVersionData (not versionData.destroyed) (not versionData.isSecretDeleted))}} + + {{/if}} +
From 7482e08a8b21d9d7781177b5feb2448168749c84 Mon Sep 17 00:00:00 2001 From: Chelsea Shaw Date: Thu, 25 Jan 2024 17:48:16 -0600 Subject: [PATCH 21/58] replace popup-menu on pki lists --- .../addon/components/page/pki-issuer-list.hbs | 26 ++++------ .../addon/components/page/pki-key-list.hbs | 52 +++++++++---------- .../addon/templates/certificates/index.hbs | 20 ++++--- ui/lib/pki/addon/templates/roles/index.hbs | 26 ++++------ 4 files changed, 55 insertions(+), 69 deletions(-) diff --git a/ui/lib/pki/addon/components/page/pki-issuer-list.hbs b/ui/lib/pki/addon/components/page/pki-issuer-list.hbs index 95ee744127df..6774c12a1237 100644 --- a/ui/lib/pki/addon/components/page/pki-issuer-list.hbs +++ b/ui/lib/pki/addon/components/page/pki-issuer-list.hbs @@ -84,22 +84,16 @@
- - - + + + + +
diff --git a/ui/lib/pki/addon/components/page/pki-key-list.hbs b/ui/lib/pki/addon/components/page/pki-key-list.hbs index 08131d0247ce..a8d13458f422 100644 --- a/ui/lib/pki/addon/components/page/pki-key-list.hbs +++ b/ui/lib/pki/addon/components/page/pki-key-list.hbs @@ -40,32 +40,32 @@
- - - + {{#if (or @canRead @canEdit)}} + + + {{#if @canRead}} + + {{/if}} + {{#if @canEdit}} + + {{/if}} + + {{/if}}
diff --git a/ui/lib/pki/addon/templates/certificates/index.hbs b/ui/lib/pki/addon/templates/certificates/index.hbs index f14b4bb12560..96e2d394af36 100644 --- a/ui/lib/pki/addon/templates/certificates/index.hbs +++ b/ui/lib/pki/addon/templates/certificates/index.hbs @@ -26,17 +26,15 @@
- - - + + + +
diff --git a/ui/lib/pki/addon/templates/roles/index.hbs b/ui/lib/pki/addon/templates/roles/index.hbs index 265a2c192f0d..956466968c4a 100644 --- a/ui/lib/pki/addon/templates/roles/index.hbs +++ b/ui/lib/pki/addon/templates/roles/index.hbs @@ -27,22 +27,16 @@
- - - + + + + +
From c101a7f7e14d8cacba636458ddd31939206e1e7f Mon Sep 17 00:00:00 2001 From: Chelsea Shaw Date: Mon, 5 Feb 2024 14:26:25 -0600 Subject: [PATCH 22/58] fix belongsTo capabilities relationship --- ui/app/lib/attach-capabilities.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/app/lib/attach-capabilities.js b/ui/app/lib/attach-capabilities.js index 1d7430a07e21..06235284a12a 100644 --- a/ui/app/lib/attach-capabilities.js +++ b/ui/app/lib/attach-capabilities.js @@ -34,7 +34,7 @@ import { isArray } from '@ember/array'; export default function attachCapabilities(modelClass, capabilities) { const capabilityKeys = Object.keys(capabilities); const newRelationships = capabilityKeys.reduce((ret, key) => { - ret[key] = belongsTo('capabilities', { async: false, inverse: null }); + ret[key] = belongsTo('capabilities', { async: true, inverse: null }); return ret; }, {}); From 7e4b91f7aee9b5287f9e69e438288d0e94810ec5 Mon Sep 17 00:00:00 2001 From: "clairebontempo@gmail.com" Date: Tue, 6 Feb 2024 12:02:09 -0800 Subject: [PATCH 23/58] use hds::dropdown in policy list --- .../vault/cluster/policies/index.js | 10 ++- .../vault/cluster/policies/index.hbs | 84 +++++++++---------- 2 files changed, 44 insertions(+), 50 deletions(-) diff --git a/ui/app/controllers/vault/cluster/policies/index.js b/ui/app/controllers/vault/cluster/policies/index.js index 4d41580889af..4d81faa10b7f 100644 --- a/ui/app/controllers/vault/cluster/policies/index.js +++ b/ui/app/controllers/vault/cluster/policies/index.js @@ -21,8 +21,8 @@ export default Controller.extend({ filterFocused: false, - // set via the route `loading` action - isLoading: false, + isLoading: false, // set via the route `loading` action + itemToDelete: null, // set when clicking 'Delete' from popup menu // callback from HDS pagination to set the queryParams page get paginationQueryParams() { @@ -61,7 +61,8 @@ export default Controller.extend({ setFilterFocus: function (bool) { this.set('filterFocused', bool); }, - deletePolicy(model) { + deletePolicy() { + const model = this.itemToDelete; const policyType = model.get('policyType'); const name = model.id; const flash = this.flashMessages; @@ -77,7 +78,8 @@ export default Controller.extend({ flash.danger( `There was an error deleting the ${policyType.toUpperCase()} policy "${name}": ${errors}.` ); - }); + }) + .finally(() => this.set('itemToDelete', null)); }, }, }); diff --git a/ui/app/templates/vault/cluster/policies/index.hbs b/ui/app/templates/vault/cluster/policies/index.hbs index 7f477cb6bdf4..83bf7fc8c985 100644 --- a/ui/app/templates/vault/cluster/policies/index.hbs +++ b/ui/app/templates/vault/cluster/policies/index.hbs @@ -91,52 +91,34 @@
- - - + + + {{#if item.updatePath.isPending}} + + + + {{else}} + {{#if item.canRead}} + + {{/if}} + {{#if item.canEdit}} + + {{/if}} + {{#if (and item.canDelete (not-eq item.name "default"))}} + + {{/if}} + {{/if}} +
@@ -180,4 +162,14 @@ {{/if}} {{else}} +{{/if}} + +{{#if this.itemToDelete}} + {{/if}} \ No newline at end of file From db13279ab76f1104f6fe2158530aabf42a86f89f Mon Sep 17 00:00:00 2001 From: "clairebontempo@gmail.com" Date: Tue, 6 Feb 2024 12:06:54 -0800 Subject: [PATCH 24/58] fix @text args from copy pasta --- ui/app/templates/components/oidc/client-list.hbs | 2 +- ui/app/templates/components/oidc/provider-list.hbs | 2 +- ui/app/templates/vault/cluster/policies/index.hbs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ui/app/templates/components/oidc/client-list.hbs b/ui/app/templates/components/oidc/client-list.hbs index 137ad2e39584..27f00eeea09c 100644 --- a/ui/app/templates/components/oidc/client-list.hbs +++ b/ui/app/templates/components/oidc/client-list.hbs @@ -28,7 +28,7 @@ diff --git a/ui/app/templates/components/oidc/provider-list.hbs b/ui/app/templates/components/oidc/provider-list.hbs index 4c8a131b1433..d684399fb062 100644 --- a/ui/app/templates/components/oidc/provider-list.hbs +++ b/ui/app/templates/components/oidc/provider-list.hbs @@ -28,7 +28,7 @@ diff --git a/ui/app/templates/vault/cluster/policies/index.hbs b/ui/app/templates/vault/cluster/policies/index.hbs index 83bf7fc8c985..7f32962d8231 100644 --- a/ui/app/templates/vault/cluster/policies/index.hbs +++ b/ui/app/templates/vault/cluster/policies/index.hbs @@ -91,7 +91,7 @@
- + {{#if item.updatePath.isPending}} From 32978c437e90b7cf8cc0ada7ae7ad8aaf5734a2d Mon Sep 17 00:00:00 2001 From: "clairebontempo@gmail.com" Date: Tue, 6 Feb 2024 13:11:55 -0800 Subject: [PATCH 25/58] rename policy tracked property and still pass in to function --- ui/app/controllers/vault/cluster/policies/index.js | 7 +++---- ui/app/templates/vault/cluster/policies/index.hbs | 8 ++++---- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/ui/app/controllers/vault/cluster/policies/index.js b/ui/app/controllers/vault/cluster/policies/index.js index 4d81faa10b7f..355f6cd4f543 100644 --- a/ui/app/controllers/vault/cluster/policies/index.js +++ b/ui/app/controllers/vault/cluster/policies/index.js @@ -22,7 +22,7 @@ export default Controller.extend({ filterFocused: false, isLoading: false, // set via the route `loading` action - itemToDelete: null, // set when clicking 'Delete' from popup menu + policyToDelete: null, // set when clicking 'Delete' from popup menu // callback from HDS pagination to set the queryParams page get paginationQueryParams() { @@ -61,8 +61,7 @@ export default Controller.extend({ setFilterFocus: function (bool) { this.set('filterFocused', bool); }, - deletePolicy() { - const model = this.itemToDelete; + deletePolicy(model) { const policyType = model.get('policyType'); const name = model.id; const flash = this.flashMessages; @@ -79,7 +78,7 @@ export default Controller.extend({ `There was an error deleting the ${policyType.toUpperCase()} policy "${name}": ${errors}.` ); }) - .finally(() => this.set('itemToDelete', null)); + .finally(() => this.set('policyToDelete', null)); }, }, }); diff --git a/ui/app/templates/vault/cluster/policies/index.hbs b/ui/app/templates/vault/cluster/policies/index.hbs index 7f32962d8231..eb6b3a414634 100644 --- a/ui/app/templates/vault/cluster/policies/index.hbs +++ b/ui/app/templates/vault/cluster/policies/index.hbs @@ -115,7 +115,7 @@ /> {{/if}} {{#if (and item.canDelete (not-eq item.name "default"))}} - + {{/if}} {{/if}} @@ -164,12 +164,12 @@ {{/if}} -{{#if this.itemToDelete}} +{{#if this.policyToDelete}} {{/if}} \ No newline at end of file From db192c2d084f85d89c1156a1d27daff4781712ff Mon Sep 17 00:00:00 2001 From: "clairebontempo@gmail.com" Date: Tue, 6 Feb 2024 17:16:35 -0800 Subject: [PATCH 26/58] add copyright headers --- ui/app/components/secret-list/aws-role-item.js | 5 +++++ ui/app/components/secret-list/item.js | 5 +++++ ui/app/components/secret-list/ssh-role-item.js | 5 +++++ ui/lib/core/addon/components/confirm-modal.hbs | 10 ++++++++++ ui/tests/integration/components/confirm-modal-test.js | 5 +++++ .../integration/components/oidc/client-list-test.js | 5 +++++ .../integration/components/oidc/provider-list-test.js | 5 +++++ 7 files changed, 40 insertions(+) diff --git a/ui/app/components/secret-list/aws-role-item.js b/ui/app/components/secret-list/aws-role-item.js index 8b665d1ebc42..cd95580a36b7 100644 --- a/ui/app/components/secret-list/aws-role-item.js +++ b/ui/app/components/secret-list/aws-role-item.js @@ -1,3 +1,8 @@ +/** + * Copyright (c) HashiCorp, Inc. + * SPDX-License-Identifier: BUSL-1.1 + */ + import Component from '@glimmer/component'; import { tracked } from '@glimmer/tracking'; diff --git a/ui/app/components/secret-list/item.js b/ui/app/components/secret-list/item.js index f43050bd2541..db17c97fda82 100644 --- a/ui/app/components/secret-list/item.js +++ b/ui/app/components/secret-list/item.js @@ -1,3 +1,8 @@ +/** + * Copyright (c) HashiCorp, Inc. + * SPDX-License-Identifier: BUSL-1.1 + */ + import Component from '@glimmer/component'; import { tracked } from '@glimmer/tracking'; diff --git a/ui/app/components/secret-list/ssh-role-item.js b/ui/app/components/secret-list/ssh-role-item.js index 808e47c11e5e..d753751d71cf 100644 --- a/ui/app/components/secret-list/ssh-role-item.js +++ b/ui/app/components/secret-list/ssh-role-item.js @@ -1,3 +1,8 @@ +/** + * Copyright (c) HashiCorp, Inc. + * SPDX-License-Identifier: BUSL-1.1 + */ + import Component from '@glimmer/component'; import { tracked } from '@glimmer/tracking'; diff --git a/ui/lib/core/addon/components/confirm-modal.hbs b/ui/lib/core/addon/components/confirm-modal.hbs index 9df4942c3490..c6021b0bfd34 100644 --- a/ui/lib/core/addon/components/confirm-modal.hbs +++ b/ui/lib/core/addon/components/confirm-modal.hbs @@ -1,3 +1,13 @@ +{{! + Copyright (c) HashiCorp, Inc. + SPDX-License-Identifier: BUSL-1.1 +~}} + +{{! Replaces ConfirmAction in dropdowns, instead use dd.Interactive + this modal }} +{{! Destructive action confirmation modal that asks "Are you sure?" or similar @confirmTitle }} +{{! If a tracked property is used to pass the list item to the destructive action, }} +{{! remember to reset item to null via the @onClose action }} + Date: Tue, 6 Feb 2024 17:44:06 -0800 Subject: [PATCH 27/58] add changelog; --- changelog/25237.txt | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 changelog/25237.txt diff --git a/changelog/25237.txt b/changelog/25237.txt new file mode 100644 index 000000000000..247861c69caa --- /dev/null +++ b/changelog/25237.txt @@ -0,0 +1,3 @@ +```release-note:improvement +ui: Use Hds::Dropdown component to replace list view popup menus +``` \ No newline at end of file From 0fc976041f5025231c85dad12eb4f8ec7e790e49 Mon Sep 17 00:00:00 2001 From: "clairebontempo@gmail.com" Date: Tue, 6 Feb 2024 18:00:01 -0800 Subject: [PATCH 28/58] identity index and tests --- .../vault/cluster/access/identity/index.js | 9 +- ui/app/models/identity/group.js | 10 +- .../vault/cluster/access/identity/index.hbs | 122 ++++++++++-------- .../access/identity/_shared-tests.js | 15 ++- .../access/identity/entities/index-test.js | 70 +++++++++- .../pages/access/identity/aliases/index.js | 2 +- ui/tests/pages/access/identity/index.js | 2 +- 7 files changed, 154 insertions(+), 76 deletions(-) diff --git a/ui/app/controllers/vault/cluster/access/identity/index.js b/ui/app/controllers/vault/cluster/access/identity/index.js index db9da7a80abd..4bb66bf14596 100644 --- a/ui/app/controllers/vault/cluster/access/identity/index.js +++ b/ui/app/controllers/vault/cluster/access/identity/index.js @@ -10,6 +10,9 @@ import ListController from 'core/mixins/list-controller'; export default Controller.extend(ListController, { flashMessages: service(), + entityToDisable: null, + itemToDelete: null, + // callback from HDS pagination to set the queryParams page get paginationQueryParams() { return (page) => { @@ -33,6 +36,9 @@ export default Controller.extend(ListController, { this.flashMessages.success( `There was a problem deleting ${type}: ${id} - ${e.errors.join(' ') || e.message}` ); + }) + .finally(() => { + this.set('itemToDelete', null); }); }, @@ -51,7 +57,8 @@ export default Controller.extend(ListController, { this.flashMessages.success( `There was a problem ${action[1]} ${type}: ${id} - ${e.errors.join(' ') || e.message}` ); - }); + }) + .finally(() => this.set('entityToDisable', null)); }, reloadRecord(model) { model.reload(); diff --git a/ui/app/models/identity/group.js b/ui/app/models/identity/group.js index 79e5f3efe783..2f25e6ec7547 100644 --- a/ui/app/models/identity/group.js +++ b/ui/app/models/identity/group.js @@ -84,13 +84,5 @@ export default IdentityModel.extend({ canEdit: alias('updatePath.canUpdate'), aliasPath: lazyCapabilities(apiPath`identity/group-alias`), - canAddAlias: computed('aliasPath.canCreate', 'type', 'alias', function () { - const type = this.type; - const alias = this.alias; - // internal groups can't have aliases, and external groups can only have one - if (type === 'internal' || alias) { - return false; - } - return this.aliasPath.canCreate; - }), + canAddAlias: alias('aliasPath.canCreate'), }); diff --git a/ui/app/templates/vault/cluster/access/identity/index.hbs b/ui/app/templates/vault/cluster/access/identity/index.hbs index 88cd07db0461..2539bbd65254 100644 --- a/ui/app/templates/vault/cluster/access/identity/index.hbs +++ b/ui/app/templates/vault/cluster/access/identity/index.hbs @@ -9,7 +9,7 @@
@@ -32,63 +32,53 @@ {{/if}}
- - - + {{/if}} + {{#if item.canEdit}} + + {{#if item.disabled}} + + {{else if (eq this.identityType "entity")}} + + {{/if}} + {{/if}} + {{#if item.canDelete}} + + {{/if}} + {{/if}} +
@@ -117,4 +107,22 @@ @iconPosition="trailing" /> +{{/if}} + +{{#if this.entityToDisable}} + +{{/if}} + +{{#if this.itemToDelete}} + {{/if}} \ No newline at end of file diff --git a/ui/tests/acceptance/access/identity/_shared-tests.js b/ui/tests/acceptance/access/identity/_shared-tests.js index 69de4b281aa1..2558551599a3 100644 --- a/ui/tests/acceptance/access/identity/_shared-tests.js +++ b/ui/tests/acceptance/access/identity/_shared-tests.js @@ -8,7 +8,11 @@ import { selectChoose, clickTrigger } from 'ember-power-select/test-support/help import page from 'vault/tests/pages/access/identity/create'; import showPage from 'vault/tests/pages/access/identity/show'; import indexPage from 'vault/tests/pages/access/identity/index'; - +const SELECTORS = { + identityRow: (name) => `[data-test-identity-row="${name}"]`, + popupMenu: '[data-test-popup-menu-trigger]', + menuDelete: '[data-test-popup-menu="delete"]', +}; export const testCRUD = async (name, itemType, assert) => { await page.visit({ item_type: itemType }); await settled(); @@ -24,7 +28,6 @@ export const testCRUD = async (name, itemType, assert) => { `${itemType}: navigates to show on create` ); assert.ok(showPage.nameContains(name), `${itemType}: renders the name on the show page`); - await indexPage.visit({ item_type: itemType }); await settled(); assert.strictEqual( @@ -32,10 +35,10 @@ export const testCRUD = async (name, itemType, assert) => { 1, `${itemType}: lists the entity in the entity list` ); - await indexPage.items.filterBy('name', name)[0].menu(); - await waitUntil(() => find('[data-test-item-delete]')); - await indexPage.delete(); - await settled(); + + await click(`${SELECTORS.identityRow(name)} ${SELECTORS.popupMenu}`); + await waitUntil(() => find(SELECTORS.menuDelete)); + await click(SELECTORS.menuDelete); await indexPage.confirmDelete(); await settled(); assert.ok( diff --git a/ui/tests/acceptance/access/identity/entities/index-test.js b/ui/tests/acceptance/access/identity/entities/index-test.js index fa9bcc5de414..8bb80fb28fab 100644 --- a/ui/tests/acceptance/access/identity/entities/index-test.js +++ b/ui/tests/acceptance/access/identity/entities/index-test.js @@ -3,12 +3,22 @@ * SPDX-License-Identifier: BUSL-1.1 */ -import { currentRouteName } from '@ember/test-helpers'; +import { fillIn, click, currentRouteName, currentURL, visit } from '@ember/test-helpers'; import { module, test } from 'qunit'; import { setupApplicationTest } from 'ember-qunit'; import page from 'vault/tests/pages/access/identity/index'; import authPage from 'vault/tests/pages/auth'; +import { runCmd } from 'vault/tests/helpers/commands'; +import { SELECTORS as GENERAL } from 'vault/tests/helpers/general-selectors'; +import { v4 as uuidv4 } from 'uuid'; +const SELECTORS = { + listItem: (name) => `[data-test-identity-row="${name}"]`, + menu: `[data-test-popup-menu-trigger]`, + menuItem: (element) => `[data-test-popup-menu="${element}"]`, + submit: '[data-test-identity-submit]', + confirm: '[data-test-confirm-button]', +}; module('Acceptance | /access/identity/entities', function (hooks) { setupApplicationTest(hooks); @@ -33,4 +43,62 @@ module('Acceptance | /access/identity/entities', function (hooks) { 'navigates to the correct route' ); }); + + test('it renders popup menu for entities', async function (assert) { + const name = `entity-${uuidv4()}`; + await runCmd(`vault write identity/entity name="${name}" policies="default"`); + await visit('/vault/access/identity/entities'); + assert.strictEqual(currentURL(), '/vault/access/identity/entities', 'navigates to entities tab'); + + await click(`${SELECTORS.listItem(name)} ${SELECTORS.menu}`); + assert + .dom('.hds-dropdown ul') + .hasText('Details Create alias Edit Disable Delete', 'all actions render for entities'); + await click(`${SELECTORS.listItem(name)} ${SELECTORS.menuItem('delete')}`); + await click(SELECTORS.confirm); + }); + + test('it renders popup menu for external groups', async function (assert) { + const name = `external-${uuidv4()}`; + await runCmd(`vault write identity/group name="${name}" policies="default" type="external"`); + await visit('/vault/access/identity/groups'); + assert.strictEqual(currentURL(), '/vault/access/identity/groups', 'navigates to the groups tab'); + + await click(`${SELECTORS.listItem(name)} ${SELECTORS.menu}`); + assert + .dom('.hds-dropdown ul') + .hasText('Details Create alias Edit Delete', 'all actions render for external groups'); + await click(`${SELECTORS.listItem(name)} ${SELECTORS.menuItem('delete')}`); + await click(SELECTORS.confirm); + }); + + test('it renders popup menu for external groups with alias', async function (assert) { + const name = `external-hasalias-${uuidv4()}`; + await runCmd(`vault write identity/group name="${name}" policies="default" type="external"`); + await visit('/vault/access/identity/groups'); + await click(`${SELECTORS.listItem(name)} ${SELECTORS.menu}`); + await click(SELECTORS.menuItem('create alias')); + await fillIn(GENERAL.inputByAttr('name'), 'alias-test'); + await click(SELECTORS.submit); + + await visit('/vault/access/identity/groups'); + await click(`${SELECTORS.listItem(name)} ${SELECTORS.menu}`); + assert + .dom('.hds-dropdown ul') + .hasText('Details Edit Delete', 'no "Create alias" option for external groups with an alias'); + await click(`${SELECTORS.listItem(name)} ${SELECTORS.menuItem('delete')}`); + await click(SELECTORS.confirm); + }); + + test('it renders popup menu for internal groups', async function (assert) { + const name = `internal-${uuidv4()}`; + await runCmd(`vault write identity/group name="${name}" policies="default" type="internal"`); + await visit('/vault/access/identity/groups'); + await click(`${SELECTORS.listItem(name)} ${SELECTORS.menu}`); + assert + .dom('.hds-dropdown ul') + .hasText('Details Edit Delete', 'no "Create alias" option for internal groups'); + await click(`${SELECTORS.listItem(name)} ${SELECTORS.menuItem('delete')}`); + await click(SELECTORS.confirm); + }); }); diff --git a/ui/tests/pages/access/identity/aliases/index.js b/ui/tests/pages/access/identity/aliases/index.js index e43fd116d526..8fd07de9ceb1 100644 --- a/ui/tests/pages/access/identity/aliases/index.js +++ b/ui/tests/pages/access/identity/aliases/index.js @@ -13,7 +13,7 @@ export default create({ menu: clickable('[data-test-popup-menu-trigger]'), name: text('[data-test-identity-link]'), }), - delete: clickable('[data-test-item-delete]', { + delete: clickable('[data-test-popup-menu="delete"]', { testContainer: '#ember-testing', }), confirmDelete: clickable('[data-test-confirm-button]'), diff --git a/ui/tests/pages/access/identity/index.js b/ui/tests/pages/access/identity/index.js index 73367d0db1a0..a034edb77707 100644 --- a/ui/tests/pages/access/identity/index.js +++ b/ui/tests/pages/access/identity/index.js @@ -14,7 +14,7 @@ export default create({ name: text('[data-test-identity-link]'), }), - delete: clickable('[data-test-item-delete]', { + delete: clickable('[data-test-popup-menu="delete"]', { testContainer: '#ember-testing', }), confirmDelete: clickable('[data-test-confirm-button]'), From ba0bccd1e08f1c4aae52d839ca37e0a4e086eeb8 Mon Sep 17 00:00:00 2001 From: "clairebontempo@gmail.com" Date: Tue, 6 Feb 2024 18:01:17 -0800 Subject: [PATCH 29/58] oidc resources --- .../cluster/access/oidc/assignments/index.hbs | 48 +++++++++---------- .../vault/cluster/access/oidc/keys/index.hbs | 48 +++++++++---------- .../cluster/access/oidc/scopes/index.hbs | 48 +++++++++---------- 3 files changed, 66 insertions(+), 78 deletions(-) diff --git a/ui/app/templates/vault/cluster/access/oidc/assignments/index.hbs b/ui/app/templates/vault/cluster/access/oidc/assignments/index.hbs index a767d31f9fd7..a023b00d5dfb 100644 --- a/ui/app/templates/vault/cluster/access/oidc/assignments/index.hbs +++ b/ui/app/templates/vault/cluster/access/oidc/assignments/index.hbs @@ -38,32 +38,28 @@ {{#if (not-eq model.name "allow_all")}}
- - - + + + + +
{{/if}} diff --git a/ui/app/templates/vault/cluster/access/oidc/keys/index.hbs b/ui/app/templates/vault/cluster/access/oidc/keys/index.hbs index 2c81e37029f4..b0763043383d 100644 --- a/ui/app/templates/vault/cluster/access/oidc/keys/index.hbs +++ b/ui/app/templates/vault/cluster/access/oidc/keys/index.hbs @@ -28,32 +28,28 @@
- - - + + + + +
diff --git a/ui/app/templates/vault/cluster/access/oidc/scopes/index.hbs b/ui/app/templates/vault/cluster/access/oidc/scopes/index.hbs index 5642457be179..e59bfd4e8baa 100644 --- a/ui/app/templates/vault/cluster/access/oidc/scopes/index.hbs +++ b/ui/app/templates/vault/cluster/access/oidc/scopes/index.hbs @@ -29,32 +29,28 @@
- - - + + + + +
From 6b46155acf9628b5f2183ca632da3bc799ddc772 Mon Sep 17 00:00:00 2001 From: "clairebontempo@gmail.com" Date: Thu, 8 Feb 2024 15:27:26 -0800 Subject: [PATCH 30/58] test fixes for first 29 cherrypicked commits ending with: ba0bccd1e08f1c4aae52d839ca37e0a4e086eeb8o --- ui/app/templates/components/secret-list/item.hbs | 7 ++++++- ui/app/templates/vault/cluster/policies/index.hbs | 14 ++++++++++++-- ui/lib/core/addon/components/confirm-action.hbs | 2 +- .../pki/addon/components/page/pki-issuer-list.hbs | 7 ++++++- ui/tests/acceptance/mfa-method-test.js | 2 +- .../acceptance/pki/pki-engine-workflow-test.js | 4 ++-- .../backend/kv/kv-v2-workflow-edge-cases-test.js | 2 +- .../acceptance/secrets/backend/ssh/role-test.js | 2 +- ui/tests/acceptance/transit-test.js | 2 +- ui/tests/helpers/pki/workflow.js | 2 +- .../components/kv/page/kv-page-list-test.js | 2 +- .../kv/page/kv-page-version-history-test.js | 4 ++-- .../components/pki/page/pki-key-list-test.js | 8 +++----- .../components/transform-list-item-test.js | 8 ++++---- 14 files changed, 42 insertions(+), 24 deletions(-) diff --git a/ui/app/templates/components/secret-list/item.hbs b/ui/app/templates/components/secret-list/item.hbs index a4dc40ddcdf5..643cf5a530bf 100644 --- a/ui/app/templates/components/secret-list/item.hbs +++ b/ui/app/templates/components/secret-list/item.hbs @@ -62,7 +62,12 @@ /> {{/if}} {{#if @item.canDelete}} - + {{/if}} {{/if}} {{/if}} diff --git a/ui/app/templates/vault/cluster/policies/index.hbs b/ui/app/templates/vault/cluster/policies/index.hbs index eb6b3a414634..73c4a3e0875c 100644 --- a/ui/app/templates/vault/cluster/policies/index.hbs +++ b/ui/app/templates/vault/cluster/policies/index.hbs @@ -92,7 +92,12 @@
- + {{#if item.updatePath.isPending}} @@ -115,7 +120,12 @@ /> {{/if}} {{#if (and item.canDelete (not-eq item.name "default"))}} - + {{/if}} {{/if}} diff --git a/ui/lib/core/addon/components/confirm-action.hbs b/ui/lib/core/addon/components/confirm-action.hbs index 15a685c491de..019d1246fce7 100644 --- a/ui/lib/core/addon/components/confirm-action.hbs +++ b/ui/lib/core/addon/components/confirm-action.hbs @@ -32,6 +32,6 @@ @confirmTitle={{@confirmTitle}} @confirmMessage={{this.confirmMessage}} @disabledMessage={{@disabledMessage}} - @isRunning={{this.isRunning}} + @isRunning={{@isRunning}} /> {{/if}} \ No newline at end of file diff --git a/ui/lib/pki/addon/components/page/pki-issuer-list.hbs b/ui/lib/pki/addon/components/page/pki-issuer-list.hbs index 6774c12a1237..b6d5ab63f5b8 100644 --- a/ui/lib/pki/addon/components/page/pki-issuer-list.hbs +++ b/ui/lib/pki/addon/components/page/pki-issuer-list.hbs @@ -91,7 +91,12 @@ @hasChevron={{false}} data-test-popup-menu-trigger /> - +
diff --git a/ui/tests/acceptance/mfa-method-test.js b/ui/tests/acceptance/mfa-method-test.js index 107c0648f01b..afc5616ff016 100644 --- a/ui/tests/acceptance/mfa-method-test.js +++ b/ui/tests/acceptance/mfa-method-test.js @@ -255,7 +255,7 @@ module('Acceptance | mfa-method', function (hooks) { await visit('/vault/access/mfa/methods'); const id = this.element.querySelector('[data-test-mfa-method-list-item] .tag').textContent.trim(); const model = this.store.peekRecord('mfa-method', id); - await click('[data-test-mfa-method-list-item] .ember-basic-dropdown-trigger'); + await click('[data-test-mfa-method-list-item] [data-test-popup-menu-trigger]'); await click('[data-test-mfa-method-menu-link="edit"]'); const keys = ['issuer', 'period', 'key_size', 'qr_size', 'algorithm', 'digits', 'skew']; diff --git a/ui/tests/acceptance/pki/pki-engine-workflow-test.js b/ui/tests/acceptance/pki/pki-engine-workflow-test.js index de3a2bf81150..395bf41c19a4 100644 --- a/ui/tests/acceptance/pki/pki-engine-workflow-test.js +++ b/ui/tests/acceptance/pki/pki-engine-workflow-test.js @@ -319,7 +319,7 @@ module('Acceptance | pki workflow', function (hooks) { ); }); - test('it hide corrects actions for user with read policy', async function (assert) { + test('it hides correct actions for user with read policy', async function (assert) { await authPage.login(this.pkiKeyReader); await visit(`/vault/secrets/${this.mountPath}/pki/overview`); await click(SELECTORS.keysTab); @@ -330,7 +330,7 @@ module('Acceptance | pki workflow', function (hooks) { assert.dom('.linked-block').exists({ count: 1 }, 'One key is in list'); const keyId = find(SELECTORS.keyPages.keyId).innerText; await click(SELECTORS.keyPages.popupMenuTrigger); - assert.dom(SELECTORS.keyPages.popupMenuEdit).hasClass('disabled', 'popup menu edit link is disabled'); + assert.dom(SELECTORS.keyPages.popupMenuEdit).doesNotExist('popup menu edit link is not shown'); await click(SELECTORS.keyPages.popupMenuDetails); assert.strictEqual(currentURL(), `/vault/secrets/${this.mountPath}/pki/keys/${keyId}/details`); assert.dom(SELECTORS.keyPages.keyDeleteButton).doesNotExist('Delete key button is not shown'); diff --git a/ui/tests/acceptance/secrets/backend/kv/kv-v2-workflow-edge-cases-test.js b/ui/tests/acceptance/secrets/backend/kv/kv-v2-workflow-edge-cases-test.js index 3ea21ed28e78..bf94b8018838 100644 --- a/ui/tests/acceptance/secrets/backend/kv/kv-v2-workflow-edge-cases-test.js +++ b/ui/tests/acceptance/secrets/backend/kv/kv-v2-workflow-edge-cases-test.js @@ -117,7 +117,7 @@ module('Acceptance | kv-v2 workflow | edge cases', function (hooks) { assert.dom(PAGE.secretTab('Metadata')).doesNotHaveClass('active'); assert.dom(PAGE.secretTab('Version History')).hasText('Version History'); assert.dom(PAGE.secretTab('Version History')).doesNotHaveClass('active'); - assert.dom(PAGE.toolbarAction).exists({ count: 5 }, 'toolbar renders all actions'); + assert.dom(PAGE.toolbarAction).exists({ count: 4 }, 'toolbar renders all actions'); }); test('it navigates back to engine index route via breadcrumbs from secret details', async function (assert) { diff --git a/ui/tests/acceptance/secrets/backend/ssh/role-test.js b/ui/tests/acceptance/secrets/backend/ssh/role-test.js index fee830da1bbe..f4d3ab8d932c 100644 --- a/ui/tests/acceptance/secrets/backend/ssh/role-test.js +++ b/ui/tests/acceptance/secrets/backend/ssh/role-test.js @@ -59,7 +59,7 @@ module('Acceptance | secrets/ssh', function (hooks) { assert.strictEqual(listPage.secrets.length, 1, 'shows role in the list'); const secret = listPage.secrets.objectAt(0); await secret.menuToggle(); - assert.ok(listPage.menuItems.length > 0, 'shows links in the menu'); + assert.dom('.hds-dropdown li').exists({ count: 5 }, 'Renders 5 popup menu items'); }); test('it deletes a role', async function (assert) { diff --git a/ui/tests/acceptance/transit-test.js b/ui/tests/acceptance/transit-test.js index 82d89de6e01e..4587150a2523 100644 --- a/ui/tests/acceptance/transit-test.js +++ b/ui/tests/acceptance/transit-test.js @@ -244,7 +244,7 @@ module('Acceptance | transit (flaky)', function (hooks) { assert.dom(SELECTORS.infoRow('Convergent encryption')).hasText('Yes'); await click(SELECTORS.rootCrumb(this.path)); await click(SELECTORS.popupMenu); - const actions = findAll('.ember-basic-dropdown-content li'); + const actions = findAll('.hds-dropdown__list li'); assert.strictEqual(actions.length, 2, 'shows 2 items in popup menu'); await click(SELECTORS.secretLink); diff --git a/ui/tests/helpers/pki/workflow.js b/ui/tests/helpers/pki/workflow.js index d0c1676898f4..c962265dd630 100644 --- a/ui/tests/helpers/pki/workflow.js +++ b/ui/tests/helpers/pki/workflow.js @@ -57,7 +57,7 @@ export const SELECTORS = { generateIssuerRoot: '[data-test-generate-issuer="root"]', generateIssuerIntermediate: '[data-test-generate-issuer="intermediate"]', issuerPopupMenu: '[data-test-popup-menu-trigger]', - issuerPopupDetails: '[data-test-popup-menu-details] a', + issuerPopupDetails: '[data-test-popup-menu-details]', issuerDetails: { title: '[data-test-pki-issuer-page-title]', ...ISSUERDETAILS, diff --git a/ui/tests/integration/components/kv/page/kv-page-list-test.js b/ui/tests/integration/components/kv/page/kv-page-list-test.js index 001a6cfad324..12c8de3abd04 100644 --- a/ui/tests/integration/components/kv/page/kv-page-list-test.js +++ b/ui/tests/integration/components/kv/page/kv-page-list-test.js @@ -90,7 +90,7 @@ module('Integration | Component | kv | Page::List', function (hooks) { const popupSelector = `${PAGE.list.item('my-secret-0')} ${PAGE.popup}`; await click(popupSelector); - await click('[data-test-confirm-action-trigger]'); + await click('[data-test-popup-metadata-delete]'); await click('[data-test-confirm-button]'); assert.dom(PAGE.list.item('my-secret-0')).doesNotExist('deleted the first record from the list'); }); diff --git a/ui/tests/integration/components/kv/page/kv-page-version-history-test.js b/ui/tests/integration/components/kv/page/kv-page-version-history-test.js index 012dadbded24..6461d6d0a64b 100644 --- a/ui/tests/integration/components/kv/page/kv-page-version-history-test.js +++ b/ui/tests/integration/components/kv/page/kv-page-version-history-test.js @@ -87,10 +87,10 @@ module('Integration | Component | kv | Page::Secret::Metadata::Version-History', { owner: this.engine } ); // because the popup menu is nested in a linked block we must combine the two selectors - const popupSelector = `${PAGE.versions.linkedBlock(2)} ${PAGE.popup}`; + const popupSelector = `${PAGE.versions.linkedBlock(1)} ${PAGE.popup}`; await click(popupSelector); assert - .dom('[data-test-create-new-version-from="2"]') + .dom('[data-test-create-new-version-from="1"]') .exists('Shows the option to create a new version from that secret.'); }); }); diff --git a/ui/tests/integration/components/pki/page/pki-key-list-test.js b/ui/tests/integration/components/pki/page/pki-key-list-test.js index 2562d28c4eda..a9f56c301531 100644 --- a/ui/tests/integration/components/pki/page/pki-key-list-test.js +++ b/ui/tests/integration/components/pki/page/pki-key-list-test.js @@ -91,8 +91,8 @@ module('Integration | Component | pki key list page', function (hooks) { assert.dom(SELECTORS.popupMenuEdit).exists('edit link exists'); }); - test('it hides or disables actions when permission denied', async function (assert) { - assert.expect(4); + test('it hides actions when permission denied', async function (assert) { + assert.expect(3); await render( hbs` `); assert.dom('[data-test-secret-link="template/foo"]').exists('shows clickable list item'); - await click('button.popup-menu-trigger'); - assert.dom('.popup-menu-content li').exists({ count: 1 }, 'has one option'); + await click('[data-test-popup-menu-trigger]'); + assert.dom('.hds-dropdown li').exists({ count: 1 }, 'has one option'); }); test('it has details and edit menu item if read & edit capabilities', async function (assert) { @@ -76,8 +76,8 @@ module('Integration | Component | transform-list-item', function (hooks) { />`); assert.dom('[data-test-secret-link="alphabet/foo"]').exists('shows clickable list item'); - await click('button.popup-menu-trigger'); - assert.dom('.popup-menu-content li').exists({ count: 2 }, 'has both options'); + await click('[data-test-popup-menu-trigger]'); + assert.dom('.hds-dropdown li').exists({ count: 2 }, 'has both options'); }); test('it is not clickable if built-in template with all capabilities', async function (assert) { From 1a66fb9b610af3635729a23152674666614ec6fd Mon Sep 17 00:00:00 2001 From: "clairebontempo@gmail.com" Date: Thu, 8 Feb 2024 15:30:01 -0800 Subject: [PATCH 31/58] cherry-pick of 'auth method and secret engines popup menus' and skip mfa-setup test --- .../vault/cluster/access/methods.js | 3 + .../vault/cluster/secrets/backends.js | 3 + .../vault/cluster/access/methods.hbs | 63 ++++++++++--------- .../vault/cluster/secrets/backends.hbs | 50 ++++++++------- ui/tests/acceptance/mfa-setup-test.js | 4 +- 5 files changed, 71 insertions(+), 52 deletions(-) diff --git a/ui/app/controllers/vault/cluster/access/methods.js b/ui/app/controllers/vault/cluster/access/methods.js index 74d8a39051cc..f5c697cb2318 100644 --- a/ui/app/controllers/vault/cluster/access/methods.js +++ b/ui/app/controllers/vault/cluster/access/methods.js @@ -15,6 +15,7 @@ export default class VaultClusterAccessMethodsController extends Controller { @tracked authMethodOptions = []; @tracked selectedAuthType = null; @tracked selectedAuthName = null; + @tracked methodToDisable = null; queryParams = ['page, pageFilter']; @@ -80,6 +81,8 @@ export default class VaultClusterAccessMethodsController extends Controller { this.flashMessages.danger( `There was an error disabling Auth Method at ${path}: ${err.errors.join(' ')}.` ); + } finally { + this.methodToDisable = null; } } } diff --git a/ui/app/controllers/vault/cluster/secrets/backends.js b/ui/app/controllers/vault/cluster/secrets/backends.js index a24396f7ba57..8c8d7f10c6ad 100644 --- a/ui/app/controllers/vault/cluster/secrets/backends.js +++ b/ui/app/controllers/vault/cluster/secrets/backends.js @@ -17,6 +17,7 @@ export default class VaultClusterSecretsBackendController extends Controller { @tracked secretEngineOptions = []; @tracked selectedEngineType = null; @tracked selectedEngineName = null; + @tracked engineToDisable = null; get sortedDisplayableBackends() { // show supported secret engines first and then organize those by id. @@ -80,6 +81,8 @@ export default class VaultClusterSecretsBackendController extends Controller { this.flashMessages.danger( `There was an error disabling the ${engineType} Secrets Engine at ${path}: ${err.errors.join(' ')}.` ); + } finally { + this.engineToDisable = null; } } } diff --git a/ui/app/templates/vault/cluster/access/methods.hbs b/ui/app/templates/vault/cluster/access/methods.hbs index b03a63afd0a3..2ba915b69897 100644 --- a/ui/app/templates/vault/cluster/access/methods.hbs +++ b/ui/app/templates/vault/cluster/access/methods.hbs @@ -69,36 +69,41 @@
- - - + + + + {{#if method.canEdit}} + + {{/if}} + {{#if (and (not-eq method.methodType "token") method.canDisable)}} + + {{/if}} +
-{{/each}} \ No newline at end of file +{{/each}} + +{{#if this.methodToDisable}} + +{{/if}} \ No newline at end of file diff --git a/ui/app/templates/vault/cluster/secrets/backends.hbs b/ui/app/templates/vault/cluster/secrets/backends.hbs index 352bc4e5d9bf..c2f8b9e4f0f1 100644 --- a/ui/app/templates/vault/cluster/secrets/backends.hbs +++ b/ui/app/templates/vault/cluster/secrets/backends.hbs @@ -86,28 +86,34 @@ {{/if}} - {{! meatball sandwich menu }}
- - - + + + + {{#if (not-eq backend.type "cubbyhole")}} + + {{/if}} +
-{{/each}} \ No newline at end of file +{{/each}} + +{{#if this.engineToDisable}} + +{{/if}} \ No newline at end of file diff --git a/ui/tests/acceptance/mfa-setup-test.js b/ui/tests/acceptance/mfa-setup-test.js index abfcf7e80a9a..ab06097d31b9 100644 --- a/ui/tests/acceptance/mfa-setup-test.js +++ b/ui/tests/acceptance/mfa-setup-test.js @@ -40,7 +40,9 @@ const setupUser = async function (path) { await click('[data-test-save-config="true"]'); }; -module('Acceptance | mfa-setup', function (hooks) { +// skipping because implementing Hds::Dropdown in the method list caused unrelated(?!) test failures +// erroring on authPage.logout() in beforeEach: Error: Assertion Failed: Expected a stable identifier +module.skip('Acceptance | mfa-setup', function (hooks) { setupApplicationTest(hooks); setupMirage(hooks); From e4bfed2a796348dc1cccadfaca9a59701b8c3bbb Mon Sep 17 00:00:00 2001 From: "clairebontempo@gmail.com" Date: Thu, 8 Feb 2024 15:42:39 -0800 Subject: [PATCH 32/58] rename changelog add one more copyright header --- changelog/{25237.txt => 25321.txt} | 0 ui/app/templates/vault/cluster/secrets/backends.hbs | 7 ++++++- 2 files changed, 6 insertions(+), 1 deletion(-) rename changelog/{25237.txt => 25321.txt} (100%) diff --git a/changelog/25237.txt b/changelog/25321.txt similarity index 100% rename from changelog/25237.txt rename to changelog/25321.txt diff --git a/ui/app/templates/vault/cluster/secrets/backends.hbs b/ui/app/templates/vault/cluster/secrets/backends.hbs index c2f8b9e4f0f1..5a86dd7e446c 100644 --- a/ui/app/templates/vault/cluster/secrets/backends.hbs +++ b/ui/app/templates/vault/cluster/secrets/backends.hbs @@ -101,7 +101,12 @@ data-test-engine-config /> {{#if (not-eq backend.type "cubbyhole")}} - + {{/if}}
From c7c48e468857ba141480275022f4f8f3411306a8 Mon Sep 17 00:00:00 2001 From: "clairebontempo@gmail.com" Date: Thu, 8 Feb 2024 15:42:58 -0800 Subject: [PATCH 33/58] whoops theres the header --- ui/lib/core/app/components/confirm-modal.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ui/lib/core/app/components/confirm-modal.js b/ui/lib/core/app/components/confirm-modal.js index 96b3a726e313..e4ceff2d8c1d 100644 --- a/ui/lib/core/app/components/confirm-modal.js +++ b/ui/lib/core/app/components/confirm-modal.js @@ -1 +1,6 @@ +/** + * Copyright (c) HashiCorp, Inc. + * SPDX-License-Identifier: BUSL-1.1 + */ + export { default } from 'core/components/confirm-modal'; From 77186bfe660fb00af721b4ac9c32b39c614beee8 Mon Sep 17 00:00:00 2001 From: "clairebontempo@gmail.com" Date: Thu, 8 Feb 2024 15:48:51 -0800 Subject: [PATCH 34/58] fix stable identifier issue in auth backend list: userpass secret backend --- ui/tests/acceptance/auth-list-test.js | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/ui/tests/acceptance/auth-list-test.js b/ui/tests/acceptance/auth-list-test.js index 491800463b1e..626f6dba857d 100644 --- a/ui/tests/acceptance/auth-list-test.js +++ b/ui/tests/acceptance/auth-list-test.js @@ -27,24 +27,25 @@ const SELECTORS = { module('Acceptance | auth backend list', function (hooks) { setupApplicationTest(hooks); - hooks.beforeEach(async function () { - await authPage.login(); + hooks.beforeEach(function () { + return authPage.login(); + }); + + // hooks.afterEach(async function () { + // await authPage.login(); + // await runCmd([deleteAuthCmd(this.path1), deleteAuthCmd(this.path2)], false); + // return; + // }); + + test('userpass secret backend', async function (assert) { + assert.expect(5); this.path1 = `userpass-${uuidv4()}`; this.path2 = `userpass-${uuidv4()}`; this.user1 = 'user1'; this.user2 = 'user2'; await runCmd([mountAuthCmd('userpass', this.path1), mountAuthCmd('userpass', this.path2)], false); - }); - hooks.afterEach(async function () { - await authPage.login(); - await runCmd([deleteAuthCmd(this.path1), deleteAuthCmd(this.path2)], false); - return; - }); - - test('userpass secret backend', async function (assert) { - assert.expect(5); // enable a user in first userpass backend await visit('/vault/access'); await click(SELECTORS.backendLink(this.path1)); @@ -72,6 +73,8 @@ module('Acceptance | auth backend list', function (hooks) { await click(SELECTORS.methods); await click(SELECTORS.backendLink(this.path1)); assert.dom(SELECTORS.listItem).hasText(this.user1, 'user1 exists in the list'); + + await runCmd([deleteAuthCmd(this.path1), deleteAuthCmd(this.path2)], false); }); test('auth methods are linkable and link to correct view', async function (assert) { From 37b48ee3a079f8d204744b00182febb93bfd531d Mon Sep 17 00:00:00 2001 From: "clairebontempo@gmail.com" Date: Tue, 6 Feb 2024 18:34:10 -0800 Subject: [PATCH 35/58] custom message list --- .../addon/components/messages/page/list.hbs | 47 ++++++++++--------- .../addon/components/messages/page/list.js | 3 ++ 2 files changed, 28 insertions(+), 22 deletions(-) diff --git a/ui/lib/config-ui/addon/components/messages/page/list.hbs b/ui/lib/config-ui/addon/components/messages/page/list.hbs index f105c25ab24e..c40b37f38abc 100644 --- a/ui/lib/config-ui/addon/components/messages/page/list.hbs +++ b/ui/lib/config-ui/addon/components/messages/page/list.hbs @@ -56,28 +56,22 @@
- - - + {{#if (or message.canEditCustomMessages message.canDeleteCustomMessages)}} + + + {{#if message.canEditCustomMessages}} + + {{/if}} + {{#if message.canDeleteCustomMessages}} + + {{/if}} + + {{/if}}
@@ -117,4 +111,13 @@
+{{/if}} + +{{#if this.messageToDelete}} + {{/if}} \ No newline at end of file diff --git a/ui/lib/config-ui/addon/components/messages/page/list.js b/ui/lib/config-ui/addon/components/messages/page/list.js index f97e477555b5..6ed34a1e4b03 100644 --- a/ui/lib/config-ui/addon/components/messages/page/list.js +++ b/ui/lib/config-ui/addon/components/messages/page/list.js @@ -30,6 +30,7 @@ export default class MessagesList extends Component { @service customMessages; @tracked showMaxMessageModal = false; + @tracked messageToDelete = null; // This follows the pattern in sync/addon/components/secrets/page/destinations for FilterInput. // Currently, FilterInput doesn't do a full page refresh causing it to lose focus. @@ -110,6 +111,8 @@ export default class MessagesList extends Component { } catch (e) { const message = errorMessage(e); this.flashMessages.danger(message); + } finally { + this.messageToDelete = null; } } From b5fc951dbd2673d28598c7ad2086a5885802cfce Mon Sep 17 00:00:00 2001 From: "clairebontempo@gmail.com" Date: Tue, 6 Feb 2024 18:39:52 -0800 Subject: [PATCH 36/58] secondary menu; --- .../addon/controllers/application.js | 4 +- .../templates/mode/secondaries/index.hbs | 61 ++++++++++--------- 2 files changed, 36 insertions(+), 29 deletions(-) diff --git a/ui/lib/replication/addon/controllers/application.js b/ui/lib/replication/addon/controllers/application.js index ed72429dd1cb..a4674791d903 100644 --- a/ui/lib/replication/addon/controllers/application.js +++ b/ui/lib/replication/addon/controllers/application.js @@ -31,6 +31,7 @@ export default Controller.extend(copy(DEFAULTS, true), { store: service(), rm: service('replication-mode'), replicationMode: alias('rm.mode'), + secondaryToRevoke: null, submitError(e) { if (e.errors) { @@ -114,7 +115,8 @@ export default Controller.extend(copy(DEFAULTS, true), { }); }, (...args) => this.submitError(...args) - ); + ) + .finally(() => this.set('secondaryToRevoke', null)); }, actions: { diff --git a/ui/lib/replication/addon/templates/mode/secondaries/index.hbs b/ui/lib/replication/addon/templates/mode/secondaries/index.hbs index d41be803a22e..f1ae89493ac4 100644 --- a/ui/lib/replication/addon/templates/mode/secondaries/index.hbs +++ b/ui/lib/replication/addon/templates/mode/secondaries/index.hbs @@ -29,34 +29,29 @@
{{#if (or (eq this.replicationMode "performance") this.model.canRevokeSecondary)}} - - - + + + {{#if (eq this.replicationMode "performance")}} + + {{/if}} + {{#if this.model.canRevokeSecondary}} + + {{/if}} + {{/if}}
@@ -76,4 +71,14 @@ /> {{/if}} +{{/if}} + +{{#if this.secondaryToRevoke}} + {{/if}} \ No newline at end of file From fbfa01adde39f561d45dbdf59b7f712b3ae518e3 Mon Sep 17 00:00:00 2001 From: "clairebontempo@gmail.com" Date: Tue, 6 Feb 2024 18:40:06 -0800 Subject: [PATCH 37/58] wizard popup --- ui/app/templates/components/wizard-content.hbs | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/ui/app/templates/components/wizard-content.hbs b/ui/app/templates/components/wizard-content.hbs index e189376fea78..448b92ccb9d8 100644 --- a/ui/app/templates/components/wizard-content.hbs +++ b/ui/app/templates/components/wizard-content.hbs @@ -5,15 +5,10 @@
{{#unless this.hidePopup}} - - - + + + + {{/unless}}

From 66854a995171fc3f6e0be5134102be774a461983 Mon Sep 17 00:00:00 2001 From: "clairebontempo@gmail.com" Date: Thu, 8 Feb 2024 16:11:13 -0800 Subject: [PATCH 38/58] Revert "wizard popup" This reverts commit fbfa01adde39f561d45dbdf59b7f712b3ae518e3. --- ui/app/templates/components/wizard-content.hbs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/ui/app/templates/components/wizard-content.hbs b/ui/app/templates/components/wizard-content.hbs index 448b92ccb9d8..e189376fea78 100644 --- a/ui/app/templates/components/wizard-content.hbs +++ b/ui/app/templates/components/wizard-content.hbs @@ -5,10 +5,15 @@
{{#unless this.hidePopup}} - - - - + + + {{/unless}}

From ebc96b7a5962f43a404d276605e9a7d078b7ee88 Mon Sep 17 00:00:00 2001 From: "clairebontempo@gmail.com" Date: Thu, 8 Feb 2024 16:11:25 -0800 Subject: [PATCH 39/58] Revert "secondary menu;" This reverts commit b5fc951dbd2673d28598c7ad2086a5885802cfce. --- .../addon/controllers/application.js | 4 +- .../templates/mode/secondaries/index.hbs | 61 +++++++++---------- 2 files changed, 29 insertions(+), 36 deletions(-) diff --git a/ui/lib/replication/addon/controllers/application.js b/ui/lib/replication/addon/controllers/application.js index a4674791d903..ed72429dd1cb 100644 --- a/ui/lib/replication/addon/controllers/application.js +++ b/ui/lib/replication/addon/controllers/application.js @@ -31,7 +31,6 @@ export default Controller.extend(copy(DEFAULTS, true), { store: service(), rm: service('replication-mode'), replicationMode: alias('rm.mode'), - secondaryToRevoke: null, submitError(e) { if (e.errors) { @@ -115,8 +114,7 @@ export default Controller.extend(copy(DEFAULTS, true), { }); }, (...args) => this.submitError(...args) - ) - .finally(() => this.set('secondaryToRevoke', null)); + ); }, actions: { diff --git a/ui/lib/replication/addon/templates/mode/secondaries/index.hbs b/ui/lib/replication/addon/templates/mode/secondaries/index.hbs index f1ae89493ac4..d41be803a22e 100644 --- a/ui/lib/replication/addon/templates/mode/secondaries/index.hbs +++ b/ui/lib/replication/addon/templates/mode/secondaries/index.hbs @@ -29,29 +29,34 @@

{{#if (or (eq this.replicationMode "performance") this.model.canRevokeSecondary)}} - - - {{#if (eq this.replicationMode "performance")}} - - {{/if}} - {{#if this.model.canRevokeSecondary}} - - {{/if}} - + + + {{/if}}

@@ -71,14 +76,4 @@ /> {{/if}} -{{/if}} - -{{#if this.secondaryToRevoke}} - {{/if}} \ No newline at end of file From 14253ffa4d9e097507a5efd17bb960879d1639bb Mon Sep 17 00:00:00 2001 From: "clairebontempo@gmail.com" Date: Thu, 8 Feb 2024 16:12:11 -0800 Subject: [PATCH 40/58] Revert "custom message list" This reverts commit 37b48ee3a079f8d204744b00182febb93bfd531d. --- .../addon/components/messages/page/list.hbs | 47 +++++++++---------- .../addon/components/messages/page/list.js | 3 -- 2 files changed, 22 insertions(+), 28 deletions(-) diff --git a/ui/lib/config-ui/addon/components/messages/page/list.hbs b/ui/lib/config-ui/addon/components/messages/page/list.hbs index c40b37f38abc..f105c25ab24e 100644 --- a/ui/lib/config-ui/addon/components/messages/page/list.hbs +++ b/ui/lib/config-ui/addon/components/messages/page/list.hbs @@ -56,22 +56,28 @@
- {{#if (or message.canEditCustomMessages message.canDeleteCustomMessages)}} - - - {{#if message.canEditCustomMessages}} - - {{/if}} - {{#if message.canDeleteCustomMessages}} - - {{/if}} - - {{/if}} + + +
@@ -111,13 +117,4 @@
-{{/if}} - -{{#if this.messageToDelete}} - {{/if}} \ No newline at end of file diff --git a/ui/lib/config-ui/addon/components/messages/page/list.js b/ui/lib/config-ui/addon/components/messages/page/list.js index 6ed34a1e4b03..f97e477555b5 100644 --- a/ui/lib/config-ui/addon/components/messages/page/list.js +++ b/ui/lib/config-ui/addon/components/messages/page/list.js @@ -30,7 +30,6 @@ export default class MessagesList extends Component { @service customMessages; @tracked showMaxMessageModal = false; - @tracked messageToDelete = null; // This follows the pattern in sync/addon/components/secrets/page/destinations for FilterInput. // Currently, FilterInput doesn't do a full page refresh causing it to lose focus. @@ -111,8 +110,6 @@ export default class MessagesList extends Component { } catch (e) { const message = errorMessage(e); this.flashMessages.danger(message); - } finally { - this.messageToDelete = null; } } From 8aa9e93534d3472569590769a051268dbd8c502e Mon Sep 17 00:00:00 2001 From: "clairebontempo@gmail.com" Date: Thu, 8 Feb 2024 16:27:34 -0800 Subject: [PATCH 41/58] Revert "fix stable identifier issue in auth backend list: userpass secret backend" This reverts commit 77186bfe660fb00af721b4ac9c32b39c614beee8. --- ui/tests/acceptance/auth-list-test.js | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/ui/tests/acceptance/auth-list-test.js b/ui/tests/acceptance/auth-list-test.js index 626f6dba857d..491800463b1e 100644 --- a/ui/tests/acceptance/auth-list-test.js +++ b/ui/tests/acceptance/auth-list-test.js @@ -27,25 +27,24 @@ const SELECTORS = { module('Acceptance | auth backend list', function (hooks) { setupApplicationTest(hooks); - hooks.beforeEach(function () { - return authPage.login(); - }); - - // hooks.afterEach(async function () { - // await authPage.login(); - // await runCmd([deleteAuthCmd(this.path1), deleteAuthCmd(this.path2)], false); - // return; - // }); - - test('userpass secret backend', async function (assert) { - assert.expect(5); + hooks.beforeEach(async function () { + await authPage.login(); this.path1 = `userpass-${uuidv4()}`; this.path2 = `userpass-${uuidv4()}`; this.user1 = 'user1'; this.user2 = 'user2'; await runCmd([mountAuthCmd('userpass', this.path1), mountAuthCmd('userpass', this.path2)], false); + }); + hooks.afterEach(async function () { + await authPage.login(); + await runCmd([deleteAuthCmd(this.path1), deleteAuthCmd(this.path2)], false); + return; + }); + + test('userpass secret backend', async function (assert) { + assert.expect(5); // enable a user in first userpass backend await visit('/vault/access'); await click(SELECTORS.backendLink(this.path1)); @@ -73,8 +72,6 @@ module('Acceptance | auth backend list', function (hooks) { await click(SELECTORS.methods); await click(SELECTORS.backendLink(this.path1)); assert.dom(SELECTORS.listItem).hasText(this.user1, 'user1 exists in the list'); - - await runCmd([deleteAuthCmd(this.path1), deleteAuthCmd(this.path2)], false); }); test('auth methods are linkable and link to correct view', async function (assert) { From f0db94c0c67a0a7964f7e8dc8a3dbbe167bc456f Mon Sep 17 00:00:00 2001 From: "clairebontempo@gmail.com" Date: Thu, 8 Feb 2024 16:30:49 -0800 Subject: [PATCH 42/58] Revert "whoops theres the header" This reverts commit c7c48e468857ba141480275022f4f8f3411306a8. --- ui/lib/core/app/components/confirm-modal.js | 5 ----- 1 file changed, 5 deletions(-) diff --git a/ui/lib/core/app/components/confirm-modal.js b/ui/lib/core/app/components/confirm-modal.js index e4ceff2d8c1d..96b3a726e313 100644 --- a/ui/lib/core/app/components/confirm-modal.js +++ b/ui/lib/core/app/components/confirm-modal.js @@ -1,6 +1 @@ -/** - * Copyright (c) HashiCorp, Inc. - * SPDX-License-Identifier: BUSL-1.1 - */ - export { default } from 'core/components/confirm-modal'; From 81d27486c5b901ede6872670610bfff16fc1493d Mon Sep 17 00:00:00 2001 From: "clairebontempo@gmail.com" Date: Thu, 8 Feb 2024 16:31:02 -0800 Subject: [PATCH 43/58] Revert "rename changelog add one more copyright header" This reverts commit e4bfed2a796348dc1cccadfaca9a59701b8c3bbb. --- changelog/{25321.txt => 25237.txt} | 0 ui/app/templates/vault/cluster/secrets/backends.hbs | 7 +------ 2 files changed, 1 insertion(+), 6 deletions(-) rename changelog/{25321.txt => 25237.txt} (100%) diff --git a/changelog/25321.txt b/changelog/25237.txt similarity index 100% rename from changelog/25321.txt rename to changelog/25237.txt diff --git a/ui/app/templates/vault/cluster/secrets/backends.hbs b/ui/app/templates/vault/cluster/secrets/backends.hbs index 5a86dd7e446c..c2f8b9e4f0f1 100644 --- a/ui/app/templates/vault/cluster/secrets/backends.hbs +++ b/ui/app/templates/vault/cluster/secrets/backends.hbs @@ -101,12 +101,7 @@ data-test-engine-config /> {{#if (not-eq backend.type "cubbyhole")}} - + {{/if}} From f810938e126eeccbaf5b293bbf4bb1d77a1a267b Mon Sep 17 00:00:00 2001 From: "clairebontempo@gmail.com" Date: Thu, 8 Feb 2024 16:31:14 -0800 Subject: [PATCH 44/58] Revert "cherry-pick of 'auth method and secret engines popup menus' and skip mfa-setup test" This reverts commit 1a66fb9b610af3635729a23152674666614ec6fd. --- .../vault/cluster/access/methods.js | 3 - .../vault/cluster/secrets/backends.js | 3 - .../vault/cluster/access/methods.hbs | 63 +++++++++---------- .../vault/cluster/secrets/backends.hbs | 50 +++++++-------- ui/tests/acceptance/mfa-setup-test.js | 4 +- 5 files changed, 52 insertions(+), 71 deletions(-) diff --git a/ui/app/controllers/vault/cluster/access/methods.js b/ui/app/controllers/vault/cluster/access/methods.js index f5c697cb2318..74d8a39051cc 100644 --- a/ui/app/controllers/vault/cluster/access/methods.js +++ b/ui/app/controllers/vault/cluster/access/methods.js @@ -15,7 +15,6 @@ export default class VaultClusterAccessMethodsController extends Controller { @tracked authMethodOptions = []; @tracked selectedAuthType = null; @tracked selectedAuthName = null; - @tracked methodToDisable = null; queryParams = ['page, pageFilter']; @@ -81,8 +80,6 @@ export default class VaultClusterAccessMethodsController extends Controller { this.flashMessages.danger( `There was an error disabling Auth Method at ${path}: ${err.errors.join(' ')}.` ); - } finally { - this.methodToDisable = null; } } } diff --git a/ui/app/controllers/vault/cluster/secrets/backends.js b/ui/app/controllers/vault/cluster/secrets/backends.js index 8c8d7f10c6ad..a24396f7ba57 100644 --- a/ui/app/controllers/vault/cluster/secrets/backends.js +++ b/ui/app/controllers/vault/cluster/secrets/backends.js @@ -17,7 +17,6 @@ export default class VaultClusterSecretsBackendController extends Controller { @tracked secretEngineOptions = []; @tracked selectedEngineType = null; @tracked selectedEngineName = null; - @tracked engineToDisable = null; get sortedDisplayableBackends() { // show supported secret engines first and then organize those by id. @@ -81,8 +80,6 @@ export default class VaultClusterSecretsBackendController extends Controller { this.flashMessages.danger( `There was an error disabling the ${engineType} Secrets Engine at ${path}: ${err.errors.join(' ')}.` ); - } finally { - this.engineToDisable = null; } } } diff --git a/ui/app/templates/vault/cluster/access/methods.hbs b/ui/app/templates/vault/cluster/access/methods.hbs index 2ba915b69897..b03a63afd0a3 100644 --- a/ui/app/templates/vault/cluster/access/methods.hbs +++ b/ui/app/templates/vault/cluster/access/methods.hbs @@ -69,41 +69,36 @@
- - - - {{#if method.canEdit}} - - {{/if}} - {{#if (and (not-eq method.methodType "token") method.canDisable)}} - - {{/if}} - + + +
-{{/each}} - -{{#if this.methodToDisable}} - -{{/if}} \ No newline at end of file +{{/each}} \ No newline at end of file diff --git a/ui/app/templates/vault/cluster/secrets/backends.hbs b/ui/app/templates/vault/cluster/secrets/backends.hbs index c2f8b9e4f0f1..352bc4e5d9bf 100644 --- a/ui/app/templates/vault/cluster/secrets/backends.hbs +++ b/ui/app/templates/vault/cluster/secrets/backends.hbs @@ -86,34 +86,28 @@ {{/if}} + {{! meatball sandwich menu }}
- - - - {{#if (not-eq backend.type "cubbyhole")}} - - {{/if}} - + + +
-{{/each}} - -{{#if this.engineToDisable}} - -{{/if}} \ No newline at end of file +{{/each}} \ No newline at end of file diff --git a/ui/tests/acceptance/mfa-setup-test.js b/ui/tests/acceptance/mfa-setup-test.js index ab06097d31b9..abfcf7e80a9a 100644 --- a/ui/tests/acceptance/mfa-setup-test.js +++ b/ui/tests/acceptance/mfa-setup-test.js @@ -40,9 +40,7 @@ const setupUser = async function (path) { await click('[data-test-save-config="true"]'); }; -// skipping because implementing Hds::Dropdown in the method list caused unrelated(?!) test failures -// erroring on authPage.logout() in beforeEach: Error: Assertion Failed: Expected a stable identifier -module.skip('Acceptance | mfa-setup', function (hooks) { +module('Acceptance | mfa-setup', function (hooks) { setupApplicationTest(hooks); setupMirage(hooks); From 7f4ecd86603659e47b065976abdb6b915d645b6e Mon Sep 17 00:00:00 2001 From: "clairebontempo@gmail.com" Date: Thu, 8 Feb 2024 16:32:52 -0800 Subject: [PATCH 45/58] actually add copyright header and rename changelog --- changelog/{25237.txt => 25321.txt} | 0 ui/lib/core/app/components/confirm-modal.js | 5 +++++ 2 files changed, 5 insertions(+) rename changelog/{25237.txt => 25321.txt} (100%) diff --git a/changelog/25237.txt b/changelog/25321.txt similarity index 100% rename from changelog/25237.txt rename to changelog/25321.txt diff --git a/ui/lib/core/app/components/confirm-modal.js b/ui/lib/core/app/components/confirm-modal.js index 96b3a726e313..e4ceff2d8c1d 100644 --- a/ui/lib/core/app/components/confirm-modal.js +++ b/ui/lib/core/app/components/confirm-modal.js @@ -1 +1,6 @@ +/** + * Copyright (c) HashiCorp, Inc. + * SPDX-License-Identifier: BUSL-1.1 + */ + export { default } from 'core/components/confirm-modal'; From c89240521e614e0ae0ede71420674b683f1ac958 Mon Sep 17 00:00:00 2001 From: "clairebontempo@gmail.com" Date: Tue, 6 Feb 2024 18:34:10 -0800 Subject: [PATCH 46/58] custom message list --- .../addon/components/messages/page/list.hbs | 47 ++++++++++--------- .../addon/components/messages/page/list.js | 3 ++ 2 files changed, 28 insertions(+), 22 deletions(-) diff --git a/ui/lib/config-ui/addon/components/messages/page/list.hbs b/ui/lib/config-ui/addon/components/messages/page/list.hbs index f105c25ab24e..c40b37f38abc 100644 --- a/ui/lib/config-ui/addon/components/messages/page/list.hbs +++ b/ui/lib/config-ui/addon/components/messages/page/list.hbs @@ -56,28 +56,22 @@
- - - + {{#if (or message.canEditCustomMessages message.canDeleteCustomMessages)}} + + + {{#if message.canEditCustomMessages}} + + {{/if}} + {{#if message.canDeleteCustomMessages}} + + {{/if}} + + {{/if}}
@@ -117,4 +111,13 @@ +{{/if}} + +{{#if this.messageToDelete}} + {{/if}} \ No newline at end of file diff --git a/ui/lib/config-ui/addon/components/messages/page/list.js b/ui/lib/config-ui/addon/components/messages/page/list.js index f97e477555b5..6ed34a1e4b03 100644 --- a/ui/lib/config-ui/addon/components/messages/page/list.js +++ b/ui/lib/config-ui/addon/components/messages/page/list.js @@ -30,6 +30,7 @@ export default class MessagesList extends Component { @service customMessages; @tracked showMaxMessageModal = false; + @tracked messageToDelete = null; // This follows the pattern in sync/addon/components/secrets/page/destinations for FilterInput. // Currently, FilterInput doesn't do a full page refresh causing it to lose focus. @@ -110,6 +111,8 @@ export default class MessagesList extends Component { } catch (e) { const message = errorMessage(e); this.flashMessages.danger(message); + } finally { + this.messageToDelete = null; } } From 88864c863002fdfa3387bc7a5db5d8a1697abe41 Mon Sep 17 00:00:00 2001 From: "clairebontempo@gmail.com" Date: Thu, 8 Feb 2024 17:20:44 -0800 Subject: [PATCH 47/58] policies index; replication secondary --- .../addon/controllers/application.js | 4 +- .../templates/mode/secondaries/index.hbs | 61 ++++++++++--------- 2 files changed, 36 insertions(+), 29 deletions(-) diff --git a/ui/lib/replication/addon/controllers/application.js b/ui/lib/replication/addon/controllers/application.js index ed72429dd1cb..a4674791d903 100644 --- a/ui/lib/replication/addon/controllers/application.js +++ b/ui/lib/replication/addon/controllers/application.js @@ -31,6 +31,7 @@ export default Controller.extend(copy(DEFAULTS, true), { store: service(), rm: service('replication-mode'), replicationMode: alias('rm.mode'), + secondaryToRevoke: null, submitError(e) { if (e.errors) { @@ -114,7 +115,8 @@ export default Controller.extend(copy(DEFAULTS, true), { }); }, (...args) => this.submitError(...args) - ); + ) + .finally(() => this.set('secondaryToRevoke', null)); }, actions: { diff --git a/ui/lib/replication/addon/templates/mode/secondaries/index.hbs b/ui/lib/replication/addon/templates/mode/secondaries/index.hbs index d41be803a22e..f1ae89493ac4 100644 --- a/ui/lib/replication/addon/templates/mode/secondaries/index.hbs +++ b/ui/lib/replication/addon/templates/mode/secondaries/index.hbs @@ -29,34 +29,29 @@
{{#if (or (eq this.replicationMode "performance") this.model.canRevokeSecondary)}} - - - + + + {{#if (eq this.replicationMode "performance")}} + + {{/if}} + {{#if this.model.canRevokeSecondary}} + + {{/if}} + {{/if}}
@@ -76,4 +71,14 @@ /> {{/if}} +{{/if}} + +{{#if this.secondaryToRevoke}} + {{/if}} \ No newline at end of file From 8e06bb4dcd6307ca31ed82dd0d47ca7a41c3bf20 Mon Sep 17 00:00:00 2001 From: "clairebontempo@gmail.com" Date: Tue, 6 Feb 2024 18:40:06 -0800 Subject: [PATCH 48/58] wizard popup --- ui/app/templates/components/wizard-content.hbs | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/ui/app/templates/components/wizard-content.hbs b/ui/app/templates/components/wizard-content.hbs index e189376fea78..448b92ccb9d8 100644 --- a/ui/app/templates/components/wizard-content.hbs +++ b/ui/app/templates/components/wizard-content.hbs @@ -5,15 +5,10 @@
{{#unless this.hidePopup}} - - - + + + + {{/unless}}

From f21f9e5f14a8dbcfaf935190d7668eeaf3f14ed8 Mon Sep 17 00:00:00 2001 From: "clairebontempo@gmail.com" Date: Thu, 8 Feb 2024 17:34:27 -0800 Subject: [PATCH 49/58] rename metadata tracked --- ui/app/controllers/vault/cluster/access/identity/index.js | 4 +--- ui/lib/kv/addon/components/page/list.hbs | 8 ++++---- ui/lib/kv/addon/components/page/list.js | 4 +++- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/ui/app/controllers/vault/cluster/access/identity/index.js b/ui/app/controllers/vault/cluster/access/identity/index.js index 4bb66bf14596..bb8eb9843ada 100644 --- a/ui/app/controllers/vault/cluster/access/identity/index.js +++ b/ui/app/controllers/vault/cluster/access/identity/index.js @@ -37,9 +37,7 @@ export default Controller.extend(ListController, { `There was a problem deleting ${type}: ${id} - ${e.errors.join(' ') || e.message}` ); }) - .finally(() => { - this.set('itemToDelete', null); - }); + .finally(() => this.set('itemToDelete', null)); }, toggleDisabled(model) { diff --git a/ui/lib/kv/addon/components/page/list.hbs b/ui/lib/kv/addon/components/page/list.hbs index 36d1507fcc7c..f503ef29d153 100644 --- a/ui/lib/kv/addon/components/page/list.hbs +++ b/ui/lib/kv/addon/components/page/list.hbs @@ -101,7 +101,7 @@ {{/if}} @@ -112,11 +112,11 @@

{{/each}} - {{#if this.deleteSecretModal}} + {{#if this.metadataToDelete}} {{/if}} diff --git a/ui/lib/kv/addon/components/page/list.js b/ui/lib/kv/addon/components/page/list.js index 2542211009cf..820a1d53c48c 100644 --- a/ui/lib/kv/addon/components/page/list.js +++ b/ui/lib/kv/addon/components/page/list.js @@ -30,7 +30,7 @@ export default class KvListPageComponent extends Component { @service store; @tracked secretPath; - @tracked deleteSecretModal = null; // set to the metadata intended to delete + @tracked metadataToDelete = null; // set to the metadata intended to delete get mountPoint() { // mountPoint tells transition where to start. In this case, mountPoint will always be vault.cluster.secrets.backend.kv. @@ -72,6 +72,8 @@ export default class KvListPageComponent extends Component { } catch (error) { const message = errorMessage(error, 'Error deleting secret. Please try again or contact support.'); this.flashMessages.danger(message); + } finally { + this.metadataToDelete = null; } } From cf73b9cf23c12a2fe2e466e3fdd09a2c81911a8f Mon Sep 17 00:00:00 2001 From: "clairebontempo@gmail.com" Date: Thu, 8 Feb 2024 19:55:38 -0800 Subject: [PATCH 50/58] add listPosition for clarity --- ui/app/templates/components/wizard-content.hbs | 2 +- ui/app/templates/vault/cluster/access/identity/index.hbs | 2 +- .../templates/vault/cluster/access/oidc/assignments/index.hbs | 2 +- ui/app/templates/vault/cluster/access/oidc/keys/index.hbs | 2 +- ui/app/templates/vault/cluster/access/oidc/scopes/index.hbs | 2 +- ui/app/templates/vault/cluster/policies/index.hbs | 2 +- ui/lib/config-ui/addon/components/messages/page/list.hbs | 2 +- ui/lib/replication/addon/templates/mode/secondaries/index.hbs | 2 +- ui/lib/sync/addon/components/secrets/page/overview.hbs | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/ui/app/templates/components/wizard-content.hbs b/ui/app/templates/components/wizard-content.hbs index 448b92ccb9d8..61a50dd5c4bd 100644 --- a/ui/app/templates/components/wizard-content.hbs +++ b/ui/app/templates/components/wizard-content.hbs @@ -5,7 +5,7 @@
{{#unless this.hidePopup}} - + diff --git a/ui/app/templates/vault/cluster/access/identity/index.hbs b/ui/app/templates/vault/cluster/access/identity/index.hbs index 2539bbd65254..de21aa26f668 100644 --- a/ui/app/templates/vault/cluster/access/identity/index.hbs +++ b/ui/app/templates/vault/cluster/access/identity/index.hbs @@ -32,7 +32,7 @@ {{/if}}
- +
- +
- +
- +
- +
{{#if (or message.canEditCustomMessages message.canDeleteCustomMessages)}} - +
{{#if (or (eq this.replicationMode "performance") this.model.canRevokeSecondary)}} - + - + Date: Wed, 7 Feb 2024 10:19:59 -0800 Subject: [PATCH 51/58] remove @color=secondary args from interactive elements --- .../components/secret-list/database-list-item.hbs | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/ui/app/templates/components/secret-list/database-list-item.hbs b/ui/app/templates/components/secret-list/database-list-item.hbs index fff82f106706..6ed69f4dbcfa 100644 --- a/ui/app/templates/components/secret-list/database-list-item.hbs +++ b/ui/app/templates/components/secret-list/database-list-item.hbs @@ -40,7 +40,7 @@ {{/if}} {{#if @item.canReset}} - + {{/if}} {{#if (and (eq @item.type "dynamic") @item.canGenerateCredentials)}} {{/if}} {{#if (and @item.canRotateRoleCredentials (eq this.keyTypeValue "static"))}} - + {{/if}} {{#if @item.canRotateRoot}} - + {{/if}}
From 91e3ae18bf08923f45903619fb47a9b567fb14f9 Mon Sep 17 00:00:00 2001 From: "clairebontempo@gmail.com" Date: Thu, 8 Feb 2024 20:23:21 -0800 Subject: [PATCH 52/58] fix qp arg and update to @query for dd.Interactive --- ui/app/templates/components/secret-list/item.hbs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ui/app/templates/components/secret-list/item.hbs b/ui/app/templates/components/secret-list/item.hbs index 643cf5a530bf..26f7c704fc46 100644 --- a/ui/app/templates/components/secret-list/item.hbs +++ b/ui/app/templates/components/secret-list/item.hbs @@ -50,7 +50,7 @@ @text="Details" @route="vault.cluster.secrets.backend.show" @model={{@item.id}} - @queryParams={{secret-query-params @backendModel.type @item.type asQueryParams=true}} + @query={{secret-query-params @backendModel.type @item.type asQueryParams=true}} /> {{/if}} {{#if @item.canEdit}} @@ -58,7 +58,7 @@ @text="Edit" @route="vault.cluster.secrets.backend.edit" @model={{@item.id}} - @queryParams={{secret-query-params @backendModel.type @item.type asQueryParams=true}} + @query={{secret-query-params @backendModel.type @item.type asQueryParams=true}} /> {{/if}} {{#if @item.canDelete}} From b2f4cffa0b17df64a05db38c58a5ec67e081a9db Mon Sep 17 00:00:00 2001 From: "clairebontempo@gmail.com" Date: Wed, 7 Feb 2024 10:31:48 -0800 Subject: [PATCH 53/58] add loading spinner because its nice --- .../secret-list/database-list-item.js | 13 ++++++++++--- .../secret-list/database-list-item.hbs | 18 +++++++++++++++--- 2 files changed, 25 insertions(+), 6 deletions(-) diff --git a/ui/app/components/secret-list/database-list-item.js b/ui/app/components/secret-list/database-list-item.js index 46adb4c0e303..84a9cb3e850a 100644 --- a/ui/app/components/secret-list/database-list-item.js +++ b/ui/app/components/secret-list/database-list-item.js @@ -22,6 +22,7 @@ import { action } from '@ember/object'; export default class DatabaseListItem extends Component { @tracked roleType = ''; + @tracked actionRunning = null; @service store; @service flashMessages; @@ -41,6 +42,7 @@ export default class DatabaseListItem extends Component { resetConnection(id) { const { backend } = this.args.item; const adapter = this.store.adapterFor('database/connection'); + this.actionRunning = 'reset'; adapter .resetConnection(backend, id) .then(() => { @@ -48,12 +50,14 @@ export default class DatabaseListItem extends Component { }) .catch((e) => { this.flashMessages.danger(e.errors); - }); + }) + .finally(() => (this.actionRunning = null)); } @action rotateRootCred(id) { const { backend } = this.args.item; const adapter = this.store.adapterFor('database/connection'); + this.actionRunning = 'rotateRoot'; adapter .rotateRootCredentials(backend, id) .then(() => { @@ -61,12 +65,14 @@ export default class DatabaseListItem extends Component { }) .catch((e) => { this.flashMessages.danger(e.errors); - }); + }) + .finally(() => (this.actionRunning = null)); } @action rotateRoleCred(id) { const { backend } = this.args.item; const adapter = this.store.adapterFor('database/credential'); + this.actionRunning = 'rotateRole'; adapter .rotateRoleCredentials(backend, id) .then(() => { @@ -74,6 +80,7 @@ export default class DatabaseListItem extends Component { }) .catch((e) => { this.flashMessages.danger(e.errors); - }); + }) + .finally(() => (this.actionRunning = null)); } } diff --git a/ui/app/templates/components/secret-list/database-list-item.hbs b/ui/app/templates/components/secret-list/database-list-item.hbs index 6ed69f4dbcfa..409429dfd3aa 100644 --- a/ui/app/templates/components/secret-list/database-list-item.hbs +++ b/ui/app/templates/components/secret-list/database-list-item.hbs @@ -40,7 +40,11 @@ {{/if}} {{#if @item.canReset}} - + {{/if}} {{#if (and (eq @item.type "dynamic") @item.canGenerateCredentials)}} {{/if}} {{#if (and @item.canRotateRoleCredentials (eq this.keyTypeValue "static"))}} - + {{/if}} {{#if @item.canRotateRoot}} - + {{/if}}
From fdd787854f5239293d1ef2d0473ccf936e0b7fe4 Mon Sep 17 00:00:00 2001 From: "clairebontempo@gmail.com" Date: Thu, 8 Feb 2024 21:17:24 -0800 Subject: [PATCH 54/58] attempt of backends.hbs dropdown --- .../vault/cluster/secrets/backends.js | 3 + .../vault/cluster/secrets/backends.hbs | 55 +++++++++++-------- 2 files changed, 36 insertions(+), 22 deletions(-) diff --git a/ui/app/controllers/vault/cluster/secrets/backends.js b/ui/app/controllers/vault/cluster/secrets/backends.js index a24396f7ba57..8c8d7f10c6ad 100644 --- a/ui/app/controllers/vault/cluster/secrets/backends.js +++ b/ui/app/controllers/vault/cluster/secrets/backends.js @@ -17,6 +17,7 @@ export default class VaultClusterSecretsBackendController extends Controller { @tracked secretEngineOptions = []; @tracked selectedEngineType = null; @tracked selectedEngineName = null; + @tracked engineToDisable = null; get sortedDisplayableBackends() { // show supported secret engines first and then organize those by id. @@ -80,6 +81,8 @@ export default class VaultClusterSecretsBackendController extends Controller { this.flashMessages.danger( `There was an error disabling the ${engineType} Secrets Engine at ${path}: ${err.errors.join(' ')}.` ); + } finally { + this.engineToDisable = null; } } } diff --git a/ui/app/templates/vault/cluster/secrets/backends.hbs b/ui/app/templates/vault/cluster/secrets/backends.hbs index 352bc4e5d9bf..5a86dd7e446c 100644 --- a/ui/app/templates/vault/cluster/secrets/backends.hbs +++ b/ui/app/templates/vault/cluster/secrets/backends.hbs @@ -86,28 +86,39 @@ {{/if}}
- {{! meatball sandwich menu }}
- - - + + + + {{#if (not-eq backend.type "cubbyhole")}} + + {{/if}} +
-{{/each}} \ No newline at end of file +{{/each}} + +{{#if this.engineToDisable}} + +{{/if}} \ No newline at end of file From 49eca9cd835e19201f10876272e0d03ba7139288 Mon Sep 17 00:00:00 2001 From: "clairebontempo@gmail.com" Date: Thu, 8 Feb 2024 21:45:04 -0800 Subject: [PATCH 55/58] attempt of methods.hbs --- .../vault/cluster/access/methods.js | 3 + .../vault/cluster/access/methods.hbs | 63 ++++++++++--------- ui/tests/acceptance/auth-list-test.js | 19 +++--- ui/tests/acceptance/mfa-setup-test.js | 4 +- 4 files changed, 48 insertions(+), 41 deletions(-) diff --git a/ui/app/controllers/vault/cluster/access/methods.js b/ui/app/controllers/vault/cluster/access/methods.js index 74d8a39051cc..f5c697cb2318 100644 --- a/ui/app/controllers/vault/cluster/access/methods.js +++ b/ui/app/controllers/vault/cluster/access/methods.js @@ -15,6 +15,7 @@ export default class VaultClusterAccessMethodsController extends Controller { @tracked authMethodOptions = []; @tracked selectedAuthType = null; @tracked selectedAuthName = null; + @tracked methodToDisable = null; queryParams = ['page, pageFilter']; @@ -80,6 +81,8 @@ export default class VaultClusterAccessMethodsController extends Controller { this.flashMessages.danger( `There was an error disabling Auth Method at ${path}: ${err.errors.join(' ')}.` ); + } finally { + this.methodToDisable = null; } } } diff --git a/ui/app/templates/vault/cluster/access/methods.hbs b/ui/app/templates/vault/cluster/access/methods.hbs index b03a63afd0a3..2ba915b69897 100644 --- a/ui/app/templates/vault/cluster/access/methods.hbs +++ b/ui/app/templates/vault/cluster/access/methods.hbs @@ -69,36 +69,41 @@
- - - + + + + {{#if method.canEdit}} + + {{/if}} + {{#if (and (not-eq method.methodType "token") method.canDisable)}} + + {{/if}} +
-{{/each}} \ No newline at end of file +{{/each}} + +{{#if this.methodToDisable}} + +{{/if}} \ No newline at end of file diff --git a/ui/tests/acceptance/auth-list-test.js b/ui/tests/acceptance/auth-list-test.js index 491800463b1e..db50aef0e115 100644 --- a/ui/tests/acceptance/auth-list-test.js +++ b/ui/tests/acceptance/auth-list-test.js @@ -27,24 +27,19 @@ const SELECTORS = { module('Acceptance | auth backend list', function (hooks) { setupApplicationTest(hooks); - hooks.beforeEach(async function () { - await authPage.login(); + hooks.beforeEach(function () { + return authPage.login(); + }); + + test('userpass secret backend', async function (assert) { + assert.expect(5); this.path1 = `userpass-${uuidv4()}`; this.path2 = `userpass-${uuidv4()}`; this.user1 = 'user1'; this.user2 = 'user2'; await runCmd([mountAuthCmd('userpass', this.path1), mountAuthCmd('userpass', this.path2)], false); - }); - hooks.afterEach(async function () { - await authPage.login(); - await runCmd([deleteAuthCmd(this.path1), deleteAuthCmd(this.path2)], false); - return; - }); - - test('userpass secret backend', async function (assert) { - assert.expect(5); // enable a user in first userpass backend await visit('/vault/access'); await click(SELECTORS.backendLink(this.path1)); @@ -72,6 +67,8 @@ module('Acceptance | auth backend list', function (hooks) { await click(SELECTORS.methods); await click(SELECTORS.backendLink(this.path1)); assert.dom(SELECTORS.listItem).hasText(this.user1, 'user1 exists in the list'); + // cleanup + await runCmd([deleteAuthCmd(this.path1), deleteAuthCmd(this.path2)], false); }); test('auth methods are linkable and link to correct view', async function (assert) { diff --git a/ui/tests/acceptance/mfa-setup-test.js b/ui/tests/acceptance/mfa-setup-test.js index abfcf7e80a9a..ab06097d31b9 100644 --- a/ui/tests/acceptance/mfa-setup-test.js +++ b/ui/tests/acceptance/mfa-setup-test.js @@ -40,7 +40,9 @@ const setupUser = async function (path) { await click('[data-test-save-config="true"]'); }; -module('Acceptance | mfa-setup', function (hooks) { +// skipping because implementing Hds::Dropdown in the method list caused unrelated(?!) test failures +// erroring on authPage.logout() in beforeEach: Error: Assertion Failed: Expected a stable identifier +module.skip('Acceptance | mfa-setup', function (hooks) { setupApplicationTest(hooks); setupMirage(hooks); From 878c0c38ff8296773e15da446dd3bbaee4d338b3 Mon Sep 17 00:00:00 2001 From: "clairebontempo@gmail.com" Date: Thu, 8 Feb 2024 22:16:34 -0800 Subject: [PATCH 56/58] Revert "attempt of methods.hbs" This reverts commit 49eca9cd835e19201f10876272e0d03ba7139288. --- .../vault/cluster/access/methods.js | 3 - .../vault/cluster/access/methods.hbs | 63 +++++++++---------- ui/tests/acceptance/auth-list-test.js | 19 +++--- ui/tests/acceptance/mfa-setup-test.js | 4 +- 4 files changed, 41 insertions(+), 48 deletions(-) diff --git a/ui/app/controllers/vault/cluster/access/methods.js b/ui/app/controllers/vault/cluster/access/methods.js index f5c697cb2318..74d8a39051cc 100644 --- a/ui/app/controllers/vault/cluster/access/methods.js +++ b/ui/app/controllers/vault/cluster/access/methods.js @@ -15,7 +15,6 @@ export default class VaultClusterAccessMethodsController extends Controller { @tracked authMethodOptions = []; @tracked selectedAuthType = null; @tracked selectedAuthName = null; - @tracked methodToDisable = null; queryParams = ['page, pageFilter']; @@ -81,8 +80,6 @@ export default class VaultClusterAccessMethodsController extends Controller { this.flashMessages.danger( `There was an error disabling Auth Method at ${path}: ${err.errors.join(' ')}.` ); - } finally { - this.methodToDisable = null; } } } diff --git a/ui/app/templates/vault/cluster/access/methods.hbs b/ui/app/templates/vault/cluster/access/methods.hbs index 2ba915b69897..b03a63afd0a3 100644 --- a/ui/app/templates/vault/cluster/access/methods.hbs +++ b/ui/app/templates/vault/cluster/access/methods.hbs @@ -69,41 +69,36 @@
- - - - {{#if method.canEdit}} - - {{/if}} - {{#if (and (not-eq method.methodType "token") method.canDisable)}} - - {{/if}} - + + +
-{{/each}} - -{{#if this.methodToDisable}} - -{{/if}} \ No newline at end of file +{{/each}} \ No newline at end of file diff --git a/ui/tests/acceptance/auth-list-test.js b/ui/tests/acceptance/auth-list-test.js index db50aef0e115..491800463b1e 100644 --- a/ui/tests/acceptance/auth-list-test.js +++ b/ui/tests/acceptance/auth-list-test.js @@ -27,19 +27,24 @@ const SELECTORS = { module('Acceptance | auth backend list', function (hooks) { setupApplicationTest(hooks); - hooks.beforeEach(function () { - return authPage.login(); - }); - - test('userpass secret backend', async function (assert) { - assert.expect(5); + hooks.beforeEach(async function () { + await authPage.login(); this.path1 = `userpass-${uuidv4()}`; this.path2 = `userpass-${uuidv4()}`; this.user1 = 'user1'; this.user2 = 'user2'; await runCmd([mountAuthCmd('userpass', this.path1), mountAuthCmd('userpass', this.path2)], false); + }); + hooks.afterEach(async function () { + await authPage.login(); + await runCmd([deleteAuthCmd(this.path1), deleteAuthCmd(this.path2)], false); + return; + }); + + test('userpass secret backend', async function (assert) { + assert.expect(5); // enable a user in first userpass backend await visit('/vault/access'); await click(SELECTORS.backendLink(this.path1)); @@ -67,8 +72,6 @@ module('Acceptance | auth backend list', function (hooks) { await click(SELECTORS.methods); await click(SELECTORS.backendLink(this.path1)); assert.dom(SELECTORS.listItem).hasText(this.user1, 'user1 exists in the list'); - // cleanup - await runCmd([deleteAuthCmd(this.path1), deleteAuthCmd(this.path2)], false); }); test('auth methods are linkable and link to correct view', async function (assert) { diff --git a/ui/tests/acceptance/mfa-setup-test.js b/ui/tests/acceptance/mfa-setup-test.js index ab06097d31b9..abfcf7e80a9a 100644 --- a/ui/tests/acceptance/mfa-setup-test.js +++ b/ui/tests/acceptance/mfa-setup-test.js @@ -40,9 +40,7 @@ const setupUser = async function (path) { await click('[data-test-save-config="true"]'); }; -// skipping because implementing Hds::Dropdown in the method list caused unrelated(?!) test failures -// erroring on authPage.logout() in beforeEach: Error: Assertion Failed: Expected a stable identifier -module.skip('Acceptance | mfa-setup', function (hooks) { +module('Acceptance | mfa-setup', function (hooks) { setupApplicationTest(hooks); setupMirage(hooks); From 86787a1ba4ce5cf08984fd0fc931c49374aef72c Mon Sep 17 00:00:00 2001 From: Chelsea Shaw <82459713+hashishaw@users.noreply.github.com> Date: Fri, 9 Feb 2024 10:35:01 -0600 Subject: [PATCH 57/58] remove space Co-authored-by: Kianna <30884335+kiannaquach@users.noreply.github.com> --- ui/app/components/identity/popup-policy.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/app/components/identity/popup-policy.js b/ui/app/components/identity/popup-policy.js index 9c0ffe8c3916..591e3d17e80a 100644 --- a/ui/app/components/identity/popup-policy.js +++ b/ui/app/components/identity/popup-policy.js @@ -17,7 +17,7 @@ export default class IdentityPopupPolicy extends Component { if (this.args.onSuccess) { this.args.onSuccess(); } - this.flashMessages.success(`Successfully removed '${policyName}' policy from ${modelId} `); + this.flashMessages.success(`Successfully removed '${policyName}' policy from ${modelId}`); } onError(err, policyName) { if (this.args.onError) { From 9ea0aed4e870bb93d2919aea12fff963a784de55 Mon Sep 17 00:00:00 2001 From: Chelsea Shaw Date: Fri, 9 Feb 2024 11:26:53 -0600 Subject: [PATCH 58/58] capabilities relationship is not async --- ui/app/lib/attach-capabilities.js | 2 +- .../integration/components/auth-config-form/options-test.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ui/app/lib/attach-capabilities.js b/ui/app/lib/attach-capabilities.js index 06235284a12a..1d7430a07e21 100644 --- a/ui/app/lib/attach-capabilities.js +++ b/ui/app/lib/attach-capabilities.js @@ -34,7 +34,7 @@ import { isArray } from '@ember/array'; export default function attachCapabilities(modelClass, capabilities) { const capabilityKeys = Object.keys(capabilities); const newRelationships = capabilityKeys.reduce((ret, key) => { - ret[key] = belongsTo('capabilities', { async: true, inverse: null }); + ret[key] = belongsTo('capabilities', { async: false, inverse: null }); return ret; }, {}); diff --git a/ui/tests/integration/components/auth-config-form/options-test.js b/ui/tests/integration/components/auth-config-form/options-test.js index edad9d815341..f267dad0f195 100644 --- a/ui/tests/integration/components/auth-config-form/options-test.js +++ b/ui/tests/integration/components/auth-config-form/options-test.js @@ -49,10 +49,10 @@ module('Integration | Component | auth-config-form options', function (hooks) { }); sinon.spy(model.config, 'serialize'); this.set('model', model); - await render(hbs`{{auth-config-form/options model=this.model}}`); + await render(hbs``); component.save(); return settled().then(() => { - assert.ok(model.config.serialize.calledOnce); + assert.strictEqual(model.config.serialize.callCount, 1, 'config serialize was called once'); }); }); });