From 8756dccb1182eda0adcf9e7fc0332b70bfe48d07 Mon Sep 17 00:00:00 2001 From: Chelsea Shaw <82459713+hashishaw@users.noreply.github.com> Date: Wed, 15 Nov 2023 10:51:26 -0600 Subject: [PATCH] Kv directory fixes (#24129) * update icon if kv path ends in slash. Fixes #23978 * Correctly link to directory in kv if search-select uses fallback input --- ui/app/components/dashboard/quick-actions-card.js | 8 +++++--- ui/lib/kv/addon/components/page/list.hbs | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/ui/app/components/dashboard/quick-actions-card.js b/ui/app/components/dashboard/quick-actions-card.js index e990ecd4fb..57a524c3ad 100644 --- a/ui/app/components/dashboard/quick-actions-card.js +++ b/ui/app/components/dashboard/quick-actions-card.js @@ -140,15 +140,17 @@ export default class DashboardQuickActionsCard extends Component { @action navigateToPage() { let route = this.searchSelectParams.route; - let param = this.paramValue.id; + // If search-select falls back to stringInput, paramVlue is a string not object + let param = this.paramValue.id || this.paramValue; // kv has a special use case where if the paramValue ends in a '/' you should // link to different route if (this.selectedEngine.type === 'kv') { - route = pathIsDirectory(this.paramValue?.path) + const path = this.paramValue.path || this.paramValue; + route = pathIsDirectory(path) ? 'vault.cluster.secrets.backend.kv.list-directory' : 'vault.cluster.secrets.backend.kv.secret.details'; - param = this.paramValue?.path; + param = path; } this.router.transitionTo(route, this.selectedEngine.id, param); diff --git a/ui/lib/kv/addon/components/page/list.hbs b/ui/lib/kv/addon/components/page/list.hbs index d750a6c024..3f95ea4b1a 100644 --- a/ui/lib/kv/addon/components/page/list.hbs +++ b/ui/lib/kv/addon/components/page/list.hbs @@ -63,7 +63,7 @@