diff --git a/.github/workflows/superset-e2e.yml b/.github/workflows/superset-e2e.yml index cbf9728f2381d..85a22bf11e917 100644 --- a/.github/workflows/superset-e2e.yml +++ b/.github/workflows/superset-e2e.yml @@ -141,4 +141,4 @@ jobs: if: failure() with: path: ${{ github.workspace }}/superset-frontend/cypress-base/cypress/screenshots - name: cypress-artifact-${{ github.run_id }}-${{ github.job }} + name: cypress-artifact-${{ github.run_id }}-${{ github.job }}-${{ matrix.browser }}-${{ matrix.parallel_id }} diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index bb34ee4055280..a40c26f218a1b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -52,14 +52,6 @@ repos: - id: trailing-whitespace exclude: ^.*\.(snap) args: ["--markdown-linebreak-ext=md"] - - repo: local - hooks: - - id: eslint - name: eslint - entry: bash -c 'cd superset-frontend && npm run eslint -- $(echo "$@" | sed "s|superset-frontend/||g")' - language: system - pass_filenames: true - files: \.(js|jsx|ts|tsx)$ - repo: https://github.com/pre-commit/mirrors-prettier rev: v4.0.0-alpha.8 # Use the sha or tag you want to point at hooks: @@ -68,6 +60,14 @@ repos: - prettier@3.3.3 args: ["--ignore-path=./superset-frontend/.prettierignore"] files: "superset-frontend" + - repo: local + hooks: + - id: eslint + name: eslint + entry: bash -c 'cd superset-frontend && npm run eslint -- $(echo "$@" | sed "s|superset-frontend/||g")' + language: system + pass_filenames: true + files: \.(js|jsx|ts|tsx)$ # blacklist unsafe functions like make_url (see #19526) - repo: https://github.com/skorokithakis/blacklist-pre-commit-hook rev: e2f070289d8eddcaec0b580d3bde29437e7c8221 diff --git a/RESOURCES/FEATURE_FLAGS.md b/RESOURCES/FEATURE_FLAGS.md index b5ab3f6d6fddc..714971378ecb7 100644 --- a/RESOURCES/FEATURE_FLAGS.md +++ b/RESOURCES/FEATURE_FLAGS.md @@ -64,8 +64,6 @@ These features flags are **safe for production**. They have been tested and will ### Flags on the path to feature launch and flag deprecation/removal - DASHBOARD_VIRTUALIZATION -- DRILL_BY -- DISABLE_LEGACY_DATASOURCE_EDITOR ### Flags retained for runtime configuration @@ -79,6 +77,7 @@ independently. This new framework will also allow for non-boolean configurations - ALLOW_ADHOC_SUBQUERY - DASHBOARD_RBAC [(docs)](https://superset.apache.org/docs/using-superset/creating-your-first-dashboard#manage-access-to-dashboards) - DATAPANEL_CLOSED_BY_DEFAULT +- DRILL_BY - DRUID_JOINS - EMBEDDABLE_CHARTS - EMBEDDED_SUPERSET diff --git a/RESOURCES/INTHEWILD.md b/RESOURCES/INTHEWILD.md index 7a19f37abdbd8..4f8ef467f2c7e 100644 --- a/RESOURCES/INTHEWILD.md +++ b/RESOURCES/INTHEWILD.md @@ -60,6 +60,7 @@ Join our growing community! - [Dropit Shopping](https://www.dropit.shop/) [@dropit-dev] - [Fanatics](https://www.fanatics.com/) [@coderfender] - [Fordeal](https://www.fordeal.com) [@Renkai] +- [Fynd](https://www.fynd.com/) [@darpanjain07] - [GFG - Global Fashion Group](https://global-fashion-group.com) [@ksaagariconic] - [GoTo/Gojek](https://www.gojek.io/) [@gwthm-in] - [HuiShouBao](https://www.huishoubao.com/) [@Yukinoshita-Yukino] diff --git a/UPDATING.md b/UPDATING.md index 663df68cd9b69..2a9e8992d85ec 100644 --- a/UPDATING.md +++ b/UPDATING.md @@ -24,6 +24,7 @@ assists people when migrating to a new version. ## Next +- [31844](https://github.com/apache/superset/pull/31844) The `ALERT_REPORTS_EXECUTE_AS` and `THUMBNAILS_EXECUTE_AS` config parameters have been renamed to `ALERT_REPORTS_EXECUTORS` and `THUMBNAILS_EXECUTORS` respectively. A new config flag `CACHE_WARMUP_EXECUTORS` has also been introduced to be able to control which user is used to execute cache warmup tasks. Finally, the config flag `THUMBNAILS_SELENIUM_USER` has been removed. To use a fixed executor for async tasks, use the new `FixedExecutor` class. See the config and docs for more info on setting up different executor profiles. - [31894](https://github.com/apache/superset/pull/31894) Domain sharding is deprecated in favor of HTTP2. The `SUPERSET_WEBSERVER_DOMAINS` configuration will be removed in the next major version (6.0) - [31774](https://github.com/apache/superset/pull/31774): Fixes the spelling of the `USE-ANALAGOUS-COLORS` feature flag. Please update any scripts/configuration item to use the new/corrected `USE-ANALOGOUS-COLORS` flag spelling. - [31582](https://github.com/apache/superset/pull/31582) Removed the legacy Area, Bar, Event Flow, Heatmap, Histogram, Line, Sankey, and Sankey Loop charts. They were all automatically migrated to their ECharts counterparts with the exception of the Event Flow and Sankey Loop charts which were removed as they were not actively maintained and not widely used. If you were using the Event Flow or Sankey Loop charts, you will need to find an alternative solution. diff --git a/docs/docs/configuration/alerts-reports.mdx b/docs/docs/configuration/alerts-reports.mdx index 293ed3f71ff11..5ff1ef4b819ef 100644 --- a/docs/docs/configuration/alerts-reports.mdx +++ b/docs/docs/configuration/alerts-reports.mdx @@ -177,10 +177,9 @@ By default, Alerts and Reports are executed as the owner of the alert/report obj just change the config as follows (`admin` in this example): ```python -from superset.tasks.types import ExecutorType +from superset.tasks.types import FixedExecutor -THUMBNAIL_SELENIUM_USER = 'admin' -ALERT_REPORTS_EXECUTE_AS = [ExecutorType.SELENIUM] +ALERT_REPORTS_EXECUTORS = [FixedExecutor("admin")] ``` Please refer to `ExecutorType` in the codebase for other executor types. diff --git a/docs/docs/configuration/cache.mdx b/docs/docs/configuration/cache.mdx index 6d761c56b7113..c0eadca95bfaf 100644 --- a/docs/docs/configuration/cache.mdx +++ b/docs/docs/configuration/cache.mdx @@ -94,10 +94,9 @@ By default thumbnails are rendered per user, and will fall back to the Selenium To always render thumbnails as a fixed user (`admin` in this example), use the following configuration: ```python -from superset.tasks.types import ExecutorType +from superset.tasks.types import FixedExecutor -THUMBNAIL_SELENIUM_USER = "admin" -THUMBNAIL_EXECUTE_AS = [ExecutorType.SELENIUM] +THUMBNAIL_EXECUTORS = [FixedExecutor("admin")] ``` @@ -130,8 +129,6 @@ def init_thumbnail_cache(app: Flask) -> S3Cache: THUMBNAIL_CACHE_CONFIG = init_thumbnail_cache -# Async selenium thumbnail task will use the following user -THUMBNAIL_SELENIUM_USER = "Admin" ``` Using the above example cache keys for dashboards will be `superset_thumb__dashboard__{ID}`. You can diff --git a/superset-frontend/.eslintrc.js b/superset-frontend/.eslintrc.js index d2ed09e69e75b..5f5acaa6d64fb 100644 --- a/superset-frontend/.eslintrc.js +++ b/superset-frontend/.eslintrc.js @@ -331,7 +331,7 @@ module.exports = { 'no-prototype-builtins': 0, 'no-restricted-properties': 0, 'no-restricted-imports': [ - 'warn', + 'error', { paths: [ { @@ -339,6 +339,11 @@ module.exports = { message: 'Please import Ant components from the index of src/components', }, + { + name: 'antd-v5', + message: + 'Please import Ant v5 components from the index of src/components', + }, { name: '@superset-ui/core', importNames: ['supersetTheme'], diff --git a/superset-frontend/cypress-base/cypress/e2e/dashboard/drillby.test.ts b/superset-frontend/cypress-base/cypress/e2e/dashboard/drillby.test.ts index c4c5ed47665fb..e471d1da8caa2 100644 --- a/superset-frontend/cypress-base/cypress/e2e/dashboard/drillby.test.ts +++ b/superset-frontend/cypress-base/cypress/e2e/dashboard/drillby.test.ts @@ -599,7 +599,7 @@ describe('Drill by modal', () => { ]); }); - it('Radar Chart', () => { + it.skip('Radar Chart', () => { testEchart('radar', 'Radar Chart', [ [182, 49], [423, 91], diff --git a/superset-frontend/cypress-base/cypress/e2e/dashboard/drilltodetail.test.ts b/superset-frontend/cypress-base/cypress/e2e/dashboard/drilltodetail.test.ts index f11aac445446b..4ebd64dd6e501 100644 --- a/superset-frontend/cypress-base/cypress/e2e/dashboard/drilltodetail.test.ts +++ b/superset-frontend/cypress-base/cypress/e2e/dashboard/drilltodetail.test.ts @@ -335,7 +335,7 @@ describe('Drill to detail modal', () => { }); }); - describe('Bar Chart', () => { + describe.skip('Bar Chart', () => { it('opens the modal with the correct filters', () => { interceptSamples(); @@ -373,7 +373,7 @@ describe('Drill to detail modal', () => { }); }); - describe('Area Chart', () => { + describe.skip('Area Chart', () => { it('opens the modal with the correct filters', () => { testTimeChart('echarts_area'); }); @@ -407,7 +407,7 @@ describe('Drill to detail modal', () => { }); }); - describe('World Map', () => { + describe.skip('World Map', () => { it('opens the modal with the correct filters', () => { interceptSamples(); @@ -567,7 +567,7 @@ describe('Drill to detail modal', () => { }); }); - describe('Radar Chart', () => { + describe.skip('Radar Chart', () => { it('opens the modal with the correct filters', () => { interceptSamples(); diff --git a/superset-frontend/cypress-base/cypress/e2e/dashboard/horizontalFilterBar.test.ts b/superset-frontend/cypress-base/cypress/e2e/dashboard/horizontalFilterBar.test.ts index f1bfa9617e1c3..bcacae8a36dbc 100644 --- a/superset-frontend/cypress-base/cypress/e2e/dashboard/horizontalFilterBar.test.ts +++ b/superset-frontend/cypress-base/cypress/e2e/dashboard/horizontalFilterBar.test.ts @@ -176,7 +176,7 @@ describe('Horizontal FilterBar', () => { validateFilterNameOnDashboard(testItems.topTenChart.filterColumn); }); - it('should spot changes in "more filters" and apply their values', () => { + it.skip('should spot changes in "more filters" and apply their values', () => { cy.intercept(`/api/v1/chart/data?form_data=**`).as('chart'); prepareDashboardFilters([ { name: 'test_1', column: 'country_name', datasetId: 2 }, @@ -204,7 +204,7 @@ describe('Horizontal FilterBar', () => { ); }); - it('should focus filter and open "more filters" programmatically', () => { + it.skip('should focus filter and open "more filters" programmatically', () => { prepareDashboardFilters([ { name: 'test_1', column: 'country_name', datasetId: 2 }, { name: 'test_2', column: 'country_code', datasetId: 2 }, @@ -231,7 +231,7 @@ describe('Horizontal FilterBar', () => { cy.get('.ant-select-focused').should('be.visible'); }); - it('should show tag count and one plain tag on focus and only count on blur in select ', () => { + it.skip('should show tag count and one plain tag on focus and only count on blur in select ', () => { prepareDashboardFilters([ { name: 'test_1', column: 'country_name', datasetId: 2 }, ]); diff --git a/superset-frontend/cypress-base/cypress/e2e/dashboard_list/list.test.ts b/superset-frontend/cypress-base/cypress/e2e/dashboard_list/list.test.ts index 77d0953edb667..c887ae0e6c2c3 100644 --- a/superset-frontend/cypress-base/cypress/e2e/dashboard_list/list.test.ts +++ b/superset-frontend/cypress-base/cypress/e2e/dashboard_list/list.test.ts @@ -206,7 +206,7 @@ describe('Dashboards list', () => { .should('not.contain', '4 - Sample dashboard'); }); - it('should delete correctly in list mode', () => { + it.skip('should delete correctly in list mode', () => { // deletes in list-view setGridMode('list'); diff --git a/superset-frontend/cypress-base/cypress/e2e/explore/annotations.test.ts b/superset-frontend/cypress-base/cypress/e2e/explore/annotations.test.ts index ec1596e932008..b4f31723ab5fb 100644 --- a/superset-frontend/cypress-base/cypress/e2e/explore/annotations.test.ts +++ b/superset-frontend/cypress-base/cypress/e2e/explore/annotations.test.ts @@ -18,7 +18,7 @@ */ import { interceptChart } from 'cypress/utils'; -describe('Annotations', () => { +describe.skip('Annotations', () => { beforeEach(() => { interceptChart({ legacy: false }).as('chartData'); }); diff --git a/superset-frontend/cypress-base/cypress/e2e/sqllab/query.test.ts b/superset-frontend/cypress-base/cypress/e2e/sqllab/query.test.ts index be758ed6dd2bd..4f0d0bb8cd3e4 100644 --- a/superset-frontend/cypress-base/cypress/e2e/sqllab/query.test.ts +++ b/superset-frontend/cypress-base/cypress/e2e/sqllab/query.test.ts @@ -80,7 +80,6 @@ describe('SqlLab query panel', () => { it.skip('successfully saves a query', () => { cy.intercept('api/v1/database/**/tables/**').as('getTables'); - cy.intercept('savedqueryviewapi/**').as('getSavedQuery'); const query = 'SELECT ds, gender, name, num FROM main.birth_names ORDER BY name LIMIT 3'; @@ -142,10 +141,11 @@ describe('SqlLab query panel', () => { }); }); - it('Create a chart from a query', () => { + it.skip('Create a chart from a query', () => { cy.intercept('/api/v1/sqllab/execute/').as('queryFinished'); cy.intercept('**/api/v1/explore/**').as('explore'); cy.intercept('**/api/v1/chart/**').as('chart'); + cy.intercept('**/tabstateview/**').as('tabstateview'); // cypress doesn't handle opening a new tab, override window.open to open in the same tab cy.window().then(win => { @@ -154,6 +154,7 @@ describe('SqlLab query panel', () => { win.location.href = url; }); }); + cy.wait('@tabstateview'); const query = 'SELECT gender, name FROM birth_names'; diff --git a/superset-frontend/cypress-base/cypress/support/e2e.ts b/superset-frontend/cypress-base/cypress/support/e2e.ts index 4a471c87d1b05..18572b6ab2e7a 100644 --- a/superset-frontend/cypress-base/cypress/support/e2e.ts +++ b/superset-frontend/cypress-base/cypress/support/e2e.ts @@ -20,6 +20,7 @@ import '@cypress/code-coverage/support'; import '@applitools/eyes-cypress/commands'; import failOnConsoleError from 'cypress-fail-on-console-error'; import { expect } from 'chai'; +import rison from 'rison'; /* eslint-disable @typescript-eslint/no-explicit-any */ @@ -169,7 +170,7 @@ Cypress.Commands.add('login', () => { }).then(response => { if (response.status === 302) { // If there's a redirect, follow it manually - const redirectUrl = response.headers['location']; + const redirectUrl = response.headers.location; cy.request({ method: 'GET', url: redirectUrl, @@ -183,8 +184,12 @@ Cypress.Commands.add('login', () => { }); Cypress.Commands.add('visitChartByName', name => { - cy.request(`/chart/api/read?_flt_3_slice_name=${name}`).then(response => { - cy.visit(`${BASE_EXPLORE_URL}{"slice_id": ${response.body.pks[0]}}`); + const query = rison.encode({ + columns: ['id'], + filters: [{ col: 'slice_name', opr: 'eq', value: name }], + }); + cy.request(`/api/v1/chart?q=${query}`).then(response => { + cy.visit(`${BASE_EXPLORE_URL}{"slice_id": ${response.body.result[0].id}}`); }); }); diff --git a/superset-frontend/package-lock.json b/superset-frontend/package-lock.json index a7ac01fa4143b..f8878539a0670 100644 --- a/superset-frontend/package-lock.json +++ b/superset-frontend/package-lock.json @@ -125,7 +125,7 @@ "react-split": "^2.0.9", "react-syntax-highlighter": "^15.4.5", "react-table": "^7.8.0", - "react-transition-group": "^2.5.3", + "react-transition-group": "^4.4.5", "react-ultimate-pagination": "^1.3.2", "react-virtualized-auto-sizer": "^1.0.25", "react-window": "^1.8.10", @@ -203,7 +203,7 @@ "@types/react-router-dom": "^5.3.3", "@types/react-syntax-highlighter": "^15.5.13", "@types/react-table": "^7.7.20", - "@types/react-transition-group": "^4.4.10", + "@types/react-transition-group": "^4.4.12", "@types/react-ultimate-pagination": "^1.2.4", "@types/react-virtualized-auto-sizer": "^1.0.4", "@types/react-window": "^1.8.8", @@ -1714,15 +1714,18 @@ } }, "node_modules/@babel/helper-string-parser": { - "version": "7.24.8", - "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.24.8.tgz", - "integrity": "sha512-pO9KhhRcuUyGnJWwyEgnRJTSIZHiT+vMD0kPeD+so0l7mxkMT19g3pjY9GTnHySck/hDzq+dtW/4VgnMkippsQ==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.25.9.tgz", + "integrity": "sha512-4A/SCr/2KLd5jrtOMFzaKjVtAei3+2r/NChoBNoZ3EyP/+GlhoaEGoWOZUmFmoITP7zOJyHIMm+DYRd8o3PvHA==", + "license": "MIT", "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-validator-identifier": { - "version": "7.24.7", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.25.9.tgz", + "integrity": "sha512-Ed61U6XJc3CVRfkERJWDz4dJwKe7iLmmJsbOGu9wSloNSFttHV0I8g6UAgb7qnK5ly5bGLPd4oXZlxCdANBOWQ==", "license": "MIT", "engines": { "node": ">=6.9.0" @@ -3496,13 +3499,13 @@ "license": "MIT" }, "node_modules/@babel/types": { - "version": "7.25.2", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.25.2.tgz", - "integrity": "sha512-YTnYtra7W9e6/oAZEHj0bJehPRUlLH9/fbpT5LfB0NhQXyALCRkRs3zH9v07IYhkgpqX6Z78FnuccZr/l4Fs4Q==", + "version": "7.26.5", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.26.5.tgz", + "integrity": "sha512-L6mZmwFDK6Cjh1nRCLXpa6no13ZIioJDz7mdkzHv399pThrTa/k0nUlNaenOeh2kWu/iaOQYElEpKPUswUa9Vg==", + "license": "MIT", "dependencies": { - "@babel/helper-string-parser": "^7.24.8", - "@babel/helper-validator-identifier": "^7.24.7", - "to-fast-properties": "^2.0.0" + "@babel/helper-string-parser": "^7.25.9", + "@babel/helper-validator-identifier": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -13814,10 +13817,11 @@ } }, "node_modules/@types/react-transition-group": { - "version": "4.4.10", + "version": "4.4.12", + "resolved": "https://registry.npmjs.org/@types/react-transition-group/-/react-transition-group-4.4.12.tgz", + "integrity": "sha512-8TV6R3h2j7a91c+1DXdJi3Syo69zzIZbz7Lg5tORM5LEJG7X/E6a1V3drRyBRZq7/utz7A+c4OgYLiLcYGHG6w==", "dev": true, - "license": "MIT", - "dependencies": { + "peerDependencies": { "@types/react": "*" } }, @@ -22495,10 +22499,12 @@ } }, "node_modules/dom-helpers": { - "version": "3.4.0", - "license": "MIT", + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/dom-helpers/-/dom-helpers-5.2.1.tgz", + "integrity": "sha512-nRCa7CK3VTrM2NmGkIy4cbK7IZlgBE/PYMn55rrXefr5xXDP0LdtfPnblFDoVdcAfslJ7or6iqAUnx0CCGIWQA==", "dependencies": { - "@babel/runtime": "^7.1.2" + "@babel/runtime": "^7.8.7", + "csstype": "^3.0.2" } }, "node_modules/dom-serializer": { @@ -45819,17 +45825,18 @@ } }, "node_modules/react-transition-group": { - "version": "2.5.3", - "license": "BSD-3-Clause", + "version": "4.4.5", + "resolved": "https://registry.npmjs.org/react-transition-group/-/react-transition-group-4.4.5.tgz", + "integrity": "sha512-pZcd1MCJoiKiBR2NRxeCRg13uCXbydPnmB4EOeRrY7480qNWO8IIgQG6zlDkm6uRMsURXPuKq0GWtiM59a5Q6g==", "dependencies": { - "dom-helpers": "^3.3.1", + "@babel/runtime": "^7.5.5", + "dom-helpers": "^5.0.1", "loose-envify": "^1.4.0", - "prop-types": "^15.6.2", - "react-lifecycles-compat": "^3.0.4" + "prop-types": "^15.6.2" }, "peerDependencies": { - "react": ">=15.0.0", - "react-dom": ">=15.0.0" + "react": ">=16.6.0", + "react-dom": ">=16.6.0" } }, "node_modules/react-ultimate-pagination": { @@ -50919,13 +50926,6 @@ "dev": true, "license": "BSD-3-Clause" }, - "node_modules/to-fast-properties": { - "version": "2.0.0", - "license": "MIT", - "engines": { - "node": ">=4" - } - }, "node_modules/to-object-path": { "version": "0.3.0", "dev": true, @@ -56297,26 +56297,6 @@ "node": ">=6.9.0" } }, - "packages/superset-ui-demo/node_modules/@babel/helper-string-parser": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.25.9.tgz", - "integrity": "sha512-4A/SCr/2KLd5jrtOMFzaKjVtAei3+2r/NChoBNoZ3EyP/+GlhoaEGoWOZUmFmoITP7zOJyHIMm+DYRd8o3PvHA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6.9.0" - } - }, - "packages/superset-ui-demo/node_modules/@babel/helper-validator-identifier": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.25.9.tgz", - "integrity": "sha512-Ed61U6XJc3CVRfkERJWDz4dJwKe7iLmmJsbOGu9wSloNSFttHV0I8g6UAgb7qnK5ly5bGLPd4oXZlxCdANBOWQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6.9.0" - } - }, "packages/superset-ui-demo/node_modules/@babel/helper-validator-option": { "version": "7.25.9", "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.25.9.tgz", @@ -58309,26 +58289,6 @@ "react-dom": "^16.13.1" } }, - "plugins/plugin-chart-pivot-table/node_modules/@babel/helper-string-parser": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.25.9.tgz", - "integrity": "sha512-4A/SCr/2KLd5jrtOMFzaKjVtAei3+2r/NChoBNoZ3EyP/+GlhoaEGoWOZUmFmoITP7zOJyHIMm+DYRd8o3PvHA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6.9.0" - } - }, - "plugins/plugin-chart-pivot-table/node_modules/@babel/helper-validator-identifier": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.25.9.tgz", - "integrity": "sha512-Ed61U6XJc3CVRfkERJWDz4dJwKe7iLmmJsbOGu9wSloNSFttHV0I8g6UAgb7qnK5ly5bGLPd4oXZlxCdANBOWQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6.9.0" - } - }, "plugins/plugin-chart-pivot-table/node_modules/@babel/types": { "version": "7.26.3", "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.26.3.tgz", @@ -59449,12 +59409,14 @@ } }, "@babel/helper-string-parser": { - "version": "7.24.8", - "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.24.8.tgz", - "integrity": "sha512-pO9KhhRcuUyGnJWwyEgnRJTSIZHiT+vMD0kPeD+so0l7mxkMT19g3pjY9GTnHySck/hDzq+dtW/4VgnMkippsQ==" + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.25.9.tgz", + "integrity": "sha512-4A/SCr/2KLd5jrtOMFzaKjVtAei3+2r/NChoBNoZ3EyP/+GlhoaEGoWOZUmFmoITP7zOJyHIMm+DYRd8o3PvHA==" }, "@babel/helper-validator-identifier": { - "version": "7.24.7" + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.25.9.tgz", + "integrity": "sha512-Ed61U6XJc3CVRfkERJWDz4dJwKe7iLmmJsbOGu9wSloNSFttHV0I8g6UAgb7qnK5ly5bGLPd4oXZlxCdANBOWQ==" }, "@babel/helper-validator-option": { "version": "7.24.7", @@ -60507,13 +60469,12 @@ } }, "@babel/types": { - "version": "7.25.2", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.25.2.tgz", - "integrity": "sha512-YTnYtra7W9e6/oAZEHj0bJehPRUlLH9/fbpT5LfB0NhQXyALCRkRs3zH9v07IYhkgpqX6Z78FnuccZr/l4Fs4Q==", + "version": "7.26.5", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.26.5.tgz", + "integrity": "sha512-L6mZmwFDK6Cjh1nRCLXpa6no13ZIioJDz7mdkzHv399pThrTa/k0nUlNaenOeh2kWu/iaOQYElEpKPUswUa9Vg==", "requires": { - "@babel/helper-string-parser": "^7.24.8", - "@babel/helper-validator-identifier": "^7.24.7", - "to-fast-properties": "^2.0.0" + "@babel/helper-string-parser": "^7.25.9", + "@babel/helper-validator-identifier": "^7.25.9" } }, "@base2/pretty-print-object": { @@ -66764,18 +66725,6 @@ "integrity": "sha512-kSMlyUVdWe25rEsRGviIgOWnoT/nfABVWlqt9N19/dIPWViAOW2s9wznP5tURbs/IDuNk4gPy3YdYRgH3uxhBw==", "dev": true }, - "@babel/helper-string-parser": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.25.9.tgz", - "integrity": "sha512-4A/SCr/2KLd5jrtOMFzaKjVtAei3+2r/NChoBNoZ3EyP/+GlhoaEGoWOZUmFmoITP7zOJyHIMm+DYRd8o3PvHA==", - "dev": true - }, - "@babel/helper-validator-identifier": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.25.9.tgz", - "integrity": "sha512-Ed61U6XJc3CVRfkERJWDz4dJwKe7iLmmJsbOGu9wSloNSFttHV0I8g6UAgb7qnK5ly5bGLPd4oXZlxCdANBOWQ==", - "dev": true - }, "@babel/helper-validator-option": { "version": "7.25.9", "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.25.9.tgz", @@ -68904,18 +68853,6 @@ "jest": "^29.7.0" }, "dependencies": { - "@babel/helper-string-parser": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.25.9.tgz", - "integrity": "sha512-4A/SCr/2KLd5jrtOMFzaKjVtAei3+2r/NChoBNoZ3EyP/+GlhoaEGoWOZUmFmoITP7zOJyHIMm+DYRd8o3PvHA==", - "dev": true - }, - "@babel/helper-validator-identifier": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.25.9.tgz", - "integrity": "sha512-Ed61U6XJc3CVRfkERJWDz4dJwKe7iLmmJsbOGu9wSloNSFttHV0I8g6UAgb7qnK5ly5bGLPd4oXZlxCdANBOWQ==", - "dev": true - }, "@babel/types": { "version": "7.26.3", "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.26.3.tgz", @@ -70091,11 +70028,11 @@ } }, "@types/react-transition-group": { - "version": "4.4.10", + "version": "4.4.12", + "resolved": "https://registry.npmjs.org/@types/react-transition-group/-/react-transition-group-4.4.12.tgz", + "integrity": "sha512-8TV6R3h2j7a91c+1DXdJi3Syo69zzIZbz7Lg5tORM5LEJG7X/E6a1V3drRyBRZq7/utz7A+c4OgYLiLcYGHG6w==", "dev": true, - "requires": { - "@types/react": "^16.9.53" - } + "requires": {} }, "@types/react-ultimate-pagination": { "version": "1.2.4", @@ -76026,9 +75963,12 @@ } }, "dom-helpers": { - "version": "3.4.0", + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/dom-helpers/-/dom-helpers-5.2.1.tgz", + "integrity": "sha512-nRCa7CK3VTrM2NmGkIy4cbK7IZlgBE/PYMn55rrXefr5xXDP0LdtfPnblFDoVdcAfslJ7or6iqAUnx0CCGIWQA==", "requires": { - "@babel/runtime": "^7.1.2" + "@babel/runtime": "^7.8.7", + "csstype": "^3.0.2" } }, "dom-serializer": { @@ -90623,12 +90563,14 @@ } }, "react-transition-group": { - "version": "2.5.3", + "version": "4.4.5", + "resolved": "https://registry.npmjs.org/react-transition-group/-/react-transition-group-4.4.5.tgz", + "integrity": "sha512-pZcd1MCJoiKiBR2NRxeCRg13uCXbydPnmB4EOeRrY7480qNWO8IIgQG6zlDkm6uRMsURXPuKq0GWtiM59a5Q6g==", "requires": { - "dom-helpers": "^3.3.1", + "@babel/runtime": "^7.5.5", + "dom-helpers": "^5.0.1", "loose-envify": "^1.4.0", - "prop-types": "^15.6.2", - "react-lifecycles-compat": "^3.0.4" + "prop-types": "^15.6.2" } }, "react-ultimate-pagination": { @@ -93957,9 +93899,6 @@ "version": "1.0.5", "dev": true }, - "to-fast-properties": { - "version": "2.0.0" - }, "to-object-path": { "version": "0.3.0", "dev": true, diff --git a/superset-frontend/package.json b/superset-frontend/package.json index a71e64ac80f60..7b8aee659123d 100644 --- a/superset-frontend/package.json +++ b/superset-frontend/package.json @@ -192,7 +192,7 @@ "react-split": "^2.0.9", "react-syntax-highlighter": "^15.4.5", "react-table": "^7.8.0", - "react-transition-group": "^2.5.3", + "react-transition-group": "^4.4.5", "react-ultimate-pagination": "^1.3.2", "react-virtualized-auto-sizer": "^1.0.25", "react-window": "^1.8.10", @@ -270,7 +270,7 @@ "@types/react-router-dom": "^5.3.3", "@types/react-syntax-highlighter": "^15.5.13", "@types/react-table": "^7.7.20", - "@types/react-transition-group": "^4.4.10", + "@types/react-transition-group": "^4.4.12", "@types/react-ultimate-pagination": "^1.2.4", "@types/react-virtualized-auto-sizer": "^1.0.4", "@types/react-window": "^1.8.8", diff --git a/superset-frontend/packages/superset-ui-core/src/models/Registry.ts b/superset-frontend/packages/superset-ui-core/src/models/Registry.ts index 53aff08c4a415..7488ab82459fc 100644 --- a/superset-frontend/packages/superset-ui-core/src/models/Registry.ts +++ b/superset-frontend/packages/superset-ui-core/src/models/Registry.ts @@ -22,11 +22,11 @@ export enum OverwritePolicy { Warn = 'WARN', } -interface ItemWithValue { +export interface ItemWithValue { value: T; } -interface ItemWithLoader { +export interface ItemWithLoader { loader: () => T; } diff --git a/superset-frontend/packages/superset-ui-core/src/style/index.tsx b/superset-frontend/packages/superset-ui-core/src/style/index.tsx index ee0b6e10ac419..c4964172be622 100644 --- a/superset-frontend/packages/superset-ui-core/src/style/index.tsx +++ b/superset-frontend/packages/superset-ui-core/src/style/index.tsx @@ -98,13 +98,6 @@ const defaultTheme = { light2: '#FAEDEE', }, warning: { - base: '#FF7F44', - dark1: '#BF5E33', - dark2: '#7F3F21', - light1: '#FEC0A1', - light2: '#FFF2EC', - }, - alert: { base: '#FCC700', dark1: '#BC9501', dark2: '#7D6300', diff --git a/superset-frontend/packages/superset-ui-core/src/ui-overrides/types.ts b/superset-frontend/packages/superset-ui-core/src/ui-overrides/types.ts index 775e2c129ad15..3f0ff82b2fcb5 100644 --- a/superset-frontend/packages/superset-ui-core/src/ui-overrides/types.ts +++ b/superset-frontend/packages/superset-ui-core/src/ui-overrides/types.ts @@ -134,13 +134,14 @@ export interface SQLFormExtensionProps { startQuery: (ctasArg?: any, ctas_method?: any) => void; } -export interface SQLResultTableExtentionProps { +export interface SQLResultTableExtensionProps { queryId: string; orderedColumnKeys: string[]; data: Record[]; height: number; filterText?: string; expandedColumns?: string[]; + allowHTML?: boolean; } /** @@ -223,7 +224,7 @@ export type Extensions = Partial<{ 'database.delete.related': ComponentType; 'dataset.delete.related': ComponentType; 'sqleditor.extension.form': ComponentType; - 'sqleditor.extension.resultTable': ComponentType; + 'sqleditor.extension.resultTable': ComponentType; 'dashboard.slice.header': ComponentType; 'sqleditor.extension.customAutocomplete': ( args: CustomAutoCompleteArgs, diff --git a/superset-frontend/packages/superset-ui-core/src/utils/featureFlags.ts b/superset-frontend/packages/superset-ui-core/src/utils/featureFlags.ts index 34e8d51f27fd7..34799d3c52324 100644 --- a/superset-frontend/packages/superset-ui-core/src/utils/featureFlags.ts +++ b/superset-frontend/packages/superset-ui-core/src/utils/featureFlags.ts @@ -35,7 +35,6 @@ export enum FeatureFlag { DashboardVirtualization = 'DASHBOARD_VIRTUALIZATION', DashboardRbac = 'DASHBOARD_RBAC', DatapanelClosedByDefault = 'DATAPANEL_CLOSED_BY_DEFAULT', - DisableLegacyDatasourceEditor = 'DISABLE_LEGACY_DATASOURCE_EDITOR', /** @deprecated */ DrillToDetail = 'DRILL_TO_DETAIL', DrillBy = 'DRILL_BY', diff --git a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/plugin-chart-table/birthNames.json b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/plugin-chart-table/birthNames.json index c35d3a80665fc..bce7fca54a815 100644 --- a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/plugin-chart-table/birthNames.json +++ b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/plugin-chart-table/birthNames.json @@ -30,7 +30,6 @@ "cache_timeout": null, "params": null, "perm": "[examples].[birth_names](id:3)", - "edit_url": "/tablemodelview/edit/3", "sql": null, "columns": [ { diff --git a/superset-frontend/plugins/legacy-plugin-chart-calendar/src/ReactCalendar.jsx b/superset-frontend/plugins/legacy-plugin-chart-calendar/src/ReactCalendar.jsx index f3fcc807d8a04..46cb1de852ada 100644 --- a/superset-frontend/plugins/legacy-plugin-chart-calendar/src/ReactCalendar.jsx +++ b/superset-frontend/plugins/legacy-plugin-chart-calendar/src/ReactCalendar.jsx @@ -157,13 +157,13 @@ export default styled(Calendar)` } .cal-heatmap-container .q1 { - background-color: ${theme.colors.alert.light2}; - fill: ${theme.colors.alert.light2}; + background-color: ${theme.colors.warning.light2}; + fill: ${theme.colors.warning.light2}; } .cal-heatmap-container .q2 { - background-color: ${theme.colors.alert.light1}; - fill: ${theme.colors.alert.light1}; + background-color: ${theme.colors.warning.light1}; + fill: ${theme.colors.warning.light1}; } .cal-heatmap-container .q3 { diff --git a/superset-frontend/spec/fixtures/mockDatasource.js b/superset-frontend/spec/fixtures/mockDatasource.js index 21a5805519b67..29f525fa8c8ca 100644 --- a/superset-frontend/spec/fixtures/mockDatasource.js +++ b/superset-frontend/spec/fixtures/mockDatasource.js @@ -199,6 +199,5 @@ export default { ['["num_girls", false]', 'num_girls [desc]'], ], type: 'table', - edit_url: '/tablemodelview/edit/7', }, }; diff --git a/superset-frontend/src/GlobalStyles.tsx b/superset-frontend/src/GlobalStyles.tsx index b65cc6d35b2b2..8e36721571173 100644 --- a/superset-frontend/src/GlobalStyles.tsx +++ b/superset-frontend/src/GlobalStyles.tsx @@ -39,11 +39,16 @@ export const GlobalStyles = () => ( .echarts-tooltip[style*='visibility: hidden'] { display: none !important; } + // Ant Design is applying inline z-index styles causing troubles + // TODO: Remove z-indexes when Ant Design is fully upgraded to v5 + // Prefer vanilla Ant Design z-indexes that should work out of the box .ant-popover, .antd5-dropdown, .ant-dropdown, - .ant-select-dropdown { - z-index: ${theme.zIndex.max}; + .ant-select-dropdown, + .antd5-modal-wrap, + .antd5-modal-mask { + z-index: ${theme.zIndex.max} !important; } // TODO: Remove when buttons have been upgraded to Ant Design 5. diff --git a/superset-frontend/src/SqlLab/components/QueryHistory/index.tsx b/superset-frontend/src/SqlLab/components/QueryHistory/index.tsx index 30103dafa566c..6916e1e19b1a5 100644 --- a/superset-frontend/src/SqlLab/components/QueryHistory/index.tsx +++ b/superset-frontend/src/SqlLab/components/QueryHistory/index.tsx @@ -20,7 +20,7 @@ import { useEffect, useMemo, useState } from 'react'; import { shallowEqual, useSelector } from 'react-redux'; import { useInView } from 'react-intersection-observer'; import { omit } from 'lodash'; -import { EmptyStateMedium } from 'src/components/EmptyState'; +import { EmptyState } from 'src/components/EmptyState'; import { t, styled, @@ -143,8 +143,9 @@ const QueryHistory = ({ ) : ( - diff --git a/superset-frontend/src/SqlLab/components/QueryTable/QueryTable.test.tsx b/superset-frontend/src/SqlLab/components/QueryTable/QueryTable.test.tsx index 4be4c995452c5..d10d926b11131 100644 --- a/superset-frontend/src/SqlLab/components/QueryTable/QueryTable.test.tsx +++ b/superset-frontend/src/SqlLab/components/QueryTable/QueryTable.test.tsx @@ -19,12 +19,10 @@ import { isValidElement } from 'react'; import thunk from 'redux-thunk'; import configureStore from 'redux-mock-store'; -import { styledMount as mount } from 'spec/helpers/theming'; import QueryTable from 'src/SqlLab/components/QueryTable'; -import TableView from 'src/components/TableView'; -import TableCollection from 'src/components/TableCollection'; import { Provider } from 'react-redux'; import { runningQuery, successfulQuery, user } from 'src/SqlLab/fixtures'; +import { render, screen } from 'spec/helpers/testing-library'; const mockedProps = { queries: [runningQuery, successfulQuery], @@ -43,15 +41,15 @@ test('renders a proper table', () => { user, }); - const wrapper = mount( + const { container } = render( , ); - const tableWrapper = wrapper.find(TableView).find(TableCollection); - expect(wrapper.find(TableView)).toExist(); - expect(tableWrapper.find('table')).toExist(); - expect(tableWrapper.find('table').find('thead').find('tr')).toHaveLength(1); - expect(tableWrapper.find('table').find('tbody').find('tr')).toHaveLength(2); + expect(screen.getByTestId('listview-table')).toBeVisible(); // Presence of TableCollection + expect(screen.getByRole('table')).toBeVisible(); + expect(container.querySelector('.table-condensed')).toBeVisible(); // Presence of TableView signature class + expect(container.querySelectorAll('table > thead > tr')).toHaveLength(1); + expect(container.querySelectorAll('table > tbody > tr')).toHaveLength(2); }); diff --git a/superset-frontend/src/SqlLab/components/SouthPane/Results.tsx b/superset-frontend/src/SqlLab/components/SouthPane/Results.tsx index 3dfec40bdc037..6a2a60831bf74 100644 --- a/superset-frontend/src/SqlLab/components/SouthPane/Results.tsx +++ b/superset-frontend/src/SqlLab/components/SouthPane/Results.tsx @@ -19,7 +19,7 @@ import { FC } from 'react'; import { shallowEqual, useSelector } from 'react-redux'; import Alert from 'src/components/Alert'; -import { EmptyStateMedium } from 'src/components/EmptyState'; +import { EmptyState } from 'src/components/EmptyState'; import { FeatureFlag, styled, t, isFeatureEnabled } from '@superset-ui/core'; import { SqlLabRootState } from 'src/SqlLab/types'; @@ -67,7 +67,7 @@ const Results: FC = ({ ) { return ( - diff --git a/superset-frontend/src/SqlLab/components/SqlEditor/index.tsx b/superset-frontend/src/SqlLab/components/SqlEditor/index.tsx index ab4797d51327e..0c3276624efdf 100644 --- a/superset-frontend/src/SqlLab/components/SqlEditor/index.tsx +++ b/superset-frontend/src/SqlLab/components/SqlEditor/index.tsx @@ -101,7 +101,7 @@ import { LocalStorageKeys, setItem, } from 'src/utils/localStorageHelpers'; -import { EmptyStateBig } from 'src/components/EmptyState'; +import { EmptyState } from 'src/components/EmptyState'; import Alert from 'src/components/Alert'; import getBootstrapData from 'src/utils/getBootstrapData'; import useLogAction from 'src/logger/useLogAction'; @@ -972,8 +972,9 @@ const SqlEditor: FC = ({ ) : showEmptyState && !hasSqlStatement ? ( - ( null, ); @@ -249,7 +249,7 @@ const SqlEditorLeftBar = ({ } database={userSelectedDb} getDbList={handleDbList} handleError={handleError} diff --git a/superset-frontend/src/SqlLab/components/TabbedSqlEditors/index.tsx b/superset-frontend/src/SqlLab/components/TabbedSqlEditors/index.tsx index 3105aa94bda53..a9360ad655e32 100644 --- a/superset-frontend/src/SqlLab/components/TabbedSqlEditors/index.tsx +++ b/superset-frontend/src/SqlLab/components/TabbedSqlEditors/index.tsx @@ -27,7 +27,7 @@ import { Logger } from 'src/logger/LogUtils'; import { Tooltip } from 'src/components/Tooltip'; import { detectOS } from 'src/utils/common'; import * as Actions from 'src/SqlLab/actions/sqlLab'; -import { EmptyStateBig } from 'src/components/EmptyState'; +import { EmptyState } from 'src/components/EmptyState'; import getBootstrapData from 'src/utils/getBootstrapData'; import { locationContext } from 'src/pages/SqlLab/LocationContext'; import SqlEditor from '../SqlEditor'; @@ -259,8 +259,9 @@ class TabbedSqlEditors extends PureComponent { tab={emptyTab} closable={false} > - diff --git a/superset-frontend/src/assets/images/chart.svg b/superset-frontend/src/assets/images/chart.svg index 2267342bccd1f..34e45631e08d8 100644 --- a/superset-frontend/src/assets/images/chart.svg +++ b/superset-frontend/src/assets/images/chart.svg @@ -16,7 +16,7 @@ KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> - - - + + + diff --git a/superset-frontend/src/assets/images/document.svg b/superset-frontend/src/assets/images/document.svg index e3d1bfe1beb28..552fc8d220b34 100644 --- a/superset-frontend/src/assets/images/document.svg +++ b/superset-frontend/src/assets/images/document.svg @@ -17,6 +17,6 @@ specific language governing permissions and limitations under the License. --> - - + + diff --git a/superset-frontend/src/assets/images/empty-charts.svg b/superset-frontend/src/assets/images/empty-charts.svg index b4cdd99086c76..8c7b205d2a904 100644 --- a/superset-frontend/src/assets/images/empty-charts.svg +++ b/superset-frontend/src/assets/images/empty-charts.svg @@ -16,15 +16,15 @@ KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> - - - - - - - - - - - + + + + + + + diff --git a/superset-frontend/src/assets/images/empty-dashboard.svg b/superset-frontend/src/assets/images/empty-dashboard.svg index c76eca0c30aaa..2acf05c801186 100644 --- a/superset-frontend/src/assets/images/empty-dashboard.svg +++ b/superset-frontend/src/assets/images/empty-dashboard.svg @@ -16,11 +16,11 @@ KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> - - - - - - - + + + + + + + diff --git a/superset-frontend/src/assets/images/empty-dataset.svg b/superset-frontend/src/assets/images/empty-dataset.svg index 5ce1752545b29..9a0299d3b422d 100644 --- a/superset-frontend/src/assets/images/empty-dataset.svg +++ b/superset-frontend/src/assets/images/empty-dataset.svg @@ -16,23 +16,24 @@ KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + diff --git a/superset-frontend/src/assets/images/empty-queries.svg b/superset-frontend/src/assets/images/empty-queries.svg index 2239c0ae8e920..1d2d8b00f229f 100644 --- a/superset-frontend/src/assets/images/empty-queries.svg +++ b/superset-frontend/src/assets/images/empty-queries.svg @@ -16,20 +16,20 @@ KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> - - - - + + + + - + - - - + + + diff --git a/superset-frontend/src/assets/images/empty-query.svg b/superset-frontend/src/assets/images/empty-query.svg index be72857d8e5c4..a19fc73eebfa9 100644 --- a/superset-frontend/src/assets/images/empty-query.svg +++ b/superset-frontend/src/assets/images/empty-query.svg @@ -16,10 +16,10 @@ KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> - - - - - - + + + + + + diff --git a/superset-frontend/src/assets/images/empty-table.svg b/superset-frontend/src/assets/images/empty-table.svg index c1062502f39dc..9079b07114cab 100644 --- a/superset-frontend/src/assets/images/empty-table.svg +++ b/superset-frontend/src/assets/images/empty-table.svg @@ -16,7 +16,7 @@ KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> - - - + + + diff --git a/superset-frontend/src/assets/images/empty.svg b/superset-frontend/src/assets/images/empty.svg index e2c78339ce64c..b503324f6764f 100644 --- a/superset-frontend/src/assets/images/empty.svg +++ b/superset-frontend/src/assets/images/empty.svg @@ -16,7 +16,7 @@ KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> - - - + + + diff --git a/superset-frontend/src/assets/images/empty_sql_chart.svg b/superset-frontend/src/assets/images/empty_sql_chart.svg index 6ab969575c9db..b729b471a6562 100644 --- a/superset-frontend/src/assets/images/empty_sql_chart.svg +++ b/superset-frontend/src/assets/images/empty_sql_chart.svg @@ -16,7 +16,7 @@ KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> - - - + + + diff --git a/superset-frontend/src/assets/images/filter-results.svg b/superset-frontend/src/assets/images/filter-results.svg index 770a54b34f37f..7244f5538b262 100644 --- a/superset-frontend/src/assets/images/filter-results.svg +++ b/superset-frontend/src/assets/images/filter-results.svg @@ -16,19 +16,56 @@ KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> - - - - - - - - - - - - - - - + + + + + + diff --git a/superset-frontend/src/assets/images/filter.svg b/superset-frontend/src/assets/images/filter.svg index 0e1f6b41efc3d..2e8c5e0f0991a 100644 --- a/superset-frontend/src/assets/images/filter.svg +++ b/superset-frontend/src/assets/images/filter.svg @@ -16,17 +16,43 @@ KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> - - - - - - - - - - - - - + + + + + + + diff --git a/superset-frontend/src/assets/images/star-circle.svg b/superset-frontend/src/assets/images/star-circle.svg index a46a1dd0fb81c..d9e6c77e2c5c0 100644 --- a/superset-frontend/src/assets/images/star-circle.svg +++ b/superset-frontend/src/assets/images/star-circle.svg @@ -16,7 +16,7 @@ KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> - - - + + + diff --git a/superset-frontend/src/assets/images/union.svg b/superset-frontend/src/assets/images/union.svg index 6ac0e0f01621b..9ccf437b225a8 100644 --- a/superset-frontend/src/assets/images/union.svg +++ b/superset-frontend/src/assets/images/union.svg @@ -16,7 +16,7 @@ KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> - - - + + + diff --git a/superset-frontend/src/assets/images/vector.svg b/superset-frontend/src/assets/images/vector.svg index 0bf9c39c6ccb0..d2f946e8107a7 100644 --- a/superset-frontend/src/assets/images/vector.svg +++ b/superset-frontend/src/assets/images/vector.svg @@ -16,6 +16,6 @@ KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> - - + + diff --git a/superset-frontend/src/components/Alert/Alert.stories.tsx b/superset-frontend/src/components/Alert/Alert.stories.tsx index 9aff2afee617b..649abaa16a95d 100644 --- a/superset-frontend/src/components/Alert/Alert.stories.tsx +++ b/superset-frontend/src/components/Alert/Alert.stories.tsx @@ -46,17 +46,6 @@ export const AlertGallery = () => ( message={smallText} description={bigText} closable - closeIcon={ - - x - - } /> diff --git a/superset-frontend/src/components/Alert/Alert.test.tsx b/superset-frontend/src/components/Alert/Alert.test.tsx index 89f221e0c5eb1..f7cb342a75d54 100644 --- a/superset-frontend/src/components/Alert/Alert.test.tsx +++ b/superset-frontend/src/components/Alert/Alert.test.tsx @@ -27,19 +27,17 @@ test('renders with default props', async () => { render(); expect(screen.getByRole('alert')).toHaveTextContent('Message'); - expect(await screen.findByLabelText('info icon')).toBeInTheDocument(); - expect(await screen.findByLabelText('close icon')).toBeInTheDocument(); + expect(screen.getByRole('img', { name: 'info-circle' })).toBeInTheDocument(); }); -test('renders each type', async () => { +test('renders message for each alert type', () => { const types: AlertTypeValue[] = ['info', 'error', 'warning', 'success']; - await Promise.all( - types.map(async type => { - render(); - expect(await screen.findByLabelText(`${type} icon`)).toBeInTheDocument(); - }), - ); + types.forEach(type => { + const { rerender } = render(); + expect(screen.getByText('Test message')).toBeInTheDocument(); + rerender(<>); // Clean up between renders + }); }); test('renders without close button', async () => { @@ -51,7 +49,7 @@ test('renders without close button', async () => { test('disappear when closed', async () => { render(); - userEvent.click(screen.getByLabelText('close icon')); + userEvent.click(screen.getByRole('img', { name: 'close' })); await waitFor(() => { expect(screen.queryByRole('alert')).not.toBeInTheDocument(); }); @@ -74,6 +72,6 @@ test('renders message and description', async () => { test('calls onClose callback when closed', () => { const onCloseMock = jest.fn(); render(); - userEvent.click(screen.getByLabelText('close icon')); + userEvent.click(screen.getByRole('img', { name: 'close' })); expect(onCloseMock).toHaveBeenCalledTimes(1); }); diff --git a/superset-frontend/src/components/Alert/index.tsx b/superset-frontend/src/components/Alert/index.tsx index 6a85739950fa3..b8fb872b6a24d 100644 --- a/superset-frontend/src/components/Alert/index.tsx +++ b/superset-frontend/src/components/Alert/index.tsx @@ -19,8 +19,6 @@ import { PropsWithChildren } from 'react'; import { Alert as AntdAlert } from 'antd-v5'; import { AlertProps as AntdAlertProps } from 'antd-v5/lib/alert'; -import { css, useTheme } from '@superset-ui/core'; -import Icons from 'src/components/Icons'; export type AlertProps = PropsWithChildren< Omit & { roomBelow?: boolean } @@ -32,60 +30,20 @@ export default function Alert(props: AlertProps) { description, showIcon = true, closable = true, - roomBelow = false, children, + ...rest } = props; - const theme = useTheme(); - const { colors } = theme; - const { alert: alertColor, error, info, success } = colors; - - let baseColor = info; - let AlertIcon = Icons.InfoSolid; - if (type === 'error') { - baseColor = error; - AlertIcon = Icons.ErrorSolid; - } else if (type === 'warning') { - baseColor = alertColor; - AlertIcon = Icons.AlertSolid; - } else if (type === 'success') { - baseColor = success; - AlertIcon = Icons.CircleCheckSolid; - } - return ( - - - ) - } - closeIcon={closable && } + closable={closable} message={children || 'Default message'} description={description} - css={css` - margin-bottom: ${roomBelow ? theme.gridUnit * 4 : 0}px; - a { - text-decoration: underline; - } - .antd5-alert-message { - font-weight: ${description - ? theme.typography.weights.bold - : 'inherit'}; - } - `} - {...props} + {...rest} /> ); } diff --git a/superset-frontend/src/components/AlteredSliceTag/index.tsx b/superset-frontend/src/components/AlteredSliceTag/index.tsx index 9aca6b46b84df..46fc58b3ffef8 100644 --- a/superset-frontend/src/components/AlteredSliceTag/index.tsx +++ b/superset-frontend/src/components/AlteredSliceTag/index.tsx @@ -221,7 +221,7 @@ const AlteredSliceTag: FC = props => {