diff --git a/.vscode/launch.json b/.vscode/launch.json index fde3489c..e31db67b 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -2,12 +2,12 @@ "version": "0.2.0", "configurations": [ { - "name": "WEB: Run in Development Mode", - "type": "node", + "name": "WEB: Vite (Chrome)", + "type": "pwa-msedge", "request": "launch", - "runtimeExecutable": "pnpm", - "runtimeArgs": ["run", "dev", "--filter", "web"], - "console": "integratedTerminal" + "url": "http://localhost:5173", + "webRoot": "${workspaceFolder}/apps/web", + "sourceMaps": true }, { "name": "SERVER: Run in Development Mode", diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 00000000..8514a66c --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,20 @@ +{ + "version": "2.0.0", + "tasks": [ + { + "label": "web:dev", + "type": "shell", + "command": "pnpm --filter web dev", + "isBackground": true, + "problemMatcher": { + "owner": "vite", + "pattern": [{ "regexp": "." }], + "background": { + "activeOnStart": true, + "beginsPattern": ".*Local:.*http://.*:5173/.*", + "endsPattern": ".*ready in .*" + } + } + } + ] +} diff --git a/apps/web/src/app.tsx b/apps/web/src/app.tsx index 34fa44bd..b0912ba1 100644 --- a/apps/web/src/app.tsx +++ b/apps/web/src/app.tsx @@ -62,7 +62,20 @@ export const App = () => { - + {import.meta.env.DEV && } diff --git a/apps/web/vite.config.mts b/apps/web/vite.config.mts index f3d89263..525491f5 100644 --- a/apps/web/vite.config.mts +++ b/apps/web/vite.config.mts @@ -1,10 +1,13 @@ import tailwindcss from "@tailwindcss/vite"; import react from "@vitejs/plugin-react"; -import path from "path"; +import path from "node:path"; import { defineConfig } from "vite"; // https://vite.dev/config/ export default defineConfig({ + build: { + sourcemap: true, + }, plugins: [react(), tailwindcss()], resolve: { alias: { diff --git a/modules/core/src/common/locales/en.json b/modules/core/src/common/locales/en.json index f7cb7d25..f83be418 100644 --- a/modules/core/src/common/locales/en.json +++ b/modules/core/src/common/locales/en.json @@ -1,5 +1,6 @@ { "common": { + "cancel": "Cancel", "required": "•" }, "components": { diff --git a/modules/core/src/common/locales/es.json b/modules/core/src/common/locales/es.json index 5a768fe3..400413c1 100644 --- a/modules/core/src/common/locales/es.json +++ b/modules/core/src/common/locales/es.json @@ -1,5 +1,6 @@ { "common": { + "cancel": "Cancelar", "required": "•" }, "components": { diff --git a/modules/customers/src/common/locales/en.json b/modules/customers/src/common/locales/en.json index 46c3968f..b509711b 100644 --- a/modules/customers/src/common/locales/en.json +++ b/modules/customers/src/common/locales/en.json @@ -2,6 +2,7 @@ "common": { "more_details": "More details", "back_to_list": "Back to the list", + "cancel": "Cancel", "save": "Save" }, "pages": { diff --git a/modules/customers/src/common/locales/es.json b/modules/customers/src/common/locales/es.json index a65baece..1fa8ac1f 100644 --- a/modules/customers/src/common/locales/es.json +++ b/modules/customers/src/common/locales/es.json @@ -2,6 +2,7 @@ "common": { "more_details": "Más detalles", "back_to_list": "Back to the list", + "cancel": "Cancelar", "save": "Guardar" }, "pages": { diff --git a/modules/customers/src/web/components/customers-list-grid.tsx b/modules/customers/src/web/components/customers-list-grid.tsx index 9bf32b3d..782adcdc 100644 --- a/modules/customers/src/web/components/customers-list-grid.tsx +++ b/modules/customers/src/web/components/customers-list-grid.tsx @@ -79,7 +79,7 @@ export const CustomersListGrid = () => { size='icon' className='size-8' onClick={() => { - navigate(`${data.id}/edit`, { relative: "path" }); + navigate(`${data.id}/edit`, { relative: "route" }); }} > diff --git a/modules/customers/src/web/pages/update/update.tsx b/modules/customers/src/web/pages/update/update.tsx index 982f0b83..778cbe66 100644 --- a/modules/customers/src/web/pages/update/update.tsx +++ b/modules/customers/src/web/pages/update/update.tsx @@ -36,10 +36,11 @@ export const CustomerUpdate = () => { const handleSubmit = async (formData: CustomerUpdateData) => { try { const result = await mutateAsync({ id: customerId!, data: formData }); + console.log(result); if (result) { showSuccessToast(t("pages.update.successTitle"), t("pages.update.successMsg")); - navigate("/customers/list"); + navigate("/customers/list", { relative: "path" }); } } catch (e) { showErrorToast(t("pages.update.errorTitle"), (e as Error).message); @@ -94,7 +95,7 @@ export const CustomerUpdate = () => { <> -
+

{t("pages.update.title")}