Skip to content

Commit

Permalink
initial commit (apache#16380)
Browse files Browse the repository at this point in the history
  • Loading branch information
pkdotson authored and Emmanuel Bavoux committed Nov 14, 2021
1 parent c01de20 commit dd771da
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions superset-frontend/src/datasource/DatasourceEditor.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -324,15 +324,19 @@ class DatasourceEditor extends React.PureComponent {
datasource: {
...props.datasource,
metrics: props.datasource.metrics?.map(metric => {
const {
certified_by: certifiedByMetric,
certification_details: certificationDetails,
} = metric;
const {
certification: { details, certified_by: certifiedBy } = {},
warning_markdown: warningMarkdown,
} = JSON.parse(metric.extra || '{}') || {};
return {
...metric,
certification_details: details || '',
certification_details: certificationDetails || details,
warning_markdown: warningMarkdown || '',
certified_by: certifiedBy,
certified_by: certifiedBy || certifiedByMetric,
};
}),
},
Expand Down Expand Up @@ -935,7 +939,6 @@ class DatasourceEditor extends React.PureComponent {
const { datasource } = this.state;
const { metrics } = datasource;
const sortedMetrics = metrics?.length ? this.sortMetrics(metrics) : [];

return (
<CollectionTable
tableColumns={['metric_name', 'verbose_name', 'expression']}
Expand Down

0 comments on commit dd771da

Please sign in to comment.