Skip to content

Commit

Permalink
Merge branch 'development' into staging
Browse files Browse the repository at this point in the history
  • Loading branch information
braddf committed Dec 19, 2024
2 parents a987fe0 + 42caeb0 commit 03b4345
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
3 changes: 2 additions & 1 deletion apps/nowcasting-app/components/helpers/data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -240,8 +240,9 @@ export const generateGeoJsonForecastData: (
);
} else if (aggregation === NationalAggregation.zone) {
console.log("aggregating to zone");
const ngZonesJson = ngZones as FeatureCollection;
features = mapZoneFeatures(
ngZones.features as Feature<Geometry, GeoJsonProperties>[],
ngZonesJson.features as Feature<Geometry, GeoJsonProperties>[],
ngGSPZoneGroupings,
combinedData,
gspForecastsDataByTimestamp,
Expand Down
3 changes: 2 additions & 1 deletion apps/nowcasting-app/components/map/deltaMap.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,8 @@ const DeltaMap: React.FC<DeltaMapProps> = ({
);
map.addSource("latestPV", {
type: "geojson",
data: forecastGeoJson
data: forecastGeoJson,
promoteId: "id"
});
} else {
if (generatedGeoJsonForecastData && source) {
Expand Down
11 changes: 10 additions & 1 deletion apps/nowcasting-app/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import {
getSitesLoadingState,
isProduction
} from "../components/helpers/utils";
import { ActiveUnit } from "../components/map/types";
import { ActiveUnit, NationalAggregation } from "../components/map/types";
import DeltaMap from "../components/map/deltaMap";
import * as Sentry from "@sentry/nextjs";
import SolarSiteChart from "../components/charts/solar-site-view/solar-site-chart";
Expand Down Expand Up @@ -71,6 +71,8 @@ export default function Home({ dashboardModeServer }: { dashboardModeServer: str
const [, setSitesLoadingState] = useGlobalState("sitesLoadingState");
const [, setLoadingState] = useGlobalState("loadingState");
const [nHourForecast] = useGlobalState("nHourForecast");
const [nationalAggregationLevel] = useGlobalState("nationalAggregationLevel");
const [, setClickedGspId] = useGlobalState("clickedGspId");

const [forecastLastFetch30MinISO, setForecastLastFetch30MinISO] = useState(get30MinNow(-30));
const [forecastHistoricBackwardIntervalMinutes, setForecastHistoricBackwardIntervalMinutes] =
Expand Down Expand Up @@ -106,6 +108,13 @@ export default function Home({ dashboardModeServer }: { dashboardModeServer: str
setArraySettingInCookieStorage(CookieStorageKeys.VISIBLE_LINES, visibleLines);
}, [visibleLines]);

// On view change, unset the clicked "GSP" if the aggregation is not GSP
useEffect(() => {
if (nationalAggregationLevel !== NationalAggregation.GSP) {
setClickedGspId(undefined);
}
}, [view]);

const currentView = (v: VIEWS) => v === view;

useEffect(() => {
Expand Down

0 comments on commit 03b4345

Please sign in to comment.