contentoh-components-library 21.1.4 → 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,107 +36,109 @@ ProviderProductEditionDefault.args = {
36
36
  category: 846,
37
37
  version: 2,
38
38
  productSelected: {
39
- orderId: 47,
40
- status: "AP",
39
+ orderId: 27,
40
+ article_status: "AP",
41
41
  datasheet_status: "AP",
42
- prio: "none",
43
- version: 2,
44
42
  description_status: "AP",
45
43
  images_status: "AP",
44
+ prio: "none",
45
+ version: 2,
46
46
  brand: null,
47
- retailerOrder: 0,
48
- missing: {
49
- datasheet: 0,
50
- descriptions: 1,
51
- images: 0
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"
52
55
  },
56
+ retailers: [{
57
+ id: 58,
58
+ name: "The Home Depot Golden"
59
+ }, {
60
+ id: 59,
61
+ name: "The Home Depot Platinum"
62
+ }, {
63
+ id: 60,
64
+ name: "The Home Depot Resizing"
65
+ }, {
66
+ id: 61,
67
+ name: "Home Depot TAB"
68
+ }],
53
69
  services: {
54
70
  datasheets: 1,
55
71
  descriptions: 1,
56
72
  images: 1
57
73
  },
58
- article: {
59
- category: "ABARROTES|ABARROTES SECOS|GALLETAS",
60
- company_name: "COMPANY DEV",
61
- country: "México",
62
- id_category: "12",
63
- id_datasheet_especialist: 54,
64
- id_datasheet_facilitator: 52,
65
- id_description_especialist: 54,
66
- id_description_facilitator: 52,
67
- id_images_especialist: 55,
68
- id_images_facilitator: 53,
69
- id_order: 47,
70
- id_article: 55115,
71
- id_auditor: 30,
72
- name: "Galletas Oreo",
73
- upc: "42334242"
74
- },
75
- retailers: [{
76
- id: 4,
77
- name: "Walmart Super y Superama"
78
- }],
74
+ id_article: 55108,
79
75
  retailersAvailable: [{
80
- id: 4,
81
- name: "Walmart Super y Superama"
82
- }],
83
- categoryName: "ABARROTES|ABARROTES SECOS|GALLETAS",
84
- upc: "42334242",
85
- id_article: 55115,
86
- id_order: 47
76
+ id: 58,
77
+ name: "The Home Depot Golden"
78
+ }, {
79
+ id: 59,
80
+ name: "The Home Depot Platinum"
81
+ }, {
82
+ id: 60,
83
+ name: "The Home Depot Resizing"
84
+ }, {
85
+ id: 61,
86
+ name: "Home Depot TAB"
87
+ }]
87
88
  },
88
89
  productToEdit: {
89
- ArticleId: 55115,
90
- idCategory: "12",
90
+ ArticleId: 55108,
91
+ idCategory: "2004",
91
92
  product: {
92
- orderId: 47,
93
- status: "AP",
93
+ orderId: 27,
94
+ article_status: "AP",
94
95
  datasheet_status: "AP",
95
- prio: "none",
96
- version: 2,
97
96
  description_status: "AP",
98
97
  images_status: "AP",
98
+ prio: "none",
99
+ version: 2,
99
100
  brand: null,
100
- retailerOrder: 0,
101
- missing: {
102
- datasheet: 0,
103
- descriptions: 1,
104
- images: 0
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"
105
109
  },
110
+ retailers: [{
111
+ id: 58,
112
+ name: "The Home Depot Golden"
113
+ }, {
114
+ id: 59,
115
+ name: "The Home Depot Platinum"
116
+ }, {
117
+ id: 60,
118
+ name: "The Home Depot Resizing"
119
+ }, {
120
+ id: 61,
121
+ name: "Home Depot TAB"
122
+ }],
106
123
  services: {
107
124
  datasheets: 1,
108
125
  descriptions: 1,
109
126
  images: 1
110
127
  },
111
- article: {
112
- category: "ABARROTES|ABARROTES SECOS|GALLETAS",
113
- company_name: "COMPANY DEV",
114
- country: "México",
115
- id_category: "12",
116
- id_datasheet_especialist: 54,
117
- id_datasheet_facilitator: 52,
118
- id_description_especialist: 54,
119
- id_description_facilitator: 52,
120
- id_images_especialist: 55,
121
- id_images_facilitator: 53,
122
- id_order: 47,
123
- id_article: 55115,
124
- id_auditor: 30,
125
- name: "Galletas Oreo",
126
- upc: "42334242"
127
- },
128
- retailers: [{
129
- id: 4,
130
- name: "Walmart Super y Superama"
131
- }],
128
+ id_article: 55108,
132
129
  retailersAvailable: [{
133
- id: 4,
134
- name: "Walmart Super y Superama"
135
- }],
136
- categoryName: "ABARROTES|ABARROTES SECOS|GALLETAS",
137
- upc: "42334242",
138
- id_article: 55115,
139
- id_order: 47
130
+ id: 58,
131
+ name: "The Home Depot Golden"
132
+ }, {
133
+ id: 59,
134
+ name: "The Home Depot Platinum"
135
+ }, {
136
+ id: 60,
137
+ name: "The Home Depot Resizing"
138
+ }, {
139
+ id: 61,
140
+ name: "Home Depot TAB"
141
+ }]
140
142
  }
