Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Develop2 #33

Closed
wants to merge 33 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
263ae02
adding webpay
May 19, 2024
116b823
nuevas dependencias
May 19, 2024
b495e73
webpay casi listo
May 19, 2024
eb5d381
Merge pull request #18 from rzyuras/barbi-webpay
barbarafcp May 19, 2024
8ca5a8e
webpay
May 19, 2024
a718b57
feat(Webpay): Webpay funcional, falta ui de retorno post pago.
rzyuras May 19, 2024
d9cfa25
Merge branch 'develop2' into avances-barbi
barbarafcp May 19, 2024
9e62392
Merge pull request #19 from rzyuras/avances-barbi
barbarafcp May 19, 2024
d4812d8
token
May 19, 2024
c67e075
fix(ruta post commit): Cambio de ruta de transactions a flights.
rzyuras May 19, 2024
0fa20e7
should work now
May 19, 2024
3a5dbef
Merge pull request #20 from rzyuras/avances-barbi
barbarafcp May 19, 2024
e75f247
avances
May 20, 2024
fa329dc
feat(boletas): Api serverless lista, falta conexión.
rzyuras May 20, 2024
9ea08f9
Merge pull request #22 from rzyuras/boletas
rzyuras May 20, 2024
0f5562a
fix(boletas): Ahora los link de las boletas se pueden ver por todos
rzyuras May 20, 2024
82ec699
sending ip details
May 21, 2024
dff2b93
Merge pull request #23 from rzyuras/avances-barbi
barbarafcp May 21, 2024
fe6e311
docs
May 21, 2024
9f566ac
Merge pull request #24 from rzyuras/avances-barbi
barbarafcp May 21, 2024
d37ca17
recommendations base
May 21, 2024
2b3369e
Merge pull request #25 from rzyuras/avances-barbi
barbarafcp May 21, 2024
478198d
uuid
May 22, 2024
61cebfd
Merge pull request #26 from rzyuras/avances-barbi
barbarafcp May 22, 2024
ee5f75d
feat(flightRequest): Se añade el nombre del usuario al flightRequest
rzyuras May 22, 2024
e772170
mail
May 22, 2024
ba0ef1e
Merge pull request #27 from rzyuras/avances-barbi
barbarafcp May 22, 2024
913cfc1
feat(boletas): Ahora se muestra el url de la boleta de los pedidos en…
rzyuras May 22, 2024
6d79836
fix(boletas): Fix importar Button
rzyuras May 22, 2024
5fd2fd3
fix(boletas): Arreglo de formato de fechas
rzyuras May 23, 2024
4609808
fix(flightdetails): Arreglo picker y botón de compra
rzyuras May 23, 2024
9ef2a97
Merge pull request #28 from rzyuras/rado
rzyuras May 23, 2024
a9004b2
Delete .DS_Store
rzyuras May 23, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions Sample-01/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,25 +22,30 @@
"@fortawesome/react-fontawesome": "^0.2",
"@heroicons/react": "^2.1.3",
"@mui/material": "^5.15.15",
"@sendgrid/mail": "^8.1.3",
"@tanstack/react-query": "^5.37.1",
"autoprefixer": "^10.4",
"axios": "^1.6.8",
"buffer": "^6.0.3",
"cors": "^2.8",
"cors": "^2.8.5",
"crypto": "^1.0.1",
"date-fns": "^3.6.0",
"date-fns-tz": "^3.1.3",
"express": "^4.18",
"express": "^4.19.2",
"express-oauth2-jwt-bearer": "^1.6.0",
"helmet": "^4.4",
"highlight.js": "^11.9.0",
"history": "^5.3.0",
"jsonwebtoken": "^9.0.2",
"morgan": "^1.9",
"node-fetch": "^3.3.2",
"npm-run-all": "^4.1",
"postcss": "^8.4",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-is": "^16.13.1",
"react-qty-picker": "^1.0.6",
"react-router-dom": "^5.3",
"react-router-dom": "^6.23.1",
"react-scripts": "^5.0",
"reactjs-popup": "^2.0.6",
"reactstrap": "^9.2",
Expand Down
13 changes: 13 additions & 0 deletions Sample-01/src/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
font-size: 16px;
}


.modal-button:hover {
background-color: #0056b3;
}
Expand All @@ -78,6 +79,7 @@

.btn-comprar {
margin-left: 30px;
margin-top: 5px;
background-color: #007bff;
color: #fff;
padding: 10px 20px;
Expand All @@ -87,12 +89,23 @@
font-size: 16px;
}

.btn-comprar:disabled {
background-color: grey;
color: darkgrey;
cursor: not-allowed;
}

.flight-container {
display: flex;
flex-direction: row;
justify-content: space-between;
}

.btn-container {
display: flex;
justify-content: center;
}

