contentoh-components-library 21.5.92 → 21.5.93

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.
Files changed (70) hide show
  1. package/dist/components/atoms/GeneralButton/styles.js +1 -1
  2. package/dist/components/atoms/GeneralInput/index.js +54 -245
  3. package/dist/components/atoms/GeneralInput/styles.js +3 -7
  4. package/dist/components/atoms/InputFormatter/index.js +68 -223
  5. package/dist/components/atoms/InputFormatter/styles.js +4 -20
  6. package/dist/components/molecules/StatusAsignationInfo/index.js +1 -11
  7. package/dist/components/molecules/TabsMenu/index.js +12 -13
  8. package/dist/components/molecules/TagAndInput/index.js +24 -361
  9. package/dist/components/molecules/TagAndInput/styles.js +2 -2
  10. package/dist/components/organisms/FullProductNameHeader/index.js +22 -6
  11. package/dist/components/organisms/InputGroup/index.js +18 -22
  12. package/dist/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +337 -150
  13. package/dist/components/pages/ProviderProductEdition/context/provider-product-edition.context.js +15 -15
  14. package/dist/components/pages/ProviderProductEdition/index.js +362 -368
  15. package/dist/components/pages/ProviderProductEdition/utils.js +0 -1
  16. package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +196 -179
  17. package/dist/components/pages/RetailerProductEdition/context/provider-product-edition.context.js +260 -59
  18. package/dist/components/pages/RetailerProductEdition/context/reducers/product.js +38 -50
  19. package/dist/components/pages/RetailerProductEdition/index.js +2234 -1716
  20. package/dist/components/pages/RetailerProductEdition/styles.js +2 -4
  21. package/dist/components/pages/RetailerProductEdition/utils.js +2 -251
  22. package/dist/contexts/AiProductEdition.js +158 -230
  23. package/package.json +2 -4
  24. package/src/components/atoms/GeneralButton/styles.js +0 -4
  25. package/src/components/atoms/GeneralInput/index.js +60 -237
  26. package/src/components/atoms/GeneralInput/styles.js +0 -81
  27. package/src/components/atoms/InputFormatter/index.js +51 -200
  28. package/src/components/atoms/InputFormatter/styles.js +0 -284
  29. package/src/components/molecules/StatusAsignationInfo/index.js +1 -9
  30. package/src/components/molecules/TabsMenu/index.js +11 -12
  31. package/src/components/molecules/TagAndInput/index.js +21 -286
  32. package/src/components/molecules/TagAndInput/styles.js +17 -59
  33. package/src/components/organisms/FullProductNameHeader/index.js +28 -4
  34. package/src/components/organisms/FullTabsMenu/index.js +1 -1
  35. package/src/components/organisms/InputGroup/index.js +4 -12
  36. package/src/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +202 -174
  37. package/src/components/pages/ProviderProductEdition/context/provider-product-edition.context.jsx +14 -14
  38. package/src/components/pages/ProviderProductEdition/index.js +452 -453
  39. package/src/components/pages/ProviderProductEdition/utils.js +2 -2
  40. package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +224 -201
  41. package/src/components/pages/RetailerProductEdition/index.js +1718 -1547
  42. package/src/components/pages/RetailerProductEdition/styles.js +2 -67
  43. package/src/components/pages/RetailerProductEdition/utils.js +0 -240
  44. package/dist/ai/utils/compare-strings.js +0 -45
  45. package/dist/components/organisms/ChangeStatusModal/index.js +0 -531
  46. package/dist/components/organisms/ChangeStatusModal/styles.js +0 -85
  47. package/dist/global-files/statusDictionary.js +0 -103
  48. package/src/ai/utils/compare-strings.js +0 -45
  49. package/src/assets/images/Icons/arrow.png +0 -0
  50. package/src/assets/images/Icons/cancel.png +0 -0
  51. package/src/assets/images/Icons/ia-icon.png +0 -0
  52. package/src/assets/images/Icons/loading.svg +0 -5
  53. package/src/assets/images/Icons/reload.png +0 -0
  54. package/src/components/atoms/RetailerSelector/RetailerSelector.stories.js +0 -10
  55. package/src/components/atoms/RetailerSelector/index.js +0 -3
  56. package/src/components/atoms/RetailerSelector/styles.js +0 -0
  57. package/src/components/organisms/ChangeStatusModal/index.jsx +0 -488
  58. package/src/components/organisms/ChangeStatusModal/styles.js +0 -333
  59. package/src/components/pages/RetailerProductEdition/context/provider-product-edition.context.jsx +0 -575
  60. package/src/components/pages/RetailerProductEdition/context/provider-product-edition.reducer.js +0 -62
  61. package/src/components/pages/RetailerProductEdition/context/reducers/active-state.js +0 -344
  62. package/src/components/pages/RetailerProductEdition/context/reducers/inputs.js +0 -155
  63. package/src/components/pages/RetailerProductEdition/context/reducers/product.js +0 -114
  64. package/src/components/pages/RetailerProductEdition/context/reducers/system.js +0 -60
  65. package/src/components/pages/RetailerProductEdition/index_old.js +0 -1979
  66. package/src/components/pages/RetailerProductEdition/stories/Auditor.stories.js +0 -101
  67. package/src/components/pages/RetailerProductEdition/stories/ImageEditor.stories.js +0 -115
  68. package/src/components/pages/RetailerProductEdition/stories/TextEditor.stories.js +0 -174
  69. package/src/contexts/AiProductEdition.jsx +0 -339
  70. package/src/global-files/statusDictionary.js +0 -103