141
143
  },
142
144
  location: {
@@ -145,39 +147,39 @@ ProviderProductEditionDefault.args = {
145
147
  versionId: 3
146
148
  },
147
149
  state: {
148
- origin: "Contentoh"
150
+ origin: "RequestWithContentoh"
149
151
  }
150
152
  },
151
153
  user: {
152
- id_user: 28,
153
- name: "Proveedor",
154
- last_name: "Colgate",
155
- email: "ilopez@contentoh.com",
156
- position: "Prueba Admin",
154
+ id_user: 59,
155
+ name: "The Home",
156
+ last_name: "Depot",
157
+ email: "cadena.ismael@allfreemail.net",
158
+ position: "Admin",
157
159
  telephone: "+523111366336",
158
160
  country: "México",
159
- id_company: 1,
160
- id_cognito: "f5927f8e-cbf7-4922-9e09-e69ec0b2731a",
161
+ id_company: 7,
162
+ id_cognito: "5884ae34-59d6-4454-b98e-821518bcc3a7",
161
163
  birth_Date: null,
162
164
  about_me: null,
163
165
  zip_code: null,
164
166
  address: null,
165
167
  job: null,
166
- id_stripe: "cus_KuEt6R6vwmN09f",
168
+ id_stripe: "",
167
169
  id_role: 0,
168
170
  active: 1,
169
- is_retailer: 0,
171
+ is_retailer: 1,
170
172
  membership: {
171
- id: 38,
172
- start_date: "2022-01-18T17:25:35.000Z",
173
- end_date: "2023-01-18T17:25:35.000Z",
174
- planID: 8,
175
- plan: "prod_KtlhECVSFG2iro",
176
- name: "Plan Pro",
177
- user_limit: "20",
178
- products_limit: "5000",
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",
179
181
  type: "Enterprise"
180
182
  },
181
- src: "https://content-management-profile.s3.amazonaws.com/id-28/28.png?1655613379760"
183
+ src: "https://content-management-profile.s3.amazonaws.com/id-59/59.png?1655616370073"
182
184
  }
183
185
  };
