contentoh-components-library 21.4.71 → 21.4.73
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/Avatar/index.js +2 -3
- package/dist/components/atoms/CheckBox/styles.js +1 -1
- package/dist/components/atoms/GeneralButton/styles.js +2 -6
- package/dist/components/atoms/InputFormatter/styles.js +3 -3
- package/dist/components/atoms/SliderToolTip/styles.js +1 -1
- package/dist/components/molecules/BoxAttribute/index.js +3 -3
- package/dist/components/molecules/BoxAttribute/styles.js +1 -1
- package/dist/components/molecules/BoxButtons/index.js +1 -0
- package/dist/components/molecules/CarouselImagesLogin/index.js +1 -1
- package/dist/components/molecules/HeaderTop/index.js +11 -68
- package/dist/components/molecules/SignInLogin/index.js +28 -36
- package/dist/components/molecules/StripeCardSelector/CardSelector.stories.js +2 -1
- package/dist/components/organisms/Chat/Chat.stories.js +8 -27
- package/dist/components/organisms/Chat/ContainerItems/index.js +3 -19
- package/dist/components/organisms/Chat/ContainerItems/styles.js +1 -1
- package/dist/components/organisms/Chat/ContentChat/index.js +197 -350
- package/dist/components/organisms/Chat/Footer/index.js +39 -48
- package/dist/components/organisms/Chat/index.js +4 -49
- package/dist/components/organisms/Chat/styles.js +1 -1
- package/dist/components/organisms/DashboardMetric/index.js +6 -12
- package/dist/components/organisms/FullProductNameHeader/index.js +2 -2
- package/dist/components/organisms/InputGroup/index.js +10 -1
- package/dist/components/organisms/Modal/styles.js +1 -1
- package/dist/components/organisms/VersionSelector/index.js +4 -2
- package/dist/components/pages/Dashboard/Dashboard.stories.js +36 -33
- package/dist/components/pages/Dashboard/index.js +9 -37
- package/dist/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +38 -34
- package/dist/components/pages/ProviderProductEdition/index.js +195 -182
- package/dist/components/pages/ProviderProductEdition/styles.js +1 -1
- package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +3 -7
- package/dist/components/pages/RetailerProductEdition/index.js +273 -278
- package/dist/components/pages/RetailerProductEdition/styles.js +1 -1
- package/dist/components/pages/RetailerProductEdition/utils.js +2 -61
- package/dist/global-files/data.js +3 -11
- package/dist/global-files/variables.js +1 -7
- package/dist/index.js +58 -201
- package/package.json +1 -2
- package/src/components/atoms/Avatar/index.js +2 -8
- package/src/components/atoms/CheckBox/styles.js +0 -2
- package/src/components/atoms/GeneralButton/styles.js +0 -46
- package/src/components/atoms/InputFormatter/styles.js +4 -9
- package/src/components/atoms/SliderToolTip/styles.js +1 -1
- package/src/components/atoms/TabSection/index.js +1 -1
- package/src/components/atoms/TabSection/styles.js +1 -1
- package/src/components/molecules/BoxAttribute/index.js +25 -32
- package/src/components/molecules/BoxAttribute/styles.js +1 -1
- package/src/components/molecules/BoxButtons/index.js +22 -23
- package/src/components/molecules/CarouselImagesLogin/index.js +1 -1
- package/src/components/molecules/HeaderTop/index.js +6 -52
- package/src/components/molecules/SignInLogin/index.js +11 -11
- package/src/components/molecules/StripeCardSelector/CardSelector.stories.js +2 -1
- package/src/components/molecules/TagAndInput/index.js +5 -6
- package/src/components/organisms/Chat/Chat.stories.js +7 -27
- package/src/components/organisms/Chat/ContainerItems/index.js +2 -18
- package/src/components/organisms/Chat/ContainerItems/styles.js +2 -14
- package/src/components/organisms/Chat/ContentChat/index.js +12 -88
- package/src/components/organisms/Chat/Footer/index.js +0 -11
- package/src/components/organisms/Chat/index.js +4 -46
- package/src/components/organisms/Chat/styles.js +0 -4
- package/src/components/organisms/DashboardMetric/index.js +3 -6
- package/src/components/organisms/FullProductNameHeader/index.js +1 -1
- package/src/components/organisms/InputGroup/index.js +119 -131
- package/src/components/organisms/Modal/styles.js +1 -4
- package/src/components/organisms/OrderDetail/utils/Table/utils.js +16 -6
- package/src/components/organisms/VersionSelector/index.js +2 -1
- package/src/components/pages/Dashboard/Dashboard.stories.js +38 -33
- package/src/components/pages/Dashboard/index.js +7 -36
- package/src/components/pages/ProviderProductEdition/ProviderProductEdition.stories.js +83 -110
- package/src/components/pages/ProviderProductEdition/index.js +152 -129
- package/src/components/pages/ProviderProductEdition/styles.js +1 -5
- package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +2 -6
- package/src/components/pages/RetailerProductEdition/index.js +136 -106
- package/src/components/pages/RetailerProductEdition/styles.js +0 -4
- package/src/components/pages/RetailerProductEdition/utils.js +0 -37
- package/src/global-files/data.js +16 -8
- package/src/global-files/variables.js +0 -6
- package/src/index.js +0 -11
- package/src/assets/images/Icons/infoNR.svg +0 -8
- package/src/assets/images/flagsv2/highPriority.svg +0 -3
- package/src/assets/images/flagsv2/lowPriority.svg +0 -3
- package/src/assets/images/flagsv2/mediumPriority.svg +0 -3
- package/src/assets/images/flagsv2/noPriority.svg +0 -3
- package/src/assets/images/generalButton/closeIconWhite.svg +0 -4
- package/src/assets/images/generalButton/closeIconv2.svg +0 -4
- package/src/components/atoms/CharsMissing/Wysiwyg.stories.js +0 -12
- package/src/components/atoms/CharsMissing/index.js +0 -60
- package/src/components/atoms/CharsMissing/styles.js +0 -44
- package/src/components/atoms/FeatureTagv2/FeatureTagv2.stories.js +0 -16
- package/src/components/atoms/FeatureTagv2/index.js +0 -10
- package/src/components/atoms/FeatureTagv2/styles.js +0 -56
- package/src/components/atoms/GeneralInputv2/GeneralInputv2.stories.js +0 -33
- package/src/components/atoms/GeneralInputv2/index.js +0 -155
- package/src/components/atoms/GeneralInputv2/styles.js +0 -67
- package/src/components/atoms/ImageCarousel/ImgeSlider.stories.js +0 -76
- package/src/components/atoms/ImageCarousel/index.js +0 -103
- package/src/components/atoms/ImageCarousel/styles.js +0 -79
- package/src/components/atoms/InputFormatterv2/Wysiwyg.stories.js +0 -12
- package/src/components/atoms/InputFormatterv2/index.js +0 -148
- package/src/components/atoms/InputFormatterv2/styles.js +0 -39
- package/src/components/atoms/InputImages/InputImages.stories.js +0 -19
- package/src/components/atoms/InputImages/index.js +0 -25
- package/src/components/atoms/InputImages/styles.js +0 -17
- package/src/components/atoms/NumberMandatory/NumberMandatory.stories.js +0 -19
- package/src/components/atoms/NumberMandatory/index.js +0 -16
- package/src/components/atoms/NumberMandatory/styles.js +0 -11
- package/src/components/atoms/PercentTag/PercentTag.stories.js +0 -7
- package/src/components/atoms/PercentTag/index.js +0 -9
- package/src/components/atoms/PercentTag/styles.js +0 -69
- package/src/components/atoms/PriorityFlagv2/PriorityFlagv2.stories.js +0 -20
- package/src/components/atoms/PriorityFlagv2/index.js +0 -20
- package/src/components/atoms/PriorityFlagv2/styles.js +0 -6
- package/src/components/atoms/ProductImagev2/ProductImagev2.stories.js +0 -28
- package/src/components/atoms/ProductImagev2/index.js +0 -16
- package/src/components/atoms/ProductImagev2/styles.js +0 -62
- package/src/components/atoms/Progress/Progress.stories.js +0 -25
- package/src/components/atoms/Progress/index.js +0 -74
- package/src/components/atoms/Progress/styles.js +0 -98
- package/src/components/atoms/RatingStars/RatingStars.stories.js +0 -10
- package/src/components/atoms/RatingStars/index.js +0 -31
- package/src/components/atoms/RatingStars/styles.js +0 -28
- package/src/components/atoms/RetailerCatalog/RetailerCatalog.stories.js +0 -36
- package/src/components/atoms/RetailerCatalog/index.js +0 -49
- package/src/components/atoms/RetailerCatalog/styles.js +0 -30
- package/src/components/atoms/RetailerOption/RetailerOption.stories.js +0 -15
- package/src/components/atoms/RetailerOption/index.js +0 -53
- package/src/components/atoms/RetailerOption/styles.js +0 -41
- package/src/components/atoms/RetailersList/RetailersList.stories.js +0 -33
- package/src/components/atoms/RetailersList/index.js +0 -20
- package/src/components/atoms/RetailersList/styles.js +0 -19
- package/src/components/atoms/ScreenHeaderv2/ScreenHeaderv2.stories.js +0 -53
- package/src/components/atoms/ScreenHeaderv2/index.js +0 -134
- package/src/components/atoms/ScreenHeaderv2/styles.js +0 -103
- package/src/components/atoms/Selectv2/VersionSelect.js +0 -27
- package/src/components/atoms/Selectv2/index.js +0 -35
- package/src/components/atoms/Selectv2/style.js +0 -93
- package/src/components/atoms/TabSectionv2/TabSection.stories.js +0 -25
- package/src/components/atoms/TabSectionv2/index.js +0 -9
- package/src/components/atoms/TabSectionv2/styles.js +0 -20
- package/src/components/atoms/TooltipLight/Tooltip.stories.js +0 -20
- package/src/components/atoms/TooltipLight/index.js +0 -46
- package/src/components/atoms/TooltipLight/styles.js +0 -65
- package/src/components/atoms/UserCatalog/UserCatalog.stories.js +0 -67
- package/src/components/atoms/UserCatalog/index.js +0 -100
- package/src/components/atoms/UserCatalog/styles.js +0 -24
- package/src/components/atoms/UserOption/UserOption.stories.js +0 -25
- package/src/components/atoms/UserOption/index.js +0 -95
- package/src/components/atoms/UserOption/styles.js +0 -61
- package/src/components/atoms/UserSelector/UserSelector.stories.js +0 -25
- package/src/components/atoms/UserSelector/index.js +0 -86
- package/src/components/atoms/UserSelector/styles.js +0 -55
- package/src/components/atoms/WordsMissing/Wysiwyg.stories.js +0 -12
- package/src/components/atoms/WordsMissing/index.js +0 -60
- package/src/components/atoms/WordsMissing/styles.js +0 -10
- package/src/components/molecules/AsignationInfo/AsignationInfo.stories.js +0 -17
- package/src/components/molecules/AsignationInfo/index.js +0 -108
- package/src/components/molecules/AsignationInfo/styles.js +0 -86
- package/src/components/molecules/EditionActiveImagev2/EditionActiveImagev2.stories.js +0 -12
- package/src/components/molecules/EditionActiveImagev2/index.js +0 -15
- package/src/components/molecules/EditionActiveImagev2/styles.js +0 -7
- package/src/components/molecules/FeaturesBarv2/FeaturesBarv2.stories.js +0 -20
- package/src/components/molecules/FeaturesBarv2/index.js +0 -32
- package/src/components/molecules/FeaturesBarv2/styles.js +0 -17
- package/src/components/molecules/GalleryElementv2/GalleryElementv2.stories.js +0 -30
- package/src/components/molecules/GalleryElementv2/index.js +0 -142
- package/src/components/molecules/GalleryElementv2/styles.js +0 -119
- package/src/components/molecules/GalleryHeaderv2/GalleryHeaderv2.stories.js +0 -10
- package/src/components/molecules/GalleryHeaderv2/index.js +0 -25
- package/src/components/molecules/GalleryHeaderv2/styles.js +0 -47
- package/src/components/molecules/GridItem/GridItem.stories.js +0 -126
- package/src/components/molecules/GridItem/index.js +0 -105
- package/src/components/molecules/GridItem/styles.js +0 -104
- package/src/components/molecules/HeaderItem/ColumnItem.js +0 -9
- package/src/components/molecules/HeaderItem/HeaderItem.stories.js +0 -24
- package/src/components/molecules/HeaderItem/index.js +0 -26
- package/src/components/molecules/HeaderItem/styles.js +0 -27
- package/src/components/molecules/HeaderTopv2/HeaderTopv2.stories.js +0 -10
- package/src/components/molecules/HeaderTopv2/index.js +0 -100
- package/src/components/molecules/HeaderTopv2/styles.js +0 -33
- package/src/components/molecules/ImageSelectorv2/ImageSelectorv2.stories.js +0 -46
- package/src/components/molecules/ImageSelectorv2/index.js +0 -22
- package/src/components/molecules/ImageSelectorv2/styles.js +0 -15
- package/src/components/molecules/Phase/Phase.stories.js +0 -37
- package/src/components/molecules/Phase/index.js +0 -56
- package/src/components/molecules/Phase/styles.js +0 -82
- package/src/components/molecules/ProductNameHeaderv2/ProductNameHeaderv2.stories.js +0 -37
- package/src/components/molecules/ProductNameHeaderv2/index.js +0 -12
- package/src/components/molecules/ProductNameHeaderv2/styles.js +0 -10
- package/src/components/molecules/ProductSkuStatus/ProductSkuStatus.stories.js +0 -37
- package/src/components/molecules/ProductSkuStatus/index.js +0 -26
- package/src/components/molecules/ProductSkuStatus/styles.js +0 -7
- package/src/components/molecules/RetailerSelectorv2/RetailerSelectorv2.stories.js +0 -35
- package/src/components/molecules/RetailerSelectorv2/index.js +0 -80
- package/src/components/molecules/RetailerSelectorv2/styles.js +0 -21
- package/src/components/molecules/RowItem/ColumnItem.js +0 -9
- package/src/components/molecules/RowItem/RowItem.stories.js +0 -5660
- package/src/components/molecules/RowItem/index.js +0 -45
- package/src/components/molecules/RowItem/styles.js +0 -40
- package/src/components/molecules/ServiceDataValidator/ServiceDataValidator.stories.js +0 -90
- package/src/components/molecules/ServiceDataValidator/index.js +0 -49
- package/src/components/molecules/ServiceDataValidator/styles.js +0 -36
- package/src/components/molecules/StatusRetailer/StatusAsignationInfo.stories.js +0 -17
- package/src/components/molecules/StatusRetailer/index.js +0 -55
- package/src/components/molecules/StatusRetailer/styles.js +0 -85
- package/src/components/molecules/TabsMenuv2/TabsMenuv2.stories.js +0 -19
- package/src/components/molecules/TabsMenuv2/index.js +0 -112
- package/src/components/molecules/TabsMenuv2/styles.js +0 -19
- package/src/components/molecules/TagAndInputv2/TagAndInputv2.stories.js +0 -24
- package/src/components/molecules/TagAndInputv2/index.js +0 -86
- package/src/components/molecules/TagAndInputv2/styles.js +0 -35
- package/src/components/molecules/Validation/Validation.stories.js +0 -12
- package/src/components/molecules/Validation/index.js +0 -77
- package/src/components/molecules/Validation/styles.js +0 -19
- package/src/components/molecules/VersionItemv2/VersionItemv2.stories.js +0 -14
- package/src/components/molecules/VersionItemv2/index.js +0 -59
- package/src/components/molecules/VersionItemv2/styles.js +0 -47
- package/src/components/organisms/BarButtons/BarButtons.stories.js +0 -13
- package/src/components/organisms/BarButtons/index.js +0 -150
- package/src/components/organisms/BarButtons/styles.js +0 -54
- package/src/components/organisms/Chatv2/ChatLists/ChatLists.stories.js +0 -65
- package/src/components/organisms/Chatv2/ChatLists/Rotoplas.jpeg +0 -0
- package/src/components/organisms/Chatv2/ChatLists/THD.png +0 -0
- package/src/components/organisms/Chatv2/ChatLists/index.js +0 -141
- package/src/components/organisms/Chatv2/ChatLists/styles.js +0 -162
- package/src/components/organisms/Chatv2/Chatv2.stories.js +0 -184
- package/src/components/organisms/Chatv2/ContainerItems/ContainerItems.stories.js +0 -142
- package/src/components/organisms/Chatv2/ContainerItems/index.js +0 -538
- package/src/components/organisms/Chatv2/ContainerItems/styles.js +0 -360
- package/src/components/organisms/Chatv2/ContentChat/ContentChat.stories.js +0 -102
- package/src/components/organisms/Chatv2/ContentChat/Rotoplas.jpeg +0 -0
- package/src/components/organisms/Chatv2/ContentChat/THD.png +0 -0
- package/src/components/organisms/Chatv2/ContentChat/index.js +0 -1016
- package/src/components/organisms/Chatv2/ContentChat/styles.js +0 -44
- package/src/components/organisms/Chatv2/Footer/Footer.stories.js +0 -22
- package/src/components/organisms/Chatv2/Footer/index.js +0 -668
- package/src/components/organisms/Chatv2/Footer/styles.js +0 -290
- package/src/components/organisms/Chatv2/Header/Header.stories.js +0 -66
- package/src/components/organisms/Chatv2/Header/index.js +0 -93
- package/src/components/organisms/Chatv2/Header/styles.js +0 -49
- package/src/components/organisms/Chatv2/index.js +0 -281
- package/src/components/organisms/Chatv2/styles.js +0 -85
- package/src/components/organisms/CompleteServices/CompleteServices.stories.js +0 -91
- package/src/components/organisms/CompleteServices/index.js +0 -82
- package/src/components/organisms/CompleteServices/styles.js +0 -35
- package/src/components/organisms/DragAndDropPhases/DragAndDropPhases.stories.js +0 -12
- package/src/components/organisms/DragAndDropPhases/index.js +0 -67
- package/src/components/organisms/DragAndDropPhases/styles.js +0 -20
- package/src/components/organisms/DragPrueba/DragPrueba.stories.js +0 -12
- package/src/components/organisms/DragPrueba/index.js +0 -57
- package/src/components/organisms/DragPrueba/styles.js +0 -8
- package/src/components/organisms/FullProductNamev2/FullProductNamev2.stories.js +0 -28
- package/src/components/organisms/FullProductNamev2/index.js +0 -101
- package/src/components/organisms/FullProductNamev2/styles.js +0 -49
- package/src/components/organisms/FullTabsMenuv2/FullTabsMenuv2.stories.js +0 -22
- package/src/components/organisms/FullTabsMenuv2/index.js +0 -142
- package/src/components/organisms/FullTabsMenuv2/styles.js +0 -47
- package/src/components/organisms/GridProducts/GridProducts.stories.js +0 -5485
- package/src/components/organisms/GridProducts/index.js +0 -50
- package/src/components/organisms/GridProducts/styles.js +0 -14
- package/src/components/organisms/GridProducts/utils.js +0 -111
- package/src/components/organisms/ImageDataTablev2/ImageDataTablev2.stories.js +0 -24
- package/src/components/organisms/ImageDataTablev2/index.js +0 -124
- package/src/components/organisms/ImageDataTablev2/styles.js +0 -18
- package/src/components/organisms/ImagePreviewerv2/ImagePreviewerv2.stories.js +0 -38
- package/src/components/organisms/ImagePreviewerv2/index.js +0 -22
- package/src/components/organisms/ImagePreviewerv2/styles.js +0 -7
- package/src/components/organisms/InputGroupv2/InputGroupv2.stories.js +0 -31
- package/src/components/organisms/InputGroupv2/index.js +0 -296
- package/src/components/organisms/InputGroupv2/styles.js +0 -90
- package/src/components/organisms/MandatoryBar/MandatoryBar.stories.js +0 -18
- package/src/components/organisms/MandatoryBar/index.js +0 -31
- package/src/components/organisms/MandatoryBar/styles.js +0 -12
- package/src/components/organisms/ProductImageModalv2/ProductImageModalv2.stories.js +0 -90
- package/src/components/organisms/ProductImageModalv2/index.js +0 -105
- package/src/components/organisms/ProductImageModalv2/styles.js +0 -71
- package/src/components/organisms/RenameImagesBar/RenameImagesBar.stories.js +0 -18
- package/src/components/organisms/RenameImagesBar/index.js +0 -30
- package/src/components/organisms/RenameImagesBar/styles.js +0 -12
- package/src/components/organisms/VersionSelectorv2/VersionSelectorv2.stories.js +0 -15
- package/src/components/organisms/VersionSelectorv2/index.js +0 -105
- package/src/components/organisms/VersionSelectorv2/styles.js +0 -45
- package/src/components/pages/ProductEditionv2/ProductEditionv2.stories.js +0 -213
- package/src/components/pages/ProductEditionv2/index.js +0 -1758
- package/src/components/pages/ProductEditionv2/styles.js +0 -154
|
@@ -93,14 +93,6 @@ var _VersionSelector = require("../../organisms/VersionSelector");
|
|
|
93
93
|
|
|
94
94
|
var _customHooks = require("../../../global-files/customHooks");
|
|
95
95
|
|
|
96
|
-
var _utils = require("../RetailerProductEdition/utils");
|
|
97
|
-
|
|
98
|
-
var _Modal = require("../../organisms/Modal");
|
|
99
|
-
|
|
100
|
-
var _ButtonV = require("../../atoms/ButtonV2");
|
|
101
|
-
|
|
102
|
-
var _Box = require("../../organisms/Box");
|
|
103
|
-
|
|
104
96
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
105
97
|
|
|
106
98
|
var reducerImages = function reducerImages(state, action) {
|
|
@@ -162,37 +154,29 @@ var reducerImages = function reducerImages(state, action) {
|
|
|
162
154
|
|
|
163
155
|
case "orderImages":
|
|
164
156
|
{
|
|
165
|
-
var
|
|
166
|
-
_inputsByRetailer = _state$inputsByRetail === void 0 ? {} : _state$inputsByRetail,
|
|
157
|
+
var _inputsByRetailer = state.inputsByRetailer,
|
|
167
158
|
valuesInitial = state.valuesInitial,
|
|
168
159
|
inputsInitial = state.inputsInitial,
|
|
169
160
|
inputs = state.inputs;
|
|
170
161
|
|
|
171
162
|
try {
|
|
163
|
+
var _inputsByRetailer$act;
|
|
164
|
+
|
|
172
165
|
var orderedImages = [];
|
|
173
166
|
var imageIdArray = [];
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
if (action.retailerId) {
|
|
180
|
-
var _inputsByRetailer$act;
|
|
181
|
-
|
|
182
|
-
(_inputsByRetailer$act = _inputsByRetailer[action.retailerId]) === null || _inputsByRetailer$act === void 0 ? void 0 : _inputsByRetailer$act.filter(function (input) {
|
|
183
|
-
imageIdArray.push(input.id_image);
|
|
184
|
-
valuesInitial.forEach(function (value) {
|
|
185
|
-
if (value.image_id === input.id_image) orderedImages.push(value);
|
|
186
|
-
});
|
|
167
|
+
if (action !== null && action !== void 0 && action.retailerId && !_inputsByRetailer[action.retailerId]) _inputsByRetailer[action.retailerId] = [];
|
|
168
|
+
action.retailerId && ((_inputsByRetailer$act = _inputsByRetailer[action.retailerId]) === null || _inputsByRetailer$act === void 0 ? void 0 : _inputsByRetailer$act.filter(function (input) {
|
|
169
|
+
imageIdArray.push(input.id_image);
|
|
170
|
+
valuesInitial.forEach(function (value) {
|
|
171
|
+
if (value.image_id === input.id_image) orderedImages.push(value);
|
|
187
172
|
});
|
|
188
|
-
}
|
|
189
|
-
|
|
173
|
+
}));
|
|
190
174
|
inputs = inputsInitial === null || inputsInitial === void 0 ? void 0 : inputsInitial.filter(function (input) {
|
|
191
175
|
return imageIdArray.includes(input.id);
|
|
192
176
|
});
|
|
193
177
|
values = orderedImages.length > 0 ? orderedImages : [];
|
|
194
178
|
} catch (error) {
|
|
195
|
-
console.log(
|
|
179
|
+
console.log(error);
|
|
196
180
|
}
|
|
197
181
|
|
|
198
182
|
return (0, _objectSpread3.default)((0, _objectSpread3.default)({}, state), {}, {
|
|
@@ -222,7 +206,7 @@ var myBucket = new _awsSdk.default.S3({
|
|
|
222
206
|
});
|
|
223
207
|
|
|
224
208
|
var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
225
|
-
var _product$retailers, _product$retailersAva, _location$state4, _location$state5,
|
|
209
|
+
var _product$retailers, _product$retailersAva, _location$state4, _location$state5, _datasheets$, _datasheets$$data;
|
|
226
210
|
|
|
227
211
|
var tabsSections = _ref.tabsSections,
|
|
228
212
|
_ref$productSelected = _ref.productSelected,
|
|
@@ -467,26 +451,21 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
467
451
|
validatedAll = _useState62[0],
|
|
468
452
|
setValidatedAll = _useState62[1];
|
|
469
453
|
|
|
470
|
-
var _useState63 = (0, _react.useState)(
|
|
471
|
-
_useState64 = (0, _slicedToArray2.default)(_useState63, 2),
|
|
472
|
-
showRejectModal = _useState64[0],
|
|
473
|
-
setShowRejectModal = _useState64[1];
|
|
474
|
-
|
|
475
|
-
var _useState65 = (0, _react.useState)({
|
|
454
|
+
var _useState63 = (0, _react.useState)({
|
|
476
455
|
"Ficha técnica": null,
|
|
477
456
|
Descripción: null,
|
|
478
457
|
Imágenes: null
|
|
479
458
|
}),
|
|
480
|
-
|
|
481
|
-
origin =
|
|
482
|
-
setOrigin =
|
|
459
|
+
_useState64 = (0, _slicedToArray2.default)(_useState63, 2),
|
|
460
|
+
origin = _useState64[0],
|
|
461
|
+
setOrigin = _useState64[1];
|
|
483
462
|
|
|
484
|
-
var
|
|
485
|
-
|
|
486
|
-
inCart =
|
|
487
|
-
setInCart =
|
|
463
|
+
var _useState65 = (0, _react.useState)(false),
|
|
464
|
+
_useState66 = (0, _slicedToArray2.default)(_useState65, 2),
|
|
465
|
+
inCart = _useState66[0],
|
|
466
|
+
setInCart = _useState66[1];
|
|
488
467
|
|
|
489
|
-
var
|
|
468
|
+
var _useState67 = (0, _react.useState)({
|
|
490
469
|
message: "¿Estás seguro de continuar?",
|
|
491
470
|
detail: " ".concat(user.is_retailer ? "Asegurate de haber revisado las tres secciones" : "Envíar el producto a la cadena"),
|
|
492
471
|
button1: {
|
|
@@ -501,34 +480,34 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
501
480
|
},
|
|
502
481
|
img: _defaultProfileImage.default
|
|
503
482
|
}),
|
|
483
|
+
_useState68 = (0, _slicedToArray2.default)(_useState67, 2),
|
|
484
|
+
dataGenericModal = _useState68[0],
|
|
485
|
+
setDataGenericModal = _useState68[1];
|
|
486
|
+
|
|
487
|
+
var _useState69 = (0, _react.useState)(null),
|
|
504
488
|
_useState70 = (0, _slicedToArray2.default)(_useState69, 2),
|
|
505
|
-
|
|
506
|
-
|
|
489
|
+
socketType = _useState70[0],
|
|
490
|
+
setSocketType = _useState70[1];
|
|
507
491
|
|
|
508
|
-
var _useState71 = (0, _react.useState)(
|
|
492
|
+
var _useState71 = (0, _react.useState)(loading),
|
|
509
493
|
_useState72 = (0, _slicedToArray2.default)(_useState71, 2),
|
|
510
|
-
|
|
511
|
-
|
|
494
|
+
saving = _useState72[0],
|
|
495
|
+
setSaving = _useState72[1];
|
|
512
496
|
|
|
513
|
-
var _useState73 = (0, _react.useState)(
|
|
497
|
+
var _useState73 = (0, _react.useState)(product.statusByRetailer),
|
|
514
498
|
_useState74 = (0, _slicedToArray2.default)(_useState73, 2),
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
var _useState75 = (0, _react.useState)(product.statusByRetailer),
|
|
519
|
-
_useState76 = (0, _slicedToArray2.default)(_useState75, 2),
|
|
520
|
-
retailerStatus = _useState76[0],
|
|
521
|
-
setRetailerStatus = _useState76[1];
|
|
499
|
+
retailerStatus = _useState74[0],
|
|
500
|
+
setRetailerStatus = _useState74[1];
|
|
522
501
|
|
|
523
502
|
var _useCloseModal = (0, _customHooks.useCloseModal)("version-selector"),
|
|
524
503
|
_useCloseModal2 = (0, _slicedToArray2.default)(_useCloseModal, 2),
|
|
525
504
|
showVersionSelector = _useCloseModal2[0],
|
|
526
505
|
setShowVersionSelector = _useCloseModal2[1];
|
|
527
506
|
|
|
528
|
-
var
|
|
529
|
-
|
|
530
|
-
globalModal =
|
|
531
|
-
setGlobalModal =
|
|
507
|
+
var _useState75 = (0, _react.useState)(),
|
|
508
|
+
_useState76 = (0, _slicedToArray2.default)(_useState75, 2),
|
|
509
|
+
globalModal = _useState76[0],
|
|
510
|
+
setGlobalModal = _useState76[1];
|
|
532
511
|
|
|
533
512
|
var updateAuditStatus = /*#__PURE__*/function () {
|
|
534
513
|
var _ref3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(status) {
|
|
@@ -700,6 +679,30 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
700
679
|
});
|
|
701
680
|
|
|
702
681
|
switch (type) {
|
|
682
|
+
case "error":
|
|
683
|
+
setGlobalModal({
|
|
684
|
+
message: "".concat(activeTab, " rechazada"),
|
|
685
|
+
detail: "Agrega tu comentarios para enviar el rechazo",
|
|
686
|
+
img: _errorModal.default,
|
|
687
|
+
textArea: true,
|
|
688
|
+
button1: {
|
|
689
|
+
name: "Enviar",
|
|
690
|
+
action: function action(e) {
|
|
691
|
+
var textArea = document.querySelector("#area");
|
|
692
|
+
|
|
693
|
+
if (textArea.value) {
|
|
694
|
+
textArea.style.border = "none";
|
|
695
|
+
createComment(e, textArea.value);
|
|
696
|
+
showGlobalModal("commentsSent");
|
|
697
|
+
validatedAll ? validateAll("R") : sendEvaluation("R");
|
|
698
|
+
} else {
|
|
699
|
+
textArea.style.border = "2px solid red";
|
|
700
|
+
}
|
|
701
|
+
}
|
|
702
|
+
}
|
|
703
|
+
});
|
|
704
|
+
break;
|
|
705
|
+
|
|
703
706
|
case "generic":
|
|
704
707
|
setGlobalModal(dataGenericModal);
|
|
705
708
|
break;
|
|
@@ -895,7 +898,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
895
898
|
var _ref6 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee8() {
|
|
896
899
|
var _product$article, _product$article2, _product$article3, _services$, _services$$values;
|
|
897
900
|
|
|
898
|
-
var services
|
|
901
|
+
var services;
|
|
899
902
|
return _regenerator.default.wrap(function _callee8$(_context8) {
|
|
900
903
|
while (1) {
|
|
901
904
|
switch (_context8.prev = _context8.next) {
|
|
@@ -916,20 +919,14 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
916
919
|
init: services[2]
|
|
917
920
|
});
|
|
918
921
|
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);
|
|
919
|
-
data = [(0, _objectSpread3.default)((0, _objectSpread3.default)({}, product), {}, {
|
|
920
|
-
retailersAvailable: product.retailersAvailable.map(function (_ref7) {
|
|
921
|
-
var id = _ref7.id;
|
|
922
|
-
return id;
|
|
923
|
-
})
|
|
924
|
-
})];
|
|
925
922
|
(0, _data.getPercentage)({
|
|
926
|
-
data:
|
|
923
|
+
data: [product]
|
|
927
924
|
}).then(function (res) {
|
|
928
|
-
setPercentages(res[0]);
|
|
925
|
+
return setPercentages(res[0]);
|
|
929
926
|
});
|
|
930
927
|
setLoading(false);
|
|
931
928
|
|
|
932
|
-
case
|
|
929
|
+
case 10:
|
|
933
930
|
case "end":
|
|
934
931
|
return _context8.stop();
|
|
935
932
|
}
|
|
@@ -943,7 +940,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
943
940
|
}();
|
|
944
941
|
|
|
945
942
|
var getServices = /*#__PURE__*/function () {
|
|
946
|
-
var
|
|
943
|
+
var _ref7 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee9() {
|
|
947
944
|
var _product$article4;
|
|
948
945
|
|
|
949
946
|
var productInOrder, idArticle, retailers, active, _product$id_order, _servicesResponse$dat, servicesResponse, parsedResponse, retailerResponse;
|
|
@@ -977,7 +974,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
977
974
|
setServicesData(parsedResponse);
|
|
978
975
|
|
|
979
976
|
case 12:
|
|
980
|
-
|
|
977
|
+
!activeRetailer.id && setActiveRetailer(active ? active : retailers[0]);
|
|
981
978
|
|
|
982
979
|
case 13:
|
|
983
980
|
case "end":
|
|
@@ -988,7 +985,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
988
985
|
}));
|
|
989
986
|
|
|
990
987
|
return function getServices() {
|
|
991
|
-
return
|
|
988
|
+
return _ref7.apply(this, arguments);
|
|
992
989
|
};
|
|
993
990
|
}();
|
|
994
991
|
|
|
@@ -1018,16 +1015,14 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1018
1015
|
};
|
|
1019
1016
|
|
|
1020
1017
|
var getCart = /*#__PURE__*/function () {
|
|
1021
|
-
var
|
|
1022
|
-
var _Object$values;
|
|
1023
|
-
|
|
1018
|
+
var _ref8 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee10() {
|
|
1024
1019
|
var res, arr;
|
|
1025
1020
|
return _regenerator.default.wrap(function _callee10$(_context10) {
|
|
1026
1021
|
while (1) {
|
|
1027
1022
|
switch (_context10.prev = _context10.next) {
|
|
1028
1023
|
case 0:
|
|
1029
1024
|
_context10.next = 2;
|
|
1030
|
-
return _axios.default.get(
|
|
1025
|
+
return _axios.default.get(process.env.REACT_APP_CART, {
|
|
1031
1026
|
headers: {
|
|
1032
1027
|
Authorization: token
|
|
1033
1028
|
}
|
|
@@ -1035,9 +1030,9 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1035
1030
|
|
|
1036
1031
|
case 2:
|
|
1037
1032
|
res = _context10.sent;
|
|
1038
|
-
arr =
|
|
1033
|
+
arr = JSON.parse(res.data.body).data.map(function (e) {
|
|
1039
1034
|
return e.article_id;
|
|
1040
|
-
})
|
|
1035
|
+
});
|
|
1041
1036
|
setInCart(arr.some(function (e) {
|
|
1042
1037
|
return e.articleId === product.id_article;
|
|
1043
1038
|
}));
|
|
@@ -1051,7 +1046,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1051
1046
|
}));
|
|
1052
1047
|
|
|
1053
1048
|
return function getCart() {
|
|
1054
|
-
return
|
|
1049
|
+
return _ref8.apply(this, arguments);
|
|
1055
1050
|
};
|
|
1056
1051
|
}();
|
|
1057
1052
|
|
|
@@ -1097,7 +1092,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1097
1092
|
}
|
|
1098
1093
|
|
|
1099
1094
|
setProduct(productTemp);
|
|
1100
|
-
|
|
1095
|
+
setActivePercentage((_retailers$ = retailers[0]) === null || _retailers$ === void 0 ? void 0 : _retailers$.percentage);
|
|
1101
1096
|
}, [percentages]);
|
|
1102
1097
|
|
|
1103
1098
|
var loadInputs = function loadInputs() {
|
|
@@ -1164,13 +1159,11 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1164
1159
|
var _images$inputs;
|
|
1165
1160
|
|
|
1166
1161
|
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) {
|
|
1167
|
-
var _images$values2;
|
|
1168
|
-
|
|
1169
1162
|
return {
|
|
1170
1163
|
value: e === null || e === void 0 ? void 0 : e.id,
|
|
1171
1164
|
name: e === null || e === void 0 ? void 0 : e.name,
|
|
1172
1165
|
required: e === null || e === void 0 ? void 0 : e.required,
|
|
1173
|
-
active: images === null || images === void 0 ? void 0 :
|
|
1166
|
+
active: images === null || images === void 0 ? void 0 : images.values.some(function (value) {
|
|
1174
1167
|
return (value === null || value === void 0 ? void 0 : value.image_id) === (e === null || e === void 0 ? void 0 : e.id);
|
|
1175
1168
|
})
|
|
1176
1169
|
};
|
|
@@ -1179,7 +1172,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1179
1172
|
}, [images]);
|
|
1180
1173
|
|
|
1181
1174
|
var saveDescriptions = /*#__PURE__*/function () {
|
|
1182
|
-
var
|
|
1175
|
+
var _ref9 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee11() {
|
|
1183
1176
|
var dataObject, res;
|
|
1184
1177
|
return _regenerator.default.wrap(function _callee11$(_context11) {
|
|
1185
1178
|
while (1) {
|
|
@@ -1230,21 +1223,21 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1230
1223
|
}));
|
|
1231
1224
|
|
|
1232
1225
|
return function saveDescriptions() {
|
|
1233
|
-
return
|
|
1226
|
+
return _ref9.apply(this, arguments);
|
|
1234
1227
|
};
|
|
1235
1228
|
}();
|
|
1236
1229
|
|
|
1237
1230
|
var saveDatasheets = /*#__PURE__*/function () {
|
|
1238
|
-
var
|
|
1231
|
+
var _ref10 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee12() {
|
|
1239
1232
|
var parseBoxData, dataObject, res;
|
|
1240
1233
|
return _regenerator.default.wrap(function _callee12$(_context12) {
|
|
1241
1234
|
while (1) {
|
|
1242
1235
|
switch (_context12.prev = _context12.next) {
|
|
1243
1236
|
case 0:
|
|
1244
1237
|
parseBoxData = [];
|
|
1245
|
-
Object.entries(boxData).forEach(function (
|
|
1246
|
-
var
|
|
1247
|
-
box =
|
|
1238
|
+
Object.entries(boxData).forEach(function (_ref11, index) {
|
|
1239
|
+
var _ref12 = (0, _slicedToArray2.default)(_ref11, 2),
|
|
1240
|
+
box = _ref12[1];
|
|
1248
1241
|
|
|
1249
1242
|
var value = box.value;
|
|
1250
1243
|
var attributesIds = Object.keys(value);
|
|
@@ -1296,6 +1289,9 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1296
1289
|
console.log(_context12.t0);
|
|
1297
1290
|
|
|
1298
1291
|
case 18:
|
|
1292
|
+
console.log(dataObject);
|
|
1293
|
+
|
|
1294
|
+
case 19:
|
|
1299
1295
|
case "end":
|
|
1300
1296
|
return _context12.stop();
|
|
1301
1297
|
}
|
|
@@ -1304,12 +1300,12 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1304
1300
|
}));
|
|
1305
1301
|
|
|
1306
1302
|
return function saveDatasheets() {
|
|
1307
|
-
return
|
|
1303
|
+
return _ref10.apply(this, arguments);
|
|
1308
1304
|
};
|
|
1309
1305
|
}();
|
|
1310
1306
|
|
|
1311
1307
|
var updateImages = (0, _react.useCallback)( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee13() {
|
|
1312
|
-
var _images$
|
|
1308
|
+
var _images$values2, _data$articleData, _data$articleData2, _data$updateImages;
|
|
1313
1309
|
|
|
1314
1310
|
var imagesList, imagesListTemp, duplicated, attrForImgs, data, valid, _data$updateImages2, _data$articleData3, _data$articleData4, _data$articleData5, promiseArray;
|
|
1315
1311
|
|
|
@@ -1317,7 +1313,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1317
1313
|
while (1) {
|
|
1318
1314
|
switch (_context13.prev = _context13.next) {
|
|
1319
1315
|
case 0:
|
|
1320
|
-
imagesList = images === null || images === void 0 ? void 0 : (_images$
|
|
1316
|
+
imagesList = images === null || images === void 0 ? void 0 : (_images$values2 = images.values) === null || _images$values2 === void 0 ? void 0 : _images$values2.slice();
|
|
1321
1317
|
imagesListTemp = imagesList === null || imagesList === void 0 ? void 0 : imagesList.reduce(function (acc, image) {
|
|
1322
1318
|
acc[image === null || image === void 0 ? void 0 : image.image_id] = ++acc[image === null || image === void 0 ? void 0 : image.image_id] || 0;
|
|
1323
1319
|
return acc;
|
|
@@ -1499,33 +1495,45 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1499
1495
|
};
|
|
1500
1496
|
|
|
1501
1497
|
var createComment = /*#__PURE__*/function () {
|
|
1502
|
-
var
|
|
1503
|
-
var
|
|
1504
|
-
retailerId,
|
|
1505
|
-
data,
|
|
1506
|
-
_args15 = arguments;
|
|
1498
|
+
var _ref15 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee15(e, body, tab) {
|
|
1499
|
+
var concept, data;
|
|
1507
1500
|
return _regenerator.default.wrap(function _callee15$(_context15) {
|
|
1508
1501
|
while (1) {
|
|
1509
1502
|
switch (_context15.prev = _context15.next) {
|
|
1510
1503
|
case 0:
|
|
1511
|
-
|
|
1512
|
-
|
|
1504
|
+
concept = "";
|
|
1505
|
+
_context15.t0 = activeTab;
|
|
1506
|
+
_context15.next = _context15.t0 === "Ficha técnica" ? 4 : _context15.t0 === "Imágenes" ? 6 : 8;
|
|
1507
|
+
break;
|
|
1508
|
+
|
|
1509
|
+
case 4:
|
|
1510
|
+
concept = "datasheet";
|
|
1511
|
+
return _context15.abrupt("break", 10);
|
|
1512
|
+
|
|
1513
|
+
case 6:
|
|
1514
|
+
concept = "images";
|
|
1515
|
+
return _context15.abrupt("break", 10);
|
|
1516
|
+
|
|
1517
|
+
case 8:
|
|
1518
|
+
concept = "description";
|
|
1519
|
+
return _context15.abrupt("break", 10);
|
|
1520
|
+
|
|
1521
|
+
case 10:
|
|
1513
1522
|
data = {
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1523
|
+
articleId: product === null || product === void 0 ? void 0 : product.id_article,
|
|
1524
|
+
orderId: product === null || product === void 0 ? void 0 : product.orderId,
|
|
1525
|
+
message: body,
|
|
1526
|
+
concept: concept,
|
|
1527
|
+
version: version
|
|
1528
|
+
};
|
|
1529
|
+
_context15.next = 13;
|
|
1530
|
+
return _axios.default.post("".concat(process.env.REACT_APP_COMMENTS_ENDPOINT), data, {
|
|
1531
|
+
headers: {
|
|
1522
1532
|
Authorization: token
|
|
1523
1533
|
}
|
|
1524
|
-
};
|
|
1525
|
-
setMessage("");
|
|
1526
|
-
return _context15.abrupt("return", (0, _utils.sendMessage)(data));
|
|
1534
|
+
});
|
|
1527
1535
|
|
|
1528
|
-
case
|
|
1536
|
+
case 13:
|
|
1529
1537
|
case "end":
|
|
1530
1538
|
return _context15.stop();
|
|
1531
1539
|
}
|
|
@@ -1533,8 +1541,8 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1533
1541
|
}, _callee15);
|
|
1534
1542
|
}));
|
|
1535
1543
|
|
|
1536
|
-
return function createComment() {
|
|
1537
|
-
return
|
|
1544
|
+
return function createComment(_x4, _x5, _x6) {
|
|
1545
|
+
return _ref15.apply(this, arguments);
|
|
1538
1546
|
};
|
|
1539
1547
|
}();
|
|
1540
1548
|
|
|
@@ -1543,7 +1551,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1543
1551
|
}, [activeTab]);
|
|
1544
1552
|
|
|
1545
1553
|
var commentRevised = /*#__PURE__*/function () {
|
|
1546
|
-
var
|
|
1554
|
+
var _ref16 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee16() {
|
|
1547
1555
|
var data;
|
|
1548
1556
|
return _regenerator.default.wrap(function _callee16$(_context16) {
|
|
1549
1557
|
while (1) {
|
|
@@ -1571,12 +1579,12 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1571
1579
|
}));
|
|
1572
1580
|
|
|
1573
1581
|
return function commentRevised() {
|
|
1574
|
-
return
|
|
1582
|
+
return _ref16.apply(this, arguments);
|
|
1575
1583
|
};
|
|
1576
1584
|
}();
|
|
1577
1585
|
|
|
1578
1586
|
var setAssignation = /*#__PURE__*/function () {
|
|
1579
|
-
var
|
|
1587
|
+
var _ref17 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee17(assignationType, assignationId) {
|
|
1580
1588
|
var concept, productTemp, data;
|
|
1581
1589
|
return _regenerator.default.wrap(function _callee17$(_context17) {
|
|
1582
1590
|
while (1) {
|
|
@@ -1632,19 +1640,19 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1632
1640
|
}, _callee17);
|
|
1633
1641
|
}));
|
|
1634
1642
|
|
|
1635
|
-
return function setAssignation(
|
|
1636
|
-
return
|
|
1643
|
+
return function setAssignation(_x7, _x8) {
|
|
1644
|
+
return _ref17.apply(this, arguments);
|
|
1637
1645
|
};
|
|
1638
1646
|
}();
|
|
1639
1647
|
|
|
1640
1648
|
var downloadImages = function downloadImages() {
|
|
1641
|
-
var _images$
|
|
1649
|
+
var _images$values3;
|
|
1642
1650
|
|
|
1643
1651
|
selectedImages.length > 0 ? selectedImages.forEach(function (e) {
|
|
1644
1652
|
if (e.id) {
|
|
1645
1653
|
(0, _fileSaver.saveAs)("https://".concat(process.env.REACT_APP_IMAGES_BUCKET, ".s3.amazonaws.com/").concat(e.srcDB), "".concat(product.upc || product.article.upc, "_").concat(e.name, ".").concat(e.ext));
|
|
1646
1654
|
}
|
|
1647
|
-
}) : images === null || images === void 0 ? void 0 : (_images$
|
|
1655
|
+
}) : images === null || images === void 0 ? void 0 : (_images$values3 = images.values) === null || _images$values3 === void 0 ? void 0 : _images$values3.forEach(function (e) {
|
|
1648
1656
|
if (e.id) {
|
|
1649
1657
|
(0, _fileSaver.saveAs)("https://".concat(process.env.REACT_APP_IMAGES_BUCKET, ".s3.amazonaws.com/").concat(e.srcDB), "".concat(product.upc || product.article.upc, "_").concat(e.name, ".").concat(e.ext));
|
|
1650
1658
|
}
|
|
@@ -1717,7 +1725,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1717
1725
|
};
|
|
1718
1726
|
|
|
1719
1727
|
var sendEvaluation = /*#__PURE__*/function () {
|
|
1720
|
-
var
|
|
1728
|
+
var _ref18 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee18(result) {
|
|
1721
1729
|
var _productTemp$id_order2;
|
|
1722
1730
|
|
|
1723
1731
|
var concept, productTemp, articleId, orderId, sectionStatusKey, evalStatus, data, retailerId, res, newStatuses, orderStatus, serviceStatus, newProductEdit, showSurveyByProvider, showSurveyByRetailer, _JSON$parse, newArticleStatus, newServiceStatus, newStatus, retailerStatusCopy, status;
|
|
@@ -1821,13 +1829,13 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1821
1829
|
}, _callee18, null, [[9, 33]]);
|
|
1822
1830
|
}));
|
|
1823
1831
|
|
|
1824
|
-
return function sendEvaluation(
|
|
1825
|
-
return
|
|
1832
|
+
return function sendEvaluation(_x9) {
|
|
1833
|
+
return _ref18.apply(this, arguments);
|
|
1826
1834
|
};
|
|
1827
1835
|
}();
|
|
1828
1836
|
|
|
1829
1837
|
var validateAll = /*#__PURE__*/function () {
|
|
1830
|
-
var
|
|
1838
|
+
var _ref19 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee19(result) {
|
|
1831
1839
|
var _product$id_order2, evaluationArray, conceptArray, dataGeneral, userType, productTemp, status, retailerStatusCopy;
|
|
1832
1840
|
|
|
1833
1841
|
return _regenerator.default.wrap(function _callee19$(_context19) {
|
|
@@ -1912,13 +1920,13 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1912
1920
|
}, _callee19, null, [[0, 27]]);
|
|
1913
1921
|
}));
|
|
1914
1922
|
|
|
1915
|
-
return function validateAll(
|
|
1916
|
-
return
|
|
1923
|
+
return function validateAll(_x10) {
|
|
1924
|
+
return _ref19.apply(this, arguments);
|
|
1917
1925
|
};
|
|
1918
1926
|
}();
|
|
1919
1927
|
|
|
1920
1928
|
var evaluationToRetailer = /*#__PURE__*/function () {
|
|
1921
|
-
var
|
|
1929
|
+
var _ref20 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee20(result) {
|
|
1922
1930
|
var data, prod, statusComplete;
|
|
1923
1931
|
return _regenerator.default.wrap(function _callee20$(_context20) {
|
|
1924
1932
|
while (1) {
|
|
@@ -1959,8 +1967,8 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1959
1967
|
}, _callee20);
|
|
1960
1968
|
}));
|
|
1961
1969
|
|
|
1962
|
-
return function evaluationToRetailer(
|
|
1963
|
-
return
|
|
1970
|
+
return function evaluationToRetailer(_x11) {
|
|
1971
|
+
return _ref20.apply(this, arguments);
|
|
1964
1972
|
};
|
|
1965
1973
|
}();
|
|
1966
1974
|
|
|
@@ -1971,6 +1979,8 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1971
1979
|
|
|
1972
1980
|
var enableActions = function enableActions(versionStatus) {
|
|
1973
1981
|
try {
|
|
1982
|
+
if (user.is_retailer) return false;
|
|
1983
|
+
|
|
1974
1984
|
if (versionStatus) {
|
|
1975
1985
|
return ["AP", "ACA", "RCA", null].includes(versionStatus);
|
|
1976
1986
|
}
|
|
@@ -2004,6 +2014,10 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
2004
2014
|
}];
|
|
2005
2015
|
|
|
2006
2016
|
var sendToEvaluation = function sendToEvaluation(result) {
|
|
2017
|
+
console.log({
|
|
2018
|
+
result: result
|
|
2019
|
+
});
|
|
2020
|
+
|
|
2007
2021
|
if (result === "A") {
|
|
2008
2022
|
if (origin[activeTab] === "RequestWithoutContentoh" && !user.is_retailer && (!product.id_order || !product.orderId)) {
|
|
2009
2023
|
setDataGenericModal(function (prev) {
|
|
@@ -2041,7 +2055,8 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
2041
2055
|
return;
|
|
2042
2056
|
} else if (user.is_retailer) {
|
|
2043
2057
|
if (product.id_order || product.orderId) {
|
|
2044
|
-
|
|
2058
|
+
setValidatedAll(true);
|
|
2059
|
+
showGlobalModal("error");
|
|
2045
2060
|
} else {
|
|
2046
2061
|
setDataGenericModal(function (prev) {
|
|
2047
2062
|
return (0, _objectSpread3.default)((0, _objectSpread3.default)({}, prev), {}, {
|
|
@@ -2056,7 +2071,8 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
2056
2071
|
showGlobalModal("generic");
|
|
2057
2072
|
}
|
|
2058
2073
|
} else {
|
|
2059
|
-
|
|
2074
|
+
setValidatedAll(true);
|
|
2075
|
+
showGlobalModal("error");
|
|
2060
2076
|
}
|
|
2061
2077
|
}
|
|
2062
2078
|
};
|
|
@@ -2066,7 +2082,6 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
2066
2082
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_HeaderTop.HeaderTop, {
|
|
2067
2083
|
setHeaderTop: setHeaderTop,
|
|
2068
2084
|
withChat: location === null || location === void 0 ? void 0 : (_location$state5 = location.state) === null || _location$state5 === void 0 ? void 0 : _location$state5.withChat,
|
|
2069
|
-
chatType: location === null || location === void 0 ? void 0 : (_location$state6 = location.state) === null || _location$state6 === void 0 ? void 0 : _location$state6.chatType,
|
|
2070
2085
|
productSelected: productSelected,
|
|
2071
2086
|
token: token,
|
|
2072
2087
|
activeRetailer: activeRetailer
|
|
@@ -2145,7 +2160,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
2145
2160
|
} else if (user.is_retailer) {
|
|
2146
2161
|
if (product.id_order || product.orderId) {
|
|
2147
2162
|
setValidatedAll(true);
|
|
2148
|
-
|
|
2163
|
+
showGlobalModal("error");
|
|
2149
2164
|
} else {
|
|
2150
2165
|
setDataGenericModal(function (prev) {
|
|
2151
2166
|
return (0, _objectSpread3.default)((0, _objectSpread3.default)({}, prev), {}, {
|
|
@@ -2160,15 +2175,15 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
2160
2175
|
showGlobalModal("generic");
|
|
2161
2176
|
}
|
|
2162
2177
|
} else {
|
|
2163
|
-
setShowRejectModal(true);
|
|
2164
2178
|
setValidatedAll(true);
|
|
2179
|
+
showGlobalModal("error");
|
|
2165
2180
|
}
|
|
2166
2181
|
},
|
|
2167
2182
|
approve: function approve() {
|
|
2168
2183
|
return sendToEvaluation("A");
|
|
2169
2184
|
},
|
|
2170
2185
|
reject: function reject() {
|
|
2171
|
-
|
|
2186
|
+
return sendToEvaluation("R");
|
|
2172
2187
|
}
|
|
2173
2188
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_FullTabsMenu.FullTabsMenu, {
|
|
2174
2189
|
tabsSections: tabsSections,
|
|
@@ -2247,7 +2262,6 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
2247
2262
|
setUpdatedDescriptions: setUpdatedDescriptions,
|
|
2248
2263
|
articleId: product === null || product === void 0 ? void 0 : product.id_article,
|
|
2249
2264
|
version: version,
|
|
2250
|
-
isShowbox: false,
|
|
2251
2265
|
dinamicHeight: true
|
|
2252
2266
|
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_ScreenHeader.ScreenHeader, {
|
|
2253
2267
|
text: "No cuentas con este servicio",
|
|
@@ -2266,7 +2280,52 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
2266
2280
|
headerType: "input-name-header"
|
|
2267
2281
|
}))]
|
|
2268
2282
|
})
|
|
2269
|
-
}),
|
|
2283
|
+
}), isRevision() && getSectionStatus() ? /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
2284
|
+
className: "commentary-box",
|
|
2285
|
+
children: !comment ? /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
2286
|
+
className: "commentary",
|
|
2287
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_index.TagAndInput, {
|
|
2288
|
+
label: "Caja de Comentario",
|
|
2289
|
+
inputType: "textarea",
|
|
2290
|
+
inputCols: 80,
|
|
2291
|
+
inputRows: 4,
|
|
2292
|
+
inputId: "commentary-box",
|
|
2293
|
+
index: 0
|
|
2294
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
2295
|
+
className: "buttons-box",
|
|
2296
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_GeneralButton.Button, {
|
|
2297
|
+
buttonType: "general-transparent-button",
|
|
2298
|
+
label: "Enviar comentario",
|
|
2299
|
+
onClick: function onClick(e) {
|
|
2300
|
+
return createComment(e, document.querySelector("#description-commentary-box-0 .ql-container .ql-editor > p").innerHTML, activeTab);
|
|
2301
|
+
}
|
|
2302
|
+
})
|
|
2303
|
+
})]
|
|
2304
|
+
}) : /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
2305
|
+
className: "feedback-box",
|
|
2306
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Commentary.Commentary, {
|
|
2307
|
+
comment: comment.message,
|
|
2308
|
+
reviewed: crossComment
|
|
2309
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_GeneralButton.Button, {
|
|
2310
|
+
buttonType: "circular-button accept-button",
|
|
2311
|
+
onClick: /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee21() {
|
|
2312
|
+
return _regenerator.default.wrap(function _callee21$(_context21) {
|
|
2313
|
+
while (1) {
|
|
2314
|
+
switch (_context21.prev = _context21.next) {
|
|
2315
|
+
case 0:
|
|
2316
|
+
setCrossComment(true);
|
|
2317
|
+
commentRevised();
|
|
2318
|
+
|
|
2319
|
+
case 2:
|
|
2320
|
+
case "end":
|
|
2321
|
+
return _context21.stop();
|
|
2322
|
+
}
|
|
2323
|
+
}
|
|
2324
|
+
}, _callee21);
|
|
2325
|
+
}))
|
|
2326
|
+
})]
|
|
2327
|
+
})
|
|
2328
|
+
}) : !revision && /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
2270
2329
|
className: "required-inputs-message",
|
|
2271
2330
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
2272
2331
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
|
|
@@ -2326,52 +2385,6 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
2326
2385
|
currentVersion: version,
|
|
2327
2386
|
setShowVersionSelector: setShowVersionSelector,
|
|
2328
2387
|
jwt: token
|
|
2329
|
-
}), showRejectModal && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Modal.Modal, {
|
|
2330
|
-
title: "Agregar mensaje de rechazo",
|
|
2331
|
-
show: showRejectModal,
|
|
2332
|
-
customComponent: /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.TagAndInput, {
|
|
2333
|
-
inputType: "textarea",
|
|
2334
|
-
inputId: "modal-message-box",
|
|
2335
|
-
index: 0,
|
|
2336
|
-
color: "white"
|
|
2337
|
-
}),
|
|
2338
|
-
buttons: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_ButtonV.ButtonV2, {
|
|
2339
|
-
type: "white",
|
|
2340
|
-
label: "Cancelar",
|
|
2341
|
-
size: 12,
|
|
2342
|
-
onClick: function onClick() {
|
|
2343
|
-
setShowRejectModal(false);
|
|
2344
|
-
}
|
|
2345
|
-
}, "btn-Cancelar"), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ButtonV.ButtonV2, {
|
|
2346
|
-
type: "pink",
|
|
2347
|
-
label: "Aceptar",
|
|
2348
|
-
size: 12,
|
|
2349
|
-
onClick: /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee21() {
|
|
2350
|
-
var body, messages;
|
|
2351
|
-
return _regenerator.default.wrap(function _callee21$(_context21) {
|
|
2352
|
-
while (1) {
|
|
2353
|
-
switch (_context21.prev = _context21.next) {
|
|
2354
|
-
case 0:
|
|
2355
|
-
body = document.querySelector("#modal-message-box .ql-container .ql-editor > p").innerHTML;
|
|
2356
|
-
messages = [{
|
|
2357
|
-
type: "message",
|
|
2358
|
-
value: body === null || body === void 0 ? void 0 : body.replace(/<.*?\/?>/gm, "")
|
|
2359
|
-
}];
|
|
2360
|
-
_context21.next = 4;
|
|
2361
|
-
return createComment(messages, activeRetailer.id);
|
|
2362
|
-
|
|
2363
|
-
case 4:
|
|
2364
|
-
validatedAll ? validateAll("R") : sendToEvaluation("R");
|
|
2365
|
-
setShowRejectModal(false);
|
|
2366
|
-
|
|
2367
|
-
case 6:
|
|
2368
|
-
case "end":
|
|
2369
|
-
return _context21.stop();
|
|
2370
|
-
}
|
|
2371
|
-
}
|
|
2372
|
-
}, _callee21);
|
|
2373
|
-
}))
|
|
2374
|
-
}, "btn-Aceptar")]
|
|
2375
2388
|
})]
|
|
2376
2389
|
});
|
|
2377
2390
|
};
|