Skip to content
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

Closed
wants to merge 51 commits into from

Conversation

yujin-emma
Copy link
Contributor

@yujin-emma yujin-emma commented Apr 14, 2024

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

empty-state-lc

when there is no remote data source but do hide local cluster

empty-state-hide-lc

Testing the changes

Check List

  • All tests pass
    • yarn test:jest
    • yarn test:jest_integration
  • New functionality includes testing.
  • New functionality has been documented.
  • Update CHANGELOG.md
  • Commits are signed per the DCO using --signoff

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>
Copy link

codecov bot commented Apr 14, 2024

Codecov Report

Attention: Patch coverage is 17.64706% with 14 lines in your changes are missing coverage. Please review.

Project coverage is 45.17%. Comparing base (b619ccb) to head (9fcde15).

❗ Current head 9fcde15 differs from pull request most recent head a6f43f5. Consider uploading reports for the commit a6f43f5 to get more accurate results

Files Patch % Lines
...ce_aggregated_view/data_source_aggregated_view.tsx 0.00% 2 Missing and 2 partials ⚠️
.../data_source_selectable/data_source_selectable.tsx 0.00% 2 Missing and 2 partials ⚠️
..._multi_selectable/data_source_multi_selectable.tsx 0.00% 1 Missing and 2 partials ⚠️
...c/components/data_source_view/data_source_view.tsx 0.00% 1 Missing and 2 partials ⚠️
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     
Flag Coverage Δ
Windows_3 45.17% <17.64%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

yujin-emma and others added 2 commits April 14, 2024 15:22
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>
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>
yujin-emma and others added 4 commits April 16, 2024 17:01
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,
Copy link
Collaborator

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated

Copy link
Collaborator

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(
Copy link
Collaborator

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed

yujin-emma and others added 12 commits April 16, 2024 17:22
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>
@BionIT
Copy link
Collaborator

BionIT commented Apr 18, 2024

Can you close this PR if not relevant any more @yujin-emma?

@kavilla
Copy link
Member

kavilla commented Apr 21, 2024

Can you close this PR if not relevant any more @yujin-emma?

+1, I see the original issue is closed.

@yujin-emma yujin-emma closed this Apr 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants