visible: (selection: CdTableSelection) =>
selection.hasSingleSelection && !selection.first().is_protected,
name: actionLabels.PROTECT,
- disable: (selection: CdTableSelection) => this.disableForMirrorSnapshot(selection)
+ disable: (selection: CdTableSelection) =>
+ this.disableForMirrorSnapshot(selection) ||
+ this.getProtectDisableDesc(selection, this.featuresName)
};
this.unprotect = {
permission: 'update',
permission: 'create',
canBePrimary: (selection: CdTableSelection) => selection.hasSingleSelection,
disable: (selection: CdTableSelection) =>
- this.getCloneDisableDesc(selection, this.featuresName) ||
- this.disableForMirrorSnapshot(selection),
+ this.getCloneDisableDesc(selection) || this.disableForMirrorSnapshot(selection),
icon: Icons.clone,
name: actionLabels.CLONE
};
];
}
- getCloneDisableDesc(selection: CdTableSelection, featuresName: string[]): boolean | string {
+ getProtectDisableDesc(selection: CdTableSelection, featuresName: string[]): boolean | string {
if (selection.hasSingleSelection && !selection.first().cdExecuting) {
if (!featuresName?.includes('layering')) {
- return $localize`Parent image must support Layering`;
+ return $localize`The layering feature needs to be enabled on parent image`;
}
+ return false;
+ }
+ return true;
+ }
+ getCloneDisableDesc(selection: CdTableSelection): boolean | string {
+ if (selection.hasSingleSelection && !selection.first().cdExecuting) {
if (this.cloneFormatVersion === 1 && !selection.first().is_protected) {
return $localize`Snapshot must be protected in order to clone.`;
}
-
return false;
}
-
return true;
}