diff --git a/configs/localConfig.json b/configs/localConfig.json index c2a78453e..3c33e5c8d 100644 --- a/configs/localConfig.json +++ b/configs/localConfig.json @@ -20,11 +20,9 @@ }, "stylesheetUri": "", "header": { - "height": 90, - "url": "/header/", + "height": 80, + "configFile": "", "script": "https://cdn.jsdelivr.net/gh/georchestra/header@dist/header.js", - "legacy": false, - "logoUrl": "https://www.georchestra.org/public/georchestra-logo.svg", "stylesheet": "" }, "defaultMapOptions": { @@ -844,7 +842,7 @@ "containerPosition": "header", "className": "navbar shadow navbar-home" } - }, + }, "Details", "AddWidgetDashboard", "MapConnectionDashboard", diff --git a/index.html b/index.html index 8f59976c3..357824135 100644 --- a/index.html +++ b/index.html @@ -101,7 +101,7 @@ } #georchestra-header { width: 100%; - height: 90px; + height: 80px; border: none; overflow: visible; position: absolute; diff --git a/indexTemplate.html b/indexTemplate.html index cb95ce307..8f392af6d 100644 --- a/indexTemplate.html +++ b/indexTemplate.html @@ -101,14 +101,14 @@ } #georchestra-header { width: 100%; - height: 90px; + height: 80px; border: none; overflow: visible; position: absolute; } #container { position: absolute; - top: 90px; + top: 80px; bottom: 0; height: unset !important; width: 100%; diff --git a/js/plugins/Header.jsx b/js/plugins/Header.jsx index 5300568a5..8ab2c1234 100644 --- a/js/plugins/Header.jsx +++ b/js/plugins/Header.jsx @@ -8,47 +8,31 @@ import {useEffect} from "react"; import { createPlugin, connect } from "@mapstore/utils/PluginsUtils"; -export const Header = ({url = "/header/", page = "mapstore", height = 90, ignoreIFrame = false, +export const Header = ({ page = "mapstore", height = 80, script = "https://cdn.jsdelivr.net/gh/georchestra/header@dist/header.js", - legacy = false, - logoUrl = "https://www.georchestra.org/public/georchestra-logo.svg", - stylesheet = ""}) => { + stylesheet = "", configFile = ""}) => { useEffect(() => { const header = document.getElementById("georchestra-header"); const headerScript = document.getElementById("georchestra-header-script"); const container = document.getElementById("container"); if (header) { - if (!ignoreIFrame && window.location !== window.parent.location) { - header.style.display = 'none'; - if (container) { - container.style.top = '0'; - } - } else { - header.setAttribute("active-app", page); - header.setAttribute("legacy-url", url); - header.setAttribute("legacy-header", legacy); - header.setAttribute("style", `height:${height}px`); - header.setAttribute("logo-url", logoUrl); - header.setAttribute("stylesheet", stylesheet); - headerScript.src = script; - - if (container) { - container.style.top = height + "px"; - } + header.setAttribute("active-app", page); + header.setAttribute("stylesheet", stylesheet); + header.setAttribute("config-file", configFile); + headerScript.src = script; + if (container) { + container.style.top = height + "px"; } - } - }, [page, url, height, window.location, window.parent.location]); + }, [page, window.location, window.parent.location]); return null; }; export default createPlugin('Header', { component: connect((state) => ({ - url: state.localConfig && state.localConfig.header && state.localConfig.header.url, - height: state.localConfig && state.localConfig.header && state.localConfig.header.height, script: state.localConfig && state.localConfig.header && state.localConfig.header.script, - legacy: state.localConfig && state.localConfig.header && state.localConfig.header.legacy, - logoUrl: state.localConfig && state.localConfig.header && state.localConfig.header.logoUrl, - stylesheet: state.localConfig && state.localConfig.header && state.localConfig.header.stylesheet + height: state.localConfig && state.localConfig.header && state.localConfig.header.height, + stylesheet: state.localConfig && state.localConfig.header && state.localConfig.header.stylesheet, + configFile: state.localConfig && state.localConfig.header && state.localConfig.header.configFile }))(Header) }); diff --git a/web/src/main/resources/mapstore.properties b/web/src/main/resources/mapstore.properties index 402948b81..09b5d69aa 100644 --- a/web/src/main/resources/mapstore.properties +++ b/web/src/main/resources/mapstore.properties @@ -18,4 +18,4 @@ datadir.location=${georchestra.extensions:},${georchestra.datadir}/mapstore overrides.config=../default.properties -overrides.mappings=header.url=headerUrl,header.height=headerHeight,header.script=headerScript,header.legacy=useLegacyHeader,header.logoUrl=logoUrl,header.stylesheet=georchestraStylesheet +overrides.mappings=header.script=headerScript,header.height=headerHeight,header.stylesheet=georchestraStylesheet,header.configFile=headerConfigFile