Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

header insertion should use vars from default.properties #46

Open
landryb opened this issue Jan 30, 2025 · 3 comments
Open

header insertion should use vars from default.properties #46

landryb opened this issue Jan 30, 2025 · 3 comments

Comments

@landryb
Copy link
Member

landryb commented Jan 30, 2025

c874164 is clever, but it hardcodes the CDN url (also in https://github.com/georchestra/dashboard/blob/main/config/superset/superset_georchestra_config.py#L141) and doesn't use vars from https://github.com/georchestra/datadir/blob/master/default.properties#L22 to configure the geor-header webcomponent

i dunno how one can inject vars in the template rendering (havent looked yet at how flask-appbuilder works), but it shouldn't be hard to have some python code running in the superset georchestra config that tries to load/parse default.properties from the datadir and inject those into jinja so that <geor-header> is properly autoconfigured.

after adding the TALISMAN_CONFIG section to my homegrown superset_config.py to work around the CSP limitations (havent tested your complete one yet) i have it running/displaying just fine here with

    <script src="/dist/header.js" nonce="{{ csp_nonce() }}"></script>
    <geor-header active-app="dashboards" config-file="/dist/config.json"></geor-header>

Image

i think the favicon should also be configured via the FAVICON config key :)

@landryb
Copy link
Member Author

landryb commented Feb 5, 2025

@jeanpommier landryb/gaia@1c58999 fixes this issue for gaia, reading the header parameters from default.properties

superset uses context_processor here

@jeanpommier
Copy link
Member

Thank you @landryb, good idea. Work in progress, coming soon

jeanpommier added a commit to georchestra/superset that referenced this issue Feb 19, 2025
Insert the logic for georchestra/superset-core#46
In geOrchestra, the header (top menu) is controlled by params rom the
default.properties file. This commit provides a means to parse this file
and get a header that is consistent with geOrchestra's other apps.
It is also possible to disable the header's display by setting
GEORCHESTRA_NOHEADER=True in the superset config file
jeanpommier added a commit that referenced this issue Feb 19, 2025
Implements #46
in the jinja2 templates. Relies on georchestra/superset@beadf0d
to work.
jeanpommier added a commit that referenced this issue Feb 19, 2025
Implements #46
in the jinja2 templates. Relies on georchestra/superset@beadf0d
to work.
@jeanpommier
Copy link
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants