-
Notifications
You must be signed in to change notification settings - Fork 8.1k
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
[Maps] keep local metrics editor state and only submit metrics to redux store when valid #84828
Conversation
…s state when valid
Pinging @elastic/kibana-gis (Team:Geo) |
@elasticmachine merge upstream |
@elasticmachine merge upstream |
@elasticmachine merge upstream |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thx for the refactor. this is a really nice pattern, and should remember it going forward for all our forms, not to try and clutter redux-store with invalid state.
x-pack/plugins/maps/public/components/metrics_editor/metric_editor.tsx
Outdated
Show resolved
Hide resolved
@elasticmachine merge upstream |
💚 Build SucceededMetrics [docs]Async chunks
Distributable file count
History
To update your PR or re-run it, just comment with: |
…ux store when valid (elastic#84828) * [Maps] keep invalid metrics editor state local and only submit metrics state when valid * review feedback Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
…ux store when valid (#84828) (#85437) * [Maps] keep invalid metrics editor state local and only submit metrics state when valid * review feedback Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Help remove edge cases that #83586 has to handle by only pushing valid metrics to redux instead of pushing all metric state changes to redux.
For example, prior to this PR, redux would get updated twice, the first time with invalid state.
Change aggregation type from 'count' to 'avg'
push redux with invalid metric { type: 'avg' }
Select field
push redux with metric { type: 'avg', field: 'my field' }
With this PR, now there is only a single redux state change
Change aggregation type from 'count' to 'avg'
update local state with metric { type: 'avg' }
Select field
update local state with metric { type: 'avg', field: 'my field' }
push local state to redux state