mirror of https://github.com/rancher/dashboard.git
Move can delete check to instance method and override cluster check
rancher/dashboard#530
This commit is contained in:
parent
5ab5ae7eb5
commit
22182006d8
|
|
@ -43,4 +43,8 @@ export default {
|
|||
return this.$rootGetters['i18n/t']('cluster.provider.importedconfig');
|
||||
}
|
||||
},
|
||||
|
||||
canDelete() {
|
||||
return this.hasLink('remove') && !this?.spec?.internal;
|
||||
},
|
||||
};
|
||||
|
|
|
|||
|
|
@ -404,7 +404,6 @@ export default {
|
|||
const canCreate = (this.schema?.attributes?.verbs || []).includes('create') && this.$rootGetters['type-map/isCreatable'](this.type);
|
||||
const canUpdate = !!links.update && this.$rootGetters['type-map/isEditable'](this.type);
|
||||
const canViewInApi = this.$rootGetters['prefs/get'](DEV);
|
||||
const canDelete = !!links.remove;
|
||||
const hasYaml = this.hasLink('rioview') || this.hasLink('view');
|
||||
|
||||
const all = [
|
||||
|
|
@ -454,7 +453,7 @@ export default {
|
|||
label: 'Delete',
|
||||
icon: 'icon icon-fw icon-trash',
|
||||
bulkable: true,
|
||||
enabled: canDelete,
|
||||
enabled: this.canDelete,
|
||||
bulkAction: 'promptRemove',
|
||||
},
|
||||
{ divider: true },
|
||||
|
|
@ -481,6 +480,12 @@ export default {
|
|||
|
||||
// ------------------------------------------------------------------
|
||||
|
||||
canDelete() {
|
||||
return this.hasLink('remove');
|
||||
},
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
|
||||
hasLink() {
|
||||
return (linkName) => {
|
||||
return !!this.linkFor(linkName);
|
||||
|
|
|
|||
Loading…
Reference in New Issue