-
Notifications
You must be signed in to change notification settings - Fork 870
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] Add Empty state no_data_source #6445
Conversation
Signed-off-by: yujin-emma <yujin.emma.work@gmail.com>
Signed-off-by: yujin-emma <yujin.emma.work@gmail.com>
Signed-off-by: yujin-emma <yujin.emma.work@gmail.com>
Signed-off-by: yujin-emma <yujin.emma.work@gmail.com>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #6445 +/- ##
==========================================
- Coverage 45.18% 45.17% -0.01%
==========================================
Files 1656 1657 +1
Lines 33591 33608 +17
Branches 6385 6393 +8
==========================================
+ Hits 15177 15184 +7
- Misses 17244 17246 +2
- Partials 1170 1178 +8
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: yujin-emma <yujin.emma.work@gmail.com>
src/plugins/data_source_management/public/components/no_data_source/no_data_source.tsx
Outdated
Show resolved
Hide resolved
src/plugins/data_source_management/public/components/data_source_menu/types.ts
Outdated
Show resolved
Hide resolved
src/plugins/data_source_management/public/components/data_source_menu/data_source_menu.tsx
Outdated
Show resolved
Hide resolved
Signed-off-by: yujin-emma <yujin.emma.work@gmail.com>
Signed-off-by: yujin-emma <yujin.emma.work@gmail.com>
Signed-off-by: yujin-emma <yujin.emma.work@gmail.com>
Signed-off-by: yujin-emma <yujin.emma.work@gmail.com>
Signed-off-by: yujin-emma <yujin.emma.work@gmail.com>
Signed-off-by: yujin-emma <yujin.emma.work@gmail.com>
Signed-off-by: yujin-emma <yujin.emma.work@gmail.com>
examples/multiple_data_source_examples/public/components/home.tsx
Outdated
Show resolved
Hide resolved
Signed-off-by: yujin-emma <yujin.emma.work@gmail.com>
Signed-off-by: yujin-emma <yujin.emma.work@gmail.com>
Signed-off-by: yujin-emma <yujin.emma.work@gmail.com>
@@ -63,6 +66,11 @@ export class DataSourceAggregatedView extends React.Component< | |||
this._isMounted = true; | |||
getDataSourcesWithFields(this.props.savedObjectsClient, ['id', 'title', 'auth.type']) | |||
.then((fetchedDataSources) => { | |||
if (fetchedDataSources?.length === 0) { | |||
this.setState({ | |||
showEmptyState: 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.
is it possible that we have local cluster?
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.
updated
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.
is it possible that there is data source but filtered out?
@@ -153,4 +153,16 @@ describe('DataSourceMenu', () => { | |||
); | |||
expect(container).toMatchSnapshot(); | |||
}); | |||
|
|||
it('should render no data source', () => { | |||
component = shallow( |
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.
let's not expose this component from data source menu
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.
removed
src/plugins/data_source_management/public/components/data_source_menu/data_source_menu.tsx
Outdated
Show resolved
Hide resolved
...e_management/public/components/data_source_multi_selectable/data_source_multi_selectable.tsx
Outdated
Show resolved
Hide resolved
...s/data_source_management/public/components/data_source_selectable/data_source_selectable.tsx
Show resolved
Hide resolved
Signed-off-by: yujin-emma <yujin.emma.work@gmail.com>
Signed-off-by: yujin-emma <yujin.emma.work@gmail.com>
Signed-off-by: yujin-emma <yujin.emma.work@gmail.com>
Signed-off-by: Yu Jin <112784385+yujin-emma@users.noreply.github.com>
Signed-off-by: Yu Jin <112784385+yujin-emma@users.noreply.github.com>
Can you close this PR if not relevant any more @yujin-emma? |
+1, I see the original issue is closed. |
Description
Add the empty state component for multiple data source, and add it on examples.
When enable multiple datasource feature, this empty state will display when there is no remote data source and hide the local cluster.
Issues Resolved
#6420
Screenshot
when there is no remote data source but do not hide local cluster
when there is no remote data source but do hide local cluster
Testing the changes
Check List
yarn test:jest
yarn test:jest_integration