From 9300868ce37238746598db0e2c5210e11b2f53d8 Mon Sep 17 00:00:00 2001 From: David Arranz Date: Mon, 2 Sep 2024 17:44:49 +0200 Subject: [PATCH] =?UTF-8?q?Arreglos=20de=20errores=20antes=20de=20subir=20?= =?UTF-8?q?a=20producci=C3=B3n?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/package.json | 1 + client/src/Routes.tsx | 8 +- client/src/app/ErrorPage.tsx | 55 +--- .../components/useCatalogTableColumns.tsx | 6 +- client/src/app/dashboard/index.tsx | 2 - .../components/useCatalogTableColumns.tsx | 4 +- client/src/app/index.ts | 4 +- .../AppendCatalogArticleRowButton.tsx | 2 +- .../components/AppendEmptyRowButton.tsx | 2 +- .../QuoteItemsSortableDataTable.tsx | 17 +- .../QuoteItemsSortableDataTableToolbar.tsx | 6 +- .../app/quotes/components/QuotePDFPreview.tsx | 13 +- .../src/app/quotes/components/QuoteResume.tsx | 12 +- .../app/quotes/components/QuotesDataTable.tsx | 59 ++-- .../editors/QuoteDetailsCardEditor copy.tsx | 278 ------------------ .../editors/QuoteDetailsCardEditor.tsx | 4 +- .../editors/QuoteDocumentsCardEditor.tsx | 4 +- .../components/useQuoteDataTableColumns.tsx | 6 +- client/src/app/quotes/edit.tsx | 3 +- .../src/app/quotes/hooks/useDetailColumns.tsx | 5 +- client/src/app/quotes/layout.tsx | 30 +- .../DataTable/DataTableRowActions.tsx | 4 +- .../DataTable/DataTableSelectionColumn.tsx | 2 +- .../components/Forms/FormCurrencyField.tsx | 8 +- .../components/Forms/FormDatePickerField.tsx | 3 +- .../components/Forms/FormPercentageField.tsx | 2 +- .../components/Forms/FormQuantityField.tsx | 6 +- .../components/Forms/FormTextAreaField.tsx | 2 +- client/src/components/PDFViewer/PDFViewer.tsx | 6 +- .../SorteableDataTable/SortableDataTable.tsx | 29 +- .../SorteableDataTable/SortableTableRow.tsx | 21 +- .../src/lib/hooks/useDataSource/useList.tsx | 6 +- .../src/lib/hooks/useDataSource/useMany.tsx | 6 +- .../src/lib/hooks/useDataSource/useRemove.tsx | 3 +- .../useLocalization/usePreferredLanguage.tsx | 4 +- .../src/lib/hooks/useQueryKey/KeyBuilder.ts | 2 +- client/src/lib/hooks/useTheme/useTheme.tsx | 11 +- client/src/lib/hooks/useUploadFile/index.ts | 1 - .../lib/hooks/useUploadFile/useUploadFile.ts | 57 ---- client/src/ui/input-otp.tsx | 69 ----- .../contexts/common/domain/RuleValidator.ts | 2 +- .../domain/entities/Address/PostalCode.ts | 23 +- .../contexts/common/domain/entities/Entity.ts | 2 +- .../common/domain/entities/MoneyValue.ts | 21 +- .../contexts/common/domain/entities/Phone.ts | 30 +- shared/lib/utilities/currencies.ts | 2 +- shared/lib/utilities/languages_data.ts | 2 +- shared/package.json | 3 +- 48 files changed, 196 insertions(+), 652 deletions(-) delete mode 100644 client/src/app/quotes/components/editors/QuoteDetailsCardEditor copy.tsx delete mode 100644 client/src/lib/hooks/useUploadFile/index.ts delete mode 100644 client/src/lib/hooks/useUploadFile/useUploadFile.ts delete mode 100644 client/src/ui/input-otp.tsx diff --git a/client/package.json b/client/package.json index a15715e..404fddf 100644 --- a/client/package.json +++ b/client/package.json @@ -49,6 +49,7 @@ "class-variance-authority": "^0.7.0", "cmdk": "^1.0.0", "date-fns": "^3.6.0", + "embla-carousel-react": "^8.2.0", "i18next": "^23.12.2", "i18next-browser-languagedetector": "^8.0.0", "joi": "^17.13.1", diff --git a/client/src/Routes.tsx b/client/src/Routes.tsx index 3fee279..3f8a102 100644 --- a/client/src/Routes.tsx +++ b/client/src/Routes.tsx @@ -77,13 +77,7 @@ export const Routes = () => { }, { path: "/quotes", - element: ( - - - - - - ), + element: , children: [ { index: true, diff --git a/client/src/app/ErrorPage.tsx b/client/src/app/ErrorPage.tsx index ac753a3..06ef747 100644 --- a/client/src/app/ErrorPage.tsx +++ b/client/src/app/ErrorPage.tsx @@ -1,31 +1,6 @@ import { Button } from "@/ui"; -import { useLocation, useNavigate } from "react-router-dom"; -// import Button - -/*const isDev = process.env.REACT_APP_NODE_ENV === "development"; -const hostname = `${ - isDev ? process.env.REACT_APP_DEV_API_URL : process.env.REACT_APP_PROD_API_URL -}`;*/ - -type ErrorPageProps = { - error?: string; -}; -export const ErrorPage = (props: ErrorPageProps) => { - const navigate = useNavigate(); - const location = useLocation(); - - const navMsg = location.state?.error; - const msg = navMsg ? ( -

{navMsg}

- ) : props.error ? ( -

{props.error}

- ) : ( -

- The targeted page "{location.pathname}" was not found, please confirm the spelling and - try again. -

- ); +export const ErrorPage = () => { return (
@@ -37,37 +12,11 @@ export const ErrorPage = (props: ErrorPageProps) => { The page you're looking for doesn't exist or has been moved.

-
); - - return ( -
- {msg} - - - - - -
- ); }; diff --git a/client/src/app/catalog/components/useCatalogTableColumns.tsx b/client/src/app/catalog/components/useCatalogTableColumns.tsx index 4c70c6c..4f0cca5 100644 --- a/client/src/app/catalog/components/useCatalogTableColumns.tsx +++ b/client/src/app/catalog/components/useCatalogTableColumns.tsx @@ -6,7 +6,7 @@ import { Badge } from "@/ui"; import { useMemo } from "react"; export const useCatalogTableColumns = ( - actions: DataTablaRowActionFunction + actions: DataTablaRowActionFunction ): ColumnDef[] => { const customerColumns: ColumnDef[] = useMemo( () => [ @@ -66,8 +66,8 @@ export const useCatalogTableColumns = ( { id: "actions", header: "Acciones", - cell: ({ row }) => { - return ; + cell: (context) => { + return ; }, }, ], diff --git a/client/src/app/dashboard/index.tsx b/client/src/app/dashboard/index.tsx index 0eebc10..e71a697 100644 --- a/client/src/app/dashboard/index.tsx +++ b/client/src/app/dashboard/index.tsx @@ -2,10 +2,8 @@ import { Layout, LayoutContent, LayoutHeader } from "@/components"; import { useGetProfile } from "@/lib/hooks"; import { Skeleton } from "@/ui"; import { t } from "i18next"; -import { useNavigate } from "react-router-dom"; export const DashboardPage = () => { - const navigate = useNavigate(); const { data: userIdentity, status } = useGetProfile(); return ( diff --git a/client/src/app/dealers/components/useCatalogTableColumns.tsx b/client/src/app/dealers/components/useCatalogTableColumns.tsx index d6f9f4f..5626742 100644 --- a/client/src/app/dealers/components/useCatalogTableColumns.tsx +++ b/client/src/app/dealers/components/useCatalogTableColumns.tsx @@ -66,8 +66,8 @@ export const useCustomerInvoiceDataTableColumns = ( { id: "actions", header: "Acciones", - cell: ({ row }) => { - return ; + cell: (context) => { + return ; }, }, ], diff --git a/client/src/app/index.ts b/client/src/app/index.ts index 3f54d3e..8046f1a 100644 --- a/client/src/app/index.ts +++ b/client/src/app/index.ts @@ -1,8 +1,8 @@ -export * from "./ErrorPage"; -export * from "./StartPage"; export * from "./auth"; export * from "./catalog"; export * from "./dashboard"; export * from "./dealers"; +export * from "./ErrorPage"; export * from "./quotes"; export * from "./settings"; +export * from "./StartPage"; diff --git a/client/src/app/quotes/components/AppendCatalogArticleRowButton.tsx b/client/src/app/quotes/components/AppendCatalogArticleRowButton.tsx index 3953ec8..72cf751 100644 --- a/client/src/app/quotes/components/AppendCatalogArticleRowButton.tsx +++ b/client/src/app/quotes/components/AppendCatalogArticleRowButton.tsx @@ -11,7 +11,7 @@ export interface AppendCatalogArticleRowButtonProps extends ButtonProps { export const AppendCatalogArticleRowButton = forwardRef( ( { label = t("common.append_article"), className, ...props }: AppendCatalogArticleRowButtonProps, - ref + _ref ): JSX.Element => (