@imj_media/tareas 1.6.3 → 1.6.4
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/src/hooks/kanbanListadoColumnTasks.types.d.ts +28 -0
- package/dist/src/hooks/useDoneTasks.d.ts +2 -12
- package/dist/src/hooks/useToDoTasks.d.ts +2 -12
- package/dist/src/hooks/useWorkingTasks.d.ts +2 -12
- package/dist/src/modules/teams/utils/teams.utils.d.ts +7 -17
- package/dist/src/modules/templates/components/atoms/tasks/WitnessesIndicator.d.ts +7 -0
- package/dist/src/modules/templates/components/atoms/tasks/index.d.ts +1 -0
- package/dist/src/modules/templates/components/organisms/NewTaskDrawer.d.ts +3 -12
- package/dist/src/modules/templates/hooks/useFlow.types.d.ts +6 -4
- package/dist/src/modules/templates/infraestructure/interfaces/api.types.d.ts +2 -0
- package/dist/src/modules/templates/types/template_graph.d.ts +10 -0
- package/dist/src/utils/buildKanbanListadoColumnFilters.d.ts +19 -0
- package/dist/src/utils/kanbanFilterFieldsEqual.d.ts +3 -0
- package/dist/src/utils/kanbanTasksQueries.d.ts +6 -1
- package/dist/src/utils/tanstack.functions.d.ts +6 -0
- package/dist/tareas.cjs +9 -9
- package/dist/tareas.css +1 -1
- package/dist/tareas.es.js +5088 -5078
- package/package.json +1 -1
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { InfiniteData, UseInfiniteQueryResult } from '@tanstack/react-query';
|
|
2
|
+
import { GetTasksKanbanPage } from '../core/actions/get_tasks_response.action';
|
|
3
|
+
/** Payload de filtros enviado al POST listado kanban (columnas del tablero general). */
|
|
4
|
+
export type KanbanListadoFiltersToSend = {
|
|
5
|
+
owner: {
|
|
6
|
+
user: number;
|
|
7
|
+
config: string;
|
|
8
|
+
role?: string;
|
|
9
|
+
};
|
|
10
|
+
status?: string;
|
|
11
|
+
[key: string]: unknown;
|
|
12
|
+
};
|
|
13
|
+
export type KanbanListadoInfiniteQueryResult = UseInfiniteQueryResult<InfiniteData<GetTasksKanbanPage, unknown>, Error>;
|
|
14
|
+
export type UseDoneTasksResult = {
|
|
15
|
+
doneTasks: KanbanListadoInfiniteQueryResult;
|
|
16
|
+
total: number;
|
|
17
|
+
filtersToSend: KanbanListadoFiltersToSend;
|
|
18
|
+
};
|
|
19
|
+
export type UseToDoTasksResult = {
|
|
20
|
+
toDoTasks: KanbanListadoInfiniteQueryResult;
|
|
21
|
+
total: number;
|
|
22
|
+
filtersToSend: KanbanListadoFiltersToSend;
|
|
23
|
+
};
|
|
24
|
+
export type UseWorkingTasksResult = {
|
|
25
|
+
workingTasks: KanbanListadoInfiniteQueryResult;
|
|
26
|
+
total: number;
|
|
27
|
+
filtersToSend: KanbanListadoFiltersToSend;
|
|
28
|
+
};
|
|
@@ -1,13 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
total: number;
|
|
4
|
-
filtersToSend: {
|
|
5
|
-
owner: {
|
|
6
|
-
user: number;
|
|
7
|
-
config: import('../core/actions/get_tasks_response.action').TConfigs;
|
|
8
|
-
role: string;
|
|
9
|
-
};
|
|
10
|
-
status: "completadas";
|
|
11
|
-
};
|
|
12
|
-
};
|
|
1
|
+
import { UseDoneTasksResult } from './kanbanListadoColumnTasks.types';
|
|
2
|
+
declare const useDoneTasks: () => UseDoneTasksResult;
|
|
13
3
|
export default useDoneTasks;
|
|
@@ -1,13 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
total: number;
|
|
4
|
-
filtersToSend: {
|
|
5
|
-
owner: {
|
|
6
|
-
user: number;
|
|
7
|
-
config: import('../core/actions/get_tasks_response.action').TConfigs;
|
|
8
|
-
role: string;
|
|
9
|
-
};
|
|
10
|
-
status: "por_hacer";
|
|
11
|
-
};
|
|
12
|
-
};
|
|
1
|
+
import { UseToDoTasksResult } from './kanbanListadoColumnTasks.types';
|
|
2
|
+
declare const useToDoTasks: () => UseToDoTasksResult;
|
|
13
3
|
export default useToDoTasks;
|
|
@@ -1,13 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
total: number;
|
|
4
|
-
filtersToSend: {
|
|
5
|
-
owner: {
|
|
6
|
-
user: number;
|
|
7
|
-
config: import('../core/actions/get_tasks_response.action').TConfigs;
|
|
8
|
-
role: string;
|
|
9
|
-
};
|
|
10
|
-
status: "trabajando";
|
|
11
|
-
};
|
|
12
|
-
};
|
|
1
|
+
import { UseWorkingTasksResult } from './kanbanListadoColumnTasks.types';
|
|
2
|
+
declare const useWorkingTasks: () => UseWorkingTasksResult;
|
|
13
3
|
export default useWorkingTasks;
|
|
@@ -1,21 +1,5 @@
|
|
|
1
1
|
import { generatePopulateStructure } from './populate.utils';
|
|
2
|
-
import { MemberList,
|
|
3
|
-
/**
|
|
4
|
-
* Aplana hijos directos del primer raíz para la API (alta y edición).
|
|
5
|
-
*
|
|
6
|
-
* - El primer raíz se mantiene con su árbol anidado (no se mueve a otros hijos).
|
|
7
|
-
* - Cada hijo directo del principal se envía también como fila raíz hermana
|
|
8
|
-
* (`miembros: []`, `miembro_padre: null`, `esEncargado: false`), para quienes
|
|
9
|
-
* **aún no** tienen esa fila plana en `otherRoots` (mismo `idUser.id`).
|
|
10
|
-
* - Así, un colaborador nuevo bajo el principal (p. ej. `id: null`) aparece en raíz
|
|
11
|
-
* sin duplicar a Maria/Andre/Zeferino que ya vienen como hermanos desde el backend.
|
|
12
|
-
*
|
|
13
|
-
* No se fuerza encargado: se respeta `esEncargado` del primer raíz.
|
|
14
|
-
*
|
|
15
|
-
* @see POST /api/registrar-equipo-miembros
|
|
16
|
-
* @see PATCH /api/actualizar-equipo-miembros/:id
|
|
17
|
-
*/
|
|
18
|
-
export declare function expandFirstRootDirectChildrenForTeamPayload(team: Team): Team;
|
|
2
|
+
import { MemberList, TeamFilters } from '../infrastructure/interfaces/team';
|
|
19
3
|
/**
|
|
20
4
|
* Miembros raíz a mostrar en el modal de equipo: solo encargados (`esEncargado`) y,
|
|
21
5
|
* bajo ellos, el árbol que ya viene en `miembros`. Oculta hermanos planos del API
|
|
@@ -23,6 +7,12 @@ export declare function expandFirstRootDirectChildrenForTeamPayload(team: Team):
|
|
|
23
7
|
* se muestran todos los raíz para poder seguir editando.
|
|
24
8
|
*/
|
|
25
9
|
export declare function getMembersForModalView(miembros: MemberList): MemberList;
|
|
10
|
+
/**
|
|
11
|
+
* Lista única de integrantes para contador y avatares: solo árbol bajo encargado(s) en raíz,
|
|
12
|
+
* sin hermanos planos del API. Deduplica por id de miembro, uid e idUser.
|
|
13
|
+
*/
|
|
14
|
+
export declare function getUniqueIntegrantesFromTeamRoots(miembros: MemberList): MemberList;
|
|
15
|
+
export declare function countUniqueIntegrantes(miembros: MemberList): number;
|
|
26
16
|
export declare const randomColor: () => string;
|
|
27
17
|
/**
|
|
28
18
|
* Construye el objeto filters para la API de equipos (Strapi).
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
interface WitnessesIndicatorProps {
|
|
2
|
+
/** column: nodo del grafo; row: footer de card de plantilla */
|
|
3
|
+
layout?: 'column' | 'row';
|
|
4
|
+
}
|
|
5
|
+
/** Cámara + leyenda «Testigos»; layout column (grafo) o row (listado). */
|
|
6
|
+
export declare const WitnessesIndicator: ({ layout }: WitnessesIndicatorProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export {};
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { NodeDataType } from '../atoms/PlusNode';
|
|
2
|
+
import { TaskFormData } from '../../hooks/useFlow.types';
|
|
3
|
+
import { RawTareaPlantilla } from '../../infraestructure/interfaces/api.types';
|
|
2
4
|
interface ParentNodeInfo {
|
|
3
5
|
id: string;
|
|
4
6
|
label?: string;
|
|
@@ -13,18 +15,7 @@ interface NewTaskDrawerProps {
|
|
|
13
15
|
nodeDataType?: NodeDataType;
|
|
14
16
|
parentNodeInfo?: ParentNodeInfo;
|
|
15
17
|
editMode?: boolean;
|
|
16
|
-
taskToEdit?:
|
|
17
|
-
}
|
|
18
|
-
interface TaskFormData {
|
|
19
|
-
title: string;
|
|
20
|
-
description: string;
|
|
21
|
-
priority: string | number;
|
|
22
|
-
difficulty: string | number;
|
|
23
|
-
duration: string | number;
|
|
24
|
-
team: number | string;
|
|
25
|
-
responsible: string;
|
|
26
|
-
type: string;
|
|
27
|
-
parent?: ParentNodeInfo;
|
|
18
|
+
taskToEdit?: Partial<RawTareaPlantilla>;
|
|
28
19
|
}
|
|
29
20
|
export declare const NewTaskDrawer: ({ isOpen, onClose, onSuccess, nodeDataType: _nodeDataType, parentNodeInfo, editMode, taskToEdit, }: NewTaskDrawerProps) => import("react/jsx-runtime").JSX.Element;
|
|
30
21
|
export {};
|
|
@@ -49,11 +49,13 @@ export interface TaskFormData {
|
|
|
49
49
|
id?: number;
|
|
50
50
|
title: string;
|
|
51
51
|
description: string;
|
|
52
|
-
priority: string;
|
|
53
|
-
difficulty: string;
|
|
54
|
-
duration: string;
|
|
55
|
-
team: string;
|
|
52
|
+
priority: string | number;
|
|
53
|
+
difficulty: string | number;
|
|
54
|
+
duration: string | number;
|
|
55
|
+
team: string | number;
|
|
56
56
|
responsible: string;
|
|
57
|
+
/** Solicitud de testigos al crear/editar tarea en plantilla */
|
|
58
|
+
is_monitoring_trigger: boolean;
|
|
57
59
|
}
|
|
58
60
|
export interface TaskData extends TaskFormData {
|
|
59
61
|
reference_graph: string;
|
|
@@ -53,6 +53,8 @@ export interface RawTareaPlantilla {
|
|
|
53
53
|
nivel_dificultad: number;
|
|
54
54
|
duracion: number | null;
|
|
55
55
|
start: boolean;
|
|
56
|
+
/** Solicitud de testigos; null se trata como false en UI */
|
|
57
|
+
is_monitoring_trigger?: boolean | null;
|
|
56
58
|
equipo: {
|
|
57
59
|
id: number | null;
|
|
58
60
|
};
|
|
@@ -40,6 +40,15 @@ export interface Editor {
|
|
|
40
40
|
username: string;
|
|
41
41
|
image: string;
|
|
42
42
|
}
|
|
43
|
+
/** Tarea resumida en listado de plantillas (all-plantillas) */
|
|
44
|
+
export interface TemplateTareaPlantillaListItem {
|
|
45
|
+
id: number;
|
|
46
|
+
start?: boolean;
|
|
47
|
+
cancelada?: boolean;
|
|
48
|
+
texto_corto?: string;
|
|
49
|
+
texto_largo?: string;
|
|
50
|
+
is_monitoring_trigger?: boolean | null;
|
|
51
|
+
}
|
|
43
52
|
export interface Template {
|
|
44
53
|
id: number;
|
|
45
54
|
nombre_plantilla: string;
|
|
@@ -62,6 +71,7 @@ export interface Template {
|
|
|
62
71
|
updated_by: Editor;
|
|
63
72
|
created_by: Editor;
|
|
64
73
|
publication_date: string;
|
|
74
|
+
tarea_plantillas?: TemplateTareaPlantillaListItem[];
|
|
65
75
|
}
|
|
66
76
|
export interface TemplateFilters {
|
|
67
77
|
etstatus?: string;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { KanbanListadoFiltersToSend } from '../hooks/kanbanListadoColumnTasks.types';
|
|
2
|
+
type KanbanListadoStatus = 'por_hacer' | 'trabajando' | 'completadas';
|
|
3
|
+
type LayoutFilters = Record<string, unknown> & {
|
|
4
|
+
owner?: {
|
|
5
|
+
config?: string;
|
|
6
|
+
user?: number;
|
|
7
|
+
role?: string;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Filtros listos para POST `listado-kanban-general` (una columna del tablero general).
|
|
12
|
+
*/
|
|
13
|
+
export declare function buildKanbanListadoColumnFilters(filters: LayoutFilters, user: {
|
|
14
|
+
id: number;
|
|
15
|
+
role: string;
|
|
16
|
+
}, status: KanbanListadoStatus): KanbanListadoFiltersToSend;
|
|
17
|
+
/** No disparar columnas hasta que el layout aplicó defaults (`owner.config`). */
|
|
18
|
+
export declare function isKanbanListadoFiltersReady(filters: LayoutFilters): boolean;
|
|
19
|
+
export {};
|
|
@@ -20,9 +20,14 @@ export declare const KANBAN_CAMPAIGN_TASKS_QUERY_ROOT: "tasksProject";
|
|
|
20
20
|
*/
|
|
21
21
|
export declare function invalidateKanbanListadoTasksQueries(queryClient: QueryClient): Promise<void>;
|
|
22
22
|
/**
|
|
23
|
-
* Botón “refrescar” del layout en tablero listado:
|
|
23
|
+
* Botón “refrescar” del layout en tablero listado: reinicia cada infinite query (solo página 1).
|
|
24
|
+
* No combinar `invalidateQueries` + `refetchQueries`: duplica POST y, con páginas en caché, refetch N veces por columna.
|
|
24
25
|
*/
|
|
25
26
|
export declare function invalidateAndRefetchKanbanListadoTasks(queryClient: QueryClient): Promise<void>;
|
|
27
|
+
/**
|
|
28
|
+
* Botón “refrescar” del layout en tablero campaña: un solo refetch de `tasksProject` activo.
|
|
29
|
+
*/
|
|
30
|
+
export declare function invalidateAndRefetchKanbanCampaignTasks(queryClient: QueryClient): Promise<void>;
|
|
26
31
|
/**
|
|
27
32
|
* Tras un bulk-update en el tablero **campaña**: obsoleta la query de proyecto (cualquier filtro/proyecto activo).
|
|
28
33
|
*/
|
|
@@ -1,8 +1,14 @@
|
|
|
1
|
+
import { GetTasksKanbanPage } from '../core/actions/get_tasks_response.action';
|
|
1
2
|
/**
|
|
2
3
|
* Tamaño de página del infinite query de las columnas del Kanban **listado** (`useToDoTasks`, etc.).
|
|
3
4
|
* `fetchAllKanbanListadoTaskIds` y `fetchNextPage` deben usar el mismo valor para no cortar mal el bucle.
|
|
4
5
|
*/
|
|
5
6
|
export declare const KANBAN_LISTADO_INFINITE_PAGE_SIZE = 30;
|
|
7
|
+
/**
|
|
8
|
+
* Siguiente página del infinite query del kanban listado.
|
|
9
|
+
* Evita pedir páginas de más (respuestas vacías / solo meta) y que un refresh refetch todas las páginas en caché sin necesidad.
|
|
10
|
+
*/
|
|
11
|
+
export declare function getKanbanListadoNextPageParam(lastPage: GetTasksKanbanPage | undefined, allPages: GetTasksKanbanPage[]): number | undefined;
|
|
6
12
|
/** Subconjunto de infinite query usado por `fetchNextPage` (Kanban listado). */
|
|
7
13
|
type KanbanInfiniteFetchKey = {
|
|
8
14
|
hasNextPage?: boolean;
|