.Airline-Logo {
margin-right: 10px;
}
Expand Down
22 changes: 13 additions & 9 deletions Sample-01/src/App.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import React from "react";
import { Router, Route, Switch } from "react-router-dom";
import { BrowserRouter as Router, Route, Routes } from "react-router-dom";
import { Container } from "reactstrap";
// import Loading from "./components/Loading";
import NavBar from "./components/NavBar";
import Home from "./views/Home";
import Profile from "./views/Profile";
// import { useAuth0 } from "@auth0/auth0-react";
import history from "./utils/history";

Check warning on line 9 in Sample-01/src/App.js

View workflow job for this annotation

GitHub Actions / build-and-deploy

'history' is defined but never used

Check warning on line 9 in Sample-01/src/App.js

View workflow job for this annotation

GitHub Actions / build-frontend

'history' is defined but never used

Check warning on line 9 in Sample-01/src/App.js

View workflow job for this annotation

GitHub Actions / build-frontend

'history' is defined but never used

Check warning on line 9 in Sample-01/src/App.js

View workflow job for this annotation

GitHub Actions / build-frontend

'history' is defined but never used

Check warning on line 9 in Sample-01/src/App.js

View workflow job for this annotation

GitHub Actions / build-frontend

'history' is defined but never used

Check warning on line 9 in Sample-01/src/App.js

View workflow job for this annotation

GitHub Actions / build-frontend

'history' is defined but never used

// styles
import "./App.css";
Expand All @@ -16,6 +16,8 @@
import FlightList from "./views/FlightList";
import Flight from "./views/FlightDetails";
import PurchaseList from "./views/MyPurchases";
import PurchaseCompleted from "./views/PurchaseCompleted";
import Recommendations from "./views/Recommendations";

initFontAwesome();

Expand All @@ -31,17 +33,19 @@
// }

