vineanova-redux-artifacts 1.119.20 → 1.119.21
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/CHANGELOG.md +1 -1
- package/dist/actions/commonActions.js +351 -0
- package/dist/reducers/index.js +10 -1
- package/dist/sagas/vineaNovaApi.sagas.js +547 -115
- package/dist/selectors/index.js +99 -0
- package/dist/selectors/lookupJobEventActionSelector.js +59 -0
- package/dist/selectors/lookupJobInvoiceMethodSelector.js +59 -0
- package/dist/selectors/lookupJobQuantityTypeSelector.js +59 -0
- package/dist/selectors/lookupJobStatusSelector.js +59 -0
- package/dist/selectors/lookupJobTypeSelector.js +59 -0
- package/dist/selectors/lookupJobTypeWorkRecordTypeSelector.js +59 -0
- package/dist/selectors/lookupJobWorkUnitSelector.js +59 -0
- package/dist/selectors/lookupPayrollRecordTypeSelector.js +59 -0
- package/dist/selectors/lookupStatusSelector.js +49 -4
- package/dist/selectors/lookupWorkRecordLevelSelector.js +59 -0
- package/dist/services/apiServices.js +353 -2
- package/package.json +1 -1
- package/src/actions/commonActions.js +81 -0
- package/src/reducers/index.js +9 -0
- package/src/sagas/vineaNovaApi.sagas.js +315 -0
- package/src/selectors/index.js +9 -0
- package/src/selectors/lookupJobEventActionSelector.js +65 -0
- package/src/selectors/lookupJobInvoiceMethodSelector.js +65 -0
- package/src/selectors/lookupJobQuantityTypeSelector.js +65 -0
- package/src/selectors/lookupJobStatusSelector.js +65 -0
- package/src/selectors/lookupJobTypeSelector.js +65 -0
- package/src/selectors/lookupJobTypeWorkRecordTypeSelector.js +65 -0
- package/src/selectors/lookupJobWorkUnitSelector.js +65 -0
- package/src/selectors/lookupPayrollRecordTypeSelector.js +65 -0
- package/src/selectors/lookupStatusSelector.js +81 -0
- package/src/selectors/lookupWorkRecordLevelSelector.js +65 -0
- package/src/services/apiServices.js +225 -0
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { createSelector } from 'reselect';
|
|
2
|
+
import isEmpty from 'lodash/isEmpty';
|
|
3
|
+
import {isValid, format} from 'date-fns';
|
|
4
|
+
import isNil from 'lodash/isNil';
|
|
5
|
+
import has from 'lodash/has';
|
|
6
|
+
|
|
7
|
+
const viewDateFormat = 'dd/MM/yyyy';
|
|
8
|
+
|
|
9
|
+
export const getlookupJobStatusEntity = state => state.entities.lookupJobStatus;
|
|
10
|
+
|
|
11
|
+
export const getlookupJobStatusEntityMeta = createSelector(
|
|
12
|
+
[getlookupJobStatusEntity],
|
|
13
|
+
reference => {
|
|
14
|
+
const { isLoading, isLoaded, hasError, error } = reference;
|
|
15
|
+
return {
|
|
16
|
+
isLoading,
|
|
17
|
+
isLoaded,
|
|
18
|
+
hasError,
|
|
19
|
+
error,
|
|
20
|
+
};
|
|
21
|
+
},
|
|
22
|
+
);
|
|
23
|
+
|
|
24
|
+
export const getlookupJobStatusEntityData = createSelector(
|
|
25
|
+
[getlookupJobStatusEntity],
|
|
26
|
+
reference => {
|
|
27
|
+
const { data = [] } = reference;
|
|
28
|
+
const refData = isEmpty(data) ? [] : data;
|
|
29
|
+
if (!Array.isArray(refData) || isNil(refData)) return [];
|
|
30
|
+
|
|
31
|
+
const formattedData = refData.map(d => {
|
|
32
|
+
let hasDates = false;
|
|
33
|
+
let fromDate = '';
|
|
34
|
+
let toDate = '';
|
|
35
|
+
let fromTo = '';
|
|
36
|
+
|
|
37
|
+
if(has(d, 'effectiveToDate') && has(d, 'effectiveFromDate')){
|
|
38
|
+
hasDates = true;
|
|
39
|
+
toDate =
|
|
40
|
+
!isEmpty(d.effectiveToDate) && isValid(new Date(d.effectiveToDate))
|
|
41
|
+
? format(new Date(d.effectiveToDate), viewDateFormat)
|
|
42
|
+
: '';
|
|
43
|
+
fromDate =
|
|
44
|
+
!isEmpty(d.effectiveFromDate) &&
|
|
45
|
+
isValid(new Date(d.effectiveFromDate))
|
|
46
|
+
? format(new Date(d.effectiveFromDate), viewDateFormat)
|
|
47
|
+
: '';
|
|
48
|
+
const seperator = toDate ? '-' : '';
|
|
49
|
+
fromToDate = `${fromDate} ${seperator} ${toDate}`;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
return {
|
|
53
|
+
...d,
|
|
54
|
+
...(hasDates && {
|
|
55
|
+
fromDate,
|
|
56
|
+
toDate,
|
|
57
|
+
fromTo,
|
|
58
|
+
})
|
|
59
|
+
};
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
return formattedData;
|
|
63
|
+
},
|
|
64
|
+
);
|
|
65
|
+
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { createSelector } from 'reselect';
|
|
2
|
+
import isEmpty from 'lodash/isEmpty';
|
|
3
|
+
import {isValid, format} from 'date-fns';
|
|
4
|
+
import isNil from 'lodash/isNil';
|
|
5
|
+
import has from 'lodash/has';
|
|
6
|
+
|
|
7
|
+
const viewDateFormat = 'dd/MM/yyyy';
|
|
8
|
+
|
|
9
|
+
export const getlookupJobTypeEntity = state => state.entities.lookupJobType;
|
|
10
|
+
|
|
11
|
+
export const getlookupJobTypeEntityMeta = createSelector(
|
|
12
|
+
[getlookupJobTypeEntity],
|
|
13
|
+
reference => {
|
|
14
|
+
const { isLoading, isLoaded, hasError, error } = reference;
|
|
15
|
+
return {
|
|
16
|
+
isLoading,
|
|
17
|
+
isLoaded,
|
|
18
|
+
hasError,
|
|
19
|
+
error,
|
|
20
|
+
};
|
|
21
|
+
},
|
|
22
|
+
);
|
|
23
|
+
|
|
24
|
+
export const getlookupJobTypeEntityData = createSelector(
|
|
25
|
+
[getlookupJobTypeEntity],
|
|
26
|
+
reference => {
|
|
27
|
+
const { data = [] } = reference;
|
|
28
|
+
const refData = isEmpty(data) ? [] : data;
|
|
29
|
+
if (!Array.isArray(refData) || isNil(refData)) return [];
|
|
30
|
+
|
|
31
|
+
const formattedData = refData.map(d => {
|
|
32
|
+
let hasDates = false;
|
|
33
|
+
let fromDate = '';
|
|
34
|
+
let toDate = '';
|
|
35
|
+
let fromTo = '';
|
|
36
|
+
|
|
37
|
+
if(has(d, 'effectiveToDate') && has(d, 'effectiveFromDate')){
|
|
38
|
+
hasDates = true;
|
|
39
|
+
toDate =
|
|
40
|
+
!isEmpty(d.effectiveToDate) && isValid(new Date(d.effectiveToDate))
|
|
41
|
+
? format(new Date(d.effectiveToDate), viewDateFormat)
|
|
42
|
+
: '';
|
|
43
|
+
fromDate =
|
|
44
|
+
!isEmpty(d.effectiveFromDate) &&
|
|
45
|
+
isValid(new Date(d.effectiveFromDate))
|
|
46
|
+
? format(new Date(d.effectiveFromDate), viewDateFormat)
|
|
47
|
+
: '';
|
|
48
|
+
const seperator = toDate ? '-' : '';
|
|
49
|
+
fromToDate = `${fromDate} ${seperator} ${toDate}`;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
return {
|
|
53
|
+
...d,
|
|
54
|
+
...(hasDates && {
|
|
55
|
+
fromDate,
|
|
56
|
+
toDate,
|
|
57
|
+
fromTo,
|
|
58
|
+
})
|
|
59
|
+
};
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
return formattedData;
|
|
63
|
+
},
|
|
64
|
+
);
|
|
65
|
+
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { createSelector } from 'reselect';
|
|
2
|
+
import isEmpty from 'lodash/isEmpty';
|
|
3
|
+
import {isValid, format} from 'date-fns';
|
|
4
|
+
import isNil from 'lodash/isNil';
|
|
5
|
+
import has from 'lodash/has';
|
|
6
|
+
|
|
7
|
+
const viewDateFormat = 'dd/MM/yyyy';
|
|
8
|
+
|
|
9
|
+
export const getlookupJobTypeWorkRecordTypeEntity = state => state.entities.lookupJobTypeWorkRecordType;
|
|
10
|
+
|
|
11
|
+
export const getlookupJobTypeWorkRecordTypeEntityMeta = createSelector(
|
|
12
|
+
[getlookupJobTypeWorkRecordTypeEntity],
|
|
13
|
+
reference => {
|
|
14
|
+
const { isLoading, isLoaded, hasError, error } = reference;
|
|
15
|
+
return {
|
|
16
|
+
isLoading,
|
|
17
|
+
isLoaded,
|
|
18
|
+
hasError,
|
|
19
|
+
error,
|
|
20
|
+
};
|
|
21
|
+
},
|
|
22
|
+
);
|
|
23
|
+
|
|
24
|
+
export const getlookupJobTypeWorkRecordTypeEntityData = createSelector(
|
|
25
|
+
[getlookupJobTypeWorkRecordTypeEntity],
|
|
26
|
+
reference => {
|
|
27
|
+
const { data = [] } = reference;
|
|
28
|
+
const refData = isEmpty(data) ? [] : data;
|
|
29
|
+
if (!Array.isArray(refData) || isNil(refData)) return [];
|
|
30
|
+
|
|
31
|
+
const formattedData = refData.map(d => {
|
|
32
|
+
let hasDates = false;
|
|
33
|
+
let fromDate = '';
|
|
34
|
+
let toDate = '';
|
|
35
|
+
let fromTo = '';
|
|
36
|
+
|
|
37
|
+
if(has(d, 'effectiveToDate') && has(d, 'effectiveFromDate')){
|
|
38
|
+
hasDates = true;
|
|
39
|
+
toDate =
|
|
40
|
+
!isEmpty(d.effectiveToDate) && isValid(new Date(d.effectiveToDate))
|
|
41
|
+
? format(new Date(d.effectiveToDate), viewDateFormat)
|
|
42
|
+
: '';
|
|
43
|
+
fromDate =
|
|
44
|
+
!isEmpty(d.effectiveFromDate) &&
|
|
45
|
+
isValid(new Date(d.effectiveFromDate))
|
|
46
|
+
? format(new Date(d.effectiveFromDate), viewDateFormat)
|
|
47
|
+
: '';
|
|
48
|
+
const seperator = toDate ? '-' : '';
|
|
49
|
+
fromToDate = `${fromDate} ${seperator} ${toDate}`;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
return {
|
|
53
|
+
...d,
|
|
54
|
+
...(hasDates && {
|
|
55
|
+
fromDate,
|
|
56
|
+
toDate,
|
|
57
|
+
fromTo,
|
|
58
|
+
})
|
|
59
|
+
};
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
return formattedData;
|
|
63
|
+
},
|
|
64
|
+
);
|
|
65
|
+
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { createSelector } from 'reselect';
|
|
2
|
+
import isEmpty from 'lodash/isEmpty';
|
|
3
|
+
import {isValid, format} from 'date-fns';
|
|
4
|
+
import isNil from 'lodash/isNil';
|
|
5
|
+
import has from 'lodash/has';
|
|
6
|
+
|
|
7
|
+
const viewDateFormat = 'dd/MM/yyyy';
|
|
8
|
+
|
|
9
|
+
export const getlookupJobWorkUnitEntity = state => state.entities.lookupJobWorkUnit;
|
|
10
|
+
|
|
11
|
+
export const getlookupJobWorkUnitEntityMeta = createSelector(
|
|
12
|
+
[getlookupJobWorkUnitEntity],
|
|
13
|
+
reference => {
|
|
14
|
+
const { isLoading, isLoaded, hasError, error } = reference;
|
|
15
|
+
return {
|
|
16
|
+
isLoading,
|
|
17
|
+
isLoaded,
|
|
18
|
+
hasError,
|
|
19
|
+
error,
|
|
20
|
+
};
|
|
21
|
+
},
|
|
22
|
+
);
|
|
23
|
+
|
|
24
|
+
export const getlookupJobWorkUnitEntityData = createSelector(
|
|
25
|
+
[getlookupJobWorkUnitEntity],
|
|
26
|
+
reference => {
|
|
27
|
+
const { data = [] } = reference;
|
|
28
|
+
const refData = isEmpty(data) ? [] : data;
|
|
29
|
+
if (!Array.isArray(refData) || isNil(refData)) return [];
|
|
30
|
+
|
|
31
|
+
const formattedData = refData.map(d => {
|
|
32
|
+
let hasDates = false;
|
|
33
|
+
let fromDate = '';
|
|
34
|
+
let toDate = '';
|
|
35
|
+
let fromTo = '';
|
|
36
|
+
|
|
37
|
+
if(has(d, 'effectiveToDate') && has(d, 'effectiveFromDate')){
|
|
38
|
+
hasDates = true;
|
|
39
|
+
toDate =
|
|
40
|
+
!isEmpty(d.effectiveToDate) && isValid(new Date(d.effectiveToDate))
|
|
41
|
+
? format(new Date(d.effectiveToDate), viewDateFormat)
|
|
42
|
+
: '';
|
|
43
|
+
fromDate =
|
|
44
|
+
!isEmpty(d.effectiveFromDate) &&
|
|
45
|
+
isValid(new Date(d.effectiveFromDate))
|
|
46
|
+
? format(new Date(d.effectiveFromDate), viewDateFormat)
|
|
47
|
+
: '';
|
|
48
|
+
const seperator = toDate ? '-' : '';
|
|
49
|
+
fromToDate = `${fromDate} ${seperator} ${toDate}`;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
return {
|
|
53
|
+
...d,
|
|
54
|
+
...(hasDates && {
|
|
55
|
+
fromDate,
|
|
56
|
+
toDate,
|
|
57
|
+
fromTo,
|
|
58
|
+
})
|
|
59
|
+
};
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
return formattedData;
|
|
63
|
+
},
|
|
64
|
+
);
|
|
65
|
+
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { createSelector } from 'reselect';
|
|
2
|
+
import isEmpty from 'lodash/isEmpty';
|
|
3
|
+
import {isValid, format} from 'date-fns';
|
|
4
|
+
import isNil from 'lodash/isNil';
|
|
5
|
+
import has from 'lodash/has';
|
|
6
|
+
|
|
7
|
+
const viewDateFormat = 'dd/MM/yyyy';
|
|
8
|
+
|
|
9
|
+
export const getlookupPayrollRecordTypeEntity = state => state.entities.lookupPayrollRecordType;
|
|
10
|
+
|
|
11
|
+
export const getlookupPayrollRecordTypeEntityMeta = createSelector(
|
|
12
|
+
[getlookupPayrollRecordTypeEntity],
|
|
13
|
+
reference => {
|
|
14
|
+
const { isLoading, isLoaded, hasError, error } = reference;
|
|
15
|
+
return {
|
|
16
|
+
isLoading,
|
|
17
|
+
isLoaded,
|
|
18
|
+
hasError,
|
|
19
|
+
error,
|
|
20
|
+
};
|
|
21
|
+
},
|
|
22
|
+
);
|
|
23
|
+
|
|
24
|
+
export const getlookupPayrollRecordTypeEntityData = createSelector(
|
|
25
|
+
[getlookupPayrollRecordTypeEntity],
|
|
26
|
+
reference => {
|
|
27
|
+
const { data = [] } = reference;
|
|
28
|
+
const refData = isEmpty(data) ? [] : data;
|
|
29
|
+
if (!Array.isArray(refData) || isNil(refData)) return [];
|
|
30
|
+
|
|
31
|
+
const formattedData = refData.map(d => {
|
|
32
|
+
let hasDates = false;
|
|
33
|
+
let fromDate = '';
|
|
34
|
+
let toDate = '';
|
|
35
|
+
let fromTo = '';
|
|
36
|
+
|
|
37
|
+
if(has(d, 'effectiveToDate') && has(d, 'effectiveFromDate')){
|
|
38
|
+
hasDates = true;
|
|
39
|
+
toDate =
|
|
40
|
+
!isEmpty(d.effectiveToDate) && isValid(new Date(d.effectiveToDate))
|
|
41
|
+
? format(new Date(d.effectiveToDate), viewDateFormat)
|
|
42
|
+
: '';
|
|
43
|
+
fromDate =
|
|
44
|
+
!isEmpty(d.effectiveFromDate) &&
|
|
45
|
+
isValid(new Date(d.effectiveFromDate))
|
|
46
|
+
? format(new Date(d.effectiveFromDate), viewDateFormat)
|
|
47
|
+
: '';
|
|
48
|
+
const seperator = toDate ? '-' : '';
|
|
49
|
+
fromToDate = `${fromDate} ${seperator} ${toDate}`;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
return {
|
|
53
|
+
...d,
|
|
54
|
+
...(hasDates && {
|
|
55
|
+
fromDate,
|
|
56
|
+
toDate,
|
|
57
|
+
fromTo,
|
|
58
|
+
})
|
|
59
|
+
};
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
return formattedData;
|
|
63
|
+
},
|
|
64
|
+
);
|
|
65
|
+
|
|
@@ -65,6 +65,15 @@ const getLkplookupActivityGroup = state => state.entities.lookupActivityGroup;
|
|
|
65
65
|
const getLkplookupPlanType = state => state.entities.lookupPlanType;
|
|
66
66
|
const getLkplookupPlanStatus = state => state.entities.lookupPlanStatus;
|
|
67
67
|
const getLkplookupSupplyContractType = state => state.entities.lookupSupplyContractType;
|
|
68
|
+
const getLkplookupJobEventAction = state => state.entities.lookupJobEventAction;
|
|
69
|
+
const getLkplookupJobInvoiceMethod = state => state.entities.lookupJobInvoiceMethod;
|
|
70
|
+
const getLkplookupJobQuantityType = state => state.entities.lookupJobQuantityType;
|
|
71
|
+
const getLkplookupJobStatus = state => state.entities.lookupJobStatus;
|
|
72
|
+
const getLkplookupJobType = state => state.entities.lookupJobType;
|
|
73
|
+
const getLkplookupJobTypeWorkRecordType = state => state.entities.lookupJobTypeWorkRecordType;
|
|
74
|
+
const getLkplookupWorkRecordLevel = state => state.entities.lookupWorkRecordLevel;
|
|
75
|
+
const getLkplookupPayrollRecordType = state => state.entities.lookupPayrollRecordType;
|
|
76
|
+
const getLkplookupJobWorkUnit = state => state.entities.lookupJobWorkUnit;
|
|
68
77
|
|
|
69
78
|
export const areLookupsLoading = createSelector(
|
|
70
79
|
[
|
|
@@ -133,6 +142,15 @@ export const areLookupsLoading = createSelector(
|
|
|
133
142
|
getLkplookupPlanType,
|
|
134
143
|
getLkplookupPlanStatus,
|
|
135
144
|
getLkplookupSupplyContractType,
|
|
145
|
+
getLkplookupJobEventAction,
|
|
146
|
+
getLkplookupJobInvoiceMethod,
|
|
147
|
+
getLkplookupJobQuantityType,
|
|
148
|
+
getLkplookupJobStatus,
|
|
149
|
+
getLkplookupJobType,
|
|
150
|
+
getLkplookupJobTypeWorkRecordType,
|
|
151
|
+
getLkplookupWorkRecordLevel,
|
|
152
|
+
getLkplookupPayrollRecordType,
|
|
153
|
+
getLkplookupJobWorkUnit,
|
|
136
154
|
],
|
|
137
155
|
(
|
|
138
156
|
lkplookupClassification,
|
|
@@ -200,6 +218,15 @@ export const areLookupsLoading = createSelector(
|
|
|
200
218
|
lkplookupPlanType,
|
|
201
219
|
lkplookupPlanStatus,
|
|
202
220
|
lkplookupSupplyContractType,
|
|
221
|
+
lkplookupJobEventAction,
|
|
222
|
+
lkplookupJobInvoiceMethod,
|
|
223
|
+
lkplookupJobQuantityType,
|
|
224
|
+
lkplookupJobStatus,
|
|
225
|
+
lkplookupJobType,
|
|
226
|
+
lkplookupJobTypeWorkRecordType,
|
|
227
|
+
lkplookupWorkRecordLevel,
|
|
228
|
+
lkplookupPayrollRecordType,
|
|
229
|
+
lkplookupJobWorkUnit,
|
|
203
230
|
) => {
|
|
204
231
|
const { isLoading: lookupClassificationIsLoading } = lkplookupClassification;
|
|
205
232
|
const { isLoading: lookupClassificationGroupIsLoading } = lkplookupClassificationGroup;
|
|
@@ -266,6 +293,15 @@ export const areLookupsLoading = createSelector(
|
|
|
266
293
|
const { isLoading: lookupPlanTypeIsLoading } = lkplookupPlanType;
|
|
267
294
|
const { isLoading: lookupPlanStatusIsLoading } = lkplookupPlanStatus;
|
|
268
295
|
const { isLoading: lookupSupplyContractTypeIsLoading } = lkplookupSupplyContractType;
|
|
296
|
+
const { isLoading: lookupJobEventActionIsLoading } = lkplookupJobEventAction;
|
|
297
|
+
const { isLoading: lookupJobInvoiceMethodIsLoading } = lkplookupJobInvoiceMethod;
|
|
298
|
+
const { isLoading: lookupJobQuantityTypeIsLoading } = lkplookupJobQuantityType;
|
|
299
|
+
const { isLoading: lookupJobStatusIsLoading } = lkplookupJobStatus;
|
|
300
|
+
const { isLoading: lookupJobTypeIsLoading } = lkplookupJobType;
|
|
301
|
+
const { isLoading: lookupJobTypeWorkRecordTypeIsLoading } = lkplookupJobTypeWorkRecordType;
|
|
302
|
+
const { isLoading: lookupWorkRecordLevelIsLoading } = lkplookupWorkRecordLevel;
|
|
303
|
+
const { isLoading: lookupPayrollRecordTypeIsLoading } = lkplookupPayrollRecordType;
|
|
304
|
+
const { isLoading: lookupJobWorkUnitIsLoading } = lkplookupJobWorkUnit;
|
|
269
305
|
|
|
270
306
|
return (
|
|
271
307
|
lookupClassificationIsLoading ||
|
|
@@ -333,6 +369,15 @@ export const areLookupsLoading = createSelector(
|
|
|
333
369
|
lookupPlanTypeIsLoading ||
|
|
334
370
|
lookupPlanStatusIsLoading ||
|
|
335
371
|
lookupSupplyContractTypeIsLoading ||
|
|
372
|
+
lookupJobEventActionIsLoading ||
|
|
373
|
+
lookupJobInvoiceMethodIsLoading ||
|
|
374
|
+
lookupJobQuantityTypeIsLoading ||
|
|
375
|
+
lookupJobStatusIsLoading ||
|
|
376
|
+
lookupJobTypeIsLoading ||
|
|
377
|
+
lookupJobTypeWorkRecordTypeIsLoading ||
|
|
378
|
+
lookupWorkRecordLevelIsLoading ||
|
|
379
|
+
lookupPayrollRecordTypeIsLoading ||
|
|
380
|
+
lookupJobWorkUnitIsLoading ||
|
|
336
381
|
false
|
|
337
382
|
);
|
|
338
383
|
},
|
|
@@ -406,6 +451,15 @@ export const areLookupsLoaded = createSelector(
|
|
|
406
451
|
getLkplookupPlanType,
|
|
407
452
|
getLkplookupPlanStatus,
|
|
408
453
|
getLkplookupSupplyContractType,
|
|
454
|
+
getLkplookupJobEventAction,
|
|
455
|
+
getLkplookupJobInvoiceMethod,
|
|
456
|
+
getLkplookupJobQuantityType,
|
|
457
|
+
getLkplookupJobStatus,
|
|
458
|
+
getLkplookupJobType,
|
|
459
|
+
getLkplookupJobTypeWorkRecordType,
|
|
460
|
+
getLkplookupWorkRecordLevel,
|
|
461
|
+
getLkplookupPayrollRecordType,
|
|
462
|
+
getLkplookupJobWorkUnit,
|
|
409
463
|
],
|
|
410
464
|
(
|
|
411
465
|
lkplookupClassification,
|
|
@@ -473,6 +527,15 @@ export const areLookupsLoaded = createSelector(
|
|
|
473
527
|
lkplookupPlanType,
|
|
474
528
|
lkplookupPlanStatus,
|
|
475
529
|
lkplookupSupplyContractType,
|
|
530
|
+
lkplookupJobEventAction,
|
|
531
|
+
lkplookupJobInvoiceMethod,
|
|
532
|
+
lkplookupJobQuantityType,
|
|
533
|
+
lkplookupJobStatus,
|
|
534
|
+
lkplookupJobType,
|
|
535
|
+
lkplookupJobTypeWorkRecordType,
|
|
536
|
+
lkplookupWorkRecordLevel,
|
|
537
|
+
lkplookupPayrollRecordType,
|
|
538
|
+
lkplookupJobWorkUnit,
|
|
476
539
|
) => {
|
|
477
540
|
const { isLoaded: lookupClassificationIsLoaded } = lkplookupClassification;
|
|
478
541
|
const { isLoaded: lookupClassificationGroupIsLoaded } = lkplookupClassificationGroup;
|
|
@@ -539,6 +602,15 @@ export const areLookupsLoaded = createSelector(
|
|
|
539
602
|
const { isLoaded: lookupPlanTypeIsLoaded } = lkplookupPlanType;
|
|
540
603
|
const { isLoaded: lookupPlanStatusIsLoaded } = lkplookupPlanStatus;
|
|
541
604
|
const { isLoaded: lookupSupplyContractTypeIsLoaded } = lkplookupSupplyContractType;
|
|
605
|
+
const { isLoaded: lookupJobEventActionIsLoaded } = lkplookupJobEventAction;
|
|
606
|
+
const { isLoaded: lookupJobInvoiceMethodIsLoaded } = lkplookupJobInvoiceMethod;
|
|
607
|
+
const { isLoaded: lookupJobQuantityTypeIsLoaded } = lkplookupJobQuantityType;
|
|
608
|
+
const { isLoaded: lookupJobStatusIsLoaded } = lkplookupJobStatus;
|
|
609
|
+
const { isLoaded: lookupJobTypeIsLoaded } = lkplookupJobType;
|
|
610
|
+
const { isLoaded: lookupJobTypeWorkRecordTypeIsLoaded } = lkplookupJobTypeWorkRecordType;
|
|
611
|
+
const { isLoaded: lookupWorkRecordLevelIsLoaded } = lkplookupWorkRecordLevel;
|
|
612
|
+
const { isLoaded: lookupPayrollRecordTypeIsLoaded } = lkplookupPayrollRecordType;
|
|
613
|
+
const { isLoaded: lookupJobWorkUnitIsLoaded } = lkplookupJobWorkUnit;
|
|
542
614
|
|
|
543
615
|
return (
|
|
544
616
|
lookupClassificationIsLoaded ||
|
|
@@ -606,6 +678,15 @@ export const areLookupsLoaded = createSelector(
|
|
|
606
678
|
lookupPlanTypeIsLoaded ||
|
|
607
679
|
lookupPlanStatusIsLoaded ||
|
|
608
680
|
lookupSupplyContractTypeIsLoaded ||
|
|
681
|
+
lookupJobEventActionIsLoaded ||
|
|
682
|
+
lookupJobInvoiceMethodIsLoaded ||
|
|
683
|
+
lookupJobQuantityTypeIsLoaded ||
|
|
684
|
+
lookupJobStatusIsLoaded ||
|
|
685
|
+
lookupJobTypeIsLoaded ||
|
|
686
|
+
lookupJobTypeWorkRecordTypeIsLoaded ||
|
|
687
|
+
lookupWorkRecordLevelIsLoaded ||
|
|
688
|
+
lookupPayrollRecordTypeIsLoaded ||
|
|
689
|
+
lookupJobWorkUnitIsLoaded ||
|
|
609
690
|
false
|
|
610
691
|
);
|
|
611
692
|
},
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { createSelector } from 'reselect';
|
|
2
|
+
import isEmpty from 'lodash/isEmpty';
|
|
3
|
+
import {isValid, format} from 'date-fns';
|
|
4
|
+
import isNil from 'lodash/isNil';
|
|
5
|
+
import has from 'lodash/has';
|
|
6
|
+
|
|
7
|
+
const viewDateFormat = 'dd/MM/yyyy';
|
|
8
|
+
|
|
9
|
+
export const getlookupWorkRecordLevelEntity = state => state.entities.lookupWorkRecordLevel;
|
|
10
|
+
|
|
11
|
+
export const getlookupWorkRecordLevelEntityMeta = createSelector(
|
|
12
|
+
[getlookupWorkRecordLevelEntity],
|
|
13
|
+
reference => {
|
|
14
|
+
const { isLoading, isLoaded, hasError, error } = reference;
|
|
15
|
+
return {
|
|
16
|
+
isLoading,
|
|
17
|
+
isLoaded,
|
|
18
|
+
hasError,
|
|
19
|
+
error,
|
|
20
|
+
};
|
|
21
|
+
},
|
|
22
|
+
);
|
|
23
|
+
|
|
24
|
+
export const getlookupWorkRecordLevelEntityData = createSelector(
|
|
25
|
+
[getlookupWorkRecordLevelEntity],
|
|
26
|
+
reference => {
|
|
27
|
+
const { data = [] } = reference;
|
|
28
|
+
const refData = isEmpty(data) ? [] : data;
|
|
29
|
+
if (!Array.isArray(refData) || isNil(refData)) return [];
|
|
30
|
+
|
|
31
|
+
const formattedData = refData.map(d => {
|
|
32
|
+
let hasDates = false;
|
|
33
|
+
let fromDate = '';
|
|
34
|
+
let toDate = '';
|
|
35
|
+
let fromTo = '';
|
|
36
|
+
|
|
37
|
+
if(has(d, 'effectiveToDate') && has(d, 'effectiveFromDate')){
|
|
38
|
+
hasDates = true;
|
|
39
|
+
toDate =
|
|
40
|
+
!isEmpty(d.effectiveToDate) && isValid(new Date(d.effectiveToDate))
|
|
41
|
+
? format(new Date(d.effectiveToDate), viewDateFormat)
|
|
42
|
+
: '';
|
|
43
|
+
fromDate =
|
|
44
|
+
!isEmpty(d.effectiveFromDate) &&
|
|
45
|
+
isValid(new Date(d.effectiveFromDate))
|
|
46
|
+
? format(new Date(d.effectiveFromDate), viewDateFormat)
|
|
47
|
+
: '';
|
|
48
|
+
const seperator = toDate ? '-' : '';
|
|
49
|
+
fromToDate = `${fromDate} ${seperator} ${toDate}`;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
return {
|
|
53
|
+
...d,
|
|
54
|
+
...(hasDates && {
|
|
55
|
+
fromDate,
|
|
56
|
+
toDate,
|
|
57
|
+
fromTo,
|
|
58
|
+
})
|
|
59
|
+
};
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
return formattedData;
|
|
63
|
+
},
|
|
64
|
+
);
|
|
65
|
+
|