ref: change in different components
This commit is contained in:
parent
a440f954ad
commit
0a14fe8882
6 changed files with 106 additions and 37 deletions
|
|
@ -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<string> {
|
|
||||||
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 }
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
"use client";
|
"use client";
|
||||||
import React, { useState } from "react";
|
import React, { useState } from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import ForgotPasswordForm from "@organisms/ForgotPasswordForm";
|
import ForgotPasswordForm from "@organisms/Auth/ForgotPasswordForm";
|
||||||
import LoginForm from "@organisms/LoginForm";
|
import LoginForm from "@organisms/Auth/LoginForm";
|
||||||
|
|
||||||
const LoginPage: React.FC = () => {
|
const LoginPage: React.FC = () => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,10 @@
|
||||||
import React from "react"
|
import React from "react"
|
||||||
import PreCheckoutScreen from "@app/selfcheckout/precheckout/page"
|
import PreCheckout from "@app/selfcheckout/precheckout/page"
|
||||||
|
|
||||||
const HomeAfterLogin: React.FC = () => {
|
const HomeAfterLogin: React.FC = () => {
|
||||||
return (
|
return (
|
||||||
<div className="min-h-screen bg-gray-100 p-6">
|
<div className="min-h-screen bg-gray-100 p-6">
|
||||||
<PreCheckoutScreen />
|
<PreCheckout />
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -7,3 +7,9 @@
|
||||||
height: 60px;
|
height: 60px;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
}
|
}
|
||||||
|
.full-width-button {
|
||||||
|
width: 100%;
|
||||||
|
height: 60px;
|
||||||
|
font-size: 16px;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -10,9 +10,13 @@ export const GRID_SIZE = 10
|
||||||
|
|
||||||
export const DEFAULT_PASSWORD = 'Bopos123'
|
export const DEFAULT_PASSWORD = 'Bopos123'
|
||||||
|
|
||||||
// Constants for special cases in Dashboard statistics
|
|
||||||
export const INFINITY_SYMBOL = '∞'
|
export const INFINITY_SYMBOL = '∞'
|
||||||
|
|
||||||
export const NOT_AVAILABLE = 'N/A'
|
export const NOT_AVAILABLE = 'N/A'
|
||||||
|
|
||||||
export const BASE_URL_LANGUAGE = i18n.language
|
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']
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,14 +4,16 @@ import { initReactI18next } from 'react-i18next';
|
||||||
i18n
|
i18n
|
||||||
.use(initReactI18next)
|
.use(initReactI18next)
|
||||||
.init({
|
.init({
|
||||||
fallbackLng: 'en', // Default language
|
fallbackLng: 'en',
|
||||||
lng: 'en', // Specify the default language to use
|
lng: 'en',
|
||||||
resources: {
|
resources: {
|
||||||
en: {
|
en: {
|
||||||
translation: {
|
translation: {
|
||||||
lbl_wellcome: "Welcome",
|
lbl_wellcome: "Welcome",
|
||||||
lbl_login: "Login",
|
lbl_login: "Login",
|
||||||
lbl_email: "Email",
|
lbl_email: "Email",
|
||||||
|
lbl_phone: "Phone",
|
||||||
|
lbl_address: "Address",
|
||||||
lbl_reset_password: "Reset password",
|
lbl_reset_password: "Reset password",
|
||||||
lbl_username: "Username",
|
lbl_username: "Username",
|
||||||
lbl_password: "Password",
|
lbl_password: "Password",
|
||||||
|
|
@ -42,9 +44,31 @@ i18n
|
||||||
lbl_clear: "Clear",
|
lbl_clear: "Clear",
|
||||||
lbl_cancel: "Cancel",
|
lbl_cancel: "Cancel",
|
||||||
lbl_enter: "Enter",
|
lbl_enter: "Enter",
|
||||||
|
lbl_confirm: "Confirm",
|
||||||
lbl_alphabetical: "Alphabetical",
|
lbl_alphabetical: "Alphabetical",
|
||||||
lbl_numeric: "Numeric",
|
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_resume_previously_suspended_order: "Resume a previously suspended order",
|
||||||
msj_transfer_Order_another_station: "Transfer an order to another station",
|
msj_transfer_Order_another_station: "Transfer an order to another station",
|
||||||
msj_generate_resale: "Generate a resale",
|
msj_generate_resale: "Generate a resale",
|
||||||
|
|
@ -75,8 +99,28 @@ i18n
|
||||||
msj_enter_your_email: "Enter your email",
|
msj_enter_your_email: "Enter your email",
|
||||||
msj_enter_document_number: "Enter the document number",
|
msj_enter_document_number: "Enter the document number",
|
||||||
msj_change_to: "Change to",
|
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_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: {
|
es: {
|
||||||
|
|
@ -85,6 +129,8 @@ i18n
|
||||||
lbl_login: "Iniciar sesión",
|
lbl_login: "Iniciar sesión",
|
||||||
lbl_username: "Nombre de usuario",
|
lbl_username: "Nombre de usuario",
|
||||||
lbl_email: "Correo electrónico",
|
lbl_email: "Correo electrónico",
|
||||||
|
lbl_phone: "Teléfono",
|
||||||
|
lbl_address: "Dirección",
|
||||||
lbl_reset_password: "Restablecer contraseña",
|
lbl_reset_password: "Restablecer contraseña",
|
||||||
lbl_password: "Contraseña",
|
lbl_password: "Contraseña",
|
||||||
lbl_enter_PLU: "Ingrese PLU",
|
lbl_enter_PLU: "Ingrese PLU",
|
||||||
|
|
@ -114,8 +160,30 @@ i18n
|
||||||
lbl_clear: "Limpiar",
|
lbl_clear: "Limpiar",
|
||||||
lbl_cancel: "Cancelar",
|
lbl_cancel: "Cancelar",
|
||||||
lbl_enter: "Entrar",
|
lbl_enter: "Entrar",
|
||||||
|
lbl_confirm: "Confirmar",
|
||||||
lbl_alphabetical: "Alfabético",
|
lbl_alphabetical: "Alfabético",
|
||||||
lbl_numeric: "Numérico",
|
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_resume_previously_suspended_order: "Reanuda una orden previamente suspendida",
|
||||||
msj_transfer_Order_another_station: "Transfiere la orden a otra estación",
|
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_your_email: "Ingrese su correo electrónico",
|
||||||
msj_enter_document_number: "Ingrese el número de documento",
|
msj_enter_document_number: "Ingrese el número de documento",
|
||||||
msj_change_to: "Cambiar a",
|
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_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",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue