contentoh-components-library 21.5.19 → 21.5.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.
- package/dist/components/atoms/UserSelector/UserSelector.stories.js +1 -1
- package/dist/components/atoms/UserSelector/index.js +4 -2
- package/dist/components/molecules/RowItem/styles.js +1 -1
- package/dist/components/molecules/StatusAsignationInfo/FinancedCompanies.js +1 -1
- package/dist/components/organisms/GridProducts/GridProducts.stories.js +102 -615
- package/dist/components/organisms/GridProducts/index.js +2 -2
- package/dist/components/organisms/InputGroup/index.js +30 -30
- package/dist/components/organisms/Table/styles.js +1 -1
- package/dist/components/pages/MultipleEdition/MultipleEdition.stories.js +1 -1
- package/dist/components/pages/MultipleEdition/saveData.js +19 -9
- package/dist/components/pages/MultipleEdition/styles.js +1 -1
- package/dist/components/pages/MultipleEdition/utils.js +153 -61
- package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +75 -72
- package/dist/components/pages/RetailerProductEdition/index.js +63 -19
- package/package.json +1 -1
- package/src/components/atoms/UserSelector/UserSelector.stories.js +1 -1
- package/src/components/atoms/UserSelector/index.js +7 -1
- package/src/components/molecules/RowItem/styles.js +1 -0
- package/src/components/molecules/StatusAsignationInfo/FinancedCompanies.js +43 -501
- package/src/components/molecules/StatusAsignationInfo/index.js +2 -3
- package/src/components/organisms/GridProducts/GridProducts.stories.js +107 -682
- package/src/components/organisms/GridProducts/index.js +2 -2
- package/src/components/organisms/InputGroup/index.js +47 -62
- package/src/components/organisms/Table/styles.js +5 -1
- package/src/components/pages/MultipleEdition/MultipleEdition.stories.js +1 -1
- package/src/components/pages/MultipleEdition/saveData.js +6 -7
- package/src/components/pages/MultipleEdition/styles.js +1 -7
- package/src/components/pages/MultipleEdition/utils.js +24 -47
- package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +79 -72
- package/src/components/pages/RetailerProductEdition/index.js +93 -29
|
@@ -16,7 +16,7 @@ export const GridProducts = ({
|
|
|
16
16
|
}) => {
|
|
17
17
|
return (
|
|
18
18
|
<Container>
|
|
19
|
-
{
|
|
19
|
+
{gridView ? (
|
|
20
20
|
products?.map(({ gridElement, product, id }, i) => (
|
|
21
21
|
<GridItem
|
|
22
22
|
key={i}
|
|
@@ -25,7 +25,7 @@ export const GridProducts = ({
|
|
|
25
25
|
product={product}
|
|
26
26
|
gridElement={gridElement}
|
|
27
27
|
chkOnChange={chkOnChange}
|
|
28
|
-
onGridClick={onGridClick}
|
|
28
|
+
onGridClick={gridView ? null : onGridClick}
|
|
29
29
|
selected={selected}
|
|
30
30
|
chkChecked={chkChecked}
|
|
31
31
|
/>
|
|
@@ -175,57 +175,53 @@ export const InputGroup = ({
|
|
|
175
175
|
{inputGroup?.inputs?.map((input, index) =>
|
|
176
176
|
activeSection === "Ficha técnica" ? (
|
|
177
177
|
<>
|
|
178
|
-
{((dataInputs[input]?.id!=6700 && dataInputs[input]?.id!=6701)
|
|
179
|
-
|| dataInputs[input]?.isApproved!=undefined) && (
|
|
180
178
|
<TagAndInput
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
)}
|
|
228
|
-
|
|
179
|
+
key={
|
|
180
|
+
index +
|
|
181
|
+
"-" +
|
|
182
|
+
dataInputs[input]?.value +
|
|
183
|
+
"-" +
|
|
184
|
+
dataInputs[input]?.id +
|
|
185
|
+
"-" +
|
|
186
|
+
compare
|
|
187
|
+
}
|
|
188
|
+
//disabled={input === 40001}
|
|
189
|
+
disabled={dataInputs[input]?.isApproved}
|
|
190
|
+
inputId={dataInputs[input]?.id}
|
|
191
|
+
version={version}
|
|
192
|
+
inputType={inputTypeValue(dataInputs[input]?.type)}
|
|
193
|
+
label={
|
|
194
|
+
dataInputs[input]?.name +
|
|
195
|
+
(dataInputs[input]?.required ? "*" : "")
|
|
196
|
+
}
|
|
197
|
+
value={
|
|
198
|
+
compare
|
|
199
|
+
? auditInputs[input]?.value
|
|
200
|
+
: dataInputs[input]?.value
|
|
201
|
+
}
|
|
202
|
+
inputPlaceHolder={input?.placeholder}
|
|
203
|
+
articleId={articleId}
|
|
204
|
+
isRequired={dataInputs[input]?.required}
|
|
205
|
+
updatedDatasheets={updatedDatasheets}
|
|
206
|
+
setUpdatedDatasheets={setUpdatedDatasheets}
|
|
207
|
+
maxChar={
|
|
208
|
+
dataInputs[input]?.max_chars
|
|
209
|
+
? dataInputs[input]?.max_chars
|
|
210
|
+
: 999
|
|
211
|
+
}
|
|
212
|
+
optionList={dataInputs[input]?.option_list}
|
|
213
|
+
description={dataInputs[input]?.description}
|
|
214
|
+
showTooltip={true}
|
|
215
|
+
auditClass={
|
|
216
|
+
compare &&
|
|
217
|
+
!isEquals(
|
|
218
|
+
dataInputs[input].value,
|
|
219
|
+
auditInputs[input].value
|
|
220
|
+
)
|
|
221
|
+
? "audit-class"
|
|
222
|
+
: ""
|
|
223
|
+
}
|
|
224
|
+
/>
|
|
229
225
|
{dataInputs[input]?.isApproved === false && (
|
|
230
226
|
<InputReviewSection
|
|
231
227
|
inputId={dataInputs[input]?.id}
|
|
@@ -251,17 +247,6 @@ export const InputGroup = ({
|
|
|
251
247
|
imageStates={imageStates}
|
|
252
248
|
/>
|
|
253
249
|
)}
|
|
254
|
-
{/*(input.id===44186||input.id===44187) && (
|
|
255
|
-
<InputReviewSection
|
|
256
|
-
inputId={input?.id}
|
|
257
|
-
isApproved={input?.isApproved}
|
|
258
|
-
comment={input?.comment}
|
|
259
|
-
handleImgClick={handleImgClick}
|
|
260
|
-
changeImageBtn={changeImageBtn}
|
|
261
|
-
showDivState={showDivStates}
|
|
262
|
-
imageStates={imageStates}
|
|
263
|
-
/>
|
|
264
|
-
)*/}
|
|
265
250
|
<TagAndInput
|
|
266
251
|
key={index + "-" + input?.value + "-" + compare}
|
|
267
252
|
inputId={input.id}
|
|
@@ -274,7 +259,7 @@ export const InputGroup = ({
|
|
|
274
259
|
: input?.value
|
|
275
260
|
}
|
|
276
261
|
isRequired={input.required}
|
|
277
|
-
disabled={input
|
|
262
|
+
disabled={input?.isApproved}
|
|
278
263
|
maxChar={input.max_chars}
|
|
279
264
|
inputPlaceHolder={input?.placeholder}
|
|
280
265
|
updatedDescriptions={updatedDescriptions}
|
|
@@ -21,13 +21,17 @@ export const Container = styled.div`
|
|
|
21
21
|
top: 0;
|
|
22
22
|
height: 45px;
|
|
23
23
|
position: sticky;
|
|
24
|
-
z-index:
|
|
24
|
+
z-index: 6;
|
|
25
25
|
& > tr {
|
|
26
26
|
background-color: #f7f7fc;
|
|
27
27
|
border-radius: 5px 5px 0px 0px;
|
|
28
28
|
height: 45px;
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
|
+
& > tbody {
|
|
32
|
+
position:absolute;
|
|
33
|
+
z-index:7;
|
|
34
|
+
}
|
|
31
35
|
& > tbody > tr {
|
|
32
36
|
height: 70px;
|
|
33
37
|
&:last-child {
|
|
@@ -12,6 +12,6 @@ MultipleEditionDefault.args = {
|
|
|
12
12
|
articles: [121219],//[216, 238, 239],
|
|
13
13
|
versions: [1],
|
|
14
14
|
//token: "eyJraWQiOiJkQWJkZCtlclwvTlwveVRQUWNvUlVyOCtrNUd2M1hM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MS1sYW1iZGFSb2xlIl0sImF1ZCI6IjVhYzh0cGdzNmdic3ExM2ZydnJwaWVlcDQwIiwiZXZlbnRfaWQiOiJkMzE0ODYyYy02OTYxLTQ5YjktODMwOC1hMDM3Mzg1MjUwYzAiLCJ0b2tlbl91c2UiOiJpZCIsImF1dGhfdGltZSI6MTcwMjQxMTc0MSwibmFtZSI6IkNvbGFib3JhZG9yIiwicGhvbmVfbnVtYmVyIjoiKzUyMTExMSIsImV4cCI6MTcwMjQxNTM0MSwiaWF0IjoxNzAyNDExNzQxLCJlbWFpbCI6ImlzbWFlbDk3bG9wZXpAZ21haWwuY29tIn0.O4Lr5HZLuueNNY1FxqrRBaQZKMgnTXY9IG7KAMkhWO20Dxnfj253sqOme36AbqIAsCQBy77GmnZtTAFs0uF9QBfEDzZXRQ1xcctboGZ9U235LlLdz-BNGoH5QCRXeZsZdXJ1M7yL8IvIdEnXkFC0WYcUMWMRUc6K6vgOvmCCQhzOr-uW-2nsLBGjBb7Tj_okViYvT0Lupo5Z0Z9Xc20oOWnVmrSuaYa1-b4AjOjEOnETA9usnRa6blOVOkHqi5fX8u11ejczINxNBtoizMPOQROuzuuPTvHrl17ae8JkNoxVCJe5ZdfRrUN1lwUXnOZim7QhNg8YR_uvPs_EJRIwfw",
|
|
17
17
|
};
|
|
@@ -15,27 +15,26 @@ const myBucket = new AWS.S3({
|
|
|
15
15
|
region: REGION,
|
|
16
16
|
});
|
|
17
17
|
|
|
18
|
-
export async function saveData(params) {
|
|
19
|
-
const { section, data, token } = params;
|
|
18
|
+
export default async function saveData(params) {
|
|
19
|
+
const { section, data, token, callbackToInitData, setModal } = params;
|
|
20
20
|
if (section === "images") {
|
|
21
21
|
if (await saveImagesData(data, token)) {
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
callbackToInitData();
|
|
23
|
+
setModal({
|
|
24
24
|
type: "saved successfully",
|
|
25
25
|
functions: { setModal },
|
|
26
26
|
payload: { service: "imágenes" },
|
|
27
|
-
})
|
|
27
|
+
});
|
|
28
28
|
// aquí va modal de que todo salío bien y actualiza la data
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
|
-
return
|
|
31
|
+
return false;
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
async function saveImagesData(articles, token) {
|
|
35
35
|
const imagesToUpdate = [];
|
|
36
36
|
articles.data.forEach((article) => {
|
|
37
37
|
const { images, version } = article;
|
|
38
|
-
console.log(images);
|
|
39
38
|
const imagesToAdd = Object.values(images).filter(
|
|
40
39
|
(f) => f.value && !f.value.src.startsWith("id-")
|
|
41
40
|
);
|
|
@@ -106,12 +106,6 @@ export const Container = styled.div`
|
|
|
106
106
|
|
|
107
107
|
td{
|
|
108
108
|
margin:0;
|
|
109
|
-
background: #ffffff !important;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
th{
|
|
113
|
-
border-radius: 0 0 0 0 !important;
|
|
114
|
-
padding: 15px !important;
|
|
115
109
|
}
|
|
116
110
|
|
|
117
111
|
textarea {
|
|
@@ -175,7 +169,7 @@ export const Container = styled.div`
|
|
|
175
169
|
text-align: center;
|
|
176
170
|
border-radius: 6px;
|
|
177
171
|
position: absolute;
|
|
178
|
-
z-index: 6
|
|
172
|
+
z-index: 6!important;
|
|
179
173
|
bottom: 100%;
|
|
180
174
|
left: 20%;
|
|
181
175
|
margin-left: -80px;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import axios from "axios";
|
|
2
2
|
import { ImageVisor } from "../../organisms/ImageVisor";
|
|
3
3
|
import { ButtonV2 } from "../../atoms/ButtonV2";
|
|
4
|
-
import { deleteImage
|
|
4
|
+
import { deleteImage } from "./saveData";
|
|
5
5
|
import { Container, Input, InputBase, TextField } from "@mui/material";
|
|
6
6
|
import { ValidationPanel } from "../../atoms/ValidationPanel";
|
|
7
7
|
import { TagAndInput } from "../../molecules/TagAndInput";
|
|
@@ -96,7 +96,7 @@ export function dataReducer(state, action) {
|
|
|
96
96
|
return action.payload;
|
|
97
97
|
}
|
|
98
98
|
if (action.type === "updateImage") {
|
|
99
|
-
const { articleId, imageId
|
|
99
|
+
const { articleId, imageId } = action.payload;
|
|
100
100
|
const newImageData = state.images.data.slice();
|
|
101
101
|
const articleIndex = newImageData.findIndex((f) => f.id === articleId);
|
|
102
102
|
const id = newImageData[articleIndex]?.images[imageId]?.value?.id;
|
|
@@ -104,8 +104,6 @@ export function dataReducer(state, action) {
|
|
|
104
104
|
...action.payload,
|
|
105
105
|
id,
|
|
106
106
|
};
|
|
107
|
-
const data = newImageData;
|
|
108
|
-
saveData({section:"images", data: {data}, token: token});
|
|
109
107
|
return {
|
|
110
108
|
...state,
|
|
111
109
|
images: {
|
|
@@ -120,6 +118,7 @@ export function dataReducer(state, action) {
|
|
|
120
118
|
const articleIndex = newImageData.findIndex((f) => f.id === articleId);
|
|
121
119
|
const id = newImageData[articleIndex]?.images[imageId]?.value?.id;
|
|
122
120
|
delete newImageData[articleIndex]?.images[imageId]?.value;
|
|
121
|
+
console.log(newImageData[articleIndex]);
|
|
123
122
|
const data = {
|
|
124
123
|
articleId,
|
|
125
124
|
deleteImages: [
|
|
@@ -212,14 +211,6 @@ export function setDataColumns(
|
|
|
212
211
|
justifyContent: "center",
|
|
213
212
|
};
|
|
214
213
|
|
|
215
|
-
const styleApprovalAttributes = {
|
|
216
|
-
textAlign: "center",
|
|
217
|
-
display: "flex",
|
|
218
|
-
justifyContent: "center",
|
|
219
|
-
border: "1px solid #ECDD1D",
|
|
220
|
-
background: "#ECDD1D"
|
|
221
|
-
};
|
|
222
|
-
|
|
223
214
|
const retailersAdded = {
|
|
224
215
|
id: [],
|
|
225
216
|
attr: [],
|
|
@@ -264,15 +255,14 @@ export function setDataColumns(
|
|
|
264
255
|
});
|
|
265
256
|
}
|
|
266
257
|
});
|
|
267
|
-
var saveAvailable=
|
|
268
|
-
/**var saveAvailable = imagesReviewed
|
|
258
|
+
var saveAvailable = imagesReviewed
|
|
269
259
|
.filter((e) => e.articleId === item.id)
|
|
270
260
|
.every((e) => e.isReviewed === true);
|
|
271
261
|
if (
|
|
272
262
|
imagesReviewed.filter((e) => e.articleId === item.id).length == 0
|
|
273
263
|
) {
|
|
274
264
|
saveAvailable = false;
|
|
275
|
-
}
|
|
265
|
+
}
|
|
276
266
|
currentData[`retailer${ret.id}-save`] = (
|
|
277
267
|
<button
|
|
278
268
|
onClick={() => {
|
|
@@ -343,7 +333,7 @@ export function setDataColumns(
|
|
|
343
333
|
);
|
|
344
334
|
currentData[`img${imageId}`] =
|
|
345
335
|
<>
|
|
346
|
-
|
|
336
|
+
<button
|
|
347
337
|
onClick={() => {
|
|
348
338
|
setShowValidationPanel(true);
|
|
349
339
|
setAttributeSelected({
|
|
@@ -428,7 +418,7 @@ export function setDataColumns(
|
|
|
428
418
|
<p> Rechazar </p>{" "}
|
|
429
419
|
</button>{" "}
|
|
430
420
|
</div>
|
|
431
|
-
|
|
421
|
+
)}{" "}
|
|
432
422
|
{comment && <div class="tooltip">
|
|
433
423
|
<ImageVisor {...props}/>
|
|
434
424
|
<span class="tooltiptext"><p><b>Comentarios del rechazo</b></p><p>{des.comment}</p></span>
|
|
@@ -472,31 +462,19 @@ export function setDataColumns(
|
|
|
472
462
|
var articleAttributes = attributesReviewed.filter(
|
|
473
463
|
(e) => e.articleId === item.id && e.versionId === item.version
|
|
474
464
|
);
|
|
475
|
-
var value;
|
|
476
465
|
articleAttributes.forEach((articleAttribute) => {
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
).checked;
|
|
485
|
-
}
|
|
486
|
-
else{
|
|
487
|
-
value = document.getElementById(
|
|
488
|
-
articleAttribute.articleId +
|
|
489
|
-
"_" +
|
|
490
|
-
articleAttribute.attributeId +
|
|
491
|
-
"_" +
|
|
492
|
-
articleAttribute.versionId
|
|
493
|
-
).value;
|
|
494
|
-
}
|
|
466
|
+
const value = document.getElementById(
|
|
467
|
+
articleAttribute.articleId +
|
|
468
|
+
"_" +
|
|
469
|
+
articleAttribute.attributeId +
|
|
470
|
+
"_" +
|
|
471
|
+
articleAttribute.versionId
|
|
472
|
+
).value;
|
|
495
473
|
articlesAtributesUpdateBody.push({
|
|
496
474
|
articleId: articleAttribute.articleId,
|
|
497
475
|
versionId: articleAttribute.versionId,
|
|
498
476
|
attributeId: articleAttribute.attributeId,
|
|
499
|
-
value: value
|
|
477
|
+
value: value ? value : "",
|
|
500
478
|
isApproved: articleAttribute.isApproved,
|
|
501
479
|
comment: articleAttribute.comment,
|
|
502
480
|
});
|
|
@@ -524,7 +502,7 @@ export function setDataColumns(
|
|
|
524
502
|
Header: rules[attributeId].name,
|
|
525
503
|
accessor: `${attributeId + "-" + ret.id}`,
|
|
526
504
|
width: "200px",
|
|
527
|
-
style:
|
|
505
|
+
style: styleData,
|
|
528
506
|
description: rules[attributeId].description,
|
|
529
507
|
});
|
|
530
508
|
}
|
|
@@ -662,7 +640,7 @@ export function setDataColumns(
|
|
|
662
640
|
)}
|
|
663
641
|
{attributesReviewed[index].isReviewed &&
|
|
664
642
|
!attributesReviewed[index].isApproved && (
|
|
665
|
-
|
|
643
|
+
<Tooltip position="topCenter" componentTooltip={<span>Debes aprobar o rechazar para continuar</span>}>
|
|
666
644
|
<div>
|
|
667
645
|
<img
|
|
668
646
|
id={
|
|
@@ -673,11 +651,11 @@ export function setDataColumns(
|
|
|
673
651
|
"_" +
|
|
674
652
|
item.version
|
|
675
653
|
}
|
|
676
|
-
src={
|
|
677
|
-
alt="
|
|
654
|
+
src={nullIcon}
|
|
655
|
+
alt="null button"
|
|
678
656
|
/>
|
|
679
657
|
</div>
|
|
680
|
-
|
|
658
|
+
</Tooltip>
|
|
681
659
|
)}
|
|
682
660
|
{typeof des.isApproved === "undefined" &&
|
|
683
661
|
!attributesReviewed[index].isReviewed && (
|
|
@@ -757,15 +735,14 @@ export function setDataColumns(
|
|
|
757
735
|
style: styleSaveButtonCol,
|
|
758
736
|
});
|
|
759
737
|
}
|
|
760
|
-
var saveAvailable=
|
|
761
|
-
/**var saveAvailable = descriptionsReviewed
|
|
738
|
+
var saveAvailable = descriptionsReviewed
|
|
762
739
|
.filter((e) => e.articleId === item.id)
|
|
763
740
|
.every((e) => e.isReviewed === true);
|
|
764
741
|
if (
|
|
765
742
|
descriptionsReviewed.filter((e) => e.articleId === item.id).length == 0
|
|
766
743
|
) {
|
|
767
744
|
saveAvailable = false;
|
|
768
|
-
}
|
|
745
|
+
}
|
|
769
746
|
currentData[`retailer${ret.id}`] = <p> {ret.name} </p>;
|
|
770
747
|
ret.descriptions.forEach((descriptionId) => {
|
|
771
748
|
if (!retailersAdded.attr.includes(`${descriptionId}`)) {
|
|
@@ -852,7 +829,7 @@ export function setDataColumns(
|
|
|
852
829
|
);
|
|
853
830
|
currentData[`${des.attributeId}`] = (
|
|
854
831
|
<>
|
|
855
|
-
|
|
832
|
+
<button
|
|
856
833
|
onClick={() => {
|
|
857
834
|
setShowValidationPanel(true);
|
|
858
835
|
setAttributeSelected({
|
|
@@ -936,7 +913,7 @@ export function setDataColumns(
|
|
|
936
913
|
<p> Rechazar </p>{" "}
|
|
937
914
|
</button>{" "}
|
|
938
915
|
</div>
|
|
939
|
-
|
|
916
|
+
)}{" "}
|
|
940
917
|
{des.comment && <div class="tooltip">
|
|
941
918
|
<textarea {...props}></textarea>
|
|
942
919
|
<span class="tooltiptext"><p><b>Comentarios del rechazo</b></p><p>{des.comment}</p></span>
|
|
@@ -16,97 +16,104 @@ RetailerProductEditionDefault.args = {
|
|
|
16
16
|
Imágenes: false,
|
|
17
17
|
},
|
|
18
18
|
token:
|
|
19
|
-
|
|
19
|
+
"eyJraWQiOiJEV3owZnNieXg2MXNFcVduN3RCXC81bVhod3ZNbFZIOTgwUnZcL3RjT0lKdEk9IiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJmNGRiODI2My1jYjA1LTQzMTItOWU0NS1lM2RlY2E2NjllNzIiLCJjb2duaXRvOmdyb3VwcyI6WyJjb2xhYm9yYWRvcmVzX2NvbnRlbnRvaCJdLCJlbWFpbF92ZXJpZmllZCI6dHJ1ZSwiaXNzIjoiaHR0cHM6XC9cL2NvZ25pdG8taWRwLnVzLWVhc3QtMS5hbWF6b25hd3MuY29tXC91cy1lYXN0LTFfbFN6UVo0WjdSIiwiY29nbml0bzp1c2VybmFtZSI6ImY0ZGI4MjYzLWNiMDUtNDMxMi05ZTQ1LWUzZGVjYTY2OWU3MiIsImF1ZCI6IjUyZDlza2tkY2c4cWpwODhvb2sxdXNlNm1rIiwiZXZlbnRfaWQiOiIyMTlmNjg1OS0zOGRkLTQwYzEtYmNhMC00OWQ1YjMwMTQxMTgiLCJ0b2tlbl91c2UiOiJpZCIsImF1dGhfdGltZSI6MTcxODIxMzQyOCwibmFtZSI6IkNvbGFib3JhZG9yIiwicGhvbmVfbnVtYmVyIjoiKzUyMTExMSIsImV4cCI6MTcxODIxNzAyNywiaWF0IjoxNzE4MjEzNDI4LCJlbWFpbCI6ImVtb250YW5vQGNvbnRlbnRvaC5jb20ifQ.TQfkHTvvjC0VUfoQexjuvlVixeb_J3ZP8uzGFgdDur8m3v0Wad32fUM3eOsTzrsXp_c0HJHHuT_7x9h27pCyLoeTmi5j_y9Rfyu4RXj9xEejE3_Ge7LXupdvYuo3-kI577vcQjrHjYShjLZ0RFNDQVxbrBLS19qRXYj7DJXM0tenLG4v5wLNZyhdmW5OdnIYjA8VfDCxV_fO2v9pFie0DUbmgGGnpzqHBVJfhbBVOrjq2PGmx4HvTy5Ne8b4pyio3Gs5LSYA7ZMTvVMaZWKTFfgNM69tY4NNCZVAfe56EL5DzOBhCtLGXljVqTrEIkd1bPHX_CmM2nGkzhbTwYtstg",
|
|
20
20
|
productSelected: {
|
|
21
|
-
orderId: 15190,
|
|
22
|
-
status: "RA",
|
|
23
|
-
datasheet_status: "NS",
|
|
24
|
-
prio: "none",
|
|
25
|
-
version: 3,
|
|
26
|
-
description_status: "NS",
|
|
27
|
-
images_status: "RA",
|
|
28
|
-
brand: null,
|
|
29
|
-
retailerOrder: 0,
|
|
30
|
-
missing: {
|
|
31
|
-
datasheet: null,
|
|
32
|
-
descriptions: null,
|
|
33
|
-
images: null,
|
|
34
|
-
},
|
|
35
21
|
services: {
|
|
36
|
-
datasheets:
|
|
37
|
-
descriptions:
|
|
22
|
+
datasheets: 1,
|
|
23
|
+
descriptions: 1,
|
|
38
24
|
images: 1,
|
|
39
25
|
},
|
|
26
|
+
orderId: 7961,
|
|
27
|
+
status: "RP",
|
|
28
|
+
datasheet_status: "AA",
|
|
29
|
+
prio: "none",
|
|
30
|
+
version: 3,
|
|
31
|
+
description_status: "RP",
|
|
32
|
+
images_status: "AA",
|
|
33
|
+
statusByRetailer: {
|
|
34
|
+
"58": {
|
|
35
|
+
datasheet: "AA",
|
|
36
|
+
description: "RP",
|
|
37
|
+
images: "AA",
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
40
|
article: {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
41
|
+
id_article: 126855,
|
|
42
|
+
id_category: "3066",
|
|
43
|
+
name: "ORGANIZADOR 3 CUBOS ITALIA 92 X 33 X 30 CM",
|
|
44
|
+
upc: "217141",
|
|
45
|
+
timestamp: "2024-05-17T18:52:34.000Z",
|
|
46
|
+
id_user: 1636,
|
|
47
|
+
status: null,
|
|
48
|
+
active: 1,
|
|
49
|
+
company_id: 315,
|
|
50
|
+
company_name: "MADERAS Y DISEÑOS DEL NORTE S.A. DE C.V.",
|
|
44
51
|
country: "México",
|
|
45
|
-
|
|
46
|
-
id_datasheet_especialist:
|
|
52
|
+
id_order: 7961,
|
|
53
|
+
id_datasheet_especialist: 2757,
|
|
47
54
|
id_datasheet_facilitator: null,
|
|
48
|
-
id_description_especialist:
|
|
55
|
+
id_description_especialist: 2757,
|
|
49
56
|
id_description_facilitator: null,
|
|
50
|
-
id_images_especialist:
|
|
51
|
-
id_images_facilitator:
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
57
|
+
id_images_especialist: 1251,
|
|
58
|
+
id_images_facilitator: null,
|
|
59
|
+
id_auditor: 514,
|
|
60
|
+
id_recepcionist: null,
|
|
61
|
+
category: "Muebles|Muebles para Oficina y Gamer|Libreros",
|
|
62
|
+
missingAttributes: 0,
|
|
63
|
+
missingDescriptions: 0,
|
|
64
|
+
missingImages: 0,
|
|
58
65
|
},
|
|
59
66
|
retailers: [
|
|
60
67
|
{
|
|
61
|
-
id:
|
|
62
|
-
name: "
|
|
68
|
+
id: 58,
|
|
69
|
+
name: "The Home Depot Golden",
|
|
63
70
|
},
|
|
64
71
|
],
|
|
65
|
-
statusByRetailer: {
|
|
66
|
-
70: {
|
|
67
|
-
images: "RA/AC",
|
|
68
|
-
},
|
|
69
|
-
},
|
|
70
|
-
},
|
|
71
|
-
location: {
|
|
72
|
-
product: { articleId: 39364, versionId: 3 },
|
|
73
|
-
state: {
|
|
74
|
-
withChat: true,
|
|
75
|
-
chatType: "product_status",
|
|
76
|
-
},
|
|
77
|
-
},
|
|
78
|
-
user: {
|
|
79
|
-
id_user: 37,
|
|
80
|
-
name: "José",
|
|
81
|
-
last_name: "Castañeda",
|
|
82
|
-
email: "ismael97lopez@gmail.com",
|
|
83
|
-
position: "Auditor",
|
|
84
|
-
telephone: "",
|
|
85
72
|
country: "México",
|
|
73
|
+
upc: "217141",
|
|
74
|
+
}
|
|
75
|
+
,
|
|
76
|
+
// location: {
|
|
77
|
+
// product: { articleId: 126855, versionId: 3 },
|
|
78
|
+
// state: {
|
|
79
|
+
// withChat: true,
|
|
80
|
+
// chatType: "product_status",
|
|
81
|
+
// },
|
|
82
|
+
// },
|
|
83
|
+
user: {
|
|
84
|
+
id_user: 1973,
|
|
85
|
+
name: "Estefany",
|
|
86
|
+
last_name: "Montaño",
|
|
87
|
+
email: "emontano@contentoh.com",
|
|
88
|
+
position: "Front-End Developer",
|
|
89
|
+
telephone: null,
|
|
90
|
+
country: null,
|
|
86
91
|
id_company: 254,
|
|
87
|
-
id_cognito: "
|
|
88
|
-
birth_Date:
|
|
89
|
-
about_me:
|
|
90
|
-
zip_code:
|
|
91
|
-
address:
|
|
92
|
-
job:
|
|
93
|
-
id_stripe:
|
|
94
|
-
id_role:
|
|
92
|
+
id_cognito: "f4db8263-cb05-4312-9e45-e3deca669e72",
|
|
93
|
+
birth_Date: "1999-10-06T00:00:00.000Z",
|
|
94
|
+
about_me: null,
|
|
95
|
+
zip_code: null,
|
|
96
|
+
address: null,
|
|
97
|
+
job: null,
|
|
98
|
+
id_stripe: null,
|
|
99
|
+
id_role: 1,
|
|
95
100
|
active: 1,
|
|
96
101
|
is_retailer: 0,
|
|
97
102
|
email_notify: 1,
|
|
98
|
-
is_user_tech:
|
|
103
|
+
is_user_tech: "ADMIN-AS",
|
|
104
|
+
is_onboarding: 0,
|
|
99
105
|
membership: {
|
|
100
|
-
id:
|
|
101
|
-
start_date: "
|
|
102
|
-
end_date: "
|
|
103
|
-
planID:
|
|
104
|
-
plan: "
|
|
105
|
-
name: "Plan
|
|
106
|
-
user_limit: "
|
|
107
|
-
products_limit: "
|
|
106
|
+
id: 750,
|
|
107
|
+
start_date: "2022-01-07T21:32:54.000Z",
|
|
108
|
+
end_date: "2023-01-07T21:32:54.000Z",
|
|
109
|
+
planID: 6,
|
|
110
|
+
plan: "prod_KvGd6YSTJyR3AP",
|
|
111
|
+
name: "Plan Small",
|
|
112
|
+
user_limit: "10",
|
|
113
|
+
products_limit: "1000",
|
|
108
114
|
type: "Enterprise",
|
|
109
115
|
},
|
|
110
|
-
src: "https://content-management-profile.s3.amazonaws.com/id-
|
|
111
|
-
}
|
|
116
|
+
src: "https://content-management-profile-prod.s3.amazonaws.com/id-1973/1973.png?1718213428633",
|
|
117
|
+
}
|
|
118
|
+
,
|
|
112
119
|
};
|