1 import { CdTableAction } from '../../../shared/models/cd-table-action';
2 import { CdTableSelection } from '../../../shared/models/cd-table-selection';
4 export class RbdSnapshotActionsModel {
5 create: CdTableAction = {
10 rename: CdTableAction = {
15 protect: CdTableAction = {
18 visible: (selection: CdTableSelection) =>
19 selection.hasSingleSelection && !selection.first().is_protected,
22 unprotect: CdTableAction = {
25 visible: (selection: CdTableSelection) =>
26 selection.hasSingleSelection && selection.first().is_protected,
29 clone: CdTableAction = {
31 buttonCondition: (selection: CdTableSelection) => selection.hasSingleSelection,
32 disable: (selection: CdTableSelection) =>
33 !selection.hasSingleSelection || selection.first().cdExecuting,
37 copy: CdTableAction = {
39 buttonCondition: (selection: CdTableSelection) => selection.hasSingleSelection,
40 disable: (selection: CdTableSelection) =>
41 !selection.hasSingleSelection || selection.first().cdExecuting,
45 rollback: CdTableAction = {
50 deleteSnap: CdTableAction = {
53 disable: (selection: CdTableSelection) => {
54 const first = selection.first();
55 return !selection.hasSingleSelection || first.cdExecuting || first.is_protected;