Skip to content

Fix #2532 Replace of DatasetCatalog with the new Catalog#2533

Open
allyoucanmap wants to merge 1 commit into
GeoNode:masterfrom
allyoucanmap:issue_2532
Open

Fix #2532 Replace of DatasetCatalog with the new Catalog#2533
allyoucanmap wants to merge 1 commit into
GeoNode:masterfrom
allyoucanmap:issue_2532

Conversation

@allyoucanmap
Copy link
Copy Markdown

This PR introduces following changes:

  • submodule update to introduce the new catalog
  • removal of the DatasetCatalog in favor of the new Catalog with GeoNode API

@allyoucanmap allyoucanmap modified the milestone: 2532 May 12, 2026
@allyoucanmap allyoucanmap linked an issue May 12, 2026 that may be closed by this pull request
3 tasks
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request performs a significant refactoring to align the GeoNode client with the MapStore framework by migrating local logic—such as facets, dataset cataloging, and resource utilities—directly into the framework. It replaces the custom DatasetsCatalog and MetadataExplorer plugins with the standard framework Catalog plugin and updates the backend context processor to provide default catalog service configurations. Feedback from the review highlights a potential casing mismatch when destructuring catalogueServices in ResourceUtils.js and suggests standardizing the inconsistent spelling of 'catalog' and 'catalogue' used throughout the modified files.

.filter(mLayer => !layers.find(layer => layer.id !== undefined && mLayer?.extra_params?.msId === layer.id))
.map(mLayer => resourceToLayerConfig(mLayer?.dataset));

const { catalogueServices = {}, catalogueSelectedService = '' } = getConfigProp('geoNodeSettings') || {};
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

There is a potential casing mismatch here. The context_processors.py file defines the keys as CATALOGUE_SERVICES and CATALOGUE_SELECTED_SERVICE (all caps), but they are being destructured here using camelCase (catalogueServices, catalogueSelectedService). Please verify if there is a mapping layer that handles this conversion, otherwise this will result in undefined values.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/gemini the mapping layer is in _geonode-config.html

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the clarification. Since the mapping is handled in _geonode-config.html, the destructuring in ResourceUtils.js is correct as long as the configuration is correctly passed through that template. I will consider this thread resolved.

Comment on lines +515 to +525
const { catalogueServices = {}, catalogueSelectedService = '' } = getConfigProp('geoNodeSettings') || {};
const existingServices = data?.catalogServices?.services || {};
const missingServices = Object.fromEntries(
Object.entries(catalogueServices).filter(([key]) => !existingServices[key])
);
const catalogServices = Object.keys(missingServices).length > 0
? {
services: { ...missingServices, ...existingServices },
selectedService: data?.catalogServices?.selectedService || catalogueSelectedService
}
: data?.catalogServices;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

There is an inconsistency in the spelling of 'catalog' vs 'catalogue' within this block. While GeoNode settings use the British spelling (catalogueServices), the MapStore configuration key and local variables use the American spelling (catalogServices). While this might be intentional for compatibility with MapStore's internal state, it makes the code harder to maintain. Consider standardizing the local variable names or adding a comment explaining the mapping.

@allyoucanmap allyoucanmap requested review from dsuren1 and removed request for stefanocudini May 12, 2026 15:49
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

Successfully merging this pull request may close these issues.

Replace of DatasetCatalog with the new Catalog

3 participants