feat: Certify Charts and Dashboards (#17335)

* Certify charts

* Format

* Certify dashboards

* Format

* Refactor card certification

* Clear details when certified by empty

* Show certification in detail page

* Add RTL tests

* Test charts api

* Enhance integration tests

* Lint

* Fix dashboards count

* Format

* Handle empty value

* Handle empty slice

* Downgrade migration

* Indent

* Use alter

* Fix revision

* Fix revision
This commit is contained in:
Geido
2021-11-24 13:42:52 +02:00
committed by GitHub
parent 9576478a5d
commit 83e49fc9ee
28 changed files with 589 additions and 60 deletions

View File

@@ -44,6 +44,7 @@ import Timer from 'src/components/Timer';
import CachedLabel from 'src/components/CachedLabel';
import PropertiesModal from 'src/explore/components/PropertiesModal';
import { sliceUpdated } from 'src/explore/actions/exploreActions';
import CertifiedIcon from 'src/components/CertifiedIcon';
import ExploreActionButtons from '../ExploreActionButtons';
import RowCountLabel from '../RowCountLabel';
@@ -165,7 +166,10 @@ export class ExploreChartHeader extends React.PureComponent {
}
getSliceName() {
return this.props.sliceName || t('%s - untitled', this.props.table_name);
const { sliceName, table_name: tableName } = this.props;
const title = sliceName || t('%s - untitled', tableName);
return title;
}
postChartFormData() {
@@ -241,7 +245,7 @@ export class ExploreChartHeader extends React.PureComponent {
}
render() {
const { user, form_data: formData } = this.props;
const { user, form_data: formData, slice } = this.props;
const {
chartStatus,
chartUpdateEndTime,
@@ -257,6 +261,14 @@ export class ExploreChartHeader extends React.PureComponent {
return (
<StyledHeader id="slice-header" className="panel-title-large">
<div className="title-panel">
{slice?.certified_by && (
<>
<CertifiedIcon
certifiedBy={slice.certified_by}
details={slice.certification_details}
/>{' '}
</>
)}
<EditableTitle
title={this.getSliceName()}
canEdit={