mirror of
https://github.com/apache/superset.git
synced 2026-06-08 09:09:27 +00:00
Co-authored-by: Fardin Mustaque <fardinmustaque@Fardins-Mac-mini.local>
This commit is contained in:
@@ -31,6 +31,8 @@ import {
|
||||
subheaderFontSize,
|
||||
subtitleFontSize,
|
||||
subtitleControl,
|
||||
showMetricNameControl,
|
||||
metricNameFontSizeWithVisibility,
|
||||
} from '../sharedControls';
|
||||
|
||||
const config: ControlPanelConfig = {
|
||||
@@ -141,6 +143,8 @@ const config: ControlPanelConfig = {
|
||||
[subheaderFontSize],
|
||||
[subtitleControl],
|
||||
[subtitleFontSize],
|
||||
[showMetricNameControl],
|
||||
[metricNameFontSizeWithVisibility],
|
||||
['y_axis_format'],
|
||||
['currency_format'],
|
||||
[
|
||||
|
||||
@@ -39,6 +39,7 @@ jest.mock('@superset-ui/core', () => ({
|
||||
jest.mock('../utils', () => ({
|
||||
getDateFormatter: jest.fn(() => (v: any) => `${v}pm`),
|
||||
parseMetricValue: jest.fn(val => Number(val)),
|
||||
getOriginalLabel: jest.fn((metric, metrics) => metric),
|
||||
}));
|
||||
|
||||
jest.mock('../../utils/tooltip', () => ({
|
||||
|
||||
@@ -35,7 +35,7 @@ import {
|
||||
BigNumberWithTrendlineChartProps,
|
||||
TimeSeriesDatum,
|
||||
} from '../types';
|
||||
import { getDateFormatter, parseMetricValue } from '../utils';
|
||||
import { getDateFormatter, parseMetricValue, getOriginalLabel } from '../utils';
|
||||
import { getDefaultTooltip } from '../../utils/tooltip';
|
||||
import { Refs } from '../../types';
|
||||
|
||||
@@ -62,6 +62,7 @@ export default function transformProps(
|
||||
compareLag: compareLag_,
|
||||
compareSuffix = '',
|
||||
timeFormat,
|
||||
metricNameFontSize,
|
||||
headerFontSize,
|
||||
metric = 'value',
|
||||
showTimestamp,
|
||||
@@ -96,6 +97,9 @@ export default function transformProps(
|
||||
const aggregatedData = hasAggregatedData ? aggregatedQueryData.data[0] : null;
|
||||
const refs: Refs = {};
|
||||
const metricName = getMetricLabel(metric);
|
||||
const metrics = chartProps.datasource?.metrics || [];
|
||||
const originalLabel = getOriginalLabel(metric, metrics);
|
||||
const showMetricName = chartProps.rawFormData?.show_metric_name ?? false;
|
||||
const compareLag = Number(compareLag_) || 0;
|
||||
let formattedSubheader = subheader;
|
||||
|
||||
@@ -303,6 +307,9 @@ export default function transformProps(
|
||||
headerFormatter,
|
||||
formatTime,
|
||||
formData,
|
||||
metricName: originalLabel,
|
||||
showMetricName,
|
||||
metricNameFontSize,
|
||||
headerFontSize,
|
||||
subtitleFontSize,
|
||||
subtitle,
|
||||
|
||||
Reference in New Issue
Block a user