contentoh-components-library 21.0.2 → 21.0.5

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.
@@ -83,7 +83,6 @@ var InputFormatter = function InputFormatter(_ref) {
83
83
  });
84
84
  };
85
85
 
86
- console.log(convertedText);
87
86
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.Container, {
88
87
  focus: focus,
89
88
  selection: selection,
@@ -44,7 +44,7 @@ var InputGroup = function InputGroup(_ref) {
44
44
 
45
45
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.Container, {
46
46
  className: activeSection === "Ficha técnica" ? "datasheets-layout" : "descriptions-layout",
47
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_ScreenHeader.ScreenHeader, {
47
+ children: [(inputGroup === null || inputGroup === void 0 ? void 0 : inputGroup.dataGroup) && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ScreenHeader.ScreenHeader, {
48
48
  headerType: "retailer-name-header",
49
49
  text: inputGroup === null || inputGroup === void 0 ? void 0 : inputGroup.dataGroup
50
50
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
@@ -58,7 +58,6 @@ var ProductImageModal = function ProductImageModal(_ref) {
58
58
  }
59
59
  };
60
60
 
61
- console.log(images === null || images === void 0 ? void 0 : images.values[activeImage]);
62
61
  (0, _react.useEffect)(function () {
63
62
  if (showValidationPanel) {
64
63
  document.addEventListener("click", closeValidationPanel, false);
@@ -78,26 +78,26 @@ RetailerProductEditionDefault.args = {
78
78
  descriptions: 1,
79
79
  images: 1
80
80
  },
81
- orderId: 101,
82
- status: "RP",
83
- datasheet_status: "AP",
81
+ orderId: 113,
82
+ status: "IN_PROGRESS",
83
+ datasheet_status: "IN_PROGRESS",
84
84
  prio: "none",
85
85
  version: 2,
86
- description_status: "RP",
87
- images_status: "AP",
86
+ description_status: "IN_PROGRESS",
87
+ images_status: "IN_PROGRESS",
88
88
  article: {
89
- id_article: 292,
90
- id_category: "697",
91
- name: "SHAMPOO ANTIFRIZ",
92
- upc: "7491989462",
93
- timestamp: "2022-03-09T19:35:51.000Z",
89
+ id_article: 324,
90
+ id_category: "684",
91
+ name: "Crema dental ",
92
+ upc: "154161",
93
+ timestamp: "2022-04-12T14:46:42.000Z",
94
94
  id_user: 28,
95
95
  status: "NULL",
96
96
  active: 1,
97
97
  company_id: 1,
98
98
  company_name: "COMPANY DEV",
99
99
  country: "Colombia",
100
- id_order: 101,
100
+ id_order: 113,
101
101
  id_datasheet_especialist: 36,
102
102
  id_datasheet_facilitator: 52,
103
103
  id_description_especialist: 36,
@@ -106,7 +106,7 @@ RetailerProductEditionDefault.args = {
106
106
  id_images_facilitator: 53,
107
107
  id_auditor: 30,
108
108
  id_recepcionist: null,
109
- category: "SALUD Y BELLEZA|CUIDADO DEL CABELLO|SHAMPOOS Y ACONDICIONADORES",
109
+ category: "SALUD Y BELLEZA|CUIDADO BUCAL|PASTAS DENTALES Y ASEO BUCAL",
110
110
  missingAttributes: null,
111
111
  missingDescriptions: null,
112
112
  missingImages: null
@@ -117,12 +117,24 @@ RetailerProductEditionDefault.args = {
117
117
  country: "México",
118
118
  id_region: 1,
119
119
  active: 1
120
+ }, {
121
+ id: 5,
122
+ name: "Chedraui",
123
+ country: "México",
124
+ id_region: 1,
125
+ active: 1
120
126
  }, {
121
127
  id: 6,
122
128
  name: "HEB",
123
129
  country: "México",
124
130
  id_region: 1,
125
131
  active: 1
132
+ }, {
133
+ id: 12,
134
+ name: "La Comer",
135
+ country: "México",
136
+ id_region: 1,
137
+ active: 1
126
138
  }],
127
139
  country: "Colombia",
128
140
  modal: false,
@@ -123,7 +123,7 @@ var myBucket = new _awsSdk.default.S3({
123
123
  });
124
124
 
125
125
  var RetailerProductEdition = function RetailerProductEdition(_ref) {
126
- var _productSelected$reta, _product$services3, _product$services4, _datasheets$, _datasheets$$data, _product$services5, _product$article4, _product$services6;
126
+ var _productSelected$reta, _product$services5, _product$services6, _datasheets$, _datasheets$$data, _product$services7, _product$article4, _product$services8;
127
127
 
128
128
  var tabsSections = _ref.tabsSections,
129
129
  _ref$productSelected = _ref.productSelected,
@@ -378,9 +378,14 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
378
378
  });
379
379
  if (((_services$ = services[2]) === null || _services$ === void 0 ? void 0 : (_services$$values = _services$.values) === null || _services$$values === void 0 ? void 0 : _services$$values.length) > 0) setActiveImage(0);
380
380
  setProduct(productSelected);
381
+ (0, _data2.getPercentage)({
382
+ data: [productSelected]
383
+ }).then(function (res) {
384
+ return setPercentages(res);
385
+ });
381
386
  setLoading(false);
382
387
 
383
- case 9:
388
+ case 10:
384
389
  case "end":
385
390
  return _context2.stop();
386
391
  }
@@ -501,23 +506,21 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
501
506
  while (1) {
502
507
  switch (_context5.prev = _context5.next) {
503
508
  case 0:
504
- loadData();
505
- (0, _data2.getPercentage)({
506
- data: [productSelected]
507
- }).then(function (res) {
508
- return setPercentages(res);
509
- });
509
+ loadData(); // getPercentage({ data: [productSelected] }).then((res) =>
510
+ // setPercentages(res)
511
+ // );
512
+
510
513
  getServices();
511
514
  getComments();
512
515
  _context5.t0 = setUserGroups;
513
- _context5.next = 7;
516
+ _context5.next = 6;
514
517
  return (0, _data2.fetchUsers)(token);
515
518
 
516
- case 7:
519
+ case 6:
517
520
  _context5.t1 = _context5.sent;
518
521
  (0, _context5.t0)(_context5.t1);
519
522
 
520
- case 9:
523
+ case 8:
521
524
  case "end":
522
525
  return _context5.stop();
523
526
  }
@@ -1491,19 +1494,19 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
1491
1494
  setAssignation: setAssignation,
1492
1495
  isRetailer: isRetailer,
1493
1496
  onClickSave: function onClickSave() {
1494
- var _product$services2;
1497
+ var _product$services2, _product$services3, _product$services4;
1495
1498
 
1496
1499
  switch (activeTab) {
1497
1500
  case "Descripción":
1498
- saveDescriptions();
1501
+ (product === null || product === void 0 ? void 0 : (_product$services2 = product.services) === null || _product$services2 === void 0 ? void 0 : _product$services2.descriptions) === 1 && saveDescriptions();
1499
1502
  break;
1500
1503
 
1501
1504
  case "Ficha técnica":
1502
- saveDatasheets();
1505
+ (product === null || product === void 0 ? void 0 : (_product$services3 = product.services) === null || _product$services3 === void 0 ? void 0 : _product$services3.datasheets) === 1 && saveDatasheets();
1503
1506
  break;
1504
1507
 
1505
1508
  case "Imágenes":
1506
- (product === null || product === void 0 ? void 0 : (_product$services2 = product.services) === null || _product$services2 === void 0 ? void 0 : _product$services2.images) === 1 && updateImages();
1509
+ (product === null || product === void 0 ? void 0 : (_product$services4 = product.services) === null || _product$services4 === void 0 ? void 0 : _product$services4.images) === 1 && updateImages();
1507
1510
  break;
1508
1511
 
1509
1512
  default:
@@ -1513,11 +1516,11 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
1513
1516
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
1514
1517
  className: "services-information-container " + (imageLayout && activeTab === "Imágenes" ? "image-services" : ""),
1515
1518
  children: loading ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_Loading.Loading, {}) : /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
1516
- children: [!imageLayout && activeTab === "Imágenes" && (product === null || product === void 0 ? void 0 : (_product$services3 = product.services) === null || _product$services3 === void 0 ? void 0 : _product$services3.images) === 1 && /*#__PURE__*/(0, _jsxRuntime.jsx)(_GalleryHeader.GalleryHeader, {
1519
+ children: [!imageLayout && activeTab === "Imágenes" && (product === null || product === void 0 ? void 0 : (_product$services5 = product.services) === null || _product$services5 === void 0 ? void 0 : _product$services5.images) === 1 && /*#__PURE__*/(0, _jsxRuntime.jsx)(_GalleryHeader.GalleryHeader, {
1517
1520
  setSelectedImages: setSelectedImages,
1518
1521
  checkAll: checkAll,
1519
1522
  setCheckAll: setCheckAll
1520
- }), activeTab === "Ficha técnica" && ((product === null || product === void 0 ? void 0 : (_product$services4 = product.services) === null || _product$services4 === void 0 ? void 0 : _product$services4.datasheets) === 1 ? (_datasheets$ = datasheets[0]) === null || _datasheets$ === void 0 ? void 0 : (_datasheets$$data = _datasheets$.data) === null || _datasheets$$data === void 0 ? void 0 : _datasheets$$data.map(function (dataGroup, index) {
1523
+ }), activeTab === "Ficha técnica" && ((product === null || product === void 0 ? void 0 : (_product$services6 = product.services) === null || _product$services6 === void 0 ? void 0 : _product$services6.datasheets) === 1 ? (_datasheets$ = datasheets[0]) === null || _datasheets$ === void 0 ? void 0 : (_datasheets$$data = _datasheets$.data) === null || _datasheets$$data === void 0 ? void 0 : _datasheets$$data.map(function (dataGroup, index) {
1521
1524
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_InputGroup.InputGroup, {
1522
1525
  articleId: productSelected.article.id_article,
1523
1526
  version: version,
@@ -1530,7 +1533,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
1530
1533
  }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_ScreenHeader.ScreenHeader, {
1531
1534
  text: "No cuentas con este servicio",
1532
1535
  headerType: "input-name-header"
1533
- })), activeTab === "Descripción" && ((product === null || product === void 0 ? void 0 : (_product$services5 = product.services) === null || _product$services5 === void 0 ? void 0 : _product$services5.descriptions) === 1 ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_InputGroup.InputGroup, {
1536
+ })), activeTab === "Descripción" && ((product === null || product === void 0 ? void 0 : (_product$services7 = product.services) === null || _product$services7 === void 0 ? void 0 : _product$services7.descriptions) === 1 ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_InputGroup.InputGroup, {
1534
1537
  activeSection: activeTab,
1535
1538
  inputGroup: descriptions[0],
1536
1539
  updatedDescriptions: updatedDescriptions,
@@ -1541,7 +1544,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
1541
1544
  }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_ScreenHeader.ScreenHeader, {
1542
1545
  text: "No cuentas con este servicio",
1543
1546
  headerType: "input-name-header"
1544
- })), activeTab === "Imágenes" && ((product === null || product === void 0 ? void 0 : (_product$services6 = product.services) === null || _product$services6 === void 0 ? void 0 : _product$services6.images) === 1 ? /*#__PURE__*/(0, _jsxRuntime.jsx)("section", {
1547
+ })), activeTab === "Imágenes" && ((product === null || product === void 0 ? void 0 : (_product$services8 = product.services) === null || _product$services8 === void 0 ? void 0 : _product$services8.images) === 1 ? /*#__PURE__*/(0, _jsxRuntime.jsx)("section", {
1545
1548
  className: "container",
1546
1549
  children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", (0, _objectSpread2.default)((0, _objectSpread2.default)({}, getRootProps({
1547
1550
  className: "dropzone"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "contentoh-components-library",
3
- "version": "21.0.2",
3
+ "version": "21.0.5",
4
4
  "dependencies": {
5
5
  "@babel/runtime": "^7.17.2",
6
6
  "@storybook/addon-postcss": "^2.0.0",
@@ -47,7 +47,7 @@ export const InputFormatter = ({
47
47
  top: e.clientY - elementPosition.y,
48
48
  });
49
49
  };
50
- console.log(convertedText);
50
+
51
51
  return (
52
52
  <Container
53
53
  focus={focus}
@@ -32,10 +32,12 @@ export const InputGroup = ({
32
32
  : "descriptions-layout"
33
33
  }
34
34
  >
35
- <ScreenHeader
36
- headerType={"retailer-name-header"}
37
- text={inputGroup?.dataGroup}
38
- />
35
+ {inputGroup?.dataGroup && (
36
+ <ScreenHeader
37
+ headerType={"retailer-name-header"}
38
+ text={inputGroup?.dataGroup}
39
+ />
40
+ )}
39
41
  <div className="inputs-container">
40
42
  {inputGroup?.inputs?.map((input, index) =>
41
43
  activeSection === "Ficha técnica" ? (
@@ -30,8 +30,6 @@ export const ProductImageModal = ({
30
30
  }
31
31
  };
32
32
 
33
- console.log(images?.values[activeImage]);
34
-
35
33
  useEffect(() => {
36
34
  if (showValidationPanel) {
37
35
  document.addEventListener("click", closeValidationPanel, false);
@@ -54,26 +54,26 @@ RetailerProductEditionDefault.args = {
54
54
  descriptions: 1,
55
55
  images: 1,
56
56
  },
57
- orderId: 101,
58
- status: "RP",
59
- datasheet_status: "AP",
57
+ orderId: 113,
58
+ status: "IN_PROGRESS",
59
+ datasheet_status: "IN_PROGRESS",
60
60
  prio: "none",
61
61
  version: 2,
62
- description_status: "RP",
63
- images_status: "AP",
62
+ description_status: "IN_PROGRESS",
63
+ images_status: "IN_PROGRESS",
64
64
  article: {
65
- id_article: 292,
66
- id_category: "697",
67
- name: "SHAMPOO ANTIFRIZ",
68
- upc: "7491989462",
69
- timestamp: "2022-03-09T19:35:51.000Z",
65
+ id_article: 324,
66
+ id_category: "684",
67
+ name: "Crema dental ",
68
+ upc: "154161",
69
+ timestamp: "2022-04-12T14:46:42.000Z",
70
70
  id_user: 28,
71
71
  status: "NULL",
72
72
  active: 1,
73
73
  company_id: 1,
74
74
  company_name: "COMPANY DEV",
75
75
  country: "Colombia",
76
- id_order: 101,
76
+ id_order: 113,
77
77
  id_datasheet_especialist: 36,
78
78
  id_datasheet_facilitator: 52,
79
79
  id_description_especialist: 36,
@@ -82,8 +82,7 @@ RetailerProductEditionDefault.args = {
82
82
  id_images_facilitator: 53,
83
83
  id_auditor: 30,
84
84
  id_recepcionist: null,
85
- category:
86
- "SALUD Y BELLEZA|CUIDADO DEL CABELLO|SHAMPOOS Y ACONDICIONADORES",
85
+ category: "SALUD Y BELLEZA|CUIDADO BUCAL|PASTAS DENTALES Y ASEO BUCAL",
87
86
  missingAttributes: null,
88
87
  missingDescriptions: null,
89
88
  missingImages: null,
@@ -96,6 +95,13 @@ RetailerProductEditionDefault.args = {
96
95
  id_region: 1,
97
96
  active: 1,
98
97
  },
98
+ {
99
+ id: 5,
100
+ name: "Chedraui",
101
+ country: "México",
102
+ id_region: 1,
103
+ active: 1,
104
+ },
99
105
  {
100
106
  id: 6,
101
107
  name: "HEB",
@@ -103,6 +109,13 @@ RetailerProductEditionDefault.args = {
103
109
  id_region: 1,
104
110
  active: 1,
105
111
  },
112
+ {
113
+ id: 12,
114
+ name: "La Comer",
115
+ country: "México",
116
+ id_region: 1,
117
+ active: 1,
118
+ },
106
119
  ],
107
120
  country: "Colombia",
108
121
  modal: false,
@@ -158,6 +158,9 @@ export const RetailerProductEdition = ({
158
158
  });
159
159
  if (services[2]?.values?.length > 0) setActiveImage(0);
160
160
  setProduct(productSelected);
161
+ getPercentage({ data: [productSelected] }).then((res) =>
162
+ setPercentages(res)
163
+ );
161
164
  setLoading(false);
162
165
  };
163
166
 
@@ -221,9 +224,9 @@ export const RetailerProductEdition = ({
221
224
 
222
225
  useEffect(async () => {
223
226
  loadData();
224
- getPercentage({ data: [productSelected] }).then((res) =>
225
- setPercentages(res)
226
- );
227
+ // getPercentage({ data: [productSelected] }).then((res) =>
228
+ // setPercentages(res)
229
+ // );
227
230
  getServices();
228
231
  getComments();
229
232
  setUserGroups(await fetchUsers(token));
@@ -994,10 +997,10 @@ export const RetailerProductEdition = ({
994
997
  onClickSave={() => {
995
998
  switch (activeTab) {
996
999
  case "Descripción":
997
- saveDescriptions();
1000
+ product?.services?.descriptions === 1 && saveDescriptions();
998
1001
  break;
999
1002
  case "Ficha técnica":
1000
- saveDatasheets();
1003
+ product?.services?.datasheets === 1 && saveDatasheets();
1001
1004
  break;
1002
1005
  case "Imágenes":
1003
1006
  product?.services?.images === 1 && updateImages();