Skip to content

Commit

Permalink
feat(explore): Implement viz switcher redesign (#20248)
Browse files Browse the repository at this point in the history
* add icons

* Implement fast viz switcher component

* Remove unnecessary keys from ControlsPanelContainer

* Rename icons

* Add unit tests

* Add licenses

* Fix test

* Change BigNumberWithTrendline to BigNumber

* fix test

* fix test

* Add currently rendered viz tile

* Move View all charts to the right side

* Add license

* Fix imports

* Fix e2e test
  • Loading branch information
kgabryje authored Jun 14, 2022
1 parent c3fdd52 commit 86f146e
Show file tree
Hide file tree
Showing 15 changed files with 644 additions and 83 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,13 @@ describe('VizType control', () => {
cy.visitChartByName('Daily Totals');
cy.verifySliceSuccess({ waitAlias: '@tableChartData' });

cy.get('[data-test="visualization-type"]').contains('Table').click();
cy.contains('View all charts').click();

cy.get('button').contains('Evolution').click(); // change categories
cy.get('[role="button"]').contains('Line Chart').click();
cy.get('button').contains('Select').click();
cy.get('.ant-modal-content').within(() => {
cy.get('button').contains('Evolution').click(); // change categories
cy.get('[role="button"]').contains('Line Chart').click();
cy.get('button').contains('Select').click();
});

cy.get('button[data-test="run-query-button"]').click();
cy.verifySliceSuccess({
Expand Down
21 changes: 21 additions & 0 deletions superset-frontend/src/assets/images/icons/area-chart-tile.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions superset-frontend/src/assets/images/icons/bar-chart-tile.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions superset-frontend/src/assets/images/icons/line-chart-tile.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
28 changes: 28 additions & 0 deletions superset-frontend/src/assets/images/icons/pie-chart-tile.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
28 changes: 28 additions & 0 deletions superset-frontend/src/assets/images/icons/table-chart-tile.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions superset-frontend/src/components/Icons/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ const IconFileNames = [
'alert',
'alert_solid',
'alert_solid_small',
'area-chart-tile',
'bar-chart-tile',
'big-number-chart-tile',
'binoculars',
'bolt',
'bolt_small',
Expand Down Expand Up @@ -56,6 +59,7 @@ const IconFileNames = [
'cog',
'collapse',
'color_palette',
'current-rendered-tile',
'components',
'copy',
'cursor_target',
Expand Down Expand Up @@ -101,6 +105,7 @@ const IconFileNames = [
'keyboard',
'layers',
'lightbulb',
'line-chart-tile',
'link',
'list',
'list_view',
Expand All @@ -123,6 +128,7 @@ const IconFileNames = [
'note',
'offline',
'paperclip',
'pie-chart-tile',
'placeholder',
'plus',
'plus_large',
Expand All @@ -141,6 +147,7 @@ const IconFileNames = [
'sort_desc',
'sort',
'table',
'table-chart-tile',
'tag',
'trash',
'triangle_change',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,6 @@ export const ControlPanelsContainer = (props: ControlPanelsContainerProps) => {
defaultActiveKey={expandedQuerySections}
expandIconPosition="right"
ghost
key={`query-sections-${props.form_data.datasource}-${props.form_data.viz_type}`}
>
{showDatasourceAlert && <DatasourceAlert />}
{querySections.map(renderControlPanelSection)}
Expand All @@ -547,7 +546,6 @@ export const ControlPanelsContainer = (props: ControlPanelsContainerProps) => {
defaultActiveKey={expandedCustomizeSections}
expandIconPosition="right"
ghost
key={`customize-sections-${props.form_data.datasource}-${props.form_data.viz_type}`}
>
{customizeSections.map(renderControlPanelSection)}
</Collapse>
Expand Down
Loading

0 comments on commit 86f146e

Please sign in to comment.