contentoh-components-library 21.0.82 → 21.0.85
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/molecules/GalleryElement/index.js +5 -2
- package/dist/components/molecules/TableHeader/styles.js +1 -1
- package/dist/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +95 -47
- package/dist/components/pages/ProviderProductEdition/index.js +48 -31
- package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +12 -10
- package/dist/components/pages/RetailerProductEdition/index.js +26 -27
- package/dist/index.js +22 -9
- package/package.json +1 -1
- package/src/components/atoms/AsignationOption/index.js +2 -0
- package/src/components/atoms/AsignationOption/styles.js +7 -1
- package/src/components/molecules/GalleryElement/index.js +4 -1
- package/src/components/molecules/RetailerSelector/index.js +2 -1
- package/src/components/molecules/RetailerSelector/styles.js +2 -0
- package/src/components/molecules/TableHeader/styles.js +4 -1
- package/src/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +133 -54
- package/src/components/pages/ProviderProductEdition/index.js +38 -22
- package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +10 -8
- package/src/components/pages/RetailerProductEdition/index.js +16 -21
- package/src/index.js +1 -0
|
@@ -41,7 +41,8 @@ var GalleryElement = function GalleryElement(_ref) {
|
|
|
41
41
|
changeImage = _ref.changeImage,
|
|
42
42
|
selectedImages = _ref.selectedImages,
|
|
43
43
|
setSelectedImages = _ref.setSelectedImages,
|
|
44
|
-
setCheckAll = _ref.setCheckAll
|
|
44
|
+
setCheckAll = _ref.setCheckAll,
|
|
45
|
+
setSocketType = _ref.setSocketType;
|
|
45
46
|
|
|
46
47
|
var _useState = (0, _react.useState)(validation),
|
|
47
48
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
@@ -110,7 +111,9 @@ var GalleryElement = function GalleryElement(_ref) {
|
|
|
110
111
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Select.default, {
|
|
111
112
|
width: "100%",
|
|
112
113
|
placeholder: "Tipo de toma",
|
|
113
|
-
options: imageInputs
|
|
114
|
+
options: imageInputs === null || imageInputs === void 0 ? void 0 : imageInputs.filter(function (img) {
|
|
115
|
+
return img.value === image.image_id || !img.active;
|
|
116
|
+
}),
|
|
114
117
|
valueSelected: image.image_id,
|
|
115
118
|
onChange: function onChange(e) {
|
|
116
119
|
changeImage({
|
|
@@ -15,6 +15,6 @@ var _variables = require("../../../global-files/variables");
|
|
|
15
15
|
|
|
16
16
|
var _templateObject;
|
|
17
17
|
|
|
18
|
-
var Container = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n justify-content: space-between;\n padding-bottom: 5px;\n border-bottom: 1px solid ", ";\n\n .input-name-header {\n overflow: auto;\n max-width: 40%;\n white-space: nowrap;\n }\n .status-asignation-info {\n display: flex;\n align-items: center;\n\n * + * {\n margin-left: 5px;\n }\n }\n\n & + * {\n margin-top: 4px;\n }\n"])), _variables.GlobalColors.s2);
|
|
18
|
+
var Container = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n justify-content: space-between;\n padding-bottom: 5px;\n border-bottom: 1px solid ", ";\n\n .input-name-header {\n overflow-x: auto;\n max-width: 40%;\n white-space: nowrap;\n height: 23px;\n line-height: 23px;\n text-overflow: initial;\n }\n .status-asignation-info {\n display: flex;\n align-items: center;\n\n * + * {\n margin-left: 5px;\n }\n }\n\n & + * {\n margin-top: 4px;\n }\n"])), _variables.GlobalColors.s2);
|
|
19
19
|
|
|
20
20
|
exports.Container = Container;
|
|
@@ -36,60 +36,108 @@ ProviderProductEditionDefault.args = {
|
|
|
36
36
|
category: 846,
|
|
37
37
|
version: 2,
|
|
38
38
|
productSelected: {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
timestamp: "2021-11-09T23:22:36.000Z",
|
|
44
|
-
status: "NULL",
|
|
45
|
-
categoryName: "TECNOLOGÍA Y ELECTRÓNICA|VIDEO|DVD Y BLU-RAY",
|
|
46
|
-
asignations: [],
|
|
39
|
+
orderId: 2,
|
|
40
|
+
status: "AA",
|
|
41
|
+
datasheet_status: "AA",
|
|
42
|
+
prio: "none",
|
|
47
43
|
version: 2,
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
44
|
+
description_status: "AP",
|
|
45
|
+
images_status: "AA",
|
|
46
|
+
brand: null,
|
|
47
|
+
retailerOrder: 0,
|
|
48
|
+
missing: {
|
|
49
|
+
datasheet: 0,
|
|
50
|
+
descriptions: 0,
|
|
51
|
+
images: -1
|
|
52
|
+
},
|
|
53
|
+
services: {
|
|
54
|
+
datasheets: 1,
|
|
55
|
+
descriptions: 1,
|
|
56
|
+
images: 1
|
|
57
|
+
},
|
|
58
|
+
article: {
|
|
59
|
+
category: "ILUMINACIÓN|FOCOS|LEDS",
|
|
60
|
+
company_name: "COMPANY DEV",
|
|
58
61
|
country: "México",
|
|
59
|
-
|
|
60
|
-
|
|
62
|
+
id_category: "2146",
|
|
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: 2,
|
|
70
|
+
id_article: 35319,
|
|
71
|
+
id_auditor: 30,
|
|
72
|
+
name: "FOCO LED A19 (60W) LUZ AMARILLA",
|
|
73
|
+
upc: "120873"
|
|
74
|
+
},
|
|
75
|
+
retailers: [{
|
|
76
|
+
id: 58,
|
|
77
|
+
name: "The Home Depot Golden"
|
|
78
|
+
}],
|
|
79
|
+
retailersAvailable: [{
|
|
80
|
+
id: 58,
|
|
81
|
+
name: "The Home Depot Golden"
|
|
61
82
|
}],
|
|
62
|
-
|
|
83
|
+
categoryName: "ILUMINACIÓN|FOCOS|LEDS",
|
|
84
|
+
upc: "120873",
|
|
85
|
+
id_article: 35319,
|
|
86
|
+
id_order: 2
|
|
63
87
|
},
|
|
64
88
|
productToEdit: {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
product:
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
timestamp: "2021-11-09T23:22:36.000Z",
|
|
73
|
-
status: "NULL",
|
|
74
|
-
categoryName: "TECNOLOGÍA Y ELECTRÓNICA|VIDEO|DVD Y BLU-RAY",
|
|
75
|
-
asignations: [],
|
|
89
|
+
ArticleId: 35319,
|
|
90
|
+
idCategory: "2146",
|
|
91
|
+
product: {
|
|
92
|
+
orderId: 2,
|
|
93
|
+
status: "AA",
|
|
94
|
+
datasheet_status: "AA",
|
|
95
|
+
prio: "none",
|
|
76
96
|
version: 2,
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
97
|
+
description_status: "AP",
|
|
98
|
+
images_status: "AA",
|
|
99
|
+
brand: null,
|
|
100
|
+
retailerOrder: 0,
|
|
101
|
+
missing: {
|
|
102
|
+
datasheet: 0,
|
|
103
|
+
descriptions: 0,
|
|
104
|
+
images: -1
|
|
105
|
+
},
|
|
106
|
+
services: {
|
|
107
|
+
datasheets: 1,
|
|
108
|
+
descriptions: 1,
|
|
109
|
+
images: 1
|
|
110
|
+
},
|
|
111
|
+
article: {
|
|
112
|
+
category: "ILUMINACIÓN|FOCOS|LEDS",
|
|
113
|
+
company_name: "COMPANY DEV",
|
|
87
114
|
country: "México",
|
|
88
|
-
|
|
89
|
-
|
|
115
|
+
id_category: "2146",
|
|
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: 2,
|
|
123
|
+
id_article: 35319,
|
|
124
|
+
id_auditor: 30,
|
|
125
|
+
name: "FOCO LED A19 (60W) LUZ AMARILLA",
|
|
126
|
+
upc: "120873"
|
|
127
|
+
},
|
|
128
|
+
retailers: [{
|
|
129
|
+
id: 58,
|
|
130
|
+
name: "The Home Depot Golden"
|
|
90
131
|
}],
|
|
91
|
-
|
|
92
|
-
|
|
132
|
+
retailersAvailable: [{
|
|
133
|
+
id: 58,
|
|
134
|
+
name: "The Home Depot Golden"
|
|
135
|
+
}],
|
|
136
|
+
categoryName: "ILUMINACIÓN|FOCOS|LEDS",
|
|
137
|
+
upc: "120873",
|
|
138
|
+
id_article: 35319,
|
|
139
|
+
id_order: 2
|
|
140
|
+
}
|
|
93
141
|
},
|
|
94
142
|
location: {
|
|
95
143
|
product: {
|
|
@@ -130,6 +178,6 @@ ProviderProductEditionDefault.args = {
|
|
|
130
178
|
products_limit: "5000",
|
|
131
179
|
type: "Enterprise"
|
|
132
180
|
},
|
|
133
|
-
src: "https://content-management-profile.s3.amazonaws.com/id-28/28.png?
|
|
181
|
+
src: "https://content-management-profile.s3.amazonaws.com/id-28/28.png?1655246340910"
|
|
134
182
|
}
|
|
135
183
|
};
|
|
@@ -439,6 +439,11 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
439
439
|
modalViewTextArea = _useState78[0],
|
|
440
440
|
setModalViewTextArea = _useState78[1];
|
|
441
441
|
|
|
442
|
+
var _useState79 = (0, _react.useState)(null),
|
|
443
|
+
_useState80 = (0, _slicedToArray2.default)(_useState79, 2),
|
|
444
|
+
socketType = _useState80[0],
|
|
445
|
+
setSocketType = _useState80[1];
|
|
446
|
+
|
|
442
447
|
(0, _react.useEffect)(function () {
|
|
443
448
|
checkAll && setSelectedImages(images.values);
|
|
444
449
|
}, [checkAll]);
|
|
@@ -538,9 +543,10 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
538
543
|
|
|
539
544
|
var isRevision = function isRevision() {
|
|
540
545
|
if (productEdit) {
|
|
541
|
-
var
|
|
546
|
+
var _concept = getConcept(activeTab);
|
|
547
|
+
|
|
542
548
|
var _isRetailer = user.is_retailer;
|
|
543
|
-
var currentService = productEdit === null || productEdit === void 0 ? void 0 : productEdit.product["".concat(
|
|
549
|
+
var currentService = productEdit === null || productEdit === void 0 ? void 0 : productEdit.product["".concat(_concept, "_status")];
|
|
544
550
|
var orgn = origin[activeTab];
|
|
545
551
|
|
|
546
552
|
var _revision = ["RequestWithContentoh", "RequestWithoutContentoh", "Contentoh"].includes(orgn);
|
|
@@ -684,15 +690,9 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
684
690
|
}, [activeRetailer, services]);
|
|
685
691
|
|
|
686
692
|
var thumbs = function thumbs() {
|
|
687
|
-
var _images$
|
|
693
|
+
var _images$imageType, _images$imagePackagin, _images$values;
|
|
688
694
|
|
|
689
|
-
var imageInputs =
|
|
690
|
-
return {
|
|
691
|
-
value: e === null || e === void 0 ? void 0 : e.id,
|
|
692
|
-
name: e === null || e === void 0 ? void 0 : e.name,
|
|
693
|
-
required: e === null || e === void 0 ? void 0 : e.required
|
|
694
|
-
};
|
|
695
|
-
});
|
|
695
|
+
var imageInputs = socketType.slice();
|
|
696
696
|
var imageType = images === null || images === void 0 ? void 0 : (_images$imageType = images.imageType) === null || _images$imageType === void 0 ? void 0 : _images$imageType.map(function (e) {
|
|
697
697
|
return {
|
|
698
698
|
value: e === null || e === void 0 ? void 0 : e.id,
|
|
@@ -723,6 +723,22 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
723
723
|
});
|
|
724
724
|
};
|
|
725
725
|
|
|
726
|
+
(0, _react.useEffect)(function () {
|
|
727
|
+
var _images$inputs;
|
|
728
|
+
|
|
729
|
+
var imageInputs = images === null || images === void 0 ? void 0 : (_images$inputs = images.inputs) === null || _images$inputs === void 0 ? void 0 : _images$inputs.map(function (e) {
|
|
730
|
+
return {
|
|
731
|
+
value: e === null || e === void 0 ? void 0 : e.id,
|
|
732
|
+
name: e === null || e === void 0 ? void 0 : e.name,
|
|
733
|
+
required: e === null || e === void 0 ? void 0 : e.required,
|
|
734
|
+
active: images === null || images === void 0 ? void 0 : images.values.some(function (value) {
|
|
735
|
+
return (value === null || value === void 0 ? void 0 : value.image_id) === (e === null || e === void 0 ? void 0 : e.id);
|
|
736
|
+
})
|
|
737
|
+
};
|
|
738
|
+
});
|
|
739
|
+
setSocketType(imageInputs);
|
|
740
|
+
}, [images]);
|
|
741
|
+
|
|
726
742
|
var saveDescriptions = /*#__PURE__*/function () {
|
|
727
743
|
var _ref7 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6() {
|
|
728
744
|
var productTemp, dataObject;
|
|
@@ -1535,7 +1551,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1535
1551
|
|
|
1536
1552
|
var sendEvaluation = /*#__PURE__*/function () {
|
|
1537
1553
|
var _ref14 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee13(result) {
|
|
1538
|
-
var data, retailerId, _product$id_order2, _product$id_order3,
|
|
1554
|
+
var data, retailerId, productTemp, _product$id_order2, _product$id_order3, _concept2;
|
|
1539
1555
|
|
|
1540
1556
|
return _regenerator.default.wrap(function _callee13$(_context13) {
|
|
1541
1557
|
while (1) {
|
|
@@ -1543,9 +1559,10 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1543
1559
|
case 0:
|
|
1544
1560
|
data = {};
|
|
1545
1561
|
retailerId = activeRetailer === null || activeRetailer === void 0 ? void 0 : activeRetailer.id;
|
|
1562
|
+
productTemp = product;
|
|
1546
1563
|
|
|
1547
1564
|
if (!result) {
|
|
1548
|
-
_context13.next =
|
|
1565
|
+
_context13.next = 10;
|
|
1549
1566
|
break;
|
|
1550
1567
|
}
|
|
1551
1568
|
|
|
@@ -1556,25 +1573,25 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1556
1573
|
result: result,
|
|
1557
1574
|
retailerId: retailerId
|
|
1558
1575
|
};
|
|
1559
|
-
|
|
1576
|
+
productTemp["".concat(concept, "_status")] = "".concat(result, "P");
|
|
1577
|
+
_context13.next = 8;
|
|
1560
1578
|
return _axios.default.put("".concat(process.env.REACT_APP_EVALUATION_ENDPOINT), data, {
|
|
1561
1579
|
headers: {
|
|
1562
1580
|
Authorization: token
|
|
1563
1581
|
}
|
|
1564
1582
|
});
|
|
1565
1583
|
|
|
1566
|
-
case
|
|
1567
|
-
_context13.next =
|
|
1584
|
+
case 8:
|
|
1585
|
+
_context13.next = 18;
|
|
1568
1586
|
break;
|
|
1569
1587
|
|
|
1570
|
-
case
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
_productTemp["".concat(concept, "_status")] = "Evaluated";
|
|
1588
|
+
case 10:
|
|
1589
|
+
_concept2 = getConcept(activeTab);
|
|
1590
|
+
productTemp["".concat(_concept2, "_status")] = "Evaluated";
|
|
1574
1591
|
data = {
|
|
1575
1592
|
articleId: product.id_article,
|
|
1576
1593
|
orderId: (_product$id_order3 = product.id_order) !== null && _product$id_order3 !== void 0 ? _product$id_order3 : product.orderId,
|
|
1577
|
-
concept:
|
|
1594
|
+
concept: _concept2,
|
|
1578
1595
|
retailerId: retailerId
|
|
1579
1596
|
};
|
|
1580
1597
|
|
|
@@ -1584,26 +1601,26 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1584
1601
|
}
|
|
1585
1602
|
});
|
|
1586
1603
|
|
|
1587
|
-
setProduct(
|
|
1604
|
+
setProduct(productTemp);
|
|
1588
1605
|
setProductEdit({
|
|
1589
|
-
ArticleId:
|
|
1590
|
-
idCategory:
|
|
1591
|
-
product:
|
|
1606
|
+
ArticleId: productTemp.id_article,
|
|
1607
|
+
idCategory: productTemp.article.id_category,
|
|
1608
|
+
product: productTemp
|
|
1592
1609
|
});
|
|
1593
1610
|
sessionStorage.setItem("productEdit", JSON.stringify({
|
|
1594
|
-
ArticleId:
|
|
1595
|
-
idCategory:
|
|
1596
|
-
product:
|
|
1611
|
+
ArticleId: productTemp.id_article,
|
|
1612
|
+
idCategory: productTemp.article.id_category,
|
|
1613
|
+
product: productTemp
|
|
1597
1614
|
}));
|
|
1598
1615
|
setOrigin(function (prev) {
|
|
1599
|
-
return (0, _objectSpread3.default)((0, _objectSpread3.default)({}, prev), {}, (0, _defineProperty2.default)({},
|
|
1616
|
+
return (0, _objectSpread3.default)((0, _objectSpread3.default)({}, prev), {}, (0, _defineProperty2.default)({}, _concept2, "Evaluated"));
|
|
1600
1617
|
});
|
|
1601
1618
|
|
|
1602
|
-
case
|
|
1619
|
+
case 18:
|
|
1603
1620
|
loadData();
|
|
1604
1621
|
showSurvey && showSurvey(confirmStatusComplete());
|
|
1605
1622
|
|
|
1606
|
-
case
|
|
1623
|
+
case 20:
|
|
1607
1624
|
case "end":
|
|
1608
1625
|
return _context13.stop();
|
|
1609
1626
|
}
|
|
@@ -1774,7 +1791,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1774
1791
|
}
|
|
1775
1792
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_FullTabsMenu.FullTabsMenu, {
|
|
1776
1793
|
tabsSections: tabsSections,
|
|
1777
|
-
status: product === null || product === void 0 ? void 0 : product.version_status,
|
|
1794
|
+
status: product["".concat(getConcept(activeTab), "_status")] || (product === null || product === void 0 ? void 0 : product.version_status),
|
|
1778
1795
|
activeTab: activeTab,
|
|
1779
1796
|
setActiveTab: setActiveTab,
|
|
1780
1797
|
setImageLayout: setImageLayout,
|
|
@@ -42,8 +42,8 @@ RetailerProductEditionDefault.args = {
|
|
|
42
42
|
images: 1
|
|
43
43
|
},
|
|
44
44
|
orderId: 233,
|
|
45
|
-
status: "
|
|
46
|
-
datasheet_status: "
|
|
45
|
+
status: "QF",
|
|
46
|
+
datasheet_status: "QF",
|
|
47
47
|
prio: "none",
|
|
48
48
|
version: 2,
|
|
49
49
|
description_status: "QF",
|
|
@@ -79,13 +79,15 @@ RetailerProductEditionDefault.args = {
|
|
|
79
79
|
name: "Walmart Super y Superama",
|
|
80
80
|
country: "México",
|
|
81
81
|
id_region: 1,
|
|
82
|
-
active: 1
|
|
82
|
+
active: 1,
|
|
83
|
+
percentage: 100
|
|
83
84
|
}, {
|
|
84
85
|
id: 26,
|
|
85
86
|
name: "Mercado Libre",
|
|
86
87
|
country: "México",
|
|
87
88
|
id_region: 1,
|
|
88
|
-
active: 1
|
|
89
|
+
active: 1,
|
|
90
|
+
percentage: 100
|
|
89
91
|
}],
|
|
90
92
|
country: "México",
|
|
91
93
|
upc: "6545345"
|
|
@@ -97,22 +99,22 @@ RetailerProductEditionDefault.args = {
|
|
|
97
99
|
}
|
|
98
100
|
},
|
|
99
101
|
user: {
|
|
100
|
-
id_user:
|
|
101
|
-
name: "
|
|
102
|
+
id_user: 53,
|
|
103
|
+
name: "FACILITADOR ED PRUEBA",
|
|
102
104
|
last_name: "",
|
|
103
|
-
email: "
|
|
105
|
+
email: "arojas@contentoh.com",
|
|
104
106
|
position: null,
|
|
105
107
|
telephone: null,
|
|
106
108
|
country: null,
|
|
107
109
|
id_company: 2,
|
|
108
|
-
id_cognito: "
|
|
110
|
+
id_cognito: "c106e141-e221-49e8-a382-ce99385c6d88",
|
|
109
111
|
birth_Date: null,
|
|
110
112
|
about_me: null,
|
|
111
113
|
zip_code: null,
|
|
112
114
|
address: null,
|
|
113
115
|
job: null,
|
|
114
116
|
id_stripe: null,
|
|
115
|
-
id_role:
|
|
117
|
+
id_role: 5,
|
|
116
118
|
active: 1,
|
|
117
119
|
is_retailer: 0,
|
|
118
120
|
membership: {
|
|
@@ -126,6 +128,6 @@ RetailerProductEditionDefault.args = {
|
|
|
126
128
|
products_limit: "3",
|
|
127
129
|
type: "PyMES"
|
|
128
130
|
},
|
|
129
|
-
src: "https://content-management-profile.s3.amazonaws.com/id-
|
|
131
|
+
src: "https://content-management-profile.s3.amazonaws.com/id-53/53.png?1655161876316"
|
|
130
132
|
}
|
|
131
133
|
};
|
|
@@ -367,6 +367,11 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
367
367
|
statusArray = _useState64[0],
|
|
368
368
|
setStatusArray = _useState64[1];
|
|
369
369
|
|
|
370
|
+
var _useState65 = (0, _react.useState)(null),
|
|
371
|
+
_useState66 = (0, _slicedToArray2.default)(_useState65, 2),
|
|
372
|
+
socketType = _useState66[0],
|
|
373
|
+
setSocketType = _useState66[1];
|
|
374
|
+
|
|
370
375
|
(0, _react.useEffect)(function () {
|
|
371
376
|
checkAll && setSelectedImages(images.values);
|
|
372
377
|
}, [checkAll]);
|
|
@@ -629,15 +634,9 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
629
634
|
}, [activeRetailer, services]);
|
|
630
635
|
|
|
631
636
|
var thumbs = function thumbs() {
|
|
632
|
-
var _images$
|
|
637
|
+
var _images$imageType, _images$imagePackagin, _images$values;
|
|
633
638
|
|
|
634
|
-
var imageInputs =
|
|
635
|
-
return {
|
|
636
|
-
value: e === null || e === void 0 ? void 0 : e.id,
|
|
637
|
-
name: e === null || e === void 0 ? void 0 : e.name,
|
|
638
|
-
required: e === null || e === void 0 ? void 0 : e.required
|
|
639
|
-
};
|
|
640
|
-
});
|
|
639
|
+
var imageInputs = socketType.slice();
|
|
641
640
|
var imageType = images === null || images === void 0 ? void 0 : (_images$imageType = images.imageType) === null || _images$imageType === void 0 ? void 0 : _images$imageType.map(function (e) {
|
|
642
641
|
return {
|
|
643
642
|
value: e === null || e === void 0 ? void 0 : e.id,
|
|
@@ -661,6 +660,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
661
660
|
imageType: imageType,
|
|
662
661
|
imagePackagingType: imagePackagingType,
|
|
663
662
|
imageInputs: imageInputs,
|
|
663
|
+
setSocketType: setSocketType,
|
|
664
664
|
changeImage: setImages,
|
|
665
665
|
selectedImages: selectedImages,
|
|
666
666
|
setSelectedImages: setSelectedImages
|
|
@@ -777,6 +777,21 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
777
777
|
};
|
|
778
778
|
}();
|
|
779
779
|
|
|
780
|
+
(0, _react.useEffect)(function () {
|
|
781
|
+
var _images$inputs;
|
|
782
|
+
|
|
783
|
+
var imageInputs = images === null || images === void 0 ? void 0 : (_images$inputs = images.inputs) === null || _images$inputs === void 0 ? void 0 : _images$inputs.map(function (e) {
|
|
784
|
+
return {
|
|
785
|
+
value: e === null || e === void 0 ? void 0 : e.id,
|
|
786
|
+
name: e === null || e === void 0 ? void 0 : e.name,
|
|
787
|
+
required: e === null || e === void 0 ? void 0 : e.required,
|
|
788
|
+
active: images === null || images === void 0 ? void 0 : images.values.some(function (value) {
|
|
789
|
+
return (value === null || value === void 0 ? void 0 : value.image_id) === (e === null || e === void 0 ? void 0 : e.id);
|
|
790
|
+
})
|
|
791
|
+
};
|
|
792
|
+
});
|
|
793
|
+
setSocketType(imageInputs);
|
|
794
|
+
}, [images]);
|
|
780
795
|
var updateImages = (0, _react.useCallback)( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee8() {
|
|
781
796
|
var _images$values2, _product$article10, _data$articleData, _data$articleData2, _data$updateImages;
|
|
782
797
|
|
|
@@ -992,8 +1007,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
992
1007
|
};
|
|
993
1008
|
|
|
994
1009
|
var approveRejectButtons = function approveRejectButtons(action) {
|
|
995
|
-
var concept = getConcept(activeTab);
|
|
996
|
-
concept = action ? action : concept;
|
|
1010
|
+
var concept = getConcept(action || activeTab);
|
|
997
1011
|
|
|
998
1012
|
var _servicesData$filter = servicesData.filter(function (srv) {
|
|
999
1013
|
return srv.id_retailer === (activeRetailer === null || activeRetailer === void 0 ? void 0 : activeRetailer.id) && srv.service === concept;
|
|
@@ -1152,24 +1166,9 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
1152
1166
|
}();
|
|
1153
1167
|
|
|
1154
1168
|
var userAssigned = function userAssigned(tab, rol) {
|
|
1155
|
-
var concept =
|
|
1156
|
-
|
|
1157
|
-
switch (tab) {
|
|
1158
|
-
case "Ficha técnica":
|
|
1159
|
-
concept = "datasheet";
|
|
1160
|
-
break;
|
|
1161
|
-
|
|
1162
|
-
case "Imágenes":
|
|
1163
|
-
concept = "images";
|
|
1164
|
-
break;
|
|
1165
|
-
|
|
1166
|
-
default:
|
|
1167
|
-
concept = "description";
|
|
1168
|
-
break;
|
|
1169
|
-
}
|
|
1170
|
-
|
|
1169
|
+
var concept = getConcept(activeTab);
|
|
1171
1170
|
var allowedRoles = [1, 4, 5, 6, 7, 8];
|
|
1172
|
-
var validUser = allowedRoles.
|
|
1171
|
+
var validUser = allowedRoles.includes(user === null || user === void 0 ? void 0 : user.id_role);
|
|
1173
1172
|
|
|
1174
1173
|
if (!rol) {
|
|
1175
1174
|
switch (user.id_role) {
|
package/dist/index.js
CHANGED
|
@@ -602,7 +602,7 @@ Object.keys(_index45).forEach(function (key) {
|
|
|
602
602
|
});
|
|
603
603
|
});
|
|
604
604
|
|
|
605
|
-
var _index46 = require("./components/
|
|
605
|
+
var _index46 = require("./components/molecules/RetailerSelector/index");
|
|
606
606
|
|
|
607
607
|
Object.keys(_index46).forEach(function (key) {
|
|
608
608
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -615,7 +615,7 @@ Object.keys(_index46).forEach(function (key) {
|
|
|
615
615
|
});
|
|
616
616
|
});
|
|
617
617
|
|
|
618
|
-
var _index47 = require("./components/organisms/
|
|
618
|
+
var _index47 = require("./components/organisms/ChangePassword/index");
|
|
619
619
|
|
|
620
620
|
Object.keys(_index47).forEach(function (key) {
|
|
621
621
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -628,7 +628,7 @@ Object.keys(_index47).forEach(function (key) {
|
|
|
628
628
|
});
|
|
629
629
|
});
|
|
630
630
|
|
|
631
|
-
var _index48 = require("./components/organisms/
|
|
631
|
+
var _index48 = require("./components/organisms/Fullplan/index");
|
|
632
632
|
|
|
633
633
|
Object.keys(_index48).forEach(function (key) {
|
|
634
634
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -641,7 +641,7 @@ Object.keys(_index48).forEach(function (key) {
|
|
|
641
641
|
});
|
|
642
642
|
});
|
|
643
643
|
|
|
644
|
-
var _index49 = require("./components/organisms/
|
|
644
|
+
var _index49 = require("./components/organisms/FullProductNameHeader/index");
|
|
645
645
|
|
|
646
646
|
Object.keys(_index49).forEach(function (key) {
|
|
647
647
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -654,7 +654,7 @@ Object.keys(_index49).forEach(function (key) {
|
|
|
654
654
|
});
|
|
655
655
|
});
|
|
656
656
|
|
|
657
|
-
var _index50 = require("./components/organisms/
|
|
657
|
+
var _index50 = require("./components/organisms/FullTabsMenu/index");
|
|
658
658
|
|
|
659
659
|
Object.keys(_index50).forEach(function (key) {
|
|
660
660
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -667,7 +667,7 @@ Object.keys(_index50).forEach(function (key) {
|
|
|
667
667
|
});
|
|
668
668
|
});
|
|
669
669
|
|
|
670
|
-
var _index51 = require("./components/organisms/
|
|
670
|
+
var _index51 = require("./components/organisms/ImageDataTable/index");
|
|
671
671
|
|
|
672
672
|
Object.keys(_index51).forEach(function (key) {
|
|
673
673
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -680,7 +680,7 @@ Object.keys(_index51).forEach(function (key) {
|
|
|
680
680
|
});
|
|
681
681
|
});
|
|
682
682
|
|
|
683
|
-
var _index52 = require("./components/organisms/
|
|
683
|
+
var _index52 = require("./components/organisms/ImagePreviewer/index");
|
|
684
684
|
|
|
685
685
|
Object.keys(_index52).forEach(function (key) {
|
|
686
686
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -693,7 +693,7 @@ Object.keys(_index52).forEach(function (key) {
|
|
|
693
693
|
});
|
|
694
694
|
});
|
|
695
695
|
|
|
696
|
-
var _index53 = require("./components/organisms/
|
|
696
|
+
var _index53 = require("./components/organisms/ImagesGroup/index");
|
|
697
697
|
|
|
698
698
|
Object.keys(_index53).forEach(function (key) {
|
|
699
699
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -706,7 +706,7 @@ Object.keys(_index53).forEach(function (key) {
|
|
|
706
706
|
});
|
|
707
707
|
});
|
|
708
708
|
|
|
709
|
-
var _index54 = require("./components/organisms/
|
|
709
|
+
var _index54 = require("./components/organisms/InputGroup/index");
|
|
710
710
|
|
|
711
711
|
Object.keys(_index54).forEach(function (key) {
|
|
712
712
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -719,6 +719,19 @@ Object.keys(_index54).forEach(function (key) {
|
|
|
719
719
|
});
|
|
720
720
|
});
|
|
721
721
|
|
|
722
|
+
var _index55 = require("./components/organisms/ProductImageModal/index");
|
|
723
|
+
|
|
724
|
+
Object.keys(_index55).forEach(function (key) {
|
|
725
|
+
if (key === "default" || key === "__esModule") return;
|
|
726
|
+
if (key in exports && exports[key] === _index55[key]) return;
|
|
727
|
+
Object.defineProperty(exports, key, {
|
|
728
|
+
enumerable: true,
|
|
729
|
+
get: function get() {
|
|
730
|
+
return _index55[key];
|
|
731
|
+
}
|
|
732
|
+
});
|
|
733
|
+
});
|
|
734
|
+
|
|
722
735
|
var _ChangePasswordLogin = require("./components/pages/ChangePasswordLogin");
|
|
723
736
|
|
|
724
737
|
Object.keys(_ChangePasswordLogin).forEach(function (key) {
|
package/package.json
CHANGED
|
@@ -14,6 +14,7 @@ export const AsignationOption = ({
|
|
|
14
14
|
team,
|
|
15
15
|
onClick,
|
|
16
16
|
btnOnClick,
|
|
17
|
+
active,
|
|
17
18
|
}) => {
|
|
18
19
|
const iconsAsignation = {
|
|
19
20
|
assigned: (
|
|
@@ -38,6 +39,7 @@ export const AsignationOption = ({
|
|
|
38
39
|
<p className="team-label">{team}</p>
|
|
39
40
|
</div>
|
|
40
41
|
{asignationType && iconsAsignation[asignationType]}
|
|
42
|
+
{active && <div className="green-circle"></div>}
|
|
41
43
|
</Container>
|
|
42
44
|
);
|
|
43
45
|
};
|
|
@@ -3,7 +3,6 @@ import { FontFamily, GlobalColors } from "../../../global-files/variables";
|
|
|
3
3
|
|
|
4
4
|
export const Container = styled.div`
|
|
5
5
|
display: flex;
|
|
6
|
-
width: fit-content;
|
|
7
6
|
align-items: center;
|
|
8
7
|
cursor: pointer;
|
|
9
8
|
border-radius: 3px;
|
|
@@ -41,6 +40,13 @@ export const Container = styled.div`
|
|
|
41
40
|
}
|
|
42
41
|
}
|
|
43
42
|
|
|
43
|
+
.green-circle {
|
|
44
|
+
background-color: ${GlobalColors.exported};
|
|
45
|
+
width: 20px;
|
|
46
|
+
height: 20px;
|
|
47
|
+
border-radius: 50%;
|
|
48
|
+
}
|
|
49
|
+
|
|
44
50
|
button {
|
|
45
51
|
background-color: transparent;
|
|
46
52
|
cursor: pointer;
|
|
@@ -20,6 +20,7 @@ export const GalleryElement = ({
|
|
|
20
20
|
selectedImages,
|
|
21
21
|
setSelectedImages,
|
|
22
22
|
setCheckAll,
|
|
23
|
+
setSocketType,
|
|
23
24
|
}) => {
|
|
24
25
|
const [statusValidation, setStatusValidation] = useState(validation);
|
|
25
26
|
const [showValidationPanel, setShowValidationPanel] = useState(false);
|
|
@@ -76,7 +77,9 @@ export const GalleryElement = ({
|
|
|
76
77
|
<Select
|
|
77
78
|
width="100%"
|
|
78
79
|
placeholder="Tipo de toma"
|
|
79
|
-
options={imageInputs
|
|
80
|
+
options={imageInputs?.filter(
|
|
81
|
+
(img) => img.value === image.image_id || !img.active
|
|
82
|
+
)}
|
|
80
83
|
valueSelected={image.image_id}
|
|
81
84
|
onChange={(e) => {
|
|
82
85
|
changeImage({
|
|
@@ -30,7 +30,7 @@ export const RetailerSelector = ({
|
|
|
30
30
|
altText={activeRetailer?.name}
|
|
31
31
|
imageType={"medium-image"}
|
|
32
32
|
onClick={() => {
|
|
33
|
-
retailers?.length >
|
|
33
|
+
retailers?.length > 0 && setRetailersPanel(!retailersPanel);
|
|
34
34
|
if (retailersPanel)
|
|
35
35
|
document.removeEventListener("click", closeRetailersPanel, false);
|
|
36
36
|
}}
|
|
@@ -54,6 +54,7 @@ export const RetailerSelector = ({
|
|
|
54
54
|
);
|
|
55
55
|
setRetailersPanel(false);
|
|
56
56
|
}}
|
|
57
|
+
active={retailer.id === activeRetailer.id}
|
|
57
58
|
/>
|
|
58
59
|
))}
|
|
59
60
|
</div>
|
|
@@ -8,9 +8,12 @@ export const Container = styled.div`
|
|
|
8
8
|
border-bottom: 1px solid ${GlobalColors.s2};
|
|
9
9
|
|
|
10
10
|
.input-name-header {
|
|
11
|
-
overflow: auto;
|
|
11
|
+
overflow-x: auto;
|
|
12
12
|
max-width: 40%;
|
|
13
13
|
white-space: nowrap;
|
|
14
|
+
height: 23px;
|
|
15
|
+
line-height: 23px;
|
|
16
|
+
text-overflow: initial;
|
|
14
17
|
}
|
|
15
18
|
.status-asignation-info {
|
|
16
19
|
display: flex;
|
|
@@ -21,68 +21,147 @@ ProviderProductEditionDefault.args = {
|
|
|
21
21
|
category: 846,
|
|
22
22
|
version: 2,
|
|
23
23
|
productSelected: {
|
|
24
|
-
|
|
25
|
-
id_category: "
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
24
|
+
orderId: 7,
|
|
25
|
+
id_category: "684",
|
|
26
|
+
status: "RECEPTION",
|
|
27
|
+
datasheet_status: null,
|
|
28
|
+
prio: "none",
|
|
29
|
+
version: 4,
|
|
30
|
+
description_status: null,
|
|
31
|
+
images_status: null,
|
|
32
|
+
brand: null,
|
|
33
|
+
missing: {
|
|
34
|
+
datasheet: 33,
|
|
35
|
+
descriptions: 14,
|
|
36
|
+
images: 3,
|
|
37
|
+
},
|
|
38
|
+
article: {
|
|
39
|
+
category: "SALUD Y BELLEZA|CUIDADO BUCAL|PASTAS DENTALES Y ASEO BUCAL",
|
|
40
|
+
company_name: "COMPANY DEV",
|
|
41
|
+
id_category: "684",
|
|
42
|
+
id_article: 33249,
|
|
43
|
+
name: "Crema dental ",
|
|
44
|
+
timestamp: "2022-06-14T23:24:08.000Z",
|
|
45
|
+
upc: "232435",
|
|
46
|
+
},
|
|
47
|
+
retailers: [
|
|
48
|
+
{
|
|
49
|
+
id: 4,
|
|
50
|
+
name: "Walmart Super y Superama",
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
id: 9,
|
|
54
|
+
name: "Amazon",
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
id: 1013,
|
|
58
|
+
name: "Cencosud Colombia",
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
id: 2005,
|
|
62
|
+
name: "ClubCo",
|
|
63
|
+
},
|
|
64
|
+
],
|
|
65
|
+
services: {
|
|
66
|
+
datasheets: 1,
|
|
67
|
+
descriptions: 1,
|
|
68
|
+
images: 1,
|
|
69
|
+
},
|
|
34
70
|
retailersAvailable: [
|
|
35
71
|
{
|
|
36
|
-
id:
|
|
37
|
-
name: "Walmart
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
72
|
+
id: 4,
|
|
73
|
+
name: "Walmart Super y Superama",
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
id: 9,
|
|
77
|
+
name: "Amazon",
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
id: 1013,
|
|
81
|
+
name: "Cencosud Colombia",
|
|
41
82
|
},
|
|
42
83
|
{
|
|
43
|
-
id:
|
|
44
|
-
name: "
|
|
45
|
-
country: "México",
|
|
46
|
-
id_region: 1,
|
|
47
|
-
active: 1,
|
|
84
|
+
id: 2005,
|
|
85
|
+
name: "ClubCo",
|
|
48
86
|
},
|
|
49
87
|
],
|
|
50
|
-
|
|
88
|
+
id_article: 33249,
|
|
89
|
+
categoryName: "SALUD Y BELLEZA|CUIDADO BUCAL|PASTAS DENTALES Y ASEO BUCAL",
|
|
90
|
+
version_status: "RECEPTION",
|
|
51
91
|
},
|
|
52
92
|
productToEdit: {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
product:
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
id: 2,
|
|
70
|
-
name: "Walmart Mercancías Generales",
|
|
71
|
-
country: "México",
|
|
72
|
-
id_region: 1,
|
|
73
|
-
active: 1,
|
|
74
|
-
},
|
|
75
|
-
{
|
|
76
|
-
id: 3,
|
|
77
|
-
name: "Sam´s Club",
|
|
78
|
-
country: "México",
|
|
79
|
-
id_region: 1,
|
|
80
|
-
active: 1,
|
|
81
|
-
},
|
|
82
|
-
],
|
|
83
|
-
missing: {},
|
|
93
|
+
ArticleId: 33249,
|
|
94
|
+
idCategory: "684",
|
|
95
|
+
product: {
|
|
96
|
+
orderId: 7,
|
|
97
|
+
id_category: "684",
|
|
98
|
+
status: "RECEPTION",
|
|
99
|
+
datasheet_status: null,
|
|
100
|
+
prio: "none",
|
|
101
|
+
version: 4,
|
|
102
|
+
description_status: null,
|
|
103
|
+
images_status: null,
|
|
104
|
+
brand: null,
|
|
105
|
+
missing: {
|
|
106
|
+
datasheet: 33,
|
|
107
|
+
descriptions: 14,
|
|
108
|
+
images: 3,
|
|
84
109
|
},
|
|
85
|
-
|
|
110
|
+
article: {
|
|
111
|
+
category: "SALUD Y BELLEZA|CUIDADO BUCAL|PASTAS DENTALES Y ASEO BUCAL",
|
|
112
|
+
company_name: "COMPANY DEV",
|
|
113
|
+
id_category: "684",
|
|
114
|
+
id_article: 33249,
|
|
115
|
+
name: "Crema dental ",
|
|
116
|
+
timestamp: "2022-06-14T23:24:08.000Z",
|
|
117
|
+
upc: "232435",
|
|
118
|
+
},
|
|
119
|
+
retailers: [
|
|
120
|
+
{
|
|
121
|
+
id: 4,
|
|
122
|
+
name: "Walmart Super y Superama",
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
id: 9,
|
|
126
|
+
name: "Amazon",
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
id: 1013,
|
|
130
|
+
name: "Cencosud Colombia",
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
id: 2005,
|
|
134
|
+
name: "ClubCo",
|
|
135
|
+
},
|
|
136
|
+
],
|
|
137
|
+
services: {
|
|
138
|
+
datasheets: 1,
|
|
139
|
+
descriptions: 1,
|
|
140
|
+
images: 1,
|
|
141
|
+
},
|
|
142
|
+
retailersAvailable: [
|
|
143
|
+
{
|
|
144
|
+
id: 4,
|
|
145
|
+
name: "Walmart Super y Superama",
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
id: 9,
|
|
149
|
+
name: "Amazon",
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
id: 1013,
|
|
153
|
+
name: "Cencosud Colombia",
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
id: 2005,
|
|
157
|
+
name: "ClubCo",
|
|
158
|
+
},
|
|
159
|
+
],
|
|
160
|
+
id_article: 33249,
|
|
161
|
+
categoryName:
|
|
162
|
+
"SALUD Y BELLEZA|CUIDADO BUCAL|PASTAS DENTALES Y ASEO BUCAL",
|
|
163
|
+
version_status: "RECEPTION",
|
|
164
|
+
},
|
|
86
165
|
},
|
|
87
166
|
location: {
|
|
88
167
|
product: { articleId: 109485, versionId: 3 },
|
|
@@ -118,6 +197,6 @@ ProviderProductEditionDefault.args = {
|
|
|
118
197
|
products_limit: "5000",
|
|
119
198
|
type: "Enterprise",
|
|
120
199
|
},
|
|
121
|
-
src: "https://content-management-profile.s3.amazonaws.com/id-28/28.png?
|
|
200
|
+
src: "https://content-management-profile.s3.amazonaws.com/id-28/28.png?1655246340910",
|
|
122
201
|
},
|
|
123
202
|
};
|
|
@@ -192,6 +192,7 @@ export const ProviderProductEdition = ({
|
|
|
192
192
|
img: face,
|
|
193
193
|
});
|
|
194
194
|
const [modalViewTextArea, setModalViewTextArea] = useState(false);
|
|
195
|
+
const [socketType, setSocketType] = useState(null);
|
|
195
196
|
|
|
196
197
|
useEffect(() => {
|
|
197
198
|
checkAll && setSelectedImages(images.values);
|
|
@@ -224,11 +225,14 @@ export const ProviderProductEdition = ({
|
|
|
224
225
|
|
|
225
226
|
const getServices = async () => {
|
|
226
227
|
const productInOrder = product.id_order || product.orderId;
|
|
228
|
+
const idArticle = product?.id_article || product?.article?.id_article;
|
|
227
229
|
if (isRevision() || productInOrder) {
|
|
228
230
|
const servicesResponse = await axios.get(
|
|
229
|
-
`${
|
|
230
|
-
|
|
231
|
-
}&orderId=${
|
|
231
|
+
`${
|
|
232
|
+
process.env.REACT_APP_SERVICES_ENDPOINT
|
|
233
|
+
}?articleId=${idArticle}&orderId=${
|
|
234
|
+
product?.id_order ?? product.orderId
|
|
235
|
+
}&end=true`
|
|
232
236
|
);
|
|
233
237
|
const parsedResponse = JSON.parse(servicesResponse?.data?.body).data;
|
|
234
238
|
setServicesData(parsedResponse);
|
|
@@ -338,28 +342,25 @@ export const ProviderProductEdition = ({
|
|
|
338
342
|
|
|
339
343
|
useEffect(() => {
|
|
340
344
|
if (services.length > 0) {
|
|
341
|
-
if (services[0][activeRetailer
|
|
345
|
+
if (services[0][activeRetailer.id]?.data)
|
|
342
346
|
services[0][activeRetailer.id].data = Object.values(
|
|
343
347
|
services[0][activeRetailer.id].data
|
|
344
348
|
);
|
|
345
349
|
setActivePercentage(Math.round(activeRetailer?.percentage, 0));
|
|
346
350
|
|
|
347
|
-
const datagroups = services[0][activeRetailer
|
|
351
|
+
const datagroups = services[0][activeRetailer.id];
|
|
348
352
|
const inputs = services[0]?.inputs;
|
|
349
353
|
const descriptions = services[1]?.filter(
|
|
350
354
|
(service) => service?.id === activeRetailer?.id
|
|
351
355
|
);
|
|
356
|
+
console.log(services[0], "services[0]");
|
|
352
357
|
setDatasheets([datagroups, inputs]);
|
|
353
358
|
setDescriptions(descriptions);
|
|
354
359
|
}
|
|
355
360
|
}, [activeRetailer, services]);
|
|
356
361
|
|
|
357
362
|
const thumbs = () => {
|
|
358
|
-
const imageInputs =
|
|
359
|
-
value: e?.id,
|
|
360
|
-
name: e?.name,
|
|
361
|
-
required: e?.required,
|
|
362
|
-
}));
|
|
363
|
+
const imageInputs = socketType.slice();
|
|
363
364
|
const imageType = images?.imageType?.map((e) => ({
|
|
364
365
|
value: e?.id,
|
|
365
366
|
name: e?.name,
|
|
@@ -387,6 +388,16 @@ export const ProviderProductEdition = ({
|
|
|
387
388
|
));
|
|
388
389
|
};
|
|
389
390
|
|
|
391
|
+
useEffect(() => {
|
|
392
|
+
const imageInputs = images?.inputs?.map((e) => ({
|
|
393
|
+
value: e?.id,
|
|
394
|
+
name: e?.name,
|
|
395
|
+
required: e?.required,
|
|
396
|
+
active: images?.values.some((value) => value?.image_id === e?.id),
|
|
397
|
+
}));
|
|
398
|
+
setSocketType(imageInputs);
|
|
399
|
+
}, [images]);
|
|
400
|
+
|
|
390
401
|
const saveDescriptions = async () => {
|
|
391
402
|
setLoading(true);
|
|
392
403
|
const productTemp = product;
|
|
@@ -911,8 +922,9 @@ export const ProviderProductEdition = ({
|
|
|
911
922
|
sessionStorage.setItem("productSelected", JSON.stringify(productTemp));
|
|
912
923
|
};
|
|
913
924
|
|
|
914
|
-
const evaluationComplete = () => {
|
|
915
|
-
|
|
925
|
+
const evaluationComplete = (tab) => {
|
|
926
|
+
console.log(servicesData, "servicesData");
|
|
927
|
+
const concept = getConcept(tab);
|
|
916
928
|
let serv = servicesData.filter((item) => item.service === concept);
|
|
917
929
|
if (
|
|
918
930
|
["RequestWithContentoh", "RequestWithoutContentoh"].includes(
|
|
@@ -1063,6 +1075,7 @@ export const ProviderProductEdition = ({
|
|
|
1063
1075
|
};
|
|
1064
1076
|
|
|
1065
1077
|
const sendEvaluation = async (result) => {
|
|
1078
|
+
setLoading(true);
|
|
1066
1079
|
let data = {};
|
|
1067
1080
|
const retailerId = activeRetailer?.id;
|
|
1068
1081
|
if (result) {
|
|
@@ -1079,8 +1092,8 @@ export const ProviderProductEdition = ({
|
|
|
1079
1092
|
},
|
|
1080
1093
|
});
|
|
1081
1094
|
} else {
|
|
1082
|
-
const concept = getConcept(activeTab);
|
|
1083
1095
|
const productTemp = product;
|
|
1096
|
+
const concept = getConcept(activeTab);
|
|
1084
1097
|
productTemp[`${concept}_status`] = "Evaluated";
|
|
1085
1098
|
data = {
|
|
1086
1099
|
articleId: product.id_article,
|
|
@@ -1249,7 +1262,10 @@ export const ProviderProductEdition = ({
|
|
|
1249
1262
|
/>
|
|
1250
1263
|
<FullTabsMenu
|
|
1251
1264
|
tabsSections={tabsSections}
|
|
1252
|
-
status={
|
|
1265
|
+
status={
|
|
1266
|
+
product[`${getConcept(activeTab)}_status`] ||
|
|
1267
|
+
product?.version_status
|
|
1268
|
+
}
|
|
1253
1269
|
activeTab={activeTab}
|
|
1254
1270
|
setActiveTab={setActiveTab}
|
|
1255
1271
|
setImageLayout={setImageLayout}
|
|
@@ -1395,14 +1411,14 @@ export const ProviderProductEdition = ({
|
|
|
1395
1411
|
)}
|
|
1396
1412
|
<Button
|
|
1397
1413
|
buttonType={
|
|
1398
|
-
evaluationComplete() &&
|
|
1414
|
+
evaluationComplete(activeTab) &&
|
|
1399
1415
|
(productEdit.product.id_order || productEdit.product.orderId)
|
|
1400
1416
|
? "general-green-button"
|
|
1401
1417
|
: "general-button-disabled"
|
|
1402
1418
|
}
|
|
1403
1419
|
label={"Enviar evaluación"}
|
|
1404
1420
|
onClick={() => {
|
|
1405
|
-
setModalSent(true);
|
|
1421
|
+
//setModalSent(true);
|
|
1406
1422
|
sendEvaluation();
|
|
1407
1423
|
setMessage(
|
|
1408
1424
|
`¡Evaluación de ${translateConcept()} completada!`
|
|
@@ -1421,10 +1437,10 @@ export const ProviderProductEdition = ({
|
|
|
1421
1437
|
</div>
|
|
1422
1438
|
{inCart ? (
|
|
1423
1439
|
<button type="button">
|
|
1424
|
-
<Link to="/checkout">
|
|
1440
|
+
{/* <Link to="/checkout">
|
|
1425
1441
|
<p>Articulo en carrito</p>
|
|
1426
1442
|
<p>Ir a checkout</p>
|
|
1427
|
-
</Link>
|
|
1443
|
+
</Link> */}
|
|
1428
1444
|
</button>
|
|
1429
1445
|
) : (
|
|
1430
1446
|
<Button
|
|
@@ -1466,10 +1482,10 @@ export const ProviderProductEdition = ({
|
|
|
1466
1482
|
<GlobalModal
|
|
1467
1483
|
close={() => setModalSent(false)}
|
|
1468
1484
|
message={message}
|
|
1469
|
-
detail={
|
|
1470
|
-
bold={!evaluationComplete() && "Aprueba / Rechaza"}
|
|
1471
|
-
widthImg={!evaluationComplete() ? "160px" : "354px"}
|
|
1472
|
-
heightImg={!evaluationComplete() ? "84px" : "354px"}
|
|
1485
|
+
detail={""}
|
|
1486
|
+
bold={!evaluationComplete(activeTab) && "Aprueba / Rechaza"}
|
|
1487
|
+
widthImg={!evaluationComplete(activeTab) ? "160px" : "354px"}
|
|
1488
|
+
heightImg={!evaluationComplete(activeTab) ? "84px" : "354px"}
|
|
1473
1489
|
img={getSectionIcon()}
|
|
1474
1490
|
/>
|
|
1475
1491
|
)}
|
|
@@ -27,8 +27,8 @@ RetailerProductEditionDefault.args = {
|
|
|
27
27
|
images: 1,
|
|
28
28
|
},
|
|
29
29
|
orderId: 233,
|
|
30
|
-
status: "
|
|
31
|
-
datasheet_status: "
|
|
30
|
+
status: "QF",
|
|
31
|
+
datasheet_status: "QF",
|
|
32
32
|
prio: "none",
|
|
33
33
|
version: 2,
|
|
34
34
|
description_status: "QF",
|
|
@@ -67,6 +67,7 @@ RetailerProductEditionDefault.args = {
|
|
|
67
67
|
country: "México",
|
|
68
68
|
id_region: 1,
|
|
69
69
|
active: 1,
|
|
70
|
+
percentage: 100,
|
|
70
71
|
},
|
|
71
72
|
{
|
|
72
73
|
id: 26,
|
|
@@ -74,6 +75,7 @@ RetailerProductEditionDefault.args = {
|
|
|
74
75
|
country: "México",
|
|
75
76
|
id_region: 1,
|
|
76
77
|
active: 1,
|
|
78
|
+
percentage: 100,
|
|
77
79
|
},
|
|
78
80
|
],
|
|
79
81
|
country: "México",
|
|
@@ -83,22 +85,22 @@ RetailerProductEditionDefault.args = {
|
|
|
83
85
|
product: { articleId: 109485, versionId: 3 },
|
|
84
86
|
},
|
|
85
87
|
user: {
|
|
86
|
-
id_user:
|
|
87
|
-
name: "
|
|
88
|
+
id_user: 53,
|
|
89
|
+
name: "FACILITADOR ED PRUEBA",
|
|
88
90
|
last_name: "",
|
|
89
|
-
email: "
|
|
91
|
+
email: "arojas@contentoh.com",
|
|
90
92
|
position: null,
|
|
91
93
|
telephone: null,
|
|
92
94
|
country: null,
|
|
93
95
|
id_company: 2,
|
|
94
|
-
id_cognito: "
|
|
96
|
+
id_cognito: "c106e141-e221-49e8-a382-ce99385c6d88",
|
|
95
97
|
birth_Date: null,
|
|
96
98
|
about_me: null,
|
|
97
99
|
zip_code: null,
|
|
98
100
|
address: null,
|
|
99
101
|
job: null,
|
|
100
102
|
id_stripe: null,
|
|
101
|
-
id_role:
|
|
103
|
+
id_role: 5,
|
|
102
104
|
active: 1,
|
|
103
105
|
is_retailer: 0,
|
|
104
106
|
membership: {
|
|
@@ -112,6 +114,6 @@ RetailerProductEditionDefault.args = {
|
|
|
112
114
|
products_limit: "3",
|
|
113
115
|
type: "PyMES",
|
|
114
116
|
},
|
|
115
|
-
src: "https://content-management-profile.s3.amazonaws.com/id-
|
|
117
|
+
src: "https://content-management-profile.s3.amazonaws.com/id-53/53.png?1655161876316",
|
|
116
118
|
},
|
|
117
119
|
};
|
|
@@ -150,6 +150,7 @@ export const RetailerProductEdition = ({
|
|
|
150
150
|
const [loading, setLoading] = useState(true);
|
|
151
151
|
const [retailerStatus, setRetailerStatus] = useState("-");
|
|
152
152
|
const [statusArray, setStatusArray] = useState([]);
|
|
153
|
+
const [socketType, setSocketType] = useState(null);
|
|
153
154
|
|
|
154
155
|
useEffect(() => {
|
|
155
156
|
checkAll && setSelectedImages(images.values);
|
|
@@ -339,11 +340,7 @@ export const RetailerProductEdition = ({
|
|
|
339
340
|
}, [activeRetailer, services]);
|
|
340
341
|
|
|
341
342
|
const thumbs = () => {
|
|
342
|
-
const imageInputs =
|
|
343
|
-
value: e?.id,
|
|
344
|
-
name: e?.name,
|
|
345
|
-
required: e?.required,
|
|
346
|
-
}));
|
|
343
|
+
const imageInputs = socketType.slice();
|
|
347
344
|
const imageType = images?.imageType?.map((e) => ({
|
|
348
345
|
value: e?.id,
|
|
349
346
|
name: e?.name,
|
|
@@ -364,6 +361,7 @@ export const RetailerProductEdition = ({
|
|
|
364
361
|
imageType={imageType}
|
|
365
362
|
imagePackagingType={imagePackagingType}
|
|
366
363
|
imageInputs={imageInputs}
|
|
364
|
+
setSocketType={setSocketType}
|
|
367
365
|
changeImage={setImages}
|
|
368
366
|
selectedImages={selectedImages}
|
|
369
367
|
setSelectedImages={setSelectedImages}
|
|
@@ -432,6 +430,16 @@ export const RetailerProductEdition = ({
|
|
|
432
430
|
}
|
|
433
431
|
};
|
|
434
432
|
|
|
433
|
+
useEffect(() => {
|
|
434
|
+
const imageInputs = images?.inputs?.map((e) => ({
|
|
435
|
+
value: e?.id,
|
|
436
|
+
name: e?.name,
|
|
437
|
+
required: e?.required,
|
|
438
|
+
active: images?.values.some((value) => value?.image_id === e?.id),
|
|
439
|
+
}));
|
|
440
|
+
setSocketType(imageInputs);
|
|
441
|
+
}, [images]);
|
|
442
|
+
|
|
435
443
|
const updateImages = useCallback(async () => {
|
|
436
444
|
const imagesList = images?.values?.slice();
|
|
437
445
|
const imagesListTemp = imagesList?.reduce((acc, image) => {
|
|
@@ -591,8 +599,7 @@ export const RetailerProductEdition = ({
|
|
|
591
599
|
};
|
|
592
600
|
|
|
593
601
|
const approveRejectButtons = (action) => {
|
|
594
|
-
let concept = getConcept(activeTab);
|
|
595
|
-
concept = action ? action : concept;
|
|
602
|
+
let concept = getConcept(action || activeTab);
|
|
596
603
|
|
|
597
604
|
const [retailerStatus] = servicesData.filter(
|
|
598
605
|
(srv) => srv.id_retailer === activeRetailer?.id && srv.service === concept
|
|
@@ -725,22 +732,10 @@ export const RetailerProductEdition = ({
|
|
|
725
732
|
};
|
|
726
733
|
|
|
727
734
|
const userAssigned = (tab, rol) => {
|
|
728
|
-
let concept =
|
|
729
|
-
switch (tab) {
|
|
730
|
-
case "Ficha técnica":
|
|
731
|
-
concept = "datasheet";
|
|
732
|
-
break;
|
|
733
|
-
case "Imágenes":
|
|
734
|
-
concept = "images";
|
|
735
|
-
break;
|
|
736
|
-
|
|
737
|
-
default:
|
|
738
|
-
concept = "description";
|
|
739
|
-
break;
|
|
740
|
-
}
|
|
735
|
+
let concept = getConcept(activeTab);
|
|
741
736
|
|
|
742
737
|
const allowedRoles = [1, 4, 5, 6, 7, 8];
|
|
743
|
-
const validUser = allowedRoles.
|
|
738
|
+
const validUser = allowedRoles.includes(user?.id_role);
|
|
744
739
|
|
|
745
740
|
if (!rol) {
|
|
746
741
|
switch (user.id_role) {
|
package/src/index.js
CHANGED
|
@@ -47,6 +47,7 @@ export * from "./components/molecules/TableRow/index";
|
|
|
47
47
|
export * from "./components/molecules/TabsMenu/index";
|
|
48
48
|
export * from "./components/molecules/TagAndInput/index";
|
|
49
49
|
export * from "./components/molecules/VerificationCodeResetPasswordLogin/index";
|
|
50
|
+
export * from "./components/molecules/RetailerSelector/index";
|
|
50
51
|
|
|
51
52
|
//organisms
|
|
52
53
|
export * from "./components/organisms/ChangePassword/index";
|