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,195 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
|
|
5
|
-
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/slicedToArray"));
|
|
6
|
-
|
|
7
|
-
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
|
|
8
|
-
|
|
9
|
-
var _vitest = require("vitest");
|
|
10
|
-
|
|
11
|
-
var _services = require("./services");
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Lista lateral de la edición a partir de GET /product-services.
|
|
15
|
-
*
|
|
16
|
-
* npx vitest run src/components/pages/ProductEdition
|
|
17
|
-
*/
|
|
18
|
-
var person = function person(id_user, name) {
|
|
19
|
-
return {
|
|
20
|
-
id_user: id_user,
|
|
21
|
-
name: name,
|
|
22
|
-
last_name: "Prueba"
|
|
23
|
-
};
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
var status = function status(status_name) {
|
|
27
|
-
var extra = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
28
|
-
return (0, _objectSpread2.default)({
|
|
29
|
-
status_name: status_name,
|
|
30
|
-
display_name: status_name,
|
|
31
|
-
color: null
|
|
32
|
-
}, extra);
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
var productServices = {
|
|
36
|
-
article_id: 10,
|
|
37
|
-
order_id: 500,
|
|
38
|
-
services: [{
|
|
39
|
-
service_name: "datasheet",
|
|
40
|
-
display_name: "Ficha técnica",
|
|
41
|
-
category: {
|
|
42
|
-
category_name: "texts"
|
|
43
|
-
},
|
|
44
|
-
status_flow: {
|
|
45
|
-
flow_name: "workflow",
|
|
46
|
-
flow_type: "workflow"
|
|
47
|
-
},
|
|
48
|
-
is_legacy: true,
|
|
49
|
-
status: status("PA"),
|
|
50
|
-
retailers: [{
|
|
51
|
-
id_retailer: 58,
|
|
52
|
-
status: status("PA")
|
|
53
|
-
}, {
|
|
54
|
-
id_retailer: 59,
|
|
55
|
-
status: status("RA/AS")
|
|
56
|
-
}],
|
|
57
|
-
roles: ["especialist", "facilitator", "auditor"],
|
|
58
|
-
assignees: {
|
|
59
|
-
especialist: person(426, "Textos"),
|
|
60
|
-
facilitator: person(901, "Coord"),
|
|
61
|
-
auditor: person(903, "QA")
|
|
62
|
-
},
|
|
63
|
-
actions: {
|
|
64
|
-
set_status: false,
|
|
65
|
-
assign: false
|
|
66
|
-
}
|
|
67
|
-
}, {
|
|
68
|
-
service_name: "productPurchase",
|
|
69
|
-
display_name: "Compra de producto",
|
|
70
|
-
icon_name: null,
|
|
71
|
-
category: {
|
|
72
|
-
category_name: "logistics"
|
|
73
|
-
},
|
|
74
|
-
status_flow: {
|
|
75
|
-
flow_name: "checkbox",
|
|
76
|
-
flow_type: "simple"
|
|
77
|
-
},
|
|
78
|
-
is_legacy: false,
|
|
79
|
-
per_retailer: false,
|
|
80
|
-
status: status("PE", {
|
|
81
|
-
display_name: "Pendiente",
|
|
82
|
-
color: "#FFAA00",
|
|
83
|
-
is_final: false
|
|
84
|
-
}),
|
|
85
|
-
retailers: [{
|
|
86
|
-
id_retailer: 0,
|
|
87
|
-
status: status("PE", {
|
|
88
|
-
display_name: "Pendiente",
|
|
89
|
-
color: "#FFAA00",
|
|
90
|
-
is_final: false
|
|
91
|
-
})
|
|
92
|
-
}],
|
|
93
|
-
status_options: [status("PE"), status("HE", {
|
|
94
|
-
is_final: true
|
|
95
|
-
})],
|
|
96
|
-
roles: ["especialist"],
|
|
97
|
-
assignees: {
|
|
98
|
-
especialist: person(426, "Textos"),
|
|
99
|
-
facilitator: null,
|
|
100
|
-
auditor: null
|
|
101
|
-
},
|
|
102
|
-
actions: {
|
|
103
|
-
set_status: true,
|
|
104
|
-
assign: true
|
|
105
|
-
}
|
|
106
|
-
}]
|
|
107
|
-
};
|
|
108
|
-
(0, _vitest.describe)("buildServicesFromApi", function () {
|
|
109
|
-
var specialist = {
|
|
110
|
-
id_user: 426,
|
|
111
|
-
id_role: 7
|
|
112
|
-
};
|
|
113
|
-
(0, _vitest.it)("toma el estatus de la cadena activa; si no está en ella, el general", function () {
|
|
114
|
-
var _buildServicesFromApi = (0, _services.buildServicesFromApi)({
|
|
115
|
-
productServices: productServices,
|
|
116
|
-
user: specialist,
|
|
117
|
-
activeRetailerId: 59
|
|
118
|
-
}),
|
|
119
|
-
_buildServicesFromApi2 = (0, _slicedToArray2.default)(_buildServicesFromApi, 2),
|
|
120
|
-
datasheet = _buildServicesFromApi2[0],
|
|
121
|
-
purchase = _buildServicesFromApi2[1];
|
|
122
|
-
|
|
123
|
-
(0, _vitest.expect)(datasheet.status).toBe("RA/AS");
|
|
124
|
-
(0, _vitest.expect)(purchase.status).toBe("PE");
|
|
125
|
-
});
|
|
126
|
-
(0, _vitest.it)("los de siempre conservan su pestaña; los del catálogo usan su bloque y la vista simple", function () {
|
|
127
|
-
var _buildServicesFromApi3 = (0, _services.buildServicesFromApi)({
|
|
128
|
-
productServices: productServices,
|
|
129
|
-
user: specialist,
|
|
130
|
-
activeRetailerId: 58
|
|
131
|
-
}),
|
|
132
|
-
_buildServicesFromApi4 = (0, _slicedToArray2.default)(_buildServicesFromApi3, 2),
|
|
133
|
-
datasheet = _buildServicesFromApi4[0],
|
|
134
|
-
purchase = _buildServicesFromApi4[1];
|
|
135
|
-
|
|
136
|
-
(0, _vitest.expect)(datasheet).toMatchObject({
|
|
137
|
-
tab: "Ficha técnica",
|
|
138
|
-
group: "texts",
|
|
139
|
-
is_catalog: false
|
|
140
|
-
});
|
|
141
|
-
(0, _vitest.expect)(purchase).toMatchObject({
|
|
142
|
-
tab: null,
|
|
143
|
-
group: "logistics",
|
|
144
|
-
view: "simple",
|
|
145
|
-
icon: "purchase",
|
|
146
|
-
status_label: "Pendiente",
|
|
147
|
-
status_color: "#FFAA00",
|
|
148
|
-
status_flow_type: "simple",
|
|
149
|
-
is_catalog: true
|
|
150
|
-
});
|
|
151
|
-
(0, _vitest.expect)(purchase.api).toBe(productServices.services[1]);
|
|
152
|
-
});
|
|
153
|
-
(0, _vitest.it)("«Míos» y «te toca» salen del equipo del servicio", function () {
|
|
154
|
-
var _buildServicesFromApi5 = (0, _services.buildServicesFromApi)({
|
|
155
|
-
productServices: productServices,
|
|
156
|
-
user: specialist,
|
|
157
|
-
activeRetailerId: 59
|
|
158
|
-
}),
|
|
159
|
-
_buildServicesFromApi6 = (0, _slicedToArray2.default)(_buildServicesFromApi5, 2),
|
|
160
|
-
datasheet = _buildServicesFromApi6[0],
|
|
161
|
-
purchase = _buildServicesFromApi6[1]; // RA/AS: le toca a la especialista asignada.
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
(0, _vitest.expect)(datasheet).toMatchObject({
|
|
165
|
-
mine: true,
|
|
166
|
-
pending: true
|
|
167
|
-
}); // Flujo simple sin terminar: le toca a su especialista.
|
|
168
|
-
|
|
169
|
-
(0, _vitest.expect)(purchase).toMatchObject({
|
|
170
|
-
mine: true,
|
|
171
|
-
pending: true
|
|
172
|
-
});
|
|
173
|
-
|
|
174
|
-
var _buildServicesFromApi7 = (0, _services.buildServicesFromApi)({
|
|
175
|
-
productServices: productServices,
|
|
176
|
-
user: {
|
|
177
|
-
id_user: 1
|
|
178
|
-
},
|
|
179
|
-
activeRetailerId: 59
|
|
180
|
-
}),
|
|
181
|
-
_buildServicesFromApi8 = (0, _slicedToArray2.default)(_buildServicesFromApi7, 2),
|
|
182
|
-
other = _buildServicesFromApi8[1];
|
|
183
|
-
|
|
184
|
-
(0, _vitest.expect)(other).toMatchObject({
|
|
185
|
-
mine: false,
|
|
186
|
-
pending: false
|
|
187
|
-
});
|
|
188
|
-
});
|
|
189
|
-
(0, _vitest.it)("sin respuesta del backend, lista vacía", function () {
|
|
190
|
-
(0, _vitest.expect)((0, _services.buildServicesFromApi)({
|
|
191
|
-
productServices: null,
|
|
192
|
-
user: specialist
|
|
193
|
-
})).toEqual([]);
|
|
194
|
-
});
|
|
195
|
-
});
|
|
@@ -1,143 +0,0 @@
|
|
|
1
|
-
import { Box, Button, Stack, Typography } from "@mui/material";
|
|
2
|
-
import MenuIcon from "@mui/icons-material/Menu";
|
|
3
|
-
import SaveOutlinedIcon from "@mui/icons-material/SaveOutlined";
|
|
4
|
-
|
|
5
|
-
import {
|
|
6
|
-
COLORS,
|
|
7
|
-
FONT_STACK,
|
|
8
|
-
TITLE_STACK,
|
|
9
|
-
PersonAvatar,
|
|
10
|
-
ServiceIcon,
|
|
11
|
-
StatusChip,
|
|
12
|
-
outlineButtonSx,
|
|
13
|
-
primaryButtonSx,
|
|
14
|
-
} from "./ui";
|
|
15
|
-
import { ROLE_LABELS, fullName, groupLabel, isMine } from "./model";
|
|
16
|
-
|
|
17
|
-
/*
|
|
18
|
-
Barra del servicio abierto. Ocupa el lugar de la barra de pestañas: dice en
|
|
19
|
-
qué servicio estás, su estatus y su equipo, y lleva la acción de guardar.
|
|
20
|
-
No hay botón de «siguiente»: quien produce ya sabe qué le toca, y la lista
|
|
21
|
-
lateral lo marca con el punto rosa.
|
|
22
|
-
*/
|
|
23
|
-
|
|
24
|
-
const Team = ({ assignees = {}, userId }) => (
|
|
25
|
-
<Stack direction="row" alignItems="center" spacing={1.5} sx={{ flexWrap: "wrap", rowGap: 0.5 }}>
|
|
26
|
-
{Object.entries(ROLE_LABELS).map(([role, label]) => {
|
|
27
|
-
const user = assignees[role];
|
|
28
|
-
const isMe = Boolean(user) && user.id_user === userId;
|
|
29
|
-
return (
|
|
30
|
-
<Stack key={role} direction="row" alignItems="center" spacing={0.75}>
|
|
31
|
-
<PersonAvatar user={user} isMe={isMe} size={24} title={user ? `${label}: ${fullName(user)}` : `${label}: sin asignar`} />
|
|
32
|
-
<Box sx={{ lineHeight: 1.1 }}>
|
|
33
|
-
<Typography sx={{ fontFamily: FONT_STACK, fontSize: 10, color: COLORS.s4, textTransform: "uppercase", letterSpacing: "0.05em" }}>
|
|
34
|
-
{label}
|
|
35
|
-
</Typography>
|
|
36
|
-
<Typography sx={{ fontFamily: FONT_STACK, fontSize: 12, fontWeight: isMe ? 700 : 400, color: user ? COLORS.s5 : COLORS.s3 }}>
|
|
37
|
-
{user ? (isMe ? "Tú" : user.name) : "Sin asignar"}
|
|
38
|
-
</Typography>
|
|
39
|
-
</Box>
|
|
40
|
-
</Stack>
|
|
41
|
-
);
|
|
42
|
-
})}
|
|
43
|
-
</Stack>
|
|
44
|
-
);
|
|
45
|
-
|
|
46
|
-
export const ServiceToolbar = ({
|
|
47
|
-
service,
|
|
48
|
-
isSummary = false,
|
|
49
|
-
summaryCounts,
|
|
50
|
-
onOpenRail,
|
|
51
|
-
userId,
|
|
52
|
-
}) => {
|
|
53
|
-
const canSave = !isSummary && service && isMine(service, userId);
|
|
54
|
-
|
|
55
|
-
return (
|
|
56
|
-
<Box
|
|
57
|
-
sx={{
|
|
58
|
-
display: "flex",
|
|
59
|
-
flexWrap: "wrap",
|
|
60
|
-
alignItems: "center",
|
|
61
|
-
columnGap: 2,
|
|
62
|
-
rowGap: 1.25,
|
|
63
|
-
pb: 1.5,
|
|
64
|
-
mb: 2,
|
|
65
|
-
borderBottom: `2px solid ${COLORS.s2}`,
|
|
66
|
-
}}
|
|
67
|
-
>
|
|
68
|
-
{onOpenRail && (
|
|
69
|
-
<Button onClick={onOpenRail} startIcon={<MenuIcon sx={{ fontSize: 18 }} />} sx={outlineButtonSx}>
|
|
70
|
-
Servicios
|
|
71
|
-
</Button>
|
|
72
|
-
)}
|
|
73
|
-
|
|
74
|
-
<Stack direction="row" alignItems="center" spacing={1.25} sx={{ minWidth: 0, flex: "1 1 260px" }}>
|
|
75
|
-
<Box
|
|
76
|
-
sx={{
|
|
77
|
-
width: 36,
|
|
78
|
-
height: 36,
|
|
79
|
-
borderRadius: "10px",
|
|
80
|
-
bgcolor: COLORS.s2,
|
|
81
|
-
display: "flex",
|
|
82
|
-
alignItems: "center",
|
|
83
|
-
justifyContent: "center",
|
|
84
|
-
flexShrink: 0,
|
|
85
|
-
}}
|
|
86
|
-
>
|
|
87
|
-
<ServiceIcon icon={isSummary ? "summary" : service?.icon} sx={{ fontSize: 20, color: COLORS.magenta_s2 }} />
|
|
88
|
-
</Box>
|
|
89
|
-
<Box sx={{ minWidth: 0 }}>
|
|
90
|
-
<Typography
|
|
91
|
-
sx={{
|
|
92
|
-
fontFamily: FONT_STACK,
|
|
93
|
-
fontSize: 11,
|
|
94
|
-
fontWeight: 700,
|
|
95
|
-
letterSpacing: "0.06em",
|
|
96
|
-
textTransform: "uppercase",
|
|
97
|
-
color: COLORS.s4,
|
|
98
|
-
}}
|
|
99
|
-
>
|
|
100
|
-
{isSummary ? "Todos los servicios" : groupLabel(service?.group)}
|
|
101
|
-
</Typography>
|
|
102
|
-
<Stack direction="row" alignItems="center" spacing={1} sx={{ minWidth: 0 }}>
|
|
103
|
-
<Typography
|
|
104
|
-
component="h3"
|
|
105
|
-
sx={{
|
|
106
|
-
fontFamily: TITLE_STACK,
|
|
107
|
-
fontWeight: 500,
|
|
108
|
-
fontSize: 20,
|
|
109
|
-
lineHeight: "26px",
|
|
110
|
-
color: COLORS.s5,
|
|
111
|
-
overflow: "hidden",
|
|
112
|
-
textOverflow: "ellipsis",
|
|
113
|
-
whiteSpace: "nowrap",
|
|
114
|
-
}}
|
|
115
|
-
>
|
|
116
|
-
{isSummary ? "Resumen" : service?.display_name}
|
|
117
|
-
</Typography>
|
|
118
|
-
{!isSummary && service && <StatusChip status={service.status} oval />}
|
|
119
|
-
</Stack>
|
|
120
|
-
</Box>
|
|
121
|
-
</Stack>
|
|
122
|
-
|
|
123
|
-
{isSummary ? (
|
|
124
|
-
summaryCounts && (
|
|
125
|
-
<Typography sx={{ fontFamily: FONT_STACK, fontSize: 13, color: COLORS.s4 }}>
|
|
126
|
-
{summaryCounts.total} servicios · {summaryCounts.pending} te{" "}
|
|
127
|
-
{summaryCounts.pending === 1 ? "toca" : "tocan"} a ti
|
|
128
|
-
</Typography>
|
|
129
|
-
)
|
|
130
|
-
) : (
|
|
131
|
-
<Team assignees={service?.assignees} userId={userId} />
|
|
132
|
-
)}
|
|
133
|
-
|
|
134
|
-
<Stack direction="row" spacing={1} sx={{ ml: "auto" }}>
|
|
135
|
-
{canSave && (
|
|
136
|
-
<Button variant="contained" startIcon={<SaveOutlinedIcon sx={{ fontSize: 18 }} />} sx={primaryButtonSx}>
|
|
137
|
-
Guardar
|
|
138
|
-
</Button>
|
|
139
|
-
)}
|
|
140
|
-
</Stack>
|
|
141
|
-
</Box>
|
|
142
|
-
);
|
|
143
|
-
};
|
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
import { ServicesNavigation } from "./index";
|
|
2
|
-
import { DEMO_PRODUCT, DEMO_USERS, TWENTY_SERVICES, buildServices } from "./catalog";
|
|
3
|
-
import { SUMMARY } from "./model";
|
|
4
|
-
|
|
5
|
-
/*
|
|
6
|
-
Prototipo de la navegación por servicios en la edición de producto.
|
|
7
|
-
Datos de ejemplo: no le pega a ninguna API.
|
|
8
|
-
|
|
9
|
-
Cada historia es el mismo producto visto por una persona distinta. Lo que hay
|
|
10
|
-
que probar es la navegación: la lista lateral, «Míos / Todos», el Resumen y,
|
|
11
|
-
en las de imágenes, el selector de servicio dentro de la vista.
|
|
12
|
-
*/
|
|
13
|
-
|
|
14
|
-
export default {
|
|
15
|
-
title: "Prototipos/Navegación por servicios",
|
|
16
|
-
// Id sin acento, para que la liga de cada historia se pueda compartir.
|
|
17
|
-
id: "prototipos-navegacion-servicios",
|
|
18
|
-
component: ServicesNavigation,
|
|
19
|
-
parameters: { layout: "fullscreen" },
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
// Como en la app: la edición vive en una caja de altura fija.
|
|
23
|
-
const Template = (args) => (
|
|
24
|
-
<div style={{ height: "100vh", display: "flex", overflow: "hidden" }}>
|
|
25
|
-
<ServicesNavigation {...args} />
|
|
26
|
-
</div>
|
|
27
|
-
);
|
|
28
|
-
|
|
29
|
-
const { ana, carlos, diana, helena } = DEMO_USERS;
|
|
30
|
-
|
|
31
|
-
const FOUR_SERVICES = buildServices([
|
|
32
|
-
["datasheet", "AS", { especialist: ana }],
|
|
33
|
-
["description", "RA/AS", { especialist: ana }],
|
|
34
|
-
["images", "PA"],
|
|
35
|
-
["translation", "CA", { especialist: diana }],
|
|
36
|
-
]);
|
|
37
|
-
|
|
38
|
-
/** El producto solo lleva Traducción: no hay lista, abre directo en ella. */
|
|
39
|
-
export const SoloTraduccion = Template.bind({});
|
|
40
|
-
SoloTraduccion.storyName = "Solo Traducción";
|
|
41
|
-
SoloTraduccion.args = {
|
|
42
|
-
product: DEMO_PRODUCT,
|
|
43
|
-
services: buildServices([["translation", "CA", { especialist: diana }]]),
|
|
44
|
-
currentUser: diana,
|
|
45
|
-
currentUserRole: "Especialista de traducción",
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
/** Caso de hoy (3 o 4 servicios), visto por la coordinadora: ve todos. */
|
|
49
|
-
export const CuatroServiciosCoordinadora = Template.bind({});
|
|
50
|
-
CuatroServiciosCoordinadora.storyName = "4 servicios · coordinadora";
|
|
51
|
-
CuatroServiciosCoordinadora.args = {
|
|
52
|
-
product: DEMO_PRODUCT,
|
|
53
|
-
services: FOUR_SERVICES,
|
|
54
|
-
currentUser: helena,
|
|
55
|
-
currentUserRole: "Coordinadora",
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
/** Mismo producto, visto por la especialista de textos: «Míos» por omisión. */
|
|
59
|
-
export const CuatroServiciosEspecialistaTextos = Template.bind({});
|
|
60
|
-
CuatroServiciosEspecialistaTextos.storyName = "4 servicios · especialista de textos";
|
|
61
|
-
CuatroServiciosEspecialistaTextos.args = {
|
|
62
|
-
product: DEMO_PRODUCT,
|
|
63
|
-
services: FOUR_SERVICES,
|
|
64
|
-
currentUser: ana,
|
|
65
|
-
currentUserRole: "Especialista de textos",
|
|
66
|
-
};
|
|
67
|
-
|
|
68
|
-
/** 20 servicios; el especialista de imágenes solo ve sus 3 hasta que pide «Todos». */
|
|
69
|
-
export const VeinteServiciosEspecialistaImagenes = Template.bind({});
|
|
70
|
-
VeinteServiciosEspecialistaImagenes.storyName = "20 servicios · especialista de imágenes";
|
|
71
|
-
VeinteServiciosEspecialistaImagenes.args = {
|
|
72
|
-
product: DEMO_PRODUCT,
|
|
73
|
-
services: TWENTY_SERVICES,
|
|
74
|
-
currentUser: carlos,
|
|
75
|
-
currentUserRole: "Especialista de imágenes",
|
|
76
|
-
};
|
|
77
|
-
|
|
78
|
-
/** 20 servicios vistos por la coordinadora: entra al Resumen. */
|
|
79
|
-
export const VeinteServiciosCoordinadora = Template.bind({});
|
|
80
|
-
VeinteServiciosCoordinadora.storyName = "20 servicios · coordinadora";
|
|
81
|
-
VeinteServiciosCoordinadora.args = {
|
|
82
|
-
product: DEMO_PRODUCT,
|
|
83
|
-
services: TWENTY_SERVICES,
|
|
84
|
-
currentUser: helena,
|
|
85
|
-
currentUserRole: "Coordinadora",
|
|
86
|
-
initialService: SUMMARY,
|
|
87
|
-
};
|
|
88
|
-
|
|
89
|
-
/** La lista contraída a íconos, para dejarle todo el ancho al editor. */
|
|
90
|
-
export const VeinteServiciosListaContraida = Template.bind({});
|
|
91
|
-
VeinteServiciosListaContraida.storyName = "20 servicios · lista contraída";
|
|
92
|
-
VeinteServiciosListaContraida.args = {
|
|
93
|
-
...VeinteServiciosEspecialistaImagenes.args,
|
|
94
|
-
initialCollapsed: true,
|
|
95
|
-
};
|
|
96
|
-
|
|
97
|
-
/** En celular la lista se abre como panel con el botón «Servicios». */
|
|
98
|
-
export const VeinteServiciosCelular = Template.bind({});
|
|
99
|
-
VeinteServiciosCelular.storyName = "20 servicios · celular";
|
|
100
|
-
VeinteServiciosCelular.args = VeinteServiciosEspecialistaImagenes.args;
|
|
101
|
-
VeinteServiciosCelular.parameters = { viewport: { defaultViewport: "mobile2" } };
|