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

[Dataset] [Search] Quick search on click territory tag #118

Merged
merged 4 commits into from
Jan 20, 2025

Conversation

AlitaBernachot
Copy link
Contributor

@AlitaBernachot AlitaBernachot commented Jan 15, 2025

This PR enables the click on "Territoire" tag, redirecting the user to the search page with checked filter on selected tag.

To enable the Territoire filter, update line in default.toml:

advanced_filters = ['producerOrg', 'categoryKeyword', 'territories', 'revisionYear', 'license', 'qualityScore']

image
image

@AlitaBernachot AlitaBernachot force-pushed the GSMEL-424-territories-search branch 2 times, most recently from 93cc90e to 7a2e4ac Compare January 15, 2025 15:24
Copy link
Member

@tkohr tkohr left a comment

Choose a reason for hiding this comment

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

Thanks, @AlitaBernachot, your solution looks and works well ! Just left some minor comments on suggestions or things you may have forgotten.

I think you also need to run npx nx format and/or configure your IDE to format on save, which should eventually make the CI pass.

apps/datahub-e2e/src/e2e/search.cy.ts Outdated Show resolved Hide resolved
apps/datahub-e2e/src/e2e/search.cy.ts Outdated Show resolved Hide resolved
apps/datahub-e2e/src/support/commands.ts Show resolved Hide resolved
conf/default.toml Show resolved Hide resolved
@AlitaBernachot AlitaBernachot force-pushed the GSMEL-424-territories-search branch from 7a2e4ac to c7a7148 Compare January 20, 2025 07:15
@AlitaBernachot AlitaBernachot requested a review from tkohr January 20, 2025 07:23
Copy link
Member

@tkohr tkohr left a comment

Choose a reason for hiding this comment

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

Looking good! Thanks for the adaptions @AlitaBernachot !

(req) => {
if (
req.body.query?.ids?.values.includes(
'775b7660-b03b-443a-9817-be82ecd0ef07'
Copy link
Member

Choose a reason for hiding this comment

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

Just for my understanding, why is this condition actually needed, as the command is currently only called for this dataset?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oops I forggot to make it generic, I updated to:

if (req.body.query?.ids?.values.includes(id))

https://github.com/camptocamp/mel-dataplatform/pull/118/files#diff-dc85986d4f606f14c248534d03723c0e6d7af1b67c90d73565774bfa2d2dc445R140

The condition is needed because there is no other way to identify the request dedicated to the dataset info since /geonetwork/srv/api/search/records/_search?bucket=bucket is also used to populate filters, queryscore, etc...

if there was a route like /geonetwork/srv/api/search/records/dataset/775b7660-b03b-443a-9817-be82ecd0ef07 we wouldnt need to analyse the request payload, a simple intercept cy.intercept('POST',
/geonetwork/srv/api/search/records/dataset/775b7660-b03b-443a-9817-be82ecd0ef07 ) would have been sufficient.

@AlitaBernachot AlitaBernachot force-pushed the GSMEL-424-territories-search branch from 17ced4f to 7bac8f7 Compare January 20, 2025 08:34
@AlitaBernachot AlitaBernachot merged commit ae15db7 into main Jan 20, 2025
7 checks passed
@AlitaBernachot AlitaBernachot deleted the GSMEL-424-territories-search branch January 20, 2025 08:48
Comment on lines +48 to +50
console.log('query', query)
console.log('keyword.key', keyword.key)
console.log('keyword.key', keyword)
Copy link
Member

Choose a reason for hiding this comment

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

remember to get rid of console.log before merging ;)

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.

3 participants