ems-frontend icon indicating copy to clipboard operation
ems-frontend copied to clipboard

Ab#78019 changing the context filter to use the filter builder

Open guisoares1 opened this issue 2 years ago • 2 comments

Description

The purpose of the ticket was to implement the filter-builder in place of the JSON builder within the 'shared-contextual-filters-settings' component. My goal was to maintain the same variable that previously stored the filter as the one responsible for receiving the result from the filter-builder, aiming to minimize the impact of the changes on the system. With that said, I will describe below how the implementation is functioning:

  • Inside 'shared-contextual-filters-settings,' I prepare a variable responsible for retrieving the information selected by the user in the filter-builder.
  • The 'shared-filter-builder' component was created to handle necessary situations before calling the existing component that creates the filter.
  • In the calls to 'shared-contextual-filters-settings,' it was necessary to create a variable that stores information needed for the process.
  • I am assuming that the filter field for all forms calling the 'contextual-filters-settings' component is 'contextFilters.'
  • To apply the filter, I require at least one resource linked to the dashboard, as it follows an existing filter builder pattern.

Useful links

Type of change

Please delete options that are not relevant.

  • [ ] Bug fix (non-breaking change which fixes an issue)
  • [ ] New feature (non-breaking change which adds functionality)
  • [X] Improvement (refactor or addition to existing functionality)
  • [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • [ ] This change requires a documentation update

How Has This Been Tested?

  • [X] A dashboard was created, and a resource and layout were added. Fields were included in this layout.

Screenshots

bandicam-2023-11-07-17-46-45-783

Checklist:

( * == Mandatory )

  • [X] * I have set myself as assignee of the pull request
  • [X] * My code follows the style guidelines of this project
  • [X] * Linting does not generate new warnings
  • [X] * I have performed a self-review of my own code
  • [X] * I have put the ticket for review, adding the oort-frontend team to the list of reviewers
  • [X] * I have commented my code, particularly in hard-to-understand areas
  • [X] * I have put JSDoc comment in all required places
  • [X] * My changes generate no new warnings
  • [X] * I have included screenshots describing my changes if relevant
  • [X] * I have selected labels in the Pull Request, according to the changes with code brings
  • [ ] I have made corresponding changes to the documentation ( if required )
  • [ ] I have added tests that prove my fix is effective or that my feature works
  • [ ] New and existing unit tests pass locally with my changes
  • [ ] Any dependent changes have been merged and published in downstream modules

guisoares1 avatar Oct 27 '23 20:10 guisoares1

Adjustments made:

  • Merged the alpha branch.
  • Adjusted so that the search logic is done within the component that creates the filter.

guisoares1 avatar Dec 07 '23 21:12 guisoares1

@AntoineRelief I pushed some fixes and refactoring. Now it's working, but maybe we'll have to check deeper in all the filter flow and form logic because im sure that this can be improved.

Deleted the {{filter.}} check as with the new filter builder that won't be needed anymore, and now the context filters for widgets are correctly applied 👍

unai-reliefapp avatar Dec 22 '23 15:12 unai-reliefapp