Skip to content

Commit b2cac23

Browse files
remove criteria contingencies (#901)
Signed-off-by: Mathieu DEHARBE <[email protected]>
1 parent c8511b2 commit b2cac23

File tree

6 files changed

+3
-231
lines changed

6 files changed

+3
-231
lines changed

src/components/contingencyList/criteriaBased/CriteriaBasedForm.tsx

Lines changed: 0 additions & 83 deletions
This file was deleted.

src/components/contingencyList/criteriaBased/criteriaBasedUtils.ts

Lines changed: 0 additions & 62 deletions
This file was deleted.

src/components/contingencyList/criteriaBased/index.ts

Lines changed: 0 additions & 9 deletions
This file was deleted.

src/components/filter/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ export * from './filter.type';
88
export * from './FilterCreationDialog';
99
export * from './FilterForm';
1010
export * from './constants/FilterConstants';
11-
export * from '../contingencyList/criteriaBased';
1211
export * from './expert';
1312
export * from './explicitNaming';
1413
export * from './utils';

src/components/filter/utils/filterFormUtils.ts

Lines changed: 3 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -4,72 +4,11 @@
44
* License, v. 2.0. If a copy of the MPL was not distributed with this
55
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
66
*/
7-
import { FunctionComponent } from 'react';
8-
import { FieldConstants } from '../../../utils/constants/fieldConstants';
9-
import { RangeInput } from '../../inputs/reactHookForm/numbers/RangeInput';
10-
import { CountriesInput } from '../../inputs/reactHookForm/selectInputs/CountriesInput';
11-
import { BASE_EQUIPMENTS, EquipmentType } from '../../../utils/types/equipmentType';
7+
import { BASE_EQUIPMENTS, EquipmentType } from '../../../utils';
128

13-
const countries = {
14-
renderer: CountriesInput,
15-
props: {
16-
label: 'Countries',
17-
name: `${FieldConstants.CRITERIA_BASED}.${FieldConstants.COUNTRIES}`,
18-
},
19-
};
20-
const countries1 = {
21-
renderer: CountriesInput,
22-
props: {
23-
label: 'Countries1',
24-
name: `${FieldConstants.CRITERIA_BASED}.${FieldConstants.COUNTRIES_1}`,
25-
},
26-
};
27-
const countries2 = {
28-
renderer: CountriesInput,
29-
props: {
30-
label: 'Countries2',
31-
name: `${FieldConstants.CRITERIA_BASED}.${FieldConstants.COUNTRIES_2}`,
32-
},
33-
};
34-
const nominalVoltage = {
35-
renderer: RangeInput,
36-
props: {
37-
label: 'nominalVoltage',
38-
name: `${FieldConstants.CRITERIA_BASED}.${FieldConstants.NOMINAL_VOLTAGE}`,
39-
},
40-
};
41-
const nominalVoltage1 = {
42-
renderer: RangeInput,
43-
props: {
44-
label: 'nominalVoltage1',
45-
name: `${FieldConstants.CRITERIA_BASED}.${FieldConstants.NOMINAL_VOLTAGE_1}`,
46-
},
47-
};
48-
const nominalVoltage2 = {
49-
renderer: RangeInput,
50-
props: {
51-
label: 'nominalVoltage2',
52-
name: `${FieldConstants.CRITERIA_BASED}.${FieldConstants.NOMINAL_VOLTAGE_2}`,
53-
},
54-
};
55-
const nominalVoltage3 = {
56-
renderer: RangeInput,
57-
props: {
58-
label: 'nominalVoltage3',
59-
name: `${FieldConstants.CRITERIA_BASED}.${FieldConstants.NOMINAL_VOLTAGE_3}`,
60-
},
61-
};
62-
export type FormField = {
63-
renderer: FunctionComponent<any>;
64-
props: {
65-
label: string;
66-
name: string;
67-
};
68-
};
69-
export type FormEquipment = {
9+
export type ContingencyListEquipment = {
7010
id: string;
7111
label: string;
72-
fields: FormField[];
7312
};
7413

7514
export const CONTINGENCY_LIST_EQUIPMENTS: Record<
@@ -84,62 +23,51 @@ export const CONTINGENCY_LIST_EQUIPMENTS: Record<
8423
| EquipmentType.STATIC_VAR_COMPENSATOR
8524
| EquipmentType.HVDC_LINE
8625
| EquipmentType.DANGLING_LINE,
87-
FormEquipment
26+
ContingencyListEquipment
8827
> = {
8928
BUSBAR_SECTION: {
9029
id: 'BUSBAR_SECTION',
9130
label: 'BusBarSections',
92-
fields: [countries, nominalVoltage],
9331
},
9432
LINE: {
9533
id: 'LINE',
9634
label: 'Lines',
97-
fields: [countries1, countries2, nominalVoltage1, nominalVoltage2],
9835
},
9936
TWO_WINDINGS_TRANSFORMER: {
10037
id: 'TWO_WINDINGS_TRANSFORMER',
10138
label: 'TwoWindingsTransformers',
102-
fields: [countries, nominalVoltage1, nominalVoltage2],
10339
},
10440
THREE_WINDINGS_TRANSFORMER: {
10541
id: 'THREE_WINDINGS_TRANSFORMER',
10642
label: 'ThreeWindingsTransformers',
107-
fields: [countries, nominalVoltage1, nominalVoltage2, nominalVoltage3],
10843
},
10944
GENERATOR: {
11045
id: 'GENERATOR',
11146
label: 'Generators',
112-
fields: [countries, nominalVoltage],
11347
},
11448
BATTERY: {
11549
id: 'BATTERY',
11650
label: 'Batteries',
117-
fields: [countries, nominalVoltage],
11851
},
11952
LOAD: {
12053
id: 'LOAD',
12154
label: 'Loads',
122-
fields: [countries, nominalVoltage],
12355
},
12456
SHUNT_COMPENSATOR: {
12557
id: 'SHUNT_COMPENSATOR',
12658
label: 'ShuntCompensators',
127-
fields: [countries, nominalVoltage],
12859
},
12960
STATIC_VAR_COMPENSATOR: {
13061
id: 'STATIC_VAR_COMPENSATOR',
13162
label: 'StaticVarCompensators',
132-
fields: [countries, nominalVoltage],
13363
},
13464
HVDC_LINE: {
13565
id: 'HVDC_LINE',
13666
label: 'HvdcLines',
137-
fields: [countries1, countries2, nominalVoltage],
13867
},
13968
DANGLING_LINE: {
14069
id: 'DANGLING_LINE',
14170
label: 'DanglingLines',
142-
fields: [countries, nominalVoltage],
14371
},
14472
};
14573

src/utils/constants/fieldConstants.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ export enum FieldConstants {
1717
COUNTRIES_1 = 'countries1',
1818
COUNTRIES_2 = 'countries2',
1919
COUNTRIES = 'countries',
20-
CRITERIA_BASED = 'criteriaBased',
2120
CURRENT_PARAMETERS = 'currentParameters',
2221
DESCRIPTION = 'description',
2322
DIRECTORY = 'directory',

0 commit comments

Comments
 (0)