Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backport of Secret Metadata Breadcrumb Bug into release/1.11.x #19714

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions changelog/19703.txt
@@ -0,0 +1,3 @@
```release-note:bug
ui: fixes issue navigating back a level using the breadcrumb from secret metadata view
```
Expand Up @@ -2,7 +2,7 @@
<p.top>
<KeyValueHeader
@baseKey={{hash id=this.id}}
@path="vault.cluster.secrets.backend.show"
@path="vault.cluster.secrets.backend.list"
@mode="show"
@showCurrent={{true}}
@root={{this.backendCrumb}}
Expand Down
29 changes: 29 additions & 0 deletions ui/tests/acceptance/secrets/backend/kv/breadcrumbs-test.js
@@ -0,0 +1,29 @@
import { create } from 'ember-cli-page-object';
import { module, test } from 'qunit';
import { setupApplicationTest } from 'ember-qunit';
import { click, currentURL, fillIn, visit } from '@ember/test-helpers';
import authPage from 'vault/tests/pages/auth';
import consoleClass from 'vault/tests/pages/components/console/ui-panel';

const consolePanel = create(consoleClass);

module('Acceptance | kv | breadcrumbs', function (hooks) {
setupApplicationTest(hooks);

test('it should route back to parent path from metadata tab', async function (assert) {
await authPage.login();
await consolePanel.runCommands(['delete sys/mounts/kv', 'write sys/mounts/kv type=kv-v2']);
await visit('/vault/secrets/kv/list');
await click('[data-test-secret-create]');
await fillIn('[data-test-secret-path]', 'foo/bar');
await click('[data-test-secret-save]');
await click('[data-test-secret-metadata-tab]');
await click('[data-test-secret-breadcrumb="foo"]');
assert.strictEqual(
currentURL(),
'/vault/secrets/kv/list/foo/',
'Routes back to list view on breadcrumb click'
);
await consolePanel.runCommands(['delete sys/mounts/kv']);
});
});