-
Notifications
You must be signed in to change notification settings - Fork 891
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 new error database icon to handle error state for data source component #6570
Conversation
Signed-off-by: Lu Yu <[email protected]>
Signed-off-by: Lu Yu <[email protected]>
*/ | ||
import React from 'react'; | ||
|
||
export const ErrorIcon = () => { |
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.
how's it look in dark mode?
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.
when do we expect the error state to be present? should it always have a default connect and fall back to that? |
title: i18n.translate('dataSource.fetchDataSourceError', { | ||
defaultMessage: 'Failed to fetch data sources', | ||
}), | ||
text: toMountPoint(getReloadButton()), |
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.
perhaps we can show the error in more detail similar to how the Discover page shows the error response if clicked in the toast.
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.
This current implementation based on requirement from UX. Since this is more of network call failure, user needs to reload the page in order to trigger another call.
totally unrelated to this PR. but every time the page refreshes is it getting data sources? if it is could we consider caching the data sources like how we cache index patterns. updating the data source on selection |
It only shows up when there is error when fetching data sources. Since the call failed, there will be no default data source. What we want user to do it to refresh the page |
<EuiIcon type={'crossInCircleFilled'} color={'danger'} /> | ||
<EuiText color={'danger'}>Error</EuiText> | ||
<EuiPopover | ||
id={'dataSourceErrrorPopover'} |
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.
typo dataSourceErrrorPopover
, it should dataSourceErrorPopover
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.
Good catch! Will fix!
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.
Fixed typo in new commit
Signed-off-by: Lu Yu <[email protected]>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #6570 +/- ##
===========================================
+ Coverage 32.93% 45.22% +12.28%
===========================================
Files 2260 1660 -600
Lines 45769 33701 -12068
Branches 7200 6409 -791
===========================================
+ Hits 15075 15240 +165
+ Misses 29984 17276 -12708
- Partials 710 1185 +475
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
…te for data source component (#6570) * add error icon and add popover Signed-off-by: Lu Yu <[email protected]> * fix tests Signed-off-by: Lu Yu <[email protected]> * fix typo Signed-off-by: Lu Yu <[email protected]> --------- Signed-off-by: Lu Yu <[email protected]> (cherry picked from commit b117fd3) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
…te for data source component (#6570) (#6593) * add error icon and add popover * fix tests * fix typo --------- (cherry picked from commit b117fd3) Signed-off-by: Lu Yu <[email protected]> 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>
…te for data source component (opensearch-project#6570) * add error icon and add popover Signed-off-by: Lu Yu <[email protected]> * fix tests Signed-off-by: Lu Yu <[email protected]> * fix typo Signed-off-by: Lu Yu <[email protected]> --------- Signed-off-by: Lu Yu <[email protected]>
Description
This change adds new error database icon, adds popover when the icon is clicked, and add button to refresh the page in both popover and toasts to handle network error state for data source component.
Issues Resolved
Screenshot
erroricon.mp4
Testing the changes
The following was performed in the recording
multi selectable
and see error toasts, click on refresh will refresh page, click on error icon will see popover, click on refresh will refresh page, click on manage will go to data source managementselectable
and see error toasts, click on refresh will refresh page, click on error icon will see popover, click on refresh will refresh page, click on manage will go to data source managementdata source view
and see error toasts, click on refresh will refresh page, click on error icon will see popover, click on refresh will refresh page, click on manage will go to data source managementlist all
and see error toasts, click on refresh will refresh page, click on error icon will see popover, click on refresh will refresh page, click on manage will go to data source managementlist active
and see error toasts, click on refresh will refresh page, click on error icon will see popover, click on refresh will refresh page, click on manage will go to data source managementFind screenshots of toast and popover below
Changelog
Check List
yarn test:jest
yarn test:jest_integration