SBIN2010 commented on code in PR #45172:
URL: https://github.com/apache/superset/pull/45172#discussion_r4238555971
##########
superset-frontend/plugins/plugin-chart-echarts/test/Timeseries/transformProps.test.ts:
##########
@@ -1466,6 +1466,36 @@ test('moves a visible horizontal Plain legend into a
custom HTML legend and rest
expect('contentHeight' in transformed).toBe(false);
});
+test('hides legend selector buttons when showSelectorLegend is false', () => {
+ const plain = transformProps(
+ createTestChartProps({
+ formData: {
+ ...formData,
+ legendOrientation: LegendOrientation.Top,
+ legendType: LegendType.Plain,
+ showLegend: true,
+ showSelectorLegend: false,
+ },
+ }),
+ );
+ expect(getCustomLegend(plain)?.showSelectors).toBe(false);
+
+ const scroll = transformProps(
+ createTestChartProps({
+ formData: {
+ ...formData,
+ legendOrientation: LegendOrientation.Top,
+ legendType: LegendType.Scroll,
+ showLegend: true,
+ showSelectorLegend: false,
+ },
+ }),
+ );
+ expect((scroll.echartOptions.legend as { selector?: unknown
}).selector).toBe(
+ false,
+ );
Review Comment:
fix in 3f76c45
##########
superset-frontend/plugins/plugin-chart-echarts/test/utils/series.test.ts:
##########
@@ -1257,6 +1277,18 @@ describe('getLegendProps', () => {
...expectedThemeProps,
});
});
+
+ test('hides All and Inv buttons when showSelectorLegend is false', () => {
+ expect(
+ getLegendProps(
+ LegendType.Plain,
+ LegendOrientation.Top,
+ true,
+ theme,
+ false,
+ ).selector,
+ ).toBe(false);
Review Comment:
fix in 3f76c45
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]