From 641d2b39a337bb9590938235cf2dd2b2fdf7d115 Mon Sep 17 00:00:00 2001 From: Chris Date: Fri, 25 Oct 2024 20:46:57 +0100 Subject: [PATCH 1/2] feat: wip forecast page updates --- .../src/app/pages/forecast/forecast.page.html | 27 +++++--------- .../src/app/pages/forecast/forecast.page.scss | 22 ------------ .../src/app/pages/forecast/forecast.page.ts | 36 ++++++++++++++++--- 3 files changed, 41 insertions(+), 44 deletions(-) diff --git a/apps/picsa-tools/climate-tool/src/app/pages/forecast/forecast.page.html b/apps/picsa-tools/climate-tool/src/app/pages/forecast/forecast.page.html index 716c5c0cf..ab82a74d9 100644 --- a/apps/picsa-tools/climate-tool/src/app/pages/forecast/forecast.page.html +++ b/apps/picsa-tools/climate-tool/src/app/pages/forecast/forecast.page.html @@ -7,22 +7,13 @@ } -
- - -
{{'Annual Forecast' | translate}}
-
- - assessment - -
- - -
{{'Downscaled Forecast' | translate}}
-
- - map - -
-
+

{{'Seasonal Forecast' | translate}}

+ @for(forecast of seasonalForecasts(); track forecast.id){ + + } + +

{{'Downscaled Forecasts' | translate}}

+ @for(forecast of downscaledForecasts(); track forecast.id){ + {{forecast.title}} + } diff --git a/apps/picsa-tools/climate-tool/src/app/pages/forecast/forecast.page.scss b/apps/picsa-tools/climate-tool/src/app/pages/forecast/forecast.page.scss index d9d420b71..c5f086962 100644 --- a/apps/picsa-tools/climate-tool/src/app/pages/forecast/forecast.page.scss +++ b/apps/picsa-tools/climate-tool/src/app/pages/forecast/forecast.page.scss @@ -1,25 +1,3 @@ -.card-container { - display: flex; - flex-direction: row; - justify-content: center; - gap: 48px; - flex-wrap: wrap; -} - -.mat-card { - min-width: 200px; - display: flex; - cursor: pointer; - justify-content: center; - align-items: center; -} -.card-content { - display: flex; - padding: 1rem; - width: 100%; - align-items: center; - justify-content: center; -} .pdf-container { position: fixed; z-index: 2; diff --git a/apps/picsa-tools/climate-tool/src/app/pages/forecast/forecast.page.ts b/apps/picsa-tools/climate-tool/src/app/pages/forecast/forecast.page.ts index fc0a0fe8c..ca3a499e4 100644 --- a/apps/picsa-tools/climate-tool/src/app/pages/forecast/forecast.page.ts +++ b/apps/picsa-tools/climate-tool/src/app/pages/forecast/forecast.page.ts @@ -1,8 +1,12 @@ import { CommonModule } from '@angular/common'; -import { Component } from '@angular/core'; -import { ActivatedRoute } from '@angular/router'; +import { Component, effect, signal } from '@angular/core'; +import { ConfigurationService } from '@picsa/configuration'; +import { ICountryCode } from '@picsa/data'; +import { ResourcesComponentsModule } from '@picsa/resources/src/app/components/components.module'; +import { IResourceFile } from '@picsa/resources/src/app/schemas'; import { PdfViewerComponent } from '@picsa/shared/features'; import { PicsaTranslateModule } from '@picsa/shared/modules'; +import { SupabaseStorageService } from '@picsa/shared/services/core/supabase/services/supabase-storage.service'; import { ClimateToolComponentsModule } from '../../components/climate-tool-components.module'; @@ -11,13 +15,37 @@ import { ClimateToolComponentsModule } from '../../components/climate-tool-compo templateUrl: './forecast.page.html', styleUrls: ['./forecast.page.scss'], standalone: true, - imports: [CommonModule, ClimateToolComponentsModule, PicsaTranslateModule, PdfViewerComponent], + imports: [ + CommonModule, + ClimateToolComponentsModule, + PicsaTranslateModule, + PdfViewerComponent, + ResourcesComponentsModule, + ], }) export class ClimateForecastComponent { forecastTypes = ['Annual', 'Downscaled']; public page = 1; public pdfSrc?: string; - constructor(private route: ActivatedRoute) {} + + public seasonalForecasts = signal([]); + + public downscaledForecasts = signal([]); + + constructor(private configurationService: ConfigurationService, private storageService: SupabaseStorageService) { + effect( + () => { + const { country_code } = this.configurationService.deploymentSettings(); + this.loadForecasts(country_code); + }, + { allowSignalWrites: true } + ); + } + + private loadForecasts(country_code: ICountryCode) { + // TODO + } + // ngOnInit() {} openAnnualForeCast() { this.pdfSrc = '/assets/forecast-assets/forecastDoc.pdf'; From 6efe06c2137b1473b21e9ea6bea6c45932343f2f Mon Sep 17 00:00:00 2001 From: Chris Date: Fri, 25 Oct 2024 20:47:15 +0100 Subject: [PATCH 2/2] chore: update pre-commit hook --- .husky/pre-commit | 3 --- 1 file changed, 3 deletions(-) diff --git a/.husky/pre-commit b/.husky/pre-commit index 5a182ef10..372362317 100644 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,4 +1 @@ -#!/usr/bin/env sh -. "$(dirname -- "$0")/_/husky.sh" - yarn lint-staged