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

Frontend: Updates Biome script #3872

Merged
merged 33 commits into from
Dec 16, 2024
Merged
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
b3ea1d9
Merge branch 'main' of https://github.com/SatcherInstitute/health-equ…
benhammondmusic Dec 10, 2024
55c286c
Merge branch 'main' of https://github.com/SatcherInstitute/health-equ…
benhammondmusic Dec 11, 2024
bec1eac
demo button
benhammondmusic Dec 13, 2024
c68f5cc
Merge branch 'main' of https://github.com/SatcherInstitute/health-equ…
benhammondmusic Dec 13, 2024
17b07ef
tweaks
benhammondmusic Dec 13, 2024
ff2b185
e2e
benhammondmusic Dec 13, 2024
f0d2b82
biome fixes
benhammondmusic Dec 13, 2024
c7e7433
update biome
benhammondmusic Dec 13, 2024
da53a29
fail
benhammondmusic Dec 13, 2024
00abdd7
Merge branch 'main' of https://github.com/SatcherInstitute/health-equ…
benhammondmusic Dec 13, 2024
9ffd37c
rv
benhammondmusic Dec 13, 2024
4608128
fix
benhammondmusic Dec 13, 2024
07ed5b0
save unformatted
benhammondmusic Dec 13, 2024
8e9dca3
per
benhammondmusic Dec 13, 2024
f00eb90
token
benhammondmusic Dec 13, 2024
ece739c
action
benhammondmusic Dec 13, 2024
f6f484d
oops
benhammondmusic Dec 13, 2024
9d98df7
gh
benhammondmusic Dec 13, 2024
6efe96d
into frontend test
benhammondmusic Dec 13, 2024
cf566f8
fix
benhammondmusic Dec 13, 2024
a9b2f8c
bad lint
benhammondmusic Dec 14, 2024
ae4f285
action
benhammondmusic Dec 14, 2024
44e797b
src
benhammondmusic Dec 14, 2024
99d6439
req
benhammondmusic Dec 14, 2024
017d234
add help
benhammondmusic Dec 14, 2024
bb3687d
>>
benhammondmusic Dec 14, 2024
02f0699
try
benhammondmusic Dec 14, 2024
0e3436d
more
benhammondmusic Dec 14, 2024
1601422
fixed
benhammondmusic Dec 14, 2024
b544c3c
force push bad formatting
benhammondmusic Dec 14, 2024
486fdd0
fix
benhammondmusic Dec 14, 2024
eb8b6de
//
benhammondmusic Dec 14, 2024
c68bf62
Merge branch 'main' into biome-script
benhammondmusic Dec 16, 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
30 changes: 0 additions & 30 deletions .github/workflows/biomeCheck.yml

This file was deleted.

26 changes: 22 additions & 4 deletions .github/workflows/runFrontendTests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,23 @@ defaults:
working-directory: frontend

jobs:
code-quality:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Biome
uses: biomejs/setup-biome@v2
with:
version: latest
- name: Run Biome
run: |
echo "Running Biome"
echo "🚨 If this fails, run 'npm run cleanup' from your frontend/ local directory, add/commit, and push again."
echo "🔧 Also, please check your local pre-commit, as Biome should run on every local commit."
echo "See https://github.com/SatcherInstitute/health-equity-tracker?tab=readme-ov-file#install-node-and-pre-commit"
biome ci src/

build_frontend:
name: Builds frontend
runs-on: ubuntu-latest
Expand All @@ -37,7 +54,6 @@ jobs:
VITE_NODE_OPTIONS: '--max_old_space_size=4096'
run: npx tsc --noEmit && npm run build:deploy_preview


frontend_unit_tests:
name: Runs frontend unit tests
runs-on: ubuntu-latest
Expand Down Expand Up @@ -72,7 +88,9 @@ jobs:
max_timeout: 180

tests_e2e_netlify:
needs: tests_e2e_netlify_prepare
needs:
- tests_e2e_netlify_prepare
- code-quality
name: Run E2E tests on deploy preview
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
Expand All @@ -88,7 +106,7 @@ jobs:
run: npm ci
- name: Install playwright deps
run: npx playwright install --with-deps chromium
- name: run quicker E2E on DEPLOY_PREVIEW
- name: run E2E on DEPLOY_PREVIEW
run: npx playwright test --project=E2E_NIGHTLY --workers 4
# base url based on the GITHUB_PR_NUMBER + NETLIFY_SITE_NAME
env:
Expand All @@ -99,4 +117,4 @@ jobs:
with:
name: playwright-report
path: frontend/playwright-report/
retention-days: 30
retention-days: 30
2 changes: 2 additions & 0 deletions cspell.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,7 @@
"IHME",
"IIS",
"iloc",
"img",
"inclusivity",
"influencers",
"INJ",
Expand Down Expand Up @@ -392,6 +393,7 @@
"mochl",
"moderna",
"Mosca",
"moz",
"MPA",
"MPS",
"MPsy",
Expand Down
3 changes: 2 additions & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@
"vitest": "^2.1.8"
},
"scripts": {
"cleanup": "npx @biomejs/biome check --write ./src",
"build:deploy_preview": "env-cmd -f .env.deploy_preview npm run build",
"build:development": "env-cmd -f .env.development npm run build",
"build:prod": "env-cmd -f .env.prod npm run build",
Expand Down Expand Up @@ -122,4 +123,4 @@
"last 1 safari version"
]
}
}
}
4 changes: 2 additions & 2 deletions frontend/src/pages/Policy/policyComponents/CardLeftIcon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ const CardLeftIcon: React.FC<CardLeftIconProps> = ({
</p>
</div>
<div className='flex flex-col'>
<HetOverline text='Advocacy Experts Say' className='mb-0 mt-4'/>
<HetOverline text='Advocacy Experts Say' className='mb-0 mt-4' />
<p className='text-small w-fit py-0 my-0'>{advice}</p>
</div>
</div>
</li>
)
}

