You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by ms...@apache.org on 2026/01/15 09:23:43 UTC
(superset) branch msyavuz/chore/disable-matrixify-for-incompatible-viz updated (a9e6e5beef -> 3014911e6b)
This is an automated email from the ASF dual-hosted git repository.
msyavuz pushed a change to branch msyavuz/chore/disable-matrixify-for-incompatible-viz
in repository https://gitbox.apache.org/repos/asf/superset.git
from a9e6e5beef chore(Matrixify): disable matrixify for incompatible viz types
new e5e267af4c feat: add other tables to unsupported set
new 3014911e6b chore: add tests
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
.../components/ControlPanelsContainer.test.tsx | 109 +++++++++++++++++++++
.../explore/components/ControlPanelsContainer.tsx | 10 +-
2 files changed, 117 insertions(+), 2 deletions(-)
(superset) 01/02: feat: add other tables to unsupported set
Posted by ms...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
msyavuz pushed a commit to branch msyavuz/chore/disable-matrixify-for-incompatible-viz
in repository https://gitbox.apache.org/repos/asf/superset.git
commit e5e267af4cdbac9bdcd42824d797a5ca85afd2d7
Author: Mehmet Salih Yavuz <sa...@proton.me>
AuthorDate: Thu Jan 15 12:21:56 2026 +0300
feat: add other tables to unsupported set
---
.../src/explore/components/ControlPanelsContainer.tsx | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/superset-frontend/src/explore/components/ControlPanelsContainer.tsx b/superset-frontend/src/explore/components/ControlPanelsContainer.tsx
index 4dd7a68120..9ba07d46ee 100644
--- a/superset-frontend/src/explore/components/ControlPanelsContainer.tsx
+++ b/superset-frontend/src/explore/components/ControlPanelsContainer.tsx
@@ -795,8 +795,14 @@ export const ControlPanelsContainer = (props: ControlPanelsContainerProps) => {
]);
const showCustomizeTab = customizeSections.length > 0;
- // Charts that don't support matrixify feature
- const MATRIXIFY_INCOMPATIBLE_CHARTS = new Set([VizType.TableAgGrid]);
+ // Table charts don't support matrixify feature
+ const MATRIXIFY_INCOMPATIBLE_CHARTS = new Set([
+ VizType.Table,
+ VizType.TableAgGrid,
+ VizType.PivotTable,
+ VizType.TimeTable,
+ VizType.TimePivot,
+ ]);
const showMatrixifyTab =
isFeatureEnabled(FeatureFlag.Matrixify) &&
!MATRIXIFY_INCOMPATIBLE_CHARTS.has(form_data.viz_type as VizType);
(superset) 02/02: chore: add tests
Posted by ms...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
msyavuz pushed a commit to branch msyavuz/chore/disable-matrixify-for-incompatible-viz
in repository https://gitbox.apache.org/repos/asf/superset.git
commit 3014911e6bb4f19857491783727c2d3533cc1afd
Author: Mehmet Salih Yavuz <sa...@proton.me>
AuthorDate: Thu Jan 15 12:23:31 2026 +0300
chore: add tests
---
.../components/ControlPanelsContainer.test.tsx | 109 +++++++++++++++++++++
1 file changed, 109 insertions(+)
diff --git a/superset-frontend/src/explore/components/ControlPanelsContainer.test.tsx b/superset-frontend/src/explore/components/ControlPanelsContainer.test.tsx
index a5b1665056..faa6d90472 100644
--- a/superset-frontend/src/explore/components/ControlPanelsContainer.test.tsx
+++ b/superset-frontend/src/explore/components/ControlPanelsContainer.test.tsx
@@ -297,9 +297,16 @@ describe('ControlPanelsContainer', () => {
(featureFlag: FeatureFlag) => featureFlag === FeatureFlag.Matrixify,
);
+ // Register control panel for line chart
+ getChartControlPanelRegistry().registerValue('line', {
+ controlPanelSections: [],
+ });
+
const props = getDefaultProps();
+ // Use a chart type that supports matrixify (not a table)
props.form_data = {
...props.form_data,
+ viz_type: 'line',
matrixify_enable_vertical_layout: true,
};
@@ -319,6 +326,7 @@ describe('ControlPanelsContainer', () => {
...props,
form_data: {
...props.form_data,
+ viz_type: 'line',
matrixify_enable_vertical_layout: true,
matrixify_dimension_columns: {
dimension: 'country',
@@ -336,6 +344,9 @@ describe('ControlPanelsContainer', () => {
});
expect(matrixifyTabAfterSave).toHaveAttribute('aria-selected', 'true');
});
+
+ // Clean up
+ getChartControlPanelRegistry().remove('line');
});
test('should automatically switch to Matrixify tab when matrixify becomes enabled', async () => {
@@ -344,7 +355,17 @@ describe('ControlPanelsContainer', () => {
(featureFlag: FeatureFlag) => featureFlag === FeatureFlag.Matrixify,
);
+ // Register control panel for line chart
+ getChartControlPanelRegistry().registerValue('line', {
+ controlPanelSections: [],
+ });
+
const props = getDefaultProps();
+ // Use a chart type that supports matrixify (not a table)
+ props.form_data = {
+ ...props.form_data,
+ viz_type: 'line',
+ };
const { rerender } = render(<ControlPanelsContainer {...props} />, {
useRedux: true,
@@ -359,6 +380,7 @@ describe('ControlPanelsContainer', () => {
...props,
form_data: {
...props.form_data,
+ viz_type: 'line',
matrixify_enable_horizontal_layout: true,
},
};
@@ -377,5 +399,92 @@ describe('ControlPanelsContainer', () => {
'aria-selected',
'false',
);
+
+ // Clean up
+ getChartControlPanelRegistry().remove('line');
+ });
+
+ test('should not show Matrixify tab for table chart types', async () => {
+ // Enable Matrixify feature flag
+ mockIsFeatureEnabled.mockImplementation(
+ (featureFlag: FeatureFlag) => featureFlag === FeatureFlag.Matrixify,
+ );
+
+ // All table-type charts that don't support matrixify
+ const tableVizTypes = [
+ 'table',
+ 'ag-grid-table',
+ 'pivot_table_v2',
+ 'time_table',
+ 'time_pivot',
+ ];
+
+ for (const vizType of tableVizTypes) {
+ const props = getDefaultProps();
+ props.form_data = {
+ ...props.form_data,
+ viz_type: vizType,
+ };
+
+ render(<ControlPanelsContainer {...props} />, {
+ useRedux: true,
+ });
+
+ // Wait for tabs to be rendered
+ await waitFor(() => {
+ expect(screen.getByRole('tab', { name: /data/i })).toBeInTheDocument();
+ });
+
+ // Check that Matrixify tab does not exist for table chart types
+ expect(
+ screen.queryByRole('tab', { name: /matrixify/i }),
+ ).not.toBeInTheDocument();
+ }
+ });
+
+ test('should show Matrixify tab for supported chart types', async () => {
+ // Enable Matrixify feature flag
+ mockIsFeatureEnabled.mockImplementation(
+ (featureFlag: FeatureFlag) => featureFlag === FeatureFlag.Matrixify,
+ );
+
+ // Register control panels for non-table chart types
+ const simpleConfig = { controlPanelSections: [] };
+ getChartControlPanelRegistry().registerValue('line', simpleConfig);
+ getChartControlPanelRegistry().registerValue('bar', simpleConfig);
+ getChartControlPanelRegistry().registerValue('pie', simpleConfig);
+
+ // Non-table chart types that support matrixify
+ const supportedVizTypes = ['line', 'bar', 'pie'];
+
+ for (const vizType of supportedVizTypes) {
+ const props = getDefaultProps();
+ props.form_data = {
+ ...props.form_data,
+ viz_type: vizType,
+ };
+
+ const { unmount } = render(<ControlPanelsContainer {...props} />, {
+ useRedux: true,
+ });
+
+ // Wait for Matrixify tab to be rendered
+ await waitFor(() => {
+ expect(
+ screen.getByRole('tab', { name: /matrixify/i }),
+ ).toBeInTheDocument();
+ });
+
+ // Also verify Data tab exists
+ expect(screen.getByRole('tab', { name: /data/i })).toBeInTheDocument();
+
+ // Clean up this render before the next iteration
+ unmount();
+ }
+
+ // Clean up registered chart types
+ getChartControlPanelRegistry().remove('line');
+ getChartControlPanelRegistry().remove('bar');
+ getChartControlPanelRegistry().remove('pie');
});
});