-
Notifications
You must be signed in to change notification settings - Fork 893
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
Filter Saved Query by supported language #8325
Conversation
❌ Empty Changelog SectionThe Changelog section in your PR description is empty. Please add a valid changelog entry or entries. If you did add a changelog entry, check to make sure that it was not accidentally included inside the comment block in the Changelog section. |
Signed-off-by: Suchit Sahoo <suchsah@amazon.com>
4494b59
to
728fde5
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #8325 +/- ##
==========================================
- Coverage 64.14% 64.14% -0.01%
==========================================
Files 3743 3743
Lines 88843 88851 +8
Branches 13855 13858 +3
==========================================
+ Hits 56987 56991 +4
- Misses 31241 31245 +4
Partials 615 615
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
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.
Nice changes! Just some non-blocking comments, otherwise LGTM
return ( | ||
languageService?.getLanguage(languageId)?.supportedAppNames?.includes(currentAppId) ?? | ||
true | ||
); |
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.
nit: Do we just need the parenthesis here? Or could it just be
return languageService?.getLanguage(languageId)?.supportedAppNames?.includes(currentAppId) ?? true;
(await application?.currentAppId$?.pipe(first()).toPromise()) ?? Promise.resolve(undefined); | ||
const languageService = queryStringManager?.getLanguageService(); | ||
|
||
// Filtering saved queries based on language supported by cirrent application |
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.
nit:
// Filtering saved queries based on language supported by cirrent application | |
// Filtering saved queries based on language supported by current application |
queries = queries.filter((query) => { | ||
const languageId = query.attributes.query.language; | ||
return ( | ||
languageService?.getLanguage(languageId)?.supportedAppNames?.includes(currentAppId) ?? |
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.
nit: Will languageService
ever not have getLanguage()
?
@@ -41,7 +43,9 @@ type SerializedSavedQueryAttributes = SavedObjectAttributes & | |||
}; | |||
|
|||
export const createSavedQueryService = ( |
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.
we should add a back log item to extend this service. i think at one point we were going to have a toggle to save the query with or without the dataset. which id imagine that is something we would want since in the past the saved query wouldn't replace the selected dataset (index pattern) it would just replace the current query
lgtm its for 2.18 correct? |
Signed-off-by: Suchit Sahoo <suchsah@amazon.com> (cherry picked from commit 33f4f64) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
(cherry picked from commit 33f4f64) Signed-off-by: Suchit Sahoo <suchsah@amazon.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>
…pensearch-project#8356) (cherry picked from commit 33f4f64) Signed-off-by: Suchit Sahoo <suchsah@amazon.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>
Signed-off-by: Sean Li <lnse@amazon.com>
Signed-off-by: Sean Li <lnse@amazon.com>
* Adding recent datasets to dataset selector Signed-off-by: Sean Li <lnse@amazon.com> * addressing comments, adding tests Signed-off-by: Sean Li <lnse@amazon.com> * moving recent datasets to fetched datasets Signed-off-by: Sean Li <lnse@amazon.com> * mocking UI settings for test Signed-off-by: Sean Li <lnse@amazon.com> * fixing connect_to_query_state.test Signed-off-by: Sean Li <lnse@amazon.com> * fixing sync_state_with_url test Signed-off-by: Sean Li <lnse@amazon.com> * adding recent datasets to session storage Signed-off-by: Sean Li <lnse@amazon.com> * fixing cache bug, improving code structure Signed-off-by: Sean Li <lnse@amazon.com> * adding i18n translation for group labels Signed-off-by: Sean Li <lnse@amazon.com> * updating mock Signed-off-by: Sean Li <lnse@amazon.com> * updating state sync tests and fixing typos in #8325 Signed-off-by: Sean Li <lnse@amazon.com> * fixing dataset selector test Signed-off-by: Sean Li <lnse@amazon.com> * fixing index test Signed-off-by: Sean Li <lnse@amazon.com> --------- Signed-off-by: Sean Li <lnse@amazon.com>
* Adding recent datasets to dataset selector Signed-off-by: Sean Li <lnse@amazon.com> * addressing comments, adding tests Signed-off-by: Sean Li <lnse@amazon.com> * moving recent datasets to fetched datasets Signed-off-by: Sean Li <lnse@amazon.com> * mocking UI settings for test Signed-off-by: Sean Li <lnse@amazon.com> * fixing connect_to_query_state.test Signed-off-by: Sean Li <lnse@amazon.com> * fixing sync_state_with_url test Signed-off-by: Sean Li <lnse@amazon.com> * adding recent datasets to session storage Signed-off-by: Sean Li <lnse@amazon.com> * fixing cache bug, improving code structure Signed-off-by: Sean Li <lnse@amazon.com> * adding i18n translation for group labels Signed-off-by: Sean Li <lnse@amazon.com> * updating mock Signed-off-by: Sean Li <lnse@amazon.com> * updating state sync tests and fixing typos in #8325 Signed-off-by: Sean Li <lnse@amazon.com> * fixing dataset selector test Signed-off-by: Sean Li <lnse@amazon.com> * fixing index test Signed-off-by: Sean Li <lnse@amazon.com> --------- Signed-off-by: Sean Li <lnse@amazon.com> (cherry picked from commit 464ef56) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
* Adding recent datasets to dataset selector Signed-off-by: Sean Li <lnse@amazon.com> * addressing comments, adding tests Signed-off-by: Sean Li <lnse@amazon.com> * moving recent datasets to fetched datasets Signed-off-by: Sean Li <lnse@amazon.com> * mocking UI settings for test Signed-off-by: Sean Li <lnse@amazon.com> * fixing connect_to_query_state.test Signed-off-by: Sean Li <lnse@amazon.com> * fixing sync_state_with_url test Signed-off-by: Sean Li <lnse@amazon.com> * adding recent datasets to session storage Signed-off-by: Sean Li <lnse@amazon.com> * fixing cache bug, improving code structure Signed-off-by: Sean Li <lnse@amazon.com> * adding i18n translation for group labels Signed-off-by: Sean Li <lnse@amazon.com> * updating mock Signed-off-by: Sean Li <lnse@amazon.com> * updating state sync tests and fixing typos in opensearch-project#8325 Signed-off-by: Sean Li <lnse@amazon.com> * fixing dataset selector test Signed-off-by: Sean Li <lnse@amazon.com> * fixing index test Signed-off-by: Sean Li <lnse@amazon.com> --------- Signed-off-by: Sean Li <lnse@amazon.com>
* Adding recent datasets to dataset selector Signed-off-by: Sean Li <lnse@amazon.com> * addressing comments, adding tests Signed-off-by: Sean Li <lnse@amazon.com> * moving recent datasets to fetched datasets Signed-off-by: Sean Li <lnse@amazon.com> * mocking UI settings for test Signed-off-by: Sean Li <lnse@amazon.com> * fixing connect_to_query_state.test Signed-off-by: Sean Li <lnse@amazon.com> * fixing sync_state_with_url test Signed-off-by: Sean Li <lnse@amazon.com> * adding recent datasets to session storage Signed-off-by: Sean Li <lnse@amazon.com> * fixing cache bug, improving code structure Signed-off-by: Sean Li <lnse@amazon.com> * adding i18n translation for group labels Signed-off-by: Sean Li <lnse@amazon.com> * updating mock Signed-off-by: Sean Li <lnse@amazon.com> * updating state sync tests and fixing typos in opensearch-project#8325 Signed-off-by: Sean Li <lnse@amazon.com> * fixing dataset selector test Signed-off-by: Sean Li <lnse@amazon.com> * fixing index test Signed-off-by: Sean Li <lnse@amazon.com> --------- Signed-off-by: Sean Li <lnse@amazon.com>
Description
This PR aims at filtering Saved Queries on the basis of language.
Issues Resolved
Screenshot
In Discover that supports additional SQL and PPL languages
In Visualize page where we only support DQL, other language Saved Queries are filtered
Testing the changes
Changelog
Check List
yarn test:jest
yarn test:jest_integration