From e572fd9c3628aa0b4405c54582f0395a77cbc15c Mon Sep 17 00:00:00 2001 From: Ville Brofeldt Date: Thu, 8 Dec 2022 14:38:48 +0200 Subject: [PATCH 1/3] chore(viz): rename v1 and v2 charts --- .../plugins/legacy-plugin-chart-pivot-table/src/index.js | 2 +- .../plugins/legacy-plugin-chart-treemap/src/index.js | 2 +- .../plugins/legacy-preset-chart-nvd3/src/Area/index.js | 2 +- .../plugins/legacy-preset-chart-nvd3/src/Bar/index.js | 2 +- .../plugins/legacy-preset-chart-nvd3/src/Line/index.js | 2 +- .../plugin-chart-echarts/src/Timeseries/Area/index.ts | 2 +- .../src/Timeseries/Regular/Bar/index.ts | 4 +--- .../src/Timeseries/Regular/Line/index.ts | 2 +- .../plugins/plugin-chart-echarts/src/Treemap/index.ts | 2 +- .../plugins/plugin-chart-pivot-table/src/plugin/index.ts | 2 +- .../controls/VizTypeControl/VizTypeControl.test.tsx | 8 +++----- 11 files changed, 13 insertions(+), 17 deletions(-) diff --git a/superset-frontend/plugins/legacy-plugin-chart-pivot-table/src/index.js b/superset-frontend/plugins/legacy-plugin-chart-pivot-table/src/index.js index a141ab60531ce..b91d969eb8241 100644 --- a/superset-frontend/plugins/legacy-plugin-chart-pivot-table/src/index.js +++ b/superset-frontend/plugins/legacy-plugin-chart-pivot-table/src/index.js @@ -27,7 +27,7 @@ const metadata = new ChartMetadata({ t(`Used to summarize a set of data by grouping together multiple statistics along two axes. Examples: Sales numbers by region and month, tasks by status and assignee, active users by age and location. This chart is being deprecated and we recommend checking out Pivot Table V2 instead!`), - name: t('Pivot Table'), + name: t('Pivot Table (legacy)'), tags: [t('Legacy')], thumbnail, useLegacyApi: true, diff --git a/superset-frontend/plugins/legacy-plugin-chart-treemap/src/index.js b/superset-frontend/plugins/legacy-plugin-chart-treemap/src/index.js index 0b517d6a2d6ad..5603d7e30100f 100644 --- a/superset-frontend/plugins/legacy-plugin-chart-treemap/src/index.js +++ b/superset-frontend/plugins/legacy-plugin-chart-treemap/src/index.js @@ -37,7 +37,7 @@ const metadata = new ChartMetadata({ { url: example3 }, { url: example4 }, ], - name: t('Treemap'), + name: t('Treemap (legacy)'), tags: [ t('Categorical'), t('Legacy'), diff --git a/superset-frontend/plugins/legacy-preset-chart-nvd3/src/Area/index.js b/superset-frontend/plugins/legacy-preset-chart-nvd3/src/Area/index.js index 1b31acfd4468d..c0208b8e97865 100644 --- a/superset-frontend/plugins/legacy-preset-chart-nvd3/src/Area/index.js +++ b/superset-frontend/plugins/legacy-preset-chart-nvd3/src/Area/index.js @@ -38,7 +38,7 @@ const metadata = new ChartMetadata({ { url: example3, caption: t('Video game consoles') }, { url: example4, caption: t('Vehicle Types') }, ], - name: t('Area Chart'), + name: t('Area Chart (legacy)'), supportedAnnotationTypes: [ANNOTATION_TYPES.INTERVAL, ANNOTATION_TYPES.EVENT], tags: [ t('Aesthetic'), diff --git a/superset-frontend/plugins/legacy-preset-chart-nvd3/src/Bar/index.js b/superset-frontend/plugins/legacy-preset-chart-nvd3/src/Bar/index.js index 073d533d38193..35a345fdbbaa4 100644 --- a/superset-frontend/plugins/legacy-preset-chart-nvd3/src/Bar/index.js +++ b/superset-frontend/plugins/legacy-preset-chart-nvd3/src/Bar/index.js @@ -32,7 +32,7 @@ const metadata = new ChartMetadata({ 'Visualize how a metric changes over time using bars. Add a group by column to visualize group level metrics and how they change over time.', ), exampleGallery: [{ url: example1 }, { url: example2 }, { url: example3 }], - name: t('Time-series Bar Chart'), + name: t('Time-series Bar Chart (legacy)'), supportedAnnotationTypes: [ANNOTATION_TYPES.INTERVAL, ANNOTATION_TYPES.EVENT], tags: [ t('Bar'), diff --git a/superset-frontend/plugins/legacy-preset-chart-nvd3/src/Line/index.js b/superset-frontend/plugins/legacy-preset-chart-nvd3/src/Line/index.js index 3ec8f2c7fd06b..0d903ce3ca1b7 100644 --- a/superset-frontend/plugins/legacy-preset-chart-nvd3/src/Line/index.js +++ b/superset-frontend/plugins/legacy-preset-chart-nvd3/src/Line/index.js @@ -35,7 +35,7 @@ const metadata = new ChartMetadata({ { url: example2 }, { url: battery, caption: t('Battery level over time') }, ], - name: t('Line Chart'), + name: t('Line Chart (legacy)'), supportedAnnotationTypes: [ ANNOTATION_TYPES.TIME_SERIES, ANNOTATION_TYPES.INTERVAL, diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Area/index.ts b/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Area/index.ts index 200b25616b4e8..b560cf0b4f795 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Area/index.ts +++ b/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Area/index.ts @@ -68,7 +68,7 @@ export default class EchartsAreaChartPlugin extends ChartPlugin< AnnotationType.Timeseries, ], name: hasGenericChartAxes - ? t('Area Chart v2') + ? t('Area Chart') : t('Time-series Area Chart'), tags: [ t('ECharts'), diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/Bar/index.ts b/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/Bar/index.ts index 6ec20be442edb..de0050edaa94b 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/Bar/index.ts +++ b/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/Bar/index.ts @@ -75,9 +75,7 @@ export default class EchartsTimeseriesBarChartPlugin extends ChartPlugin< AnnotationType.Interval, AnnotationType.Timeseries, ], - name: hasGenericChartAxes - ? t('Bar Chart v2') - : t('Time-series Bar Chart v2'), + name: hasGenericChartAxes ? t('Bar Chart') : t('Time-series Bar Chart'), tags: [ t('ECharts'), t('Predictive'), diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/Line/index.ts b/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/Line/index.ts index 3a384293e5300..b6f7f1fceb2bf 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/Line/index.ts +++ b/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/Line/index.ts @@ -73,7 +73,7 @@ export default class EchartsTimeseriesLineChartPlugin extends ChartPlugin< AnnotationType.Timeseries, ], name: hasGenericChartAxes - ? t('Line Chart v2') + ? t('Line Chart') : t('Time-series Line Chart'), tags: [ t('ECharts'), diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/Treemap/index.ts b/superset-frontend/plugins/plugin-chart-echarts/src/Treemap/index.ts index 49be2849ac0bb..6be508d5649bf 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/Treemap/index.ts +++ b/superset-frontend/plugins/plugin-chart-echarts/src/Treemap/index.ts @@ -53,7 +53,7 @@ export default class EchartsTreemapChartPlugin extends ChartPlugin< 'Show hierarchical relationships of data, with with the value represented by area, showing proportion and contribution to the whole.', ), exampleGallery: [{ url: example1 }, { url: example2 }], - name: t('Treemap v2'), + name: t('Treemap'), tags: [ t('Aesthetic'), t('Categorical'), diff --git a/superset-frontend/plugins/plugin-chart-pivot-table/src/plugin/index.ts b/superset-frontend/plugins/plugin-chart-pivot-table/src/plugin/index.ts index f65eefebbe89f..7b5f7b4b9e8d2 100644 --- a/superset-frontend/plugins/plugin-chart-pivot-table/src/plugin/index.ts +++ b/superset-frontend/plugins/plugin-chart-pivot-table/src/plugin/index.ts @@ -51,7 +51,7 @@ export default class PivotTableChartPlugin extends ChartPlugin< description: t( 'Used to summarize a set of data by grouping together multiple statistics along two axes. Examples: Sales numbers by region and month, tasks by status and assignee, active users by age and location. Not the most visually stunning visualization, but highly informative and versatile.', ), - name: t('Pivot Table v2'), + name: t('Pivot Table'), tags: [t('Additive'), t('Report'), t('Tabular'), t('Popular')], thumbnail, }); diff --git a/superset-frontend/src/explore/components/controls/VizTypeControl/VizTypeControl.test.tsx b/superset-frontend/src/explore/components/controls/VizTypeControl/VizTypeControl.test.tsx index 3f71786100a2e..ee3bfdaee99b1 100644 --- a/superset-frontend/src/explore/components/controls/VizTypeControl/VizTypeControl.test.tsx +++ b/superset-frontend/src/explore/components/controls/VizTypeControl/VizTypeControl.test.tsx @@ -139,7 +139,7 @@ describe('VizTypeControl', () => { ).toBeInTheDocument(); expect( within(screen.getByTestId('fast-viz-switcher')).getByText( - 'Time-series Bar Chart v2', + 'Time-series Bar Chart', ), ).toBeInTheDocument(); expect( @@ -251,7 +251,7 @@ describe('VizTypeControl', () => { within(visualizations).getByText('Time-series Line Chart'), ).toBeVisible(); expect( - within(visualizations).getByText('Time-series Bar Chart v2'), + within(visualizations).getByText('Time-series Bar Chart'), ).toBeVisible(); expect( within(visualizations).queryByText('Line Chart'), @@ -269,9 +269,7 @@ describe('VizTypeControl', () => { renderWrapper(); userEvent.click(screen.getByRole('button', { name: 'ballot All charts' })); const visualizations = screen.getByTestId(getTestId('viz-row')); - userEvent.click( - within(visualizations).getByText('Time-series Bar Chart v2'), - ); + userEvent.click(within(visualizations).getByText('Time-series Bar Chart')); expect(defaultProps.onChange).not.toBeCalled(); userEvent.dblClick( From ba7273867b88d2979cb0eb73e42c471a81bcb06d Mon Sep 17 00:00:00 2001 From: Ville Brofeldt Date: Thu, 8 Dec 2022 21:04:01 +0200 Subject: [PATCH 2/3] rename cypress test --- .../cypress/integration/dashboard/drilltodetail.test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/superset-frontend/cypress-base/cypress/integration/dashboard/drilltodetail.test.ts b/superset-frontend/cypress-base/cypress/integration/dashboard/drilltodetail.test.ts index 2323b749c58cf..c71a5833dba90 100644 --- a/superset-frontend/cypress-base/cypress/integration/dashboard/drilltodetail.test.ts +++ b/superset-frontend/cypress-base/cypress/integration/dashboard/drilltodetail.test.ts @@ -339,7 +339,7 @@ describe('Drill to detail modal', () => { }); }); - describe('Time-series Bar Chart V2', () => { + describe('Time-series Bar Chart', () => { it('opens the modal with the correct filters', () => { interceptSamples(); @@ -591,7 +591,7 @@ describe('Drill to detail modal', () => { }); }); - describe('Treemap V2', () => { + describe('Treemap', () => { it('opens the modal with the correct filters', () => { interceptSamples(); From ad5016dd0d058329ebb3f7fac3063be4c1ae22e3 Mon Sep 17 00:00:00 2001 From: Ville Brofeldt Date: Fri, 9 Dec 2022 08:54:51 +0200 Subject: [PATCH 3/3] fix cypress tests --- .../cypress/integration/chart_list/filter.test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/superset-frontend/cypress-base/cypress/integration/chart_list/filter.test.ts b/superset-frontend/cypress-base/cypress/integration/chart_list/filter.test.ts index 9ba7a4a29e825..67d15dd5a6ca6 100644 --- a/superset-frontend/cypress-base/cypress/integration/chart_list/filter.test.ts +++ b/superset-frontend/cypress-base/cypress/integration/chart_list/filter.test.ts @@ -50,7 +50,7 @@ describe('Charts filters', () => { }); it('should filter by viz type correctly', () => { - setFilter('Chart type', 'Area Chart'); + setFilter('Chart type', 'Area Chart (legacy)'); cy.getBySel('styled-card').should('have.length', 3); setFilter('Chart type', 'Bubble Chart'); cy.getBySel('styled-card').should('have.length', 2); @@ -91,7 +91,7 @@ describe('Charts filters', () => { }); it('should filter by viz type correctly', () => { - setFilter('Chart type', 'Area Chart'); + setFilter('Chart type', 'Area Chart (legacy)'); cy.getBySel('table-row').should('have.length', 3); setFilter('Chart type', 'Bubble Chart'); cy.getBySel('table-row').should('have.length', 2);