Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Record view / contact focus on feature: allow to customise the contact field name to filter #8578

Merged

Conversation

josegar74
Copy link
Member

In the metadata page, clicking on a contact shows an option to filter by the organisation name:

Screenshot 2024-12-23 at 13 49 25

The filter was hardcoded to use the field OrgForResourceObject.default, to filter by the resource contact. Updated the code to configure the field name depending on the type of contact displayed.

In the previous example, for a metadata contact, the query was not showing any result:

http://localhost:8080/geonetwork/srv/eng/catalog.search?debug#/search?query_string=%7B%22OrgForResourceObject.default%22:%7B%22FAO%20-%20NRCW%22:true%7D%7D

Screenshot 2024-12-23 at 14 13 41

With the change, the query shows the results properly:

http://localhost:8080/geonetwork/srv/eng/catalog.search?debug#/search?query_string=%7B%22OrgObject.default%22:%7B%22FAO%20-%20NRCW%22:true%7D%7D

Screenshot 2024-12-23 at 14 13 50

Checklist

  • I have read the contribution guidelines
  • Pull request provided for main branch, backports managed with label
  • Good housekeeping of code, cleaning up comments, tests, and documentation
  • Clean commit history broken into understandable chucks, avoiding big commits with hundreds of files, cautious of reformatting and whitespace changes
  • Clean commit messages, longer verbose messages are encouraged
  • API Changes are identified in commit messages
  • Testing provided for features or enhancements using automatic tests
  • User documentation provided for new features or enhancements in manual
  • Build documentation provided for development instructions in README.md files
  • Library management using pom.xml dependency management. Update build documentation with intended library use and library tutorials or documentation

Sorry, something went wrong.

Verified

This commit was signed with the committer’s verified signature.
kianenigma Kian Paimani
…t field name to filter
@josegar74 josegar74 added this to the 4.4.7 milestone Dec 23, 2024
@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@ianwallen ianwallen merged commit 8aabcfc into geonetwork:main Mar 5, 2025
7 of 8 checks passed
@geonetworkbuild
Copy link
Collaborator

The backport to 4.2.x failed:

The process '/usr/bin/git' failed with exit code 1
stderr
error: could not apply 37a2fdcede... Record view / contact focus on feature: allow to customise the contact field name to filter
hint: After resolving the conflicts, mark them with
hint: "git add/rm <pathspec>", then run
hint: "git cherry-pick --continue".
hint: You can instead skip this commit with "git cherry-pick --skip".
hint: To abort and get back to the state before "git cherry-pick",
hint: run "git cherry-pick --abort".
hint: Disable this message with "git config set advice.mergeConflict false"

stdout
Auto-merging web-ui/src/main/resources/catalog/components/search/mdview/mdviewDirective.js
Auto-merging web-ui/src/main/resources/catalog/components/search/mdview/partials/contact.html
CONFLICT (content): Merge conflict in web-ui/src/main/resources/catalog/components/search/mdview/partials/contact.html
Auto-merging web-ui/src/main/resources/catalog/js/CatController.js
CONFLICT (content): Merge conflict in web-ui/src/main/resources/catalog/js/CatController.js
Auto-merging web-ui/src/main/resources/catalog/views/default/templates/recordView/processsteps.html
Auto-merging web-ui/src/main/resources/catalog/views/default/templates/recordView/type-dataset.html
CONFLICT (content): Merge conflict in web-ui/src/main/resources/catalog/views/default/templates/recordView/type-dataset.html
Auto-merging web-ui/src/main/resources/catalog/views/default/templates/recordView/type-series.html
CONFLICT (content): Merge conflict in web-ui/src/main/resources/catalog/views/default/templates/recordView/type-series.html

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-4.2.x 4.2.x
# Navigate to the new working tree
cd .worktrees/backport-4.2.x
# Create a new branch
git switch --create backport-8578-to-4.2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick 37a2fdcede647ff95d5b670db3b25c85992c4d00
# Push it to GitHub
git push --set-upstream origin backport-8578-to-4.2.x
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-4.2.x

Then, create a pull request where the base branch is 4.2.x and the compare/head branch is backport-8578-to-4.2.x.

josegar74 added a commit to GeoCat/core-geonetwork that referenced this pull request Mar 7, 2025

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
…t field name to filter (geonetwork#8578)
josegar74 added a commit to GeoCat/core-geonetwork that referenced this pull request Mar 7, 2025

Verified

This commit was signed with the committer’s verified signature.
kianenigma Kian Paimani
…t field name to filter (geonetwork#8578)
josegar74 added a commit to GeoCat/core-geonetwork that referenced this pull request Mar 7, 2025

Verified

This commit was signed with the committer’s verified signature.
kianenigma Kian Paimani
…t field name to filter (geonetwork#8578)
ianwallen pushed a commit that referenced this pull request Mar 7, 2025

Verified

This commit was signed with the committer’s verified signature.
kianenigma Kian Paimani
…tomise the contact field name to filter (#8682)

* Record view / contact focus on feature: allow to customise the contact field name to filter (#8578)

* Fix wrong self-closing tags
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants