villebro commented on a change in pull request #14408:
URL: https://github.com/apache/superset/pull/14408#discussion_r624891416



##########
File path: 
superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/utils.ts
##########
@@ -20,6 +20,7 @@ import { FormInstance } from 'antd/lib/form';
 import shortid from 'shortid';
 import { FilterRemoval, NativeFiltersForm } from './types';
 import { Filter, FilterConfiguration, Target } from '../types';
+import { getInitialDataMask } from '../../../../dataMask/reducer';

Review comment:
       nit:
   ```suggestion
   import { getInitialDataMask } from 'src/dataMask/reducer';
   ```

##########
File path: superset-frontend/src/dashboard/actions/nativeFilters.ts
##########
@@ -99,6 +91,7 @@ export const setFilterConfiguration = (
         native_filter_configuration: filterConfig,
       }),
     });
+    console.log(JSON.parse(response.result.json_metadata));

Review comment:
       leftover:
   ```suggestion
   ```

##########
File path: superset-frontend/src/dashboard/types.ts
##########
@@ -95,7 +95,7 @@ export type LayoutItem = {
 
 type ActiveFilter = {
   scope: number[];
-  values: any[];
+  values: JsonObject;

Review comment:
       Is this not `ExtraFormData`?
   

##########
File path: superset-frontend/src/dataMask/reducer.ts
##########
@@ -20,23 +20,57 @@
 /* eslint-disable no-param-reassign */
 // <- When we work with Immer, we need reassign, so disabling lint
 import produce from 'immer';
+import { DataMask, FeatureFlag } from '@superset-ui/core';
 import { DataMaskStateWithId, DataMaskWithId } from './types';
 import {
   AnyDataMaskAction,
   SET_DATA_MASK_FOR_FILTER_CONFIG_COMPLETE,
   UPDATE_DATA_MASK,
 } from './actions';
 import { NATIVE_FILTER_PREFIX } from 
'../dashboard/components/nativeFilters/FiltersConfigModal/utils';
-import { Filter } from '../dashboard/components/nativeFilters/types';
+import {
+  Filter,
+  FilterConfiguration,
+} from '../dashboard/components/nativeFilters/types';
+import { HYDRATE_DASHBOARD } from '../dashboard/actions/hydrate';
+import { isFeatureEnabled } from '../featureFlags';

Review comment:
       ```suggestion
   import { HYDRATE_DASHBOARD } from 'src/dashboard/actions/hydrate';
   import { isFeatureEnabled } from 'src/featureFlags';
   ```

##########
File path: 
superset-frontend/src/dashboard/components/nativeFilters/FilterBar/utils.ts
##########
@@ -39,3 +40,9 @@ export function mapParentFiltersToChildren(
   });
   return cascadeChildren;
 }
+
+export const getOnlyExtraFormData = (data: DataMaskStateWithId) =>
+  Object.values(data).reduce(
+    (prev, next) => ({ ...prev, [next.id]: next.filterState }),

Review comment:
       I believe this should be
   ```suggestion
       (prev, next) => ({ ...prev, [next.id]: next.extraFormData }),
   ```

##########
File path: 
superset-frontend/src/dashboard/components/nativeFilters/FilterBar/state.ts
##########
@@ -22,10 +22,14 @@ import {
   Filters,
   FilterSets as FilterSetsType,
 } from 'src/dashboard/reducers/types';
-import { DataMaskState, DataMaskStateWithId } from 'src/dataMask/types';
-import { useEffect, useState } from 'react';
-import { areObjectsEqual } from 'src/reduxUtils';
-import { Filter } from '../types';
+import {
+  DataMaskState,
+  DataMaskStateWithId,
+  DataMaskWithId,
+} from 'src/dataMask/types';
+import { useEffect } from 'react';
+import { NATIVE_FILTER_PREFIX } from '../FiltersConfigModal/utils';
+import { RootState } from '../../../types';

Review comment:
       nit:
   ```suggestion
   import { RootState } from 'src/dashboard/types';
   ```




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to