Skip to content

Commit

Permalink
Fix ESLint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
oeninghe-dataport committed Jan 16, 2025
1 parent 45a0266 commit aca7072
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 49 deletions.
24 changes: 8 additions & 16 deletions app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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/')
})
Expand Down Expand Up @@ -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')
})
}
6 changes: 3 additions & 3 deletions app/templater.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
63 changes: 33 additions & 30 deletions portal/portal/config.js
Original file line number Diff line number Diff line change
@@ -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',
},
}

0 comments on commit aca7072

Please sign in to comment.