diff --git a/changelog/_10227.txt b/changelog/_10227.txt new file mode 100644 index 0000000000..038d0f594d --- /dev/null +++ b/changelog/_10227.txt @@ -0,0 +1,3 @@ +```release-note:change +ui/secrets: Secrets engines url paths renamed from '/secrets' to '/secrets-engines' +``` \ No newline at end of file diff --git a/ui/app/components/secret-engine/list.ts b/ui/app/components/secret-engine/list.ts index 6f69f86829..b41d8cdd03 100644 --- a/ui/app/components/secret-engine/list.ts +++ b/ui/app/components/secret-engine/list.ts @@ -62,7 +62,7 @@ export default class SecretEngineList extends Component { { key: 'accessor', label: 'Accessor', - width: '150px', + width: '175px', }, { key: 'description', diff --git a/ui/app/router.js b/ui/app/router.js index 23003136d5..22a5d4843c 100644 --- a/ui/app/router.js +++ b/ui/app/router.js @@ -167,6 +167,7 @@ Router.map(function () { }); }); }); + this.route('secrets-redirect', { path: '/secrets' }); // legacy redirect this.route('secrets', { path: '/secrets-engines' }, function () { this.route('enable', function () { // TODO: Revisit path on create once components are separated - should we specify selected type or just keep it generic as /create? diff --git a/ui/app/routes/vault/cluster/secrets-redirect.js b/ui/app/routes/vault/cluster/secrets-redirect.js new file mode 100644 index 0000000000..0223d9c0c4 --- /dev/null +++ b/ui/app/routes/vault/cluster/secrets-redirect.js @@ -0,0 +1,16 @@ +/** + * Copyright (c) HashiCorp, Inc. + * SPDX-License-Identifier: BUSL-1.1 + */ +import Route from '@ember/routing/route'; +import { service } from '@ember/service'; + +export default class SecretsRedirectRoute extends Route { + @service router; + + beforeModel() { + // Redirect to secrets page under /secrets-engines + // if the user navigates to the legacy path /secrets + this.router.replaceWith('vault.cluster.secrets'); + } +} diff --git a/ui/tests/acceptance/cluster-test.js b/ui/tests/acceptance/cluster-test.js index 7ab2532410..5c2f61b0fc 100644 --- a/ui/tests/acceptance/cluster-test.js +++ b/ui/tests/acceptance/cluster-test.js @@ -3,7 +3,7 @@ * SPDX-License-Identifier: BUSL-1.1 */ -import { settled, click, visit } from '@ember/test-helpers'; +import { settled, click, visit, currentURL } from '@ember/test-helpers'; import { module, test } from 'qunit'; import { setupApplicationTest } from 'ember-qunit'; import { v4 as uuidv4 } from 'uuid'; @@ -107,4 +107,13 @@ module('Acceptance | cluster', function (hooks) { .dom('[data-test-resultant-acl-banner]') .includesText(expectedText, 'Resultant ACL banner shows appropriate message for OSS/Enterprise'); }); + + test('redirects to secret-engines from legacy /secrets path', async function (assert) { + await visit('/vault/secrets'); + assert.strictEqual( + currentURL(), + '/vault/secrets-engines', + 'Navigating to /secrets redirects to /secrets-engines' + ); + }); });