@@ -9,8 +9,6 @@ exports.productReducer = exports.productInitialState = exports.PRODUCT_ACTIONS =
9
9
 
10
10
  var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
11
11
 
12
- var _statusDictionary = require("../../../../../global-files/statusDictionary");
13
-
14
12
  var productInitialState = {
15
13
  product: null,
16
14
  services: null,
@@ -22,8 +20,9 @@ var PRODUCT_ACTIONS = {
22
20
  SET_SERVICES: "SET_SERVICES",
23
21
  SET_SERVICES_DATA: "SET_SERVICES_DATA",
24
22
  SET_PRODUCT_VERSION: "SET_PRODUCT_VERSION",
25
- SET_PERCENTAGES: "SET_PERCENTAGES",
26
- SET_RETAILER_STATUS: "SET_RETAILER_STATUS"
23
+ UPDATE_DESCRIPTION_STATUS: "UPDATE_DESCRIPTION_STATUS",
24
+ UPDATE_DATASHEET_STATUS: "UPDATE_DATASHEET_STATUS",
25
+ UPDATE_IMAGES_STATUS: "UPDATE_IMAGES_STATUS"
27
26
  };
28
27
  exports.PRODUCT_ACTIONS = PRODUCT_ACTIONS;
29
28
 
@@ -43,56 +42,63 @@ var productReducer = function productReducer(state, action) {
43
42
  });
44
43
  }
45
44
 
46
- case PRODUCT_ACTIONS.SET_RETAILER_STATUS:
45
+ case PRODUCT_ACTIONS.SET_SERVICES_DATA:
47
46
  {
48
- var _action$payload$find, _action$payload$find2, _action$payload$find3;
47
+ return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, state), {}, {
48
+ services_data: action.payload
49
+ });
50
+ }
49
51
 
52
+ case PRODUCT_ACTIONS.SET_PRODUCT_VERSION:
53
+ {
50
54
  return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, state), {}, {
51
55
  product: (0, _objectSpread2.default)((0, _objectSpread2.default)({}, state.product), {}, {
52
- status: getMinorStatus(action.payload.map(function (status) {
53
- return status === null || status === void 0 ? void 0 : status.status;
54
- })),
55
- description_status: ((_action$payload$find = action.payload.find(function (status) {
56
- var _state$active_retaile;
57
-
58
- return (status === null || status === void 0 ? void 0 : status.service) === "description" && (status === null || status === void 0 ? void 0 : status.retailer_id) === (state === null || state === void 0 ? void 0 : (_state$active_retaile = state.active_retailer) === null || _state$active_retaile === void 0 ? void 0 : _state$active_retaile.id_retailer);
59
- })) === null || _action$payload$find === void 0 ? void 0 : _action$payload$find.status) || "NS",
60
- datasheet_status: ((_action$payload$find2 = action.payload.find(function (status) {
61
- var _state$active_retaile2;
62
-
63
- return (status === null || status === void 0 ? void 0 : status.service) === "datasheet" && (status === null || status === void 0 ? void 0 : status.retailer_id) === (state === null || state === void 0 ? void 0 : (_state$active_retaile2 = state.active_retailer) === null || _state$active_retaile2 === void 0 ? void 0 : _state$active_retaile2.id_retailer);
64
- })) === null || _action$payload$find2 === void 0 ? void 0 : _action$payload$find2.status) || "NS",
65
- images_status: ((_action$payload$find3 = action.payload.find(function (status) {
66
- var _state$active_retaile3;
67
-
68
- return (status === null || status === void 0 ? void 0 : status.service) === "images" && (status === null || status === void 0 ? void 0 : status.retailer_id) === (state === null || state === void 0 ? void 0 : (_state$active_retaile3 = state.active_retailer) === null || _state$active_retaile3 === void 0 ? void 0 : _state$active_retaile3.id_retailer);
69
- })) === null || _action$payload$find3 === void 0 ? void 0 : _action$payload$find3.status) || "NS",
70
- statusByRetailer: action.payload
56
+ version: action.payload
71
57
  })
72
58
  });
