qwc-services / qwc-config-generator

QWC Config Generator
2 stars 12 forks source link

feature request: using default parameters for manually specified themes in tenantConfig #51

Closed danceb closed 1 year ago

danceb commented 1 year ago

If I am not wrong, the default parameters for

are only taken into account, if the automatically scanning of qgis projects with qgis_projects_scan_base_dir is used, right? It would be very useful, if they can also be used for themes, which are set manually within the tenantConfig.json. So the parameters must not be set in each theme item seperately if they are the same.

Maybe a possible way (ditn't try it) could be to set the default items in the get() functions, where the items are read from the config file? Like for the background layers:

themes['backgroundLayers'] = themes_config_themes.get(
    'backgroundLayers', themes['defaultBackgroundLayers']
)

in https://github.com/qwc-services/qwc-config-generator/blob/master/config_generator/map_viewer_config.py#L250

With specifying

themes['defaultBackgroundLayers'] = themes_config.get('defaultBackgroundLayers', [])

before that. Any thoughts/ideas about this?

manisandro commented 1 year ago

Should since be fixed with the following:

https://github.com/qwc-services/qwc-config-generator/commit/63517f8a041493f010d4f6ec9a2fc3e0716ca5ef https://github.com/qwc-services/qwc-config-generator/commit/d428c793494df395505beeac8228d4081917db80 https://github.com/qgis/qwc2/commit/3bdb5cc72ca6d858ae7ba34e8af453539a16da82