mirror of
https://github.com/harvester/harvester-ui-extension.git
synced 2026-05-14 06:51:46 +00:00
* fix: some actions limited for virt-viewer Signed-off-by: Andy Lee <andy.lee@suse.com> * refactor: based on schema collectionMethods Signed-off-by: Andy Lee <andy.lee@suse.com> * fix: conditionally add migrate action to available actions * fix: update collectionMethods check to use find for case-insensitive matching * fix: update canEditClusterMembers method to use schema for collectionMethods * fix: update canCreateImage check to use case-insensitive matching --------- Signed-off-by: Andy Lee <andy.lee@suse.com>
27 lines
692 B
JavaScript
27 lines
692 B
JavaScript
import { get } from '@shell/utils/object';
|
|
import { findBy } from '@shell/utils/array';
|
|
import HarvesterResource from './harvester';
|
|
|
|
export default class HciKeypair extends HarvesterResource {
|
|
get _availableActions() {
|
|
let out = super._availableActions;
|
|
|
|
out = out.map((action) => {
|
|
if (['download'].includes(action.action)) {
|
|
return { ...action, enabled: !!this.linkFor('update') };
|
|
}
|
|
|
|
return action;
|
|
});
|
|
|
|
return out;
|
|
}
|
|
|
|
get stateDisplay() {
|
|
const conditions = get(this, 'status.conditions');
|
|
const status = (findBy(conditions, 'type', 'validated') || {}).status ;
|
|
|
|
return status === 'True' ? 'Validated' : 'Not Validated';
|
|
}
|
|
}
|