From aca707226b5b9714386522fdf8071a941938b178 Mon Sep 17 00:00:00 2001 From: Hendrik Oenings Date: Thu, 16 Jan 2025 11:11:34 +0100 Subject: [PATCH] Fix ESLint errors --- app/index.js | 24 ++++++---------- app/templater.js | 6 ++-- portal/portal/config.js | 63 +++++++++++++++++++++-------------------- 3 files changed, 44 insertions(+), 49 deletions(-) diff --git a/app/index.js b/app/index.js index 020aa5f..a86b7ca 100644 --- a/app/index.js +++ b/app/index.js @@ -86,10 +86,8 @@ app.use(async (req, res, next) => { }) app.use(express.static('dist')) -// -// Rewrite to portal (variant-only) -// -if (process.env.VARIANT_ONLY) { +if(process.env.VARIANT_ONLY) { + // Rewrite to portal (variant-only) app.use((req, res, next) => { if(req.url.startsWith('/resources/')) { next() @@ -102,12 +100,8 @@ if (process.env.VARIANT_ONLY) { req.url = `/portal${req.url}` next() }) -} - -// -// Redirect for landing page -// -else { +} else { + // Redirect for landing page app.get('/', (req, res) => { res.redirect(308, '/portal/') }) @@ -205,14 +199,12 @@ app.get('/:portal/:variant/', indexHandler) app.get('/:portal/:variant/config.js', configJsHandler) app.get('/:portal/:variant/config.json', configJsonHandler) - -if (process.env.NODE_ENV === "development") { +if(process.env.NODE_ENV === 'development') { app.listen(9000, () => { - console.info("App is running at PORT: 9000") + console.info('App is running at PORT: 9000') }) -} -else { +} else { app.listen(80, () => { - console.info("App is running at PORT: 80") + console.info('App is running at PORT: 80') }) } diff --git a/app/templater.js b/app/templater.js index c2f6ba9..9004597 100644 --- a/app/templater.js +++ b/app/templater.js @@ -68,10 +68,10 @@ function getTemplate(s, config, opts) { return getTemplate(res.groups.template, viaMap?.[viaValue] ?? viaMap?.fallback, opts) } if(res = checkCommand('not', s, config, opts)) return !res[0] - if(res = checkCommand('eq', s, config, opts)) return res[0] === res[1] + if(res = checkCommand('eq', s, config, opts)) return res[0] === res[1] if(res = checkCommand('neq', s, config, opts)) return res[0] !== res[1] - if(res = checkCommand('and', s, config, opts)) return res[0] && res[1] - if(res = checkCommand('or', s, config, opts)) return res[0] || res[1] + if(res = checkCommand('and', s, config, opts)) return res[0] && res[1] + if(res = checkCommand('or', s, config, opts)) return res[0] || res[1] if(res = checkCommand('elem', s, config, opts)) return Array.isArray(res[1]) && res[1].includes(res[0]) const path = translatePath(s) return getByPath(config, path) diff --git a/portal/portal/config.js b/portal/portal/config.js index fb02fdb..7460288 100644 --- a/portal/portal/config.js +++ b/portal/portal/config.js @@ -1,31 +1,34 @@ const Config = { - wfsImgPath: "/resources/img/", - namedProjections: [ - ["EPSG:25832", "+title=ETRS89/UTM 32N +proj=utm +zone=32 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs"] - ], - footer: { - urls: [ - { - "bezeichnung": "common:modules.footer.designation", - "url": "https://geoinfo.hamburg.de/", - "alias": "Landesbetrieb Geoinformation und Vermessung", - "alias_mobil": "LGV" - } - ], - showVersion: true - }, - layerConf: "/resources/services-internet.json", - restConf: "/resources/rest-services-internet.json", - styleConf: "/resources/style_v3.json", - scaleLine: true, - mouseHover: { - numFeaturesToShow: 2, - infoText: "(weitere Objekte. Bitte zoomen.)" - }, - login: { - oidcAuthorizationEndpoint: "", - oidcTokenEndpoint: "", - oidcClientId: "", - oidcScope: "profile email openid" - } -}; + wfsImgPath: '/resources/img/', + namedProjections: [ + [ + 'EPSG:25832', + '+title=ETRS89/UTM 32N +proj=utm +zone=32 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs', + ], + ], + footer: { + urls: [ + { + 'bezeichnung': 'common:modules.footer.designation', + 'url': 'https://geoinfo.hamburg.de/', + 'alias': 'Landesbetrieb Geoinformation und Vermessung', + 'alias_mobil': 'LGV', + }, + ], + showVersion: true, + }, + layerConf: '/resources/services-internet.json', + restConf: '/resources/rest-services-internet.json', + styleConf: '/resources/style_v3.json', + scaleLine: true, + mouseHover: { + numFeaturesToShow: 2, + infoText: '(weitere Objekte. Bitte zoomen.)', + }, + login: { + oidcAuthorizationEndpoint: '', + oidcTokenEndpoint: '', + oidcClientId: '', + oidcScope: 'profile email openid', + }, +}