a4b6bb8626
* fix switch css * allow breadcrumbs container to grow if it's overflowed so that it's still usable * close the dropdowns on destructive actions that cause a route refresh * use new attachCapabilities for context menus on auth methods to get rid of an error
38 lines
893 B
JavaScript
38 lines
893 B
JavaScript
import { computed } from '@ember/object';
|
|
import Component from '@ember/component';
|
|
import { encodePath } from 'vault/utils/path-encoding-helpers';
|
|
|
|
export function linkParams({ mode, secret, queryParams }) {
|
|
let params;
|
|
const route = `vault.cluster.secrets.backend.${mode}`;
|
|
|
|
if (!secret || secret === ' ') {
|
|
params = [route + '-root'];
|
|
} else {
|
|
params = [route, encodePath(secret)];
|
|
}
|
|
|
|
if (queryParams) {
|
|
params.push(queryParams);
|
|
}
|
|
|
|
return params;
|
|
}
|
|
|
|
export default Component.extend({
|
|
onLinkClick() {},
|
|
tagName: '',
|
|
// so that ember-test-selectors doesn't log a warning
|
|
supportsDataTestProperties: true,
|
|
mode: 'list',
|
|
|
|
secret: null,
|
|
queryParams: null,
|
|
ariaLabel: null,
|
|
|
|
linkParams: computed('mode', 'secret', 'queryParams', function() {
|
|
let data = this.getProperties('mode', 'secret', 'queryParams');
|
|
return linkParams(data);
|
|
}),
|
|
});
|