Skip to content

Commit

Permalink
fixed broken map loading from station link issue, also implemented su…
Browse files Browse the repository at this point in the history
…ggested code changes on PR
  • Loading branch information
LeeGordon83 committed Jul 11, 2023
1 parent 2e6ed43 commit 1a45d27
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 37 deletions.
2 changes: 1 addition & 1 deletion server/models/views/station.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
43 changes: 20 additions & 23 deletions server/src/sass/components/_flood-status.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
$white: #ffffff;
$red: #e3000f;
$amber: #f18700;

.defra-flood-status {
padding-bottom:10px;
@include mq ($from: tablet) {
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
}
Expand All @@ -117,7 +121,7 @@
color: white;
width: 20px;
height: 20px;
margin: 0px 5px;
margin: 0 5px;
@include mq ($from: tablet) {
width: 25px;
height: 25px;
Expand Down Expand Up @@ -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');
Expand Down
12 changes: 0 additions & 12 deletions server/src/sass/components/_line-chart.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 2 additions & 1 deletion server/views/station.html
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,8 @@ <h2 class="govuk-heading-s govuk-!-margin-bottom-4">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 }}
}
</script>
<script src="{{assetPath}}/js/templates.js"></script>
Expand Down

0 comments on commit 1a45d27

Please sign in to comment.