Skip to content

Commit ed74fe2

Browse files
authored
Merge pull request #471 from openclimatefix/india-mvp
India MVP
2 parents 811c803 + 1267f1d commit ed74fe2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+10084
-9101
lines changed

.github/workflows/yarn_test.yaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,15 @@ jobs:
1717
uses: actions/setup-node@v3
1818
with:
1919
node-version: ${{ matrix.node-version }}
20-
- name: install yarn app
20+
- name: install yarn
2121
run: |
2222
cd apps/nowcasting-app
2323
yarn install
24+
- name: build & start app
25+
run: |
26+
cd apps/nowcasting-app
27+
yarn build
2428
- name: run tests
2529
run: |
2630
cd apps/nowcasting-app
27-
yarn test --coverage --coverageDirectory=../..
31+
yarn start & sleep 5 && yarn test --coverage --coverageDirectory=../..

apps/nowcasting-app/components/charts/forecast-header/ui.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import React from "react";
21
import { theme } from "../../../tailwind.config";
32
import { ClockIcon } from "../../icons/icons";
43
import ForecastLabel from "../../national_forecast_labels";
@@ -146,6 +145,7 @@ export const NextForecast: React.FC<{ pv: string; tip: string; time: string; col
146145
};
147146

148147
type ForecastHeaderProps = {
148+
children: React.ReactNode;
149149
forecastNextPV: string;
150150
forecastPV: string;
151151
actualPV: string;

apps/nowcasting-app/components/charts/gsp-pv-remix-chart/forecast-header-gsp.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import React from "react";
21
import { CloseButtonIcon, DownArrow, UpArrow } from "../../icons/icons";
32
import { ForecastHeadlineFigure } from "../forecast-header/ui";
43
import { DeltaHeaderBlock } from "../delta-view/delta-header-block";
4+
import React, { FC } from "react";
55

66
type ForecastHeaderGSPProps = {
77
title: string;
@@ -14,9 +14,10 @@ type ForecastHeaderGSPProps = {
1414
forecastPV?: string;
1515
forecastNextTimeOnly?: string;
1616
forecastNextPV?: string;
17+
children?: React.ReactNode;
1718
};
1819

19-
const ForecastHeaderGSP: React.FC<ForecastHeaderGSPProps> = ({
20+
const ForecastHeaderGSP: FC<ForecastHeaderGSPProps> = ({
2021
title,
2122
deltaView,
2223
deltaValue,

apps/nowcasting-app/components/charts/gsp-pv-remix-chart/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { FC } from "react";
21
import RemixLine from "../remix-line";
32
import useFormatChartData from "../use-format-chart-data";
43
import {
@@ -12,6 +11,7 @@ import useGetGspData from "./use-get-gsp-data";
1211
import useGlobalState, { get30MinNow, getNext30MinSlot } from "../../helpers/globalState";
1312
import Spinner from "../../icons/spinner";
1413
import { ForecastValue } from "../../types";
14+
import React, { FC } from "react";
1515

1616
// We want to have the ymax of the graph to be related to the capacity of the GspPvRemixChart
1717
// If we use the raw values, the graph looks funny, i.e y major ticks are 0 100 232

apps/nowcasting-app/components/charts/solar-site-view/forecast-header.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import React from "react";
21
import { CloseButtonIcon } from "../../icons/icons";
32

43
type ForecastHeaderSiteProps = {

apps/nowcasting-app/components/delta-forecast-label.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
type DeltaForecastLabelProps = {
2+
children: React.ReactNode;
23
tip: string | React.ReactNode;
34
position?: "left" | "right" | "middle";
45
className?: string;

apps/nowcasting-app/components/helpers/utils.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ describe("check getOpacityValueFromPVNormalized with valid values", () => {
2525
describe("check convertISODateStringToLondonTime", () => {
2626
test("check convertISODateStringToLondonTime with valid date strings", () => {
2727
expect(convertISODateStringToLondonTime("2021-01-01T03:00:00.000Z")).toBe("03:00");
28-
expect(convertISODateStringToLondonTime("2021-01-01T03:21:00.000")).toBe("03:21");
29-
expect(convertISODateStringToLondonTime("2021-01-01T03:50:11")).toBe("03:50");
28+
expect(convertISODateStringToLondonTime("2021-01-01T03:21:00.000Z")).toBe("03:21");
29+
expect(convertISODateStringToLondonTime("2021-01-01T03:50:11Z")).toBe("03:50");
3030
});
3131

3232
it("should handle an empty date string", () => {

apps/nowcasting-app/components/icons/logo.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
export const OCFlogo = () => (
1+
import { FC } from "react";
2+
3+
export const OCFlogo: FC = () => (
24
<a
35
className="max-h-full z-20"
46
href="https://www.openclimatefix.org/"

apps/nowcasting-app/components/layout/header/profile-dropdown.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ const ProfileDropDown = ({}: IProfileDropDown) => {
170170
"block px-4 py-2 text-sm text-ocf-black-600"
171171
)}
172172
>
173-
<Link href="/api/auth/logout">
173+
<Link href="/api/auth/logout" legacyBehavior>
174174
<a id={"UserMenu-LogoutBtn"}>Sign out</a>
175175
</Link>
176176
</div>

apps/nowcasting-app/components/map/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ export enum SelectedData {
1212
}
1313

1414
export interface IMap {
15+
children: React.ReactNode;
1516
loadDataOverlay: any;
1617
controlOverlay: any;
1718
bearing?: number;
1819
updateData: { newData: boolean | string; updateMapData: (map: mapboxgl.Map) => void };
19-
children: React.ReactNode;
2020
title: string;
2121
}

0 commit comments

Comments
 (0)