{
} as DatasourcePublicAPI).isDisabled('trendline')
).toBeTruthy();
});
+ it('should not show a trendline button group when primary metric dimension is non-numeric', () => {
+ expect(
+ getHarnessWithState(fullState, undefined, {
+ frame: nonNumericMetricFrame,
+ }).wrapper.isEmptyRender()
+ ).toBeTruthy();
+ });
describe('responding to buttons', () => {
it('enables trendline', () => {
diff --git a/x-pack/plugins/lens/public/visualizations/metric/dimension_editor.tsx b/x-pack/plugins/lens/public/visualizations/metric/dimension_editor.tsx
index 7d2561369ee6b..c84fa45834fa0 100644
--- a/x-pack/plugins/lens/public/visualizations/metric/dimension_editor.tsx
+++ b/x-pack/plugins/lens/public/visualizations/metric/dimension_editor.tsx
@@ -143,78 +143,77 @@ function SecondaryMetricEditor({ accessor, idPrefix, frame, layerId, setState, s
const defaultPrefix = columnName || '';
return (
-
-
- <>
- {
+
+ <>
+ {
+ setState({
+ ...state,
+ secondaryPrefix,
+ });
+ }}
+ />
+
+ {state.secondaryPrefix && (
+ {
setState({
...state,
- secondaryPrefix,
+ secondaryPrefix: newPrefix,
});
}}
/>
-
- {state.secondaryPrefix && (
- {
- setState({
- ...state,
- secondaryPrefix: newPrefix,
- });
- }}
- />
- )}
- >
-
-
+ )}
+ >
+