return (
<Router history={history}>
<Router>
<div id="app" className="d-flex flex-column h-100">
<NavBar />
<Container className="flex-grow-1 mt-5">
<Switch>
<Route path="/" exact component={Home} />
<Route path="/profile" component={Profile} />
<Route path="/flights" component={FlightList}/>
<Route path="/details/:flightId" component={Flight}/>
<Route path="/mypurchases" component={PurchaseList} />
</Switch>
<Routes>
<Route path="/" element={<Home/>} />
<Route path="/profile" element={<Profile/>} />
<Route path="/flights" element={<FlightList/>}/>
<Route path="/details/:flightId" element={<Flight/>}/>
<Route path="/mypurchases" element={<PurchaseList/>} />
<Route path="/purchase" element={<PurchaseCompleted/>} />
<Route path="/recommendations" element={<Recommendations/>} />
</Routes>
</Container>
{/*<Footer />*/}
</div>
Expand Down
46 changes: 41 additions & 5 deletions Sample-01/src/api/flights.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import axios from 'axios';

const BASE_URL = 'https://wtfmzvwh4b.execute-api.us-east-1.amazonaws.com';
// const BASE_URL = 'http://localhost:3000';
const BASE_URL = 'https://rvvfas273i.execute-api.us-east-2.amazonaws.com/dev';

export const getAllFlights = async (token, filters = {}, pageNumber = 1) => {
try {
Expand Down Expand Up @@ -38,16 +39,33 @@ export const getFlightDetails = async (token, flightId) => {
}
}

export const postFlightRequest = async (token, flightId, quantity) => {
export const getRecommendations = async ( token ) => {
try {
const headers = {
Authorization: `Bearer ${token}`
};
const response = await axios.get(`${BASE_URL}/flights/recommendations`, { headers });
return response.data.flights;
} catch (error) {
console.error("Error: details", error)
throw error;
}
}

export const postFlightRequest = async (token, flightId, quantity, latitude, longitude, name) => {
try {
const headers = {
Authorization: `Bearer ${token}`
};
const data = {
'type': "our_group_purchase",
// 'type': "our_group_purchase",
'flight_id': flightId,
'quantity': quantity
'quantity': quantity,
'latitudeIp': latitude,
'longitudeIp': longitude,
'name': name
};
console.log(data);
const response = await axios.post(`${BASE_URL}/flights/request/`, data, { headers });
return response.data;
} catch (error) {
Expand All @@ -66,4 +84,22 @@ export const getPurchase = async (token) => {
} catch (error) {
console.error("Failed to request flight:", error);
}
}
}

export const commitTransaction = async(token, token_ws, userEmail, purchaseUuid) => {
try {
const headers = {
Authorization: `Bearer ${token}`
};
const data = {
'ws_token': token_ws,
'userEmail': userEmail,
'purchase_uuid': purchaseUuid
};
const response = await axios.post(`${BASE_URL}/flights/commit`, data, {headers});
return response.data;
} catch (error) {
console.error("Failed to commit transaction:", error);
throw error;
}
}
2 changes: 1 addition & 1 deletion Sample-01/src/components/IPdetails.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useEffect, useState } from 'react';
import { Paper, Typography } from '@mui/material';

Check warning on line 2 in Sample-01/src/components/IPdetails.js

View workflow job for this annotation

GitHub Actions / build-and-deploy

'Paper' is defined but never used

Check warning on line 2 in Sample-01/src/components/IPdetails.js

View workflow job for this annotation

GitHub Actions / build-frontend

'Paper' is defined but never used

Check warning on line 2 in Sample-01/src/components/IPdetails.js

View workflow job for this annotation

GitHub Actions / build-frontend

'Paper' is defined but never used

Check warning on line 2 in Sample-01/src/components/IPdetails.js

View workflow job for this annotation

GitHub Actions / build-frontend

'Paper' is defined but never used

Check warning on line 2 in Sample-01/src/components/IPdetails.js

View workflow job for this annotation

GitHub Actions / build-frontend

'Paper' is defined but never used

Check warning on line 2 in Sample-01/src/components/IPdetails.js

View workflow job for this annotation

GitHub Actions / build-frontend

'Paper' is defined but never used

function IPdetails() {
const [ipAddress, setIpAddress] = useState('');
Expand Down Expand Up @@ -78,4 +78,4 @@
);
}

export default IPdetails;
export default IPdetails;
10 changes: 10 additions & 0 deletions Sample-01/src/components/NavBar.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import React, { useState } from "react";
import { NavLink as RouterNavLink } from "react-router-dom";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import logo from "../assets/nav-logo.svg";

Check warning on line 4 in Sample-01/src/components/NavBar.js

View workflow job for this annotation

GitHub Actions / build-and-deploy

'logo' is defined but never used

Check warning on line 4 in Sample-01/src/components/NavBar.js

View workflow job for this annotation

GitHub Actions / build-frontend

'logo' is defined but never used

Check warning on line 4 in Sample-01/src/components/NavBar.js

View workflow job for this annotation

GitHub Actions / build-frontend

'logo' is defined but never used

Check warning on line 4 in Sample-01/src/components/NavBar.js

View workflow job for this annotation

GitHub Actions / build-frontend

'logo' is defined but never used

Check warning on line 4 in Sample-01/src/components/NavBar.js

View workflow job for this annotation

GitHub Actions / build-frontend

'logo' is defined but never used

Check warning on line 4 in Sample-01/src/components/NavBar.js

View workflow job for this annotation

GitHub Actions / build-frontend

'logo' is defined but never used

import {
Collapse,
Container,
Navbar,
NavbarToggler,
NavbarBrand,

Check warning on line 11 in Sample-01/src/components/NavBar.js

View workflow job for this annotation

GitHub Actions / build-and-deploy

'NavbarBrand' is defined but never used

Check warning on line 11 in Sample-01/src/components/NavBar.js

View workflow job for this annotation

GitHub Actions / build-frontend

'NavbarBrand' is defined but never used

Check warning on line 11 in Sample-01/src/components/NavBar.js

View workflow job for this annotation

GitHub Actions / build-frontend

'NavbarBrand' is defined but never used

Check warning on line 11 in Sample-01/src/components/NavBar.js

View workflow job for this annotation

GitHub Actions / build-frontend

'NavbarBrand' is defined but never used

Check warning on line 11 in Sample-01/src/components/NavBar.js

View workflow job for this annotation

GitHub Actions / build-frontend

'NavbarBrand' is defined but never used

Check warning on line 11 in Sample-01/src/components/NavBar.js

View workflow job for this annotation

GitHub Actions / build-frontend

'NavbarBrand' is defined but never used
Nav,
NavItem,
NavLink,
Expand Down Expand Up @@ -78,6 +78,16 @@
Mis Solicitudes
</NavLink>
</NavItem>
<NavItem>
<NavLink
tag={RouterNavLink}
to="/recommendations"
exact
activeClassName="router-link-exact-active"
>
Recomendaciones
</NavLink>
</NavItem>
</>
)}
</Nav>
Expand Down
2 changes: 1 addition & 1 deletion Sample-01/src/components/PopUp.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ const Popup = ({ onClose, children }) => {
);
};

export default Popup;
export default Popup;
15 changes: 10 additions & 5 deletions Sample-01/src/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Import necessary dependencies
import React from "react";
import ReactDOM from "react-dom";
import "./index.css";
Expand All @@ -7,14 +8,17 @@ import { Auth0Provider } from "@auth0/auth0-react";
import history from "./utils/history";
import { getConfig } from "./config";

// Define onRedirectCallback function
const onRedirectCallback = (appState) => {
history.push(
appState && appState.returnTo ? appState.returnTo : window.location.pathname
);
};

// Get Auth0 configuration
const config = getConfig();

// Configuration for Auth0Provider
const providerConfig = {
domain: config.domain,
clientId: config.clientId,
Expand All @@ -26,13 +30,14 @@ const providerConfig = {
},
};

ReactDOM.render(
// Render the app using the new client rendering API
ReactDOM.createRoot(document.getElementById('root')).render(
<React.StrictMode>
<Auth0Provider {...providerConfig}>
<App />
<App />
</Auth0Provider>
</React.StrictMode>,
document.getElementById('root')
</React.StrictMode>
);

serviceWorker.unregister();
// Unregister service worker
serviceWorker.unregister();
Loading
Loading