contentoh-components-library 21.1.9 → 21.1.10

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: 60,
40
40
  article_status: "AP",
41
- datasheet_status: "AP",
42
- description_status: "AP",
43
- images_status: "AP",
41
+ datasheet_status: "AA",
42
+ description_status: "AA",
43
+ images_status: "NS",
44
44
  prio: "none",
45
45
  version: 2,
46
46
  brand: null,
47
47
  article: {
48
- category: "BAÑOS|ACCESORIOS PARA BAÑO|ACCESORIOS INDIVIDUALES",
48
+ category: "ORGANIZADORES Y CLOSETS|MUEBLES DE ORGANIZACIÓN|CARRITOS Y CAJONES",
49
49
  company_name: "THD Proveedor",
50
50
  country: "México",
51
- id_category: "2004",
52
- id_article: 55108,
53
- name: "Producto de prueba 10 THD",
54
- upc: "SKU12314THD"
51
+ id_category: "2275",
52
+ id_article: 55126,
53
+ name: "ESCRITORIO PLEGABLE CAFÉ",
54
+ upc: "159786"
55
55
  },
56
56
  retailers: [{
57
57
  id: 58,
@@ -69,9 +69,9 @@ ProviderProductEditionDefault.args = {
69
69
  services: {
70
70
  datasheets: 1,
71
71
  descriptions: 1,
72
- images: 1
72
+ images: 0
73
73
  },
74
- id_article: 55108,
74
+ id_article: 55126,
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: 55126,
91
+ idCategory: "2275",
92
92
  product: {
93
- orderId: 27,
93
+ orderId: 60,
94
94
  article_status: "AP",
95
- datasheet_status: "AP",
96
- description_status: "AP",
97
- images_status: "AP",
95
+ datasheet_status: "AA",
96
+ description_status: "AA",
97
+ images_status: "NS",
98
98
  prio: "none",
99
99
  version: 2,
100
100
  brand: null,
101
101
  article: {
102
- category: "BAÑOS|ACCESORIOS PARA BAÑO|ACCESORIOS INDIVIDUALES",
102
+ category: "ORGANIZADORES Y CLOSETS|MUEBLES DE ORGANIZACIÓN|CARRITOS Y CAJONES",
103
103
  company_name: "THD Proveedor",
104
104
  country: "México",
105
- id_category: "2004",
106
- id_article: 55108,
107
- name: "Producto de prueba 10 THD",
108
- upc: "SKU12314THD"
105
+ id_category: "2275",
106
+ id_article: 55126,
107
+ name: "ESCRITORIO PLEGABLE CAFÉ",
108
+ upc: "159786"
109
109
  },
110
110
  retailers: [{
111
111
  id: 58,
@@ -123,9 +123,9 @@ ProviderProductEditionDefault.args = {
123
123
  services: {
124
124
  datasheets: 1,
125
125
  descriptions: 1,
126
- images: 1
126
+ images: 0
127
127
  },
128
- id_article: 55108,
128
+ id_article: 55126,
129
129
  retailersAvailable: [{
130
130
  id: 58,
131
131
  name: "The Home Depot Golden"
@@ -616,50 +616,56 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
616
616
  }();
617
617
 
618
618
  (0, _react.useEffect)( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5() {
619
- var arr;
619
+ var retailers, active, arr;
620
620
  return _regenerator.default.wrap(function _callee5$(_context5) {
621
621
  while (1) {
622
622
  switch (_context5.prev = _context5.next) {
623
623
  case 0:
624
624
  sessionStorage.setItem("user", JSON.stringify(user));
625
625
  loadData();
626
- setActiveRetailer(product.retailers ? product.retailers[0] : product.retailersAvailable[0]); // getPercentage({ data: [product] }).then((res) =>
626
+ retailers = product.retailers || product.retailersAvailable;
627
+ active = retailers === null || retailers === void 0 ? void 0 : retailers.filter(function (retailer) {
628
+ return servicesData === null || servicesData === void 0 ? void 0 : servicesData.map(function (srv) {
629
+ return srv.id_retailer;
630
+ }).includes(retailer.id);
631
+ })[0];
632
+ setActiveRetailer(active ? active : retailers[0]); // getPercentage({ data: [product] }).then((res) =>
627
633
  // setPercentages(res)
628
634
  // );
629
635
 
630
636
  getCart();
631
637
  _context5.t0 = setUserGroups;
632
- _context5.next = 7;
638
+ _context5.next = 9;
633
639
  return (0, _data2.fetchUsers)(token);
634
640
 
635
- case 7:
641
+ case 9:
636
642
  _context5.t1 = _context5.sent;
637
643
  (0, _context5.t0)(_context5.t1);
638
644
  arr = [];
639
645
  _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;
646
+ _context5.next = _context5.t2 === 7 ? 15 : _context5.t2 === 8 ? 15 : _context5.t2 === 4 ? 17 : _context5.t2 === 5 ? 17 : _context5.t2 === 6 ? 19 : 21;
641
647
  break;
642
648
 
643
- case 13:
649
+ case 15:
644
650
  arr = ["IN_PROGRESS", "RF", "RA"];
645
- return _context5.abrupt("break", 21);
651
+ return _context5.abrupt("break", 23);
646
652
 
647
- case 15:
653
+ case 17:
648
654
  arr = ["RF", "AF", "AA", "AP", "AC"];
649
- return _context5.abrupt("break", 21);
655
+ return _context5.abrupt("break", 23);
650
656
 
651
- case 17:
657
+ case 19:
652
658
  arr = ["RP", "RC", "AF"];
653
- return _context5.abrupt("break", 21);
659
+ return _context5.abrupt("break", 23);
654
660
 
655
- case 19:
661
+ case 21:
656
662
  arr = [];
657
- return _context5.abrupt("break", 21);
663
+ return _context5.abrupt("break", 23);
658
664
 
659
- case 21:
665
+ case 23:
660
666
  setStatusArray(arr);
661
667
 
662
- case 22:
668
+ case 24:
663
669
  case "end":
664
670
  return _context5.stop();
665
671
  }
@@ -1763,6 +1769,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
1763
1769
  activeRetailer: activeRetailer,
1764
1770
  setActiveRetailer: setActiveRetailer,
1765
1771
  showValidationButtons: isRevision() && getSectionStatus(),
1772
+ servicesData: servicesData ? servicesData : null,
1766
1773
  approve: function approve() {
1767
1774
  if (origin[activeTab] === "RequestWithoutContentoh" && !user.is_retailer && (!product.id_order || !product.orderId)) {
1768
1775
  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.10",
4
4
  "dependencies": {
5
5
  "@aws-amplify/auth": "^4.5.3",
6
6
  "@aws-amplify/datastore": "^3.11.0",
@@ -21,22 +21,23 @@ ProviderProductEditionDefault.args = {
21
21
  category: 846,
22
22
  version: 2,
23
23
  productSelected: {
24
- orderId: 27,
24
+ orderId: 60,
25
25
  article_status: "AP",
26
- datasheet_status: "AP",
27
- description_status: "AP",
28
- images_status: "AP",
26
+ datasheet_status: "AA",
27
+ description_status: "AA",
28
+ images_status: "NS",
29
29
  prio: "none",
30
30
  version: 2,
31
31
  brand: null,
32
32
  article: {
33
- category: "BAÑOS|ACCESORIOS PARA BAÑO|ACCESORIOS INDIVIDUALES",
33
+ category:
34
+ "ORGANIZADORES Y CLOSETS|MUEBLES DE ORGANIZACIÓN|CARRITOS Y CAJONES",
34
35
  company_name: "THD Proveedor",
35
36
  country: "México",
36
- id_category: "2004",
37
- id_article: 55108,
38
- name: "Producto de prueba 10 THD",
39
- upc: "SKU12314THD",
37
+ id_category: "2275",
38
+ id_article: 55126,
39
+ name: "ESCRITORIO PLEGABLE CAFÉ",
40
+ upc: "159786",
40
41
  },
41
42
  retailers: [
42
43
  {
@@ -59,9 +60,9 @@ ProviderProductEditionDefault.args = {
59
60
  services: {
60
61
  datasheets: 1,
61
62
  descriptions: 1,
62
- images: 1,
63
+ images: 0,
63
64
  },
64
- id_article: 55108,
65
+ id_article: 55126,
65
66
  retailersAvailable: [
66
67
  {
67
68
  id: 58,
@@ -82,25 +83,26 @@ ProviderProductEditionDefault.args = {
82
83
  ],
83
84
  },
84
85
  productToEdit: {
85
- ArticleId: 55108,
86
- idCategory: "2004",
86
+ ArticleId: 55126,
87
+ idCategory: "2275",
87
88
  product: {
88
- orderId: 27,
89
+ orderId: 60,
89
90
  article_status: "AP",
90
- datasheet_status: "AP",
91
- description_status: "AP",
92
- images_status: "AP",
91
+ datasheet_status: "AA",
92
+ description_status: "AA",
93
+ images_status: "NS",
93
94
  prio: "none",
94
95
  version: 2,
95
96
  brand: null,
96
97
  article: {
97
- category: "BAÑOS|ACCESORIOS PARA BAÑO|ACCESORIOS INDIVIDUALES",
98
+ category:
99
+ "ORGANIZADORES Y CLOSETS|MUEBLES DE ORGANIZACIÓN|CARRITOS Y CAJONES",
98
100
  company_name: "THD Proveedor",
99
101
  country: "México",
100
- id_category: "2004",
101
- id_article: 55108,
102
- name: "Producto de prueba 10 THD",
103
- upc: "SKU12314THD",
102
+ id_category: "2275",
103
+ id_article: 55126,
104
+ name: "ESCRITORIO PLEGABLE CAFÉ",
105
+ upc: "159786",
104
106
  },
105
107
  retailers: [
106
108
  {
@@ -123,9 +125,9 @@ ProviderProductEditionDefault.args = {
123
125
  services: {
124
126
  datasheets: 1,
125
127
  descriptions: 1,
126
- images: 1,
128
+ images: 0,
127
129
  },
128
- id_article: 55108,
130
+ id_article: 55126,
129
131
  retailersAvailable: [
130
132
  {
131
133
  id: 58,
@@ -299,9 +299,12 @@ export const ProviderProductEdition = ({
299
299
  useEffect(async () => {
300
300
  sessionStorage.setItem("user", JSON.stringify(user));
301
301
  loadData();
302
- setActiveRetailer(
303
- product.retailers ? product.retailers[0] : product.retailersAvailable[0]
304
- );
302
+
303
+ let retailers = product.retailers || product.retailersAvailable;
304
+ let active = retailers?.filter((retailer) =>
305
+ servicesData?.map((srv) => srv.id_retailer).includes(retailer.id)
306
+ )[0];
307
+ setActiveRetailer(active ? active : retailers[0]);
305
308
  // getPercentage({ data: [product] }).then((res) =>
306
309
  // setPercentages(res)
307
310
  // );
@@ -1227,6 +1230,7 @@ export const ProviderProductEdition = ({
1227
1230
  activeRetailer={activeRetailer}
1228
1231
  setActiveRetailer={setActiveRetailer}
1229
1232
  showValidationButtons={isRevision() && getSectionStatus()}
1233
+ servicesData={servicesData ? servicesData : null}
1230
1234
  approve={() => {
1231
1235
  if (
1232
1236
  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())