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

fix #9098 dashboard filter capabilities #9514

Merged

Conversation

MV88
Copy link
Contributor

@MV88 MV88 commented Sep 28, 2023

Description

Added the possibility to add spatial filter during creation of certain of widgets (charts, table, counter)

Please check if the PR fulfills these requirements

What kind of change does this PR introduce? (check one with "x", remove the others)

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Other... Please describe:

Issue

What is the current behavior?

fix #9098 dashboard filter capabilities

What is the new behavior?

Breaking change

Does this PR introduce a breaking change? (check one with "x", remove the other)

  • Yes, and I documented them in migration notes
  • No

Other useful information

@MV88 MV88 added this to the 2023.02.00 milestone Sep 28, 2023
@MV88 MV88 self-assigned this Sep 28, 2023
@tdipisa tdipisa requested a review from offtherailz September 28, 2023 13:06
@MV88 MV88 modified the milestones: 2023.02.00, 2024.01.00 Sep 28, 2023
Copy link
Member

@offtherailz offtherailz left a comment

Choose a reason for hiding this comment

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

There are too few differences between the QueryPanel plugin and QueryPanelWithMap, not enough to create 2 distinct plugins.
Keep them separated will required too much maintainance and testing. So please try to properly unify them.
If you need help with it, we can check. The condition of using or not using the map could be to check the presence of the map plugin or via configuration.

Note: I didn't tested it fully because I'd like to spend this time when the full plugin is ready.

