mirror of
https://github.com/hashicorp/vault.git
synced 2026-05-05 20:36:26 +02:00
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
This commit is contained in:
parent
28e3507680
commit
8756dccb11
@ -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);
|
||||
|
||||
@ -63,7 +63,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>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user