-
Notifications
You must be signed in to change notification settings - Fork 917
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
[MDS] Refactor several utility functions in data source plugin #6417
Comments
Thank you for continuous improvement and insist on high standards. |
@huyaboo Should we target this for 2.16 instead? |
Unlike "decideClient" that will be used by many internal and external plugins, where plugins need to choose the correct client to talk to either local cluster, or data source cluster, for "fetchDataSourceIdByName", I don't think it's necessary to make it a util in data source plugin, because
OpenSearch-Dashboards/src/plugins/vis_type_timeline/server/lib/fetch_data_source_id.ts Lines 38 to 41 in 4f54049
|
Hi @zhongnansu Is this complete? Can we close the issue? |
Yes, closing |
Is your feature request related to a problem? Please describe.
Currently, there are two functions being repeated in plugins that can simply be extracted into data source plugin utility functions:
Describe the solution you'd like
There should be three utility functions placed in the data source plugin that will be exposed so that other plugins can consume:
decideClient(context: RequestHandlerContext, dataSourceId?: string, withLongNumeralsSupport: boolean)
: return the correct clientdecideLegacyClient(context: RequestHandlerContext, dataSourceId?: string)
: return the correct legacy clientfetchDataSourceNameById(client: SavedObjectsClientCommon, dataSourceTitle: string)
: return the data source id (if it exists)SavedObjectClientWrapper
should be defined in bothpublic
andserver
folders for passing type checksDescribe alternatives you've considered
N/A
Additional context
N/A
The text was updated successfully, but these errors were encountered: