Skip to content

Commit

Permalink
extend overview route from issuers index (#18623)
Browse files Browse the repository at this point in the history
  • Loading branch information
hellobontempo authored and AnPucel committed Jan 14, 2023
1 parent e67229c commit 8237243
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 5 deletions.
1 change: 0 additions & 1 deletion ui/lib/pki/addon/components/pki-key-import.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import errorMessage from 'vault/utils/error-message';
import trimRight from 'vault/utils/trim-right';
import { waitFor } from '@ember/test-waiters';

// TODO: convert to typescript after https://github.com/hashicorp/vault/pull/18387 is merged
/**
* @module PkiKeyImport
* PkiKeyImport components are used to import PKI keys.
Expand Down
9 changes: 7 additions & 2 deletions ui/lib/pki/addon/routes/issuers/import.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
import Route from '@ember/routing/route';
import PkiIssuersIndexRoute from '.';

export default class PkiIssuersImportRoute extends Route {}
export default class PkiIssuersImportRoute extends PkiIssuersIndexRoute {
setupController(controller, resolvedModel) {
super.setupController(controller, resolvedModel);
controller.breadcrumbs.push({ label: 'import' });
}
}
14 changes: 12 additions & 2 deletions ui/lib/pki/addon/routes/issuers/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Route from '@ember/routing/route';
import PkiOverviewRoute from '../overview';
import { inject as service } from '@ember/service';

export default class PkiIssuersListRoute extends Route {
export default class PkiIssuersIndexRoute extends PkiOverviewRoute {
@service store;
@service secretMountPath;
@service pathHelp;
Expand All @@ -25,4 +25,14 @@ export default class PkiIssuersListRoute extends Route {
}
});
}

setupController(controller, resolvedModel) {
super.setupController(controller, resolvedModel);
const backend = this.secretMountPath.currentPath || 'pki';
controller.breadcrumbs = [
{ label: 'secrets', route: 'secrets', linkExternal: true },
{ label: backend, route: 'overview' },
{ label: 'issuers', route: 'issuers.index' },
];
}
}

0 comments on commit 8237243

Please sign in to comment.