Skip to content

Commit

Permalink
Fix/clear on close type
Browse files Browse the repository at this point in the history
Related PR: gridsuite/gridexplore-app#540

Signed-off-by: Thang PHAM <phamthang37@gmail.com>
  • Loading branch information
thangqp committed Nov 19, 2024
1 parent d40f7af commit 9ed5713
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions src/components/filter/FilterCreationDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,20 @@ import { useCallback } from 'react';
import { Resolver, useForm } from 'react-hook-form';
import { yupResolver } from '@hookform/resolvers/yup';
import { UUID } from 'crypto';
import { saveCriteriaBasedFilter, saveExpertFilter, saveExplicitNamingFilter } from './utils/filterApi';
import { useSnackMessage } from '../../hooks/useSnackMessage';
import { CustomMuiDialog } from '../dialogs/customMuiDialog/CustomMuiDialog';
import { criteriaBasedFilterEmptyFormData, criteriaBasedFilterSchema } from './criteriaBased/CriteriaBasedFilterForm';
import { saveCriteriaBasedFilter, saveExpertFilter, saveExplicitNamingFilter } from './utils';
import { useSnackMessage } from '../../hooks';
import { CustomMuiDialog } from '../dialogs';
import { criteriaBasedFilterEmptyFormData, criteriaBasedFilterSchema } from './criteriaBased';
import {
explicitNamingFilterSchema,
FILTER_EQUIPMENTS_ATTRIBUTES,
getExplicitNamingFilterEmptyFormData,
} from './explicitNaming/ExplicitNamingFilterForm';
import { FieldConstants } from '../../utils/constants/fieldConstants';
} from './explicitNaming';
import { ElementExistsType, FieldConstants } from '../../utils';
import yup from '../../utils/yupConfig';
import { FilterForm } from './FilterForm';
import { EXPERT_FILTER_QUERY, expertFilterSchema, getExpertFilterEmptyFormData } from './expert/ExpertFilterForm';
import { EXPERT_FILTER_QUERY, expertFilterSchema, getExpertFilterEmptyFormData } from './expert';
import { FilterType } from './constants/FilterConstants';
import { ElementExistsType } from '../../utils/types/elementType';

const emptyFormData = {
[FieldConstants.NAME]: '',
Expand Down Expand Up @@ -51,7 +50,7 @@ const formSchema = yup

export interface FilterCreationDialogProps {
open: boolean;
onClose: (e?: unknown, nextSelectedDirectoryId?: string | null) => void;
onClose: () => void;
activeDirectory?: UUID;
elementExists?: ElementExistsType;
language?: string;
Expand Down

0 comments on commit 9ed5713

Please sign in to comment.