contentoh-components-library 21.2.18 → 21.2.21

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.
@@ -16,178 +16,244 @@ ProviderProductEditionDefault.args = {
16
16
  Imágenes: true,
17
17
  },
18
18
  token:
19
- "eyJraWQiOiJEV3owZnNieXg2MXNFcVduN3RCXC81bVhod3ZNbFZIOTgwUnZcL3RjT0lKdEk9IiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJhYmUxODhlMi0yNWIxLTRhMTktODY3Mi0wZDRiYzExYTliZjIiLCJjb2duaXRvOmdyb3VwcyI6WyJ1c3VhcmlvX2NvbnRlbnRvaCJdLCJlbWFpbF92ZXJpZmllZCI6dHJ1ZSwiaXNzIjoiaHR0cHM6XC9cL2NvZ25pdG8taWRwLnVzLWVhc3QtMS5hbWF6b25hd3MuY29tXC91cy1lYXN0LTFfbFN6UVo0WjdSIiwicGhvbmVfbnVtYmVyX3ZlcmlmaWVkIjpmYWxzZSwiY29nbml0bzp1c2VybmFtZSI6ImFiZTE4OGUyLTI1YjEtNGExOS04NjcyLTBkNGJjMTFhOWJmMiIsImF1ZCI6IjUyZDlza2tkY2c4cWpwODhvb2sxdXNlNm1rIiwiZXZlbnRfaWQiOiIzOTUzZWZjMy0yZjAxLTQwNDYtYmY3Mi0zYTkxZDA0MDNkNTAiLCJ0b2tlbl91c2UiOiJpZCIsImF1dGhfdGltZSI6MTY2MDA2NDUwNCwibmFtZSI6IlJldGFpbGVyIEFjYyIsInBob25lX251bWJlciI6Iis1MjMxMTExMTExMTEiLCJleHAiOjE2NjAwNjgxMDQsImlhdCI6MTY2MDA2NDUwNCwiZW1haWwiOiJyZXRhaWxlclRoZEBBbGxGcmVlTWFpbC5uZXQifQ.Nwsu6XKRp2u5pGqqftQxkSPjD-6xv2Xovmo-tS1VRsfGByPlY0qfyqF0QFZCgncubcYtDoAmpqad7UT0_5HKE1d5nwPM-fA639uv1029YnZwbgfPE3TSAna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dCI6MTY2MjEwNjk3MiwiZW1haWwiOiJpbG9wZXpAY29udGVudG9oLmNvbSJ9.LtlrjlQ19EDcMR5iMoRyQpASYMQ62S9iqhyh0Nf7vTxkOK8FEynOmiQvxIvxWEjtzONHbSXc1mLweFdHOKecVsi6H2qobW-vxlmgBCxpcJ0svLqlsAyOTfN0Acwda2w4BMamfnrETEe6SFHNxIZV0bCKRrHC9dwXbpIhJ0g1-iN54wHxbZ1bCaPJ1KmJZwWtIYRUfUZrOOOYvaN1jvOk1t49uXLFsK1W5HjpdIVaRKampArVSw5GPR1d_BmhD-gb8SGXc3DlOdXNn_5x9pynKp3Yy4BbJlDLz3lGxJU93ZQRnJzQsfQXhYtvlTC0A4nAaF5rucoZedSC0sGeeEmtvw",
20
20
  articleId: 238,
21
21
  category: 846,
22
22
  version: 2,
