Support injecting DataStructureMeta from QueryEditorExtensions for Query Assist#7871
Conversation
Signed-off-by: Joshua Li <joshuali925@gmail.com>
Signed-off-by: Joshua Li <joshuali925@gmail.com>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #7871 +/- ##
==========================================
- Coverage 64.22% 64.21% -0.02%
==========================================
Files 3672 3673 +1
Lines 81152 81175 +23
Branches 12938 12940 +2
==========================================
+ Hits 52121 52127 +6
- Misses 25822 25840 +18
+ Partials 3209 3208 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Signed-off-by: Joshua Li <joshuali925@gmail.com>
5a88864 to
555c299
Compare
ashwin-pc
left a comment
There was a problem hiding this comment.
The code looks good. Looks like you have a failing unit test though.
| * @returns list of query assist supported languages for the given data source. | ||
| */ | ||
| const getAvailableLanguagesForDataSource = (() => { | ||
| const availableLanguagesByDataSource: Map<string | undefined, string[]> = new Map(); |
There was a problem hiding this comment.
Not a blocker but can we add some tests for this function?
| * @param selectDataSourceId - function to get data source id given a data structure | ||
| * @returns data structures with meta | ||
| */ | ||
| export const injectMetaToDataStructures = async ( |
There was a problem hiding this comment.
@ashwin-pc are we sure we don't want to do convert the dataset config to a class.
I was thinking it would be similar to the the interceptor class:
This way we don't have to ensure developers import this in their configs.
@joshuali925 could implement this in the base class and then it would be available for classes that extend the base class
There was a problem hiding this comment.
agree. will think about it later, right now just trying to add instead of refactor..
|
|
||
| data.__enhance({ | ||
| ui: { | ||
| editor: { |
There was a problem hiding this comment.
sorry about that. Thanks for fixing.
…r Query Assist (#7871) * fix query editor extensions enhance key Signed-off-by: Joshua Li <joshuali925@gmail.com> * add query assist icons to clusters if available Signed-off-by: Joshua Li <joshuali925@gmail.com> * allow custom icon for `DATA_STRUCTURE_META_TYPES.FEATURE` Signed-off-by: Joshua Li <joshuali925@gmail.com> * Changeset file for PR #7871 created/updated --------- Signed-off-by: Joshua Li <joshuali925@gmail.com> Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com> Co-authored-by: Ashwin P Chandran <ashwinpc@amazon.com> (cherry picked from commit 9bc2433) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
…r Query Assist (#7871) (#7888) * fix query editor extensions enhance key * add query assist icons to clusters if available * allow custom icon for `DATA_STRUCTURE_META_TYPES.FEATURE` * Changeset file for PR #7871 created/updated --------- (cherry picked from commit 9bc2433) Signed-off-by: Joshua Li <joshuali925@gmail.com> Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com> Co-authored-by: Ashwin P Chandran <ashwinpc@amazon.com>
Description
TODO items:
OpenSearch-Dashboards/src/plugins/data/common/datasets/types.ts
Lines 137 to 161 in 73339c5
typetoTYPE, which should be "metadata for dataset type". But for extensions I thinkFEATUREwould make more sense. Is it on purpose to only support built-in OUI icons forFEATURE?CUSTOM, is it intentional to not support icons for it?Issues Resolved
Screenshot
Testing the changes
Changelog
DataStructureMetafromQueryEditorExtensionsfor Query AssistCheck List
yarn test:jestyarn test:jest_integration