-
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
[Discover-next] Add query editor extensions #7034
[Discover-next] Add query editor extensions #7034
Commits on Jun 14, 2024
-
[Discover-next] Add search bar extensions (opensearch-project#6894)
A search bar extension can display a UI component above the query bar. The component has the ability to read and write discover search bar states to enhance the search experience for users. The configuration is part of Query Enhancements. ```ts export interface SearchBarExtensionDependencies { /** * Currently selected index patterns. */ indexPatterns?: IIndexPattern[]; } export interface SearchBarExtensionConfig { /** * The id for the search bar extension. */ id: string; /** * Lower order indicates higher position on UI. */ order: number; /** * A function that determines if the search bar extension is enabled and should be rendered on UI. * @returns whether the extension is enabled. */ isEnabled: () => Promise<boolean>; /** * A function that returns the mount point for the search bar extension. * @param dependencies - The dependencies required for the extension. * @returns The mount point for the search bar extension. */ getComponent: (dependencies: SearchBarExtensionDependencies) => React.ReactElement; } export interface QueryEnhancement { ... searchBar?: { ... extensions?: SearchBarExtensionConfig[]; }; } Signed-off-by: Joshua Li <joshuali925@gmail.com> (cherry picked from commit e748e81)
Configuration menu - View commit details
-
Copy full SHA for 71bba11 - Browse repository at this point
Copy the full SHA 71bba11View commit details -
[Discover-next] add query assist to query enhancements plugin (opense…
…arch-project#6895) it adds query assist specific logic in query enhancements plugin to show a UI above the PPL search bar if user has configured PPL agent. Issues Resolved: opensearch-project#6820 * add query assist to query enhancements Signed-off-by: Joshua Li <joshuali925@gmail.com> * align language to uppercase Signed-off-by: Joshua Li <joshuali925@gmail.com> * pick PR 6167 Signed-off-by: Joshua Li <joshuali925@gmail.com> * use useState hooks for query assist There is a bug in data explorer `AppContainer` where memorized `DiscoverCanvas` gets unmounted after `setQuery`. PR 6167 works around it by memorizing `AppContainer`. As query assist is no longer being unmounted, we can use proper hooks to persist state now. Signed-off-by: Joshua Li <joshuali925@gmail.com> * Revert "pick PR 6167" This reverts commit acb0d41. Wait for official 6167 to merge to avoid conflict Signed-off-by: Joshua Li <joshuali925@gmail.com> * address comments for PR 6894 Signed-off-by: Joshua Li <joshuali925@gmail.com> --------- Signed-off-by: Joshua Li <joshuali925@gmail.com> (cherry picked from commit 016e0f2)
Configuration menu - View commit details
-
Copy full SHA for d90734a - Browse repository at this point
Copy the full SHA d90734aView commit details -
[Discover-next] Address comments for search bar extensions and query …
…assist (opensearch-project#6933) * pass dependencies to isEnabled func Signed-off-by: Joshua Li <joshuali925@gmail.com> * add lazy and memo to search bar extensions Signed-off-by: Joshua Li <joshuali925@gmail.com> * move ppl specific string out from query assist Signed-off-by: Joshua Li <joshuali925@gmail.com> * prevent setstate after hook unmounts Signed-off-by: Joshua Li <joshuali925@gmail.com> * add max-height to search bar extensions Signed-off-by: Joshua Li <joshuali925@gmail.com> * prevent setstate after component unmounts Signed-off-by: Joshua Li <joshuali925@gmail.com> * move ml-commons API to common/index.ts Signed-off-by: Joshua Li <joshuali925@gmail.com> * improve i18n and accessibility usages Signed-off-by: Joshua Li <joshuali925@gmail.com> * add hard-coded suggestions for sample data indices Signed-off-by: Joshua Li <joshuali925@gmail.com> --------- Signed-off-by: Joshua Li <joshuali925@gmail.com> (cherry picked from commit 4aade0f)
Configuration menu - View commit details
-
Copy full SHA for 08a81e0 - Browse repository at this point
Copy the full SHA 08a81e0View commit details -
[Discover-next] Support data sources for query assist (opensearch-pro…
…ject#6972) * disable query assist for non-default datasource Signed-off-by: Joshua Li <joshuali925@gmail.com> * disable query assist input when loading Signed-off-by: Joshua Li <joshuali925@gmail.com> * support MDS for query assist Signed-off-by: Joshua Li <joshuali925@gmail.com> * add unit tests for agents Signed-off-by: Joshua Li <joshuali925@gmail.com> * Revert "add unit tests for agents" This reverts commit 983514e. The test configs are not yet setup in query_enhancements plugins. Signed-off-by: Joshua Li <joshuali925@gmail.com> --------- Signed-off-by: Joshua Li <joshuali925@gmail.com> (cherry picked from commit 328e08e)
Configuration menu - View commit details
-
Copy full SHA for 5b2ad95 - Browse repository at this point
Copy the full SHA 5b2ad95View commit details -
SearchBar extensions depend on the currently selected dataSource, which depends on opensearch-project#6833 to be ported to main Signed-off-by: Joshua Li <joshuali925@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for 84a2013 - Browse repository at this point
Copy the full SHA 84a2013View commit details -
Signed-off-by: Joshua Li <joshuali925@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for e798287 - Browse repository at this point
Copy the full SHA e798287View commit details -
separate searchBarExtensions from queryEnhancements
To support bannar callout for query assist in un-supported languages and notify user the feature, the search bar extensions need to be enabled for all languages. Signed-off-by: Joshua Li <joshuali925@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for 8b0af9d - Browse repository at this point
Copy the full SHA 8b0af9dView commit details
Commits on Jun 17, 2024
-
refactor search bar extensions
move SearchBarExtensions to QueryEditorExtensions and change config settings from list to map. Signed-off-by: Joshua Li <joshuali925@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for edb0390 - Browse repository at this point
Copy the full SHA edb0390View commit details -
Signed-off-by: Joshua Li <joshuali925@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for 886ace5 - Browse repository at this point
Copy the full SHA 886ace5View commit details -
change query editor extension configs from map to record
Signed-off-by: Joshua Li <joshuali925@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for 7f0e39e - Browse repository at this point
Copy the full SHA 7f0e39eView commit details