@imj_media/tareas 1.6.1 → 1.6.3
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/components/atoms/InputSearch.d.ts +8 -3
- package/dist/src/components/lista-campania/ActionsTaskList.d.ts +3 -1
- package/dist/src/components/molecules/ButtonAssignUsers.d.ts +3 -1
- package/dist/src/components/organisms/ConfirmationModal.d.ts +1 -1
- package/dist/src/components/organisms/DetailsTask.d.ts +1 -1
- package/dist/src/components/organisms/Task.d.ts +1 -1
- package/dist/src/components/tasks/DifficultyButton.d.ts +10 -0
- package/dist/src/components/tasks/PriorityButton.d.ts +3 -1
- package/dist/src/components/templates/progress-modal/config/estadoTareaProgreso.config.d.ts +2 -2
- package/dist/src/core/actions/get_tasks_project.action.d.ts +9 -39
- package/dist/src/core/actions/get_tasks_response.action.d.ts +26 -3
- package/dist/src/core/actions/get_teams_project.action.d.ts +1 -1
- package/dist/src/hooks/useDoneTasks.d.ts +3 -3
- package/dist/src/hooks/useToDoTasks.d.ts +3 -3
- package/dist/src/hooks/useWorkingTasks.d.ts +3 -3
- package/dist/src/infraestructure/interfaces/atraso-reasons-response.d.ts +1 -1
- package/dist/src/infraestructure/interfaces/pause-reasons.d.ts +1 -1
- package/dist/src/infraestructure/interfaces/tasks-campania-response.d.ts +2 -1
- package/dist/src/infraestructure/interfaces/tasks-kanban-general.d.ts +3 -1
- package/dist/src/infraestructure/interfaces/tasks-reponse.d.ts +27 -4
- package/dist/src/infraestructure/mappers/pause-reasons.d.ts +1 -0
- package/dist/src/modules/teams/ui/atoms/TeamModalHeader.d.ts +2 -2
- package/dist/src/modules/teams/utils/teams.utils.d.ts +24 -1
- package/dist/src/modules/templates/components/organisms/AddTemplateModal.d.ts +1 -1
- package/dist/src/modules/templates/components/organisms/NewTaskDrawer.d.ts +1 -1
- package/dist/src/modules/templates/hooks/filters/useGetInputFiltersByPath.d.ts +2 -2
- package/dist/src/modules/templates/hooks/filters/useStaticFilters.d.ts +1 -1
- package/dist/src/modules/templates/hooks/states/useStates.d.ts +1 -1
- package/dist/src/modules/templates/hooks/useFetchGraphTemplates.d.ts +1 -1
- package/dist/src/modules/templates/hooks/useFlow.types.d.ts +9 -9
- package/dist/src/modules/templates/hooks/useFlowActions.d.ts +1 -1
- package/dist/src/modules/templates/hooks/useZoomAndCenter.d.ts +6 -1
- package/dist/src/modules/templates/infraestructure/interfaces/filter.types.d.ts +4 -3
- package/dist/src/modules/templates/store/useTemplateGrid.d.ts +11 -0
- package/dist/src/shared/store/useStore.d.ts +4 -2
- package/dist/src/types/index.d.ts +29 -3
- package/dist/src/utils/canEditTaskFields.d.ts +6 -0
- package/dist/src/utils/filters.functions.d.ts +1 -1
- package/dist/src/utils/flattenEquipoMiembros.d.ts +38 -0
- package/dist/src/utils/formats.d.ts +4 -18
- package/dist/src/utils/inputs.functions.d.ts +2 -2
- package/dist/src/utils/kanbanOwnerFilterPermissions.d.ts +7 -0
- package/dist/src/utils/mapListItemToDetailsTaskData.d.ts +6 -0
- package/dist/src/utils/tanstack.functions.d.ts +12 -1
- package/dist/src/utils/taskKanbanBulkEligibility.d.ts +8 -7
- package/dist/tareas.cjs +9 -9
- package/dist/tareas.css +1 -1
- package/dist/tareas.es.js +6626 -6322
- package/package.json +1 -1
- package/dist/src/components/atoms/Toast.d.ts +0 -1
- package/dist/src/context/toastContext.d.ts +0 -14
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { IAllUsersOBPResponse } from '../infraestructure/interfaces/users-obp-response';
|
|
1
2
|
type TeamWork = {
|
|
2
3
|
id: number;
|
|
3
4
|
nombre: string;
|
|
@@ -6,6 +7,16 @@ type TeamWork = {
|
|
|
6
7
|
type TRequirement = {
|
|
7
8
|
id: number;
|
|
8
9
|
texto_corto: string;
|
|
10
|
+
/** Tarea previa obligatoria (`id_t_requerida` en listado / detalle acotado). */
|
|
11
|
+
estatus?: number | null;
|
|
12
|
+
responsable?: {
|
|
13
|
+
id?: number;
|
|
14
|
+
nombre?: string | null;
|
|
15
|
+
} | null;
|
|
16
|
+
equipo?: {
|
|
17
|
+
id?: number;
|
|
18
|
+
nombre?: string | null;
|
|
19
|
+
} | null;
|
|
9
20
|
};
|
|
10
21
|
type ImageType = {
|
|
11
22
|
formats: {
|
|
@@ -29,6 +40,12 @@ type Responsible = {
|
|
|
29
40
|
nombre: string;
|
|
30
41
|
imagen: ImageType;
|
|
31
42
|
};
|
|
43
|
+
/** Usuario de auditoría en listado kanban (`created_by` / `updated_by`). */
|
|
44
|
+
export type TaskUserAudit = {
|
|
45
|
+
id: number;
|
|
46
|
+
nombre: string;
|
|
47
|
+
email?: string;
|
|
48
|
+
};
|
|
32
49
|
type CommentItem = {
|
|
33
50
|
id: number;
|
|
34
51
|
comentario: string;
|
|
@@ -45,8 +62,10 @@ type CommentProps = {
|
|
|
45
62
|
comment: CommentItem;
|
|
46
63
|
};
|
|
47
64
|
type CommentsProps = {
|
|
48
|
-
data
|
|
49
|
-
|
|
65
|
+
data?: {
|
|
66
|
+
comentarios?: CommentItem[];
|
|
67
|
+
} | null;
|
|
68
|
+
currentUser: (CommentItem['autor'] | IAllUsersOBPResponse) | null;
|
|
50
69
|
taskId: number;
|
|
51
70
|
onNewComment: (addCommentF: boolean) => void;
|
|
52
71
|
};
|
|
@@ -66,6 +85,8 @@ type DetailsTaskData = {
|
|
|
66
85
|
fterminada: Date | null;
|
|
67
86
|
responsable: Responsible | null;
|
|
68
87
|
prioridad: string | null;
|
|
88
|
+
/** API `nivel_dificultad` (1–5); optional if older payloads omit it. */
|
|
89
|
+
nivel_dificultad?: number | string | null;
|
|
69
90
|
lista: string | null;
|
|
70
91
|
texto_corto: string | null;
|
|
71
92
|
texto_largo: string | null;
|
|
@@ -73,11 +94,16 @@ type DetailsTaskData = {
|
|
|
73
94
|
ids_t_dependientes: TRequirement[];
|
|
74
95
|
atraso: IAtrasoReason | null;
|
|
75
96
|
categoria: ICategory | null;
|
|
97
|
+
/** Quién creó / actualizó cuando el API envía `created_by` / `updated_by` en el listado. */
|
|
98
|
+
createdBy?: TaskUserAudit | null;
|
|
99
|
+
updatedBy?: TaskUserAudit | null;
|
|
76
100
|
};
|
|
77
101
|
type DetailsTaskProps = {
|
|
78
102
|
isOpen: boolean;
|
|
79
103
|
taskId: number;
|
|
80
104
|
setIsOpen: (isOpen: boolean) => void;
|
|
105
|
+
/** Si viene del listado kanban acotado, se evita la primera petición a `/api/detalleTarea/:id`. */
|
|
106
|
+
initialFromList?: DetailsTaskData | null;
|
|
81
107
|
};
|
|
82
108
|
type TabDetailsTaskItem = {
|
|
83
109
|
id: number;
|
|
@@ -87,7 +113,7 @@ type TabDetailsTaskItem = {
|
|
|
87
113
|
type TabDetailsTaskProps = {
|
|
88
114
|
items: TabDetailsTaskItem[];
|
|
89
115
|
};
|
|
90
|
-
export type { DetailsTaskData, DetailsTaskProps, TabDetailsTaskProps, TabDetailsTaskItem, CommentsProps, CommentItem, CommentProps };
|
|
116
|
+
export type { DetailsTaskData, DetailsTaskProps, TabDetailsTaskProps, TabDetailsTaskItem, CommentsProps, CommentItem, CommentProps, };
|
|
91
117
|
export type ICategory = {
|
|
92
118
|
id: number;
|
|
93
119
|
nombre: string;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Same rules as assignment (`ButtonAssignUsers`): Project Managers can edit regardless of status;
|
|
3
|
+
* other roles only when the task is still in backlog (`estatus === 0`).
|
|
4
|
+
*/
|
|
5
|
+
export declare const TASKS_PROJECT_MANAGER_ROLE = "Project Manager";
|
|
6
|
+
export declare function canEditTaskFields(role: string | undefined | null, status: number): boolean;
|
|
@@ -6,7 +6,7 @@ import { TFilters } from '../context/filtersLayout.context';
|
|
|
6
6
|
export declare const withoutProjectFilter: (filters: Record<string, unknown>) => {
|
|
7
7
|
[x: string]: unknown;
|
|
8
8
|
};
|
|
9
|
-
export declare const addEstructureToFilters: (filters: TFilters) =>
|
|
9
|
+
export declare const addEstructureToFilters: (filters: TFilters) => Record<string, unknown>;
|
|
10
10
|
export declare const formatQueryFilters: <T>({ search, filters }: {
|
|
11
11
|
search: string;
|
|
12
12
|
filters: T;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Listado kanban OBP: `equipo.miembros` es un árbol; `userOBP` (imagen) va en `idUser.userOBP`.
|
|
3
|
+
* Compatibilidad: si en un payload viejo `userOBP` solo existía en la raíz del nodo miembro, se usa ahí.
|
|
4
|
+
*/
|
|
5
|
+
type ObpThumbCore = {
|
|
6
|
+
imagen?: {
|
|
7
|
+
formats?: {
|
|
8
|
+
thumbnail?: {
|
|
9
|
+
url?: string | null;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
role?: {
|
|
14
|
+
id: number;
|
|
15
|
+
name: string;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
type ObpThumb = ObpThumbCore | null | undefined;
|
|
19
|
+
export type EquipoMiembroNode = {
|
|
20
|
+
idUser?: {
|
|
21
|
+
id: number;
|
|
22
|
+
nombre: string;
|
|
23
|
+
userOBP?: ObpThumb;
|
|
24
|
+
} | null;
|
|
25
|
+
userOBP?: ObpThumb;
|
|
26
|
+
miembros?: EquipoMiembroNode[];
|
|
27
|
+
};
|
|
28
|
+
export type EquipoMiembroVisit = {
|
|
29
|
+
idUser: NonNullable<EquipoMiembroNode['idUser']>;
|
|
30
|
+
node: EquipoMiembroNode;
|
|
31
|
+
};
|
|
32
|
+
export declare function forEachEquipoMiembroIdUser(miembros: EquipoMiembroNode[] | null | undefined, visit: (payload: EquipoMiembroVisit) => void): void;
|
|
33
|
+
export declare function thumbnailUrlFromEquipoMiembroVisit({ idUser, node }: EquipoMiembroVisit): string | undefined;
|
|
34
|
+
export declare function roleFromEquipoMiembroVisit({ idUser, node }: EquipoMiembroVisit): {
|
|
35
|
+
id: number;
|
|
36
|
+
name: string;
|
|
37
|
+
};
|
|
38
|
+
export {};
|
|
@@ -1,26 +1,12 @@
|
|
|
1
1
|
import { IUsers } from '../infraestructure/interfaces/users';
|
|
2
2
|
export declare const getMonthName: (month: number) => string;
|
|
3
|
-
export declare const formatDate: (date: Date) => string;
|
|
4
|
-
export declare const AddOBPUrl: (user: IUsers, url: string) =>
|
|
5
|
-
image: string;
|
|
6
|
-
id: number;
|
|
7
|
-
name: string;
|
|
8
|
-
nombre?: string;
|
|
9
|
-
tasksUser?: {
|
|
10
|
-
email: string;
|
|
11
|
-
id: number;
|
|
12
|
-
nombre: string;
|
|
13
|
-
};
|
|
14
|
-
role: {
|
|
15
|
-
id: number;
|
|
16
|
-
name: string;
|
|
17
|
-
};
|
|
18
|
-
};
|
|
3
|
+
export declare const formatDate: (date: Date | string | null | undefined) => string;
|
|
4
|
+
export declare const AddOBPUrl: (user: IUsers, url: string) => IUsers;
|
|
19
5
|
export declare const extractRequiredTaskResponsible: (idTRequerida?: {
|
|
20
6
|
responsable?: {
|
|
21
|
-
nombre
|
|
7
|
+
nombre?: string | null;
|
|
22
8
|
} | null;
|
|
23
9
|
equipo?: {
|
|
24
|
-
nombre
|
|
10
|
+
nombre?: string | null;
|
|
25
11
|
} | null;
|
|
26
12
|
} | null) => string | null;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare function debounce(callback: (...args:
|
|
1
|
+
export declare function debounce<T extends unknown[]>(callback: (...args: T) => void, delay?: number, options?: {
|
|
2
2
|
leading: boolean;
|
|
3
3
|
trailing: boolean;
|
|
4
|
-
}): (...args:
|
|
4
|
+
}): (...args: T) => void;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { TConfigs } from '../core/actions/get_tasks_response.action';
|
|
2
|
+
export declare const KANBAN_TODAS_TAREAS_ROLE_ALLOWLIST: readonly ["Project Manager", "Administrador"];
|
|
3
|
+
export declare function canUseKanbanTodasTareasFilter(role: string | undefined | null): boolean;
|
|
4
|
+
/**
|
|
5
|
+
* Evita enviar `config: 'todas'` al listado si el rol no está autorizado (p. ej. manipulación del payload).
|
|
6
|
+
*/
|
|
7
|
+
export declare function resolveOwnerConfigForKanbanListado(config: string | undefined | null, role: string | undefined | null): TConfigs;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { DetailsTaskData } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Construye un `DetailsTaskData` desde la fila del listado kanban (normalizada).
|
|
4
|
+
* Permite abrir el panel sin `GET /api/detalleTarea` cuando el listado ya trae los campos.
|
|
5
|
+
*/
|
|
6
|
+
export declare function mapListItemToDetailsTaskData(task: Record<string, unknown>): DetailsTaskData;
|
|
@@ -3,7 +3,17 @@
|
|
|
3
3
|
* `fetchAllKanbanListadoTaskIds` y `fetchNextPage` deben usar el mismo valor para no cortar mal el bucle.
|
|
4
4
|
*/
|
|
5
5
|
export declare const KANBAN_LISTADO_INFINITE_PAGE_SIZE = 30;
|
|
6
|
-
|
|
6
|
+
/** Subconjunto de infinite query usado por `fetchNextPage` (Kanban listado). */
|
|
7
|
+
type KanbanInfiniteFetchKey = {
|
|
8
|
+
hasNextPage?: boolean;
|
|
9
|
+
fetchNextPage?: () => void;
|
|
10
|
+
data?: {
|
|
11
|
+
pages: Array<{
|
|
12
|
+
tasks?: unknown[];
|
|
13
|
+
} | unknown[] | undefined>;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
export declare const fetchNextPage: (key: KanbanInfiniteFetchKey | null | undefined) => void;
|
|
7
17
|
export declare const getPaginationEstructure: (page: number) => {
|
|
8
18
|
pagination: {
|
|
9
19
|
page: number;
|
|
@@ -11,3 +21,4 @@ export declare const getPaginationEstructure: (page: number) => {
|
|
|
11
21
|
withCount: boolean;
|
|
12
22
|
};
|
|
13
23
|
};
|
|
24
|
+
export {};
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Elegibilidad para multiselección masiva del Kanban (listado y campaña)
|
|
3
|
-
*
|
|
2
|
+
* Elegibilidad para multiselección masiva del Kanban (listado y campaña): misma regla que
|
|
3
|
+
* `hasMoveMenuForBulk` en `Task.tsx` (menú «mover» + checkbox bulk).
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
* - **
|
|
7
|
-
*
|
|
8
|
-
* `repeatsToDo === 1` se trataba como «sin repeticiones» y permitía `0/1` con menú mover y bulk.
|
|
9
|
-
* - **Dependencia:** misma regla que el render de `ButtonMoveTask` (tarea previa obligatoria incompleta bloquea).
|
|
5
|
+
* - **`isVisibleMoveMenu`:** `(repeatsAreCompleted || dontHaveRepeats || statusIsZero) && status !== 2`
|
|
6
|
+
* - **Tarea requerida (como `ButtonMoveTask`):** `haveRequiredTask || !nameRequiredTask`, con
|
|
7
|
+
* `haveRequiredTask = (nameRequiredTask ?? '') !== '' && statusRequiredTask === 2`
|
|
10
8
|
*/
|
|
11
9
|
export type TaskKanbanBulkEligibilityInput = {
|
|
12
10
|
status: number;
|
|
@@ -15,4 +13,7 @@ export type TaskKanbanBulkEligibilityInput = {
|
|
|
15
13
|
repeatsToDo?: number | null | undefined;
|
|
16
14
|
repeats?: number | null | undefined;
|
|
17
15
|
};
|
|
16
|
+
/**
|
|
17
|
+
* `true` si la tarea puede mostrar fila «mover» + bulk en la card (`Task` / `KanbanCampania` «Seleccionar todas»).
|
|
18
|
+
*/
|
|
18
19
|
export declare function isTaskEligibleForKanbanBulkSelection(t: TaskKanbanBulkEligibilityInput): boolean;
|