From 85482b2e8ec6560c3109e8ce927617e1b752e8dc Mon Sep 17 00:00:00 2001 From: keyurx11 Date: Thu, 26 Sep 2024 13:40:38 +0100 Subject: [PATCH] FSR-1295: Consistent button CSS --- server/src/js/core.js | 2 +- server/src/sass/objects/_buttons.scss | 3 +-- server/views/alerts-and-warnings.html | 2 +- server/views/location.html | 2 +- server/views/national.html | 2 +- server/views/rainfall-station.html | 2 +- server/views/river-and-sea-levels.html | 2 +- server/views/station.html | 2 +- server/views/target-area.html | 2 +- test/routes/station.js | 6 +++--- 10 files changed, 12 insertions(+), 13 deletions(-) diff --git a/server/src/js/core.js b/server/src/js/core.js index 477801d4f..fd8326c7c 100644 --- a/server/src/js/core.js +++ b/server/src/js/core.js @@ -43,7 +43,7 @@ document.addEventListener('readystatechange', () => { if (document.getElementById('map-outlook')) { window.flood.maps.createOutlookMap('map-outlook', { btnText: 'View map showing flood risk areas', - btnClass: 'defra-button-secondary defra-button-secondary--icon', + btnClass: 'defra-button-secondary', days: model.outlookDays, data: model.outlookData || null }) diff --git a/server/src/sass/objects/_buttons.scss b/server/src/sass/objects/_buttons.scss index 2f350f634..6b8870a46 100644 --- a/server/src/sass/objects/_buttons.scss +++ b/server/src/sass/objects/_buttons.scss @@ -14,8 +14,7 @@ } // Secondoary button -a.defra-button-secondary, -button.defra-button-secondary { +.defra-button-secondary { position: relative; display: inline-block; @include govuk-font($size: 16); diff --git a/server/views/alerts-and-warnings.html b/server/views/alerts-and-warnings.html index f329878b0..67881fb09 100644 --- a/server/views/alerts-and-warnings.html +++ b/server/views/alerts-and-warnings.html @@ -127,7 +127,7 @@

window.flood = {} window.flood.model = {{ model.expose | dump(2) | safe }} window.flood.model.mapButtonText = 'View map of flood warning and alert areas' - window.flood.model.mapButtonClass = 'defra-button-secondary defra-button-secondary--icon' + window.flood.model.mapButtonClass = 'defra-button-secondary' window.flood.model.mapLayers = 'ts,tw,ta,mv' window.flood.model.extent = window.flood.model.placeBbox diff --git a/server/views/location.html b/server/views/location.html index 603a21429..862659be6 100644 --- a/server/views/location.html +++ b/server/views/location.html @@ -137,7 +137,7 @@

River, sea, groundwater and rainfall levels

window.flood = {} window.flood.model = {{ model.expose | dump(2) | safe }} window.flood.model.mapButtonText = {{ model.expose.mapButtonText | dump | safe }} - window.flood.model.mapButtonClass = 'defra-button-secondary defra-button-secondary--icon govuk-!-margin-bottom-4' + window.flood.model.mapButtonClass = 'defra-button-secondary govuk-!-margin-bottom-4' window.flood.model.data = { button: 'Location:Map view:Location - View national warning map' } diff --git a/server/views/national.html b/server/views/national.html index 7576f25bb..f1bffd412 100644 --- a/server/views/national.html +++ b/server/views/national.html @@ -121,7 +121,7 @@

River, sea, groundwater and rainfall levels

window.flood = {} window.flood.model = {{ model | dump(2) | safe }} window.flood.model.mapButtonText = {{ model.mapButtonText | dump | safe }} - window.flood.model.mapButtonClass = 'defra-button-secondary defra-button-secondary--icon' + window.flood.model.mapButtonClass = 'defra-button-secondary' window.flood.model.mapLayers = 'mv,ts,tw,ta' window.flood.model.outlookDays = {{ model.outlook.days | dump | safe }} window.flood.model.data = { diff --git a/server/views/rainfall-station.html b/server/views/rainfall-station.html index b26d530bd..12bc99879 100644 --- a/server/views/rainfall-station.html +++ b/server/views/rainfall-station.html @@ -111,7 +111,7 @@

Rainfall over the last 5 days in millimetres

- + Download data CSV (12KB)
diff --git a/server/views/river-and-sea-levels.html b/server/views/river-and-sea-levels.html index 12368fd94..da5939009 100644 --- a/server/views/river-and-sea-levels.html +++ b/server/views/river-and-sea-levels.html @@ -159,7 +159,7 @@

window.flood = {} window.flood.model = {{ model.clientModel | dump(2) | safe }} window.flood.model.mapButtonText = 'View map of levels' - window.flood.model.mpaButtonClass = 'defra-button-secondary defra-button-secondary--icon' + window.flood.model.mpaButtonClass = 'defra-button-secondary' window.flood.model.mapLayers = 'mv,ri,ti,gr,rf' window.flood.model.extent = window.flood.model.placeBox window.flood.model.data = { diff --git a/server/views/station.html b/server/views/station.html index d68dc9008..d0b1ae107 100644 --- a/server/views/station.html +++ b/server/views/station.html @@ -252,7 +252,7 @@

Height

Levels that are very low or below zero are normal for some stations.

{% endif %} - Download data CSV ({% if model.isFfoi %}16{% else %}12{% endif %}KB) + Download data CSV ({% if model.isFfoi %}16{% else %}12{% endif %}KB) diff --git a/server/views/target-area.html b/server/views/target-area.html index d5a2097b2..ca36360f1 100644 --- a/server/views/target-area.html +++ b/server/views/target-area.html @@ -111,7 +111,7 @@

{{ model.pageTitle }}

window.flood = {} window.flood.model = {{ model | dump(2) | safe }} window.flood.model.mapButtonText = {{ model.mapButtonText | dump | safe }} - window.flood.model.mapButtonClass = 'defra-button-secondary defra-button-secondary--icon govuk-!-margin-top-4' + window.flood.model.mapButtonClass = 'defra-button-secondary govuk-!-margin-top-4'; window.flood.model.mapLayers = 'mv,ts,tw,ta', window.flood.model.data = { button: 'Target Area:Map view:TA - Map view' diff --git a/test/routes/station.js b/test/routes/station.js index 35b840021..796965d7d 100644 --- a/test/routes/station.js +++ b/test/routes/station.js @@ -388,7 +388,7 @@ lab.experiment('Test - /station/{id}', () => { Code.expect(response.payload).to.contain('Normal range 0.15m to 3.50m') Code.expect(response.payload).to.contain('Nearby levels') Code.expect(response.payload).to.contain('Upstream') - Code.expect(response.payload).to.contain('Download data CSV (12KB)') + Code.expect(response.payload).to.contain('Download data CSV (12KB)') fullRelatedContentChecker(parse(response.payload)) validateFooterPresent(response) }) @@ -1897,7 +1897,7 @@ lab.experiment('Test - /station/{id}', () => { Code.expect(response.payload).to.contain('This data feed was interrupted') Code.expect(response.payload).to.contain('Nearby levels') Code.expect(response.payload).to.contain('Upstream') - Code.expect(response.payload).to.contain('Download data CSV (12KB)') + Code.expect(response.payload).to.contain('Download data CSV (12KB)') }) lab.test('GET station/5146 with Normal river level does no show IMTD thresholds if not present', async () => { const floodService = require('../../server/services/flood') @@ -2162,7 +2162,7 @@ lab.experiment('Test - /station/{id}', () => { Code.expect(response.payload).to.not.contain('Normal range ') Code.expect(response.payload).to.contain('Nearby levels') Code.expect(response.payload).to.contain('Upstream') - Code.expect(response.payload).to.contain('Download data CSV (12KB)') + Code.expect(response.payload).to.contain('Download data CSV (12KB)') }) lab.test('GET station/1034 - Coastal River title check ', async () => { const floodService = require('../../server/services/flood')