Skip to content

Commit

Permalink
remove duplicates
Browse files Browse the repository at this point in the history
  • Loading branch information
basseche committed Jan 6, 2025
1 parent d316401 commit 1b9f306
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 34 deletions.
19 changes: 2 additions & 17 deletions src/components/filter/expert/ExpertFilterEditionDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,15 @@
*/

import { yupResolver } from '@hookform/resolvers/yup';
import { UUID } from 'crypto';
import { useCallback, useEffect, useState } from 'react';
import { useForm } from 'react-hook-form';
import { useSnackMessage } from '../../../hooks/useSnackMessage';
import { FetchStatus } from '../../../utils/constants/fetchStatus';
import { FieldConstants } from '../../../utils/constants/fieldConstants';
import { ElementExistsType } from '../../../utils/types/elementType';
import yup from '../../../utils/yupConfig';
import { CustomMuiDialog } from '../../dialogs/customMuiDialog/CustomMuiDialog';
import { FilterType, NO_ITEM_SELECTION_FOR_COPY } from '../constants/FilterConstants';
import { ItemSelectionForCopy } from '../filter.type';
import { FilterProps } from '../filter.type';
import { FilterForm } from '../FilterForm';
import { saveExpertFilter } from '../utils/filterApi';
import { EXPERT_FILTER_QUERY, expertFilterSchema } from './ExpertFilterForm';
Expand All @@ -34,21 +32,8 @@ const formSchema = yup
})
.required();

export interface ExpertFilterEditionDialogProps {
id: string;
name: string;
titleId: string;
open: boolean;
onClose: () => void;
broadcastChannel: BroadcastChannel;
itemSelectionForCopy: ItemSelectionForCopy;
setItemSelectionForCopy: (selection: ItemSelectionForCopy) => void;
export interface ExpertFilterEditionDialogProps extends FilterProps {
getFilterById: (id: string) => Promise<{ [prop: string]: any }>;
elementUuid: UUID;
activeDirectory?: UUID;
elementExists?: ElementExistsType;
language?: string;
description?: string;
}

export function ExpertFilterEditionDialog({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
*/

import { yupResolver } from '@hookform/resolvers/yup';
import { UUID } from 'crypto';
import PropTypes from 'prop-types';
import { useCallback, useEffect, useState } from 'react';
import { SubmitHandler, useForm, UseFormReturn } from 'react-hook-form';
Expand All @@ -19,11 +18,10 @@ import { saveExplicitNamingFilter } from '../utils/filterApi';
import { explicitNamingFilterSchema, FILTER_EQUIPMENTS_ATTRIBUTES } from './ExplicitNamingFilterForm';

import { FetchStatus } from '../../../utils/constants/fetchStatus';
import { ElementExistsType } from '../../../utils/types/elementType';
import { FilterForm } from '../FilterForm';
import { FilterType, NO_ITEM_SELECTION_FOR_COPY } from '../constants/FilterConstants';
import { ItemSelectionForCopy } from '../filter.type';
import { MAX_CHAR_DESCRIPTION } from '../../../utils/constants/UIconstants';
import { FilterProps } from '../filter.type';

const formSchema = yup
.object()
Expand All @@ -37,21 +35,8 @@ const formSchema = yup
.required();

type FormSchemaType = yup.InferType<typeof formSchema>;
export interface ExplicitNamingFilterEditionDialogProps {
id: string;
name: string;
titleId: string;
open: boolean;
onClose: () => void;
broadcastChannel: BroadcastChannel;
itemSelectionForCopy: ItemSelectionForCopy;
setItemSelectionForCopy: (selection: ItemSelectionForCopy) => void;
export interface ExplicitNamingFilterEditionDialogProps extends FilterProps {
getFilterById: (id: string) => Promise<any>;
elementUuid: UUID;
activeDirectory?: UUID;
elementExists?: ElementExistsType;
language?: string;
description?: string;
}

export function ExplicitNamingFilterEditionDialog({
Expand Down
17 changes: 17 additions & 0 deletions src/components/filter/filter.type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
*/

import { UUID } from 'crypto';
import { ElementExistsType } from '../../utils';

/**
* Represent an item/object in directories.
Expand All @@ -18,3 +19,19 @@ export type ItemSelectionForCopy = {
parentDirectoryUuid: UUID | null;
specificTypeItem: string | null;
};

export interface FilterProps {
id: string;
name: string;
titleId: string;
open: boolean;
onClose: () => void;
broadcastChannel: BroadcastChannel;
itemSelectionForCopy: ItemSelectionForCopy;
setItemSelectionForCopy: (selection: ItemSelectionForCopy) => void;
elementUuid: UUID;
activeDirectory?: UUID;
elementExists?: ElementExistsType;
language?: string;
description?: string;
}

0 comments on commit 1b9f306

Please sign in to comment.