Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
83 changes: 0 additions & 83 deletions src/components/contingencyList/criteriaBased/CriteriaBasedForm.tsx

This file was deleted.

62 changes: 0 additions & 62 deletions src/components/contingencyList/criteriaBased/criteriaBasedUtils.ts

This file was deleted.

9 changes: 0 additions & 9 deletions src/components/contingencyList/criteriaBased/index.ts

This file was deleted.

1 change: 0 additions & 1 deletion src/components/filter/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ export * from './filter.type';
export * from './FilterCreationDialog';
export * from './FilterForm';
export * from './constants/FilterConstants';
export * from '../contingencyList/criteriaBased';
export * from './expert';
export * from './explicitNaming';
export * from './utils';
78 changes: 3 additions & 75 deletions src/components/filter/utils/filterFormUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,72 +4,11 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
import { FunctionComponent } from 'react';
import { FieldConstants } from '../../../utils/constants/fieldConstants';
import { RangeInput } from '../../inputs/reactHookForm/numbers/RangeInput';
import { CountriesInput } from '../../inputs/reactHookForm/selectInputs/CountriesInput';
import { BASE_EQUIPMENTS, EquipmentType } from '../../../utils/types/equipmentType';
import { BASE_EQUIPMENTS, EquipmentType } from '../../../utils';

const countries = {
renderer: CountriesInput,
props: {
label: 'Countries',
name: `${FieldConstants.CRITERIA_BASED}.${FieldConstants.COUNTRIES}`,
},
};
const countries1 = {
renderer: CountriesInput,
props: {
label: 'Countries1',
name: `${FieldConstants.CRITERIA_BASED}.${FieldConstants.COUNTRIES_1}`,
},
};
const countries2 = {
renderer: CountriesInput,
props: {
label: 'Countries2',
name: `${FieldConstants.CRITERIA_BASED}.${FieldConstants.COUNTRIES_2}`,
},
};
const nominalVoltage = {
renderer: RangeInput,
props: {
label: 'nominalVoltage',
name: `${FieldConstants.CRITERIA_BASED}.${FieldConstants.NOMINAL_VOLTAGE}`,
},
};
const nominalVoltage1 = {
renderer: RangeInput,
props: {
label: 'nominalVoltage1',
name: `${FieldConstants.CRITERIA_BASED}.${FieldConstants.NOMINAL_VOLTAGE_1}`,
},
};
const nominalVoltage2 = {
renderer: RangeInput,
props: {
label: 'nominalVoltage2',
name: `${FieldConstants.CRITERIA_BASED}.${FieldConstants.NOMINAL_VOLTAGE_2}`,
},
};
const nominalVoltage3 = {
renderer: RangeInput,
props: {
label: 'nominalVoltage3',
name: `${FieldConstants.CRITERIA_BASED}.${FieldConstants.NOMINAL_VOLTAGE_3}`,
},
};
export type FormField = {
renderer: FunctionComponent<any>;
props: {
label: string;
name: string;
};
};
export type FormEquipment = {
export type ContingencyListEquipment = {
id: string;
label: string;
fields: FormField[];
};

export const CONTINGENCY_LIST_EQUIPMENTS: Record<
Expand All @@ -84,62 +23,51 @@ export const CONTINGENCY_LIST_EQUIPMENTS: Record<
| EquipmentType.STATIC_VAR_COMPENSATOR
| EquipmentType.HVDC_LINE
| EquipmentType.DANGLING_LINE,
FormEquipment
ContingencyListEquipment
> = {
BUSBAR_SECTION: {
id: 'BUSBAR_SECTION',
label: 'BusBarSections',
fields: [countries, nominalVoltage],
},
LINE: {
id: 'LINE',
label: 'Lines',
fields: [countries1, countries2, nominalVoltage1, nominalVoltage2],
},
TWO_WINDINGS_TRANSFORMER: {
id: 'TWO_WINDINGS_TRANSFORMER',
label: 'TwoWindingsTransformers',
fields: [countries, nominalVoltage1, nominalVoltage2],
},
THREE_WINDINGS_TRANSFORMER: {
id: 'THREE_WINDINGS_TRANSFORMER',
label: 'ThreeWindingsTransformers',
fields: [countries, nominalVoltage1, nominalVoltage2, nominalVoltage3],
},
GENERATOR: {
id: 'GENERATOR',
label: 'Generators',
fields: [countries, nominalVoltage],
},
BATTERY: {
id: 'BATTERY',
label: 'Batteries',
fields: [countries, nominalVoltage],
},
LOAD: {
id: 'LOAD',
label: 'Loads',
fields: [countries, nominalVoltage],
},
SHUNT_COMPENSATOR: {
id: 'SHUNT_COMPENSATOR',
label: 'ShuntCompensators',
fields: [countries, nominalVoltage],
},
STATIC_VAR_COMPENSATOR: {
id: 'STATIC_VAR_COMPENSATOR',
label: 'StaticVarCompensators',
fields: [countries, nominalVoltage],
},
HVDC_LINE: {
id: 'HVDC_LINE',
label: 'HvdcLines',
fields: [countries1, countries2, nominalVoltage],
},
DANGLING_LINE: {
id: 'DANGLING_LINE',
label: 'DanglingLines',
fields: [countries, nominalVoltage],
},
};

Expand Down
1 change: 0 additions & 1 deletion src/utils/constants/fieldConstants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ export enum FieldConstants {
COUNTRIES_1 = 'countries1',
COUNTRIES_2 = 'countries2',
COUNTRIES = 'countries',
CRITERIA_BASED = 'criteriaBased',
CURRENT_PARAMETERS = 'currentParameters',
DESCRIPTION = 'description',
DIRECTORY = 'directory',
Expand Down
Loading