From 76751ba0032173e7c9fcf42a2c72e3d2b0d53c4e Mon Sep 17 00:00:00 2001 From: Santiago Lo Coco Date: Mon, 4 Dec 2023 19:48:59 -0300 Subject: [PATCH 1/2] Fix merge conflicts --- browser-domain/.dockerignore | 1 + browser-domain/Dockerfile.dev | 18 ++++ browser-domain/docker-compose.dev.yml | 2 + browser-domain/nginx/default-dev.conf | 15 ++++ .../components/CreateFlight/CreateFlight.tsx | 9 +- browser-domain/src/components/Home/Home.tsx | 2 +- browser-domain/src/components/LogIn/LogIn.tsx | 4 + .../src/components/SignUp/SignUp.tsx | 5 ++ gateway/src/api/main.py | 5 ++ testing/catcher/.env.dev.example | 4 +- testing/catcher/.gitignore | 1 + testing/catcher/Dockerfile | 17 +++- testing/catcher/Dockerfile.dev | 18 ++++ testing/catcher/docker-compose.dev.yml | 9 +- testing/catcher/inventories/local.yaml | 4 +- testing/catcher/resources/create-flight.js | 89 +++++++++++++++++++ testing/catcher/resources/login.js | 42 +++++++++ testing/catcher/resources/signup.js | 49 ++++++++++ testing/catcher/test.sh | 5 +- testing/catcher/tests/auth.test.yaml | 12 --- testing/catcher/tests/create-flight.test.yaml | 22 +++++ testing/catcher/tests/login.test.yaml | 9 ++ testing/catcher/tests/signup.test.yaml | 24 +++++ testing/tavern/test.sh | 3 +- testing/tavern/test_flights.tavern.yaml | 53 +++++++++++ testing/tavern/test_users.tavern.yaml | 42 ++++++++- 26 files changed, 440 insertions(+), 24 deletions(-) create mode 100644 browser-domain/Dockerfile.dev create mode 100644 browser-domain/nginx/default-dev.conf create mode 100644 testing/catcher/.gitignore create mode 100644 testing/catcher/Dockerfile.dev create mode 100644 testing/catcher/resources/create-flight.js create mode 100644 testing/catcher/resources/login.js create mode 100644 testing/catcher/resources/signup.js create mode 100644 testing/catcher/tests/create-flight.test.yaml create mode 100644 testing/catcher/tests/login.test.yaml create mode 100644 testing/catcher/tests/signup.test.yaml diff --git a/browser-domain/.dockerignore b/browser-domain/.dockerignore index e3ff84a..5d1de82 100644 --- a/browser-domain/.dockerignore +++ b/browser-domain/.dockerignore @@ -1,6 +1,7 @@ node_modules Dockerfile.prod Dockerfile.test +Dockerfile.dev docker-compose.dev.yml docker-compose.yml docker-template.yml diff --git a/browser-domain/Dockerfile.dev b/browser-domain/Dockerfile.dev new file mode 100644 index 0000000..d50678d --- /dev/null +++ b/browser-domain/Dockerfile.dev @@ -0,0 +1,18 @@ +FROM node:17.9.1 AS app +WORKDIR /app +COPY package.json . +COPY package-lock.json . +RUN npm install +COPY . . + +ENV REACT_APP_ENDPOINT "http://host.docker.internal:5001" + +RUN npm run build + +FROM nginx:alpine +WORKDIR /usr/share/nginx/html +RUN rm -rf ./* +COPY --from=app /app/build . +COPY nginx/default-dev.conf /etc/nginx/conf.d/default.conf +EXPOSE 8000 +ENTRYPOINT ["nginx", "-g", "daemon off;"] diff --git a/browser-domain/docker-compose.dev.yml b/browser-domain/docker-compose.dev.yml index 08890cc..c727b36 100644 --- a/browser-domain/docker-compose.dev.yml +++ b/browser-domain/docker-compose.dev.yml @@ -7,4 +7,6 @@ services: file: docker-template.yml service: browser-client container_name: fids-browser-dev_browser-client + extra_hosts: + - "host.docker.internal:host-gateway" network_mode: host diff --git a/browser-domain/nginx/default-dev.conf b/browser-domain/nginx/default-dev.conf new file mode 100644 index 0000000..b096709 --- /dev/null +++ b/browser-domain/nginx/default-dev.conf @@ -0,0 +1,15 @@ +server { + listen 8000; + location / { + root /usr/share/nginx/html; + index unresolvable-file-html.html; + try_files $uri @index; + } + + location @index { + root /usr/share/nginx/html; + add_header Cache-Control no-cache; + expires 0; + try_files /index.html =404; + } +} diff --git a/browser-domain/src/components/CreateFlight/CreateFlight.tsx b/browser-domain/src/components/CreateFlight/CreateFlight.tsx index fd6fcc0..9d61dd4 100644 --- a/browser-domain/src/components/CreateFlight/CreateFlight.tsx +++ b/browser-domain/src/components/CreateFlight/CreateFlight.tsx @@ -47,6 +47,7 @@ export const CreateFlight = () => { setFlightData({ ...flightData, flight_code: e.target.value }) } @@ -56,6 +57,7 @@ export const CreateFlight = () => { Status: setFlightData({ ...flightData, status: e.target.value }) @@ -67,6 +69,7 @@ export const CreateFlight = () => { setFlightData({ ...flightData, origin: e.target.value }) } @@ -76,6 +79,7 @@ export const CreateFlight = () => { Destination: setFlightData({ ...flightData, destination: e.target.value }) @@ -86,6 +90,7 @@ export const CreateFlight = () => { Departure Time: setFlightData({ ...flightData, departure_time: e.target.value }) @@ -96,6 +101,7 @@ export const CreateFlight = () => { Arrival Time: setFlightData({ ...flightData, arrival_time: e.target.value }) @@ -106,11 +112,12 @@ export const CreateFlight = () => { Gate: setFlightData({ ...flightData, gate: e.target.value })} /> - + ); }; diff --git a/browser-domain/src/components/Home/Home.tsx b/browser-domain/src/components/Home/Home.tsx index 0002654..6d1a174 100644 --- a/browser-domain/src/components/Home/Home.tsx +++ b/browser-domain/src/components/Home/Home.tsx @@ -52,7 +52,7 @@ export const Home: React.FC = (props) => { return (
- {isAirline ? : <>} + {isAirline ? : <>} {isAdmin ? : <>}

Flights

diff --git a/browser-domain/src/components/LogIn/LogIn.tsx b/browser-domain/src/components/LogIn/LogIn.tsx index 79ed4fe..4c6bb8c 100644 --- a/browser-domain/src/components/LogIn/LogIn.tsx +++ b/browser-domain/src/components/LogIn/LogIn.tsx @@ -16,10 +16,12 @@ export const LogIn = () => {
setEmail(ev.target.value)} /> setPassword(ev.target.value)} /> diff --git a/browser-domain/src/components/SignUp/SignUp.tsx b/browser-domain/src/components/SignUp/SignUp.tsx index 909add1..976e895 100644 --- a/browser-domain/src/components/SignUp/SignUp.tsx +++ b/browser-domain/src/components/SignUp/SignUp.tsx @@ -19,18 +19,22 @@ export const SignUp = () => { setEmail(ev.target.value)} /> setUsername(ev.target.value)} /> setPassword(ev.target.value)} /> setRepeatPassword(ev.target.value)} />
+<<<<<<< HEAD {!isAirline && !isAdmin ? +======= + {!isAirline ? +>>>>>>> 8b9f006 (Add edit and delete flight in the frontend) ( !(subscribed) ?