Skip to content

Commit

Permalink
refactor: fix CR notes
Browse files Browse the repository at this point in the history
  • Loading branch information
simcha90 committed Apr 6, 2021
1 parent 37b3f0e commit 4d4b371
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import {
Behavior,
SetDataMaskHook,
SuperChart,
Place,
AppSection,
} from '@superset-ui/core';
import { FormInstance } from 'antd/lib/form';
import Loading from 'src/components/Loading';
Expand Down Expand Up @@ -61,7 +61,7 @@ const DefaultValue: FC<DefaultValueProps> = ({
<SuperChart
height={25}
width={250}
place={Place.FILTER_CONFIG_MODAL}
appSection={AppSection.FILTER_CONFIG_MODAL}
behaviors={[Behavior.NATIVE_FILTER]}
formData={formData}
// For charts that don't have datasource we need workaround for empty placeholder
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import {
DataMask,
ensureIsArray,
GenericDataType,
Place,
AppSection,
t,
tn,
} from '@superset-ui/core';
Expand Down Expand Up @@ -58,7 +58,7 @@ export default function PluginFilterSelect(props: PluginFilterSelectProps) {
width,
behaviors,
setDataMask,
place,
appSection,
} = props;
const {
defaultValue,
Expand All @@ -72,7 +72,7 @@ export default function PluginFilterSelect(props: PluginFilterSelectProps) {
} = formData;

const isDefaultToFirstItemInFilterConfigModal =
place === Place.FILTER_CONFIG_MODAL && defaultToFirstItem;
appSection === AppSection.FILTER_CONFIG_MODAL && defaultToFirstItem;

const groupby = ensureIsArray<string>(formData.groupby);
// Correct initial value for Ant Select
Expand All @@ -86,7 +86,7 @@ export default function PluginFilterSelect(props: PluginFilterSelectProps) {

// If we are in config modal we always need show empty select for `defaultToFirstItem`
const [values, setValues] = useState<SelectValue>(
defaultToFirstItem && place !== Place.FILTER_CONFIG_MODAL
defaultToFirstItem && appSection !== AppSection.FILTER_CONFIG_MODAL
? firstItem
: initSelectValue,
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export default function transformProps(
queriesData,
width,
behaviors,
place,
appSection,
} = chartProps;
const newFormData = { ...DEFAULT_FORM_DATA, ...formData };
const { setDataMask = () => {} } = hooks;
Expand All @@ -42,7 +42,7 @@ export default function transformProps(

return {
coltypeMap,
place,
appSection,
width,
behaviors,
height,
Expand Down
4 changes: 2 additions & 2 deletions superset-frontend/src/filters/components/Select/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* under the License.
*/
import {
Place,
AppSection,
ChartProps,
Behavior,
DataRecord,
Expand Down Expand Up @@ -56,7 +56,7 @@ export type PluginFilterSelectProps = PluginFilterStylesProps & {
data: DataRecord[];
setDataMask: SetDataMaskHook;
behaviors: Behavior[];
place: Place;
appSection: AppSection;
formData: PluginFilterSelectQueryFormData;
};

Expand Down

0 comments on commit 4d4b371

Please sign in to comment.