export default CardLeftIcon
export default CardLeftIcon
2 changes: 1 addition & 1 deletion frontend/src/pages/Policy/policyComponents/FactCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ const FactCard: React.FC<FactCardProps> = ({ content }) => {
)
}

export default FactCard
export default FactCard
32 changes: 23 additions & 9 deletions frontend/src/pages/Policy/policyComponents/ResourceSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,24 @@ import type React from 'react'
import ResourceItem from './ResourceItem'

interface ResourceSectionProps {
id: string
icon: React.ReactNode
id: string
icon: React.ReactNode
title: string
description: string | JSX.Element
resources: {
title: string
description: string | JSX.Element
resources: { title: string; description: string | JSX.Element; link?: string }[]
}
description: string | JSX.Element
link?: string
}[]
}

const ResourceSection: React.FC<ResourceSectionProps> = ({ id, icon, title, description, resources }) => {
const ResourceSection: React.FC<ResourceSectionProps> = ({
id,
icon,
title,
description,
resources,
}) => {
return (
<section id={id}>
<div className='flex flex-row w-full items-center rounded-md border border-solid border-methodologyGreen'>
Expand All @@ -23,12 +33,16 @@ const ResourceSection: React.FC<ResourceSectionProps> = ({ id, icon, title, desc
<p>{description}</p>
<ul className='list-none'>
{resources.map((resource) => (
<ResourceItem key={resource.title} title={resource.title} description={resource.description} link={resource.link} />

<ResourceItem
key={resource.title}
title={resource.title}
description={resource.description}
link={resource.link}
/>
))}
</ul>
</section>
)
}

export default ResourceSection
export default ResourceSection
80 changes: 47 additions & 33 deletions frontend/src/pages/Policy/policyContent/CrisisOverviewContent.tsx
Original file line number Diff line number Diff line change
@@ -1,40 +1,54 @@
import HetTermUnderline from '../../../styles/HetComponents/HetTermUnderline'

export const gvaFacts = [
{
content: (
<>
In 2023, Atlanta experienced <HetTermUnderline>no fewer than six mass shootings</HetTermUnderline>, with each
event tragically claiming six lives and injuring 22 others, marking a
series of deliberate, targeted attacks that shook the community.
</>
),
},
{
content: (
<>
In 2023, Atlanta experienced{' '}
<HetTermUnderline>no fewer than six mass shootings</HetTermUnderline>,
with each event tragically claiming six lives and injuring 22 others,
marking a series of deliberate, targeted attacks that shook the
community.
</>
),
},

{
content: (
<>
As of April 2024, firearms have injured four children in Atlanta,
raising the total to <HetTermUnderline>53 children injured</HetTermUnderline> since 2021,
underscoring an urgent need for protective measures.
</>
),
},
{
content: (
<>
As of April 2024, firearms have injured four children in Atlanta,
raising the total to{' '}
<HetTermUnderline>53 children injured</HetTermUnderline> since 2021,
underscoring an urgent need for protective measures.
</>
),
},
]

export const rocketFoundationFacts = [
{
content: (
<>
Gun violence in the U.S. is a growing crisis, claiming over 47,000 lives in 2021 alone, with <HetTermUnderline>more than half being homicides</HetTermUnderline>. This epidemic disproportionately affects people of color, women, and children, making guns the leading cause of death among American youth.
</>
),
},
{
content: (
<>
While the U.S. has an alarmingly high rate of gun-related homicides—22 times higher than in the European Union—<HetTermUnderline>this violence is concentrated in specific neighborhoods</HetTermUnderline>. By focusing our efforts on these areas, we can begin to solve the crisis one city at a time, starting with <HetTermUnderline>places like Atlanta</HetTermUnderline>.
</>
),
},
]
{
content: (
<>
Gun violence in the U.S. is a growing crisis, claiming over 47,000 lives
in 2021 alone, with{' '}
<HetTermUnderline>more than half being homicides</HetTermUnderline>.
This epidemic disproportionately affects people of color, women, and
children, making guns the leading cause of death among American youth.
</>
),
},
{
content: (
<>
While the U.S. has an alarmingly high rate of gun-related homicides—22
times higher than in the European Union—
<HetTermUnderline>
this violence is concentrated in specific neighborhoods
</HetTermUnderline>
. By focusing our efforts on these areas, we can begin to solve the
crisis one city at a time, starting with{' '}
<HetTermUnderline>places like Atlanta</HetTermUnderline>.
</>
),
},
]
Loading
Loading