contentoh-components-library 21.1.2 → 21.1.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.
@@ -36,22 +36,22 @@ ProviderProductEditionDefault.args = {
36
36
  category: 846,
37
37
  version: 2,
38
38
  productSelected: {
39
- orderId: 14,
39
+ orderId: 27,
40
40
  article_status: "AP",
41
- datasheet_status: "AC",
42
- description_status: "AC",
41
+ datasheet_status: "AP",
42
+ description_status: "AP",
43
43
  images_status: "AP",
44
44
  prio: "none",
45
45
  version: 2,
46
46
  brand: null,
47
47
  article: {
48
- category: "ILUMINACIÓN|FOCOS|LEDS",
49
- company_name: "COMPANY DEV",
48
+ category: "BAÑOS|ACCESORIOS PARA BAÑO|ACCESORIOS INDIVIDUALES",
49
+ company_name: "THD Proveedor",
50
50
  country: "México",
51
- id_category: "2146",
52
- id_article: 35705,
53
- name: "FOCO LED A19 (60W) LUZ AMARILLA",
54
- upc: "12087311111"
51
+ id_category: "2004",
52
+ id_article: 55108,
53
+ name: "Producto de prueba 10 THD",
54
+ upc: "SKU12314THD"
55
55
  },
56
56
  retailers: [{
57
57
  id: 58,
@@ -71,7 +71,7 @@ ProviderProductEditionDefault.args = {
71
71
  descriptions: 1,
72
72
  images: 1
73
73
  },
74
- id_article: 35705,
74
+ id_article: 55108,
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: 35705,
91
- idCategory: "2146",
90
+ ArticleId: 55108,
91
+ idCategory: "2004",
92
92
  product: {
93
- orderId: 14,
93
+ orderId: 27,
94
94
  article_status: "AP",
95
- datasheet_status: "AC",
96
- description_status: "AC",
95
+ datasheet_status: "AP",
96
+ description_status: "AP",
97
97
  images_status: "AP",
98
98
  prio: "none",
99
99
  version: 2,
100
100
  brand: null,
101
101
  article: {
102
- category: "ILUMINACIÓN|FOCOS|LEDS",
103
- company_name: "COMPANY DEV",
102
+ category: "BAÑOS|ACCESORIOS PARA BAÑO|ACCESORIOS INDIVIDUALES",
103
+ company_name: "THD Proveedor",
104
104
  country: "México",
105
- id_category: "2146",
106
- id_article: 35705,
107
- name: "FOCO LED A19 (60W) LUZ AMARILLA",
108
- upc: "12087311111"
105
+ id_category: "2004",
106
+ id_article: 55108,
107
+ name: "Producto de prueba 10 THD",
108
+ upc: "SKU12314THD"
109
109
  },
110
110
  retailers: [{
111
111
  id: 58,
@@ -125,7 +125,7 @@ ProviderProductEditionDefault.args = {
125
125
  descriptions: 1,
126
126
  images: 1
127
127
  },
128
- id_article: 35705,
128
+ id_article: 55108,
129
129
  retailersAvailable: [{
130
130
  id: 58,
131
131
  name: "The Home Depot Golden"
@@ -147,7 +147,7 @@ ProviderProductEditionDefault.args = {
147
147
  versionId: 3
148
148
  },
149
149
  state: {
150
- origin: "Contentoh"
150
+ origin: "RequestWithContentoh"
151
151
  }
152
152
  },
153
153
  user: {
@@ -180,6 +180,6 @@ ProviderProductEditionDefault.args = {
180
180
  products_limit: "10000",
181
181
  type: "Enterprise"
182
182
  },
183
- src: "https://content-management-profile.s3.amazonaws.com/id-59/59.png?1655492937526"
183
+ src: "https://content-management-profile.s3.amazonaws.com/id-59/59.png?1655616370073"
184
184
  }
185
185
  };
@@ -1445,17 +1445,16 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
1445
1445
  return item.service === concept;
1446
1446
  });
1447
1447
 
1448
- if (["RequestWithContentoh", "RequestWithoutContentoh"].includes(origin[concept])) {
1448
+ if (["RequestWithContentoh", "RequestWithoutContentoh"].includes(origin[tab])) {
1449
1449
  serv = serv.filter(function (f) {
1450
1450
  return f.id_retailer === product.retailer_id;
1451
1451
  });
1452
1452
  }
1453
1453
 
1454
- var approved = user.is_retailer ? "AC" : "AP";
1455
- var rejected = user.is_retailer ? "RC" : "RP";
1456
- return serv.filter(function (item) {
1457
- return item.status === approved || item.status === rejected;
1458
- }).length === serv.length;
1454
+ var statusArray = user.is_retailer ? ["AC", "RC"] : ["AP", "RP", "AC"];
1455
+ return serv.every(function (item) {
1456
+ return statusArray.includes(item.status);
1457
+ });
1459
1458
  };
1460
1459
 
1461
1460
  var downloadImages = function downloadImages() {
@@ -1594,7 +1593,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
1594
1593
  retailerId = activeRetailer === null || activeRetailer === void 0 ? void 0 : activeRetailer.id;
1595
1594
 
1596
1595
  if (!result) {
1597
- _context13.next = 9;
1596
+ _context13.next = 10;
1598
1597
  break;
1599
1598
  }
1600
1599
 
@@ -1605,18 +1604,19 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
1605
1604
  result: result,
1606
1605
  retailerId: retailerId
1607
1606
  };
1608
- _context13.next = 7;
1607
+ console.log(data, "data");
1608
+ _context13.next = 8;
1609
1609
  return _axios.default.put("".concat(process.env.REACT_APP_EVALUATION_ENDPOINT), data, {
1610
1610
  headers: {
1611
1611
  Authorization: token
1612
1612
  }
1613
1613
  });
1614
1614
 
1615
- case 7:
1616
- _context13.next = 18;
1615
+ case 8:
1616
+ _context13.next = 19;
1617
1617
  break;
1618
1618
 
1619
- case 9:
1619
+ case 10:
1620
1620
  _productTemp = product;
1621
1621
  concept = getConcept(activeTab);
1622
1622
  _productTemp["".concat(concept, "_status")] = "Evaluated";
@@ -1648,11 +1648,11 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
1648
1648
  return (0, _objectSpread3.default)((0, _objectSpread3.default)({}, prev), {}, (0, _defineProperty2.default)({}, concept, "Evaluated"));
1649
1649
  });
1650
1650
 
1651
- case 18:
1651
+ case 19:
1652
1652
  loadData();
1653
1653
  showSurvey && showSurvey(confirmStatusComplete());
1654
1654
 
1655
- case 20:
1655
+ case 21:
1656
1656
  case "end":
1657
1657
  return _context13.stop();
1658
1658
  }
@@ -1764,7 +1764,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
1764
1764
  setActiveRetailer: setActiveRetailer,
1765
1765
  showValidationButtons: isRevision() && getSectionStatus(),
1766
1766
  approve: function approve() {
1767
- if (origin[getConcept(activeTab)] === "RequestWithoutContentoh" && !user.is_retailer && (!product.id_order || !product.orderId)) {
1767
+ if (origin[activeTab] === "RequestWithoutContentoh" && !user.is_retailer && (!product.id_order || !product.orderId)) {
1768
1768
  setDataGenericModal(function (prev) {
1769
1769
  return (0, _objectSpread3.default)((0, _objectSpread3.default)({}, prev), {}, {
1770
1770
  button2: {
@@ -1799,7 +1799,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
1799
1799
  }
1800
1800
  },
1801
1801
  reject: function reject() {
1802
- if (origin[getConcept(activeTab)] === "RequestWithoutContentoh" && !user.is_retailer && (!product.id_order || !product.orderId)) {
1802
+ if (origin[activeTab] === "RequestWithoutContentoh" && !user.is_retailer && (!product.id_order || !product.orderId)) {
1803
1803
  return;
1804
1804
  } else {
1805
1805
  if (user.is_retailer) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "contentoh-components-library",
3
- "version": "21.1.2",
3
+ "version": "21.1.5",
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: 14,
24
+ orderId: 27,
25
25
  article_status: "AP",
26
- datasheet_status: "AC",
27
- description_status: "AC",
26
+ datasheet_status: "AP",
27
+ description_status: "AP",
28
28
  images_status: "AP",
29
29
  prio: "none",
30
30
  version: 2,
31
31
  brand: null,
32
32
  article: {
33
- category: "ILUMINACIÓN|FOCOS|LEDS",
34
- company_name: "COMPANY DEV",
33
+ category: "BAÑOS|ACCESORIOS PARA BAÑO|ACCESORIOS INDIVIDUALES",
34
+ company_name: "THD Proveedor",
35
35
  country: "México",
36
- id_category: "2146",
37
- id_article: 35705,
38
- name: "FOCO LED A19 (60W) LUZ AMARILLA",
39
- upc: "12087311111",
36
+ id_category: "2004",
37
+ id_article: 55108,
38
+ name: "Producto de prueba 10 THD",
39
+ upc: "SKU12314THD",
40
40
  },
41
41
  retailers: [
42
42
  {
@@ -61,7 +61,7 @@ ProviderProductEditionDefault.args = {
61
61
  descriptions: 1,
62
62
  images: 1,
63
63
  },
64
- id_article: 35705,
64
+ id_article: 55108,
65
65
  retailersAvailable: [
66
66
  {
67
67
  id: 58,
@@ -82,25 +82,25 @@ ProviderProductEditionDefault.args = {
82
82
  ],
83
83
  },
84
84
  productToEdit: {
85
- ArticleId: 35705,
86
- idCategory: "2146",
85
+ ArticleId: 55108,
86
+ idCategory: "2004",
87
87
  product: {
88
- orderId: 14,
88
+ orderId: 27,
89
89
  article_status: "AP",
90
- datasheet_status: "AC",
91
- description_status: "AC",
90
+ datasheet_status: "AP",
91
+ description_status: "AP",
92
92
  images_status: "AP",
93
93
  prio: "none",
94
94
  version: 2,
95
95
  brand: null,
96
96
  article: {
97
- category: "ILUMINACIÓN|FOCOS|LEDS",
98
- company_name: "COMPANY DEV",
97
+ category: "BAÑOS|ACCESORIOS PARA BAÑO|ACCESORIOS INDIVIDUALES",
98
+ company_name: "THD Proveedor",
99
99
  country: "México",
100
- id_category: "2146",
101
- id_article: 35705,
102
- name: "FOCO LED A19 (60W) LUZ AMARILLA",
103
- upc: "12087311111",
100
+ id_category: "2004",
101
+ id_article: 55108,
102
+ name: "Producto de prueba 10 THD",
103
+ upc: "SKU12314THD",
104
104
  },
105
105
  retailers: [
106
106
  {
@@ -125,7 +125,7 @@ ProviderProductEditionDefault.args = {
125
125
  descriptions: 1,
126
126
  images: 1,
127
127
  },
128
- id_article: 35705,
128
+ id_article: 55108,
129
129
  retailersAvailable: [
130
130
  {
131
131
  id: 58,
@@ -148,7 +148,7 @@ ProviderProductEditionDefault.args = {
148
148
  },
149
149
  location: {
150
150
  product: { articleId: 109485, versionId: 3 },
151
- state: { origin: "Contentoh" },
151
+ state: { origin: "RequestWithContentoh" },
152
152
  },
153
153
  user: {
154
154
  id_user: 59,
@@ -180,6 +180,6 @@ ProviderProductEditionDefault.args = {
180
180
  products_limit: "10000",
181
181
  type: "Enterprise",
182
182
  },
183
- src: "https://content-management-profile.s3.amazonaws.com/id-59/59.png?1655492937526",
183
+ src: "https://content-management-profile.s3.amazonaws.com/id-59/59.png?1655616370073",
184
184
  },
185
185
  };
@@ -946,19 +946,12 @@ export const ProviderProductEdition = ({
946
946
  const concept = getConcept(tab);
947
947
  let serv = servicesData.filter((item) => item.service === concept);
948
948
  if (
949
- ["RequestWithContentoh", "RequestWithoutContentoh"].includes(
950
- origin[concept]
951
- )
949
+ ["RequestWithContentoh", "RequestWithoutContentoh"].includes(origin[tab])
952
950
  ) {
953
951
  serv = serv.filter((f) => f.id_retailer === product.retailer_id);
954
952
  }
955
- const approved = user.is_retailer ? "AC" : "AP";
956
- const rejected = user.is_retailer ? "RC" : "RP";
957
- return (
958
- serv.filter(
959
- (item) => item.status === approved || item.status === rejected
960
- ).length === serv.length
961
- );
953
+ const statusArray = user.is_retailer ? ["AC", "RC"] : ["AP", "RP", "AC"];
954
+ return serv.every((item) => statusArray.includes(item.status));
962
955
  };
963
956
 
964
957
  const downloadImages = () => {
@@ -1110,6 +1103,7 @@ export const ProviderProductEdition = ({
1110
1103
  result: result,
1111
1104
  retailerId,
1112
1105
  };
1106
+ console.log(data, "data");
1113
1107
  await axios.put(`${process.env.REACT_APP_EVALUATION_ENDPOINT}`, data, {
1114
1108
  headers: {
1115
1109
  Authorization: token,
@@ -1229,7 +1223,7 @@ export const ProviderProductEdition = ({
1229
1223
  showValidationButtons={isRevision() && getSectionStatus()}
1230
1224
  approve={() => {
1231
1225
  if (
1232
- origin[getConcept(activeTab)] === "RequestWithoutContentoh" &&
1226
+ origin[activeTab] === "RequestWithoutContentoh" &&
1233
1227
  !user.is_retailer &&
1234
1228
  (!product.id_order || !product.orderId)
1235
1229
  ) {
@@ -1262,7 +1256,7 @@ export const ProviderProductEdition = ({
1262
1256
  }}
1263
1257
  reject={() => {
1264
1258
  if (
1265
- origin[getConcept(activeTab)] === "RequestWithoutContentoh" &&
1259
+ origin[activeTab] === "RequestWithoutContentoh" &&
1266
1260
  !user.is_retailer &&
1267
1261
  (!product.id_order || !product.orderId)
1268
1262
  ) {