GeoNodeUserGroup-DE / contrib_externalapplications

GeoNode contrib module adding an externalapplication resource
GNU General Public License v3.0
0 stars 0 forks source link

Adding an External Application only possible from catalogue view #1

Open mkrueger-dev opened 2 months ago

mkrueger-dev commented 2 months ago

Hi, I implemented the feature and noticed that you can only access the "External Application" in the "Add Resource" dropdown from the catalogue view, but not from the base path.

Cheers, Marcus

ridoo commented 2 months ago

I noticed this some time ago, but did not find out the reason for that directly. Thanks for reporting, so we have it documented.

ridoo commented 3 weeks ago

Adding some thought: The app actually does not add itself to the drop down menu. This is done by the geonode-mapstore-client. Perhaps there's some location where to add another config of externalapplication in the localConfig.json. However, did not explore further yet.

Edit: The blueprint adds the drop down entry for externalapplications for the catalogue plugin only.

ridoo commented 3 weeks ago

Could be that the geonode-mapstore-client does not consider the overrides from _geonode_config.html, when starting from /. I suspect geonode_mapstore_client/templates/index.html:

<script>
    window.addEventListener('mapstore:ready', function(event) {
        const catalogPagePath = window.__GEONODE_CONFIG__.localConfig.geoNodeSettings.catalogPagePath;
        const pagePath = catalogPagePath ? catalogPagePath : '/catalogue/';
        const msAPI = event.detail;
        msAPI.setPluginsConfig([
            {
                name: 'FeaturedResourcesGrid',
                cfg: {
                    targetSelector: '#gn-home-featured-resources-grid',
                    pagePath: pagePath
                }
            },
            {
                name: 'ResourcesGrid',
                cfg: {
                    targetSelector: '#gn-home-resources-grid',
                    containerSelector: '#gn-home-resources-grid',
                    pagination: false,
                    pagePath: pagePath,
                    disableFilters: true,
                    disableDetailPanel: true,
                    enableGeoNodeCardsMenuItems: true
                }
            },
            { name: 'SaveAs', cfg: { closeOnSave: true } },
            { name: 'DeleteResource' },
            { name: 'DownloadResource' },
            { name: 'Notifications' }
        ]);
    });
</script>