const copyAction: CdTableAction = {
permission: 'create',
buttonCondition: (selection: CdTableSelection) => selection.hasSingleSelection,
- disable: (selection: CdTableSelection) => !selection.hasSingleSelection,
+ disable: (selection: CdTableSelection) =>
+ !selection.hasSingleSelection || selection.first().cdExecuting,
icon: 'fa-copy',
routerLink: () => `/block/rbd/copy/${getImageUri()}`,
name: 'Copy'
};
const moveAction: CdTableAction = {
permission: 'delete',
- disable: (selection: CdTableSelection) =>
- !selection.hasSingleSelection || selection.first().cdExecuting,
icon: 'fa-trash-o',
click: () => this.trashRbdModal(),
name: 'Move to Trash'
create: CdTableAction = {
permission: 'create',
icon: 'fa-plus',
- buttonCondition: (selection: CdTableSelection) => !selection.hasSingleSelection,
name: 'Create'
};
rename: CdTableAction = {
clone: CdTableAction = {
permission: 'create',
buttonCondition: (selection: CdTableSelection) => selection.hasSingleSelection,
- disable: (selection: CdTableSelection) => !selection.hasSingleSelection,
+ disable: (selection: CdTableSelection) =>
+ !selection.hasSingleSelection || selection.first().cdExecuting,
icon: 'fa-clone',
name: 'Clone'
};
copy: CdTableAction = {
permission: 'create',
buttonCondition: (selection: CdTableSelection) => selection.hasSingleSelection,
- disable: (selection: CdTableSelection) => !selection.hasSingleSelection,
+ disable: (selection: CdTableSelection) =>
+ !selection.hasSingleSelection || selection.first().cdExecuting,
icon: 'fa-copy',
name: 'Copy'
};
rollback: CdTableAction = {
permission: 'update',
- disable: (selection: CdTableSelection) =>
- selection.hasSingleSelection && !selection.first().parent,
icon: 'fa-undo',
name: 'Rollback'
};
deleteSnap: CdTableAction = {
permission: 'delete',
icon: 'fa-times',
- disable: (selection: CdTableSelection) =>
- selection.hasSingleSelection && !selection.first().is_protected,
+ disable: (selection: CdTableSelection) => {
+ const first = selection.first();
+ return !selection.hasSingleSelection || first.cdExecuting || first.is_protected;
+ },
name: 'Delete'
};
ordering = [