Skip to content

Commit

Permalink
Merge pull request #1812 from rodekruis/fix.return-period-shows-no-tr…
Browse files Browse the repository at this point in the history
…igger

fix: only show RP if > 0 + linting fixes
  • Loading branch information
jannisvisser authored Nov 26, 2024
2 parents c89cc6d + 067c290 commit b754461
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 8 deletions.
2 changes: 1 addition & 1 deletion interfaces/IBF-dashboard/eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ module.exports = tseslint.config(
'@angular-eslint/template/mouse-events-have-key-events': 'warn',
'@angular-eslint/template/alt-text': 'warn',
'@angular-eslint/template/elements-content': 'warn',
'@angular-eslint/template/i18n': 'warn',
'@angular-eslint/template/i18n': 'off', // 'warn' caused automatic changes that broke the code

//'@angular-eslint/template/i18n': [
// 'error',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
style="cursor: default"
><ion-icon name="information-circle-outline"></ion-icon></span
></strong>
@if (data?.station?.dynamicData?.forecastReturnPeriod) {
@if (data?.station?.dynamicData?.forecastReturnPeriod > 0) {
<br />
{{
'map-popups.glofas-station.forecast-return'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Component, Input, OnInit } from '@angular/core';
import { EapAlertClass, EapAlertClasses } from '../../../models/country.model';
import { Station } from '../../../models/poi.model';
import { LeadTime } from '../../../types/lead-time';
import { EapAlertClass, EapAlertClasses } from 'src/app/models/country.model';
import { Station } from 'src/app/models/poi.model';
import { LeadTime } from 'src/app/types/lead-time';

@Component({
selector: 'app-glofas-station-popup-content',
Expand Down Expand Up @@ -73,7 +73,7 @@ export class GlofasStationPopupContentComponent implements OnInit {
public addComma = (n) => Math.round(n).toLocaleString('en-US');

public getLeadTimeString(): string {
if (!this.data || !this.data?.leadTime) {
if (!this.data?.leadTime) {
return '';
}

Expand Down
10 changes: 8 additions & 2 deletions interfaces/IBF-dashboard/src/app/models/poi.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,14 @@
export class Station {
stationName: string;
stationCode: string;
/* eslint-disable @typescript-eslint/no-explicit-any */
dynamicData?: any;
dynamicData?: StationDynamicData;
}

export class StationDynamicData {
forecastLevel: number;
triggerLevel: number;
forecastReturnPeriod: number;
eapAlertClass: string;
}

export class TyphoonTrackPoint {
Expand Down

0 comments on commit b754461

Please sign in to comment.