contentoh-components-library 21.6.61 → 21.6.62
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/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/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/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/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
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.generateAttributePrompt = void 0;
|
|
7
|
+
|
|
8
|
+
var generateAttributePrompt = function generateAttributePrompt(_ref) {
|
|
9
|
+
var _ref$upc = _ref.upc,
|
|
10
|
+
upc = _ref$upc === void 0 ? 0 : _ref$upc,
|
|
11
|
+
_ref$inputName = _ref.inputName,
|
|
12
|
+
inputName = _ref$inputName === void 0 ? "" : _ref$inputName,
|
|
13
|
+
_ref$description = _ref.description,
|
|
14
|
+
description = _ref$description === void 0 ? "" : _ref$description,
|
|
15
|
+
_ref$currentValue = _ref.currentValue,
|
|
16
|
+
currentValue = _ref$currentValue === void 0 ? "" : _ref$currentValue,
|
|
17
|
+
_ref$name = _ref.name,
|
|
18
|
+
name = _ref$name === void 0 ? "" : _ref$name,
|
|
19
|
+
_ref$category = _ref.category,
|
|
20
|
+
category = _ref$category === void 0 ? "" : _ref$category,
|
|
21
|
+
_ref$retailer = _ref.retailer,
|
|
22
|
+
retailer = _ref$retailer === void 0 ? "" : _ref$retailer,
|
|
23
|
+
_ref$maxChar = _ref.maxChar,
|
|
24
|
+
maxChar = _ref$maxChar === void 0 ? 100 : _ref$maxChar;
|
|
25
|
+
return "\n Eres un especialista en la generaci\xF3n, optimizaci\xF3n, mejora y captura de atributos de la ficha t\xE9cnica de productos para cat\xE1logos en l\xEDnea.\n Tu tarea es crear atributos claros, concisos y relevantes que resalten las caracter\xEDsticas y beneficios del producto, utilizando un lenguaje preciso y adaptado al p\xFAblico objetivo.\n\n Datos del producto:\n - UPC: ".concat(upc, "\n - Nombre del producto: ").concat(name, "\n - Categor\xEDa: ").concat(category, "\n - Nombre del atributo: ").concat(inputName, "\n - Requerimiento del atributo: ").concat(description, "\n - Valor actual del atributo: ").concat(currentValue, "\n - Cadena comercial dirigida: ").concat(retailer, "\n\n Instrucciones:\n 1. Analiza el nombre del producto y la categor\xEDa para entender su contexto.\n 2. Analiza la descripci\xF3n del atributo actual del producto.\n 3. Identifica la informaci\xF3n clave del atributo que sean relevantes y \xFAtiles para los clientes potenciales.\n 4. Genera una lista de atributos que:\n - Cumplan con la descripcion del atributo proporcionada, no inventes datos o cambies el contexto de lo que pide la descripci\xF3n del atributo.\n - Sean claros y f\xE1ciles de entender.\n - Destaquen las caracter\xEDsticas y beneficios clave del producto.\n - Utilicen un lenguaje preciso y adaptado al p\xFAblico objetivo.\n - Mantengan un tono profesional y coherente con la marca.\n - Aumenten la probabilidad de compra del producto.\n - No excedan los ").concat(maxChar, " caracteres en total.\n - Si existe ejemplo en la descripci\xF3n del atributo, sigue el mismo formato para generar los atributos.\n 5. No incluyas emojis ni signos especiales (*/+\xB4!\xA1?\xBF)\n 6. No repitas el encabezado: ").concat(inputName, "\n 7. No incluyas call to action, ejemplo: \"!Compra ya!\" \"!Da click!\" \"!Apurate!\"\n\n Aseg\xFArate de que los atributos generados cumplan con todas las instrucciones proporcionadas.\n\n No lo olvides, el objetivo principal es mejorar la captura de atributos para la ficha t\xE9cnica del producto para atraer, convencer y dar la informaci\xF3n completa a los clientes potenciales que puedan realizar una compra.\n ");
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
exports.generateAttributePrompt = generateAttributePrompt;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.generateDescriptionPrompt = void 0;
|
|
7
|
+
|
|
8
|
+
// Cadena y Proveedor
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* La cadena ${cadena} tiene estas reglas ${reglas} para el tipo de descripcion que es: ${descripcion}
|
|
12
|
+
*/
|
|
13
|
+
var generateDescriptionPrompt = function generateDescriptionPrompt(_ref) {
|
|
14
|
+
var _ref$upc = _ref.upc,
|
|
15
|
+
upc = _ref$upc === void 0 ? 0 : _ref$upc,
|
|
16
|
+
_ref$inputName = _ref.inputName,
|
|
17
|
+
inputName = _ref$inputName === void 0 ? "" : _ref$inputName,
|
|
18
|
+
_ref$description = _ref.description,
|
|
19
|
+
description = _ref$description === void 0 ? "" : _ref$description,
|
|
20
|
+
_ref$currentValue = _ref.currentValue,
|
|
21
|
+
currentValue = _ref$currentValue === void 0 ? "" : _ref$currentValue,
|
|
22
|
+
_ref$name = _ref.name,
|
|
23
|
+
name = _ref$name === void 0 ? "" : _ref$name,
|
|
24
|
+
_ref$category = _ref.category,
|
|
25
|
+
category = _ref$category === void 0 ? "" : _ref$category,
|
|
26
|
+
_ref$retailer = _ref.retailer,
|
|
27
|
+
retailer = _ref$retailer === void 0 ? "" : _ref$retailer,
|
|
28
|
+
_ref$maxChar = _ref.maxChar,
|
|
29
|
+
maxChar = _ref$maxChar === void 0 ? 100 : _ref$maxChar;
|
|
30
|
+
return "\n Eres un especialista en la generaci\xF3n, optimizaci\xF3n y mejora de descripciones de productos para cat\xE1logos en l\xEDnea.\n Tu tarea es crear descripciones claras, concisas y atractivas que resalten las caracter\xEDsticas y beneficios del producto, utilizando un lenguaje persuasivo y adaptado al p\xFAblico objetivo.\n\n Datos del producto:\n - UPC: ".concat(upc, "\n - Nombre del producto: ").concat(name, "\n - Categor\xEDa: ").concat(category, "\n - Encabezado de la descripci\xF3n: ").concat(inputName, "\n - Requerimiento de la descripcion: ").concat(description, "\n - Descripcion actual del producto: ").concat(currentValue, "\n - Cadena comercial dirigida: ").concat(retailer, "\n\n Instrucciones:\n 1. Analiza la descripci\xF3n actual del producto en caso de tenerla.\n 2. Identifica \xE1reas de mejora, como claridad, concisi\xF3n, atractivo y relevancia.\n 3. Genera una descripci\xF3n que:\n - Sea clara y f\xE1cil de entender.\n - Destaque las caracter\xEDsticas y beneficios clave del producto.\n - Utilice un lenguaje persuasivo y adaptado al p\xFAblico objetivo.\n - Mantenga un tono profesional y coherente con la marca.\n - No exceda los ").concat(maxChar, " caracteres.\n - Aumente la probabilidad de compra del producto, utilizando persuasi\xF3n en la necesidad de compra del producto.\n 4. No incluyas emojis ni signos especiales (*/+\xB4!\xA1?\xBF)\n 5. No repitas el encabezado: ").concat(inputName, "\n 6. No incluyas call to action, ejemplo: \"!Compra ya!\" \"!Da click!\" \"!Apurate!\"\n\n\n Aseg\xFArate de que la descripci\xF3n generada cumpla con todas las instrucciones proporcionadas.\n\n No lo olvides, el objetivo principal es mejorar la descripci\xF3n del producto para atraer y convencer a los clientes potenciales de realizar una compra. Eres un experto en marketing y redacci\xF3n persuasiva.\n\n Nota: No estas hablando con los clientes, estas descripciones ir\xE1n en la tienda de E-commerce de la cadena comercial. No realices saludos, despedidas, sugerencias\n ");
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
exports.generateDescriptionPrompt = generateDescriptionPrompt;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var schema = {
|
|
8
|
+
type: "object",
|
|
9
|
+
properties: {
|
|
10
|
+
results: {
|
|
11
|
+
type: "array",
|
|
12
|
+
items: {
|
|
13
|
+
type: "object",
|
|
14
|
+
properties: {
|
|
15
|
+
label: {
|
|
16
|
+
type: "string"
|
|
17
|
+
},
|
|
18
|
+
value: {
|
|
19
|
+
type: "string"
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
maxItems: 3
|
|
24
|
+
},
|
|
25
|
+
compliance_warnings: {
|
|
26
|
+
type: "array",
|
|
27
|
+
items: {
|
|
28
|
+
type: "string"
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
required: ["results"]
|
|
33
|
+
};
|
|
34
|
+
var _default = schema;
|
|
35
|
+
exports.default = _default;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var schema = {
|
|
8
|
+
type: "object",
|
|
9
|
+
properties: {
|
|
10
|
+
results: {
|
|
11
|
+
type: "array",
|
|
12
|
+
items: {
|
|
13
|
+
type: "object",
|
|
14
|
+
properties: {
|
|
15
|
+
value: {
|
|
16
|
+
type: "string"
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
minItems: 1,
|
|
21
|
+
maxItems: 3
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
required: ["results"]
|
|
25
|
+
};
|
|
26
|
+
var _default = schema;
|
|
27
|
+
exports.default = _default;
|
|
@@ -87,7 +87,7 @@ var NoService = function NoService() {
|
|
|
87
87
|
};
|
|
88
88
|
|
|
89
89
|
var CreatorsProductEditionView = function CreatorsProductEditionView(_ref) {
|
|
90
|
-
var _state$errors, _pendingPropagation$k, _family$variants, _variantGroup$members, _variantGroup$group, _state$product, _state$product2, _state$product3, _state$active_retaile, _state$product4, _state$product5, _state$product6, _variantGroup$group2, _location$state, _location$state2, _state$active_retaile2, _state$active_retaile3, _state$images_values$, _state$images_values, _state$images_values$2, _state$product7, _state$active_retaile4, _state$active_percent, _state$active_percent2, _state$active_percent3, _state$active_retaile5, _state$active_retaile6, _state$active_retaile7, _state$product8, _state$services, _state$services$datas, _state$product9, _state$product10, _state$datasheets_inp, _state$datasheets_inp2
|
|
90
|
+
var _state$errors, _pendingPropagation$k, _family$variants, _variantGroup$members, _variantGroup$group, _state$product, _state$product2, _state$product3, _state$active_retaile, _state$product4, _state$product5, _state$product6, _variantGroup$group2, _location$state, _location$state2, _state$active_retaile2, _state$active_retaile3, _state$images_values$, _state$images_values, _state$images_values$2, _state$product7, _state$active_retaile4, _state$active_percent, _state$active_percent2, _state$active_percent3, _state$active_retaile5, _state$active_retaile6, _state$active_retaile7, _state$product8, _state$services, _state$services$datas, _state$product9, _state$product10, _state$datasheets_inp, _state$datasheets_inp2;
|
|
91
91
|
|
|
92
92
|
var tabsSections = _ref.tabsSections,
|
|
93
93
|
_ref$productSelected = _ref.productSelected,
|
|
@@ -110,6 +110,8 @@ var CreatorsProductEditionView = function CreatorsProductEditionView(_ref) {
|
|
|
110
110
|
isRetailer = _useCreatorsProductEd.isRetailer,
|
|
111
111
|
digitalAssets = _useCreatorsProductEd.digitalAssets,
|
|
112
112
|
currentTray = _useCreatorsProductEd.currentTray,
|
|
113
|
+
hasImagesService = _useCreatorsProductEd.hasImagesService,
|
|
114
|
+
canEditAssets = _useCreatorsProductEd.canEditAssets,
|
|
113
115
|
assetsLoadedFor = _useCreatorsProductEd.assetsLoadedFor,
|
|
114
116
|
handleOnSetSelectedAssets = _useCreatorsProductEd.handleOnSetSelectedAssets,
|
|
115
117
|
handleOnSetAllAssetsChecked = _useCreatorsProductEd.handleOnSetAllAssetsChecked,
|
|
@@ -738,8 +740,11 @@ var CreatorsProductEditionView = function CreatorsProductEditionView(_ref) {
|
|
|
738
740
|
// las imágenes del producto, que no es lo que el usuario pidió.
|
|
739
741
|
,
|
|
740
742
|
downloadImages: currentTray === _GalleryTrayTabs.TRAYS.ASSETS ? handleOnDownloadAssets : handleOnDownloadImages,
|
|
741
|
-
askToDeleteImages: handleOnAskToDeleteImages
|
|
742
|
-
|
|
743
|
+
askToDeleteImages: handleOnAskToDeleteImages // En la bandeja de activos el permiso es el de los activos: sin
|
|
744
|
+
// servicio de imágenes nadie está asignado a él y el botón de
|
|
745
|
+
// guardar desaparecería justo donde sí hay algo que guardar.
|
|
746
|
+
,
|
|
747
|
+
showSaveButton: currentTray === _GalleryTrayTabs.TRAYS.ASSETS ? canEditAssets() : isAuditorAssigned() || isUserAssignedToService(),
|
|
743
748
|
onClickSave: handleOnClickSave // validations
|
|
744
749
|
,
|
|
745
750
|
canAssign: ![7, 8].includes(user.id_role)
|
|
@@ -792,11 +797,12 @@ var CreatorsProductEditionView = function CreatorsProductEditionView(_ref) {
|
|
|
792
797
|
compare: compare
|
|
793
798
|
}, index + "-" + state.active_retailer.retailer);
|
|
794
799
|
})
|
|
795
|
-
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(NoService, {})), state.active_tab === "Imágenes" && (
|
|
800
|
+
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(NoService, {})), state.active_tab === "Imágenes" && (hasImagesService || enableDigitalAssets ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_ImagesSection.ImagesSection, {
|
|
796
801
|
imagesValues: state.images_values,
|
|
797
802
|
selectedImages: state.selected_images,
|
|
798
803
|
imageLayout: imageLayout,
|
|
799
804
|
enableDigitalAssets: enableDigitalAssets,
|
|
805
|
+
hasImagesService: hasImagesService,
|
|
800
806
|
currentTray: currentTray,
|
|
801
807
|
setActiveTray: setActiveTray,
|
|
802
808
|
digitalAssets: digitalAssets,
|
|
@@ -804,7 +810,7 @@ var CreatorsProductEditionView = function CreatorsProductEditionView(_ref) {
|
|
|
804
810
|
selectedAssets: state.selected_assets,
|
|
805
811
|
setSelectedAssets: handleOnSetSelectedAssets,
|
|
806
812
|
setAllAssetsChecked: handleOnSetAllAssetsChecked,
|
|
807
|
-
canEdit: isAuditorAssigned() || isUserAssignedToService(),
|
|
813
|
+
canEdit: currentTray === _GalleryTrayTabs.TRAYS.ASSETS ? canEditAssets() : isAuditorAssigned() || isUserAssignedToService(),
|
|
808
814
|
setCheckAll: handleOnSetCheckAll,
|
|
809
815
|
setSelectedImages: handleOnSetSelectedImages,
|
|
810
816
|
onChangeCurrentImage: handleOnChangeCurrentImage,
|
|
@@ -86,7 +86,7 @@ function obtenerDuracionVideoBase64(base64Data) {
|
|
|
86
86
|
}
|
|
87
87
|
|
|
88
88
|
var useCreatorsProductEdition = function useCreatorsProductEdition(_ref) {
|
|
89
|
-
var _state$product$id_art, _state$product, _state$
|
|
89
|
+
var _state$product$id_art, _state$product, _state$product2, _state$product12, _family$variants, _state$product13, _state$product17;
|
|
90
90
|
|
|
91
91
|
var tabsSections = _ref.tabsSections,
|
|
92
92
|
_ref$productSelected = _ref.productSelected,
|
|
@@ -438,8 +438,15 @@ var useCreatorsProductEdition = function useCreatorsProductEdition(_ref) {
|
|
|
438
438
|
_useState60 = (0, _slicedToArray2.default)(_useState59, 2),
|
|
439
439
|
activeTray = _useState60[0],
|
|
440
440
|
setActiveTray = _useState60[1];
|
|
441
|
+
/*
|
|
442
|
+
Los activos digitales no pertenecen al servicio de imágenes: se suben
|
|
443
|
+
aunque el producto no lo tenga contratado. Sin ese servicio solo queda su
|
|
444
|
+
bandeja, así que la vista abre directamente en ella.
|
|
445
|
+
*/
|
|
446
|
+
|
|
441
447
|
|
|
442
|
-
var
|
|
448
|
+
var hasImagesService = ((_state$product2 = state.product) === null || _state$product2 === void 0 ? void 0 : _state$product2.images_status) !== "NS";
|
|
449
|
+
var currentTray = !enableDigitalAssets ? _GalleryTrayTabs.TRAYS.IMAGES : hasImagesService ? activeTray : _GalleryTrayTabs.TRAYS.ASSETS;
|
|
443
450
|
/*
|
|
444
451
|
De qué artículo se cargaron ya los activos.
|
|
445
452
|
`loadData` se vuelve a ejecutar cada vez que cambia la cadena activa, pero los
|
|
@@ -573,7 +580,7 @@ var useCreatorsProductEdition = function useCreatorsProductEdition(_ref) {
|
|
|
573
580
|
|
|
574
581
|
var loadAuditableData = /*#__PURE__*/function () {
|
|
575
582
|
var _ref4 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
|
|
576
|
-
var _state$
|
|
583
|
+
var _state$product3, _state$product4, _state$product5;
|
|
577
584
|
|
|
578
585
|
var auditServices;
|
|
579
586
|
return _regenerator.default.wrap(function _callee3$(_context3) {
|
|
@@ -581,7 +588,7 @@ var useCreatorsProductEdition = function useCreatorsProductEdition(_ref) {
|
|
|
581
588
|
switch (_context3.prev = _context3.next) {
|
|
582
589
|
case 0:
|
|
583
590
|
_context3.next = 2;
|
|
584
|
-
return (0, _data.getRetailerServices)((_state$
|
|
591
|
+
return (0, _data.getRetailerServices)((_state$product3 = state.product) === null || _state$product3 === void 0 ? void 0 : _state$product3.id_article, (_state$product4 = state.product) === null || _state$product4 === void 0 ? void 0 : _state$product4.categoryName, parseInt((_state$product5 = state.product) === null || _state$product5 === void 0 ? void 0 : _state$product5.id_category), auditableVersion.version, token);
|
|
585
592
|
|
|
586
593
|
case 2:
|
|
587
594
|
auditServices = _context3.sent;
|
|
@@ -627,7 +634,7 @@ var useCreatorsProductEdition = function useCreatorsProductEdition(_ref) {
|
|
|
627
634
|
_state$active_retaile2,
|
|
628
635
|
_services$0$inputs,
|
|
629
636
|
_services$2,
|
|
630
|
-
_state$
|
|
637
|
+
_state$product6,
|
|
631
638
|
id_article,
|
|
632
639
|
version,
|
|
633
640
|
id_order,
|
|
@@ -673,7 +680,7 @@ var useCreatorsProductEdition = function useCreatorsProductEdition(_ref) {
|
|
|
673
680
|
type: "SET_ERRORS",
|
|
674
681
|
payload: []
|
|
675
682
|
});
|
|
676
|
-
_state$
|
|
683
|
+
_state$product6 = state.product, id_article = _state$product6.id_article, version = _state$product6.version, id_order = _state$product6.id_order;
|
|
677
684
|
_state$active_retaile = state.active_retailer, category = _state$active_retaile.category, id_category = _state$active_retaile.id_category, id_retailer = _state$active_retaile.id_retailer; // Payloads y headers
|
|
678
685
|
|
|
679
686
|
data = [{
|
|
@@ -968,9 +975,9 @@ var useCreatorsProductEdition = function useCreatorsProductEdition(_ref) {
|
|
|
968
975
|
};
|
|
969
976
|
|
|
970
977
|
var isAuditorAssigned = function isAuditorAssigned() {
|
|
971
|
-
var _state$
|
|
978
|
+
var _state$product7;
|
|
972
979
|
|
|
973
|
-
return ((_state$
|
|
980
|
+
return ((_state$product7 = state.product) === null || _state$product7 === void 0 ? void 0 : _state$product7.id_auditor) === (user === null || user === void 0 ? void 0 : user.id_user);
|
|
974
981
|
};
|
|
975
982
|
/**
|
|
976
983
|
* ¿Ocupo este slot EN ESTE producto?
|
|
@@ -983,9 +990,9 @@ var useCreatorsProductEdition = function useCreatorsProductEdition(_ref) {
|
|
|
983
990
|
|
|
984
991
|
|
|
985
992
|
var isAssignedAs = function isAssignedAs(rol, concept) {
|
|
986
|
-
var _state$
|
|
993
|
+
var _state$product8;
|
|
987
994
|
|
|
988
|
-
var assigned = (_state$
|
|
995
|
+
var assigned = (_state$product8 = state.product) === null || _state$product8 === void 0 ? void 0 : _state$product8["id_".concat(concept, "_").concat(rol)];
|
|
989
996
|
return !!assigned && assigned === (user === null || user === void 0 ? void 0 : user.id_user);
|
|
990
997
|
};
|
|
991
998
|
|
|
@@ -1002,6 +1009,24 @@ var useCreatorsProductEdition = function useCreatorsProductEdition(_ref) {
|
|
|
1002
1009
|
var isAssigned = rol ? isAssignedAs(rol, concept) : isAssignedAs("especialist", concept) || isAssignedAs("facilitator", concept);
|
|
1003
1010
|
return isAssigned && validUser;
|
|
1004
1011
|
};
|
|
1012
|
+
/*
|
|
1013
|
+
Permiso sobre la bandeja de activos digitales.
|
|
1014
|
+
No son parte del servicio de imágenes, así que no pueden depender de estar
|
|
1015
|
+
asignado a él: sin ese servicio nadie lo está y la bandeja quedaría de solo
|
|
1016
|
+
lectura. En ese caso vale la asignación a cualquier otro servicio del
|
|
1017
|
+
producto.
|
|
1018
|
+
*/
|
|
1019
|
+
|
|
1020
|
+
|
|
1021
|
+
var canEditAssets = function canEditAssets() {
|
|
1022
|
+
if (isAuditorAssigned() || isUserAssignedToService()) return true;
|
|
1023
|
+
if (hasImagesService) return false;
|
|
1024
|
+
var allowedRoles = [1, 4, 5, 6, 7, 8];
|
|
1025
|
+
if (!allowedRoles.includes(user === null || user === void 0 ? void 0 : user.id_role)) return false;
|
|
1026
|
+
return ["description", "datasheet"].some(function (concept) {
|
|
1027
|
+
return isAssignedAs("especialist", concept) || isAssignedAs("facilitator", concept);
|
|
1028
|
+
});
|
|
1029
|
+
};
|
|
1005
1030
|
|
|
1006
1031
|
var canShowSingleEvaluationButtons = function canShowSingleEvaluationButtons(action) {
|
|
1007
1032
|
var _state$services_data, _state$services_data$, _state$services_data$2;
|
|
@@ -1111,7 +1136,7 @@ var useCreatorsProductEdition = function useCreatorsProductEdition(_ref) {
|
|
|
1111
1136
|
|
|
1112
1137
|
var handleOnClickSaveImages = /*#__PURE__*/function () {
|
|
1113
1138
|
var _ref10 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6() {
|
|
1114
|
-
var _state$
|
|
1139
|
+
var _state$product9, _state$product9$servi;
|
|
1115
1140
|
|
|
1116
1141
|
return _regenerator.default.wrap(function _callee6$(_context6) {
|
|
1117
1142
|
while (1) {
|
|
@@ -1129,7 +1154,7 @@ var useCreatorsProductEdition = function useCreatorsProductEdition(_ref) {
|
|
|
1129
1154
|
return _context6.abrupt("return");
|
|
1130
1155
|
|
|
1131
1156
|
case 4:
|
|
1132
|
-
if (!(((_state$
|
|
1157
|
+
if (!(((_state$product9 = state.product) === null || _state$product9 === void 0 ? void 0 : (_state$product9$servi = _state$product9.services) === null || _state$product9$servi === void 0 ? void 0 : _state$product9$servi.images) === 1)) {
|
|
1133
1158
|
_context6.next = 9;
|
|
1134
1159
|
break;
|
|
1135
1160
|
}
|
|
@@ -1163,7 +1188,7 @@ var useCreatorsProductEdition = function useCreatorsProductEdition(_ref) {
|
|
|
1163
1188
|
var loadFamily = /*#__PURE__*/function () {
|
|
1164
1189
|
var _ref11 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee7() {
|
|
1165
1190
|
var forzar,
|
|
1166
|
-
_state$
|
|
1191
|
+
_state$product10,
|
|
1167
1192
|
res,
|
|
1168
1193
|
data,
|
|
1169
1194
|
_args7 = arguments;
|
|
@@ -1185,7 +1210,7 @@ var useCreatorsProductEdition = function useCreatorsProductEdition(_ref) {
|
|
|
1185
1210
|
_context7.prev = 3;
|
|
1186
1211
|
_context7.next = 6;
|
|
1187
1212
|
return _axios.default.post("".concat(process.env.REACT_APP_VARIANTS_ENDPOINT, "/family"), {
|
|
1188
|
-
articleId: (_state$
|
|
1213
|
+
articleId: (_state$product10 = state.product) === null || _state$product10 === void 0 ? void 0 : _state$product10.id_article
|
|
1189
1214
|
}, {
|
|
1190
1215
|
headers: {
|
|
1191
1216
|
Authorization: token
|
|
@@ -1235,16 +1260,16 @@ var useCreatorsProductEdition = function useCreatorsProductEdition(_ref) {
|
|
|
1235
1260
|
|
|
1236
1261
|
|
|
1237
1262
|
(0, _react.useEffect)(function () {
|
|
1238
|
-
var _state$
|
|
1263
|
+
var _state$product11;
|
|
1239
1264
|
|
|
1240
|
-
if (!((_state$
|
|
1265
|
+
if (!((_state$product11 = state.product) !== null && _state$product11 !== void 0 && _state$product11.id_article)) return;
|
|
1241
1266
|
loadFamily(true); // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1242
|
-
}, [(_state$
|
|
1267
|
+
}, [(_state$product12 = state.product) === null || _state$product12 === void 0 ? void 0 : _state$product12.id_article]); // El conteo sale de la familia recién consultada, no del producto.
|
|
1243
1268
|
|
|
1244
1269
|
var hijosDelProducto = family !== null && family !== void 0 && family.error ? 0 : ((_family$variants = family === null || family === void 0 ? void 0 : family.variants) !== null && _family$variants !== void 0 ? _family$variants : []).filter(function (v) {
|
|
1245
1270
|
return !v.isCurrent;
|
|
1246
1271
|
}).length;
|
|
1247
|
-
var esHijoDeOtro = family !== null && family !== void 0 && family.error ? !!((_state$
|
|
1272
|
+
var esHijoDeOtro = family !== null && family !== void 0 && family.error ? !!((_state$product13 = state.product) !== null && _state$product13 !== void 0 && _state$product13.parentArticleId) : !!(family !== null && family !== void 0 && family.parent);
|
|
1248
1273
|
/*
|
|
1249
1274
|
Un hijo no se agrupa como variante (decisión de producto, 2026-09-25).
|
|
1250
1275
|
Agrupar declara «estos son el mismo producto en otra presentación», y un
|
|
@@ -1286,14 +1311,14 @@ var useCreatorsProductEdition = function useCreatorsProductEdition(_ref) {
|
|
|
1286
1311
|
*/
|
|
1287
1312
|
|
|
1288
1313
|
var handleOnUnlinked = function handleOnUnlinked(result) {
|
|
1289
|
-
var _state$product$varian, _state$
|
|
1314
|
+
var _state$product$varian, _state$product14, _updatedProduct$varia;
|
|
1290
1315
|
|
|
1291
1316
|
if (!result) return;
|
|
1292
1317
|
var updatedProduct = result.mode === "self" ? (0, _objectSpread5.default)((0, _objectSpread5.default)({}, state.product), {}, {
|
|
1293
1318
|
parentArticleId: null,
|
|
1294
1319
|
variantsCount: 0
|
|
1295
1320
|
}) : (0, _objectSpread5.default)((0, _objectSpread5.default)({}, state.product), {}, {
|
|
1296
|
-
variantsCount: Math.max(((_state$product$varian = (_state$
|
|
1321
|
+
variantsCount: Math.max(((_state$product$varian = (_state$product14 = state.product) === null || _state$product14 === void 0 ? void 0 : _state$product14.variantsCount) !== null && _state$product$varian !== void 0 ? _state$product$varian : 1) - 1, 0)
|
|
1297
1322
|
});
|
|
1298
1323
|
dispatch({
|
|
1299
1324
|
type: "SET_PRODUCT",
|
|
@@ -1347,7 +1372,7 @@ var useCreatorsProductEdition = function useCreatorsProductEdition(_ref) {
|
|
|
1347
1372
|
var loadVariantGroup = /*#__PURE__*/function () {
|
|
1348
1373
|
var _ref12 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee8() {
|
|
1349
1374
|
var forzar,
|
|
1350
|
-
_state$
|
|
1375
|
+
_state$product15,
|
|
1351
1376
|
res,
|
|
1352
1377
|
data,
|
|
1353
1378
|
_args8 = arguments;
|
|
@@ -1369,7 +1394,7 @@ var useCreatorsProductEdition = function useCreatorsProductEdition(_ref) {
|
|
|
1369
1394
|
_context8.prev = 3;
|
|
1370
1395
|
_context8.next = 6;
|
|
1371
1396
|
return _axios.default.post("".concat(process.env.REACT_APP_VARIANTS_ENDPOINT, "/group"), {
|
|
1372
|
-
articleId: (_state$
|
|
1397
|
+
articleId: (_state$product15 = state.product) === null || _state$product15 === void 0 ? void 0 : _state$product15.id_article
|
|
1373
1398
|
}, {
|
|
1374
1399
|
headers: {
|
|
1375
1400
|
Authorization: token
|
|
@@ -1407,15 +1432,15 @@ var useCreatorsProductEdition = function useCreatorsProductEdition(_ref) {
|
|
|
1407
1432
|
}();
|
|
1408
1433
|
|
|
1409
1434
|
(0, _react.useEffect)(function () {
|
|
1410
|
-
var _state$
|
|
1435
|
+
var _state$product16;
|
|
1411
1436
|
|
|
1412
|
-
if (!((_state$
|
|
1437
|
+
if (!((_state$product16 = state.product) !== null && _state$product16 !== void 0 && _state$product16.id_article)) return;
|
|
1413
1438
|
loadVariantGroup(true); // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1414
|
-
}, [(_state$
|
|
1439
|
+
}, [(_state$product17 = state.product) === null || _state$product17 === void 0 ? void 0 : _state$product17.id_article]);
|
|
1415
1440
|
|
|
1416
1441
|
var handleOnLeaveGroup = /*#__PURE__*/function () {
|
|
1417
1442
|
var _ref13 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee9() {
|
|
1418
|
-
var _state$
|
|
1443
|
+
var _state$product18, res;
|
|
1419
1444
|
|
|
1420
1445
|
return _regenerator.default.wrap(function _callee9$(_context9) {
|
|
1421
1446
|
while (1) {
|
|
@@ -1424,7 +1449,7 @@ var useCreatorsProductEdition = function useCreatorsProductEdition(_ref) {
|
|
|
1424
1449
|
_context9.prev = 0;
|
|
1425
1450
|
_context9.next = 3;
|
|
1426
1451
|
return _axios.default.post("".concat(process.env.REACT_APP_VARIANTS_ENDPOINT, "/leave"), {
|
|
1427
|
-
articleId: (_state$
|
|
1452
|
+
articleId: (_state$product18 = state.product) === null || _state$product18 === void 0 ? void 0 : _state$product18.id_article
|
|
1428
1453
|
}, {
|
|
1429
1454
|
headers: {
|
|
1430
1455
|
Authorization: token
|
|
@@ -1562,11 +1587,11 @@ var useCreatorsProductEdition = function useCreatorsProductEdition(_ref) {
|
|
|
1562
1587
|
|
|
1563
1588
|
|
|
1564
1589
|
var handleOnLinkedVariants = function handleOnLinkedVariants(result) {
|
|
1565
|
-
var _state$product$varian2, _state$
|
|
1590
|
+
var _state$product$varian2, _state$product19, _result$linked, _result$parentArticle;
|
|
1566
1591
|
|
|
1567
1592
|
if (!result) return;
|
|
1568
1593
|
var updatedProduct = result.mode === "children" ? (0, _objectSpread5.default)((0, _objectSpread5.default)({}, state.product), {}, {
|
|
1569
|
-
variantsCount: ((_state$product$varian2 = (_state$
|
|
1594
|
+
variantsCount: ((_state$product$varian2 = (_state$product19 = state.product) === null || _state$product19 === void 0 ? void 0 : _state$product19.variantsCount) !== null && _state$product$varian2 !== void 0 ? _state$product$varian2 : 0) + ((_result$linked = result.linked) !== null && _result$linked !== void 0 ? _result$linked : []).length
|
|
1570
1595
|
}) : (0, _objectSpread5.default)((0, _objectSpread5.default)({}, state.product), {}, {
|
|
1571
1596
|
parentArticleId: (_result$parentArticle = result.parentArticleId) !== null && _result$parentArticle !== void 0 ? _result$parentArticle : null,
|
|
1572
1597
|
variantsCount: 0
|
|
@@ -1641,7 +1666,7 @@ var useCreatorsProductEdition = function useCreatorsProductEdition(_ref) {
|
|
|
1641
1666
|
|
|
1642
1667
|
var handleOnRestoreInheritance = /*#__PURE__*/function () {
|
|
1643
1668
|
var _ref16 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee11(attributeId) {
|
|
1644
|
-
var _state$
|
|
1669
|
+
var _state$product20;
|
|
1645
1670
|
|
|
1646
1671
|
var kind,
|
|
1647
1672
|
esDescripcion,
|
|
@@ -1654,7 +1679,7 @@ var useCreatorsProductEdition = function useCreatorsProductEdition(_ref) {
|
|
|
1654
1679
|
case 0:
|
|
1655
1680
|
kind = _args11.length > 1 && _args11[1] !== undefined ? _args11[1] : "attribute";
|
|
1656
1681
|
|
|
1657
|
-
if (!(!attributeId || !((_state$
|
|
1682
|
+
if (!(!attributeId || !((_state$product20 = state.product) !== null && _state$product20 !== void 0 && _state$product20.id_article))) {
|
|
1658
1683
|
_context11.next = 3;
|
|
1659
1684
|
break;
|
|
1660
1685
|
}
|
|
@@ -2818,6 +2843,8 @@ var useCreatorsProductEdition = function useCreatorsProductEdition(_ref) {
|
|
|
2818
2843
|
isRetailer: isRetailer,
|
|
2819
2844
|
digitalAssets: digitalAssets,
|
|
2820
2845
|
currentTray: currentTray,
|
|
2846
|
+
hasImagesService: hasImagesService,
|
|
2847
|
+
canEditAssets: canEditAssets,
|
|
2821
2848
|
assetsLoadedFor: assetsLoadedFor,
|
|
2822
2849
|
handleOnSetSelectedAssets: handleOnSetSelectedAssets,
|
|
2823
2850
|
handleOnSetAllAssetsChecked: handleOnSetAllAssetsChecked,
|
|
@@ -253,6 +253,8 @@ var buildFamily = function buildFamily(familia) {
|
|
|
253
253
|
/**
|
|
254
254
|
* Crea las respuestas.
|
|
255
255
|
* - `images: false` simula un producto sin imágenes.
|
|
256
|
+
* - `imagesService: false` simula un producto sin el servicio de imágenes
|
|
257
|
+
* contratado: sin su renglón en los servicios, el estatus queda en "NS".
|
|
256
258
|
* - `delSolStatus` cambia el estatus de los tres servicios de Del Sol; con
|
|
257
259
|
* "AC" el auditor asignado puede validar o rechazar.
|
|
258
260
|
* - `familia`: "padre" (este producto con dos hijos) o "hijo" (este producto
|
|
@@ -265,6 +267,8 @@ var buildFixtures = function buildFixtures() {
|
|
|
265
267
|
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
266
268
|
_ref$images = _ref.images,
|
|
267
269
|
images = _ref$images === void 0 ? true : _ref$images,
|
|
270
|
+
_ref$imagesService = _ref.imagesService,
|
|
271
|
+
imagesService = _ref$imagesService === void 0 ? true : _ref$imagesService,
|
|
268
272
|
delSolStatus = _ref.delSolStatus,
|
|
269
273
|
familia = _ref.familia,
|
|
270
274
|
_ref$grupo = _ref.grupo,
|
|
@@ -398,7 +402,7 @@ var buildFixtures = function buildFixtures() {
|
|
|
398
402
|
}),
|
|
399
403
|
services: lambda({
|
|
400
404
|
message: "OK",
|
|
401
|
-
data: [service(36, "datasheet", "RA/AS", 2), service(36, "description", "RA/AS", 2), service(
|
|
405
|
+
data: [service(36, "datasheet", "RA/AS", 2), service(36, "description", "RA/AS", 2), service(38, "datasheet", delSolStatus !== null && delSolStatus !== void 0 ? delSolStatus : "RA/AS", 2), service(38, "description", delSolStatus !== null && delSolStatus !== void 0 ? delSolStatus : "RA/AS", 2)].concat((0, _toConsumableArray2.default)(imagesService ? [service(36, "images", "AA", 5), service(38, "images", delSolStatus !== null && delSolStatus !== void 0 ? delSolStatus : "AA", 5)] : []))
|
|
402
406
|
}),
|
|
403
407
|
percentages: lambda([{
|
|
404
408
|
id_article: ARTICLE_ID,
|
|
@@ -17,8 +17,6 @@ var _axios = _interopRequireDefault(require("axios"));
|
|
|
17
17
|
|
|
18
18
|
var _api = require("./api.fixtures");
|
|
19
19
|
|
|
20
|
-
var _productServices = require("./productServices.fixtures");
|
|
21
|
-
|
|
22
20
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
23
21
|
|
|
24
22
|
/*
|
|
@@ -80,6 +78,8 @@ var createMockAdapter = function createMockAdapter() {
|
|
|
80
78
|
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
81
79
|
_ref$images = _ref.images,
|
|
82
80
|
images = _ref$images === void 0 ? true : _ref$images,
|
|
81
|
+
_ref$imagesService = _ref.imagesService,
|
|
82
|
+
imagesService = _ref$imagesService === void 0 ? true : _ref$imagesService,
|
|
83
83
|
_ref$failLoad = _ref.failLoad,
|
|
84
84
|
failLoad = _ref$failLoad === void 0 ? false : _ref$failLoad,
|
|
85
85
|
delSolStatus = _ref.delSolStatus,
|
|
@@ -88,23 +88,11 @@ var createMockAdapter = function createMockAdapter() {
|
|
|
88
88
|
|
|
89
89
|
var fx = (0, _api.buildFixtures)({
|
|
90
90
|
images: images,
|
|
91
|
+
imagesService: imagesService,
|
|
91
92
|
delSolStatus: delSolStatus,
|
|
92
93
|
familia: familia,
|
|
93
94
|
grupo: grupo
|
|
94
|
-
}); // Servicios del producto (edición unificada): con estado, para que un cambio
|
|
95
|
-
// de estatus o de asignación se vea al volver a pedir la lista.
|
|
96
|
-
|
|
97
|
-
var productServices = (0, _productServices.buildProductServices)({
|
|
98
|
-
delSolStatus: delSolStatus
|
|
99
95
|
});
|
|
100
|
-
|
|
101
|
-
var lambdaReply = function lambdaReply(config, statusCode, body) {
|
|
102
|
-
return reply(config, {
|
|
103
|
-
statusCode: statusCode,
|
|
104
|
-
body: JSON.stringify(body)
|
|
105
|
-
});
|
|
106
|
-
};
|
|
107
|
-
|
|
108
96
|
return function (config) {
|
|
109
97
|
var _fx$comments$query$co, _fx$users$query$fetch;
|
|
110
98
|
|
|
@@ -140,31 +128,6 @@ var createMockAdapter = function createMockAdapter() {
|
|
|
140
128
|
if (path === "variants/group") return reply(config, fx.group);
|
|
141
129
|
if (method === "GET" && path === "services") return reply(config, fx.services);
|
|
142
130
|
if (method === "GET" && path === "versions") return reply(config, fx.versions);
|
|
143
|
-
if (method === "GET" && path === "product-services") return lambdaReply(config, 200, productServices);
|
|
144
|
-
|
|
145
|
-
if (method === "PUT" && path.startsWith("product-services/")) {
|
|
146
|
-
var action = path.split("/")[1];
|
|
147
|
-
var data = typeof config.data === "string" ? JSON.parse(config.data) : config.data;
|
|
148
|
-
|
|
149
|
-
var _applyProductServices = (0, _productServices.applyProductServicesChange)(productServices, action, data),
|
|
150
|
-
statusCode = _applyProductServices.statusCode,
|
|
151
|
-
message = _applyProductServices.message;
|
|
152
|
-
|
|
153
|
-
console.info("[mock API] PUT ".concat(path), data);
|
|
154
|
-
return lambdaReply(config, statusCode, statusCode === 200 ? {
|
|
155
|
-
action: action,
|
|
156
|
-
result: data
|
|
157
|
-
} : {
|
|
158
|
-
message: message
|
|
159
|
-
});
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
if (method === "GET" && path === "service-catalog" && query.view === "assignables") {
|
|
163
|
-
return lambdaReply(config, 200, {
|
|
164
|
-
users: (0, _productServices.assignablesFor)(query.assignment_role)
|
|
165
|
-
});
|
|
166
|
-
}
|
|
167
|
-
|
|
168
131
|
if (path === "percentages") return reply(config, fx.percentages); // Sin versión auditable ni observación: con la API real de dev estas dos
|
|
169
132
|
// fallan por CORS, así que la pantalla ya sabe vivir sin ellas.
|
|
170
133
|
|
|
@@ -65,11 +65,16 @@ var TrayTabs = function TrayTabs(_ref) {
|
|
|
65
65
|
var activeTray = _ref.activeTray,
|
|
66
66
|
setActiveTray = _ref.setActiveTray,
|
|
67
67
|
imagesCount = _ref.imagesCount,
|
|
68
|
-
assetsCount = _ref.assetsCount
|
|
68
|
+
assetsCount = _ref.assetsCount,
|
|
69
|
+
_ref$hasImagesService = _ref.hasImagesService,
|
|
70
|
+
hasImagesService = _ref$hasImagesService === void 0 ? true : _ref$hasImagesService;
|
|
69
71
|
var trays = [{
|
|
70
72
|
id: _GalleryTrayTabs.TRAYS.IMAGES,
|
|
71
73
|
label: "Imágenes",
|
|
72
|
-
count: imagesCount
|
|
74
|
+
count: imagesCount,
|
|
75
|
+
// Sin el servicio contratado no hay nada que mostrar en esa bandeja,
|
|
76
|
+
// pero se deja a la vista para que se entienda por qué.
|
|
77
|
+
disabled: !hasImagesService
|
|
73
78
|
}, {
|
|
74
79
|
id: _GalleryTrayTabs.TRAYS.ASSETS,
|
|
75
80
|
label: "Activos digitales",
|
|
@@ -96,6 +101,7 @@ var TrayTabs = function TrayTabs(_ref) {
|
|
|
96
101
|
var active = tray.id === activeTray;
|
|
97
102
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Tab, {
|
|
98
103
|
value: tray.id,
|
|
104
|
+
disabled: tray.disabled,
|
|
99
105
|
disableRipple: true,
|
|
100
106
|
label: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.Stack, {
|
|
101
107
|
direction: "row",
|
|
@@ -129,6 +135,12 @@ var TrayTabs = function TrayTabs(_ref) {
|
|
|
129
135
|
"&.Mui-selected": {
|
|
130
136
|
color: _tokens.COLORS.s5,
|
|
131
137
|
fontWeight: 600
|
|
138
|
+
},
|
|
139
|
+
// Igual que en `TabsBar`: el tema de Creators las pinta de rosa
|
|
140
|
+
// al pasar el ratón y aquí no se quiere.
|
|
141
|
+
"&:hover, &.Mui-selected:hover": {
|
|
142
|
+
color: _tokens.COLORS.s5,
|
|
143
|
+
backgroundColor: "transparent"
|
|
132
144
|
}
|
|
133
145
|
}
|
|
134
146
|
}, tray.id);
|
|
@@ -223,6 +235,8 @@ var ImagesSection = function ImagesSection(_ref3) {
|
|
|
223
235
|
selectedImages = _ref3.selectedImages,
|
|
224
236
|
imageLayout = _ref3.imageLayout,
|
|
225
237
|
enableDigitalAssets = _ref3.enableDigitalAssets,
|
|
238
|
+
_ref3$hasImagesServic = _ref3.hasImagesService,
|
|
239
|
+
hasImagesService = _ref3$hasImagesServic === void 0 ? true : _ref3$hasImagesServic,
|
|
226
240
|
currentTray = _ref3.currentTray,
|
|
227
241
|
setActiveTray = _ref3.setActiveTray,
|
|
228
242
|
digitalAssets = _ref3.digitalAssets,
|
|
@@ -293,7 +307,8 @@ var ImagesSection = function ImagesSection(_ref3) {
|
|
|
293
307
|
activeTray: currentTray,
|
|
294
308
|
setActiveTray: setActiveTray,
|
|
295
309
|
imagesCount: images.length,
|
|
296
|
-
assetsCount: (_digitalAssets$assets = digitalAssets === null || digitalAssets === void 0 ? void 0 : (_digitalAssets$assets2 = digitalAssets.assets) === null || _digitalAssets$assets2 === void 0 ? void 0 : _digitalAssets$assets2.length) !== null && _digitalAssets$assets !== void 0 ? _digitalAssets$assets : 0
|
|
310
|
+
assetsCount: (_digitalAssets$assets = digitalAssets === null || digitalAssets === void 0 ? void 0 : (_digitalAssets$assets2 = digitalAssets.assets) === null || _digitalAssets$assets2 === void 0 ? void 0 : _digitalAssets$assets2.length) !== null && _digitalAssets$assets !== void 0 ? _digitalAssets$assets : 0,
|
|
311
|
+
hasImagesService: hasImagesService
|
|
297
312
|
}), currentTray === _GalleryTrayTabs.TRAYS.ASSETS && /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Box, {
|
|
298
313
|
sx: {
|
|
299
314
|
position: "relative",
|