From 762998f6d38f4f4786feb2073e8a7013586a07df Mon Sep 17 00:00:00 2001 From: simcha90 <56388545+simcha90@users.noreply.github.com> Date: Wed, 10 Feb 2021 10:08:23 +0200 Subject: [PATCH] feat(core): expand native filter hook and add chart metadata fields (#943) * refactor: update setExtraFormData hook / change isNativeFilter Property / remove native filters * refactor: clear storybook * refactor: update type place * refactor: add dasourceCount property * refactor: fix CR notes --- .../src/chart/models/ChartMetadata.ts | 18 +- .../superset-ui-core/src/chart/types/Base.ts | 13 +- .../plugin-filter-antd/Select/Stories.tsx | 42 ---- .../plugins/plugin-filter-antd/Select/data.ts | 216 ------------------ .../plugins/plugin-filter-antd/README.md | 34 --- .../plugins/plugin-filter-antd/package.json | 40 ---- .../src/Range/AntdRangeFilter.tsx | 55 ----- .../src/Range/buildQuery.ts | 68 ------ .../src/Range/controlPanel.ts | 43 ---- .../src/Range/images/thumbnail.png | Bin 5658 -> 0 bytes .../plugin-filter-antd/src/Range/index.ts | 42 ---- .../src/Range/transformProps.ts | 33 --- .../plugin-filter-antd/src/Range/types.ts | 35 --- .../src/Select/AntdSelectFilter.tsx | 103 --------- .../src/Select/buildQuery.ts | 41 ---- .../src/Select/controlPanel.ts | 113 --------- .../src/Select/images/thumbnail.png | Bin 5658 -> 0 bytes .../plugin-filter-antd/src/Select/index.ts | 42 ---- .../src/Select/transformProps.ts | 35 --- .../plugin-filter-antd/src/Select/types.ts | 48 ---- .../plugins/plugin-filter-antd/src/index.ts | 20 -- .../plugins/plugin-filter-antd/src/types.ts | 22 -- .../plugin-filter-antd/test/index.test.ts | 34 --- .../plugins/plugin-filter-antd/tsconfig.json | 25 -- .../plugin-filter-antd/types/external.d.ts | 4 - 25 files changed, 25 insertions(+), 1101 deletions(-) delete mode 100644 superset-frontend/temporary_superset_ui/superset-ui/packages/superset-ui-demo/storybook/stories/plugins/plugin-filter-antd/Select/Stories.tsx delete mode 100644 superset-frontend/temporary_superset_ui/superset-ui/packages/superset-ui-demo/storybook/stories/plugins/plugin-filter-antd/Select/data.ts delete mode 100644 superset-frontend/temporary_superset_ui/superset-ui/plugins/plugin-filter-antd/README.md delete mode 100644 superset-frontend/temporary_superset_ui/superset-ui/plugins/plugin-filter-antd/package.json delete mode 100644 superset-frontend/temporary_superset_ui/superset-ui/plugins/plugin-filter-antd/src/Range/AntdRangeFilter.tsx delete mode 100644 superset-frontend/temporary_superset_ui/superset-ui/plugins/plugin-filter-antd/src/Range/buildQuery.ts delete mode 100644 superset-frontend/temporary_superset_ui/superset-ui/plugins/plugin-filter-antd/src/Range/controlPanel.ts delete mode 100644 superset-frontend/temporary_superset_ui/superset-ui/plugins/plugin-filter-antd/src/Range/images/thumbnail.png delete mode 100644 superset-frontend/temporary_superset_ui/superset-ui/plugins/plugin-filter-antd/src/Range/index.ts delete mode 100644 superset-frontend/temporary_superset_ui/superset-ui/plugins/plugin-filter-antd/src/Range/transformProps.ts delete mode 100644 superset-frontend/temporary_superset_ui/superset-ui/plugins/plugin-filter-antd/src/Range/types.ts delete mode 100644 superset-frontend/temporary_superset_ui/superset-ui/plugins/plugin-filter-antd/src/Select/AntdSelectFilter.tsx delete mode 100644 superset-frontend/temporary_superset_ui/superset-ui/plugins/plugin-filter-antd/src/Select/buildQuery.ts delete mode 100644 superset-frontend/temporary_superset_ui/superset-ui/plugins/plugin-filter-antd/src/Select/controlPanel.ts delete mode 100644 superset-frontend/temporary_superset_ui/superset-ui/plugins/plugin-filter-antd/src/Select/images/thumbnail.png delete mode 100644 superset-frontend/temporary_superset_ui/superset-ui/plugins/plugin-filter-antd/src/Select/index.ts delete mode 100644 superset-frontend/temporary_superset_ui/superset-ui/plugins/plugin-filter-antd/src/Select/transformProps.ts delete mode 100644 superset-frontend/temporary_superset_ui/superset-ui/plugins/plugin-filter-antd/src/Select/types.ts delete mode 100644 superset-frontend/temporary_superset_ui/superset-ui/plugins/plugin-filter-antd/src/index.ts delete mode 100644 superset-frontend/temporary_superset_ui/superset-ui/plugins/plugin-filter-antd/src/types.ts delete mode 100644 superset-frontend/temporary_superset_ui/superset-ui/plugins/plugin-filter-antd/test/index.test.ts delete mode 100644 superset-frontend/temporary_superset_ui/superset-ui/plugins/plugin-filter-antd/tsconfig.json delete mode 100644 superset-frontend/temporary_superset_ui/superset-ui/plugins/plugin-filter-antd/types/external.d.ts diff --git a/superset-frontend/temporary_superset_ui/superset-ui/packages/superset-ui-core/src/chart/models/ChartMetadata.ts b/superset-frontend/temporary_superset_ui/superset-ui/packages/superset-ui-core/src/chart/models/ChartMetadata.ts index 4562b454baa5..99ff5a9aad33 100644 --- a/superset-frontend/temporary_superset_ui/superset-ui/packages/superset-ui-core/src/chart/models/ChartMetadata.ts +++ b/superset-frontend/temporary_superset_ui/superset-ui/packages/superset-ui-core/src/chart/models/ChartMetadata.ts @@ -1,3 +1,5 @@ +import { Behavior } from '../types/Base'; + interface LookupTable { [key: string]: boolean; } @@ -7,11 +9,12 @@ export interface ChartMetadataConfig { canBeAnnotationTypes?: string[]; credits?: string[]; description?: string; + datasourceCount?: number; show?: boolean; supportedAnnotationTypes?: string[]; thumbnail: string; useLegacyApi?: boolean; - isNativeFilter?: boolean; + behaviors?: Behavior[]; } export default class ChartMetadata { @@ -33,7 +36,9 @@ export default class ChartMetadata { useLegacyApi: boolean; - isNativeFilter: boolean; + behaviors: Behavior[]; + + datasourceCount: number; constructor(config: ChartMetadataConfig) { const { @@ -45,7 +50,8 @@ export default class ChartMetadata { supportedAnnotationTypes = [], thumbnail, useLegacyApi = false, - isNativeFilter = false, + behaviors = [], + datasourceCount = 1, } = config; this.name = name; @@ -65,7 +71,8 @@ export default class ChartMetadata { this.supportedAnnotationTypes = supportedAnnotationTypes; this.thumbnail = thumbnail; this.useLegacyApi = useLegacyApi; - this.isNativeFilter = isNativeFilter; + this.behaviors = behaviors; + this.datasourceCount = datasourceCount; } canBeAnnotationType(type: string): boolean { @@ -82,7 +89,8 @@ export default class ChartMetadata { supportedAnnotationTypes: this.supportedAnnotationTypes, thumbnail: this.thumbnail, useLegacyApi: this.useLegacyApi, - isNativeFilter: this.isNativeFilter, + behaviors: this.behaviors, + datasourceCount: this.datasourceCount, }); } } diff --git a/superset-frontend/temporary_superset_ui/superset-ui/packages/superset-ui-core/src/chart/types/Base.ts b/superset-frontend/temporary_superset_ui/superset-ui/packages/superset-ui-core/src/chart/types/Base.ts index f206aec5cb7f..e37323a2a9d9 100644 --- a/superset-frontend/temporary_superset_ui/superset-ui/packages/superset-ui-core/src/chart/types/Base.ts +++ b/superset-frontend/temporary_superset_ui/superset-ui/packages/superset-ui-core/src/chart/types/Base.ts @@ -2,8 +2,19 @@ import { ExtraFormData } from '../../query'; export type HandlerFunction = (...args: unknown[]) => void; +export enum Behavior { + CROSS_FILTER = 'CROSS_FILTER', + NATIVE_FILTER = 'NATIVE_FILTER', +} + export type SetExtraFormDataHook = { - (extraFormData: ExtraFormData): void; + ({ + extraFormData, + currentState: { value }, + }: { + extraFormData: ExtraFormData; + currentState: { value: any; [key: string]: any }; + }): void; }; export interface PlainObject { diff --git a/superset-frontend/temporary_superset_ui/superset-ui/packages/superset-ui-demo/storybook/stories/plugins/plugin-filter-antd/Select/Stories.tsx b/superset-frontend/temporary_superset_ui/superset-ui/packages/superset-ui-demo/storybook/stories/plugins/plugin-filter-antd/Select/Stories.tsx deleted file mode 100644 index c4dbeab5dc00..000000000000 --- a/superset-frontend/temporary_superset_ui/superset-ui/packages/superset-ui-demo/storybook/stories/plugins/plugin-filter-antd/Select/Stories.tsx +++ /dev/null @@ -1,42 +0,0 @@ -import React from 'react'; -import { action } from '@storybook/addon-actions'; -import { boolean, withKnobs } from '@storybook/addon-knobs'; -import { SuperChart, getChartTransformPropsRegistry } from '@superset-ui/core'; -import { AntdSelectFilterPlugin } from '@superset-ui/plugin-filter-antd'; -import transformProps from '@superset-ui/plugin-filter-antd/lib/Select/transformProps'; -import data from './data'; -import { withResizableChartDemo } from '../../../../shared/components/ResizableChartDemo'; -import 'antd/dist/antd.css'; - -new AntdSelectFilterPlugin().configure({ key: 'filter_select' }).register(); - -getChartTransformPropsRegistry().registerValue('filter_select', transformProps); - -export default { - title: 'Filter Plugins|plugin-filter-antd/Select', - decorators: [withKnobs, withResizableChartDemo], -}; - -export const Select = ({ width, height }) => { - return ( - - ); -}; diff --git a/superset-frontend/temporary_superset_ui/superset-ui/packages/superset-ui-demo/storybook/stories/plugins/plugin-filter-antd/Select/data.ts b/superset-frontend/temporary_superset_ui/superset-ui/packages/superset-ui-demo/storybook/stories/plugins/plugin-filter-antd/Select/data.ts deleted file mode 100644 index c2e5fa07083a..000000000000 --- a/superset-frontend/temporary_superset_ui/superset-ui/packages/superset-ui-demo/storybook/stories/plugins/plugin-filter-antd/Select/data.ts +++ /dev/null @@ -1,216 +0,0 @@ -export default [ - { country_name: 'Afghanistan', 'SUM(SP_POP_TOTL)': 887557752 }, - { country_name: 'Albania', 'SUM(SP_POP_TOTL)': 148154320 }, - { country_name: 'Algeria', 'SUM(SP_POP_TOTL)': 1317290647 }, - { country_name: 'American Samoa', 'SUM(SP_POP_TOTL)': 2294886 }, - { country_name: 'Andorra', 'SUM(SP_POP_TOTL)': 2704725 }, - { country_name: 'Angola', 'SUM(SP_POP_TOTL)': 641906296 }, - { country_name: 'Antigua and Barbuda', 'SUM(SP_POP_TOTL)': 3887170 }, - { country_name: 'Argentina', 'SUM(SP_POP_TOTL)': 1728332290 }, - { country_name: 'Armenia', 'SUM(SP_POP_TOTL)': 160782905 }, - { country_name: 'Aruba', 'SUM(SP_POP_TOTL)': 4048374 }, - { country_name: 'Australia', 'SUM(SP_POP_TOTL)': 903260509 }, - { country_name: 'Austria', 'SUM(SP_POP_TOTL)': 426785647 }, - { country_name: 'Azerbaijan', 'SUM(SP_POP_TOTL)': 374210660 }, - { country_name: 'Bahamas, The', 'SUM(SP_POP_TOTL)': 13446111 }, - { country_name: 'Bahrain', 'SUM(SP_POP_TOTL)': 29724096 }, - { country_name: 'Bangladesh', 'SUM(SP_POP_TOTL)': 5549261462 }, - { country_name: 'Barbados', 'SUM(SP_POP_TOTL)': 14146501 }, - { country_name: 'Belarus', 'SUM(SP_POP_TOTL)': 524490000 }, - { country_name: 'Belgium', 'SUM(SP_POP_TOTL)': 551921585 }, - { country_name: 'Belize', 'SUM(SP_POP_TOTL)': 10571460 }, - { country_name: 'Benin', 'SUM(SP_POP_TOTL)': 290736360 }, - { country_name: 'Bermuda', 'SUM(SP_POP_TOTL)': 3159267 }, - { country_name: 'Bhutan', 'SUM(SP_POP_TOTL)': 25987074 }, - { country_name: 'Bolivia', 'SUM(SP_POP_TOTL)': 368308373 }, - { country_name: 'Bosnia and Herzegovina', 'SUM(SP_POP_TOTL)': 215521543 }, - { country_name: 'Botswana', 'SUM(SP_POP_TOTL)': 70510085 }, - { country_name: 'Brazil', 'SUM(SP_POP_TOTL)': 7752058955 }, - { country_name: 'Brunei Darussalam', 'SUM(SP_POP_TOTL)': 13322318 }, - { country_name: 'Bulgaria', 'SUM(SP_POP_TOTL)': 456247765 }, - { country_name: 'Burkina Faso', 'SUM(SP_POP_TOTL)': 505122912 }, - { country_name: 'Burundi', 'SUM(SP_POP_TOTL)': 305731834 }, - { country_name: 'Cabo Verde', 'SUM(SP_POP_TOTL)': 19178461 }, - { country_name: 'Cambodia', 'SUM(SP_POP_TOTL)': 523555378 }, - { country_name: 'Cameroon', 'SUM(SP_POP_TOTL)': 664127790 }, - { country_name: 'Canada', 'SUM(SP_POP_TOTL)': 1470276931 }, - { country_name: 'Cayman Islands', 'SUM(SP_POP_TOTL)': 1480956 }, - { country_name: 'Central African Republic', 'SUM(SP_POP_TOTL)': 158650217 }, - { country_name: 'Chad', 'SUM(SP_POP_TOTL)': 355875809 }, - { country_name: 'Channel Islands', 'SUM(SP_POP_TOTL)': 7515697 }, - { country_name: 'Chile', 'SUM(SP_POP_TOTL)': 696739897 }, - { country_name: 'China', 'SUM(SP_POP_TOTL)': 58345455000 }, - { country_name: 'Colombia', 'SUM(SP_POP_TOTL)': 1776189608 }, - { country_name: 'Comoros', 'SUM(SP_POP_TOTL)': 22692936 }, - { country_name: 'Congo, Dem. Rep.', 'SUM(SP_POP_TOTL)': 2015439254 }, - { country_name: 'Congo, Rep.', 'SUM(SP_POP_TOTL)': 130701144 }, - { country_name: 'Costa Rica', 'SUM(SP_POP_TOTL)': 163515714 }, - { country_name: "Cote d'Ivoire", 'SUM(SP_POP_TOTL)': 634194484 }, - { country_name: 'Croatia', 'SUM(SP_POP_TOTL)': 246197511 }, - { country_name: 'Cuba', 'SUM(SP_POP_TOTL)': 550461345 }, - { country_name: 'Curacao', 'SUM(SP_POP_TOTL)': 7898637 }, - { country_name: 'Cyprus', 'SUM(SP_POP_TOTL)': 43711039 }, - { country_name: 'Czech Republic', 'SUM(SP_POP_TOTL)': 559416359 }, - { country_name: 'Denmark', 'SUM(SP_POP_TOTL)': 283435789 }, - { country_name: 'Djibouti', 'SUM(SP_POP_TOTL)': 26324244 }, - { country_name: 'Dominica', 'SUM(SP_POP_TOTL)': 3881071 }, - { country_name: 'Dominican Republic', 'SUM(SP_POP_TOTL)': 373939753 }, - { country_name: 'Ecuador', 'SUM(SP_POP_TOTL)': 537148542 }, - { country_name: 'Egypt, Arab Rep.', 'SUM(SP_POP_TOTL)': 2967887581 }, - { country_name: 'El Salvador', 'SUM(SP_POP_TOTL)': 266413287 }, - { country_name: 'Equatorial Guinea', 'SUM(SP_POP_TOTL)': 22627794 }, - { country_name: 'Eritrea', 'SUM(SP_POP_TOTL)': 161125877 }, - { country_name: 'Estonia', 'SUM(SP_POP_TOTL)': 77119567 }, - { country_name: 'Ethiopia', 'SUM(SP_POP_TOTL)': 2750952916 }, - { country_name: 'Faeroe Islands', 'SUM(SP_POP_TOTL)': 2399439 }, - { country_name: 'Fiji', 'SUM(SP_POP_TOTL)': 37505227 }, - { country_name: 'Finland', 'SUM(SP_POP_TOTL)': 271585488 }, - { country_name: 'France', 'SUM(SP_POP_TOTL)': 3151638853 }, - { country_name: 'French Polynesia', 'SUM(SP_POP_TOTL)': 9974982 }, - { country_name: 'Gabon', 'SUM(SP_POP_TOTL)': 52489952 }, - { country_name: 'Gambia, The', 'SUM(SP_POP_TOTL)': 50232086 }, - { country_name: 'Georgia', 'SUM(SP_POP_TOTL)': 241070850 }, - { country_name: 'Germany', 'SUM(SP_POP_TOTL)': 4361793335 }, - { country_name: 'Ghana', 'SUM(SP_POP_TOTL)': 801844889 }, - { country_name: 'Greece', 'SUM(SP_POP_TOTL)': 547065293 }, - { country_name: 'Greenland', 'SUM(SP_POP_TOTL)': 2807533 }, - { country_name: 'Grenada', 'SUM(SP_POP_TOTL)': 5366107 }, - { country_name: 'Guam', 'SUM(SP_POP_TOTL)': 6647797 }, - { country_name: 'Guatemala', 'SUM(SP_POP_TOTL)': 498361800 }, - { country_name: 'Guinea', 'SUM(SP_POP_TOTL)': 362469063 }, - { country_name: 'Guinea-Bissau', 'SUM(SP_POP_TOTL)': 58400669 }, - { country_name: 'Guyana', 'SUM(SP_POP_TOTL)': 39868752 }, - { country_name: 'Haiti', 'SUM(SP_POP_TOTL)': 377521290 }, - { country_name: 'Honduras', 'SUM(SP_POP_TOTL)': 257791863 }, - { country_name: 'Hong Kong SAR, China', 'SUM(SP_POP_TOTL)': 298353905 }, - { country_name: 'Hungary', 'SUM(SP_POP_TOTL)': 566995908 }, - { country_name: 'Iceland', 'SUM(SP_POP_TOTL)': 13716537 }, - { country_name: 'India', 'SUM(SP_POP_TOTL)': 46023037597 }, - { country_name: 'Indonesia', 'SUM(SP_POP_TOTL)': 9357861231 }, - { country_name: 'Iran, Islamic Rep.', 'SUM(SP_POP_TOTL)': 2717528355 }, - { country_name: 'Iraq', 'SUM(SP_POP_TOTL)': 983604177 }, - { country_name: 'Ireland', 'SUM(SP_POP_TOTL)': 196019322 }, - { country_name: 'Isle of Man', 'SUM(SP_POP_TOTL)': 3728525 }, - { country_name: 'Israel', 'SUM(SP_POP_TOTL)': 263866720 }, - { country_name: 'Italy', 'SUM(SP_POP_TOTL)': 3082869665 }, - { country_name: 'Jamaica', 'SUM(SP_POP_TOTL)': 124779119 }, - { country_name: 'Japan', 'SUM(SP_POP_TOTL)': 6454620759 }, - { country_name: 'Jordan', 'SUM(SP_POP_TOTL)': 180850641 }, - { country_name: 'Kazakhstan', 'SUM(SP_POP_TOTL)': 797168043 }, - { country_name: 'Kenya', 'SUM(SP_POP_TOTL)': 1253201109 }, - { country_name: 'Kiribati', 'SUM(SP_POP_TOTL)': 3874990 }, - { country_name: 'Korea, Dem. Rep.', 'SUM(SP_POP_TOTL)': 1047335229 }, - { country_name: 'Korea, Rep.', 'SUM(SP_POP_TOTL)': 2216456927 }, - { country_name: 'Kosovo', 'SUM(SP_POP_TOTL)': 86627232 }, - { country_name: 'Kuwait', 'SUM(SP_POP_TOTL)': 84737006 }, - { country_name: 'Kyrgyz Republic', 'SUM(SP_POP_TOTL)': 222809200 }, - { country_name: 'Lao PDR', 'SUM(SP_POP_TOTL)': 227340983 }, - { country_name: 'Latvia', 'SUM(SP_POP_TOTL)': 130544986 }, - { country_name: 'Lebanon', 'SUM(SP_POP_TOTL)': 162031498 }, - { country_name: 'Lesotho', 'SUM(SP_POP_TOTL)': 81971241 }, - { country_name: 'Liberia', 'SUM(SP_POP_TOTL)': 125666085 }, - { country_name: 'Libya', 'SUM(SP_POP_TOTL)': 217716251 }, - { country_name: 'Liechtenstein', 'SUM(SP_POP_TOTL)': 1527171 }, - { country_name: 'Lithuania', 'SUM(SP_POP_TOTL)': 182416949 }, - { country_name: 'Luxembourg', 'SUM(SP_POP_TOTL)': 21852156 }, - { country_name: 'Macao SAR, China', 'SUM(SP_POP_TOTL)': 18882494 }, - { country_name: 'Macedonia, FYR', 'SUM(SP_POP_TOTL)': 104100695 }, - { country_name: 'Madagascar', 'SUM(SP_POP_TOTL)': 656478313 }, - { country_name: 'Malawi', 'SUM(SP_POP_TOTL)': 470725354 }, - { country_name: 'Malaysia', 'SUM(SP_POP_TOTL)': 978122682 }, - { country_name: 'Maldives', 'SUM(SP_POP_TOTL)': 11478624 }, - { country_name: 'Mali', 'SUM(SP_POP_TOTL)': 500758830 }, - { country_name: 'Malta', 'SUM(SP_POP_TOTL)': 19363458 }, - { country_name: 'Marshall Islands', 'SUM(SP_POP_TOTL)': 2086174 }, - { country_name: 'Mauritania', 'SUM(SP_POP_TOTL)': 113489314 }, - { country_name: 'Mauritius', 'SUM(SP_POP_TOTL)': 56066051 }, - { country_name: 'Mexico', 'SUM(SP_POP_TOTL)': 4444653964 }, - { country_name: 'Micronesia, Fed. Sts.', 'SUM(SP_POP_TOTL)': 4627492 }, - { country_name: 'Moldova', 'SUM(SP_POP_TOTL)': 186156257 }, - { country_name: 'Monaco', 'SUM(SP_POP_TOTL)': 1595554 }, - { country_name: 'Mongolia', 'SUM(SP_POP_TOTL)': 106717826 }, - { country_name: 'Montenegro', 'SUM(SP_POP_TOTL)': 31652512 }, - { country_name: 'Morocco', 'SUM(SP_POP_TOTL)': 1277441301 }, - { country_name: 'Mozambique', 'SUM(SP_POP_TOTL)': 807229371 }, - { country_name: 'Myanmar', 'SUM(SP_POP_TOTL)': 2126848982 }, - { country_name: 'Namibia', 'SUM(SP_POP_TOTL)': 75238033 }, - { country_name: 'Nepal', 'SUM(SP_POP_TOTL)': 1007162709 }, - { country_name: 'Netherlands', 'SUM(SP_POP_TOTL)': 803013980 }, - { country_name: 'New Caledonia', 'SUM(SP_POP_TOTL)': 9225822 }, - { country_name: 'New Zealand', 'SUM(SP_POP_TOTL)': 187593600 }, - { country_name: 'Nicaragua', 'SUM(SP_POP_TOTL)': 213048662 }, - { country_name: 'Niger', 'SUM(SP_POP_TOTL)': 471910464 }, - { country_name: 'Nigeria', 'SUM(SP_POP_TOTL)': 5259800493 }, - { country_name: 'Northern Mariana Islands', 'SUM(SP_POP_TOTL)': 2015842 }, - { country_name: 'Norway', 'SUM(SP_POP_TOTL)': 233337059 }, - { country_name: 'Oman', 'SUM(SP_POP_TOTL)': 93132249 }, - { country_name: 'Pakistan', 'SUM(SP_POP_TOTL)': 5696041480 }, - { country_name: 'Palau', 'SUM(SP_POP_TOTL)': 833299 }, - { country_name: 'Panama', 'SUM(SP_POP_TOTL)': 130974461 }, - { country_name: 'Papua New Guinea', 'SUM(SP_POP_TOTL)': 228299012 }, - { country_name: 'Paraguay', 'SUM(SP_POP_TOTL)': 221768661 }, - { country_name: 'Peru', 'SUM(SP_POP_TOTL)': 1121937313 }, - { country_name: 'Philippines', 'SUM(SP_POP_TOTL)': 3272015554 }, - { country_name: 'Poland', 'SUM(SP_POP_TOTL)': 1976772515 }, - { country_name: 'Portugal', 'SUM(SP_POP_TOTL)': 536945679 }, - { country_name: 'Puerto Rico', 'SUM(SP_POP_TOTL)': 181515497 }, - { country_name: 'Qatar', 'SUM(SP_POP_TOTL)': 30075210 }, - { country_name: 'Romania', 'SUM(SP_POP_TOTL)': 1171333228 }, - { country_name: 'Russian Federation', 'SUM(SP_POP_TOTL)': 7667188460 }, - { country_name: 'Rwanda', 'SUM(SP_POP_TOTL)': 347121852 }, - { country_name: 'Samoa', 'SUM(SP_POP_TOTL)': 8770470 }, - { country_name: 'San Marino', 'SUM(SP_POP_TOTL)': 1298411 }, - { country_name: 'Sao Tome and Principe', 'SUM(SP_POP_TOTL)': 6169644 }, - { country_name: 'Saudi Arabia', 'SUM(SP_POP_TOTL)': 828451525 }, - { country_name: 'Senegal', 'SUM(SP_POP_TOTL)': 414475224 }, - { country_name: 'Serbia', 'SUM(SP_POP_TOTL)': 186596480 }, - { country_name: 'Seychelles', 'SUM(SP_POP_TOTL)': 3761184 }, - { country_name: 'Sierra Leone', 'SUM(SP_POP_TOTL)': 203443826 }, - { country_name: 'Singapore', 'SUM(SP_POP_TOTL)': 173168000 }, - { country_name: 'Sint Maarten (Dutch part)', 'SUM(SP_POP_TOTL)': 597781 }, - { country_name: 'Slovak Republic', 'SUM(SP_POP_TOTL)': 276228375 }, - { country_name: 'Slovenia', 'SUM(SP_POP_TOTL)': 104119695 }, - { country_name: 'Solomon Islands', 'SUM(SP_POP_TOTL)': 16859526 }, - { country_name: 'Somalia', 'SUM(SP_POP_TOTL)': 332677926 }, - { country_name: 'South Africa', 'SUM(SP_POP_TOTL)': 1871083248 }, - { country_name: 'South Sudan', 'SUM(SP_POP_TOTL)': 319024522 }, - { country_name: 'Spain', 'SUM(SP_POP_TOTL)': 2115316751 }, - { country_name: 'Sri Lanka', 'SUM(SP_POP_TOTL)': 881137000 }, - { country_name: 'St. Kitts and Nevis', 'SUM(SP_POP_TOTL)': 2535482 }, - { country_name: 'St. Lucia', 'SUM(SP_POP_TOTL)': 7336842 }, - { country_name: 'St. Martin (French part)', 'SUM(SP_POP_TOTL)': 1020457 }, - { country_name: 'St. Vincent and the Grenadines', 'SUM(SP_POP_TOTL)': 5557117 }, - { country_name: 'Sudan', 'SUM(SP_POP_TOTL)': 1118903636 }, - { country_name: 'Suriname', 'SUM(SP_POP_TOTL)': 22687861 }, - { country_name: 'Swaziland', 'SUM(SP_POP_TOTL)': 42858935 }, - { country_name: 'Sweden', 'SUM(SP_POP_TOTL)': 468210684 }, - { country_name: 'Switzerland', 'SUM(SP_POP_TOTL)': 369360744 }, - { country_name: 'Syrian Arab Republic', 'SUM(SP_POP_TOTL)': 663924524 }, - { country_name: 'Tajikistan', 'SUM(SP_POP_TOTL)': 267603756 }, - { country_name: 'Tanzania', 'SUM(SP_POP_TOTL)': 1413734053 }, - { country_name: 'Thailand', 'SUM(SP_POP_TOTL)': 2827157965 }, - { country_name: 'Timor-Leste', 'SUM(SP_POP_TOTL)': 41694123 }, - { country_name: 'Togo', 'SUM(SP_POP_TOTL)': 204624027 }, - { country_name: 'Tonga', 'SUM(SP_POP_TOTL)': 5038574 }, - { country_name: 'Trinidad and Tobago', 'SUM(SP_POP_TOTL)': 62771502 }, - { country_name: 'Tunisia', 'SUM(SP_POP_TOTL)': 415992799 }, - { country_name: 'Turkey', 'SUM(SP_POP_TOTL)': 2805220683 }, - { country_name: 'Turkmenistan', 'SUM(SP_POP_TOTL)': 189687365 }, - { country_name: 'Turks and Caicos Islands', 'SUM(SP_POP_TOTL)': 775185 }, - { country_name: 'Tuvalu', 'SUM(SP_POP_TOTL)': 466709 }, - { country_name: 'Uganda', 'SUM(SP_POP_TOTL)': 987376102 }, - { country_name: 'Ukraine', 'SUM(SP_POP_TOTL)': 2657782543 }, - { country_name: 'United Arab Emirates', 'SUM(SP_POP_TOTL)': 134952923 }, - { country_name: 'United Kingdom', 'SUM(SP_POP_TOTL)': 3169118137 }, - { country_name: 'United States', 'SUM(SP_POP_TOTL)': 13604468357 }, - { country_name: 'Uruguay', 'SUM(SP_POP_TOTL)': 167612670 }, - { country_name: 'Uzbekistan', 'SUM(SP_POP_TOTL)': 1053380227 }, - { country_name: 'Vanuatu', 'SUM(SP_POP_TOTL)': 7966814 }, - { country_name: 'Venezuela, RB', 'SUM(SP_POP_TOTL)': 1036057583 }, - { country_name: 'Vietnam', 'SUM(SP_POP_TOTL)': 3420037000 }, - { country_name: 'Virgin Islands (U.S.)', 'SUM(SP_POP_TOTL)': 5006756 }, - { country_name: 'West Bank and Gaza', 'SUM(SP_POP_TOTL)': 77390117 }, - { country_name: 'Yemen, Rep.', 'SUM(SP_POP_TOTL)': 695646128 }, - { country_name: 'Zambia', 'SUM(SP_POP_TOTL)': 438847085 }, - { country_name: 'Zimbabwe', 'SUM(SP_POP_TOTL)': 509866860 }, -]; diff --git a/superset-frontend/temporary_superset_ui/superset-ui/plugins/plugin-filter-antd/README.md b/superset-frontend/temporary_superset_ui/superset-ui/plugins/plugin-filter-antd/README.md deleted file mode 100644 index 7de162f36a3a..000000000000 --- a/superset-frontend/temporary_superset_ui/superset-ui/plugins/plugin-filter-antd/README.md +++ /dev/null @@ -1,34 +0,0 @@ -## @superset-ui/plugin-filter-antd - -[![Version](https://img.shields.io/npm/v/@superset-ui/plugin-filter-antd.svg?style=flat-square)](https://www.npmjs.com/package/@superset-ui/plugin-filter-antd) - -This plugin provides native filter plugins based on AntD. - -### Usage - -Configure `key`, which can be any `string`, and register the plugin. This `key` will be used to -lookup this chart throughout the app. - -Below is an example of how to use the Select filter plugin. - -```js -import { AntdFilterSelectPlugin } from '@superset-ui/plugin-filter-antd'; - -new AntdFilterSelectPlugin().configure({ key: 'plugin-filter-select' }).register(); -``` - -Then use it via `SuperChart`. - -```js - console.log(extraFormData) }, - }]} -/> -``` diff --git a/superset-frontend/temporary_superset_ui/superset-ui/plugins/plugin-filter-antd/package.json b/superset-frontend/temporary_superset_ui/superset-ui/plugins/plugin-filter-antd/package.json deleted file mode 100644 index 3390febb06d2..000000000000 --- a/superset-frontend/temporary_superset_ui/superset-ui/plugins/plugin-filter-antd/package.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "name": "@superset-ui/plugin-filter-antd", - "version": "0.17.5", - "description": "Superset Filter - Plugin Filter AntD", - "sideEffects": false, - "main": "lib/index.js", - "module": "esm/index.js", - "files": [ - "esm", - "lib" - ], - "repository": { - "type": "git", - "url": "git+https://github.com/apache-superset/superset-ui.git" - }, - "keywords": [ - "superset" - ], - "author": "Superset", - "license": "Apache-2.0", - "bugs": { - "url": "https://github.com/apache-superset/superset-ui/issues" - }, - "homepage": "https://github.com/apache-superset/superset-ui#readme", - "publishConfig": { - "access": "public" - }, - "dependencies": { - "@superset-ui/chart-controls": "0.17.5", - "@superset-ui/core": "0.17.5", - "antd": "^4.9.1" - }, - "peerDependencies": { - "react": "^16.13.1" - }, - "devDependencies": { - "@types/jest": "^26.0.0", - "jest": "^26.0.1" - } -} diff --git a/superset-frontend/temporary_superset_ui/superset-ui/plugins/plugin-filter-antd/src/Range/AntdRangeFilter.tsx b/superset-frontend/temporary_superset_ui/superset-ui/plugins/plugin-filter-antd/src/Range/AntdRangeFilter.tsx deleted file mode 100644 index 62cf2810e554..000000000000 --- a/superset-frontend/temporary_superset_ui/superset-ui/plugins/plugin-filter-antd/src/Range/AntdRangeFilter.tsx +++ /dev/null @@ -1,55 +0,0 @@ -/** - * 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 { QueryObjectFilterClause, styled } from '@superset-ui/core'; -import React from 'react'; -import { Slider } from 'antd'; -import { AntdPluginFilterRangeProps } from './types'; -import { AntdPluginFilterStylesProps } from '../types'; - -const Styles = styled.div` - height: ${({ height }) => height}; - width: ${({ width }) => width}; -`; - -export default function AntdRangeFilter(props: AntdPluginFilterRangeProps) { - const { data, formData, height, width, setExtraFormData } = props; - const [row] = data; - // @ts-ignore - const { min, max }: { min: number; max: number } = row; - const { groupby } = formData; - const [col] = groupby || []; - - const handleChange = (value: [number, number]) => { - const [lower, upper] = value; - const filters: QueryObjectFilterClause[] = []; - if (lower !== undefined && lower !== null) filters.push({ col, op: '>=', val: lower }); - if (upper !== undefined && upper !== null) filters.push({ col, op: '>=', val: upper }); - setExtraFormData({ - append_form_data: { - filters, - }, - }); - }; - - return ( - - - - ); -} diff --git a/superset-frontend/temporary_superset_ui/superset-ui/plugins/plugin-filter-antd/src/Range/buildQuery.ts b/superset-frontend/temporary_superset_ui/superset-ui/plugins/plugin-filter-antd/src/Range/buildQuery.ts deleted file mode 100644 index 9c0d0202dcd2..000000000000 --- a/superset-frontend/temporary_superset_ui/superset-ui/plugins/plugin-filter-antd/src/Range/buildQuery.ts +++ /dev/null @@ -1,68 +0,0 @@ -/** - * 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 { buildQueryContext, ColumnType, QueryFormData } from '@superset-ui/core'; - -/** - * The buildQuery function is used to create an instance of QueryContext that's - * sent to the chart data endpoint. In addition to containing information of which - * datasource to use, it specifies the type (e.g. full payload, samples, query) and - * format (e.g. CSV or JSON) of the result and whether or not to force refresh the data from - * the datasource as opposed to using a cached copy of the data, if available. - * - * More importantly though, QueryContext contains a property `queries`, which is an array of - * QueryObjects specifying individual data requests to be made. A QueryObject specifies which - * columns, metrics and filters, among others, to use during the query. Usually it will be enough - * to specify just one query based on the baseQueryObject, but for some more advanced use cases - * it is possible to define post processing operations in the QueryObject, or multiple queries - * if a viz needs multiple different result sets. - */ -export default function buildQuery(formData: QueryFormData) { - const { groupby } = formData; - const [column] = groupby || []; - return buildQueryContext(formData, baseQueryObject => [ - { - ...baseQueryObject, - groupby: [], - metrics: [ - { - aggregate: 'MIN', - column: { - columnName: column, - id: 1, - type: ColumnType.FLOAT, - }, - expressionType: 'SIMPLE', - hasCustomLabel: true, - label: 'min', - }, - { - aggregate: 'MAX', - column: { - columnName: column, - id: 2, - type: ColumnType.FLOAT, - }, - expressionType: 'SIMPLE', - hasCustomLabel: true, - label: 'max', - }, - ], - }, - ]); -} diff --git a/superset-frontend/temporary_superset_ui/superset-ui/plugins/plugin-filter-antd/src/Range/controlPanel.ts b/superset-frontend/temporary_superset_ui/superset-ui/plugins/plugin-filter-antd/src/Range/controlPanel.ts deleted file mode 100644 index 73feec8b2947..000000000000 --- a/superset-frontend/temporary_superset_ui/superset-ui/plugins/plugin-filter-antd/src/Range/controlPanel.ts +++ /dev/null @@ -1,43 +0,0 @@ -/** - * 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 { t, validateNonEmpty } from '@superset-ui/core'; -import { ControlPanelConfig, sections } from '@superset-ui/chart-controls'; - -const config: ControlPanelConfig = { - // For control input types, see: superset-frontend/src/explore/components/controls/index.js - controlPanelSections: [ - sections.legacyRegularTime, - { - label: t('Query'), - expanded: true, - controlSetRows: [['groupby'], ['adhoc_filters']], - }, - ], - controlOverrides: { - groupby: { - validators: [validateNonEmpty], - clearable: false, - }, - row_limit: { - default: 100, - }, - }, -}; - -export default config; diff --git a/superset-frontend/temporary_superset_ui/superset-ui/plugins/plugin-filter-antd/src/Range/images/thumbnail.png b/superset-frontend/temporary_superset_ui/superset-ui/plugins/plugin-filter-antd/src/Range/images/thumbnail.png deleted file mode 100644 index 7afef30bd4e6e4f85723208bf9f429647d03d3e5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5658 zcmaKQc|4SB*uSMHTe}h_DM`k@HN$YqGL1EB526`kFviSij6I|dWe=G`DtpY}AySfk zpR6&WC=xMbE28il=bX;_`{O#$X9Js+0@P z9Zy0?&%dmdmcqLtq%UchDVurg<2>*ef+#raAafgR5CIEwmDbah(g}cb3=nZtj8p*8 zi{t|jKuG^(7tW!#*-FwQCR`2tgI@f1yfYfR9Dkf zhDxa_t12rgt179eDJZMJm9^lis#5`O&Rb0Yma z1)}%AW=TH(EE8wJlmal`N-B!V+bR7PG&B3ZMTx|JrG2PYxc`awe>Lo56X=aovcmb0 zeJNNRNBqRLD{r_y1&5)MDK=!X*Y8!l=s~8EeLTqCQmQJ7DpIG-FjzcknaVQf`2UXO+<)5pN7wbgV>$ny zx=Ng2l(zTw|J&=|EDnIS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1a2V#@%;tEM7Bz-@S6?fwAeZ(y&m12Do8&RXBec` zSy{05)D=3Mj<0dLY>`!Zq1k9Cl95XAxYr^rGjJ_9O|Vtk^!wzsTPB8B%cOvox$tAI z*nLU-ElyQoyILt%yjnVVw8sEc(;~u1;Mjg<2LAH{Bmswo<(t4__M2_wT+;xG_l1ft zcQ7QFf!b40`+Z|6h5$nn{GmJek%7vw8Uu=z_J*pt5NiZmDTt9Wh!8*z8r>a}>*6w( zgU#)w^sQ;zD~<|>S6DF?y0x$DiuqN4{j~}k)m)vP>1>Bq;OzG%IJ0KbT7u;(tSisCvZ z_5t6t*R0#4Qlgu)iomzLF{5&!qIJ@G1w<2cuWVrVPO#0QB6hX$WAZ{h*hZkO)@6l> z{A|BM`Vn?d2lQ@3#XwU^Jl;}?(x?9~sH1c$z@epA&? z{8&CzpLLPS$P9O42T7>+%MM|d;2W1;?`!E=IR#BtsO)!>-&N9FR`t?(##6$5>yW$` z64nJ5PcOf3QZ{6hQiQVAibT27cWnwB z;ob(Ws`j6tM~=GdDXQKir-v-wf9ZzkHq-wy_*Tg7_V+70|GL@XG?=@7_nv!yU-umU w-G!e2ecKbk={Emna{q2sc{u$!YkZMEzvNu&_|}5$_LVNm(A=Q-Jo?7}1CNbcfB*mh diff --git a/superset-frontend/temporary_superset_ui/superset-ui/plugins/plugin-filter-antd/src/Range/index.ts b/superset-frontend/temporary_superset_ui/superset-ui/plugins/plugin-filter-antd/src/Range/index.ts deleted file mode 100644 index 4a77fbb97c41..000000000000 --- a/superset-frontend/temporary_superset_ui/superset-ui/plugins/plugin-filter-antd/src/Range/index.ts +++ /dev/null @@ -1,42 +0,0 @@ -/** - * 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 { t, ChartMetadata, ChartPlugin } from '@superset-ui/core'; -import buildQuery from './buildQuery'; -import controlPanel from './controlPanel'; -import transformProps from './transformProps'; -import thumbnail from './images/thumbnail.png'; - -export default class AntdRangeFilterPlugin extends ChartPlugin { - constructor() { - const metadata = new ChartMetadata({ - name: t('Range Filter Plugin'), - description: 'Range Filter Plugin using AntD', - isNativeFilter: true, - thumbnail, - }); - - super({ - buildQuery, - controlPanel, - loadChart: () => import('./AntdRangeFilter'), - metadata, - transformProps, - }); - } -} diff --git a/superset-frontend/temporary_superset_ui/superset-ui/plugins/plugin-filter-antd/src/Range/transformProps.ts b/superset-frontend/temporary_superset_ui/superset-ui/plugins/plugin-filter-antd/src/Range/transformProps.ts deleted file mode 100644 index 20b81b58ac2d..000000000000 --- a/superset-frontend/temporary_superset_ui/superset-ui/plugins/plugin-filter-antd/src/Range/transformProps.ts +++ /dev/null @@ -1,33 +0,0 @@ -/** - * 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 { ChartProps, DataRecord } from '@superset-ui/core'; - -export default function transformProps(chartProps: ChartProps) { - const { formData, height, hooks, queriesData, width } = chartProps; - const { setExtraFormData } = hooks; - const data = queriesData[0].data as DataRecord[]; - - return { - data, - formData, - height, - setExtraFormData, - width, - }; -} diff --git a/superset-frontend/temporary_superset_ui/superset-ui/plugins/plugin-filter-antd/src/Range/types.ts b/superset-frontend/temporary_superset_ui/superset-ui/plugins/plugin-filter-antd/src/Range/types.ts deleted file mode 100644 index e095c364b2b4..000000000000 --- a/superset-frontend/temporary_superset_ui/superset-ui/plugins/plugin-filter-antd/src/Range/types.ts +++ /dev/null @@ -1,35 +0,0 @@ -/** - * 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 { DataRecord, QueryFormData, SetExtraFormDataHook } from '@superset-ui/core'; -import { AntdPluginFilterStylesProps } from '../types'; - -interface AntdPluginFilterSelectCustomizeProps { - max?: number; - min?: number; -} - -export type PluginFilterRangeQueryFormData = QueryFormData & - AntdPluginFilterStylesProps & - AntdPluginFilterSelectCustomizeProps; - -export type AntdPluginFilterRangeProps = AntdPluginFilterStylesProps & { - data: DataRecord[]; - formData: PluginFilterRangeQueryFormData; - setExtraFormData: SetExtraFormDataHook; -}; diff --git a/superset-frontend/temporary_superset_ui/superset-ui/plugins/plugin-filter-antd/src/Select/AntdSelectFilter.tsx b/superset-frontend/temporary_superset_ui/superset-ui/plugins/plugin-filter-antd/src/Select/AntdSelectFilter.tsx deleted file mode 100644 index 4df3a1ff97cb..000000000000 --- a/superset-frontend/temporary_superset_ui/superset-ui/plugins/plugin-filter-antd/src/Select/AntdSelectFilter.tsx +++ /dev/null @@ -1,103 +0,0 @@ -/** - * 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 { styled } from '@superset-ui/core'; -import React, { useEffect, useState } from 'react'; -import { Select } from 'antd'; -import { DEFAULT_FORM_DATA, AntdPluginFilterSelectProps } from './types'; -import { AntdPluginFilterStylesProps } from '../types'; - -const Styles = styled.div` - height: ${({ height }) => height}; - width: ${({ width }) => width}; -`; - -const { Option } = Select; - -export default function AntdPluginFilterSelect(props: AntdPluginFilterSelectProps) { - const [values, setValues] = useState<(string | number)[]>([]); - const DELIMITER = '!^&@%#*!@'; - const { data, formData, height, width, setExtraFormData } = props; - const { defaultValues, enableEmptyFilter, multiSelect, showSearch, inverseSelection } = { - ...DEFAULT_FORM_DATA, - ...formData, - }; - - useEffect(() => { - setValues(defaultValues || []); - }, [defaultValues]); - - let { groupby = [] } = formData; - groupby = Array.isArray(groupby) ? groupby : [groupby]; - - function handleChange(value?: number[] | string[] | null) { - setValues(value || []); - const [col] = groupby; - const emptyFilter = - enableEmptyFilter && - !inverseSelection && - (value === undefined || value === null || value.length === 0); - setExtraFormData({ - append_form_data: emptyFilter - ? { - extras: { - where: '1 = 0', - }, - } - : { - filters: - value === undefined || value === null || value.length === 0 - ? [] - : [ - { - col, - op: inverseSelection ? 'NOT IN' : 'IN', - val: value, - }, - ], - }, - }); - } - const placeholderText = - (data || []).length === 0 ? 'No data' : `${data.length} option${data.length > 1 ? 's' : 0}`; - return ( - - - - ); -} diff --git a/superset-frontend/temporary_superset_ui/superset-ui/plugins/plugin-filter-antd/src/Select/buildQuery.ts b/superset-frontend/temporary_superset_ui/superset-ui/plugins/plugin-filter-antd/src/Select/buildQuery.ts deleted file mode 100644 index ba82222b91f0..000000000000 --- a/superset-frontend/temporary_superset_ui/superset-ui/plugins/plugin-filter-antd/src/Select/buildQuery.ts +++ /dev/null @@ -1,41 +0,0 @@ -/** - * 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 { buildQueryContext, QueryFormData } from '@superset-ui/core'; - -/** - * The buildQuery function is used to create an instance of QueryContext that's - * sent to the chart data endpoint. In addition to containing information of which - * datasource to use, it specifies the type (e.g. full payload, samples, query) and - * format (e.g. CSV or JSON) of the result and whether or not to force refresh the data from - * the datasource as opposed to using a cached copy of the data, if available. - * - * More importantly though, QueryContext contains a property `queries`, which is an array of - * QueryObjects specifying individual data requests to be made. A QueryObject specifies which - * columns, metrics and filters, among others, to use during the query. Usually it will be enough - * to specify just one query based on the baseQueryObject, but for some more advanced use cases - * it is possible to define post processing operations in the QueryObject, or multiple queries - * if a viz needs multiple different result sets. - */ -export default function buildQuery(formData: QueryFormData) { - return buildQueryContext(formData, baseQueryObject => [ - { - ...baseQueryObject, - }, - ]); -} diff --git a/superset-frontend/temporary_superset_ui/superset-ui/plugins/plugin-filter-antd/src/Select/controlPanel.ts b/superset-frontend/temporary_superset_ui/superset-ui/plugins/plugin-filter-antd/src/Select/controlPanel.ts deleted file mode 100644 index b3ca6cc83698..000000000000 --- a/superset-frontend/temporary_superset_ui/superset-ui/plugins/plugin-filter-antd/src/Select/controlPanel.ts +++ /dev/null @@ -1,113 +0,0 @@ -/** - * 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 { t, validateNonEmpty } from '@superset-ui/core'; -import { ControlPanelConfig, sections } from '@superset-ui/chart-controls'; -import { DEFAULT_FORM_DATA } from './types'; - -const { - enableEmptyFilter, - fetchPredicate, - inverseSelection, - multiSelect, - showSearch, -} = DEFAULT_FORM_DATA; - -const config: ControlPanelConfig = { - controlPanelSections: [ - sections.legacyRegularTime, - { - label: t('Query'), - expanded: true, - controlSetRows: [ - ['groupby'], - ['metrics'], - ['adhoc_filters'], - [ - { - name: 'multiSelect', - config: { - type: 'CheckboxControl', - label: t('Multiple Select'), - default: multiSelect, - description: t('Allow selecting multiple values'), - }, - }, - ], - [ - { - name: 'enableEmptyFilter', - config: { - type: 'CheckboxControl', - label: t('Enable Empty Filter'), - default: enableEmptyFilter, - description: t( - 'When selection is empty, should an always false filter event be emitted', - ), - }, - }, - ], - [ - { - name: 'inverseSelection', - config: { - type: 'CheckboxControl', - label: t('Inverse Selection'), - default: inverseSelection, - description: t('Exclude selected values'), - }, - }, - ], - [ - { - name: 'showSearch', - config: { - type: 'CheckboxControl', - label: t('Search Field'), - default: showSearch, - description: t('Allow typing search terms'), - }, - }, - ], - [ - { - name: 'fetchPredicate', - config: { - type: 'TextControl', - label: t('Fetch predicate'), - default: fetchPredicate, - description: t( - 'Predicate applied when fetching distinct value to populate the filter control component.', - ), - }, - }, - null, - ], - ['row_limit', null], - ], - }, - ], - controlOverrides: { - groupby: { - multi: false, - validators: [validateNonEmpty], - }, - }, -}; - -export default config; diff --git a/superset-frontend/temporary_superset_ui/superset-ui/plugins/plugin-filter-antd/src/Select/images/thumbnail.png b/superset-frontend/temporary_superset_ui/superset-ui/plugins/plugin-filter-antd/src/Select/images/thumbnail.png deleted file mode 100644 index 7afef30bd4e6e4f85723208bf9f429647d03d3e5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5658 zcmaKQc|4SB*uSMHTe}h_DM`k@HN$YqGL1EB526`kFviSij6I|dWe=G`DtpY}AySfk zpR6&WC=xMbE28il=bX;_`{O#$X9Js+0@P z9Zy0?&%dmdmcqLtq%UchDVurg<2>*ef+#raAafgR5CIEwmDbah(g}cb3=nZtj8p*8 zi{t|jKuG^(7tW!#*-FwQCR`2tgI@f1yfYfR9Dkf zhDxa_t12rgt179eDJZMJm9^lis#5`O&Rb0Yma z1)}%AW=TH(EE8wJlmal`N-B!V+bR7PG&B3ZMTx|JrG2PYxc`awe>Lo56X=aovcmb0 zeJNNRNBqRLD{r_y1&5)MDK=!X*Y8!l=s~8EeLTqCQmQJ7DpIG-FjzcknaVQf`2UXO+<)5pN7wbgV>$ny zx=Ng2l(zTw|J&=|EDnIS$$yc{8T^ZV9Ek&X3J2M63Ef)GsSu+Y0#s|V8`U2}!EyZ! zU=$JK&eD6?e|0( zoU;iSo*iLYozObShmI3^3OP(Y%@O31l_ zGRw7+OTQ+8Li(#1s3`L6sN)d@ukVDS!?}Qe$h};G|ByUr?!U=DxS;=#yS8Qj;&MAO zvhMRTAHRMyNH09YEG%S^t}iY`wdBLO&^7U z;Ery}0Sm|6HLXfP^jzeC@mJ%GDUBbzj1h3yq+-lUt8U#(rsC}7oEmPHth`J-?Mb;u zshd@K%6(61IhJYp;ez6D+k2LdlD}>j$$*iDcvqPTv;c!&;dOL%JB0c8>Q=3^vwOTR ziG_Z3ixrTj#flM~G<@V5=j(>Go!S!-s#5R7z7-+g^6_zL+rQqY%0`BjWrQoFCv`94<3~@&o)E#Mr9Zj7#p&l~lU` zsK0z>UMeO|2Yg<+P+$7~o&P2t@6FIoXd54ub-Ouy4>a;8e^+%N_NE(LJyc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(##6$5>yW$` z64nJ5PcOf3QZ{6hQiQVAibT27cWnwB z;ob(Ws`j6tM~=GdDXQKir-v-wf9ZzkHq-wy_*Tg7_V+70|GL@XG?=@7_nv!yU-umU w-G!e2ecKbk={Emna{q2sc{u$!YkZMEzvNu&_|}5$_LVNm(A=Q-Jo?7}1CNbcfB*mh diff --git a/superset-frontend/temporary_superset_ui/superset-ui/plugins/plugin-filter-antd/src/Select/index.ts b/superset-frontend/temporary_superset_ui/superset-ui/plugins/plugin-filter-antd/src/Select/index.ts deleted file mode 100644 index f0d05c373924..000000000000 --- a/superset-frontend/temporary_superset_ui/superset-ui/plugins/plugin-filter-antd/src/Select/index.ts +++ /dev/null @@ -1,42 +0,0 @@ -/** - * 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 { t, ChartMetadata, ChartPlugin } from '@superset-ui/core'; -import buildQuery from './buildQuery'; -import controlPanel from './controlPanel'; -import transformProps from './transformProps'; -import thumbnail from './images/thumbnail.png'; - -export default class AntdFilterSelectPlugin extends ChartPlugin { - constructor() { - const metadata = new ChartMetadata({ - name: t('Select Filter Plugin'), - description: 'Select Filter Plugin using AntD', - isNativeFilter: true, - thumbnail, - }); - - super({ - buildQuery, - controlPanel, - loadChart: () => import('./AntdSelectFilter'), - metadata, - transformProps, - }); - } -} diff --git a/superset-frontend/temporary_superset_ui/superset-ui/plugins/plugin-filter-antd/src/Select/transformProps.ts b/superset-frontend/temporary_superset_ui/superset-ui/plugins/plugin-filter-antd/src/Select/transformProps.ts deleted file mode 100644 index 935f49f2dc2a..000000000000 --- a/superset-frontend/temporary_superset_ui/superset-ui/plugins/plugin-filter-antd/src/Select/transformProps.ts +++ /dev/null @@ -1,35 +0,0 @@ -/** - * 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 { ChartProps, DataRecord } from '@superset-ui/core'; -import { DEFAULT_FORM_DATA } from './types'; - -export default function transformProps(chartProps: ChartProps) { - const { formData, height, hooks, queriesData, width } = chartProps; - const newFormData = { ...DEFAULT_FORM_DATA, ...formData }; - const { setExtraFormData = () => {} } = hooks; - const data = queriesData[0].data as DataRecord[]; - - return { - width, - height, - data, - formData: newFormData, - setExtraFormData, - }; -} diff --git a/superset-frontend/temporary_superset_ui/superset-ui/plugins/plugin-filter-antd/src/Select/types.ts b/superset-frontend/temporary_superset_ui/superset-ui/plugins/plugin-filter-antd/src/Select/types.ts deleted file mode 100644 index f485685f9579..000000000000 --- a/superset-frontend/temporary_superset_ui/superset-ui/plugins/plugin-filter-antd/src/Select/types.ts +++ /dev/null @@ -1,48 +0,0 @@ -/** - * 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 { QueryFormData, DataRecord, SetExtraFormDataHook } from '@superset-ui/core'; -import { AntdPluginFilterStylesProps } from '../types'; - -interface AntdPluginFilterSelectCustomizeProps { - defaultValues?: (string | number)[]; - enableEmptyFilter: boolean; - fetchPredicate?: string; - inverseSelection: boolean; - multiSelect: boolean; - showSearch: boolean; -} - -export type AntdPluginFilterSelectQueryFormData = QueryFormData & - AntdPluginFilterStylesProps & - AntdPluginFilterSelectCustomizeProps; - -export type AntdPluginFilterSelectProps = AntdPluginFilterStylesProps & { - data: DataRecord[]; - setExtraFormData: SetExtraFormDataHook; - formData: AntdPluginFilterSelectQueryFormData; -}; - -export const DEFAULT_FORM_DATA: AntdPluginFilterSelectCustomizeProps = { - defaultValues: [], - enableEmptyFilter: false, - fetchPredicate: '', - inverseSelection: false, - multiSelect: true, - showSearch: true, -}; diff --git a/superset-frontend/temporary_superset_ui/superset-ui/plugins/plugin-filter-antd/src/index.ts b/superset-frontend/temporary_superset_ui/superset-ui/plugins/plugin-filter-antd/src/index.ts deleted file mode 100644 index fadaf1cdec12..000000000000 --- a/superset-frontend/temporary_superset_ui/superset-ui/plugins/plugin-filter-antd/src/index.ts +++ /dev/null @@ -1,20 +0,0 @@ -/** - * 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. - */ -export { default as AntdSelectFilterPlugin } from './Select'; -export { default as AntdRangeFilterPlugin } from './Range'; diff --git a/superset-frontend/temporary_superset_ui/superset-ui/plugins/plugin-filter-antd/src/types.ts b/superset-frontend/temporary_superset_ui/superset-ui/plugins/plugin-filter-antd/src/types.ts deleted file mode 100644 index 869dc79e3216..000000000000 --- a/superset-frontend/temporary_superset_ui/superset-ui/plugins/plugin-filter-antd/src/types.ts +++ /dev/null @@ -1,22 +0,0 @@ -/** - * 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. - */ -export interface AntdPluginFilterStylesProps { - height: number; - width: number; -} diff --git a/superset-frontend/temporary_superset_ui/superset-ui/plugins/plugin-filter-antd/test/index.test.ts b/superset-frontend/temporary_superset_ui/superset-ui/plugins/plugin-filter-antd/test/index.test.ts deleted file mode 100644 index 72fcfba90397..000000000000 --- a/superset-frontend/temporary_superset_ui/superset-ui/plugins/plugin-filter-antd/test/index.test.ts +++ /dev/null @@ -1,34 +0,0 @@ -/** - * 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 { AntdSelectFilterPlugin, AntdRangeFilterPlugin } from '../src'; - -/** - * The example tests in this file act as a starting point, and - * we encourage you to build more. These tests check that the - * plugin loads properly, and focus on `transformProps` - * to ake sure that data, controls, and props are all - * treated correctly (e.g. formData from plugin controls - * properly transform the data and/or any resulting props). - */ -describe('@superset-ui/plugin-filter-antd', () => { - it('exists', () => { - expect(AntdSelectFilterPlugin).toBeDefined(); - expect(AntdRangeFilterPlugin).toBeDefined(); - }); -}); diff --git a/superset-frontend/temporary_superset_ui/superset-ui/plugins/plugin-filter-antd/tsconfig.json b/superset-frontend/temporary_superset_ui/superset-ui/plugins/plugin-filter-antd/tsconfig.json deleted file mode 100644 index f164c580609c..000000000000 --- a/superset-frontend/temporary_superset_ui/superset-ui/plugins/plugin-filter-antd/tsconfig.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "compilerOptions": { - "declarationDir": "lib", - "outDir": "lib", - "rootDir": "src" - }, - "exclude": [ - "lib", - "test" - ], - "extends": "../../tsconfig.options.json", - "include": [ - "src/**/*", - "types/**/*", - "../../types/**/*" - ], - "references": [ - { - "path": "../../packages/superset-ui-chart-controls" - }, - { - "path": "../../packages/superset-ui-core" - } - ] -} diff --git a/superset-frontend/temporary_superset_ui/superset-ui/plugins/plugin-filter-antd/types/external.d.ts b/superset-frontend/temporary_superset_ui/superset-ui/plugins/plugin-filter-antd/types/external.d.ts deleted file mode 100644 index 0935dbbd8066..000000000000 --- a/superset-frontend/temporary_superset_ui/superset-ui/plugins/plugin-filter-antd/types/external.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -declare module '*.png' { - const value: any; - export default value; -}