Skip to content

[Fixes #14801][5.1.x] Metadata: improve SpatialRepresentationType handling - #14806

Open
etj wants to merge 1 commit into
5.1.xfrom
14801_51x_spatial_representation_type_label
Open

etj wants to merge 1 commit into
5.1.xfrom
14801_51x_spatial_representation_type_label

Conversation

@etj

@etj etj commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

Manual backport of #14802

Checklist

Reviewing is a process done by project maintainers, mostly on a volunteer basis. We try to keep the overhead as small as possible and appreciate if you help us to do so by completing the following items. Feel free to ask in a comment if you have troubles with any of them.

For all pull requests:

  • Confirm you have read the contribution guidelines
  • You have sent a Contribution Licence Agreement (CLA) as necessary (not required for small changes, e.g., fixing typos in the documentation)
  • Make sure the first PR targets the master branch, eventual backports will be managed later. This can be ignored if the PR is fixing an issue that only happens in a specific branch, but not in newer ones.

The following are required only for core and extension modules (they are welcomed, but not required, for contrib modules):

  • There is a ticket in https://github.com/GeoNode/geonode/issues describing the issue/improvement/feature (a notable exemption is, changes not visible to end-users)
  • The issue connected to the PR must have Labels and Milestone assigned
  • PR for bug fixes and small new features are presented as a single commit
  • PR title must be in the form "[Fixes #<issue_number>] Title of the PR"
  • New unit tests have been added covering the changes, unless there is an explanation on why the tests are not necessary/implemented

Submitting the PR does not require you to check all items, but by the time it gets merged, they should be either satisfied or inapplicable.

@etj etj added this to the 5.1.2 milestone Nov 30, 2026
@etj
etj requested a review from sijandh35 November 30, 2026 17:03
@etj etj self-assigned this Nov 30, 2026
Copilot AI balanced review requested due to automatic review settings November 30, 2026 17:03
@cla-bot cla-bot Bot added the cla-signed CLA Bot: community license agreement signed label Nov 30, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The new spatial representation labels lack translation extraction markers, can use the wrong language, and remain stale after admin edits because schema caches are not invalidated.

3 open issues
What changed in this PR

Backports #14802 to the 5.1.x branch, making spatial representation choices in GeoNode’s metadata editor human-readable while preserving ISO identifiers for metadata interchange.

Changes:

  • Uses gn_description for dropdown labels, passed through gettext.
  • Adds short default labels to fixtures and a reversible migration that preserves customized descriptions.
  • Updates handler tests to expect display labels rather than identifiers.
File Description
geonode/​metadata/​tests/​test_handlers.py Updates test data and assertions for display labels.
geonode/​metadata/​handlers/​base.py Uses gn_description as the option title while retaining identifier values.
geonode/​base/​migrations/​0103_spatialrepresentationtype_gn_description_labels.py Replaces original fixture descriptions with short labels using guarded, reversible updates.
geonode/​base/​fixtures/​initial_data.json Supplies six short labels for fresh installations.

Review effort: Balanced

Comment thread geonode/metadata/handlers/base.py Resolved
Comment thread geonode/metadata/handlers/base.py Resolved
Comment thread geonode/metadata/handlers/base.py Resolved
@codecov

codecov Bot commented Nov 30, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 26.56250% with 47 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (5.1.x@77975c1). Learn more about missing BASE report.

Additional details and impacted files
@@           Coverage Diff            @@
##             5.1.x   #14806   +/-   ##
========================================
  Coverage         ?   52.59%           
========================================
  Files            ?     1000           
  Lines            ?    63942           
  Branches         ?     8827           
========================================
  Hits             ?    33629           
  Misses           ?    28751           
  Partials         ?     1562           
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@etj
etj force-pushed the 14801_51x_spatial_representation_type_label branch from 443fcb0 to 2aaa847 Compare December 1, 2026 15:35
@etj
etj requested a review from sijandh35 December 1, 2026 16:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed CLA Bot: community license agreement signed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants