@imposium-hub/components 1.42.4 → 1.43.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Entry.ts +5 -0
- package/components/data-table/DataTable.tsx +0 -1
- package/components/publish-wizard/PublishWizard.tsx +62 -8
- package/components/publish-wizard/publish/EmailWorkflow.tsx +236 -27
- package/components/select-field/SelectField.tsx +2 -3
- package/constants/copy.ts +3 -0
- package/dist/components.js +4 -4
- package/dist/components.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/styles.css.map +1 -1
- package/dist/styles.less +72 -0
- package/dist/styles.less.map +1 -1
- package/less/components/align-columns.less +66 -0
- package/less/components/publish-wizard.less +6 -0
- package/less/styles.less +1 -0
- package/package.json +1 -1
- package/redux/actions/active-batch.ts +110 -0
- package/redux/reducers/active-batch.ts +108 -0
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import batchActions from '../actions/active-batch';
|
|
2
|
+
|
|
3
|
+
const initialState : any = {
|
|
4
|
+
loading: true,
|
|
5
|
+
updating: false,
|
|
6
|
+
associationOptions : {},
|
|
7
|
+
page: 1,
|
|
8
|
+
data: {}
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
const FRESH_COLUMN : any = {
|
|
12
|
+
name: 'New Column',
|
|
13
|
+
type: 'Static',
|
|
14
|
+
from_import: 1,
|
|
15
|
+
detail: null
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
const getNFreshColumns = (state : any) => {
|
|
19
|
+
return state.data.columns.filter((col : any) => (col.name.includes(FRESH_COLUMN.name))).length;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
const activeBatch = (state = initialState, action) : any => {
|
|
23
|
+
let nFreshCols : number;
|
|
24
|
+
let freshCol : any;
|
|
25
|
+
|
|
26
|
+
switch (action.type) {
|
|
27
|
+
case batchActions.TOGGlE_LOADING:
|
|
28
|
+
return {
|
|
29
|
+
...state,
|
|
30
|
+
loading: action.toggle
|
|
31
|
+
};
|
|
32
|
+
case batchActions.TOGGLE_UPDATING:
|
|
33
|
+
return {
|
|
34
|
+
...state,
|
|
35
|
+
updating: action.toggle
|
|
36
|
+
};
|
|
37
|
+
case batchActions.ADD_COLUMN:
|
|
38
|
+
if (typeof action.columnData !== 'undefined') {
|
|
39
|
+
return {
|
|
40
|
+
...state,
|
|
41
|
+
data: {
|
|
42
|
+
...state.data,
|
|
43
|
+
columns: [...state.data.columns, action.columnData]
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
} else {
|
|
47
|
+
nFreshCols = getNFreshColumns(state);
|
|
48
|
+
if (!nFreshCols) {
|
|
49
|
+
freshCol = {...FRESH_COLUMN};
|
|
50
|
+
} else {
|
|
51
|
+
freshCol = {...FRESH_COLUMN, name: FRESH_COLUMN.name + ` (${nFreshCols})`};
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
return {
|
|
55
|
+
...state,
|
|
56
|
+
data: {
|
|
57
|
+
...state.data,
|
|
58
|
+
columns: [...state.data.columns, freshCol]
|
|
59
|
+
}
|
|
60
|
+
}; }
|
|
61
|
+
case batchActions.REPLACE_ASSOCIATION_OPTIONS:
|
|
62
|
+
return {
|
|
63
|
+
...state,
|
|
64
|
+
associationOptions: {...action.associationOptions}
|
|
65
|
+
};
|
|
66
|
+
case batchActions.UPDATE_ASSOCIATION:
|
|
67
|
+
return {
|
|
68
|
+
...state,
|
|
69
|
+
data: {
|
|
70
|
+
...state.data,
|
|
71
|
+
columns: state.data.columns.map((col : any, i : number) => {
|
|
72
|
+
if (action.colIndex === i) {
|
|
73
|
+
if (action.newType === 'Static') {
|
|
74
|
+
return {
|
|
75
|
+
...col,
|
|
76
|
+
type: action.newType,
|
|
77
|
+
detail: null
|
|
78
|
+
};
|
|
79
|
+
} else {
|
|
80
|
+
return {
|
|
81
|
+
...col,
|
|
82
|
+
type: action.newType,
|
|
83
|
+
detail: action.newAssociation,
|
|
84
|
+
from_import: (action.newType === 'EGC') ? 0 : 1,
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
return col;
|
|
90
|
+
})
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
case batchActions.SET_BATCH:
|
|
94
|
+
return {
|
|
95
|
+
...state,
|
|
96
|
+
data: {...action.batch}
|
|
97
|
+
};
|
|
98
|
+
case batchActions.SET_PAGE:
|
|
99
|
+
return {
|
|
100
|
+
...state,
|
|
101
|
+
page: action.page
|
|
102
|
+
};
|
|
103
|
+
default:
|
|
104
|
+
return state;
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
export default activeBatch;
|