open-vault/ui/app/components/secret-list/transform-list-item.js
Angel Garbarino 98c2ba2e6c
secret-list/item partial removed (#11710)
* secret-list/item partial removed

* remove all partials and I'm sure break many things.

* changing props types and breaking more things

* cleanup

* fix options for backend

* fix transform list item test
2021-06-02 08:59:31 -06:00

33 lines
1.1 KiB
JavaScript

/**
* @module TransformListItem
* TransformListItem components are used for the list items for the Transform Secret Engines for all but Transformations.
* This component automatically handles read-only list items if capabilities are not granted or the item is internal only.
*
* @example
* ```js
* <TransformListItem @item={item} @itemPath="role/my-item" @itemType="role" />
* ```
* @param {object} item - item refers to the model item used on the list item partial
* @param {string} itemPath - usually the id of the item, but can be prefixed with the model type (see transform/role)
* @param {string} [itemType] - itemType is used to calculate whether an item is readable or
*/
import { computed } from '@ember/object';
import Component from '@ember/component';
export default Component.extend({
item: null,
itemPath: '',
itemType: '',
isBuiltin: computed('item', 'itemType', function() {
const item = this.item;
if (this.itemType === 'alphabet' || this.itemType === 'template') {
return item.get('id').startsWith('builtin/');
}
return false;
}),
backendType: 'transform',
});