mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-10-31 18:48:08 +00:00
* converts secret-v2-version model to native class -- fixes issues with cached values for deleted prop * adds changelog entry * adds disabled state to ToolbarLink component and disables create new version action when users cannot read metadata * updates secret-edit acceptance test
42 lines
1.1 KiB
JavaScript
42 lines
1.1 KiB
JavaScript
/**
|
|
* @module ToolbarLink
|
|
* `ToolbarLink` components style links and buttons for the Toolbar
|
|
* It should only be used inside of `Toolbar`.
|
|
*
|
|
* @example
|
|
* ```js
|
|
* <Toolbar>
|
|
* <ToolbarActions>
|
|
* <ToolbarLink @params={{array 'vault.cluster.policies.create'}} @type="add" @disabled={{true}} @disabledTooltip="This link is disabled">
|
|
* Create policy
|
|
* </ToolbarLink>
|
|
* </ToolbarActions>
|
|
* </Toolbar>
|
|
* ```
|
|
*
|
|
* @param {array} params - Array to pass to LinkTo
|
|
* @param {string} type - Use "add" to change icon
|
|
* @param {boolean} disabled - pass true to disable link
|
|
* @param {string} disabledTooltip - tooltip to display on hover when disabled
|
|
*/
|
|
|
|
import Component from '@ember/component';
|
|
import { computed } from '@ember/object';
|
|
import layout from '../templates/components/toolbar-link';
|
|
|
|
export default Component.extend({
|
|
layout,
|
|
tagName: '',
|
|
supportsDataTestProperties: true,
|
|
type: null,
|
|
disabled: false,
|
|
disabledTooltip: null,
|
|
glyph: computed('type', function() {
|
|
if (this.type == 'add') {
|
|
return 'plus-plain';
|
|
} else {
|
|
return 'chevron-right';
|
|
}
|
|
}),
|
|
});
|