From 1a45d278414806b1e66e4cf146e979b7908c3118 Mon Sep 17 00:00:00 2001 From: LeeGordon83 Date: Tue, 11 Jul 2023 16:35:13 +0100 Subject: [PATCH] fixed broken map loading from station link issue, also implemented suggested code changes on PR --- server/models/views/station.js | 2 +- server/src/sass/components/_flood-status.scss | 43 +++++++++---------- server/src/sass/components/_line-chart.scss | 12 ------ server/views/station.html | 3 +- 4 files changed, 23 insertions(+), 37 deletions(-) diff --git a/server/models/views/station.js b/server/models/views/station.js index d1b1a2b5d..2dac0cd2c 100644 --- a/server/models/views/station.js +++ b/server/models/views/station.js @@ -388,7 +388,7 @@ class ViewModel { } function getBannerIcon (id) { - return severity.filter(item => item.id === id)[0].icon + return severity.find(item => item.id === id)?.icon } function stationTypeCalculator (stationTypeData) { diff --git a/server/src/sass/components/_flood-status.scss b/server/src/sass/components/_flood-status.scss index 21b6c4fad..2c3145c1f 100644 --- a/server/src/sass/components/_flood-status.scss +++ b/server/src/sass/components/_flood-status.scss @@ -1,3 +1,7 @@ +$white: #ffffff; +$red: #e3000f; +$amber: #f18700; + .defra-flood-status { padding-bottom:10px; @include mq ($from: tablet) { @@ -29,9 +33,9 @@ .defra-flood-status-item { @extend .govuk-inset-text; position: relative; - padding: 0px; + padding: 0; background-color: govuk-colour('light-grey'); - margin-top:0px; + margin-top:0; margin-bottom:10px; &:last-of-type { margin-bottom:5px; @@ -73,35 +77,35 @@ position: absolute; box-sizing: border-box; content: ''; - left: 0px; - top: 0px; - bottom: 0px; - right: 0px; + left: 0; + top: 0; + bottom: 0; + right: 0; border: 1px solid transparent; pointer-events: none; } } .defra-flood-status-item--severe { - background-color: govuk-tint(#e3000f, 93); - border-color:#e3000f; + background-color: govuk-tint($red, 93); + border-color:$red; &:after { - color: govuk-tint(#e3000f, 93); + color: govuk-tint($red, 93); border-color: currentColor; } } .defra-flood-status-item--warning { - background-color:govuk-tint(#e3000f, 93); - border-color:#e3000f; + background-color:govuk-tint($red, 93); + border-color:$red; &:after { - color: govuk-tint(#e3000f, 93); + color: govuk-tint($red, 93); border-color: currentColor; } } .defra-flood-status-item--alert { - background-color: govuk-tint(#f18700, 90); - border-color:#f18700; + background-color: govuk-tint($amber, 90); + border-color:$amber; &:after { - color: govuk-tint(#f18700, 90); + color: govuk-tint($amber, 90); border-color: currentColor; } } @@ -117,7 +121,7 @@ color: white; width: 20px; height: 20px; - margin: 0px 5px; + margin: 0 5px; @include mq ($from: tablet) { width: 25px; height: 25px; @@ -149,13 +153,6 @@ } } } -/* -.defra-flood-status-item--removed { - .defra-flood-status-item__icon:after { - background-position: 100% 75%; - } -} -*/ .defra-flood-status__text { @extend .govuk-body; @include govuk-responsive-margin(3, 'top'); diff --git a/server/src/sass/components/_line-chart.scss b/server/src/sass/components/_line-chart.scss index 1078fa26b..57015d4ed 100644 --- a/server/src/sass/components/_line-chart.scss +++ b/server/src/sass/components/_line-chart.scss @@ -277,18 +277,6 @@ .threshold:not(.threshold--selected) .threshold__line { cursor: pointer; } - // Typical/Alert - // .threshold--alert { - // .threshold__line { - // stroke: $govuk-border-colour; - // } - // } - // .threshold.threshold--selected.threshold--alert, - // .threshold.threshold--mouseover.threshold--alert { - // .threshold__line { - // stroke: $govuk-text-colour; - // } - // } // Significant points .significant .point circle { opacity: 0; diff --git a/server/views/station.html b/server/views/station.html index f4f8473ca..3d59f6b2d 100644 --- a/server/views/station.html +++ b/server/views/station.html @@ -308,7 +308,8 @@

How levels here could affect id: {{ model.station.id | dump | safe }}, zoom: {{ model.zoom | dump | safe }}, centre: {{ model.centre | dump | safe }}, - telemetry: {{ model.telemetryRefined | dump | safe }} + telemetry: {{ model.telemetryRefined | dump | safe }}, + bingMaps: {{ model.bingMaps | dump | safe }} }