Skip to content

fixing region map click filter#61949

Merged
ppisljar merged 3 commits intoelastic:masterfrom
ppisljar:fix/regionMapClickFilter
Apr 8, 2020
Merged

fixing region map click filter#61949
ppisljar merged 3 commits intoelastic:masterfrom
ppisljar:fix/regionMapClickFilter

Conversation

@ppisljar
Copy link
Copy Markdown
Contributor

@ppisljar ppisljar commented Mar 31, 2020

Summary

resolves #61879

Checklist

Delete any items that are not applicable to this PR.

For maintainers

functional test should be added but i am not doing it for now as its not going to be easy (figuring out where on <canvas> do we need to click)

@ppisljar ppisljar added review Team:Visualizations Team label for Lens, elastic-charts, Graph, legacy editors (TSVB, Visualize, Timelion) t// v8.0.0 release_note:skip Skip the PR/issue when compiling release notes v7.7.0 labels Mar 31, 2020
@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/kibana-app (Team:KibanaApp)

@ppisljar ppisljar requested a review from wylieconlon March 31, 2020 10:47
Copy link
Copy Markdown
Contributor

@wylieconlon wylieconlon left a comment

Choose a reason for hiding this comment

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

The functionality is working for me, tested in the visualize editor and dashboards. I don't understand why this broke, and it makes me worry that there are under-tested areas of this code. Can a unit test trigger this select event, as well as any other events that are happening on the map? I think a unit test would be called for here.

@ppisljar
Copy link
Copy Markdown
Contributor Author

ppisljar commented Apr 1, 2020

i don't think a unit test can help, we need integration testing,

  • maps correctly emited an action trigger
  • action triggers work correctly
  • embeddable works correctly

however when maps was emitting wrong information, due to the embeddable changes and small change in data format, when emitting an action action would not fire (as rowIndex at this point was -1)

i think unit tests would very unlikely catch this

@ppisljar
Copy link
Copy Markdown
Contributor Author

ppisljar commented Apr 3, 2020

@elasticmachine merge upstream

@wylieconlon
Copy link
Copy Markdown
Contributor

@ppisljar Can you be more specific about why this broke? You wrote that it was "due to the embeddable changes and small change in data format," can you link to specific PRs? My concern is that we didn't catch this in an automated way at all, and that other code could be broken too.

@ppisljar
Copy link
Copy Markdown
Contributor Author

ppisljar commented Apr 6, 2020

#55351 in this PR we removed cellValue property from createFiltersFromEvent function. regionmap was always passing rowIndex as -1 but depending on the behaviour of passing in correct value.

@ppisljar
Copy link
Copy Markdown
Contributor Author

ppisljar commented Apr 6, 2020

@elasticmachine merge upstream

@kibanamachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

Copy link
Copy Markdown
Contributor

@wylieconlon wylieconlon left a comment

Choose a reason for hiding this comment

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

I am trying to review this carefully because I am not familiar with how filters are applied in these visualizations. It seems like I need to trace out how this code used to work, vs how it works now.

Copy link
Copy Markdown
Contributor

@wylieconlon wylieconlon left a comment

Choose a reason for hiding this comment

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

I've now understood the behavior of this change, it definitely works now.

}

this._choroplethLayer.on('select', event => {
const rowIndex = this._chartData.rows.findIndex(row => row[0] === event);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Okay, so it looks like rowIndex was always returning -1 before, and there used to be a special case for this.

@ppisljar ppisljar merged commit d212102 into elastic:master Apr 8, 2020
ppisljar added a commit to ppisljar/kibana that referenced this pull request Apr 8, 2020
ppisljar added a commit to ppisljar/kibana that referenced this pull request Apr 8, 2020
wayneseymour pushed a commit that referenced this pull request Apr 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release_note:skip Skip the PR/issue when compiling release notes review Team:Visualizations Team label for Lens, elastic-charts, Graph, legacy editors (TSVB, Visualize, Timelion) t// v7.7.0 v8.0.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Region map] Clicking a country does not add filters

4 participants