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

[Canvas] Fix elements not being updated properly when filter is changed on workpad #81863

Merged
merged 5 commits into from
Nov 6, 2020

Conversation

poffdeluxe
Copy link
Contributor

@poffdeluxe poffdeluxe commented Oct 27, 2020

Summary

When new handlers are created after an element is updated, we need to make sure they get passed to the renderer functions. Before this PR, having a copy of the old handlers caused elements to use outdated filter values. The fix in this PR updates the handlers used by the render functions only when it actually changes.

I'm also adding a new canvas functional test where we attempt to change a dropdown filter and a time filter and we check that they successfully change the filter being passed to the debug filter element

BEFORE

AFTER

Checklist

For maintainers

@poffdeluxe poffdeluxe added release_note:fix loe:medium Medium Level of Effort v8.0.0 impact:high Addressing this issue will have a high level of impact on the quality/strength of our product. Feature:Canvas v7.10.1 v7.11 labels Oct 27, 2020
@poffdeluxe poffdeluxe requested a review from a team as a code owner October 27, 2020 22:31
@poffdeluxe poffdeluxe added the Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas label Oct 27, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-canvas (Team:Canvas)

@timroes timroes added v7.11.0 and removed v7.11 labels Oct 29, 2020
Copy link
Contributor

@crob611 crob611 left a comment

Choose a reason for hiding this comment

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

Yes! Nice work fixing and getting that test in there 👍

@poffdeluxe
Copy link
Contributor Author

@elasticmachine merge upstream

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

async chunks size

id before after diff
canvas 1.3MB 1.3MB -294.0B

page load bundle size

id before after diff
canvas 908.8KB 908.9KB +88.0B

History

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

@poffdeluxe poffdeluxe merged commit 0e8985c into elastic:master Nov 6, 2020
@poffdeluxe poffdeluxe deleted the bug/time-filter-update branch November 6, 2020 16:41
poffdeluxe added a commit to poffdeluxe/kibana that referenced this pull request Nov 6, 2020
…ed on workpad (elastic#81863)

* Update renderer handlers when element is changed

* Update handlers before render

* Add canvas functional test for filters

* Update snapshot and remove log

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
# Conflicts:
#	x-pack/plugins/canvas/canvas_plugin_src/renderers/filters/dropdown_filter/component/dropdown_filter.tsx
poffdeluxe added a commit to poffdeluxe/kibana that referenced this pull request Nov 6, 2020
…ed on workpad (elastic#81863)

* Update renderer handlers when element is changed

* Update handlers before render

* Add canvas functional test for filters

* Update snapshot and remove log

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
# Conflicts:
#	x-pack/plugins/canvas/canvas_plugin_src/renderers/filters/dropdown_filter/component/dropdown_filter.tsx
gmmorris added a commit to gmmorris/kibana that referenced this pull request Nov 9, 2020
* master: (68 commits)
  [Fleet] Make stream id unique in agent policy (elastic#82447)
  skip flaky suite (elastic#82915)
  skip flaky suite (elastic#75794)
  Copy `dateAsStringRt` to observability plugin (elastic#82839)
  [Maps] rename connected_components/map folder to mb_map (elastic#82897)
  [Security Solution] Fix EventsViewer DnD cypress tests (elastic#82619)
  [Security Solution] Adds logging and performance fan out API for threat/Indicator matching (elastic#82546)
  Implemented Alerting health status pusher by using task manager and status pooler for Kibana status plugins 'kibanahost/api/status' (elastic#79056)
  [APM] Adds new configuration 'xpack.apm.maxServiceEnvironments' (elastic#82090)
  Move single use function in line (elastic#82885)
  [ML] Add unsigned_long support to data frame analytics and anomaly detection (elastic#82636)
  Add flot_chart dependency from shared_deps to Shareable Runtime (elastic#81649)
  [Security Solution][Detections] - Auto refresh all rules/monitoring tables (elastic#82062)
  [APM] Fix apm e2e runner script commands (elastic#82798)
  [Ingest Manager] Move cache functions to from registry to archive (elastic#82871)
  Update webpack-dev-server and webpack-cli (elastic#82844)
  [Uptime] Migrate to new es client (elastic#82003)
  Move parseAndVerify* functions to validation.ts (elastic#82845)
  Remove yeoman & yo (elastic#82825)
  [Canvas] Fix elements not being updated properly when filter is changed on workpad (elastic#81863)
  ...
@kibanamachine
Copy link
Contributor

Looks like this PR has backport PRs but they still haven't been merged. Please merge them ASAP to keep the branches relatively in sync.

@kibanamachine kibanamachine added the backport missing Added to PRs automatically when the are determined to be missing a backport. label Nov 10, 2020
@kibanamachine
Copy link
Contributor

Looks like this PR has backport PRs but they still haven't been merged. Please merge them ASAP to keep the branches relatively in sync.

poffdeluxe added a commit that referenced this pull request Nov 11, 2020
…ed on workpad (#81863) (#82866)

* Update renderer handlers when element is changed

* Update handlers before render

* Add canvas functional test for filters

* Update snapshot and remove log

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
# Conflicts:
#	x-pack/plugins/canvas/canvas_plugin_src/renderers/filters/dropdown_filter/component/dropdown_filter.tsx
poffdeluxe added a commit that referenced this pull request Nov 11, 2020
…ed on workpad (#81863) (#82864)

* Update renderer handlers when element is changed

* Update handlers before render

* Add canvas functional test for filters

* Update snapshot and remove log

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
# Conflicts:
#	x-pack/plugins/canvas/canvas_plugin_src/renderers/filters/dropdown_filter/component/dropdown_filter.tsx
@kibanamachine kibanamachine removed the backport missing Added to PRs automatically when the are determined to be missing a backport. label Nov 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Canvas impact:high Addressing this issue will have a high level of impact on the quality/strength of our product. loe:medium Medium Level of Effort release_note:fix Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas v7.10.1 v7.11.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants