From 94d8232a8c1f0f75566d09a236e5969b06eae33a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Omar=20Luna=20Hern=C3=A1ndez?= <42101656@uaz.edu.mx> Date: Sun, 14 Jul 2024 13:35:30 -0600 Subject: [PATCH 01/19] =?UTF-8?q?Se=20agrega=20la=20l=C3=B3gica=20para=20r?= =?UTF-8?q?egistrar=20y=20eliminar=20una=20categor=C3=ADa=20y=20obtener=20?= =?UTF-8?q?todas=20las=20categor=C3=ADas=20en=20la=20API?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../datasources/prod/category_datasource.ts | 39 +++++++++++++++++++ .../repositories/prod/category_repository.ts | 21 ++++++++++ .../datasources/category_datasource.ts | 7 ++++ .../repositories/category_repository.ts | 7 ++++ 4 files changed, 74 insertions(+) create mode 100644 web/src/data/datasources/prod/category_datasource.ts create mode 100644 web/src/data/repositories/prod/category_repository.ts create mode 100644 web/src/infraestructure/datasources/category_datasource.ts create mode 100644 web/src/infraestructure/repositories/category_repository.ts diff --git a/web/src/data/datasources/prod/category_datasource.ts b/web/src/data/datasources/prod/category_datasource.ts new file mode 100644 index 00000000..39937f09 --- /dev/null +++ b/web/src/data/datasources/prod/category_datasource.ts @@ -0,0 +1,39 @@ +import axios from "axios"; +import { CategoryDatasourceInf } from "../../../infraestructure/datasources/category_datasource"; +import { Category, CategoryFormValues } from "../../../infraestructure/entities/category"; +import { CategoryModel } from "../../models/prod/CategoryModel"; +import { APIUrl } from "../../../constants/api_url"; + +export class CategoryDatasourceProd implements CategoryDatasourceInf{ + async registerCategory(form: CategoryFormValues): Promise { + await axios.post( + APIUrl + "/category", + { + nameES: form.nameES, + nameEN: form.nameEN + } + ); + } + + async getCategories(): Promise { + const {data: dataES} = await axios.get(APIUrl+'/category/ES'); + console.log(dataES); + + const {data: dataEN} = await axios.get(APIUrl+'/category/EN'); + const categories : Category[] = []; + for(let i=0; i { + await axios.delete(APIUrl + `/category/${category.idCategory}`) + } +} \ No newline at end of file diff --git a/web/src/data/repositories/prod/category_repository.ts b/web/src/data/repositories/prod/category_repository.ts new file mode 100644 index 00000000..ab0055eb --- /dev/null +++ b/web/src/data/repositories/prod/category_repository.ts @@ -0,0 +1,21 @@ +import { CategoryDatasourceInf } from "../../../infraestructure/datasources/category_datasource"; +import { Category, CategoryFormValues } from "../../../infraestructure/entities/category"; +import { CategoryRepositoryInf } from "../../../infraestructure/repositories/category_repository"; + +export class CategoryRepositoryProd implements CategoryRepositoryInf{ + constructor( + private datasource: CategoryDatasourceInf + ){} + + async registerCategory(form: CategoryFormValues): Promise { + return this.datasource.registerCategory(form); + } + + async getCategories(): Promise { + return this.datasource.getCategories(); + } + + async deleteCategory(category: Category): Promise { + return this.datasource.deleteCategory(category); + } +} \ No newline at end of file diff --git a/web/src/infraestructure/datasources/category_datasource.ts b/web/src/infraestructure/datasources/category_datasource.ts new file mode 100644 index 00000000..d130c5c8 --- /dev/null +++ b/web/src/infraestructure/datasources/category_datasource.ts @@ -0,0 +1,7 @@ +import { Category, CategoryFormValues } from "../entities/category"; + +export interface CategoryDatasourceInf{ + registerCategory(form: CategoryFormValues): Promise; + getCategories(): Promise; + deleteCategory(category: Category): Promise; +} \ No newline at end of file diff --git a/web/src/infraestructure/repositories/category_repository.ts b/web/src/infraestructure/repositories/category_repository.ts new file mode 100644 index 00000000..d9ae769c --- /dev/null +++ b/web/src/infraestructure/repositories/category_repository.ts @@ -0,0 +1,7 @@ +import { Category, CategoryFormValues } from "../entities/category"; + +export interface CategoryRepositoryInf{ + registerCategory(form: CategoryFormValues): Promise; + getCategories(): Promise; + deleteCategory(category: Category): Promise; +} \ No newline at end of file -- GitLab From 8a7afa46ebdf67bd82c9be57546e00c05347a9f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Omar=20Luna=20Hern=C3=A1ndez?= <42101656@uaz.edu.mx> Date: Sun, 14 Jul 2024 13:35:56 -0600 Subject: [PATCH 02/19] =?UTF-8?q?Se=20crean=20dos=20interfaces=20para=20la?= =?UTF-8?q?s=20categor=C3=ADas?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/src/infraestructure/entities/category.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 web/src/infraestructure/entities/category.ts diff --git a/web/src/infraestructure/entities/category.ts b/web/src/infraestructure/entities/category.ts new file mode 100644 index 00000000..b7066663 --- /dev/null +++ b/web/src/infraestructure/entities/category.ts @@ -0,0 +1,10 @@ +export interface Category{ + idCategory: number; + nameES: string; + nameEN: string; +} + +export interface CategoryFormValues{ + nameES: string; + nameEN: string; +} \ No newline at end of file -- GitLab From 2addbd32845bb510b3f5459c3eb1f6044c3a2e1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Omar=20Luna=20Hern=C3=A1ndez?= <42101656@uaz.edu.mx> Date: Sun, 14 Jul 2024 13:36:16 -0600 Subject: [PATCH 03/19] Se agregan las opciones para el panel de superadmin --- web/src/constants/selected_panel.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/web/src/constants/selected_panel.ts b/web/src/constants/selected_panel.ts index 3498fa32..64626a33 100644 --- a/web/src/constants/selected_panel.ts +++ b/web/src/constants/selected_panel.ts @@ -1,5 +1,11 @@ export enum AdminSelectedPanel { - TOWN_INFO = 'town_info', + TOWN_INFO = "town_info", PLACES = "places", ACTIVITIES = "activities" +} + +export enum SuperAdminSelectedPanel { + TOWNS = "towns", + ADMINS = "admins", + CATEGORIES = "categories" } \ No newline at end of file -- GitLab From 3821607c9167810d6801430c3e1a58c41425c7ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Omar=20Luna=20Hern=C3=A1ndez?= <42101656@uaz.edu.mx> Date: Sun, 14 Jul 2024 13:36:41 -0600 Subject: [PATCH 04/19] =?UTF-8?q?Se=20crea=20un=20modelo=20para=20recibir?= =?UTF-8?q?=20una=20categor=C3=ADa=20a=20trav=C3=A9s=20de=20axios?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/src/data/models/prod/CategoryModel.ts | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 web/src/data/models/prod/CategoryModel.ts diff --git a/web/src/data/models/prod/CategoryModel.ts b/web/src/data/models/prod/CategoryModel.ts new file mode 100644 index 00000000..f16740fe --- /dev/null +++ b/web/src/data/models/prod/CategoryModel.ts @@ -0,0 +1,4 @@ +export interface CategoryModel{ + idCategory: number; + name: string; +} \ No newline at end of file -- GitLab From 6d2e6e39eeb69f7b5cda1adabe1c1c03e00941f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Omar=20Luna=20Hern=C3=A1ndez?= <42101656@uaz.edu.mx> Date: Mon, 15 Jul 2024 16:54:39 -0600 Subject: [PATCH 05/19] Se elimino un log innecesario --- web/src/data/datasources/prod/category_datasource.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/web/src/data/datasources/prod/category_datasource.ts b/web/src/data/datasources/prod/category_datasource.ts index 39937f09..264be779 100644 --- a/web/src/data/datasources/prod/category_datasource.ts +++ b/web/src/data/datasources/prod/category_datasource.ts @@ -17,8 +17,6 @@ export class CategoryDatasourceProd implements CategoryDatasourceInf{ async getCategories(): Promise { const {data: dataES} = await axios.get(APIUrl+'/category/ES'); - console.log(dataES); - const {data: dataEN} = await axios.get(APIUrl+'/category/EN'); const categories : Category[] = []; for(let i=0; i Date: Mon, 15 Jul 2024 17:14:27 -0600 Subject: [PATCH 06/19] Se crea un componente y sus estilos para una ventana de confirmacion --- .../assets/css/styles.css | 35 ++++++++++++++++ .../confirmation_dialog.tsx | 40 +++++++++++++++++++ 2 files changed, 75 insertions(+) create mode 100644 web/src/components/confirmation_dialog_box/assets/css/styles.css create mode 100644 web/src/components/confirmation_dialog_box/confirmation_dialog.tsx diff --git a/web/src/components/confirmation_dialog_box/assets/css/styles.css b/web/src/components/confirmation_dialog_box/assets/css/styles.css new file mode 100644 index 00000000..72195727 --- /dev/null +++ b/web/src/components/confirmation_dialog_box/assets/css/styles.css @@ -0,0 +1,35 @@ +.confirmation_dialog_wrap{ + position: absolute; + z-index: 99; + left: 0; + right: 0; + margin: auto; + width: 25vw; + display: flex; + flex-direction: column; + background: white; + border: solid 2px black; +} + +.confirmation_dialog_wrap .header{ + background: #ccc; +} + +.confirmation_dialog_wrap .body{ + display: flex; + flex-direction: column; + width: 100%; + align-items: center; + justify-content: center; +} + +.confirmation_dialog_wrap .buttons{ + display: flex; + justify-content: center; + align-items: center; +} + +.confirmation_dialog_wrap .buttons button{ + margin: 5px; + width: 60px; +} diff --git a/web/src/components/confirmation_dialog_box/confirmation_dialog.tsx b/web/src/components/confirmation_dialog_box/confirmation_dialog.tsx new file mode 100644 index 00000000..9cc98917 --- /dev/null +++ b/web/src/components/confirmation_dialog_box/confirmation_dialog.tsx @@ -0,0 +1,40 @@ +import { Dispatch, SetStateAction } from 'react'; +import './assets/css/styles.css'; + +interface props{ + hangleToClose: () => void; + setAnswer?: Dispatch>; + title?: string; + message: string; +} + +export const ConfirmationDialog = ({hangleToClose, setAnswer, title, message}:props) => { + return ( +
+
+

{title || 'Confirmar acción'}

+
+
+
+

{message}

+
+ +
+ + +
+
+
+ ); +} \ No newline at end of file -- GitLab From a4b504f880f24ebb63c7e53524a3ca0481e07aa4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Omar=20Luna=20Hern=C3=A1ndez?= <42101656@uaz.edu.mx> Date: Mon, 15 Jul 2024 17:15:05 -0600 Subject: [PATCH 07/19] =?UTF-8?q?Se=20crea=20la=20l=C3=B3gica=20para=20agr?= =?UTF-8?q?egar,=20eliminar=20y=20obtener=20categor=C3=ADas=20en=20el=20fr?= =?UTF-8?q?ont?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/src/hooks/useCategory.tsx | 130 ++++++++++++++++++++++++++++++++++ 1 file changed, 130 insertions(+) create mode 100644 web/src/hooks/useCategory.tsx diff --git a/web/src/hooks/useCategory.tsx b/web/src/hooks/useCategory.tsx new file mode 100644 index 00000000..16443f41 --- /dev/null +++ b/web/src/hooks/useCategory.tsx @@ -0,0 +1,130 @@ +import { FieldErrors, Resolver, SubmitHandler, useForm } from "react-hook-form"; +import { CategoryDatasourceProd } from "../data/datasources/prod/category_datasource" +import { CategoryRepositoryProd } from "../data/repositories/prod/category_repository"; +import { Category, CategoryFormValues } from "../infraestructure/entities/category"; +import axios, { AxiosError } from "axios"; +import { toast } from "react-toastify"; +import { Dispatch, SetStateAction, useEffect, useState } from "react"; +import { showErrorAxios } from "../utils/Messages"; + +const categoryDatasource = new CategoryDatasourceProd(); +const categoryRepository = new CategoryRepositoryProd(categoryDatasource); + +const resolver : Resolver = async (data) => { + const errors: FieldErrors = {}; + + if(!data.nameES){ + errors.nameES = { + type: 'required', + message: 'El nombre en español de la categoría es requerido' + } + } + + + if(!data.nameEN){ + errors.nameEN = { + type: 'required', + message: 'El nombre en inglés de la categoría es requerido' + } + } + + return { + values: Object.keys(errors).length > 0 ? {} : data, + errors: errors + } +} + +export const useCategory = (forceRenderList?: () => void, handleClickToClose?: () => void) => { + const { + register, + handleSubmit, + setValue, + formState: {errors}, + clearErrors, + resetField, + } = useForm({resolver}); + const [errorMessage, setErrorMessage] = useState(""); + const [pending, setPending] = useState(false); + const [isLoading, setIsLoading] = useState(false); + const [categoriesList, setCategoriesList] = useState([]); + + const onSubmit : SubmitHandler = (data: CategoryFormValues) => { + const fetch = async () => { + try{ + await categoryRepository.registerCategory(data).then(() =>{ + if(forceRenderList && handleClickToClose){ + forceRenderList(); + handleClickToClose(); + } + }); + }catch(error: any){ + if(axios.isAxiosError(error)){ + error as AxiosError; + switch(error.code){ + case(axios.AxiosError.ERR_BAD_REQUEST): + setErrorMessage("Acceso no autorizado"); + break; + case(axios.AxiosError.ERR_NETWORK): + setErrorMessage("Conexión con el servidor fallida"); + break; + default: + setErrorMessage(error.message); + break; + } + } + throw new Error(); + } + } + toast.promise( + fetch(),{ + pending: "Subiendo datos...", + success: "Los datos se han subido correctamente", + error: errorMessage + } + ) + } + + const updateCategoriesList = async () => { + setPending(true); + try{ + const categories = await categoryRepository.getCategories(); + setCategoriesList(categories); + setPending(false); + }catch(error: any){ + if(axios.isAxiosError(error)){ + error as AxiosError; + showErrorAxios(error); + } + setPending(false); + } + } + + useEffect(()=>{ + setIsLoading(true); + updateCategoriesList(); + setIsLoading(false); + },[]); + + const deleteCategory = async (category: Category) => { + setPending(true); + await categoryRepository.deleteCategory(category); + const categories = await categoryRepository.getCategories(); + setCategoriesList(categories); + setPending(false); + } + + return { + register, + handleSubmit, + errors, + onSubmit, + setValue, + clearErrors, + resetField, + updateCategoriesList, + categoriesList, + pending, + deleteCategory, + isLoading + }; +} \ No newline at end of file -- GitLab From 97697db75ab4b77767388294377ca7f9c2835af1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Omar=20Luna=20Hern=C3=A1ndez?= <42101656@uaz.edu.mx> Date: Mon, 15 Jul 2024 17:15:36 -0600 Subject: [PATCH 08/19] =?UTF-8?q?Se=20crea=20el=20componente=20y=20sus=20e?= =?UTF-8?q?stilos=20para=20la=20tabla=20que=20muestra=20las=20categor?= =?UTF-8?q?=C3=ADas?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../assets/css/styles.css | 19 ++++ .../sa_panel_category_list.tsx | 102 ++++++++++++++++++ 2 files changed, 121 insertions(+) create mode 100644 web/src/components/sa_panel_category/sa_panel_category_list/assets/css/styles.css create mode 100644 web/src/components/sa_panel_category/sa_panel_category_list/sa_panel_category_list.tsx diff --git a/web/src/components/sa_panel_category/sa_panel_category_list/assets/css/styles.css b/web/src/components/sa_panel_category/sa_panel_category_list/assets/css/styles.css new file mode 100644 index 00000000..9c12b79e --- /dev/null +++ b/web/src/components/sa_panel_category/sa_panel_category_list/assets/css/styles.css @@ -0,0 +1,19 @@ +.category_list_cnt{ + display: flex; + height: 100%; + width: 100%; +} + +.data_table{ + height: 100%; +} + +.bhFeAR{ + display: flex !important; + height: 100%; +} + +.rdt_TableBody{ + max-height: 100%; + overflow-y: auto; +} \ No newline at end of file diff --git a/web/src/components/sa_panel_category/sa_panel_category_list/sa_panel_category_list.tsx b/web/src/components/sa_panel_category/sa_panel_category_list/sa_panel_category_list.tsx new file mode 100644 index 00000000..9d74d986 --- /dev/null +++ b/web/src/components/sa_panel_category/sa_panel_category_list/sa_panel_category_list.tsx @@ -0,0 +1,102 @@ +import DataTable, { TableColumn } from 'react-data-table-component'; +import './assets/css/styles.css'; +import { LoadingSpinner } from '../../loading_spinner/loading_spinner'; +import { useCategory } from '../../../hooks/useCategory'; +import { Category } from '../../../infraestructure/entities/category'; +import { faTrash } from '@fortawesome/free-solid-svg-icons'; +import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; +import { Dispatch, SetStateAction, useEffect, useState } from 'react'; +import { ConfirmationDialog } from '../../confirmation_dialog_box/confirmation_dialog'; +import { toast } from 'react-toastify'; + +interface props { + isWindowActive: boolean; + setIsWindowActive: Dispatch>; +} + +export const SuperAdminPanelCategoryList = ({isWindowActive, setIsWindowActive}:props) => { + const { + categoriesList, + pending, + deleteCategory, + } = useCategory(); + const [isDialogOpen, setIsDialogOpen] = useState(false); + const [dialogMessage, setDialogMessage] = useState(''); + const [categoryDeleted, setCategoryDeleted] = useState(null); + const [deleteCategoryBool, setDeleteCategoryBool] = useState(false); + + const deleteSelectedCategory = (category: Category) => { + toast.promise( + deleteCategory(category),{ + pending: "Eliminando categoría...", + success: "La categoría se ha eliminado correctamente", + error: "No se pudo eliminar la categoría" + } + ) + } + + useEffect(() => { + if(deleteCategoryBool && categoryDeleted){ + deleteSelectedCategory(categoryDeleted); + setDeleteCategoryBool(false); + } + }, [deleteCategoryBool]); + + const handleDeleteSelectedCategory = (category: Category) => { + setDialogMessage(`¿Desea eliminar la categoría ${category.nameES}?`) + setCategoryDeleted(category); + setIsDialogOpen(true); + setIsWindowActive(true); + } + + const handleToClose = () => { + setIsWindowActive(false); + setIsDialogOpen(false) + } + + const columns : TableColumn[] = [ + { + name: "Identificador", + selector: row => row.idCategory || 0, + sortable: true + }, + { + name: "Nombre en español", + selector: row => row.nameES, + sortable: true + }, + { + name: "Nombre en Inglés", + selector: row => row.nameEN, + sortable: true + }, + { + name: "Acciones", + cell: (row) => { + return ( + { + if(!isWindowActive){ + handleDeleteSelectedCategory(row); + } + }} + /> + ); + } + } + ]; + + return ( +
+ + } + disabled={isWindowActive} + columns={columns} data={categoriesList} className="data_table"/> + { + isDialogOpen && + } +
+ ); +} \ No newline at end of file -- GitLab From d25880944fe8ff587b1b782ef3a7ec35bd35067f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Omar=20Luna=20Hern=C3=A1ndez?= <42101656@uaz.edu.mx> Date: Mon, 15 Jul 2024 17:16:04 -0600 Subject: [PATCH 09/19] =?UTF-8?q?Se=20crea=20el=20componente=20y=20sus=20e?= =?UTF-8?q?stilos=20para=20la=20ventana=20de=20registro=20de=20una=20categ?= =?UTF-8?q?or=C3=ADa?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../assets/css/styles.css | 75 +++++++++++++++++++ .../sa_panel_category_register.tsx | 60 +++++++++++++++ 2 files changed, 135 insertions(+) create mode 100644 web/src/components/sa_panel_category/sa_panel_category_register/assets/css/styles.css create mode 100644 web/src/components/sa_panel_category/sa_panel_category_register/sa_panel_category_register.tsx diff --git a/web/src/components/sa_panel_category/sa_panel_category_register/assets/css/styles.css b/web/src/components/sa_panel_category/sa_panel_category_register/assets/css/styles.css new file mode 100644 index 00000000..216bab18 --- /dev/null +++ b/web/src/components/sa_panel_category/sa_panel_category_register/assets/css/styles.css @@ -0,0 +1,75 @@ +*{ + user-select: none; +} + +.category_register_wrap{ + position: absolute; + z-index: 99; + left: 0; + right: 0; + top: 0; + bottom: 0; + margin: auto; + width: 25vw; + height: 30vh; + display: flex; + flex-direction: column; + background: white; + border: solid 2px black; +} + +.category_register_header{ + display: flex; + width: 100%; + align-items: center; + justify-content: center; + padding: 5px; + background: #ccc; + height: 15%; +} + +.category_register_close_btn{ + display: inline-block; + cursor: pointer; + position: absolute; + right: 5px; +} + +.category_register_body{ + height: 85%; + width: 100%; +} + +.category_register_body form{ + height: 100%; + display: flex; +} + +.inputs_container{ + height: 100%; + width: 100%; +} + +.input{ + width: 100%; + display: flex; + flex-direction: column; +} + +.input input{ + margin: 0px 30px 0px 30px; +} + +.input_header{ + display: flex; + align-items: center; + justify-content: center; + position: relative; +} + +.error{ + color: red; + font-size: 12px; + padding: 0; + margin: 0; +} diff --git a/web/src/components/sa_panel_category/sa_panel_category_register/sa_panel_category_register.tsx b/web/src/components/sa_panel_category/sa_panel_category_register/sa_panel_category_register.tsx new file mode 100644 index 00000000..675d0d68 --- /dev/null +++ b/web/src/components/sa_panel_category/sa_panel_category_register/sa_panel_category_register.tsx @@ -0,0 +1,60 @@ +import { faWindowClose } from "@fortawesome/free-solid-svg-icons"; +import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; +import { Dispatch, SetStateAction} from "react"; +import "./assets/css/styles.css"; +import { useCategory } from "../../../hooks/useCategory"; + +interface props { + handleClickToClose: () => void; + forceRenderList: () => void; +} + +export const SuperAdminPanelCategoryRegister = ({handleClickToClose, forceRenderList}: props) => { + const { + register, + handleSubmit, + errors, + onSubmit, + } = useCategory(forceRenderList, handleClickToClose); + + return ( +
+
+ Registra la categoría + handleClickToClose()}/> +
+
+
+
+
+
+ Nombre de la categoría(español) +
+ +

{errors.nameES?.message}

+
+ +
+
+ Nombre de la categoría(inglés) +
+ +

{errors.nameEN?.message}

+
+ + +
+
+
+
+ ); +} \ No newline at end of file -- GitLab From 47ac568111fce147f81e783c5f0fad9d4d5308d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Omar=20Luna=20Hern=C3=A1ndez?= <42101656@uaz.edu.mx> Date: Mon, 15 Jul 2024 17:16:32 -0600 Subject: [PATCH 10/19] =?UTF-8?q?Se=20crea=20el=20componente=20y=20los=20e?= =?UTF-8?q?stilos=20para=20el=20panel=20de=20visualizaci=C3=B3n=20de=20las?= =?UTF-8?q?=20categor=C3=ADas?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../assets/css/styles.css | 29 +++++++++++ .../sa_panel_category_screen.tsx | 49 +++++++++++++++++++ 2 files changed, 78 insertions(+) create mode 100644 web/src/components/sa_panel_category/sa_panel_category_screen/assets/css/styles.css create mode 100644 web/src/components/sa_panel_category/sa_panel_category_screen/sa_panel_category_screen.tsx diff --git a/web/src/components/sa_panel_category/sa_panel_category_screen/assets/css/styles.css b/web/src/components/sa_panel_category/sa_panel_category_screen/assets/css/styles.css new file mode 100644 index 00000000..5ead15cf --- /dev/null +++ b/web/src/components/sa_panel_category/sa_panel_category_screen/assets/css/styles.css @@ -0,0 +1,29 @@ +.panel_category_content{ + width: 100%; + max-height: 100%; + display: flex; + flex-direction: column; +} + +.panel_category_header{ + height: 7%; + width: 100%; + display: flex; + align-items: center; + justify-content: center; + padding: 5px; + background: gray; +} + +.panel_category_header .category_add_btn{ + display: inline-block; + cursor: pointer; + position: absolute; + right: 5px; +} + +.panel_category_body{ + height: 93%; + width: 100%; + background: white; +} \ No newline at end of file diff --git a/web/src/components/sa_panel_category/sa_panel_category_screen/sa_panel_category_screen.tsx b/web/src/components/sa_panel_category/sa_panel_category_screen/sa_panel_category_screen.tsx new file mode 100644 index 00000000..c5b27edd --- /dev/null +++ b/web/src/components/sa_panel_category/sa_panel_category_screen/sa_panel_category_screen.tsx @@ -0,0 +1,49 @@ +import { Dispatch, SetStateAction, useState } from "react"; +import "./assets/css/styles.css"; +import { SuperAdminPanelCategoryRegister } from "../sa_panel_category_register/sa_panel_category_register"; +import { SuperAdminPanelCategoryList } from "../sa_panel_category_list/sa_panel_category_list"; + +interface props { + isWindowActive: boolean; + setIsWindowActive: Dispatch>; +} + +export const SuperAdminPanelCategoryScreen = ({isWindowActive,setIsWindowActive}: props) => { + const [renderCount, setRenderCount] = useState(0); + const [isRegisterWindowOpen, setIsRegisterWindowOpen] = useState(false); + + const handleClickToClose = () => { + setIsWindowActive(false); + setIsRegisterWindowOpen(false); + } + + const forceRenderList = () =>{ + setRenderCount(prevCount => prevCount + 1); + } + + return ( +
+
+ Administrar Categorías + +
+
+ { + isRegisterWindowOpen && + } + +
+
+ ); +} \ No newline at end of file -- GitLab From 63ad478b7d29c968a96837411885e6c62824b52a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Omar=20Luna=20Hern=C3=A1ndez?= <42101656@uaz.edu.mx> Date: Mon, 15 Jul 2024 17:17:07 -0600 Subject: [PATCH 11/19] =?UTF-8?q?Se=20mueve=20la=20l=C3=B3gica=20de=20la?= =?UTF-8?q?=20p=C3=A1gina=20principal=20del=20superadministrador=20a=20un?= =?UTF-8?q?=20custom=20hook?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/src/hooks/useSuperadminHomePage.tsx | 65 ++++++++++ .../super_admin_home_page.tsx | 111 ++++++++++-------- 2 files changed, 128 insertions(+), 48 deletions(-) create mode 100644 web/src/hooks/useSuperadminHomePage.tsx diff --git a/web/src/hooks/useSuperadminHomePage.tsx b/web/src/hooks/useSuperadminHomePage.tsx new file mode 100644 index 00000000..5e0a7e45 --- /dev/null +++ b/web/src/hooks/useSuperadminHomePage.tsx @@ -0,0 +1,65 @@ +import { useEffect, useState } from "react"; +import { SuperAdminSelectedPanel } from "../constants/selected_panel"; +import { useAuth } from "../context/auth_context"; +import { useWindowShow } from "./useWindowShow"; +import { useAdmin } from "./useAdmin"; +import { UserRole } from "../constants/roles"; +import { useGetStatesList } from "./useGetStatesList"; +import axios, { AxiosError } from "axios"; +import { showErrorAxios } from "../utils/Messages"; + +export const useSuperAdminHomePage = () => { + const [isLoading, setIsLoading] = useState(true); + const [error, setError] = useState(false); + const [errorMessage, setErrorMessage] = useState(""); + const [collapsed, setCollapsed] = useState(true); + const {setIsWindowActive, isWindowActive} = useWindowShow(); + const [selectedPanel, setSelectedPanel] = useState(SuperAdminSelectedPanel.TOWNS); + const {user, logout} = useAuth(); + const {getAdminInfo} = useAdmin(); + const {getStates, statesList} = useGetStatesList(); + + useEffect(() => { + const checkAdminRole = async () => { + const admin = await getAdminInfo(); + if(admin){ + if(admin.role!==UserRole.SUPERADMIN){ + setError(true); + setErrorMessage("No estas autorizado para acceder a esta página") + setTimeout(() => { + logout(); + }, 5000); + return; + } + } + setIsLoading(false); + }; + checkAdminRole(); + + const getStatesList = async () => { + try{ + getStates(); + setIsLoading(false); + }catch(error: any){ + if(axios.isAxiosError(error)){ + error as AxiosError; + showErrorAxios(error); + } + } + } + getStatesList(); + },[user]); + + return { + collapsed, + isWindowActive, + selectedPanel, + setCollapsed, + setSelectedPanel, + setIsWindowActive, + isLoading, + error, + errorMessage, + statesList + }; +} \ No newline at end of file diff --git a/web/src/pages/home/super_admin_page/super_admin_home_page.tsx b/web/src/pages/home/super_admin_page/super_admin_home_page.tsx index b0a861ee..76717880 100644 --- a/web/src/pages/home/super_admin_page/super_admin_home_page.tsx +++ b/web/src/pages/home/super_admin_page/super_admin_home_page.tsx @@ -1,45 +1,49 @@ import { Menu, MenuItem, Sidebar } from "react-pro-sidebar" import './assets/styles/style.css'; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; -import { faMonument, faUserTie } from "@fortawesome/free-solid-svg-icons"; -import { useEffect, useState } from "react"; +import { faMonument, faTags, faUserTie } from "@fortawesome/free-solid-svg-icons"; import { AdminPanelNavBar } from "../../../components/admin_panel_navbar/admin_navbar"; import { SidebarHeader } from "../../../components/sidebar_header/sidebar_header"; import { SuperadminPanelTownScreen } from "../../../components/sa_panel_town/sa_panel_town_screen/sa_panel_town_screen"; import { SuperadminPanelAdminScreen } from "../../../components/sa_panel_admin/sa_panel_admin_screen/sa_panel_admin_screen"; -import { useGetStatesList } from "../../../hooks/useGetStatesList"; -import axios, { AxiosError } from "axios"; import { LoadingScreen } from "../../../components/loading_screen/loading_screen"; import { ToastContainer } from "react-toastify"; -import { showErrorAxios } from "../../../utils/Messages"; +import { ErrorWindow } from "../../../components/error_window/error_window"; +import { LoadingSpinner } from "../../../components/loading_spinner/loading_spinner"; +import { SuperAdminSelectedPanel } from "../../../constants/selected_panel"; +import { useSuperAdminHomePage } from "../../../hooks/useSuperadminHomePage"; +import { SuperAdminPanelCategoryScreen } from "../../../components/sa_panel_category/sa_panel_category_screen/sa_panel_category_screen"; export const SuperAdminHomePage = () => { - const [collapsed, setCollapsed] = useState(true); - const [windowActive, setWindowActive] = useState(false); - const [townPanel, setTownPanel] = useState(true); - const [isLoading, setIsLoading] = useState(true); - const {getStates, statesList} = useGetStatesList(); + const { + collapsed, + isWindowActive, + setCollapsed, + selectedPanel, + setSelectedPanel, + setIsWindowActive, + isLoading, + error, + errorMessage, + statesList, - useEffect(() => { - const getStatesList = async () => { - try{ - getStates(); - setIsLoading(false); - }catch(error: any){ - if(axios.isAxiosError(error)){ - error as AxiosError; - showErrorAxios(error); - } - } - } - getStatesList(); - }, []); + } = useSuperAdminHomePage(); + + if(isLoading) return ; + + if(error) return ( +
+ + Redirigiendo... + +
+ ); return (
{ - windowActive ? + isWindowActive ? setCollapsed(true) : setCollapsed(false) @@ -50,39 +54,50 @@ export const SuperAdminHomePage = () => { } - onClick={() => setTownPanel(true)} - disabled={windowActive}> + onClick={() => setSelectedPanel(SuperAdminSelectedPanel.TOWNS)} + disabled={isWindowActive}> Pueblos } - onClick={() => setTownPanel(false)} - disabled={windowActive}> + onClick={() => setSelectedPanel(SuperAdminSelectedPanel.ADMINS)} + disabled={isWindowActive}> Administradores + + } + onClick={() => setSelectedPanel(SuperAdminSelectedPanel.CATEGORIES)} + disabled={isWindowActive}> + Categorías +
- +
- {townPanel - ? - isLoading || statesList.length===0 - ? - - : - - : - - } + {(() => { + switch (selectedPanel) { + case SuperAdminSelectedPanel.TOWNS: + return + case SuperAdminSelectedPanel.ADMINS: + return + case SuperAdminSelectedPanel.CATEGORIES: + return + default: + return null; + } + })()} Date: Mon, 15 Jul 2024 17:25:08 -0600 Subject: [PATCH 12/19] =?UTF-8?q?Se=20establece=20el=20tama=C3=B1o=20=20de?= =?UTF-8?q?=20la=20imagen=20al=20maximo=20del=20contenedor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/src/components/admin_town_info/assets/css/styles.css | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/web/src/components/admin_town_info/assets/css/styles.css b/web/src/components/admin_town_info/assets/css/styles.css index 69fd36bf..729d3fe5 100644 --- a/web/src/components/admin_town_info/assets/css/styles.css +++ b/web/src/components/admin_town_info/assets/css/styles.css @@ -31,6 +31,11 @@ width: 50%; } +.town_image_cnt img{ + max-height: 100%; + max-width: 100%; +} + .info_fields_cnt{ width: 50%; height: 100%; -- GitLab From 7c33be4dd9593565bba84fcbb7be66897d9694b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Omar=20Luna=20Hern=C3=A1ndez?= <42101656@uaz.edu.mx> Date: Mon, 15 Jul 2024 20:45:37 -0600 Subject: [PATCH 13/19] Se agrega el atributo de los id de las categorias --- web/src/data/models/prod/PlaceModel.ts | 1 + web/src/infraestructure/entities/place.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/web/src/data/models/prod/PlaceModel.ts b/web/src/data/models/prod/PlaceModel.ts index b201143a..c8a674d8 100644 --- a/web/src/data/models/prod/PlaceModel.ts +++ b/web/src/data/models/prod/PlaceModel.ts @@ -7,6 +7,7 @@ export interface PlaceModel { longitude: number; imageName: string; name: string; + categoriesId: string; openAt: number; closeAt: number; startDate?: Date; diff --git a/web/src/infraestructure/entities/place.ts b/web/src/infraestructure/entities/place.ts index 67669276..bdbe0fb1 100644 --- a/web/src/infraestructure/entities/place.ts +++ b/web/src/infraestructure/entities/place.ts @@ -2,6 +2,7 @@ export interface Place{ idTown: number; idPlace? : number; name: string; + categoriesId: string; descriptions?: string[]; latitude: number; longitude: number; -- GitLab From 05e55c721d7694e212c5b664935f9d39f0d0d45b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Omar=20Luna=20Hern=C3=A1ndez?= <42101656@uaz.edu.mx> Date: Mon, 15 Jul 2024 20:45:59 -0600 Subject: [PATCH 14/19] Se agrega los ids de las categorias --- web/src/data/datasources/prod/place_datasource.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/web/src/data/datasources/prod/place_datasource.ts b/web/src/data/datasources/prod/place_datasource.ts index 353e38e7..938bdd97 100644 --- a/web/src/data/datasources/prod/place_datasource.ts +++ b/web/src/data/datasources/prod/place_datasource.ts @@ -10,6 +10,7 @@ export class PlaceDatasourceProd implements PlaceDatasourceInf{ formToSend.append('available', form.available); formToSend.append('idTown', String(form.idTown)); formToSend.append('name', form.name); + formToSend.append('categoriesId', form.categoriesId); formToSend.append('descriptionES', form.descriptions?.[0] ?? ''); formToSend.append('descriptionEN', form.descriptions?.[1] ?? ''); formToSend.append('image', form.imagesList?.[0] ?? ''); @@ -60,6 +61,7 @@ export class PlaceDatasourceProd implements PlaceDatasourceInf{ latitude: value.latitude, longitude: value.longitude, name: value.name, + categoriesId: value.categoriesId, openAt: value.openAt, closeAt: value.closeAt } -- GitLab From 366353fff2f7615db89560f1cbc570105a78b70d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Omar=20Luna=20Hern=C3=A1ndez?= <42101656@uaz.edu.mx> Date: Mon, 15 Jul 2024 20:46:56 -0600 Subject: [PATCH 15/19] Se agrega un hook de efecto para obtener la lista de categorias cada vez que se renderice el componente --- .../admin_panel_place_screen.tsx | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/web/src/components/admin_panel_places/admin_panel_place_screen/admin_panel_place_screen.tsx b/web/src/components/admin_panel_places/admin_panel_place_screen/admin_panel_place_screen.tsx index 621f47a3..e3b5d087 100644 --- a/web/src/components/admin_panel_places/admin_panel_place_screen/admin_panel_place_screen.tsx +++ b/web/src/components/admin_panel_places/admin_panel_place_screen/admin_panel_place_screen.tsx @@ -1,8 +1,10 @@ -import { Dispatch, SetStateAction, useState } from "react"; +import { Dispatch, SetStateAction, useEffect, useState } from "react"; import { AdminPanelPlaceRegister } from "../admin_panel_place_register/admin_panel_place_register"; import "./assets/css/styles.css"; import { AdminPanelPlaceList } from "../admin_panel_place_list/admin_panel_place_list"; import { Town } from "../../../infraestructure/entities/town"; +import { useCategory } from "../../../hooks/useCategory"; +import { LoadingScreen } from "../../loading_screen/loading_screen"; interface props { isWindowActive: boolean; @@ -12,11 +14,22 @@ interface props { export const AdminPanelPlaceScreen = ({isWindowActive,setIsWindowActive, town}: props) => { const [renderCount, setRenderCount] = useState(0); + const { + categoriesList, + updateCategoriesList, + pending + } = useCategory(); const forceRenderList = () =>{ setRenderCount(prevCount => prevCount + 1); } + useEffect(()=>{ + updateCategoriesList(); + },[]); + + if(pending) return + return (
@@ -33,6 +46,7 @@ export const AdminPanelPlaceScreen = ({isWindowActive,setIsWindowActive, town}: isWindowActive && } -- GitLab From b4c6dee6160726834b0e1741db49e40b0cc3a8de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Omar=20Luna=20Hern=C3=A1ndez?= <42101656@uaz.edu.mx> Date: Mon, 15 Jul 2024 20:47:49 -0600 Subject: [PATCH 16/19] =?UTF-8?q?Se=20agrega=20la=20validaci=C3=B3n=20de?= =?UTF-8?q?=20los=20ids=20de=20las=20categorias=20y=20que=20se=20registre?= =?UTF-8?q?=20en=20el=20formulario?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/src/hooks/usePlace.tsx | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/web/src/hooks/usePlace.tsx b/web/src/hooks/usePlace.tsx index 19d32499..f99696bf 100644 --- a/web/src/hooks/usePlace.tsx +++ b/web/src/hooks/usePlace.tsx @@ -57,6 +57,20 @@ const resolver: Resolver = async (data) => { }; } + if(!data.categoriesId){ + errors.categoriesId = { + type: "required", + message: "Debe seleccionar al menos una categoría" + } + }else{ + if(data.categoriesId.length < 1){ + errors.categoriesId = { + type: "required", + message: "Debe seleccionar al menos una categoría" + } + } + } + for(var index = languaguesList.length-1; index>=0; index--){ if(!data.descriptions || !data.descriptions[index]){ errors.descriptions = { @@ -137,6 +151,13 @@ setIsWindowActive?: Dispatch>) => { const [placeList, setPlaceList] = useState([]); const [isLoading, setIsLoading] = useState(false); const [pending, setPending] = useState(false); + const [categoriesId, setCategoriesId] = useState([]); + + + useEffect(()=> { + const categoriesIdString = categoriesId.join(','); + setValue('categoriesId',categoriesIdString,{shouldValidate: true}); + },[categoriesId]); useEffect(() => { setIsLoading(true); @@ -228,6 +249,8 @@ setIsWindowActive?: Dispatch>) => { resetField, updatePlacesByTown, placeList, - pending + pending, + categoriesId, + setCategoriesId, }; } -- GitLab From 8f5ee3e90c3dc07c0c4a84ac08baa0cdddf69313 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Omar=20Luna=20Hern=C3=A1ndez?= <42101656@uaz.edu.mx> Date: Mon, 15 Jul 2024 20:48:12 -0600 Subject: [PATCH 17/19] =?UTF-8?q?Se=20agreg=C3=B3=20el=20campo=20para=20se?= =?UTF-8?q?leccionar=20las=20categorias?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin_panel_place_register.tsx | 55 ++++++++++++++++++- .../assets/css/styles.css | 24 ++++++++ 2 files changed, 77 insertions(+), 2 deletions(-) diff --git a/web/src/components/admin_panel_places/admin_panel_place_register/admin_panel_place_register.tsx b/web/src/components/admin_panel_places/admin_panel_place_register/admin_panel_place_register.tsx index dc04cd17..0edd69b6 100644 --- a/web/src/components/admin_panel_places/admin_panel_place_register/admin_panel_place_register.tsx +++ b/web/src/components/admin_panel_places/admin_panel_place_register/admin_panel_place_register.tsx @@ -1,6 +1,6 @@ import { faWindowClose } from "@fortawesome/free-solid-svg-icons"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; -import { Dispatch, SetStateAction} from "react"; +import { Dispatch, SetStateAction, useState} from "react"; import "./assets/css/styles.css"; import { MapComponent } from "../../map/map"; import { usePlace } from "../../../hooks/usePlace"; @@ -8,14 +8,16 @@ import { languaguesList } from "../../../constants/languages"; import { LoadingScreen } from "../../loading_screen/loading_screen"; import { MultipleImagesDropzone } from "../../multiple_images_dropzone/multiple_images_dropzone"; import { AvailableDays, availableDaysList } from "../../../infraestructure/entities/place"; +import { Category } from "../../../infraestructure/entities/category"; interface props { setIsWindowActive: Dispatch>; + categoriesList: Category[]; idTown: number; forceRenderList: () => void; } -export const AdminPanelPlaceRegister = ({setIsWindowActive, idTown, forceRenderList}: props) => { +export const AdminPanelPlaceRegister = ({setIsWindowActive, idTown, categoriesList, forceRenderList}: props) => { const { register, handleSubmit, @@ -31,7 +33,33 @@ export const AdminPanelPlaceRegister = ({setIsWindowActive, idTown, forceRenderL availableDays, setAvailableDays, resetField, + categoriesId, + setCategoriesId, } = usePlace(idTown, forceRenderList, setIsWindowActive); + const [clickedCategories, setClickedCategories] = useState(new Array(categoriesList.length).fill(false)); + + const onClickCategory = (idCategory: number, indexList: number) => { + const index = categoriesId.indexOf(idCategory); + const clickedCategoriesBackup = clickedCategories.map((clickedCategory, index)=> { + if(index === indexList){ + return !clickedCategory; + }else{ + return clickedCategory; + } + }) + if(index > -1){ + setCategoriesId( + categoriesId.filter(cat => cat !== idCategory) + ); + }else{ + setCategoriesId( + [...categoriesId, + idCategory + ] + ) + } + setClickedCategories(clickedCategoriesBackup); + } return (
@@ -164,6 +192,29 @@ export const AdminPanelPlaceRegister = ({setIsWindowActive, idTown, forceRenderL

{errors.available?.message || errors.startDate?.message || errors.endDate?.message}

+
+
+ Categorías +
+
+
+ { + categoriesList.map((category, index) => { + return ( +
onClickCategory(category.idCategory, index)} + style={clickedCategories[index] ? {border: '2px solid blue'} : {border: '1px solid black'}} + > + {category.nameES} {clickedCategories[index] ? 'SI': 'NO'} +
+ ); + }) + } +
+
+

{errors.categoriesId?.message}

+
+

{errors.imagesList?.message}

diff --git a/web/src/components/admin_panel_places/admin_panel_place_register/assets/css/styles.css b/web/src/components/admin_panel_places/admin_panel_place_register/assets/css/styles.css index 4f0b19f3..2aefa5c0 100644 --- a/web/src/components/admin_panel_places/admin_panel_place_register/assets/css/styles.css +++ b/web/src/components/admin_panel_places/admin_panel_place_register/assets/css/styles.css @@ -132,4 +132,28 @@ flex-direction: row; justify-content: center; align-items: center; +} + +.categories_cnt { + display: flex; + border: solid 1px black; + height: 80px; +} + +.categories_grid { + height: 100%; + overflow-x: auto; + display: grid; + grid-auto-flow: column; + grid-template-rows: auto auto; +} + +.category_item{ + display: flex; + justify-content: center; + align-items: center; + width: auto; + padding: 0 10px 0 10px; + margin: 4px; + cursor: pointer; } \ No newline at end of file -- GitLab From 25884c4c5eeba88999c30b47a6b418b571b69856 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Omar=20Luna=20Hern=C3=A1ndez?= <42101656@uaz.edu.mx> Date: Mon, 15 Jul 2024 20:49:08 -0600 Subject: [PATCH 18/19] Se elimina texto innecesario --- .../admin_panel_place_register/admin_panel_place_register.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/src/components/admin_panel_places/admin_panel_place_register/admin_panel_place_register.tsx b/web/src/components/admin_panel_places/admin_panel_place_register/admin_panel_place_register.tsx index 0edd69b6..7f5eda9a 100644 --- a/web/src/components/admin_panel_places/admin_panel_place_register/admin_panel_place_register.tsx +++ b/web/src/components/admin_panel_places/admin_panel_place_register/admin_panel_place_register.tsx @@ -205,7 +205,7 @@ export const AdminPanelPlaceRegister = ({setIsWindowActive, idTown, categoriesLi onClick={() => onClickCategory(category.idCategory, index)} style={clickedCategories[index] ? {border: '2px solid blue'} : {border: '1px solid black'}} > - {category.nameES} {clickedCategories[index] ? 'SI': 'NO'} + {category.nameES}
); }) -- GitLab From bb5fd03af8a6eb73087bc2ee88b487e3c50de977 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Omar=20Luna=20Hern=C3=A1ndez?= <42101656@uaz.edu.mx> Date: Mon, 15 Jul 2024 20:51:45 -0600 Subject: [PATCH 19/19] Se especifican mejor las clases --- .../sa_panel_category_register/assets/css/styles.css | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/web/src/components/sa_panel_category/sa_panel_category_register/assets/css/styles.css b/web/src/components/sa_panel_category/sa_panel_category_register/assets/css/styles.css index 216bab18..78b5e14d 100644 --- a/web/src/components/sa_panel_category/sa_panel_category_register/assets/css/styles.css +++ b/web/src/components/sa_panel_category/sa_panel_category_register/assets/css/styles.css @@ -45,22 +45,22 @@ display: flex; } -.inputs_container{ +.category_register_body .inputs_container{ height: 100%; width: 100%; } -.input{ +.category_register_body .input{ width: 100%; display: flex; flex-direction: column; } -.input input{ +.category_register_body .input input{ margin: 0px 30px 0px 30px; } -.input_header{ +.category_register_body .input_header{ display: flex; align-items: center; justify-content: center; -- GitLab