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

116 frontend add unit testing for frontend #124

Closed
Closed
Changes from 1 commit
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
3db3755
Merge pull request #2 from kristo-baricevic/feedback-form2
kristo-baricevic Oct 11, 2023
947c504
feat(ci): add automated release workflow
themightychris Nov 15, 2023
477c1f7
Add helm chart (in project root) and files for static demo server
joshuagerstein Dec 12, 2023
aef6135
Merge pull request #56 from CodeForPhilly/develop
themightychris Dec 13, 2023
5620c9c
fix(ci): show same Docker tag in log output
themightychris Dec 13, 2023
82b8b37
fix(ci): trigger container builds on tags
themightychris Dec 13, 2023
c657730
Merge pull request #65 from CodeForPhilly/helm-chart-2
themightychris Dec 13, 2023
140bc92
Merge pull request #66 from CodeForPhilly/develop
themightychris Dec 13, 2023
a84cfef
fix(ci): add explicit write permission for packages
themightychris Dec 13, 2023
caced0a
Merge pull request #67 from CodeForPhilly/develop
themightychris Dec 13, 2023
a60d5bd
Merge branch 'main' of https://github.com/CodeForPhilly/balancer-main
kristo-baricevic Feb 4, 2024
e023c7f
test
kristo-baricevic Feb 4, 2024
8e8921d
Merge branch
kristo-baricevic Feb 4, 2024
d26eac4
Merge branch 'listOfMed'
kristo-baricevic Feb 11, 2024
aecffba
Merge branch 'listOfMed'
kristo-baricevic Feb 12, 2024
7382cb0
Merge pull request #4 from kristo-baricevic/listOfMed
kristo-baricevic Feb 13, 2024
7761fc2
Delete config/env/env.dev
kristo-baricevic Feb 13, 2024
0a4a098
font sizes
kristo-baricevic Feb 22, 2024
b727f6a
updated fonts and size of card
kristo-baricevic Feb 22, 2024
fb4e501
Merge branch 'main' into listOfMed
kristo-baricevic Feb 22, 2024
f5705b4
Merge pull request #5 from kristo-baricevic/listOfMed
kristo-baricevic Feb 22, 2024
77a4b3b
merge
kristo-baricevic Feb 23, 2024
72cbf83
Merge pull request #6 from kristo-baricevic/listOfMed
kristo-baricevic Feb 23, 2024
1fffb89
adjusted width
kristo-baricevic Feb 24, 2024
94c2f0c
updated colors
kristo-baricevic Mar 12, 2024
67d692a
Merge branch 'listOfMed' of https://github.com/CodeForPhilly/balancer…
kristo-baricevic Mar 12, 2024
722509b
Start ChatGPT View
ryanrrogers Mar 29, 2024
5a0f025
Merge branch '115-rest-framework-overhaul' of https://github.com/Code…
kristo-baricevic Apr 2, 2024
1e06544
installed jest
kristo-baricevic Apr 2, 2024
c901665
added react testing library
kristo-baricevic Apr 2, 2024
b8f8a14
added types for jest
kristo-baricevic Apr 2, 2024
c9a0b59
added ts config
kristo-baricevic Apr 2, 2024
760411d
test setup
kristo-baricevic Apr 2, 2024
a4af5be
jsdom
kristo-baricevic Apr 2, 2024
828061e
pre pull-request
kristo-baricevic Apr 5, 2024
72c1c69
Merge pull request #120 from kristo-baricevic/main
kristo-baricevic Apr 5, 2024
4e0819f
push
kristo-baricevic Apr 12, 2024
c426c69
Merge branch 'help-page' of https://github.com/kristo-baricevic/balan…
kristo-baricevic Apr 12, 2024
ed6eddb
idk
kristo-baricevic Apr 12, 2024
b6ea4cc
Merge branch '116-frontend-add-unit-testing-for-frontend' into help-page
kristo-baricevic Apr 12, 2024
091a576
Merge pull request #122 from kristo-baricevic/help-page
kristo-baricevic Apr 12, 2024
96d6971
vitest setup
kristo-baricevic Apr 13, 2024
fe0f5fc
updated scripts
kristo-baricevic Apr 13, 2024
8a935d7
everything working
kristo-baricevic Apr 13, 2024
5542a6e
Merge branch '116-frontend-add-unit-testing-for-frontend' into vitest…
kristo-baricevic Apr 13, 2024
83f74d8
Merge pull request #123 from kristo-baricevic/vitest-branch
kristo-baricevic Apr 13, 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
Prev Previous commit
Next Next commit
Merge branch 'listOfMed' of https://github.com/CodeForPhilly/balancer…
  • Loading branch information
