@@ -137,7 +144,7 @@ export const SuperadminPanelTownRegister = ({setWindowActive, statesList, forceR
Fotografía representativa del pueblo
-
+
{errors.imageURL?.message}
--
GitLab
From 7d3b4b0e3e9b0ce2194f2b7ebec25edf9e0d7a44 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Omar=20Luna=20Hern=C3=A1ndez?= <42101656@uaz.edu.mx>
Date: Thu, 22 Aug 2024 18:27:37 -0600
Subject: [PATCH 15/21] =?UTF-8?q?Se=20crea=20el=20modeo=20para=20obtener?=
=?UTF-8?q?=20un=20punto=20de=20interes=20y=20se=20crea=20un=20m=C3=A9todo?=
=?UTF-8?q?=20para=20convertirlo=20a=20entidad?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
web/src/data/models/prod/POIModel.ts | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
create mode 100644 web/src/data/models/prod/POIModel.ts
diff --git a/web/src/data/models/prod/POIModel.ts b/web/src/data/models/prod/POIModel.ts
new file mode 100644
index 00000000..603b8bd4
--- /dev/null
+++ b/web/src/data/models/prod/POIModel.ts
@@ -0,0 +1,24 @@
+import { PointOfInterest } from "../../../infraestructure/entities/poi";
+
+export interface POIModel {
+ idPoint: number;
+ idPlace: number;
+ name: string;
+ imageName: string;
+ content: string;
+ directions: string;
+}
+
+export const POIModelToEntity = (model: POIModel) =>{
+ const poi: PointOfInterest = {
+ idPoint : model.idPoint,
+ idPlace : model.idPlace,
+ name: model.name,
+ image: model.imageName,
+ contentES: model.content,
+ contentEN: model.content,
+ directionsES: model.directions,
+ directionsEN: model.directions
+ }
+ return poi;
+}
\ No newline at end of file
--
GitLab
From d5e46ac91294e4c932736e3a42b475a76f1cbf2d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Omar=20Luna=20Hern=C3=A1ndez?= <42101656@uaz.edu.mx>
Date: Thu, 22 Aug 2024 18:28:26 -0600
Subject: [PATCH 16/21] =?UTF-8?q?Se=20crea=20la=20l=C3=B3gica=20para=20cre?=
=?UTF-8?q?ar=20y=20obtener=20puntos=20de=20inter=C3=A9s=20a=20trav=C3=A9s?=
=?UTF-8?q?=20de=20llamadas=20a=20la=20API?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../data/datasources/prod/poi_datasource.ts | 59 +++++++++++++++++++
.../data/repositories/prod/poi_repository.ts | 21 +++++++
.../datasources/poi_repository.ts | 7 +++
.../repositories/poi_repository.ts | 7 +++
4 files changed, 94 insertions(+)
create mode 100644 web/src/data/datasources/prod/poi_datasource.ts
create mode 100644 web/src/data/repositories/prod/poi_repository.ts
create mode 100644 web/src/infraestructure/datasources/poi_repository.ts
create mode 100644 web/src/infraestructure/repositories/poi_repository.ts
diff --git a/web/src/data/datasources/prod/poi_datasource.ts b/web/src/data/datasources/prod/poi_datasource.ts
new file mode 100644
index 00000000..bf000199
--- /dev/null
+++ b/web/src/data/datasources/prod/poi_datasource.ts
@@ -0,0 +1,59 @@
+import axios from "axios";
+import { PoiDatasourceInf } from "../../../infraestructure/datasources/poi_repository";
+import { PointOfInterest } from "../../../infraestructure/entities/poi";
+import { APIUrl } from "../../../constants/api_url";
+import { API_ROUTE_PLACE, API_ROUTE_POINT } from "../../../constants/api_routes";
+import { POIModel, POIModelToEntity } from "../../models/prod/POIModel";
+
+export class POIDatasourceProd implements PoiDatasourceInf{
+ async registerPoint(form: PointOfInterest): Promise
{
+ const formToSend = new FormData();
+ formToSend.append('idPlace', String(form.idPlace));
+ formToSend.append('name', form.name);
+ formToSend.append('image', form.image);
+ formToSend.append('contentEN', form.contentEN);
+ formToSend.append('contentES', form.contentES);
+ formToSend.append('directionsEN', form.directionsEN);
+ formToSend.append('directionsES', form.directionsES);
+
+ const headers = {
+ 'Content-Type': 'multipart/form-data'
+ };
+
+ await axios.post(APIUrl + API_ROUTE_POINT, formToSend,{headers});
+ }
+
+ async getPOIsByPlace(idPlace: number): Promise {
+ const {data: dataES} = await axios.get(APIUrl + API_ROUTE_PLACE + `/${idPlace}` + API_ROUTE_POINT, {
+ params: {
+ lang: 'ES'
+ }
+ });
+
+ const poiList = dataES.map((dataESModel) => {
+ return POIModelToEntity(dataESModel);
+ })
+
+ return poiList;
+ }
+
+ async getPOIById(idPoint: number): Promise {
+ const {data: dataES} = await axios.get(APIUrl + API_ROUTE_POINT + `/${idPoint}`, {
+ params: {
+ lang: 'ES'
+ }
+ });
+
+ const {data: dataEN} = await axios.get(APIUrl + API_ROUTE_POINT + `/${idPoint}`, {
+ params: {
+ lang: 'EN'
+ }
+ });
+
+ const poi: PointOfInterest = POIModelToEntity(dataES);
+ poi.contentEN = dataEN.content;
+ poi.directionsEN = dataEN.directions;
+
+ return poi;
+ }
+}
\ No newline at end of file
diff --git a/web/src/data/repositories/prod/poi_repository.ts b/web/src/data/repositories/prod/poi_repository.ts
new file mode 100644
index 00000000..48991f04
--- /dev/null
+++ b/web/src/data/repositories/prod/poi_repository.ts
@@ -0,0 +1,21 @@
+import { PoiDatasourceInf } from "../../../infraestructure/datasources/poi_repository";
+import { PointOfInterest } from "../../../infraestructure/entities/poi";
+import { PoiRepositoryInf } from "../../../infraestructure/repositories/poi_repository";
+
+export class POIRepositoryProd implements PoiRepositoryInf{
+ constructor(
+ private datasouce: PoiDatasourceInf
+ ){}
+
+ async registerPoint(form: PointOfInterest): Promise {
+ return this.datasouce.registerPoint(form);
+ }
+
+ async getPOIById(idPoint: number): Promise {
+ return this.datasouce.getPOIById(idPoint);
+ }
+
+ async getPOIsByPlace(idPlace: number): Promise {
+ return this.datasouce.getPOIsByPlace(idPlace);
+ }
+}
\ No newline at end of file
diff --git a/web/src/infraestructure/datasources/poi_repository.ts b/web/src/infraestructure/datasources/poi_repository.ts
new file mode 100644
index 00000000..20ec7db6
--- /dev/null
+++ b/web/src/infraestructure/datasources/poi_repository.ts
@@ -0,0 +1,7 @@
+import { PointOfInterest } from "../entities/poi";
+
+export interface PoiDatasourceInf {
+ registerPoint(form: PointOfInterest): Promise;
+ getPOIsByPlace(idPlace: number): Promise;
+ getPOIById(idPoint: number): Promise;
+}
\ No newline at end of file
diff --git a/web/src/infraestructure/repositories/poi_repository.ts b/web/src/infraestructure/repositories/poi_repository.ts
new file mode 100644
index 00000000..3ef41a00
--- /dev/null
+++ b/web/src/infraestructure/repositories/poi_repository.ts
@@ -0,0 +1,7 @@
+import { PointOfInterest } from "../entities/poi";
+
+export interface PoiRepositoryInf {
+ registerPoint(form: PointOfInterest): Promise;
+ getPOIsByPlace(idPlace: number): Promise;
+ getPOIById(idPoint: number): Promise;
+}
\ No newline at end of file
--
GitLab
From a46a5a313a387b59447c18a1a5783102874fad06 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Omar=20Luna=20Hern=C3=A1ndez?= <42101656@uaz.edu.mx>
Date: Thu, 22 Aug 2024 18:29:00 -0600
Subject: [PATCH 17/21] =?UTF-8?q?Se=20crea=20el=20hook=20que=20guarda=20la?=
=?UTF-8?q?=20l=C3=B3gica=20para=20crear,=20validar=20y=20obtener=20puntos?=
=?UTF-8?q?=20de=20interes?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
web/src/hooks/usePointOfInterest.tsx | 179 +++++++++++++++++++++++++++
1 file changed, 179 insertions(+)
create mode 100644 web/src/hooks/usePointOfInterest.tsx
diff --git a/web/src/hooks/usePointOfInterest.tsx b/web/src/hooks/usePointOfInterest.tsx
new file mode 100644
index 00000000..c65d7f46
--- /dev/null
+++ b/web/src/hooks/usePointOfInterest.tsx
@@ -0,0 +1,179 @@
+import { FieldErrors, Resolver, SubmitHandler, useForm } from "react-hook-form";
+import { POIDatasourceProd } from "../data/datasources/prod/poi_datasource";
+import { POIRepositoryProd } from "../data/repositories/prod/poi_repository";
+import { PointOfInterest } from "../infraestructure/entities/poi";
+import { useState } from "react";
+import axios, { AxiosError } from "axios";
+import { toast } from "react-toastify";
+import { languaguesList } from "../constants/languages";
+import { showErrorAxios } from "../utils/Messages";
+
+const POIDatasouce = new POIDatasourceProd();
+const POIRepository = new POIRepositoryProd(POIDatasouce);
+
+const resolver: Resolver = async (data) => {
+ const errors: FieldErrors = {};
+
+ if(!data.idPlace){
+ errors.idPlace = {
+ type : "required",
+ message : "Debe seleccionar el lugar al que pertenece el punto de interés"
+ }
+ }
+
+ if(!data.name){
+ errors.name = {
+ type: "required",
+ message: "El nombre del punto de interés es requerido"
+ };
+ }
+
+ if(!data.contentEN){
+ errors.contentEN = {
+ type: "required",
+ message: "La descripción del punto de interés en inglés es requerida"
+ };
+ }
+
+ if(!data.contentES){
+ errors.contentES = {
+ type: "required",
+ message: "La descripción del punto de interés en español es requerida"
+ };
+ }
+
+ if(!data.directionsEN){
+ errors.directionsEN = {
+ type: "required",
+ message: "Las direcciones del punto de interés en inglés son requeridas"
+ };
+ }
+
+ if(!data.directionsES){
+ errors.directionsES = {
+ type: "required",
+ message: "Las direcciones del punto de interés en español son requeridas"
+ };
+ }
+
+
+ if(!data.image){
+ errors.image = {
+ type: "required",
+ message: "Debe de haber al menos 1 imagen representativa del lugar"
+ }
+ }
+
+ return {
+ values: Object.keys(errors).length > 0 ? {} : data,
+ errors: errors
+ };
+};
+
+export const usePointOfInterest = (forceRenderList?: () => void,
+setIsWindowActive?: (visibility: boolean) => void) => {
+ const {
+ register,
+ handleSubmit,
+ setValue,
+ formState: {errors},
+ clearErrors,
+ resetField,
+ } = useForm({resolver});
+ const [errorMessage, setErrorMessage] = useState("");
+ const [languageDescriptionIndexSelected, setLanguageDescriptionIndexSelected] = useState(0);
+ const [languageDirectionsIndexSelected, setLanguageDirectionsIndexSelected] = useState(0);
+ const [descriptions, setDescriptions] = useState(new Array(languaguesList.length).fill(""));
+ const [directions, setDirections] = useState(new Array(languaguesList.length).fill(""));
+ const [poiList, setPoiList] = useState([]);
+ const [pending, setPending] = useState(false);
+
+
+ const onSubmitRegister : SubmitHandler = (data: PointOfInterest) => {
+ const fetch = async () => {
+ try{
+ await POIRepository.registerPoint(data).then(() =>{
+ if(forceRenderList && setIsWindowActive){
+ setTimeout(() => {
+ forceRenderList();
+ setIsWindowActive(false);
+ }, 1000);
+ }
+ });
+ }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 updatePOIByPlace = async (idPlace: number) => {
+ setPending(true);
+ try{
+ const POIs = await POIRepository.getPOIsByPlace(idPlace);
+ setPoiList(POIs);
+ setPending(false);
+ }catch(error: any){
+ if(axios.isAxiosError(error)){
+ error as AxiosError;
+ showErrorAxios(error);
+ }
+ setPending(false);
+ }
+ }
+
+ const getPointById = async (idPoint: number): Promise => {
+ try{
+ const point = await POIRepository.getPOIById(idPoint);
+ return point;
+ }catch(error: any){
+ if(axios.isAxiosError(error)){
+ error as AxiosError;
+ showErrorAxios(error);
+ }
+ }
+ return null;
+ }
+
+ return {
+ register,
+ handleSubmit,
+ errors,
+ onSubmitRegister,
+ setValue,
+ languageDescriptionIndexSelected,
+ setLanguageDescriptionIndexSelected,
+ languageDirectionsIndexSelected,
+ setLanguageDirectionsIndexSelected,
+ descriptions,
+ directions,
+ setDirections,
+ setDescriptions,
+ clearErrors,
+ resetField,
+ poiList,
+ pending,
+ getPointById,
+ updatePOIByPlace
+ };
+}
--
GitLab
From adf2c6e5c22f2543bf8617130a1984a8acc17696 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Omar=20Luna=20Hern=C3=A1ndez?= <42101656@uaz.edu.mx>
Date: Thu, 22 Aug 2024 18:29:43 -0600
Subject: [PATCH 18/21] =?UTF-8?q?Se=20crea=20el=20componente=20y=20sus=20e?=
=?UTF-8?q?stilos=20para=20visualizar=20la=20lista=20de=20puntos=20de=20in?=
=?UTF-8?q?ter=C3=A9s=20de=20un=20lugar=20especifico?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../admin_panel_poi_list.tsx | 111 ++++++++++++++++++
.../assets/css/styles.css | 34 ++++++
2 files changed, 145 insertions(+)
create mode 100644 web/src/components/admin_panel_poi/admin_panel_poi_list/admin_panel_poi_list.tsx
create mode 100644 web/src/components/admin_panel_poi/admin_panel_poi_list/assets/css/styles.css
diff --git a/web/src/components/admin_panel_poi/admin_panel_poi_list/admin_panel_poi_list.tsx b/web/src/components/admin_panel_poi/admin_panel_poi_list/admin_panel_poi_list.tsx
new file mode 100644
index 00000000..0ec33afc
--- /dev/null
+++ b/web/src/components/admin_panel_poi/admin_panel_poi_list/admin_panel_poi_list.tsx
@@ -0,0 +1,111 @@
+import DataTable, { TableColumn } from 'react-data-table-component';
+import { usePlace } from '../../../hooks/usePlace';
+import './assets/css/styles.css';
+import { LoadingSpinner } from '../../loading_spinner/loading_spinner';
+import { faEdit } from '@fortawesome/free-solid-svg-icons';
+import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
+import { Dispatch, SetStateAction, useEffect, useState } from 'react';
+import { usePointOfInterest } from '../../../hooks/usePointOfInterest';
+import { PointOfInterest } from '../../../infraestructure/entities/poi';
+
+interface props{
+ idTown: number;
+ isWindowActive: boolean;
+ setWindowVisibility: (visibility: boolean) => void;
+ setActualPoint: Dispatch>;
+ setIsRegisterPane: Dispatch>;
+}
+
+export const AdminPanelPoiList = ({idTown, isWindowActive}: props) => {
+ const [isLoading, setIsLoading] = useState(false);
+ const {
+ placeList,
+ updatePlacesByTown
+ } = usePlace();
+
+ const {
+ pending,
+ updatePOIByPlace,
+ poiList
+ } = usePointOfInterest();
+
+ const columns : TableColumn[] = [
+ {
+ name: "Identificador",
+ selector: row => row.idPoint || -1,
+ sortable: true
+ },
+ {
+ name: "Nombre",
+ selector: row => row.name,
+ sortable: true
+ },
+ {
+ name: "Descripción",
+ selector: row => row.contentES,
+ sortable: true
+ },
+ {
+ name: "Acciones",
+ cell: (row) => {
+ return (
+
+ );
+ }
+ }
+ ];
+
+ useEffect(() => {
+ setIsLoading(true);
+ updatePlacesByTown(idTown);
+ setIsLoading(false);
+ },[]);
+
+ const refreshList = (idPlace: number) => {
+ updatePOIByPlace(idPlace)
+ };
+
+
+ if(isLoading) return
+
+ return (
+
+
+ Lugar
+
+
+
+
+ }
+ columns={columns} data={poiList} selectableRows className="data_table"
+ />
+
+
+ );
+}
\ No newline at end of file
diff --git a/web/src/components/admin_panel_poi/admin_panel_poi_list/assets/css/styles.css b/web/src/components/admin_panel_poi/admin_panel_poi_list/assets/css/styles.css
new file mode 100644
index 00000000..a3154b01
--- /dev/null
+++ b/web/src/components/admin_panel_poi/admin_panel_poi_list/assets/css/styles.css
@@ -0,0 +1,34 @@
+.poi_list_cnt{
+ display: flex;
+ height: 100%;
+ width: 100%;
+ flex-direction: column;
+}
+
+.poi_list_header{
+ display: flex;
+ width: 100%;
+ height: 8%;
+ justify-content: center;
+ align-items: center;
+}
+
+.poi_list_body{
+ display: flex;
+ width: 100%;
+ flex-grow: 1;
+}
+
+.data_table{
+ height: 100%;
+}
+
+.bhFeAR{
+ display: flex !important;
+ height: 100%;
+}
+
+.rdt_TableBody{
+ max-height: 100%;
+ overflow-y: auto;
+}
\ No newline at end of file
--
GitLab
From 1ba88c49c7cb45e22946a7801d4bcf2b7b9fda48 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Omar=20Luna=20Hern=C3=A1ndez?= <42101656@uaz.edu.mx>
Date: Thu, 22 Aug 2024 18:30:27 -0600
Subject: [PATCH 19/21] =?UTF-8?q?Se=20crea=20el=20componente=20y=20los=20e?=
=?UTF-8?q?stilos=20para=20el=20panel=20para=20agregar=20un=20punto=20de?=
=?UTF-8?q?=20inter=C3=A9s?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../admin_panel_poi_register.tsx | 207 ++++++++++++++++++
.../assets/css/styles.css | 137 ++++++++++++
2 files changed, 344 insertions(+)
create mode 100644 web/src/components/admin_panel_poi/admin_panel_poi_register/admin_panel_poi_register.tsx
create mode 100644 web/src/components/admin_panel_poi/admin_panel_poi_register/assets/css/styles.css
diff --git a/web/src/components/admin_panel_poi/admin_panel_poi_register/admin_panel_poi_register.tsx b/web/src/components/admin_panel_poi/admin_panel_poi_register/admin_panel_poi_register.tsx
new file mode 100644
index 00000000..d8f653e1
--- /dev/null
+++ b/web/src/components/admin_panel_poi/admin_panel_poi_register/admin_panel_poi_register.tsx
@@ -0,0 +1,207 @@
+import { faWindowClose } from "@fortawesome/free-solid-svg-icons";
+import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
+import { useEffect, useState} from "react";
+import "./assets/css/styles.css";
+import { languaguesList } from "../../../constants/languages";
+import { LoadingScreen } from "../../loading_screen/loading_screen";
+import { usePointOfInterest } from "../../../hooks/usePointOfInterest";
+import { EmptyPointOfInterest, PointOfInterest } from "../../../infraestructure/entities/poi";
+import { ImageDropzone } from "../../image_dropzone/image_dropzone";
+import { usePlace } from "../../../hooks/usePlace";
+
+interface props {
+ setWindowVisibility: (visibility: boolean) => void;
+ idTown: number;
+ forceRenderList: () => void;
+ isRegister: boolean;
+ form?: PointOfInterest;
+}
+
+export const AdminPanelPoiRegister = ({setWindowVisibility, idTown,forceRenderList, isRegister, form}: props) => {
+ const {
+ register,
+ errors,
+ setDescriptions,
+ setDirections,
+ descriptions,
+ directions,
+ setLanguageDescriptionIndexSelected,
+ handleSubmit,
+ onSubmitRegister,
+ getPointById,
+ setValue,
+ languageDescriptionIndexSelected,
+ languageDirectionsIndexSelected,
+ setLanguageDirectionsIndexSelected,
+ } = usePointOfInterest(forceRenderList, setWindowVisibility);
+ const [isLoading, setIsLoading] = useState(false);
+ const [actualPOI, setActualPOI] = useState(EmptyPointOfInterest);
+ const [preview, setPreview] = useState(null);
+ const [image, setImage] = useState(null);
+ const {
+ placeList,
+ updatePlacesByTown
+ } = usePlace();
+
+ useEffect(() => {
+ if(image){
+ setValue('image', image, {shouldValidate: true});
+ }
+ },[image]);
+
+ useEffect(() => {
+ setIsLoading(true);
+ const fetchData = async () => {
+ await updatePlacesByTown(idTown);
+ if (!isRegister && form) {
+ const pointGetted = await getPointById(form.idPoint || 0);
+ if(pointGetted){
+ setActualPOI(pointGetted);
+ setValue('idPoint', pointGetted.idPlace);
+ setValue('name', pointGetted.name);
+ setValue('contentEN', pointGetted.contentEN);
+ setValue('contentES', pointGetted.contentES);
+ setValue('directionsEN', pointGetted.directionsEN);
+ setValue('directionsES', pointGetted.directionsES);
+ }
+ }
+ };
+ fetchData();
+ setIsLoading(false);
+ },[]);
+
+ return (
+
+
+ Registra el punto de interés
+ setWindowVisibility(false)}/>
+
+
+ {isLoading
+ ?
+
+ :
+
+ }
+
+
+ );
+}
\ No newline at end of file
diff --git a/web/src/components/admin_panel_poi/admin_panel_poi_register/assets/css/styles.css b/web/src/components/admin_panel_poi/admin_panel_poi_register/assets/css/styles.css
new file mode 100644
index 00000000..2ae1a18e
--- /dev/null
+++ b/web/src/components/admin_panel_poi/admin_panel_poi_register/assets/css/styles.css
@@ -0,0 +1,137 @@
+*{
+ user-select: none;
+}
+
+.poi_register_wrap{
+ position: absolute;
+ z-index: 99;
+ left: 0;
+ right: 0;
+ top: 0;
+ bottom: 0;
+ margin: auto;
+ width: 75vw;
+ height: 90vh;
+ display: flex;
+ flex-direction: column;
+ background: white;
+ border: solid 2px black;
+}
+
+.poi_register_header{
+ display: flex;
+ width: 100%;
+ align-items: center;
+ justify-content: center;
+ padding: 5px;
+ background: #ccc;
+ height: 7%;
+}
+
+.close_btn{
+ display: inline-block;
+ cursor: pointer;
+ height: 3%;
+ position: absolute;
+ right: 5px;
+}
+
+.poi_register_body{
+ height: 93%;
+ width: 100%;
+}
+
+.poi_register_body form{
+ height: 100%;
+ display: flex;
+}
+
+.inputs_container{
+ height: 100%;
+ width: 60%;
+}
+
+.image_cnt{
+ height: 100%;
+ width: 40%;
+ display: flex;
+ align-items: center;
+ flex-direction: column;
+}
+
+.input{
+ width: 100%;
+ display: flex;
+ flex-direction: column;
+}
+
+.input_header{
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ position: relative;
+}
+
+.input .input_header select{
+ position: absolute;
+ right: 5px;
+}
+
+.error{
+ color: red;
+ font-size: 12px;
+ padding: 0;
+ margin: 0;
+}
+
+.poi_description{
+ height: 100px;
+ padding: 5px;
+ overflow-y: auto;
+ resize: none;
+}
+
+.town_select_cnt{
+ display: flex;
+ width: 100%;
+}
+
+.town_select_cnt div{
+ width: 50%;
+ height: 100%;
+ display: flex;
+ flex-direction: row;
+ justify-content: center;
+ align-items: center;
+}
+
+.town_select_cnt div select{
+ width: 50%;
+}
+
+.input_body{
+ display: flex;
+ width: 100%;
+ flex-direction: row;
+}
+
+.input_body div{
+ height: 100%;
+ width: 50%;
+ display: flex;
+ flex-direction: row;
+ justify-content: center;
+ align-items: center;
+}
+
+.place_select{
+ display: flex;
+ flex-direction: column;
+ width: 50%;
+ justify-content: center;
+ align-items: center;
+}
+
+.place_select select{
+ width: 60%;
+}
\ No newline at end of file
--
GitLab
From 2ad1228911f2834b70b45fe5f28c840ee3d5abfd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Omar=20Luna=20Hern=C3=A1ndez?= <42101656@uaz.edu.mx>
Date: Thu, 22 Aug 2024 18:31:18 -0600
Subject: [PATCH 20/21] =?UTF-8?q?Se=20crea=20el=20componente=20y=20los=20e?=
=?UTF-8?q?stilos=20para=20la=20pantalla=20que=20va=20a=20contener=20la=20?=
=?UTF-8?q?lista=20de=20puntos=20de=20inter=C3=A9s=20y=20el=20boton=20para?=
=?UTF-8?q?=20agregar=20un=20nuevo=20punto?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../admin_panel_poi_screen.tsx | 60 +++++++++++++++++++
.../assets/css/styles.css | 29 +++++++++
2 files changed, 89 insertions(+)
create mode 100644 web/src/components/admin_panel_poi/admin_panel_poi_screen/admin_panel_poi_screen.tsx
create mode 100644 web/src/components/admin_panel_poi/admin_panel_poi_screen/assets/css/styles.css
diff --git a/web/src/components/admin_panel_poi/admin_panel_poi_screen/admin_panel_poi_screen.tsx b/web/src/components/admin_panel_poi/admin_panel_poi_screen/admin_panel_poi_screen.tsx
new file mode 100644
index 00000000..57d32b8f
--- /dev/null
+++ b/web/src/components/admin_panel_poi/admin_panel_poi_screen/admin_panel_poi_screen.tsx
@@ -0,0 +1,60 @@
+import { Dispatch, SetStateAction, useEffect, useState } from "react";
+import { AdminPanelPoiRegister } from "../admin_panel_poi_register/admin_panel_poi_register";
+import "./assets/css/styles.css";
+import { AdminPanelPoiList } from "../admin_panel_poi_list/admin_panel_poi_list";
+import { Town } from "../../../infraestructure/entities/town";
+import { PointOfInterest } from "../../../infraestructure/entities/poi";
+
+interface props {
+ isWindowActive: boolean;
+ setIsWindowActive: Dispatch>;
+ town: Town | undefined;
+}
+
+export const AdminPanelPoiScreen = ({isWindowActive,setIsWindowActive, town}: props) => {
+ const [renderCount, setRenderCount] = useState(0);
+ const [isRegisterPane, setIsRegisterPane] = useState(true);
+ const [actualPoint, setActualPoint] = useState();
+ const [isPlaceRegisterWindowActive, setIsPlaceRegisterWindowActive] = useState(false);
+
+ const forceRenderList = () =>{
+ setRenderCount(prevCount => prevCount + 1);
+ setIsWindowActive(false);
+ }
+
+ const setWindowVisibility = (visibility: boolean) => {
+ setIsPlaceRegisterWindowActive(visibility);
+ setIsWindowActive(visibility);
+ }
+
+ return (
+
+
+ Administrar puntos de interés dentro de un lugar
+
+
+
+ {
+ isPlaceRegisterWindowActive &&
+ }
+
+
+
+ );
+}
\ No newline at end of file
diff --git a/web/src/components/admin_panel_poi/admin_panel_poi_screen/assets/css/styles.css b/web/src/components/admin_panel_poi/admin_panel_poi_screen/assets/css/styles.css
new file mode 100644
index 00000000..5471c694
--- /dev/null
+++ b/web/src/components/admin_panel_poi/admin_panel_poi_screen/assets/css/styles.css
@@ -0,0 +1,29 @@
+.admin_panel_poi_content{
+ width: 100%;
+ max-height: 100%;
+ display: flex;
+ flex-direction: column;
+}
+
+.panel_poi_header{
+ height: 7%;
+ width: 100%;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ padding: 5px;
+ background: gray;
+}
+
+.panel_poi_header .poi_add_btn{
+ display: inline-block;
+ cursor: pointer;
+ position: absolute;
+ right: 5px;
+}
+
+.panel_poi_body{
+ height: 93%;
+ width: 100%;
+ background: white;
+}
\ No newline at end of file
--
GitLab
From 120df60fd020a3a8c0140d2e8de0b1c5101e197c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Omar=20Luna=20Hern=C3=A1ndez?= <42101656@uaz.edu.mx>
Date: Thu, 22 Aug 2024 18:31:49 -0600
Subject: [PATCH 21/21] =?UTF-8?q?Se=20integra=20el=20componente=20de=20la?=
=?UTF-8?q?=20pantalla=20de=20puntos=20de=20inter=C3=A9s=20en=20el=20panel?=
=?UTF-8?q?=20de=20administrador?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
web/src/pages/home/admin_page/admin_home_page.tsx | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/web/src/pages/home/admin_page/admin_home_page.tsx b/web/src/pages/home/admin_page/admin_home_page.tsx
index e0626b77..a8852459 100644
--- a/web/src/pages/home/admin_page/admin_home_page.tsx
+++ b/web/src/pages/home/admin_page/admin_home_page.tsx
@@ -12,6 +12,7 @@ import { ErrorWindow } from "../../../components/error_window/error_window";
import { LoadingSpinner } from "../../../components/loading_spinner/loading_spinner";
import { ToastContainer } from "react-toastify";
import { AdminTownInfo } from "../../../components/admin_town_info/admin_town_info";
+import { AdminPanelPoiScreen } from "../../../components/admin_panel_poi/admin_panel_poi_screen/admin_panel_poi_screen";
export const AdminHomePage = () => {
const {
@@ -65,9 +66,9 @@ export const AdminHomePage = () => {
@@ -80,8 +81,8 @@ export const AdminHomePage = () => {
return
case AdminSelectedPanel.PLACES:
return ;
- case AdminSelectedPanel.ACTIVITIES:
- return
+ case AdminSelectedPanel.POINT_OF_INTEREST:
+ return ;
default:
return null;
}
--
GitLab