contentoh-components-library 21.4.72 → 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 +196 -190
- package/dist/components/pages/ProviderProductEdition/styles.js +1 -1
- package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +53 -52
- package/dist/components/pages/RetailerProductEdition/index.js +300 -318
- package/dist/components/pages/RetailerProductEdition/styles.js +1 -1
- package/dist/components/pages/RetailerProductEdition/utils.js +2 -61
- package/dist/global-files/data.js +29 -22
- 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 -134
- package/src/components/pages/ProviderProductEdition/styles.js +1 -5
- package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +52 -52
- package/src/components/pages/RetailerProductEdition/index.js +137 -120
- package/src/components/pages/RetailerProductEdition/styles.js +0 -4
- package/src/components/pages/RetailerProductEdition/utils.js +0 -37
- package/src/global-files/data.js +46 -14
- 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;
|
|
@@ -893,9 +896,9 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
893
896
|
|
|
894
897
|
var loadData = /*#__PURE__*/function () {
|
|
895
898
|
var _ref6 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee8() {
|
|
896
|
-
var _product$article, _product$article2, _product$article3, _services$, _services$$values
|
|
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,27 +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 = [{
|
|
920
|
-
id_article: product.id_article,
|
|
921
|
-
id_category: product.id_category,
|
|
922
|
-
version: product.version,
|
|
923
|
-
id_retailer_array: ((_product$retailersAva2 = product.retailersAvailable) !== null && _product$retailersAva2 !== void 0 ? _product$retailersAva2 : product.retailers).map(function (_ref7) {
|
|
924
|
-
var id = _ref7.id;
|
|
925
|
-
return id;
|
|
926
|
-
})
|
|
927
|
-
}];
|
|
928
|
-
headers = {
|
|
929
|
-
Authorization: token
|
|
930
|
-
};
|
|
931
922
|
(0, _data.getPercentage)({
|
|
932
|
-
data:
|
|
933
|
-
headers: headers
|
|
923
|
+
data: [product]
|
|
934
924
|
}).then(function (res) {
|
|
935
|
-
setPercentages(res[0]);
|
|
925
|
+
return setPercentages(res[0]);
|
|
936
926
|
});
|
|
937
927
|
setLoading(false);
|
|
938
928
|
|
|
939
|
-
case
|
|
929
|
+
case 10:
|
|
940
930
|
case "end":
|
|
941
931
|
return _context8.stop();
|
|
942
932
|
}
|
|
@@ -950,7 +940,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
950
940
|
}();
|
|
951
941
|
|
|
952
942
|
var getServices = /*#__PURE__*/function () {
|
|
953
|
-
var
|
|
943
|
+
var _ref7 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee9() {
|
|
954
944
|
var _product$article4;
|
|
955
945
|
|
|
956
946
|
var productInOrder, idArticle, retailers, active, _product$id_order, _servicesResponse$dat, servicesResponse, parsedResponse, retailerResponse;
|
|
@@ -984,7 +974,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
984
974
|
setServicesData(parsedResponse);
|
|
985
975
|
|
|
986
976
|
case 12:
|
|
987
|
-
|
|
977
|
+
!activeRetailer.id && setActiveRetailer(active ? active : retailers[0]);
|
|
988
978
|
|
|
989
979
|
case 13:
|
|
990
980
|
case "end":
|
|
@@ -995,7 +985,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
995
985
|
}));
|
|
996
986
|
|
|
997
987
|
return function getServices() {
|
|
998
|
-
return
|
|
988
|
+
return _ref7.apply(this, arguments);
|
|
999
989
|
};
|
|
1000
990
|
}();
|
|
1001
991
|
|
|
@@ -1025,16 +1015,14 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1025
1015
|
};
|
|
1026
1016
|
|
|
1027
1017
|
var getCart = /*#__PURE__*/function () {
|
|
1028
|
-
var
|
|
1029
|
-
var _Object$values;
|
|
1030
|
-
|
|
1018
|
+
var _ref8 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee10() {
|
|
1031
1019
|
var res, arr;
|
|
1032
1020
|
return _regenerator.default.wrap(function _callee10$(_context10) {
|
|
1033
1021
|
while (1) {
|
|
1034
1022
|
switch (_context10.prev = _context10.next) {
|
|
1035
1023
|
case 0:
|
|
1036
1024
|
_context10.next = 2;
|
|
1037
|
-
return _axios.default.get(
|
|
1025
|
+
return _axios.default.get(process.env.REACT_APP_CART, {
|
|
1038
1026
|
headers: {
|
|
1039
1027
|
Authorization: token
|
|
1040
1028
|
}
|
|
@@ -1042,9 +1030,9 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1042
1030
|
|
|
1043
1031
|
case 2:
|
|
1044
1032
|
res = _context10.sent;
|
|
1045
|
-
arr =
|
|
1033
|
+
arr = JSON.parse(res.data.body).data.map(function (e) {
|
|
1046
1034
|
return e.article_id;
|
|
1047
|
-
})
|
|
1035
|
+
});
|
|
1048
1036
|
setInCart(arr.some(function (e) {
|
|
1049
1037
|
return e.articleId === product.id_article;
|
|
1050
1038
|
}));
|
|
@@ -1058,7 +1046,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1058
1046
|
}));
|
|
1059
1047
|
|
|
1060
1048
|
return function getCart() {
|
|
1061
|
-
return
|
|
1049
|
+
return _ref8.apply(this, arguments);
|
|
1062
1050
|
};
|
|
1063
1051
|
}();
|
|
1064
1052
|
|
|
@@ -1104,7 +1092,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1104
1092
|
}
|
|
1105
1093
|
|
|
1106
1094
|
setProduct(productTemp);
|
|
1107
|
-
|
|
1095
|
+
setActivePercentage((_retailers$ = retailers[0]) === null || _retailers$ === void 0 ? void 0 : _retailers$.percentage);
|
|
1108
1096
|
}, [percentages]);
|
|
1109
1097
|
|
|
1110
1098
|
var loadInputs = function loadInputs() {
|
|
@@ -1171,13 +1159,11 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1171
1159
|
var _images$inputs;
|
|
1172
1160
|
|
|
1173
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) {
|
|
1174
|
-
var _images$values2;
|
|
1175
|
-
|
|
1176
1162
|
return {
|
|
1177
1163
|
value: e === null || e === void 0 ? void 0 : e.id,
|
|
1178
1164
|
name: e === null || e === void 0 ? void 0 : e.name,
|
|
1179
1165
|
required: e === null || e === void 0 ? void 0 : e.required,
|
|
1180
|
-
active: images === null || images === void 0 ? void 0 :
|
|
1166
|
+
active: images === null || images === void 0 ? void 0 : images.values.some(function (value) {
|
|
1181
1167
|
return (value === null || value === void 0 ? void 0 : value.image_id) === (e === null || e === void 0 ? void 0 : e.id);
|
|
1182
1168
|
})
|
|
1183
1169
|
};
|
|
@@ -1186,7 +1172,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1186
1172
|
}, [images]);
|
|
1187
1173
|
|
|
1188
1174
|
var saveDescriptions = /*#__PURE__*/function () {
|
|
1189
|
-
var
|
|
1175
|
+
var _ref9 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee11() {
|
|
1190
1176
|
var dataObject, res;
|
|
1191
1177
|
return _regenerator.default.wrap(function _callee11$(_context11) {
|
|
1192
1178
|
while (1) {
|
|
@@ -1237,21 +1223,21 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1237
1223
|
}));
|
|
1238
1224
|
|
|
1239
1225
|
return function saveDescriptions() {
|
|
1240
|
-
return
|
|
1226
|
+
return _ref9.apply(this, arguments);
|
|
1241
1227
|
};
|
|
1242
1228
|
}();
|
|
1243
1229
|
|
|
1244
1230
|
var saveDatasheets = /*#__PURE__*/function () {
|
|
1245
|
-
var
|
|
1231
|
+
var _ref10 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee12() {
|
|
1246
1232
|
var parseBoxData, dataObject, res;
|
|
1247
1233
|
return _regenerator.default.wrap(function _callee12$(_context12) {
|
|
1248
1234
|
while (1) {
|
|
1249
1235
|
switch (_context12.prev = _context12.next) {
|
|
1250
1236
|
case 0:
|
|
1251
1237
|
parseBoxData = [];
|
|
1252
|
-
Object.entries(boxData).forEach(function (
|
|
1253
|
-
var
|
|
1254
|
-
box =
|
|
1238
|
+
Object.entries(boxData).forEach(function (_ref11, index) {
|
|
1239
|
+
var _ref12 = (0, _slicedToArray2.default)(_ref11, 2),
|
|
1240
|
+
box = _ref12[1];
|
|
1255
1241
|
|
|
1256
1242
|
var value = box.value;
|
|
1257
1243
|
var attributesIds = Object.keys(value);
|
|
@@ -1303,6 +1289,9 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1303
1289
|
console.log(_context12.t0);
|
|
1304
1290
|
|
|
1305
1291
|
case 18:
|
|
1292
|
+
console.log(dataObject);
|
|
1293
|
+
|
|
1294
|
+
case 19:
|
|
1306
1295
|
case "end":
|
|
1307
1296
|
return _context12.stop();
|
|
1308
1297
|
}
|
|
@@ -1311,12 +1300,12 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1311
1300
|
}));
|
|
1312
1301
|
|
|
1313
1302
|
return function saveDatasheets() {
|
|
1314
|
-
return
|
|
1303
|
+
return _ref10.apply(this, arguments);
|
|
1315
1304
|
};
|
|
1316
1305
|
}();
|
|
1317
1306
|
|
|
1318
1307
|
var updateImages = (0, _react.useCallback)( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee13() {
|
|
1319
|
-
var _images$
|
|
1308
|
+
var _images$values2, _data$articleData, _data$articleData2, _data$updateImages;
|
|
1320
1309
|
|
|
1321
1310
|
var imagesList, imagesListTemp, duplicated, attrForImgs, data, valid, _data$updateImages2, _data$articleData3, _data$articleData4, _data$articleData5, promiseArray;
|
|
1322
1311
|
|
|
@@ -1324,7 +1313,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1324
1313
|
while (1) {
|
|
1325
1314
|
switch (_context13.prev = _context13.next) {
|
|
1326
1315
|
case 0:
|
|
1327
|
-
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();
|
|
1328
1317
|
imagesListTemp = imagesList === null || imagesList === void 0 ? void 0 : imagesList.reduce(function (acc, image) {
|
|
1329
1318
|
acc[image === null || image === void 0 ? void 0 : image.image_id] = ++acc[image === null || image === void 0 ? void 0 : image.image_id] || 0;
|
|
1330
1319
|
return acc;
|
|
@@ -1506,33 +1495,45 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1506
1495
|
};
|
|
1507
1496
|
|
|
1508
1497
|
var createComment = /*#__PURE__*/function () {
|
|
1509
|
-
var
|
|
1510
|
-
var
|
|
1511
|
-
retailerId,
|
|
1512
|
-
data,
|
|
1513
|
-
_args15 = arguments;
|
|
1498
|
+
var _ref15 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee15(e, body, tab) {
|
|
1499
|
+
var concept, data;
|
|
1514
1500
|
return _regenerator.default.wrap(function _callee15$(_context15) {
|
|
1515
1501
|
while (1) {
|
|
1516
1502
|
switch (_context15.prev = _context15.next) {
|
|
1517
1503
|
case 0:
|
|
1518
|
-
|
|
1519
|
-
|
|
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:
|
|
1520
1522
|
data = {
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
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: {
|
|
1529
1532
|
Authorization: token
|
|
1530
1533
|
}
|
|
1531
|
-
};
|
|
1532
|
-
setMessage("");
|
|
1533
|
-
return _context15.abrupt("return", (0, _utils.sendMessage)(data));
|
|
1534
|
+
});
|
|
1534
1535
|
|
|
1535
|
-
case
|
|
1536
|
+
case 13:
|
|
1536
1537
|
case "end":
|
|
1537
1538
|
return _context15.stop();
|
|
1538
1539
|
}
|
|
@@ -1540,8 +1541,8 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1540
1541
|
}, _callee15);
|
|
1541
1542
|
}));
|
|
1542
1543
|
|
|
1543
|
-
return function createComment() {
|
|
1544
|
-
return
|
|
1544
|
+
return function createComment(_x4, _x5, _x6) {
|
|
1545
|
+
return _ref15.apply(this, arguments);
|
|
1545
1546
|
};
|
|
1546
1547
|
}();
|
|
1547
1548
|
|
|
@@ -1550,7 +1551,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1550
1551
|
}, [activeTab]);
|
|
1551
1552
|
|
|
1552
1553
|
var commentRevised = /*#__PURE__*/function () {
|
|
1553
|
-
var
|
|
1554
|
+
var _ref16 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee16() {
|
|
1554
1555
|
var data;
|
|
1555
1556
|
return _regenerator.default.wrap(function _callee16$(_context16) {
|
|
1556
1557
|
while (1) {
|
|
@@ -1578,12 +1579,12 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1578
1579
|
}));
|
|
1579
1580
|
|
|
1580
1581
|
return function commentRevised() {
|
|
1581
|
-
return
|
|
1582
|
+
return _ref16.apply(this, arguments);
|
|
1582
1583
|
};
|
|
1583
1584
|
}();
|
|
1584
1585
|
|
|
1585
1586
|
var setAssignation = /*#__PURE__*/function () {
|
|
1586
|
-
var
|
|
1587
|
+
var _ref17 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee17(assignationType, assignationId) {
|
|
1587
1588
|
var concept, productTemp, data;
|
|
1588
1589
|
return _regenerator.default.wrap(function _callee17$(_context17) {
|
|
1589
1590
|
while (1) {
|
|
@@ -1639,19 +1640,19 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1639
1640
|
}, _callee17);
|
|
1640
1641
|
}));
|
|
1641
1642
|
|
|
1642
|
-
return function setAssignation(
|
|
1643
|
-
return
|
|
1643
|
+
return function setAssignation(_x7, _x8) {
|
|
1644
|
+
return _ref17.apply(this, arguments);
|
|
1644
1645
|
};
|
|
1645
1646
|
}();
|
|
1646
1647
|
|
|
1647
1648
|
var downloadImages = function downloadImages() {
|
|
1648
|
-
var _images$
|
|
1649
|
+
var _images$values3;
|
|
1649
1650
|
|
|
1650
1651
|
selectedImages.length > 0 ? selectedImages.forEach(function (e) {
|
|
1651
1652
|
if (e.id) {
|
|
1652
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));
|
|
1653
1654
|
}
|
|
1654
|
-
}) : 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) {
|
|
1655
1656
|
if (e.id) {
|
|
1656
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));
|
|
1657
1658
|
}
|
|
@@ -1724,7 +1725,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1724
1725
|
};
|
|
1725
1726
|
|
|
1726
1727
|
var sendEvaluation = /*#__PURE__*/function () {
|
|
1727
|
-
var
|
|
1728
|
+
var _ref18 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee18(result) {
|
|
1728
1729
|
var _productTemp$id_order2;
|
|
1729
1730
|
|
|
1730
1731
|
var concept, productTemp, articleId, orderId, sectionStatusKey, evalStatus, data, retailerId, res, newStatuses, orderStatus, serviceStatus, newProductEdit, showSurveyByProvider, showSurveyByRetailer, _JSON$parse, newArticleStatus, newServiceStatus, newStatus, retailerStatusCopy, status;
|
|
@@ -1828,13 +1829,13 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1828
1829
|
}, _callee18, null, [[9, 33]]);
|
|
1829
1830
|
}));
|
|
1830
1831
|
|
|
1831
|
-
return function sendEvaluation(
|
|
1832
|
-
return
|
|
1832
|
+
return function sendEvaluation(_x9) {
|
|
1833
|
+
return _ref18.apply(this, arguments);
|
|
1833
1834
|
};
|
|
1834
1835
|
}();
|
|
1835
1836
|
|
|
1836
1837
|
var validateAll = /*#__PURE__*/function () {
|
|
1837
|
-
var
|
|
1838
|
+
var _ref19 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee19(result) {
|
|
1838
1839
|
var _product$id_order2, evaluationArray, conceptArray, dataGeneral, userType, productTemp, status, retailerStatusCopy;
|
|
1839
1840
|
|
|
1840
1841
|
return _regenerator.default.wrap(function _callee19$(_context19) {
|
|
@@ -1919,13 +1920,13 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1919
1920
|
}, _callee19, null, [[0, 27]]);
|
|
1920
1921
|
}));
|
|
1921
1922
|
|
|
1922
|
-
return function validateAll(
|
|
1923
|
-
return
|
|
1923
|
+
return function validateAll(_x10) {
|
|
1924
|
+
return _ref19.apply(this, arguments);
|
|
1924
1925
|
};
|
|
1925
1926
|
}();
|
|
1926
1927
|
|
|
1927
1928
|
var evaluationToRetailer = /*#__PURE__*/function () {
|
|
1928
|
-
var
|
|
1929
|
+
var _ref20 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee20(result) {
|
|
1929
1930
|
var data, prod, statusComplete;
|
|
1930
1931
|
return _regenerator.default.wrap(function _callee20$(_context20) {
|
|
1931
1932
|
while (1) {
|
|
@@ -1966,8 +1967,8 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1966
1967
|
}, _callee20);
|
|
1967
1968
|
}));
|
|
1968
1969
|
|
|
1969
|
-
return function evaluationToRetailer(
|
|
1970
|
-
return
|
|
1970
|
+
return function evaluationToRetailer(_x11) {
|
|
1971
|
+
return _ref20.apply(this, arguments);
|
|
1971
1972
|
};
|
|
1972
1973
|
}();
|
|
1973
1974
|
|
|
@@ -1978,6 +1979,8 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
1978
1979
|
|
|
1979
1980
|
var enableActions = function enableActions(versionStatus) {
|
|
1980
1981
|
try {
|
|
1982
|
+
if (user.is_retailer) return false;
|
|
1983
|
+
|
|
1981
1984
|
if (versionStatus) {
|
|
1982
1985
|
return ["AP", "ACA", "RCA", null].includes(versionStatus);
|
|
1983
1986
|
}
|
|
@@ -2011,6 +2014,10 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
2011
2014
|
}];
|
|
2012
2015
|
|
|
2013
2016
|
var sendToEvaluation = function sendToEvaluation(result) {
|
|
2017
|
+
console.log({
|
|
2018
|
+
result: result
|
|
2019
|
+
});
|
|
2020
|
+
|
|
2014
2021
|
if (result === "A") {
|
|
2015
2022
|
if (origin[activeTab] === "RequestWithoutContentoh" && !user.is_retailer && (!product.id_order || !product.orderId)) {
|
|
2016
2023
|
setDataGenericModal(function (prev) {
|
|
@@ -2048,7 +2055,8 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
2048
2055
|
return;
|
|
2049
2056
|
} else if (user.is_retailer) {
|
|
2050
2057
|
if (product.id_order || product.orderId) {
|
|
2051
|
-
|
|
2058
|
+
setValidatedAll(true);
|
|
2059
|
+
showGlobalModal("error");
|
|
2052
2060
|
} else {
|
|
2053
2061
|
setDataGenericModal(function (prev) {
|
|
2054
2062
|
return (0, _objectSpread3.default)((0, _objectSpread3.default)({}, prev), {}, {
|
|
@@ -2063,7 +2071,8 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
2063
2071
|
showGlobalModal("generic");
|
|
2064
2072
|
}
|
|
2065
2073
|
} else {
|
|
2066
|
-
|
|
2074
|
+
setValidatedAll(true);
|
|
2075
|
+
showGlobalModal("error");
|
|
2067
2076
|
}
|
|
2068
2077
|
}
|
|
2069
2078
|
};
|
|
@@ -2073,7 +2082,6 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
2073
2082
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_HeaderTop.HeaderTop, {
|
|
2074
2083
|
setHeaderTop: setHeaderTop,
|
|
2075
2084
|
withChat: location === null || location === void 0 ? void 0 : (_location$state5 = location.state) === null || _location$state5 === void 0 ? void 0 : _location$state5.withChat,
|
|
2076
|
-
chatType: location === null || location === void 0 ? void 0 : (_location$state6 = location.state) === null || _location$state6 === void 0 ? void 0 : _location$state6.chatType,
|
|
2077
2085
|
productSelected: productSelected,
|
|
2078
2086
|
token: token,
|
|
2079
2087
|
activeRetailer: activeRetailer
|
|
@@ -2152,7 +2160,7 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
2152
2160
|
} else if (user.is_retailer) {
|
|
2153
2161
|
if (product.id_order || product.orderId) {
|
|
2154
2162
|
setValidatedAll(true);
|
|
2155
|
-
|
|
2163
|
+
showGlobalModal("error");
|
|
2156
2164
|
} else {
|
|
2157
2165
|
setDataGenericModal(function (prev) {
|
|
2158
2166
|
return (0, _objectSpread3.default)((0, _objectSpread3.default)({}, prev), {}, {
|
|
@@ -2167,15 +2175,15 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
2167
2175
|
showGlobalModal("generic");
|
|
2168
2176
|
}
|
|
2169
2177
|
} else {
|
|
2170
|
-
setShowRejectModal(true);
|
|
2171
2178
|
setValidatedAll(true);
|
|
2179
|
+
showGlobalModal("error");
|
|
2172
2180
|
}
|
|
2173
2181
|
},
|
|
2174
2182
|
approve: function approve() {
|
|
2175
2183
|
return sendToEvaluation("A");
|
|
2176
2184
|
},
|
|
2177
2185
|
reject: function reject() {
|
|
2178
|
-
|
|
2186
|
+
return sendToEvaluation("R");
|
|
2179
2187
|
}
|
|
2180
2188
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_FullTabsMenu.FullTabsMenu, {
|
|
2181
2189
|
tabsSections: tabsSections,
|
|
@@ -2254,7 +2262,6 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
2254
2262
|
setUpdatedDescriptions: setUpdatedDescriptions,
|
|
2255
2263
|
articleId: product === null || product === void 0 ? void 0 : product.id_article,
|
|
2256
2264
|
version: version,
|
|
2257
|
-
isShowbox: false,
|
|
2258
2265
|
dinamicHeight: true
|
|
2259
2266
|
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_ScreenHeader.ScreenHeader, {
|
|
2260
2267
|
text: "No cuentas con este servicio",
|
|
@@ -2273,7 +2280,52 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
2273
2280
|
headerType: "input-name-header"
|
|
2274
2281
|
}))]
|
|
2275
2282
|
})
|
|
2276
|
-
}),
|
|
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", {
|
|
2277
2329
|
className: "required-inputs-message",
|
|
2278
2330
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
2279
2331
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
|
|
@@ -2333,52 +2385,6 @@ var ProviderProductEdition = function ProviderProductEdition(_ref) {
|
|
|
2333
2385
|
currentVersion: version,
|
|
2334
2386
|
setShowVersionSelector: setShowVersionSelector,
|
|
2335
2387
|
jwt: token
|
|
2336
|
-
}), showRejectModal && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Modal.Modal, {
|
|
2337
|
-
title: "Agregar mensaje de rechazo",
|
|
2338
|
-
show: showRejectModal,
|
|
2339
|
-
customComponent: /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.TagAndInput, {
|
|
2340
|
-
inputType: "textarea",
|
|
2341
|
-
inputId: "modal-message-box",
|
|
2342
|
-
index: 0,
|
|
2343
|
-
color: "white"
|
|
2344
|
-
}),
|
|
2345
|
-
buttons: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_ButtonV.ButtonV2, {
|
|
2346
|
-
type: "white",
|
|
2347
|
-
label: "Cancelar",
|
|
2348
|
-
size: 12,
|
|
2349
|
-
onClick: function onClick() {
|
|
2350
|
-
setShowRejectModal(false);
|
|
2351
|
-
}
|
|
2352
|
-
}, "btn-Cancelar"), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ButtonV.ButtonV2, {
|
|
2353
|
-
type: "pink",
|
|
2354
|
-
label: "Aceptar",
|
|
2355
|
-
size: 12,
|
|
2356
|
-
onClick: /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee21() {
|
|
2357
|
-
var body, messages;
|
|
2358
|
-
return _regenerator.default.wrap(function _callee21$(_context21) {
|
|
2359
|
-
while (1) {
|
|
2360
|
-
switch (_context21.prev = _context21.next) {
|
|
2361
|
-
case 0:
|
|
2362
|
-
body = document.querySelector("#modal-message-box .ql-container .ql-editor > p").innerHTML;
|
|
2363
|
-
messages = [{
|
|
2364
|
-
type: "message",
|
|
2365
|
-
value: body === null || body === void 0 ? void 0 : body.replace(/<.*?\/?>/gm, "")
|
|
2366
|
-
}];
|
|
2367
|
-
_context21.next = 4;
|
|
2368
|
-
return createComment(messages, activeRetailer.id);
|
|
2369
|
-
|
|
2370
|
-
case 4:
|
|
2371
|
-
validatedAll ? validateAll("R") : sendToEvaluation("R");
|
|
2372
|
-
setShowRejectModal(false);
|
|
2373
|
-
|
|
2374
|
-
case 6:
|
|
2375
|
-
case "end":
|
|
2376
|
-
return _context21.stop();
|
|
2377
|
-
}
|
|
2378
|
-
}
|
|
2379
|
-
}, _callee21);
|
|
2380
|
-
}))
|
|
2381
|
-
}, "btn-Aceptar")]
|
|
2382
2388
|
})]
|
|
2383
2389
|
});
|
|
2384
2390
|
};
|