Skip to content

Commit

Permalink
Merge pull request #512 from openclimatefix/development
Browse files Browse the repository at this point in the history
Development -> Staging w/India
  • Loading branch information
braddf authored May 8, 2024
2 parents a287520 + ed74fe2 commit 7c2c1dc
Show file tree
Hide file tree
Showing 71 changed files with 10,084 additions and 9,101 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/yarn_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,15 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: install yarn app
- name: install yarn
run: |
cd apps/nowcasting-app
yarn install
- name: build & start app
run: |
cd apps/nowcasting-app
yarn build
- name: run tests
run: |
cd apps/nowcasting-app
yarn test --coverage --coverageDirectory=../..
yarn start & sleep 5 && yarn test --coverage --coverageDirectory=../..
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from "react";
import { theme } from "../../../tailwind.config";
import { ClockIcon } from "../../icons/icons";
import ForecastLabel from "../../national_forecast_labels";
Expand Down Expand Up @@ -146,6 +145,7 @@ export const NextForecast: React.FC<{ pv: string; tip: string; time: string; col
};

type ForecastHeaderProps = {
children: React.ReactNode;
forecastNextPV: string;
forecastPV: string;
actualPV: string;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from "react";
import { CloseButtonIcon, DownArrow, UpArrow } from "../../icons/icons";
import { ForecastHeadlineFigure } from "../forecast-header/ui";
import { DeltaHeaderBlock } from "../delta-view/delta-header-block";
import React, { FC } from "react";

type ForecastHeaderGSPProps = {
title: string;
Expand All @@ -14,9 +14,10 @@ type ForecastHeaderGSPProps = {
forecastPV?: string;
forecastNextTimeOnly?: string;
forecastNextPV?: string;
children?: React.ReactNode;
};

const ForecastHeaderGSP: React.FC<ForecastHeaderGSPProps> = ({
const ForecastHeaderGSP: FC<ForecastHeaderGSPProps> = ({
title,
deltaView,
deltaValue,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { FC } from "react";
import RemixLine from "../remix-line";
import useFormatChartData from "../use-format-chart-data";
import {
Expand All @@ -12,6 +11,7 @@ import useGetGspData from "./use-get-gsp-data";
import useGlobalState, { get30MinNow, getNext30MinSlot } from "../../helpers/globalState";
import Spinner from "../../icons/spinner";
import { ForecastValue } from "../../types";
import React, { FC } from "react";

// We want to have the ymax of the graph to be related to the capacity of the GspPvRemixChart
// If we use the raw values, the graph looks funny, i.e y major ticks are 0 100 232
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from "react";
import { CloseButtonIcon } from "../../icons/icons";

type ForecastHeaderSiteProps = {
Expand Down
1 change: 1 addition & 0 deletions apps/nowcasting-app/components/delta-forecast-label.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
type DeltaForecastLabelProps = {
children: React.ReactNode;
tip: string | React.ReactNode;
position?: "left" | "right" | "middle";
className?: string;
Expand Down
4 changes: 2 additions & 2 deletions apps/nowcasting-app/components/helpers/utils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ describe("check getOpacityValueFromPVNormalized with valid values", () => {
describe("check convertISODateStringToLondonTime", () => {
test("check convertISODateStringToLondonTime with valid date strings", () => {
expect(convertISODateStringToLondonTime("2021-01-01T03:00:00.000Z")).toBe("03:00");
expect(convertISODateStringToLondonTime("2021-01-01T03:21:00.000")).toBe("03:21");
expect(convertISODateStringToLondonTime("2021-01-01T03:50:11")).toBe("03:50");
expect(convertISODateStringToLondonTime("2021-01-01T03:21:00.000Z")).toBe("03:21");
expect(convertISODateStringToLondonTime("2021-01-01T03:50:11Z")).toBe("03:50");
});

it("should handle an empty date string", () => {
Expand Down
4 changes: 3 additions & 1 deletion apps/nowcasting-app/components/icons/logo.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
export const OCFlogo = () => (
import { FC } from "react";

export const OCFlogo: FC = () => (
<a
className="max-h-full z-20"
href="https://www.openclimatefix.org/"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ const ProfileDropDown = ({}: IProfileDropDown) => {
"block px-4 py-2 text-sm text-ocf-black-600"
)}
>
<Link href="/api/auth/logout">
<Link href="/api/auth/logout" legacyBehavior>
<a id={"UserMenu-LogoutBtn"}>Sign out</a>
</Link>
</div>
Expand Down
2 changes: 1 addition & 1 deletion apps/nowcasting-app/components/map/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ export enum SelectedData {
}

export interface IMap {
children: React.ReactNode;
loadDataOverlay: any;
controlOverlay: any;
bearing?: number;
updateData: { newData: boolean | string; updateMapData: (map: mapboxgl.Map) => void };
children: React.ReactNode;
title: string;
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
type ForecastLabelProps = {
children: React.ReactNode;
tip: string | React.ReactNode;
position?: "left" | "right" | "middle";
className?: string;
Expand Down
3 changes: 2 additions & 1 deletion apps/nowcasting-app/components/side-layout/index.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import React, { useState } from "react";
import { useState } from "react";
import ExpandButton from "./expand-button";
import useGlobalState from "../helpers/globalState";

type SideLayoutProps = {
children: React.ReactNode;
className?: string;
dashboardModeActive?: boolean;
bottomPadding?: boolean;
Expand Down
3 changes: 1 addition & 2 deletions apps/nowcasting-app/components/tooltip.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React from "react";

type TooltipProps = {
children: React.ReactNode;
tip: string | React.ReactNode;
position?: "left" | "right" | "middle" | "top";
className?: string;
Expand Down
2 changes: 1 addition & 1 deletion apps/nowcasting-app/dist/tsconfig.tsbuildinfo

Large diffs are not rendered by default.

27 changes: 14 additions & 13 deletions apps/nowcasting-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"scripts": {
"dev": "next dev -p 3002",
"build": "next build",
"start": "next start",
"start": "next start -p 3002",
"storybook": "start-storybook -p 6006",
"build-storybook": "build-storybook",
"lint": "next lint",
Expand All @@ -24,14 +24,14 @@
"cookies": "^0.8.0",
"js-cookie": "^3.0.5",
"mapbox-gl": "^2.8.2",
"next": "^12.0.7",
"openapi-fetch": "^0.8.2",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"next": "14.1.0",
"openapi-fetch": "^0.9.3",
"react": "^18",
"react-dom": "^18",
"react-hooks-global-state": "^1.0.2",
"react-icons": "^4.4.0",
"react-toastify": "^9.0.4",
"rechart": "^0.0.1",
"recharts": "^2.12.0",
"resize-observer-polyfill": "^1.5.1",
"turbo": "^1.0.26"
},
Expand All @@ -40,20 +40,21 @@
"@babel/eslint-parser": "^7.19.1",
"@jest/globals": "^29.7.0",
"@openclimatefix/nowcasting-tsconfig": "*",
"@storybook/addon-actions": "^6.4.22",
"@storybook/addon-essentials": "^6.4.22",
"@storybook/addon-links": "^6.4.22",
"@storybook/addon-actions": "^8.0.8",
"@storybook/addon-essentials": "^8.0.8",
"@storybook/addon-links": "^8.0.8",
"@storybook/addon-postcss": "^2.0.0",
"@storybook/builder-webpack5": "^6.4.22",
"@storybook/manager-webpack5": "^6.4.22",
"@storybook/react": "^6.4.22",
"@storybook/builder-webpack5": "^8.0.8",
"@storybook/manager-webpack5": "^7.0.0-alpha.10",
"@storybook/react": "^8.0.8",
"@tailwindcss/forms": "^0.5.1",
"@tailwindcss/typography": "^0.5.2",
"@types/jest": "^29.5.5",
"@types/js-cookie": "^3.0.3",
"@types/leaflet": "^1.7.9",
"@types/mapbox-gl": "^2.7.2",
"@types/react": "^17.0.38",
"@types/react": "^18",
"@types/react-dom": "^18",
"autoprefixer": "^10.4.7",
"babel-eslint": "^10.1.0",
"babel-loader": "^8.2.5",
Expand Down
6 changes: 3 additions & 3 deletions apps/nowcasting-website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
"@heroicons/react": "^1.0.6",
"@tailwindcss/forms": "^0.5.2",
"@tailwindcss/typography": "^0.5.2",
"next": "12.1.6",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"next": "14.1.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"turbo": "^1.2.11"
},
"devDependencies": {
Expand Down
36 changes: 36 additions & 0 deletions apps/quartz-app/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js
.yarn/install-state.gz

# testing
/coverage

# next.js
/.next/
/out/

# production
/build

# misc
.DS_Store
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# local env files
.env*.local

# vercel
.vercel

# typescript
*.tsbuildinfo
next-env.d.ts
3 changes: 3 additions & 0 deletions apps/quartz-app/OLDeslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "next/core-web-vitals"
}
36 changes: 36 additions & 0 deletions apps/quartz-app/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).

## Getting Started

First, run the development server:

```bash
npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun dev
```

Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.

You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file.

This project uses [`next/font`](https://nextjs.org/docs/basic-features/font-optimization) to automatically optimize and load Inter, a custom Google Font.

## Learn More

To learn more about Next.js, take a look at the following resources:

- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.

You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!

## Deploy on Vercel

The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.

Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.
Binary file added apps/quartz-app/app/favicon.ico
Binary file not shown.
33 changes: 33 additions & 0 deletions apps/quartz-app/app/globals.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
@tailwind base;
@tailwind components;
@tailwind utilities;

:root {
--foreground-rgb: 0, 0, 0;
--background-start-rgb: 214, 219, 220;
--background-end-rgb: 255, 255, 255;
}

@media (prefers-color-scheme: dark) {
:root {
--foreground-rgb: 255, 255, 255;
--background-start-rgb: 0, 0, 0;
--background-end-rgb: 0, 0, 0;
}
}

body {
color: rgb(var(--foreground-rgb));
background: linear-gradient(
to bottom,
transparent,
rgb(var(--background-end-rgb))
)
rgb(var(--background-start-rgb));
}

@layer utilities {
.text-balance {
text-wrap: balance;
}
}
30 changes: 30 additions & 0 deletions apps/quartz-app/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import type { Metadata } from "next";
import { Inter } from "next/font/google";
import "./globals.css";
import Header from "../src/components/layout/Header";
import Providers from "@/app/providers";
import { ReactNode } from "react";

const inter = Inter({ subsets: ["latin"] });

export const metadata: Metadata = {
title: "Quartz Energy | Rajasthan",
description: "Solar and Wind Forecasting Service",
};

export default function RootLayout({
children,
}: Readonly<{
children: ReactNode;
}>) {
return (
<html lang="en">
<body className={inter.className}>
<Providers>
<Header />
{children}
</Providers>
</body>
</html>
);
}
Loading

0 comments on commit 7c2c1dc

Please sign in to comment.