-
Notifications
You must be signed in to change notification settings - Fork 44
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
Clean console indexPatterns api error #418
Conversation
Signed-off-by: Junqiu Lei <junqiu@amazon.com>
Codecov Report
@@ Coverage Diff @@
## main #418 +/- ##
=======================================
Coverage 41.36% 41.36%
=======================================
Files 53 53
Lines 1777 1777
Branches 329 329
=======================================
Hits 735 735
Misses 1014 1014
Partials 28 28 |
// @ts-ignore | ||
const newIndexPattern = await indexPatterns.get(selectedLayerConfig.source.indexPatternId); | ||
const newIndexPattern = await services.data.indexPatterns.get( | ||
// @ts-ignore |
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.
Is this by mistake or intentional? having comment inside method parameter seems weird.
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.
Intentional for the below line
@@ -241,8 +241,10 @@ export const MapContainer = ({ | |||
(indexPattern) => indexPattern.id === selectedLayerConfig.source.indexPatternId | |||
); | |||
if (!findIndexPattern) { | |||
// @ts-ignore | |||
const newIndexPattern = await indexPatterns.get(selectedLayerConfig.source.indexPatternId); | |||
const newIndexPattern = await services.data.indexPatterns.get( |
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.
I just couldn't match commit message and this code change.
Correct indexPatterns api from services.data.indexPatterns to clean browser console error.
but the code is changing indexPatterns to services.data.indexPatterns
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.
The method is used to update layersIndexPatterns which is only used in top nav comment as a requirement prop, but no use there currently(it's mainly used for global filter, we don't support yet).
It used to be passed in by:
const {
data: { indexPatterns },
} = services;
so it's the reason we change from indexPatterns
to services.data.indexPatterns
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.
Got it. So it is Use indexPatterns api from services.data.indexPatterns to clean browser console error.
Signed-off-by: Junqiu Lei <junqiu@amazon.com> (cherry picked from commit 485ef36)
Signed-off-by: Junqiu Lei <junqiu@amazon.com> (cherry picked from commit 485ef36)
Description
Use indexPatterns api from services.data.indexPatterns to clean browser console error
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.