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,387 +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.buildProductServices = exports.assignablesFor = exports.applyProductServicesChange = exports.PEOPLE = 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 _excluded = ["legacy", "flow", "retailers", "roles", "assignees", "actions"];
|
|
15
|
-
|
|
16
|
-
/*
|
|
17
|
-
GET /product-services para las historias de la edición unificada
|
|
18
|
-
(ProductEdition): el mismo producto de api.fixtures.js (144814, orden 10421)
|
|
19
|
-
con sus tres servicios de siempre en Oxxo (36) y Del Sol (38), más tres del
|
|
20
|
-
catálogo: A+ (flujo completo, por cadena), Compra de producto en tienda
|
|
21
|
-
(casilla) y Levantamiento y recolección (avance), los dos últimos por
|
|
22
|
-
producto (cadena 0). Nombres, colores e íconos como en cat_service y
|
|
23
|
-
cat_status (docs/sql/catalog 002, 003 y 006 del backend).
|
|
24
|
-
|
|
25
|
-
`applyProductServicesChange` simula PUT /product-services/{action} sobre una
|
|
26
|
-
copia, para que la historia muestre el cambio al volver a pedir la lista.
|
|
27
|
-
*/
|
|
28
|
-
var ARTICLE_ID = 144814;
|
|
29
|
-
var ORDER_ID = 10421;
|
|
30
|
-
var STATUS = {
|
|
31
|
-
PA: {
|
|
32
|
-
status_name: "PA",
|
|
33
|
-
display_name: "Por asignar",
|
|
34
|
-
color: "#E57432",
|
|
35
|
-
flow_name: "workflow",
|
|
36
|
-
is_final: false,
|
|
37
|
-
progress_percent: null
|
|
38
|
-
},
|
|
39
|
-
AA: {
|
|
40
|
-
status_name: "AA",
|
|
41
|
-
display_name: "Aprobado auditor",
|
|
42
|
-
color: "#18A0FB",
|
|
43
|
-
flow_name: "workflow",
|
|
44
|
-
is_final: false,
|
|
45
|
-
progress_percent: null
|
|
46
|
-
},
|
|
47
|
-
"RA/AS": {
|
|
48
|
-
status_name: "RA/AS",
|
|
49
|
-
display_name: "Rechazado auditor / Asignado",
|
|
50
|
-
color: "#D74DED",
|
|
51
|
-
flow_name: "workflow",
|
|
52
|
-
is_final: false,
|
|
53
|
-
progress_percent: null
|
|
54
|
-
},
|
|
55
|
-
PE: {
|
|
56
|
-
status_name: "PE",
|
|
57
|
-
display_name: "Pendiente",
|
|
58
|
-
color: "#E57432",
|
|
59
|
-
flow_name: "checkbox",
|
|
60
|
-
is_final: false,
|
|
61
|
-
progress_percent: 0
|
|
62
|
-
},
|
|
63
|
-
HE: {
|
|
64
|
-
status_name: "HE",
|
|
65
|
-
display_name: "Hecho",
|
|
66
|
-
color: "#71DE56",
|
|
67
|
-
flow_name: "checkbox",
|
|
68
|
-
is_final: true,
|
|
69
|
-
progress_percent: 100
|
|
70
|
-
},
|
|
71
|
-
SE: {
|
|
72
|
-
status_name: "SE",
|
|
73
|
-
display_name: "Sin empezar",
|
|
74
|
-
color: "#E57432",
|
|
75
|
-
flow_name: "progress",
|
|
76
|
-
is_final: false,
|
|
77
|
-
progress_percent: 0
|
|
78
|
-
},
|
|
79
|
-
EP: {
|
|
80
|
-
status_name: "EP",
|
|
81
|
-
display_name: "En proceso",
|
|
82
|
-
color: "#ED9A4D",
|
|
83
|
-
flow_name: "progress",
|
|
84
|
-
is_final: false,
|
|
85
|
-
progress_percent: 50
|
|
86
|
-
},
|
|
87
|
-
TE: {
|
|
88
|
-
status_name: "TE",
|
|
89
|
-
display_name: "Terminado",
|
|
90
|
-
color: "#71DE56",
|
|
91
|
-
flow_name: "progress",
|
|
92
|
-
is_final: true,
|
|
93
|
-
progress_percent: 100
|
|
94
|
-
}
|
|
95
|
-
};
|
|
96
|
-
var OPTIONS = {
|
|
97
|
-
checkbox: ["PE", "HE"],
|
|
98
|
-
progress: ["SE", "EP", "TE"]
|
|
99
|
-
};
|
|
100
|
-
var WEIGHT = {
|
|
101
|
-
PA: 1,
|
|
102
|
-
"RA/AS": 7,
|
|
103
|
-
AA: 10,
|
|
104
|
-
PE: 2,
|
|
105
|
-
SE: 2,
|
|
106
|
-
EP: 3,
|
|
107
|
-
HE: 99,
|
|
108
|
-
TE: 99
|
|
109
|
-
};
|
|
110
|
-
var PEOPLE = {
|
|
111
|
-
423: {
|
|
112
|
-
id_user: 423,
|
|
113
|
-
name: "Coordinador Textos",
|
|
114
|
-
last_name: null,
|
|
115
|
-
id_role: 4
|
|
116
|
-
},
|
|
117
|
-
424: {
|
|
118
|
-
id_user: 424,
|
|
119
|
-
name: "Coordinador Imágenes",
|
|
120
|
-
last_name: null,
|
|
121
|
-
id_role: 5
|
|
122
|
-
},
|
|
123
|
-
425: {
|
|
124
|
-
id_user: 425,
|
|
125
|
-
name: "Auditor QA",
|
|
126
|
-
last_name: null,
|
|
127
|
-
id_role: 6
|
|
128
|
-
},
|
|
129
|
-
426: {
|
|
130
|
-
id_user: 426,
|
|
131
|
-
name: "Especialista Textos",
|
|
132
|
-
last_name: null,
|
|
133
|
-
id_role: 7
|
|
134
|
-
},
|
|
135
|
-
427: {
|
|
136
|
-
id_user: 427,
|
|
137
|
-
name: "Especialista Edición",
|
|
138
|
-
last_name: null,
|
|
139
|
-
id_role: 8
|
|
140
|
-
}
|
|
141
|
-
};
|
|
142
|
-
exports.PEOPLE = PEOPLE;
|
|
143
|
-
var RETAILER_NAMES = {
|
|
144
|
-
0: "Sin cadena",
|
|
145
|
-
36: "Oxxo",
|
|
146
|
-
38: "Del Sol"
|
|
147
|
-
};
|
|
148
|
-
|
|
149
|
-
var retailer = function retailer(id, statusName) {
|
|
150
|
-
var _STATUS$statusName;
|
|
151
|
-
|
|
152
|
-
return {
|
|
153
|
-
id_retailer: id,
|
|
154
|
-
retailer_name: RETAILER_NAMES[id],
|
|
155
|
-
quantity: 1,
|
|
156
|
-
status: (_STATUS$statusName = STATUS[statusName]) !== null && _STATUS$statusName !== void 0 ? _STATUS$statusName : null
|
|
157
|
-
};
|
|
158
|
-
};
|
|
159
|
-
|
|
160
|
-
var generalOf = function generalOf(retailers) {
|
|
161
|
-
return retailers.filter(function (item) {
|
|
162
|
-
return item.status;
|
|
163
|
-
}).reduce(function (low, item) {
|
|
164
|
-
return !low || WEIGHT[item.status.status_name] < WEIGHT[low.status_name] ? item.status : low;
|
|
165
|
-
}, null);
|
|
166
|
-
};
|
|
167
|
-
|
|
168
|
-
var service = function service(_ref) {
|
|
169
|
-
var _OPTIONS$flow$map, _OPTIONS$flow;
|
|
170
|
-
|
|
171
|
-
var _ref$legacy = _ref.legacy,
|
|
172
|
-
legacy = _ref$legacy === void 0 ? false : _ref$legacy,
|
|
173
|
-
flow = _ref.flow,
|
|
174
|
-
retailers = _ref.retailers,
|
|
175
|
-
roles = _ref.roles,
|
|
176
|
-
assignees = _ref.assignees,
|
|
177
|
-
actions = _ref.actions,
|
|
178
|
-
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
179
|
-
return (0, _objectSpread2.default)({
|
|
180
|
-
icon_name: null,
|
|
181
|
-
deliverable_type: null,
|
|
182
|
-
has_workflow: flow !== "flag",
|
|
183
|
-
requires_qa: roles.includes("auditor"),
|
|
184
|
-
per_retailer: !retailers.some(function (item) {
|
|
185
|
-
return item.id_retailer === 0;
|
|
186
|
-
}),
|
|
187
|
-
is_legacy: legacy,
|
|
188
|
-
status_flow: {
|
|
189
|
-
flow_name: flow,
|
|
190
|
-
flow_type: flow === "workflow" || flow === "flag" ? flow : "simple"
|
|
191
|
-
},
|
|
192
|
-
status: generalOf(retailers),
|
|
193
|
-
status_options: (_OPTIONS$flow$map = (_OPTIONS$flow = OPTIONS[flow]) === null || _OPTIONS$flow === void 0 ? void 0 : _OPTIONS$flow.map(function (name) {
|
|
194
|
-
return STATUS[name];
|
|
195
|
-
})) !== null && _OPTIONS$flow$map !== void 0 ? _OPTIONS$flow$map : [],
|
|
196
|
-
retailers: retailers,
|
|
197
|
-
roles: roles,
|
|
198
|
-
assignees: (0, _objectSpread2.default)({
|
|
199
|
-
especialist: null,
|
|
200
|
-
facilitator: null,
|
|
201
|
-
auditor: null
|
|
202
|
-
}, assignees),
|
|
203
|
-
actions: actions
|
|
204
|
-
}, rest);
|
|
205
|
-
};
|
|
206
|
-
|
|
207
|
-
var category = function category(category_name, display_name) {
|
|
208
|
-
return {
|
|
209
|
-
category_name: category_name,
|
|
210
|
-
display_name: display_name
|
|
211
|
-
};
|
|
212
|
-
};
|
|
213
|
-
/** Respuesta de GET /product-services (el cuerpo, sin la envoltura de la lambda). */
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
var buildProductServices = function buildProductServices() {
|
|
217
|
-
var _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
218
|
-
delSolStatus = _ref2.delSolStatus;
|
|
219
|
-
|
|
220
|
-
return {
|
|
221
|
-
article_id: ARTICLE_ID,
|
|
222
|
-
order_id: ORDER_ID,
|
|
223
|
-
auditor: PEOPLE[425],
|
|
224
|
-
services: [service({
|
|
225
|
-
service_name: "datasheet",
|
|
226
|
-
display_name: "Ficha técnica",
|
|
227
|
-
icon_name: "datasheet",
|
|
228
|
-
category: category("texts", "Textos"),
|
|
229
|
-
legacy: true,
|
|
230
|
-
flow: "workflow",
|
|
231
|
-
retailers: [retailer(36, "RA/AS"), retailer(38, delSolStatus !== null && delSolStatus !== void 0 ? delSolStatus : "RA/AS")],
|
|
232
|
-
roles: ["especialist", "facilitator", "auditor"],
|
|
233
|
-
assignees: {
|
|
234
|
-
especialist: PEOPLE[426],
|
|
235
|
-
facilitator: PEOPLE[423],
|
|
236
|
-
auditor: PEOPLE[425]
|
|
237
|
-
},
|
|
238
|
-
actions: {
|
|
239
|
-
set_status: false,
|
|
240
|
-
assign: false
|
|
241
|
-
}
|
|
242
|
-
}), service({
|
|
243
|
-
service_name: "description",
|
|
244
|
-
display_name: "Descripción",
|
|
245
|
-
icon_name: "description",
|
|
246
|
-
category: category("texts", "Textos"),
|
|
247
|
-
legacy: true,
|
|
248
|
-
flow: "workflow",
|
|
249
|
-
retailers: [retailer(36, "RA/AS"), retailer(38, delSolStatus !== null && delSolStatus !== void 0 ? delSolStatus : "RA/AS")],
|
|
250
|
-
roles: ["especialist", "facilitator", "auditor"],
|
|
251
|
-
assignees: {
|
|
252
|
-
especialist: PEOPLE[426],
|
|
253
|
-
facilitator: PEOPLE[423],
|
|
254
|
-
auditor: PEOPLE[425]
|
|
255
|
-
},
|
|
256
|
-
actions: {
|
|
257
|
-
set_status: false,
|
|
258
|
-
assign: false
|
|
259
|
-
}
|
|
260
|
-
}), service({
|
|
261
|
-
service_name: "images",
|
|
262
|
-
display_name: "Imágenes",
|
|
263
|
-
icon_name: "images",
|
|
264
|
-
category: category("images", "Imágenes"),
|
|
265
|
-
legacy: true,
|
|
266
|
-
flow: "workflow",
|
|
267
|
-
retailers: [retailer(36, "AA"), retailer(38, delSolStatus !== null && delSolStatus !== void 0 ? delSolStatus : "AA")],
|
|
268
|
-
roles: ["especialist", "facilitator", "auditor"],
|
|
269
|
-
assignees: {
|
|
270
|
-
especialist: PEOPLE[427],
|
|
271
|
-
facilitator: PEOPLE[424],
|
|
272
|
-
auditor: PEOPLE[425]
|
|
273
|
-
},
|
|
274
|
-
actions: {
|
|
275
|
-
set_status: false,
|
|
276
|
-
assign: false
|
|
277
|
-
}
|
|
278
|
-
}), service({
|
|
279
|
-
service_name: "aplusPlatinum",
|
|
280
|
-
display_name: "A+ / Platinum SKU",
|
|
281
|
-
icon_name: "aplus",
|
|
282
|
-
category: category("media", "Multimedia y diseño"),
|
|
283
|
-
flow: "workflow",
|
|
284
|
-
retailers: [retailer(36, "PA"), retailer(38, "PA")],
|
|
285
|
-
roles: ["especialist", "facilitator", "auditor"],
|
|
286
|
-
assignees: {
|
|
287
|
-
auditor: PEOPLE[425]
|
|
288
|
-
},
|
|
289
|
-
actions: {
|
|
290
|
-
set_status: false,
|
|
291
|
-
assign: true
|
|
292
|
-
}
|
|
293
|
-
}), service({
|
|
294
|
-
service_name: "productPurchase",
|
|
295
|
-
display_name: "Compra de producto en tienda",
|
|
296
|
-
icon_name: "purchase",
|
|
297
|
-
category: category("logistics", "Logística"),
|
|
298
|
-
flow: "checkbox",
|
|
299
|
-
retailers: [retailer(0, "PE")],
|
|
300
|
-
roles: ["especialist"],
|
|
301
|
-
assignees: {
|
|
302
|
-
especialist: PEOPLE[427]
|
|
303
|
-
},
|
|
304
|
-
actions: {
|
|
305
|
-
set_status: true,
|
|
306
|
-
assign: true
|
|
307
|
-
}
|
|
308
|
-
}), service({
|
|
309
|
-
service_name: "productPickup",
|
|
310
|
-
display_name: "Levantamiento y recolección",
|
|
311
|
-
icon_name: "pickup",
|
|
312
|
-
category: category("logistics", "Logística"),
|
|
313
|
-
flow: "progress",
|
|
314
|
-
retailers: [retailer(0, "SE")],
|
|
315
|
-
roles: ["especialist"],
|
|
316
|
-
assignees: {},
|
|
317
|
-
actions: {
|
|
318
|
-
set_status: true,
|
|
319
|
-
assign: true
|
|
320
|
-
}
|
|
321
|
-
})]
|
|
322
|
-
};
|
|
323
|
-
};
|
|
324
|
-
/** Personas que se pueden asignar (GET /service-catalog?view=assignables). */
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
exports.buildProductServices = buildProductServices;
|
|
328
|
-
|
|
329
|
-
var assignablesFor = function assignablesFor(role) {
|
|
330
|
-
return Object.values(PEOPLE).filter(function (person) {
|
|
331
|
-
return (role === "facilitator" ? [4, 5] : [7, 8]).includes(person.id_role);
|
|
332
|
-
}).map(function (person) {
|
|
333
|
-
return {
|
|
334
|
-
id_user: person.id_user,
|
|
335
|
-
name: person.name,
|
|
336
|
-
email: null,
|
|
337
|
-
id_role: person.id_role
|
|
338
|
-
};
|
|
339
|
-
});
|
|
340
|
-
};
|
|
341
|
-
/** Aplica PUT /product-services/{action} sobre `body` (se modifica en su lugar). */
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
exports.assignablesFor = assignablesFor;
|
|
345
|
-
|
|
346
|
-
var applyProductServicesChange = function applyProductServicesChange(body, action, data) {
|
|
347
|
-
var target = body.services.find(function (item) {
|
|
348
|
-
return item.service_name === (data === null || data === void 0 ? void 0 : data.serviceName);
|
|
349
|
-
});
|
|
350
|
-
if (!target) return {
|
|
351
|
-
statusCode: 404,
|
|
352
|
-
message: "El producto no tiene ese servicio en esta orden."
|
|
353
|
-
};
|
|
354
|
-
|
|
355
|
-
if (action === "set-status") {
|
|
356
|
-
var status = STATUS[data.statusName];
|
|
357
|
-
if (!status) return {
|
|
358
|
-
statusCode: 400,
|
|
359
|
-
message: "Estatus no válido."
|
|
360
|
-
};
|
|
361
|
-
target.retailers.forEach(function (item) {
|
|
362
|
-
if (!data.retailerIds || data.retailerIds.includes(item.id_retailer)) item.status = status;
|
|
363
|
-
});
|
|
364
|
-
target.status = generalOf(target.retailers);
|
|
365
|
-
return {
|
|
366
|
-
statusCode: 200
|
|
367
|
-
};
|
|
368
|
-
}
|
|
369
|
-
|
|
370
|
-
if (action === "assign") {
|
|
371
|
-
var _PEOPLE$data$userId;
|
|
372
|
-
|
|
373
|
-
target.assignees[data.role] = data.userId ? (_PEOPLE$data$userId = PEOPLE[data.userId]) !== null && _PEOPLE$data$userId !== void 0 ? _PEOPLE$data$userId : {
|
|
374
|
-
id_user: data.userId
|
|
375
|
-
} : null;
|
|
376
|
-
return {
|
|
377
|
-
statusCode: 200
|
|
378
|
-
};
|
|
379
|
-
}
|
|
380
|
-
|
|
381
|
-
return {
|
|
382
|
-
statusCode: 400,
|
|
383
|
-
message: "Acci\xF3n no v\xE1lida: ".concat(action, ".")
|
|
384
|
-
};
|
|
385
|
-
};
|
|
386
|
-
|
|
387
|
-
exports.applyProductServicesChange = applyProductServicesChange;
|
|
@@ -1,148 +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.default = exports.TodosLosServicios = exports.EspecialistaTextos = exports.EspecialistaImagenesCelular = exports.EspecialistaImagenes = exports.ConServiciosDeEjemplo = exports.AuditorQA = void 0;
|
|
9
|
-
|
|
10
|
-
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
|
|
11
|
-
|
|
12
|
-
var _index = require("./index");
|
|
13
|
-
|
|
14
|
-
var _mockApi = require("../CreatorsProductEdition/mocks/mockApi");
|
|
15
|
-
|
|
16
|
-
var _catalog = require("../../organisms/ServicesNavigation/catalog");
|
|
17
|
-
|
|
18
|
-
var _ImageEditor = require("../RetailerProductEdition/stories/ImageEditor.stories");
|
|
19
|
-
|
|
20
|
-
var _TextEditor = require("../RetailerProductEdition/stories/TextEditor.stories");
|
|
21
|
-
|
|
22
|
-
var _Auditor = require("../RetailerProductEdition/stories/Auditor.stories");
|
|
23
|
-
|
|
24
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
25
|
-
|
|
26
|
-
/*
|
|
27
|
-
Edición de producto unificada con datos locales: no le pega a ninguna API
|
|
28
|
-
(la simula `CreatorsProductEdition/mocks`). Guardar, aprobar o rechazar se
|
|
29
|
-
acepta sin hacer nada y queda en la consola como `[mock API]`.
|
|
30
|
-
|
|
31
|
-
El producto y los usuarios son los mismos de las historias de
|
|
32
|
-
CreatorsProductEdition, para comparar las dos pantallas con lo mismo.
|
|
33
|
-
*/
|
|
34
|
-
var _default = {
|
|
35
|
-
title: "Components/pages/ProductEdition",
|
|
36
|
-
component: _index.ProductEdition,
|
|
37
|
-
decorators: [(0, _mockApi.withMockApi)()],
|
|
38
|
-
parameters: {
|
|
39
|
-
layout: "fullscreen"
|
|
40
|
-
}
|
|
41
|
-
}; // Como en la app: la pantalla vive en una caja de altura fija.
|
|
42
|
-
|
|
43
|
-
exports.default = _default;
|
|
44
|
-
|
|
45
|
-
var Template = function Template(args) {
|
|
46
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
47
|
-
style: {
|
|
48
|
-
height: "100vh",
|
|
49
|
-
display: "flex",
|
|
50
|
-
overflow: "hidden"
|
|
51
|
-
},
|
|
52
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.ProductEdition, (0, _objectSpread2.default)({}, args))
|
|
53
|
-
});
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
var base = {
|
|
57
|
-
app: "creators",
|
|
58
|
-
token: _ImageEditor.ImageEditor.args.token,
|
|
59
|
-
productSelected: _ImageEditor.ImageEditor.args.productSelected,
|
|
60
|
-
enableDigitalAssets: true
|
|
61
|
-
};
|
|
62
|
-
var TODAS_LAS_PESTAÑAS = {
|
|
63
|
-
Descripción: true,
|
|
64
|
-
"Ficha técnica": true,
|
|
65
|
-
Imágenes: true
|
|
66
|
-
};
|
|
67
|
-
/** Servicios del catálogo que todavía no tienen editor (vista de muestra). */
|
|
68
|
-
|
|
69
|
-
var SERVICIOS_DE_EJEMPLO = [{
|
|
70
|
-
service_name: "translation",
|
|
71
|
-
status: "CA"
|
|
72
|
-
}, {
|
|
73
|
-
service_name: "seo",
|
|
74
|
-
status: "AS"
|
|
75
|
-
}, {
|
|
76
|
-
service_name: "photo",
|
|
77
|
-
status: "Ex"
|
|
78
|
-
}, {
|
|
79
|
-
service_name: "videos",
|
|
80
|
-
status: "IE"
|
|
81
|
-
}, {
|
|
82
|
-
service_name: "brandstore",
|
|
83
|
-
status: "AC"
|
|
84
|
-
}, {
|
|
85
|
-
service_name: "quality",
|
|
86
|
-
status: "PA"
|
|
87
|
-
}];
|
|
88
|
-
/** Especialista de imágenes (rol 8): «Míos» le muestra solo Imágenes. */
|
|
89
|
-
|
|
90
|
-
var EspecialistaImagenes = Template.bind({});
|
|
91
|
-
exports.EspecialistaImagenes = EspecialistaImagenes;
|
|
92
|
-
EspecialistaImagenes.storyName = "Especialista de imágenes";
|
|
93
|
-
EspecialistaImagenes.args = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, base), {}, {
|
|
94
|
-
tabsSections: _ImageEditor.ImageEditor.args.tabsSections,
|
|
95
|
-
user: _ImageEditor.ImageEditor.args.user
|
|
96
|
-
});
|
|
97
|
-
/** Especialista de textos (rol 7): Ficha técnica y Descripción. */
|
|
98
|
-
|
|
99
|
-
var EspecialistaTextos = Template.bind({});
|
|
100
|
-
exports.EspecialistaTextos = EspecialistaTextos;
|
|
101
|
-
EspecialistaTextos.storyName = "Especialista de textos";
|
|
102
|
-
EspecialistaTextos.args = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, base), {}, {
|
|
103
|
-
tabsSections: _TextEditor.TextEditor.args.tabsSections,
|
|
104
|
-
user: _TextEditor.TextEditor.args.user
|
|
105
|
-
});
|
|
106
|
-
/** Auditor QA (rol 6): asignado a todo el producto, ve los tres servicios. */
|
|
107
|
-
|
|
108
|
-
var AuditorQA = Template.bind({});
|
|
109
|
-
exports.AuditorQA = AuditorQA;
|
|
110
|
-
AuditorQA.storyName = "Auditor QA";
|
|
111
|
-
AuditorQA.args = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, base), {}, {
|
|
112
|
-
tabsSections: TODAS_LAS_PESTAÑAS,
|
|
113
|
-
user: _Auditor.Auditor.args.user
|
|
114
|
-
});
|
|
115
|
-
/** Auditor con servicios de ejemplo: así se ve con más de los tres de siempre. */
|
|
116
|
-
|
|
117
|
-
var ConServiciosDeEjemplo = Template.bind({});
|
|
118
|
-
exports.ConServiciosDeEjemplo = ConServiciosDeEjemplo;
|
|
119
|
-
ConServiciosDeEjemplo.storyName = "Con servicios de ejemplo";
|
|
120
|
-
ConServiciosDeEjemplo.args = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, AuditorQA.args), {}, {
|
|
121
|
-
demoServices: SERVICIOS_DE_EJEMPLO
|
|
122
|
-
});
|
|
123
|
-
/**
|
|
124
|
-
* Auditor con todos los servicios activos de la plataforma (los de
|
|
125
|
-
* `cat_service`): los tres con editor salen del producto y el resto son de
|
|
126
|
-
* ejemplo, con estatus variados. Sirve para ver la lista lateral llena: los
|
|
127
|
-
* cinco bloques (con Mantenimiento), el buscador y el Resumen.
|
|
128
|
-
*/
|
|
129
|
-
|
|
130
|
-
var TodosLosServicios = Template.bind({});
|
|
131
|
-
exports.TodosLosServicios = TodosLosServicios;
|
|
132
|
-
TodosLosServicios.storyName = "Todos los servicios";
|
|
133
|
-
TodosLosServicios.args = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, AuditorQA.args), {}, {
|
|
134
|
-
demoServices: (0, _catalog.allCatalogServices)({
|
|
135
|
-
exclude: ["datasheet", "description", "images"]
|
|
136
|
-
})
|
|
137
|
-
});
|
|
138
|
-
/** En celular la lista se abre como panel con el botón «Servicios». */
|
|
139
|
-
|
|
140
|
-
var EspecialistaImagenesCelular = Template.bind({});
|
|
141
|
-
exports.EspecialistaImagenesCelular = EspecialistaImagenesCelular;
|
|
142
|
-
EspecialistaImagenesCelular.storyName = "Especialista de imágenes · celular";
|
|
143
|
-
EspecialistaImagenesCelular.args = EspecialistaImagenes.args;
|
|
144
|
-
EspecialistaImagenesCelular.parameters = {
|
|
145
|
-
viewport: {
|
|
146
|
-
defaultViewport: "mobile2"
|
|
147
|
-
}
|
|
148
|
-
};
|