diff --git a/.github/workflows/yarn_test.yaml b/.github/workflows/yarn_test.yaml index b05c3a76..280ef83a 100644 --- a/.github/workflows/yarn_test.yaml +++ b/.github/workflows/yarn_test.yaml @@ -29,3 +29,21 @@ jobs: run: | cd apps/nowcasting-app yarn start & sleep 5 && yarn test --coverage --coverageDirectory=../.. + env: + AUTH0_AUDIENCE: ${{ secrets.AUTH0_AUDIENCE }} + AUTH0_BASE_URL: ${{ secrets.AUTH0_BASE_URL }} + AUTH0_CLIENT_ID: ${{ secrets.AUTH0_CLIENT_ID }} + AUTH0_CLIENT_SECRET: ${{ secrets.AUTH0_CLIENT_SECRET }} + AUTH0_DOMAIN: ${{ secrets.AUTH0_DOMAIN }} + AUTH0_ISSUER_BASE_URL: ${{ secrets.AUTH0_ISSUER_BASE_URL }} + AUTH0_SCOPE: ${{ secrets.AUTH0_SCOPE }} + AUTH0_SECRET: ${{ secrets.AUTH0_SECRET }} + NEXT_PUBLIC_API_PREFIX: ${{ secrets.NEXT_PUBLIC_API_PREFIX }} + NEXT_PUBLIC_AUTH0_AUDIENCE: ${{ secrets.NEXT_PUBLIC_AUTH0_AUDIENCE }} + NEXT_PUBLIC_AUTH0_CLIENT_ID: ${{ secrets.NEXT_PUBLIC_AUTH0_CLIENT_ID }} + NEXT_PUBLIC_AUTH0_DOMAIN: ${{ secrets.NEXT_PUBLIC_AUTH0_DOMAIN }} + NEXT_PUBLIC_AUTH0_PASSWORD: ${{ secrets.NEXT_PUBLIC_AUTH0_PASSWORD }} + NEXT_PUBLIC_AUTH0_SCOPE: ${{ secrets.NEXT_PUBLIC_AUTH0_SCOPE }} + NEXT_PUBLIC_AUTH0_USERNAME: ${{ secrets.NEXT_PUBLIC_AUTH0_USERNAME }} + + diff --git a/.husky/pre-commit b/.husky/pre-commit index e2ec2352..90576a12 100755 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,6 +1,15 @@ #!/bin/sh . "$(dirname "$0")/_/husky.sh" -cd apps/nowcasting-app +cd apps/nowcasting-app || exit yarn lint -yarn test + +# check if the server is already running and save the boolean result +serverRunning=$(lsof -t -i :3002) +# if the server is running, just run the tests and don't start the server +if [ -z "$serverRunning" ]; then + yarn test +else + # if the server isn't running, start it, run the tests, and then kill the server after the tests are done + yarn dev & yarn test && lsof -t -i :3002 | xargs kill +fi diff --git a/apps/nowcasting-app/components/charts/delta-view/delta-view-chart.tsx b/apps/nowcasting-app/components/charts/delta-view/delta-view-chart.tsx index 268b7779..0c34e6b9 100644 --- a/apps/nowcasting-app/components/charts/delta-view/delta-view-chart.tsx +++ b/apps/nowcasting-app/components/charts/delta-view/delta-view-chart.tsx @@ -374,9 +374,9 @@ const DeltaChart: FC = ({ className, combinedData, combinedErro )}
{!hasGspPvInitialForSelectedTime && ( diff --git a/apps/nowcasting-app/components/charts/solar-site-view/solar-site-chart.tsx b/apps/nowcasting-app/components/charts/solar-site-view/solar-site-chart.tsx index 25f40f85..573e433a 100644 --- a/apps/nowcasting-app/components/charts/solar-site-view/solar-site-chart.tsx +++ b/apps/nowcasting-app/components/charts/solar-site-view/solar-site-chart.tsx @@ -324,30 +324,38 @@ const SolarSiteChart: FC<{
)} -
+
-
+
diff --git a/apps/nowcasting-app/components/charts/solar-site-view/solar-site-tables.tsx b/apps/nowcasting-app/components/charts/solar-site-view/solar-site-tables.tsx index 728cf77a..6cab734c 100644 --- a/apps/nowcasting-app/components/charts/solar-site-view/solar-site-tables.tsx +++ b/apps/nowcasting-app/components/charts/solar-site-view/solar-site-tables.tsx @@ -29,7 +29,7 @@ import { formatISODateString } from "../../helpers/utils"; const TableHeader: React.FC<{ text: string }> = ({ text }) => { return (
@@ -81,7 +81,7 @@ const TableData: React.FC = ({ rows }) => { return ( <> -
+
{rows?.sort(sortFn).map((site) => { const mostAccurateGeneration = site.actualPV || site.expectedPV; return ( diff --git a/apps/nowcasting-app/components/side-layout/index.tsx b/apps/nowcasting-app/components/side-layout/index.tsx index 55795ecf..430c3c64 100644 --- a/apps/nowcasting-app/components/side-layout/index.tsx +++ b/apps/nowcasting-app/components/side-layout/index.tsx @@ -44,9 +44,9 @@ const SideLayout: FC = ({ "focus:outline-none h-full text-white justify-between flex flex-col bg-mapbox-black-500 z-20 " } > -
{children}
+
{children}
-
+
setIsOpen((o) => !o)} />
diff --git a/apps/nowcasting-app/package.json b/apps/nowcasting-app/package.json index b1de0328..75236c59 100644 --- a/apps/nowcasting-app/package.json +++ b/apps/nowcasting-app/package.json @@ -1,6 +1,6 @@ { "name": "@openclimatefix/nowcasting-app", - "version": "0.5.2", + "version": "0.5.3", "private": true, "scripts": { "dev": "next dev -p 3002", diff --git a/apps/nowcasting-app/styles/globals.css b/apps/nowcasting-app/styles/globals.css index 2e25745e..b8834b20 100644 --- a/apps/nowcasting-app/styles/globals.css +++ b/apps/nowcasting-app/styles/globals.css @@ -114,3 +114,28 @@ overflow: hidden; visibility: hidden; } + +/**************/ +/* SCROLLBARS */ +/**************/ + +/* Works on Firefox */ +* { + scrollbar-width: thin; + scrollbar-color: theme(colors.mapbox-black.700) theme(colors.mapbox-black.600); +} + +/* Works on Chrome, Edge, and Safari */ +*::-webkit-scrollbar { + width: 12px; +} + +*::-webkit-scrollbar-track { + background: theme(colors.mapbox-black.600); +} + +*::-webkit-scrollbar-thumb { + background-color: theme(colors.mapbox-black.700); + border-radius: 20px; + border: 3px solid theme(colors.mapbox-black.600); +}