Agregar columna de acciones en el listado de proformas recurrentes y mejorar la gestión de acciones
This commit is contained in:
parent
3d49fca2d2
commit
5775378ca6
@ -75,16 +75,15 @@ V1 NO incluye:
|
||||
|
||||
## Columna Acciones
|
||||
|
||||
La columna `Acciones` de `recurring-proformas` debe reutilizar `RdxRowActions`,
|
||||
la misma primitive visual utilizada por el listado de Proformas. Debe aparecer
|
||||
como última columna, con trigger compacto, menú accesible, alineación a la
|
||||
derecha y acciones destructivas separadas visualmente.
|
||||
La columna `Acciones` de `recurring-proformas` reutiliza `RdxRowActions`, la
|
||||
misma primitive visual del listado de Proformas. Se presenta como última
|
||||
columna, alineada a la derecha, con trigger compacto, menú accesible y
|
||||
separación visual para acciones destructivas.
|
||||
|
||||
La celda solo representa acciones preparadas por el controller o la página:
|
||||
no llama a la API, no utiliza DTOs y no reconstruye reglas de lifecycle.
|
||||
Las acciones disponibles siguen el lifecycle de `RecurringProforma`; la
|
||||
presentación e interacción siguen el estándar global de columnas de acciones
|
||||
del ERP.
|
||||
La celda solo representa callbacks preparados por la página; no invoca APIs
|
||||
directamente, no consume DTOs y no reconstruye reglas de dominio. El contenido
|
||||
del menú depende del lifecycle de `RecurringProforma`, mientras que su
|
||||
presentación e interacción siguen el estándar global del ERP.
|
||||
|
||||
---
|
||||
|
||||
|
||||
@ -3,8 +3,8 @@ import {
|
||||
DataTable,
|
||||
DataTableColumnHeader,
|
||||
RdxPageContainer,
|
||||
RdxRowActions,
|
||||
type RdxRowAction,
|
||||
RdxRowActions,
|
||||
} from "@repo/rdx-ui/components";
|
||||
import { Badge, Button } from "@repo/shadcn-ui/components";
|
||||
import type { ColumnDef } from "@tanstack/react-table";
|
||||
@ -17,22 +17,22 @@ import {
|
||||
PlayCircleIcon,
|
||||
Trash2Icon,
|
||||
} from "lucide-react";
|
||||
import { useMemo, useState } from "react";
|
||||
import { useCallback, useMemo, useState } from "react";
|
||||
import { Link } from "react-router-dom";
|
||||
|
||||
import { useTranslation } from "../../i18n";
|
||||
import type { RecurringProformaListRow } from "../shared/recurring-proforma-list";
|
||||
import { buildRecurringProformaDetailPath } from "../shared/recurring-proforma-navigation";
|
||||
import {
|
||||
type RecurringProformaAction,
|
||||
useRecurringProformaActionMutation,
|
||||
} from "../shared/hooks/use-recurring-proforma-action-mutation";
|
||||
import { useListRecurringProformasPageController } from "./controllers/use-list-recurring-proformas-page-controller";
|
||||
import type { RecurringProformaListRow } from "../shared/recurring-proforma-list";
|
||||
import { buildRecurringProformaDetailPath } from "../shared/recurring-proforma-navigation";
|
||||
|
||||
import { useListRecurringProformasPageController } from "./controllers/use-list-recurring-proformas-page-controller";
|
||||
import {
|
||||
formatRecurringProformaSchedule,
|
||||
formatRecurringProformaDateOnly,
|
||||
formatRecurringProformaDateTime,
|
||||
formatRecurringProformaSchedule,
|
||||
getRecurringProformaStatusKey,
|
||||
} from "./recurring-proforma-list-utils";
|
||||
import { RecurringProformaStatusSegmentedFilter } from "./ui/components/recurring-proforma-status-segmented-filter";
|
||||
@ -99,9 +99,12 @@ export const ListRecurringProformasPage = () => {
|
||||
} = useListRecurringProformasPageController();
|
||||
const actionMutation = useRecurringProformaActionMutation();
|
||||
const dateLocale = i18n.language === "en" ? "en-US" : "es-ES";
|
||||
const executeAction = (id: string, action: RecurringProformaAction) => {
|
||||
actionMutation.mutate({ id, action });
|
||||
};
|
||||
const executeAction = useCallback(
|
||||
(id: string, action: RecurringProformaAction) => {
|
||||
actionMutation.mutate({ id, action });
|
||||
},
|
||||
[actionMutation]
|
||||
);
|
||||
|
||||
const columns = useMemo<ColumnDef<RecurringProformaListRow>[]>(
|
||||
() => [
|
||||
@ -249,7 +252,7 @@ export const ListRecurringProformasPage = () => {
|
||||
),
|
||||
},
|
||||
],
|
||||
[actionMutation.isPending, dateLocale, t]
|
||||
[actionMutation.isPending, dateLocale, executeAction, t]
|
||||
);
|
||||
|
||||
if (hasBlockingError && pageError) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user