Anyway my first test was failing. In particuar The map is blank ( tested with http://localhost:8081/#/dashboard/21694 connected to dev env )

screencast-localhost_8081-2023.10.09-10_47_12.webm

So please always double check:

  • You committed everything, and do a final test before to ask for reviw
  • You didn't committed anything in excess (e.g. wrong / unnecessary indentation changes of some files not involved and so on.

web/client/utils/WidgetsUtils.js Outdated Show resolved Hide resolved
web/client/plugins/queryPanelWithMap/SpatialFilter.jsx Outdated Show resolved Hide resolved
web/client/plugins/queryPanelWithMap/SmartQueryForm.jsx Outdated Show resolved Hide resolved
web/client/components/data/query/QueryBuilder.jsx Outdated Show resolved Hide resolved
web/client/components/data/query/SpatialFilter.jsx Outdated Show resolved Hide resolved
web/client/epics/dashboard.js Outdated Show resolved Hide resolved
web/client/epics/dashboard.js Outdated Show resolved Hide resolved
web/client/epics/dashboard.js Outdated Show resolved Hide resolved
web/client/epics/widgets.js Outdated Show resolved Hide resolved
@MV88
Copy link
Contributor Author

MV88 commented Oct 9, 2023

There are too few differences between the QueryPanel plugin and QueryPanelWithMap, not enough to create 2 distinct plugins. Keep them separated will required too much maintainance and testing.

ok, but you asked me to separate them from the start and we also discussed that creating it's own plugin for the dashboard with a different behaviour was fine (initially). now I will merge them even if the reason of the splitting was due to the different connect function and the map component included.

Also one big difference is the one has the map state that works and interact with it, the one in dashboard don't and needs another map object to work, plus the original QueryPanel does not need and internal mal component to be rendered. also on a style point of view this has to be handled properly

So please try to properly unify them. If you need help with it, we can check. The condition of using or not using the map could be to check the presence of the map plugin or via configuration.

Imo the condition of showing it should not be the Map plugin presence, but it should be driven by the object map being populated or not, which what is present now.

Note: I didn't tested it fully because I'd like to spend this time when the full plugin is ready.

Anyway my first test was failing. In particuar The map is blank ( tested with http://localhost:8081/#/dashboard/21694 connected to dev env )

screencast-localhost_8081-2023.10.09-10_47_12.webm
So please always double check:

will check

  • You committed everything, and do a final test before to ask for review

will check

  • You didn't committed anything in excess (e.g. wrong / unnecessary indentation changes of some files not involved and so on.

I mean you can close an eye if I reorder a bit some of the imported packages. this is not going to create conflicts and if it so it is something very naive to resolve.

@MV88 MV88 requested a review from offtherailz October 10, 2023 16:03
Copy link
Member

@offtherailz offtherailz left a comment

Choose a reason for hiding this comment

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

I reorganized a little bit the components.

  • I moved the useEmbeddedMap to properties to toolsOptions and documented in JSDOC
  • Now we have another target in querypanel called "map". The map is rendered there through the SpatialFilterMap component, if toolsOptions.useEmbeddedMap=== true. I also documented this propertly
  • The SpatialFilter component will render one or the other component, with the proper connections, depending on the toolsOptions.useEmbeddedMap, removing all the duplications that may confuse and be hard to maintain.
  • viewport option do not work/ is not updated.

Everything works as before, it looks, anyway I see some errors in the tests of querypanel I didn't expect after this change. I'd like to take a look at that test failure later.

  • The issue I noticed (also before my changes) is that if you try to edit the spatial filter (clicking on the pencil), the modification to bbox coordinates or radius/center of circle are not updated to the map.
  • See also the comments inline.

web/client/themes/default/less/dashboard.less Outdated Show resolved Hide resolved
@MV88
Copy link
Contributor Author

MV88 commented Oct 12, 2023

@offtherailz please review again

viewport option do not work/ is not updated.

removed this option

The issue I noticed (also before my changes) is that if you try to edit the spatial filter (clicking on the pencil), the modification to bbox coordinates or radius/center of circle are not updated to the map.

fixed with calculation fo correct zoom in the epic

it was not redrawing the filter

fixed with onMapReady that triggers initQueryPanel

Examples

2.-.demo.spatial.filtering.mp4
3.-.demo.spatial.filtering.and.viewport.dependency.mp4

@MV88
Copy link
Contributor Author

MV88 commented Oct 12, 2023

ah i have added also this part to the migration guidelines

image

MV88 and others added 3 commits October 13, 2023 12:11
Co-authored-by: Lorenzo Natali <lorenzo.natali@geosolutionsgroup.com>
Co-authored-by: Lorenzo Natali <lorenzo.natali@geosolutionsgroup.com>
Co-authored-by: Lorenzo Natali <lorenzo.natali@geosolutionsgroup.com>
MV88 and others added 3 commits October 13, 2023 12:51
Co-authored-by: Lorenzo Natali <lorenzo.natali@geosolutionsgroup.com>
@MV88 MV88 requested a review from offtherailz October 13, 2023 11:40
Co-authored-by: Lorenzo Natali <lorenzo.natali@geosolutionsgroup.com>
@MV88
Copy link
Contributor Author

MV88 commented Oct 13, 2023

@offtherailz can you approve now?

@offtherailz offtherailz merged commit 6856256 into geosolutions-it:master Oct 13, 2023
4 checks passed
@MV88
Copy link
Contributor Author

MV88 commented Oct 13, 2023

@ElenaGallo please test it in DEV

@ElenaGallo
Copy link
Contributor

ElenaGallo commented Oct 16, 2023

Hi @MV88 I found two issues that also concern the Attribute Filter option, @tdipisa it is better to open a new issue for these?

  • The Attribute filter and Area of interest do not interact with each other and cannot be used at the same time. Use this dashboard
two.filter.mp4
  • The Attribute filter is not visible on the filter map
    filter map

@tdipisa
Copy link
Member

tdipisa commented Oct 16, 2023

@ElenaGallo thank you. I double checked and I can confirm these two issues. @ElenaGallo please create a new dedicated issue with same labels to be assigned to @MV88.

@ElenaGallo
Copy link
Contributor

@tdipisa new issue here: #9605

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

Successfully merging this pull request may close these issues.

Improving filtering capabilities for widgets
4 participants