kristo-baricevic committed Mar 12, 2024
commit 67d692aa1045826d6d4d5330862a94439a2e9911
67 changes: 47 additions & 20 deletions Dockerfile.prod
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
# This image runs the production server, with nginx
###########
# BUILDER #
###########

# pull official base image
FROM python:3.11.4-slim-buster as python_builder
FROM python:3.11.4-slim-buster as builder

# set work directory
WORKDIR /usr/src/app
@@ -14,31 +13,59 @@ ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1

# install system dependencies
RUN apt-get update && apt-get install -y netcat
RUN apt-get update && \
apt-get install -y --no-install-recommends gcc

# lint
# RUN pip install --upgrade pip
# RUN pip install flake8==6.0.0
# COPY . /usr/src/app/
# RUN flake8 --ignore=E501,F401 .

# install python dependencies
COPY ./requirements.txt .
RUN pip wheel --no-cache-dir --no-deps --wheel-dir /usr/src/app/wheels -r requirements.txt


#########
# FINAL #
#########

# pull official base image
FROM python:3.11.4-slim-buster

# create directory for the app user
RUN mkdir -p /home/app

# create the app user
RUN addgroup --system app && adduser --system --group app

# create the appropriate directories
ENV HOME=/home/app
ENV APP_HOME=/home/app/web
RUN mkdir $APP_HOME
WORKDIR $APP_HOME

