-
Notifications
You must be signed in to change notification settings - Fork 916
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
[Multiple Datasource] Create examples about how to consume data source components #6302
Conversation
Signed-off-by: Lu Yu <nluyu@amazon.com>
Signed-off-by: Lu Yu <nluyu@amazon.com>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #6302 +/- ##
==========================================
- Coverage 67.51% 67.49% -0.03%
==========================================
Files 3376 3376
Lines 65783 65783
Branches 10637 10637
==========================================
- Hits 44415 44401 -14
- Misses 18785 18798 +13
- Partials 2583 2584 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
*/ | ||
import React from 'react'; | ||
import ReactDOM from 'react-dom'; | ||
import { DataSourcePluginSetup } from 'src/plugins/data_source/public'; |
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.
Should we use the relative path for the import?
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.
examples/multiple_data_source_examples/public/components/data_source_list_active_example.tsx
Outdated
Show resolved
Hide resolved
examples/multiple_data_source_examples/public/components/data_source_list_all_example.tsx
Outdated
Show resolved
Hide resolved
const DataSourceMenu = dataSourceManagement.ui.getDataSourceMenu<DataSourceSelectableConfig>(); | ||
const [selectedDataSources, setSelectedDataSources] = useState<string[]>([]); | ||
|
||
const data: ComponentProp[] = [ |
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.
Several files use the exact same constant data. Is it possible to simplify it so that the same content doesn't need to be copied in each file?
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.
The data array content is different for each component
examples/multiple_data_source_examples/public/components/data_source_selectable_example.tsx
Outdated
Show resolved
Hide resolved
pages: PageDef[]; | ||
}; | ||
|
||
const Nav = withRouter(({ history, pages }: NavProps) => { |
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.
if use Route component, probably don't need withRouter
here
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.
withRouter is different from Router component https://v5.reactrouter.com/web/api/withRouter
examples/multiple_data_source_examples/opensearch_dashboards.json
Outdated
Show resolved
Hide resolved
Signed-off-by: Lu Yu <nluyu@amazon.com>
We're missing a CHANGELOG entry here |
…e components (#6302) * fix lint error Signed-off-by: Lu Yu <nluyu@amazon.com> * show useMemo Signed-off-by: Lu Yu <nluyu@amazon.com> * address comments Signed-off-by: Lu Yu <nluyu@amazon.com> --------- Signed-off-by: Lu Yu <nluyu@amazon.com> Co-authored-by: ZilongX <99905560+ZilongX@users.noreply.github.com> (cherry picked from commit c0e8d4a) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
…e components (#6302) (#6331) * fix lint error * show useMemo * address comments --------- (cherry picked from commit c0e8d4a) Signed-off-by: Lu Yu <nluyu@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> Co-authored-by: ZilongX <99905560+ZilongX@users.noreply.github.com>
Description
This change adds examples about how to configure the following components from data source management plugin:
At the same time, there is one example shows how to configure the TopNavMenu to mount the data source component
Issues Resolved
Fixes #6275
Screenshot
examples.mp4
Testing the changes
The following was performed in the recording
Multiple Data source Integration
Check List
yarn test:jest
yarn test:jest_integration