vineanova-redux-artifacts 1.119.385 → 1.119.387

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.
@@ -497,6 +497,158 @@ var ducksActions = (0, _reduxActions.createActions)({
497
497
  }]
498
498
  }
499
499
  },
500
+ calculators: {
501
+ get: {
502
+ REQUEST: [function (payload) {
503
+ return payload;
504
+ }, function () {
505
+ return {
506
+ reducerName: 'calculators'
507
+ };
508
+ }],
509
+ RECEIVE: [function (payload) {
510
+ return payload;
511
+ }, function () {
512
+ return {
513
+ reducerName: 'calculators'
514
+ };
515
+ }],
516
+ ERROR: [function (payload) {
517
+ return payload;
518
+ }, function () {
519
+ return {
520
+ reducerName: 'calculators'
521
+ };
522
+ }],
523
+ CLEARDATA: [function (payload) {
524
+ return payload;
525
+ }, function () {
526
+ return {
527
+ reducerName: 'calculators'
528
+ };
529
+ }],
530
+ UPDATEPARTIALENTITY: [function (payload) {
531
+ return payload;
532
+ }, function () {
533
+ return {
534
+ reducerName: 'calculators'
535
+ };
536
+ }]
537
+ }
538
+ },
539
+ calculator: {
540
+ post: {
541
+ REQUEST: [function (payload) {
542
+ return payload;
543
+ }, function () {
544
+ return {
545
+ reducerName: 'calculator'
546
+ };
547
+ }],
548
+ RECEIVE: [function (payload) {
549
+ return payload;
550
+ }, function () {
551
+ return {
552
+ reducerName: 'calculator'
553
+ };
554
+ }],
555
+ ERROR: [function (payload) {
556
+ return payload;
557
+ }, function () {
558
+ return {
559
+ reducerName: 'calculator'
560
+ };
561
+ }],
562
+ CLEARDATA: [function (payload) {
563
+ return payload;
564
+ }, function () {
565
+ return {
566
+ reducerName: 'calculator'
567
+ };
568
+ }],
569
+ UPDATEPARTIALENTITY: [function (payload) {
570
+ return payload;
571
+ }, function () {
572
+ return {
573
+ reducerName: 'calculator'
574
+ };
575
+ }]
576
+ },
577
+ put: {
578
+ REQUEST: [function (payload) {
579
+ return payload;
580
+ }, function () {
581
+ return {
582
+ reducerName: 'calculator'
583
+ };
584
+ }],
585
+ RECEIVE: [function (payload) {
586
+ return payload;
587
+ }, function () {
588
+ return {
589
+ reducerName: 'calculator'
590
+ };
591
+ }],
592
+ ERROR: [function (payload) {
593
+ return payload;
594
+ }, function () {
595
+ return {
596
+ reducerName: 'calculator'
597
+ };
598
+ }],
599
+ CLEARDATA: [function (payload) {
600
+ return payload;
601
+ }, function () {
602
+ return {
603
+ reducerName: 'calculator'
604
+ };
605
+ }],
606
+ UPDATEPARTIALENTITY: [function (payload) {
607
+ return payload;
608
+ }, function () {
609
+ return {
610
+ reducerName: 'calculator'
611
+ };
612
+ }]
613
+ },
614
+ "delete": {
615
+ REQUEST: [function (payload) {
616
+ return payload;
617
+ }, function () {
618
+ return {
619
+ reducerName: 'calculator'
620
+ };
621
+ }],
622
+ RECEIVE: [function (payload) {
623
+ return payload;
624
+ }, function () {
625
+ return {
626
+ reducerName: 'calculator'
627
+ };
628
+ }],
629
+ ERROR: [function (payload) {
630
+ return payload;
631
+ }, function () {
632
+ return {
633
+ reducerName: 'calculator'
634
+ };
635
+ }],
636
+ CLEARDATA: [function (payload) {
637
+ return payload;
638
+ }, function () {
639
+ return {
640
+ reducerName: 'calculator'
641
+ };
642
+ }],
643
+ UPDATEPARTIALENTITY: [function (payload) {
644
+ return payload;
645
+ }, function () {
646
+ return {
647
+ reducerName: 'calculator'
648
+ };
649
+ }]
650
+ }
651
+ },
500
652
  chartsByChartFilters: {
501
653
  post: {
502
654
  REQUEST: [function (payload) {
@@ -5390,45 +5542,6 @@ var ducksActions = (0, _reduxActions.createActions)({
5390
5542
  }]
5391
5543
  }
5392
5544
  },
5393
- gridVineyardBlocks: {
5394
- get: {
5395
- REQUEST: [function (payload) {
5396
- return payload;
5397
- }, function () {
5398
- return {
5399
- reducerName: 'gridVineyardBlocks'
5400
- };
5401
- }],
5402
- RECEIVE: [function (payload) {
5403
- return payload;
5404
- }, function () {
5405
- return {
5406
- reducerName: 'gridVineyardBlocks'
5407
- };
5408
- }],
5409
- ERROR: [function (payload) {
5410
- return payload;
5411
- }, function () {
5412
- return {
5413
- reducerName: 'gridVineyardBlocks'
5414
- };
5415
- }],
5416
- CLEARDATA: [function (payload) {
5417
- return payload;
5418
- }, function () {
5419
- return {
5420
- reducerName: 'gridVineyardBlocks'
5421
- };
5422
- }],
5423
- UPDATEPARTIALENTITY: [function (payload) {
5424
- return payload;
5425
- }, function () {
5426
- return {
5427
- reducerName: 'gridVineyardBlocks'
5428
- };
5429
- }]
5430
- }
5431
- },
5432
5545
  identityVineyardBlocks: {
5433
5546
  get: {
5434
5547
  REQUEST: [function (payload) {
@@ -47,6 +47,28 @@ Object.keys(_useFetchblockVintage).forEach(function (key) {
47
47
  }
48
48
  });
49
49
  });
50
+ var _useFetchcalculators = require("./useFetchcalculators");
51
+ Object.keys(_useFetchcalculators).forEach(function (key) {
52
+ if (key === "default" || key === "__esModule") return;
53
+ if (key in exports && exports[key] === _useFetchcalculators[key]) return;
54
+ Object.defineProperty(exports, key, {
55
+ enumerable: true,
56
+ get: function get() {
57
+ return _useFetchcalculators[key];
58
+ }
59
+ });
60
+ });
61
+ var _useFetchcalculator = require("./useFetchcalculator");
62
+ Object.keys(_useFetchcalculator).forEach(function (key) {
63
+ if (key === "default" || key === "__esModule") return;
64
+ if (key in exports && exports[key] === _useFetchcalculator[key]) return;
65
+ Object.defineProperty(exports, key, {
66
+ enumerable: true,
67
+ get: function get() {
68
+ return _useFetchcalculator[key];
69
+ }
70
+ });
71
+ });
50
72
  var _useFetchchartsByChartFilters = require("./useFetchchartsByChartFilters");
51
73
  Object.keys(_useFetchchartsByChartFilters).forEach(function (key) {
52
74
  if (key === "default" || key === "__esModule") return;
@@ -707,17 +729,6 @@ Object.keys(_useFetchparentVineyardPayers).forEach(function (key) {
707
729
  }
708
730
  });
709
731
  });
710
- var _useFetchgridVineyardBlocks = require("./useFetchgridVineyardBlocks");
711
- Object.keys(_useFetchgridVineyardBlocks).forEach(function (key) {
712
- if (key === "default" || key === "__esModule") return;
713
- if (key in exports && exports[key] === _useFetchgridVineyardBlocks[key]) return;
714
- Object.defineProperty(exports, key, {
715
- enumerable: true,
716
- get: function get() {
717
- return _useFetchgridVineyardBlocks[key];
718
- }
719
- });
720
- });
721
732
  var _useFetchidentityVineyardBlocks = require("./useFetchidentityVineyardBlocks");
722
733
  Object.keys(_useFetchidentityVineyardBlocks).forEach(function (key) {
723
734
  if (key === "default" || key === "__esModule") return;
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.useFetchGridVineyardBlocks = void 0;
6
+ exports.useFetchCalculator = void 0;
7
7
  var _react = require("react");
8
8
  var _reactRedux = require("react-redux");
9
9
  var _isEmpty = _interopRequireDefault(require("lodash/isEmpty"));
@@ -17,10 +17,10 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
17
17
  function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
18
18
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
19
19
  function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
20
- var useFetchGridVineyardBlocks = exports.useFetchGridVineyardBlocks = function useFetchGridVineyardBlocks(props) {
20
+ var useFetchCalculator = exports.useFetchCalculator = function useFetchCalculator(props) {
21
21
  // selectors
22
- var data = (0, _reactRedux.useSelector)(VineaNovaSelectors.getGridVineyardBlocksEntityData);
23
- var entity = (0, _reactRedux.useSelector)(VineaNovaSelectors.getGridVineyardBlocksEntityMeta);
22
+ var data = (0, _reactRedux.useSelector)(VineaNovaSelectors.getCalculatorEntityData);
23
+ var entity = (0, _reactRedux.useSelector)(VineaNovaSelectors.getCalculatorEntityMeta);
24
24
  var dispatchAPI = (0, _reactRedux.useDispatch)();
25
25
  var _props$queryParams = props.queryParams,
26
26
  queryParams = _props$queryParams === void 0 ? {} : _props$queryParams;
@@ -29,13 +29,13 @@ var useFetchGridVineyardBlocks = exports.useFetchGridVineyardBlocks = function u
29
29
  var shouldFetch = !(entity !== null && entity !== void 0 && entity.isLoaded) || (entity === null || entity === void 0 ? void 0 : entity.hasError) || (0, _isEmpty["default"])(entity.data);
30
30
  (0, _react.useEffect)(function () {
31
31
  if (shouldFetch) {
32
- dispatchAPI(_actions.VineaNovaActions.api.v1.gridVineyardBlocks.get.request({
32
+ dispatchAPI(_actions.VineaNovaActions.api.v1.calculator.get.request({
33
33
  queryParams: _objectSpread({}, queryParams)
34
34
  }));
35
35
  }
36
36
  }, [shouldFetch, JSON.stringify(queryParams)]);
37
37
  var useQuery = function useQuery(queryParams) {
38
- dispatchAPI(_actions.VineaNovaActions.api.v1.gridVineyardBlocks.get.request({
38
+ dispatchAPI(_actions.VineaNovaActions.api.v1.calculator.get.request({
39
39
  queryParams: _objectSpread({}, queryParams)
40
40
  }));
41
41
  };
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.useFetchCalculators = void 0;
7
+ var _react = require("react");
8
+ var _reactRedux = require("react-redux");
9
+ var _isEmpty = _interopRequireDefault(require("lodash/isEmpty"));
10
+ var _actions = require("../actions");
11
+ var VineaNovaSelectors = _interopRequireWildcard(require("../selectors"));
12
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
13
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
14
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
15
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
16
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
17
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
18
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
19
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
20
+ var useFetchCalculators = exports.useFetchCalculators = function useFetchCalculators(props) {
21
+ // selectors
22
+ var data = (0, _reactRedux.useSelector)(VineaNovaSelectors.getCalculatorsEntityData);
23
+ var entity = (0, _reactRedux.useSelector)(VineaNovaSelectors.getCalculatorsEntityMeta);
24
+ var dispatchAPI = (0, _reactRedux.useDispatch)();
25
+ var _props$queryParams = props.queryParams,
26
+ queryParams = _props$queryParams === void 0 ? {} : _props$queryParams;
27
+
28
+ // Determine if we need to fetch: not loaded, has error, or empty data
29
+ var shouldFetch = !(entity !== null && entity !== void 0 && entity.isLoaded) || (entity === null || entity === void 0 ? void 0 : entity.hasError) || (0, _isEmpty["default"])(entity.data);
30
+ (0, _react.useEffect)(function () {
31
+ if (shouldFetch) {
32
+ dispatchAPI(_actions.VineaNovaActions.api.v1.calculators.get.request({
33
+ queryParams: _objectSpread({}, queryParams)
34
+ }));
35
+ }
36
+ }, [shouldFetch, JSON.stringify(queryParams)]);
37
+ var useQuery = function useQuery(queryParams) {
38
+ dispatchAPI(_actions.VineaNovaActions.api.v1.calculators.get.request({
39
+ queryParams: _objectSpread({}, queryParams)
40
+ }));
41
+ };
42
+ return {
43
+ data: data,
44
+ useQuery: useQuery,
45
+ isLoading: entity === null || entity === void 0 ? void 0 : entity.isLoading,
46
+ hasError: entity === null || entity === void 0 ? void 0 : entity.hasError,
47
+ error: entity === null || entity === void 0 ? void 0 : entity.error
48
+ };
49
+ };
@@ -13,6 +13,8 @@ var rootReducer = {
13
13
  blockRowPlant: (0, _createNamedReducer["default"])('blockRowPlant'),
14
14
  plantsForBlock: (0, _createNamedReducer["default"])('plantsForBlock'),
15
15
  blockVintage: (0, _createNamedReducer["default"])('blockVintage'),
16
+ calculators: (0, _createNamedReducer["default"])('calculators'),
17
+ calculator: (0, _createNamedReducer["default"])('calculator'),
16
18
  chartsByChartFilters: (0, _createNamedReducer["default"])('chartsByChartFilters'),
17
19
  chartsByPageFilters: (0, _createNamedReducer["default"])('chartsByPageFilters'),
18
20
  chartFilters: (0, _createNamedReducer["default"])('chartFilters'),
@@ -73,7 +75,6 @@ var rootReducer = {
73
75
  identityVineyard: (0, _createNamedReducer["default"])('identityVineyard'),
74
76
  identityVineyardTracking: (0, _createNamedReducer["default"])('identityVineyardTracking'),
75
77
  parentVineyardPayers: (0, _createNamedReducer["default"])('parentVineyardPayers'),
76
- gridVineyardBlocks: (0, _createNamedReducer["default"])('gridVineyardBlocks'),
77
78
  identityVineyardBlocks: (0, _createNamedReducer["default"])('identityVineyardBlocks'),
78
79
  identityVineyardBlock: (0, _createNamedReducer["default"])('identityVineyardBlock'),
79
80
  vineyardBlockCropMeasurements: (0, _createNamedReducer["default"])('vineyardBlockCropMeasurements'),