# install dependencies
RUN apt-get update && apt-get install -y --no-install-recommends netcat
COPY --from=python_builder /usr/src/app/wheels /wheels
COPY --from=python_builder /usr/src/app/requirements.txt .
COPY --from=builder /usr/src/app/wheels /wheels
COPY --from=builder /usr/src/app/requirements.txt .
RUN pip install --upgrade pip
COPY ./requirements.txt .
RUN pip install -r requirements.txt
RUN pip install --no-cache /wheels/*

# copy entrypoint.prod.sh
COPY ./entrypoint.prod.sh .
RUN sed -i 's/\r$//g' $APP_HOME/entrypoint.prod.sh
RUN chmod +x $APP_HOME/entrypoint.prod.sh

# copy project
COPY . /usr/src/app
COPY . $APP_HOME

# Correct line endings in entrypoint.sh and make it executable
RUN sed -i 's/\r$//' entrypoint.sh && chmod +x entrypoint.sh
# chown all the files to the app user
RUN chown -R app:app $APP_HOME

# run entrypoint.sh
ENTRYPOINT ["./entrypoint.sh"]
# change to the app user
USER app

# run entrypoint.prod.sh
<<<<<<< HEAD:Dockerfile.prod
ENTRYPOINT ["/home/app/web/entrypoint.prod.sh"]


# TODO: gunicorn stuff
=======
ENTRYPOINT ["/home/app/web/entrypoint.prod.sh"]
>>>>>>> ac68347c12ced724206112843623ee8c515bd3ad:server/Dockerfile.prod
ENTRYPOINT ["/home/app/web/entrypoint.prod.sh"]
35 changes: 1 addition & 34 deletions docker-compose.dev.yml
Original file line number Diff line number Diff line change
@@ -10,24 +10,6 @@ services:
- POSTGRES_DB=balancer_dev
ports:
- "5432:5432"
networks:
app_net:
ipv4_address: 192.168.0.2
pgadmin:
container_name: pgadmin4
image: dpage/pgadmin4
environment:
PGADMIN_DEFAULT_EMAIL: balancer-noreply@codeforphilly.org
PGADMIN_DEFAULT_PASSWORD: balancer
# PGADMIN_LISTEN_PORT = 80
# volumes:
# - ./pgadmin-data:/var/lib/pgadmin
# # PGADMIN_LISTEN_PORT = 80
ports:
- "5050:80"
networks:
app_net:
ipv4_address: 192.168.0.3
backend:
image: balancer-backend
build: ./server
@@ -43,11 +25,6 @@ services:
- ./config/env/env.dev
depends_on:
- db
volumes:
- ./server:/usr/src/server
networks:
app_net:
ipv4_address: 192.168.0.4
frontend:
image: balancer-frontend
build:
@@ -66,16 +43,6 @@ services:
- "/usr/src/app/node_modules/"
depends_on:
- backend
networks:
app_net:
ipv4_address: 192.168.0.5

volumes:
postgres_data:
networks:
app_net:
ipam:
driver: default
config:
- subnet: "192.168.0.0/24"
gateway: 192.168.0.1
postgres_data:
17 changes: 5 additions & 12 deletions docker-compose.prod.yml
Original file line number Diff line number Diff line change
@@ -4,17 +4,10 @@ services:
image: postgres:15
volumes:
- postgres_data:/var/lib/postgresql/data/
env_file:
<<<<<<< HEAD
- ./config/env/env.prod.db
=======
- ./config/env/.env.prod.db
>>>>>>> ac68347c12ced724206112843623ee8c515bd3ad
backend:
build:
context: ./server
dockerfile: Dockerfile.prod
command: gunicorn balancer_backend.wsgi:application --bind 0.0.0.0:8000
environment:
- POSTGRES_USER=balancer
- POSTGRES_PASSWORD=balancer
- POSTGRES_DB=balancer_dev
ports:
- "5432:5432"
backend:
@@ -25,7 +18,7 @@ services:
ports:
- "8000:8000"
env_file:
- ./config/env/env.prod
- ./config/env/env.dev
depends_on:
- db
<<<<<<< HEAD
21 changes: 12 additions & 9 deletions frontend/src/pages/Help/Help.tsx
Original file line number Diff line number Diff line change
@@ -44,9 +44,9 @@ function Help() {
<Layout>
<div className="mt-20 flex w-full flex-col items-center justify-center px-4">
<div className="flex justify-center text-center">
<h2 className="mt-20 font-satoshi text-3xl text-blue-600">
<h1 className="mt-20 font-satoshi text-3xl text-blue-600">
Help & Support Page
</h2>
</h1>
</div>
<div className="flex py-2 text-center">
<h3 className="font-satoshi text-gray-600">
@@ -55,13 +55,16 @@ function Help() {
</div>
<div className="flex flex-col gap-4 sm:flex-row">
{data.icon.map((icon, index) => (
<Link to={data.link[index]} key={index} className="flex flex-grow basis-1/3 max-w-full">
<HelpCard
key={index}
icon={icon}
title={data.title[index]}
paragraph={data.paragraph[index]}
/>
<Link to={data.link[index]} key={index} className="flex">

<div className="">
<HelpCard
key={index}
icon={icon}
title={data.title[index]}
paragraph={data.paragraph[index]}
/>
</div>
</Link>
))}
</div>
17 changes: 3 additions & 14 deletions frontend/src/pages/Help/HowTo.tsx
Original file line number Diff line number Diff line change
@@ -84,26 +84,15 @@ function HowTo() {
</h3>
<div className="flex flex-col rounded-xl border-2 border-blue-100 bg-neutral-50 px-4 py-4 shadow-md">
<div className="flex flex-col px-2 py-2">
<p className="font-satoshi text-md text-gray-700">
<p className="text-md font-satoshi text-gray-700">
{howToData.paragraph[0]}
</p>
<p className="py-2 font-satoshi text-md text-gray-600">
<p className="text-md py-2 font-satoshi text-gray-600">
{howToData.paragraph[1]}
</p>
</div>
<div className="flex px-6">
<ol>
{howToData.instructions.map((text, index) => {
return (
<li
className="py-1 font-satoshi text-md text-gray-700"
key={index}
>
{text}
</li>
);
})}
</ol>
{createList(howToData.instructions)}
</div>
</div>
</div>
You are viewing a condensed version of this merge commit. You can view the full changes here.