Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(native-filters): update dataMask and ExtraFormData schema #13983

Merged
merged 24 commits into from
Apr 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
9b27475
refactor: updates usage of `ownFilters` to `ownState`
simcha90 Apr 6, 2021
a9aaf29
Merge branch 'master' of github.com:apache/superset into own_state
simcha90 Apr 7, 2021
274f559
refactor: update dataMask (final)
simcha90 Apr 8, 2021
fc47dad
Merge branch 'master' of github.com:apache/superset into own_state
simcha90 Apr 8, 2021
6a9d5d3
lint: fix lint
simcha90 Apr 8, 2021
1501558
Merge branch 'master' of github.com:apache/superset into own_state
simcha90 Apr 12, 2021
3589b12
Merge branch 'master' of github.com:apache/superset into own_state
simcha90 Apr 12, 2021
b64ae02
refactor: revert feat
simcha90 Apr 12, 2021
63799f5
fix: fix missed chart configuration
simcha90 Apr 12, 2021
1f12208
add filter set migration
villebro Apr 12, 2021
c2755bc
Merge branch 'master' of github.com:apache/superset into own_state
simcha90 Apr 13, 2021
b84d266
Merge branch 'own_state' of github.com:simchaNielsen/incubator-supers…
simcha90 Apr 13, 2021
8f5a2f2
apply new changes
villebro Apr 13, 2021
11d21af
Merge branch 'master' into own_state
villebro Apr 14, 2021
aa6baba
fix migration revision
villebro Apr 14, 2021
68d4b1f
Merge branch 'master' into own_state
villebro Apr 15, 2021
8751f3f
update migration
villebro Apr 15, 2021
2ee3dfc
fix jest mock
villebro Apr 15, 2021
0653a92
js lint
villebro Apr 15, 2021
336adbf
fix test types
villebro Apr 15, 2021
1ebfa7d
update tests and types
villebro Apr 15, 2021
29a8b59
remove append_form_data from tests
villebro Apr 15, 2021
22863aa
fix findExistingFilterSet tests
villebro Apr 15, 2021
d493bb8
add migration test
villebro Apr 15, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
582 changes: 291 additions & 291 deletions superset-frontend/package-lock.json

Large diffs are not rendered by default.

54 changes: 27 additions & 27 deletions superset-frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,34 +65,34 @@
"@babel/runtime-corejs3": "^7.12.5",
"@data-ui/sparkline": "^0.0.84",
"@emotion/core": "^10.0.35",
"@superset-ui/chart-controls": "^0.17.30",
"@superset-ui/core": "^0.17.30",
"@superset-ui/legacy-plugin-chart-calendar": "^0.17.30",
"@superset-ui/legacy-plugin-chart-chord": "^0.17.30",
"@superset-ui/legacy-plugin-chart-country-map": "^0.17.31",
"@superset-ui/legacy-plugin-chart-event-flow": "^0.17.30",
"@superset-ui/legacy-plugin-chart-force-directed": "^0.17.30",
"@superset-ui/legacy-plugin-chart-heatmap": "^0.17.30",
"@superset-ui/legacy-plugin-chart-histogram": "^0.17.30",
"@superset-ui/legacy-plugin-chart-horizon": "^0.17.30",
"@superset-ui/legacy-plugin-chart-map-box": "^0.17.30",
"@superset-ui/legacy-plugin-chart-paired-t-test": "^0.17.30",
"@superset-ui/legacy-plugin-chart-parallel-coordinates": "^0.17.30",
"@superset-ui/legacy-plugin-chart-partition": "^0.17.30",
"@superset-ui/legacy-plugin-chart-pivot-table": "^0.17.30",
"@superset-ui/legacy-plugin-chart-rose": "^0.17.30",
"@superset-ui/legacy-plugin-chart-sankey": "^0.17.30",
"@superset-ui/legacy-plugin-chart-sankey-loop": "^0.17.30",
"@superset-ui/legacy-plugin-chart-sunburst": "^0.17.30",
"@superset-ui/legacy-plugin-chart-treemap": "^0.17.30",
"@superset-ui/legacy-plugin-chart-world-map": "^0.17.30",
"@superset-ui/legacy-preset-chart-big-number": "^0.17.30",
"@superset-ui/chart-controls": "^0.17.32",
"@superset-ui/core": "^0.17.32",
"@superset-ui/legacy-plugin-chart-calendar": "^0.17.32",
"@superset-ui/legacy-plugin-chart-chord": "^0.17.32",
"@superset-ui/legacy-plugin-chart-country-map": "^0.17.32",
"@superset-ui/legacy-plugin-chart-event-flow": "^0.17.32",
"@superset-ui/legacy-plugin-chart-force-directed": "^0.17.32",
"@superset-ui/legacy-plugin-chart-heatmap": "^0.17.32",
"@superset-ui/legacy-plugin-chart-histogram": "^0.17.32",
"@superset-ui/legacy-plugin-chart-horizon": "^0.17.32",
"@superset-ui/legacy-plugin-chart-map-box": "^0.17.32",
"@superset-ui/legacy-plugin-chart-paired-t-test": "^0.17.32",
"@superset-ui/legacy-plugin-chart-parallel-coordinates": "^0.17.32",
"@superset-ui/legacy-plugin-chart-partition": "^0.17.32",
"@superset-ui/legacy-plugin-chart-pivot-table": "^0.17.32",
"@superset-ui/legacy-plugin-chart-rose": "^0.17.32",
"@superset-ui/legacy-plugin-chart-sankey": "^0.17.32",
"@superset-ui/legacy-plugin-chart-sankey-loop": "^0.17.32",
"@superset-ui/legacy-plugin-chart-sunburst": "^0.17.32",
"@superset-ui/legacy-plugin-chart-treemap": "^0.17.32",
"@superset-ui/legacy-plugin-chart-world-map": "^0.17.32",
"@superset-ui/legacy-preset-chart-big-number": "^0.17.32",
"@superset-ui/legacy-preset-chart-deckgl": "^0.4.6",
"@superset-ui/legacy-preset-chart-nvd3": "^0.17.30",
"@superset-ui/plugin-chart-echarts": "^0.17.30",
"@superset-ui/plugin-chart-table": "^0.17.30",
"@superset-ui/plugin-chart-word-cloud": "^0.17.30",
"@superset-ui/preset-chart-xy": "^0.17.30",
"@superset-ui/legacy-preset-chart-nvd3": "^0.17.32",
"@superset-ui/plugin-chart-echarts": "^0.17.32",
"@superset-ui/plugin-chart-table": "^0.17.32",
"@superset-ui/plugin-chart-word-cloud": "^0.17.32",
"@superset-ui/preset-chart-xy": "^0.17.32",
"@vx/responsive": "^0.0.195",
"abortcontroller-polyfill": "^1.1.9",
"antd": "^4.9.4",
Expand Down
73 changes: 33 additions & 40 deletions superset-frontend/spec/fixtures/mockNativeFilters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
import { ExtraFormData } from '@superset-ui/core';
import { NativeFiltersState } from 'src/dashboard/reducers/types';
import { DataMaskStateWithId } from '../../src/dataMask/types';

