From 00157f02e4465d018f599d9eb6f5bd148c3d51b5 Mon Sep 17 00:00:00 2001 From: Angel Garbarino Date: Tue, 23 Jan 2024 11:31:46 -0700 Subject: [PATCH] Allow Dashboard's QA card to search for nested KVv2 secrets (#25001) * improve overview test * add new component for KVv2 dashboard quick actions card * add changelog * revert carry over test change from ember data work. * redo test * remove the check for v2 because test suite is strange on return value CI vs locally --- changelog/25001.txt | 3 ++ .../dashboard/quick-actions-card.hbs | 45 +++++++++++-------- ui/tests/acceptance/dashboard-test.js | 17 +++---- .../dashboard/dashboard-selectors.js | 1 + .../dashboard/quick-actions-card-test.js | 2 +- 5 files changed, 41 insertions(+), 27 deletions(-) create mode 100644 changelog/25001.txt diff --git a/changelog/25001.txt b/changelog/25001.txt new file mode 100644 index 0000000000..de5f82d055 --- /dev/null +++ b/changelog/25001.txt @@ -0,0 +1,3 @@ +```release-note:bug +ui: Allows users to search within KV v2 directories from the Dashboard's quick action card. +``` \ No newline at end of file diff --git a/ui/app/templates/components/dashboard/quick-actions-card.hbs b/ui/app/templates/components/dashboard/quick-actions-card.hbs index 2657f0dfef..0b4e2d3509 100644 --- a/ui/app/templates/components/dashboard/quick-actions-card.hbs +++ b/ui/app/templates/components/dashboard/quick-actions-card.hbs @@ -40,25 +40,34 @@ /> {{#if this.searchSelectParams.model}} -

{{this.searchSelectParams.title}}

- - + {{! use special input to allow searching for KVv2 secrets inside a directory }} + {{#if (eq this.selectedEngine.type "kv")}} + + {{else}} +

{{this.searchSelectParams.title}}

+ + {{/if}}
`[data-test-dashboard-card-header="${name}"]`, tableRow: (name) => `[data-test-dashboard-table="${name}"] tr`, searchSelect: (name) => `[data-test-search-select="${name}"]`, + kvSearchSelect: `[data-test-kv-suggestion-input]`, actionButton: (action) => `[data-test-button="${action}"]`, title: (name) => `[data-test-title="${name}"]`, subtitle: (name) => `[data-test-card-subtitle="${name}"]`, diff --git a/ui/tests/integration/components/dashboard/quick-actions-card-test.js b/ui/tests/integration/components/dashboard/quick-actions-card-test.js index b2e72c21f9..8122f9260f 100644 --- a/ui/tests/integration/components/dashboard/quick-actions-card-test.js +++ b/ui/tests/integration/components/dashboard/quick-actions-card-test.js @@ -143,7 +143,7 @@ module('Integration | Component | dashboard/quick-actions-card', function (hooks await selectChoose(SELECTORS.searchSelect('secrets-engines'), 'kv-v2-test'); assert.dom(SELECTORS.emptyState('quick-actions')).doesNotExist(); await fillIn(SELECTORS.selectEl, 'Find KV secrets'); - assert.dom(SELECTORS.subtitle('param')).hasText('Secret path'); + assert.dom(SELECTORS.kvSearchSelect).exists('Shows option to search fo KVv2 secret'); assert.dom(SELECTORS.actionButton('Read secrets')).exists({ count: 1 }); }); });