You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by di...@apache.org on 2023/02/21 11:40:23 UTC
[superset] branch feat/cross-filters-sidebar updated (6f8418b992 -> 4349dfd6a4)
This is an automated email from the ASF dual-hosted git repository.
diegopucci pushed a change to branch feat/cross-filters-sidebar
in repository https://gitbox.apache.org/repos/asf/superset.git
from 6f8418b992 Initial implementation
add b35190783c chore(welcome): change default last tab to "all" (#22798)
add ed7b3533bc fix(explore): Time comparison in Mixed Chart in GENERIC_CHART_AXES not working (#22945)
add c53c3aa23d chore(superset-ui-chart-controls): refactor pivot and rename operator (#22963)
add deb51090d2 build(deps): bump http-cache-semantics from 4.1.0 to 4.1.1 in /superset-frontend (#22958)
add ad1ffbd723 fix(explore): unable to update linked charts (#22896)
add 78ede590ee chore(frontend): Spelling (#19676)
add 56d4bd063c chore: add waitress for win32 platform (#22935)
add 4b05a1eddd fix(datasets): Include expression and description in duplicated dataset columns (#22943)
add c05871eb37 feat: add tabs to edit dataset page (#22043)
add deba0fd7c1 docs: add Caizin to the user list (#22961)
add 39f15b8d95 test: Fix act errors in DatabaseList test (#22970)
add 4970df0a65 test: Clean up QueryList test warnings (#22972)
add 32d497785a fix(native-filters): Don't include description icon in truncation calc (#22941)
add b63ea6386f fix: Prevents last temporal filter removal (#22982)
add 5d550f449a fix(explore): Mark time range dashboard filter with warning icon (#22984)
add a299b4789b docs(alerts & reports): clarify nature of "-dev" labeled container images (#22988)
add ae155611dc chore: bump python version to 3.8.16 in Dockerfile (#22934)
add c9b9b7404a fix: Form data was not being passed to save/update slice (#22989)
add cf395ac2d8 feat(ssh_tunnel): SSH Tunnel Switch extension (#22967)
add 5bafb5c950 chore: Fix grammar (#22831)
add 79114bcd29 docs: added Orange inside the inthewild.md doc (#22986)
add 7a0f350028 fix: add new config to allow for specific import data urls (#22942)
add 2dff0009e9 build(deps): bump pre-commit from 2.20.0 to 3.0.4 in /requirements (#22996)
add 7d5c86b44c fix(explore): Save button incorrectly disabled when adding new metric with dnd (#23000)
add aa0a07859e build(deps): bump http-cache-semantics from 4.1.0 to 4.1.1 in /docs (#22956)
add 9dfaad772d fix: Make cte_alias a property of db engine spec (#22947)
add a2c3ef8130 fix(migrations): Flask-Migrate output is not logged during alembic migrations #17991 (#22991)
add efe6d22d4a fix(dashboard): export & import chart description and certification details (#22471)
add ce6dd158a1 chore: updating link to sandbox.js (#23005)
add a1b7eb3870 fix(sqllab): clean unwanted scrollbar (#22990)
add 773d2a54a3 chore: Localization of superset pt. 3 (#22938)
add c5b25ebf17 chore(deps): bump ajv and react-jsonschema-form in /superset-frontend (#21809)
add 1a34876e35 build(deps-dev): bump eslint-config-prettier from 7.2.0 to 8.6.0 in /superset-websocket (#22767)
add b12bb568ac build(deps): bump http-cache-semantics from 4.1.0 to 4.1.1 in /superset-frontend/cypress-base (#22955)
add 50f1e2ee29 build(deps-dev): bump @types/node from 18.11.13 to 18.11.19 in /superset-websocket (#22997)
add 32fac77b5f feat(datasets): Populate Usage tab in Edit Dataset view (#22670)
add 4f590befae build(deps-dev): bump @typescript-eslint/parser from 5.48.1 to 5.51.0 in /superset-websocket (#23013)
add 438cd1c150 build(deps-dev): bump typescript from 4.9.4 to 4.9.5 in /superset-websocket (#22933)
add 183c5f9589 chore(tests): Cypress optimizations to help with fails (#23023)
add 493181c977 chore: refactor SliceAdder for react 17 and react 18 (#23009)
add 98bf878d6e fix(explore): Enable saving metric after changing title (#23020)
add 7bb9b810ee fix: dataset import error message (#23025)
add ddd8d17aa4 fix(ssh_tunnel): Fix bug on database edition for databases with ssh tunnels (#23006)
add 5e64211bdb fix: Handles disabled options on Select All (#22830)
add 684b8888b1 fix(dashboard): Stop updating chart owners for charts removed from dashboard (#21720)
add 85f07798bf docs(teradata): fix connection string (#23051)
add 464ddee4b4 fix: Time Column on Generic X-axis (#23021)
add 17fbb2dbb2 fix: Menu items are not disappearing when deleting a dashboard (#23039)
add a7bb14e433 fix(i18n): improve Russian translation (#22939)
add d3d59ee0ae fix(sqllab): Invalid schema fetch by deprecated value (#22968)
add 49aa9b4ca8 chore: Removes icon warnings from tests (#23054)
add 4980621902 feat(sqllab): Add event logger (#23040)
add f3bdcdc79b chore(datasets): Refactor DatasetDAO update to leverage bulk logic for create, update, and delete operations (#22957)
add 65fffe974b chore: remove db_engines (#22444)
add a307223857 feat(helm): allow persisting nodePort for services (#22713)
add 52da9fcbe7 build(deps-dev): bump @typescript-eslint/eslint-plugin from 5.49.0 to 5.52.0 in /superset-websocket (#23073)
add 50ae48103e build(deps): bump hot-shots from 9.3.0 to 10.0.0 in /superset-websocket (#23031)
add c59a77e3ca build(deps-dev): bump prettier from 2.8.3 to 2.8.4 in /superset-websocket (#23030)
add 0ec1e6e0b4 build(deps-dev): bump @types/node from 18.11.19 to 18.13.0 in /superset-websocket (#23029)
add e755b4f417 fix: cache warmup solution non legacy charts. (#23012)
add 7d7e3e4ade docs: remove duplicate navbar item (#22486)
add 3fae7dbc34 chore: Migrate get_or_create_table endpoint to api v1 (#22931)
add e5a4c78dc7 chore: Migrate /superset/csv/<client_id> to API v1 (#22913)
add c39cf36d27 fix: css template permissions for gamma role (#23083)
add f46aacae71 build(deps): bump ws from 8.12.0 to 8.12.1 in /superset-websocket (#23080)
add a7dac13ded build(deps-dev): bump eslint from 8.33.0 to 8.34.0 in /superset-websocket (#23079)
add 1324135697 chore(style): make brand icon max width customizable (#23081)
add 76f7a3fb4e chore: Remove dependency warnings from SqlEditorLeftBar/index.tsx (#22975)
add 861ecf65d4 chore: Remove dependency warnings from SqlEditor/index.jsx (#22974)
add 5b5b534e89 chore: Remove dependency warnings from DatasetList.tsx (#22973)
add b1296a195c test: Convert DatasetList test from jsx to tsx (#22971)
add f6c304437a test: Clean up SelectAsyncControl test warnings (#22969)
add 4ddf67fc14 chore: move dashboard screenshot standalone logic (#23003)
add 21dd1601bf fix: dict bug on QueryContextFactory (#23093)
add f4ffed24ba chore: Improve greeting message (#23077)
new 55c601566b Merge branch 'master' of https://github.com/apache/superset into feat/cross-filters-sidebar
new 4349dfd6a4 Add vertical truncation
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:
.github/workflows/welcome-new-users.yml | 3 +-
Dockerfile | 2 +-
RESOURCES/INTHEWILD.md | 2 +
UPDATING.md | 1 +
.../docs/databases/installing-database-drivers.mdx | 2 +-
docs/docs/databases/teradata.mdx | 2 +-
docs/docs/installation/alerts-reports.mdx | 2 +
.../installing-superset-from-scratch.mdx | 2 +-
docs/docusaurus.config.js | 4 -
docs/static/resources/openapi.json | 90 +-
docs/yarn.lock | 6 +-
helm/superset/Chart.yaml | 2 +-
helm/superset/README.md | 5 +-
helm/superset/templates/service.yaml | 9 +
helm/superset/values.yaml | 9 +
requirements/integration.txt | 20 +-
scripts/generate_frontend_ts_tasklist.js | 4 +-
setup.py | 3 +-
.../cypress/integration/dashboard/load.test.ts | 2 +-
.../integration/dashboard/nativeFilters.test.ts | 2 +-
.../cypress/integration/dashboard/utils.ts | 2 +-
.../cypress-base/cypress/support/directories.ts | 12 +-
superset-frontend/cypress-base/package-lock.json | 12 +-
superset-frontend/jest.config.js | 2 +-
superset-frontend/package-lock.json | 123 +-
superset-frontend/package.json | 3 +-
.../templates/src/plugin/controlPanel.erb | 4 +-
.../src/operators/pivotOperator.ts | 3 +-
.../src/operators/renameOperator.ts | 20 +-
.../src/operators/timeCompareOperator.ts | 4 +-
.../src/operators/timeComparePivotOperator.ts | 3 +-
.../src/operators/utils/isDerivedSeries.ts | 4 +-
.../src/operators/utils/isTimeComparison.ts | 4 +-
.../src/sections/advancedAnalytics.tsx | 10 +-
.../components/ColumnConfigControl/constants.tsx | 2 +-
.../src/shared-controls/sharedControls.tsx | 4 +-
.../superset-ui-chart-controls/src/types.ts | 4 +-
.../src/utils/D3Formatting.ts | 7 +
.../src/utils/expandControlConfig.tsx | 2 +-
.../test/operators/pivotOperator.test.ts | 31 +-
.../test/operators/renameOperator.test.ts | 33 +-
.../test/operators/rollingWindowOperator.test.ts | 4 +-
.../test/operators/timeCompareOperator.test.ts | 4 +-
.../operators/timeComparePivotOperator.test.ts | 39 +
.../test/operators/utils/isDerivedSeries.test.ts | 18 +-
.../src/chart/components/SuperChart.tsx | 2 +-
.../superset-ui-core/src/math-expression/index.ts | 2 +-
.../src/query/buildQueryContext.ts | 17 +-
.../superset-ui-core/src/query/buildQueryObject.ts | 2 +-
.../superset-ui-core/src/query/normalizeOrderBy.ts | 2 +-
.../src/query/types/AdvancedAnalytics.ts | 4 +-
.../src/query/types/PostProcessing.ts | 6 +-
.../packages/superset-ui-core/src/style/index.tsx | 1 +
.../superset-ui-core/src/translation/index.ts | 2 +-
.../src/ui-overrides/ExtensionsRegistry.ts | 11 +
.../superset-ui-core/test/models/Registry.test.ts | 2 +-
.../factories/createD3NumberFormatter.test.ts | 2 +-
.../test/query/buildQueryContext.test.ts | 37 -
.../test/query/types/PostProcessing.test.ts | 4 +-
.../packages/superset-ui-core/types/external.d.ts | 2 +-
.../Area/stories/controlsShown.tsx | 2 +-
.../Area/stories/expanded.tsx | 2 +-
.../Area/stories/stackedWithBounds.tsx | 4 +-
.../superset-ui-chart/SuperChartStories.tsx | 2 +-
.../superset-ui-switchboard/src/switchboard.ts | 2 +-
.../legacy-plugin-chart-country-map/src/index.js | 2 +-
.../legacy-plugin-chart-heatmap/src/Heatmap.js | 2 +-
.../src/ReactParallelCoordinates.jsx | 6 +-
.../src/SankeyLoop.js | 4 +-
.../src/components/PlaySlider.jsx | 4 +-
.../src/layers/Polygon/Polygon.jsx | 4 +-
.../src/layers/Scatter/controlPanel.ts | 2 +-
.../src/utilities/Shared_DeckGL.jsx | 12 +-
.../src/utils/fitViewport.ts | 2 +-
.../legacy-preset-chart-deckgl/src/utils/time.js | 8 +-
.../src/Pie/controlPanel.ts | 10 +-
.../src/BoxPlot/controlPanel.ts | 5 +-
.../src/Funnel/controlPanel.tsx | 6 +-
.../src/MixedTimeseries/buildQuery.ts | 10 +-
.../plugin-chart-echarts/src/Pie/controlPanel.tsx | 5 +-
.../plugin-chart-echarts/src/Radar/buildQuery.ts | 4 +-
.../src/Radar/controlPanel.tsx | 5 +-
.../plugin-chart-echarts/src/Radar/index.ts | 2 +-
.../src/Sunburst/controlPanel.tsx | 5 +-
.../src/Timeseries/Area/controlPanel.tsx | 6 +-
.../src/Timeseries/Regular/Bar/controlPanel.tsx | 9 +-
.../src/Timeseries/Regular/Line/controlPanel.tsx | 9 +-
.../Timeseries/Regular/Scatter/controlPanel.tsx | 9 +-
.../Timeseries/Regular/SmoothLine/controlPanel.tsx | 9 +-
.../src/Timeseries/Step/controlPanel.tsx | 6 +-
.../src/Timeseries/constants.ts | 5 +
.../plugin-chart-echarts/src/Tree/controlPanel.tsx | 2 +-
.../src/Treemap/controlPanel.tsx | 5 +-
.../plugin-chart-echarts/src/Treemap/index.ts | 4 +-
.../test/MixedTimeseries/buildQuery.test.ts | 69 +-
.../test/plugin/transformProps.test.ts | 4 +-
.../plugins/plugin-chart-table/src/TableChart.tsx | 2 +-
.../plugins/plugin-chart-table/src/buildQuery.ts | 4 +-
.../src/utils/convertScaleToDataUIScaleShape.ts | 2 +-
.../types.ts => spec/fixtures/mockCharts.ts} | 52 +-
superset-frontend/spec/helpers/shim.tsx | 30 +
superset-frontend/src/SqlLab/App.jsx | 3 +-
superset-frontend/src/SqlLab/actions/sqlLab.js | 8 +-
.../src/SqlLab/components/App/App.test.jsx | 49 +-
.../src/SqlLab/components/App/index.jsx | 17 +-
.../components/ExploreCtasResultsButton/index.tsx | 6 +-
.../QueryLimitSelect/QueryLimitSelect.test.tsx | 3 -
.../src/SqlLab/components/QueryTable/index.tsx | 15 +-
.../src/SqlLab/components/ResultSet/index.tsx | 5 +-
.../src/SqlLab/components/SqlEditor/index.jsx | 116 +-
.../SqlEditorLeftBar/SqlEditorLeftBar.test.jsx | 78 +-
.../SqlLab/components/SqlEditorLeftBar/index.tsx | 59 +-
.../src/SqlLab/components/TableElement/index.tsx | 3 +-
.../AlteredSliceTag/AlteredSliceTag.test.jsx | 2 -
.../Chart/DrillDetail/DrillDetailMenuItems.tsx | 13 +-
.../DatabaseSelector/DatabaseSelector.test.tsx | 270 +-
.../src/components/DatabaseSelector/index.tsx | 81 +-
.../Datasource/DatasourceEditor.test.jsx | 12 -
.../DeprecatedSelect/DeprecatedSelect.tsx | 4 +-
.../ErrorBoundary/ErrorBoundary.test.tsx | 2 -
.../Form/LabeledErrorBoundInput.test.jsx | 1 -
.../src/components/ListView/ListView.test.jsx | 6 -
superset-frontend/src/components/ListView/utils.ts | 2 +-
.../src/components/MessageToasts/Toast.test.jsx | 2 -
.../PageHeaderWithActions.test.tsx | 2 -
.../HeaderReportDropdown/index.test.tsx | 6 -
.../components/ReportModal/ReportModal.test.tsx | 6 -
.../src/components/Select/AsyncSelect.tsx | 4 +-
.../src/components/Select/Select.stories.tsx | 2 +-
.../src/components/Select/Select.test.tsx | 59 +-
superset-frontend/src/components/Select/Select.tsx | 93 +-
superset-frontend/src/components/Select/utils.tsx | 18 +
.../TableSelector/TableSelector.test.tsx | 87 +-
.../src/components/TableSelector/index.tsx | 36 +-
.../src/components/TableView/TableView.test.tsx | 2 -
.../src/components/TruncatedList/index.tsx | 160 +
.../DashboardBuilder/DashboardBuilder.test.tsx | 3 -
.../PropertiesModal/PropertiesModal.test.tsx | 2 +-
.../src/dashboard/components/SliceAdder.jsx | 12 +-
.../src/dashboard/components/SliceHeader/index.tsx | 2 +-
.../components/dnd/dragDroppableConfig.js | 2 +-
.../dashboard/components/gridComponents/Chart.jsx | 2 +-
.../components/gridComponents/Markdown.jsx | 1 +
.../components/gridComponents/Tabs.test.jsx | 2 +-
.../FilterBar/FilterBarCrossFilters/Vertical.tsx | 122 +-
.../FilterBar/FilterBarCrossFilters/index.tsx | 48 +-
.../FilterBar/FilterBarCrossFilters/selectors.ts | 56 +
.../FilterBar/FilterControls/FilterControl.tsx | 4 +-
.../nativeFilters/FilterBar/Horizontal.tsx | 40 +-
.../FiltersConfigForm/getControlItemsMap.tsx | 2 +-
.../components/nativeFilters/selectors.ts | 27 +-
.../src/dashboard/util/filterboxMigrationHelper.ts | 6 +-
.../src/dashboard/util/getSliceHeaderTooltip.tsx | 2 +-
.../src/explore/components/Control.test.tsx | 2 +-
.../src/explore/components/ControlHeader.tsx | 2 +-
.../explore/components/ControlPanelsContainer.tsx | 47 +-
.../src/explore/components/ExploreChartPanel.jsx | 2 +-
.../src/explore/components/SaveModal.tsx | 12 +-
.../components/controls/ColorPickerControl.jsx | 4 +-
.../controls/ColorSchemeControl/index.tsx | 2 +-
.../DatasourceControl/DatasourceControl.test.tsx | 19 -
.../components/controls/DateFilterControl/types.ts | 2 +-
.../DndColumnSelectControl/DndFilterSelect.tsx | 35 +-
.../DndMetricSelect.test.tsx | 8 -
.../DndColumnSelectControl/DndMetricSelect.tsx | 3 +-
.../FilterControl/AdhocFilterControl/index.jsx | 28 +-
.../AdhocFilterOption/AdhocFilterOption.test.tsx | 8 -
.../controls/MetricControl/AdhocMetric.js | 4 -
.../controls/MetricControl/AdhocMetric.test.js | 6 -
.../AdhocMetricEditPopover.test.tsx | 22 +-
.../MetricControl/AdhocMetricEditPopover/index.jsx | 40 +-
.../MetricControl/AdhocMetricPopoverTrigger.tsx | 6 +
.../MetricControl/MetricDefinitionValue.jsx | 2 +-
.../controls/MetricControl/MetricsControl.jsx | 6 +-
.../controls/MetricControl/MetricsControl.test.jsx | 1 -
.../SelectAsyncControl/SelectAsyncControl.test.tsx | 16 +-
.../controls/VizTypeControl/FastVizSwitcher.tsx | 11 +-
.../getFormDataFromDashboardContext.test.ts | 1 +
.../getFormDataWithDashboardContext.ts | 1 +
.../src/explore/exploreUtils/getHostName.test.ts | 2 +-
superset-frontend/src/explore/store.js | 2 +-
superset-frontend/src/hooks/apiResources/index.ts | 1 +
.../src/hooks/apiResources/schemas.test.ts | 138 +
.../hooks/apiResources/{tables.ts => schemas.ts} | 72 +-
.../src/hooks/apiResources/tables.test.ts | 186 +-
superset-frontend/src/hooks/apiResources/tables.ts | 17 +-
superset-frontend/src/logger/LogUtils.ts | 2 +
.../src/middleware/loggerMiddleware.js | 12 +-
.../src/pages/ChartCreation/index.tsx | 9 +-
superset-frontend/src/pages/ChartList/index.tsx | 7 +-
superset-frontend/src/preamble.ts | 2 +-
...rdComponents.ts => setupDashboardComponents.ts} | 0
superset-frontend/src/types/Chart.ts | 14 +
.../src/utils/getClientErrorObject.ts | 2 +-
.../src/views/CRUD/annotation/AnnotationList.tsx | 2 +-
.../views/CRUD/annotation/AnnotationModal.test.jsx | 4 +-
.../src/views/CRUD/annotation/AnnotationModal.tsx | 8 +-
.../src/views/CRUD/dashboard/DashboardCard.tsx | 51 +-
.../src/views/CRUD/dashboard/DashboardList.tsx | 35 +-
.../views/CRUD/data/database/DatabaseList.test.jsx | 20 +-
.../src/views/CRUD/data/database/DatabaseList.tsx | 4 +-
.../DatabaseConnectionForm/EncryptedField.tsx | 4 +-
.../data/database/DatabaseModal/ExtraOptions.tsx | 2 +-
.../data/database/DatabaseModal/SSHTunnelForm.tsx | 317 +-
.../database/DatabaseModal/SSHTunnelSwitch.tsx | 58 +
.../data/database/DatabaseModal/index.test.tsx | 72 +-
.../CRUD/data/database/DatabaseModal/index.tsx | 56 +-
.../CRUD/data/database/DatabaseModal/styles.ts | 2 +-
.../data/dataset/AddDataset/AddDataset.test.tsx | 1 +
.../AddDataset/EditDataset/EditDataset.test.tsx} | 35 +-
.../EditDataset/UsageTab/UsageTab.test.tsx | 405 +++
.../AddDataset/EditDataset/UsageTab/index.tsx | 261 ++
.../data/dataset/AddDataset/EditDataset/index.tsx | 78 +
.../AddDataset/LeftPanel/LeftPanel.test.tsx | 2 +-
.../views/CRUD/data/dataset/AddDataset/index.tsx | 56 +-
.../CRUD/data/dataset/DatasetLayout/index.tsx | 9 +-
.../{DatasetList.test.jsx => DatasetList.test.tsx} | 9 +-
.../src/views/CRUD/data/dataset/DatasetList.tsx | 6 +-
superset-frontend/src/views/CRUD/data/hooks.ts | 127 +-
superset-frontend/src/views/CRUD/types.ts | 2 +-
superset-frontend/src/views/CRUD/utils.tsx | 2 +-
.../src/views/CRUD/welcome/ActivityTable.tsx | 2 +-
.../src/views/CRUD/welcome/DashboardTable.tsx | 34 +-
.../src/views/CRUD/welcome/EmptyState.tsx | 18 +-
.../src/views/CRUD/welcome/Welcome.tsx | 4 +-
superset-frontend/src/views/components/Menu.tsx | 2 +-
.../src/views/components/RightMenu.tsx | 4 +-
superset-frontend/src/views/components/types.ts | 2 +-
superset-frontend/webpack.config.js | 4 +-
superset-websocket/package-lock.json | 430 +--
superset-websocket/package.json | 18 +-
superset/charts/api.py | 4 +-
superset/charts/commands/export.py | 2 +-
superset/charts/commands/update.py | 5 +-
superset/charts/schemas.py | 15 +-
superset/cli/importexport.py | 8 +-
superset/cli/thumbnails.py | 9 +-
superset/commands/importers/v1/__init__.py | 3 +
superset/common/query_context_factory.py | 96 +-
superset/config.py | 13 +-
superset/connectors/sqla/models.py | 4 +-
superset/connectors/sqla/views.py | 2 -
superset/dao/base.py | 14 +-
superset/dashboards/commands/update.py | 2 +-
superset/databases/api.py | 2 +-
superset/datasets/api.py | 70 +
superset/datasets/commands/duplicate.py | 2 +
superset/datasets/commands/exceptions.py | 4 +
superset/datasets/commands/importers/v0.py | 2 +-
superset/datasets/commands/importers/v1/utils.py | 32 +-
superset/datasets/dao.py | 123 +-
superset/datasets/schemas.py | 11 +
superset/db_engine_specs/base.py | 7 +-
superset/db_engine_specs/hive.py | 54 +-
superset/db_engines/__init__.py | 16 -
superset/db_engines/hive.py | 67 -
.../dashboards/COVID_Vaccine_Dashboard.yaml | 2 +-
superset/migrations/alembic.ini | 7 +-
...7c195a_rewriting_url_from_shortner_with_new_.py | 2 +-
...10-42_f9a30386bd74_cleanup_time_grainularity.py | 12 +-
...b56500de1855_add_uuid_column_to_import_mixin.py | 2 +-
...4fbb_add_type_to_native_filter_configuration.py | 2 +-
...03_5afbb1a5849b_add_embedded_dahshoard_table.py | 2 +-
superset/models/helpers.py | 3 +-
superset/models/slice.py | 3 +
superset/reports/commands/execute.py | 3 -
superset/reports/notifications/email.py | 8 +-
superset/reports/notifications/slack.py | 8 +-
superset/security/manager.py | 1 +
superset/sqllab/api.py | 67 +-
superset/sqllab/commands/export.py | 136 +
superset/tasks/thumbnails.py | 2 +-
superset/templates/tail_js_custom_extra.html | 2 +-
superset/translations/en/LC_MESSAGES/messages.po | 10 +-
superset/translations/messages.pot | 10 +-
superset/translations/ru/LC_MESSAGES/messages.json | 212 +-
superset/translations/ru/LC_MESSAGES/messages.po | 3204 +++++++++++---------
superset/utils/core.py | 2 +-
superset/utils/screenshots.py | 20 +-
superset/utils/urls.py | 4 +-
superset/utils/webdriver.py | 5 +
superset/views/base.py | 10 +-
superset/views/core.py | 53 +-
.../annotation_layers/fixtures.py | 2 +-
tests/integration_tests/charts/api_tests.py | 55 +
tests/integration_tests/charts/commands_tests.py | 51 +-
tests/integration_tests/cli_tests.py | 24 +-
tests/integration_tests/core_tests.py | 2 +-
tests/integration_tests/dashboards/api_tests.py | 59 +
tests/integration_tests/datasets/api_tests.py | 89 +
tests/integration_tests/datasets/commands_tests.py | 51 +-
.../db_engine_specs/base_engine_spec_tests.py | 2 +-
tests/integration_tests/reports/commands_tests.py | 40 +-
.../security/migrate_roles_tests.py | 8 +-
tests/integration_tests/security_tests.py | 16 +-
tests/integration_tests/sql_lab/api_tests.py | 39 +-
tests/integration_tests/sql_lab/commands_tests.py | 251 +-
.../datasets/commands/importers/v1/import_test.py | 128 +-
tests/unit_tests/datasets/dao/dao_tests.py | 30 +
tests/unit_tests/utils/urls_tests.py | 5 +
300 files changed, 6921 insertions(+), 3716 deletions(-)
copy superset-frontend/{src/components/Chart/DrillDetail/types.ts => spec/fixtures/mockCharts.ts} (52%)
create mode 100644 superset-frontend/src/components/TruncatedList/index.tsx
create mode 100644 superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FilterBarCrossFilters/selectors.ts
create mode 100644 superset-frontend/src/hooks/apiResources/schemas.test.ts
copy superset-frontend/src/hooks/apiResources/{tables.ts => schemas.ts} (55%)
rename superset-frontend/src/setup/{setupDasboardComponents.ts => setupDashboardComponents.ts} (100%)
create mode 100644 superset-frontend/src/views/CRUD/data/database/DatabaseModal/SSHTunnelSwitch.tsx
copy superset-frontend/src/{components/ErrorMessage/IssueCode.test.tsx => views/CRUD/data/dataset/AddDataset/EditDataset/EditDataset.test.tsx} (56%)
create mode 100644 superset-frontend/src/views/CRUD/data/dataset/AddDataset/EditDataset/UsageTab/UsageTab.test.tsx
create mode 100644 superset-frontend/src/views/CRUD/data/dataset/AddDataset/EditDataset/UsageTab/index.tsx
create mode 100644 superset-frontend/src/views/CRUD/data/dataset/AddDataset/EditDataset/index.tsx
rename superset-frontend/src/views/CRUD/data/dataset/{DatasetList.test.jsx => DatasetList.test.tsx} (98%)
delete mode 100644 superset/db_engines/__init__.py
delete mode 100644 superset/db_engines/hive.py
create mode 100644 superset/sqllab/commands/export.py
[superset] 01/02: Merge branch 'master' of https://github.com/apache/superset into feat/cross-filters-sidebar
Posted by di...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
diegopucci pushed a commit to branch feat/cross-filters-sidebar
in repository https://gitbox.apache.org/repos/asf/superset.git
commit 55c601566b7f9ff432abbb58a31e3f93e9d986f3
Merge: 6f8418b992 f4ffed24ba
Author: geido <di...@gmail.com>
AuthorDate: Thu Feb 16 17:10:10 2023 +0100
Merge branch 'master' of https://github.com/apache/superset into feat/cross-filters-sidebar
.github/workflows/welcome-new-users.yml | 3 +-
Dockerfile | 2 +-
RESOURCES/INTHEWILD.md | 2 +
UPDATING.md | 1 +
.../docs/databases/installing-database-drivers.mdx | 2 +-
docs/docs/databases/teradata.mdx | 2 +-
docs/docs/installation/alerts-reports.mdx | 2 +
.../installing-superset-from-scratch.mdx | 2 +-
docs/docusaurus.config.js | 4 -
docs/static/resources/openapi.json | 90 +-
docs/yarn.lock | 6 +-
helm/superset/Chart.yaml | 2 +-
helm/superset/README.md | 5 +-
helm/superset/templates/service.yaml | 9 +
helm/superset/values.yaml | 9 +
requirements/integration.txt | 20 +-
scripts/generate_frontend_ts_tasklist.js | 4 +-
setup.py | 3 +-
.../cypress/integration/dashboard/load.test.ts | 2 +-
.../integration/dashboard/nativeFilters.test.ts | 2 +-
.../cypress/integration/dashboard/utils.ts | 2 +-
.../cypress-base/cypress/support/directories.ts | 12 +-
superset-frontend/cypress-base/package-lock.json | 12 +-
superset-frontend/jest.config.js | 2 +-
superset-frontend/package-lock.json | 123 +-
superset-frontend/package.json | 3 +-
.../templates/src/plugin/controlPanel.erb | 4 +-
.../src/operators/pivotOperator.ts | 3 +-
.../src/operators/renameOperator.ts | 20 +-
.../src/operators/timeCompareOperator.ts | 4 +-
.../src/operators/timeComparePivotOperator.ts | 3 +-
.../src/operators/utils/isDerivedSeries.ts | 4 +-
.../src/operators/utils/isTimeComparison.ts | 4 +-
.../src/sections/advancedAnalytics.tsx | 10 +-
.../components/ColumnConfigControl/constants.tsx | 2 +-
.../src/shared-controls/sharedControls.tsx | 4 +-
.../superset-ui-chart-controls/src/types.ts | 4 +-
.../src/utils/D3Formatting.ts | 7 +
.../src/utils/expandControlConfig.tsx | 2 +-
.../test/operators/pivotOperator.test.ts | 31 +-
.../test/operators/renameOperator.test.ts | 33 +-
.../test/operators/rollingWindowOperator.test.ts | 4 +-
.../test/operators/timeCompareOperator.test.ts | 4 +-
.../operators/timeComparePivotOperator.test.ts | 39 +
.../test/operators/utils/isDerivedSeries.test.ts | 18 +-
.../src/chart/components/SuperChart.tsx | 2 +-
.../superset-ui-core/src/math-expression/index.ts | 2 +-
.../src/query/buildQueryContext.ts | 17 +-
.../superset-ui-core/src/query/buildQueryObject.ts | 2 +-
.../superset-ui-core/src/query/normalizeOrderBy.ts | 2 +-
.../src/query/types/AdvancedAnalytics.ts | 4 +-
.../src/query/types/PostProcessing.ts | 6 +-
.../packages/superset-ui-core/src/style/index.tsx | 1 +
.../superset-ui-core/src/translation/index.ts | 2 +-
.../src/ui-overrides/ExtensionsRegistry.ts | 11 +
.../superset-ui-core/test/models/Registry.test.ts | 2 +-
.../factories/createD3NumberFormatter.test.ts | 2 +-
.../test/query/buildQueryContext.test.ts | 37 -
.../test/query/types/PostProcessing.test.ts | 4 +-
.../packages/superset-ui-core/types/external.d.ts | 2 +-
.../Area/stories/controlsShown.tsx | 2 +-
.../Area/stories/expanded.tsx | 2 +-
.../Area/stories/stackedWithBounds.tsx | 4 +-
.../superset-ui-chart/SuperChartStories.tsx | 2 +-
.../superset-ui-switchboard/src/switchboard.ts | 2 +-
.../legacy-plugin-chart-country-map/src/index.js | 2 +-
.../legacy-plugin-chart-heatmap/src/Heatmap.js | 2 +-
.../src/ReactParallelCoordinates.jsx | 6 +-
.../src/SankeyLoop.js | 4 +-
.../src/components/PlaySlider.jsx | 4 +-
.../src/layers/Polygon/Polygon.jsx | 4 +-
.../src/layers/Scatter/controlPanel.ts | 2 +-
.../src/utilities/Shared_DeckGL.jsx | 12 +-
.../src/utils/fitViewport.ts | 2 +-
.../legacy-preset-chart-deckgl/src/utils/time.js | 8 +-
.../src/Pie/controlPanel.ts | 10 +-
.../src/BoxPlot/controlPanel.ts | 5 +-
.../src/Funnel/controlPanel.tsx | 6 +-
.../src/MixedTimeseries/buildQuery.ts | 10 +-
.../plugin-chart-echarts/src/Pie/controlPanel.tsx | 5 +-
.../plugin-chart-echarts/src/Radar/buildQuery.ts | 4 +-
.../src/Radar/controlPanel.tsx | 5 +-
.../plugin-chart-echarts/src/Radar/index.ts | 2 +-
.../src/Sunburst/controlPanel.tsx | 5 +-
.../src/Timeseries/Area/controlPanel.tsx | 6 +-
.../src/Timeseries/Regular/Bar/controlPanel.tsx | 9 +-
.../src/Timeseries/Regular/Line/controlPanel.tsx | 9 +-
.../Timeseries/Regular/Scatter/controlPanel.tsx | 9 +-
.../Timeseries/Regular/SmoothLine/controlPanel.tsx | 9 +-
.../src/Timeseries/Step/controlPanel.tsx | 6 +-
.../src/Timeseries/constants.ts | 5 +
.../plugin-chart-echarts/src/Tree/controlPanel.tsx | 2 +-
.../src/Treemap/controlPanel.tsx | 5 +-
.../plugin-chart-echarts/src/Treemap/index.ts | 4 +-
.../test/MixedTimeseries/buildQuery.test.ts | 69 +-
.../test/plugin/transformProps.test.ts | 4 +-
.../plugins/plugin-chart-table/src/TableChart.tsx | 2 +-
.../plugins/plugin-chart-table/src/buildQuery.ts | 4 +-
.../src/utils/convertScaleToDataUIScaleShape.ts | 2 +-
superset-frontend/spec/fixtures/mockCharts.ts | 55 +
superset-frontend/spec/helpers/shim.tsx | 30 +
superset-frontend/src/SqlLab/App.jsx | 3 +-
superset-frontend/src/SqlLab/actions/sqlLab.js | 8 +-
.../src/SqlLab/components/App/App.test.jsx | 49 +-
.../src/SqlLab/components/App/index.jsx | 17 +-
.../components/ExploreCtasResultsButton/index.tsx | 6 +-
.../QueryLimitSelect/QueryLimitSelect.test.tsx | 3 -
.../src/SqlLab/components/QueryTable/index.tsx | 15 +-
.../src/SqlLab/components/ResultSet/index.tsx | 5 +-
.../src/SqlLab/components/SqlEditor/index.jsx | 116 +-
.../SqlEditorLeftBar/SqlEditorLeftBar.test.jsx | 78 +-
.../SqlLab/components/SqlEditorLeftBar/index.tsx | 59 +-
.../src/SqlLab/components/TableElement/index.tsx | 3 +-
.../AlteredSliceTag/AlteredSliceTag.test.jsx | 2 -
.../Chart/DrillDetail/DrillDetailMenuItems.tsx | 13 +-
.../DatabaseSelector/DatabaseSelector.test.tsx | 270 +-
.../src/components/DatabaseSelector/index.tsx | 81 +-
.../Datasource/DatasourceEditor.test.jsx | 12 -
.../DeprecatedSelect/DeprecatedSelect.tsx | 4 +-
.../ErrorBoundary/ErrorBoundary.test.tsx | 2 -
.../Form/LabeledErrorBoundInput.test.jsx | 1 -
.../src/components/ListView/ListView.test.jsx | 6 -
superset-frontend/src/components/ListView/utils.ts | 2 +-
.../src/components/MessageToasts/Toast.test.jsx | 2 -
.../PageHeaderWithActions.test.tsx | 2 -
.../HeaderReportDropdown/index.test.tsx | 6 -
.../components/ReportModal/ReportModal.test.tsx | 6 -
.../src/components/Select/AsyncSelect.tsx | 4 +-
.../src/components/Select/Select.stories.tsx | 2 +-
.../src/components/Select/Select.test.tsx | 59 +-
superset-frontend/src/components/Select/Select.tsx | 93 +-
superset-frontend/src/components/Select/utils.tsx | 18 +
.../TableSelector/TableSelector.test.tsx | 87 +-
.../src/components/TableSelector/index.tsx | 36 +-
.../src/components/TableView/TableView.test.tsx | 2 -
.../src/components/TruncatedList/index.tsx | 160 +
.../DashboardBuilder/DashboardBuilder.test.tsx | 3 -
.../PropertiesModal/PropertiesModal.test.tsx | 2 +-
.../src/dashboard/components/SliceAdder.jsx | 12 +-
.../src/dashboard/components/SliceHeader/index.tsx | 2 +-
.../components/dnd/dragDroppableConfig.js | 2 +-
.../dashboard/components/gridComponents/Chart.jsx | 2 +-
.../components/gridComponents/Markdown.jsx | 1 +
.../components/gridComponents/Tabs.test.jsx | 2 +-
.../FilterBar/FilterControls/FilterControl.tsx | 4 +-
.../FiltersConfigForm/getControlItemsMap.tsx | 2 +-
.../src/dashboard/util/filterboxMigrationHelper.ts | 6 +-
.../src/dashboard/util/getSliceHeaderTooltip.tsx | 2 +-
.../src/explore/components/Control.test.tsx | 2 +-
.../src/explore/components/ControlHeader.tsx | 2 +-
.../explore/components/ControlPanelsContainer.tsx | 47 +-
.../src/explore/components/ExploreChartPanel.jsx | 2 +-
.../src/explore/components/SaveModal.tsx | 12 +-
.../components/controls/ColorPickerControl.jsx | 4 +-
.../controls/ColorSchemeControl/index.tsx | 2 +-
.../DatasourceControl/DatasourceControl.test.tsx | 19 -
.../components/controls/DateFilterControl/types.ts | 2 +-
.../DndColumnSelectControl/DndFilterSelect.tsx | 35 +-
.../DndMetricSelect.test.tsx | 8 -
.../DndColumnSelectControl/DndMetricSelect.tsx | 3 +-
.../FilterControl/AdhocFilterControl/index.jsx | 28 +-
.../AdhocFilterOption/AdhocFilterOption.test.tsx | 8 -
.../controls/MetricControl/AdhocMetric.js | 4 -
.../controls/MetricControl/AdhocMetric.test.js | 6 -
.../AdhocMetricEditPopover.test.tsx | 22 +-
.../MetricControl/AdhocMetricEditPopover/index.jsx | 40 +-
.../MetricControl/AdhocMetricPopoverTrigger.tsx | 6 +
.../MetricControl/MetricDefinitionValue.jsx | 2 +-
.../controls/MetricControl/MetricsControl.jsx | 6 +-
.../controls/MetricControl/MetricsControl.test.jsx | 1 -
.../SelectAsyncControl/SelectAsyncControl.test.tsx | 16 +-
.../controls/VizTypeControl/FastVizSwitcher.tsx | 11 +-
.../getFormDataFromDashboardContext.test.ts | 1 +
.../getFormDataWithDashboardContext.ts | 1 +
.../src/explore/exploreUtils/getHostName.test.ts | 2 +-
superset-frontend/src/explore/store.js | 2 +-
superset-frontend/src/hooks/apiResources/index.ts | 1 +
.../src/hooks/apiResources/schemas.test.ts | 138 +
.../hooks/apiResources/{tables.ts => schemas.ts} | 72 +-
.../src/hooks/apiResources/tables.test.ts | 186 +-
superset-frontend/src/hooks/apiResources/tables.ts | 17 +-
superset-frontend/src/logger/LogUtils.ts | 2 +
.../src/middleware/loggerMiddleware.js | 12 +-
.../src/pages/ChartCreation/index.tsx | 9 +-
superset-frontend/src/pages/ChartList/index.tsx | 7 +-
superset-frontend/src/preamble.ts | 2 +-
...rdComponents.ts => setupDashboardComponents.ts} | 0
superset-frontend/src/types/Chart.ts | 14 +
.../src/utils/getClientErrorObject.ts | 2 +-
.../src/views/CRUD/annotation/AnnotationList.tsx | 2 +-
.../views/CRUD/annotation/AnnotationModal.test.jsx | 4 +-
.../src/views/CRUD/annotation/AnnotationModal.tsx | 8 +-
.../src/views/CRUD/dashboard/DashboardCard.tsx | 51 +-
.../src/views/CRUD/dashboard/DashboardList.tsx | 35 +-
.../views/CRUD/data/database/DatabaseList.test.jsx | 20 +-
.../src/views/CRUD/data/database/DatabaseList.tsx | 4 +-
.../DatabaseConnectionForm/EncryptedField.tsx | 4 +-
.../data/database/DatabaseModal/ExtraOptions.tsx | 2 +-
.../data/database/DatabaseModal/SSHTunnelForm.tsx | 317 +-
.../database/DatabaseModal/SSHTunnelSwitch.tsx | 58 +
.../data/database/DatabaseModal/index.test.tsx | 72 +-
.../CRUD/data/database/DatabaseModal/index.tsx | 56 +-
.../CRUD/data/database/DatabaseModal/styles.ts | 2 +-
.../data/dataset/AddDataset/AddDataset.test.tsx | 1 +
.../EditDataset.test.tsx} | 37 +-
.../EditDataset/UsageTab/UsageTab.test.tsx | 405 +++
.../AddDataset/EditDataset/UsageTab/index.tsx | 261 ++
.../data/dataset/AddDataset/EditDataset/index.tsx | 78 +
.../AddDataset/LeftPanel/LeftPanel.test.tsx | 2 +-
.../views/CRUD/data/dataset/AddDataset/index.tsx | 56 +-
.../CRUD/data/dataset/DatasetLayout/index.tsx | 9 +-
.../{DatasetList.test.jsx => DatasetList.test.tsx} | 9 +-
.../src/views/CRUD/data/dataset/DatasetList.tsx | 6 +-
superset-frontend/src/views/CRUD/data/hooks.ts | 127 +-
superset-frontend/src/views/CRUD/types.ts | 2 +-
superset-frontend/src/views/CRUD/utils.tsx | 2 +-
.../src/views/CRUD/welcome/ActivityTable.tsx | 2 +-
.../src/views/CRUD/welcome/DashboardTable.tsx | 34 +-
.../src/views/CRUD/welcome/EmptyState.tsx | 18 +-
.../src/views/CRUD/welcome/Welcome.tsx | 4 +-
superset-frontend/src/views/components/Menu.tsx | 2 +-
.../src/views/components/RightMenu.tsx | 4 +-
superset-frontend/src/views/components/types.ts | 2 +-
superset-frontend/webpack.config.js | 4 +-
superset-websocket/package-lock.json | 430 +--
superset-websocket/package.json | 18 +-
superset/charts/api.py | 4 +-
superset/charts/commands/export.py | 2 +-
superset/charts/commands/update.py | 5 +-
superset/charts/schemas.py | 15 +-
superset/cli/importexport.py | 8 +-
superset/cli/thumbnails.py | 9 +-
superset/commands/importers/v1/__init__.py | 3 +
superset/common/query_context_factory.py | 96 +-
superset/config.py | 13 +-
superset/connectors/sqla/models.py | 4 +-
superset/connectors/sqla/views.py | 2 -
superset/dao/base.py | 14 +-
superset/dashboards/commands/update.py | 2 +-
superset/databases/api.py | 2 +-
superset/datasets/api.py | 70 +
superset/datasets/commands/duplicate.py | 2 +
superset/datasets/commands/exceptions.py | 4 +
superset/datasets/commands/importers/v0.py | 2 +-
superset/datasets/commands/importers/v1/utils.py | 32 +-
superset/datasets/dao.py | 123 +-
superset/datasets/schemas.py | 11 +
superset/db_engine_specs/base.py | 7 +-
superset/db_engine_specs/hive.py | 54 +-
superset/db_engines/__init__.py | 16 -
superset/db_engines/hive.py | 67 -
.../dashboards/COVID_Vaccine_Dashboard.yaml | 2 +-
superset/migrations/alembic.ini | 7 +-
...7c195a_rewriting_url_from_shortner_with_new_.py | 2 +-
...10-42_f9a30386bd74_cleanup_time_grainularity.py | 12 +-
...b56500de1855_add_uuid_column_to_import_mixin.py | 2 +-
...4fbb_add_type_to_native_filter_configuration.py | 2 +-
...03_5afbb1a5849b_add_embedded_dahshoard_table.py | 2 +-
superset/models/helpers.py | 3 +-
superset/models/slice.py | 3 +
superset/reports/commands/execute.py | 3 -
superset/reports/notifications/email.py | 8 +-
superset/reports/notifications/slack.py | 8 +-
superset/security/manager.py | 1 +
superset/sqllab/api.py | 67 +-
superset/sqllab/commands/export.py | 136 +
superset/tasks/thumbnails.py | 2 +-
superset/templates/tail_js_custom_extra.html | 2 +-
superset/translations/en/LC_MESSAGES/messages.po | 10 +-
superset/translations/messages.pot | 10 +-
superset/translations/ru/LC_MESSAGES/messages.json | 212 +-
superset/translations/ru/LC_MESSAGES/messages.po | 3204 +++++++++++---------
superset/utils/core.py | 2 +-
superset/utils/screenshots.py | 20 +-
superset/utils/urls.py | 4 +-
superset/utils/webdriver.py | 5 +
superset/views/base.py | 10 +-
superset/views/core.py | 53 +-
.../annotation_layers/fixtures.py | 2 +-
tests/integration_tests/charts/api_tests.py | 55 +
tests/integration_tests/charts/commands_tests.py | 51 +-
tests/integration_tests/cli_tests.py | 24 +-
tests/integration_tests/core_tests.py | 2 +-
tests/integration_tests/dashboards/api_tests.py | 59 +
tests/integration_tests/datasets/api_tests.py | 89 +
tests/integration_tests/datasets/commands_tests.py | 51 +-
.../db_engine_specs/base_engine_spec_tests.py | 2 +-
tests/integration_tests/reports/commands_tests.py | 40 +-
.../security/migrate_roles_tests.py | 8 +-
tests/integration_tests/security_tests.py | 16 +-
tests/integration_tests/sql_lab/api_tests.py | 39 +-
tests/integration_tests/sql_lab/commands_tests.py | 251 +-
.../datasets/commands/importers/v1/import_test.py | 128 +-
tests/unit_tests/datasets/dao/dao_tests.py | 30 +
tests/unit_tests/utils/urls_tests.py | 5 +
295 files changed, 6710 insertions(+), 3639 deletions(-)
[superset] 02/02: Add vertical truncation
Posted by di...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
diegopucci pushed a commit to branch feat/cross-filters-sidebar
in repository https://gitbox.apache.org/repos/asf/superset.git
commit 4349dfd6a48021e119b6e43ffda579e3c407261d
Author: geido <di...@gmail.com>
AuthorDate: Tue Feb 21 12:39:59 2023 +0100
Add vertical truncation
---
.../FilterBar/FilterBarCrossFilters/Vertical.tsx | 122 ++++++++++++++++-----
.../FilterBar/FilterBarCrossFilters/index.tsx | 48 ++++----
.../FilterBar/FilterBarCrossFilters/selectors.ts | 56 ++++++++++
.../nativeFilters/FilterBar/Horizontal.tsx | 40 ++++++-
.../components/nativeFilters/selectors.ts | 27 ++++-
5 files changed, 236 insertions(+), 57 deletions(-)
diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FilterBarCrossFilters/Vertical.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FilterBarCrossFilters/Vertical.tsx
index 484404580a..82d48e0057 100644
--- a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FilterBarCrossFilters/Vertical.tsx
+++ b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FilterBarCrossFilters/Vertical.tsx
@@ -17,14 +17,17 @@
* under the License.
*/
-import React, { useCallback } from 'react';
+import React, { useCallback, useMemo } from 'react';
import Collapse from 'src/components/Collapse';
-import { styled, t, css } from '@superset-ui/core';
-import { Indicator } from 'src/dashboard/components/nativeFilters/selectors';
+import { styled, t, css, useTheme } from '@superset-ui/core';
+import { IndicatorWithEmitterType } from 'src/dashboard/components/nativeFilters/selectors';
import Icons from 'src/components/Icons';
import { useDispatch } from 'react-redux';
import { setFocusedNativeFilter } from 'src/dashboard/actions/nativeFilters';
import { Tag } from 'src/components';
+import { Tooltip } from 'src/components/Tooltip';
+import useCSSTextTruncation from 'src/hooks/useTruncation/useCSSTextTruncation';
+import { FilterBarOrientation } from 'src/dashboard/types';
const StyledCollapse = styled(Collapse)`
${({ theme }) => `
@@ -87,23 +90,79 @@ const ellipsisCss = css`
const StyledCrossFilterValue = styled('b')`
${({ theme }) => `
- max-width: ${theme.gridUnit * 30}px;
- ${ellipsisCss}
+ max-width: ${theme.gridUnit * 25}px;
`}
+ ${ellipsisCss}
`;
const StyledCrossFilterColumn = styled('span')`
${({ theme }) => `
- max-width: ${theme.gridUnit * 20}px;
- ${ellipsisCss}
+ max-width: ${theme.gridUnit * 25}px;
+ padding-right: ${theme.gridUnit}px;
`}
+ ${ellipsisCss}
`;
+const CrossFilterTag = (props: {
+ filter: IndicatorWithEmitterType;
+ removeCrossFilter: (filterId: number) => void;
+}) => {
+ const { filter, removeCrossFilter } = props;
+ const [columnRef, columnIsTruncated] =
+ useCSSTextTruncation<HTMLSpanElement>();
+ const [valueRef, valueIsTruncated] = useCSSTextTruncation<HTMLSpanElement>();
+
+ return (
+ <StyledCrossFilterTag
+ closable
+ onClose={() => removeCrossFilter(filter.emitterId)}
+ >
+ <Tooltip title={columnIsTruncated ? filter.column : null}>
+ <StyledCrossFilterColumn ref={columnRef}>
+ {filter.column}
+ </StyledCrossFilterColumn>
+ </Tooltip>
+ <Tooltip title={valueIsTruncated ? filter.value : null}>
+ <StyledCrossFilterValue ref={valueRef}>
+ {filter.value}
+ </StyledCrossFilterValue>
+ </Tooltip>
+ </StyledCrossFilterTag>
+ );
+};
+
+const CrossFilterChartTitle = (props: {
+ title: string;
+ orientation: FilterBarOrientation;
+}) => {
+ const { title, orientation } = props;
+ const [titleRef, titleIsTruncated] = useCSSTextTruncation<HTMLSpanElement>();
+ const theme = useTheme();
+ return (
+ <Tooltip title={titleIsTruncated ? title : null}>
+ <span
+ css={css`
+ max-width: ${orientation === FilterBarOrientation.VERTICAL
+ ? `${theme.gridUnit * 60}px`
+ : `${theme.gridUnit * 15}px`};
+ ${ellipsisCss}
+ `}
+ ref={titleRef}
+ >
+ {title}
+ </span>
+ </Tooltip>
+ );
+};
+
const FilterBarCrossFiltersVertical = (props: {
- crossFilters: Indicator[];
+ crossFilters: IndicatorWithEmitterType[];
+ orientation: FilterBarOrientation;
+ removeCrossFilter: (chartId: number) => void;
}) => {
- const { crossFilters } = props;
+ const { crossFilters, orientation, removeCrossFilter } = props;
const dispatch = useDispatch();
+
const onHighlightFilterSource = useCallback(
(path?: string[]) => {
if (path) {
@@ -113,24 +172,33 @@ const FilterBarCrossFiltersVertical = (props: {
[dispatch],
);
- const crossFiltersIndicators = crossFilters.map(filter => (
- <StyledCrossFilter>
- <StyledCrossFilterTitle
- key={filter.name}
- onClick={() => onHighlightFilterSource(filter.path)}
- role="button"
- tabIndex={0}
- >
- {filter.name} <StyledIconSearch iconSize="xs" />
- </StyledCrossFilterTitle>
- {(filter.column || filter.value) && (
- <StyledCrossFilterTag closable>
- <StyledCrossFilterColumn>{filter.column} </StyledCrossFilterColumn>
- <StyledCrossFilterValue>{filter.value}</StyledCrossFilterValue>
- </StyledCrossFilterTag>
- )}
- </StyledCrossFilter>
- ));
+ const crossFiltersIndicators = useMemo(
+ () =>
+ crossFilters.map(filter => (
+ <StyledCrossFilter key={filter.emitterId}>
+ <StyledCrossFilterTitle
+ onClick={() => onHighlightFilterSource(filter.path)}
+ role="button"
+ tabIndex={0}
+ >
+ <CrossFilterChartTitle
+ title={filter.name}
+ orientation={orientation}
+ />
+ <Tooltip title={t('Locate the chart')}>
+ <StyledIconSearch iconSize="xs" />
+ </Tooltip>
+ </StyledCrossFilterTitle>
+ {(filter.column || filter.value) && (
+ <CrossFilterTag
+ filter={filter}
+ removeCrossFilter={removeCrossFilter}
+ />
+ )}
+ </StyledCrossFilter>
+ )),
+ [crossFilters, onHighlightFilterSource, orientation, removeCrossFilter],
+ );
return (
<StyledCollapse
diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FilterBarCrossFilters/index.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FilterBarCrossFilters/index.tsx
index 8fc639aad8..b58050df09 100644
--- a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FilterBarCrossFilters/index.tsx
+++ b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FilterBarCrossFilters/index.tsx
@@ -25,17 +25,16 @@ import {
RootState,
} from 'src/dashboard/types';
import { DataMaskStateWithId } from '@superset-ui/core';
-import {
- selectChartCrossFilters,
- Indicator,
-} from 'src/dashboard/components/nativeFilters/selectors';
-import { useSelector } from 'react-redux';
+import { useDispatch, useSelector } from 'react-redux';
+import { updateDataMask } from 'src/dataMask/actions';
import FilterBarCrossFiltersVertical from './Vertical';
+import crossFiltersSelector from './selectors';
const FilterBarCrossFilters = (props: {
orientation: FilterBarOrientation;
}) => {
const { orientation } = props;
+ const dispatch = useDispatch();
const dataMask = useSelector<RootState, DataMaskStateWithId>(
state => state.dataMask,
);
@@ -45,27 +44,34 @@ const FilterBarCrossFilters = (props: {
const dashboardLayout = useSelector<RootState, DashboardLayout>(
state => state.dashboardLayout.present,
);
- const chartConfiguration = dashboardInfo.metadata?.chart_configuration;
- const chartsIds = Object.keys(chartConfiguration);
- let selectedCrossFilters: Indicator[] = [];
+ const selectedCrossFilters = crossFiltersSelector({
+ dataMask,
+ dashboardInfo,
+ dashboardLayout,
+ });
- chartsIds.forEach(id => {
- const chartId = Number(id);
- const crossFilters = selectChartCrossFilters(
- dataMask,
- chartId,
- dashboardLayout,
- chartConfiguration,
+ const handleRemoveCrossFilter = (chartId: number) => {
+ dispatch(
+ updateDataMask(chartId, {
+ extraFormData: {
+ filters: [],
+ },
+ filterState: {
+ value: null,
+ selectedValues: null,
+ },
+ }),
);
- selectedCrossFilters = [...selectedCrossFilters, ...crossFilters];
- });
+ };
if (!selectedCrossFilters.length) return null;
- return orientation === FilterBarOrientation.VERTICAL ? (
- <FilterBarCrossFiltersVertical crossFilters={selectedCrossFilters} />
- ) : (
- <span>Horizontal</span>
+ return (
+ <FilterBarCrossFiltersVertical
+ crossFilters={selectedCrossFilters}
+ removeCrossFilter={handleRemoveCrossFilter}
+ orientation={orientation}
+ />
);
};
diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FilterBarCrossFilters/selectors.ts b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FilterBarCrossFilters/selectors.ts
new file mode 100644
index 0000000000..353350841a
--- /dev/null
+++ b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FilterBarCrossFilters/selectors.ts
@@ -0,0 +1,56 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import { DataMaskStateWithId } from '@superset-ui/core';
+import { DashboardInfo, DashboardLayout } from 'src/dashboard/types';
+import {
+ IndicatorWithEmitterType,
+ selectChartCrossFilters,
+} from '../../selectors';
+
+export const crossFiltersSelector = (props: {
+ dataMask: DataMaskStateWithId;
+ dashboardInfo: DashboardInfo;
+ dashboardLayout: DashboardLayout;
+}): IndicatorWithEmitterType[] => {
+ const { dataMask, dashboardInfo, dashboardLayout } = props;
+ const chartConfiguration = dashboardInfo.metadata?.chart_configuration;
+ const chartsIds = Object.keys(chartConfiguration);
+ const shouldFilterEmitters = true;
+
+ let selectedCrossFilters: IndicatorWithEmitterType[] = [];
+
+ for (let i = 0; i < chartsIds.length; i += 1) {
+ const chartId = Number(chartsIds[i]);
+ const crossFilters = selectChartCrossFilters(
+ dataMask,
+ chartId,
+ dashboardLayout,
+ chartConfiguration,
+ shouldFilterEmitters,
+ );
+ selectedCrossFilters = [
+ ...selectedCrossFilters,
+ ...(crossFilters as IndicatorWithEmitterType[]),
+ ];
+ }
+ return selectedCrossFilters;
+};
+
+export default crossFiltersSelector;
diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/Horizontal.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/Horizontal.tsx
index 7e786985e8..2cda17698e 100644
--- a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/Horizontal.tsx
+++ b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/Horizontal.tsx
@@ -17,15 +17,30 @@
* under the License.
*/
-import React from 'react';
-import { styled, t } from '@superset-ui/core';
+import React, { useMemo } from 'react';
+import {
+ DataMaskStateWithId,
+ FeatureFlag,
+ isFeatureEnabled,
+ styled,
+ t,
+} from '@superset-ui/core';
import Icons from 'src/components/Icons';
import Loading from 'src/components/Loading';
+import {
+ DashboardInfo,
+ DashboardLayout,
+ FilterBarOrientation,
+ RootState,
+} from 'src/dashboard/types';
+import { useSelector } from 'react-redux';
import FilterControls from './FilterControls/FilterControls';
import { getFilterBarTestId } from './utils';
import { HorizontalBarProps } from './types';
import FilterBarSettings from './FilterBarSettings';
import FilterConfigurationLink from './FilterConfigurationLink';
+import FilterBarCrossFilters from './FilterBarCrossFilters';
+import crossFiltersSelector from './FilterBarCrossFilters/selectors';
const HorizontalBar = styled.div`
${({ theme }) => `
@@ -96,7 +111,26 @@ const HorizontalFilterBar: React.FC<HorizontalBarProps> = ({
focusedFilterId,
onSelectionChange,
}) => {
- const hasFilters = filterValues.length > 0;
+ const dataMask = useSelector<RootState, DataMaskStateWithId>(
+ state => state.dataMask,
+ );
+ const dashboardInfo = useSelector<RootState, DashboardInfo>(
+ state => state.dashboardInfo,
+ );
+ const dashboardLayout = useSelector<RootState, DashboardLayout>(
+ state => state.dashboardLayout.present,
+ );
+ const isCrossFiltersEnabled = isFeatureEnabled(
+ FeatureFlag.DASHBOARD_CROSS_FILTERS,
+ );
+ const selectedCrossFilters = isCrossFiltersEnabled
+ ? crossFiltersSelector({
+ dataMask,
+ dashboardInfo,
+ dashboardLayout,
+ })
+ : [];
+ const hasFilters = filterValues.length > 0 || selectedCrossFilters.length > 0;
return (
<HorizontalBar {...getFilterBarTestId()}>
diff --git a/superset-frontend/src/dashboard/components/nativeFilters/selectors.ts b/superset-frontend/src/dashboard/components/nativeFilters/selectors.ts
index d84b755a11..137154be2a 100644
--- a/superset-frontend/src/dashboard/components/nativeFilters/selectors.ts
+++ b/superset-frontend/src/dashboard/components/nativeFilters/selectors.ts
@@ -158,6 +158,8 @@ export type Indicator = {
path?: string[];
};
+export type IndicatorWithEmitterType = Indicator & { emitterId: number };
+
const cachedIndicatorsForChart = {};
const cachedDashboardFilterDataForChart = {};
// inspects redux state to find what the filter indicators should be shown for a given chart
@@ -250,14 +252,23 @@ export const selectChartCrossFilters = (
chartId: number,
dashboardLayout: Layout,
chartConfiguration: ChartConfiguration = defaultChartConfig,
-): Indicator[] => {
+ filterEmitter = false,
+): Indicator[] | IndicatorWithEmitterType[] => {
let crossFilterIndicators: any = [];
if (isFeatureEnabled(FeatureFlag.DASHBOARD_CROSS_FILTERS)) {
const dashboardLayoutValues = Object.values(dashboardLayout);
crossFilterIndicators = Object.values(chartConfiguration)
- .filter(chartConfig =>
- chartConfig.crossFilters?.chartsInScope?.includes(chartId),
- )
+ .filter(chartConfig => {
+ const inScope =
+ chartConfig.crossFilters?.chartsInScope?.includes(chartId);
+ if (!filterEmitter && inScope) {
+ return true;
+ }
+ if (filterEmitter && !inScope) {
+ return true;
+ }
+ return false;
+ })
.map(chartConfig => {
const filterState = dataMask[chartConfig.id]?.filterState;
const extraFormData = dataMask[chartConfig.id]?.extraFormData;
@@ -270,12 +281,12 @@ export const selectChartCrossFilters = (
const dashboardLayoutItem = dashboardLayoutValues.find(
layoutItem => layoutItem?.meta?.chartId === chartConfig.id,
);
- return {
+ const filterObject: Indicator = {
column,
name: dashboardLayoutItem?.meta?.sliceName as string,
path: [
...(dashboardLayoutItem?.parents ?? []),
- dashboardLayoutItem?.id,
+ dashboardLayoutItem?.id || '',
],
status: getStatus({
label,
@@ -283,6 +294,10 @@ export const selectChartCrossFilters = (
}),
value: label,
};
+ if (filterEmitter) {
+ (filterObject as IndicatorWithEmitterType).emitterId = chartId;
+ }
+ return filterObject;
})
.filter(filter => filter.status === IndicatorStatus.CrossFilterApplied);
}