mirror of
https://github.com/apache/superset.git
synced 2026-04-07 10:31:50 +00:00
refactor(native-filters): Move filtersState to dataMask redux root (#13437)
This commit is contained in:
@@ -33,6 +33,7 @@ import {
|
||||
NATIVE_FILTER_ID,
|
||||
layoutForSingleNativeFilter,
|
||||
singleNativeFiltersState,
|
||||
dataMaskWith1Filter,
|
||||
} from 'spec/fixtures/mockNativeFilters';
|
||||
import dashboardInfo from 'spec/fixtures/mockDashboardInfo';
|
||||
import { dashboardLayout } from 'spec/fixtures/mockDashboardLayout';
|
||||
@@ -154,7 +155,8 @@ describe('Dashboard', () => {
|
||||
activeFilters: {
|
||||
...OVERRIDE_FILTERS,
|
||||
...getActiveNativeFilters({
|
||||
nativeFilters: singleNativeFiltersState,
|
||||
dataMask: dataMaskWith1Filter,
|
||||
filters: singleNativeFiltersState.filters,
|
||||
layout: layoutForSingleNativeFilter,
|
||||
}),
|
||||
},
|
||||
|
||||
@@ -16,12 +16,17 @@
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
export const nativeFiltersInfo = {
|
||||
import { DataMaskStateWithId, DataMaskType } from 'src/dataMask/types';
|
||||
import { NativeFiltersState } from 'src/dashboard/reducers/types';
|
||||
|
||||
export const nativeFiltersInfo: NativeFiltersState = {
|
||||
filterSets: {},
|
||||
filters: {
|
||||
DefaultsID: {
|
||||
cascadeParentIds: [],
|
||||
id: 'DefaultsID',
|
||||
name: 'test',
|
||||
type: 'filter_select',
|
||||
filterType: 'filter_select',
|
||||
targets: [
|
||||
{
|
||||
datasetId: 0,
|
||||
@@ -37,17 +42,22 @@ export const nativeFiltersInfo = {
|
||||
excluded: [],
|
||||
},
|
||||
isInstant: true,
|
||||
allowsMultipleValues: true,
|
||||
isRequired: false,
|
||||
},
|
||||
},
|
||||
filtersState: {
|
||||
nativeFilters: {
|
||||
DefaultsID: {
|
||||
id: 'DefaultId',
|
||||
currentState: {
|
||||
value: [],
|
||||
},
|
||||
controlValues: {
|
||||
allowsMultipleValues: true,
|
||||
isRequired: false,
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
export const mockDataMaskInfo: DataMaskStateWithId = {
|
||||
[DataMaskType.CrossFilters]: {},
|
||||
[DataMaskType.OwnFilters]: {},
|
||||
[DataMaskType.NativeFilters]: {
|
||||
DefaultsID: {
|
||||
id: 'DefaultId',
|
||||
currentState: {
|
||||
value: [],
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -61,15 +61,15 @@ describe('getFormDataWithExtraFilters', () => {
|
||||
},
|
||||
} as unknown) as Filter,
|
||||
},
|
||||
filtersState: {
|
||||
crossFilters: {},
|
||||
ownFilters: {},
|
||||
nativeFilters: {
|
||||
[filterId]: {
|
||||
id: filterId,
|
||||
extraFormData: {},
|
||||
currentState: {},
|
||||
},
|
||||
},
|
||||
dataMask: {
|
||||
crossFilters: {},
|
||||
ownFilters: {},
|
||||
nativeFilters: {
|
||||
[filterId]: {
|
||||
id: filterId,
|
||||
extraFormData: {},
|
||||
currentState: {},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user