23
23
  productSelected: {
24
- orderId: 2446,
25
- article_status: "AP",
26
- datasheet_status: "AP",
27
- description_status: "AP",
28
- images_status: "ACA",
24
+ orderId: 125,
25
+ status: "AA",
26
+ datasheet_status: "AA",
29
27
  prio: "none",
30
- version: 2,
31
- brand: null,
32
- article: {
33
- category:
34
- "Organizadores y Closets|Accesorios de Lavandería|Organizadores de Lavandería",
35
- company_name: "WOMEX SA DE CV",
36
- id_company: 424,
37
- country: null,
38
- id_category: "2522",
39
- id_article: 78773,
40
- name: "RACK PARA ROPA DOBLE NEGRO",
41
- upc: "168462",
28
+ version: 3,
29
+ description_status: "AA",
30
+ images_status: "AA",
31
+ brand: "DESCRIPCION PRUEBA",
32
+ retailerOrder: 0,
33
+ missing: {
34
+ datasheet: null,
35
+ descriptions: null,
36
+ images: null,
42
37
  },
43
- retailers: [
44
- {
45
- id: 58,
46
- name: "The Home Depot Golden",
47
- },
48
- ],
49
38
  services: {
50
39
  datasheets: 1,
51
40
  descriptions: 1,
52
41
  images: 1,
53
42
  },
43
+ article: {
44
+ category: "Salud y Belleza|Cosméticos y Accesorios|Cosméticos",
45
+ company_name: "COMPANY DEV",
46
+ country: "México",
47
+ id_category: "682",
48
+ id_datasheet_especialist: 54,
49
+ id_datasheet_facilitator: 52,
50
+ id_description_especialist: 55,
51
+ id_description_facilitator: 52,
52
+ id_images_especialist: 55,
53
+ id_images_facilitator: 53,
54
+ id_order: 125,
55
+ id_article: 76125,
56
+ id_auditor: 30,
57
+ name: "prueba 11",
58
+ timestamp: "2022-07-20T19:20:46.000Z",
59
+ upc: "35646655",
60
+ },
61
+ retailers: [
62
+ {
63
+ id: 2,
64
+ name: "Walmart Mercancías Generales",
65
+ },
66
+ {
67
+ id: 3,
68
+ name: "Sam´s Club",
69
+ },
70
+ {
71
+ id: 5,
72
+ name: "Chedraui",
73
+ },
74
+ ],
54
75
  statusByRetailer: {
55
- 58: {
56
- datasheet: "AP",
57
- description: "AP",
58
- images: "ACA",
76
+ 2: {
77
+ datasheet: "AA",
78
+ datasheetTranslations: "AA",
79
+ description: "AA",
80
+ images: "AA",
81
+ },
82
+ 3: {
83
+ datasheet: "AA",
84
+ datasheetTranslations: "AA",
85
+ description: "AA",
86
+ images: "AA",
87
+ },
88
+ 5: {
89
+ datasheet: "AA",
90
+ datasheetTranslations: "AA",
91
+ description: "AA",
92
+ images: "AA",
59
93
  },
60
94
  },
61
- retailersWithService: ["58"],
62
- id_article: 78773,
63
95
  retailersAvailable: [
64
96
  {
65
- id: 58,
66
- name: "The Home Depot Golden",
97
+ id: 2,
98
+ name: "Walmart Mercancías Generales",
99
+ },
100
+ {
101
+ id: 3,
102
+ name: "Sam´s Club",
103
+ },
104
+ {
105
+ id: 5,
106
+ name: "Chedraui",
67
107
  },
68
108
  ],
109
+ categoryName: "Salud y Belleza|Cosméticos y Accesorios|Cosméticos",
110
+ upc: "35646655",
111
+ id_article: 76125,
112
+ id_order: 125,
69
113
  },
70
114
  productToEdit: {
71
- ArticleId: 78773,
72
- idCategory: "2522",
115
+ ArticleId: 76125,
116
+ idCategory: "682",
73
117
  product: {
74
- orderId: 2446,
75
- article_status: "AP",
76
- datasheet_status: "AP",
77
- description_status: "AP",
78
- images_status: "ACA",
118
+ orderId: 125,
119
+ status: "AA",
120
+ datasheet_status: "AA",
79
121
  prio: "none",
80
- version: 2,
81
- brand: null,
82
- article: {
83
- category:
84
- "Organizadores y Closets|Accesorios de Lavandería|Organizadores de Lavandería",
85
- company_name: "WOMEX SA DE CV",
86
- id_company: 424,
87
- country: null,
88
- id_category: "2522",
89
- id_article: 78773,
90
- name: "RACK PARA ROPA DOBLE NEGRO",
91
- upc: "168462",
122
+ version: 3,
123
+ description_status: "AA",
124
+ images_status: "AA",
125
+ brand: "DESCRIPCION PRUEBA",
126
+ retailerOrder: 0,
127
+ missing: {
128
+ datasheet: null,
129
+ descriptions: null,
130
+ images: null,
92
131
  },
93
- retailers: [
94
- {
95
- id: 58,
96
- name: "The Home Depot Golden",
97
- },
98
- ],
99
132
  services: {
100
133
  datasheets: 1,
101
134
  descriptions: 1,
102
135
  images: 1,
103
136
  },
137
+ article: {
138
+ category: "Salud y Belleza|Cosméticos y Accesorios|Cosméticos",
139
+ company_name: "COMPANY DEV",
140
+ country: "México",
141
+ id_category: "682",
142
+ id_datasheet_especialist: 54,
143
+ id_datasheet_facilitator: 52,
144
+ id_description_especialist: 55,
145
+ id_description_facilitator: 52,
146
+ id_images_especialist: 55,
147
+ id_images_facilitator: 53,
148
+ id_order: 125,
149
+ id_article: 76125,
150
+ id_auditor: 30,
151
+ name: "prueba 11",
152
+ timestamp: "2022-07-20T19:20:46.000Z",
153
+ upc: "35646655",
154
+ },
155
+ retailers: [
156
+ {
157
+ id: 2,
158
+ name: "Walmart Mercancías Generales",
159
+ },
160
+ {
161
+ id: 3,
162
+ name: "Sam´s Club",
163
+ },
164
+ {
165
+ id: 5,
166
+ name: "Chedraui",
167
+ },
168
+ ],
104
169
  statusByRetailer: {
105
- 58: {
106
- datasheet: "AP",
107
- description: "AP",
108
- images: "ACA",
170
+ 2: {
171
+ datasheet: "AA",
172
+ datasheetTranslations: "AA",
173
+ description: "AA",
174
+ images: "AA",
175
+ },
176
+ 3: {
177
+ datasheet: "AA",
178
+ datasheetTranslations: "AA",
179
+ description: "AA",
180
+ images: "AA",
181
+ },
182
+ 5: {
183
+ datasheet: "AA",
184
+ datasheetTranslations: "AA",
185
+ description: "AA",
186
+ images: "AA",
109
187
  },
110
188
  },
111
- retailersWithService: ["58"],
112
- id_article: 78773,
113
189
  retailersAvailable: [
114
190
  {
115
- id: 58,
116
- name: "The Home Depot Golden",
191
+ id: 2,
192
+ name: "Walmart Mercancías Generales",
193
+ },
194
+ {
195
+ id: 3,
196
+ name: "Sam´s Club",
197
+ },
198
+ {
199
+ id: 5,
200
+ name: "Chedraui",
117
201
  },
118
202
  ],
203
+ categoryName: "Salud y Belleza|Cosméticos y Accesorios|Cosméticos",
204
+ upc: "35646655",
205
+ id_article: 76125,
206
+ id_order: 125,
119
207
  },
120
208
  },
121
209
  location: {
122
210
  state: { origin: "Contentoh" },
123
211
  },
124
212
  user: {
125
- id_user: 1237,
126
- name: "The Home",
127
- last_name: "Depot",
128
- email: "retailerThd@AllFreeMail.net",
129
- position: "Retailer",
130
- telephone: "+523111111111",
213
+ id_user: 28,
214
+ name: "Proveedor",
215
+ last_name: "Colgate",
216
+ email: "ilopez@contentoh.com",
217
+ position: "Prueba Admin",
218
+ telephone: "+523111366336",
131
219
  country: "México",
132
- id_company: 817,
133
- id_cognito: "abe188e2-25b1-4a19-8672-0d4bc11a9bf2",
220
+ id_company: 1,
221
+ id_cognito: "f5927f8e-cbf7-4922-9e09-e69ec0b2731a",
134
222
  birth_Date: null,
135
223
  about_me: null,
136
224
  zip_code: null,
137
225
  address: null,
138
226
  job: null,
139
- id_stripe: null,
227
+ id_stripe: "cus_KuEt6R6vwmN09f",
140
228
  id_role: 0,
141
229
  active: 1,
142
- is_retailer: 1,
230
+ is_retailer: 0,
143
231
  email_notify: 1,
144
232
  membership: {
145
- id: 798,
146
- start_date: "2022-06-19T04:25:07.000Z",
147
- end_date: "2023-06-19T04:25:07.000Z",
148
- planID: 6,
149
- plan: "prod_KvGd6YSTJyR3AP",
150
- name: "Plan Small",
151
- user_limit: "10",
152
- products_limit: "1000",
233
+ id: 76,
234
+ start_date: "2022-01-18T17:25:35.000Z",
235
+ end_date: "2023-01-18T17:25:35.000Z",
236
+ planID: 8,
237
+ plan: "prod_KtlhECVSFG2iro",
238
+ name: "Plan Pro",
239
+ user_limit: "20",
240
+ products_limit: "5000",
153
241
  type: "Enterprise",
154
242
  },
155
- src: "https://content-management-profile-prod.s3.amazonaws.com/id-1237/1237.png?1660064505178",
243
+ src: "https://content-management-profile.s3.amazonaws.com/id-28/28.png?1662106973155",
156
244
  },
157
245
  company: {
158
- id_company: 817,
159
- trade_name: "Retailer acc",
160
- company_name: "Retailer acc",
161
- rfc: "ASER12345",
162
- adress: "Av. Insurgentes",
163
- about_company: null,
164
- telephone: null,
165
- web_site: null,
166
- zip_code: null,
246
+ id_company: 1,
247
+ trade_name: "COMPANY DEV",
248
+ company_name: "COMPANY DEV",
249
+ rfc: null,
250
+ adress: "",
251
+ about_company: "...",
252
+ telephone: "",
253
+ web_site: "",
254
+ zip_code: "",
167
255
  email: null,
168
- social_link: null,
169
- is_retailer: 1,
170
- retailers: [
171
- {
172
- id: 58,
173
- name: "The Home Depot Golden",
174
- country: "México",
175
- },
176
- {
177
- id: 59,
178
- name: "The Home Depot Platinum",
179
- country: "México",
180
- },
181
- {
182
- id: 60,
183
- name: "The Home Depot Resizing",
184
- country: "México",
185
- },
186
- {
187
- id: 61,
188
- name: "Home Depot TAB",
189
- country: "México",
190
- },
191
- ],
256
+ social_link: "",
257
+ is_retailer: 0,
192
258
  },
193
259
  };
@@ -217,6 +217,7 @@ export const ProviderProductEdition = ({
217
217
  const [checkAll, setCheckAll] = useState(false);
218
218
  const isRetailer = user?.is_retailer;
219
219
  const [loading, setLoading] = useState(true);
220
+ const [validatedAll, setValidatedAll] = useState(false);
220
221
 
221
222
  const originProp = location?.state?.origin;
222
223
  const [origin, setOrigin] = useState({
@@ -1138,7 +1139,7 @@ export const ProviderProductEdition = ({
1138
1139
  return;
1139
1140
  } else if (user.is_retailer) {
1140
1141
  if (product.id_order || product.orderId) {
1141
- validateAll("R");
1142
+ setValidatedAll(true);
1142
1143
  setModalViewError(true);
1143
1144
  } else {
1144
1145
  setDataGenericModal((prev) => ({
@@ -1151,7 +1152,7 @@ export const ProviderProductEdition = ({
1151
1152
  setShowGenericModal(true);
1152
1153
  }
1153
1154
  } else {
1154
- validateAll("R");
1155
+ setValidatedAll(true);
1155
1156
  setModalViewError(true);
1156
1157
  }
1157
1158
  }}
@@ -1195,7 +1196,7 @@ export const ProviderProductEdition = ({
1195
1196
  return;
1196
1197
  } else if (user.is_retailer) {
1197
1198
  if (product.id_order || product.orderId) {
1198
- sendEvaluation("R");
1199
+ setValidatedAll(false);
1199
1200
  setModalViewError(true);
1200
1201
  } else {
1201
1202
  setDataGenericModal((prev) => ({
@@ -1208,7 +1209,7 @@ export const ProviderProductEdition = ({
1208
1209
  setShowGenericModal(true);
1209
1210
  }
1210
1211
  } else {
1211
- sendEvaluation("R");
1212
+ setValidatedAll(false);
1212
1213
  setModalViewError(true);
1213
1214
  }
1214
1215
  }}
@@ -1448,9 +1449,16 @@ export const ProviderProductEdition = ({
1448
1449
  button1={{
1449
1450
  name: "Enviar",
1450
1451
  action: (e) => {
1451
- createComment(e, document.querySelector("#area").value);
1452
- setModalViewError(false);
1453
- setModalViewTextArea(true);
1452
+ const textArea = document.querySelector("#area");
1453
+ if (textArea.value) {
1454
+ textArea.style.border = "none";
1455
+ createComment(e, textArea.value);
1456
+ setModalViewError(false);
1457
+ setModalViewTextArea(true);
1458
+ validatedAll ? validateAll("R") : sendEvaluation("R");
1459
+ } else {
1460
+ textArea.style.border = "2px solid red";
1461
+ }
1454
1462
  },
1455
1463
  }}
1456
1464
  img={errorModal}