@imj_media/tareas 0.1.49 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/tareas.es.js
CHANGED
|
@@ -1,55 +1,17 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsxs as c, Fragment as $, jsx as t } from "react/jsx-runtime";
|
|
2
2
|
import "@imj_media/imj-ui/styles.css";
|
|
3
|
-
import { useQueryClient as et, useQuery as ct, useMutation as it, useInfiniteQuery as ut, QueryClient as
|
|
4
|
-
import { useState as
|
|
5
|
-
import {
|
|
3
|
+
import { useQueryClient as et, useQuery as ct, useMutation as it, useInfiniteQuery as ut, QueryClient as Yt, QueryClientProvider as Gt } from "@tanstack/react-query";
|
|
4
|
+
import { useState as y, useRef as Y, useEffect as q, createContext as at, useContext as rt } from "react";
|
|
5
|
+
import { Icons as P, Tooltip as K } from "@imj_media/tasks-modules";
|
|
6
6
|
import nt from "react-dom";
|
|
7
|
-
import
|
|
7
|
+
import At from "axios";
|
|
8
8
|
import St from "qs";
|
|
9
|
-
import { parseISO as
|
|
9
|
+
import { parseISO as Xt, formatDistanceToNow as Zt, format as Dt } from "date-fns";
|
|
10
10
|
import { es as mt } from "date-fns/locale";
|
|
11
|
-
import { Button as Mt, Input as
|
|
12
|
-
import { useForm as
|
|
11
|
+
import { Button as Mt, Input as Jt, Label as Vt, Accordion as te, AccordionItem as ee, AccordionTrigger as ae, AccordionContent as re } from "@imj_media/imj-ui";
|
|
12
|
+
import { useForm as ne } from "react-hook-form";
|
|
13
13
|
import { Paginator as se } from "primereact/paginator";
|
|
14
|
-
const
|
|
15
|
-
L,
|
|
16
|
-
{
|
|
17
|
-
dispatch: /* @__PURE__ */ t("button", { className: "tw-text-texts-placeholder tw-text-xl tw-font-semibold tw-cursor-help", children: a }),
|
|
18
|
-
children: /* @__PURE__ */ t("div", { className: "tw-flex tw-items-center tw-justify-center tw-px-3 tw-py-2 tw-bg-bg-card tw-rounded-lg tw-border tw-border-border-card", children: /* @__PURE__ */ t("p", { className: "tw-text-texts-placeholder tw-text-lg tw-font-semibold", children: "Espéralo muy pronto..." }) })
|
|
19
|
-
}
|
|
20
|
-
) : /* @__PURE__ */ t(
|
|
21
|
-
"button",
|
|
22
|
-
{
|
|
23
|
-
disabled: n,
|
|
24
|
-
onClick: l,
|
|
25
|
-
className: `${e ? "tw-text-texts-enfasis tw-border-b-2 tw-border-texts-enfasis" : ""} tw-text-xl tw-font-semibold ${n ? "tw-cursor-not-allowed tw-text-texts-placeholder tw-text-lg" : "tw-text-texts-subtext"}`,
|
|
26
|
-
children: a
|
|
27
|
-
}
|
|
28
|
-
), oe = ({ tabs: a, renderItem: e, initialTab: l }) => {
|
|
29
|
-
const [n, r] = v(l ?? a[0].toLowerCase());
|
|
30
|
-
T(() => {
|
|
31
|
-
l && r(l);
|
|
32
|
-
}, [l]);
|
|
33
|
-
const s = (i) => {
|
|
34
|
-
r(i), e(i);
|
|
35
|
-
};
|
|
36
|
-
return /* @__PURE__ */ t("div", { className: "tw-flex", children: a.map((i, d) => /* @__PURE__ */ t(
|
|
37
|
-
"div",
|
|
38
|
-
{
|
|
39
|
-
className: `${d === 0 ? "tw-border-l-2" : ""} tw-border-r-2 tw-border-gray-200 tw-px-m`,
|
|
40
|
-
children: /* @__PURE__ */ t(
|
|
41
|
-
ie,
|
|
42
|
-
{
|
|
43
|
-
onClick: () => s(i.toLowerCase()),
|
|
44
|
-
label: i,
|
|
45
|
-
active: i.toLowerCase() === n,
|
|
46
|
-
disabled: ["gantt"].includes(i.toLowerCase())
|
|
47
|
-
},
|
|
48
|
-
d
|
|
49
|
-
)
|
|
50
|
-
}
|
|
51
|
-
)) });
|
|
52
|
-
}, p = {
|
|
14
|
+
const p = {
|
|
53
15
|
bg: {
|
|
54
16
|
DEFAULT: "#EFEFEF",
|
|
55
17
|
content: "#FAFAFA",
|
|
@@ -134,41 +96,41 @@ const ie = ({ label: a, active: e, onClick: l, disabled: n }) => n ? /* @__PURE_
|
|
|
134
96
|
black_regular: "#252525"
|
|
135
97
|
}
|
|
136
98
|
}, pt = () => {
|
|
137
|
-
const [a, e] =
|
|
99
|
+
const [a, e] = y(null);
|
|
138
100
|
return {
|
|
139
101
|
//Properties
|
|
140
102
|
position: a,
|
|
141
103
|
//Methods
|
|
142
|
-
setElementPosition: (
|
|
104
|
+
setElementPosition: (l) => {
|
|
143
105
|
var g;
|
|
144
|
-
let i = (g =
|
|
106
|
+
let i = (g = l.current) == null ? void 0 : g.getBoundingClientRect(), d = (i == null ? void 0 : i.x) + ((i == null ? void 0 : i.width) ?? 0), o = (i == null ? void 0 : i.y) + (i == null ? void 0 : i.height);
|
|
145
107
|
e(a ? null : { x: d ?? 0, y: o ?? 0 });
|
|
146
108
|
},
|
|
147
|
-
getChildrenSize: (
|
|
109
|
+
getChildrenSize: (l) => {
|
|
148
110
|
var i;
|
|
149
|
-
return (i =
|
|
111
|
+
return (i = l.current) == null ? void 0 : i.getBoundingClientRect();
|
|
150
112
|
},
|
|
151
113
|
clearPosition: () => {
|
|
152
114
|
e(null);
|
|
153
115
|
}
|
|
154
116
|
};
|
|
155
|
-
},
|
|
117
|
+
}, le = ({
|
|
156
118
|
children: a,
|
|
157
119
|
filterChildren: e
|
|
158
120
|
}) => {
|
|
159
|
-
const { position:
|
|
160
|
-
const [d, o] =
|
|
161
|
-
return
|
|
162
|
-
var g,
|
|
121
|
+
const { position: s, setElementPosition: n } = pt(), r = Y(null), l = ({ children: i }) => {
|
|
122
|
+
const [d, o] = y();
|
|
123
|
+
return q(() => {
|
|
124
|
+
var g, m;
|
|
163
125
|
e.current && o(
|
|
164
|
-
((
|
|
126
|
+
((s == null ? void 0 : s.x) ?? 0) - (((m = (g = e.current) == null ? void 0 : g.getBoundingClientRect()) == null ? void 0 : m.width) ?? 0)
|
|
165
127
|
);
|
|
166
|
-
}, [e == null ? void 0 : e.current,
|
|
128
|
+
}, [e == null ? void 0 : e.current, s == null ? void 0 : s.x]), s && nt.createPortal(
|
|
167
129
|
/* @__PURE__ */ t(
|
|
168
130
|
"div",
|
|
169
131
|
{
|
|
170
132
|
className: `tw-absolute tw-w-fit tw-h-fit ${d ? "tw-block" : "tw-hidden"}`,
|
|
171
|
-
style: { top: `${
|
|
133
|
+
style: { top: `${s == null ? void 0 : s.y}px`, left: `${d}px`, zIndex: 1 },
|
|
172
134
|
"data-portal-host": !0,
|
|
173
135
|
children: i
|
|
174
136
|
}
|
|
@@ -176,7 +138,7 @@ const ie = ({ label: a, active: e, onClick: l, disabled: n }) => n ? /* @__PURE_
|
|
|
176
138
|
document.body
|
|
177
139
|
);
|
|
178
140
|
};
|
|
179
|
-
return /* @__PURE__ */ c(
|
|
141
|
+
return /* @__PURE__ */ c($, { children: [
|
|
180
142
|
/* @__PURE__ */ c(
|
|
181
143
|
"label",
|
|
182
144
|
{
|
|
@@ -184,7 +146,7 @@ const ie = ({ label: a, active: e, onClick: l, disabled: n }) => n ? /* @__PURE_
|
|
|
184
146
|
htmlFor: "filter-button",
|
|
185
147
|
className: "tw-flex tw-cursor-pointer tw-text-xl tw-items-center tw-gap-m tw-p-s tw-text-texts-enfasis tw-fill-texts-enfasis tw-bg-bg tw-rounded-lg tw-px-l tw-h-[30px] tw-shadow-button-primary hover:tw-shadow-button-primary-hover",
|
|
186
148
|
children: [
|
|
187
|
-
/* @__PURE__ */ t(
|
|
149
|
+
/* @__PURE__ */ t(P, { icon: "filter", size: "xs", strokeWidth: 5, color: p.primary.regular }),
|
|
188
150
|
"Filtrar"
|
|
189
151
|
]
|
|
190
152
|
}
|
|
@@ -199,74 +161,77 @@ const ie = ({ label: a, active: e, onClick: l, disabled: n }) => n ? /* @__PURE_
|
|
|
199
161
|
}
|
|
200
162
|
}
|
|
201
163
|
),
|
|
202
|
-
/* @__PURE__ */ t(
|
|
164
|
+
/* @__PURE__ */ t(l, { children: a })
|
|
203
165
|
] });
|
|
204
166
|
}, Tt = (a) => {
|
|
205
167
|
let e = {};
|
|
206
|
-
return Object.entries(a).forEach(([
|
|
207
|
-
if (
|
|
208
|
-
let [r,
|
|
209
|
-
e[r] = e[r] || {}, e[r][
|
|
168
|
+
return Object.entries(a).forEach(([s, n]) => {
|
|
169
|
+
if (s.includes(".")) {
|
|
170
|
+
let [r, l] = s.split(".");
|
|
171
|
+
e[r] = e[r] || {}, e[r][l] = n;
|
|
210
172
|
} else
|
|
211
|
-
e[
|
|
173
|
+
e[s] = n;
|
|
212
174
|
}), e;
|
|
213
|
-
}, Et = at({}),
|
|
214
|
-
const [e,
|
|
215
|
-
function
|
|
216
|
-
return !isNaN(
|
|
175
|
+
}, Et = at({}), ie = ({ children: a }) => {
|
|
176
|
+
const [e, s] = y({}), [n, r] = y({}), [l, i] = y([]), [d, o] = y(""), g = ({ name: x, value: u }) => {
|
|
177
|
+
function h(v) {
|
|
178
|
+
return !isNaN(v) && v !== null && v !== "" ? parseFloat(v) : null;
|
|
217
179
|
}
|
|
218
|
-
let _ =
|
|
219
|
-
r((
|
|
220
|
-
let C = { ...
|
|
221
|
-
(
|
|
180
|
+
let _ = h(u);
|
|
181
|
+
r((v) => {
|
|
182
|
+
let C = { ...v }, T = l == null ? void 0 : l.find(
|
|
183
|
+
(k) => k.label.toLowerCase().replace(/ /g, "_") === x
|
|
222
184
|
);
|
|
223
|
-
return
|
|
185
|
+
return T ? C[T.id] = _ ?? u : C[x] = _ ?? u, C;
|
|
224
186
|
});
|
|
225
187
|
};
|
|
226
|
-
|
|
227
|
-
let
|
|
228
|
-
r(
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
let
|
|
235
|
-
|
|
188
|
+
q(() => {
|
|
189
|
+
let x = l.map((u) => u.id === "owner.config" ? [u.id, "yo_y_mis_equipos"] : u.id === "dependency" ? [u.id, "ambas"] : [u.id, null]);
|
|
190
|
+
r((u) => {
|
|
191
|
+
let h = { search: u == null ? void 0 : u.search, taskName: u == null ? void 0 : u.taskName };
|
|
192
|
+
return h = { ...h, ...Object.fromEntries(x) }, h;
|
|
193
|
+
});
|
|
194
|
+
}, [l]);
|
|
195
|
+
const m = () => {
|
|
196
|
+
let x = l.map((u) => u.id === "owner.config" ? [u.id, "yo_y_mis_equipos"] : u.id === "dependency" ? [u.id, "ambas"] : [u.id, null]);
|
|
197
|
+
r(Object.fromEntries(x)), s(Tt(Object.fromEntries(x)));
|
|
198
|
+
}, b = () => {
|
|
199
|
+
let x = Tt(n);
|
|
200
|
+
s(x);
|
|
236
201
|
};
|
|
237
202
|
return /* @__PURE__ */ t(
|
|
238
203
|
Et.Provider,
|
|
239
204
|
{
|
|
240
205
|
value: {
|
|
241
206
|
//properties
|
|
242
|
-
fields:
|
|
207
|
+
fields: l,
|
|
243
208
|
filters: e,
|
|
244
209
|
path: d,
|
|
245
210
|
//methods
|
|
246
211
|
defineFields: i,
|
|
247
212
|
updateFilters: g,
|
|
248
|
-
cleanFilters:
|
|
249
|
-
applyFilters:
|
|
213
|
+
cleanFilters: m,
|
|
214
|
+
applyFilters: b,
|
|
250
215
|
initialFilters: n,
|
|
251
216
|
selectPath: o
|
|
252
217
|
},
|
|
253
218
|
children: a
|
|
254
219
|
}
|
|
255
220
|
);
|
|
256
|
-
},
|
|
257
|
-
function
|
|
221
|
+
}, U = () => rt(Et);
|
|
222
|
+
function oe(a, e = 300, s = { leading: !1, trailing: !0 }) {
|
|
258
223
|
let n, r = null;
|
|
259
|
-
return function(...
|
|
260
|
-
const i = Date.now(), d =
|
|
261
|
-
clearTimeout(n), d && a(...
|
|
262
|
-
|
|
224
|
+
return function(...l) {
|
|
225
|
+
const i = Date.now(), d = s.leading && !r;
|
|
226
|
+
clearTimeout(n), d && a(...l), r = i, n = setTimeout(() => {
|
|
227
|
+
s.trailing && (!s.leading || i - r >= e) && (a(...l), r = null);
|
|
263
228
|
}, e);
|
|
264
229
|
};
|
|
265
230
|
}
|
|
266
|
-
const
|
|
231
|
+
const Q = ({
|
|
267
232
|
imageUrl: a = "https://www.uv.unach.mx/assets/img/prueba/directorio/userM.png",
|
|
268
233
|
alt: e = "avatar",
|
|
269
|
-
size:
|
|
234
|
+
size: s = "s"
|
|
270
235
|
}) => {
|
|
271
236
|
const n = {
|
|
272
237
|
xs: "tw-w-[24px] tw-h-[24px] tw-min-w-[24px] tw-min-h-[24px]",
|
|
@@ -275,7 +240,7 @@ const O = ({
|
|
|
275
240
|
l: "tw-w-[36px] tw-h-[36px] tw-min-w-[36px] tw-min-h-[36px]",
|
|
276
241
|
xl: "tw-w-[40px] tw-h-[40px] tw-min-w-[40px] tw-min-h-[40px]",
|
|
277
242
|
xxl: "tw-w-[44px] tw-h-[44px] tw-min-w-[44px] tw-min-h-[44px]"
|
|
278
|
-
}[
|
|
243
|
+
}[s];
|
|
279
244
|
return /* @__PURE__ */ t(
|
|
280
245
|
"img",
|
|
281
246
|
{
|
|
@@ -288,8 +253,8 @@ const O = ({
|
|
|
288
253
|
options: a,
|
|
289
254
|
onselect: e
|
|
290
255
|
}) => {
|
|
291
|
-
const [
|
|
292
|
-
(i) => i.name.toLowerCase().includes((
|
|
256
|
+
const [s, n] = y(null), r = Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 15), l = [...a].filter(
|
|
257
|
+
(i) => i.name.toLowerCase().includes((s == null ? void 0 : s.toLowerCase()) ?? "")
|
|
293
258
|
);
|
|
294
259
|
return /* @__PURE__ */ c("div", { className: "tw-h-fit tw-w-full tw-min-w-max", children: [
|
|
295
260
|
/* @__PURE__ */ c("div", { className: "tw-relative tw-flex tw-items-center", children: [
|
|
@@ -297,16 +262,16 @@ const O = ({
|
|
|
297
262
|
"input",
|
|
298
263
|
{
|
|
299
264
|
id: r,
|
|
300
|
-
value:
|
|
265
|
+
value: s ?? "",
|
|
301
266
|
onChange: (i) => n(i.target.value),
|
|
302
267
|
type: "text",
|
|
303
268
|
className: "tw-w-full tw-h-[32px] tw-bg-bg-card tw-border-cards tw-rounded-lg tw-p-2",
|
|
304
269
|
placeholder: "Buscar"
|
|
305
270
|
}
|
|
306
271
|
),
|
|
307
|
-
/* @__PURE__ */ t("div", { className: "tw-absolute tw-right-[8px]", children: /* @__PURE__ */ t(
|
|
272
|
+
/* @__PURE__ */ t("div", { className: "tw-absolute tw-right-[8px]", children: /* @__PURE__ */ t(P, { icon: "search", size: "xs", strokeWidth: 3 }) })
|
|
308
273
|
] }),
|
|
309
|
-
/* @__PURE__ */ t("div", { className: "tw-bg-bg-card tw-border-cards tw-rounded-lg tw-p-2 tw-flex tw-flex-col tw-gap-s tw-overflow-y-auto tw-max-h-[120px] tw-min-w-max", children:
|
|
274
|
+
/* @__PURE__ */ t("div", { className: "tw-bg-bg-card tw-border-cards tw-rounded-lg tw-p-2 tw-flex tw-flex-col tw-gap-s tw-overflow-y-auto tw-max-h-[120px] tw-min-w-max", children: l.map((i) => /* @__PURE__ */ c(
|
|
310
275
|
"button",
|
|
311
276
|
{
|
|
312
277
|
onClick: () => {
|
|
@@ -314,33 +279,33 @@ const O = ({
|
|
|
314
279
|
},
|
|
315
280
|
className: "tw-flex tw-gap-s tw-items-center tw-max-w-[200px] tw-min-w-full hover:tw-bg-primary-light tw-cursor-pointer",
|
|
316
281
|
children: [
|
|
317
|
-
i.image && /* @__PURE__ */ t(
|
|
282
|
+
i.image && /* @__PURE__ */ t(Q, { imageUrl: i.image, alt: i.name }),
|
|
318
283
|
/* @__PURE__ */ t("p", { className: "tw-text-s tw-py-m tw-font-normal tw-text-texts-subtext tw-content-text tw-truncate", children: i.name })
|
|
319
284
|
]
|
|
320
285
|
}
|
|
321
286
|
)) })
|
|
322
287
|
] });
|
|
323
|
-
},
|
|
324
|
-
const [r,
|
|
325
|
-
return
|
|
288
|
+
}, ce = ({ error: a, options: e, onSelect: s, initialValue: n }) => {
|
|
289
|
+
const [r, l] = y(!1), [i, d] = y((n == null ? void 0 : n.name) ?? null);
|
|
290
|
+
return q(() => {
|
|
326
291
|
n && d(n);
|
|
327
292
|
}, [n]), /* @__PURE__ */ c("div", { className: "tw-relative", children: [
|
|
328
|
-
/* @__PURE__ */ c("div", { onBlur: () =>
|
|
293
|
+
/* @__PURE__ */ c("div", { onBlur: () => l(!1), onClick: () => l(!r), className: `tw-z-[1] tw-cursor-pointer tw-w-full tw-bg-bg-card ${a ? "tw-shadow-danger-regular tw-border-2 tw-border-danger-regular" : "tw-shadow-input"} tw-h-[30px] tw-rounded-md tw-flex tw-justify-between tw-items-center tw-pl-2 ${a ? "tw-text-danger-regular" : i ? "tw-text-texts-subtext" : "tw-text-texts-placeholder"}`, children: [
|
|
329
294
|
/* @__PURE__ */ t("p", { children: (i == null ? void 0 : i.name) ?? "Selecciona una opción" }),
|
|
330
|
-
/* @__PURE__ */ t(
|
|
295
|
+
/* @__PURE__ */ t(P, { icon: "angle_down_outline", color: a ? p.danger.regular : p.texts.placeholder })
|
|
331
296
|
] }),
|
|
332
297
|
r && /* @__PURE__ */ t("div", { className: "absolute tw-w-full tw-shadow-md tw-rounded-lg tw-z-[10]", children: /* @__PURE__ */ t(
|
|
333
298
|
gt,
|
|
334
299
|
{
|
|
335
300
|
onselect: (o) => {
|
|
336
|
-
d(o),
|
|
301
|
+
d(o), l(!1), s && s(o);
|
|
337
302
|
},
|
|
338
303
|
options: e
|
|
339
304
|
}
|
|
340
305
|
) })
|
|
341
306
|
] });
|
|
342
|
-
},
|
|
343
|
-
const { fields: a, updateFilters: e, cleanFilters:
|
|
307
|
+
}, we = () => {
|
|
308
|
+
const { fields: a, updateFilters: e, cleanFilters: s, applyFilters: n, initialFilters: r } = U();
|
|
344
309
|
return /* @__PURE__ */ c("div", { className: "tw-flex tw-flex-col tw-gap-l tw-min-w-[250px] tw-z-[100]", children: [
|
|
345
310
|
/* @__PURE__ */ c("div", { className: "tw-flex tw-justify-between tw-items-center", children: [
|
|
346
311
|
/* @__PURE__ */ t("p", { className: "tw-text-texts tw-text-2xl", children: "Filtros" }),
|
|
@@ -348,41 +313,41 @@ const O = ({
|
|
|
348
313
|
"button",
|
|
349
314
|
{
|
|
350
315
|
className: "tw-text-lg tw-font-semibold tw-flex tw-cursor-pointer tw-items-center tw-gap-m tw-p-s tw-text-texts-enfasis tw-fill-texts-enfasis tw-bg-bg tw-rounded-lg tw-px-l tw-h-fit tw-shadow-button-primary hover:tw-shadow-button-primary-hover",
|
|
351
|
-
onClick:
|
|
316
|
+
onClick: s,
|
|
352
317
|
children: "Limpiar"
|
|
353
318
|
}
|
|
354
319
|
)
|
|
355
320
|
] }),
|
|
356
|
-
/* @__PURE__ */ t("div", { className: "tw-flex tw-flex-col tw-gap-m", children: a == null ? void 0 : a.map((
|
|
321
|
+
/* @__PURE__ */ t("div", { className: "tw-flex tw-flex-col tw-gap-m", children: a == null ? void 0 : a.map((l, i) => {
|
|
357
322
|
var d;
|
|
358
323
|
return /* @__PURE__ */ c("div", { style: { zIndex: 10 - i }, children: [
|
|
359
|
-
/* @__PURE__ */ t("p", { className: "tw-text-xl z-[1]", children:
|
|
360
|
-
(
|
|
361
|
-
|
|
324
|
+
/* @__PURE__ */ t("p", { className: "tw-text-xl z-[1]", children: l.label }),
|
|
325
|
+
(l == null ? void 0 : l.type) === "select" ? /* @__PURE__ */ t("div", { className: "tw-relative tw-z-[10]", children: /* @__PURE__ */ t(
|
|
326
|
+
ce,
|
|
362
327
|
{
|
|
363
328
|
error: !1,
|
|
364
|
-
options:
|
|
329
|
+
options: l == null ? void 0 : l.options,
|
|
365
330
|
onSelect: (o) => {
|
|
366
331
|
e({
|
|
367
|
-
name:
|
|
332
|
+
name: l == null ? void 0 : l.id,
|
|
368
333
|
value: o == null ? void 0 : o.id
|
|
369
334
|
});
|
|
370
335
|
},
|
|
371
|
-
initialValue: (d =
|
|
336
|
+
initialValue: (d = l == null ? void 0 : l.options) == null ? void 0 : d.find((o) => o.id === (r == null ? void 0 : r[l == null ? void 0 : l.id]))
|
|
372
337
|
}
|
|
373
338
|
) }) : /* @__PURE__ */ t(
|
|
374
339
|
"input",
|
|
375
340
|
{
|
|
376
341
|
className: "tw-w-full tw-h-[30px] tw-shadow-input tw-rounded-lg tw-p-s",
|
|
377
|
-
type:
|
|
378
|
-
value: r == null ? void 0 : r[
|
|
379
|
-
name:
|
|
380
|
-
onChange:
|
|
342
|
+
type: l.type,
|
|
343
|
+
value: r == null ? void 0 : r[l == null ? void 0 : l.id],
|
|
344
|
+
name: l.label.toLowerCase().replace(/ /g, "_"),
|
|
345
|
+
onChange: oe(
|
|
381
346
|
(o) => {
|
|
382
|
-
var g,
|
|
347
|
+
var g, m;
|
|
383
348
|
return e({
|
|
384
349
|
name: (g = o == null ? void 0 : o.target) == null ? void 0 : g.name,
|
|
385
|
-
value: (
|
|
350
|
+
value: (m = o == null ? void 0 : o.target) == null ? void 0 : m.value
|
|
386
351
|
});
|
|
387
352
|
},
|
|
388
353
|
1e3
|
|
@@ -401,34 +366,34 @@ const O = ({
|
|
|
401
366
|
)
|
|
402
367
|
] });
|
|
403
368
|
}, G = (a) => {
|
|
404
|
-
const e = (n) => Object.prototype.toString.call(n) === "[object Object]",
|
|
369
|
+
const e = (n) => Object.prototype.toString.call(n) === "[object Object]", s = (n) => n.attributes ? {
|
|
405
370
|
id: n.id,
|
|
406
371
|
...n.attributes
|
|
407
372
|
} : n;
|
|
408
373
|
if (Array.isArray(a))
|
|
409
374
|
return a.map((n) => G(n));
|
|
410
375
|
if (e(a)) {
|
|
411
|
-
Array.isArray(a.data) ? a = [...a.data] : e(a.data) ? a =
|
|
376
|
+
Array.isArray(a.data) ? a = [...a.data] : e(a.data) ? a = s({ ...a.data }) : a.data === null ? a = null : a = s(a);
|
|
412
377
|
for (const n in a)
|
|
413
378
|
a[n] = G(a[n]);
|
|
414
379
|
return a;
|
|
415
380
|
}
|
|
416
381
|
return a;
|
|
417
382
|
};
|
|
418
|
-
class
|
|
383
|
+
class de {
|
|
419
384
|
static toCampaignTasks(e) {
|
|
420
|
-
var n, r,
|
|
421
|
-
let
|
|
422
|
-
return e != null && e.responsable &&
|
|
385
|
+
var n, r, l, i, d, o, g, m, b, x, u, h;
|
|
386
|
+
let s = [];
|
|
387
|
+
return e != null && e.responsable && s.push({
|
|
423
388
|
id: e.responsable.id,
|
|
424
389
|
name: e.responsable.nombre,
|
|
425
|
-
image: (d = (i = (
|
|
390
|
+
image: (d = (i = (l = (r = (n = e.responsable) == null ? void 0 : n.userOBP) == null ? void 0 : r.imagen) == null ? void 0 : l.formats) == null ? void 0 : i.thumbnail) == null ? void 0 : d.url
|
|
426
391
|
}), (o = e == null ? void 0 : e.equipo) != null && o.miembros && e.equipo.miembros.forEach((_) => {
|
|
427
|
-
var
|
|
428
|
-
|
|
392
|
+
var v, C, T, k;
|
|
393
|
+
s != null && s.find((f) => f.id === _.idUser.id) || _.idUser && s.push({
|
|
429
394
|
id: _.idUser.id,
|
|
430
395
|
name: _.idUser.nombre,
|
|
431
|
-
image: (
|
|
396
|
+
image: (k = (T = (C = (v = _ == null ? void 0 : _.userOBP) == null ? void 0 : v.imagen) == null ? void 0 : C.formats) == null ? void 0 : T.thumbnail) == null ? void 0 : k.url
|
|
432
397
|
});
|
|
433
398
|
}), {
|
|
434
399
|
isPrincipalTask: (e == null ? void 0 : e.tarea_principal) ?? !1,
|
|
@@ -442,15 +407,15 @@ class me {
|
|
|
442
407
|
endDate: new Date((e == null ? void 0 : e.ffin) ?? null),
|
|
443
408
|
startDate: new Date((e == null ? void 0 : e.finicio) ?? null),
|
|
444
409
|
mediumName: (e == null ? void 0 : e.nombre_medio) ?? null,
|
|
445
|
-
users:
|
|
410
|
+
users: s,
|
|
446
411
|
repeatsToDo: (e == null ? void 0 : e.repeticiones) ?? null,
|
|
447
412
|
repeats: (e == null ? void 0 : e.repeticiones_realizadas) ?? null,
|
|
448
|
-
comments: ((
|
|
413
|
+
comments: ((m = e == null ? void 0 : e.comentarios) == null ? void 0 : m.length) ?? null,
|
|
449
414
|
willBePaused: e == null ? void 0 : e.es_pausable,
|
|
450
|
-
statusRequiredTask: ((
|
|
451
|
-
nameRequiredTask: ((
|
|
452
|
-
responsible: ((
|
|
453
|
-
tasks: ((
|
|
415
|
+
statusRequiredTask: ((b = e == null ? void 0 : e.id_t_requerida) == null ? void 0 : b.estatus) ?? null,
|
|
416
|
+
nameRequiredTask: ((x = e == null ? void 0 : e.id_t_requerida) == null ? void 0 : x.texto_corto) ?? null,
|
|
417
|
+
responsible: ((u = e == null ? void 0 : e.responsable) == null ? void 0 : u.id) ?? null,
|
|
418
|
+
tasks: ((h = e == null ? void 0 : e.tareas) == null ? void 0 : h.map((_) => ({
|
|
454
419
|
id: _.id,
|
|
455
420
|
name: _.texto_corto,
|
|
456
421
|
status: _.estatus
|
|
@@ -458,51 +423,51 @@ class me {
|
|
|
458
423
|
};
|
|
459
424
|
}
|
|
460
425
|
}
|
|
461
|
-
const
|
|
426
|
+
const ue = async ({ filters: a, tasks_api: e, project: s }) => {
|
|
462
427
|
try {
|
|
463
428
|
const n = await e.get("/api/listado_tareas_flujo", {
|
|
464
429
|
params: {
|
|
465
430
|
...a,
|
|
466
431
|
project: {
|
|
467
|
-
id:
|
|
432
|
+
id: s
|
|
468
433
|
},
|
|
469
434
|
includeAllTasks: !0
|
|
470
435
|
}
|
|
471
436
|
});
|
|
472
|
-
return G(n.data.tareas).map(
|
|
437
|
+
return G(n.data.tareas).map(de.toCampaignTasks);
|
|
473
438
|
} catch (n) {
|
|
474
439
|
console.log(n);
|
|
475
440
|
}
|
|
476
|
-
},
|
|
477
|
-
const r = n === "prod" ? "https://services.imjmedia.com.mx" : "https://devobp.imjmedia.com.mx",
|
|
478
|
-
baseURL:
|
|
441
|
+
}, $t = at({}), me = ({ children: a, user: e, url: s, mode: n }) => {
|
|
442
|
+
const r = n === "prod" ? "https://services.imjmedia.com.mx" : "https://devobp.imjmedia.com.mx", l = At.create({
|
|
443
|
+
baseURL: s,
|
|
479
444
|
headers: {
|
|
480
445
|
Authorization: `Bearer ${e.accessToken}`
|
|
481
446
|
},
|
|
482
447
|
paramsSerializer: (o) => St.stringify(o, { encodeValuesOnly: !0 })
|
|
483
448
|
}), i = () => r, d = (o) => o === "undefined" ? "" : `${r}${o}`;
|
|
484
449
|
return /* @__PURE__ */ t(
|
|
485
|
-
|
|
450
|
+
$t.Provider,
|
|
486
451
|
{
|
|
487
452
|
value: {
|
|
488
453
|
//methods
|
|
489
|
-
tasks_api:
|
|
454
|
+
tasks_api: l,
|
|
490
455
|
getOBPUrlApi: i,
|
|
491
456
|
getImageOBP: d
|
|
492
457
|
},
|
|
493
458
|
children: a
|
|
494
459
|
}
|
|
495
460
|
);
|
|
496
|
-
},
|
|
497
|
-
const n =
|
|
498
|
-
baseURL:
|
|
461
|
+
}, B = () => rt($t), Bt = at({}), pe = ({ children: a, user: e, url: s }) => {
|
|
462
|
+
const n = At.create({
|
|
463
|
+
baseURL: s,
|
|
499
464
|
headers: {
|
|
500
465
|
Authorization: `Bearer ${e.accessToken}`
|
|
501
466
|
},
|
|
502
467
|
paramsSerializer: (r) => St.stringify(r, { encodeValuesOnly: !0 })
|
|
503
468
|
});
|
|
504
469
|
return /* @__PURE__ */ t(
|
|
505
|
-
|
|
470
|
+
Bt.Provider,
|
|
506
471
|
{
|
|
507
472
|
value: {
|
|
508
473
|
//properties
|
|
@@ -513,29 +478,30 @@ const pe = async ({ filters: a, tasks_api: e, project: l }) => {
|
|
|
513
478
|
children: a
|
|
514
479
|
}
|
|
515
480
|
);
|
|
516
|
-
}, X = () => rt(
|
|
517
|
-
var
|
|
518
|
-
const
|
|
481
|
+
}, X = () => rt(Bt), zt = at({}), ge = ({ children: a, project: e }) => {
|
|
482
|
+
var v;
|
|
483
|
+
const s = et(), [n, r] = y([]), [l, i] = y([]), { tasks_api: d } = B(), { filters: o } = U(), { user: g } = X(), [m, b] = y({
|
|
519
484
|
owner: {
|
|
520
485
|
user: g.id,
|
|
521
|
-
config: ((
|
|
486
|
+
config: ((v = o == null ? void 0 : o.owner) == null ? void 0 : v.config) ?? "yo_y_mis_equipos"
|
|
522
487
|
},
|
|
523
488
|
project: {
|
|
524
489
|
id: e
|
|
525
490
|
}
|
|
526
|
-
}),
|
|
491
|
+
}), x = ct({
|
|
527
492
|
queryKey: ["tasksProject", o, e],
|
|
528
|
-
queryFn: () =>
|
|
493
|
+
queryFn: () => ue({
|
|
529
494
|
filters: {
|
|
530
|
-
...
|
|
495
|
+
...m,
|
|
496
|
+
taskName: o == null ? void 0 : o.taskName
|
|
531
497
|
},
|
|
532
498
|
project: e,
|
|
533
499
|
tasks_api: d
|
|
534
500
|
})
|
|
535
501
|
});
|
|
536
|
-
|
|
502
|
+
q(() => {
|
|
537
503
|
var C;
|
|
538
|
-
Object.keys(o).length > 0 &&
|
|
504
|
+
Object.keys(o).length > 0 && b({
|
|
539
505
|
...o,
|
|
540
506
|
owner: {
|
|
541
507
|
user: g.id,
|
|
@@ -545,33 +511,33 @@ const pe = async ({ filters: a, tasks_api: e, project: l }) => {
|
|
|
545
511
|
id: e
|
|
546
512
|
}
|
|
547
513
|
});
|
|
548
|
-
}, [o]),
|
|
549
|
-
|
|
514
|
+
}, [o]), q(() => {
|
|
515
|
+
console.log("entraaaaa kanabn", o, m), s.invalidateQueries({
|
|
550
516
|
queryKey: ["tasksProject", o, e]
|
|
551
517
|
});
|
|
552
|
-
}, [
|
|
553
|
-
const
|
|
554
|
-
r((
|
|
555
|
-
},
|
|
556
|
-
i((
|
|
518
|
+
}, [m]);
|
|
519
|
+
const u = (C) => {
|
|
520
|
+
r((T) => [...T, C]);
|
|
521
|
+
}, h = (C) => {
|
|
522
|
+
i((T) => T.includes(C) ? T.filter((k) => k !== C) : [...T, C]);
|
|
557
523
|
}, _ = e ?? null;
|
|
558
524
|
return /* @__PURE__ */ t(
|
|
559
|
-
|
|
525
|
+
zt.Provider,
|
|
560
526
|
{
|
|
561
527
|
value: {
|
|
562
528
|
//properties
|
|
563
|
-
tasksProject:
|
|
529
|
+
tasksProject: x,
|
|
564
530
|
selectedTasks: n,
|
|
565
531
|
projectID: _,
|
|
566
|
-
openTasks:
|
|
532
|
+
openTasks: l,
|
|
567
533
|
//methods
|
|
568
|
-
selectTask:
|
|
569
|
-
openTask:
|
|
534
|
+
selectTask: u,
|
|
535
|
+
openTask: h
|
|
570
536
|
},
|
|
571
537
|
children: a
|
|
572
538
|
}
|
|
573
539
|
);
|
|
574
|
-
},
|
|
540
|
+
}, st = () => rt(zt), he = [
|
|
575
541
|
{
|
|
576
542
|
label: "Tipo de dependencia",
|
|
577
543
|
type: "select",
|
|
@@ -622,8 +588,18 @@ const pe = async ({ filters: a, tasks_api: e, project: l }) => {
|
|
|
622
588
|
name: "Muy dificil"
|
|
623
589
|
}]
|
|
624
590
|
}
|
|
625
|
-
],
|
|
626
|
-
|
|
591
|
+
], xe = () => /* @__PURE__ */ c("div", { className: "tw-bg-gray-200 tw-h-[150px] tw-w-full tw-animate-pulse tw-rounded-md tw-flex tw-flex-col tw-gap-[50px] tw-p-4", children: [
|
|
592
|
+
/* @__PURE__ */ c("div", { className: "tw-flex tw-h-[30px] tw-gap-3", children: [
|
|
593
|
+
/* @__PURE__ */ t("div", { className: "tw-w-[30px] tw-min-w-[30px] tw-h-full tw-bg-gray-300 tw-rounded-full" }),
|
|
594
|
+
/* @__PURE__ */ t("div", { className: "tw-w-full tw-h-full tw-bg-gray-300" }),
|
|
595
|
+
/* @__PURE__ */ t("div", { className: "tw-w-[30px] tw-min-w-[30px] tw-h-full tw-bg-gray-300 tw-rounded-full" })
|
|
596
|
+
] }),
|
|
597
|
+
/* @__PURE__ */ c("div", { className: "tw-flex tw-justify-between tw-w-full tw-h-[30px] tw-gap-[50px]", children: [
|
|
598
|
+
/* @__PURE__ */ t("div", { className: "tw-w-full tw-h-[30px] tw-bg-gray-300" }),
|
|
599
|
+
/* @__PURE__ */ t("div", { className: "tw-w-full tw-h-[30px] tw-bg-gray-300" })
|
|
600
|
+
] })
|
|
601
|
+
] }), lt = () => {
|
|
602
|
+
const { tasks_api: a } = B(), { user: e } = X(), { filters: s, path: n } = U(), r = et(), { projectID: l } = st(), i = async ({ id: f }) => (await a.put(`/api/tareas/${f}`, {
|
|
627
603
|
data: {
|
|
628
604
|
estatus: 1,
|
|
629
605
|
responsable: e == null ? void 0 : e.id,
|
|
@@ -633,30 +609,30 @@ const pe = async ({ filters: a, tasks_api: e, project: l }) => {
|
|
|
633
609
|
id_task: f,
|
|
634
610
|
ended_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
635
611
|
id_user: e == null ? void 0 : e.id
|
|
636
|
-
})).data, o = async ({ id: f, repeats:
|
|
612
|
+
})).data, o = async ({ id: f, repeats: N }) => (await a.put(`/api/tareas/${f}`, {
|
|
637
613
|
data: {
|
|
638
|
-
repeticiones_realizadas:
|
|
614
|
+
repeticiones_realizadas: N,
|
|
639
615
|
updated_by: e == null ? void 0 : e.id
|
|
640
616
|
}
|
|
641
617
|
})).data, g = async ({
|
|
642
618
|
id: f,
|
|
643
|
-
idNewResponsible:
|
|
644
|
-
typeOfSelect:
|
|
619
|
+
idNewResponsible: N,
|
|
620
|
+
typeOfSelect: j
|
|
645
621
|
}) => {
|
|
646
|
-
let
|
|
622
|
+
let F = {
|
|
647
623
|
updated_by: e == null ? void 0 : e.id
|
|
648
624
|
};
|
|
649
|
-
return
|
|
650
|
-
...
|
|
625
|
+
return j === "responsible" && (F = { ...F, responsable: N }), j === "team" && (F = {
|
|
626
|
+
...F,
|
|
651
627
|
responsable: null,
|
|
652
|
-
equipo:
|
|
628
|
+
equipo: N
|
|
653
629
|
}), (await a.put(`/api/tareas/${f}`, {
|
|
654
|
-
data:
|
|
630
|
+
data: F
|
|
655
631
|
})).data;
|
|
656
|
-
},
|
|
657
|
-
},
|
|
658
|
-
await
|
|
659
|
-
}, { mutateAsync:
|
|
632
|
+
}, m = async ({ id: f, data: N, user: j }) => {
|
|
633
|
+
}, b = async ({ id: f }) => {
|
|
634
|
+
await x({ id: f });
|
|
635
|
+
}, { mutateAsync: x } = it({
|
|
660
636
|
mutationFn: i,
|
|
661
637
|
onSuccess: () => {
|
|
662
638
|
const f = {
|
|
@@ -664,11 +640,11 @@ const pe = async ({ filters: a, tasks_api: e, project: l }) => {
|
|
|
664
640
|
"kanban-campania": "tasksProject"
|
|
665
641
|
};
|
|
666
642
|
try {
|
|
667
|
-
n === "kanban-general" && (r.invalidateQueries({ queryKey: [f[n],
|
|
668
|
-
queryKey: ["tasksProject",
|
|
643
|
+
n === "kanban-general" && (r.invalidateQueries({ queryKey: [f[n], s] }), r.invalidateQueries({ queryKey: ["working_tasks", s] })), n === "kanban-campania" && (r.invalidateQueries({ queryKey: ["tasksProject"] }), r.invalidateQueries({
|
|
644
|
+
queryKey: ["tasksProject", s, l]
|
|
669
645
|
}));
|
|
670
|
-
} catch (
|
|
671
|
-
console.error("Error updating the element:",
|
|
646
|
+
} catch (N) {
|
|
647
|
+
console.error("Error updating the element:", N);
|
|
672
648
|
}
|
|
673
649
|
},
|
|
674
650
|
onError: (f) => {
|
|
@@ -677,7 +653,7 @@ const pe = async ({ filters: a, tasks_api: e, project: l }) => {
|
|
|
677
653
|
onMutate: async ({ id: f }) => {
|
|
678
654
|
await r.cancelQueries({ queryKey: ["working_tasks"] }), await r.cancelQueries({ queryKey: ["to_do_tasks"] });
|
|
679
655
|
}
|
|
680
|
-
}), { mutateAsync:
|
|
656
|
+
}), { mutateAsync: u } = it({
|
|
681
657
|
mutationFn: d,
|
|
682
658
|
onSuccess: () => {
|
|
683
659
|
const f = {
|
|
@@ -685,13 +661,13 @@ const pe = async ({ filters: a, tasks_api: e, project: l }) => {
|
|
|
685
661
|
"kanban-campania": "tasksProject"
|
|
686
662
|
};
|
|
687
663
|
try {
|
|
688
|
-
r.setQueryData([f[n],
|
|
689
|
-
console.log({ oldData:
|
|
690
|
-
}), n === "kanban-general" && (r.invalidateQueries({ queryKey: [f[n],
|
|
691
|
-
queryKey: ["tasksProject",
|
|
664
|
+
r.setQueryData([f[n], s], (N) => {
|
|
665
|
+
console.log({ oldData: N });
|
|
666
|
+
}), n === "kanban-general" && (r.invalidateQueries({ queryKey: [f[n], s] }), r.invalidateQueries({ queryKey: ["done_tasks", s] }), r.invalidateQueries({ queryKey: ["working_tasks", s] })), n === "kanban-campania" && (r.invalidateQueries({ queryKey: ["tasksProject"] }), r.invalidateQueries({
|
|
667
|
+
queryKey: ["tasksProject", s, l]
|
|
692
668
|
}));
|
|
693
|
-
} catch (
|
|
694
|
-
console.error("Error invalidating queries:",
|
|
669
|
+
} catch (N) {
|
|
670
|
+
console.error("Error invalidating queries:", N);
|
|
695
671
|
}
|
|
696
672
|
},
|
|
697
673
|
onError: (f) => {
|
|
@@ -700,7 +676,7 @@ const pe = async ({ filters: a, tasks_api: e, project: l }) => {
|
|
|
700
676
|
onMutate: async ({ id: f }) => {
|
|
701
677
|
await r.cancelQueries({ queryKey: ["working_tasks"] }), await r.cancelQueries({ queryKey: ["done_tasks"] }), await r.cancelQueries({ queryKey: ["to_do_tasks"] });
|
|
702
678
|
}
|
|
703
|
-
}), { mutateAsync:
|
|
679
|
+
}), { mutateAsync: h } = it({
|
|
704
680
|
mutationFn: o,
|
|
705
681
|
onSuccess: () => {
|
|
706
682
|
const f = {
|
|
@@ -708,11 +684,11 @@ const pe = async ({ filters: a, tasks_api: e, project: l }) => {
|
|
|
708
684
|
"kanban-campania": "tasksProject"
|
|
709
685
|
};
|
|
710
686
|
try {
|
|
711
|
-
n === "kanban-general" && (r.invalidateQueries({ queryKey: [f[n],
|
|
712
|
-
queryKey: ["tasksProject",
|
|
687
|
+
n === "kanban-general" && (r.invalidateQueries({ queryKey: [f[n], s] }), r.invalidateQueries({ queryKey: ["done_tasks", s] }), r.invalidateQueries({ queryKey: ["working_tasks", s] })), n === "kanban-campania" && (r.invalidateQueries({ queryKey: ["tasksProject"] }), r.invalidateQueries({
|
|
688
|
+
queryKey: ["tasksProject", s, l]
|
|
713
689
|
}));
|
|
714
|
-
} catch (
|
|
715
|
-
console.error("Error invalidating queries:",
|
|
690
|
+
} catch (N) {
|
|
691
|
+
console.error("Error invalidating queries:", N);
|
|
716
692
|
}
|
|
717
693
|
},
|
|
718
694
|
onError: (f) => {
|
|
@@ -729,11 +705,11 @@ const pe = async ({ filters: a, tasks_api: e, project: l }) => {
|
|
|
729
705
|
"kanban-campania": "tasksProject"
|
|
730
706
|
};
|
|
731
707
|
try {
|
|
732
|
-
n === "kanban-general" && (r.invalidateQueries({ queryKey: [f[n],
|
|
733
|
-
queryKey: ["tasksProject",
|
|
708
|
+
n === "kanban-general" && (r.invalidateQueries({ queryKey: [f[n], s] }), r.invalidateQueries({ queryKey: ["done_tasks", s] }), r.invalidateQueries({ queryKey: ["working_tasks", s] })), n === "kanban-campania" && (r.invalidateQueries({ queryKey: ["tasksProject"] }), r.invalidateQueries({
|
|
709
|
+
queryKey: ["tasksProject", s, l]
|
|
734
710
|
}));
|
|
735
|
-
} catch (
|
|
736
|
-
console.error("Error invalidating queries:",
|
|
711
|
+
} catch (N) {
|
|
712
|
+
console.error("Error invalidating queries:", N);
|
|
737
713
|
}
|
|
738
714
|
},
|
|
739
715
|
onError: (f) => {
|
|
@@ -745,44 +721,44 @@ const pe = async ({ filters: a, tasks_api: e, project: l }) => {
|
|
|
745
721
|
});
|
|
746
722
|
return {
|
|
747
723
|
//* Methods
|
|
748
|
-
updateTask:
|
|
749
|
-
startWorking:
|
|
724
|
+
updateTask: m,
|
|
725
|
+
startWorking: b,
|
|
750
726
|
completeTask: async ({ id: f }) => {
|
|
751
|
-
await
|
|
727
|
+
await u({ id: f });
|
|
752
728
|
},
|
|
753
|
-
reasignResponsible: async ({ id: f, idNewResponsible:
|
|
754
|
-
await _({ id: f, idNewResponsible:
|
|
729
|
+
reasignResponsible: async ({ id: f, idNewResponsible: N, typeOfSelect: j }) => {
|
|
730
|
+
await _({ id: f, idNewResponsible: N, typeOfSelect: j });
|
|
755
731
|
},
|
|
756
|
-
updateUnitys: async ({ repeats: f, id:
|
|
757
|
-
await
|
|
732
|
+
updateUnitys: async ({ repeats: f, id: N }) => {
|
|
733
|
+
await h({ repeats: f, id: N });
|
|
758
734
|
},
|
|
759
|
-
pauseTask: async ({ id: f, motiveId:
|
|
760
|
-
console.log({ taksId: f, motivoId:
|
|
735
|
+
pauseTask: async ({ id: f, motiveId: N }) => {
|
|
736
|
+
console.log({ taksId: f, motivoId: N, user: e == null ? void 0 : e.id });
|
|
761
737
|
}
|
|
762
738
|
};
|
|
763
|
-
},
|
|
764
|
-
const [e,
|
|
739
|
+
}, fe = ({ id: a }) => {
|
|
740
|
+
const [e, s] = y(!1), { completeTask: n } = lt();
|
|
765
741
|
return { checked: e, checkTask: () => {
|
|
766
|
-
|
|
742
|
+
s(!e), n({ id: a });
|
|
767
743
|
} };
|
|
768
|
-
},
|
|
769
|
-
const { checked: r, checkTask:
|
|
744
|
+
}, Lt = ({ id: a, nameRequiredTask: e, statusRequiredTask: s, status: n }) => {
|
|
745
|
+
const { checked: r, checkTask: l } = fe({ id: a });
|
|
770
746
|
let i = Math.random().toString();
|
|
771
|
-
return /* @__PURE__ */ c(
|
|
747
|
+
return /* @__PURE__ */ c($, { children: [
|
|
772
748
|
n === 2 && /* @__PURE__ */ t(
|
|
773
749
|
"div",
|
|
774
750
|
{
|
|
775
751
|
className: "tw-bg-success-regular tw-rounded-full tw-flex tw-items-center tw-justify-center tw-mx-[2px] tw-transition-all",
|
|
776
|
-
children: /* @__PURE__ */ t(
|
|
752
|
+
children: /* @__PURE__ */ t(P, { icon: "circle_checked", color: "white", strokeWidth: 4, size: "xs" })
|
|
777
753
|
}
|
|
778
754
|
),
|
|
779
|
-
e !== "" &&
|
|
755
|
+
e !== "" && s === 2 || !e ? n === 1 ? /* @__PURE__ */ t(
|
|
780
756
|
"label",
|
|
781
757
|
{
|
|
782
758
|
htmlFor: i,
|
|
783
759
|
className: r ? "tw-bg-success-regular tw-rounded-full tw-w-[20px] tw-h-[20px] tw-flex tw-items-center tw-justify-center tw-mx-[2px] tw-transition-all" : "tw-transition-colors",
|
|
784
760
|
children: /* @__PURE__ */ t(
|
|
785
|
-
|
|
761
|
+
P,
|
|
786
762
|
{
|
|
787
763
|
icon: r ? "check_outline" : "circle_checked",
|
|
788
764
|
color: r ? "white" : p.texts.placeholder,
|
|
@@ -791,11 +767,11 @@ const pe = async ({ filters: a, tasks_api: e, project: l }) => {
|
|
|
791
767
|
}
|
|
792
768
|
)
|
|
793
769
|
}
|
|
794
|
-
) : /* @__PURE__ */ t(
|
|
795
|
-
|
|
770
|
+
) : /* @__PURE__ */ t($, { children: " " }) : /* @__PURE__ */ t(
|
|
771
|
+
K,
|
|
796
772
|
{
|
|
797
773
|
dispatch: /* @__PURE__ */ t("label", { className: "tw-cursor-help", children: /* @__PURE__ */ t(
|
|
798
|
-
|
|
774
|
+
P,
|
|
799
775
|
{
|
|
800
776
|
icon: "info_circle",
|
|
801
777
|
color: p.warning.regular,
|
|
@@ -817,17 +793,17 @@ const pe = async ({ filters: a, tasks_api: e, project: l }) => {
|
|
|
817
793
|
{
|
|
818
794
|
id: i,
|
|
819
795
|
checked: r,
|
|
820
|
-
onChange:
|
|
796
|
+
onChange: l,
|
|
821
797
|
type: "checkbox",
|
|
822
798
|
className: "tw-hidden"
|
|
823
799
|
}
|
|
824
800
|
)
|
|
825
801
|
] });
|
|
826
|
-
}, qt = ({ trigger: a, user: e, showUser:
|
|
827
|
-
/* @__PURE__ */ t(
|
|
802
|
+
}, qt = ({ trigger: a, user: e, showUser: s = !0 }) => /* @__PURE__ */ t(K, { dispatch: a, children: s && /* @__PURE__ */ c("div", { className: "tw-flex tw-items-center tw-gap-2 tw-bg-bg-card tw-w-fit tw-h-fit tw-p-2 tw-rounded-lg tw-border-containers", children: [
|
|
803
|
+
/* @__PURE__ */ t(Q, { imageUrl: e.image ?? "", alt: e.name }),
|
|
828
804
|
/* @__PURE__ */ t("p", { className: "tw-text-s tw-font-bold tw-text-texts-subtext", children: e.name })
|
|
829
805
|
] }) });
|
|
830
|
-
class
|
|
806
|
+
class be {
|
|
831
807
|
static toDomain(e) {
|
|
832
808
|
return {
|
|
833
809
|
id: e.id,
|
|
@@ -836,23 +812,23 @@ class ye {
|
|
|
836
812
|
};
|
|
837
813
|
}
|
|
838
814
|
}
|
|
839
|
-
const
|
|
840
|
-
const { tasks_api: a } =
|
|
815
|
+
const ye = () => {
|
|
816
|
+
const { tasks_api: a } = B();
|
|
841
817
|
return { teams: ct({
|
|
842
818
|
queryKey: ["teams", "all"],
|
|
843
819
|
queryFn: async () => {
|
|
844
|
-
const
|
|
845
|
-
return G(
|
|
820
|
+
const s = await a.get("/api/equipos");
|
|
821
|
+
return G(s.data).map(be.toDomain);
|
|
846
822
|
}
|
|
847
823
|
}) };
|
|
848
824
|
};
|
|
849
825
|
class Ne {
|
|
850
826
|
static toUsers(e) {
|
|
851
|
-
var
|
|
827
|
+
var s, n, r;
|
|
852
828
|
return {
|
|
853
829
|
id: e.id,
|
|
854
830
|
name: e.nombre,
|
|
855
|
-
image: (r = (n = (
|
|
831
|
+
image: (r = (n = (s = e.imagen) == null ? void 0 : s.formats) == null ? void 0 : n.thumbnail) == null ? void 0 : r.url,
|
|
856
832
|
tasksUser: {
|
|
857
833
|
email: e.tasksUser.email,
|
|
858
834
|
id: e.tasksUser.id,
|
|
@@ -861,7 +837,7 @@ class Ne {
|
|
|
861
837
|
};
|
|
862
838
|
}
|
|
863
839
|
}
|
|
864
|
-
const
|
|
840
|
+
const ve = async ({
|
|
865
841
|
tasks_api: a
|
|
866
842
|
}) => {
|
|
867
843
|
try {
|
|
@@ -870,100 +846,100 @@ const _e = async ({
|
|
|
870
846
|
} catch (e) {
|
|
871
847
|
throw console.log("Error al obtener los usuarios comerciales", e), `Error al obtener los usuarios comerciales: ${e}`;
|
|
872
848
|
}
|
|
873
|
-
},
|
|
874
|
-
const { tasks_api: a } =
|
|
849
|
+
}, _e = () => {
|
|
850
|
+
const { tasks_api: a } = B();
|
|
875
851
|
return {
|
|
876
852
|
users: ct({
|
|
877
853
|
queryKey: ["users"],
|
|
878
|
-
queryFn: () =>
|
|
854
|
+
queryFn: () => ve({ tasks_api: a }),
|
|
879
855
|
staleTime: 1e3 * 60 * 60 * 24
|
|
880
856
|
})
|
|
881
857
|
};
|
|
882
858
|
}, ht = (a) => new Intl.DateTimeFormat("es-MX", { month: "long" }).format(a);
|
|
883
|
-
function
|
|
884
|
-
const e = ["domingo", "lunes", "martes", "miércoles", "jueves", "viernes", "sábado"],
|
|
885
|
-
return e[
|
|
859
|
+
function Ce(a) {
|
|
860
|
+
const e = ["domingo", "lunes", "martes", "miércoles", "jueves", "viernes", "sábado"], s = new Date(a).getDay();
|
|
861
|
+
return e[s];
|
|
886
862
|
}
|
|
887
863
|
const jt = (a) => {
|
|
888
|
-
let e = a || /* @__PURE__ */ new Date(),
|
|
889
|
-
return `${
|
|
864
|
+
let e = a || /* @__PURE__ */ new Date(), s = e.getDate(), n = ht(e.getMonth()).slice(0, 3), r = e.getFullYear().toString().slice(-2), l = Ce(e).slice(0, 3);
|
|
865
|
+
return `${l.charAt(0).toUpperCase() + l.slice(1)} ${s} ${n.charAt(0).toUpperCase() + n.slice(1)} ${r}`;
|
|
890
866
|
}, xt = (a, e) => ({
|
|
891
867
|
...a,
|
|
892
868
|
image: a.image ? `${e}${a.image}` : ""
|
|
893
|
-
}),
|
|
869
|
+
}), Rt = ({
|
|
894
870
|
users: a,
|
|
895
871
|
onClick: e,
|
|
896
|
-
responsible:
|
|
872
|
+
responsible: s
|
|
897
873
|
}) => {
|
|
898
|
-
const { getOBPUrlApi: n } =
|
|
874
|
+
const { getOBPUrlApi: n } = B();
|
|
899
875
|
let r = `button-assign-users-${Math.random().toString(36).substring(2, 15)}`;
|
|
900
|
-
const { setElementPosition:
|
|
901
|
-
|
|
876
|
+
const { setElementPosition: l, position: i, clearPosition: d } = pt(), o = Y(null), g = () => s ? null : a.length > 3 && /* @__PURE__ */ t(
|
|
877
|
+
K,
|
|
902
878
|
{
|
|
903
879
|
dispatch: /* @__PURE__ */ t("div", { className: "tw-w-[28px] tw-h-[28px] tw-rounded-full tw-bg-primary-regular tw-flex tw-items-center tw-justify-center tw-border-2 tw-border-white tw-ml-[-8px]", children: /* @__PURE__ */ t("p", { className: "tw-text-s tw-font-bold tw-text-white ", children: `+${a.length - 3}` }) }),
|
|
904
|
-
children: /* @__PURE__ */ t("div", { className: "tw-bg-bg-card tw-w-fit tw-h-fit tw-p-2 tw-rounded-lg tw-border-containers", children: a == null ? void 0 : a.slice(3).map((
|
|
905
|
-
/* @__PURE__ */ t(
|
|
906
|
-
/* @__PURE__ */ t("p", { className: "tw-text-s tw-font-bold tw-text-texts-subtext", children:
|
|
907
|
-
] },
|
|
880
|
+
children: /* @__PURE__ */ t("div", { className: "tw-bg-bg-card tw-w-fit tw-h-fit tw-p-2 tw-rounded-lg tw-border-containers", children: a == null ? void 0 : a.slice(3).map((u, h) => /* @__PURE__ */ c("div", { className: "tw-flex tw-items-center tw-gap-2 ", children: [
|
|
881
|
+
/* @__PURE__ */ t(Q, { imageUrl: u.image ?? "", alt: u.name }, h),
|
|
882
|
+
/* @__PURE__ */ t("p", { className: "tw-text-s tw-font-bold tw-text-texts-subtext", children: u.name })
|
|
883
|
+
] }, h)) })
|
|
908
884
|
}
|
|
909
|
-
),
|
|
910
|
-
if (
|
|
911
|
-
let
|
|
912
|
-
(
|
|
885
|
+
), m = () => {
|
|
886
|
+
if (s) {
|
|
887
|
+
let u = a.find(
|
|
888
|
+
(h) => h.id === s
|
|
913
889
|
);
|
|
914
890
|
return /* @__PURE__ */ t("div", { children: /* @__PURE__ */ t(
|
|
915
891
|
qt,
|
|
916
892
|
{
|
|
917
893
|
trigger: /* @__PURE__ */ t(
|
|
918
|
-
|
|
894
|
+
Q,
|
|
919
895
|
{
|
|
920
|
-
imageUrl:
|
|
921
|
-
alt:
|
|
896
|
+
imageUrl: u == null ? void 0 : u.image,
|
|
897
|
+
alt: u == null ? void 0 : u.name
|
|
922
898
|
},
|
|
923
|
-
|
|
899
|
+
s
|
|
924
900
|
),
|
|
925
|
-
user:
|
|
901
|
+
user: u,
|
|
926
902
|
showUser: !(i != null && i.x)
|
|
927
903
|
}
|
|
928
904
|
) });
|
|
929
905
|
}
|
|
930
|
-
return (a == null ? void 0 : a.length) > 0 && a.slice(0, 3).map((
|
|
906
|
+
return (a == null ? void 0 : a.length) > 0 && a.slice(0, 3).map((u, h) => /* @__PURE__ */ t("div", { className: `${h === 0 ? "" : "tw-ml-[-8px]"}`, children: /* @__PURE__ */ t(
|
|
931
907
|
qt,
|
|
932
908
|
{
|
|
933
|
-
trigger: /* @__PURE__ */ t(
|
|
934
|
-
user:
|
|
909
|
+
trigger: /* @__PURE__ */ t(Q, { imageUrl: u.image, alt: u.name }, h),
|
|
910
|
+
user: u,
|
|
935
911
|
showUser: !(i != null && i.x)
|
|
936
912
|
}
|
|
937
913
|
) }));
|
|
938
|
-
},
|
|
914
|
+
}, b = ({ children: u }) => /* @__PURE__ */ t(
|
|
939
915
|
"label",
|
|
940
916
|
{
|
|
941
917
|
ref: o,
|
|
942
918
|
htmlFor: r,
|
|
943
919
|
className: "tw-cursor-pointer tw-flex tw-items-center",
|
|
944
|
-
children:
|
|
920
|
+
children: u
|
|
945
921
|
}
|
|
946
922
|
);
|
|
947
923
|
if (a.length === 0)
|
|
948
|
-
return /* @__PURE__ */ t(
|
|
949
|
-
const
|
|
924
|
+
return /* @__PURE__ */ t(b, { children: /* @__PURE__ */ t(P, { icon: "user", size: "xs", strokeWidth: 3 }) });
|
|
925
|
+
const x = () => {
|
|
950
926
|
var f;
|
|
951
|
-
const [
|
|
952
|
-
|
|
953
|
-
var
|
|
954
|
-
o.current &&
|
|
927
|
+
const [u, h] = y(), [_, v] = y("team"), { teams: C } = ye(), { users: T } = _e();
|
|
928
|
+
q(() => {
|
|
929
|
+
var N, j;
|
|
930
|
+
o.current && h(((i == null ? void 0 : i.x) ?? 0) - (((j = (N = o.current) == null ? void 0 : N.getBoundingClientRect()) == null ? void 0 : j.width) ?? 0));
|
|
955
931
|
}, [o == null ? void 0 : o.current, i == null ? void 0 : i.x]);
|
|
956
|
-
const
|
|
957
|
-
const
|
|
932
|
+
const k = () => {
|
|
933
|
+
const N = [
|
|
958
934
|
{ id: "team", label: "Equipo" },
|
|
959
935
|
{ id: "responsible", label: "Responsable" }
|
|
960
936
|
];
|
|
961
|
-
return /* @__PURE__ */ t("div", { className: "tw-w-full tw-flex tw-justify-center tw-gap-l tw-text-texts-placeholder tw-font-bold", children:
|
|
937
|
+
return /* @__PURE__ */ t("div", { className: "tw-w-full tw-flex tw-justify-center tw-gap-l tw-text-texts-placeholder tw-font-bold", children: N.map((j, F) => /* @__PURE__ */ t(
|
|
962
938
|
"button",
|
|
963
939
|
{
|
|
964
|
-
className: `tw-w-full tw-text-sm tw-border-texts-placeholder tw-text-center ${_ ===
|
|
965
|
-
onClick: () =>
|
|
966
|
-
children:
|
|
940
|
+
className: `tw-w-full tw-text-sm tw-border-texts-placeholder tw-text-center ${_ === j.id ? "tw-text-primary-pastel" : ""} ${F === N.length - 1 ? "tw-border-r-0" : " tw-border-r-2"}`,
|
|
941
|
+
onClick: () => v(j.id),
|
|
942
|
+
children: j.label
|
|
967
943
|
}
|
|
968
944
|
)) });
|
|
969
945
|
};
|
|
@@ -972,21 +948,21 @@ const jt = (a) => {
|
|
|
972
948
|
"div",
|
|
973
949
|
{
|
|
974
950
|
"data-portal-host": !0,
|
|
975
|
-
className: `absolute tw-w-[300px] tw-h-fit ${
|
|
976
|
-
style: { top: `${i == null ? void 0 : i.y}px`, left: `${
|
|
951
|
+
className: `absolute tw-w-[300px] tw-h-fit ${u ? "tw-block" : "tw-hidden"}`,
|
|
952
|
+
style: { top: `${i == null ? void 0 : i.y}px`, left: `${u}px`, zIndex: 1 },
|
|
977
953
|
children: /* @__PURE__ */ c("div", { className: "tw-flex tw-flex-col tw-gap-m tw-bg-bg-card tw-border-cards tw-rounded-lg tw-p-2 tw-max-h-[200px] tw-overflow-y-hidden", children: [
|
|
978
|
-
/* @__PURE__ */ t(
|
|
954
|
+
/* @__PURE__ */ t(k, {}),
|
|
979
955
|
/* @__PURE__ */ t(
|
|
980
956
|
gt,
|
|
981
957
|
{
|
|
982
|
-
options: _ === "team" ? C.data.map((
|
|
983
|
-
id:
|
|
984
|
-
name:
|
|
958
|
+
options: _ === "team" ? C.data.map((N) => ({
|
|
959
|
+
id: N.id,
|
|
960
|
+
name: N.name,
|
|
985
961
|
image: ""
|
|
986
|
-
})) : (f =
|
|
987
|
-
onselect: (
|
|
988
|
-
var
|
|
989
|
-
d(), e && e((
|
|
962
|
+
})) : (f = T.data) == null ? void 0 : f.map((N) => xt(N, n())),
|
|
963
|
+
onselect: (N) => {
|
|
964
|
+
var j;
|
|
965
|
+
d(), e && e((j = N.tasksUser) == null ? void 0 : j.id, _);
|
|
990
966
|
}
|
|
991
967
|
}
|
|
992
968
|
)
|
|
@@ -996,9 +972,9 @@ const jt = (a) => {
|
|
|
996
972
|
document.body
|
|
997
973
|
);
|
|
998
974
|
};
|
|
999
|
-
return /* @__PURE__ */ c(
|
|
1000
|
-
/* @__PURE__ */ c(
|
|
1001
|
-
|
|
975
|
+
return /* @__PURE__ */ c($, { children: [
|
|
976
|
+
/* @__PURE__ */ c(b, { children: [
|
|
977
|
+
m(),
|
|
1002
978
|
g()
|
|
1003
979
|
] }),
|
|
1004
980
|
/* @__PURE__ */ t(
|
|
@@ -1006,25 +982,25 @@ const jt = (a) => {
|
|
|
1006
982
|
{
|
|
1007
983
|
className: "tw-hidden",
|
|
1008
984
|
id: r,
|
|
1009
|
-
onClick: () =>
|
|
985
|
+
onClick: () => l(o)
|
|
1010
986
|
}
|
|
1011
987
|
),
|
|
1012
|
-
/* @__PURE__ */ t(
|
|
988
|
+
/* @__PURE__ */ t(x, {})
|
|
1013
989
|
] });
|
|
1014
990
|
};
|
|
1015
|
-
function
|
|
991
|
+
function Fe({ items: a }) {
|
|
1016
992
|
var n;
|
|
1017
|
-
const [e,
|
|
1018
|
-
return /* @__PURE__ */ c(
|
|
1019
|
-
/* @__PURE__ */ t("div", { className: "tw-flex tw-flex-row tw-mb-2 tw-border-b tw-border-neutral-100 tw-bg-white tw-mt-4", children: a.map((r,
|
|
993
|
+
const [e, s] = y(1);
|
|
994
|
+
return /* @__PURE__ */ c($, { children: [
|
|
995
|
+
/* @__PURE__ */ t("div", { className: "tw-flex tw-flex-row tw-mb-2 tw-border-b tw-border-neutral-100 tw-bg-white tw-mt-4", children: a.map((r, l) => /* @__PURE__ */ t(
|
|
1020
996
|
"div",
|
|
1021
997
|
{
|
|
1022
|
-
className: `tw-border-r tw-border-neutral-100 tw-pr-3 tw-py-1 ${
|
|
998
|
+
className: `tw-border-r tw-border-neutral-100 tw-pr-3 tw-py-1 ${l !== 0 ? "tw-px-3" : ""}`,
|
|
1023
999
|
children: /* @__PURE__ */ t(
|
|
1024
1000
|
Mt,
|
|
1025
1001
|
{
|
|
1026
1002
|
variant: "ghost",
|
|
1027
|
-
onClick: () =>
|
|
1003
|
+
onClick: () => s(r.id),
|
|
1028
1004
|
className: `tw-text-xl tw-font-normal rounded-none tw-py-1 tw-h-12 ${e === r.id ? "tw-text-primary tw-border-b tw-border-primary" : "tw-text-neutral-400 tw-border-b-0"}`,
|
|
1029
1005
|
children: r.label
|
|
1030
1006
|
},
|
|
@@ -1036,15 +1012,15 @@ function Pe({ items: a }) {
|
|
|
1036
1012
|
/* @__PURE__ */ t("div", { className: "tw-pt-4 tw-flex-1 tw-overflow-y-auto tw-bg-white", children: (n = a.find((r) => r.id === e)) == null ? void 0 : n.component })
|
|
1037
1013
|
] });
|
|
1038
1014
|
}
|
|
1039
|
-
function
|
|
1040
|
-
var r,
|
|
1041
|
-
const { getImageOBP: e } =
|
|
1015
|
+
function Pe({ comment: a }) {
|
|
1016
|
+
var r, l, i, d, o;
|
|
1017
|
+
const { getImageOBP: e } = B(), s = (d = (i = (l = (r = a == null ? void 0 : a.autor) == null ? void 0 : r.imagen) == null ? void 0 : l.formats) == null ? void 0 : i.thumbnail) == null ? void 0 : d.url;
|
|
1042
1018
|
function n(g) {
|
|
1043
|
-
const
|
|
1044
|
-
return
|
|
1019
|
+
const m = Xt(g);
|
|
1020
|
+
return Zt(m, { locale: mt, addSuffix: !0 });
|
|
1045
1021
|
}
|
|
1046
1022
|
return /* @__PURE__ */ t("div", { children: /* @__PURE__ */ c("div", { className: "tw-flex tw-flex-row tw-gap-3 tw-items-start", children: [
|
|
1047
|
-
/* @__PURE__ */ t(
|
|
1023
|
+
/* @__PURE__ */ t(Q, { size: "xxl", imageUrl: s ? e(s) : "", alt: "@shadcn" }),
|
|
1048
1024
|
/* @__PURE__ */ c("div", { className: "tw-flex tw-flex-col tw-gap-1", children: [
|
|
1049
1025
|
/* @__PURE__ */ c("div", { className: "tw-flex tw-flex-row tw-gap-2", children: [
|
|
1050
1026
|
/* @__PURE__ */ t("p", { className: "tw-text-xl tw-text-neutral-900 tw-font-medium", children: (o = a == null ? void 0 : a.autor) == null ? void 0 : o.nombre }),
|
|
@@ -1054,21 +1030,21 @@ function Te({ comment: a }) {
|
|
|
1054
1030
|
] })
|
|
1055
1031
|
] }) });
|
|
1056
1032
|
}
|
|
1057
|
-
function
|
|
1058
|
-
var
|
|
1059
|
-
const { tasks_api: r, getImageOBP:
|
|
1060
|
-
return
|
|
1033
|
+
function Te({ currentUser: a, data: e, taskId: s, onNewComment: n }) {
|
|
1034
|
+
var u, h, _;
|
|
1035
|
+
const { tasks_api: r, getImageOBP: l } = B(), { register: i, handleSubmit: d, reset: o } = ne(), [g, m] = y([]), b = (_ = (h = (u = a == null ? void 0 : a.imagen) == null ? void 0 : u.formats) == null ? void 0 : h.thumbnail) == null ? void 0 : _.url;
|
|
1036
|
+
return q(() => {
|
|
1061
1037
|
if (e != null && e.comentarios) {
|
|
1062
|
-
const
|
|
1063
|
-
(C,
|
|
1038
|
+
const v = [...e.comentarios].sort(
|
|
1039
|
+
(C, T) => new Date(T.createdAt).getTime() - new Date(C.createdAt).getTime()
|
|
1064
1040
|
);
|
|
1065
|
-
|
|
1041
|
+
m(v);
|
|
1066
1042
|
}
|
|
1067
1043
|
}, [e]), /* @__PURE__ */ c("div", { className: "tw-flex tw-flex-col tw-h-full tw-gap-4", children: [
|
|
1068
1044
|
/* @__PURE__ */ c(
|
|
1069
1045
|
"form",
|
|
1070
1046
|
{
|
|
1071
|
-
onSubmit: d(async (
|
|
1047
|
+
onSubmit: d(async (v) => {
|
|
1072
1048
|
try {
|
|
1073
1049
|
const C = {
|
|
1074
1050
|
autor: {
|
|
@@ -1077,25 +1053,25 @@ function qe({ currentUser: a, data: e, taskId: l, onNewComment: n }) {
|
|
|
1077
1053
|
nombre: a == null ? void 0 : a.nombre,
|
|
1078
1054
|
imagen: a == null ? void 0 : a.imagen
|
|
1079
1055
|
},
|
|
1080
|
-
comentario:
|
|
1056
|
+
comentario: v == null ? void 0 : v.comment,
|
|
1081
1057
|
createdAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
1082
1058
|
};
|
|
1083
1059
|
await r.post("/api/comentarios", {
|
|
1084
1060
|
data: {
|
|
1085
1061
|
autor: a == null ? void 0 : a.id,
|
|
1086
|
-
comentario:
|
|
1087
|
-
tarea:
|
|
1062
|
+
comentario: v.comment,
|
|
1063
|
+
tarea: s
|
|
1088
1064
|
}
|
|
1089
|
-
}), n(!0),
|
|
1065
|
+
}), n(!0), m((T) => [C, ...T]), o();
|
|
1090
1066
|
} catch (C) {
|
|
1091
1067
|
console.error("Error al agregar comentario:", C);
|
|
1092
1068
|
}
|
|
1093
1069
|
}),
|
|
1094
1070
|
className: "tw-flex tw-flex-row tw-items-center tw-gap-3",
|
|
1095
1071
|
children: [
|
|
1096
|
-
/* @__PURE__ */ t(
|
|
1072
|
+
/* @__PURE__ */ t(Q, { size: "xxl", imageUrl: b ? l(b) : "", alt: "@shadcn" }),
|
|
1097
1073
|
/* @__PURE__ */ t(
|
|
1098
|
-
|
|
1074
|
+
Jt,
|
|
1099
1075
|
{
|
|
1100
1076
|
...i("comment", { required: !0 }),
|
|
1101
1077
|
autoComplete: "off",
|
|
@@ -1106,10 +1082,10 @@ function qe({ currentUser: a, data: e, taskId: l, onNewComment: n }) {
|
|
|
1106
1082
|
]
|
|
1107
1083
|
}
|
|
1108
1084
|
),
|
|
1109
|
-
g && g.map((
|
|
1085
|
+
g && g.map((v, C) => /* @__PURE__ */ t(Pe, { comment: v }, C))
|
|
1110
1086
|
] });
|
|
1111
1087
|
}
|
|
1112
|
-
function
|
|
1088
|
+
function qe({ data: a }) {
|
|
1113
1089
|
const e = {
|
|
1114
1090
|
0: {
|
|
1115
1091
|
color: "tw-bg-gray-400",
|
|
@@ -1127,25 +1103,25 @@ function je({ data: a }) {
|
|
|
1127
1103
|
color: "tw-bg-success-regular",
|
|
1128
1104
|
label: "Finalizada"
|
|
1129
1105
|
}
|
|
1130
|
-
},
|
|
1106
|
+
}, s = (n) => n ? Dt(new Date(n), "d MMM", { locale: mt }) : "";
|
|
1131
1107
|
return /* @__PURE__ */ c("div", { children: [
|
|
1132
1108
|
/* @__PURE__ */ c("div", { className: "tw-flex tw-flex-row tw-items-center tw-gap-4", children: [
|
|
1133
|
-
/* @__PURE__ */ t(
|
|
1109
|
+
/* @__PURE__ */ t(Vt, { className: "tw-text-2xl tw-font-medium tw-text-neutral-900", children: "Tareas dependientes" }),
|
|
1134
1110
|
/* @__PURE__ */ t("span", { className: "tw-text-lg tw-font-normal tw-text-neutral-600 tw-bg-[#E1EBF9] tw-w-10 tw-h-10 tw-rounded-full tw-flex tw-items-center tw-justify-center tw-text-primary", children: a == null ? void 0 : a.length })
|
|
1135
1111
|
] }),
|
|
1136
1112
|
/* @__PURE__ */ t("div", { className: "tw-flex tw-flex-col tw-gap-2 tw-border tw-border-neutral-200 tw-rounded-lg tw-mt-3", children: a == null ? void 0 : a.map((n) => {
|
|
1137
|
-
var r,
|
|
1113
|
+
var r, l, i, d, o;
|
|
1138
1114
|
return /* @__PURE__ */ c(
|
|
1139
1115
|
"div",
|
|
1140
1116
|
{
|
|
1141
1117
|
className: "tw-flex tw-flex-row tw-w-full tw-items-center tw-justify-between tw-gap-s tw-border-b tw-border-neutral-200 tw-py-1 tw-px-2",
|
|
1142
1118
|
children: [
|
|
1143
1119
|
/* @__PURE__ */ c("div", { className: "tw-flex tw-items-center tw-gap-2", children: [
|
|
1144
|
-
/* @__PURE__ */ t(
|
|
1120
|
+
/* @__PURE__ */ t(Q, { imageUrl: (d = (i = (l = (r = n.responsable) == null ? void 0 : r.image) == null ? void 0 : l.formats) == null ? void 0 : i.thumbnail) == null ? void 0 : d.url }),
|
|
1145
1121
|
/* @__PURE__ */ t("p", { className: "tw-text-sm tw-font-normal tw-w-[400px] tw-text-nowrap tw-text-ellipsis tw-overflow-hidden", children: n == null ? void 0 : n.texto_corto })
|
|
1146
1122
|
] }),
|
|
1147
1123
|
/* @__PURE__ */ c("div", { className: "tw-flex tw-items-center tw-gap-1", children: [
|
|
1148
|
-
/* @__PURE__ */ t("p", { className: "tw-text-sm tw-font-normal", children:
|
|
1124
|
+
/* @__PURE__ */ t("p", { className: "tw-text-sm tw-font-normal", children: s(n == null ? void 0 : n.createdAt) }),
|
|
1149
1125
|
/* @__PURE__ */ t(
|
|
1150
1126
|
"div",
|
|
1151
1127
|
{
|
|
@@ -1160,24 +1136,24 @@ function je({ data: a }) {
|
|
|
1160
1136
|
}) })
|
|
1161
1137
|
] });
|
|
1162
1138
|
}
|
|
1163
|
-
function
|
|
1164
|
-
var
|
|
1165
|
-
const [n, r] =
|
|
1166
|
-
|
|
1167
|
-
if (a &&
|
|
1168
|
-
const
|
|
1169
|
-
const
|
|
1170
|
-
r(
|
|
1171
|
-
},
|
|
1172
|
-
var
|
|
1173
|
-
const
|
|
1174
|
-
emailList: [(
|
|
1139
|
+
function je({ isOpen: a, setIsOpen: e, taskId: s }) {
|
|
1140
|
+
var T, k, f, N, j, F, z, L, R, w, A, M;
|
|
1141
|
+
const [n, r] = y(null), [l, i] = y(!1), [d, o] = y(!1), [g, m] = y(null), b = (N = (f = (k = (T = n == null ? void 0 : n.responsable) == null ? void 0 : T.imagen) == null ? void 0 : k.formats) == null ? void 0 : f.thumbnail) == null ? void 0 : N.url, { tasks_api: x, getImageOBP: u } = B(), { user: h } = X();
|
|
1142
|
+
q(() => {
|
|
1143
|
+
if (a && s || l) {
|
|
1144
|
+
const S = async () => {
|
|
1145
|
+
const D = await x.get(`/api/detalleTarea/${s}`);
|
|
1146
|
+
r(D == null ? void 0 : D.data);
|
|
1147
|
+
}, I = async () => {
|
|
1148
|
+
var O, H;
|
|
1149
|
+
const D = await x.get(`/api/users/${h.id}`), E = await x.post("/api/obtenerUsuarioOBP/", {
|
|
1150
|
+
emailList: [(O = D == null ? void 0 : D.data) == null ? void 0 : O.email]
|
|
1175
1151
|
});
|
|
1176
|
-
|
|
1152
|
+
m((H = E == null ? void 0 : E.data) == null ? void 0 : H.data[0]);
|
|
1177
1153
|
};
|
|
1178
|
-
|
|
1154
|
+
S(), I();
|
|
1179
1155
|
}
|
|
1180
|
-
}, [a,
|
|
1156
|
+
}, [a, s, l]);
|
|
1181
1157
|
const _ = {
|
|
1182
1158
|
0: {
|
|
1183
1159
|
label: "Sin prioridad",
|
|
@@ -1199,16 +1175,16 @@ function Ae({ isOpen: a, setIsOpen: e, taskId: l }) {
|
|
|
1199
1175
|
color: "tw-text-danger-regular",
|
|
1200
1176
|
iconColor: "#C34335"
|
|
1201
1177
|
}
|
|
1202
|
-
},
|
|
1178
|
+
}, v = (S) => S ? Dt(S, "d MMM yyyy, h:mmaaa", {
|
|
1203
1179
|
locale: mt
|
|
1204
1180
|
}) : "Fecha no disponible", C = [
|
|
1205
1181
|
{
|
|
1206
1182
|
id: 1,
|
|
1207
1183
|
label: "Todo",
|
|
1208
1184
|
component: /* @__PURE__ */ t(
|
|
1209
|
-
|
|
1185
|
+
Te,
|
|
1210
1186
|
{
|
|
1211
|
-
taskId:
|
|
1187
|
+
taskId: s,
|
|
1212
1188
|
currentUser: g,
|
|
1213
1189
|
data: n,
|
|
1214
1190
|
onNewComment: i
|
|
@@ -1218,11 +1194,11 @@ function Ae({ isOpen: a, setIsOpen: e, taskId: l }) {
|
|
|
1218
1194
|
{
|
|
1219
1195
|
id: 2,
|
|
1220
1196
|
label: "Dependencias",
|
|
1221
|
-
component: /* @__PURE__ */ t(
|
|
1197
|
+
component: /* @__PURE__ */ t(qe, { data: n == null ? void 0 : n.ids_t_dependientes })
|
|
1222
1198
|
}
|
|
1223
1199
|
];
|
|
1224
1200
|
return a && nt.createPortal(
|
|
1225
|
-
/* @__PURE__ */ c(
|
|
1201
|
+
/* @__PURE__ */ c($, { children: [
|
|
1226
1202
|
/* @__PURE__ */ t(
|
|
1227
1203
|
"div",
|
|
1228
1204
|
{
|
|
@@ -1237,7 +1213,7 @@ function Ae({ isOpen: a, setIsOpen: e, taskId: l }) {
|
|
|
1237
1213
|
children: /* @__PURE__ */ c("div", { className: "tw-flex tw-w-full tw-h-full tw-flex-col tw-overflow-y-scroll tw-bg-white tw-border-none tw-shadow-xl tw-px-6 tw-py-10", children: [
|
|
1238
1214
|
/* @__PURE__ */ c("div", { className: "tw-w-full tw-flex tw-items-center tw-flex-row tw-justify-between tw-pb-4 tw-gap-10 tw-border-none", children: [
|
|
1239
1215
|
/* @__PURE__ */ c("div", { className: "tw-flex tw-flex-row tw-items-start tw-gap-2 tw-relative", children: [
|
|
1240
|
-
((
|
|
1216
|
+
((j = n == null ? void 0 : n.id_t_requerida) == null ? void 0 : j.id) && /* @__PURE__ */ c($, { children: [
|
|
1241
1217
|
/* @__PURE__ */ t(
|
|
1242
1218
|
"div",
|
|
1243
1219
|
{
|
|
@@ -1245,7 +1221,7 @@ function Ae({ isOpen: a, setIsOpen: e, taskId: l }) {
|
|
|
1245
1221
|
onMouseOver: () => o(!0),
|
|
1246
1222
|
onMouseLeave: () => o(!1),
|
|
1247
1223
|
children: /* @__PURE__ */ t(
|
|
1248
|
-
|
|
1224
|
+
P,
|
|
1249
1225
|
{
|
|
1250
1226
|
icon: "info_circle",
|
|
1251
1227
|
color: p.warning.regular,
|
|
@@ -1263,7 +1239,7 @@ function Ae({ isOpen: a, setIsOpen: e, taskId: l }) {
|
|
|
1263
1239
|
className: "tw-p-l tw-max-w-[400px] tw-absolute tw-w-fit tw-bg-warning-light tw-rounded-lg tw-border-l-[5px] tw-border-warning-regular tw-text-warning-dark tw-text-xs tw-flex tw-flex-col tw-gap-m",
|
|
1264
1240
|
children: [
|
|
1265
1241
|
/* @__PURE__ */ t("p", { className: "tw-font-bold", children: "Requiere completar su tarea requerida:" }),
|
|
1266
|
-
/* @__PURE__ */ t("p", { className: "tw-text-2xl tw-text-neutral-600 tw-font-normal", children: (
|
|
1242
|
+
/* @__PURE__ */ t("p", { className: "tw-text-2xl tw-text-neutral-600 tw-font-normal", children: (F = n == null ? void 0 : n.id_t_requerida) == null ? void 0 : F.texto_corto })
|
|
1267
1243
|
]
|
|
1268
1244
|
}
|
|
1269
1245
|
)
|
|
@@ -1277,7 +1253,7 @@ function Ae({ isOpen: a, setIsOpen: e, taskId: l }) {
|
|
|
1277
1253
|
size: "sm",
|
|
1278
1254
|
onClick: () => e(!1),
|
|
1279
1255
|
className: "tw-bg-neutral-100 tw-w-12 tw-h-12",
|
|
1280
|
-
children: /* @__PURE__ */ t(
|
|
1256
|
+
children: /* @__PURE__ */ t(P, { icon: "x_outline" })
|
|
1281
1257
|
}
|
|
1282
1258
|
)
|
|
1283
1259
|
] }),
|
|
@@ -1291,38 +1267,38 @@ function Ae({ isOpen: a, setIsOpen: e, taskId: l }) {
|
|
|
1291
1267
|
/* @__PURE__ */ t("p", { className: "tw-text-neutral-600 tw-font-normal tw-text-sm", children: (n == null ? void 0 : n.texto_largo) ?? "Sin descripción" })
|
|
1292
1268
|
] }),
|
|
1293
1269
|
/* @__PURE__ */ t(
|
|
1294
|
-
|
|
1270
|
+
te,
|
|
1295
1271
|
{
|
|
1296
1272
|
type: "single",
|
|
1297
1273
|
collapsible: !0,
|
|
1298
1274
|
defaultValue: "item-1",
|
|
1299
1275
|
className: "tw-w-full tw-flex tw-flex-col tw-border tw-border-neutral-200 tw-rounded-xl tw-mt-6",
|
|
1300
|
-
children: /* @__PURE__ */ c(
|
|
1301
|
-
/* @__PURE__ */ t(
|
|
1302
|
-
/* @__PURE__ */ t(
|
|
1276
|
+
children: /* @__PURE__ */ c(ee, { value: "item-1", className: "tw-border-none", children: [
|
|
1277
|
+
/* @__PURE__ */ t(ae, { className: "tw-text-neutral-900 tw-font-medium tw-text-2xl tw-w-full tw-flex tw-flex-row tw-border-b tw-border-neutral-200 tw-p-4", children: "Detalles" }),
|
|
1278
|
+
/* @__PURE__ */ t(re, { className: "tw-border-none", children: /* @__PURE__ */ c("div", { className: "tw-w-full tw-grid tw-grid-cols-3 tw-gap-4 tw-p-4", children: [
|
|
1303
1279
|
/* @__PURE__ */ c("div", { className: "tw-flex tw-flex-col tw-w-auto tw-gap-2", children: [
|
|
1304
1280
|
/* @__PURE__ */ t("span", { className: "tw-text-xl tw-text-neutral-900 tw-font-medium", children: "Responsable" }),
|
|
1305
|
-
(
|
|
1281
|
+
(z = n == null ? void 0 : n.responsable) != null && z.nombre ? /* @__PURE__ */ c("div", { className: "tw-flex tw-flex-row tw-gap-2 tw-items-center", children: [
|
|
1306
1282
|
/* @__PURE__ */ t(
|
|
1307
|
-
|
|
1283
|
+
Q,
|
|
1308
1284
|
{
|
|
1309
1285
|
size: "xxl",
|
|
1310
|
-
imageUrl:
|
|
1286
|
+
imageUrl: b ? u(b) : "",
|
|
1311
1287
|
alt: "@shadcn"
|
|
1312
1288
|
}
|
|
1313
1289
|
),
|
|
1314
|
-
/* @__PURE__ */ t("span", { className: "tw-text-lg tw-text-neutral-600 tw-font-normal", children: (
|
|
1290
|
+
/* @__PURE__ */ t("span", { className: "tw-text-lg tw-text-neutral-600 tw-font-normal", children: (L = n == null ? void 0 : n.responsable) == null ? void 0 : L.nombre })
|
|
1315
1291
|
] }) : /* @__PURE__ */ t("span", { className: "tw-text-lg tw-text-neutral-600 tw-font-normal", children: "Sin responsable" })
|
|
1316
1292
|
] }),
|
|
1317
1293
|
/* @__PURE__ */ c("div", { className: "tw-flex tw-flex-col tw-w-auto tw-gap-2", children: [
|
|
1318
1294
|
/* @__PURE__ */ t("span", { className: "tw-text-xl tw-text-neutral-900 tw-font-medium", children: "Equipo asignado" }),
|
|
1319
|
-
/* @__PURE__ */ t("div", { className: "tw-flex tw-flex-row tw-gap-2", children: /* @__PURE__ */ t("span", { className: "tw-text-lg tw-text-neutral-600 tw-font-normal", children: ((
|
|
1295
|
+
/* @__PURE__ */ t("div", { className: "tw-flex tw-flex-row tw-gap-2", children: /* @__PURE__ */ t("span", { className: "tw-text-lg tw-text-neutral-600 tw-font-normal", children: ((R = n == null ? void 0 : n.equipo) == null ? void 0 : R.nombre) ?? "Sin equipo" }) })
|
|
1320
1296
|
] }),
|
|
1321
1297
|
/* @__PURE__ */ c("div", { className: "tw-flex tw-flex-col tw-w-auto tw-gap-2", children: [
|
|
1322
1298
|
/* @__PURE__ */ t("span", { className: "tw-text-xl tw-text-neutral-900 tw-font-medium", children: "Prioridad" }),
|
|
1323
1299
|
/* @__PURE__ */ c("div", { className: "tw-flex tw-flex-row tw-items-center tw-gap-2", children: [
|
|
1324
1300
|
/* @__PURE__ */ t(
|
|
1325
|
-
|
|
1301
|
+
P,
|
|
1326
1302
|
{
|
|
1327
1303
|
icon: "flag",
|
|
1328
1304
|
size: "xs",
|
|
@@ -1334,7 +1310,7 @@ function Ae({ isOpen: a, setIsOpen: e, taskId: l }) {
|
|
|
1334
1310
|
"span",
|
|
1335
1311
|
{
|
|
1336
1312
|
className: `tw-text-lg tw-text-neutral-600 tw-font-normal ${(A = _[n == null ? void 0 : n.prioridad]) == null ? void 0 : A.color}`,
|
|
1337
|
-
children: ((
|
|
1313
|
+
children: ((M = _[n == null ? void 0 : n.prioridad]) == null ? void 0 : M.label) ?? "Sin prioridad"
|
|
1338
1314
|
}
|
|
1339
1315
|
)
|
|
1340
1316
|
] })
|
|
@@ -1345,29 +1321,29 @@ function Ae({ isOpen: a, setIsOpen: e, taskId: l }) {
|
|
|
1345
1321
|
] }),
|
|
1346
1322
|
/* @__PURE__ */ c("div", { className: "tw-flex tw-flex-col tw-w-auto tw-gap-2", children: [
|
|
1347
1323
|
/* @__PURE__ */ t("span", { className: "tw-text-xl tw-text-neutral-900 tw-font-medium", children: "Fecha estimada de inicio" }),
|
|
1348
|
-
/* @__PURE__ */ t("p", { className: "tw-text-lg tw-text-neutral-600 tw-font-normal", children:
|
|
1324
|
+
/* @__PURE__ */ t("p", { className: "tw-text-lg tw-text-neutral-600 tw-font-normal", children: v(n == null ? void 0 : n.f_inicio_estimada) })
|
|
1349
1325
|
] }),
|
|
1350
1326
|
/* @__PURE__ */ c("div", { className: "tw-flex tw-flex-col tw-w-auto tw-gap-2", children: [
|
|
1351
1327
|
/* @__PURE__ */ t("span", { className: "tw-text-xl tw-text-neutral-900 tw-font-medium", children: "Fecha estimada de fin" }),
|
|
1352
|
-
/* @__PURE__ */ t("p", { className: "tw-text-lg tw-text-neutral-600 tw-font-normal", children:
|
|
1328
|
+
/* @__PURE__ */ t("p", { className: "tw-text-lg tw-text-neutral-600 tw-font-normal", children: v(n == null ? void 0 : n.f_fin_estimada) })
|
|
1353
1329
|
] }),
|
|
1354
1330
|
/* @__PURE__ */ c("div", { className: "tw-flex tw-flex-col tw-w-auto tw-gap-2", children: [
|
|
1355
1331
|
/* @__PURE__ */ t("span", { className: "tw-text-xl tw-text-neutral-900 tw-font-medium", children: "Fecha de fin" }),
|
|
1356
|
-
/* @__PURE__ */ t("p", { className: "tw-text-lg tw-text-neutral-600 tw-font-normal", children:
|
|
1332
|
+
/* @__PURE__ */ t("p", { className: "tw-text-lg tw-text-neutral-600 tw-font-normal", children: v(n == null ? void 0 : n.ffin) })
|
|
1357
1333
|
] }),
|
|
1358
1334
|
/* @__PURE__ */ c("div", { className: "tw-flex tw-flex-col tw-w-auto tw-gap-2", children: [
|
|
1359
1335
|
/* @__PURE__ */ t("span", { className: "tw-text-xl tw-text-neutral-900 tw-font-medium", children: "Creado" }),
|
|
1360
|
-
/* @__PURE__ */ t("p", { className: "tw-text-lg tw-text-neutral-600 tw-font-normal", children:
|
|
1336
|
+
/* @__PURE__ */ t("p", { className: "tw-text-lg tw-text-neutral-600 tw-font-normal", children: v(n == null ? void 0 : n.createdAt) })
|
|
1361
1337
|
] }),
|
|
1362
1338
|
/* @__PURE__ */ c("div", { className: "tw-flex tw-flex-col tw-w-auto tw-gap-2", children: [
|
|
1363
1339
|
/* @__PURE__ */ t("span", { className: "tw-text-xl tw-text-neutral-900 tw-font-medium", children: "Última modificación" }),
|
|
1364
|
-
/* @__PURE__ */ t("p", { className: "tw-text-lg tw-text-neutral-600 tw-font-normal", children:
|
|
1340
|
+
/* @__PURE__ */ t("p", { className: "tw-text-lg tw-text-neutral-600 tw-font-normal", children: v(n == null ? void 0 : n.updatedAt) })
|
|
1365
1341
|
] })
|
|
1366
1342
|
] }) })
|
|
1367
1343
|
] })
|
|
1368
1344
|
}
|
|
1369
1345
|
),
|
|
1370
|
-
/* @__PURE__ */ t(
|
|
1346
|
+
/* @__PURE__ */ t(Fe, { items: C })
|
|
1371
1347
|
] })
|
|
1372
1348
|
}
|
|
1373
1349
|
)
|
|
@@ -1375,10 +1351,10 @@ function Ae({ isOpen: a, setIsOpen: e, taskId: l }) {
|
|
|
1375
1351
|
document.body
|
|
1376
1352
|
);
|
|
1377
1353
|
}
|
|
1378
|
-
const
|
|
1379
|
-
const { setElementPosition: r, position:
|
|
1380
|
-
return /* @__PURE__ */ c(
|
|
1381
|
-
(e !== "" &&
|
|
1354
|
+
const Kt = ({ status: a, nameRequiredTask: e, statusRequiredTask: s, id: n }) => {
|
|
1355
|
+
const { setElementPosition: r, position: l } = pt(), { startWorking: i, completeTask: d } = lt(), o = Y(null), g = Y(!1);
|
|
1356
|
+
return /* @__PURE__ */ c($, { children: [
|
|
1357
|
+
(e !== "" && s === 2 && s === 2 || !e) && /* @__PURE__ */ t(
|
|
1382
1358
|
"button",
|
|
1383
1359
|
{
|
|
1384
1360
|
ref: o,
|
|
@@ -1388,24 +1364,24 @@ const Ut = ({ status: a, nameRequiredTask: e, statusRequiredTask: l, id: n }) =>
|
|
|
1388
1364
|
);
|
|
1389
1365
|
},
|
|
1390
1366
|
className: "tw-flex tw-items-center tw-justify-center tw-text-sm tw-font-extrabold tw-bg-bg tw-hover:filter-[drop-shadow(0_0_10px_#000000)] tw-rounded-full tw-w-[24px] tw-h-[24px] tw-m-block",
|
|
1391
|
-
children: /* @__PURE__ */ t("span", { className: "tw-rotate-90", children: /* @__PURE__ */ t(
|
|
1367
|
+
children: /* @__PURE__ */ t("span", { className: "tw-rotate-90", children: /* @__PURE__ */ t(P, { icon: "elipsis", size: "xs" }) })
|
|
1392
1368
|
}
|
|
1393
1369
|
),
|
|
1394
|
-
/* @__PURE__ */ t(({ children:
|
|
1395
|
-
const [
|
|
1396
|
-
return
|
|
1397
|
-
var _,
|
|
1398
|
-
o.current &&
|
|
1399
|
-
((
|
|
1370
|
+
/* @__PURE__ */ t(({ children: x }) => {
|
|
1371
|
+
const [u, h] = y();
|
|
1372
|
+
return q(() => {
|
|
1373
|
+
var _, v;
|
|
1374
|
+
o.current && h(
|
|
1375
|
+
((l == null ? void 0 : l.x) ?? 0) - (((v = (_ = o.current) == null ? void 0 : _.getBoundingClientRect()) == null ? void 0 : v.width) ?? 0)
|
|
1400
1376
|
);
|
|
1401
|
-
}, [o == null ? void 0 : o.current,
|
|
1377
|
+
}, [o == null ? void 0 : o.current, l == null ? void 0 : l.x]), l && nt.createPortal(
|
|
1402
1378
|
/* @__PURE__ */ t(
|
|
1403
1379
|
"div",
|
|
1404
1380
|
{
|
|
1405
1381
|
"data-portal-host": !0,
|
|
1406
|
-
className: `tw-absolute tw-w-fit tw-h-fit ${
|
|
1407
|
-
style: { top: `${
|
|
1408
|
-
children:
|
|
1382
|
+
className: `tw-absolute tw-w-fit tw-h-fit ${u ? "tw-block" : "tw-hidden"}`,
|
|
1383
|
+
style: { top: `${l == null ? void 0 : l.y}px`, left: `${u}px`, zIndex: 1 },
|
|
1384
|
+
children: x
|
|
1409
1385
|
}
|
|
1410
1386
|
),
|
|
1411
1387
|
document.body
|
|
@@ -1420,7 +1396,7 @@ const Ut = ({ status: a, nameRequiredTask: e, statusRequiredTask: l, id: n }) =>
|
|
|
1420
1396
|
children: [
|
|
1421
1397
|
/* @__PURE__ */ t("p", { className: "tw-text-sm tw-font-normal tw-text-texts-placeholder tw-font-regular", children: a === 0 ? "Mover a trabajando" : "Mover a completadas" }),
|
|
1422
1398
|
/* @__PURE__ */ t(
|
|
1423
|
-
|
|
1399
|
+
P,
|
|
1424
1400
|
{
|
|
1425
1401
|
icon: "arrow_right",
|
|
1426
1402
|
size: "xs",
|
|
@@ -1441,7 +1417,7 @@ class ke {
|
|
|
1441
1417
|
};
|
|
1442
1418
|
}
|
|
1443
1419
|
}
|
|
1444
|
-
const
|
|
1420
|
+
const Ae = async ({
|
|
1445
1421
|
tasks_api: a
|
|
1446
1422
|
}) => {
|
|
1447
1423
|
try {
|
|
@@ -1450,25 +1426,25 @@ const Se = async ({
|
|
|
1450
1426
|
} catch (e) {
|
|
1451
1427
|
throw console.log("Error al obtener los usuarios comerciales", e), `Error al obtener los usuarios comerciales: ${e}`;
|
|
1452
1428
|
}
|
|
1453
|
-
},
|
|
1454
|
-
const { tasks_api: a } =
|
|
1429
|
+
}, Se = () => {
|
|
1430
|
+
const { tasks_api: a } = B();
|
|
1455
1431
|
return { pauseReasons: ct({
|
|
1456
1432
|
queryKey: ["pause_task_reasons"],
|
|
1457
|
-
queryFn: () =>
|
|
1433
|
+
queryFn: () => Ae({
|
|
1458
1434
|
tasks_api: a
|
|
1459
1435
|
}),
|
|
1460
1436
|
staleTime: 1e3 * 60 * 60 * 24
|
|
1461
1437
|
// mantains the data for 24 hours
|
|
1462
1438
|
}) };
|
|
1463
|
-
},
|
|
1464
|
-
const { pauseTask: r } =
|
|
1465
|
-
if (!
|
|
1439
|
+
}, De = ({ id: a, task: e, isActive: s, closeModal: n }) => {
|
|
1440
|
+
const { pauseTask: r } = lt(), [l, i] = y(), [d, o] = y(!1), [g, m] = y(!1), { pauseReasons: b } = Se(), x = () => {
|
|
1441
|
+
if (!l) {
|
|
1466
1442
|
o(!0);
|
|
1467
1443
|
return;
|
|
1468
1444
|
}
|
|
1469
|
-
r({ id: a, motiveId:
|
|
1445
|
+
r({ id: a, motiveId: l.id }), n();
|
|
1470
1446
|
};
|
|
1471
|
-
return
|
|
1447
|
+
return s && nt.createPortal(
|
|
1472
1448
|
/* @__PURE__ */ t("div", { className: "tw-w-screen tw-h-screen tw-fixed tw-top-0 tw-left-0 tw-flex tw-items-center tw-justify-center ", children: /* @__PURE__ */ c("div", { className: "tw-rounded-lg tw-p-4 tw-shadow-gray-600 tw-bg-warning-light tw-border-l-4 tw-border-warning-regular tw-max-w-[350px]", children: [
|
|
1473
1449
|
/* @__PURE__ */ c("p", { className: "tw-text-xl tw-font-bold tw-text-warning-regular", children: [
|
|
1474
1450
|
"Pausar tarea: ",
|
|
@@ -1477,17 +1453,17 @@ const Se = async ({
|
|
|
1477
1453
|
/* @__PURE__ */ c("div", { className: "tw-my-5 tw-flex tw-flex-col tw-gap-l", children: [
|
|
1478
1454
|
/* @__PURE__ */ c("div", { className: "tw-relative", children: [
|
|
1479
1455
|
/* @__PURE__ */ t("p", { className: "tw-text-xl tw-font-normal tw-text-warning-regular", children: "Seleccione la razón por la cual se realizará la pausa" }),
|
|
1480
|
-
/* @__PURE__ */ c("div", { onBlur: () =>
|
|
1481
|
-
/* @__PURE__ */ t("p", { children: (
|
|
1482
|
-
/* @__PURE__ */ t(
|
|
1456
|
+
/* @__PURE__ */ c("div", { onBlur: () => m(!1), onClick: () => m(!g), className: `tw-w-full tw-bg-bg-card ${d ? "tw-shadow-danger-regular tw-border-2 tw-border-danger-regular" : "tw-shadow-input"} tw-h-[30px] tw-rounded-md tw-flex tw-justify-between tw-items-center tw-pl-2 ${d ? "tw-text-danger-regular" : l ? "tw-text-texts-subtext" : "tw-text-texts-placeholder"}`, children: [
|
|
1457
|
+
/* @__PURE__ */ t("p", { children: (l == null ? void 0 : l.name) ?? "Selecciona una razón" }),
|
|
1458
|
+
/* @__PURE__ */ t(P, { icon: "angle_down_outline", color: d ? p.danger.regular : p.texts.placeholder })
|
|
1483
1459
|
] }),
|
|
1484
1460
|
g && /* @__PURE__ */ t("div", { className: "absolute w-full tw-shadow-md tw-rounded-lg", children: /* @__PURE__ */ t(
|
|
1485
1461
|
gt,
|
|
1486
1462
|
{
|
|
1487
|
-
onselect: (
|
|
1488
|
-
i(
|
|
1463
|
+
onselect: (u) => {
|
|
1464
|
+
i(u), m(!1);
|
|
1489
1465
|
},
|
|
1490
|
-
options:
|
|
1466
|
+
options: b == null ? void 0 : b.data.map((u) => ({ id: u.id, name: u.motivo_imj }))
|
|
1491
1467
|
}
|
|
1492
1468
|
) })
|
|
1493
1469
|
] }),
|
|
@@ -1495,44 +1471,44 @@ const Se = async ({
|
|
|
1495
1471
|
/* @__PURE__ */ t("button", { onClick: () => {
|
|
1496
1472
|
n(), i(null);
|
|
1497
1473
|
}, className: "tw-bg-danger-light tw-px-l tw-py-s tw-border-2 tw-border-danger-medium tw-rounded-md tw-w-full tw-text-danger-dark tw-font-bold hover:tw-border-danger-regular", children: "Cancelar" }),
|
|
1498
|
-
/* @__PURE__ */ t("button", { onClick:
|
|
1474
|
+
/* @__PURE__ */ t("button", { onClick: x, className: "tw-w-full tw-bg-primary-light tw-px-l tw-py-s tw-border-2 tw-border-primary-medium tw-rounded-md tw-text-primary-dark tw-font-bold hover:tw-border-primary-regular", children: "Pausar" })
|
|
1499
1475
|
] })
|
|
1500
1476
|
] })
|
|
1501
1477
|
] }) }),
|
|
1502
1478
|
document.body
|
|
1503
1479
|
);
|
|
1504
|
-
},
|
|
1480
|
+
}, Me = ({
|
|
1505
1481
|
id: a,
|
|
1506
1482
|
task: e,
|
|
1507
|
-
endDate:
|
|
1483
|
+
endDate: s,
|
|
1508
1484
|
users: n,
|
|
1509
1485
|
willBePaused: r,
|
|
1510
|
-
nameProject:
|
|
1486
|
+
nameProject: l,
|
|
1511
1487
|
comments: i,
|
|
1512
1488
|
priority: d,
|
|
1513
1489
|
difficulty: o,
|
|
1514
1490
|
responsible: g,
|
|
1515
|
-
nameRequiredTask:
|
|
1516
|
-
statusRequiredTask:
|
|
1517
|
-
status:
|
|
1518
|
-
repeatsToDo:
|
|
1519
|
-
repeats:
|
|
1491
|
+
nameRequiredTask: m,
|
|
1492
|
+
statusRequiredTask: b,
|
|
1493
|
+
status: x,
|
|
1494
|
+
repeatsToDo: u,
|
|
1495
|
+
repeats: h,
|
|
1520
1496
|
medioName: _
|
|
1521
1497
|
}) => {
|
|
1522
|
-
var
|
|
1523
|
-
const [
|
|
1498
|
+
var D, E, O, H, V, tt;
|
|
1499
|
+
const [v, C] = y(!1), [T, k] = y(!1), {
|
|
1524
1500
|
reasignResponsible: f,
|
|
1525
|
-
updateUnitys:
|
|
1501
|
+
updateUnitys: N
|
|
1526
1502
|
/* , pauseTask */
|
|
1527
|
-
} =
|
|
1503
|
+
} = lt(), { getOBPUrlApi: j } = B(), [F, z] = y(h ?? 0), L = !!(u && h === u), R = !u || u === 1, w = x === 0, A = () => /* @__PURE__ */ c("div", { className: "tw-flex tw-justify-between tw-items-center tw-w-full tw-h-fit tw-relative", children: [
|
|
1528
1504
|
/* @__PURE__ */ c("div", { className: "tw-flex tw-flex-row tw-items-start tw-gap-[8px] tw-w-[calc(100%-32px)]", children: [
|
|
1529
|
-
|
|
1530
|
-
|
|
1505
|
+
x < 2 && (L || R || w) && /* @__PURE__ */ t(
|
|
1506
|
+
Lt,
|
|
1531
1507
|
{
|
|
1532
1508
|
id: a,
|
|
1533
|
-
nameRequiredTask:
|
|
1534
|
-
statusRequiredTask:
|
|
1535
|
-
status:
|
|
1509
|
+
nameRequiredTask: m ?? "",
|
|
1510
|
+
statusRequiredTask: b ?? 0,
|
|
1511
|
+
status: x
|
|
1536
1512
|
}
|
|
1537
1513
|
),
|
|
1538
1514
|
/* @__PURE__ */ t(
|
|
@@ -1544,46 +1520,46 @@ const Se = async ({
|
|
|
1544
1520
|
}
|
|
1545
1521
|
)
|
|
1546
1522
|
] }),
|
|
1547
|
-
(
|
|
1548
|
-
|
|
1523
|
+
(L || R || w) && /* @__PURE__ */ t(
|
|
1524
|
+
Kt,
|
|
1549
1525
|
{
|
|
1550
1526
|
id: a,
|
|
1551
|
-
nameRequiredTask:
|
|
1552
|
-
status:
|
|
1553
|
-
statusRequiredTask:
|
|
1527
|
+
nameRequiredTask: m,
|
|
1528
|
+
status: x,
|
|
1529
|
+
statusRequiredTask: b
|
|
1554
1530
|
}
|
|
1555
1531
|
)
|
|
1556
|
-
] }),
|
|
1532
|
+
] }), M = {
|
|
1557
1533
|
0: { title: "N/A", color: p.texts.placeholder },
|
|
1558
1534
|
1: { title: "Baja", color: p.primary.regular },
|
|
1559
1535
|
2: { title: "Media", color: p.success.regular },
|
|
1560
1536
|
3: { title: "Alta", color: p.danger.regular }
|
|
1561
|
-
},
|
|
1537
|
+
}, S = {
|
|
1562
1538
|
0: { title: "Muy fácil", color: p.primary.regular },
|
|
1563
1539
|
1: { title: "Fácil", color: p.success.regular },
|
|
1564
1540
|
2: { title: "Media", color: p.warning.regular },
|
|
1565
1541
|
3: { title: "Difícil", color: p.danger.regular },
|
|
1566
1542
|
4: { title: "Muy difícil", color: p.danger.dark }
|
|
1567
|
-
},
|
|
1568
|
-
|
|
1543
|
+
}, I = (W) => {
|
|
1544
|
+
z((Z) => W === "minus" ? Math.max(0, Z - 1) : Math.min(u, Z + 1));
|
|
1569
1545
|
};
|
|
1570
|
-
return /* @__PURE__ */ c(
|
|
1546
|
+
return /* @__PURE__ */ c($, { children: [
|
|
1571
1547
|
/* @__PURE__ */ c("div", { className: "tw-bg-white tw-border-cards tw-max-w-[350px] tw-rounded-lg tw-relative tw-h-fit tw-p-[12px_12px] hover:tw-border-active hover:tw-bg-active tw-cursor-pointer", children: [
|
|
1572
1548
|
/* @__PURE__ */ t(A, {}),
|
|
1573
1549
|
/* @__PURE__ */ c("div", { className: "tw-flex tw-flex-col tw-gap-[4px] tw-py-2", children: [
|
|
1574
|
-
/* @__PURE__ */ t("p", { className: "tw-text-xl tw-font-regular tw-text-texts-subtext tw-max-w-[250px] tw-truncate", children:
|
|
1550
|
+
/* @__PURE__ */ t("p", { className: "tw-text-xl tw-font-regular tw-text-texts-subtext tw-max-w-[250px] tw-truncate", children: l }),
|
|
1575
1551
|
_ && /* @__PURE__ */ t("p", { className: "tw-text-xl", children: _ })
|
|
1576
1552
|
] }),
|
|
1577
1553
|
/* @__PURE__ */ c("div", { className: "tw-flex tw-justify-between tw-items-center tw-w-full tw-h-fit tw-relative tw-pt-5 tw-pb-1", children: [
|
|
1578
1554
|
/* @__PURE__ */ c("div", { className: "tw-flex tw-items-center tw-relative", children: [
|
|
1579
1555
|
/* @__PURE__ */ t(
|
|
1580
|
-
|
|
1556
|
+
Rt,
|
|
1581
1557
|
{
|
|
1582
1558
|
responsible: g,
|
|
1583
|
-
users: n.filter((
|
|
1584
|
-
onClick: async (
|
|
1559
|
+
users: n.filter((W) => g ? W.id === g : !0).map((W) => xt(W, j())),
|
|
1560
|
+
onClick: async (W, Z) => {
|
|
1585
1561
|
await f({
|
|
1586
|
-
idNewResponsible:
|
|
1562
|
+
idNewResponsible: W,
|
|
1587
1563
|
id: a,
|
|
1588
1564
|
typeOfSelect: Z
|
|
1589
1565
|
});
|
|
@@ -1591,15 +1567,15 @@ const Se = async ({
|
|
|
1591
1567
|
}
|
|
1592
1568
|
),
|
|
1593
1569
|
r && /* @__PURE__ */ t(
|
|
1594
|
-
|
|
1570
|
+
K,
|
|
1595
1571
|
{
|
|
1596
1572
|
dispatch: /* @__PURE__ */ t(
|
|
1597
1573
|
"button",
|
|
1598
1574
|
{
|
|
1599
1575
|
disabled: !0,
|
|
1600
|
-
onClick: () =>
|
|
1576
|
+
onClick: () => k(!0),
|
|
1601
1577
|
className: "tw-text-sm tw-font-regular tw-text-gray-400 tw-flex tw-items-center tw-gap-2",
|
|
1602
|
-
children: /* @__PURE__ */ t(
|
|
1578
|
+
children: /* @__PURE__ */ t(P, { icon: "pause", size: "s", strokeWidth: 2 })
|
|
1603
1579
|
}
|
|
1604
1580
|
),
|
|
1605
1581
|
children: /* @__PURE__ */ t("p", { className: "tw-text-sm tw-font-regular tw-text-white tw-p-5", children: "En camino..." })
|
|
@@ -1609,14 +1585,14 @@ const Se = async ({
|
|
|
1609
1585
|
/* @__PURE__ */ c("div", { className: "tw-flex tw-gap-m tw-items-center tw-flex-wrap", children: [
|
|
1610
1586
|
/* @__PURE__ */ c("div", { className: "tw-flex tw-items-center tw-gap-2", children: [
|
|
1611
1587
|
/* @__PURE__ */ t(
|
|
1612
|
-
|
|
1588
|
+
K,
|
|
1613
1589
|
{
|
|
1614
1590
|
dispatch: /* @__PURE__ */ t(
|
|
1615
|
-
|
|
1591
|
+
P,
|
|
1616
1592
|
{
|
|
1617
1593
|
icon: "difficulty",
|
|
1618
1594
|
size: "xs",
|
|
1619
|
-
color: (
|
|
1595
|
+
color: (D = S[o ?? 0]) == null ? void 0 : D.color,
|
|
1620
1596
|
strokeWidth: 4
|
|
1621
1597
|
}
|
|
1622
1598
|
),
|
|
@@ -1624,21 +1600,21 @@ const Se = async ({
|
|
|
1624
1600
|
"p",
|
|
1625
1601
|
{
|
|
1626
1602
|
className: "tw-text-sm tw-font-regular tw-p-5 tw-bg-bg-card tw-rounded-lg",
|
|
1627
|
-
style: { color: (
|
|
1628
|
-
children: `Dificultad ${(
|
|
1603
|
+
style: { color: (E = S[o ?? 0]) == null ? void 0 : E.color },
|
|
1604
|
+
children: `Dificultad ${(O = S[o ?? 0]) == null ? void 0 : O.title}`
|
|
1629
1605
|
}
|
|
1630
1606
|
)
|
|
1631
1607
|
}
|
|
1632
1608
|
),
|
|
1633
1609
|
/* @__PURE__ */ t(
|
|
1634
|
-
|
|
1610
|
+
K,
|
|
1635
1611
|
{
|
|
1636
1612
|
dispatch: /* @__PURE__ */ t(
|
|
1637
|
-
|
|
1613
|
+
P,
|
|
1638
1614
|
{
|
|
1639
1615
|
icon: "flag",
|
|
1640
1616
|
size: "xs",
|
|
1641
|
-
color: (H =
|
|
1617
|
+
color: (H = M[d ?? 0]) == null ? void 0 : H.color,
|
|
1642
1618
|
strokeWidth: 4
|
|
1643
1619
|
}
|
|
1644
1620
|
),
|
|
@@ -1646,15 +1622,15 @@ const Se = async ({
|
|
|
1646
1622
|
"p",
|
|
1647
1623
|
{
|
|
1648
1624
|
className: "tw-text-sm tw-font-regular tw-p-5 tw-bg-bg-card tw-rounded-lg",
|
|
1649
|
-
style: { color: (V =
|
|
1650
|
-
children: `Prioridad: ${(tt =
|
|
1625
|
+
style: { color: (V = M[d ?? 0]) == null ? void 0 : V.color },
|
|
1626
|
+
children: `Prioridad: ${(tt = M[d ?? 0]) == null ? void 0 : tt.title}`
|
|
1651
1627
|
}
|
|
1652
1628
|
)
|
|
1653
1629
|
}
|
|
1654
1630
|
),
|
|
1655
|
-
!
|
|
1631
|
+
!u || u && x === 0 && /* @__PURE__ */ c($, { children: [
|
|
1656
1632
|
/* @__PURE__ */ t(
|
|
1657
|
-
|
|
1633
|
+
P,
|
|
1658
1634
|
{
|
|
1659
1635
|
icon: "calendar",
|
|
1660
1636
|
size: "xs",
|
|
@@ -1662,20 +1638,20 @@ const Se = async ({
|
|
|
1662
1638
|
color: p.texts.subtext
|
|
1663
1639
|
}
|
|
1664
1640
|
),
|
|
1665
|
-
/* @__PURE__ */ t("p", { className: "tw-text-sm tw-font-regular tw-text-texts-subtext", children: `${
|
|
1666
|
-
|
|
1641
|
+
/* @__PURE__ */ t("p", { className: "tw-text-sm tw-font-regular tw-text-texts-subtext", children: `${s.getDate()} ${ht(
|
|
1642
|
+
s.getMonth()
|
|
1667
1643
|
).slice(0, 3)}` })
|
|
1668
1644
|
] })
|
|
1669
1645
|
] }),
|
|
1670
|
-
|
|
1646
|
+
x === 1 && u && u > 0 && /* @__PURE__ */ c("div", { className: "tw-flex tw-items-center tw-gap-m", children: [
|
|
1671
1647
|
/* @__PURE__ */ t("p", { className: "tw-text-xs tw-text-texts-placeholder ", children: "unidades" }),
|
|
1672
1648
|
/* @__PURE__ */ t(
|
|
1673
1649
|
"button",
|
|
1674
1650
|
{
|
|
1675
|
-
onClick: () =>
|
|
1651
|
+
onClick: () => I("minus"),
|
|
1676
1652
|
className: "tw-flex tw-items-center tw-justify-center tw-bg-gray-200 tw-w-[0] tw-rounded-full hover:tw-bg-gray-400",
|
|
1677
1653
|
children: /* @__PURE__ */ t(
|
|
1678
|
-
|
|
1654
|
+
P,
|
|
1679
1655
|
{
|
|
1680
1656
|
icon: "circle_minus",
|
|
1681
1657
|
size: "xs",
|
|
@@ -1685,14 +1661,14 @@ const Se = async ({
|
|
|
1685
1661
|
)
|
|
1686
1662
|
}
|
|
1687
1663
|
),
|
|
1688
|
-
/* @__PURE__ */ t("p", { className: "tw-text-xs tw-text-texts-placeholder", children: `${
|
|
1664
|
+
/* @__PURE__ */ t("p", { className: "tw-text-xs tw-text-texts-placeholder", children: `${F ?? 0} / ${u ?? 0}` }),
|
|
1689
1665
|
/* @__PURE__ */ t(
|
|
1690
1666
|
"button",
|
|
1691
1667
|
{
|
|
1692
|
-
onClick: () =>
|
|
1668
|
+
onClick: () => I("plus"),
|
|
1693
1669
|
className: "tw-flex tw-items-center tw-justify-center tw-bg-gray-200 tw-w-[0] tw-rounded-full hover:tw-bg-gray-400",
|
|
1694
1670
|
children: /* @__PURE__ */ t(
|
|
1695
|
-
|
|
1671
|
+
P,
|
|
1696
1672
|
{
|
|
1697
1673
|
icon: "circle_plus",
|
|
1698
1674
|
size: "xs",
|
|
@@ -1707,7 +1683,7 @@ const Se = async ({
|
|
|
1707
1683
|
{
|
|
1708
1684
|
className: "tw-text-xs tw-bg-primary-medium tw-rounded-md tw-py-s tw-px-m tw-text-primary-regular",
|
|
1709
1685
|
onClick: () => {
|
|
1710
|
-
|
|
1686
|
+
N({ repeats: F, id: a });
|
|
1711
1687
|
},
|
|
1712
1688
|
children: "Agregar"
|
|
1713
1689
|
}
|
|
@@ -1721,51 +1697,41 @@ const Se = async ({
|
|
|
1721
1697
|
onClick: () => C(!0),
|
|
1722
1698
|
className: "tw-flex tw-items-center tw-gap-2",
|
|
1723
1699
|
children: [
|
|
1724
|
-
/* @__PURE__ */ t(
|
|
1700
|
+
/* @__PURE__ */ t(P, { icon: "comment", size: "xs", strokeWidth: 4 }),
|
|
1725
1701
|
/* @__PURE__ */ t("span", { className: "tw-text-xl tw-font-regular tw-text-gray-400", children: i })
|
|
1726
1702
|
]
|
|
1727
1703
|
}
|
|
1728
1704
|
) })
|
|
1729
1705
|
] }),
|
|
1730
|
-
/* @__PURE__ */ t(
|
|
1706
|
+
/* @__PURE__ */ t(je, { taskId: a, isOpen: v, setIsOpen: C }),
|
|
1731
1707
|
/* @__PURE__ */ t(
|
|
1732
|
-
|
|
1708
|
+
De,
|
|
1733
1709
|
{
|
|
1734
1710
|
id: a,
|
|
1735
1711
|
task: e,
|
|
1736
|
-
isActive:
|
|
1737
|
-
closeModal: () =>
|
|
1712
|
+
isActive: T,
|
|
1713
|
+
closeModal: () => k(!1)
|
|
1738
1714
|
}
|
|
1739
1715
|
)
|
|
1740
1716
|
] });
|
|
1741
|
-
},
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
]
|
|
1747
|
-
|
|
1748
|
-
/* @__PURE__ */ t("div", { className: "tw-w-full tw-h-[30px] tw-bg-gray-300" }),
|
|
1749
|
-
/* @__PURE__ */ t("div", { className: "tw-w-full tw-h-[30px] tw-bg-gray-300" })
|
|
1750
|
-
] })
|
|
1751
|
-
] }), wt = ({ title: a, tasks: e, loadNextPage: l, isFetching: n, total: r }) => {
|
|
1752
|
-
const s = Y(null), i = Y(null), d = Y(!1);
|
|
1753
|
-
T(() => {
|
|
1754
|
-
var u;
|
|
1755
|
-
s != null && s.current && (i != null && i.current) && (i.current.style.minHeight = `${((u = s == null ? void 0 : s.current) == null ? void 0 : u.clientHeight) - 300}px`);
|
|
1756
|
-
}, [s == null ? void 0 : s.current]);
|
|
1757
|
-
const o = (u) => {
|
|
1717
|
+
}, wt = ({ title: a, tasks: e, loadNextPage: s, isFetching: n, total: r }) => {
|
|
1718
|
+
const l = Y(null), i = Y(null), d = Y(!1);
|
|
1719
|
+
q(() => {
|
|
1720
|
+
var m;
|
|
1721
|
+
l != null && l.current && (i != null && i.current) && (i.current.style.minHeight = `${((m = l == null ? void 0 : l.current) == null ? void 0 : m.clientHeight) - 300}px`);
|
|
1722
|
+
}, [l == null ? void 0 : l.current]);
|
|
1723
|
+
const o = (m) => {
|
|
1758
1724
|
if (d.current) return;
|
|
1759
|
-
const { scrollTop:
|
|
1760
|
-
|
|
1725
|
+
const { scrollTop: b, clientHeight: x, scrollHeight: u } = m == null ? void 0 : m.target, h = b / (u - x) * 100;
|
|
1726
|
+
h <= 95 || h >= 95 && (d.current = !0, s && s(), setTimeout(() => {
|
|
1761
1727
|
d.current = !1;
|
|
1762
1728
|
}, 200));
|
|
1763
1729
|
};
|
|
1764
1730
|
return /* @__PURE__ */ c(
|
|
1765
1731
|
"div",
|
|
1766
1732
|
{
|
|
1767
|
-
ref:
|
|
1768
|
-
className: `tw-flex tw-flex-col tw-bg-containers tw-w-fit tw-max-w-[400px] tw-min-w-[400px] tw-h-full tw-min-h-[100%] tw-
|
|
1733
|
+
ref: l,
|
|
1734
|
+
className: `tw-flex tw-flex-col tw-bg-containers tw-w-fit tw-max-w-[400px] tw-min-w-[400px] tw-h-full tw-min-h-[100%] tw-relative tw-p-[16px] tw-rounded-lg tw-overflow-hidden tw-border-t-4 ${{
|
|
1769
1735
|
"Por hacer": "tw-border-texts-placeholder",
|
|
1770
1736
|
Trabajando: "tw-border-primary-regular",
|
|
1771
1737
|
Completadas: "tw-border-success-regular"
|
|
@@ -1775,7 +1741,7 @@ const Se = async ({
|
|
|
1775
1741
|
/* @__PURE__ */ t("div", { className: "tw-flex tw-items-center tw-gap-[8px]", children: /* @__PURE__ */ t("p", { className: "tw-text-2xl", children: a }) }),
|
|
1776
1742
|
/* @__PURE__ */ t("div", { className: "tw-flex tw-items-center tw-gap-[8px]", children: /* @__PURE__ */ c("div", { className: "tw-flex tw-items-center tw-gap-[4px]", children: [
|
|
1777
1743
|
/* @__PURE__ */ t(
|
|
1778
|
-
|
|
1744
|
+
P,
|
|
1779
1745
|
{
|
|
1780
1746
|
icon: "group_files",
|
|
1781
1747
|
size: "xs",
|
|
@@ -1793,54 +1759,54 @@ const Se = async ({
|
|
|
1793
1759
|
className: "tw-flex tw-flex-col tw-gap-[12px] tw-overflow-y-auto tw-scrollbar-none tw-pt-4 tw-pb-[200px] tw-h-full",
|
|
1794
1760
|
onScroll: o,
|
|
1795
1761
|
children: [
|
|
1796
|
-
e == null ? void 0 : e.map((
|
|
1797
|
-
n ? /* @__PURE__ */ t(
|
|
1762
|
+
e == null ? void 0 : e.map((m) => /* @__PURE__ */ t(Me, { ...m }, m.id)),
|
|
1763
|
+
n ? /* @__PURE__ */ t(xe, {}) : /* @__PURE__ */ t("p", { className: "tw-text-center tw-text-gray-500 tw-text-2xl", children: "No hay más tareas por mostrar..." })
|
|
1798
1764
|
]
|
|
1799
1765
|
}
|
|
1800
1766
|
)
|
|
1801
1767
|
]
|
|
1802
1768
|
}
|
|
1803
1769
|
);
|
|
1804
|
-
},
|
|
1770
|
+
}, Ee = () => {
|
|
1805
1771
|
var r;
|
|
1806
|
-
const { defineFields: a } =
|
|
1807
|
-
|
|
1772
|
+
const { defineFields: a } = U(), { tasksProject: e } = st();
|
|
1773
|
+
q(() => {
|
|
1808
1774
|
(async () => {
|
|
1809
|
-
let i = [...
|
|
1775
|
+
let i = [...he];
|
|
1810
1776
|
a(i);
|
|
1811
1777
|
})();
|
|
1812
1778
|
}, []);
|
|
1813
|
-
let
|
|
1779
|
+
let s = (r = e == null ? void 0 : e.data) == null ? void 0 : r.filter((l) => {
|
|
1814
1780
|
var i;
|
|
1815
|
-
return ((i =
|
|
1816
|
-
}).reduce((
|
|
1817
|
-
return /* @__PURE__ */ t("div", { className: "tw-flex tw-gap-4 tw-w-full tw-h-full tw-min-h-[100%] tw-relative", children: ["Por hacer", "Trabajando", "Completadas"].map((
|
|
1781
|
+
return ((i = l == null ? void 0 : l.tasks) == null ? void 0 : i.length) === 0;
|
|
1782
|
+
}).reduce((l, i) => (l[i.status] = l[i.status] || [], l[i.status].push(i), l), {});
|
|
1783
|
+
return /* @__PURE__ */ t("div", { className: "tw-flex tw-gap-4 tw-w-full tw-h-full tw-min-h-[100%] tw-relative", children: ["Por hacer", "Trabajando", "Completadas"].map((l, i) => {
|
|
1818
1784
|
var d;
|
|
1819
1785
|
return /* @__PURE__ */ t(
|
|
1820
1786
|
wt,
|
|
1821
1787
|
{
|
|
1822
|
-
total: ((d =
|
|
1823
|
-
title:
|
|
1824
|
-
tasks: (
|
|
1788
|
+
total: ((d = s == null ? void 0 : s[i]) == null ? void 0 : d.length) ?? 0,
|
|
1789
|
+
title: l,
|
|
1790
|
+
tasks: (s == null ? void 0 : s[i]) ?? [],
|
|
1825
1791
|
isFetching: e == null ? void 0 : e.isFetching,
|
|
1826
1792
|
isLoadingData: e == null ? void 0 : e.isLoading
|
|
1827
1793
|
}
|
|
1828
1794
|
);
|
|
1829
1795
|
}) });
|
|
1830
1796
|
};
|
|
1831
|
-
class
|
|
1797
|
+
class $e {
|
|
1832
1798
|
static toKanbanTasks(e) {
|
|
1833
|
-
var n, r,
|
|
1834
|
-
let
|
|
1835
|
-
return e != null && e.responsable &&
|
|
1836
|
-
var _,
|
|
1837
|
-
|
|
1799
|
+
var n, r, l, i, d, o, g, m, b, x, u;
|
|
1800
|
+
let s = [];
|
|
1801
|
+
return e != null && e.responsable && s.push({ id: e.responsable.id, name: e.responsable.nombre, image: (d = (i = (l = (r = (n = e.responsable) == null ? void 0 : n.userOBP) == null ? void 0 : r.imagen) == null ? void 0 : l.formats) == null ? void 0 : i.thumbnail) == null ? void 0 : d.url }), (o = e == null ? void 0 : e.equipo) != null && o.miembros && e.equipo.miembros.forEach((h) => {
|
|
1802
|
+
var _, v, C, T;
|
|
1803
|
+
s != null && s.find((k) => k.id === h.idUser.id) || h.idUser && s.push({ id: h.idUser.id, name: h.idUser.nombre, image: (T = (C = (v = (_ = h == null ? void 0 : h.userOBP) == null ? void 0 : _.imagen) == null ? void 0 : v.formats) == null ? void 0 : C.thumbnail) == null ? void 0 : T.url });
|
|
1838
1804
|
}), {
|
|
1839
1805
|
repeats: e == null ? void 0 : e.repeticiones_realizadas,
|
|
1840
1806
|
repeatsToDo: e == null ? void 0 : e.repeticiones,
|
|
1841
1807
|
comments: 0,
|
|
1842
1808
|
nameProject: (g = e == null ? void 0 : e.proyecto) == null ? void 0 : g.nombre,
|
|
1843
|
-
idProject: (
|
|
1809
|
+
idProject: (m = e == null ? void 0 : e.proyecto) == null ? void 0 : m.id,
|
|
1844
1810
|
willBePaused: e.es_pausable,
|
|
1845
1811
|
difficulty: e.nivel_dificultad,
|
|
1846
1812
|
endDate: new Date(e.ffin),
|
|
@@ -1848,25 +1814,25 @@ class ze {
|
|
|
1848
1814
|
priority: e.prioridad ?? 0,
|
|
1849
1815
|
status: e.estatus,
|
|
1850
1816
|
task: e.texto_corto,
|
|
1851
|
-
users:
|
|
1852
|
-
responsible: ((
|
|
1853
|
-
statusRequiredTask: ((
|
|
1854
|
-
nameRequiredTask: ((
|
|
1817
|
+
users: s,
|
|
1818
|
+
responsible: ((b = e == null ? void 0 : e.responsable) == null ? void 0 : b.id) ?? null,
|
|
1819
|
+
statusRequiredTask: ((x = e.id_t_requerida) == null ? void 0 : x.estatus) ?? null,
|
|
1820
|
+
nameRequiredTask: ((u = e.id_t_requerida) == null ? void 0 : u.texto_corto) ?? null,
|
|
1855
1821
|
medioName: (e == null ? void 0 : e.nombre_medio) ?? null
|
|
1856
1822
|
};
|
|
1857
1823
|
}
|
|
1858
1824
|
}
|
|
1859
1825
|
const ft = async ({ filters: a, tasks_api: e }) => {
|
|
1860
1826
|
try {
|
|
1861
|
-
return (await e.get("/api/listado_tareas", { params: a })).data.tareas.map(G).map(
|
|
1862
|
-
} catch (
|
|
1863
|
-
throw console.log({ error:
|
|
1827
|
+
return (await e.get("/api/listado_tareas", { params: a })).data.tareas.map(G).map($e.toKanbanTasks);
|
|
1828
|
+
} catch (s) {
|
|
1829
|
+
throw console.log({ error: s }), `Error al obtener las tareas: ${s}`;
|
|
1864
1830
|
}
|
|
1865
1831
|
}, bt = (a) => {
|
|
1866
1832
|
var e;
|
|
1867
1833
|
if (a != null && a.hasNextPage) {
|
|
1868
|
-
const
|
|
1869
|
-
(
|
|
1834
|
+
const s = (e = a == null ? void 0 : a.data) == null ? void 0 : e.pages[a.data.pages.length - 1];
|
|
1835
|
+
(s == null ? void 0 : s.length) === 30 && (a == null || a.fetchNextPage());
|
|
1870
1836
|
}
|
|
1871
1837
|
}, J = (a) => ({
|
|
1872
1838
|
pagination: {
|
|
@@ -1874,47 +1840,47 @@ const ft = async ({ filters: a, tasks_api: e }) => {
|
|
|
1874
1840
|
pageSize: 30,
|
|
1875
1841
|
withCount: !0
|
|
1876
1842
|
}
|
|
1877
|
-
}),
|
|
1843
|
+
}), Be = () => {
|
|
1878
1844
|
var g;
|
|
1879
|
-
const a = et(), { tasks_api: e } =
|
|
1845
|
+
const a = et(), { tasks_api: e } = B(), { user: s } = X(), { filters: n } = U(), [r, l] = y(0), [i, d] = y({
|
|
1880
1846
|
owner: {
|
|
1881
|
-
user:
|
|
1847
|
+
user: s.id,
|
|
1882
1848
|
config: ((g = n == null ? void 0 : n.owner) == null ? void 0 : g.config) ?? "yo_y_mis_equipos"
|
|
1883
1849
|
},
|
|
1884
1850
|
status: "por_hacer"
|
|
1885
1851
|
}), o = ut({
|
|
1886
1852
|
initialPageParam: 1,
|
|
1887
1853
|
queryKey: ["to_do_tasks", i],
|
|
1888
|
-
queryFn: ({ pageParam:
|
|
1854
|
+
queryFn: ({ pageParam: m }) => ft({
|
|
1889
1855
|
filters: {
|
|
1890
1856
|
...i,
|
|
1891
1857
|
status: "por_hacer",
|
|
1892
|
-
...J(
|
|
1858
|
+
...J(m)
|
|
1893
1859
|
},
|
|
1894
1860
|
tasks_api: e,
|
|
1895
|
-
page:
|
|
1861
|
+
page: m
|
|
1896
1862
|
}),
|
|
1897
1863
|
staleTime: 1e3 * 60 * 60 * 24,
|
|
1898
1864
|
// mantains the data for 24 hours
|
|
1899
|
-
getNextPageParam: (
|
|
1865
|
+
getNextPageParam: (m, b) => b.length + 1
|
|
1900
1866
|
});
|
|
1901
|
-
return
|
|
1902
|
-
var
|
|
1867
|
+
return q(() => {
|
|
1868
|
+
var m;
|
|
1903
1869
|
Object.keys(n).length > 0 && d({
|
|
1904
1870
|
...n,
|
|
1905
1871
|
owner: {
|
|
1906
|
-
user:
|
|
1907
|
-
config: ((
|
|
1872
|
+
user: s.id,
|
|
1873
|
+
config: ((m = n == null ? void 0 : n.owner) == null ? void 0 : m.config) ?? "yo_y_mis_equipos"
|
|
1908
1874
|
},
|
|
1909
1875
|
status: "por_hacer"
|
|
1910
1876
|
});
|
|
1911
|
-
}, [n]),
|
|
1877
|
+
}, [n]), q(() => {
|
|
1912
1878
|
a.invalidateQueries({
|
|
1913
1879
|
queryKey: ["to_do_tasks", i]
|
|
1914
1880
|
});
|
|
1915
|
-
}, [i]),
|
|
1881
|
+
}, [i]), q(() => {
|
|
1916
1882
|
(async () => {
|
|
1917
|
-
const
|
|
1883
|
+
const b = await e.get("/api/listado_tareas", {
|
|
1918
1884
|
params: {
|
|
1919
1885
|
...i,
|
|
1920
1886
|
status: "por_hacer",
|
|
@@ -1923,58 +1889,58 @@ const ft = async ({ filters: a, tasks_api: e }) => {
|
|
|
1923
1889
|
justCount: !0
|
|
1924
1890
|
}
|
|
1925
1891
|
});
|
|
1926
|
-
|
|
1892
|
+
l(b.data.total);
|
|
1927
1893
|
})();
|
|
1928
1894
|
}, [i, o == null ? void 0 : o.data]), {
|
|
1929
1895
|
//Properties
|
|
1930
1896
|
toDoTasks: o,
|
|
1931
1897
|
total: r
|
|
1932
1898
|
};
|
|
1933
|
-
},
|
|
1899
|
+
}, ze = () => {
|
|
1934
1900
|
var n, r;
|
|
1935
|
-
const { toDoTasks: a, total: e } =
|
|
1936
|
-
return /* @__PURE__ */ t(wt, { total: e, title: "Por hacer", tasks:
|
|
1937
|
-
},
|
|
1901
|
+
const { toDoTasks: a, total: e } = Be(), s = [...((r = (n = a == null ? void 0 : a.data) == null ? void 0 : n.pages) == null ? void 0 : r.flat()) ?? []];
|
|
1902
|
+
return /* @__PURE__ */ t(wt, { total: e, title: "Por hacer", tasks: s, loadNextPage: () => bt(a), isFetching: a == null ? void 0 : a.isFetching, isLoadingData: a == null ? void 0 : a.isLoading });
|
|
1903
|
+
}, Le = () => {
|
|
1938
1904
|
var g;
|
|
1939
|
-
const a = et(), { tasks_api: e } =
|
|
1905
|
+
const a = et(), { tasks_api: e } = B(), { user: s } = X(), { filters: n } = U(), [r, l] = y(0), [i, d] = y({
|
|
1940
1906
|
owner: {
|
|
1941
|
-
user:
|
|
1907
|
+
user: s.id,
|
|
1942
1908
|
config: ((g = n == null ? void 0 : n.owner) == null ? void 0 : g.config) ?? "yo_y_mis_equipos"
|
|
1943
1909
|
},
|
|
1944
1910
|
status: "trabajando"
|
|
1945
1911
|
}), o = ut({
|
|
1946
1912
|
initialPageParam: 1,
|
|
1947
1913
|
queryKey: ["working_tasks", i],
|
|
1948
|
-
queryFn: ({ pageParam:
|
|
1914
|
+
queryFn: ({ pageParam: m }) => ft({
|
|
1949
1915
|
filters: {
|
|
1950
1916
|
...i,
|
|
1951
1917
|
status: "trabajando",
|
|
1952
|
-
...J(
|
|
1918
|
+
...J(m)
|
|
1953
1919
|
},
|
|
1954
1920
|
tasks_api: e,
|
|
1955
|
-
page:
|
|
1921
|
+
page: m
|
|
1956
1922
|
}),
|
|
1957
1923
|
staleTime: 1e3 * 60 * 60 * 24,
|
|
1958
1924
|
// mantains the data for 24 hours
|
|
1959
|
-
getNextPageParam: (
|
|
1925
|
+
getNextPageParam: (m, b) => b.length + 1
|
|
1960
1926
|
});
|
|
1961
|
-
return
|
|
1962
|
-
var
|
|
1927
|
+
return q(() => {
|
|
1928
|
+
var m;
|
|
1963
1929
|
Object.keys(n).length > 0 && d({
|
|
1964
1930
|
...n,
|
|
1965
1931
|
owner: {
|
|
1966
|
-
user:
|
|
1967
|
-
config: ((
|
|
1932
|
+
user: s.id,
|
|
1933
|
+
config: ((m = n == null ? void 0 : n.owner) == null ? void 0 : m.config) ?? "yo_y_mis_equipos"
|
|
1968
1934
|
},
|
|
1969
1935
|
status: "trabajando"
|
|
1970
1936
|
});
|
|
1971
|
-
}, [n]),
|
|
1937
|
+
}, [n]), q(() => {
|
|
1972
1938
|
a.invalidateQueries({
|
|
1973
1939
|
queryKey: ["working_tasks", i]
|
|
1974
1940
|
});
|
|
1975
|
-
}, [i]),
|
|
1941
|
+
}, [i]), q(() => {
|
|
1976
1942
|
(async () => {
|
|
1977
|
-
const
|
|
1943
|
+
const b = await e.get("/api/listado_tareas", {
|
|
1978
1944
|
params: {
|
|
1979
1945
|
...i,
|
|
1980
1946
|
status: "trabajando",
|
|
@@ -1983,29 +1949,29 @@ const ft = async ({ filters: a, tasks_api: e }) => {
|
|
|
1983
1949
|
justCount: !0
|
|
1984
1950
|
}
|
|
1985
1951
|
});
|
|
1986
|
-
|
|
1952
|
+
l(b.data.total);
|
|
1987
1953
|
})();
|
|
1988
1954
|
}, [i, o == null ? void 0 : o.data]), {
|
|
1989
1955
|
//Properties
|
|
1990
1956
|
workingTasks: o,
|
|
1991
1957
|
total: r
|
|
1992
1958
|
};
|
|
1993
|
-
},
|
|
1959
|
+
}, Re = () => {
|
|
1994
1960
|
var n, r;
|
|
1995
|
-
const { workingTasks: a, total: e } =
|
|
1961
|
+
const { workingTasks: a, total: e } = Le(), s = [...((r = (n = a == null ? void 0 : a.data) == null ? void 0 : n.pages) == null ? void 0 : r.flat()) ?? []];
|
|
1996
1962
|
return /* @__PURE__ */ t(
|
|
1997
1963
|
wt,
|
|
1998
1964
|
{
|
|
1999
1965
|
total: e,
|
|
2000
1966
|
title: "Trabajando",
|
|
2001
|
-
tasks:
|
|
1967
|
+
tasks: s,
|
|
2002
1968
|
loadNextPage: () => bt(a),
|
|
2003
1969
|
isFetching: a == null ? void 0 : a.isFetching
|
|
2004
1970
|
}
|
|
2005
1971
|
);
|
|
2006
|
-
},
|
|
1972
|
+
}, Ke = () => {
|
|
2007
1973
|
var g;
|
|
2008
|
-
const a = et(), { user: e } = X(), { tasks_api:
|
|
1974
|
+
const a = et(), { user: e } = X(), { tasks_api: s } = B(), { filters: n } = U(), [r, l] = y(0), [i, d] = y({
|
|
2009
1975
|
owner: {
|
|
2010
1976
|
user: e.id,
|
|
2011
1977
|
config: ((g = n == null ? void 0 : n.owner) == null ? void 0 : g.config) ?? "yo_y_mis_equipos"
|
|
@@ -2014,59 +1980,59 @@ const ft = async ({ filters: a, tasks_api: e }) => {
|
|
|
2014
1980
|
}), o = ut({
|
|
2015
1981
|
initialPageParam: 1,
|
|
2016
1982
|
queryKey: ["done_tasks", i],
|
|
2017
|
-
queryFn: ({ pageParam:
|
|
1983
|
+
queryFn: ({ pageParam: m }) => ft({
|
|
2018
1984
|
filters: {
|
|
2019
1985
|
...i,
|
|
2020
1986
|
status: "completadas",
|
|
2021
|
-
...J(
|
|
1987
|
+
...J(m)
|
|
2022
1988
|
},
|
|
2023
|
-
tasks_api:
|
|
2024
|
-
page:
|
|
1989
|
+
tasks_api: s,
|
|
1990
|
+
page: m
|
|
2025
1991
|
}),
|
|
2026
1992
|
staleTime: 1e3 * 60 * 60 * 24,
|
|
2027
1993
|
// mantains the data for 24 hours
|
|
2028
|
-
getNextPageParam: (
|
|
1994
|
+
getNextPageParam: (m, b) => b.length + 1
|
|
2029
1995
|
});
|
|
2030
|
-
return
|
|
2031
|
-
var
|
|
1996
|
+
return q(() => {
|
|
1997
|
+
var m;
|
|
2032
1998
|
Object.keys(n).length > 0 && d({
|
|
2033
1999
|
...n,
|
|
2034
2000
|
owner: {
|
|
2035
2001
|
user: e.id,
|
|
2036
|
-
config: ((
|
|
2002
|
+
config: ((m = n == null ? void 0 : n.owner) == null ? void 0 : m.config) ?? "yo_y_mis_equipos"
|
|
2037
2003
|
},
|
|
2038
2004
|
status: "completadas"
|
|
2039
2005
|
});
|
|
2040
|
-
}, [n]),
|
|
2006
|
+
}, [n]), q(() => {
|
|
2041
2007
|
a.invalidateQueries({
|
|
2042
2008
|
queryKey: ["done_tasks", i]
|
|
2043
2009
|
});
|
|
2044
|
-
}, [i]),
|
|
2010
|
+
}, [i]), q(() => {
|
|
2045
2011
|
(async () => {
|
|
2046
|
-
const
|
|
2012
|
+
const b = await s.get("/api/listado_tareas", {
|
|
2047
2013
|
params: {
|
|
2048
2014
|
...i,
|
|
2049
2015
|
status: "completadas",
|
|
2050
2016
|
...J(1),
|
|
2051
2017
|
justCount: !0,
|
|
2052
|
-
tasks_api:
|
|
2018
|
+
tasks_api: s
|
|
2053
2019
|
}
|
|
2054
2020
|
});
|
|
2055
|
-
|
|
2021
|
+
l(b.data.total);
|
|
2056
2022
|
})();
|
|
2057
2023
|
}, [o == null ? void 0 : o.data, i]), {
|
|
2058
2024
|
// Properties
|
|
2059
2025
|
doneTasks: o,
|
|
2060
2026
|
total: r
|
|
2061
2027
|
};
|
|
2062
|
-
},
|
|
2028
|
+
}, Ue = () => {
|
|
2063
2029
|
var n, r;
|
|
2064
|
-
const { doneTasks: a, total: e } =
|
|
2030
|
+
const { doneTasks: a, total: e } = Ke(), s = [...((r = (n = a == null ? void 0 : a.data) == null ? void 0 : n.pages) == null ? void 0 : r.flat()) ?? []];
|
|
2065
2031
|
return /* @__PURE__ */ t(
|
|
2066
2032
|
wt,
|
|
2067
2033
|
{
|
|
2068
2034
|
title: "Completadas",
|
|
2069
|
-
tasks:
|
|
2035
|
+
tasks: s,
|
|
2070
2036
|
loadNextPage: () => bt(a),
|
|
2071
2037
|
isFetching: a == null ? void 0 : a.isFetching,
|
|
2072
2038
|
total: e
|
|
@@ -2081,8 +2047,8 @@ class ot {
|
|
|
2081
2047
|
};
|
|
2082
2048
|
}
|
|
2083
2049
|
}
|
|
2084
|
-
const
|
|
2085
|
-
const { tasks_api: a } =
|
|
2050
|
+
const Ie = () => {
|
|
2051
|
+
const { tasks_api: a } = B(), { filters: e } = U(), { user: s } = X();
|
|
2086
2052
|
return {
|
|
2087
2053
|
//methods
|
|
2088
2054
|
getSalesmanAndProjects: async () => {
|
|
@@ -2093,7 +2059,7 @@ const We = () => {
|
|
|
2093
2059
|
params: {
|
|
2094
2060
|
...e,
|
|
2095
2061
|
owner: {
|
|
2096
|
-
user:
|
|
2062
|
+
user: s == null ? void 0 : s.id,
|
|
2097
2063
|
config: ((o = e == null ? void 0 : e.owner) == null ? void 0 : o.config) ?? "yo_y_mis_equipos"
|
|
2098
2064
|
},
|
|
2099
2065
|
justProjects: !0
|
|
@@ -2111,7 +2077,7 @@ const We = () => {
|
|
|
2111
2077
|
params: {
|
|
2112
2078
|
...e,
|
|
2113
2079
|
owner: {
|
|
2114
|
-
user:
|
|
2080
|
+
user: s.id,
|
|
2115
2081
|
config: ((d = e == null ? void 0 : e.owner) == null ? void 0 : d.config) ?? "yo_y_mis_equipos"
|
|
2116
2082
|
},
|
|
2117
2083
|
justProjects: !0
|
|
@@ -2120,7 +2086,7 @@ const We = () => {
|
|
|
2120
2086
|
},
|
|
2121
2087
|
getSalesmans: async () => (await a.get("/api/obtener-comerciales")).data.map(ot.toSalesmanUsers)
|
|
2122
2088
|
};
|
|
2123
|
-
},
|
|
2089
|
+
}, Oe = [
|
|
2124
2090
|
{
|
|
2125
2091
|
label: "Tipo de dependencia",
|
|
2126
2092
|
type: "select",
|
|
@@ -2189,7 +2155,7 @@ const We = () => {
|
|
|
2189
2155
|
}
|
|
2190
2156
|
]
|
|
2191
2157
|
}
|
|
2192
|
-
],
|
|
2158
|
+
], kt = [
|
|
2193
2159
|
{
|
|
2194
2160
|
label: "Responsable",
|
|
2195
2161
|
type: "select",
|
|
@@ -2206,35 +2172,35 @@ const We = () => {
|
|
|
2206
2172
|
id: "ejecutivo",
|
|
2207
2173
|
options: []
|
|
2208
2174
|
}
|
|
2209
|
-
],
|
|
2210
|
-
const { defineFields: a } =
|
|
2211
|
-
return
|
|
2175
|
+
], We = () => {
|
|
2176
|
+
const { defineFields: a } = U(), { getSalesmanAndProjects: e } = Ie();
|
|
2177
|
+
return q(() => {
|
|
2212
2178
|
(async () => {
|
|
2213
|
-
let n = [...
|
|
2179
|
+
let n = [...Oe], { salesmanUsers: r, projects: l } = await e();
|
|
2214
2180
|
a(
|
|
2215
|
-
n.map((i) => (i.id === "project.id" && (i.options =
|
|
2181
|
+
n.map((i) => (i.id === "project.id" && (i.options = l), i.id === "salesman.id" && (i.options = r), i))
|
|
2216
2182
|
);
|
|
2217
2183
|
})();
|
|
2218
2184
|
}, []), /* @__PURE__ */ c("div", { className: "tw-flex tw-gap-4 tw-w-full tw-h-full tw-min-h-[100%] tw-relative", children: [
|
|
2185
|
+
/* @__PURE__ */ t(ze, {}),
|
|
2219
2186
|
/* @__PURE__ */ t(Re, {}),
|
|
2220
|
-
/* @__PURE__ */ t(Ue, {})
|
|
2221
|
-
/* @__PURE__ */ t(Oe, {})
|
|
2187
|
+
/* @__PURE__ */ t(Ue, {})
|
|
2222
2188
|
] });
|
|
2223
|
-
},
|
|
2224
|
-
const [e,
|
|
2225
|
-
|
|
2189
|
+
}, Ut = at({}), Qe = ({ children: a }) => {
|
|
2190
|
+
const [e, s] = y([]);
|
|
2191
|
+
q(() => {
|
|
2226
2192
|
console.log({ selectedTasks: e });
|
|
2227
2193
|
}, [e]);
|
|
2228
2194
|
const n = (r) => {
|
|
2229
|
-
|
|
2195
|
+
s((l) => l.includes(r) ? l.filter((i) => i !== r) : [...l, r]);
|
|
2230
2196
|
};
|
|
2231
|
-
return /* @__PURE__ */ t(
|
|
2197
|
+
return /* @__PURE__ */ t(Ut.Provider, { value: {
|
|
2232
2198
|
//properties
|
|
2233
2199
|
selectedTasks: e,
|
|
2234
2200
|
//methods
|
|
2235
2201
|
selectTask: n
|
|
2236
2202
|
}, children: a });
|
|
2237
|
-
},
|
|
2203
|
+
}, He = () => rt(Ut), It = () => {
|
|
2238
2204
|
const a = () => /* @__PURE__ */ c("div", { className: "tw-w-full tw-flex tw-gap-m", children: [
|
|
2239
2205
|
/* @__PURE__ */ t("div", { className: "tw-w-[30px] tw-h-[30px] tw-min-w-[30px] tw-min-h-[30px] tw-bg-gray-200 tw-rounded-full tw-animate-pulse" }),
|
|
2240
2206
|
/* @__PURE__ */ t("div", { className: "tw-w-[30%] tw-h-[30px] tw-bg-gray-200 tw-rounded-md tw-animate-pulse" }),
|
|
@@ -2259,26 +2225,26 @@ const We = () => {
|
|
|
2259
2225
|
/* @__PURE__ */ t("div", { className: "tw-pl-5", children: /* @__PURE__ */ t(a, {}) })
|
|
2260
2226
|
] })
|
|
2261
2227
|
] });
|
|
2262
|
-
},
|
|
2228
|
+
}, Ot = ({ startDate: a, endDate: e }) => /* @__PURE__ */ c($, { children: [
|
|
2263
2229
|
/* @__PURE__ */ c("div", { className: "tw-gap-s tw-bg-gray-100 tw-rounded-md tw-h-[30px] tw-w-fit tw-flex tw-justify-center tw-items-center tw-px-xxxl", children: [
|
|
2264
|
-
/* @__PURE__ */ t(
|
|
2230
|
+
/* @__PURE__ */ t(P, { icon: "calendar", size: "xs", strokeWidth: 4, color: p.texts.subtext }),
|
|
2265
2231
|
/* @__PURE__ */ c("p", { className: "tw-text-lg", children: [
|
|
2266
2232
|
" ",
|
|
2267
2233
|
jt(a)
|
|
2268
2234
|
] })
|
|
2269
2235
|
] }),
|
|
2270
|
-
/* @__PURE__ */ t(
|
|
2236
|
+
/* @__PURE__ */ t(P, { icon: "arrow_right", size: "xs", strokeWidth: 4, color: p.texts.DEFAULT }),
|
|
2271
2237
|
/* @__PURE__ */ c("div", { className: "tw-gap-s tw-bg-gray-100 tw-rounded-md tw-h-[30px] tw-w-fit tw-flex tw-justify-center tw-items-center tw-px-xxxl", children: [
|
|
2272
|
-
/* @__PURE__ */ t(
|
|
2238
|
+
/* @__PURE__ */ t(P, { icon: "calendar", size: "xs", strokeWidth: 4, color: p.texts.subtext }),
|
|
2273
2239
|
/* @__PURE__ */ c("p", { className: "tw-text-lg", children: [
|
|
2274
2240
|
" ",
|
|
2275
2241
|
jt(e)
|
|
2276
2242
|
] })
|
|
2277
2243
|
] })
|
|
2278
|
-
] }),
|
|
2244
|
+
] }), Ye = ({ id: a }) => /* @__PURE__ */ t($, { children: /* @__PURE__ */ t("button", { onClick: () => alert("pausar tarea " + a), children: /* @__PURE__ */ t(P, { icon: "pause", size: "xs", strokeWidth: 4, color: p.texts.subtext }) }) }), Wt = ({
|
|
2279
2245
|
id: a,
|
|
2280
2246
|
priority: e,
|
|
2281
|
-
difficulty:
|
|
2247
|
+
difficulty: s,
|
|
2282
2248
|
endDate: n
|
|
2283
2249
|
}) => {
|
|
2284
2250
|
var i, d;
|
|
@@ -2303,7 +2269,7 @@ const We = () => {
|
|
|
2303
2269
|
color: p.danger.regular,
|
|
2304
2270
|
bg: "tw-bg-danger-light tw-border-danger-regular"
|
|
2305
2271
|
}
|
|
2306
|
-
},
|
|
2272
|
+
}, l = {
|
|
2307
2273
|
0: {
|
|
2308
2274
|
title: "Muy fácil",
|
|
2309
2275
|
color: p.success.dark,
|
|
@@ -2330,12 +2296,12 @@ const We = () => {
|
|
|
2330
2296
|
bg: "tw-bg-danger-light tw-border-danger-regular"
|
|
2331
2297
|
}
|
|
2332
2298
|
};
|
|
2333
|
-
return /* @__PURE__ */ c(
|
|
2299
|
+
return /* @__PURE__ */ c($, { children: [
|
|
2334
2300
|
/* @__PURE__ */ t("button", { className: "tw-gap-s tw-bg-gray-100 tw-rounded-md tw-h-[30px] tw-w-[30px] tw-flex tw-justify-center tw-items-center hover:tw-bg-gray-200", children: /* @__PURE__ */ t(
|
|
2335
|
-
|
|
2301
|
+
K,
|
|
2336
2302
|
{
|
|
2337
2303
|
dispatch: /* @__PURE__ */ t(
|
|
2338
|
-
|
|
2304
|
+
P,
|
|
2339
2305
|
{
|
|
2340
2306
|
icon: "align_center",
|
|
2341
2307
|
size: "xs",
|
|
@@ -2357,16 +2323,16 @@ const We = () => {
|
|
|
2357
2323
|
/* @__PURE__ */ t(
|
|
2358
2324
|
"div",
|
|
2359
2325
|
{
|
|
2360
|
-
className: `tw-gap-s ${((i = s
|
|
2326
|
+
className: `tw-gap-s ${((i = l[s ?? 0]) == null ? void 0 : i.bg.replace(/\bbg-|border-/g, "tw-$&")) ?? "tw-bg-gray-100"} tw-border tw-rounded-md tw-h-[30px] tw-w-[30px] tw-flex tw-justify-center tw-items-center`,
|
|
2361
2327
|
children: /* @__PURE__ */ t(
|
|
2362
|
-
|
|
2328
|
+
K,
|
|
2363
2329
|
{
|
|
2364
2330
|
dispatch: /* @__PURE__ */ t(
|
|
2365
|
-
|
|
2331
|
+
P,
|
|
2366
2332
|
{
|
|
2367
2333
|
icon: "difficulty",
|
|
2368
2334
|
size: "xs",
|
|
2369
|
-
color: s
|
|
2335
|
+
color: l[s ?? 0].color,
|
|
2370
2336
|
strokeWidth: 4
|
|
2371
2337
|
}
|
|
2372
2338
|
),
|
|
@@ -2374,8 +2340,8 @@ const We = () => {
|
|
|
2374
2340
|
"p",
|
|
2375
2341
|
{
|
|
2376
2342
|
className: "tw-text-sm tw-font-regular tw-p-5 tw-bg-bg-card tw-rounded-lg",
|
|
2377
|
-
style: { color: s
|
|
2378
|
-
children: s
|
|
2343
|
+
style: { color: l[s ?? 0].color },
|
|
2344
|
+
children: l[s ?? 0].title
|
|
2379
2345
|
}
|
|
2380
2346
|
)
|
|
2381
2347
|
}
|
|
@@ -2387,10 +2353,10 @@ const We = () => {
|
|
|
2387
2353
|
{
|
|
2388
2354
|
className: `tw-gap-s ${((d = r[e ?? 0]) == null ? void 0 : d.bg.replace(/\bbg-|border-/g, "tw-$&")) ?? "tw-bg-gray-100"} tw-border tw-rounded-md tw-h-[30px] tw-w-[30px] tw-flex tw-justify-center tw-items-center`,
|
|
2389
2355
|
children: /* @__PURE__ */ t(
|
|
2390
|
-
|
|
2356
|
+
K,
|
|
2391
2357
|
{
|
|
2392
2358
|
dispatch: /* @__PURE__ */ t(
|
|
2393
|
-
|
|
2359
|
+
P,
|
|
2394
2360
|
{
|
|
2395
2361
|
icon: "flag",
|
|
2396
2362
|
size: "xs",
|
|
@@ -2410,13 +2376,13 @@ const We = () => {
|
|
|
2410
2376
|
)
|
|
2411
2377
|
}
|
|
2412
2378
|
),
|
|
2413
|
-
/* @__PURE__ */ t(
|
|
2379
|
+
/* @__PURE__ */ t(P, { icon: "calendar", size: "xs", strokeWidth: 3, color: p.texts.subtext }),
|
|
2414
2380
|
/* @__PURE__ */ t("p", { className: "tw-text-xl tw-font-regular tw-text-texts-subtext", children: `${n.getDate()} ${ht(n.getMonth()).slice(0, 3)}` })
|
|
2415
2381
|
] })
|
|
2416
2382
|
] });
|
|
2417
|
-
},
|
|
2418
|
-
const { selectedTasks: e, selectTask:
|
|
2419
|
-
return /* @__PURE__ */ c(
|
|
2383
|
+
}, Ge = ({ id: a }) => {
|
|
2384
|
+
const { selectedTasks: e, selectTask: s } = He();
|
|
2385
|
+
return /* @__PURE__ */ c($, { children: [
|
|
2420
2386
|
/* @__PURE__ */ t(
|
|
2421
2387
|
"label",
|
|
2422
2388
|
{
|
|
@@ -2427,7 +2393,7 @@ const We = () => {
|
|
|
2427
2393
|
{
|
|
2428
2394
|
className: `${e.includes(a) ? "tw-opacity-100" : "tw-opacity-0"} tw-transition-opacity tw-duration-500`,
|
|
2429
2395
|
children: /* @__PURE__ */ t(
|
|
2430
|
-
|
|
2396
|
+
P,
|
|
2431
2397
|
{
|
|
2432
2398
|
icon: "check_outline",
|
|
2433
2399
|
size: "xs",
|
|
@@ -2445,23 +2411,23 @@ const We = () => {
|
|
|
2445
2411
|
className: "tw-hidden",
|
|
2446
2412
|
id: a.toString(),
|
|
2447
2413
|
type: "checkbox",
|
|
2448
|
-
onChange: () =>
|
|
2414
|
+
onChange: () => s(a)
|
|
2449
2415
|
}
|
|
2450
2416
|
)
|
|
2451
2417
|
] });
|
|
2452
|
-
},
|
|
2453
|
-
|
|
2418
|
+
}, Qt = ({ task: a }) => /* @__PURE__ */ t(
|
|
2419
|
+
K,
|
|
2454
2420
|
{
|
|
2455
2421
|
dispatch: /* @__PURE__ */ t("p", { className: "tw-text-xl tw-text-texts-subtext tw-max-w-[400px] tw-truncate", children: a }),
|
|
2456
2422
|
children: /* @__PURE__ */ t("p", { className: "tw-text-xl tw-text-texts-subtext tw-p-2 tw-max-w-[400px]", children: a })
|
|
2457
2423
|
}
|
|
2458
|
-
),
|
|
2459
|
-
var
|
|
2460
|
-
const { tasksProject: e } =
|
|
2424
|
+
), Xe = ({ id: a }) => {
|
|
2425
|
+
var l, i;
|
|
2426
|
+
const { tasksProject: e } = st(), { reasignResponsible: s } = lt(), { getOBPUrlApi: n } = B(), r = (l = e == null ? void 0 : e.data) == null ? void 0 : l.find((d) => d.id === a);
|
|
2461
2427
|
return /* @__PURE__ */ t("div", { className: "tw-border-b tw-border-gray-200 tw-pb-3", children: /* @__PURE__ */ c("div", { className: "tw-ml-[30px] tw-mb-3 tw-mt-1 tw-p-2 tw-flex tw-flex-wrap tw-items-center tw-gap-xl tw-rounded-md hover:tw-bg-gray-100", children: [
|
|
2462
|
-
!(r != null && r.nameRequiredTask) || (r == null ? void 0 : r.nameRequiredTask) !== "" && (r == null ? void 0 : r.statusRequiredTask) === 2 && /* @__PURE__ */ t(
|
|
2428
|
+
!(r != null && r.nameRequiredTask) || (r == null ? void 0 : r.nameRequiredTask) !== "" && (r == null ? void 0 : r.statusRequiredTask) === 2 && /* @__PURE__ */ t(Ge, { id: a }),
|
|
2463
2429
|
/* @__PURE__ */ t(
|
|
2464
|
-
|
|
2430
|
+
Lt,
|
|
2465
2431
|
{
|
|
2466
2432
|
id: a,
|
|
2467
2433
|
nameRequiredTask: (r == null ? void 0 : r.nameRequiredTask) ?? "",
|
|
@@ -2470,13 +2436,13 @@ const We = () => {
|
|
|
2470
2436
|
},
|
|
2471
2437
|
a
|
|
2472
2438
|
),
|
|
2473
|
-
(r == null ? void 0 : r.willBePaused) && /* @__PURE__ */ t(
|
|
2439
|
+
(r == null ? void 0 : r.willBePaused) && /* @__PURE__ */ t(Ye, { id: a }),
|
|
2474
2440
|
/* @__PURE__ */ t(
|
|
2475
|
-
|
|
2441
|
+
Rt,
|
|
2476
2442
|
{
|
|
2477
2443
|
onClick: async (d, o) => {
|
|
2478
2444
|
var g;
|
|
2479
|
-
await
|
|
2445
|
+
await s({
|
|
2480
2446
|
idNewResponsible: (g = d == null ? void 0 : d.tasksUser) == null ? void 0 : g.id,
|
|
2481
2447
|
id: a,
|
|
2482
2448
|
typeOfSelect: o
|
|
@@ -2486,9 +2452,9 @@ const We = () => {
|
|
|
2486
2452
|
users: ((i = r == null ? void 0 : r.users) == null ? void 0 : i.map((d) => xt(d, n()))) ?? []
|
|
2487
2453
|
}
|
|
2488
2454
|
),
|
|
2489
|
-
/* @__PURE__ */ t(
|
|
2455
|
+
/* @__PURE__ */ t(Qt, { task: (r == null ? void 0 : r.task) ?? "" }),
|
|
2490
2456
|
/* @__PURE__ */ t(
|
|
2491
|
-
|
|
2457
|
+
Wt,
|
|
2492
2458
|
{
|
|
2493
2459
|
id: a,
|
|
2494
2460
|
priority: r == null ? void 0 : r.priority,
|
|
@@ -2496,9 +2462,9 @@ const We = () => {
|
|
|
2496
2462
|
endDate: r == null ? void 0 : r.endDate
|
|
2497
2463
|
}
|
|
2498
2464
|
),
|
|
2499
|
-
/* @__PURE__ */ t(
|
|
2465
|
+
/* @__PURE__ */ t(Ot, { startDate: r == null ? void 0 : r.startDate, endDate: r == null ? void 0 : r.endDate }),
|
|
2500
2466
|
/* @__PURE__ */ t(
|
|
2501
|
-
|
|
2467
|
+
Kt,
|
|
2502
2468
|
{
|
|
2503
2469
|
id: a,
|
|
2504
2470
|
nameRequiredTask: r.nameRequiredTask,
|
|
@@ -2507,23 +2473,23 @@ const We = () => {
|
|
|
2507
2473
|
}
|
|
2508
2474
|
)
|
|
2509
2475
|
] }) });
|
|
2510
|
-
},
|
|
2511
|
-
var
|
|
2512
|
-
const { tasksProject: e, openTasks:
|
|
2476
|
+
}, Ht = ({ id: a }) => {
|
|
2477
|
+
var l, i, d, o, g, m, b;
|
|
2478
|
+
const { tasksProject: e, openTasks: s, openTask: n } = st(), r = (l = e == null ? void 0 : e.data) == null ? void 0 : l.find((x) => x.id === a);
|
|
2513
2479
|
return r ? /* @__PURE__ */ c("div", { className: "tw-flex tw-flex-col tw-gap-m tw-mb-2 tw-overflow-y-auto", children: [
|
|
2514
2480
|
/* @__PURE__ */ c("div", { className: "tw-flex tw-items-center tw-gap-m tw-flex-wrap hover:tw-bg-gray-100 tw-p-2 tw-rounded-md", children: [
|
|
2515
2481
|
/* @__PURE__ */ t(
|
|
2516
2482
|
"button",
|
|
2517
2483
|
{
|
|
2518
|
-
className: `${
|
|
2484
|
+
className: `${s.includes(a) ? "" : "tw--rotate-90"} tw-transition-all tw-duration-300`,
|
|
2519
2485
|
onClick: () => n(a),
|
|
2520
|
-
children: /* @__PURE__ */ t(
|
|
2486
|
+
children: /* @__PURE__ */ t(P, { icon: "angle_down_outline", color: p.texts.subtext })
|
|
2521
2487
|
}
|
|
2522
2488
|
),
|
|
2523
2489
|
/* @__PURE__ */ t("div", { className: "tw-flex tw-items-center tw-justify-center tw-min-w-[28px] tw-min-h-[28px] tw-w-fit tw-h-[28px] tw-mx-1 tw-bg-primary-medium tw-rounded-full", children: /* @__PURE__ */ t("p", { className: "tw-text-xl tw-text-primary", children: ((i = r == null ? void 0 : r.tasks) == null ? void 0 : i.length) === 0 ? 1 : (d = r == null ? void 0 : r.tasks) == null ? void 0 : d.length }) }),
|
|
2524
|
-
/* @__PURE__ */ t(
|
|
2490
|
+
/* @__PURE__ */ t(Qt, { task: (r == null ? void 0 : r.task) ?? "" }),
|
|
2525
2491
|
/* @__PURE__ */ t(
|
|
2526
|
-
|
|
2492
|
+
Wt,
|
|
2527
2493
|
{
|
|
2528
2494
|
id: a,
|
|
2529
2495
|
priority: r == null ? void 0 : r.priority,
|
|
@@ -2531,88 +2497,88 @@ const We = () => {
|
|
|
2531
2497
|
endDate: r == null ? void 0 : r.endDate
|
|
2532
2498
|
}
|
|
2533
2499
|
),
|
|
2534
|
-
/* @__PURE__ */ t(
|
|
2500
|
+
/* @__PURE__ */ t(Ot, { startDate: r == null ? void 0 : r.startDate, endDate: r == null ? void 0 : r.endDate }),
|
|
2535
2501
|
/* @__PURE__ */ c("button", { className: "tw-gap-s tw-bg-gray-100 tw-rounded-md tw-h-[30px] tw-flex tw-justify-center tw-items-center tw-w-fit tw-px-m hover:tw-bg-gray-200", children: [
|
|
2536
|
-
/* @__PURE__ */ t(
|
|
2502
|
+
/* @__PURE__ */ t(P, { icon: "subtasks", size: "xs", strokeWidth: 5, color: p.texts.subtext }),
|
|
2537
2503
|
/* @__PURE__ */ t("p", { className: "tw-text-xl", children: ((o = r == null ? void 0 : r.tasks) == null ? void 0 : o.length) === 0 ? 1 : (g = r == null ? void 0 : r.tasks) == null ? void 0 : g.length })
|
|
2538
2504
|
] })
|
|
2539
2505
|
] }),
|
|
2540
|
-
|
|
2506
|
+
s.includes(a) && /* @__PURE__ */ t("div", { className: "tw-ml-[30px]", children: ((m = r == null ? void 0 : r.tasks) == null ? void 0 : m.length) > 0 ? (b = r == null ? void 0 : r.tasks) == null ? void 0 : b.map((x) => /* @__PURE__ */ t(Ht, { id: x == null ? void 0 : x.id })) : /* @__PURE__ */ t(Xe, { id: r == null ? void 0 : r.id }) })
|
|
2541
2507
|
] }) : null;
|
|
2542
|
-
},
|
|
2508
|
+
}, Ze = () => {
|
|
2543
2509
|
var n;
|
|
2544
|
-
const { tasksProject: a, projectID: e } =
|
|
2545
|
-
if (a != null && a.isFetching || a != null && a.isLoading) return /* @__PURE__ */ t(
|
|
2546
|
-
let
|
|
2547
|
-
return /* @__PURE__ */ t("div", { className: "tw-flex tw-flex-col tw-gap-m", children: /* @__PURE__ */ t(
|
|
2548
|
-
},
|
|
2510
|
+
const { tasksProject: a, projectID: e } = st();
|
|
2511
|
+
if (a != null && a.isFetching || a != null && a.isLoading) return /* @__PURE__ */ t(It, {});
|
|
2512
|
+
let s = [...(n = a == null ? void 0 : a.data) == null ? void 0 : n.filter((r) => r.isPrincipalTask)];
|
|
2513
|
+
return /* @__PURE__ */ t("div", { className: "tw-flex tw-flex-col tw-gap-m", children: /* @__PURE__ */ t(Qe, { project: e, children: s == null ? void 0 : s.sort((r, l) => r.orden - l.orden).map((r) => /* @__PURE__ */ t("div", { className: "tw-flex tw-flex-col tw-gap-m tw-border-b tw-border-gray-200 tw-pb-m ", children: /* @__PURE__ */ t(Ht, { id: r.id }) })) }) });
|
|
2514
|
+
}, Je = ({
|
|
2549
2515
|
setPath: a,
|
|
2550
2516
|
setProject: e
|
|
2551
2517
|
}) => {
|
|
2552
|
-
const [
|
|
2553
|
-
var
|
|
2518
|
+
const [s, n] = y([]), [r, l] = y(!0), [i, d] = y(0), [o, g] = y(10), [m, b] = y(0), [x, u] = y("nombre"), { filters: h, defineFields: _ } = U(), { tasks_api: v, getImageOBP: C } = B(), { user: T } = X(), k = async (w, A) => {
|
|
2519
|
+
var M, S, I;
|
|
2554
2520
|
try {
|
|
2555
|
-
|
|
2556
|
-
const
|
|
2521
|
+
l(!0);
|
|
2522
|
+
const D = {
|
|
2557
2523
|
filters: {
|
|
2558
|
-
search: (
|
|
2524
|
+
search: (h == null ? void 0 : h.search) ?? "",
|
|
2559
2525
|
responsable: {
|
|
2560
|
-
idUser:
|
|
2561
|
-
responsableType: (
|
|
2526
|
+
idUser: T.id,
|
|
2527
|
+
responsableType: (M = h == null ? void 0 : h.responsable) == null ? void 0 : M.responsableType
|
|
2562
2528
|
},
|
|
2563
|
-
ejecutivo: (
|
|
2529
|
+
ejecutivo: (h == null ? void 0 : h.ejecutivo) ?? ""
|
|
2564
2530
|
}
|
|
2565
|
-
},
|
|
2531
|
+
}, E = await v.get("/api/listado_campanias", {
|
|
2566
2532
|
params: {
|
|
2567
2533
|
pagination: {
|
|
2568
2534
|
page: w,
|
|
2569
2535
|
pageSize: A
|
|
2570
2536
|
},
|
|
2571
|
-
orderBy:
|
|
2572
|
-
...
|
|
2537
|
+
orderBy: x,
|
|
2538
|
+
...D
|
|
2573
2539
|
}
|
|
2574
|
-
}),
|
|
2575
|
-
n(
|
|
2576
|
-
} catch (
|
|
2577
|
-
console.error("Error fetching data en Lista Campaña:",
|
|
2540
|
+
}), O = G(E == null ? void 0 : E.data);
|
|
2541
|
+
n(O), b((I = (S = E == null ? void 0 : E.data) == null ? void 0 : S.meta) == null ? void 0 : I.total);
|
|
2542
|
+
} catch (D) {
|
|
2543
|
+
console.error("Error fetching data en Lista Campaña:", D);
|
|
2578
2544
|
} finally {
|
|
2579
|
-
|
|
2545
|
+
l(!1);
|
|
2580
2546
|
}
|
|
2581
2547
|
}, f = async () => {
|
|
2582
2548
|
try {
|
|
2583
|
-
const w = await
|
|
2584
|
-
return [...
|
|
2585
|
-
id:
|
|
2586
|
-
name:
|
|
2587
|
-
}))),
|
|
2549
|
+
const w = await v.get("/api/obtener-comerciales");
|
|
2550
|
+
return [...kt].map((M) => (M.id === "ejecutivo" && (M.options = w.data.map((S) => ({
|
|
2551
|
+
id: S.nombre,
|
|
2552
|
+
name: S.nombre
|
|
2553
|
+
}))), M));
|
|
2588
2554
|
} catch (w) {
|
|
2589
|
-
return console.error("Error fetching salesman data:", w), [...
|
|
2555
|
+
return console.error("Error fetching salesman data:", w), [...kt];
|
|
2590
2556
|
}
|
|
2591
2557
|
};
|
|
2592
|
-
|
|
2558
|
+
q(() => {
|
|
2593
2559
|
(async () => {
|
|
2594
2560
|
const A = await f();
|
|
2595
2561
|
_(A);
|
|
2596
2562
|
})();
|
|
2597
|
-
}, []),
|
|
2563
|
+
}, []), q(() => {
|
|
2598
2564
|
const w = Math.floor(i / o) + 1;
|
|
2599
|
-
|
|
2600
|
-
}, [i, o,
|
|
2601
|
-
const
|
|
2565
|
+
k(w, o);
|
|
2566
|
+
}, [i, o, x, h]);
|
|
2567
|
+
const N = (w) => {
|
|
2602
2568
|
d(w.first), g(w.rows);
|
|
2603
|
-
},
|
|
2569
|
+
}, j = [
|
|
2604
2570
|
{ label: "5 filas", value: 5 },
|
|
2605
2571
|
{ label: "10 filas", value: 10 },
|
|
2606
2572
|
{ label: "15 filas", value: 15 },
|
|
2607
2573
|
{ label: "20 filas", value: 20 },
|
|
2608
2574
|
{ label: "25 filas", value: 25 },
|
|
2609
2575
|
{ label: "50 filas", value: 50 }
|
|
2610
|
-
],
|
|
2576
|
+
], F = (w) => {
|
|
2611
2577
|
const A = parseInt(w.target.value, 10);
|
|
2612
|
-
g(A),
|
|
2613
|
-
},
|
|
2614
|
-
|
|
2615
|
-
},
|
|
2578
|
+
g(A), N({ first: 0, rows: A });
|
|
2579
|
+
}, z = (w) => {
|
|
2580
|
+
u((A) => A === w ? `${w}:desc` : w);
|
|
2581
|
+
}, L = (w) => x === w ? "↑↓" : x === `${w}:desc` ? "↓↑" : "↑↓", R = (w) => ({
|
|
2616
2582
|
padding: "auto",
|
|
2617
2583
|
backgroundColor: p.silver.silver_light,
|
|
2618
2584
|
borderRadius: "50%",
|
|
@@ -2634,11 +2600,11 @@ const We = () => {
|
|
|
2634
2600
|
className: "tw-w-full tw-p-4 tw-rounded-lg tw-shadow-md",
|
|
2635
2601
|
style: {
|
|
2636
2602
|
background: p.bg.content,
|
|
2637
|
-
height: "calc(100vh - 200px)",
|
|
2638
2603
|
display: "flex",
|
|
2639
|
-
flexDirection: "column"
|
|
2604
|
+
flexDirection: "column",
|
|
2605
|
+
height: "100%"
|
|
2640
2606
|
},
|
|
2641
|
-
children: r ? /* @__PURE__ */ t("div", { className: "tw-w-full", children: /* @__PURE__ */ t(
|
|
2607
|
+
children: r ? /* @__PURE__ */ t("div", { className: "tw-w-full", children: /* @__PURE__ */ t(It, {}) }) : /* @__PURE__ */ t($, { children: /* @__PURE__ */ c("div", { className: "tw-flex tw-flex-col tw-h-full", children: [
|
|
2642
2608
|
/* @__PURE__ */ t("div", { className: "tw-flex-1 tw-overflow-auto", children: /* @__PURE__ */ c(
|
|
2643
2609
|
"table",
|
|
2644
2610
|
{
|
|
@@ -2659,7 +2625,7 @@ const We = () => {
|
|
|
2659
2625
|
/* @__PURE__ */ t(
|
|
2660
2626
|
"th",
|
|
2661
2627
|
{
|
|
2662
|
-
onClick: () =>
|
|
2628
|
+
onClick: () => z("nombre"),
|
|
2663
2629
|
style: {
|
|
2664
2630
|
color: p.gray.gray_dark,
|
|
2665
2631
|
textAlign: "left"
|
|
@@ -2672,7 +2638,7 @@ const We = () => {
|
|
|
2672
2638
|
style: {
|
|
2673
2639
|
color: p.gray.gray_dark
|
|
2674
2640
|
},
|
|
2675
|
-
children:
|
|
2641
|
+
children: L("nombre")
|
|
2676
2642
|
}
|
|
2677
2643
|
),
|
|
2678
2644
|
"Campaña"
|
|
@@ -2682,7 +2648,7 @@ const We = () => {
|
|
|
2682
2648
|
/* @__PURE__ */ t(
|
|
2683
2649
|
"th",
|
|
2684
2650
|
{
|
|
2685
|
-
onClick: () =>
|
|
2651
|
+
onClick: () => z("inicia"),
|
|
2686
2652
|
className: "tw-whitespace-nowrap",
|
|
2687
2653
|
style: {
|
|
2688
2654
|
color: p.gray.gray_dark,
|
|
@@ -2696,9 +2662,9 @@ const We = () => {
|
|
|
2696
2662
|
color: p.gray.gray_dark
|
|
2697
2663
|
},
|
|
2698
2664
|
children: [
|
|
2699
|
-
|
|
2665
|
+
L("inicia"),
|
|
2700
2666
|
/* @__PURE__ */ t(
|
|
2701
|
-
|
|
2667
|
+
P,
|
|
2702
2668
|
{
|
|
2703
2669
|
icon: "calendar",
|
|
2704
2670
|
size: "xs",
|
|
@@ -2723,7 +2689,7 @@ const We = () => {
|
|
|
2723
2689
|
/* @__PURE__ */ t(
|
|
2724
2690
|
"th",
|
|
2725
2691
|
{
|
|
2726
|
-
onClick: () =>
|
|
2692
|
+
onClick: () => z("termina"),
|
|
2727
2693
|
className: "tw-whitespace-nowrap",
|
|
2728
2694
|
style: {
|
|
2729
2695
|
color: p.gray.gray_dark,
|
|
@@ -2737,11 +2703,11 @@ const We = () => {
|
|
|
2737
2703
|
color: "#C4C4C4",
|
|
2738
2704
|
fontSize: "10px"
|
|
2739
2705
|
},
|
|
2740
|
-
children:
|
|
2706
|
+
children: L("termina")
|
|
2741
2707
|
}
|
|
2742
2708
|
),
|
|
2743
2709
|
/* @__PURE__ */ t(
|
|
2744
|
-
|
|
2710
|
+
P,
|
|
2745
2711
|
{
|
|
2746
2712
|
icon: "calendar",
|
|
2747
2713
|
size: "xs",
|
|
@@ -2776,8 +2742,8 @@ const We = () => {
|
|
|
2776
2742
|
]
|
|
2777
2743
|
}
|
|
2778
2744
|
) }),
|
|
2779
|
-
/* @__PURE__ */ t("tbody", { children:
|
|
2780
|
-
var
|
|
2745
|
+
/* @__PURE__ */ t("tbody", { children: s == null ? void 0 : s.map((w, A) => {
|
|
2746
|
+
var M, S, I, D, E, O, H, V, tt, W, Z, yt, Nt, vt, _t, Ct, Ft, Pt;
|
|
2781
2747
|
return /* @__PURE__ */ c(
|
|
2782
2748
|
"tr",
|
|
2783
2749
|
{
|
|
@@ -2799,9 +2765,9 @@ const We = () => {
|
|
|
2799
2765
|
dt.currentTarget.style.backgroundColor = A % 2 === 0 ? "#F5F5F5" : "#FAFAFA";
|
|
2800
2766
|
},
|
|
2801
2767
|
children: [
|
|
2802
|
-
/* @__PURE__ */ t("td", { className: "tw-text-s", children: (
|
|
2803
|
-
/* @__PURE__ */ t("td", { className: "tw-text-s", children: (
|
|
2804
|
-
/* @__PURE__ */ t("td", { className: "tw-text-s", children: (
|
|
2768
|
+
/* @__PURE__ */ t("td", { className: "tw-text-s", children: (M = w == null ? void 0 : w.campania) == null ? void 0 : M.nombre }),
|
|
2769
|
+
/* @__PURE__ */ t("td", { className: "tw-text-s", children: (S = w == null ? void 0 : w.campania) == null ? void 0 : S.inicia }),
|
|
2770
|
+
/* @__PURE__ */ t("td", { className: "tw-text-s", children: (I = w == null ? void 0 : w.campania) == null ? void 0 : I.termina }),
|
|
2805
2771
|
/* @__PURE__ */ t("td", { className: "tw-text-s", children: /* @__PURE__ */ c(
|
|
2806
2772
|
"div",
|
|
2807
2773
|
{
|
|
@@ -2851,12 +2817,12 @@ const We = () => {
|
|
|
2851
2817
|
) }),
|
|
2852
2818
|
/* @__PURE__ */ t("td", { className: "tw-text-s", children: /* @__PURE__ */ c("div", { className: "tw-flex tw-items-center tw-justify-center tw-text-s", children: [
|
|
2853
2819
|
/* @__PURE__ */ t(
|
|
2854
|
-
|
|
2820
|
+
Q,
|
|
2855
2821
|
{
|
|
2856
|
-
imageUrl: (V = (H = (
|
|
2857
|
-
(
|
|
2822
|
+
imageUrl: (V = (H = (O = (E = (D = w == null ? void 0 : w.campania) == null ? void 0 : D.responsable) == null ? void 0 : E.imagen) == null ? void 0 : O.formats) == null ? void 0 : H.thumbnail) != null && V.url ? C(
|
|
2823
|
+
(Nt = (yt = (Z = (W = (tt = w == null ? void 0 : w.campania) == null ? void 0 : tt.responsable) == null ? void 0 : W.imagen) == null ? void 0 : Z.formats) == null ? void 0 : yt.thumbnail) == null ? void 0 : Nt.url
|
|
2858
2824
|
) : "",
|
|
2859
|
-
alt: (Ct = (_t = (
|
|
2825
|
+
alt: (Ct = (_t = (vt = w == null ? void 0 : w.campania) == null ? void 0 : vt.responsable) == null ? void 0 : _t.nombre) == null ? void 0 : Ct.charAt(
|
|
2860
2826
|
0
|
|
2861
2827
|
)
|
|
2862
2828
|
}
|
|
@@ -2888,9 +2854,9 @@ const We = () => {
|
|
|
2888
2854
|
},
|
|
2889
2855
|
className: "tw-text-s tw-whitespace-nowrap",
|
|
2890
2856
|
children: [
|
|
2891
|
-
|
|
2857
|
+
s.length,
|
|
2892
2858
|
" elementos de ",
|
|
2893
|
-
|
|
2859
|
+
m
|
|
2894
2860
|
]
|
|
2895
2861
|
}
|
|
2896
2862
|
),
|
|
@@ -2899,9 +2865,9 @@ const We = () => {
|
|
|
2899
2865
|
{
|
|
2900
2866
|
first: i,
|
|
2901
2867
|
rows: o,
|
|
2902
|
-
totalRecords:
|
|
2868
|
+
totalRecords: m,
|
|
2903
2869
|
rowsPerPageOptions: [5, 10, 20, 50],
|
|
2904
|
-
onPageChange:
|
|
2870
|
+
onPageChange: N,
|
|
2905
2871
|
className: "tw-flex tw-justify-center tw-items-center tw-w-full tw-p-2 tw-gap-1 tw-rounded-lg",
|
|
2906
2872
|
style: {
|
|
2907
2873
|
display: "flex",
|
|
@@ -2919,7 +2885,7 @@ const We = () => {
|
|
|
2919
2885
|
{
|
|
2920
2886
|
onClick: w.onClick,
|
|
2921
2887
|
disabled: w.disabled,
|
|
2922
|
-
style:
|
|
2888
|
+
style: R(w.disabled),
|
|
2923
2889
|
className: "tw-flex tw-items-center tw-justify-center tw-text-s",
|
|
2924
2890
|
children: "<<"
|
|
2925
2891
|
}
|
|
@@ -2929,7 +2895,7 @@ const We = () => {
|
|
|
2929
2895
|
{
|
|
2930
2896
|
onClick: w.onClick,
|
|
2931
2897
|
disabled: w.disabled,
|
|
2932
|
-
style:
|
|
2898
|
+
style: R(w.disabled),
|
|
2933
2899
|
className: "tw-text-s",
|
|
2934
2900
|
children: "<"
|
|
2935
2901
|
}
|
|
@@ -2939,7 +2905,7 @@ const We = () => {
|
|
|
2939
2905
|
{
|
|
2940
2906
|
onClick: w.onClick,
|
|
2941
2907
|
disabled: w.disabled,
|
|
2942
|
-
style:
|
|
2908
|
+
style: R(w.disabled),
|
|
2943
2909
|
className: "tw-text-s",
|
|
2944
2910
|
children: ">"
|
|
2945
2911
|
}
|
|
@@ -2949,7 +2915,7 @@ const We = () => {
|
|
|
2949
2915
|
{
|
|
2950
2916
|
onClick: w.onClick,
|
|
2951
2917
|
disabled: w.disabled,
|
|
2952
|
-
style:
|
|
2918
|
+
style: R(w.disabled),
|
|
2953
2919
|
className: "tw-text-s",
|
|
2954
2920
|
children: ">>"
|
|
2955
2921
|
}
|
|
@@ -2960,7 +2926,7 @@ const We = () => {
|
|
|
2960
2926
|
onClick: (A) => w.onClick(A),
|
|
2961
2927
|
className: `tw-flex tw-items-center tw-justify-center tw-text-s ${w.className.includes("p-highlight") ? "highlighted" : ""}`,
|
|
2962
2928
|
style: {
|
|
2963
|
-
...
|
|
2929
|
+
...R(!1),
|
|
2964
2930
|
backgroundColor: w.className.includes(
|
|
2965
2931
|
"p-highlight"
|
|
2966
2932
|
) ? "#E1EBF9" : p.silver.silver_light,
|
|
@@ -2985,8 +2951,8 @@ const We = () => {
|
|
|
2985
2951
|
borderRadius: "4px"
|
|
2986
2952
|
},
|
|
2987
2953
|
value: o,
|
|
2988
|
-
onChange: (w) =>
|
|
2989
|
-
children:
|
|
2954
|
+
onChange: (w) => F(w),
|
|
2955
|
+
children: j.map((w) => /* @__PURE__ */ t(
|
|
2990
2956
|
"option",
|
|
2991
2957
|
{
|
|
2992
2958
|
value: w.value,
|
|
@@ -3005,55 +2971,114 @@ const We = () => {
|
|
|
3005
2971
|
] }) })
|
|
3006
2972
|
}
|
|
3007
2973
|
);
|
|
3008
|
-
},
|
|
3009
|
-
const
|
|
3010
|
-
"kanban-general": { kanban: /* @__PURE__ */ t(
|
|
2974
|
+
}, Ve = ({ path: a, tab: e, setPath: s, project: n, setProject: r }) => {
|
|
2975
|
+
const l = {
|
|
2976
|
+
"kanban-general": { kanban: /* @__PURE__ */ t(We, {}) },
|
|
3011
2977
|
"lista-campanias": {
|
|
3012
|
-
lista: /* @__PURE__ */ t(
|
|
2978
|
+
lista: /* @__PURE__ */ t(Je, { setPath: s, setProject: r }),
|
|
3013
2979
|
gantt: /* @__PURE__ */ t("div", { children: "gantt-campanias" })
|
|
3014
2980
|
},
|
|
3015
2981
|
"kanban-campania": {
|
|
3016
|
-
kanban: /* @__PURE__ */ t(
|
|
3017
|
-
lista: /* @__PURE__ */ t(
|
|
2982
|
+
kanban: /* @__PURE__ */ t(Ee, {}),
|
|
2983
|
+
lista: /* @__PURE__ */ t(Ze, {}),
|
|
3018
2984
|
gantt: /* @__PURE__ */ t("div", { children: "kanban-campania-gantt" })
|
|
3019
2985
|
}
|
|
3020
2986
|
};
|
|
3021
|
-
return a === "kanban-campania" ? /* @__PURE__ */ t(
|
|
3022
|
-
},
|
|
3023
|
-
|
|
2987
|
+
return a === "kanban-campania" ? /* @__PURE__ */ t(ge, { project: n == null ? void 0 : n.id, children: l[a][e] }) : l[a][e];
|
|
2988
|
+
}, ta = ({ label: a, active: e, onClick: s, disabled: n }) => n ? /* @__PURE__ */ t(
|
|
2989
|
+
K,
|
|
2990
|
+
{
|
|
2991
|
+
dispatch: /* @__PURE__ */ t("button", { className: "tw-text-texts-placeholder tw-text-xl tw-font-semibold tw-cursor-help", children: a }),
|
|
2992
|
+
children: /* @__PURE__ */ t("div", { className: "tw-flex tw-items-center tw-justify-center tw-px-3 tw-py-2 tw-bg-bg-card tw-rounded-lg tw-border tw-border-border-card", children: /* @__PURE__ */ t("p", { className: "tw-text-texts-placeholder tw-text-lg tw-font-semibold", children: "Espéralo muy pronto..." }) })
|
|
2993
|
+
}
|
|
2994
|
+
) : /* @__PURE__ */ t(
|
|
2995
|
+
"button",
|
|
2996
|
+
{
|
|
2997
|
+
disabled: n,
|
|
2998
|
+
onClick: s,
|
|
2999
|
+
className: `${e ? "tw-text-texts-enfasis tw-border-b-2 tw-border-texts-enfasis" : ""} tw-text-xl tw-font-semibold ${n ? "tw-cursor-not-allowed tw-text-texts-placeholder tw-text-lg" : "tw-text-texts-subtext"}`,
|
|
3000
|
+
children: a
|
|
3001
|
+
}
|
|
3002
|
+
), ea = ({ tabs: a, renderItem: e, initialTab: s }) => {
|
|
3003
|
+
const [n, r] = y(s ?? a[0].toLowerCase());
|
|
3004
|
+
q(() => {
|
|
3005
|
+
s && r(s);
|
|
3006
|
+
}, [s]);
|
|
3007
|
+
const l = (i) => {
|
|
3008
|
+
r(i), e(i);
|
|
3009
|
+
};
|
|
3010
|
+
return /* @__PURE__ */ t("div", { className: "tw-flex", children: a.map((i, d) => /* @__PURE__ */ t(
|
|
3011
|
+
"div",
|
|
3012
|
+
{
|
|
3013
|
+
className: `${d === 0 ? "tw-border-l-2" : ""} tw-border-r-2 tw-border-gray-200 tw-px-m`,
|
|
3014
|
+
children: /* @__PURE__ */ t(
|
|
3015
|
+
ta,
|
|
3016
|
+
{
|
|
3017
|
+
onClick: () => l(i.toLowerCase()),
|
|
3018
|
+
label: i,
|
|
3019
|
+
active: i.toLowerCase() === n,
|
|
3020
|
+
disabled: ["gantt"].includes(i.toLowerCase())
|
|
3021
|
+
},
|
|
3022
|
+
d
|
|
3023
|
+
)
|
|
3024
|
+
}
|
|
3025
|
+
)) });
|
|
3026
|
+
}, aa = ({ path: a }) => /* @__PURE__ */ t(ie, { children: /* @__PURE__ */ t(() => {
|
|
3027
|
+
const { selectPath: s, updateFilters: n, applyFilters: r, filters: l } = U(), [i, d] = y("kanban"), [o, g] = y(a), [m, b] = y({
|
|
3024
3028
|
id: 1704,
|
|
3025
3029
|
project: "Kanban de Campania"
|
|
3026
|
-
}), [
|
|
3027
|
-
|
|
3028
|
-
|
|
3029
|
-
|
|
3030
|
-
|
|
3031
|
-
|
|
3030
|
+
}), [x, u] = y([
|
|
3031
|
+
{ path: "lista-campanias", search: (l == null ? void 0 : l.search) ?? "" },
|
|
3032
|
+
{ path: "kanban-campania", search: (l == null ? void 0 : l.taskName) ?? "" },
|
|
3033
|
+
{ path: "kanban-general", search: (l == null ? void 0 : l.taskName) ?? "" }
|
|
3034
|
+
]), [h, _] = y(), v = Y(null);
|
|
3035
|
+
q(() => {
|
|
3036
|
+
var F;
|
|
3037
|
+
d(o === "lista-campanias" ? "lista" : "kanban"), s(o), _(((F = x.find((z) => z.path === o)) == null ? void 0 : F.search) ?? "");
|
|
3038
|
+
}, [a, o]), q(() => {
|
|
3039
|
+
var F;
|
|
3040
|
+
((F = N()) == null ? void 0 : F.trim()) === "" && n({
|
|
3041
|
+
name: o === "lista-campanias" ? "search" : "taskName",
|
|
3032
3042
|
value: null
|
|
3033
3043
|
}), r();
|
|
3034
|
-
}, [
|
|
3035
|
-
|
|
3036
|
-
}, [s == null ? void 0 : s.taskName]);
|
|
3037
|
-
const C = (x) => ({
|
|
3044
|
+
}, [x]);
|
|
3045
|
+
const C = (F) => ({
|
|
3038
3046
|
"kanban-general": "Kanban General",
|
|
3039
3047
|
"lista-campanias": "Campanias",
|
|
3040
|
-
"kanban-campania": `Kanban de ${
|
|
3041
|
-
})[
|
|
3042
|
-
g(
|
|
3043
|
-
},
|
|
3048
|
+
"kanban-campania": `Kanban de ${m.project}`
|
|
3049
|
+
})[F], T = (F) => {
|
|
3050
|
+
g(F);
|
|
3051
|
+
}, k = ["lista-campanias", "kanban-campania"], f = {
|
|
3044
3052
|
"lista-campanias": ["lista", "gantt"],
|
|
3045
3053
|
"kanban-campania": ["kanban", "lista", "gantt"]
|
|
3054
|
+
}, N = () => {
|
|
3055
|
+
var F;
|
|
3056
|
+
return ((F = x.find((z) => z.path === o)) == null ? void 0 : F.search) ?? "";
|
|
3057
|
+
}, j = (F) => {
|
|
3058
|
+
u(
|
|
3059
|
+
(z) => z.map((L) => L.path === o ? { ...L, search: F } : L)
|
|
3060
|
+
);
|
|
3046
3061
|
};
|
|
3047
|
-
return
|
|
3062
|
+
return q(() => {
|
|
3063
|
+
const F = setTimeout(() => {
|
|
3064
|
+
n({
|
|
3065
|
+
name: o === "lista-campanias" ? "search" : "taskName",
|
|
3066
|
+
value: h == null ? void 0 : h.trim()
|
|
3067
|
+
}), j(h);
|
|
3068
|
+
}, 500);
|
|
3069
|
+
return () => {
|
|
3070
|
+
clearTimeout(F);
|
|
3071
|
+
};
|
|
3072
|
+
}, [h]), /* @__PURE__ */ c("div", { className: "tw-bg-bg-card tw-p-m tw-rounded-lg tw-border tw-border-gray-200 tw-flex tw-flex-col tw-gap-m tw-w-full tw-h-full tw-min-h-[100%] tw-relative tw-overflow-hidden", children: [
|
|
3048
3073
|
/* @__PURE__ */ c("div", { className: "tw-w-full tw-justify-between tw-flex tw-items-end tw-border-b tw-border-gray-200 tw-pb-m tw-px-l tw-flex-wrap tw-gap-l", children: [
|
|
3049
3074
|
/* @__PURE__ */ c("div", { className: "tw-flex tw-gap-xl", children: [
|
|
3050
3075
|
o === "kanban-campania" && /* @__PURE__ */ t(
|
|
3051
3076
|
"button",
|
|
3052
3077
|
{
|
|
3053
|
-
onClick: () =>
|
|
3078
|
+
onClick: () => T("lista-campanias"),
|
|
3054
3079
|
className: "tw-flex tw-items-center tw-text-primary hover:tw-text-primary/80 tw-transition-colors",
|
|
3055
3080
|
children: /* @__PURE__ */ t(
|
|
3056
|
-
|
|
3081
|
+
P,
|
|
3057
3082
|
{
|
|
3058
3083
|
icon: "arrow_left",
|
|
3059
3084
|
size: "xs",
|
|
@@ -3065,12 +3090,12 @@ const We = () => {
|
|
|
3065
3090
|
}
|
|
3066
3091
|
),
|
|
3067
3092
|
/* @__PURE__ */ t("h2", { className: "tw-text-texts tw-font-medium", children: C(o) }),
|
|
3068
|
-
|
|
3069
|
-
|
|
3093
|
+
k.includes(o) && /* @__PURE__ */ t(
|
|
3094
|
+
ea,
|
|
3070
3095
|
{
|
|
3071
3096
|
tabs: f[o],
|
|
3072
|
-
renderItem: (
|
|
3073
|
-
d(
|
|
3097
|
+
renderItem: (F) => {
|
|
3098
|
+
d(F);
|
|
3074
3099
|
},
|
|
3075
3100
|
initialTab: i
|
|
3076
3101
|
}
|
|
@@ -3080,13 +3105,8 @@ const We = () => {
|
|
|
3080
3105
|
/* @__PURE__ */ t(
|
|
3081
3106
|
"input",
|
|
3082
3107
|
{
|
|
3083
|
-
onChange: (
|
|
3084
|
-
|
|
3085
|
-
n({
|
|
3086
|
-
name: "taskName",
|
|
3087
|
-
value: x.target.value.trim()
|
|
3088
|
-
}), _(x.target.value);
|
|
3089
|
-
}, 1e3)();
|
|
3108
|
+
onChange: (F) => {
|
|
3109
|
+
_(F.target.value);
|
|
3090
3110
|
},
|
|
3091
3111
|
type: "text",
|
|
3092
3112
|
placeholder: "Buscar",
|
|
@@ -3095,29 +3115,29 @@ const We = () => {
|
|
|
3095
3115
|
}
|
|
3096
3116
|
),
|
|
3097
3117
|
/* @__PURE__ */ t(
|
|
3098
|
-
|
|
3118
|
+
le,
|
|
3099
3119
|
{
|
|
3100
|
-
filterChildren:
|
|
3120
|
+
filterChildren: v,
|
|
3101
3121
|
children: /* @__PURE__ */ t(
|
|
3102
3122
|
"div",
|
|
3103
3123
|
{
|
|
3104
|
-
ref:
|
|
3124
|
+
ref: v,
|
|
3105
3125
|
className: "tw-w-max tw-max-w-[400px] tw-h-fit tw-bg-bg-card tw-shadow-lg tw-rounded-lg tw-p-l",
|
|
3106
|
-
children: /* @__PURE__ */ t(
|
|
3126
|
+
children: /* @__PURE__ */ t(we, {})
|
|
3107
3127
|
}
|
|
3108
3128
|
)
|
|
3109
3129
|
}
|
|
3110
3130
|
)
|
|
3111
3131
|
] })
|
|
3112
3132
|
] }),
|
|
3113
|
-
/* @__PURE__ */ t("div", { className: "tw-overflow-y-auto tw-scrollbar-none tw-max-h-[100%]", children: /* @__PURE__ */ t(
|
|
3114
|
-
|
|
3133
|
+
/* @__PURE__ */ t("div", { className: "tw-overflow-y-auto tw-scrollbar-none tw-max-h-[100%] tw-h-full", children: /* @__PURE__ */ t(
|
|
3134
|
+
Ve,
|
|
3115
3135
|
{
|
|
3116
3136
|
path: o,
|
|
3117
3137
|
tab: i,
|
|
3118
|
-
setPath:
|
|
3119
|
-
project:
|
|
3120
|
-
setProject:
|
|
3138
|
+
setPath: T,
|
|
3139
|
+
project: m,
|
|
3140
|
+
setProject: b
|
|
3121
3141
|
}
|
|
3122
3142
|
) })
|
|
3123
3143
|
] });
|
|
@@ -3129,12 +3149,12 @@ const We = () => {
|
|
|
3129
3149
|
/* @__PURE__ */ t("div", { className: "tw-w-10 tw-h-10 tw-bg-primary-regular tw-rounded-full tw-animate-pulse" }),
|
|
3130
3150
|
/* @__PURE__ */ t("p", { className: "tw-text-l tw-text-texts-enfasis", children: "No encontramos tu acceso" }),
|
|
3131
3151
|
/* @__PURE__ */ t("p", { className: "tw-text-sm tw-text-texts-placeholder", children: "por favor, contacta al administrador" })
|
|
3132
|
-
] }) }) }), fa = ({ path: a, user: e, url:
|
|
3133
|
-
const r = new
|
|
3152
|
+
] }) }) }), fa = ({ path: a, user: e, url: s, mode: n }) => {
|
|
3153
|
+
const r = new Yt();
|
|
3134
3154
|
if (!e) return /* @__PURE__ */ t(ra, {});
|
|
3135
3155
|
if (!e.accessToken) return /* @__PURE__ */ t(na, {});
|
|
3136
|
-
let
|
|
3137
|
-
return /* @__PURE__ */ t(
|
|
3156
|
+
let l = { user: e, url: s, mode: n };
|
|
3157
|
+
return /* @__PURE__ */ t($, { children: /* @__PURE__ */ t(pe, { ...l, children: /* @__PURE__ */ t(me, { ...l, children: /* @__PURE__ */ t("div", { className: "tw-w-full tw-h-full tw-min-h-[100%] tw-relative", children: /* @__PURE__ */ c(Gt, { client: r, children: [
|
|
3138
3158
|
/* @__PURE__ */ t(aa, { path: a }),
|
|
3139
3159
|
" "
|
|
3140
3160
|
] }) }) }) }) });
|