Skip to content

[Fixes #14780] Add a relation type to LinkedResource - #14781

Open
giohappy wants to merge 1 commit into
masterfrom
linked_resource_relation_type
Open

giohappy wants to merge 1 commit into
masterfrom
linked_resource_relation_type

Conversation

@giohappy

Copy link
Copy Markdown
Contributor
  • New relation_type field on LinkedResource (related, uses, clone_of), unique together with source and target. The internal column is removed.
  • Cloning a resource adds a clone_of link from the clone to the original. Only the related links are copied to the clone.
  • linked_resources API: relation_type is returned for each item and can be used as a filter (?relation_type=clone_of). POST and DELETE only work on related links, the other types return a 400.
  • The "Related resources" field of the metadata editor only handles related links. For maps the map viewer is not listed, it's preserved on save and it can't be added.

Changes in geonode-mapstore-client

The current client keeps working, because internal is still returned (true only for uses). Until it's updated the clone links are shown under "Linked To" / "Linked By".

  • DetailsLinkedResources.jsx should group by relation_type instead of internal, with the new "Clone of" (linked_to) and "Cloned by" (linked_by) labels.
  • MapViewerConfiguration.jsx deletes the map viewer only when it has a single linkedBy. A cloned viewer now has its clone in that list, so only the related links should be counted.
  • The map viewer could be hidden from the Relations tab of a map, and from the autocomplete of "Related resources".

Upgrade notes

  • The migration sets related for the existing links and removes the duplicated ones (same source, target and type).
  • Code using LinkedResource(internal=...) or get_linked_resources(is_internal=...) must switch to relation_type.
  • Resources cloned before this change don't get a clone_of link.

@cla-bot cla-bot Bot added the cla-signed CLA Bot: community license agreement signed label Nov 20, 2026
@gitguardian

gitguardian Bot commented Nov 20, 2026

Copy link
Copy Markdown

⚠️ GitGuardian has uncovered 1 secret following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

🔎 Detected hardcoded secret in your pull request
GitGuardian id GitGuardian status Secret Commit Filename
34065353 Triggered Bearer Token d4d2691 docs/src/development/api.md View secret
🛠 Guidelines to remediate hardcoded secrets
  1. Understand the implications of revoking this secret by investigating where it is used in your code.
  2. Replace and store your secret safely. Learn here the best practices.
  3. Revoke and rotate this secret.
  4. If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.

To avoid such incidents in the future consider


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

@giohappy giohappy linked an issue Nov 20, 2026 that may be closed by this pull request
@etj

etj commented Nov 20, 2026

Copy link
Copy Markdown
Contributor

I'd use a proper thesaurus as a codelist for the relation type.

@giohappy giohappy changed the title Add a relation type to LinkedResource [Fixes #14780] Add a relation type to LinkedResource Nov 20, 2026
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.

Add a relation type to LinkedResource

2 participants