73
59
  }
74
60
 
75
- case PRODUCT_ACTIONS.SET_SERVICES_DATA:
61
+ case PRODUCT_ACTIONS.UPDATE_DESCRIPTION_STATUS:
76
62
  {
63
+ var _state$product;
64
+
77
65
  return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, state), {}, {
78
- services_data: action.payload
66
+ product: (0, _objectSpread2.default)((0, _objectSpread2.default)({}, state.product), {}, {
67
+ statusByRetailer: (((_state$product = state.product) === null || _state$product === void 0 ? void 0 : _state$product.statusByRetailer) || []).map(function (retailerStatus) {
68
+ return retailerStatus.service === "description" ? (0, _objectSpread2.default)((0, _objectSpread2.default)({}, retailerStatus), {}, {
69
+ status: action.payload
70
+ }) : retailerStatus;
71
+ })
72
+ })
79
73
  });
80
74
  }
81
75
 
82
- case PRODUCT_ACTIONS.SET_PRODUCT_VERSION:
76
+ case PRODUCT_ACTIONS.UPDATE_DATASHEET_STATUS:
83
77
  {
78
+ var _state$product2;
79
+
84
80
  return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, state), {}, {
85
81
  product: (0, _objectSpread2.default)((0, _objectSpread2.default)({}, state.product), {}, {
86
- version: action.payload
82
+ statusByRetailer: (((_state$product2 = state.product) === null || _state$product2 === void 0 ? void 0 : _state$product2.statusByRetailer) || []).map(function (retailerStatus) {
83
+ return retailerStatus.service === "datasheet" ? (0, _objectSpread2.default)((0, _objectSpread2.default)({}, retailerStatus), {}, {
84
+ status: action.payload
85
+ }) : retailerStatus;
86
+ })
87
87
  })
88
88
  });
89
89
  }
90
90
 
91
- case PRODUCT_ACTIONS.SET_PERCENTAGES:
91
+ case PRODUCT_ACTIONS.UPDATE_IMAGES_STATUS:
92
92
  {
93
+ var _state$product3;
94
+
93
95
  return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, state), {}, {
94
96
  product: (0, _objectSpread2.default)((0, _objectSpread2.default)({}, state.product), {}, {
95
- percentages: action.payload
97
+ statusByRetailer: (((_state$product3 = state.product) === null || _state$product3 === void 0 ? void 0 : _state$product3.statusByRetailer) || []).map(function (retailerStatus) {
98
+ return retailerStatus.service === "images" ? (0, _objectSpread2.default)((0, _objectSpread2.default)({}, retailerStatus), {}, {
99
+ status: action.payload
100
+ }) : retailerStatus;
101
+ })
96
102
  })
97
103
  });
98
104
  }
@@ -104,22 +110,4 @@ var productReducer = function productReducer(state, action) {
104
110
  }
105
111
  };
106
112
 
107
- exports.productReducer = productReducer;
108
-
109
- function getMinorStatus() {
110
- var _STATUS_DICTIONARY$NS;
111
-
112
- var servicesStatus = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
113
- if (!servicesStatus || servicesStatus.length === 0) return _statusDictionary.STATUS_DICTIONARY.NS.name;
114
- console.log({
115
- servicesStatus: servicesStatus
116
- });
117
- var winner = servicesStatus.reduce(function (minor, current) {
118
- var currentObj = typeof current === "string" ? _statusDictionary.STATUS_DICTIONARY[current] : current;
119
- var minorObj = typeof minor === "string" ? _statusDictionary.STATUS_DICTIONARY[minor] : minor;
120
- if (!currentObj || typeof currentObj.weight === "undefined") return minor;
121
- if (!minorObj || typeof minorObj.weight === "undefined") return current;
122
- return currentObj.weight < minorObj.weight ? currentObj : minorObj;
123
- }, servicesStatus[0] || _statusDictionary.STATUS_DICTIONARY.NS);
124
- return (winner === null || winner === void 0 ? void 0 : winner.status) || ((_STATUS_DICTIONARY$NS = _statusDictionary.STATUS_DICTIONARY.NS) === null || _STATUS_DICTIONARY$NS === void 0 ? void 0 : _STATUS_DICTIONARY$NS.status);
125
- }
113
+ exports.productReducer = productReducer;