From 0a14fe88824858937ef396de85e04ade8dbe83e3 Mon Sep 17 00:00:00 2001 From: Luis Felipe Cadavid Date: Mon, 30 Sep 2024 15:20:47 -0500 Subject: [PATCH] ref: change in different components --- app/account/controller/AuthController.tsx | 28 ------- app/account/login/page.tsx | 4 +- app/home/page.tsx | 4 +- package/styles/tailwind.css | 6 ++ package/utils/Constants.tsx | 6 +- package/utils/language/i18n.tsx | 95 ++++++++++++++++++++++- 6 files changed, 106 insertions(+), 37 deletions(-) delete mode 100644 app/account/controller/AuthController.tsx diff --git a/app/account/controller/AuthController.tsx b/app/account/controller/AuthController.tsx deleted file mode 100644 index 3a30ae6..0000000 --- a/app/account/controller/AuthController.tsx +++ /dev/null @@ -1,28 +0,0 @@ -import { BASE_URL_AUTHENTICATION } from "@package/config/ApiPath" -import { FetchData } from "@package/config/FetchData" - -async function auth(ae_user: string, ae_password: string): Promise { - const options: RequestInit = { - method: "POST", - // mode: 'cors', - headers: { - "Content-Type": "application/json", - }, - body: JSON.stringify({ - username: ae_user, - password: ae_password, - }), - } - - const data = await FetchData<{ token: string }>(BASE_URL_AUTHENTICATION, "login", options) - - console.log(data) - if (data.correct) { - return data.object.token - } else { - console.error("Error en la autenticación:", data.message) - return "error en la autenticación" - } -} - -export { auth } diff --git a/app/account/login/page.tsx b/app/account/login/page.tsx index 8f7e29e..e2510a9 100644 --- a/app/account/login/page.tsx +++ b/app/account/login/page.tsx @@ -1,8 +1,8 @@ "use client"; import React, { useState } from "react"; import { useTranslation } from "react-i18next"; -import ForgotPasswordForm from "@organisms/ForgotPasswordForm"; -import LoginForm from "@organisms/LoginForm"; +import ForgotPasswordForm from "@organisms/Auth/ForgotPasswordForm"; +import LoginForm from "@organisms/Auth/LoginForm"; const LoginPage: React.FC = () => { const { t } = useTranslation(); diff --git a/app/home/page.tsx b/app/home/page.tsx index 585e90d..a801422 100644 --- a/app/home/page.tsx +++ b/app/home/page.tsx @@ -1,10 +1,10 @@ import React from "react" -import PreCheckoutScreen from "@app/selfcheckout/precheckout/page" +import PreCheckout from "@app/selfcheckout/precheckout/page" const HomeAfterLogin: React.FC = () => { return (
- +
) } diff --git a/package/styles/tailwind.css b/package/styles/tailwind.css index 54fd827..d969f83 100644 --- a/package/styles/tailwind.css +++ b/package/styles/tailwind.css @@ -7,3 +7,9 @@ height: 60px; font-size: 14px; } +.full-width-button { + width: 100%; + height: 60px; + font-size: 16px; + font-weight: bold; +} diff --git a/package/utils/Constants.tsx b/package/utils/Constants.tsx index f746f24..c004ff0 100644 --- a/package/utils/Constants.tsx +++ b/package/utils/Constants.tsx @@ -10,9 +10,13 @@ export const GRID_SIZE = 10 export const DEFAULT_PASSWORD = 'Bopos123' -// Constants for special cases in Dashboard statistics export const INFINITY_SYMBOL = '∞' export const NOT_AVAILABLE = 'N/A' export const BASE_URL_LANGUAGE = i18n.language + +export const PAGE_SIZE_OPTIONS = [6, 10, 20, 50, 100] + +export const DAYS_OF_WEEK = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'] + diff --git a/package/utils/language/i18n.tsx b/package/utils/language/i18n.tsx index 618f524..72432de 100644 --- a/package/utils/language/i18n.tsx +++ b/package/utils/language/i18n.tsx @@ -4,14 +4,16 @@ import { initReactI18next } from 'react-i18next'; i18n .use(initReactI18next) .init({ - fallbackLng: 'en', // Default language - lng: 'en', // Specify the default language to use + fallbackLng: 'en', + lng: 'en', resources: { en: { translation: { lbl_wellcome: "Welcome", lbl_login: "Login", lbl_email: "Email", + lbl_phone: "Phone", + lbl_address: "Address", lbl_reset_password: "Reset password", lbl_username: "Username", lbl_password: "Password", @@ -42,9 +44,31 @@ i18n lbl_clear: "Clear", lbl_cancel: "Cancel", lbl_enter: "Enter", + lbl_confirm: "Confirm", lbl_alphabetical: "Alphabetical", lbl_numeric: "Numeric", - + lbl_client_search: "Client Search", + lbl_id_type: "ID Type", + lbl_selectid_type: "Select ID Type", + lbl_search_result: "Search Result", + lbl_id_number: "ID Number", + lbl_search: "Search", + lbl_name: "Name", + lbl_last_name: "Last Name", + lbl_use_generic_customer: "Use generic customer", + lbl_create_new_customer: "Create new customer", + lbl_continue: "Continue", + lbl_name_customer: "Customer Name", + lbl_dni_customer: "Customer DNI", + lbl_email_customer: "Customer Email", + lbl_subtotal: "Subtotal", + lbl_discount: "Discount", + lbl_tax: "Tax", + lbl_total: "Total", + lbl_void_order: "Void order", + lbl_void_last: "Void last", + lbl_resume: "Resume", + msj_resume_previously_suspended_order: "Resume a previously suspended order", msj_transfer_Order_another_station: "Transfer an order to another station", msj_generate_resale: "Generate a resale", @@ -75,8 +99,28 @@ i18n msj_enter_your_email: "Enter your email", msj_enter_document_number: "Enter the document number", msj_change_to: "Change to", + msj_loading_id_types: "Loading ID types", + msj_enter_id_number: "Enter the document number", + mjs_search_for_client: "Search for a client", + msj_no_affiliate: "The client is not affiliated", + msj_choose_option_for_non_affiliate: "The client is not affiliated, choose an option", + msj_confirm_generic_customer: "Are you sure you want to continue with a generic customer?", + msj_are_you_sure_generic_customer: "Are you sure you want to continue with a generic customer?", + msj_enter_plu: "Enter PLU", tle_self_checkout: "SELF CHECKOUT", + tle_product: "PRODUCT", + tle_description: "DESCRIPTION", + tle_amount: "AMOUNT", + tle_total: "TOTAL", + tle_unit_value: "UNIT VALUE", + tle_tax: "TAX", + tle_discount: "DISCOUNT", + tle_item_count: "ITEM COUNT", + tle_total_unit: "TOTAL UNIT VALUE", + tle_total_taxes: "TOTAL TAXES", + tle_total_discount: "TOTAL DISCOUNT", + }, }, es: { @@ -85,6 +129,8 @@ i18n lbl_login: "Iniciar sesión", lbl_username: "Nombre de usuario", lbl_email: "Correo electrónico", + lbl_phone: "Teléfono", + lbl_address: "Dirección", lbl_reset_password: "Restablecer contraseña", lbl_password: "Contraseña", lbl_enter_PLU: "Ingrese PLU", @@ -114,8 +160,30 @@ i18n lbl_clear: "Limpiar", lbl_cancel: "Cancelar", lbl_enter: "Entrar", + lbl_confirm: "Confirmar", lbl_alphabetical: "Alfabético", lbl_numeric: "Numérico", + lbl_client_search: "Búsqueda de Cliente", + lbl_search_result: "Resultado de la búsqueda", + lbl_id_type: "Tipo de documento", + lbl_selectid_type: "Seleccione el tipo de documento", + lbl_id_number: "Número de documento", + lbl_search: "Buscar", + lbl_name: "Nombre", + lbl_last_name: "Apellido", + lbl_use_generic_customer: "Usar cliente genérico", + lbl_create_new_customer: "Crear nuevo cliente", + lbl_continue: "Continuar", + lbl_name_customer: "Nombre del cliente", + lbl_dni_customer: "DNI del cliente", + lbl_email_customer: "Correo electrónico del cliente", + lbl_subtotal: "Subtotal", + lbl_discount: "Descuento", + lbl_tax: "Impuesto", + lbl_total: "Total", + lbl_void_order: "Anular orden", + lbl_void_last: "Anular último", + lbl_resume: "Reanudar", msj_resume_previously_suspended_order: "Reanuda una orden previamente suspendida", msj_transfer_Order_another_station: "Transfiere la orden a otra estación", @@ -147,8 +215,27 @@ i18n msj_enter_your_email: "Ingrese su correo electrónico", msj_enter_document_number: "Ingrese el número de documento", msj_change_to: "Cambiar a", - + msj_loading_id_types: "Cargando tipos de documento", + msj_enter_id_number: "Ingrese el número de documento", + mjs_search_for_client: "Buscar un cliente", + msj_no_affiliate: "El cliente no es afiliado", + msj_choose_option_for_non_affiliate: "El cliente no es afiliado, elija una opción", + msj_confirm_generic_customer: "¿Está seguro de que desea continuar con un cliente genérico?", + msj_are_you_sure_generic_customer: "¿Está seguro de que desea continuar con un cliente genérico?", + msj_enter_plu: "Ingrese PLU", + tle_self_checkout: "AUTO PAGO", + tle_product: "PRODUCTO", + tle_description: "DESCRIPCIÓN", + tle_amount: "CANTIDAD", + tle_total: "TOTAL", + tle_unit_value: "VALOR UNITARIO", + tle_tax: "IMPUESTO", + tle_discount: "DESCUENTO", + tle_item_count: "CANTIDAD DE ARTÍCULOS", + tle_total_unit: "VALOR UNITARIO TOTAL", + tle_total_taxes: "IMPUESTOS TOTALES", + tle_total_discount: "DESCUENTO TOTAL", }, }, },