contentoh-components-library 21.1.9 → 21.1.12

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.
@@ -36,22 +36,22 @@ ProviderProductEditionDefault.args = {
36
36
  category: 846,
37
37
  version: 2,
38
38
  productSelected: {
39
- orderId: 27,
39
+ orderId: 77,
40
40
  article_status: "AP",
41
- datasheet_status: "AP",
42
- description_status: "AP",
41
+ datasheet_status: "NS",
42
+ description_status: "NS",
43
43
  images_status: "AP",
44
44
  prio: "none",
45
- version: 2,
45
+ version: 19,
46
46
  brand: null,
47
47
  article: {
48
- category: "BAÑOS|ACCESORIOS PARA BAÑO|ACCESORIOS INDIVIDUALES",
49
- company_name: "THD Proveedor",
50
- country: "México",
51
- id_category: "2004",
52
- id_article: 55108,
53
- name: "Producto de prueba 10 THD",
54
- upc: "SKU12314THD"
48
+ category: "RESIZING|RESIZING|RESIZING",
49
+ company_name: "THD Resize Proveedor",
50
+ country: null,
51
+ id_category: "2999",
52
+ id_article: 55109,
53
+ name: "Resize Ismael",
54
+ upc: "ResizeIsmael"
55
55
  },
56
56
  retailers: [{
57
57
  id: 58,
@@ -67,11 +67,11 @@ ProviderProductEditionDefault.args = {
67
67
  name: "Home Depot TAB"
68
68
  }],
69
69
  services: {
70
- datasheets: 1,
71
- descriptions: 1,
70
+ datasheets: 0,
71
+ descriptions: 0,
72
72
  images: 1
73
73
  },
74
- id_article: 55108,
74
+ id_article: 55109,
75
75
  retailersAvailable: [{
76
76
  id: 58,
77
77
  name: "The Home Depot Golden"
@@ -87,25 +87,25 @@ ProviderProductEditionDefault.args = {
87
87
  }]
88
88
  },
89
89
  productToEdit: {
90
- ArticleId: 55108,
91
- idCategory: "2004",
90
+ ArticleId: 55109,
91
+ idCategory: "2999",
92
92
  product: {
93
- orderId: 27,
93
+ orderId: 77,
94
94
  article_status: "AP",
95
- datasheet_status: "AP",
96
- description_status: "AP",
95
+ datasheet_status: "NS",
96
+ description_status: "NS",
97
97
  images_status: "AP",
98
98
  prio: "none",
99
- version: 2,
99
+ version: 19,
100
100
  brand: null,
101
101
  article: {
102
- category: "BAÑOS|ACCESORIOS PARA BAÑO|ACCESORIOS INDIVIDUALES",
103
- company_name: "THD Proveedor",
104
- country: "México",
105
- id_category: "2004",
106
- id_article: 55108,
107
- name: "Producto de prueba 10 THD",
108
- upc: "SKU12314THD"
102
+ category: "RESIZING|RESIZING|RESIZING",
103
+ company_name: "THD Resize Proveedor",
104
+ country: null,
105
+ id_category: "2999",
106
+ id_article: 55109,
107
+ name: "Resize Ismael",
108
+ upc: "ResizeIsmael"
109
109
  },
110
110
  retailers: [{
111
111
  id: 58,
@@ -121,11 +121,11 @@ ProviderProductEditionDefault.args = {
121
121
  name: "Home Depot TAB"
122
122
  }],
123
123
  services: {
124
- datasheets: 1,
125
- descriptions: 1,
124
+ datasheets: 0,
125
+ descriptions: 0,
126
126
  images: 1
127
127
  },
128
- id_article: 55108,
128
+ id_article: 55109,
129
129
  retailersAvailable: [{
130
130
  id: 58,
131
131
  name: "The Home Depot Golden"
@@ -151,35 +151,35 @@ ProviderProductEditionDefault.args = {
151
151
  }
152
152
  },
153
153
  user: {
154
- id_user: 59,
155
- name: "The Home",
156
- last_name: "Depot",
157
- email: "cadena.ismael@allfreemail.net",
158
- position: "Admin",
154
+ id_user: 28,
155
+ name: "Proveedor",
156
+ last_name: "Colgate",
157
+ email: "ilopez@contentoh.com",
158
+ position: "Prueba Admin",
159
159
  telephone: "+523111366336",
160
160
  country: "México",
161
- id_company: 7,
162
- id_cognito: "5884ae34-59d6-4454-b98e-821518bcc3a7",
161
+ id_company: 1,
162
+ id_cognito: "f5927f8e-cbf7-4922-9e09-e69ec0b2731a",
163
163
  birth_Date: null,
164
164
  about_me: null,
165
165
  zip_code: null,
166
166
  address: null,
167
167
  job: null,
168
- id_stripe: "",
168
+ id_stripe: "cus_KuEt6R6vwmN09f",
169
169
  id_role: 0,
170
170
  active: 1,
171
- is_retailer: 1,
171
+ is_retailer: 0,
172
172
  membership: {
173
- id: 24,
174
- start_date: "2021-11-23T03:35:50.000Z",
175
- end_date: "2022-11-23T03:35:50.000Z",
176
- planID: 9,
177
- plan: "prod_KtlkzZVGq6bRTO",
178
- name: "Plan Enterprise Full",
179
- user_limit: "30",
180
- products_limit: "10000",
173
+ id: 38,
174
+ start_date: "2022-01-18T17:25:35.000Z",
175
+ end_date: "2023-01-18T17:25:35.000Z",
176
+ planID: 8,
177
+ plan: "prod_KtlhECVSFG2iro",
178
+ name: "Plan Pro",
179
+ user_limit: "20",
180
+ products_limit: "5000",
181
181
  type: "Enterprise"
182
182
  },
183
- src: "https://content-management-profile.s3.amazonaws.com/id-59/59.png?1655616370073"
183
+ src: "https://content-management-profile.s3.amazonaws.com/id-28/28.png?1655691624761"
184
184
  }
185
185
  };
@@ -510,7 +510,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
510
510
  var _ref4 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
511
511
  var _product$article3;
512
512
 
513
- var productInOrder, idArticle, _product$id_order, _servicesResponse$dat, servicesResponse, parsedResponse;
513
+ var productInOrder, idArticle, _product$id_order, _servicesResponse$dat, servicesResponse, parsedResponse, retailers, active;
514
514
 
515
515
  return _regenerator.default.wrap(function _callee3$(_context3) {
516
516
  while (1) {
@@ -520,7 +520,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
520
520
  idArticle = (product === null || product === void 0 ? void 0 : product.id_article) || (product === null || product === void 0 ? void 0 : (_product$article3 = product.article) === null || _product$article3 === void 0 ? void 0 : _product$article3.id_article);
521
521
 
522
522
  if (!(isRevision() || productInOrder)) {
523
- _context3.next = 8;
523
+ _context3.next = 11;
524
524
  break;
525
525
  }
526
526
 
@@ -530,9 +530,16 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
530
530
  case 5:
531
531
  servicesResponse = _context3.sent;
532
532
  parsedResponse = JSON.parse(servicesResponse === null || servicesResponse === void 0 ? void 0 : (_servicesResponse$dat = servicesResponse.data) === null || _servicesResponse$dat === void 0 ? void 0 : _servicesResponse$dat.body).data;
533
+ retailers = product.retailers || product.retailersAvailable;
534
+ active = retailers === null || retailers === void 0 ? void 0 : retailers.filter(function (retailer) {
535
+ return parsedResponse === null || parsedResponse === void 0 ? void 0 : parsedResponse.map(function (srv) {
536
+ return srv.id_retailer;
537
+ }).includes(retailer.id);
538
+ })[0];
539
+ !activeRetailer.id && setActiveRetailer(active ? active : retailers[0]);
533
540
  setServicesData(parsedResponse);
534
541
 
535
- case 8:
542
+ case 11:
536
543
  case "end":
537
544
  return _context3.stop();
538
545
  }
@@ -623,43 +630,39 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
623
630
  case 0:
624
631
  sessionStorage.setItem("user", JSON.stringify(user));
625
632
  loadData();
626
- setActiveRetailer(product.retailers ? product.retailers[0] : product.retailersAvailable[0]); // getPercentage({ data: [product] }).then((res) =>
627
- // setPercentages(res)
628
- // );
629
-
630
633
  getCart();
631
634
  _context5.t0 = setUserGroups;
632
- _context5.next = 7;
635
+ _context5.next = 6;
633
636
  return (0, _data2.fetchUsers)(token);
634
637
 
635
- case 7:
638
+ case 6:
636
639
  _context5.t1 = _context5.sent;
637
640
  (0, _context5.t0)(_context5.t1);
638
641
  arr = [];
639
642
  _context5.t2 = user.id_role;
640
- _context5.next = _context5.t2 === 7 ? 13 : _context5.t2 === 8 ? 13 : _context5.t2 === 4 ? 15 : _context5.t2 === 5 ? 15 : _context5.t2 === 6 ? 17 : 19;
643
+ _context5.next = _context5.t2 === 7 ? 12 : _context5.t2 === 8 ? 12 : _context5.t2 === 4 ? 14 : _context5.t2 === 5 ? 14 : _context5.t2 === 6 ? 16 : 18;
641
644
  break;
642
645
 
643
- case 13:
646
+ case 12:
644
647
  arr = ["IN_PROGRESS", "RF", "RA"];
645
- return _context5.abrupt("break", 21);
648
+ return _context5.abrupt("break", 20);
646
649
 
647
- case 15:
650
+ case 14:
648
651
  arr = ["RF", "AF", "AA", "AP", "AC"];
649
- return _context5.abrupt("break", 21);
652
+ return _context5.abrupt("break", 20);
650
653
 
651
- case 17:
654
+ case 16:
652
655
  arr = ["RP", "RC", "AF"];
653
- return _context5.abrupt("break", 21);
656
+ return _context5.abrupt("break", 20);
654
657
 
655
- case 19:
658
+ case 18:
656
659
  arr = [];
657
- return _context5.abrupt("break", 21);
660
+ return _context5.abrupt("break", 20);
658
661
 
659
- case 21:
662
+ case 20:
660
663
  setStatusArray(arr);
661
664
 
662
- case 22:
665
+ case 21:
663
666
  case "end":
664
667
  return _context5.stop();
665
668
  }
@@ -1763,6 +1766,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
1763
1766
  activeRetailer: activeRetailer,
1764
1767
  setActiveRetailer: setActiveRetailer,
1765
1768
  showValidationButtons: isRevision() && getSectionStatus(),
1769
+ servicesData: servicesData ? servicesData : null,
1766
1770
  approve: function approve() {
1767
1771
  if (origin[activeTab] === "RequestWithoutContentoh" && !user.is_retailer && (!product.id_order || !product.orderId)) {
1768
1772
  setDataGenericModal(function (prev) {
@@ -1639,35 +1639,27 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
1639
1639
  sendToFacilitator("A");
1640
1640
  },
1641
1641
  reject: function reject() {
1642
- sendToFacilitator("R"); // setMessage("Rechazado");
1643
- // setComponentsArray([
1644
- // <img src={errorModal} />,
1645
- // <ScreenHeader
1646
- // text={"Agrega tu comentarios para enviar el rechazo"}
1647
- // headerType={"input-name-header"}
1648
- // color={"white"}
1649
- // />,
1650
- // <TagAndInput
1651
- // label={"Caja de Comentario"}
1652
- // inputType={"textarea"}
1653
- // inputId={"modal-commentary-box"}
1654
- // index={0}
1655
- // color={"white"}
1656
- // />,
1657
- // <Button
1658
- // buttonType={"general-default-button"}
1659
- // label={"Enviar comentario"}
1660
- // onClick={(e) =>
1661
- // createComment(
1662
- // e,
1663
- // document.querySelector(
1664
- // "#modal-commentary-box .ql-container .ql-editor > p"
1665
- // ).innerHTML,
1666
- // activeTab
1667
- // )
1668
- // }
1669
- // />,
1670
- // ]);
1642
+ sendToFacilitator("R");
1643
+ setMessage("Rechazado");
1644
+ setComponentsArray([/*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
1645
+ src: _errorModal.default
1646
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ScreenHeader.ScreenHeader, {
1647
+ text: "Agrega tu comentarios para enviar el rechazo",
1648
+ headerType: "input-name-header",
1649
+ color: "white"
1650
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.TagAndInput, {
1651
+ label: "Caja de Comentario",
1652
+ inputType: "textarea",
1653
+ inputId: "modal-commentary-box",
1654
+ index: 0,
1655
+ color: "white"
1656
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_GeneralButton.Button, {
1657
+ buttonType: "general-default-button",
1658
+ label: "Enviar comentario",
1659
+ onClick: function onClick(e) {
1660
+ return createComment(e, document.querySelector("#modal-commentary-box .ql-container .ql-editor > p").innerHTML, activeTab);
1661
+ }
1662
+ })]);
1671
1663
  },
1672
1664
  showValidationButtons: approveRejectButtons() && (auditorAssigned() || userAssigned())
1673
1665
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_FullTabsMenu.FullTabsMenu, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "contentoh-components-library",
3
- "version": "21.1.9",
3
+ "version": "21.1.12",
4
4
  "dependencies": {
5
5
  "@aws-amplify/auth": "^4.5.3",
6
6
  "@aws-amplify/datastore": "^3.11.0",
@@ -21,22 +21,22 @@ ProviderProductEditionDefault.args = {
21
21
  category: 846,
22
22
  version: 2,
23
23
  productSelected: {
24
- orderId: 27,
24
+ orderId: 77,
25
25
  article_status: "AP",
26
- datasheet_status: "AP",
27
- description_status: "AP",
26
+ datasheet_status: "NS",
27
+ description_status: "NS",
28
28
  images_status: "AP",
29
29
  prio: "none",
30
- version: 2,
30
+ version: 19,
31
31
  brand: null,
32
32
  article: {
33
- category: "BAÑOS|ACCESORIOS PARA BAÑO|ACCESORIOS INDIVIDUALES",
34
- company_name: "THD Proveedor",
35
- country: "México",
36
- id_category: "2004",
37
- id_article: 55108,
38
- name: "Producto de prueba 10 THD",
39
- upc: "SKU12314THD",
33
+ category: "RESIZING|RESIZING|RESIZING",
34
+ company_name: "THD Resize Proveedor",
35
+ country: null,
36
+ id_category: "2999",
37
+ id_article: 55109,
38
+ name: "Resize Ismael",
39
+ upc: "ResizeIsmael",
40
40
  },
41
41
  retailers: [
42
42
  {
@@ -57,11 +57,11 @@ ProviderProductEditionDefault.args = {
57
57
  },
58
58
  ],
59
59
  services: {
60
- datasheets: 1,
61
- descriptions: 1,
60
+ datasheets: 0,
61
+ descriptions: 0,
62
62
  images: 1,
63
63
  },
64
- id_article: 55108,
64
+ id_article: 55109,
65
65
  retailersAvailable: [
66
66
  {
67
67
  id: 58,
@@ -82,25 +82,25 @@ ProviderProductEditionDefault.args = {
82
82
  ],
83
83
  },
84
84
  productToEdit: {
85
- ArticleId: 55108,
86
- idCategory: "2004",
85
+ ArticleId: 55109,
86
+ idCategory: "2999",
87
87
  product: {
88
- orderId: 27,
88
+ orderId: 77,
89
89
  article_status: "AP",
90
- datasheet_status: "AP",
91
- description_status: "AP",
90
+ datasheet_status: "NS",
91
+ description_status: "NS",
92
92
  images_status: "AP",
93
93
  prio: "none",
94
- version: 2,
94
+ version: 19,
95
95
  brand: null,
96
96
  article: {
97
- category: "BAÑOS|ACCESORIOS PARA BAÑO|ACCESORIOS INDIVIDUALES",
98
- company_name: "THD Proveedor",
99
- country: "México",
100
- id_category: "2004",
101
- id_article: 55108,
102
- name: "Producto de prueba 10 THD",
103
- upc: "SKU12314THD",
97
+ category: "RESIZING|RESIZING|RESIZING",
98
+ company_name: "THD Resize Proveedor",
99
+ country: null,
100
+ id_category: "2999",
101
+ id_article: 55109,
102
+ name: "Resize Ismael",
103
+ upc: "ResizeIsmael",
104
104
  },
105
105
  retailers: [
106
106
  {
@@ -121,11 +121,11 @@ ProviderProductEditionDefault.args = {
121
121
  },
122
122
  ],
123
123
  services: {
124
- datasheets: 1,
125
- descriptions: 1,
124
+ datasheets: 0,
125
+ descriptions: 0,
126
126
  images: 1,
127
127
  },
128
- id_article: 55108,
128
+ id_article: 55109,
129
129
  retailersAvailable: [
130
130
  {
131
131
  id: 58,
@@ -151,35 +151,35 @@ ProviderProductEditionDefault.args = {
151
151
  state: { origin: "RequestWithContentoh" },
152
152
  },
153
153
  user: {
154
- id_user: 59,
155
- name: "The Home",
156
- last_name: "Depot",
157
- email: "cadena.ismael@allfreemail.net",
158
- position: "Admin",
154
+ id_user: 28,
155
+ name: "Proveedor",
156
+ last_name: "Colgate",
157
+ email: "ilopez@contentoh.com",
158
+ position: "Prueba Admin",
159
159
  telephone: "+523111366336",
160
160
  country: "México",
161
- id_company: 7,
162
- id_cognito: "5884ae34-59d6-4454-b98e-821518bcc3a7",
161
+ id_company: 1,
162
+ id_cognito: "f5927f8e-cbf7-4922-9e09-e69ec0b2731a",
163
163
  birth_Date: null,
164
164
  about_me: null,
165
165
  zip_code: null,
166
166
  address: null,
167
167
  job: null,
168
- id_stripe: "",
168
+ id_stripe: "cus_KuEt6R6vwmN09f",
169
169
  id_role: 0,
170
170
  active: 1,
171
- is_retailer: 1,
171
+ is_retailer: 0,
172
172
  membership: {
173
- id: 24,
174
- start_date: "2021-11-23T03:35:50.000Z",
175
- end_date: "2022-11-23T03:35:50.000Z",
176
- planID: 9,
177
- plan: "prod_KtlkzZVGq6bRTO",
178
- name: "Plan Enterprise Full",
179
- user_limit: "30",
180
- products_limit: "10000",
173
+ id: 38,
174
+ start_date: "2022-01-18T17:25:35.000Z",
175
+ end_date: "2023-01-18T17:25:35.000Z",
176
+ planID: 8,
177
+ plan: "prod_KtlhECVSFG2iro",
178
+ name: "Plan Pro",
179
+ user_limit: "20",
180
+ products_limit: "5000",
181
181
  type: "Enterprise",
182
182
  },
183
- src: "https://content-management-profile.s3.amazonaws.com/id-59/59.png?1655616370073",
183
+ src: "https://content-management-profile.s3.amazonaws.com/id-28/28.png?1655691624761",
184
184
  },
185
185
  };
@@ -240,6 +240,11 @@ export const ProviderProductEdition = ({
240
240
  }&end=true`
241
241
  );
242
242
  const parsedResponse = JSON.parse(servicesResponse?.data?.body).data;
243
+ let retailers = product.retailers || product.retailersAvailable;
244
+ let active = retailers?.filter((retailer) =>
245
+ parsedResponse?.map((srv) => srv.id_retailer).includes(retailer.id)
246
+ )[0];
247
+ !activeRetailer.id && setActiveRetailer(active ? active : retailers[0]);
243
248
  setServicesData(parsedResponse);
244
249
  }
245
250
  };
@@ -299,12 +304,6 @@ export const ProviderProductEdition = ({
299
304
  useEffect(async () => {
300
305
  sessionStorage.setItem("user", JSON.stringify(user));
301
306
  loadData();
302
- setActiveRetailer(
303
- product.retailers ? product.retailers[0] : product.retailersAvailable[0]
304
- );
305
- // getPercentage({ data: [product] }).then((res) =>
306
- // setPercentages(res)
307
- // );
308
307
  getCart();
309
308
  setUserGroups(await fetchUsers(token));
310
309
  let arr = [];
@@ -1227,6 +1226,7 @@ export const ProviderProductEdition = ({
1227
1226
  activeRetailer={activeRetailer}
1228
1227
  setActiveRetailer={setActiveRetailer}
1229
1228
  showValidationButtons={isRevision() && getSectionStatus()}
1229
+ servicesData={servicesData ? servicesData : null}
1230
1230
  approve={() => {
1231
1231
  if (
1232
1232
  origin[activeTab] === "RequestWithoutContentoh" &&
@@ -1187,35 +1187,35 @@ export const RetailerProductEdition = ({
1187
1187
  }}
1188
1188
  reject={() => {
1189
1189
  sendToFacilitator("R");
1190
- // setMessage("Rechazado");
1191
- // setComponentsArray([
1192
- // <img src={errorModal} />,
1193
- // <ScreenHeader
1194
- // text={"Agrega tu comentarios para enviar el rechazo"}
1195
- // headerType={"input-name-header"}
1196
- // color={"white"}
1197
- // />,
1198
- // <TagAndInput
1199
- // label={"Caja de Comentario"}
1200
- // inputType={"textarea"}
1201
- // inputId={"modal-commentary-box"}
1202
- // index={0}
1203
- // color={"white"}
1204
- // />,
1205
- // <Button
1206
- // buttonType={"general-default-button"}
1207
- // label={"Enviar comentario"}
1208
- // onClick={(e) =>
1209
- // createComment(
1210
- // e,
1211
- // document.querySelector(
1212
- // "#modal-commentary-box .ql-container .ql-editor > p"
1213
- // ).innerHTML,
1214
- // activeTab
1215
- // )
1216
- // }
1217
- // />,
1218
- // ]);
1190
+ setMessage("Rechazado");
1191
+ setComponentsArray([
1192
+ <img src={errorModal} />,
1193
+ <ScreenHeader
1194
+ text={"Agrega tu comentarios para enviar el rechazo"}
1195
+ headerType={"input-name-header"}
1196
+ color={"white"}
1197
+ />,
1198
+ <TagAndInput
1199
+ label={"Caja de Comentario"}
1200
+ inputType={"textarea"}
1201
+ inputId={"modal-commentary-box"}
1202
+ index={0}
1203
+ color={"white"}
1204
+ />,
1205
+ <Button
1206
+ buttonType={"general-default-button"}
1207
+ label={"Enviar comentario"}
1208
+ onClick={(e) =>
1209
+ createComment(
1210
+ e,
1211
+ document.querySelector(
1212
+ "#modal-commentary-box .ql-container .ql-editor > p"
1213
+ ).innerHTML,
1214
+ activeTab
1215
+ )
1216
+ }
1217
+ />,
1218
+ ]);
1219
1219
  }}
1220
1220
  showValidationButtons={
1221
1221
  approveRejectButtons() && (auditorAssigned() || userAssigned())