vault/ui/app/components/secret-list/transform-list-item.js
claire bontempo 918642bd9c
UI: Ember deprecation prep for 5.0: ember-data:deprecate-array-like (#26170)
* remove .get() from cluster and vault route

* replace .get() use in adapters

* remove .get() from components part 1

* remove .get() from string-list

* remaining components

* controller .get() removal

* remove .get() use in mixins

* routes/cluster/access* .get() replacement

* policy index route

* routes/secrets/backend*

* route/cluster*

* serializers

* is-active-route

* remaining top-level addon gets

* replication get()

* revery change that broke things

* woops, revert other store service change

* revert some controller changes

* revert get on URLSearchParams class

* remove .sortBy ember method

* small cleanup items

* small cleanups from PR review
2024-03-28 12:13:33 -07:00

38 lines
1.2 KiB
JavaScript

/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: BUSL-1.1
*/
/**
* @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.id.startsWith('builtin/');
}
return false;
}),
backendType: 'transform',
});