contentoh-components-library 21.0.1 → 21.0.4
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/GeneralInput/index.js +1 -1
- package/dist/components/atoms/GenericModal/styles.js +1 -1
- package/dist/components/atoms/InputFormatter/index.js +2 -2
- package/dist/components/atoms/LabelToInput/index.js +0 -1
- package/dist/components/atoms/LabelToInput/style.js +1 -1
- package/dist/components/atoms/Loading/index.js +26 -0
- package/dist/components/atoms/Loading/styles.js +22 -0
- package/dist/components/atoms/ScreenHeader/index.js +1 -1
- package/dist/components/atoms/ScreenHeader/styles.js +1 -1
- package/dist/components/atoms/StatusTag/index.js +37 -2
- package/dist/components/molecules/StatusAsignationInfo/index.js +1 -1
- package/dist/components/molecules/TableHeader/index.js +1 -1
- package/dist/components/molecules/TableHeader/styles.js +1 -1
- package/dist/components/organisms/ImageDataTable/index.js +10 -10
- package/dist/components/organisms/ProductImageModal/index.js +0 -1
- package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +11 -1
- package/dist/components/pages/RetailerProductEdition/index.js +129 -118
- package/package.json +1 -1
- package/src/components/atoms/GeneralInput/index.js +2 -2
- package/src/components/atoms/GenericModal/styles.js +4 -0
- package/src/components/atoms/InputFormatter/index.js +4 -2
- package/src/components/atoms/LabelToInput/index.js +0 -1
- package/src/components/atoms/LabelToInput/style.js +5 -2
- package/src/components/atoms/Loading/index.js +12 -0
- package/src/components/atoms/Loading/styles.js +57 -0
- package/src/components/atoms/ScreenHeader/index.js +7 -3
- package/src/components/atoms/ScreenHeader/styles.js +9 -2
- package/src/components/atoms/StatusTag/index.js +30 -2
- package/src/components/molecules/StatusAsignationInfo/index.js +1 -1
- package/src/components/molecules/TableHeader/index.js +1 -1
- package/src/components/molecules/TableHeader/styles.js +5 -0
- package/src/components/organisms/ImageDataTable/index.js +18 -7
- package/src/components/organisms/ProductImageModal/index.js +0 -2
- package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +11 -1
- package/src/components/pages/RetailerProductEdition/index.js +97 -84
|
@@ -69,6 +69,10 @@ var _GenericModal = require("../../atoms/GenericModal");
|
|
|
69
69
|
|
|
70
70
|
var _ScreenHeader = require("../../atoms/ScreenHeader");
|
|
71
71
|
|
|
72
|
+
var _Loading = require("../../atoms/Loading");
|
|
73
|
+
|
|
74
|
+
var _genericModalCheck = _interopRequireDefault(require("../../../assets/images/genericModal/genericModalCheck.svg"));
|
|
75
|
+
|
|
72
76
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
73
77
|
|
|
74
78
|
var reducerImages = function reducerImages(state, action) {
|
|
@@ -119,7 +123,7 @@ var myBucket = new _awsSdk.default.S3({
|
|
|
119
123
|
});
|
|
120
124
|
|
|
121
125
|
var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
122
|
-
var _productSelected$reta, _product$
|
|
126
|
+
var _productSelected$reta, _product$services5, _product$services6, _datasheets$, _datasheets$$data, _product$services7, _product$article4, _product$services8;
|
|
123
127
|
|
|
124
128
|
var tabsSections = _ref.tabsSections,
|
|
125
129
|
_ref$productSelected = _ref.productSelected,
|
|
@@ -341,6 +345,12 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
341
345
|
setCheckAll = _useState58[1];
|
|
342
346
|
|
|
343
347
|
var isRetailer = user === null || user === void 0 ? void 0 : user.is_retailer;
|
|
348
|
+
|
|
349
|
+
var _useState59 = (0, _react.useState)(true),
|
|
350
|
+
_useState60 = (0, _slicedToArray2.default)(_useState59, 2),
|
|
351
|
+
loading = _useState60[0],
|
|
352
|
+
setLoading = _useState60[1];
|
|
353
|
+
|
|
344
354
|
(0, _react.useEffect)(function () {
|
|
345
355
|
checkAll && setSelectedImages(images.values);
|
|
346
356
|
}, [checkAll]);
|
|
@@ -368,8 +378,9 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
368
378
|
});
|
|
369
379
|
if (((_services$ = services[2]) === null || _services$ === void 0 ? void 0 : (_services$$values = _services$.values) === null || _services$$values === void 0 ? void 0 : _services$$values.length) > 0) setActiveImage(0);
|
|
370
380
|
setProduct(productSelected);
|
|
381
|
+
setLoading(false);
|
|
371
382
|
|
|
372
|
-
case
|
|
383
|
+
case 9:
|
|
373
384
|
case "end":
|
|
374
385
|
return _context2.stop();
|
|
375
386
|
}
|
|
@@ -581,7 +592,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
581
592
|
if (services.length > 0) {
|
|
582
593
|
var _services$2, _services$3;
|
|
583
594
|
|
|
584
|
-
services[0][activeRetailer.id].data = Object.values(services[0][activeRetailer.id].data);
|
|
595
|
+
if (services[0][activeRetailer.id]) services[0][activeRetailer.id].data = Object.values(services[0][activeRetailer.id].data);
|
|
585
596
|
setActivePercentage(Math.round(activeRetailer === null || activeRetailer === void 0 ? void 0 : activeRetailer.percentage, 0));
|
|
586
597
|
var datagroups = services[0][activeRetailer === null || activeRetailer === void 0 ? void 0 : activeRetailer.id];
|
|
587
598
|
var inputs = (_services$2 = services[0]) === null || _services$2 === void 0 ? void 0 : _services$2.inputs;
|
|
@@ -594,7 +605,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
594
605
|
setDatasheets([datagroups, inputs]);
|
|
595
606
|
setDescriptions(_descriptions);
|
|
596
607
|
}
|
|
597
|
-
}, [activeRetailer]);
|
|
608
|
+
}, [activeRetailer, services]);
|
|
598
609
|
|
|
599
610
|
var thumbs = function thumbs() {
|
|
600
611
|
var _images$inputs, _images$imageType, _images$imagePackagin, _images$values;
|
|
@@ -643,34 +654,37 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
643
654
|
while (1) {
|
|
644
655
|
switch (_context6.prev = _context6.next) {
|
|
645
656
|
case 0:
|
|
657
|
+
setLoading(true);
|
|
646
658
|
dataObject = {
|
|
647
659
|
articleId: productSelected === null || productSelected === void 0 ? void 0 : (_productSelected$arti6 = productSelected.article) === null || _productSelected$arti6 === void 0 ? void 0 : _productSelected$arti6.id_article,
|
|
648
660
|
articleData: updatedDescriptions
|
|
649
661
|
};
|
|
650
|
-
|
|
651
|
-
_context6.
|
|
662
|
+
if (productSelected !== null && productSelected !== void 0 && productSelected.orderId) dataObject["orderId"] = productSelected === null || productSelected === void 0 ? void 0 : productSelected.orderId;
|
|
663
|
+
_context6.prev = 3;
|
|
664
|
+
_context6.next = 6;
|
|
652
665
|
return _axios.default.put("".concat(process.env.REACT_APP_ARTICLE_DATA_ENDPOINT, "?description=true&version=").concat(version), dataObject, {
|
|
653
666
|
headers: {
|
|
654
667
|
Authorization: token
|
|
655
668
|
}
|
|
656
669
|
});
|
|
657
670
|
|
|
658
|
-
case
|
|
671
|
+
case 6:
|
|
659
672
|
setMessage("Descripciones guardadas con éxito");
|
|
660
|
-
|
|
673
|
+
loadData();
|
|
674
|
+
_context6.next = 13;
|
|
661
675
|
break;
|
|
662
676
|
|
|
663
|
-
case
|
|
664
|
-
_context6.prev =
|
|
665
|
-
_context6.t0 = _context6["catch"](
|
|
677
|
+
case 10:
|
|
678
|
+
_context6.prev = 10;
|
|
679
|
+
_context6.t0 = _context6["catch"](3);
|
|
666
680
|
console.log(_context6.t0);
|
|
667
681
|
|
|
668
|
-
case
|
|
682
|
+
case 13:
|
|
669
683
|
case "end":
|
|
670
684
|
return _context6.stop();
|
|
671
685
|
}
|
|
672
686
|
}
|
|
673
|
-
}, _callee6, null, [[
|
|
687
|
+
}, _callee6, null, [[3, 10]]);
|
|
674
688
|
}));
|
|
675
689
|
|
|
676
690
|
return function saveDescriptions() {
|
|
@@ -687,34 +701,37 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
687
701
|
while (1) {
|
|
688
702
|
switch (_context7.prev = _context7.next) {
|
|
689
703
|
case 0:
|
|
704
|
+
setLoading(true);
|
|
690
705
|
dataObject = {
|
|
691
706
|
articleId: productSelected === null || productSelected === void 0 ? void 0 : (_productSelected$arti7 = productSelected.article) === null || _productSelected$arti7 === void 0 ? void 0 : _productSelected$arti7.id_article,
|
|
692
707
|
articleData: updatedDatasheets
|
|
693
708
|
};
|
|
694
|
-
|
|
695
|
-
_context7.
|
|
709
|
+
if (productSelected !== null && productSelected !== void 0 && productSelected.orderId) dataObject["orderId"] = productSelected === null || productSelected === void 0 ? void 0 : productSelected.orderId;
|
|
710
|
+
_context7.prev = 3;
|
|
711
|
+
_context7.next = 6;
|
|
696
712
|
return _axios.default.put("".concat(process.env.REACT_APP_ARTICLE_DATA_ENDPOINT, "?datasheet=true&version=").concat(version), dataObject, {
|
|
697
713
|
headers: {
|
|
698
714
|
Authorization: token
|
|
699
715
|
}
|
|
700
716
|
});
|
|
701
717
|
|
|
702
|
-
case
|
|
703
|
-
setMessage("Fichas técnicas guardadas
|
|
704
|
-
|
|
718
|
+
case 6:
|
|
719
|
+
setMessage("Fichas técnicas guardadas");
|
|
720
|
+
loadData();
|
|
721
|
+
_context7.next = 13;
|
|
705
722
|
break;
|
|
706
723
|
|
|
707
|
-
case
|
|
708
|
-
_context7.prev =
|
|
709
|
-
_context7.t0 = _context7["catch"](
|
|
724
|
+
case 10:
|
|
725
|
+
_context7.prev = 10;
|
|
726
|
+
_context7.t0 = _context7["catch"](3);
|
|
710
727
|
console.log(_context7.t0);
|
|
711
728
|
|
|
712
|
-
case
|
|
729
|
+
case 13:
|
|
713
730
|
case "end":
|
|
714
731
|
return _context7.stop();
|
|
715
732
|
}
|
|
716
733
|
}
|
|
717
|
-
}, _callee7, null, [[
|
|
734
|
+
}, _callee7, null, [[3, 10]]);
|
|
718
735
|
}));
|
|
719
736
|
|
|
720
737
|
return function saveDatasheets() {
|
|
@@ -758,6 +775,7 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
758
775
|
return e.id;
|
|
759
776
|
})
|
|
760
777
|
};
|
|
778
|
+
if (productSelected !== null && productSelected !== void 0 && productSelected.orderId) data["orderId"] = productSelected === null || productSelected === void 0 ? void 0 : productSelected.orderId;
|
|
761
779
|
valid = (data === null || data === void 0 ? void 0 : (_data$articleData = data.articleData) === null || _data$articleData === void 0 ? void 0 : _data$articleData.length) === 0 ? true : data === null || data === void 0 ? void 0 : (_data$articleData2 = data.articleData) === null || _data$articleData2 === void 0 ? void 0 : _data$articleData2.every(function (e, i) {
|
|
762
780
|
if (e !== null && e !== void 0 && e.image_id && e !== null && e !== void 0 && e.packing_type && e !== null && e !== void 0 && e.image_type) {
|
|
763
781
|
return true;
|
|
@@ -777,18 +795,18 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
777
795
|
}
|
|
778
796
|
|
|
779
797
|
if (!(valid && (duplicated === null || duplicated === void 0 ? void 0 : duplicated.length) === 0)) {
|
|
780
|
-
_context8.next =
|
|
798
|
+
_context8.next = 30;
|
|
781
799
|
break;
|
|
782
800
|
}
|
|
783
801
|
|
|
784
|
-
_context8.prev =
|
|
802
|
+
_context8.prev = 10;
|
|
785
803
|
data === null || data === void 0 ? void 0 : (_data$articleData3 = data.articleData) === null || _data$articleData3 === void 0 ? void 0 : _data$articleData3.forEach(function (e) {
|
|
786
804
|
e.uuid = (0, _uuid.v4)();
|
|
787
805
|
});
|
|
788
806
|
setDataImages(data);
|
|
789
807
|
|
|
790
808
|
if (!((data === null || data === void 0 ? void 0 : (_data$articleData4 = data.articleData) === null || _data$articleData4 === void 0 ? void 0 : _data$articleData4.length) > 0)) {
|
|
791
|
-
_context8.next =
|
|
809
|
+
_context8.next = 22;
|
|
792
810
|
break;
|
|
793
811
|
}
|
|
794
812
|
|
|
@@ -804,40 +822,40 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
804
822
|
};
|
|
805
823
|
promiseArray.push(myBucket.putObject(params).promise());
|
|
806
824
|
});
|
|
807
|
-
_context8.next =
|
|
825
|
+
_context8.next = 19;
|
|
808
826
|
return Promise.all(promiseArray);
|
|
809
827
|
|
|
810
|
-
case
|
|
828
|
+
case 19:
|
|
811
829
|
setImagesUploaded(true);
|
|
812
|
-
_context8.next =
|
|
830
|
+
_context8.next = 23;
|
|
813
831
|
break;
|
|
814
832
|
|
|
815
|
-
case
|
|
833
|
+
case 22:
|
|
816
834
|
setImagesUploaded(true);
|
|
817
835
|
|
|
818
|
-
case
|
|
819
|
-
_context8.next =
|
|
836
|
+
case 23:
|
|
837
|
+
_context8.next = 28;
|
|
820
838
|
break;
|
|
821
839
|
|
|
822
|
-
case
|
|
823
|
-
_context8.prev =
|
|
824
|
-
_context8.t0 = _context8["catch"](
|
|
840
|
+
case 25:
|
|
841
|
+
_context8.prev = 25;
|
|
842
|
+
_context8.t0 = _context8["catch"](10);
|
|
825
843
|
console.log(_context8.t0); // setMainLoading(false);
|
|
826
844
|
|
|
827
|
-
case
|
|
828
|
-
_context8.next =
|
|
845
|
+
case 28:
|
|
846
|
+
_context8.next = 31;
|
|
829
847
|
break;
|
|
830
848
|
|
|
831
|
-
case
|
|
849
|
+
case 30:
|
|
832
850
|
// setMainLoading(false);
|
|
833
851
|
setMessage("Completa los campos que solicita cada una de la imágenes o hay imágenes con el mismo tipo de toma.\nRecuerda hay campos obligatorios y no podras avanzar si no estan completos.");
|
|
834
852
|
|
|
835
|
-
case
|
|
853
|
+
case 31:
|
|
836
854
|
case "end":
|
|
837
855
|
return _context8.stop();
|
|
838
856
|
}
|
|
839
857
|
}
|
|
840
|
-
}, _callee8, null, [[
|
|
858
|
+
}, _callee8, null, [[10, 25]]);
|
|
841
859
|
})), [images, imagesUploaded]);
|
|
842
860
|
(0, _react.useEffect)( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee9() {
|
|
843
861
|
return _regenerator.default.wrap(function _callee9$(_context9) {
|
|
@@ -845,41 +863,44 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
845
863
|
switch (_context9.prev = _context9.next) {
|
|
846
864
|
case 0:
|
|
847
865
|
if (!imagesUploaded) {
|
|
848
|
-
_context9.next =
|
|
866
|
+
_context9.next = 13;
|
|
849
867
|
break;
|
|
850
868
|
}
|
|
851
869
|
|
|
870
|
+
setLoading(true);
|
|
852
871
|
dataImages.articleData = dataImages === null || dataImages === void 0 ? void 0 : dataImages.articleData.map(function (e) {
|
|
853
872
|
delete e.src;
|
|
854
873
|
e.imageID = e.image_id;
|
|
855
874
|
e.packingType = e.packing_type;
|
|
856
875
|
e.imageType = e.image_type;
|
|
876
|
+
if (productSelected !== null && productSelected !== void 0 && productSelected.orderId) e["orderId"] = productSelected === null || productSelected === void 0 ? void 0 : productSelected.orderId;
|
|
857
877
|
return e;
|
|
858
878
|
});
|
|
859
|
-
_context9.prev =
|
|
860
|
-
_context9.next =
|
|
879
|
+
_context9.prev = 3;
|
|
880
|
+
_context9.next = 6;
|
|
861
881
|
return _axios.default.put("".concat(process.env.REACT_APP_ARTICLE_DATA_ENDPOINT, "?image=true&version=").concat(version), dataImages, {
|
|
862
882
|
headers: {
|
|
863
883
|
Authorization: token
|
|
864
884
|
}
|
|
865
885
|
});
|
|
866
886
|
|
|
867
|
-
case
|
|
887
|
+
case 6:
|
|
868
888
|
setMessage("Imágenes guardadas con éxito");
|
|
869
|
-
|
|
889
|
+
loadData();
|
|
890
|
+
_context9.next = 13;
|
|
870
891
|
break;
|
|
871
892
|
|
|
872
|
-
case
|
|
873
|
-
_context9.prev =
|
|
874
|
-
_context9.t0 = _context9["catch"](
|
|
893
|
+
case 10:
|
|
894
|
+
_context9.prev = 10;
|
|
895
|
+
_context9.t0 = _context9["catch"](3);
|
|
875
896
|
console.log(_context9.t0);
|
|
876
897
|
|
|
877
|
-
case
|
|
898
|
+
case 13:
|
|
878
899
|
case "end":
|
|
879
900
|
return _context9.stop();
|
|
880
901
|
}
|
|
881
902
|
}
|
|
882
|
-
}, _callee9, null, [[
|
|
903
|
+
}, _callee9, null, [[3, 10]]);
|
|
883
904
|
})), [dataImages, imagesUploaded]);
|
|
884
905
|
|
|
885
906
|
var approveRejectButtons = function approveRejectButtons(action) {
|
|
@@ -1141,30 +1162,6 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
1141
1162
|
return (productSelected === null || productSelected === void 0 ? void 0 : productSelected.article["id_auditor"]) === user.id_user;
|
|
1142
1163
|
};
|
|
1143
1164
|
|
|
1144
|
-
function specialistValid(tab) {
|
|
1145
|
-
var concept = "";
|
|
1146
|
-
|
|
1147
|
-
switch (tab) {
|
|
1148
|
-
case "Ficha técnica":
|
|
1149
|
-
concept = "datasheet";
|
|
1150
|
-
break;
|
|
1151
|
-
|
|
1152
|
-
case "Imágenes":
|
|
1153
|
-
concept = "images";
|
|
1154
|
-
break;
|
|
1155
|
-
|
|
1156
|
-
default:
|
|
1157
|
-
concept = "description";
|
|
1158
|
-
break;
|
|
1159
|
-
}
|
|
1160
|
-
|
|
1161
|
-
return product["".concat(concept, "_status")] === "IN_PROGRESS" || product["".concat(concept, "_status")] === "RF" || product["".concat(concept, "_status")] === "RA";
|
|
1162
|
-
}
|
|
1163
|
-
|
|
1164
|
-
function versionMatch() {
|
|
1165
|
-
return (productSelected === null || productSelected === void 0 ? void 0 : productSelected.version) === version;
|
|
1166
|
-
}
|
|
1167
|
-
|
|
1168
1165
|
var createComment = /*#__PURE__*/function () {
|
|
1169
1166
|
var _ref12 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee11(e, body, tab) {
|
|
1170
1167
|
var _product$article2;
|
|
@@ -1407,6 +1404,8 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
1407
1404
|
Authorization: token
|
|
1408
1405
|
}
|
|
1409
1406
|
});
|
|
1407
|
+
|
|
1408
|
+
loadData();
|
|
1410
1409
|
} catch (err) {
|
|
1411
1410
|
console.log(err);
|
|
1412
1411
|
}
|
|
@@ -1460,7 +1459,9 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
1460
1459
|
setAssignation: setAssignation,
|
|
1461
1460
|
isRetailer: isRetailer,
|
|
1462
1461
|
onClickSave: function onClickSave() {
|
|
1463
|
-
|
|
1462
|
+
var _product$services;
|
|
1463
|
+
|
|
1464
|
+
return (product === null || product === void 0 ? void 0 : (_product$services = product.services) === null || _product$services === void 0 ? void 0 : _product$services.images) === 1 && updateImages();
|
|
1464
1465
|
}
|
|
1465
1466
|
})]
|
|
1466
1467
|
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
@@ -1490,63 +1491,70 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
1490
1491
|
setAssignation: setAssignation,
|
|
1491
1492
|
isRetailer: isRetailer,
|
|
1492
1493
|
onClickSave: function onClickSave() {
|
|
1494
|
+
var _product$services2, _product$services3, _product$services4;
|
|
1495
|
+
|
|
1493
1496
|
switch (activeTab) {
|
|
1494
1497
|
case "Descripción":
|
|
1495
|
-
saveDescriptions();
|
|
1498
|
+
(product === null || product === void 0 ? void 0 : (_product$services2 = product.services) === null || _product$services2 === void 0 ? void 0 : _product$services2.descriptions) === 1 && saveDescriptions();
|
|
1496
1499
|
break;
|
|
1497
1500
|
|
|
1498
1501
|
case "Ficha técnica":
|
|
1499
|
-
saveDatasheets();
|
|
1502
|
+
(product === null || product === void 0 ? void 0 : (_product$services3 = product.services) === null || _product$services3 === void 0 ? void 0 : _product$services3.datasheets) === 1 && saveDatasheets();
|
|
1500
1503
|
break;
|
|
1501
1504
|
|
|
1502
1505
|
case "Imágenes":
|
|
1503
|
-
updateImages();
|
|
1506
|
+
(product === null || product === void 0 ? void 0 : (_product$services4 = product.services) === null || _product$services4 === void 0 ? void 0 : _product$services4.images) === 1 && updateImages();
|
|
1504
1507
|
break;
|
|
1505
1508
|
|
|
1506
1509
|
default:
|
|
1507
1510
|
break;
|
|
1508
1511
|
}
|
|
1509
1512
|
}
|
|
1510
|
-
}), /*#__PURE__*/(0, _jsxRuntime.
|
|
1513
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
1511
1514
|
className: "services-information-container " + (imageLayout && activeTab === "Imágenes" ? "image-services" : ""),
|
|
1512
|
-
children:
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1515
|
+
children: loading ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_Loading.Loading, {}) : /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
1516
|
+
children: [!imageLayout && activeTab === "Imágenes" && (product === null || product === void 0 ? void 0 : (_product$services5 = product.services) === null || _product$services5 === void 0 ? void 0 : _product$services5.images) === 1 && /*#__PURE__*/(0, _jsxRuntime.jsx)(_GalleryHeader.GalleryHeader, {
|
|
1517
|
+
setSelectedImages: setSelectedImages,
|
|
1518
|
+
checkAll: checkAll,
|
|
1519
|
+
setCheckAll: setCheckAll
|
|
1520
|
+
}), activeTab === "Ficha técnica" && ((product === null || product === void 0 ? void 0 : (_product$services6 = product.services) === null || _product$services6 === void 0 ? void 0 : _product$services6.datasheets) === 1 ? (_datasheets$ = datasheets[0]) === null || _datasheets$ === void 0 ? void 0 : (_datasheets$$data = _datasheets$.data) === null || _datasheets$$data === void 0 ? void 0 : _datasheets$$data.map(function (dataGroup, index) {
|
|
1521
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_InputGroup.InputGroup, {
|
|
1522
|
+
articleId: productSelected.article.id_article,
|
|
1523
|
+
version: version,
|
|
1524
|
+
activeSection: activeTab,
|
|
1525
|
+
inputGroup: dataGroup,
|
|
1526
|
+
dataInputs: datasheets[1],
|
|
1527
|
+
updatedDatasheets: updatedDatasheets,
|
|
1528
|
+
setUpdatedDatasheets: setUpdatedDatasheets
|
|
1529
|
+
}, index + "-" + activeRetailer.name);
|
|
1530
|
+
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_ScreenHeader.ScreenHeader, {
|
|
1531
|
+
text: "No cuentas con este servicio",
|
|
1532
|
+
headerType: "input-name-header"
|
|
1533
|
+
})), activeTab === "Descripción" && ((product === null || product === void 0 ? void 0 : (_product$services7 = product.services) === null || _product$services7 === void 0 ? void 0 : _product$services7.descriptions) === 1 ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_InputGroup.InputGroup, {
|
|
1520
1534
|
activeSection: activeTab,
|
|
1521
|
-
inputGroup:
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
}))
|
|
1543
|
-
|
|
1544
|
-
children: thumbs()
|
|
1545
|
-
})]
|
|
1546
|
-
}))
|
|
1547
|
-
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
|
|
1548
|
-
children: "no tienes este servicio"
|
|
1549
|
-
}))]
|
|
1535
|
+
inputGroup: descriptions[0],
|
|
1536
|
+
updatedDescriptions: updatedDescriptions,
|
|
1537
|
+
setUpdatedDescriptions: setUpdatedDescriptions,
|
|
1538
|
+
articleId: product === null || product === void 0 ? void 0 : (_product$article4 = product.article) === null || _product$article4 === void 0 ? void 0 : _product$article4.id_article,
|
|
1539
|
+
version: version,
|
|
1540
|
+
dinamicHeight: true
|
|
1541
|
+
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_ScreenHeader.ScreenHeader, {
|
|
1542
|
+
text: "No cuentas con este servicio",
|
|
1543
|
+
headerType: "input-name-header"
|
|
1544
|
+
})), activeTab === "Imágenes" && ((product === null || product === void 0 ? void 0 : (_product$services8 = product.services) === null || _product$services8 === void 0 ? void 0 : _product$services8.images) === 1 ? /*#__PURE__*/(0, _jsxRuntime.jsx)("section", {
|
|
1545
|
+
className: "container",
|
|
1546
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", (0, _objectSpread2.default)((0, _objectSpread2.default)({}, getRootProps({
|
|
1547
|
+
className: "dropzone"
|
|
1548
|
+
})), {}, {
|
|
1549
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("input", (0, _objectSpread2.default)({}, getInputProps())), /*#__PURE__*/(0, _jsxRuntime.jsx)("aside", {
|
|
1550
|
+
children: thumbs()
|
|
1551
|
+
})]
|
|
1552
|
+
}))
|
|
1553
|
+
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_ScreenHeader.ScreenHeader, {
|
|
1554
|
+
text: "No cuentas con este servicio",
|
|
1555
|
+
headerType: "input-name-header"
|
|
1556
|
+
}))]
|
|
1557
|
+
})
|
|
1550
1558
|
}), (userAssigned(activeTab, "especialist" || "facilitator") || auditorAssigned()) && /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
1551
1559
|
className: "commentary-box",
|
|
1552
1560
|
children: [!comment ? /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
@@ -1606,8 +1614,11 @@ var RetailerProductEdition = function RetailerProductEdition(_ref) {
|
|
|
1606
1614
|
sendToFacilitator: sendToFacilitator,
|
|
1607
1615
|
approveRejectButtons: approveRejectButtons
|
|
1608
1616
|
}), message.length > 0 && /*#__PURE__*/(0, _jsxRuntime.jsx)(_GenericModal.GenericModal, {
|
|
1609
|
-
buttonType: "delete-product",
|
|
1610
|
-
componentsArray: componentsArray.length > 0 ? componentsArray : [/*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
1617
|
+
buttonType: componentsArray.length > 0 && "delete-product",
|
|
1618
|
+
componentsArray: componentsArray.length > 0 ? componentsArray : [/*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
|
|
1619
|
+
src: _genericModalCheck.default,
|
|
1620
|
+
alt: "success icon"
|
|
1621
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ScreenHeader.ScreenHeader, {
|
|
1611
1622
|
headerType: "retailer-name-header",
|
|
1612
1623
|
text: message,
|
|
1613
1624
|
color: "white"
|
package/package.json
CHANGED
|
@@ -77,8 +77,8 @@ export const GeneralInput = ({
|
|
|
77
77
|
updatedDescriptions={updatedDatasheets}
|
|
78
78
|
setUpdatedDescriptions={setUpdatedDescriptions}
|
|
79
79
|
inputValue={inputValue?.replace(/<br>/gm, "<p><br></p>")}
|
|
80
|
-
isRequired={isRequired
|
|
81
|
-
|
|
80
|
+
isRequired={isRequired}
|
|
81
|
+
/>
|
|
82
82
|
)}
|
|
83
83
|
</Container>
|
|
84
84
|
);
|
|
@@ -20,7 +20,7 @@ export const InputFormatter = ({
|
|
|
20
20
|
setConvertedText((current) => (current = value));
|
|
21
21
|
!id.includes("commentary") &&
|
|
22
22
|
addTextAreaToArray(
|
|
23
|
-
value.replace(/<\/?p>/gm, ""),
|
|
23
|
+
value.trim().replace(/<\/?p>/gm, ""),
|
|
24
24
|
updatedDescriptions,
|
|
25
25
|
setUpdatedDescriptions
|
|
26
26
|
);
|
|
@@ -53,7 +53,9 @@ export const InputFormatter = ({
|
|
|
53
53
|
focus={focus}
|
|
54
54
|
selection={selection}
|
|
55
55
|
position={position}
|
|
56
|
-
isRequired={
|
|
56
|
+
isRequired={
|
|
57
|
+
isRequired && convertedText.replace(/<\/?p>/gm, "") === "<br>"
|
|
58
|
+
}
|
|
57
59
|
onClick={(e) => {
|
|
58
60
|
getCursorPosition(e);
|
|
59
61
|
}}
|
|
@@ -6,13 +6,13 @@ export const MainContainer = styled.div`
|
|
|
6
6
|
align-items: center;
|
|
7
7
|
width: fit-content;
|
|
8
8
|
height: 20px;
|
|
9
|
-
padding: 0 5px;
|
|
10
9
|
box-sizing: border-box;
|
|
11
10
|
border-radius: 2px;
|
|
12
|
-
margin-left:
|
|
11
|
+
margin-left: auto;
|
|
13
12
|
white-space: nowrap;
|
|
14
13
|
overflow-x: auto;
|
|
15
14
|
overflow-y: hidden;
|
|
15
|
+
|
|
16
16
|
& > p {
|
|
17
17
|
font-family: ${FontFamily.AvenirNext};
|
|
18
18
|
font-weight: 400;
|
|
@@ -22,6 +22,9 @@ export const MainContainer = styled.div`
|
|
|
22
22
|
background-color: ${GlobalColors.s2};
|
|
23
23
|
padding: 1px 3px;
|
|
24
24
|
border-radius: 3px;
|
|
25
|
+
min-width: 50px;
|
|
26
|
+
height: 21px;
|
|
27
|
+
text-align: center;
|
|
25
28
|
}
|
|
26
29
|
border: ${(props) => props.error && "1px solid red"};
|
|
27
30
|
::-webkit-scrollbar {
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Container, Loader } from "./styles";
|
|
2
|
+
export const Loading = () => {
|
|
3
|
+
return (
|
|
4
|
+
<Container>
|
|
5
|
+
<Loader>
|
|
6
|
+
<span className="first"></span>
|
|
7
|
+
<span className="second"></span>
|
|
8
|
+
<span className="third"></span>
|
|
9
|
+
</Loader>
|
|
10
|
+
</Container>
|
|
11
|
+
);
|
|
12
|
+
};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import styled from "styled-components";
|
|
2
|
+
|
|
3
|
+
export const Container = styled.div`
|
|
4
|
+
display: flex;
|
|
5
|
+
justify-content: center;
|
|
6
|
+
align-items: center;
|
|
7
|
+
height: 100%;
|
|
8
|
+
width: 100%;
|
|
9
|
+
`;
|
|
10
|
+
export const Loader = styled.div`
|
|
11
|
+
display: flex;
|
|
12
|
+
justify-content: center;
|
|
13
|
+
align-items: center;
|
|
14
|
+
height: 100%;
|
|
15
|
+
width: 100%;
|
|
16
|
+
span {
|
|
17
|
+
display: inline-block;
|
|
18
|
+
border-radius: 100%;
|
|
19
|
+
margin: 35px 5px;
|
|
20
|
+
opacity: 1;
|
|
21
|
+
}
|
|
22
|
+
.first {
|
|
23
|
+
background-color: #ff75cf;
|
|
24
|
+
}
|
|
25
|
+
.second {
|
|
26
|
+
background-color: #e33aa9;
|
|
27
|
+
}
|
|
28
|
+
.third {
|
|
29
|
+
background-color: #b12d84;
|
|
30
|
+
}
|
|
31
|
+
span:nth-child(1) {
|
|
32
|
+
width: 16px;
|
|
33
|
+
height: 16px;
|
|
34
|
+
animation: opacitychange 1s ease-in-out infinite;
|
|
35
|
+
}
|
|
36
|
+
span:nth-child(2) {
|
|
37
|
+
width: 18px;
|
|
38
|
+
height: 18px;
|
|
39
|
+
|
|
40
|
+
animation: opacitychange 1s ease-in-out 0.33s infinite;
|
|
41
|
+
}
|
|
42
|
+
span:nth-child(3) {
|
|
43
|
+
width: 20px;
|
|
44
|
+
height: 20px;
|
|
45
|
+
|
|
46
|
+
animation: opacitychange 1s ease-in-out 0.66s infinite;
|
|
47
|
+
}
|
|
48
|
+
@keyframes opacitychange {
|
|
49
|
+
0%,
|
|
50
|
+
100% {
|
|
51
|
+
opacity: 0;
|
|
52
|
+
}
|
|
53
|
+
60% {
|
|
54
|
+
opacity: 1;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
`;
|
|
@@ -8,12 +8,16 @@ export const ScreenHeader = ({
|
|
|
8
8
|
color,
|
|
9
9
|
headerType,
|
|
10
10
|
Paragraph,
|
|
11
|
-
|
|
12
11
|
}) => {
|
|
13
12
|
return (
|
|
14
|
-
<Container
|
|
13
|
+
<Container
|
|
14
|
+
fontFamily={fontFamily}
|
|
15
|
+
color={color}
|
|
16
|
+
className={headerType}
|
|
17
|
+
key={`title-${text}`}
|
|
18
|
+
>
|
|
15
19
|
{text} {boldText && <span> {boldText}</span>}
|
|
16
|
-
{<p>{Paragraph}</p>}
|
|
20
|
+
{Paragraph && <p>{Paragraph}</p>}
|
|
17
21
|
</Container>
|
|
18
22
|
);
|
|
19
23
|
};
|