@@ -1451,11 +1451,10 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
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.4",
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,151 +21,165 @@ ProviderProductEditionDefault.args = {
21
21
  category: 846,
22
22
  version: 2,
23
23
  productSelected: {
24
- orderId: 47,
25
- status: "AP",
24
+ orderId: 27,
25
+ article_status: "AP",
26
26
  datasheet_status: "AP",
27
- prio: "none",
28
- version: 2,
29
27
  description_status: "AP",
30
28
  images_status: "AP",
29
+ prio: "none",
30
+ version: 2,
31
31
  brand: null,
32
- retailerOrder: 0,
33
- missing: {
34
- datasheet: 0,
35
- descriptions: 1,
36
- images: 0,
37
- },
38
- services: {
39
- datasheets: 1,
40
- descriptions: 1,
41
- images: 1,
42
- },
43
32
  article: {
44
- category: "ABARROTES|ABARROTES SECOS|GALLETAS",
45
- company_name: "COMPANY DEV",
33
+ category: "BAÑOS|ACCESORIOS PARA BAÑO|ACCESORIOS INDIVIDUALES",
34
+ company_name: "THD Proveedor",
46
35
  country: "México",
47
- id_category: "12",
48
- id_datasheet_especialist: 54,
49
- id_datasheet_facilitator: 52,
50
- id_description_especialist: 54,
51
- id_description_facilitator: 52,
52
- id_images_especialist: 55,
53
- id_images_facilitator: 53,
54
- id_order: 47,
55
- id_article: 55115,
56
- id_auditor: 30,
57
- name: "Galletas Oreo",
58
- upc: "42334242",
36
+ id_category: "2004",
37
+ id_article: 55108,
38
+ name: "Producto de prueba 10 THD",
39
+ upc: "SKU12314THD",
59
40
  },
60
41
  retailers: [
61
42
  {
62
- id: 4,
63
- name: "Walmart Super y Superama",
43
+ id: 58,
44
+ name: "The Home Depot Golden",
45
+ },
46
+ {
47
+ id: 59,
48
+ name: "The Home Depot Platinum",
49
+ },
50
+ {
51
+ id: 60,
52
+ name: "The Home Depot Resizing",
53
+ },
54
+ {
55
+ id: 61,
56
+ name: "Home Depot TAB",
64
57
  },
65
58
  ],
59
+ services: {
60
+ datasheets: 1,
61
+ descriptions: 1,
62
+ images: 1,
63
+ },
64
+ id_article: 55108,
66
65
  retailersAvailable: [
67
66
  {
68
- id: 4,
69
- name: "Walmart Super y Superama",
67
+ id: 58,
68
+ name: "The Home Depot Golden",
69
+ },
70
+ {
71
+ id: 59,
72
+ name: "The Home Depot Platinum",
73
+ },
74
+ {
75
+ id: 60,
76
+ name: "The Home Depot Resizing",
77
+ },
78
+ {
79
+ id: 61,
80
+ name: "Home Depot TAB",
70
81
  },
71
82
  ],
72
- categoryName: "ABARROTES|ABARROTES SECOS|GALLETAS",
73
- upc: "42334242",
74
- id_article: 55115,
75
- id_order: 47,
76
83
  },
77
84
  productToEdit: {
78
- ArticleId: 55115,
79
- idCategory: "12",
85
+ ArticleId: 55108,
86
+ idCategory: "2004",
80
87
  product: {
81
- orderId: 47,
82
- status: "AP",
88
+ orderId: 27,
89
+ article_status: "AP",
83
90
  datasheet_status: "AP",
84
- prio: "none",
85
- version: 2,
86
91
  description_status: "AP",
87
92
  images_status: "AP",
93
+ prio: "none",
94
+ version: 2,
88
95
  brand: null,
89
- retailerOrder: 0,
90
- missing: {
91
- datasheet: 0,
92
- descriptions: 1,
93
- images: 0,
94
- },
95
- services: {
96
- datasheets: 1,
97
- descriptions: 1,
98
- images: 1,
99
- },
100
96
  article: {
101
- category: "ABARROTES|ABARROTES SECOS|GALLETAS",
102
- company_name: "COMPANY DEV",
97
+ category: "BAÑOS|ACCESORIOS PARA BAÑO|ACCESORIOS INDIVIDUALES",
98
+ company_name: "THD Proveedor",
103
99
  country: "México",
104
- id_category: "12",
105
- id_datasheet_especialist: 54,
106
- id_datasheet_facilitator: 52,
107
- id_description_especialist: 54,
108
- id_description_facilitator: 52,
109
- id_images_especialist: 55,
110
- id_images_facilitator: 53,
111
- id_order: 47,
112
- id_article: 55115,
113
- id_auditor: 30,
114
- name: "Galletas Oreo",
115
- upc: "42334242",
100
+ id_category: "2004",
101
+ id_article: 55108,
102
+ name: "Producto de prueba 10 THD",
103
+ upc: "SKU12314THD",
116
104
  },
117
105
  retailers: [
118
106
  {
119
- id: 4,
120
- name: "Walmart Super y Superama",
107
+ id: 58,
108
+ name: "The Home Depot Golden",
109
+ },
110
+ {
111
+ id: 59,
112
+ name: "The Home Depot Platinum",
113
+ },
114
+ {
115
+ id: 60,
116
+ name: "The Home Depot Resizing",
117
+ },
118
+ {
119
+ id: 61,
120
+ name: "Home Depot TAB",
121
121
  },
122
122
  ],
123
+ services: {
124
+ datasheets: 1,
125
+ descriptions: 1,
126
+ images: 1,
127
+ },
128
+ id_article: 55108,
123
129
  retailersAvailable: [
124
130
  {
125
- id: 4,
126
- name: "Walmart Super y Superama",
131
+ id: 58,
132
+ name: "The Home Depot Golden",
133
+ },
134
+ {
135
+ id: 59,
136
+ name: "The Home Depot Platinum",
137
+ },
138
+ {
139
+ id: 60,
140
+ name: "The Home Depot Resizing",
141
+ },
142
+ {
143
+ id: 61,
144
+ name: "Home Depot TAB",
127
145
  },
128
146
  ],
129
- categoryName: "ABARROTES|ABARROTES SECOS|GALLETAS",
130
- upc: "42334242",
131
- id_article: 55115,
132
- id_order: 47,
133
147
  },
134
148
  },
135
149
  location: {
136
150
  product: { articleId: 109485, versionId: 3 },
137
- state: { origin: "Contentoh" },
151
+ state: { origin: "RequestWithContentoh" },
138
152
  },
139
153
  user: {
140
- id_user: 28,
141
- name: "Proveedor",
142
- last_name: "Colgate",
143
- email: "ilopez@contentoh.com",
144
- position: "Prueba Admin",
154
+ id_user: 59,
155
+ name: "The Home",
156
+ last_name: "Depot",
157
+ email: "cadena.ismael@allfreemail.net",
158
+ position: "Admin",
145
159
  telephone: "+523111366336",
146
160
  country: "México",
147
- id_company: 1,
148
- id_cognito: "f5927f8e-cbf7-4922-9e09-e69ec0b2731a",
161
+ id_company: 7,
162
+ id_cognito: "5884ae34-59d6-4454-b98e-821518bcc3a7",
149
163
  birth_Date: null,
150
164
  about_me: null,
151
165
  zip_code: null,
152
166
  address: null,
153
167
  job: null,
154
- id_stripe: "cus_KuEt6R6vwmN09f",
168
+ id_stripe: "",
155
169
  id_role: 0,
156
170
  active: 1,
157
- is_retailer: 0,
171
+ is_retailer: 1,
158
172
  membership: {
159
- id: 38,
160
- start_date: "2022-01-18T17:25:35.000Z",
161
- end_date: "2023-01-18T17:25:35.000Z",
162
- planID: 8,
163
- plan: "prod_KtlhECVSFG2iro",
164
- name: "Plan Pro",
165
- user_limit: "20",
166
- products_limit: "5000",
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",
167
181
  type: "Enterprise",
168
182
  },
169
- src: "https://content-management-profile.s3.amazonaws.com/id-28/28.png?1655613379760",
183
+ src: "https://content-management-profile.s3.amazonaws.com/id-59/59.png?1655616370073",
170
184
  },
171
185
  };
