Skip to content

Commit

Permalink
Fix warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
m-ajay committed Oct 14, 2021
1 parent 2b81f94 commit fce3de1
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,11 @@ import {
} from 'react-reverse-portal';
import { Collapse } from 'src/common/components';
import { DataMaskStateWithId } from 'src/dataMask/types';
import { useDashboardHasTabs, useSelectFiltersInScope } from '../../state';
import { Filter } from '../../types';
import {
useDashboardHasTabs,
useSelectFiltersInScope,
} from 'src/dashboard/components/nativeFilters/state';
import { Filter } from 'src/dashboard/components/nativeFilters/types';
import CascadePopover from '../CascadeFilters/CascadePopover';
import { useFilters } from '../state';
import { buildCascadeFiltersTree } from './utils';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import Icons, { IconType } from 'src/components/Icons';
interface TitleContainerProps {
readonly isDragging: boolean;
}

const FILTER_TYPE = 'FILTER';

const Container = styled.div<TitleContainerProps>`
Expand All @@ -39,16 +40,18 @@ const Container = styled.div<TitleContainerProps>`
width: 100%;
display: flex;
padding: ${theme.gridUnit}px
`}
`}
`;

const DragIcon = styled(Icons.Drag)<IconType & { isDragging: boolean }>`
const DragIcon = styled(Icons.Drag, {
shouldForwardProp: propName => propName !== 'isDragging',
})<IconType & { isDragging: boolean }>`
${({ isDragging, theme }) => `
font-size: ${theme.typography.sizes.m}px;
margin-top: 15px;
cursor: ${isDragging ? 'grabbing' : 'grab'};
padding-left: ${theme.gridUnit}px;
`}
`}
`;

interface FilterTabTitleProps {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ const FilterTitle = styled.div`
color: ${theme.colors.primary.light1};
}
}
&.errored div, &.errored .warning{
&.errored div, &.errored .warning {
color: ${theme.colors.error.base};
}
`}
`}
`;

const StyledTrashIcon = styled(Icons.Trash)`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ const StyledContainer = styled.div`
flex-direction: row-reverse;
justify-content: space-between;
padding: 0px ${theme.gridUnit * 4}px;
`}
`}
`;

const StyledRowContainer = styled.div`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,12 +214,12 @@ export function FiltersConfigModal({
setRemovedFilters({});
setSaveAlertVisible(false);
setFormValues({ filters: {} });
setErroredFilters([]);
if (!isSaving) {
setOrderedFilters(buildFilterGroup(getInitialFilterHierarchy()));
form.resetFields();
}
form.resetFields();
form.setFieldsValue({ changed: false });
setErroredFilters([]);
};

const getFilterTitle = (id: string) =>
Expand Down

0 comments on commit fce3de1

Please sign in to comment.