-
Notifications
You must be signed in to change notification settings - Fork 884
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
[Backport 2.x] Fix object empty check and minor perf issue in query editor extensions #7140
Conversation
#7077) Follow up for #7034, this PR - addresses #7034 (comment) - addresses #7034 (comment) - fixes render order - QueryEditorExtensions requires the container divs to be mounted first, but in the previous implementation, extensions will be mounted first and it relied on rerendering of queryEditorTopRow. Moving them into query editor fixes the render order and ensures refs are set. @AMoo-Miki I didn't use the object check `'[object Object]' !== Object.prototype.toString.call(configMap)`. I don't know what access user has, but if an attacker can arbitrarily alter `configMap`, the code will still break with something like ```tsx configMap={ new Proxy( {}, { ownKeys(target) { throw new Error('Accessing keys is not allowed.'); }, } ) } ``` Given that our code creates the config map here, I think relying on static type check is enough, but feel free to comment if otherwise. https://github.com/opensearch-project/OpenSearch-Dashboards/blob/7f0e39eb9809c95b98069cc971611edc2cbbc62b/src/plugins/data/public/ui/ui_service.ts#L31 Signed-off-by: Joshua Li <joshuali925@gmail.com> (cherry picked from commit b85e177) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
❌ Invalid Changelog HeadingThe '## Changelog' heading in your PR description is either missing or malformed. Please make sure that your PR description includes a '## Changelog' heading with proper spelling, capitalization, spacing, and Markdown syntax. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## 2.x #7140 +/- ##
=======================================
Coverage 67.59% 67.59%
=======================================
Files 3446 3446
Lines 67908 67908
Branches 11027 11027
=======================================
Hits 45904 45904
Misses 19341 19341
Partials 2663 2663
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Backport b85e177 from #7077.
Changelog