Expand Down Expand Up @@ -76,44 +77,38 @@ export const nativeFilters: NativeFiltersState = {
};

export const dataMaskWith2Filters: DataMaskStateWithId = {
crossFilters: {},
ownFilters: {},
nativeFilters: {
'NATIVE_FILTER-e7Q8zKixx': {
id: 'NATIVE_FILTER-e7Q8zKixx',
extraFormData: {
append_form_data: {
filters: [
{
col: 'region',
op: 'IN',
val: ['East Asia & Pacific'],
},
],
'NATIVE_FILTER-e7Q8zKixx': {
id: 'NATIVE_FILTER-e7Q8zKixx',
ownState: {},
extraFormData: {
filters: [
{
col: 'region',
op: 'IN',
val: ['East Asia & Pacific'],
},
},
currentState: {
value: ['East Asia & Pacific'],
},
],
},
'NATIVE_FILTER-x9QPw0so1': {
id: 'NATIVE_FILTER-x9QPw0so1',
extraFormData: {},
currentState: {},
filterState: {
value: ['East Asia & Pacific'],
},
},
'NATIVE_FILTER-x9QPw0so1': {
id: 'NATIVE_FILTER-x9QPw0so1',
ownState: {},
extraFormData: {},
filterState: {},
},
};

export const extraFormData = {
append_form_data: {
filters: [
{
col: 'ethnic_minority',
op: 'IN',
val: 'No, not an ethnic minority',
},
],
},
export const extraFormData: ExtraFormData = {
filters: [
{
col: 'ethnic_minority',
op: 'IN',
val: ['No, not an ethnic minority'],
},
],
};

export const NATIVE_FILTER_ID = 'NATIVE_FILTER-p4LImrSgA';
Expand All @@ -136,14 +131,12 @@ export const singleNativeFiltersState = {
},
};

export const dataMaskWith1Filter = {
nativeFilters: {
[NATIVE_FILTER_ID]: {
id: NATIVE_FILTER_ID,
extraFormData,
currentState: {
value: ['No, not an ethnic minority'],
},
export const dataMaskWith1Filter: DataMaskStateWithId = {
[NATIVE_FILTER_ID]: {
id: NATIVE_FILTER_ID,
extraFormData,
filterState: {
value: ['No, not an ethnic minority'],
},
},
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,15 @@
* specific language governing permissions and limitations
* under the License.
*/
import { DataMaskStateWithId, DataMaskType } from 'src/dataMask/types';
import { DataMaskStateWithId } from 'src/dataMask/types';
import { NativeFiltersState } from 'src/dashboard/reducers/types';

export const mockDataMaskInfo: DataMaskStateWithId = {
[DataMaskType.CrossFilters]: {},
[DataMaskType.OwnFilters]: {},
[DataMaskType.NativeFilters]: {
DefaultsID: {
id: 'DefaultId',
currentState: {
value: [],
},
DefaultsID: {
id: 'DefaultId',
ownState: {},
filterState: {
value: [],
},
},
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,11 @@ describe('getFormDataWithExtraFilters', () => {
},
},
dataMask: {
crossFilters: {},
ownFilters: {},
nativeFilters: {
[filterId]: {
id: filterId,
extraFormData: {},
currentState: {},
},
[filterId]: {
id: filterId,
extraFormData: {},
filterState: {},
ownState: {},
},
},
layout: (dashboardLayout.present as unknown) as {
Expand Down
Loading