Skip to content

Commit

Permalink
FCRM-5430 applied standards
Browse files Browse the repository at this point in the history
  • Loading branch information
markfee committed Dec 9, 2024
1 parent 47f02f2 commit 88fda2c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
15 changes: 10 additions & 5 deletions client/js/defra-map/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { FloodMap } from '/flood-map' // Path defined as an alias to npm or submodule version in webpack alias
// /flood-map Path defined as an alias to npm or submodule version in webpack alias
import { FloodMap } from '/flood-map' // eslint-disable-line import/no-absolute-path
import { getEsriToken, getRequest, getInterceptors, getDefraMapConfig } from './tokens.js'
import { renderInfo, renderList } from './infoRenderer'
import { terms } from './terms.js'
Expand Down Expand Up @@ -48,9 +49,9 @@ const keyItemDefinitions = {
// floodZoneSymbolIndex is used to infer the _symbol value sent to the query feature when a layer is clicked
// we believe it depends on the order of the styles that are set on the flood zones vector tile layer
// and it is used to infer the flood zone that has been clicked on by a user.
// On a previous data set, these values were in the reverse order so we need to verify that they remain correct
// On a previous data set, these values were in the reverse order so we need to verify that they remain correct
// after a data upload to arcGis
const floodZoneSymbolIndex = [ '3', '2' ]
const floodZoneSymbolIndex = ['3', '2']

getDefraMapConfig().then((defraMapConfig) => {
const getVectorTileUrl = (layerName) => `${defraMapConfig.agolVectorTileUrl}/${layerName + defraMapConfig.layerNameSuffix}/VectorTileServer`
Expand Down Expand Up @@ -245,8 +246,10 @@ getDefraMapConfig().then((defraMapConfig) => {
}
const addLayers = async () => {
return Promise.all([
import(/* webpackChunkName: "esri-sdk" */ '/@arcgis-path/core/layers/VectorTileLayer.js'),
/* eslint-disable */
import(/* webpackChunkName: "esri-sdk" */ '/@arcgis-path/core/layers/VectorTileLayer.js'),
import(/* webpackChunkName: "esri-sdk" */ '/@arcgis-path/core/layers/FeatureLayer.js')
/* eslint-enable */
]).then(modules => {
const VectorTileLayer = modules[0].default
const FeatureLayer = modules[1].default
Expand Down Expand Up @@ -602,8 +605,10 @@ getDefraMapConfig().then((defraMapConfig) => {

const getModelFeatureLayer = async (coords, layerName) => {
const [{ default: FeatureLayer }, { default: Point }] = await Promise.all([
/* eslint-disable */
import(/* webpackChunkName: "esri-sdk" */ '/@arcgis-path/core/layers/FeatureLayer.js'),
import(/* webpackChunkName: "esri-sdk" */ '/@arcgis-path/core/geometry/Point.js')
/* eslint-enable */
])

const model = new FeatureLayer({ url: getModelFeatureLayerUrl(layerName) })
Expand All @@ -627,7 +632,7 @@ getDefraMapConfig().then((defraMapConfig) => {
} else if (floodSource === 'Fluvial') {
return 'River'
}
return floodSource[0].toUpperCase() + floodSource.slice(1);
return floodSource[0].toUpperCase() + floodSource.slice(1)
}

// Listen to map queries
Expand Down
1 change: 0 additions & 1 deletion client/js/defra-map/infoRenderer.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

const renderListKey = (value) => `<dt class="govuk-summary-list__key govuk-!-width-one-half">
<span class="govuk-body-s">
<strong>${value}</strong>
Expand Down
4 changes: 2 additions & 2 deletions client/js/defra-map/terms.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
const terms = {
likelihood: {
rsHigh: 'Rivers and sea 3.3%',
rsMedium:'Rivers 1% Sea 0.5%',
rsMedium: 'Rivers 1% Sea 0.5%',
rsLow: 'Rivers and sea 0.1%',
swHigh: '3.3%',
swMedium: '1%',
swLow: '0.1%'
}
}

export { terms }
export { terms }

0 comments on commit 88fda2c

Please sign in to comment.