@@ -950,13 +950,8 @@ export const ProviderProductEdition = ({
950
950
  ) {
951
951
  serv = serv.filter((f) => f.id_retailer === product.retailer_id);
952
952
  }
953
- const approved = user.is_retailer ? "AC" : "AP";
954
- const rejected = user.is_retailer ? "RC" : "RP";
955
- return (
956
- serv.filter(
957
- (item) => item.status === approved || item.status === rejected
958
- ).length === serv.length
959
- );
953
+ const statusArray = user.is_retailer ? ["AC", "RC"] : ["AP", "RP", "AC"];
954
+ return serv.every((item) => statusArray.includes(item.status));
960
955
  };
961
956
 
962
957
  const downloadImages = () => {
@@ -1108,6 +1103,7 @@ export const ProviderProductEdition = ({
1108
1103
  result: result,
1109
1104
  retailerId,
1110
1105
  };
1106
+ console.log(data, "data");
1111
1107
  await axios.put(`${process.env.REACT_APP_EVALUATION_ENDPOINT}`, data, {
1112
1108
  headers: {
1113
1109
  Authorization: token,
@@ -1227,7 +1223,7 @@ export const ProviderProductEdition = ({
1227
1223
  showValidationButtons={isRevision() && getSectionStatus()}
1228
1224
  approve={() => {
1229
1225
  if (
1230
- origin[getConcept(activeTab)] === "RequestWithoutContentoh" &&
1226
+ origin[activeTab] === "RequestWithoutContentoh" &&
1231
1227
  !user.is_retailer &&
1232
1228
  (!product.id_order || !product.orderId)
1233
1229
  ) {
@@ -1260,7 +1256,7 @@ export const ProviderProductEdition = ({
1260
1256
  }}
1261
1257
  reject={() => {
1262
1258
  if (
1263
- origin[getConcept(activeTab)] === "RequestWithoutContentoh" &&
1259
+ origin[activeTab] === "RequestWithoutContentoh" &&
1264
1260
  !user.is_retailer &&
1265
1261
  (!product.id_order || !product.orderId)
1266
1262
  ) {