From 95882ee10d42c142f85a357d678f5b0cb9cef8a5 Mon Sep 17 00:00:00 2001 From: David Arranz Date: Wed, 10 Jul 2024 12:41:00 +0200 Subject: [PATCH] . --- .../app/quotes/components/QuotesDataTable.tsx | 35 ++++++++++++++++--- client/src/locales/es.json | 9 ++--- client/src/ui/textarea.tsx | 17 +++++---- shared/package.json | 2 ++ 4 files changed, 46 insertions(+), 17 deletions(-) diff --git a/client/src/app/quotes/components/QuotesDataTable.tsx b/client/src/app/quotes/components/QuotesDataTable.tsx index 53ac225..74ca224 100644 --- a/client/src/app/quotes/components/QuotesDataTable.tsx +++ b/client/src/app/quotes/components/QuotesDataTable.tsx @@ -1,4 +1,4 @@ -import { Badge, Card, CardContent } from "@/ui"; +import { Badge, Button, Card, CardContent } from "@/ui"; import { DataTableSkeleton, ErrorOverlay, SimpleEmptyState } from "@/components"; @@ -9,6 +9,7 @@ import { IListQuotes_Response_DTO, MoneyValue, UTCDateValue } from "@shared/cont import { ColumnDef } from "@tanstack/react-table"; import { t } from "i18next"; import { useMemo } from "react"; +import { Trans } from "react-i18next"; import { useNavigate } from "react-router-dom"; import { useQuotesList } from "../hooks"; @@ -31,7 +32,6 @@ export const QuotesDataTable = () => { accessor: "date", header: () => <>{t("quotes.list.columns.date")}, cell: ({ table, row: { index, original }, column, getValue }) => { - console.log(original.date); const quoteDate = UTCDateValue.create(original.date); return quoteDate.isSuccess ? quoteDate.object.toLocaleDateString("es-ES") : "-"; }, @@ -42,8 +42,17 @@ export const QuotesDataTable = () => { id: "customer_information" as const, accessorKey: "customer_information", header: () => <>{t("quotes.list.columns.customer_information")}, - cell: ({ renderValue }: { renderValue: () => any }) => ( -
{renderValue()}
+ cell: ({ row: { original } }) => ( +
+ {original.customer_information.split("\n").map((item, index) => { + return ( + + {item} +
+
+ ); + })} +
), enableResizing: false, size: 10, @@ -76,6 +85,24 @@ export const QuotesDataTable = () => { enableResizing: false, size: 20, }, + { + id: "edit-acion", + header: () => null, + cell: ({ row, table }: { row: Row; table: Table }) => ( + + ), + enableResizing: false, + size: 20, + }, ], [] ); diff --git a/client/src/locales/es.json b/client/src/locales/es.json index 5702ee7..949ec05 100644 --- a/client/src/locales/es.json +++ b/client/src/locales/es.json @@ -31,7 +31,8 @@ "duplicate_rows_tooltip": "Duplica las fila(s) seleccionadas(s)", "pick_date": "Elige una fecha", "required_field": "Este campo es obligatorio", - "unsaved_changes_prompt": "Los últimos cambios no se han guardado. Si continúas, se perderán" + "unsaved_changes_prompt": "Los últimos cambios no se han guardado. Si continúas, se perderán", + "edit": "Editar" }, "main_menu": { "home": "Inicio", @@ -134,9 +135,9 @@ "placeholder": "" }, "customer_information": { - "label": "Cliente", - "desc": "Datos del cliente de esta cotización", - "placeholder": "Nombre\nDirección\n..." + "label": "Datos del cliente", + "desc": "Escriba el nombre del cliente en la primera línea, la direccion en la segunda y el código postal y ciudad en la tercera.", + "placeholder": "Nombre y apellidos\nCalle y número\nCódigo postal y ciudad..." }, "payment_method": { "label": "Forma de pago", diff --git a/client/src/ui/textarea.tsx b/client/src/ui/textarea.tsx index 9f9a6dc..1fe0363 100644 --- a/client/src/ui/textarea.tsx +++ b/client/src/ui/textarea.tsx @@ -1,24 +1,23 @@ -import * as React from "react" +import * as React from "react"; -import { cn } from "@/lib/utils" +import { cn } from "@/lib/utils"; -export interface TextareaProps - extends React.TextareaHTMLAttributes {} +export interface TextareaProps extends React.TextareaHTMLAttributes {} const Textarea = React.forwardRef( ({ className, ...props }, ref) => { return (