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

Enhancements to data-resources block in WP #1337

Open
sandykadam opened this issue Jul 3, 2024 · 13 comments
Open

Enhancements to data-resources block in WP #1337

sandykadam opened this issue Jul 3, 2024 · 13 comments
Assignees

Comments

@sandykadam
Copy link
Collaborator

sandykadam commented Jul 3, 2024

Hi @kasprzyk-sz

We need to make following modifications to data-resources block to make it flexible for editors.

Option to

  • search by display title
  • search by team
  • search by keywords
  • option to use long description or short description (default is short description)

@kasprzyk-sz please also add documentation & steps on https://stable.visual-framework.dev/wordpress/blocks/

@mshujamalik-ebi please note this and accordingly make necessary changes to CH API and provide examples to Szymon so he will implement the changes accordingly.

FYI @Adedoyinebi

@kasprzyk-sz
Copy link
Contributor

Hi @mshujamalik-ebi, could you please provide the relevant CH queries for this one?

@kasprzyk-sz
Copy link
Contributor

@sandykadam
Copy link
Collaborator Author

sandykadam commented Sep 3, 2024

@mshujamalik-ebi @kasprzyk-sz I guess there is confusion with the long/short description requirement - We don't need any search option for description, the requirement is to show or hide long/short descriptions in the block or which description to use for display they can use long or they can use short description for display. E.g below screenshot - by default currently it takes long description, so we need to give option in block to choose.

Screenshot 2024-09-03 at 12 32 42

@kasprzyk-sz
Copy link
Contributor

kasprzyk-sz commented Sep 3, 2024

Thanks for clarifying @sandykadam . Shouldn't the query be then something like filter-field-contains[field_description]=short/long?

@sandykadam
Copy link
Collaborator Author

You can hide the field by hide flag, @mshujamalik-ebi give him example of show/hide field for description. @kasprzyk-sz similar to how we do for profile block where we can show hide position/phone etc

@kasprzyk-sz
Copy link
Contributor

Thanks!

@mshujamalik-ebi could you look into keyword search and sorting?

@sandykadam should it be possible to combine the parameters like search by title AND team or search by title OR team?

@mshujamalik-ebi
Copy link

mshujamalik-ebi commented Sep 4, 2024

@kasprzyk-sz The sorting is done on changed DESC by default,if you try ASC then it changes the result.
https://www.embl.org/api/v1/pattern.html?source=contenthub&filter-content-type=data_resource&pattern=vf-summary-image&sort-field-value[changed]=ASC
For keywords,there is a field for keywords and it seems empty for all contents.
Also the description field is the default result displays long description ,for short description the url is below.
https://dev.content.embl.org/api/v1/pattern.html?hide[body]&source=contenthub&filter-content-type=data_resource&pattern=vf-summary-image
Currently present on dev only,need to move on prod.

@kasprzyk-sz
Copy link
Contributor

kasprzyk-sz commented Sep 4, 2024

Many thanks @mshujamalik-ebi!

For the sorting, is it supposed to be sorted alphabetically based on the title?
In this example, the results seem to be still a bit random: https://www.embl.org/api/v1/pattern.html?source=contenthub&filter-content-type=data_resource&pattern=vf-summary-image&sort-field-value[changed]=ASC

@sandykadam does it make sense to keep the keyword search then?

@sandykadam
Copy link
Collaborator Author

sandykadam commented Sep 4, 2024

Thanks!

@mshujamalik-ebi could you look into keyword search and sorting?

@sandykadam should it be possible to combine the parameters like search by title AND team or search by title OR team?

search by title, keyword should be OR like dropdown and team should be separate

@kasprzyk-sz also use "EMBL Teams" taxonomy to populate teams dropdown, so user can select team from dropdown and you can pass the team ID to API, @mshujamalik-ebi will give you example on how to use BDR ID to be used in pattern html of data-resources

Below is screenshot of ID which we already storing in "EMBL Teams" taxonomy.

Screenshot 2024-09-04 at 15 29 13

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

No branches or pull requests

3 participants