Skip to content

Commit

Permalink
Merge pull request #32 from iic2154-uc-cl/development_deploy_2
Browse files Browse the repository at this point in the history
Development deploy 2
  • Loading branch information
sebaav12 authored Nov 7, 2024
2 parents a0a171a + 2d6bb10 commit 6e05b77
Show file tree
Hide file tree
Showing 95 changed files with 10,074 additions and 3,464 deletions.
11 changes: 11 additions & 0 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,17 @@
# NEXT_PUBLIC_LOGIN_REDIRECT_URL=http://localhost:3000/post/CreateProperty
# NEXT_PUBLIC_LOGOUT_REDIRECT_URL=http://localhost:3000


VITE_GOOGLE_MAPS_API_KEY=AIzaSyAJuzF9SX5VP6CU38hq-lgRopJ66jYgb5E

#VITE_AUTH0_AUDIENCE=https://geomap/
#VITE_AUTH0_DOMAIN=dev-7w1no2zl1opt24if.us.auth0.com
#VITE_AUTH0_CLIENT_ID=QrElcRF9AI2H6dRBwCChbc04JvtKygJo

VITE_AUTH0_AUDIENCE=https://geomap/
VITE_AUTH0_DOMAIN=dev-7w1no2zl1opt24if.us.auth0.com
VITE_AUTH0_CLIENT_ID=QrElcRF9AI2H6dRBwCChbc04JvtKygJo

VITE_API_URL=http://localhost:8000/
ONESIGNAL_APP_ID=a8f9feb6-81c6-464a-ac6d-56bf9fafba76
ONESIGNAL_REST_API_KEY=YmY2ZWEwMTUtNmMzZi00MDg1LWEyZDMtMDE5ZjQ0OWQ5NmQw
2 changes: 1 addition & 1 deletion .github/workflows/commit_review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ jobs:
--sha "$SHA" \
--message "$MESSAGE" \
--webhook "$WEBHOOK" \
--websecret "$WEBSECRET"
--websecret "$WEBSECRET"
2 changes: 1 addition & 1 deletion .github/workflows/condor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ jobs:
pip install condor_code_reviewer
- name: Run Condor
run: condor --openai-key ${{ secrets.OPENAI_KEY }} --gh-api-key ${{ secrets.GH_API_KEY }} --assistant-id ${{ secrets.ASSISTANT_ID }} --pull-request-url ${{ github.event.pull_request.html_url }}
run: condor --gh-api-key ${{ secrets.GH_API_KEY }} --assistant-id ${{ secrets.ASSISTANT_ID }} --pull-request-url ${{ github.event.pull_request.html_url }}
2 changes: 1 addition & 1 deletion .github/workflows/sonar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ jobs:
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
REPOSITORY: ${{ github.repository }}
BRANCH: ${{ github.ref }}
BRANCH: ${{ github.ref }}
15 changes: 13 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,24 @@
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<link rel="icon" type="image/svg+xml" href="src/assets/logo_oficial.png" />
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Kaushan+Script&display=swap" rel="stylesheet">

<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>GeoMapp</title>

<script src="https://cdn.onesignal.com/sdks/web/v16/OneSignalSDK.page.js" defer></script>
<script>
window.OneSignalDeferred = window.OneSignalDeferred || [];
OneSignalDeferred.push(async function(OneSignal) {
await OneSignal.init({
appId: "a8f9feb6-81c6-464a-ac6d-56bf9fafba76",
});
});
</script>

<title>GEOMAPP</title>
</head>
<body>
<div id="root"></div>
Expand Down
8 changes: 6 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,18 @@
"@emotion/react": "^11.13.3",
"@emotion/styled": "^11.13.0",
"@material-tailwind/react": "^2.1.10",
"@mui/icons-material": "^6.1.6",
"@mui/lab": "^6.0.0-beta.10",
"@mui/material": "^6.1.2",
"@mui/system": "^6.1.2",
"@mui/x-date-pickers": "^7.19.0",
"@react-google-maps/api": "^2.19.3",
"@react-google-maps/api": "^2.20.3",
"aws-sdk": "^2.1691.0",
"axios": "^1.7.7",
"browser-image-compression": "^2.0.2",
"compress.js": "1.1.2",
"date-fns": "2.29.3",
"framer-motion": "^11.11.11",
"lucide-react": "^0.454.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
Expand All @@ -39,6 +43,6 @@
"eslint-plugin-react-hooks": "^5.1.0-rc.0",
"eslint-plugin-react-refresh": "^0.4.12",
"globals": "^15.9.0",
"vite": "^5.4.8"
"vite": "^5.4.10"
}
}
1 change: 1 addition & 0 deletions public/OneSignalSDKWorker.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
importScripts("https://cdn.onesignal.com/sdks/web/v16/OneSignalSDK.sw.js");
Binary file modified src/.DS_Store
Binary file not shown.
10 changes: 8 additions & 2 deletions src/Router.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ import Favoritos from './pages/users/favoritos.jsx';
import Notification from './pages/users/notificaciones.jsx';
import NewMapa from './pages/newMapa.jsx';
import Calendario from './pages/calendario.jsx';
import GestionSolicitudes from './pages/GestionSolicitudes.jsx';
import TermCondition from './pages/TermCondition.jsx';
import Privacy from './pages/PrivacyPolitic.jsx';
import NewPublicacionInfo from './components/NewPublicacionInfo.jsx';

