@gridsuite/commons-ui 0.132.0 → 0.133.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/filter/FilterCreationDialog.js +13 -3
- package/dist/components/filter/expert/ExpertFilterEditionDialog.js +12 -4
- package/dist/components/filter/expert/expertFilterConstants.d.ts +13 -12
- package/dist/components/filter/expert/expertFilterConstants.js +17 -48
- package/dist/components/filter/expert/expertFilterUtils.js +6 -2
- package/dist/components/filter/utils/filterApi.js +14 -6
- package/dist/components/index.js +0 -2
- package/dist/components/inputs/index.js +0 -2
- package/dist/components/inputs/reactHookForm/index.js +0 -2
- package/dist/components/inputs/reactHookForm/utils/index.d.ts +0 -1
- package/dist/components/inputs/reactHookForm/utils/index.js +0 -2
- package/dist/index.js +8 -3
- package/dist/services/businessErrorCode.d.ts +11 -0
- package/dist/services/businessErrorCode.js +10 -0
- package/dist/services/index.d.ts +1 -0
- package/dist/services/index.js +2 -0
- package/dist/services/utils.js +11 -5
- package/dist/translations/en/businessErrorsEn.d.ts +28 -0
- package/dist/translations/en/businessErrorsEn.js +25 -0
- package/dist/translations/en/equipmentsEn.d.ts +1 -0
- package/dist/translations/en/equipmentsEn.js +2 -1
- package/dist/translations/en/index.d.ts +1 -0
- package/dist/translations/en/index.js +2 -0
- package/dist/translations/fr/businessErrorsFr.d.ts +28 -0
- package/dist/translations/fr/businessErrorsFr.js +25 -0
- package/dist/translations/fr/equipmentsFr.d.ts +1 -0
- package/dist/translations/fr/equipmentsFr.js +2 -1
- package/dist/translations/fr/index.d.ts +1 -0
- package/dist/translations/fr/index.js +2 -0
- package/dist/utils/index.js +2 -1
- package/dist/utils/types/equipmentType.d.ts +162 -8
- package/dist/utils/types/equipmentType.js +117 -9
- package/dist/utils/types/index.js +2 -1
- package/package.json +4 -4
- package/dist/components/inputs/reactHookForm/utils/RefreshButton.d.ts +0 -2
- package/dist/components/inputs/reactHookForm/utils/RefreshButton.js +0 -9
|
@@ -14,6 +14,10 @@ import { FilterType } from "./constants/FilterConstants.js";
|
|
|
14
14
|
import { MAX_CHAR_DESCRIPTION } from "../../utils/constants/uiConstants.js";
|
|
15
15
|
import { EXPERT_FILTER_QUERY } from "./expert/expertFilterConstants.js";
|
|
16
16
|
import { FILTER_EQUIPMENTS_ATTRIBUTES } from "./explicitNaming/ExplicitNamingFilterConstants.js";
|
|
17
|
+
import { CustomError } from "../../services/businessErrorCode.js";
|
|
18
|
+
import "../../utils/conversionUtils.js";
|
|
19
|
+
import "@mui/icons-material";
|
|
20
|
+
import "../../utils/types/equipmentType.js";
|
|
17
21
|
import * as yup from "yup";
|
|
18
22
|
const emptyFormData = {
|
|
19
23
|
[FieldConstants.NAME]: "",
|
|
@@ -77,9 +81,15 @@ function FilterCreationDialog({
|
|
|
77
81
|
activeDirectory,
|
|
78
82
|
onClose,
|
|
79
83
|
(error) => {
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
84
|
+
if (error instanceof CustomError && error.businessErrorCode != null) {
|
|
85
|
+
snackError({
|
|
86
|
+
messageId: error.businessErrorCode
|
|
87
|
+
});
|
|
88
|
+
} else {
|
|
89
|
+
snackError({
|
|
90
|
+
messageTxt: error.message
|
|
91
|
+
});
|
|
92
|
+
}
|
|
83
93
|
}
|
|
84
94
|
);
|
|
85
95
|
}
|
|
@@ -17,6 +17,7 @@ import { catchErrorHandler } from "../../../services/utils.js";
|
|
|
17
17
|
import "../../../utils/conversionUtils.js";
|
|
18
18
|
import "@mui/icons-material";
|
|
19
19
|
import "../../../utils/types/equipmentType.js";
|
|
20
|
+
import { CustomError } from "../../../services/businessErrorCode.js";
|
|
20
21
|
import { EXPERT_FILTER_QUERY } from "./expertFilterConstants.js";
|
|
21
22
|
import * as yup from "yup";
|
|
22
23
|
const formSchema = yup.object().shape({
|
|
@@ -83,10 +84,17 @@ function ExpertFilterEditionDialog({
|
|
|
83
84
|
null,
|
|
84
85
|
onClose,
|
|
85
86
|
(error) => {
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
87
|
+
if (error instanceof CustomError && error.businessErrorCode != null) {
|
|
88
|
+
snackError({
|
|
89
|
+
messageId: error.businessErrorCode,
|
|
90
|
+
headerId: "cannotSaveFilter"
|
|
91
|
+
});
|
|
92
|
+
} else {
|
|
93
|
+
snackError({
|
|
94
|
+
messageTxt: error.message,
|
|
95
|
+
headerId: "cannotSaveFilter"
|
|
96
|
+
});
|
|
97
|
+
}
|
|
90
98
|
}
|
|
91
99
|
);
|
|
92
100
|
if (itemSelectionForCopy.sourceItemUuid === id) {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Field } from 'react-querybuilder';
|
|
2
2
|
import { CombinatorType, DataType, OperatorType } from './expertFilter.type';
|
|
3
3
|
import { FieldType } from '../../../utils/types/fieldType';
|
|
4
|
+
import { EquipmentType } from '../../../utils';
|
|
4
5
|
export declare enum RULES {
|
|
5
6
|
EMPTY_RULE = "emptyRule",
|
|
6
7
|
EMPTY_GROUP = "emptyGroup",
|
|
@@ -10,51 +11,51 @@ export declare enum RULES {
|
|
|
10
11
|
export declare const EXPERT_FILTER_QUERY = "rules";
|
|
11
12
|
export declare const EXPERT_FILTER_EQUIPMENTS: {
|
|
12
13
|
SUBSTATION: {
|
|
13
|
-
id:
|
|
14
|
+
id: EquipmentType;
|
|
14
15
|
label: string;
|
|
15
16
|
};
|
|
16
17
|
VOLTAGE_LEVEL: {
|
|
17
|
-
id:
|
|
18
|
+
id: EquipmentType;
|
|
18
19
|
label: string;
|
|
19
20
|
};
|
|
20
21
|
LINE: {
|
|
21
|
-
id:
|
|
22
|
+
id: EquipmentType;
|
|
22
23
|
label: string;
|
|
23
24
|
};
|
|
24
25
|
TWO_WINDINGS_TRANSFORMER: {
|
|
25
|
-
id:
|
|
26
|
+
id: EquipmentType;
|
|
26
27
|
label: string;
|
|
27
28
|
};
|
|
28
29
|
THREE_WINDINGS_TRANSFORMER: {
|
|
29
|
-
id:
|
|
30
|
+
id: EquipmentType;
|
|
30
31
|
label: string;
|
|
31
32
|
};
|
|
32
33
|
GENERATOR: {
|
|
33
|
-
id:
|
|
34
|
+
id: EquipmentType;
|
|
34
35
|
label: string;
|
|
35
36
|
};
|
|
36
37
|
BATTERY: {
|
|
37
|
-
id:
|
|
38
|
+
id: EquipmentType;
|
|
38
39
|
label: string;
|
|
39
40
|
};
|
|
40
41
|
LOAD: {
|
|
41
|
-
id:
|
|
42
|
+
id: EquipmentType;
|
|
42
43
|
label: string;
|
|
43
44
|
};
|
|
44
45
|
SHUNT_COMPENSATOR: {
|
|
45
|
-
id:
|
|
46
|
+
id: EquipmentType;
|
|
46
47
|
label: string;
|
|
47
48
|
};
|
|
48
49
|
STATIC_VAR_COMPENSATOR: {
|
|
49
|
-
id:
|
|
50
|
+
id: EquipmentType;
|
|
50
51
|
label: string;
|
|
51
52
|
};
|
|
52
53
|
HVDC_LINE: {
|
|
53
|
-
id:
|
|
54
|
+
id: EquipmentType;
|
|
54
55
|
label: string;
|
|
55
56
|
};
|
|
56
57
|
DANGLING_LINE: {
|
|
57
|
-
id:
|
|
58
|
+
id: EquipmentType;
|
|
58
59
|
label: string;
|
|
59
60
|
};
|
|
60
61
|
};
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import { OperatorType, CombinatorType, DataType } from "./expertFilter.type.js";
|
|
2
2
|
import { FieldType } from "../../../utils/types/fieldType.js";
|
|
3
3
|
import { KILO_AMPERE, KILO_VOLT, MICRO_SIEMENS, SIEMENS, MEGA_VAR, MEGA_WATT, OHM, MEGA_VOLT_AMPERE } from "../../../utils/constants/unitsConstants.js";
|
|
4
|
+
import "../../../utils/conversionUtils.js";
|
|
5
|
+
import "react/jsx-runtime";
|
|
6
|
+
import "@mui/icons-material";
|
|
7
|
+
import { EquipmentType, ALL_EQUIPMENTS } from "../../../utils/types/equipmentType.js";
|
|
8
|
+
import "../../../utils/yupConfig.js";
|
|
4
9
|
var RULES = /* @__PURE__ */ ((RULES2) => {
|
|
5
10
|
RULES2["EMPTY_RULE"] = "emptyRule";
|
|
6
11
|
RULES2["EMPTY_GROUP"] = "emptyGroup";
|
|
@@ -10,54 +15,18 @@ var RULES = /* @__PURE__ */ ((RULES2) => {
|
|
|
10
15
|
})(RULES || {});
|
|
11
16
|
const EXPERT_FILTER_QUERY = "rules";
|
|
12
17
|
const EXPERT_FILTER_EQUIPMENTS = {
|
|
13
|
-
SUBSTATION:
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
TWO_WINDINGS_TRANSFORMER: {
|
|
26
|
-
id: "TWO_WINDINGS_TRANSFORMER",
|
|
27
|
-
label: "TwoWindingsTransformers"
|
|
28
|
-
},
|
|
29
|
-
THREE_WINDINGS_TRANSFORMER: {
|
|
30
|
-
id: "THREE_WINDINGS_TRANSFORMER",
|
|
31
|
-
label: "ThreeWindingsTransformers"
|
|
32
|
-
},
|
|
33
|
-
GENERATOR: {
|
|
34
|
-
id: "GENERATOR",
|
|
35
|
-
label: "Generators"
|
|
36
|
-
},
|
|
37
|
-
BATTERY: {
|
|
38
|
-
id: "BATTERY",
|
|
39
|
-
label: "Batteries"
|
|
40
|
-
},
|
|
41
|
-
LOAD: {
|
|
42
|
-
id: "LOAD",
|
|
43
|
-
label: "Loads"
|
|
44
|
-
},
|
|
45
|
-
SHUNT_COMPENSATOR: {
|
|
46
|
-
id: "SHUNT_COMPENSATOR",
|
|
47
|
-
label: "ShuntCompensators"
|
|
48
|
-
},
|
|
49
|
-
STATIC_VAR_COMPENSATOR: {
|
|
50
|
-
id: "STATIC_VAR_COMPENSATOR",
|
|
51
|
-
label: "StaticVarCompensators"
|
|
52
|
-
},
|
|
53
|
-
HVDC_LINE: {
|
|
54
|
-
id: "HVDC_LINE",
|
|
55
|
-
label: "Hvdc"
|
|
56
|
-
},
|
|
57
|
-
DANGLING_LINE: {
|
|
58
|
-
id: "DANGLING_LINE",
|
|
59
|
-
label: "DanglingLines"
|
|
60
|
-
}
|
|
18
|
+
[EquipmentType.SUBSTATION]: ALL_EQUIPMENTS[EquipmentType.SUBSTATION],
|
|
19
|
+
[EquipmentType.VOLTAGE_LEVEL]: ALL_EQUIPMENTS[EquipmentType.VOLTAGE_LEVEL],
|
|
20
|
+
[EquipmentType.LINE]: ALL_EQUIPMENTS[EquipmentType.LINE],
|
|
21
|
+
[EquipmentType.TWO_WINDINGS_TRANSFORMER]: ALL_EQUIPMENTS[EquipmentType.TWO_WINDINGS_TRANSFORMER],
|
|
22
|
+
[EquipmentType.THREE_WINDINGS_TRANSFORMER]: ALL_EQUIPMENTS[EquipmentType.THREE_WINDINGS_TRANSFORMER],
|
|
23
|
+
[EquipmentType.GENERATOR]: ALL_EQUIPMENTS[EquipmentType.GENERATOR],
|
|
24
|
+
[EquipmentType.BATTERY]: ALL_EQUIPMENTS[EquipmentType.BATTERY],
|
|
25
|
+
[EquipmentType.LOAD]: ALL_EQUIPMENTS[EquipmentType.LOAD],
|
|
26
|
+
[EquipmentType.SHUNT_COMPENSATOR]: ALL_EQUIPMENTS[EquipmentType.SHUNT_COMPENSATOR],
|
|
27
|
+
[EquipmentType.STATIC_VAR_COMPENSATOR]: ALL_EQUIPMENTS[EquipmentType.STATIC_VAR_COMPENSATOR],
|
|
28
|
+
[EquipmentType.HVDC_LINE]: ALL_EQUIPMENTS[EquipmentType.HVDC_LINE],
|
|
29
|
+
[EquipmentType.DANGLING_LINE]: ALL_EQUIPMENTS[EquipmentType.DANGLING_LINE]
|
|
61
30
|
};
|
|
62
31
|
const ENERGY_SOURCE_OPTIONS = [
|
|
63
32
|
{ name: "HYDRO", label: "Hydro" },
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import { defaultOperators, getParentPath, findPath, remove } from "react-querybuilder";
|
|
2
2
|
import { validate } from "uuid";
|
|
3
3
|
import { DataType } from "./expertFilter.type.js";
|
|
4
|
-
import { OPERATOR_OPTIONS, RULES, FIELDS_OPTIONS
|
|
4
|
+
import { OPERATOR_OPTIONS, RULES, FIELDS_OPTIONS } from "./expertFilterConstants.js";
|
|
5
5
|
import { isBlankOrEmpty, convertOutputValue, convertInputValue } from "../../../utils/conversionUtils.js";
|
|
6
6
|
import { FieldType } from "../../../utils/types/fieldType.js";
|
|
7
|
+
import "react/jsx-runtime";
|
|
8
|
+
import "@mui/icons-material";
|
|
9
|
+
import { ALL_EQUIPMENTS } from "../../../utils/types/equipmentType.js";
|
|
10
|
+
import "../../../utils/yupConfig.js";
|
|
7
11
|
const searchTree = (tree, key, value) => {
|
|
8
12
|
const stack = Object.values(tree);
|
|
9
13
|
while (stack.length) {
|
|
@@ -367,7 +371,7 @@ function getFilterEquipmentTypeLabel(equipmentType) {
|
|
|
367
371
|
if (!equipmentType) {
|
|
368
372
|
return "";
|
|
369
373
|
}
|
|
370
|
-
return ((_a =
|
|
374
|
+
return ((_a = ALL_EQUIPMENTS[equipmentType]) == null ? void 0 : _a.label) ?? "";
|
|
371
375
|
}
|
|
372
376
|
export {
|
|
373
377
|
countRules,
|
|
@@ -73,9 +73,13 @@ const saveExpertFilter = (id, query, equipmentType, name, description, isFilterC
|
|
|
73
73
|
).then(() => {
|
|
74
74
|
onClose();
|
|
75
75
|
}).catch((error) => {
|
|
76
|
-
|
|
77
|
-
onError(
|
|
78
|
-
}
|
|
76
|
+
if (error instanceof Error) {
|
|
77
|
+
onError(error);
|
|
78
|
+
} else {
|
|
79
|
+
catchErrorHandler(error, (message) => {
|
|
80
|
+
onError(new Error(message));
|
|
81
|
+
});
|
|
82
|
+
}
|
|
79
83
|
});
|
|
80
84
|
} else {
|
|
81
85
|
saveFilter(
|
|
@@ -91,9 +95,13 @@ const saveExpertFilter = (id, query, equipmentType, name, description, isFilterC
|
|
|
91
95
|
).then(() => {
|
|
92
96
|
onClose();
|
|
93
97
|
}).catch((error) => {
|
|
94
|
-
|
|
95
|
-
onError(
|
|
96
|
-
}
|
|
98
|
+
if (error instanceof Error) {
|
|
99
|
+
onError(error);
|
|
100
|
+
} else {
|
|
101
|
+
catchErrorHandler(error, (message) => {
|
|
102
|
+
onError(new Error(message));
|
|
103
|
+
});
|
|
104
|
+
}
|
|
97
105
|
});
|
|
98
106
|
}
|
|
99
107
|
};
|
package/dist/components/index.js
CHANGED
|
@@ -92,7 +92,6 @@ import { UniqueNameInput } from "./inputs/reactHookForm/text/UniqueNameInput.js"
|
|
|
92
92
|
import { CancelButton } from "./inputs/reactHookForm/utils/CancelButton.js";
|
|
93
93
|
import { FieldLabel } from "./inputs/reactHookForm/utils/FieldLabel.js";
|
|
94
94
|
import { SubmitButton } from "./inputs/reactHookForm/utils/SubmitButton.js";
|
|
95
|
-
import { RefreshButton } from "./inputs/reactHookForm/utils/RefreshButton.js";
|
|
96
95
|
import { TextFieldWithAdornment } from "./inputs/reactHookForm/utils/TextFieldWithAdornment.js";
|
|
97
96
|
import { genHelperError, gridItem, identity, isFieldRequired, toFloatOrNullValue } from "./inputs/reactHookForm/utils/functions.js";
|
|
98
97
|
import { HelperPreviousValue } from "./inputs/reactHookForm/utils/HelperPreviousValue.js";
|
|
@@ -397,7 +396,6 @@ export {
|
|
|
397
396
|
RangeType,
|
|
398
397
|
RawReadOnlyInput,
|
|
399
398
|
ReactivePowerAdornment,
|
|
400
|
-
RefreshButton,
|
|
401
399
|
RemoveButton,
|
|
402
400
|
RuleValueEditor,
|
|
403
401
|
SELECTED,
|
|
@@ -35,7 +35,6 @@ import { UniqueNameInput } from "./reactHookForm/text/UniqueNameInput.js";
|
|
|
35
35
|
import { CancelButton } from "./reactHookForm/utils/CancelButton.js";
|
|
36
36
|
import { FieldLabel } from "./reactHookForm/utils/FieldLabel.js";
|
|
37
37
|
import { SubmitButton } from "./reactHookForm/utils/SubmitButton.js";
|
|
38
|
-
import { RefreshButton } from "./reactHookForm/utils/RefreshButton.js";
|
|
39
38
|
import { TextFieldWithAdornment } from "./reactHookForm/utils/TextFieldWithAdornment.js";
|
|
40
39
|
import { genHelperError, gridItem, identity, isFieldRequired, toFloatOrNullValue } from "./reactHookForm/utils/functions.js";
|
|
41
40
|
import { HelperPreviousValue } from "./reactHookForm/utils/HelperPreviousValue.js";
|
|
@@ -99,7 +98,6 @@ export {
|
|
|
99
98
|
RangeInput,
|
|
100
99
|
RangeType,
|
|
101
100
|
RawReadOnlyInput,
|
|
102
|
-
RefreshButton,
|
|
103
101
|
RemoveButton,
|
|
104
102
|
RuleValueEditor,
|
|
105
103
|
SelectClearable,
|
|
@@ -34,7 +34,6 @@ import { UniqueNameInput } from "./text/UniqueNameInput.js";
|
|
|
34
34
|
import { CancelButton } from "./utils/CancelButton.js";
|
|
35
35
|
import { FieldLabel } from "./utils/FieldLabel.js";
|
|
36
36
|
import { SubmitButton } from "./utils/SubmitButton.js";
|
|
37
|
-
import { RefreshButton } from "./utils/RefreshButton.js";
|
|
38
37
|
import { TextFieldWithAdornment } from "./utils/TextFieldWithAdornment.js";
|
|
39
38
|
import { genHelperError, gridItem, identity, isFieldRequired, toFloatOrNullValue } from "./utils/functions.js";
|
|
40
39
|
import { HelperPreviousValue } from "./utils/HelperPreviousValue.js";
|
|
@@ -72,7 +71,6 @@ export {
|
|
|
72
71
|
RangeInput,
|
|
73
72
|
RangeType,
|
|
74
73
|
RawReadOnlyInput,
|
|
75
|
-
RefreshButton,
|
|
76
74
|
SelectInput,
|
|
77
75
|
SliderInput,
|
|
78
76
|
SubmitButton,
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { CancelButton } from "./CancelButton.js";
|
|
2
2
|
import { FieldLabel } from "./FieldLabel.js";
|
|
3
3
|
import { SubmitButton } from "./SubmitButton.js";
|
|
4
|
-
import { RefreshButton } from "./RefreshButton.js";
|
|
5
4
|
import { TextFieldWithAdornment } from "./TextFieldWithAdornment.js";
|
|
6
5
|
import { genHelperError, gridItem, identity, isFieldRequired, toFloatOrNullValue } from "./functions.js";
|
|
7
6
|
import { HelperPreviousValue } from "./HelperPreviousValue.js";
|
|
@@ -9,7 +8,6 @@ export {
|
|
|
9
8
|
CancelButton,
|
|
10
9
|
FieldLabel,
|
|
11
10
|
HelperPreviousValue,
|
|
12
|
-
RefreshButton,
|
|
13
11
|
SubmitButton,
|
|
14
12
|
TextFieldWithAdornment,
|
|
15
13
|
genHelperError,
|
package/dist/index.js
CHANGED
|
@@ -93,7 +93,6 @@ import { UniqueNameInput } from "./components/inputs/reactHookForm/text/UniqueNa
|
|
|
93
93
|
import { CancelButton } from "./components/inputs/reactHookForm/utils/CancelButton.js";
|
|
94
94
|
import { FieldLabel } from "./components/inputs/reactHookForm/utils/FieldLabel.js";
|
|
95
95
|
import { SubmitButton } from "./components/inputs/reactHookForm/utils/SubmitButton.js";
|
|
96
|
-
import { RefreshButton } from "./components/inputs/reactHookForm/utils/RefreshButton.js";
|
|
97
96
|
import { TextFieldWithAdornment } from "./components/inputs/reactHookForm/utils/TextFieldWithAdornment.js";
|
|
98
97
|
import { genHelperError, gridItem, identity, isFieldRequired, toFloatOrNullValue } from "./components/inputs/reactHookForm/utils/functions.js";
|
|
99
98
|
import { HelperPreviousValue } from "./components/inputs/reactHookForm/utils/HelperPreviousValue.js";
|
|
@@ -199,6 +198,7 @@ import { getNetworkVisualizationsParameters } from "./services/study-config.js";
|
|
|
199
198
|
import { fetchCurrentAnnouncement, fetchUserDetails } from "./services/userAdmin.js";
|
|
200
199
|
import { getVoltageInitParameters, getVoltageInitUrl } from "./services/voltage-init.js";
|
|
201
200
|
import { fetchDefaultSecurityAnalysisProvider, fetchSecurityAnalysisParameters, fetchSecurityAnalysisProviders, getSecurityAnalysisDefaultLimitReductions, getSecurityAnalysisParameters, getStudyUrl, safeEncodeURIComponent, setSecurityAnalysisParameters, updateSecurityAnalysisParameters, updateSecurityAnalysisProvider } from "./services/security-analysis.js";
|
|
201
|
+
import { CustomError } from "./services/businessErrorCode.js";
|
|
202
202
|
import { equalsArray } from "./utils/algos.js";
|
|
203
203
|
import { FetchStatus } from "./utils/constants/fetchStatus.js";
|
|
204
204
|
import { FieldConstants } from "./utils/constants/fieldConstants.js";
|
|
@@ -213,7 +213,7 @@ import { equipmentTypesForPredefinedPropertiesMapper } from "./utils/mapper/equi
|
|
|
213
213
|
import { NotificationsUrlKeys, PREFIX_CONFIG_NOTIFICATION_WS, PREFIX_DIRECTORY_NOTIFICATION_WS, PREFIX_STUDY_NOTIFICATION_WS } from "./utils/constants/notificationsProvider.js";
|
|
214
214
|
import { DARK_THEME, LIGHT_THEME, makeComposeClasses, mergeSx, toNestedGlobalSelectors } from "./utils/styles.js";
|
|
215
215
|
import { ElementType } from "./utils/types/elementType.js";
|
|
216
|
-
import { BASE_EQUIPMENTS, EQUIPMENT_TYPE, EquipmentType, ExtendedEquipmentType, HvdcType, OperatingStatus, SEARCH_EQUIPMENTS, TYPE_TAG_MAX_SIZE, VL_TAG_MAX_SIZE, equipmentStyles, getEquipmentsInfosForSearchBar } from "./utils/types/equipmentType.js";
|
|
216
|
+
import { ALL_EQUIPMENTS, BASE_EQUIPMENTS, EQUIPMENT_TYPE, EquipmentType, ExtendedEquipmentType, HvdcType, OperatingStatus, SEARCH_EQUIPMENTS, TYPE_TAG_MAX_SIZE, VL_TAG_MAX_SIZE, equipmentStyles, getEquipmentsInfosForSearchBar } from "./utils/types/equipmentType.js";
|
|
217
217
|
import { Battery, BusBar, DanglingLine, Generator, Hvdc, LCC, Line, Load, SVC, ShuntCompensator, Substation, ThreeWindingTransfo, TwoWindingTransfo, VSC, VoltageLevel } from "./utils/types/equipmentTypes.js";
|
|
218
218
|
import { AnnouncementSeverity, ArrayAction } from "./utils/types/types.js";
|
|
219
219
|
import { MODIFICATION_TYPES, ModificationType } from "./utils/types/modificationType.js";
|
|
@@ -224,6 +224,7 @@ import { DistributionType, SensitivityType } from "./utils/types/sensitivity-ana
|
|
|
224
224
|
import { toNumber, validateValueIsANumber } from "./utils/validation-functions.js";
|
|
225
225
|
import "./utils/yupConfig.js";
|
|
226
226
|
import { cardErrorBoundaryEn } from "./translations/en/cardErrorBoundaryEn.js";
|
|
227
|
+
import { businessErrorsEn } from "./translations/en/businessErrorsEn.js";
|
|
227
228
|
import { commonButtonEn } from "./translations/en/commonButtonEn.js";
|
|
228
229
|
import { csvEn } from "./translations/en/csvEn.js";
|
|
229
230
|
import { descriptionEn } from "./translations/en/descriptionEn.js";
|
|
@@ -250,6 +251,7 @@ import { componentsEn } from "./translations/en/componentsEn.js";
|
|
|
250
251
|
import { parametersEn } from "./translations/en/parameters.js";
|
|
251
252
|
import { useUniqueNameValidationEn } from "./translations/en/use-unique-name-validation-en.js";
|
|
252
253
|
import { cardErrorBoundaryFr } from "./translations/fr/cardErrorBoundaryFr.js";
|
|
254
|
+
import { businessErrorsFr } from "./translations/fr/businessErrorsFr.js";
|
|
253
255
|
import { commonButtonFr } from "./translations/fr/commonButtonFr.js";
|
|
254
256
|
import { csvFr } from "./translations/fr/csvFr.js";
|
|
255
257
|
import { descriptionFr } from "./translations/fr/descriptionFr.js";
|
|
@@ -277,6 +279,7 @@ import { parametersFr } from "./translations/fr/parameters.js";
|
|
|
277
279
|
import { useUniqueNameValidationFr } from "./translations/fr/use-unique-name-validation-fr.js";
|
|
278
280
|
import * as yup from "yup";
|
|
279
281
|
export {
|
|
282
|
+
ALL_EQUIPMENTS,
|
|
280
283
|
AMPERE,
|
|
281
284
|
AboutDialog,
|
|
282
285
|
ActivableChip,
|
|
@@ -329,6 +332,7 @@ export {
|
|
|
329
332
|
CsvUploader,
|
|
330
333
|
CustomAGGrid,
|
|
331
334
|
CustomAgGridTable,
|
|
335
|
+
CustomError,
|
|
332
336
|
CustomFormContext,
|
|
333
337
|
CustomFormProvider,
|
|
334
338
|
CustomMenuItem,
|
|
@@ -558,7 +562,6 @@ export {
|
|
|
558
562
|
RangeType,
|
|
559
563
|
RawReadOnlyInput,
|
|
560
564
|
ReactivePowerAdornment,
|
|
561
|
-
RefreshButton,
|
|
562
565
|
RemoveButton,
|
|
563
566
|
RuleValueEditor,
|
|
564
567
|
SEARCH_EQUIPMENTS,
|
|
@@ -663,6 +666,8 @@ export {
|
|
|
663
666
|
backendFetchFile,
|
|
664
667
|
backendFetchJson,
|
|
665
668
|
backendFetchText,
|
|
669
|
+
businessErrorsEn,
|
|
670
|
+
businessErrorsFr,
|
|
666
671
|
cardErrorBoundaryEn,
|
|
667
672
|
cardErrorBoundaryFr,
|
|
668
673
|
catchErrorHandler,
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025, RTE (http://www.rte-france.com)
|
|
3
|
+
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
4
|
+
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
5
|
+
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
6
|
+
*/
|
|
7
|
+
export declare class CustomError extends Error {
|
|
8
|
+
status: number;
|
|
9
|
+
businessErrorCode?: string;
|
|
10
|
+
constructor(message: string, status: number, businessErrorCode?: string);
|
|
11
|
+
}
|
package/dist/services/index.d.ts
CHANGED
package/dist/services/index.js
CHANGED
|
@@ -8,7 +8,9 @@ import { getNetworkVisualizationsParameters } from "./study-config.js";
|
|
|
8
8
|
import { fetchCurrentAnnouncement, fetchUserDetails } from "./userAdmin.js";
|
|
9
9
|
import { getVoltageInitParameters, getVoltageInitUrl } from "./voltage-init.js";
|
|
10
10
|
import { fetchDefaultSecurityAnalysisProvider, fetchSecurityAnalysisParameters, fetchSecurityAnalysisProviders, getSecurityAnalysisDefaultLimitReductions, getSecurityAnalysisParameters, getStudyUrl, safeEncodeURIComponent, setSecurityAnalysisParameters, updateSecurityAnalysisParameters, updateSecurityAnalysisProvider } from "./security-analysis.js";
|
|
11
|
+
import { CustomError } from "./businessErrorCode.js";
|
|
11
12
|
export {
|
|
13
|
+
CustomError,
|
|
12
14
|
NetworkTimeoutError,
|
|
13
15
|
PREFIX_STUDY_QUERIES,
|
|
14
16
|
backendFetch,
|
package/dist/services/utils.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { getUserToken } from "../redux/commonStore.js";
|
|
2
|
+
import { CustomError } from "./businessErrorCode.js";
|
|
2
3
|
const DEFAULT_TIMEOUT_MS = 5e4;
|
|
3
4
|
class NetworkTimeoutError extends Error {
|
|
4
5
|
constructor(messageKey = "errors.network.timeout") {
|
|
@@ -36,14 +37,19 @@ const handleError = (response) => {
|
|
|
36
37
|
const errorName = "HttpResponseError : ";
|
|
37
38
|
const errorJson = parseError(text);
|
|
38
39
|
let customError;
|
|
40
|
+
if ((errorJson == null ? void 0 : errorJson.businessErrorCode) != null) {
|
|
41
|
+
throw new CustomError(errorJson.message, errorJson.status, errorJson.businessErrorCode);
|
|
42
|
+
}
|
|
39
43
|
if (errorJson && errorJson.status && errorJson.error && errorJson.message) {
|
|
40
|
-
customError = new
|
|
41
|
-
`${errorName + errorJson.status} ${errorJson.error}, message : ${errorJson.message}
|
|
44
|
+
customError = new CustomError(
|
|
45
|
+
`${errorName + errorJson.status} ${errorJson.error}, message : ${errorJson.message}`,
|
|
46
|
+
errorJson.status
|
|
42
47
|
);
|
|
43
|
-
customError.status = errorJson.status;
|
|
44
48
|
} else {
|
|
45
|
-
customError = new
|
|
46
|
-
|
|
49
|
+
customError = new CustomError(
|
|
50
|
+
`${errorName + response.status} ${response.statusText}, message : ${text}`,
|
|
51
|
+
response.status
|
|
52
|
+
);
|
|
47
53
|
}
|
|
48
54
|
throw customError;
|
|
49
55
|
});
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025, RTE (http://www.rte-france.com)
|
|
3
|
+
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
4
|
+
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
5
|
+
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
6
|
+
*/
|
|
7
|
+
export declare const businessErrorsEn: {
|
|
8
|
+
'directory.permissionDenied': string;
|
|
9
|
+
'directory.elementNameBlank': string;
|
|
10
|
+
'directory.notDirectory': string;
|
|
11
|
+
'directory.elementNameConflict': string;
|
|
12
|
+
'directory.moveInDescendantNotAllowed': string;
|
|
13
|
+
'directory.someElementsAreMissing': string;
|
|
14
|
+
'directory.elementNotFound': string;
|
|
15
|
+
'explore.permissionDenied': string;
|
|
16
|
+
'explore.maxElementsExceeded': string;
|
|
17
|
+
'explore.incorrectCaseFile': string;
|
|
18
|
+
'useradmin.permissionDenied': string;
|
|
19
|
+
'useradmin.userNotFound': string;
|
|
20
|
+
'useradmin.userAlreadyExists': string;
|
|
21
|
+
'useradmin.profileNotFound': string;
|
|
22
|
+
'useradmin.profileAlreadyExists': string;
|
|
23
|
+
'useradmin.groupNotFound': string;
|
|
24
|
+
'useradmin.groupAlreadyExists': string;
|
|
25
|
+
'useradmin.announcementInvalidPeriod': string;
|
|
26
|
+
'useradmin.announcementOverlap': string;
|
|
27
|
+
'filter.filterCycleDetected': string;
|
|
28
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
const businessErrorsEn = {
|
|
2
|
+
"directory.permissionDenied": "You are not allowed to perform this action.",
|
|
3
|
+
"directory.elementNameBlank": "Element name must not be blank.",
|
|
4
|
+
"directory.notDirectory": "The selected element is not a directory.",
|
|
5
|
+
"directory.elementNameConflict": "An element with the same name already exists in the directory.",
|
|
6
|
+
"directory.moveInDescendantNotAllowed": "Cannot move an element inside one of its descendants.",
|
|
7
|
+
"directory.someElementsAreMissing": "Some of the requested directory elements are missing.",
|
|
8
|
+
"directory.elementNotFound": "The requested directory element could not be found.",
|
|
9
|
+
"explore.permissionDenied": "You are not allowed to perform this action.",
|
|
10
|
+
"explore.maxElementsExceeded": "The number of allowed elements has been exceeded.",
|
|
11
|
+
"explore.incorrectCaseFile": "The provided case file is incorrect.",
|
|
12
|
+
"useradmin.permissionDenied": "You don't have permission to perform this action.",
|
|
13
|
+
"useradmin.userNotFound": "User not found.",
|
|
14
|
+
"useradmin.userAlreadyExists": "User already exists.",
|
|
15
|
+
"useradmin.profileNotFound": "User profile not found.",
|
|
16
|
+
"useradmin.profileAlreadyExists": "User profile already exists.",
|
|
17
|
+
"useradmin.groupNotFound": "User's group not found.",
|
|
18
|
+
"useradmin.groupAlreadyExists": "User group already exists.",
|
|
19
|
+
"useradmin.announcementInvalidPeriod": "The announcement has an invalid time period.",
|
|
20
|
+
"useradmin.announcementOverlap": "The announcement period overlaps with an existing one.",
|
|
21
|
+
"filter.filterCycleDetected": "Filter cycle detected."
|
|
22
|
+
};
|
|
23
|
+
export {
|
|
24
|
+
businessErrorsEn
|
|
25
|
+
};
|
|
@@ -16,7 +16,8 @@ const equipmentsEn = {
|
|
|
16
16
|
Other: "Other",
|
|
17
17
|
LccConverterStations: "LCC converter stations",
|
|
18
18
|
VscConverterStations: "VSC converter stations",
|
|
19
|
-
StaticVarCompensators: "Static var compensators"
|
|
19
|
+
StaticVarCompensators: "Static var compensators",
|
|
20
|
+
BusBarSections: "Busbar sections"
|
|
20
21
|
};
|
|
21
22
|
export {
|
|
22
23
|
equipmentsEn
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { cardErrorBoundaryEn } from "./cardErrorBoundaryEn.js";
|
|
2
|
+
import { businessErrorsEn } from "./businessErrorsEn.js";
|
|
2
3
|
import { commonButtonEn } from "./commonButtonEn.js";
|
|
3
4
|
import { csvEn } from "./csvEn.js";
|
|
4
5
|
import { descriptionEn } from "./descriptionEn.js";
|
|
@@ -25,6 +26,7 @@ import { componentsEn } from "./componentsEn.js";
|
|
|
25
26
|
import { parametersEn } from "./parameters.js";
|
|
26
27
|
import { useUniqueNameValidationEn } from "./use-unique-name-validation-en.js";
|
|
27
28
|
export {
|
|
29
|
+
businessErrorsEn,
|
|
28
30
|
cardErrorBoundaryEn,
|
|
29
31
|
commonButtonEn,
|
|
30
32
|
componentsEn,
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025, RTE (http://www.rte-france.com)
|
|
3
|
+
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
4
|
+
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
5
|
+
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
6
|
+
*/
|
|
7
|
+
export declare const businessErrorsFr: {
|
|
8
|
+
'directory.permissionDenied': string;
|
|
9
|
+
'directory.elementNameBlank': string;
|
|
10
|
+
'directory.notDirectory': string;
|
|
11
|
+
'directory.elementNameConflict': string;
|
|
12
|
+
'directory.moveInDescendantNotAllowed': string;
|
|
13
|
+
'directory.someElementsAreMissing': string;
|
|
14
|
+
'directory.elementNotFound': string;
|
|
15
|
+
'explore.permissionDenied': string;
|
|
16
|
+
'explore.maxElementsExceeded': string;
|
|
17
|
+
'explore.incorrectCaseFile': string;
|
|
18
|
+
'useradmin.permissionDenied': string;
|
|
19
|
+
'useradmin.userNotFound': string;
|
|
20
|
+
'useradmin.userAlreadyExists': string;
|
|
21
|
+
'useradmin.profileNotFound': string;
|
|
22
|
+
'useradmin.profileAlreadyExists': string;
|
|
23
|
+
'useradmin.groupNotFound': string;
|
|
24
|
+
'useradmin.groupAlreadyExists': string;
|
|
25
|
+
'useradmin.announcementInvalidPeriod': string;
|
|
26
|
+
'useradmin.announcementOverlap': string;
|
|
27
|
+
'filter.filterCycleDetected': string;
|
|
28
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
const businessErrorsFr = {
|
|
2
|
+
"directory.permissionDenied": "Vous n'êtes pas autorisé à effectuer cette action.",
|
|
3
|
+
"directory.elementNameBlank": "Le nom de l'élément ne peut pas être vide.",
|
|
4
|
+
"directory.notDirectory": "L'élément sélectionné n'est pas un dossier.",
|
|
5
|
+
"directory.elementNameConflict": "Un élément portant le même nom existe déjà dans le dossier.",
|
|
6
|
+
"directory.moveInDescendantNotAllowed": "Impossible de déplacer un élément dans l’un de ses descendants.",
|
|
7
|
+
"directory.someElementsAreMissing": "Certains des éléments demandés sont manquants.",
|
|
8
|
+
"directory.elementNotFound": "L'élément du dossier demandé est introuvable.",
|
|
9
|
+
"explore.permissionDenied": "Vous n'êtes pas autorisé à effectuer cette action.",
|
|
10
|
+
"explore.maxElementsExceeded": "Le nombre d'éléments autorisés a été dépassé.",
|
|
11
|
+
"explore.incorrectCaseFile": "Le fichier réseau fourni est incorrect.",
|
|
12
|
+
"useradmin.permissionDenied": "Vous n'avez pas la permission d'effectuer cette action.",
|
|
13
|
+
"useradmin.userNotFound": "Utilisateur introuvable.",
|
|
14
|
+
"useradmin.userAlreadyExists": "L'utilisateur existe déjà.",
|
|
15
|
+
"useradmin.profileNotFound": "Profil utilisateur introuvable.",
|
|
16
|
+
"useradmin.profileAlreadyExists": "Le profil utilisateur existe déjà.",
|
|
17
|
+
"useradmin.groupNotFound": "Le groupe de l'utilisateur est introuvable.",
|
|
18
|
+
"useradmin.groupAlreadyExists": "Le groupe d'utilisateurs existe déjà.",
|
|
19
|
+
"useradmin.announcementInvalidPeriod": "La période de l'annonce est invalide.",
|
|
20
|
+
"useradmin.announcementOverlap": "La période de l'annonce chevauche une autre annonce existante.",
|
|
21
|
+
"filter.filterCycleDetected": "Cycle de filtre détecté."
|
|
22
|
+
};
|
|
23
|
+
export {
|
|
24
|
+
businessErrorsFr
|
|
25
|
+
};
|
|
@@ -16,7 +16,8 @@ const equipmentsFr = {
|
|
|
16
16
|
Other: "Autre",
|
|
17
17
|
LccConverterStations: "Stations de conversion LCC",
|
|
18
18
|
VscConverterStations: "Stations de conversion VSC",
|
|
19
|
-
StaticVarCompensators: "CSPR"
|
|
19
|
+
StaticVarCompensators: "CSPR",
|
|
20
|
+
BusBarSections: "Sections de jeux de barres"
|
|
20
21
|
};
|
|
21
22
|
export {
|
|
22
23
|
equipmentsFr
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { cardErrorBoundaryFr } from "./cardErrorBoundaryFr.js";
|
|
2
|
+
import { businessErrorsFr } from "./businessErrorsFr.js";
|
|
2
3
|
import { commonButtonFr } from "./commonButtonFr.js";
|
|
3
4
|
import { csvFr } from "./csvFr.js";
|
|
4
5
|
import { descriptionFr } from "./descriptionFr.js";
|
|
@@ -25,6 +26,7 @@ import { componentsFr } from "./componentsFr.js";
|
|
|
25
26
|
import { parametersFr } from "./parameters.js";
|
|
26
27
|
import { useUniqueNameValidationFr } from "./use-unique-name-validation-fr.js";
|
|
27
28
|
export {
|
|
29
|
+
businessErrorsFr,
|
|
28
30
|
cardErrorBoundaryFr,
|
|
29
31
|
commonButtonFr,
|
|
30
32
|
componentsFr,
|
package/dist/utils/index.js
CHANGED
|
@@ -12,7 +12,7 @@ import { equipmentTypesForPredefinedPropertiesMapper } from "./mapper/equipmentT
|
|
|
12
12
|
import { NotificationsUrlKeys, PREFIX_CONFIG_NOTIFICATION_WS, PREFIX_DIRECTORY_NOTIFICATION_WS, PREFIX_STUDY_NOTIFICATION_WS } from "./constants/notificationsProvider.js";
|
|
13
13
|
import { DARK_THEME, LIGHT_THEME, makeComposeClasses, mergeSx, toNestedGlobalSelectors } from "./styles.js";
|
|
14
14
|
import { ElementType } from "./types/elementType.js";
|
|
15
|
-
import { BASE_EQUIPMENTS, EQUIPMENT_TYPE, EquipmentType, ExtendedEquipmentType, HvdcType, OperatingStatus, SEARCH_EQUIPMENTS, TYPE_TAG_MAX_SIZE, VL_TAG_MAX_SIZE, equipmentStyles, getEquipmentsInfosForSearchBar } from "./types/equipmentType.js";
|
|
15
|
+
import { ALL_EQUIPMENTS, BASE_EQUIPMENTS, EQUIPMENT_TYPE, EquipmentType, ExtendedEquipmentType, HvdcType, OperatingStatus, SEARCH_EQUIPMENTS, TYPE_TAG_MAX_SIZE, VL_TAG_MAX_SIZE, equipmentStyles, getEquipmentsInfosForSearchBar } from "./types/equipmentType.js";
|
|
16
16
|
import { Battery, BusBar, DanglingLine, Generator, Hvdc, LCC, Line, Load, SVC, ShuntCompensator, Substation, ThreeWindingTransfo, TwoWindingTransfo, VSC, VoltageLevel } from "./types/equipmentTypes.js";
|
|
17
17
|
import { AnnouncementSeverity, ArrayAction } from "./types/types.js";
|
|
18
18
|
import { MODIFICATION_TYPES, ModificationType } from "./types/modificationType.js";
|
|
@@ -24,6 +24,7 @@ import { toNumber, validateValueIsANumber } from "./validation-functions.js";
|
|
|
24
24
|
import "./yupConfig.js";
|
|
25
25
|
import * as yup from "yup";
|
|
26
26
|
export {
|
|
27
|
+
ALL_EQUIPMENTS,
|
|
27
28
|
AMPERE,
|
|
28
29
|
AnnouncementSeverity,
|
|
29
30
|
ArrayAction,
|
|
@@ -71,18 +71,172 @@ export declare enum ExtendedEquipmentType {
|
|
|
71
71
|
HVDC_LINE_LCC = "HVDC_LINE_LCC",
|
|
72
72
|
HVDC_LINE_VSC = "HVDC_LINE_VSC"
|
|
73
73
|
}
|
|
74
|
-
export declare const
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
74
|
+
export declare const ALL_EQUIPMENTS: {
|
|
75
|
+
SUBSTATION: {
|
|
76
|
+
id: EquipmentType;
|
|
77
|
+
label: string;
|
|
78
|
+
};
|
|
79
|
+
VOLTAGE_LEVEL: {
|
|
80
|
+
id: EquipmentType;
|
|
81
|
+
label: string;
|
|
82
|
+
};
|
|
83
|
+
LINE: {
|
|
84
|
+
id: EquipmentType;
|
|
85
|
+
label: string;
|
|
86
|
+
};
|
|
87
|
+
TWO_WINDINGS_TRANSFORMER: {
|
|
88
|
+
id: EquipmentType;
|
|
89
|
+
label: string;
|
|
90
|
+
};
|
|
91
|
+
THREE_WINDINGS_TRANSFORMER: {
|
|
92
|
+
id: EquipmentType;
|
|
93
|
+
label: string;
|
|
94
|
+
};
|
|
95
|
+
GENERATOR: {
|
|
96
|
+
id: EquipmentType;
|
|
97
|
+
label: string;
|
|
98
|
+
};
|
|
99
|
+
BATTERY: {
|
|
100
|
+
id: EquipmentType;
|
|
101
|
+
label: string;
|
|
102
|
+
};
|
|
103
|
+
LOAD: {
|
|
104
|
+
id: EquipmentType;
|
|
105
|
+
label: string;
|
|
106
|
+
};
|
|
107
|
+
SHUNT_COMPENSATOR: {
|
|
108
|
+
id: EquipmentType;
|
|
109
|
+
label: string;
|
|
110
|
+
};
|
|
111
|
+
STATIC_VAR_COMPENSATOR: {
|
|
112
|
+
id: EquipmentType;
|
|
113
|
+
label: string;
|
|
114
|
+
};
|
|
115
|
+
DANGLING_LINE: {
|
|
116
|
+
id: EquipmentType;
|
|
117
|
+
label: string;
|
|
118
|
+
};
|
|
119
|
+
BUSBAR_SECTION: {
|
|
120
|
+
id: EquipmentType;
|
|
121
|
+
label: string;
|
|
122
|
+
};
|
|
123
|
+
HVDC_LINE: {
|
|
124
|
+
id: EquipmentType;
|
|
125
|
+
label: string;
|
|
126
|
+
};
|
|
127
|
+
HVDC_LINE_LCC: {
|
|
128
|
+
id: ExtendedEquipmentType;
|
|
129
|
+
label: string;
|
|
130
|
+
};
|
|
131
|
+
HVDC_LINE_VSC: {
|
|
132
|
+
id: ExtendedEquipmentType;
|
|
133
|
+
label: string;
|
|
134
|
+
};
|
|
135
|
+
};
|
|
136
|
+
export declare const BASE_EQUIPMENTS: {
|
|
137
|
+
SUBSTATION: {
|
|
138
|
+
id: EquipmentType;
|
|
139
|
+
label: string;
|
|
140
|
+
};
|
|
141
|
+
VOLTAGE_LEVEL: {
|
|
142
|
+
id: EquipmentType;
|
|
143
|
+
label: string;
|
|
144
|
+
};
|
|
145
|
+
LINE: {
|
|
146
|
+
id: EquipmentType;
|
|
147
|
+
label: string;
|
|
148
|
+
};
|
|
149
|
+
TWO_WINDINGS_TRANSFORMER: {
|
|
150
|
+
id: EquipmentType;
|
|
151
|
+
label: string;
|
|
152
|
+
};
|
|
153
|
+
THREE_WINDINGS_TRANSFORMER: {
|
|
154
|
+
id: EquipmentType;
|
|
155
|
+
label: string;
|
|
156
|
+
};
|
|
157
|
+
GENERATOR: {
|
|
158
|
+
id: EquipmentType;
|
|
159
|
+
label: string;
|
|
160
|
+
};
|
|
161
|
+
BATTERY: {
|
|
162
|
+
id: EquipmentType;
|
|
163
|
+
label: string;
|
|
164
|
+
};
|
|
165
|
+
LOAD: {
|
|
166
|
+
id: EquipmentType;
|
|
167
|
+
label: string;
|
|
168
|
+
};
|
|
169
|
+
SHUNT_COMPENSATOR: {
|
|
170
|
+
id: EquipmentType;
|
|
171
|
+
label: string;
|
|
172
|
+
};
|
|
173
|
+
STATIC_VAR_COMPENSATOR: {
|
|
174
|
+
id: EquipmentType;
|
|
175
|
+
label: string;
|
|
176
|
+
};
|
|
177
|
+
DANGLING_LINE: {
|
|
178
|
+
id: EquipmentType;
|
|
179
|
+
label: string;
|
|
180
|
+
};
|
|
181
|
+
};
|
|
78
182
|
export declare const EQUIPMENT_TYPE: Partial<Record<EquipmentType | ExtendedEquipmentType, {
|
|
79
183
|
name: EquipmentType | ExtendedEquipmentType;
|
|
80
184
|
tagLabel: string;
|
|
81
185
|
} | undefined>>;
|
|
82
|
-
export declare const SEARCH_EQUIPMENTS:
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
186
|
+
export declare const SEARCH_EQUIPMENTS: {
|
|
187
|
+
HVDC_LINE_LCC: {
|
|
188
|
+
id: ExtendedEquipmentType;
|
|
189
|
+
label: string;
|
|
190
|
+
};
|
|
191
|
+
HVDC_LINE_VSC: {
|
|
192
|
+
id: ExtendedEquipmentType;
|
|
193
|
+
label: string;
|
|
194
|
+
};
|
|
195
|
+
SUBSTATION: {
|
|
196
|
+
id: EquipmentType;
|
|
197
|
+
label: string;
|
|
198
|
+
};
|
|
199
|
+
VOLTAGE_LEVEL: {
|
|
200
|
+
id: EquipmentType;
|
|
201
|
+
label: string;
|
|
202
|
+
};
|
|
203
|
+
LINE: {
|
|
204
|
+
id: EquipmentType;
|
|
205
|
+
label: string;
|
|
206
|
+
};
|
|
207
|
+
TWO_WINDINGS_TRANSFORMER: {
|
|
208
|
+
id: EquipmentType;
|
|
209
|
+
label: string;
|
|
210
|
+
};
|
|
211
|
+
THREE_WINDINGS_TRANSFORMER: {
|
|
212
|
+
id: EquipmentType;
|
|
213
|
+
label: string;
|
|
214
|
+
};
|
|
215
|
+
GENERATOR: {
|
|
216
|
+
id: EquipmentType;
|
|
217
|
+
label: string;
|
|
218
|
+
};
|
|
219
|
+
BATTERY: {
|
|
220
|
+
id: EquipmentType;
|
|
221
|
+
label: string;
|
|
222
|
+
};
|
|
223
|
+
LOAD: {
|
|
224
|
+
id: EquipmentType;
|
|
225
|
+
label: string;
|
|
226
|
+
};
|
|
227
|
+
SHUNT_COMPENSATOR: {
|
|
228
|
+
id: EquipmentType;
|
|
229
|
+
label: string;
|
|
230
|
+
};
|
|
231
|
+
STATIC_VAR_COMPENSATOR: {
|
|
232
|
+
id: EquipmentType;
|
|
233
|
+
label: string;
|
|
234
|
+
};
|
|
235
|
+
DANGLING_LINE: {
|
|
236
|
+
id: EquipmentType;
|
|
237
|
+
label: string;
|
|
238
|
+
};
|
|
239
|
+
};
|
|
86
240
|
export interface Identifiable {
|
|
87
241
|
id: string;
|
|
88
242
|
name?: string;
|
|
@@ -71,7 +71,7 @@ var ExtendedEquipmentType = /* @__PURE__ */ ((ExtendedEquipmentType2) => {
|
|
|
71
71
|
ExtendedEquipmentType2["HVDC_LINE_VSC"] = "HVDC_LINE_VSC";
|
|
72
72
|
return ExtendedEquipmentType2;
|
|
73
73
|
})(ExtendedEquipmentType || {});
|
|
74
|
-
const
|
|
74
|
+
const ALL_EQUIPMENTS = {
|
|
75
75
|
[
|
|
76
76
|
"SUBSTATION"
|
|
77
77
|
/* SUBSTATION */
|
|
@@ -148,8 +148,115 @@ const BASE_EQUIPMENTS = {
|
|
|
148
148
|
]: {
|
|
149
149
|
id: "DANGLING_LINE",
|
|
150
150
|
label: "DanglingLines"
|
|
151
|
+
},
|
|
152
|
+
[
|
|
153
|
+
"BUSBAR_SECTION"
|
|
154
|
+
/* BUSBAR_SECTION */
|
|
155
|
+
]: {
|
|
156
|
+
id: "BUSBAR_SECTION",
|
|
157
|
+
label: "BusBarSections"
|
|
158
|
+
},
|
|
159
|
+
[
|
|
160
|
+
"HVDC_LINE"
|
|
161
|
+
/* HVDC_LINE */
|
|
162
|
+
]: {
|
|
163
|
+
id: "HVDC_LINE",
|
|
164
|
+
label: "Hvdc"
|
|
165
|
+
},
|
|
166
|
+
[
|
|
167
|
+
"HVDC_LINE_LCC"
|
|
168
|
+
/* HVDC_LINE_LCC */
|
|
169
|
+
]: {
|
|
170
|
+
id: "HVDC_LINE_LCC",
|
|
171
|
+
label: "LCC"
|
|
172
|
+
},
|
|
173
|
+
[
|
|
174
|
+
"HVDC_LINE_VSC"
|
|
175
|
+
/* HVDC_LINE_VSC */
|
|
176
|
+
]: {
|
|
177
|
+
id: "HVDC_LINE_VSC",
|
|
178
|
+
label: "VSC"
|
|
151
179
|
}
|
|
152
180
|
};
|
|
181
|
+
const BASE_EQUIPMENTS = {
|
|
182
|
+
[
|
|
183
|
+
"SUBSTATION"
|
|
184
|
+
/* SUBSTATION */
|
|
185
|
+
]: ALL_EQUIPMENTS[
|
|
186
|
+
"SUBSTATION"
|
|
187
|
+
/* SUBSTATION */
|
|
188
|
+
],
|
|
189
|
+
[
|
|
190
|
+
"VOLTAGE_LEVEL"
|
|
191
|
+
/* VOLTAGE_LEVEL */
|
|
192
|
+
]: ALL_EQUIPMENTS[
|
|
193
|
+
"VOLTAGE_LEVEL"
|
|
194
|
+
/* VOLTAGE_LEVEL */
|
|
195
|
+
],
|
|
196
|
+
[
|
|
197
|
+
"LINE"
|
|
198
|
+
/* LINE */
|
|
199
|
+
]: ALL_EQUIPMENTS[
|
|
200
|
+
"LINE"
|
|
201
|
+
/* LINE */
|
|
202
|
+
],
|
|
203
|
+
[
|
|
204
|
+
"TWO_WINDINGS_TRANSFORMER"
|
|
205
|
+
/* TWO_WINDINGS_TRANSFORMER */
|
|
206
|
+
]: ALL_EQUIPMENTS[
|
|
207
|
+
"TWO_WINDINGS_TRANSFORMER"
|
|
208
|
+
/* TWO_WINDINGS_TRANSFORMER */
|
|
209
|
+
],
|
|
210
|
+
[
|
|
211
|
+
"THREE_WINDINGS_TRANSFORMER"
|
|
212
|
+
/* THREE_WINDINGS_TRANSFORMER */
|
|
213
|
+
]: ALL_EQUIPMENTS[
|
|
214
|
+
"THREE_WINDINGS_TRANSFORMER"
|
|
215
|
+
/* THREE_WINDINGS_TRANSFORMER */
|
|
216
|
+
],
|
|
217
|
+
[
|
|
218
|
+
"GENERATOR"
|
|
219
|
+
/* GENERATOR */
|
|
220
|
+
]: ALL_EQUIPMENTS[
|
|
221
|
+
"GENERATOR"
|
|
222
|
+
/* GENERATOR */
|
|
223
|
+
],
|
|
224
|
+
[
|
|
225
|
+
"BATTERY"
|
|
226
|
+
/* BATTERY */
|
|
227
|
+
]: ALL_EQUIPMENTS[
|
|
228
|
+
"BATTERY"
|
|
229
|
+
/* BATTERY */
|
|
230
|
+
],
|
|
231
|
+
[
|
|
232
|
+
"LOAD"
|
|
233
|
+
/* LOAD */
|
|
234
|
+
]: ALL_EQUIPMENTS[
|
|
235
|
+
"LOAD"
|
|
236
|
+
/* LOAD */
|
|
237
|
+
],
|
|
238
|
+
[
|
|
239
|
+
"SHUNT_COMPENSATOR"
|
|
240
|
+
/* SHUNT_COMPENSATOR */
|
|
241
|
+
]: ALL_EQUIPMENTS[
|
|
242
|
+
"SHUNT_COMPENSATOR"
|
|
243
|
+
/* SHUNT_COMPENSATOR */
|
|
244
|
+
],
|
|
245
|
+
[
|
|
246
|
+
"STATIC_VAR_COMPENSATOR"
|
|
247
|
+
/* STATIC_VAR_COMPENSATOR */
|
|
248
|
+
]: ALL_EQUIPMENTS[
|
|
249
|
+
"STATIC_VAR_COMPENSATOR"
|
|
250
|
+
/* STATIC_VAR_COMPENSATOR */
|
|
251
|
+
],
|
|
252
|
+
[
|
|
253
|
+
"DANGLING_LINE"
|
|
254
|
+
/* DANGLING_LINE */
|
|
255
|
+
]: ALL_EQUIPMENTS[
|
|
256
|
+
"DANGLING_LINE"
|
|
257
|
+
/* DANGLING_LINE */
|
|
258
|
+
]
|
|
259
|
+
};
|
|
153
260
|
const EQUIPMENT_TYPE = {
|
|
154
261
|
[
|
|
155
262
|
"SUBSTATION"
|
|
@@ -290,17 +397,17 @@ const SEARCH_EQUIPMENTS = {
|
|
|
290
397
|
[
|
|
291
398
|
"HVDC_LINE_LCC"
|
|
292
399
|
/* HVDC_LINE_LCC */
|
|
293
|
-
]:
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
400
|
+
]: ALL_EQUIPMENTS[
|
|
401
|
+
"HVDC_LINE_LCC"
|
|
402
|
+
/* HVDC_LINE_LCC */
|
|
403
|
+
],
|
|
297
404
|
[
|
|
298
405
|
"HVDC_LINE_VSC"
|
|
299
406
|
/* HVDC_LINE_VSC */
|
|
300
|
-
]:
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
407
|
+
]: ALL_EQUIPMENTS[
|
|
408
|
+
"HVDC_LINE_VSC"
|
|
409
|
+
/* HVDC_LINE_VSC */
|
|
410
|
+
]
|
|
304
411
|
};
|
|
305
412
|
var OperatingStatus = /* @__PURE__ */ ((OperatingStatus2) => {
|
|
306
413
|
OperatingStatus2["IN_OPERATION"] = "IN_OPERATION";
|
|
@@ -330,6 +437,7 @@ function getEquipmentsInfosForSearchBar(equipmentsInfos, getNameOrId) {
|
|
|
330
437
|
});
|
|
331
438
|
}
|
|
332
439
|
export {
|
|
440
|
+
ALL_EQUIPMENTS,
|
|
333
441
|
BASE_EQUIPMENTS,
|
|
334
442
|
EQUIPMENT_TYPE,
|
|
335
443
|
EquipmentType,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ElementType } from "./elementType.js";
|
|
2
|
-
import { BASE_EQUIPMENTS, EQUIPMENT_TYPE, EquipmentType, ExtendedEquipmentType, HvdcType, OperatingStatus, SEARCH_EQUIPMENTS, TYPE_TAG_MAX_SIZE, VL_TAG_MAX_SIZE, equipmentStyles, getEquipmentsInfosForSearchBar } from "./equipmentType.js";
|
|
2
|
+
import { ALL_EQUIPMENTS, BASE_EQUIPMENTS, EQUIPMENT_TYPE, EquipmentType, ExtendedEquipmentType, HvdcType, OperatingStatus, SEARCH_EQUIPMENTS, TYPE_TAG_MAX_SIZE, VL_TAG_MAX_SIZE, equipmentStyles, getEquipmentsInfosForSearchBar } from "./equipmentType.js";
|
|
3
3
|
import { Battery, BusBar, DanglingLine, Generator, Hvdc, LCC, Line, Load, SVC, ShuntCompensator, Substation, ThreeWindingTransfo, TwoWindingTransfo, VSC, VoltageLevel } from "./equipmentTypes.js";
|
|
4
4
|
import { AnnouncementSeverity, ArrayAction } from "./types.js";
|
|
5
5
|
import { MODIFICATION_TYPES, ModificationType } from "./modificationType.js";
|
|
@@ -8,6 +8,7 @@ import { ParameterType } from "./parameters.type.js";
|
|
|
8
8
|
import { SolverTypeInfos } from "./dynamic-simulation.type.js";
|
|
9
9
|
import { DistributionType, SensitivityType } from "./sensitivity-analysis.type.js";
|
|
10
10
|
export {
|
|
11
|
+
ALL_EQUIPMENTS,
|
|
11
12
|
AnnouncementSeverity,
|
|
12
13
|
ArrayAction,
|
|
13
14
|
BASE_EQUIPMENTS,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gridsuite/commons-ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.133.0",
|
|
4
4
|
"description": "common react components for gridsuite applications",
|
|
5
5
|
"author": "gridsuite team",
|
|
6
6
|
"homepage": "https://github.com/gridsuite",
|
|
@@ -37,8 +37,8 @@
|
|
|
37
37
|
"@ag-grid-community/locale": "^33.3.2",
|
|
38
38
|
"@hello-pangea/dnd": "^18.0.1",
|
|
39
39
|
"@material-symbols/svg-400": "^0.31.9",
|
|
40
|
-
"@react-querybuilder/dnd": "^8.
|
|
41
|
-
"@react-querybuilder/material": "^8.
|
|
40
|
+
"@react-querybuilder/dnd": "^8.11.0",
|
|
41
|
+
"@react-querybuilder/material": "^8.11.0",
|
|
42
42
|
"autosuggest-highlight": "^3.3.4",
|
|
43
43
|
"clsx": "^2.1.1",
|
|
44
44
|
"jwt-decode": "^4.0.0",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"react-csv-downloader": "^3.3.0",
|
|
50
50
|
"react-dnd": "^16.0.1",
|
|
51
51
|
"react-dnd-html5-backend": "^16.0.1",
|
|
52
|
-
"react-querybuilder": "^8.
|
|
52
|
+
"react-querybuilder": "^8.11.0",
|
|
53
53
|
"reconnecting-websocket": "^4.4.0",
|
|
54
54
|
"type-fest": "^4.41.0",
|
|
55
55
|
"uuid": "^13.0.0"
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { IconButton } from "@mui/material";
|
|
3
|
-
import { Refresh } from "@mui/icons-material";
|
|
4
|
-
function RefreshButton(buttonProps) {
|
|
5
|
-
return /* @__PURE__ */ jsx(IconButton, { ...buttonProps, children: /* @__PURE__ */ jsx(Refresh, { fontSize: "large" }) });
|
|
6
|
-
}
|
|
7
|
-
export {
|
|
8
|
-
RefreshButton
|
|
9
|
-
};
|