summaryrefslogtreecommitdiffstats
path: root/vid-webpack-master/src/app/shared/storeUtil/utils/global/global.actions.ts
blob: d4e6cf287b06f5d067a2a0e69c2d82d7b024e856 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
import {Action, ActionCreator} from "redux";

export enum GlobalActions {
  UPDATE_NAME = 'UPDATE_NAME',
  UPDATE_FLAGS = 'UPDATE_FLAGS',
  UPDATE_DRAWING_BOARD_STATUS = 'UPDATE_DRAWING_BOARD_STATUS',
  UPDATE_GENERIC_MODAL_CRITERIA = 'UPDATE_GENERIC_MODAL_CRITERIA',
  UPDATE_GENERIC_MODAL_HELPER = 'UPDATE_GENERIC_MODAL_HELPER',
  DELETE_GENERIC_MODAL_HELPER = 'DELETE_GENERIC_MODAL_HELPER',
  CLEAR_ALL_GENERIC_MODAL_HELPER = 'CLEAR_ALL_GENERIC_MODAL_HELPER',
  UPDATE_GENERIC_MODAL_TABLE_DATA_HELPER = 'UPDATE_GENERIC_MODAL_TABLE_DATA_HELPER',
  DELETE_GENERIC_MODAL_TABLE_DATA_HELPER = 'DELETE_GENERIC_MODAL_TABLE_DATA_HELPER',
  UPDATE_GENERIC_CURRNT_VRF_HELPER = 'UPDATE_GENERIC_CURRNT_VRF_HELPER',
  DELETE_GENERIC_CURRNT_VRF_HELPER = 'DELETE_GENERIC_CURRNT_VRF_HELPER',
  UPDATE_CURRENT_MODAL_MODE = 'UPDATE_CURRENT_MODAL_MODE'
}

export interface UpdateCurrentModalModeAction extends Action {
  isUpdateModalMode?: boolean;
}


export interface UpdateGlobalAction extends Action {
  name?: string;
}

export interface UpdateFlagsAction extends Action {
  flags?: any;
}

export interface UpdateDrawingBoardStatusAction extends Action{
  drawingBoardStatus?: any;
}

export interface UpdateGenericModalCriteria extends Action {
  field: any;
  values: any;
}

export interface UpdateGenericModalTableDataHelper extends Action {
  field: any;
  values: any;
}
export interface UpdateGenericModalHelper extends Action {
  field: any;
  values: any;
  uniqObjectField : string;
}

export interface DeleteGenericModalHelper extends Action {
  field: any;
  uniqObjectField : string;
}

export interface DeleteGenericModalTabelDataHelper extends Action {
  field: any;
}


export interface ClearGenericModalHelper extends Action {}

export const updateName: ActionCreator<UpdateGlobalAction> =
  (name) => ({
    type: GlobalActions.UPDATE_NAME,
    name: name
  });

export const updateFlags: ActionCreator<UpdateFlagsAction> =
  (flags) => ({
    type: GlobalActions.UPDATE_FLAGS,
    flags: flags
  });

export const updateDrawingBoardStatus: ActionCreator<UpdateDrawingBoardStatusAction> =
  (drawingBoardStatus) => ({
    type: GlobalActions.UPDATE_DRAWING_BOARD_STATUS,
    drawingBoardStatus: drawingBoardStatus
  });


export const updateGenericModalCriteria: ActionCreator<UpdateGenericModalCriteria> = (field, values) => ({
  type : GlobalActions.UPDATE_GENERIC_MODAL_CRITERIA,
  field: field,
  values: values
});

export const updateGenericModalhelper: ActionCreator<UpdateGenericModalHelper> = (field, values, uniqObjectField) => ({
  type : GlobalActions.UPDATE_GENERIC_MODAL_HELPER,
  field: field,
  values: values,
  uniqObjectField : uniqObjectField
});

export const deleteGenericModalhelper: ActionCreator<DeleteGenericModalHelper> = (field, uniqObjectField) => ({
  type : GlobalActions.DELETE_GENERIC_MODAL_HELPER,
  field: field,
  uniqObjectField : uniqObjectField
});


export const updateGenericModalTableDataHelper: ActionCreator<UpdateGenericModalTableDataHelper> = (field, values) => ({
  type : GlobalActions.UPDATE_GENERIC_MODAL_TABLE_DATA_HELPER,
  field: field,
  values: values,
});

export const deleteGenericModalTableDataHelper: ActionCreator<DeleteGenericModalTabelDataHelper> = (field) => ({
  type : GlobalActions.DELETE_GENERIC_MODAL_TABLE_DATA_HELPER,
  field: field,
});

export const clearAllGenericModalhelper: ActionCreator<ClearGenericModalHelper> = (field, uniqObjectField) => ({
  type : GlobalActions.CLEAR_ALL_GENERIC_MODAL_HELPER
});

export const updateCurrentModalModeAction: ActionCreator<UpdateCurrentModalModeAction> = (isUpdateModalMode? :boolean) => ({
  type : GlobalActions.UPDATE_CURRENT_MODAL_MODE,
  isUpdateModalMode
});