function Router() {

Expand All @@ -30,8 +34,10 @@ function Router() {
<Route path="/notificaciones" element={<Notification />} />
<Route path="/mapa-navegacion" element={<NewMapa />} />
<Route path="/calendario" element={<Calendario />} />


<Route path="/gestion-solicitudes" element={<GestionSolicitudes />} />
<Route path="/term-condition" element={<TermCondition />} />
<Route path="/privacy" element={<Privacy />} />
<Route path="/publicacion/:id" element={<NewPublicacionInfo />} />

</Routes>
</BrowserRouter>
Expand Down
Binary file added src/assets/Empanadas.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/Logo270.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/boton1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/boton2 2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/boton2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/boton3.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/fblogo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/iglogo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/logo_admin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/logo_oficial.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/pin2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/tellogo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/boton1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/boton2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/boton3.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
65 changes: 65 additions & 0 deletions src/components/Campana.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
import React, { useState, useEffect } from 'react';
import '../pages/users/campana.css';

const Campana = () => {
const [isOpen, setIsOpen] = useState(false);
const [notificaciones, setNotificaciones] = useState([]);

const toggleNotifications = () => {
setIsOpen(!isOpen);
};

useEffect(() => {
if (isOpen && notificaciones.length === 0) {
fetch('http://localhost:8000/onesignal/notificaciones/')
.then((response) => response.json())
.then((data) => setNotificaciones(data))
.catch((error) => console.error('Error fetching notifications:', error));
}
}, [isOpen]);

return (
<div className="campana-container">
<div className="loader" onClick={toggleNotifications}>
<svg
viewBox="0 0 24 24"
fill="none"
height="24"
width="24"
xmlns="http://www.w3.org/2000/svg"
aria-hidden="true"
className="w-6 h-6 text-gray-800 dark:text-white"
>
<path
d="M12 5.365V3m0 2.365a5.338 5.338 0 0 1 5.133 5.368v1.8c0 2.386 1.867 2.982 1.867 4.175 0 .593 0 1.292-.538 1.292H5.538C5 18 5 17.301 5 16.708c0-1.193 1.867-1.789 1.867-4.175v-1.8A5.338 5.338 0 0 1 12 5.365ZM8.733 18c.094.852.306 1.54.944 2.112a3.48 3.48 0 0 0 4.646 0c.638-.572 1.236-1.26 1.33-2.112h-6.92Z"
strokeWidth="2"
strokeLinejoin="round"
strokeLinecap="round"
stroke="currentColor"
></path>
</svg>
<div className="point"></div>
</div>

{isOpen && (
<div className="notification-box">
<h4>Notificaciones</h4>
<ul>
{notificaciones.length > 0 ? (
notificaciones.map((notificacion, index) => (
<li key={index}>
<h5>{notificacion.title}</h5>
<p>{notificacion.message}</p>
</li>
))
) : (
<li>No hay notificaciones disponibles</li>
)}
</ul>
</div>
)}
</div>
);
};

export default Campana;
46 changes: 27 additions & 19 deletions src/components/Filter.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -180,26 +180,34 @@ const Filter = ({ onCategoryChange, onSubCategoryChange, onRatingChange, onPrice

{/* linea de separación */}
<hr/>
{/* Solo se muestra si categoría: Propiedad o Camping */}
{selectedIndustries.includes('Propiedad') || selectedIndustries.includes('Camping') ? (
<>
<h3>Precio</h3>
<div className="price-list">
{/* rango de precio: 0 - 100000 */}
<Slider
value={rangePrice}
onChange={handlePriceChange}
valueLabelDisplay="off"
min={0}
max={100000}
step={1000}
style={{ width: '100%', color: '#fa7e02' }}
/>
<span className='price-text'>
<span>{`$${rangePrice[0]}`}</span>
<span>{' - '}</span>
<span>{`$${rangePrice[1]}`}</span>
</span>

</div>
</>
)
: null}

{/* linea de separación */}

<h3>Precio</h3>
<div className="price-list">
{/* rango de precio: 0 - 100000 */}
<Slider
value={rangePrice}
onChange={handlePriceChange}
valueLabelDisplay="off"
min={0}
max={100000}
step={1000}
style={{ width: '100%', color: '#fa7e02' }}
/>
<span className='price-text'>
<span>{`$${rangePrice[0]}`}</span>
<span>{' - '}</span>
<span>{`$${rangePrice[1]}`}</span>
</span>

</div>

<div className="buttons">
<button id="showResultsBtn" className="show-results-btn" onClick={handleReset}>
Expand Down
14 changes: 9 additions & 5 deletions src/components/Footer.jsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
import React from 'react';
import '../styles/footer.css'; // Asegúrate de que este archivo está correctamente vinculado
import React, { useState } from 'react';
import { useAuth0 } from '@auth0/auth0-react';

//import '../styles/footer.css'; // Asegúrate de que este archivo está correctamente vinculado
import { Link } from 'react-router-dom';

function Footer() {
return (

return (
<footer className="footer">
<div className="footer-links">
<a href="Terminos.html" className="footer-link">Términos y Condiciones de uso</a>
<a href="Politicas.html" className="footer-link">Políticas de privacidad</a>
<Link to="/term-condition" className="footer-link">Términos y Condiciones de uso</Link>
<Link to="/privacy" className="footer-link">Políticas de privacidad</Link>
</div>
</footer>
);
Expand Down
2 changes: 1 addition & 1 deletion src/components/GoogleMap.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ const GoogleMapComponent = ({ onMapLoad, filterType, places }) => {
return (
<div style={containerStyle}>
<div style={mapStyle}>
<LoadScript googleMapsApiKey="AIzaSyAJuzF9SX5VP6CU38hq-lgRopJ66jYgb5E">
<LoadScript googleMapsApiKey={import.meta.env.VITE_GOOGLE_MAPS_API_KEY}>
<GoogleMap
mapContainerStyle={mapStyle}
center={userLocation}
Expand Down
59 changes: 59 additions & 0 deletions src/components/GoogleMapSelectLocation.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
import React, { useState } from 'react';
import { GoogleMap, LoadScript, Marker } from '@react-google-maps/api';

const containerStyle = {
height: '400px', // Ajusta el tamaño del contenedor si es necesario
width: '100%',
};

const center = {
lat: -33.45694, // Coordenadas iniciales para Santiago, Chile
lng: -70.64827,
};

const GoogleMapSelectLocation = ({ onLocationSelect }) => {
const [selectedLocation, setSelectedLocation] = useState(null);

const handleMapClick = (event) => {
const location = {
lat: event.latLng.lat(),
lng: event.latLng.lng(),
};
setSelectedLocation(location);

//Llamada a la API de Geocoding
const geocoder = new window.google.maps.Geocoder();
geocoder.geocode({ location }, (results, status) => {
if (status === "OK") {
if (results[0]) {
const address = results[0].formatted_address;
onLocationSelect(address); // Pasar la dirección al formulario
} else {
console.log("No se encontraron resultados");
}
} else {
console.log("Geocoder falló debido a: " + status);
}
});
};

return (
<LoadScript googleMapsApiKey={import.meta.env.VITE_GOOGLE_MAPS_API_KEY}>
<GoogleMap
mapContainerStyle={containerStyle}
center={center}
zoom={12}
onClick={handleMapClick} // Añade la función para manejar clics en el mapa
>
{selectedLocation && (
<Marker
position={selectedLocation}
title="Ubicación seleccionada"
/>
)}
</GoogleMap>
</LoadScript>
);
};

export default GoogleMapSelectLocation;
46 changes: 46 additions & 0 deletions src/components/ImageUpload.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
html, body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; /* Usar San Francisco */
}
.image-upload-container {
max-width: 800px;
margin: 0 auto;
}

.dropzone {
background-color: #f9fafb; /* Color de fondo más claro */
transition: background-color 0.2s;
}

.dropzone:hover {
background-color: #e5e7eb; /* Color de fondo al pasar el mouse */
}

.image-preview {
margin-top: 0.5rem;
width: 100%; /* Asegúrate de que ocupe todo el ancho de su contenedor */
height: 150px; /* Altura fija para todas las imágenes */
object-fit: cover; /* Mantener la relación de aspecto y recortar si es necesario */
}

.font-medium {
padding-left: 10px;
margin-bottom: 70px;
}
.absolute{
position: absolute;
border: none;
background-color: transparent;
}
.absolute:hover{
color: #666;
}
.flex{
display: flex flex-wrap;
}







Loading

0 comments on commit 6e05b77

Please sign in to comment.