Skip to content

Commit

Permalink
backport of KV directory fixes (#24144)
Browse files Browse the repository at this point in the history
Co-authored-by: Chelsea Shaw <[email protected]>
  • Loading branch information
1 parent 23bed9e commit 30e5521
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions ui/app/components/dashboard/quick-actions-card.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion ui/lib/kv/addon/components/page/list.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
<div class="level is-mobile">
<div class="level-left">
<div>
<Icon @name="file" class="has-text-grey-light" />
<Icon @name={{if metadata.pathIsDirectory "folder" "file"}} class="has-text-grey-light" />
<span class="has-text-weight-semibold is-underline">
{{metadata.path}}
</span>
Expand Down

0 comments on commit 30e5521

Please sign in to comment.