vineanova-redux-artifacts 1.74.0 → 1.76.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/CHANGELOG.md +1 -1
- package/dist/actions/commonActions.js +230 -191
- package/dist/reducers/index.js +4 -3
- package/dist/sagas/vineaNovaApi.sagas.js +857 -800
- package/dist/selectors/index.js +52 -39
- package/dist/selectors/triggerSensorSummaryDataSyncSelector.js +71 -0
- package/dist/services/apiServices.js +834 -781
- package/package.json +1 -1
- package/src/actions/commonActions.js +50 -41
- package/src/reducers/index.js +4 -3
- package/src/sagas/vineaNovaApi.sagas.js +190 -158
- package/src/selectors/index.js +4 -3
- package/src/selectors/triggerSensorSummaryDataSyncSelector.js +64 -0
- package/src/services/apiServices.js +162 -135
package/package.json
CHANGED
|
@@ -216,6 +216,56 @@ const ducksActions = createActions({
|
|
|
216
216
|
UPDATEPARTIALENTITY:[(payload) => payload, ()=> ({ reducerName: 'cropBlockVintage' })],
|
|
217
217
|
},
|
|
218
218
|
},
|
|
219
|
+
sites: {
|
|
220
|
+
get: {
|
|
221
|
+
REQUEST: [(payload) => payload, ()=> ({ reducerName: 'sites' })],
|
|
222
|
+
RECEIVE: [(payload) => payload, ()=> ({ reducerName: 'sites' })],
|
|
223
|
+
ERROR: [(payload) => payload, ()=> ({ reducerName: 'sites' })],
|
|
224
|
+
CLEARDATA: [(payload) => payload, ()=> ({ reducerName: 'sites' })],
|
|
225
|
+
UPDATEPARTIALENTITY:[(payload) => payload, ()=> ({ reducerName: 'sites' })],
|
|
226
|
+
},
|
|
227
|
+
put: {
|
|
228
|
+
REQUEST: [(payload) => payload, ()=> ({ reducerName: 'sites' })],
|
|
229
|
+
RECEIVE: [(payload) => payload, ()=> ({ reducerName: 'sites' })],
|
|
230
|
+
ERROR: [(payload) => payload, ()=> ({ reducerName: 'sites' })],
|
|
231
|
+
CLEARDATA: [(payload) => payload, ()=> ({ reducerName: 'sites' })],
|
|
232
|
+
UPDATEPARTIALENTITY:[(payload) => payload, ()=> ({ reducerName: 'sites' })],
|
|
233
|
+
},
|
|
234
|
+
},
|
|
235
|
+
sensors: {
|
|
236
|
+
get: {
|
|
237
|
+
REQUEST: [(payload) => payload, ()=> ({ reducerName: 'sensors' })],
|
|
238
|
+
RECEIVE: [(payload) => payload, ()=> ({ reducerName: 'sensors' })],
|
|
239
|
+
ERROR: [(payload) => payload, ()=> ({ reducerName: 'sensors' })],
|
|
240
|
+
CLEARDATA: [(payload) => payload, ()=> ({ reducerName: 'sensors' })],
|
|
241
|
+
UPDATEPARTIALENTITY:[(payload) => payload, ()=> ({ reducerName: 'sensors' })],
|
|
242
|
+
},
|
|
243
|
+
put: {
|
|
244
|
+
REQUEST: [(payload) => payload, ()=> ({ reducerName: 'sensors' })],
|
|
245
|
+
RECEIVE: [(payload) => payload, ()=> ({ reducerName: 'sensors' })],
|
|
246
|
+
ERROR: [(payload) => payload, ()=> ({ reducerName: 'sensors' })],
|
|
247
|
+
CLEARDATA: [(payload) => payload, ()=> ({ reducerName: 'sensors' })],
|
|
248
|
+
UPDATEPARTIALENTITY:[(payload) => payload, ()=> ({ reducerName: 'sensors' })],
|
|
249
|
+
},
|
|
250
|
+
},
|
|
251
|
+
sensorBlocks: {
|
|
252
|
+
get: {
|
|
253
|
+
REQUEST: [(payload) => payload, ()=> ({ reducerName: 'sensorBlocks' })],
|
|
254
|
+
RECEIVE: [(payload) => payload, ()=> ({ reducerName: 'sensorBlocks' })],
|
|
255
|
+
ERROR: [(payload) => payload, ()=> ({ reducerName: 'sensorBlocks' })],
|
|
256
|
+
CLEARDATA: [(payload) => payload, ()=> ({ reducerName: 'sensorBlocks' })],
|
|
257
|
+
UPDATEPARTIALENTITY:[(payload) => payload, ()=> ({ reducerName: 'sensorBlocks' })],
|
|
258
|
+
},
|
|
259
|
+
},
|
|
260
|
+
triggerSensorSummaryDataSync: {
|
|
261
|
+
get: {
|
|
262
|
+
REQUEST: [(payload) => payload, ()=> ({ reducerName: 'triggerSensorSummaryDataSync' })],
|
|
263
|
+
RECEIVE: [(payload) => payload, ()=> ({ reducerName: 'triggerSensorSummaryDataSync' })],
|
|
264
|
+
ERROR: [(payload) => payload, ()=> ({ reducerName: 'triggerSensorSummaryDataSync' })],
|
|
265
|
+
CLEARDATA: [(payload) => payload, ()=> ({ reducerName: 'triggerSensorSummaryDataSync' })],
|
|
266
|
+
UPDATEPARTIALENTITY:[(payload) => payload, ()=> ({ reducerName: 'triggerSensorSummaryDataSync' })],
|
|
267
|
+
},
|
|
268
|
+
},
|
|
219
269
|
healthcheck: {
|
|
220
270
|
get: {
|
|
221
271
|
REQUEST: [(payload) => payload, ()=> ({ reducerName: 'healthcheck' })],
|
|
@@ -1024,47 +1074,6 @@ const ducksActions = createActions({
|
|
|
1024
1074
|
UPDATEPARTIALENTITY:[(payload) => payload, ()=> ({ reducerName: 'searchTrackingBlockVintages' })],
|
|
1025
1075
|
},
|
|
1026
1076
|
},
|
|
1027
|
-
sites: {
|
|
1028
|
-
get: {
|
|
1029
|
-
REQUEST: [(payload) => payload, ()=> ({ reducerName: 'sites' })],
|
|
1030
|
-
RECEIVE: [(payload) => payload, ()=> ({ reducerName: 'sites' })],
|
|
1031
|
-
ERROR: [(payload) => payload, ()=> ({ reducerName: 'sites' })],
|
|
1032
|
-
CLEARDATA: [(payload) => payload, ()=> ({ reducerName: 'sites' })],
|
|
1033
|
-
UPDATEPARTIALENTITY:[(payload) => payload, ()=> ({ reducerName: 'sites' })],
|
|
1034
|
-
},
|
|
1035
|
-
put: {
|
|
1036
|
-
REQUEST: [(payload) => payload, ()=> ({ reducerName: 'sites' })],
|
|
1037
|
-
RECEIVE: [(payload) => payload, ()=> ({ reducerName: 'sites' })],
|
|
1038
|
-
ERROR: [(payload) => payload, ()=> ({ reducerName: 'sites' })],
|
|
1039
|
-
CLEARDATA: [(payload) => payload, ()=> ({ reducerName: 'sites' })],
|
|
1040
|
-
UPDATEPARTIALENTITY:[(payload) => payload, ()=> ({ reducerName: 'sites' })],
|
|
1041
|
-
},
|
|
1042
|
-
},
|
|
1043
|
-
sensors: {
|
|
1044
|
-
get: {
|
|
1045
|
-
REQUEST: [(payload) => payload, ()=> ({ reducerName: 'sensors' })],
|
|
1046
|
-
RECEIVE: [(payload) => payload, ()=> ({ reducerName: 'sensors' })],
|
|
1047
|
-
ERROR: [(payload) => payload, ()=> ({ reducerName: 'sensors' })],
|
|
1048
|
-
CLEARDATA: [(payload) => payload, ()=> ({ reducerName: 'sensors' })],
|
|
1049
|
-
UPDATEPARTIALENTITY:[(payload) => payload, ()=> ({ reducerName: 'sensors' })],
|
|
1050
|
-
},
|
|
1051
|
-
put: {
|
|
1052
|
-
REQUEST: [(payload) => payload, ()=> ({ reducerName: 'sensors' })],
|
|
1053
|
-
RECEIVE: [(payload) => payload, ()=> ({ reducerName: 'sensors' })],
|
|
1054
|
-
ERROR: [(payload) => payload, ()=> ({ reducerName: 'sensors' })],
|
|
1055
|
-
CLEARDATA: [(payload) => payload, ()=> ({ reducerName: 'sensors' })],
|
|
1056
|
-
UPDATEPARTIALENTITY:[(payload) => payload, ()=> ({ reducerName: 'sensors' })],
|
|
1057
|
-
},
|
|
1058
|
-
},
|
|
1059
|
-
sensorBlocks: {
|
|
1060
|
-
get: {
|
|
1061
|
-
REQUEST: [(payload) => payload, ()=> ({ reducerName: 'sensorBlocks' })],
|
|
1062
|
-
RECEIVE: [(payload) => payload, ()=> ({ reducerName: 'sensorBlocks' })],
|
|
1063
|
-
ERROR: [(payload) => payload, ()=> ({ reducerName: 'sensorBlocks' })],
|
|
1064
|
-
CLEARDATA: [(payload) => payload, ()=> ({ reducerName: 'sensorBlocks' })],
|
|
1065
|
-
UPDATEPARTIALENTITY:[(payload) => payload, ()=> ({ reducerName: 'sensorBlocks' })],
|
|
1066
|
-
},
|
|
1067
|
-
},
|
|
1068
1077
|
vineyardBlocksGeometry: {
|
|
1069
1078
|
get: {
|
|
1070
1079
|
REQUEST: [(payload) => payload, ()=> ({ reducerName: 'vineyardBlocksGeometry' })],
|
package/src/reducers/index.js
CHANGED
|
@@ -15,6 +15,10 @@ const rootReducer = {
|
|
|
15
15
|
cropBlockPhenology: createNamedReducer('cropBlockPhenology'),
|
|
16
16
|
cropBlockSetting: createNamedReducer('cropBlockSetting'),
|
|
17
17
|
cropBlockVintage: createNamedReducer('cropBlockVintage'),
|
|
18
|
+
sites: createNamedReducer('sites'),
|
|
19
|
+
sensors: createNamedReducer('sensors'),
|
|
20
|
+
sensorBlocks: createNamedReducer('sensorBlocks'),
|
|
21
|
+
triggerSensorSummaryDataSync: createNamedReducer('triggerSensorSummaryDataSync'),
|
|
18
22
|
healthcheck: createNamedReducer('healthcheck'),
|
|
19
23
|
identity: createNamedReducer('identity'),
|
|
20
24
|
identityDetails: createNamedReducer('identityDetails'),
|
|
@@ -62,9 +66,6 @@ const rootReducer = {
|
|
|
62
66
|
searchIdentity: createNamedReducer('searchIdentity'),
|
|
63
67
|
searchTrackingVineyards: createNamedReducer('searchTrackingVineyards'),
|
|
64
68
|
searchTrackingBlockVintages: createNamedReducer('searchTrackingBlockVintages'),
|
|
65
|
-
sites: createNamedReducer('sites'),
|
|
66
|
-
sensors: createNamedReducer('sensors'),
|
|
67
|
-
sensorBlocks: createNamedReducer('sensorBlocks'),
|
|
68
69
|
vineyardBlocksGeometry: createNamedReducer('vineyardBlocksGeometry'),
|
|
69
70
|
vineyardGeometry: createNamedReducer('vineyardGeometry'),
|
|
70
71
|
vineyardBlockActivityProgress: createNamedReducer('vineyardBlockActivityProgress'),
|
|
@@ -850,6 +850,190 @@ import { VineaNovaActions } from '../actions'
|
|
|
850
850
|
}
|
|
851
851
|
|
|
852
852
|
|
|
853
|
+
export function* getSitesSagas(action) {
|
|
854
|
+
const {
|
|
855
|
+
payload = {},
|
|
856
|
+
meta: { reducerName },
|
|
857
|
+
} = action;
|
|
858
|
+
try {
|
|
859
|
+
yield put({
|
|
860
|
+
type: "FETCHING",
|
|
861
|
+
name: reducerName,
|
|
862
|
+
});
|
|
863
|
+
|
|
864
|
+
const response = yield call(APIServices.getSites, payload);
|
|
865
|
+
yield put({
|
|
866
|
+
type: "SUCCESS",
|
|
867
|
+
payload: response,
|
|
868
|
+
name: reducerName,
|
|
869
|
+
});
|
|
870
|
+
|
|
871
|
+
|
|
872
|
+
} catch (err) {
|
|
873
|
+
logger.error(err);
|
|
874
|
+
/* istanbul ignore next */
|
|
875
|
+
yield put({
|
|
876
|
+
type: "ERROR",
|
|
877
|
+
payload: err,
|
|
878
|
+
name: reducerName,
|
|
879
|
+
});
|
|
880
|
+
}
|
|
881
|
+
}
|
|
882
|
+
|
|
883
|
+
export function* putSitesSagas(action) {
|
|
884
|
+
const {
|
|
885
|
+
payload = {},
|
|
886
|
+
meta: { reducerName },
|
|
887
|
+
} = action;
|
|
888
|
+
try {
|
|
889
|
+
yield put({
|
|
890
|
+
type: "FETCHING",
|
|
891
|
+
name: reducerName,
|
|
892
|
+
});
|
|
893
|
+
|
|
894
|
+
const response = yield call(APIServices.putSites, payload);
|
|
895
|
+
yield put({
|
|
896
|
+
type: "SUCCESS",
|
|
897
|
+
payload: response,
|
|
898
|
+
name: reducerName,
|
|
899
|
+
});
|
|
900
|
+
|
|
901
|
+
|
|
902
|
+
} catch (err) {
|
|
903
|
+
logger.error(err);
|
|
904
|
+
/* istanbul ignore next */
|
|
905
|
+
yield put({
|
|
906
|
+
type: "ERROR",
|
|
907
|
+
payload: err,
|
|
908
|
+
name: reducerName,
|
|
909
|
+
});
|
|
910
|
+
}
|
|
911
|
+
}
|
|
912
|
+
|
|
913
|
+
|
|
914
|
+
export function* getSensorsSagas(action) {
|
|
915
|
+
const {
|
|
916
|
+
payload = {},
|
|
917
|
+
meta: { reducerName },
|
|
918
|
+
} = action;
|
|
919
|
+
try {
|
|
920
|
+
yield put({
|
|
921
|
+
type: "FETCHING",
|
|
922
|
+
name: reducerName,
|
|
923
|
+
});
|
|
924
|
+
|
|
925
|
+
const response = yield call(APIServices.getSensors, payload);
|
|
926
|
+
yield put({
|
|
927
|
+
type: "SUCCESS",
|
|
928
|
+
payload: response,
|
|
929
|
+
name: reducerName,
|
|
930
|
+
});
|
|
931
|
+
|
|
932
|
+
|
|
933
|
+
} catch (err) {
|
|
934
|
+
logger.error(err);
|
|
935
|
+
/* istanbul ignore next */
|
|
936
|
+
yield put({
|
|
937
|
+
type: "ERROR",
|
|
938
|
+
payload: err,
|
|
939
|
+
name: reducerName,
|
|
940
|
+
});
|
|
941
|
+
}
|
|
942
|
+
}
|
|
943
|
+
|
|
944
|
+
export function* putSensorsSagas(action) {
|
|
945
|
+
const {
|
|
946
|
+
payload = {},
|
|
947
|
+
meta: { reducerName },
|
|
948
|
+
} = action;
|
|
949
|
+
try {
|
|
950
|
+
yield put({
|
|
951
|
+
type: "FETCHING",
|
|
952
|
+
name: reducerName,
|
|
953
|
+
});
|
|
954
|
+
|
|
955
|
+
const response = yield call(APIServices.putSensors, payload);
|
|
956
|
+
yield put({
|
|
957
|
+
type: "SUCCESS",
|
|
958
|
+
payload: response,
|
|
959
|
+
name: reducerName,
|
|
960
|
+
});
|
|
961
|
+
|
|
962
|
+
|
|
963
|
+
} catch (err) {
|
|
964
|
+
logger.error(err);
|
|
965
|
+
/* istanbul ignore next */
|
|
966
|
+
yield put({
|
|
967
|
+
type: "ERROR",
|
|
968
|
+
payload: err,
|
|
969
|
+
name: reducerName,
|
|
970
|
+
});
|
|
971
|
+
}
|
|
972
|
+
}
|
|
973
|
+
|
|
974
|
+
|
|
975
|
+
export function* getSensorBlocksSagas(action) {
|
|
976
|
+
const {
|
|
977
|
+
payload = {},
|
|
978
|
+
meta: { reducerName },
|
|
979
|
+
} = action;
|
|
980
|
+
try {
|
|
981
|
+
yield put({
|
|
982
|
+
type: "FETCHING",
|
|
983
|
+
name: reducerName,
|
|
984
|
+
});
|
|
985
|
+
|
|
986
|
+
const response = yield call(APIServices.getSensorBlocks, payload);
|
|
987
|
+
yield put({
|
|
988
|
+
type: "SUCCESS",
|
|
989
|
+
payload: response,
|
|
990
|
+
name: reducerName,
|
|
991
|
+
});
|
|
992
|
+
|
|
993
|
+
|
|
994
|
+
} catch (err) {
|
|
995
|
+
logger.error(err);
|
|
996
|
+
/* istanbul ignore next */
|
|
997
|
+
yield put({
|
|
998
|
+
type: "ERROR",
|
|
999
|
+
payload: err,
|
|
1000
|
+
name: reducerName,
|
|
1001
|
+
});
|
|
1002
|
+
}
|
|
1003
|
+
}
|
|
1004
|
+
|
|
1005
|
+
|
|
1006
|
+
export function* getTriggerSensorSummaryDataSyncSagas(action) {
|
|
1007
|
+
const {
|
|
1008
|
+
payload = {},
|
|
1009
|
+
meta: { reducerName },
|
|
1010
|
+
} = action;
|
|
1011
|
+
try {
|
|
1012
|
+
yield put({
|
|
1013
|
+
type: "FETCHING",
|
|
1014
|
+
name: reducerName,
|
|
1015
|
+
});
|
|
1016
|
+
|
|
1017
|
+
const response = yield call(APIServices.getTriggerSensorSummaryDataSync, payload);
|
|
1018
|
+
yield put({
|
|
1019
|
+
type: "SUCCESS",
|
|
1020
|
+
payload: response,
|
|
1021
|
+
name: reducerName,
|
|
1022
|
+
});
|
|
1023
|
+
|
|
1024
|
+
|
|
1025
|
+
} catch (err) {
|
|
1026
|
+
logger.error(err);
|
|
1027
|
+
/* istanbul ignore next */
|
|
1028
|
+
yield put({
|
|
1029
|
+
type: "ERROR",
|
|
1030
|
+
payload: err,
|
|
1031
|
+
name: reducerName,
|
|
1032
|
+
});
|
|
1033
|
+
}
|
|
1034
|
+
}
|
|
1035
|
+
|
|
1036
|
+
|
|
853
1037
|
export function* gethealthcheckSagas(action) {
|
|
854
1038
|
const {
|
|
855
1039
|
payload = {},
|
|
@@ -3965,159 +4149,6 @@ import { VineaNovaActions } from '../actions'
|
|
|
3965
4149
|
}
|
|
3966
4150
|
|
|
3967
4151
|
|
|
3968
|
-
export function* getSitesSagas(action) {
|
|
3969
|
-
const {
|
|
3970
|
-
payload = {},
|
|
3971
|
-
meta: { reducerName },
|
|
3972
|
-
} = action;
|
|
3973
|
-
try {
|
|
3974
|
-
yield put({
|
|
3975
|
-
type: "FETCHING",
|
|
3976
|
-
name: reducerName,
|
|
3977
|
-
});
|
|
3978
|
-
|
|
3979
|
-
const response = yield call(APIServices.getSites, payload);
|
|
3980
|
-
yield put({
|
|
3981
|
-
type: "SUCCESS",
|
|
3982
|
-
payload: response,
|
|
3983
|
-
name: reducerName,
|
|
3984
|
-
});
|
|
3985
|
-
|
|
3986
|
-
|
|
3987
|
-
} catch (err) {
|
|
3988
|
-
logger.error(err);
|
|
3989
|
-
/* istanbul ignore next */
|
|
3990
|
-
yield put({
|
|
3991
|
-
type: "ERROR",
|
|
3992
|
-
payload: err,
|
|
3993
|
-
name: reducerName,
|
|
3994
|
-
});
|
|
3995
|
-
}
|
|
3996
|
-
}
|
|
3997
|
-
|
|
3998
|
-
export function* putSitesSagas(action) {
|
|
3999
|
-
const {
|
|
4000
|
-
payload = {},
|
|
4001
|
-
meta: { reducerName },
|
|
4002
|
-
} = action;
|
|
4003
|
-
try {
|
|
4004
|
-
yield put({
|
|
4005
|
-
type: "FETCHING",
|
|
4006
|
-
name: reducerName,
|
|
4007
|
-
});
|
|
4008
|
-
|
|
4009
|
-
const response = yield call(APIServices.putSites, payload);
|
|
4010
|
-
yield put({
|
|
4011
|
-
type: "SUCCESS",
|
|
4012
|
-
payload: response,
|
|
4013
|
-
name: reducerName,
|
|
4014
|
-
});
|
|
4015
|
-
|
|
4016
|
-
|
|
4017
|
-
} catch (err) {
|
|
4018
|
-
logger.error(err);
|
|
4019
|
-
/* istanbul ignore next */
|
|
4020
|
-
yield put({
|
|
4021
|
-
type: "ERROR",
|
|
4022
|
-
payload: err,
|
|
4023
|
-
name: reducerName,
|
|
4024
|
-
});
|
|
4025
|
-
}
|
|
4026
|
-
}
|
|
4027
|
-
|
|
4028
|
-
|
|
4029
|
-
export function* getSensorsSagas(action) {
|
|
4030
|
-
const {
|
|
4031
|
-
payload = {},
|
|
4032
|
-
meta: { reducerName },
|
|
4033
|
-
} = action;
|
|
4034
|
-
try {
|
|
4035
|
-
yield put({
|
|
4036
|
-
type: "FETCHING",
|
|
4037
|
-
name: reducerName,
|
|
4038
|
-
});
|
|
4039
|
-
|
|
4040
|
-
const response = yield call(APIServices.getSensors, payload);
|
|
4041
|
-
yield put({
|
|
4042
|
-
type: "SUCCESS",
|
|
4043
|
-
payload: response,
|
|
4044
|
-
name: reducerName,
|
|
4045
|
-
});
|
|
4046
|
-
|
|
4047
|
-
|
|
4048
|
-
} catch (err) {
|
|
4049
|
-
logger.error(err);
|
|
4050
|
-
/* istanbul ignore next */
|
|
4051
|
-
yield put({
|
|
4052
|
-
type: "ERROR",
|
|
4053
|
-
payload: err,
|
|
4054
|
-
name: reducerName,
|
|
4055
|
-
});
|
|
4056
|
-
}
|
|
4057
|
-
}
|
|
4058
|
-
|
|
4059
|
-
export function* putSensorsSagas(action) {
|
|
4060
|
-
const {
|
|
4061
|
-
payload = {},
|
|
4062
|
-
meta: { reducerName },
|
|
4063
|
-
} = action;
|
|
4064
|
-
try {
|
|
4065
|
-
yield put({
|
|
4066
|
-
type: "FETCHING",
|
|
4067
|
-
name: reducerName,
|
|
4068
|
-
});
|
|
4069
|
-
|
|
4070
|
-
const response = yield call(APIServices.putSensors, payload);
|
|
4071
|
-
yield put({
|
|
4072
|
-
type: "SUCCESS",
|
|
4073
|
-
payload: response,
|
|
4074
|
-
name: reducerName,
|
|
4075
|
-
});
|
|
4076
|
-
|
|
4077
|
-
|
|
4078
|
-
} catch (err) {
|
|
4079
|
-
logger.error(err);
|
|
4080
|
-
/* istanbul ignore next */
|
|
4081
|
-
yield put({
|
|
4082
|
-
type: "ERROR",
|
|
4083
|
-
payload: err,
|
|
4084
|
-
name: reducerName,
|
|
4085
|
-
});
|
|
4086
|
-
}
|
|
4087
|
-
}
|
|
4088
|
-
|
|
4089
|
-
|
|
4090
|
-
export function* getSensorBlocksSagas(action) {
|
|
4091
|
-
const {
|
|
4092
|
-
payload = {},
|
|
4093
|
-
meta: { reducerName },
|
|
4094
|
-
} = action;
|
|
4095
|
-
try {
|
|
4096
|
-
yield put({
|
|
4097
|
-
type: "FETCHING",
|
|
4098
|
-
name: reducerName,
|
|
4099
|
-
});
|
|
4100
|
-
|
|
4101
|
-
const response = yield call(APIServices.getSensorBlocks, payload);
|
|
4102
|
-
yield put({
|
|
4103
|
-
type: "SUCCESS",
|
|
4104
|
-
payload: response,
|
|
4105
|
-
name: reducerName,
|
|
4106
|
-
});
|
|
4107
|
-
|
|
4108
|
-
|
|
4109
|
-
} catch (err) {
|
|
4110
|
-
logger.error(err);
|
|
4111
|
-
/* istanbul ignore next */
|
|
4112
|
-
yield put({
|
|
4113
|
-
type: "ERROR",
|
|
4114
|
-
payload: err,
|
|
4115
|
-
name: reducerName,
|
|
4116
|
-
});
|
|
4117
|
-
}
|
|
4118
|
-
}
|
|
4119
|
-
|
|
4120
|
-
|
|
4121
4152
|
export function* getVineyardBlocksGeometrySagas(action) {
|
|
4122
4153
|
const {
|
|
4123
4154
|
payload = {},
|
|
@@ -6249,6 +6280,12 @@ export default function* root() {
|
|
|
6249
6280
|
takeLatest(VineaNovaActions.api.v1.cropBlockVintage.post.request().type, postCropBlockVintageSagas),
|
|
6250
6281
|
takeLatest(VineaNovaActions.api.v1.cropBlockVintage.put.request().type, putCropBlockVintageSagas),
|
|
6251
6282
|
takeLatest(VineaNovaActions.api.v1.cropBlockVintage.delete.request().type, deleteCropBlockVintageSagas),
|
|
6283
|
+
takeLatest(VineaNovaActions.api.v1.sites.get.request().type, getSitesSagas),
|
|
6284
|
+
takeLatest(VineaNovaActions.api.v1.sites.put.request().type, putSitesSagas),
|
|
6285
|
+
takeLatest(VineaNovaActions.api.v1.sensors.get.request().type, getSensorsSagas),
|
|
6286
|
+
takeLatest(VineaNovaActions.api.v1.sensors.put.request().type, putSensorsSagas),
|
|
6287
|
+
takeLatest(VineaNovaActions.api.v1.sensorBlocks.get.request().type, getSensorBlocksSagas),
|
|
6288
|
+
takeLatest(VineaNovaActions.api.v1.triggerSensorSummaryDataSync.get.request().type, getTriggerSensorSummaryDataSyncSagas),
|
|
6252
6289
|
takeLatest(VineaNovaActions.api.v1.healthcheck.get.request().type, gethealthcheckSagas),
|
|
6253
6290
|
takeLatest(VineaNovaActions.api.v1.healthcheck.post.request().type, posthealthcheckSagas),
|
|
6254
6291
|
takeLatest(VineaNovaActions.api.v1.identity.get.request().type, getIdentitySagas),
|
|
@@ -6351,11 +6388,6 @@ export default function* root() {
|
|
|
6351
6388
|
takeLatest(VineaNovaActions.api.v1.searchIdentity.post.request().type, postSearchIdentitySagas),
|
|
6352
6389
|
takeLatest(VineaNovaActions.api.v1.searchTrackingVineyards.post.request().type, postSearchTrackingVineyardsSagas),
|
|
6353
6390
|
takeLatest(VineaNovaActions.api.v1.searchTrackingBlockVintages.post.request().type, postSearchTrackingBlockVintagesSagas),
|
|
6354
|
-
takeLatest(VineaNovaActions.api.v1.sites.get.request().type, getSitesSagas),
|
|
6355
|
-
takeLatest(VineaNovaActions.api.v1.sites.put.request().type, putSitesSagas),
|
|
6356
|
-
takeLatest(VineaNovaActions.api.v1.sensors.get.request().type, getSensorsSagas),
|
|
6357
|
-
takeLatest(VineaNovaActions.api.v1.sensors.put.request().type, putSensorsSagas),
|
|
6358
|
-
takeLatest(VineaNovaActions.api.v1.sensorBlocks.get.request().type, getSensorBlocksSagas),
|
|
6359
6391
|
takeLatest(VineaNovaActions.api.v1.vineyardBlocksGeometry.get.request().type, getVineyardBlocksGeometrySagas),
|
|
6360
6392
|
takeLatest(VineaNovaActions.api.v1.vineyardGeometry.get.request().type, getVineyardGeometrySagas),
|
|
6361
6393
|
takeLatest(VineaNovaActions.api.v1.vineyardBlockActivityProgress.get.request().type, getVineyardBlockActivityProgressSagas),
|
package/src/selectors/index.js
CHANGED
|
@@ -11,6 +11,10 @@ export * from "./cropBlockNotesSelector";
|
|
|
11
11
|
export * from "./cropBlockPhenologySelector";
|
|
12
12
|
export * from "./cropBlockSettingSelector";
|
|
13
13
|
export * from "./cropBlockVintageSelector";
|
|
14
|
+
export * from "./sitesSelector";
|
|
15
|
+
export * from "./sensorsSelector";
|
|
16
|
+
export * from "./sensorBlocksSelector";
|
|
17
|
+
export * from "./triggerSensorSummaryDataSyncSelector";
|
|
14
18
|
export * from "./healthcheckSelector";
|
|
15
19
|
export * from "./identitySelector";
|
|
16
20
|
export * from "./identityDetailsSelector";
|
|
@@ -58,9 +62,6 @@ export * from "./sampleSetSelector";
|
|
|
58
62
|
export * from "./searchIdentitySelector";
|
|
59
63
|
export * from "./searchTrackingVineyardsSelector";
|
|
60
64
|
export * from "./searchTrackingBlockVintagesSelector";
|
|
61
|
-
export * from "./sitesSelector";
|
|
62
|
-
export * from "./sensorsSelector";
|
|
63
|
-
export * from "./sensorBlocksSelector";
|
|
64
65
|
export * from "./vineyardBlocksGeometrySelector";
|
|
65
66
|
export * from "./vineyardGeometrySelector";
|
|
66
67
|
export * from "./vineyardBlockActivityProgressSelector";
|
|
@@ -0,0 +1,64 @@
|
|
|
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
|
+
|
|
8
|
+
export const getTriggerSensorSummaryDataSyncEntity = state => state.entities.triggerSensorSummaryDataSync;
|
|
9
|
+
|
|
10
|
+
export const getTriggerSensorSummaryDataSyncEntityMeta = createSelector(
|
|
11
|
+
[getTriggerSensorSummaryDataSyncEntity],
|
|
12
|
+
reference => {
|
|
13
|
+
const { isLoading, isLoaded, hasError, error } = reference;
|
|
14
|
+
return {
|
|
15
|
+
isLoading,
|
|
16
|
+
isLoaded,
|
|
17
|
+
hasError,
|
|
18
|
+
error,
|
|
19
|
+
};
|
|
20
|
+
},
|
|
21
|
+
);
|
|
22
|
+
|
|
23
|
+
export const getTriggerSensorSummaryDataSyncEntityData = createSelector(
|
|
24
|
+
[getTriggerSensorSummaryDataSyncEntity],
|
|
25
|
+
reference => {
|
|
26
|
+
const { data = [] } = reference;
|
|
27
|
+
const refData = isEmpty(data) ? [] : data;
|
|
28
|
+
if (!Array.isArray(refData) || isNil(refData)) return [];
|
|
29
|
+
|
|
30
|
+
const formattedData = refData.map(d => {
|
|
31
|
+
let hasDates = false;
|
|
32
|
+
let fromDate = '';
|
|
33
|
+
let toDate = '';
|
|
34
|
+
let fromTo = '';
|
|
35
|
+
|
|
36
|
+
if(has(d, 'effectiveToDate') && has(d, 'effectiveFromDate')){
|
|
37
|
+
hasDates = true;
|
|
38
|
+
toDate =
|
|
39
|
+
!isEmpty(d.effectiveToDate) && isValid(new Date(d.effectiveToDate))
|
|
40
|
+
? format(new Date(d.effectiveToDate), viewDateFormat)
|
|
41
|
+
: '';
|
|
42
|
+
fromDate =
|
|
43
|
+
!isEmpty(d.effectiveFromDate) &&
|
|
44
|
+
isValid(new Date(d.effectiveFromDate))
|
|
45
|
+
? format(new Date(d.effectiveFromDate), viewDateFormat)
|
|
46
|
+
: '';
|
|
47
|
+
const seperator = toDate ? '-' : '';
|
|
48
|
+
fromToDate = `${fromDate} ${seperator} ${toDate}`;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
return {
|
|
52
|
+
...d,
|
|
53
|
+
...(hasDates && {
|
|
54
|
+
fromDate,
|
|
55
|
+
toDate,
|
|
56
|
+
fromTo,
|
|
57
|
+
})
|
|
58
|
+
};
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
return formattedData;
|
|
62
|
+
},
|
|
63
|
+
);
|
|
64
|
+
|