contentoh-components-library 21.6.61 → 21.6.63
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/.claude/settings.local.json +7 -0
- package/dist/ai/prompts/attribute.prompt.js +28 -0
- package/dist/ai/prompts/description.prompt.js +33 -0
- package/dist/ai/schemas/attribute.schema.js +35 -0
- package/dist/ai/schemas/description.schema.js +27 -0
- package/dist/components/atoms/MetricCard/index.js +3 -1
- package/dist/components/organisms/DashboardMetric/DashboardMetric.stories.js +12 -2
- package/dist/components/organisms/DashboardMetric/index.js +24 -1
- package/dist/components/organisms/DashboardMetric/styles.js +1 -1
- package/dist/components/pages/CreatorsProductEdition/CreatorsProductEditionView.js +11 -5
- package/dist/components/pages/CreatorsProductEdition/hooks/useCreatorsProductEdition.js +58 -31
- package/dist/components/pages/CreatorsProductEdition/mocks/api.fixtures.js +5 -1
- package/dist/components/pages/CreatorsProductEdition/mocks/mockApi.js +3 -40
- package/dist/components/pages/CreatorsProductEdition/sections/ImagesSection.js +18 -3
- package/dist/components/pages/CreatorsProductEdition/sections/StatusChip.js +4 -13
- package/dist/components/pages/CreatorsProductEdition/sections/TabsBar.js +10 -0
- package/dist/components/pages/CreatorsProductEdition/stories/CreatorsProductEdition.stories.js +10 -2
- package/dist/components/pages/Dashboard/dashboardUtils.js +3 -3
- package/dist/components/pages/Dashboard/index.js +102 -88
- package/dist/components/pages/Dashboard/styles.js +1 -1
- package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +2 -15
- package/dist/components/pages/RetailerProductEdition/index.js +40 -57
- package/dist/components/pages/RetailerProductEdition/utils.js +2 -6
- package/dist/index.js +0 -13
- package/package.json +1 -1
- package/src/components/atoms/MetricCard/index.js +2 -2
- package/src/components/organisms/DashboardMetric/DashboardMetric.stories.js +11 -0
- package/src/components/organisms/DashboardMetric/index.js +13 -1
- package/src/components/organisms/DashboardMetric/styles.js +13 -0
- package/src/components/pages/CreatorsProductEdition/CreatorsProductEditionView.jsx +22 -3
- package/src/components/pages/CreatorsProductEdition/hooks/useCreatorsProductEdition.js +36 -1
- package/src/components/pages/CreatorsProductEdition/mocks/api.fixtures.js +15 -3
- package/src/components/pages/CreatorsProductEdition/mocks/mockApi.js +8 -18
- package/src/components/pages/CreatorsProductEdition/sections/ImagesSection.jsx +24 -2
- package/src/components/pages/CreatorsProductEdition/sections/StatusChip.jsx +4 -8
- package/src/components/pages/CreatorsProductEdition/sections/TabsBar.jsx +9 -0
- package/src/components/pages/CreatorsProductEdition/stories/CreatorsProductEdition.stories.js +6 -0
- package/src/components/pages/Dashboard/dashboardUtils.js +3 -3
- package/src/components/pages/Dashboard/index.js +62 -106
- package/src/components/pages/Dashboard/styles.js +17 -12
- package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +0 -12
- package/src/components/pages/RetailerProductEdition/index.js +3 -28
- package/src/components/pages/RetailerProductEdition/utils.js +0 -5
- package/src/index.js +0 -1
- package/dist/components/organisms/ServicesNavigation/ServiceToolbar.js +0 -210
- package/dist/components/organisms/ServicesNavigation/ServicesNavigation.stories.js +0 -138
- package/dist/components/organisms/ServicesNavigation/ServicesRail.js +0 -705
- package/dist/components/organisms/ServicesNavigation/catalog.js +0 -505
- package/dist/components/organisms/ServicesNavigation/index.js +0 -337
- package/dist/components/organisms/ServicesNavigation/model.js +0 -167
- package/dist/components/organisms/ServicesNavigation/ui.js +0 -371
- package/dist/components/organisms/ServicesNavigation/views.js +0 -1237
- package/dist/components/organisms/ServicesWorkspace/AssigneePicker.js +0 -459
- package/dist/components/organisms/ServicesWorkspace/ServicesWorkspace.stories.js +0 -119
- package/dist/components/organisms/ServicesWorkspace/demo.js +0 -137
- package/dist/components/organisms/ServicesWorkspace/index.js +0 -813
- package/dist/components/organisms/ServicesWorkspace/servicesModel.js +0 -351
- package/dist/components/organisms/ServicesWorkspace/tooltipStyles.js +0 -37
- package/dist/components/pages/CreatorsProductEdition/mocks/productServices.fixtures.js +0 -387
- package/dist/components/pages/ProductEdition/ProductEdition.stories.js +0 -148
- package/dist/components/pages/ProductEdition/ProductEditionView.js +0 -1355
- package/dist/components/pages/ProductEdition/ServiceHeader.js +0 -142
- package/dist/components/pages/ProductEdition/api.js +0 -256
- package/dist/components/pages/ProductEdition/index.js +0 -37
- package/dist/components/pages/ProductEdition/permissions.js +0 -200
- package/dist/components/pages/ProductEdition/permissions.test.js +0 -320
- package/dist/components/pages/ProductEdition/sections/CatalogServicePanel.js +0 -237
- package/dist/components/pages/ProductEdition/sections/EditionTopBar.js +0 -174
- package/dist/components/pages/ProductEdition/sections/ImagePanel.js +0 -440
- package/dist/components/pages/ProductEdition/sections/ServiceTeam.js +0 -275
- package/dist/components/pages/ProductEdition/sections/ServiceTools.js +0 -186
- package/dist/components/pages/ProductEdition/services.js +0 -233
- package/dist/components/pages/ProductEdition/services.test.js +0 -195
- package/src/components/organisms/ServicesNavigation/ServiceToolbar.jsx +0 -143
- package/src/components/organisms/ServicesNavigation/ServicesNavigation.stories.js +0 -101
- package/src/components/organisms/ServicesNavigation/ServicesRail.jsx +0 -591
- package/src/components/organisms/ServicesNavigation/catalog.js +0 -180
- package/src/components/organisms/ServicesNavigation/index.jsx +0 -232
- package/src/components/organisms/ServicesNavigation/model.js +0 -85
- package/src/components/organisms/ServicesNavigation/ui.jsx +0 -229
- package/src/components/organisms/ServicesNavigation/views.jsx +0 -705
- package/src/components/organisms/ServicesWorkspace/AssigneePicker.js +0 -348
- package/src/components/organisms/ServicesWorkspace/ServicesWorkspace.stories.js +0 -61
- package/src/components/organisms/ServicesWorkspace/demo.js +0 -58
- package/src/components/organisms/ServicesWorkspace/index.js +0 -556
- package/src/components/organisms/ServicesWorkspace/servicesModel.js +0 -203
- package/src/components/organisms/ServicesWorkspace/tooltipStyles.js +0 -27
- package/src/components/pages/CreatorsProductEdition/mocks/productServices.fixtures.js +0 -175
- package/src/components/pages/ProductEdition/ProductEdition.stories.js +0 -106
- package/src/components/pages/ProductEdition/ProductEditionView.jsx +0 -1142
- package/src/components/pages/ProductEdition/ServiceHeader.jsx +0 -104
- package/src/components/pages/ProductEdition/api.js +0 -84
- package/src/components/pages/ProductEdition/index.js +0 -21
- package/src/components/pages/ProductEdition/permissions.js +0 -128
- package/src/components/pages/ProductEdition/permissions.test.js +0 -249
- package/src/components/pages/ProductEdition/sections/CatalogServicePanel.jsx +0 -123
- package/src/components/pages/ProductEdition/sections/EditionTopBar.jsx +0 -134
- package/src/components/pages/ProductEdition/sections/ImagePanel.jsx +0 -342
- package/src/components/pages/ProductEdition/sections/ServiceTeam.jsx +0 -184
- package/src/components/pages/ProductEdition/sections/ServiceTools.jsx +0 -134
- package/src/components/pages/ProductEdition/services.js +0 -187
- package/src/components/pages/ProductEdition/services.test.js +0 -88
|
@@ -1,1355 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.ProductEditionView = void 0;
|
|
9
|
-
|
|
10
|
-
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
|
|
11
|
-
|
|
12
|
-
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectWithoutProperties"));
|
|
13
|
-
|
|
14
|
-
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
15
|
-
|
|
16
|
-
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/asyncToGenerator"));
|
|
17
|
-
|
|
18
|
-
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/slicedToArray"));
|
|
19
|
-
|
|
20
|
-
var _react = require("react");
|
|
21
|
-
|
|
22
|
-
var _axios = _interopRequireDefault(require("axios"));
|
|
23
|
-
|
|
24
|
-
var _material = require("@mui/material");
|
|
25
|
-
|
|
26
|
-
var _utils = require("../RetailerProductEdition/utils");
|
|
27
|
-
|
|
28
|
-
var _assets = require("../../../global-files/digital-assets/assets.reducer");
|
|
29
|
-
|
|
30
|
-
var _GalleryTrayTabs = require("../../molecules/GalleryTrayTabs");
|
|
31
|
-
|
|
32
|
-
var _InputGroup = require("../../organisms/InputGroup");
|
|
33
|
-
|
|
34
|
-
var _LinkVariantsModal = require("../../organisms/LinkVariantsModal");
|
|
35
|
-
|
|
36
|
-
var _UnlinkVariantModal = require("../../organisms/UnlinkVariantModal");
|
|
37
|
-
|
|
38
|
-
var _VariantGroupModal = require("../../organisms/VariantGroupModal");
|
|
39
|
-
|
|
40
|
-
var _PropagateChangesModal = require("../../organisms/PropagateChangesModal");
|
|
41
|
-
|
|
42
|
-
var _ChangeStatusModal = _interopRequireDefault(require("../../organisms/ChangeStatusModal"));
|
|
43
|
-
|
|
44
|
-
var _AiProductEdition = require("../../../contexts/AiProductEdition");
|
|
45
|
-
|
|
46
|
-
var _errorModal = _interopRequireDefault(require("../../../assets/images/genericModal/errorModal.svg"));
|
|
47
|
-
|
|
48
|
-
var _useCreatorsProductEdition = require("../CreatorsProductEdition/hooks/useCreatorsProductEdition");
|
|
49
|
-
|
|
50
|
-
var _constants = require("../CreatorsProductEdition/constants");
|
|
51
|
-
|
|
52
|
-
var _styles = require("../CreatorsProductEdition/styles");
|
|
53
|
-
|
|
54
|
-
var _ProductHeader = require("../CreatorsProductEdition/sections/ProductHeader");
|
|
55
|
-
|
|
56
|
-
var _ImagePanel = require("./sections/ImagePanel");
|
|
57
|
-
|
|
58
|
-
var _EditionTopBar = require("./sections/EditionTopBar");
|
|
59
|
-
|
|
60
|
-
var _ServiceTeam = require("./sections/ServiceTeam");
|
|
61
|
-
|
|
62
|
-
var _ServiceTools = require("./sections/ServiceTools");
|
|
63
|
-
|
|
64
|
-
var _CatalogServicePanel = require("./sections/CatalogServicePanel");
|
|
65
|
-
|
|
66
|
-
var _ImagesSection = require("../CreatorsProductEdition/sections/ImagesSection");
|
|
67
|
-
|
|
68
|
-
var _VariantsPanel = require("../CreatorsProductEdition/sections/VariantsPanel");
|
|
69
|
-
|
|
70
|
-
var _CommentBox = require("../CreatorsProductEdition/sections/CommentBox");
|
|
71
|
-
|
|
72
|
-
var _NoticeDialog = require("../CreatorsProductEdition/sections/NoticeDialog");
|
|
73
|
-
|
|
74
|
-
var _RejectDialog = require("../CreatorsProductEdition/sections/RejectDialog");
|
|
75
|
-
|
|
76
|
-
var _ImageGallery = require("../CreatorsProductEdition/sections/ImageGallery");
|
|
77
|
-
|
|
78
|
-
var _VersionDrawer = require("../CreatorsProductEdition/sections/VersionDrawer");
|
|
79
|
-
|
|
80
|
-
var _tokens = require("../CreatorsProductEdition/sections/tokens");
|
|
81
|
-
|
|
82
|
-
var _ServicesRail = require("../../organisms/ServicesNavigation/ServicesRail");
|
|
83
|
-
|
|
84
|
-
var _views = require("../../organisms/ServicesNavigation/views");
|
|
85
|
-
|
|
86
|
-
var _model = require("../../organisms/ServicesNavigation/model");
|
|
87
|
-
|
|
88
|
-
var _ServiceHeader = require("./ServiceHeader");
|
|
89
|
-
|
|
90
|
-
var _services = require("./services");
|
|
91
|
-
|
|
92
|
-
var _api = require("./api");
|
|
93
|
-
|
|
94
|
-
var _permissions = require("./permissions");
|
|
95
|
-
|
|
96
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
97
|
-
|
|
98
|
-
var _excluded = ["attributes"];
|
|
99
|
-
// Lado de la lista de servicios; en celular, el panel sale del mismo lado.
|
|
100
|
-
var RAIL_SIDE = "right"; // Aviso cuando el producto no tiene contratado el servicio de la pestaña.
|
|
101
|
-
|
|
102
|
-
var NoService = function NoService() {
|
|
103
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Typography, {
|
|
104
|
-
sx: {
|
|
105
|
-
fontFamily: _tokens.FONTS.Raleway,
|
|
106
|
-
fontSize: 14,
|
|
107
|
-
color: _tokens.COLORS.s5,
|
|
108
|
-
py: 1
|
|
109
|
-
},
|
|
110
|
-
children: "No cuentas con este servicio"
|
|
111
|
-
});
|
|
112
|
-
};
|
|
113
|
-
|
|
114
|
-
var ProductEditionView = function ProductEditionView(_ref) {
|
|
115
|
-
var _state$product, _state$product2, _services$find, _catalogService$api, _catalogService$api$a, _state$errors, _pendingPropagation$k, _family$variants, _variantGroup$members, _variantGroup$group, _state$product3, _state$product4, _state$product5, _state$active_retaile3, _state$product6, _state$product7, _state$product8, _variantGroup$group2, _location$state, _location$state2, _state$active_retaile4, _state$active_retaile5, _state$images_values$, _state$images_values, _state$images_values$2, _state$product9, _state$active_retaile6, _state$active_percent, _state$active_percent2, _state$active_percent3, _state$active_retaile7, _state$active_retaile8, _state$active_retaile9, _state$collaborator_a, _state$active_retaile10, _state$product10, _state$services2, _state$services2$data, _state$product11, _state$product12, _state$datasheets_inp, _state$datasheets_inp2, _state$product13;
|
|
116
|
-
|
|
117
|
-
var _ref$app = _ref.app,
|
|
118
|
-
app = _ref$app === void 0 ? "creators" : _ref$app,
|
|
119
|
-
demoServices = _ref.demoServices,
|
|
120
|
-
tabsSections = _ref.tabsSections,
|
|
121
|
-
_ref$productSelected = _ref.productSelected,
|
|
122
|
-
productSelected = _ref$productSelected === void 0 ? {} : _ref$productSelected,
|
|
123
|
-
_ref$user = _ref.user,
|
|
124
|
-
user = _ref$user === void 0 ? {} : _ref$user,
|
|
125
|
-
token = _ref.token,
|
|
126
|
-
location = _ref.location,
|
|
127
|
-
_ref$enableDigitalAss = _ref.enableDigitalAssets,
|
|
128
|
-
enableDigitalAssets = _ref$enableDigitalAss === void 0 ? false : _ref$enableDigitalAss;
|
|
129
|
-
|
|
130
|
-
var _useCreatorsProductEd = (0, _useCreatorsProductEdition.useCreatorsProductEdition)({
|
|
131
|
-
tabsSections: tabsSections,
|
|
132
|
-
productSelected: productSelected,
|
|
133
|
-
user: user,
|
|
134
|
-
token: token,
|
|
135
|
-
location: location,
|
|
136
|
-
enableDigitalAssets: enableDigitalAssets
|
|
137
|
-
}),
|
|
138
|
-
isRetailer = _useCreatorsProductEd.isRetailer,
|
|
139
|
-
digitalAssets = _useCreatorsProductEd.digitalAssets,
|
|
140
|
-
currentTray = _useCreatorsProductEd.currentTray,
|
|
141
|
-
assetsLoadedFor = _useCreatorsProductEd.assetsLoadedFor,
|
|
142
|
-
handleOnSetSelectedAssets = _useCreatorsProductEd.handleOnSetSelectedAssets,
|
|
143
|
-
handleOnSetAllAssetsChecked = _useCreatorsProductEd.handleOnSetAllAssetsChecked,
|
|
144
|
-
initializeProduct = _useCreatorsProductEd.initializeProduct,
|
|
145
|
-
loadAuditableData = _useCreatorsProductEd.loadAuditableData,
|
|
146
|
-
loadData = _useCreatorsProductEd.loadData,
|
|
147
|
-
handleOnChangeCurrentImage = _useCreatorsProductEd.handleOnChangeCurrentImage,
|
|
148
|
-
handleOnShowModalGallery = _useCreatorsProductEd.handleOnShowModalGallery,
|
|
149
|
-
handleOnChangeActiveRetailer = _useCreatorsProductEd.handleOnChangeActiveRetailer,
|
|
150
|
-
handleOnChangeActiveTab = _useCreatorsProductEd.handleOnChangeActiveTab,
|
|
151
|
-
handleOnToggleImageLayout = _useCreatorsProductEd.handleOnToggleImageLayout,
|
|
152
|
-
handleOnToggleObservation = _useCreatorsProductEd.handleOnToggleObservation,
|
|
153
|
-
handleOnHideObservation = _useCreatorsProductEd.handleOnHideObservation,
|
|
154
|
-
isAuditorAssigned = _useCreatorsProductEd.isAuditorAssigned,
|
|
155
|
-
isAssignedAs = _useCreatorsProductEd.isAssignedAs,
|
|
156
|
-
isUserAssignedToService = _useCreatorsProductEd.isUserAssignedToService,
|
|
157
|
-
canShowSingleEvaluationButtons = _useCreatorsProductEd.canShowSingleEvaluationButtons,
|
|
158
|
-
canShowBulkEvaluationButtons = _useCreatorsProductEd.canShowBulkEvaluationButtons,
|
|
159
|
-
getStatusByCurrentServiceAndRetailer = _useCreatorsProductEd.getStatusByCurrentServiceAndRetailer,
|
|
160
|
-
handleOnSaveAssets = _useCreatorsProductEd.handleOnSaveAssets,
|
|
161
|
-
handleOnClickSaveImages = _useCreatorsProductEd.handleOnClickSaveImages,
|
|
162
|
-
loadFamily = _useCreatorsProductEd.loadFamily,
|
|
163
|
-
hijosDelProducto = _useCreatorsProductEd.hijosDelProducto,
|
|
164
|
-
esHijoDeOtro = _useCreatorsProductEd.esHijoDeOtro,
|
|
165
|
-
puedeAgruparse = _useCreatorsProductEd.puedeAgruparse,
|
|
166
|
-
handleOnUnlinked = _useCreatorsProductEd.handleOnUnlinked,
|
|
167
|
-
loadVariantGroup = _useCreatorsProductEd.loadVariantGroup,
|
|
168
|
-
handleOnLeaveGroup = _useCreatorsProductEd.handleOnLeaveGroup,
|
|
169
|
-
openFamilyMember = _useCreatorsProductEd.openFamilyMember,
|
|
170
|
-
handleOnLinkedVariants = _useCreatorsProductEd.handleOnLinkedVariants,
|
|
171
|
-
handleOnRestoreInheritance = _useCreatorsProductEd.handleOnRestoreInheritance,
|
|
172
|
-
cambiosDeFichaTecnica = _useCreatorsProductEd.cambiosDeFichaTecnica,
|
|
173
|
-
cambiosDeDescripciones = _useCreatorsProductEd.cambiosDeDescripciones,
|
|
174
|
-
handleOnClickSave = _useCreatorsProductEd.handleOnClickSave,
|
|
175
|
-
handleOnSetUpdatedDescriptions = _useCreatorsProductEd.handleOnSetUpdatedDescriptions,
|
|
176
|
-
handleOnSetUpdatedDatasheets = _useCreatorsProductEd.handleOnSetUpdatedDatasheets,
|
|
177
|
-
handleOnDownloadAssets = _useCreatorsProductEd.handleOnDownloadAssets,
|
|
178
|
-
handleOnAskToDeleteAssets = _useCreatorsProductEd.handleOnAskToDeleteAssets,
|
|
179
|
-
handleOnAskToDeleteImages = _useCreatorsProductEd.handleOnAskToDeleteImages,
|
|
180
|
-
handleOnApproveSingleService = _useCreatorsProductEd.handleOnApproveSingleService,
|
|
181
|
-
handleOnRejectSingleService = _useCreatorsProductEd.handleOnRejectSingleService,
|
|
182
|
-
sendSingleEvaluation = _useCreatorsProductEd.sendSingleEvaluation,
|
|
183
|
-
handleOnApproveAllServices = _useCreatorsProductEd.handleOnApproveAllServices,
|
|
184
|
-
handleOnRejectAllServices = _useCreatorsProductEd.handleOnRejectAllServices,
|
|
185
|
-
sendBulkEvaluation = _useCreatorsProductEd.sendBulkEvaluation,
|
|
186
|
-
handleOnChangeAssignations = _useCreatorsProductEd.handleOnChangeAssignations,
|
|
187
|
-
handleOnSetAssignation = _useCreatorsProductEd.handleOnSetAssignation,
|
|
188
|
-
handleOnSetImages = _useCreatorsProductEd.handleOnSetImages,
|
|
189
|
-
handleOnSetCheckAll = _useCreatorsProductEd.handleOnSetCheckAll,
|
|
190
|
-
handleOnSetSelectedImages = _useCreatorsProductEd.handleOnSetSelectedImages,
|
|
191
|
-
handleOnSubmitComment = _useCreatorsProductEd.handleOnSubmitComment,
|
|
192
|
-
handleOnSendEvaluationToFacilitator = _useCreatorsProductEd.handleOnSendEvaluationToFacilitator,
|
|
193
|
-
isEvaluationFinished = _useCreatorsProductEd.isEvaluationFinished,
|
|
194
|
-
handleOnChangeProductVersion = _useCreatorsProductEd.handleOnChangeProductVersion,
|
|
195
|
-
handleRetryLoad = _useCreatorsProductEd.handleRetryLoad,
|
|
196
|
-
showVersionSelector = _useCreatorsProductEd.showVersionSelector,
|
|
197
|
-
setShowVersionSelector = _useCreatorsProductEd.setShowVersionSelector,
|
|
198
|
-
auditableVersion = _useCreatorsProductEd.auditableVersion,
|
|
199
|
-
setAuditableVersion = _useCreatorsProductEd.setAuditableVersion,
|
|
200
|
-
headerTop = _useCreatorsProductEd.headerTop,
|
|
201
|
-
setHeaderTop = _useCreatorsProductEd.setHeaderTop,
|
|
202
|
-
shotThd = _useCreatorsProductEd.shotThd,
|
|
203
|
-
setShotThd = _useCreatorsProductEd.setShotThd,
|
|
204
|
-
observation = _useCreatorsProductEd.observation,
|
|
205
|
-
setObservation = _useCreatorsProductEd.setObservation,
|
|
206
|
-
showRejectModal = _useCreatorsProductEd.showRejectModal,
|
|
207
|
-
setShowRejectModal = _useCreatorsProductEd.setShowRejectModal,
|
|
208
|
-
isObservationVisible = _useCreatorsProductEd.isObservationVisible,
|
|
209
|
-
setObservationVisible = _useCreatorsProductEd.setObservationVisible,
|
|
210
|
-
imageLayout = _useCreatorsProductEd.imageLayout,
|
|
211
|
-
setImageLayout = _useCreatorsProductEd.setImageLayout,
|
|
212
|
-
crossComment = _useCreatorsProductEd.crossComment,
|
|
213
|
-
setCrossComment = _useCreatorsProductEd.setCrossComment,
|
|
214
|
-
statusArray = _useCreatorsProductEd.statusArray,
|
|
215
|
-
setStatusArray = _useCreatorsProductEd.setStatusArray,
|
|
216
|
-
rejectAll = _useCreatorsProductEd.rejectAll,
|
|
217
|
-
setRejectAll = _useCreatorsProductEd.setRejectAll,
|
|
218
|
-
showLinkVariants = _useCreatorsProductEd.showLinkVariants,
|
|
219
|
-
setShowLinkVariants = _useCreatorsProductEd.setShowLinkVariants,
|
|
220
|
-
family = _useCreatorsProductEd.family,
|
|
221
|
-
setFamily = _useCreatorsProductEd.setFamily,
|
|
222
|
-
showFamily = _useCreatorsProductEd.showFamily,
|
|
223
|
-
setShowFamily = _useCreatorsProductEd.setShowFamily,
|
|
224
|
-
loadingVariant = _useCreatorsProductEd.loadingVariant,
|
|
225
|
-
setLoadingVariant = _useCreatorsProductEd.setLoadingVariant,
|
|
226
|
-
variantGroup = _useCreatorsProductEd.variantGroup,
|
|
227
|
-
setVariantGroup = _useCreatorsProductEd.setVariantGroup,
|
|
228
|
-
showGroup = _useCreatorsProductEd.showGroup,
|
|
229
|
-
setShowGroup = _useCreatorsProductEd.setShowGroup,
|
|
230
|
-
showGroupModal = _useCreatorsProductEd.showGroupModal,
|
|
231
|
-
setShowGroupModal = _useCreatorsProductEd.setShowGroupModal,
|
|
232
|
-
porDesvincular = _useCreatorsProductEd.porDesvincular,
|
|
233
|
-
setPorDesvincular = _useCreatorsProductEd.setPorDesvincular,
|
|
234
|
-
avisoFamilia = _useCreatorsProductEd.avisoFamilia,
|
|
235
|
-
setAvisoFamilia = _useCreatorsProductEd.setAvisoFamilia,
|
|
236
|
-
pendingPropagation = _useCreatorsProductEd.pendingPropagation,
|
|
237
|
-
setPendingPropagation = _useCreatorsProductEd.setPendingPropagation,
|
|
238
|
-
preparandoPropagacion = _useCreatorsProductEd.preparandoPropagacion,
|
|
239
|
-
setPreparandoPropagacion = _useCreatorsProductEd.setPreparandoPropagacion,
|
|
240
|
-
auditServices = _useCreatorsProductEd.auditServices,
|
|
241
|
-
setAuditServices = _useCreatorsProductEd.setAuditServices,
|
|
242
|
-
auditDatasheets = _useCreatorsProductEd.auditDatasheets,
|
|
243
|
-
setAuditDatasheets = _useCreatorsProductEd.setAuditDatasheets,
|
|
244
|
-
auditDescriptions = _useCreatorsProductEd.auditDescriptions,
|
|
245
|
-
setAuditDescriptions = _useCreatorsProductEd.setAuditDescriptions,
|
|
246
|
-
showModal = _useCreatorsProductEd.showModal,
|
|
247
|
-
setShowModal = _useCreatorsProductEd.setShowModal,
|
|
248
|
-
compare = _useCreatorsProductEd.compare,
|
|
249
|
-
setCompare = _useCreatorsProductEd.setCompare,
|
|
250
|
-
openChangeStatusModal = _useCreatorsProductEd.openChangeStatusModal,
|
|
251
|
-
setOpenChangeStatusModal = _useCreatorsProductEd.setOpenChangeStatusModal,
|
|
252
|
-
assetNotices = _useCreatorsProductEd.assetNotices,
|
|
253
|
-
setAssetNotices = _useCreatorsProductEd.setAssetNotices,
|
|
254
|
-
activeTray = _useCreatorsProductEd.activeTray,
|
|
255
|
-
setActiveTray = _useCreatorsProductEd.setActiveTray,
|
|
256
|
-
state = _useCreatorsProductEd.state,
|
|
257
|
-
dispatch = _useCreatorsProductEd.dispatch,
|
|
258
|
-
saveDatasheets = _useCreatorsProductEd.saveDatasheets,
|
|
259
|
-
saveDescriptions = _useCreatorsProductEd.saveDescriptions,
|
|
260
|
-
updateImages = _useCreatorsProductEd.updateImages,
|
|
261
|
-
deleteImages = _useCreatorsProductEd.deleteImages,
|
|
262
|
-
saveAssets = _useCreatorsProductEd.saveAssets,
|
|
263
|
-
registerUploadedAssets = _useCreatorsProductEd.registerUploadedAssets,
|
|
264
|
-
handleOnDownloadImages = _useCreatorsProductEd.handleOnDownloadImages,
|
|
265
|
-
createComment = _useCreatorsProductEd.createComment,
|
|
266
|
-
getRootProps = _useCreatorsProductEd.getRootProps,
|
|
267
|
-
getInputProps = _useCreatorsProductEd.getInputProps,
|
|
268
|
-
isDragActive = _useCreatorsProductEd.isDragActive,
|
|
269
|
-
open = _useCreatorsProductEd.open;
|
|
270
|
-
/* ---------------------------------------------------------------------- */
|
|
271
|
-
|
|
272
|
-
/* Navegación por servicios */
|
|
273
|
-
|
|
274
|
-
/* ---------------------------------------------------------------------- */
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
(0, _react.useEffect)(function () {
|
|
278
|
-
if (app !== "creators") {
|
|
279
|
-
console.warn("[ProductEdition] app \xAB".concat(app, "\xBB: los permisos de Content Management llegan en la fase 2; por ahora se usan los de Creators."));
|
|
280
|
-
}
|
|
281
|
-
}, [app]);
|
|
282
|
-
var isDesktop = (0, _material.useMediaQuery)("(min-width:900px)"); // Auditores, para poner nombre al auditor del producto en el equipo del
|
|
283
|
-
// servicio (`collaborator_assignations` solo trae especialistas y
|
|
284
|
-
// coordinadores). Es la misma consulta que hace `fetchUsers` para el rol 6.
|
|
285
|
-
|
|
286
|
-
var _useState = (0, _react.useState)([]),
|
|
287
|
-
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
288
|
-
auditors = _useState2[0],
|
|
289
|
-
setAuditors = _useState2[1];
|
|
290
|
-
|
|
291
|
-
(0, _react.useEffect)(function () {
|
|
292
|
-
if (!token) return undefined;
|
|
293
|
-
var alive = true;
|
|
294
|
-
|
|
295
|
-
_axios.default.get("".concat(process.env.REACT_APP_USER_ENDPOINT, "?fetchRole=6"), {
|
|
296
|
-
headers: {
|
|
297
|
-
Authorization: token
|
|
298
|
-
}
|
|
299
|
-
}).then(function (response) {
|
|
300
|
-
var _response$data$data, _response$data;
|
|
301
|
-
|
|
302
|
-
return alive && setAuditors((_response$data$data = (_response$data = response.data) === null || _response$data === void 0 ? void 0 : _response$data.data) !== null && _response$data$data !== void 0 ? _response$data$data : []);
|
|
303
|
-
}).catch(function () {});
|
|
304
|
-
|
|
305
|
-
return function () {
|
|
306
|
-
alive = false;
|
|
307
|
-
};
|
|
308
|
-
}, [token]);
|
|
309
|
-
/*
|
|
310
|
-
Servicios del producto desde el backend (GET /product-services), leídos de
|
|
311
|
-
las columnas del catálogo de rel_order_services: los de siempre y los
|
|
312
|
-
nuevos, con su estatus, su equipo y lo que la persona puede hacer.
|
|
313
|
-
Se vuelven a pedir cuando el flujo actual cambia el producto o sus estatus
|
|
314
|
-
(evaluar, asignar, guardar), para que la lista no se quede atrás. Si el
|
|
315
|
-
endpoint no responde, la lista se arma como antes, con los campos del
|
|
316
|
-
producto (buildEditionServices). Las historias usan `demoServices`.
|
|
317
|
-
*/
|
|
318
|
-
|
|
319
|
-
var _useState3 = (0, _react.useState)(null),
|
|
320
|
-
_useState4 = (0, _slicedToArray2.default)(_useState3, 2),
|
|
321
|
-
productServices = _useState4[0],
|
|
322
|
-
setProductServices = _useState4[1];
|
|
323
|
-
|
|
324
|
-
var productServicesRequest = (0, _react.useRef)(0);
|
|
325
|
-
var articleId = (_state$product = state.product) === null || _state$product === void 0 ? void 0 : _state$product.id_article;
|
|
326
|
-
var orderId = (_state$product2 = state.product) === null || _state$product2 === void 0 ? void 0 : _state$product2.id_order;
|
|
327
|
-
var refreshProductServices = (0, _react.useCallback)( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
328
|
-
var request, data;
|
|
329
|
-
return _regenerator.default.wrap(function _callee$(_context) {
|
|
330
|
-
while (1) {
|
|
331
|
-
switch (_context.prev = _context.next) {
|
|
332
|
-
case 0:
|
|
333
|
-
if (!(!token || !articleId || !orderId || demoServices)) {
|
|
334
|
-
_context.next = 2;
|
|
335
|
-
break;
|
|
336
|
-
}
|
|
337
|
-
|
|
338
|
-
return _context.abrupt("return");
|
|
339
|
-
|
|
340
|
-
case 2:
|
|
341
|
-
productServicesRequest.current += 1;
|
|
342
|
-
request = productServicesRequest.current;
|
|
343
|
-
_context.prev = 4;
|
|
344
|
-
_context.next = 7;
|
|
345
|
-
return (0, _api.fetchProductServices)({
|
|
346
|
-
articleId: articleId,
|
|
347
|
-
orderId: orderId,
|
|
348
|
-
token: token
|
|
349
|
-
});
|
|
350
|
-
|
|
351
|
-
case 7:
|
|
352
|
-
data = _context.sent;
|
|
353
|
-
|
|
354
|
-
// Solo la respuesta más reciente (un producto que se abrió después gana),
|
|
355
|
-
// y solo si trae la lista: si no, se queda la que arma el producto.
|
|
356
|
-
if (request === productServicesRequest.current && Array.isArray(data === null || data === void 0 ? void 0 : data.services)) {
|
|
357
|
-
setProductServices(data);
|
|
358
|
-
}
|
|
359
|
-
|
|
360
|
-
_context.next = 14;
|
|
361
|
-
break;
|
|
362
|
-
|
|
363
|
-
case 11:
|
|
364
|
-
_context.prev = 11;
|
|
365
|
-
_context.t0 = _context["catch"](4);
|
|
366
|
-
console.warn("[ProductEdition] servicios del producto:", _context.t0 === null || _context.t0 === void 0 ? void 0 : _context.t0.message);
|
|
367
|
-
|
|
368
|
-
case 14:
|
|
369
|
-
case "end":
|
|
370
|
-
return _context.stop();
|
|
371
|
-
}
|
|
372
|
-
}
|
|
373
|
-
}, _callee, null, [[4, 11]]);
|
|
374
|
-
})), [token, articleId, orderId, demoServices]);
|
|
375
|
-
(0, _react.useEffect)(function () {
|
|
376
|
-
setProductServices(null);
|
|
377
|
-
}, [articleId, orderId]);
|
|
378
|
-
(0, _react.useEffect)(function () {
|
|
379
|
-
refreshProductServices();
|
|
380
|
-
}, [refreshProductServices, state.product, state.services_data]);
|
|
381
|
-
var services = (0, _react.useMemo)(function () {
|
|
382
|
-
var _state$active_retaile, _state$active_retaile2;
|
|
383
|
-
|
|
384
|
-
return productServices ? (0, _services.buildServicesFromApi)({
|
|
385
|
-
productServices: productServices,
|
|
386
|
-
user: user,
|
|
387
|
-
activeRetailerId: (_state$active_retaile = state.active_retailer) === null || _state$active_retaile === void 0 ? void 0 : _state$active_retaile.id_retailer
|
|
388
|
-
}) : (0, _services.buildEditionServices)({
|
|
389
|
-
product: state.product,
|
|
390
|
-
user: user,
|
|
391
|
-
servicesData: state.services_data,
|
|
392
|
-
activeRetailerId: (_state$active_retaile2 = state.active_retailer) === null || _state$active_retaile2 === void 0 ? void 0 : _state$active_retaile2.id_retailer,
|
|
393
|
-
collaboratorAssignations: state.collaborator_assignations,
|
|
394
|
-
auditors: auditors,
|
|
395
|
-
demoServices: demoServices
|
|
396
|
-
});
|
|
397
|
-
}, [productServices, state.product, user, state.services_data, state.active_retailer, state.collaborator_assignations, auditors, demoServices]);
|
|
398
|
-
var single = services.length === 1;
|
|
399
|
-
var showFilter = (0, _model.hasUsefulFilter)(services, user === null || user === void 0 ? void 0 : user.id_user); // `null` hasta que cargan los servicios; después, el servicio abierto o SUMMARY.
|
|
400
|
-
|
|
401
|
-
var _useState5 = (0, _react.useState)(null),
|
|
402
|
-
_useState6 = (0, _slicedToArray2.default)(_useState5, 2),
|
|
403
|
-
selected = _useState6[0],
|
|
404
|
-
setSelected = _useState6[1];
|
|
405
|
-
|
|
406
|
-
var _useState7 = (0, _react.useState)("all"),
|
|
407
|
-
_useState8 = (0, _slicedToArray2.default)(_useState7, 2),
|
|
408
|
-
filter = _useState8[0],
|
|
409
|
-
setFilter = _useState8[1];
|
|
410
|
-
|
|
411
|
-
var _useState9 = (0, _react.useState)(false),
|
|
412
|
-
_useState10 = (0, _slicedToArray2.default)(_useState9, 2),
|
|
413
|
-
railCollapsed = _useState10[0],
|
|
414
|
-
setRailCollapsed = _useState10[1];
|
|
415
|
-
|
|
416
|
-
var _useState11 = (0, _react.useState)(false),
|
|
417
|
-
_useState12 = (0, _slicedToArray2.default)(_useState11, 2),
|
|
418
|
-
railOpen = _useState12[0],
|
|
419
|
-
setRailOpen = _useState12[1];
|
|
420
|
-
|
|
421
|
-
var _useState13 = (0, _react.useState)(null),
|
|
422
|
-
_useState14 = (0, _slicedToArray2.default)(_useState13, 2),
|
|
423
|
-
pendingSelection = _useState14[0],
|
|
424
|
-
setPendingSelection = _useState14[1];
|
|
425
|
-
/*
|
|
426
|
-
Al cargar se abre, en este orden:
|
|
427
|
-
1. el único servicio, si solo hay uno;
|
|
428
|
-
2. lo primero que le toca a la persona;
|
|
429
|
-
3. su primer servicio, si trabaja solo algunos (un especialista);
|
|
430
|
-
4. el Resumen (quien ve todo: administración, coordinación, auditoría).
|
|
431
|
-
*/
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
(0, _react.useEffect)(function () {
|
|
435
|
-
// Se espera a `services_data`: antes, los estatus son los generales del
|
|
436
|
-
// producto y no los de la cadena activa, y se elegiría con datos viejos.
|
|
437
|
-
if (selected !== null || services.length === 0 || !state.services_data) return;
|
|
438
|
-
var first = (0, _model.initialSelection)(services, user === null || user === void 0 ? void 0 : user.id_user);
|
|
439
|
-
var mine = services.filter(function (item) {
|
|
440
|
-
return item.mine;
|
|
441
|
-
});
|
|
442
|
-
|
|
443
|
-
if (first === _model.SUMMARY && mine.length > 0 && mine.length < services.length) {
|
|
444
|
-
first = mine[0].service_name;
|
|
445
|
-
}
|
|
446
|
-
|
|
447
|
-
setFilter((0, _model.defaultFilter)(services, user === null || user === void 0 ? void 0 : user.id_user));
|
|
448
|
-
openService(first); // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
449
|
-
}, [services, state.services_data]); // Si el hook cambia de pestaña por su cuenta, la lista lo sigue.
|
|
450
|
-
|
|
451
|
-
(0, _react.useEffect)(function () {
|
|
452
|
-
var current = services.find(function (item) {
|
|
453
|
-
return item.service_name === selected;
|
|
454
|
-
});
|
|
455
|
-
var fromTab = (0, _permissions.serviceOfTab)(state.active_tab);
|
|
456
|
-
if (current !== null && current !== void 0 && current.tab && fromTab && fromTab !== selected) setSelected(fromTab); // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
457
|
-
}, [state.active_tab]);
|
|
458
|
-
var selectedService = (_services$find = services.find(function (item) {
|
|
459
|
-
return item.service_name === selected;
|
|
460
|
-
})) !== null && _services$find !== void 0 ? _services$find : null;
|
|
461
|
-
var isSummary = selected === _model.SUMMARY;
|
|
462
|
-
var isClassic = Boolean(selectedService === null || selectedService === void 0 ? void 0 : selectedService.tab); // Servicio del catálogo (o de siempre sin editor) que llegó del backend.
|
|
463
|
-
|
|
464
|
-
var catalogService = !isClassic && !isSummary && selectedService !== null && selectedService !== void 0 && selectedService.api ? selectedService : null; // A quién se puede asignar en el servicio del catálogo abierto (view=assignables).
|
|
465
|
-
|
|
466
|
-
var _useState15 = (0, _react.useState)({}),
|
|
467
|
-
_useState16 = (0, _slicedToArray2.default)(_useState15, 2),
|
|
468
|
-
assignables = _useState16[0],
|
|
469
|
-
setAssignables = _useState16[1];
|
|
470
|
-
|
|
471
|
-
var catalogServiceName = catalogService === null || catalogService === void 0 ? void 0 : catalogService.service_name;
|
|
472
|
-
var catalogCanAssign = Boolean(catalogService === null || catalogService === void 0 ? void 0 : (_catalogService$api = catalogService.api) === null || _catalogService$api === void 0 ? void 0 : (_catalogService$api$a = _catalogService$api.actions) === null || _catalogService$api$a === void 0 ? void 0 : _catalogService$api$a.assign);
|
|
473
|
-
(0, _react.useEffect)(function () {
|
|
474
|
-
var _catalogService$api$r;
|
|
475
|
-
|
|
476
|
-
setAssignables({});
|
|
477
|
-
if (!catalogServiceName || !catalogCanAssign || !token) return undefined;
|
|
478
|
-
var alive = true;
|
|
479
|
-
var roles = ((_catalogService$api$r = catalogService.api.roles) !== null && _catalogService$api$r !== void 0 ? _catalogService$api$r : []).filter(function (role) {
|
|
480
|
-
return role === "especialist" || role === "facilitator";
|
|
481
|
-
});
|
|
482
|
-
Promise.all(roles.map(function (role) {
|
|
483
|
-
return (0, _api.fetchAssignables)({
|
|
484
|
-
serviceName: catalogServiceName,
|
|
485
|
-
role: role,
|
|
486
|
-
token: token
|
|
487
|
-
}).then(function (users) {
|
|
488
|
-
return [role, users];
|
|
489
|
-
}).catch(function () {
|
|
490
|
-
return [role, []];
|
|
491
|
-
});
|
|
492
|
-
})).then(function (entries) {
|
|
493
|
-
return alive && setAssignables(Object.fromEntries(entries));
|
|
494
|
-
});
|
|
495
|
-
return function () {
|
|
496
|
-
alive = false;
|
|
497
|
-
}; // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
498
|
-
}, [catalogServiceName, catalogCanAssign, token]);
|
|
499
|
-
|
|
500
|
-
var handleOnSetCatalogStatus = /*#__PURE__*/function () {
|
|
501
|
-
var _ref3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(statusName, retailerIds) {
|
|
502
|
-
return _regenerator.default.wrap(function _callee2$(_context2) {
|
|
503
|
-
while (1) {
|
|
504
|
-
switch (_context2.prev = _context2.next) {
|
|
505
|
-
case 0:
|
|
506
|
-
_context2.next = 2;
|
|
507
|
-
return (0, _api.setServiceStatus)({
|
|
508
|
-
articleId: articleId,
|
|
509
|
-
orderId: orderId,
|
|
510
|
-
serviceName: catalogServiceName,
|
|
511
|
-
statusName: statusName,
|
|
512
|
-
retailerIds: retailerIds,
|
|
513
|
-
token: token
|
|
514
|
-
});
|
|
515
|
-
|
|
516
|
-
case 2:
|
|
517
|
-
_context2.next = 4;
|
|
518
|
-
return refreshProductServices();
|
|
519
|
-
|
|
520
|
-
case 4:
|
|
521
|
-
case "end":
|
|
522
|
-
return _context2.stop();
|
|
523
|
-
}
|
|
524
|
-
}
|
|
525
|
-
}, _callee2);
|
|
526
|
-
}));
|
|
527
|
-
|
|
528
|
-
return function handleOnSetCatalogStatus(_x, _x2) {
|
|
529
|
-
return _ref3.apply(this, arguments);
|
|
530
|
-
};
|
|
531
|
-
}();
|
|
532
|
-
|
|
533
|
-
var handleOnAssignCatalogService = /*#__PURE__*/function () {
|
|
534
|
-
var _ref4 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3(role, userId) {
|
|
535
|
-
return _regenerator.default.wrap(function _callee3$(_context3) {
|
|
536
|
-
while (1) {
|
|
537
|
-
switch (_context3.prev = _context3.next) {
|
|
538
|
-
case 0:
|
|
539
|
-
_context3.prev = 0;
|
|
540
|
-
_context3.next = 3;
|
|
541
|
-
return (0, _api.assignService)({
|
|
542
|
-
articleId: articleId,
|
|
543
|
-
orderId: orderId,
|
|
544
|
-
serviceName: catalogServiceName,
|
|
545
|
-
role: role,
|
|
546
|
-
userId: userId,
|
|
547
|
-
token: token
|
|
548
|
-
});
|
|
549
|
-
|
|
550
|
-
case 3:
|
|
551
|
-
_context3.next = 8;
|
|
552
|
-
break;
|
|
553
|
-
|
|
554
|
-
case 5:
|
|
555
|
-
_context3.prev = 5;
|
|
556
|
-
_context3.t0 = _context3["catch"](0);
|
|
557
|
-
console.warn("[ProductEdition] asignar servicio:", _context3.t0 === null || _context3.t0 === void 0 ? void 0 : _context3.t0.message);
|
|
558
|
-
|
|
559
|
-
case 8:
|
|
560
|
-
_context3.next = 10;
|
|
561
|
-
return refreshProductServices();
|
|
562
|
-
|
|
563
|
-
case 10:
|
|
564
|
-
case "end":
|
|
565
|
-
return _context3.stop();
|
|
566
|
-
}
|
|
567
|
-
}
|
|
568
|
-
}, _callee3, null, [[0, 5]]);
|
|
569
|
-
}));
|
|
570
|
-
|
|
571
|
-
return function handleOnAssignCatalogService(_x3, _x4) {
|
|
572
|
-
return _ref4.apply(this, arguments);
|
|
573
|
-
};
|
|
574
|
-
}();
|
|
575
|
-
|
|
576
|
-
var activeConcept = (0, _permissions.serviceOfTab)(state.active_tab); // Permisos del servicio abierto (ver permissions.js).
|
|
577
|
-
|
|
578
|
-
var userCanSave = (0, _permissions.canSave)(state.product, user, activeConcept);
|
|
579
|
-
var userCanEvaluate = Boolean(state.product && state.services_data) && (0, _permissions.canEvaluate)(state.product, user, activeConcept, getStatusByCurrentServiceAndRetailer());
|
|
580
|
-
|
|
581
|
-
var hasUnsavedChanges = function hasUnsavedChanges() {
|
|
582
|
-
var _state$updated_descri, _state$updated_datash, _state$updated_images, _state$services, _state$services$image, _state$services$image2, _state$services$image3;
|
|
583
|
-
|
|
584
|
-
return ((_state$updated_descri = state.updated_descriptions_inputs) === null || _state$updated_descri === void 0 ? void 0 : _state$updated_descri.length) > 0 || ((_state$updated_datash = state.updated_datasheets_inputs) === null || _state$updated_datash === void 0 ? void 0 : _state$updated_datash.length) > 0 || ((_state$updated_images = state.updated_images_values) === null || _state$updated_images === void 0 ? void 0 : _state$updated_images.length) > 0 || ((_state$services = state.services) === null || _state$services === void 0 ? void 0 : (_state$services$image = _state$services.images) === null || _state$services$image === void 0 ? void 0 : (_state$services$image2 = _state$services$image.values) === null || _state$services$image2 === void 0 ? void 0 : (_state$services$image3 = _state$services$image2.filter(function (file) {
|
|
585
|
-
return !file.id;
|
|
586
|
-
})) === null || _state$services$image3 === void 0 ? void 0 : _state$services$image3.length) > 0;
|
|
587
|
-
};
|
|
588
|
-
|
|
589
|
-
function openService(name) {
|
|
590
|
-
var target = services.find(function (item) {
|
|
591
|
-
return item.service_name === name;
|
|
592
|
-
});
|
|
593
|
-
if (target !== null && target !== void 0 && target.tab && target.tab !== state.active_tab) handleOnChangeActiveTab(target.tab);
|
|
594
|
-
setSelected(name);
|
|
595
|
-
setRailOpen(false);
|
|
596
|
-
} // Igual que la barra de pestañas: cambiar con cambios sin guardar pregunta.
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
var requestService = function requestService(name) {
|
|
600
|
-
if (name === selected) return;
|
|
601
|
-
if (hasUnsavedChanges()) setPendingSelection(name);else openService(name);
|
|
602
|
-
};
|
|
603
|
-
|
|
604
|
-
var confirmServiceChange = function confirmServiceChange() {
|
|
605
|
-
handleOnSetUpdatedDescriptions && handleOnSetUpdatedDescriptions([]);
|
|
606
|
-
handleOnSetUpdatedDatasheets && handleOnSetUpdatedDatasheets([]);
|
|
607
|
-
handleOnSetImages && handleOnSetImages({});
|
|
608
|
-
openService(pendingSelection);
|
|
609
|
-
setPendingSelection(null);
|
|
610
|
-
};
|
|
611
|
-
|
|
612
|
-
var pendingCount = services.filter(function (item) {
|
|
613
|
-
return (0, _model.isPendingFor)(item, user === null || user === void 0 ? void 0 : user.id_user);
|
|
614
|
-
}).length;
|
|
615
|
-
|
|
616
|
-
var renderRail = function renderRail(variant) {
|
|
617
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ServicesRail.ServicesRail, {
|
|
618
|
-
variant: variant,
|
|
619
|
-
services: services,
|
|
620
|
-
selected: selected !== null && selected !== void 0 ? selected : _model.SUMMARY,
|
|
621
|
-
onSelect: requestService,
|
|
622
|
-
userId: user === null || user === void 0 ? void 0 : user.id_user,
|
|
623
|
-
filter: filter,
|
|
624
|
-
onFilterChange: setFilter,
|
|
625
|
-
showFilter: showFilter,
|
|
626
|
-
collapsed: railCollapsed,
|
|
627
|
-
onToggleCollapsed: function onToggleCollapsed() {
|
|
628
|
-
return setRailCollapsed(function (value) {
|
|
629
|
-
return !value;
|
|
630
|
-
});
|
|
631
|
-
},
|
|
632
|
-
onClose: variant === "drawer" ? function () {
|
|
633
|
-
return setRailOpen(false);
|
|
634
|
-
} : undefined,
|
|
635
|
-
side: RAIL_SIDE
|
|
636
|
-
});
|
|
637
|
-
};
|
|
638
|
-
|
|
639
|
-
var ProductEditionSkeleton = function ProductEditionSkeleton() {
|
|
640
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.Container, {
|
|
641
|
-
headerTop: 0,
|
|
642
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.Box, {
|
|
643
|
-
px: 1.5,
|
|
644
|
-
py: 1,
|
|
645
|
-
pb: 0,
|
|
646
|
-
display: "flex",
|
|
647
|
-
alignItems: "center",
|
|
648
|
-
justifyContent: "space-between",
|
|
649
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Skeleton, {
|
|
650
|
-
variant: "text",
|
|
651
|
-
width: "min(300px, 60%)",
|
|
652
|
-
height: 40
|
|
653
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Stack, {
|
|
654
|
-
direction: "row",
|
|
655
|
-
spacing: 2,
|
|
656
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Skeleton, {
|
|
657
|
-
variant: "circular",
|
|
658
|
-
width: 32,
|
|
659
|
-
height: 32
|
|
660
|
-
})
|
|
661
|
-
})]
|
|
662
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
663
|
-
className: "data-container",
|
|
664
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
665
|
-
className: "image-data-panel",
|
|
666
|
-
style: {
|
|
667
|
-
display: "flex",
|
|
668
|
-
flexDirection: "column",
|
|
669
|
-
gap: "20px"
|
|
670
|
-
},
|
|
671
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Skeleton, {
|
|
672
|
-
variant: "rounded",
|
|
673
|
-
width: "100%",
|
|
674
|
-
height: 320
|
|
675
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Stack, {
|
|
676
|
-
direction: "row",
|
|
677
|
-
spacing: 2,
|
|
678
|
-
justifyContent: "center",
|
|
679
|
-
children: [1, 2, 3, 4].map(function (item) {
|
|
680
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Skeleton, {
|
|
681
|
-
variant: "rounded",
|
|
682
|
-
width: 60,
|
|
683
|
-
height: 80
|
|
684
|
-
}, item);
|
|
685
|
-
})
|
|
686
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Box, {
|
|
687
|
-
mt: 2,
|
|
688
|
-
children: [1, 2, 3, 4].map(function (item) {
|
|
689
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.Box, {
|
|
690
|
-
display: "flex",
|
|
691
|
-
justifyContent: "space-between",
|
|
692
|
-
py: 1,
|
|
693
|
-
borderBottom: "1px solid #f0f0f0",
|
|
694
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Skeleton, {
|
|
695
|
-
variant: "text",
|
|
696
|
-
width: "40%"
|
|
697
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Skeleton, {
|
|
698
|
-
variant: "text",
|
|
699
|
-
width: "20%"
|
|
700
|
-
})]
|
|
701
|
-
}, item);
|
|
702
|
-
})
|
|
703
|
-
})]
|
|
704
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
705
|
-
className: "product-information",
|
|
706
|
-
style: {
|
|
707
|
-
flex: 1,
|
|
708
|
-
display: "flex",
|
|
709
|
-
flexDirection: "column",
|
|
710
|
-
gap: "14px"
|
|
711
|
-
},
|
|
712
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.Box, {
|
|
713
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Skeleton, {
|
|
714
|
-
variant: "text",
|
|
715
|
-
width: "80%",
|
|
716
|
-
height: 50
|
|
717
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.Stack, {
|
|
718
|
-
direction: "row",
|
|
719
|
-
spacing: 2,
|
|
720
|
-
alignItems: "center",
|
|
721
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Skeleton, {
|
|
722
|
-
variant: "rounded",
|
|
723
|
-
width: "30%",
|
|
724
|
-
height: 24
|
|
725
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Skeleton, {
|
|
726
|
-
variant: "rounded",
|
|
727
|
-
width: "45%",
|
|
728
|
-
height: 24
|
|
729
|
-
})]
|
|
730
|
-
})]
|
|
731
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.Box, {
|
|
732
|
-
display: "flex",
|
|
733
|
-
gap: 4,
|
|
734
|
-
pb: 1,
|
|
735
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Skeleton, {
|
|
736
|
-
variant: "text",
|
|
737
|
-
width: "28%",
|
|
738
|
-
height: 45
|
|
739
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Skeleton, {
|
|
740
|
-
variant: "text",
|
|
741
|
-
width: "28%",
|
|
742
|
-
height: 45
|
|
743
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Skeleton, {
|
|
744
|
-
variant: "text",
|
|
745
|
-
width: "28%",
|
|
746
|
-
height: 45
|
|
747
|
-
})]
|
|
748
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Box, {
|
|
749
|
-
display: "flex",
|
|
750
|
-
flexDirection: "column",
|
|
751
|
-
gap: 4,
|
|
752
|
-
children: [1, 2, 3].map(function (item) {
|
|
753
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.Box, {
|
|
754
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.Box, {
|
|
755
|
-
display: "flex",
|
|
756
|
-
justifyContent: "space-between",
|
|
757
|
-
alignItems: "center",
|
|
758
|
-
mb: 1,
|
|
759
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Skeleton, {
|
|
760
|
-
variant: "text",
|
|
761
|
-
width: "30%",
|
|
762
|
-
height: 24
|
|
763
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Skeleton, {
|
|
764
|
-
variant: "rounded",
|
|
765
|
-
width: "min(175px, 35%)",
|
|
766
|
-
height: 25,
|
|
767
|
-
sx: {
|
|
768
|
-
borderRadius: "7.5px"
|
|
769
|
-
}
|
|
770
|
-
})]
|
|
771
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Skeleton, {
|
|
772
|
-
variant: "rounded",
|
|
773
|
-
width: "100%",
|
|
774
|
-
height: 70
|
|
775
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Box, {
|
|
776
|
-
display: "flex",
|
|
777
|
-
justifyContent: "flex-end",
|
|
778
|
-
mt: 0.5,
|
|
779
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Skeleton, {
|
|
780
|
-
variant: "text",
|
|
781
|
-
width: 60
|
|
782
|
-
})
|
|
783
|
-
})]
|
|
784
|
-
}, item);
|
|
785
|
-
})
|
|
786
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.Box, {
|
|
787
|
-
mt: "auto",
|
|
788
|
-
pt: 4,
|
|
789
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Skeleton, {
|
|
790
|
-
variant: "rounded",
|
|
791
|
-
width: "100%",
|
|
792
|
-
height: 120
|
|
793
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.Box, {
|
|
794
|
-
display: "flex",
|
|
795
|
-
justifyContent: "flex-end",
|
|
796
|
-
gap: 2,
|
|
797
|
-
mt: 2,
|
|
798
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Skeleton, {
|
|
799
|
-
variant: "rounded",
|
|
800
|
-
width: "min(180px, 45%)",
|
|
801
|
-
height: 45,
|
|
802
|
-
sx: {
|
|
803
|
-
borderRadius: "24px"
|
|
804
|
-
}
|
|
805
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Skeleton, {
|
|
806
|
-
variant: "rounded",
|
|
807
|
-
width: "min(180px, 45%)",
|
|
808
|
-
height: 45,
|
|
809
|
-
sx: {
|
|
810
|
-
borderRadius: "24px"
|
|
811
|
-
}
|
|
812
|
-
})]
|
|
813
|
-
})]
|
|
814
|
-
})]
|
|
815
|
-
})]
|
|
816
|
-
})]
|
|
817
|
-
});
|
|
818
|
-
}; // Si la carga falló y no tenemos servicios, mostramos un estado de error con
|
|
819
|
-
// opción de reintentar en vez de quedarnos colgados en el skeleton.
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
if (!state.loading && ((_state$errors = state.errors) === null || _state$errors === void 0 ? void 0 : _state$errors.length) > 0 && !state.services) return /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.Container, {
|
|
823
|
-
headerTop: 0,
|
|
824
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.Box, {
|
|
825
|
-
display: "flex",
|
|
826
|
-
flexDirection: "column",
|
|
827
|
-
alignItems: "center",
|
|
828
|
-
justifyContent: "center",
|
|
829
|
-
gap: 2,
|
|
830
|
-
sx: {
|
|
831
|
-
minHeight: "60vh",
|
|
832
|
-
textAlign: "center",
|
|
833
|
-
padding: "40px"
|
|
834
|
-
},
|
|
835
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
|
|
836
|
-
src: _errorModal.default,
|
|
837
|
-
alt: "error",
|
|
838
|
-
width: 64,
|
|
839
|
-
height: 64
|
|
840
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Typography, {
|
|
841
|
-
sx: {
|
|
842
|
-
fontFamily: _tokens.FONTS.Raleway,
|
|
843
|
-
fontSize: 16,
|
|
844
|
-
color: _tokens.COLORS.s5
|
|
845
|
-
},
|
|
846
|
-
children: "No pudimos cargar el producto"
|
|
847
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Typography, {
|
|
848
|
-
sx: {
|
|
849
|
-
color: "#666",
|
|
850
|
-
maxWidth: 420,
|
|
851
|
-
fontSize: 14
|
|
852
|
-
},
|
|
853
|
-
children: state.errors[0] || "Ocurrió un error al cargar la información del producto."
|
|
854
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Button, {
|
|
855
|
-
variant: "contained",
|
|
856
|
-
disableElevation: true,
|
|
857
|
-
onClick: handleRetryLoad,
|
|
858
|
-
sx: {
|
|
859
|
-
textTransform: "none",
|
|
860
|
-
borderRadius: "20px",
|
|
861
|
-
px: 4,
|
|
862
|
-
bgcolor: _tokens.COLORS.magenta_s2,
|
|
863
|
-
"&:hover": {
|
|
864
|
-
bgcolor: _tokens.COLORS.secondary_magenta
|
|
865
|
-
}
|
|
866
|
-
},
|
|
867
|
-
children: "Reintentar"
|
|
868
|
-
})]
|
|
869
|
-
})
|
|
870
|
-
});
|
|
871
|
-
/*
|
|
872
|
-
`images_values` entra al guard junto a `services` y `product`.
|
|
873
|
-
React 17 no agrupa los dispatch que van después de un `await`: cada uno
|
|
874
|
-
re-renderiza al instante. En `loadData` el orden es SET_SERVICES →
|
|
875
|
-
…_INPUTS → SET_IMAGES_VALUES, así que había renders intermedios con
|
|
876
|
-
`services` ya puesto —el guard los dejaba pasar— y el resto todavía en null.
|
|
877
|
-
El cuerpo de abajo lee `datasheets_inputs[1]`, `descriptions_inputs[0]` y
|
|
878
|
-
`images_values.values` sin protección, y tumbaba la pantalla entera.
|
|
879
|
-
Se comprueba `images_values` y no cada uno: es el ÚLTIMO que `loadData`
|
|
880
|
-
despacha, así que si ya está, los anteriores también.
|
|
881
|
-
*/
|
|
882
|
-
|
|
883
|
-
if (state.loading || !state.services || !state.product || !state.images_values) return /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
|
|
884
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(ProductEditionSkeleton, {})
|
|
885
|
-
});
|
|
886
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_AiProductEdition.AiProductEditionProvider, {
|
|
887
|
-
isCreatorsEdition: true,
|
|
888
|
-
user: user,
|
|
889
|
-
token: token,
|
|
890
|
-
state: state,
|
|
891
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.Box, {
|
|
892
|
-
sx: {
|
|
893
|
-
display: "flex",
|
|
894
|
-
flex: 1,
|
|
895
|
-
minWidth: 0,
|
|
896
|
-
height: "100%",
|
|
897
|
-
overflow: "hidden"
|
|
898
|
-
},
|
|
899
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.Container, {
|
|
900
|
-
headerTop: headerTop,
|
|
901
|
-
children: [pendingPropagation && /*#__PURE__*/(0, _jsxRuntime.jsx)(_PropagateChangesModal.PropagateChangesModal, {
|
|
902
|
-
changedAttributes: pendingPropagation.cambios,
|
|
903
|
-
kind: (_pendingPropagation$k = pendingPropagation.kind) !== null && _pendingPropagation$k !== void 0 ? _pendingPropagation$k : "datasheet",
|
|
904
|
-
variants: esHijoDeOtro ? [] : ((_family$variants = family === null || family === void 0 ? void 0 : family.variants) !== null && _family$variants !== void 0 ? _family$variants : []).filter(function (v) {
|
|
905
|
-
return !v.isCurrent;
|
|
906
|
-
}),
|
|
907
|
-
groupMembers: ((_variantGroup$members = variantGroup === null || variantGroup === void 0 ? void 0 : variantGroup.members) !== null && _variantGroup$members !== void 0 ? _variantGroup$members : []).filter(function (m) {
|
|
908
|
-
return !m.isCurrent;
|
|
909
|
-
}),
|
|
910
|
-
groupCode: (_variantGroup$group = variantGroup === null || variantGroup === void 0 ? void 0 : variantGroup.group) !== null && _variantGroup$group !== void 0 ? _variantGroup$group : null,
|
|
911
|
-
saving: state.saving,
|
|
912
|
-
onCancel: function onCancel() {
|
|
913
|
-
return setPendingPropagation(null);
|
|
914
|
-
},
|
|
915
|
-
onConfirm: function onConfirm(propagation) {
|
|
916
|
-
var esDescripcion = pendingPropagation.kind === "description";
|
|
917
|
-
setPendingPropagation(null);
|
|
918
|
-
|
|
919
|
-
if (!propagation) {
|
|
920
|
-
if (esDescripcion) saveDescriptions(token);else saveDatasheets(token);
|
|
921
|
-
return;
|
|
922
|
-
}
|
|
923
|
-
/*
|
|
924
|
-
El diálogo habla de «atributos» porque es el mismo componente
|
|
925
|
-
para las dos pestañas. Al guardar hay que ponerlo en la lista
|
|
926
|
-
que corresponde: el servidor recibe `attributes` o
|
|
927
|
-
`descriptions`, nunca una por la otra.
|
|
928
|
-
*/
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
var attributes = propagation.attributes,
|
|
932
|
-
destinos = (0, _objectWithoutProperties2.default)(propagation, _excluded);
|
|
933
|
-
|
|
934
|
-
if (esDescripcion) {
|
|
935
|
-
saveDescriptions(token, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, destinos), {}, {
|
|
936
|
-
descriptions: attributes
|
|
937
|
-
}));
|
|
938
|
-
} else {
|
|
939
|
-
saveDatasheets(token, propagation);
|
|
940
|
-
}
|
|
941
|
-
}
|
|
942
|
-
}), showLinkVariants && /*#__PURE__*/(0, _jsxRuntime.jsx)(_LinkVariantsModal.LinkVariantsModal, {
|
|
943
|
-
articleId: (_state$product3 = state.product) === null || _state$product3 === void 0 ? void 0 : _state$product3.id_article,
|
|
944
|
-
articleName: (_state$product4 = state.product) === null || _state$product4 === void 0 ? void 0 : _state$product4.name,
|
|
945
|
-
articleUpc: (_state$product5 = state.product) === null || _state$product5 === void 0 ? void 0 : _state$product5.upc,
|
|
946
|
-
activeRetailerId: (_state$active_retaile3 = state.active_retailer) === null || _state$active_retaile3 === void 0 ? void 0 : _state$active_retaile3.id_retailer,
|
|
947
|
-
token: token,
|
|
948
|
-
onClose: function onClose() {
|
|
949
|
-
return setShowLinkVariants(false);
|
|
950
|
-
},
|
|
951
|
-
onLinked: handleOnLinkedVariants
|
|
952
|
-
}), showGroupModal && /*#__PURE__*/(0, _jsxRuntime.jsx)(_VariantGroupModal.VariantGroupModal, {
|
|
953
|
-
articleId: (_state$product6 = state.product) === null || _state$product6 === void 0 ? void 0 : _state$product6.id_article,
|
|
954
|
-
articleName: (_state$product7 = state.product) === null || _state$product7 === void 0 ? void 0 : _state$product7.name,
|
|
955
|
-
articleUpc: (_state$product8 = state.product) === null || _state$product8 === void 0 ? void 0 : _state$product8.upc,
|
|
956
|
-
currentGroup: (_variantGroup$group2 = variantGroup === null || variantGroup === void 0 ? void 0 : variantGroup.group) !== null && _variantGroup$group2 !== void 0 ? _variantGroup$group2 : null,
|
|
957
|
-
token: token,
|
|
958
|
-
onClose: function onClose() {
|
|
959
|
-
return setShowGroupModal(false);
|
|
960
|
-
},
|
|
961
|
-
onSaved: function onSaved(result) {
|
|
962
|
-
setVariantGroup(result);
|
|
963
|
-
setShowGroup(true);
|
|
964
|
-
}
|
|
965
|
-
}), porDesvincular && /*#__PURE__*/(0, _jsxRuntime.jsx)(_UnlinkVariantModal.UnlinkVariantModal, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, porDesvincular), {}, {
|
|
966
|
-
token: token,
|
|
967
|
-
onClose: function onClose() {
|
|
968
|
-
return setPorDesvincular(null);
|
|
969
|
-
},
|
|
970
|
-
onUnlinked: handleOnUnlinked
|
|
971
|
-
})), /*#__PURE__*/(0, _jsxRuntime.jsx)(_RejectDialog.RejectDialog, {
|
|
972
|
-
open: showRejectModal,
|
|
973
|
-
rejectAll: rejectAll,
|
|
974
|
-
onCancel: function onCancel() {
|
|
975
|
-
return setShowRejectModal(false);
|
|
976
|
-
},
|
|
977
|
-
onConfirm: /*#__PURE__*/function () {
|
|
978
|
-
var _ref5 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4(message) {
|
|
979
|
-
return _regenerator.default.wrap(function _callee4$(_context4) {
|
|
980
|
-
while (1) {
|
|
981
|
-
switch (_context4.prev = _context4.next) {
|
|
982
|
-
case 0:
|
|
983
|
-
_context4.next = 2;
|
|
984
|
-
return createComment(message, token);
|
|
985
|
-
|
|
986
|
-
case 2:
|
|
987
|
-
rejectAll ? sendBulkEvaluation("R") : sendSingleEvaluation("R");
|
|
988
|
-
setShowRejectModal(false);
|
|
989
|
-
|
|
990
|
-
case 4:
|
|
991
|
-
case "end":
|
|
992
|
-
return _context4.stop();
|
|
993
|
-
}
|
|
994
|
-
}
|
|
995
|
-
}, _callee4);
|
|
996
|
-
}));
|
|
997
|
-
|
|
998
|
-
return function (_x5) {
|
|
999
|
-
return _ref5.apply(this, arguments);
|
|
1000
|
-
};
|
|
1001
|
-
}()
|
|
1002
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_NoticeDialog.NoticeDialog, {
|
|
1003
|
-
modal: state.modal,
|
|
1004
|
-
onClose: function onClose() {
|
|
1005
|
-
return dispatch({
|
|
1006
|
-
type: "SET_MODAL",
|
|
1007
|
-
payload: {
|
|
1008
|
-
show: false,
|
|
1009
|
-
title: "",
|
|
1010
|
-
message: "",
|
|
1011
|
-
image: null
|
|
1012
|
-
}
|
|
1013
|
-
});
|
|
1014
|
-
}
|
|
1015
|
-
}), showModal && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ImageGallery.ImageGallery, {
|
|
1016
|
-
images: state.images_values,
|
|
1017
|
-
initialIndex: state.current_image,
|
|
1018
|
-
setShowModal: setShowModal,
|
|
1019
|
-
approveRejectButtons: canShowSingleEvaluationButtons(),
|
|
1020
|
-
sendToFacilitator: handleOnSendEvaluationToFacilitator
|
|
1021
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_VersionDrawer.VersionDrawer, {
|
|
1022
|
-
open: showVersionSelector,
|
|
1023
|
-
modalId: "version-selector",
|
|
1024
|
-
articleId: state.product.id_article,
|
|
1025
|
-
setVersion: handleOnChangeProductVersion,
|
|
1026
|
-
companyName: state.product.company,
|
|
1027
|
-
currentVersion: state.product.version,
|
|
1028
|
-
setShowVersionSelector: setShowVersionSelector,
|
|
1029
|
-
jwt: token
|
|
1030
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_EditionTopBar.EditionTopBar, {
|
|
1031
|
-
setHeaderTop: setHeaderTop,
|
|
1032
|
-
auditableVersion: auditableVersion,
|
|
1033
|
-
setCompare: setCompare,
|
|
1034
|
-
isAuditor: [1, 6].includes(user.id_role),
|
|
1035
|
-
withChat: location === null || location === void 0 ? void 0 : (_location$state = location.state) === null || _location$state === void 0 ? void 0 : _location$state.withChat,
|
|
1036
|
-
chatType: location === null || location === void 0 ? void 0 : (_location$state2 = location.state) === null || _location$state2 === void 0 ? void 0 : _location$state2.chatType,
|
|
1037
|
-
productSelected: state.product,
|
|
1038
|
-
token: token,
|
|
1039
|
-
activeRetailer: {
|
|
1040
|
-
id: (_state$active_retaile4 = state.active_retailer) === null || _state$active_retaile4 === void 0 ? void 0 : _state$active_retaile4.id_retailer,
|
|
1041
|
-
name: (_state$active_retaile5 = state.active_retailer) === null || _state$active_retaile5 === void 0 ? void 0 : _state$active_retaile5.retailer
|
|
1042
|
-
}
|
|
1043
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
1044
|
-
className: "data-container",
|
|
1045
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
1046
|
-
className: "image-data-panel",
|
|
1047
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_ImagePanel.ImagePanel
|
|
1048
|
-
/*
|
|
1049
|
-
`images_values` puede ser null en pleno render: React 17 no
|
|
1050
|
-
agrupa los dispatch que van después de un `await` y hay un render
|
|
1051
|
-
con `services` puesto y las imágenes todavía no (ver el guard de
|
|
1052
|
-
arriba). Por eso las interrogaciones.
|
|
1053
|
-
*/
|
|
1054
|
-
, {
|
|
1055
|
-
imagesArray: state.images_values || [],
|
|
1056
|
-
activeImage: (_state$images_values$ = (_state$images_values = state.images_values) === null || _state$images_values === void 0 ? void 0 : (_state$images_values$2 = _state$images_values.values) === null || _state$images_values$2 === void 0 ? void 0 : _state$images_values$2[state.current_image]) !== null && _state$images_values$ !== void 0 ? _state$images_values$ : {},
|
|
1057
|
-
currentIndex: state.current_image,
|
|
1058
|
-
setActiveImage: handleOnChangeCurrentImage,
|
|
1059
|
-
setShowModal: handleOnShowModalGallery // datos de la imagen
|
|
1060
|
-
,
|
|
1061
|
-
lists: state.images_values || [],
|
|
1062
|
-
assignationsImages: state.collaborator_assignations["Imágenes"],
|
|
1063
|
-
imagesStatus: ((_state$product9 = state.product) === null || _state$product9 === void 0 ? void 0 : _state$product9.images_status) || "-",
|
|
1064
|
-
retailerSelected: (_state$active_retaile6 = state.active_retailer) === null || _state$active_retaile6 === void 0 ? void 0 : _state$active_retaile6.id_retailer,
|
|
1065
|
-
isRetailer: isRetailer,
|
|
1066
|
-
version: state.product.version,
|
|
1067
|
-
shotThd: shotThd,
|
|
1068
|
-
setShowVersionSelector: setShowVersionSelector,
|
|
1069
|
-
setImages: handleOnChangeCurrentImage,
|
|
1070
|
-
setAssignation: handleOnChangeAssignations,
|
|
1071
|
-
onClickSave: handleOnClickSaveImages,
|
|
1072
|
-
showSaveButton: userCanSave
|
|
1073
|
-
})
|
|
1074
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
1075
|
-
className: "product-information",
|
|
1076
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_ProductHeader.ProductHeader // states
|
|
1077
|
-
, {
|
|
1078
|
-
headerData: state.product,
|
|
1079
|
-
productObservation: observation,
|
|
1080
|
-
percent: (_state$active_percent = (_state$active_percent2 = state.active_percentage) === null || _state$active_percent2 === void 0 ? void 0 : (_state$active_percent3 = _state$active_percent2.percentagesGeneral) === null || _state$active_percent3 === void 0 ? void 0 : _state$active_percent3.required) !== null && _state$active_percent !== void 0 ? _state$active_percent : 0,
|
|
1081
|
-
activeRetailer: {
|
|
1082
|
-
id: (_state$active_retaile7 = state.active_retailer) === null || _state$active_retaile7 === void 0 ? void 0 : _state$active_retaile7.id_retailer,
|
|
1083
|
-
name: (_state$active_retaile8 = state.active_retailer) === null || _state$active_retaile8 === void 0 ? void 0 : _state$active_retaile8.retailer,
|
|
1084
|
-
image: (_state$active_retaile9 = state.active_retailer) === null || _state$active_retaile9 === void 0 ? void 0 : _state$active_retaile9.image
|
|
1085
|
-
},
|
|
1086
|
-
servicesData: state.services_data ? state.services_data : null,
|
|
1087
|
-
isObservationVisible: isObservationVisible // actions
|
|
1088
|
-
,
|
|
1089
|
-
setActiveRetailer: handleOnChangeActiveRetailer,
|
|
1090
|
-
approve: handleOnApproveSingleService,
|
|
1091
|
-
approveAll: handleOnApproveAllServices,
|
|
1092
|
-
reject: handleOnRejectSingleService,
|
|
1093
|
-
rejectAll: handleOnRejectAllServices,
|
|
1094
|
-
toggleObservation: handleOnToggleObservation,
|
|
1095
|
-
hideObservation: handleOnHideObservation // sendToFacilitator={handleOnSendEvaluationToFacilitator} // No se usa?
|
|
1096
|
-
// validations
|
|
1097
|
-
// La evaluación de todos los servicios a la vez sigue en el hook
|
|
1098
|
-
// (canShowBulkEvaluationButtons); pasa a permissions.js en la fase 2.
|
|
1099
|
-
,
|
|
1100
|
-
showApproveRejectAll: canShowBulkEvaluationButtons() || userCanSave // Validar o rechazar aplica al servicio abierto con editor: no en
|
|
1101
|
-
// el Resumen ni en los servicios sin editor.
|
|
1102
|
-
,
|
|
1103
|
-
showValidationButtons: isClassic && userCanEvaluate && userCanSave
|
|
1104
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_VariantsPanel.VariantsPanel, {
|
|
1105
|
-
product: state.product,
|
|
1106
|
-
esHijoDeOtro: esHijoDeOtro,
|
|
1107
|
-
hijosDelProducto: hijosDelProducto,
|
|
1108
|
-
family: family,
|
|
1109
|
-
showFamily: showFamily,
|
|
1110
|
-
setShowFamily: setShowFamily,
|
|
1111
|
-
loadFamily: loadFamily,
|
|
1112
|
-
loadingVariant: loadingVariant,
|
|
1113
|
-
avisoFamilia: avisoFamilia,
|
|
1114
|
-
openFamilyMember: openFamilyMember,
|
|
1115
|
-
setPorDesvincular: setPorDesvincular,
|
|
1116
|
-
setShowLinkVariants: setShowLinkVariants,
|
|
1117
|
-
puedeAgruparse: puedeAgruparse,
|
|
1118
|
-
variantGroup: variantGroup,
|
|
1119
|
-
showGroup: showGroup,
|
|
1120
|
-
setShowGroup: setShowGroup,
|
|
1121
|
-
setShowGroupModal: setShowGroupModal,
|
|
1122
|
-
handleOnLeaveGroup: handleOnLeaveGroup
|
|
1123
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ServiceHeader.ServiceHeader, {
|
|
1124
|
-
service: selectedService,
|
|
1125
|
-
isSummary: isSummary,
|
|
1126
|
-
subtitle: isSummary ? "".concat(services.length, " servicios \xB7 ").concat(pendingCount, " te ").concat(pendingCount === 1 ? "toca" : "tocan", " a ti") : null,
|
|
1127
|
-
onOpenRail: !single && !isDesktop ? function () {
|
|
1128
|
-
return setRailOpen(true);
|
|
1129
|
-
} : undefined,
|
|
1130
|
-
team: isClassic ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_ServiceTeam.ServiceTeam, {
|
|
1131
|
-
assignees: selectedService.assignees,
|
|
1132
|
-
userId: user === null || user === void 0 ? void 0 : user.id_user,
|
|
1133
|
-
canAssign: (0, _permissions.canAssign)(user),
|
|
1134
|
-
assig: (_state$collaborator_a = state.collaborator_assignations) === null || _state$collaborator_a === void 0 ? void 0 : _state$collaborator_a[state.active_tab] // La que sí asigna (POST a asignaciones y actualiza el
|
|
1135
|
-
// producto). La barra de pestañas usaba `handleOnSetAssignation`,
|
|
1136
|
-
// que en el hook está vacía: asignar desde ahí no hacía nada.
|
|
1137
|
-
,
|
|
1138
|
-
setAssignation: handleOnChangeAssignations,
|
|
1139
|
-
resetKey: state.active_tab
|
|
1140
|
-
}) : catalogService ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_ServiceTeam.ServiceTeam, {
|
|
1141
|
-
assignees: catalogService.assignees,
|
|
1142
|
-
userId: user === null || user === void 0 ? void 0 : user.id_user,
|
|
1143
|
-
roles: catalogService.api.roles,
|
|
1144
|
-
canAssign: catalogCanAssign,
|
|
1145
|
-
assig: {
|
|
1146
|
-
collaborators: assignables
|
|
1147
|
-
},
|
|
1148
|
-
setAssignation: handleOnAssignCatalogService,
|
|
1149
|
-
resetKey: catalogService.service_name
|
|
1150
|
-
}) : null,
|
|
1151
|
-
children: isClassic && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ServiceTools.ServiceTools, {
|
|
1152
|
-
imagesSection: state.active_tab === "Imágenes",
|
|
1153
|
-
imageLayout: imageLayout,
|
|
1154
|
-
setImageLayout: handleOnToggleImageLayout // El botón actúa sobre la bandeja visible: en activos descargaba
|
|
1155
|
-
// las imágenes del producto, que no es lo que el usuario pidió.
|
|
1156
|
-
,
|
|
1157
|
-
downloadImages: currentTray === _GalleryTrayTabs.TRAYS.ASSETS ? handleOnDownloadAssets : handleOnDownloadImages,
|
|
1158
|
-
askToDeleteImages: handleOnAskToDeleteImages,
|
|
1159
|
-
onClickSave: handleOnClickSave,
|
|
1160
|
-
showSaveButton: userCanSave,
|
|
1161
|
-
version: state.product.version,
|
|
1162
|
-
setShowVersionSelector: setShowVersionSelector
|
|
1163
|
-
})
|
|
1164
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
1165
|
-
className: "services-information-container",
|
|
1166
|
-
id: "services-information-container",
|
|
1167
|
-
children: selected !== null && !isClassic ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Box, {
|
|
1168
|
-
sx: {
|
|
1169
|
-
pb: 2
|
|
1170
|
-
},
|
|
1171
|
-
children: catalogService ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_CatalogServicePanel.CatalogServicePanel, {
|
|
1172
|
-
service: catalogService,
|
|
1173
|
-
onSetStatus: handleOnSetCatalogStatus
|
|
1174
|
-
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_views.ServiceView, {
|
|
1175
|
-
selected: isSummary ? _model.SUMMARY : selected,
|
|
1176
|
-
service: selectedService,
|
|
1177
|
-
services: services,
|
|
1178
|
-
userId: user === null || user === void 0 ? void 0 : user.id_user,
|
|
1179
|
-
onSelect: requestService,
|
|
1180
|
-
retailerName: (_state$active_retaile10 = state.active_retailer) === null || _state$active_retaile10 === void 0 ? void 0 : _state$active_retaile10.retailer
|
|
1181
|
-
})
|
|
1182
|
-
}) : state.saving ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Stack, {
|
|
1183
|
-
alignItems: "center",
|
|
1184
|
-
justifyContent: "center",
|
|
1185
|
-
sx: {
|
|
1186
|
-
py: 6
|
|
1187
|
-
},
|
|
1188
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.CircularProgress, {
|
|
1189
|
-
size: 32,
|
|
1190
|
-
sx: {
|
|
1191
|
-
color: _tokens.COLORS.magenta_s2
|
|
1192
|
-
}
|
|
1193
|
-
})
|
|
1194
|
-
}) : /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
1195
|
-
children: [state.active_tab === "Descripción" && (((_state$product10 = state.product) === null || _state$product10 === void 0 ? void 0 : _state$product10.description_status) !== "NS" ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_InputGroup.InputGroup, {
|
|
1196
|
-
activeSection: state.active_tab,
|
|
1197
|
-
inputGroup: state.descriptions_inputs[0],
|
|
1198
|
-
updatedDescriptions: state.updated_descriptions_inputs
|
|
1199
|
-
/* El parentesco es del producto, no del servicio: los
|
|
1200
|
-
dos endpoints lo devuelven igual. */
|
|
1201
|
-
,
|
|
1202
|
-
variant: (_state$services2 = state.services) === null || _state$services2 === void 0 ? void 0 : (_state$services2$data = _state$services2.datasheets) === null || _state$services2$data === void 0 ? void 0 : _state$services2$data.variant,
|
|
1203
|
-
onRestoreInheritance: handleOnRestoreInheritance,
|
|
1204
|
-
articleId: (_state$product11 = state.product) === null || _state$product11 === void 0 ? void 0 : _state$product11.id_article,
|
|
1205
|
-
version: state.product.version,
|
|
1206
|
-
auditInputGroup: auditDescriptions[0],
|
|
1207
|
-
setUpdatedDescriptions: handleOnSetUpdatedDescriptions,
|
|
1208
|
-
dinamicHeight: true,
|
|
1209
|
-
compare: compare
|
|
1210
|
-
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(NoService, {})), state.active_tab === "Ficha técnica" && (((_state$product12 = state.product) === null || _state$product12 === void 0 ? void 0 : _state$product12.datasheet_status) !== "NS" ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
|
|
1211
|
-
children: (_state$datasheets_inp = state.datasheets_inputs[0]) === null || _state$datasheets_inp === void 0 ? void 0 : (_state$datasheets_inp2 = _state$datasheets_inp.data) === null || _state$datasheets_inp2 === void 0 ? void 0 : _state$datasheets_inp2.map(function (dataGroup, index) {
|
|
1212
|
-
var _state$services3, _state$services3$data;
|
|
1213
|
-
|
|
1214
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_InputGroup.InputGroup, {
|
|
1215
|
-
articleId: state.product.id_article,
|
|
1216
|
-
version: state.version,
|
|
1217
|
-
activeSection: state.active_tab,
|
|
1218
|
-
inputGroup: dataGroup,
|
|
1219
|
-
dataInputs: state.datasheets_inputs[1],
|
|
1220
|
-
variant: (_state$services3 = state.services) === null || _state$services3 === void 0 ? void 0 : (_state$services3$data = _state$services3.datasheets) === null || _state$services3$data === void 0 ? void 0 : _state$services3$data.variant,
|
|
1221
|
-
onRestoreInheritance: handleOnRestoreInheritance,
|
|
1222
|
-
auditInputs: auditDatasheets[1],
|
|
1223
|
-
updatedDatasheets: state.updated_datasheets_inputs,
|
|
1224
|
-
setUpdatedDatasheets: handleOnSetUpdatedDatasheets,
|
|
1225
|
-
compare: compare
|
|
1226
|
-
}, index + "-" + state.active_retailer.retailer);
|
|
1227
|
-
})
|
|
1228
|
-
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(NoService, {})), state.active_tab === "Imágenes" && (((_state$product13 = state.product) === null || _state$product13 === void 0 ? void 0 : _state$product13.images_status) !== "NS" ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_ImagesSection.ImagesSection, {
|
|
1229
|
-
imagesValues: state.images_values,
|
|
1230
|
-
selectedImages: state.selected_images,
|
|
1231
|
-
imageLayout: imageLayout,
|
|
1232
|
-
enableDigitalAssets: enableDigitalAssets,
|
|
1233
|
-
currentTray: currentTray,
|
|
1234
|
-
setActiveTray: setActiveTray,
|
|
1235
|
-
digitalAssets: digitalAssets,
|
|
1236
|
-
unsavedAssets: (0, _assets.countUnsavedAssets)(state),
|
|
1237
|
-
selectedAssets: state.selected_assets,
|
|
1238
|
-
setSelectedAssets: handleOnSetSelectedAssets,
|
|
1239
|
-
setAllAssetsChecked: handleOnSetAllAssetsChecked,
|
|
1240
|
-
canEdit: userCanSave,
|
|
1241
|
-
setCheckAll: handleOnSetCheckAll,
|
|
1242
|
-
setSelectedImages: handleOnSetSelectedImages,
|
|
1243
|
-
onChangeCurrentImage: handleOnChangeCurrentImage,
|
|
1244
|
-
onUpdateImage: function onUpdateImage(item) {
|
|
1245
|
-
return dispatch({
|
|
1246
|
-
type: "UPDATE_IMAGE_VALUE",
|
|
1247
|
-
payload: item
|
|
1248
|
-
});
|
|
1249
|
-
},
|
|
1250
|
-
onSelectImage: function onSelectImage(item) {
|
|
1251
|
-
return dispatch({
|
|
1252
|
-
type: "SET_SELECTED_IMAGE",
|
|
1253
|
-
payload: item
|
|
1254
|
-
});
|
|
1255
|
-
},
|
|
1256
|
-
getRootProps: getRootProps,
|
|
1257
|
-
getInputProps: getInputProps,
|
|
1258
|
-
isDragActive: isDragActive,
|
|
1259
|
-
openFilePicker: open
|
|
1260
|
-
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(NoService, {}))]
|
|
1261
|
-
})
|
|
1262
|
-
}), isClassic && userCanSave && state.product["".concat((0, _utils.getConceptByTab)(state.active_tab), "_status")] !== "NS" && /*#__PURE__*/(0, _jsxRuntime.jsx)(_CommentBox.CommentBox, {
|
|
1263
|
-
comment: state.comment,
|
|
1264
|
-
crossComment: crossComment,
|
|
1265
|
-
createComment: createComment,
|
|
1266
|
-
token: token,
|
|
1267
|
-
dispatch: dispatch,
|
|
1268
|
-
showChangeStatus: (0, _permissions.canChangeStatus)(user, _constants.allowedAccountsToViewChangeStatus),
|
|
1269
|
-
onOpenChangeStatus: function onOpenChangeStatus() {
|
|
1270
|
-
return setOpenChangeStatusModal(true);
|
|
1271
|
-
},
|
|
1272
|
-
showSendEvaluation: (0, _permissions.canSendToFacilitator)(user) // Solo para los roles 7 y 8, como en la vista original: para
|
|
1273
|
-
// el rol 6, `isEvaluationFinished` usa un `srv` que no existe
|
|
1274
|
-
// (defecto heredado) y tumbaría la pantalla.
|
|
1275
|
-
,
|
|
1276
|
-
canSendEvaluation: (0, _permissions.canSendToFacilitator)(user) && isEvaluationFinished(user.id_role, state.active_tab, statusArray) && state.missing_required_fields[state.active_tab] === 0,
|
|
1277
|
-
onSendEvaluation: handleOnSendEvaluationToFacilitator
|
|
1278
|
-
})]
|
|
1279
|
-
})]
|
|
1280
|
-
})]
|
|
1281
|
-
}), !single && isDesktop && renderRail("rail")]
|
|
1282
|
-
}), !single && !isDesktop && /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Drawer, {
|
|
1283
|
-
anchor: RAIL_SIDE,
|
|
1284
|
-
open: railOpen,
|
|
1285
|
-
onClose: function onClose() {
|
|
1286
|
-
return setRailOpen(false);
|
|
1287
|
-
},
|
|
1288
|
-
PaperProps: {
|
|
1289
|
-
sx: {
|
|
1290
|
-
width: "min(320px, 88vw)"
|
|
1291
|
-
}
|
|
1292
|
-
},
|
|
1293
|
-
children: renderRail("drawer")
|
|
1294
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.Dialog, {
|
|
1295
|
-
open: Boolean(pendingSelection),
|
|
1296
|
-
onClose: function onClose() {
|
|
1297
|
-
return setPendingSelection(null);
|
|
1298
|
-
},
|
|
1299
|
-
maxWidth: "xs",
|
|
1300
|
-
fullWidth: true,
|
|
1301
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.DialogTitle, {
|
|
1302
|
-
sx: {
|
|
1303
|
-
fontFamily: _tokens.FONTS.Raleway_600,
|
|
1304
|
-
color: _tokens.COLORS.s5
|
|
1305
|
-
},
|
|
1306
|
-
children: "Cambios sin Guardar"
|
|
1307
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.DialogContent, {
|
|
1308
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.DialogContentText, {
|
|
1309
|
-
sx: {
|
|
1310
|
-
fontFamily: _tokens.FONTS.AvenirNext
|
|
1311
|
-
},
|
|
1312
|
-
children: "Est\xE1s cambiando de servicio y aun no guardas cambios \xBFEst\xE1s seguro?"
|
|
1313
|
-
})
|
|
1314
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.DialogActions, {
|
|
1315
|
-
sx: {
|
|
1316
|
-
px: 3,
|
|
1317
|
-
pb: 2
|
|
1318
|
-
},
|
|
1319
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Button, {
|
|
1320
|
-
onClick: function onClick() {
|
|
1321
|
-
return setPendingSelection(null);
|
|
1322
|
-
},
|
|
1323
|
-
sx: {
|
|
1324
|
-
color: _tokens.COLORS.s5,
|
|
1325
|
-
textTransform: "none"
|
|
1326
|
-
},
|
|
1327
|
-
children: "Cancelar"
|
|
1328
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Button, {
|
|
1329
|
-
variant: "contained",
|
|
1330
|
-
disableElevation: true,
|
|
1331
|
-
onClick: confirmServiceChange,
|
|
1332
|
-
sx: {
|
|
1333
|
-
textTransform: "none",
|
|
1334
|
-
borderRadius: "20px",
|
|
1335
|
-
bgcolor: _tokens.COLORS.magenta_s2,
|
|
1336
|
-
"&:hover": {
|
|
1337
|
-
bgcolor: _tokens.COLORS.secondary_magenta
|
|
1338
|
-
}
|
|
1339
|
-
},
|
|
1340
|
-
children: "Aceptar"
|
|
1341
|
-
})]
|
|
1342
|
-
})]
|
|
1343
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.ReusedModalsStyles, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChangeStatusModal.default, {
|
|
1344
|
-
state: state,
|
|
1345
|
-
open: openChangeStatusModal,
|
|
1346
|
-
onClose: function onClose() {
|
|
1347
|
-
setOpenChangeStatusModal(false);
|
|
1348
|
-
},
|
|
1349
|
-
reloadData: loadData,
|
|
1350
|
-
token: token
|
|
1351
|
-
})]
|
|
1352
|
-
});
|
|
1353
|
-
};
|
|
1354
|
-
|
|
1355
|
-
exports.ProductEditionView = ProductEditionView;
|