Skip to content

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

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

Open
wants to merge 19 commits into
base: alpha
Choose a base branch
from

Conversation

guisoares1
Copy link
Contributor

@guisoares1 guisoares1 commented Oct 27, 2023

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)
  • 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?

  • 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 )

  • * I have set myself as assignee of the pull request
  • * My code follows the style guidelines of this project
  • * Linting does not generate new warnings
  • * I have performed a self-review of my own code
  • * I have put the ticket for review, adding the oort-frontend team to the list of reviewers
  • * I have commented my code, particularly in hard-to-understand areas
  • * I have put JSDoc comment in all required places
  • * My changes generate no new warnings
  • * I have included screenshots describing my changes if relevant
  • * 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 guisoares1 self-assigned this Oct 27, 2023
@guisoares1 guisoares1 added the enhancement New feature or request label Oct 27, 2023
@guisoares1 guisoares1 requested a review from a team November 7, 2023 21:25
@guisoares1 guisoares1 marked this pull request as ready for review November 7, 2023 21:28
@Maximo-reliefapps Maximo-reliefapps self-requested a review November 15, 2023 08:47
Copy link
Contributor

@Maximo-reliefapps Maximo-reliefapps left a comment

Choose a reason for hiding this comment

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

The new filter is working as expected in the maps, summary cards and grids.
But the chart filter doesn't load any of the properties of your resource.

I made sure the issue wasn't coming from using an aggregation instead of a layout, but it's working on the other widgets.

I would recommend to find a way to have all the logic to set the dataFilter variable in the same place, so you can reuse the same code in all widgets and avoid specific issues.

@AntoineRelief AntoineRelief changed the base branch from beta to alpha December 6, 2023 16:32
@guisoares1
Copy link
Contributor Author

Adjustments made:

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

…dd missing subscription logic teardowns refactor: remove not necessary properties and imports for ngx-monaco editor refactor: query build filter method in order to avoid the use of promises and have a more clear and readable code fix: remove {{filter.}} value check for the inject dashboard method as with the new filter builder user won't use/need this feature any more
@unai-reliefapp
Copy link
Contributor

@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 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants