Dynamic filter for collections

Created on 31 October 2024, 10 months ago

Problem/Motivation

In a project I’m working on, we had a requirement to implement a dynamic filter for collections that updates instantly and reflects the latest data. I’m not sure if this will be useful for others, but I’m sharing my approach in case it might help. I’m open to any suggestions or feedback.

Summary

After reviewing the Widen API documentation (Collections API Reference), examining the module’s functionality, and finding the search prefix acn:(), I decided to build on the existing module to handle this as a feature.

Implementation Details

Method Addition in AcquiaDamClient:
I created a new function, getCollections, in the AcquiaDamClient class. This function retrieves the latest list of collections from the Widen API, ensuring the data is up-to-date.

CollectionFilter Plugin: I added a CollectionFilter filter plugin that dynamically fills filter options in getValueOptions directly from getCollections. This approach ensures that the filter options are always current, meeting our project’s requirement for real-time updates.

Feature request
Status

Active

Version

1.1

Component

Code

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @Ricardo García
  • Merge request !83#3484967 – Filter for collections → (Open) created by Ricardo García
  • Pipeline finished with Success
    10 months ago
    Total: 1706s
    #326224
  • First commit to issue fork.
  • Pipeline finished with Success
    5 months ago
    Total: 2236s
    #452444
  • Pipeline finished with Success
    about 1 month ago
    Total: 2545s
    #555598
  • Status changed to Needs review about 1 month ago
  • 🇮🇳India rajeshreeputra Pune

    Requesting review.

  • 🇮🇳India rajeshreeputra Pune

    @japerry do we need to add the collection filter in the view? and update hook for existing customers/users?

  • 🇺🇸United States japerry KVUO

    Yah, I think if it can be added to the view without messing up the other filters, then lets do that. Unfortunately that also means more review time needed VS just putting up the api calls in the current MR, which really is harmless since you'd intentionally want to use it.

  • 🇮🇳India rajeshreeputra Pune

    I understand your point, whoever wants to use the collection filter can simply add it to view, since not everyone may need it. Hence we can probably merge this without adding the collection filter in the view.

  • Pipeline finished with Success
    5 days ago
    #576658
Production build 0.71.5 2024