diff --git a/client/src/app/quotes/components/editors/CatalogPickerDialog.tsx b/client/src/app/quotes/components/editors/CatalogPickerDialog.tsx index a766fe8..b050ed3 100644 --- a/client/src/app/quotes/components/editors/CatalogPickerDialog.tsx +++ b/client/src/app/quotes/components/editors/CatalogPickerDialog.tsx @@ -9,6 +9,7 @@ import { } from "@/ui"; import { DataTableProvider } from "@/lib/hooks"; +import { t } from "i18next"; import { CatalogPickerDataTable } from "../CatalogPickerDataTable"; export const CatalogPickerDialog = ({ @@ -24,18 +25,15 @@ export const CatalogPickerDialog = ({ - Are you absolutely sure? - - This action cannot be undone. This will permanently delete your account and remove your - data from our servers. - + {t("quotes.catalog_picker_dialog.title")} + {t("quotes.catalog_picker_dialog.subtitle")} - Choose + {t("common.close")} diff --git a/client/src/app/quotes/components/editors/QuoteDetailsCardEditor.tsx b/client/src/app/quotes/components/editors/QuoteDetailsCardEditor.tsx index 5617d34..9beedc1 100644 --- a/client/src/app/quotes/components/editors/QuoteDetailsCardEditor.tsx +++ b/client/src/app/quotes/components/editors/QuoteDetailsCardEditor.tsx @@ -11,6 +11,7 @@ import { ResizableHandle, ResizablePanel, ResizablePanelGroup } from "@/ui"; import { CurrencyData, Language, Quantity } from "@shared/contexts"; import { ColumnDef } from "@tanstack/react-table"; import { t } from "i18next"; +import { ChevronDownIcon, ChevronUpIcon, CopyIcon, Trash2Icon } from "lucide-react"; import { useCallback, useState } from "react"; import { useFieldArray, useFormContext } from "react-hook-form"; import { useDetailColumns } from "../../hooks"; @@ -51,6 +52,16 @@ export const QuoteDetailsCardEditor = ({ enableSorting: false, enableResizing: false, },*/ + + { + id: "description" as const, + accessorKey: "description", + header: t("quotes.form_fields.items.description.label"), + size: 24, + cell: ({ row: { index } }) => { + return ; + }, + }, { id: "quantity" as const, accessorKey: "quantity", @@ -61,7 +72,6 @@ export const QuoteDetailsCardEditor = ({ cell: ({ row: { index } }) => { return ( { - return ( - - ); - }, - }, { id: "unit_price" as const, accessorKey: "unit_price", @@ -93,7 +88,6 @@ export const QuoteDetailsCardEditor = ({ cell: ({ row: { index } }) => { return ( { return ( { return ( { return ( , onClick: () => table.options.meta?.duplicateItems(row.index), }, { label: t("common.insert_row_above"), + icon: , onClick: () => table.options.meta?.insertItem(row.index), }, { label: t("common.insert_row_below"), + icon: , onClick: () => table.options.meta?.insertItem(row.index + 1), }, @@ -189,7 +184,8 @@ export const QuoteDetailsCardEditor = ({ }, { label: t("common.remove_row"), - shortcut: "⌘⌫", + //shortcut: "⌘⌫", + icon: , onClick: () => { table.options.meta?.deleteItems(row.index); }, diff --git a/client/src/app/quotes/create.tsx b/client/src/app/quotes/create.tsx index a43bf3b..56a8a77 100644 --- a/client/src/app/quotes/create.tsx +++ b/client/src/app/quotes/create.tsx @@ -1,6 +1,7 @@ import { BackHistoryButton, FormDatePickerField, + FormGroup, FormTextAreaField, FormTextField, LoadingOverlay, @@ -9,7 +10,7 @@ import { t } from "i18next"; import { SubmitButton } from "@/components"; import { useUnsavedChangesNotifier } from "@/lib/hooks"; -import { Button, Form } from "@/ui"; +import { Button, Form, Separator } from "@/ui"; import { joiResolver } from "@hookform/resolvers/joi"; import { ICreateQuote_Request_DTO } from "@shared/contexts"; import Joi from "joi"; @@ -17,6 +18,7 @@ import { useMemo } from "react"; import { SubmitHandler, useForm } from "react-hook-form"; import { useNavigate } from "react-router-dom"; import { toast } from "react-toastify"; +import SpanishJoiMessages from "../../spanish-joi-messages.json"; import { useQuotes } from "./hooks"; interface QuoteDataForm extends ICreateQuote_Request_DTO {} @@ -41,13 +43,14 @@ export const QuoteCreate = () => { defaultValues, resolver: joiResolver( Joi.object({ - //reference: Joi.string().required(), - customer_information: Joi.string().required(), - date: Joi.date().required(), customer_reference: Joi.string(), + date: Joi.date().required(), + customer_information: Joi.string().required(), }), { - //messages: SpanishJoiMessages, + messages: { + es: SpanishJoiMessages, + }, } ), }); @@ -101,49 +104,47 @@ export const QuoteCreate = () => { - {/**/} + + navigate("/quotes")}> + {t("common.discard")} + + + + } + > + - + - + - - - - navigate("/quotes")}> - {t("common.discard")} - - - - + + diff --git a/client/src/app/quotes/hooks/useDetailColumns.tsx b/client/src/app/quotes/hooks/useDetailColumns.tsx index 1dfaff2..323e2f2 100644 --- a/client/src/app/quotes/hooks/useDetailColumns.tsx +++ b/client/src/app/quotes/hooks/useDetailColumns.tsx @@ -28,6 +28,23 @@ export function useDetailColumns( // const lastSelectedId = ""; return useMemo(() => { + if (enableDragHandleColumn) { + columns.unshift({ + id: "row_drag_handle", + /*header: () => ( + + ),*/ + header: () => null, + cell: (info) => , + size: 2, + minSize: 2, + maxSize: 2, + + enableSorting: false, + enableHiding: false, + }); + } + if (enableSelectionColumn) { columns.unshift({ id: "select", @@ -63,23 +80,6 @@ export function useDetailColumns( }); } - if (enableDragHandleColumn) { - columns.unshift({ - id: "row_drag_handle", - /*header: () => ( - - ),*/ - header: () => null, - cell: (info) => , - size: 2, - minSize: 2, - maxSize: 2, - - enableSorting: false, - enableHiding: false, - }); - } - if (enableActionsColumn) { columns.push({ id: "row_actions", diff --git a/client/src/components/DataTable/DataTableRowActions.tsx b/client/src/components/DataTable/DataTableRowActions.tsx index 498987c..b942e1d 100644 --- a/client/src/components/DataTable/DataTableRowActions.tsx +++ b/client/src/components/DataTable/DataTableRowActions.tsx @@ -13,7 +13,8 @@ import { } from "@/ui"; import { CellContext } from "@tanstack/react-table"; import { t } from "i18next"; -import { MoreHorizontalIcon } from "lucide-react"; +import { MoreVerticalIcon } from "lucide-react"; +import { ReactElement } from "react"; export type DataTablaRowActionFunction = ( props: CellContext @@ -21,6 +22,7 @@ export type DataTablaRowActionFunction = ( export type DataTableRowActionDefinition = { label: string | "-"; + icon?: ReactElement; shortcut?: string; onClick?: (props: CellContext, e: React.BaseSyntheticEvent) => void; }; @@ -46,7 +48,7 @@ export function DataTableRowActions({ variant='link' className={cn("w-4 h-4 mt-2 text-ring hover:text-muted-foreground", className)} > - + {t("common.open_menu")} @@ -62,8 +64,9 @@ export function DataTableRowActions({ key={index} onClick={(event) => (action.onClick ? action.onClick(rowContext, event) : null)} > + {action.icon && <>{action.icon}>} {action.label} - {action.shortcut} + {action.shortcut && {action.shortcut}} ) )} diff --git a/client/src/components/DataTable/DataTableToolbar/DataTableToolbar.tsx b/client/src/components/DataTable/DataTableToolbar/DataTableToolbar.tsx index b6cfe16..748e0e4 100644 --- a/client/src/components/DataTable/DataTableToolbar/DataTableToolbar.tsx +++ b/client/src/components/DataTable/DataTableToolbar/DataTableToolbar.tsx @@ -5,7 +5,7 @@ import { DataTableFilterField, useDataTableContext } from "@/lib/hooks"; import { cn } from "@/lib/utils"; import { Button, Input } from "@/ui"; import { t } from "i18next"; -import { XIcon } from "lucide-react"; +import { SearchIcon, XIcon } from "lucide-react"; import { DataTableColumnOptions } from "./DataTableColumnOptions"; interface DataTableToolbarProps extends React.HTMLAttributes { @@ -32,6 +32,7 @@ export function DataTableToolbar({ {...props} > + {t("common.pick_date")} )} - + diff --git a/client/src/components/Forms/FormTextField.tsx b/client/src/components/Forms/FormTextField.tsx index fd982e5..4cb95f9 100644 --- a/client/src/components/Forms/FormTextField.tsx +++ b/client/src/components/Forms/FormTextField.tsx @@ -13,7 +13,7 @@ const formTextFieldVariants = cva("", { variants: { variant: { default: "", - outline: + ghost: "border-0 focus-visible:border focus-visible:border-input focus-visible:ring-0 focus-visible:ring-offset-0 ", }, }, @@ -48,6 +48,7 @@ export const FormTextField = React.forwardRef { return ( {label && ( - + )}