mirror of
https://github.com/apache/superset.git
synced 2026-05-12 19:35:17 +00:00
feat: add hook for dataset health check (#11970)
* feat: add hook for dataset health check * add event log * optimize datasource json data like certified data * add unit test * fix review comments * extra code review comments
This commit is contained in:
@@ -19,7 +19,7 @@
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { Col, Collapse, Row, Well } from 'react-bootstrap';
|
||||
import { t, styled } from '@superset-ui/core';
|
||||
import { t, styled, supersetTheme } from '@superset-ui/core';
|
||||
import { ColumnOption, MetricOption } from '@superset-ui/chart-controls';
|
||||
|
||||
import { Dropdown, Menu } from 'src/common/components';
|
||||
@@ -73,6 +73,10 @@ const Styles = styled.div`
|
||||
vertical-align: middle;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.datasource-controls {
|
||||
display: flex;
|
||||
}
|
||||
`;
|
||||
|
||||
/**
|
||||
@@ -213,10 +217,13 @@ class DatasourceControl extends React.PureComponent {
|
||||
</Menu>
|
||||
);
|
||||
|
||||
// eslint-disable-next-line camelcase
|
||||
const { health_check_message: healthCheckMessage } = datasource;
|
||||
|
||||
return (
|
||||
<Styles className="DatasourceControl">
|
||||
<ControlHeader {...this.props} />
|
||||
<div>
|
||||
<div className="datasource-controls">
|
||||
<Tooltip title={t('Expand/collapse dataset configuration')}>
|
||||
<Label
|
||||
style={{ textTransform: 'none' }}
|
||||
@@ -230,6 +237,14 @@ class DatasourceControl extends React.PureComponent {
|
||||
/>
|
||||
</Label>
|
||||
</Tooltip>
|
||||
{healthCheckMessage && (
|
||||
<Tooltip title={healthCheckMessage}>
|
||||
<Icon
|
||||
name="alert-solid"
|
||||
color={supersetTheme.colors.warning.base}
|
||||
/>
|
||||
</Tooltip>
|
||||
)}
|
||||
<Dropdown
|
||||
overlay={datasourceMenu}
|
||||
trigger={['click']}
|
||||
|
||||
Reference in New Issue
Block a user