mirror of
https://github.com/harvester/harvester-ui-extension.git
synced 2026-05-14 15:01:44 +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>
20 lines
602 B
JavaScript
20 lines
602 B
JavaScript
|
|
import shellProject from '@shell/models/management.cattle.io.project';
|
|
|
|
// This model controls `Project / Namespace` page in rancher integration mode
|
|
// Extend management.cattle.io.project model from shell
|
|
export default class Project extends shellProject {
|
|
get _availableActions() {
|
|
const canUpdate = !!this.linkFor('update');
|
|
|
|
// disable `Edit Config` action if user does not have update permission.
|
|
return super._availableActions.map((action) => {
|
|
if (action.action === 'goToEdit') {
|
|
return { ...action, enabled: canUpdate };
|
|
}
|
|
|
|
return action;
|
|
});
|
|
}
|
|
}
|