@gridsuite/commons-ui 0.241.1 → 0.243.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/README.md +10 -2
- package/dist/components/composite/filter/explicitNaming/ExplicitNamingFilterForm.js +1 -1
- package/dist/components/composite/grid/grid-item.d.ts +2 -1
- package/dist/components/composite/grid/grid-item.js +9 -2
- package/dist/components/ui/csvPicker/csv-picker.d.ts +7 -2
- package/dist/components/ui/csvPicker/csv-picker.js +7 -6
- package/dist/components/ui/inputs/checkbox-autocomplete/checkbox-autocomplete.d.ts +1 -2
- package/dist/features/index.js +87 -3
- package/dist/features/network-modification-table/index.js +2 -1
- package/dist/features/network-modification-table/use-modifications-drag-and-drop.js +2 -1
- package/dist/features/network-modification-table/utils.d.ts +1 -0
- package/dist/features/network-modification-table/utils.js +5 -1
- package/dist/features/network-modifications/battery/creation/BatteryCreationForm.js +3 -0
- package/dist/features/network-modifications/battery/creation/batteryCreation.utils.js +3 -0
- package/dist/features/network-modifications/battery/modification/BatteryDialogHeader.js +3 -0
- package/dist/features/network-modifications/battery/modification/BatteryDialogTabsContent.js +3 -0
- package/dist/features/network-modifications/battery/modification/batteryModification.utils.js +3 -0
- package/dist/features/network-modifications/common/connectivity/connectivityForm.utils.d.ts +71 -2
- package/dist/features/network-modifications/common/connectivity/connectivityForm.utils.js +26 -8
- package/dist/features/network-modifications/common/connectivity/index.js +3 -1
- package/dist/features/network-modifications/common/currentLimits/LimitsPane.d.ts +7 -0
- package/dist/features/network-modifications/common/currentLimits/LimitsPane.js +243 -0
- package/dist/features/network-modifications/common/currentLimits/LimitsTagChip.d.ts +9 -0
- package/dist/features/network-modifications/common/currentLimits/LimitsTagChip.js +29 -0
- package/dist/features/network-modifications/common/currentLimits/SelectedOperationalLimitGroup.d.ts +9 -0
- package/dist/features/network-modifications/common/currentLimits/SelectedOperationalLimitGroup.js +100 -0
- package/dist/features/network-modifications/common/currentLimits/index.d.ts +12 -0
- package/dist/features/network-modifications/common/currentLimits/index.js +47 -0
- package/dist/features/network-modifications/common/currentLimits/limits.types.d.ts +52 -0
- package/dist/features/network-modifications/common/currentLimits/limits.types.js +17 -0
- package/dist/features/network-modifications/common/currentLimits/limitsEditor/LimitsEditor.d.ts +10 -0
- package/dist/features/network-modifications/common/currentLimits/limitsEditor/LimitsEditor.js +285 -0
- package/dist/features/network-modifications/common/currentLimits/limitsEditor/LimitsPropertiesSideStack.d.ts +5 -0
- package/dist/features/network-modifications/common/currentLimits/limitsEditor/LimitsPropertiesSideStack.js +184 -0
- package/dist/features/network-modifications/common/currentLimits/limitsEditor/TemporaryLimitsTable.d.ts +14 -0
- package/dist/features/network-modifications/common/currentLimits/limitsEditor/TemporaryLimitsTable.js +166 -0
- package/dist/features/network-modifications/common/currentLimits/limitsEditor/index.d.ts +10 -0
- package/dist/features/network-modifications/common/currentLimits/limitsEditor/index.js +10 -0
- package/dist/features/network-modifications/common/currentLimits/limitsEditor/limitsChart.d.ts +11 -0
- package/dist/features/network-modifications/common/currentLimits/limitsEditor/limitsChart.js +177 -0
- package/dist/features/network-modifications/common/currentLimits/limitsPane.utils.d.ts +213 -0
- package/dist/features/network-modifications/common/currentLimits/limitsPane.utils.js +337 -0
- package/dist/features/network-modifications/common/currentLimits/operationalLimitsGroups/LimitsGroupsContextualMenu.d.ts +25 -0
- package/dist/features/network-modifications/common/currentLimits/operationalLimitsGroups/LimitsGroupsContextualMenu.js +92 -0
- package/dist/features/network-modifications/common/currentLimits/operationalLimitsGroups/LimitsPropertiesStack.d.ts +10 -0
- package/dist/features/network-modifications/common/currentLimits/operationalLimitsGroups/LimitsPropertiesStack.js +25 -0
- package/dist/features/network-modifications/common/currentLimits/operationalLimitsGroups/OperationalLimitsGroupTabLabel.d.ts +10 -0
- package/dist/features/network-modifications/common/currentLimits/operationalLimitsGroups/OperationalLimitsGroupTabLabel.js +73 -0
- package/dist/features/network-modifications/common/currentLimits/operationalLimitsGroups/OperationalLimitsGroups.d.ts +16 -0
- package/dist/features/network-modifications/common/currentLimits/operationalLimitsGroups/OperationalLimitsGroups.js +121 -0
- package/dist/features/network-modifications/common/currentLimits/operationalLimitsGroups/index.d.ts +11 -0
- package/dist/features/network-modifications/common/currentLimits/operationalLimitsGroups/index.js +12 -0
- package/dist/features/network-modifications/common/currentLimits/operationalLimitsGroups/operationalLimitsGroups.types.d.ts +71 -0
- package/dist/features/network-modifications/common/currentLimits/operationalLimitsGroups/operationalLimitsGroups.types.js +15 -0
- package/dist/features/network-modifications/common/currentLimits/operationalLimitsGroups/operationalLimitsGroupsStyles.d.ts +46 -0
- package/dist/features/network-modifications/common/currentLimits/operationalLimitsGroups/operationalLimitsGroupsStyles.js +45 -0
- package/dist/features/network-modifications/common/index.d.ts +1 -0
- package/dist/features/network-modifications/common/index.js +50 -2
- package/dist/features/network-modifications/common/measurements/branchActiveReactivePowerForm.utils.d.ts +11 -0
- package/dist/features/network-modifications/common/measurements/branchActiveReactivePowerForm.utils.js +6 -4
- package/dist/features/network-modifications/common/measurements/index.js +2 -1
- package/dist/features/network-modifications/common/reactiveLimits/reactiveCapabilityCurve/ReactiveCapabilityCurveTableForm.js +1 -1
- package/dist/features/network-modifications/common/voltageRegulation/VoltageRegulationForm.js +3 -7
- package/dist/features/network-modifications/equipmentDeletion/EquipmentDeletionForm.js +3 -0
- package/dist/features/network-modifications/generator/creation/GeneratorCreationForm.js +9 -6
- package/dist/features/network-modifications/generator/creation/generatorCreation.utils.js +3 -0
- package/dist/features/network-modifications/generator/modification/GeneratorDialogHeader.js +3 -0
- package/dist/features/network-modifications/generator/modification/GeneratorDialogTabsContent.js +9 -6
- package/dist/features/network-modifications/generator/modification/generatorModification.utils.js +3 -0
- package/dist/features/network-modifications/index.d.ts +1 -0
- package/dist/features/network-modifications/index.js +85 -2
- package/dist/features/network-modifications/line/catalog/index.d.ts +8 -0
- package/dist/features/network-modifications/line/catalog/index.js +14 -0
- package/dist/features/network-modifications/line/catalog/lineCatalog.type.d.ts +66 -0
- package/dist/features/network-modifications/line/catalog/lineCatalog.type.js +7 -0
- package/dist/features/network-modifications/line/catalog/segment.utils.d.ts +90 -0
- package/dist/features/network-modifications/line/catalog/segment.utils.js +100 -0
- package/dist/features/network-modifications/line/characteristics/LineCharacteristicsPane.d.ts +8 -0
- package/dist/features/network-modifications/line/characteristics/LineCharacteristicsPane.js +152 -0
- package/dist/features/network-modifications/line/characteristics/index.d.ts +9 -0
- package/dist/features/network-modifications/line/characteristics/index.js +9 -0
- package/dist/features/network-modifications/line/characteristics/lineCharacteristicsPane.types.d.ts +14 -0
- package/dist/features/network-modifications/line/characteristics/lineCharacteristicsPane.types.js +1 -0
- package/dist/features/network-modifications/line/characteristics/lineCharacteristicsPane.utils.d.ts +52 -0
- package/dist/features/network-modifications/line/characteristics/lineCharacteristicsPane.utils.js +53 -0
- package/dist/features/network-modifications/line/common/LineDialogHeader.d.ts +6 -0
- package/dist/features/network-modifications/line/common/LineDialogHeader.js +103 -0
- package/dist/features/network-modifications/line/common/LineDialogTabs.d.ts +9 -0
- package/dist/features/network-modifications/line/common/LineDialogTabs.js +61 -0
- package/dist/features/network-modifications/line/common/LineDialogTabsContent.d.ts +8 -0
- package/dist/features/network-modifications/line/common/LineDialogTabsContent.js +96 -0
- package/dist/features/network-modifications/line/common/LineForm.d.ts +6 -0
- package/dist/features/network-modifications/line/common/LineForm.js +50 -0
- package/dist/features/network-modifications/line/common/index.d.ts +12 -0
- package/dist/features/network-modifications/line/common/index.js +13 -0
- package/dist/features/network-modifications/line/common/line.types.d.ts +47 -0
- package/dist/features/network-modifications/line/common/line.types.js +1 -0
- package/dist/features/network-modifications/line/common/line.utils.d.ts +13 -0
- package/dist/features/network-modifications/line/common/line.utils.js +34 -0
- package/dist/features/network-modifications/line/creation/index.d.ts +8 -0
- package/dist/features/network-modifications/line/creation/index.js +7 -0
- package/dist/features/network-modifications/line/creation/lineCreation.types.d.ts +39 -0
- package/dist/features/network-modifications/line/creation/lineCreation.types.js +1 -0
- package/dist/features/network-modifications/line/creation/lineCreation.utils.d.ts +151 -0
- package/dist/features/network-modifications/line/creation/lineCreation.utils.js +172 -0
- package/dist/features/network-modifications/line/index.d.ts +10 -0
- package/dist/features/network-modifications/line/index.js +37 -0
- package/dist/features/network-modifications/load/common/LoadDialogHeader.js +3 -0
- package/dist/features/network-modifications/load/modification/loadModification.utils.js +3 -0
- package/dist/features/network-modifications/shunt-compensator/common/CharacteristicsForm.js +7 -6
- package/dist/features/network-modifications/shunt-compensator/creation/ShuntCompensatorCreationForm.js +3 -0
- package/dist/features/network-modifications/shunt-compensator/creation/shuntCompensatorCreation.utils.js +3 -0
- package/dist/features/network-modifications/shunt-compensator/modification/ShuntCompensatorModificationForm.js +3 -0
- package/dist/features/network-modifications/shunt-compensator/modification/shuntCompensatorModification.utils.js +3 -0
- package/dist/features/network-modifications/substation/creation/SubstationCreationForm.js +3 -0
- package/dist/features/network-modifications/substation/modification/SubstationModificationForm.js +3 -0
- package/dist/features/network-modifications/voltageLevel/creation/VoltageLevelCreationForm.js +3 -0
- package/dist/features/network-modifications/voltageLevel/creation/index.js +3 -0
- package/dist/features/network-modifications/voltageLevel/creation/tabs/substationTab/SubstationCreationSection.js +3 -0
- package/dist/features/network-modifications/voltageLevel/creation/voltageLevelCreation.utils.js +3 -0
- package/dist/features/network-modifications/voltageLevel/index.js +3 -0
- package/dist/features/network-modifications/voltageLevel/modification/VoltageLevelModificationForm.js +4 -1
- package/dist/features/parameters/common/contingency-table/contingency-table.js +22 -10
- package/dist/features/parameters/common/contingency-table/types.d.ts +7 -8
- package/dist/features/parameters/common/contingency-table/utils.d.ts +13 -0
- package/dist/features/parameters/common/contingency-table/utils.js +31 -0
- package/dist/features/parameters/loadflow/load-flow-general-parameters.js +5 -1
- package/dist/features/parameters/security-analysis/security-analysis-parameters-form.js +19 -31
- package/dist/hooks/useModificationLabelComputer.js +1 -0
- package/dist/index.js +87 -7
- package/dist/translations/en/index.d.ts +0 -1
- package/dist/translations/en/index.js +0 -2
- package/dist/translations/en/networkModificationsEn.d.ts +28 -0
- package/dist/translations/en/networkModificationsEn.js +28 -0
- package/dist/translations/en/parameters.d.ts +3 -1
- package/dist/translations/en/parameters.js +3 -1
- package/dist/translations/fr/index.d.ts +0 -1
- package/dist/translations/fr/index.js +0 -2
- package/dist/translations/fr/networkModificationsFr.d.ts +28 -0
- package/dist/translations/fr/networkModificationsFr.js +28 -0
- package/dist/translations/fr/parameters.d.ts +3 -1
- package/dist/translations/fr/parameters.js +3 -1
- package/dist/utils/constants/fieldConstants.d.ts +47 -1
- package/dist/utils/constants/fieldConstants.js +46 -0
- package/dist/utils/types/modificationType.d.ts +4 -0
- package/dist/utils/types/modificationType.js +5 -0
- package/package.json +11 -4
- package/dist/translations/en/inputsEn.d.ts +0 -24
- package/dist/translations/en/inputsEn.js +0 -21
- package/dist/translations/fr/inputsFr.d.ts +0 -24
- package/dist/translations/fr/inputsFr.js +0 -21
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2026, 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 * from './limitsChart';
|
|
8
|
+
export * from './LimitsPropertiesSideStack';
|
|
9
|
+
export * from './LimitsEditor';
|
|
10
|
+
export * from './TemporaryLimitsTable';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { LimitsChart } from "./limitsChart.js";
|
|
2
|
+
import { LimitsPropertiesSideStack } from "./LimitsPropertiesSideStack.js";
|
|
3
|
+
import { LimitsEditor } from "./LimitsEditor.js";
|
|
4
|
+
import { TemporaryLimitsTable } from "./TemporaryLimitsTable.js";
|
|
5
|
+
export {
|
|
6
|
+
LimitsChart,
|
|
7
|
+
LimitsEditor,
|
|
8
|
+
LimitsPropertiesSideStack,
|
|
9
|
+
TemporaryLimitsTable
|
|
10
|
+
};
|
package/dist/features/network-modifications/common/currentLimits/limitsEditor/limitsChart.d.ts
ADDED
|
@@ -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 interface LimitsGraphProps {
|
|
8
|
+
limitsGroupFormName: string;
|
|
9
|
+
previousPermanentLimit?: number | null;
|
|
10
|
+
}
|
|
11
|
+
export declare function LimitsChart({ limitsGroupFormName, previousPermanentLimit }: Readonly<LimitsGraphProps>): import("react").JSX.Element;
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { BarChart } from "@mui/x-charts";
|
|
3
|
+
import { useCallback, useMemo } from "react";
|
|
4
|
+
import { useWatch } from "react-hook-form";
|
|
5
|
+
import { useIntl } from "react-intl";
|
|
6
|
+
const colorPermanentLimit = "#58d058";
|
|
7
|
+
const colors = ["#ffc019", "#e47400", "#cc5500", "#ff5757", "#ff0000"];
|
|
8
|
+
const colorForbidden = "#b10303";
|
|
9
|
+
const formatTempo = (tempo) => {
|
|
10
|
+
if (!tempo) {
|
|
11
|
+
return "";
|
|
12
|
+
}
|
|
13
|
+
const min = Math.floor(tempo / 60);
|
|
14
|
+
const sec = tempo % 60;
|
|
15
|
+
if (min > 0 && sec === 0) {
|
|
16
|
+
return `${min}min`;
|
|
17
|
+
}
|
|
18
|
+
if (min === 0 && sec > 0) {
|
|
19
|
+
return `${sec}s`;
|
|
20
|
+
}
|
|
21
|
+
return `${min}min${sec}s`;
|
|
22
|
+
};
|
|
23
|
+
function LimitsChart({ limitsGroupFormName, previousPermanentLimit }) {
|
|
24
|
+
const currentLimits = useWatch({ name: `${limitsGroupFormName}` });
|
|
25
|
+
const intl = useIntl();
|
|
26
|
+
const permanentLimit = currentLimits?.permanentLimit ?? previousPermanentLimit ?? null;
|
|
27
|
+
const isIncoherent = useCallback(
|
|
28
|
+
(maxValuePermanentLimit, item, previousItem) => {
|
|
29
|
+
const isPermanentLimit = item.name === intl.formatMessage({ id: "permanentLimit" }) && permanentLimit || !permanentLimit && !item.acceptableDuration;
|
|
30
|
+
const permanentLimitValue = permanentLimit || maxValuePermanentLimit;
|
|
31
|
+
const itemTempoGreaterThanPrevious = item?.acceptableDuration && previousItem?.acceptableDuration && item.acceptableDuration > previousItem.acceptableDuration || false;
|
|
32
|
+
const atLeastTwoItemsWithNotempo = previousItem?.acceptableDuration && !item.acceptableDuration || false;
|
|
33
|
+
return !item.acceptableDuration && permanentLimit && !isPermanentLimit || !isPermanentLimit && item.value && item.value < permanentLimitValue || itemTempoGreaterThanPrevious || atLeastTwoItemsWithNotempo || false;
|
|
34
|
+
},
|
|
35
|
+
[intl, permanentLimit]
|
|
36
|
+
);
|
|
37
|
+
const { series, ticks, max } = useMemo(() => {
|
|
38
|
+
const thresholds = [];
|
|
39
|
+
let noValueThresholdFound = false;
|
|
40
|
+
let maxValuePermanentLimit = 0;
|
|
41
|
+
if (permanentLimit) {
|
|
42
|
+
thresholds.push({
|
|
43
|
+
name: intl.formatMessage({ id: "permanentLimit" }),
|
|
44
|
+
value: permanentLimit ? +permanentLimit : permanentLimit,
|
|
45
|
+
acceptableDuration: null
|
|
46
|
+
});
|
|
47
|
+
maxValuePermanentLimit = permanentLimit ?? 0;
|
|
48
|
+
}
|
|
49
|
+
if (currentLimits?.temporaryLimits) {
|
|
50
|
+
currentLimits.temporaryLimits.filter((field) => field.name && (field.acceptableDuration || field.value)).forEach((field) => {
|
|
51
|
+
if (!field.value) {
|
|
52
|
+
noValueThresholdFound = true;
|
|
53
|
+
}
|
|
54
|
+
if (!field.acceptableDuration && field.value) {
|
|
55
|
+
maxValuePermanentLimit = Math.max(maxValuePermanentLimit, field.value);
|
|
56
|
+
}
|
|
57
|
+
thresholds.push({
|
|
58
|
+
name: field.name,
|
|
59
|
+
value: field.value ? +field.value : field.value,
|
|
60
|
+
acceptableDuration: field.acceptableDuration
|
|
61
|
+
});
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
thresholds.sort((a, b) => {
|
|
65
|
+
if (a.value && !b.value) {
|
|
66
|
+
return -1;
|
|
67
|
+
}
|
|
68
|
+
if (!a.value && !b.value && a.acceptableDuration && b.acceptableDuration) {
|
|
69
|
+
return a.acceptableDuration - b.acceptableDuration;
|
|
70
|
+
}
|
|
71
|
+
if (!a.value && b.value) {
|
|
72
|
+
return 1;
|
|
73
|
+
}
|
|
74
|
+
if (a.value && b.value) {
|
|
75
|
+
return a.value - b.value;
|
|
76
|
+
}
|
|
77
|
+
return 0;
|
|
78
|
+
});
|
|
79
|
+
const maxValue = Math.max(...thresholds.map((item) => item.value ?? 0));
|
|
80
|
+
let colorIndex = 0;
|
|
81
|
+
let previousSum = 0;
|
|
82
|
+
return thresholds.reduce(
|
|
83
|
+
(acc, item, index) => {
|
|
84
|
+
const isPermanentLimit = item.name === intl.formatMessage({ id: "permanentLimit" }) && permanentLimit || !permanentLimit && !item.acceptableDuration && item.value === maxValuePermanentLimit;
|
|
85
|
+
const difference = item.value ? item.value - previousSum : void 0;
|
|
86
|
+
const color = isPermanentLimit || !item.acceptableDuration || item.acceptableDuration && item.value && maxValuePermanentLimit >= item.value ? colorPermanentLimit : colors?.[colorIndex] ?? colors[colors.length - 1];
|
|
87
|
+
const incoherent = isIncoherent(
|
|
88
|
+
maxValuePermanentLimit,
|
|
89
|
+
item,
|
|
90
|
+
index > 0 ? thresholds[index - 1] : void 0
|
|
91
|
+
);
|
|
92
|
+
if (item.value && item.value >= maxValuePermanentLimit) {
|
|
93
|
+
previousSum = item.value;
|
|
94
|
+
}
|
|
95
|
+
if (item.value && item.value > maxValuePermanentLimit) {
|
|
96
|
+
colorIndex += 1;
|
|
97
|
+
}
|
|
98
|
+
const updatedSeries = item.acceptableDuration && !item.value || item.value && item.value >= maxValuePermanentLimit ? [
|
|
99
|
+
...acc.series,
|
|
100
|
+
{
|
|
101
|
+
type: "bar",
|
|
102
|
+
label: isPermanentLimit || item.value === maxValuePermanentLimit ? intl.formatMessage({ id: "unlimited" }) : formatTempo(item.acceptableDuration),
|
|
103
|
+
data: [difference ?? maxValue * 0.15],
|
|
104
|
+
color: item.value ? color : colorForbidden,
|
|
105
|
+
stack: "total"
|
|
106
|
+
}
|
|
107
|
+
] : [...acc.series];
|
|
108
|
+
const updatedTicks = [...acc.ticks, { position: item.value, label: item.name, incoherent }];
|
|
109
|
+
if (index === thresholds.length - 1 && updatedTicks[updatedTicks.length - 1].position && !noValueThresholdFound) {
|
|
110
|
+
updatedSeries.push({
|
|
111
|
+
type: "bar",
|
|
112
|
+
label: intl.formatMessage({ id: "forbidden" }),
|
|
113
|
+
data: [(updatedTicks[updatedTicks.length - 1].position ?? 0) * 0.15],
|
|
114
|
+
color: colorForbidden,
|
|
115
|
+
stack: "total"
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
return {
|
|
119
|
+
series: updatedSeries,
|
|
120
|
+
ticks: updatedTicks,
|
|
121
|
+
max: updatedSeries.flatMap((serie) => serie.data).filter(Number.isFinite).reduce((a, b) => a + b, 0) ?? 100
|
|
122
|
+
};
|
|
123
|
+
},
|
|
124
|
+
{ series: [], ticks: [], max: 0 }
|
|
125
|
+
);
|
|
126
|
+
}, [currentLimits.temporaryLimits, intl, isIncoherent, permanentLimit]);
|
|
127
|
+
const tickPositions = ticks.map((t) => t.position);
|
|
128
|
+
return /* @__PURE__ */ jsx(
|
|
129
|
+
BarChart,
|
|
130
|
+
{
|
|
131
|
+
margin: { left: 20, right: 20, top: 0, bottom: 0 },
|
|
132
|
+
height: 90,
|
|
133
|
+
slotProps: {
|
|
134
|
+
legend: {
|
|
135
|
+
position: {
|
|
136
|
+
vertical: "bottom"
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
},
|
|
140
|
+
series: series.length > 0 ? series : [{ label: intl.formatMessage({ id: "unlimited" }), data: [100], color: colorPermanentLimit }],
|
|
141
|
+
layout: "horizontal",
|
|
142
|
+
yAxis: [
|
|
143
|
+
// We can't totally disable the yAxis, so we have to give empty data
|
|
144
|
+
{
|
|
145
|
+
id: "leftAxis",
|
|
146
|
+
position: "none",
|
|
147
|
+
data: [""]
|
|
148
|
+
}
|
|
149
|
+
],
|
|
150
|
+
xAxis: [
|
|
151
|
+
{
|
|
152
|
+
id: "bottomAxis",
|
|
153
|
+
position: "bottom",
|
|
154
|
+
tickInterval: tickPositions,
|
|
155
|
+
tickLabelStyle: { fontSize: 10 },
|
|
156
|
+
disableLine: true,
|
|
157
|
+
min: 0,
|
|
158
|
+
max
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
id: "topAxis",
|
|
162
|
+
position: "top",
|
|
163
|
+
tickInterval: tickPositions,
|
|
164
|
+
tickLabelStyle: { fontSize: 10 },
|
|
165
|
+
valueFormatter: (value, _context) => ticks.find((item) => item.position === value)?.label ?? "",
|
|
166
|
+
disableLine: true,
|
|
167
|
+
min: 0,
|
|
168
|
+
max
|
|
169
|
+
}
|
|
170
|
+
],
|
|
171
|
+
sx: { pointerEvents: "none" }
|
|
172
|
+
}
|
|
173
|
+
);
|
|
174
|
+
}
|
|
175
|
+
export {
|
|
176
|
+
LimitsChart
|
|
177
|
+
};
|
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
import { InferType } from 'yup';
|
|
2
|
+
import { OperationalLimitsGroup, OperationalLimitsGroupFormSchema, OperationalLimitsGroupModificationInfos, TemporaryLimitFormSchema } from './operationalLimitsGroups/operationalLimitsGroups.types';
|
|
3
|
+
import { AttributeModification, FieldConstants } from '../../../../utils';
|
|
4
|
+
import { CurrentLimitsData, TemporaryLimit, TemporaryLimitsData } from './limits.types';
|
|
5
|
+
declare const limitsGroupValidationSchema: import('yup').ObjectSchema<NonNullable<{
|
|
6
|
+
id: string;
|
|
7
|
+
name: string;
|
|
8
|
+
applicability: string;
|
|
9
|
+
operationalLimitsGroupsIsDuplicate: boolean | null | undefined;
|
|
10
|
+
currentLimits: {
|
|
11
|
+
temporaryLimits?: {
|
|
12
|
+
name?: string | null | undefined;
|
|
13
|
+
value?: number | null | undefined;
|
|
14
|
+
acceptableDuration?: number | null | undefined;
|
|
15
|
+
}[] | undefined;
|
|
16
|
+
permanentLimit: number;
|
|
17
|
+
};
|
|
18
|
+
limitsProperties: {
|
|
19
|
+
name: string;
|
|
20
|
+
value: string;
|
|
21
|
+
}[] | undefined;
|
|
22
|
+
} & {
|
|
23
|
+
AdditionalProperties: {
|
|
24
|
+
previousValue?: string | null | undefined;
|
|
25
|
+
added: NonNullable<boolean | undefined>;
|
|
26
|
+
deletionMark: NonNullable<boolean | undefined>;
|
|
27
|
+
name: string;
|
|
28
|
+
value: string;
|
|
29
|
+
}[] | undefined;
|
|
30
|
+
}>, import('yup').AnyObject, {
|
|
31
|
+
id: undefined;
|
|
32
|
+
name: undefined;
|
|
33
|
+
applicability: undefined;
|
|
34
|
+
operationalLimitsGroupsIsDuplicate: undefined;
|
|
35
|
+
currentLimits: {
|
|
36
|
+
permanentLimit: undefined;
|
|
37
|
+
temporaryLimits: "";
|
|
38
|
+
};
|
|
39
|
+
limitsProperties: "";
|
|
40
|
+
AdditionalProperties: "";
|
|
41
|
+
}, "">;
|
|
42
|
+
export type LimitsGroupFormData = InferType<typeof limitsGroupValidationSchema>;
|
|
43
|
+
export declare const getLimitsValidationSchemaProps: (isEquipmentModification?: boolean) => import('yup').ObjectSchema<{
|
|
44
|
+
operationalLimitsGroups: {
|
|
45
|
+
AdditionalProperties?: {
|
|
46
|
+
previousValue?: string | null | undefined;
|
|
47
|
+
added: NonNullable<boolean | undefined>;
|
|
48
|
+
deletionMark: NonNullable<boolean | undefined>;
|
|
49
|
+
name: string;
|
|
50
|
+
value: string;
|
|
51
|
+
}[] | undefined;
|
|
52
|
+
limitsProperties?: {
|
|
53
|
+
name: string;
|
|
54
|
+
value: string;
|
|
55
|
+
}[] | undefined;
|
|
56
|
+
operationalLimitsGroupsIsDuplicate?: boolean | null | undefined;
|
|
57
|
+
applicability: string;
|
|
58
|
+
currentLimits: {
|
|
59
|
+
temporaryLimits?: {
|
|
60
|
+
name?: string | null | undefined;
|
|
61
|
+
value?: number | null | undefined;
|
|
62
|
+
acceptableDuration?: number | null | undefined;
|
|
63
|
+
}[] | undefined;
|
|
64
|
+
permanentLimit: number;
|
|
65
|
+
};
|
|
66
|
+
id: string;
|
|
67
|
+
name: string;
|
|
68
|
+
}[] | undefined;
|
|
69
|
+
selectedOperationalLimitsGroupId1: string | null | undefined;
|
|
70
|
+
selectedOperationalLimitsGroupId2: string | null | undefined;
|
|
71
|
+
enableOLGModification: boolean | undefined;
|
|
72
|
+
}, import('yup').AnyObject, {
|
|
73
|
+
operationalLimitsGroups: undefined;
|
|
74
|
+
selectedOperationalLimitsGroupId1: undefined;
|
|
75
|
+
selectedOperationalLimitsGroupId2: undefined;
|
|
76
|
+
enableOLGModification: undefined;
|
|
77
|
+
}, "">;
|
|
78
|
+
export type LimitsSchemaType = InferType<ReturnType<typeof limitsValidationSchemaCreation>[typeof FieldConstants.LIMITS]>;
|
|
79
|
+
declare const limitsValidationSchemaCreation: (id: string, isModification: boolean) => {
|
|
80
|
+
[x: string]: import('yup').ObjectSchema<{
|
|
81
|
+
operationalLimitsGroups: {
|
|
82
|
+
AdditionalProperties?: {
|
|
83
|
+
previousValue?: string | null | undefined;
|
|
84
|
+
added: NonNullable<boolean | undefined>;
|
|
85
|
+
deletionMark: NonNullable<boolean | undefined>;
|
|
86
|
+
name: string;
|
|
87
|
+
value: string;
|
|
88
|
+
}[] | undefined;
|
|
89
|
+
limitsProperties?: {
|
|
90
|
+
name: string;
|
|
91
|
+
value: string;
|
|
92
|
+
}[] | undefined;
|
|
93
|
+
operationalLimitsGroupsIsDuplicate?: boolean | null | undefined;
|
|
94
|
+
applicability: string;
|
|
95
|
+
currentLimits: {
|
|
96
|
+
temporaryLimits?: {
|
|
97
|
+
name?: string | null | undefined;
|
|
98
|
+
value?: number | null | undefined;
|
|
99
|
+
acceptableDuration?: number | null | undefined;
|
|
100
|
+
}[] | undefined;
|
|
101
|
+
permanentLimit: number;
|
|
102
|
+
};
|
|
103
|
+
id: string;
|
|
104
|
+
name: string;
|
|
105
|
+
}[] | undefined;
|
|
106
|
+
selectedOperationalLimitsGroupId1: string | null | undefined;
|
|
107
|
+
selectedOperationalLimitsGroupId2: string | null | undefined;
|
|
108
|
+
enableOLGModification: boolean | undefined;
|
|
109
|
+
}, import('yup').AnyObject, {
|
|
110
|
+
operationalLimitsGroups: undefined;
|
|
111
|
+
selectedOperationalLimitsGroupId1: undefined;
|
|
112
|
+
selectedOperationalLimitsGroupId2: undefined;
|
|
113
|
+
enableOLGModification: undefined;
|
|
114
|
+
}, "">;
|
|
115
|
+
};
|
|
116
|
+
export declare const getLimitsValidationSchema: (id?: string, isModification?: boolean) => {
|
|
117
|
+
[x: string]: import('yup').ObjectSchema<{
|
|
118
|
+
operationalLimitsGroups: {
|
|
119
|
+
AdditionalProperties?: {
|
|
120
|
+
previousValue?: string | null | undefined;
|
|
121
|
+
added: NonNullable<boolean | undefined>;
|
|
122
|
+
deletionMark: NonNullable<boolean | undefined>;
|
|
123
|
+
name: string;
|
|
124
|
+
value: string;
|
|
125
|
+
}[] | undefined;
|
|
126
|
+
limitsProperties?: {
|
|
127
|
+
name: string;
|
|
128
|
+
value: string;
|
|
129
|
+
}[] | undefined;
|
|
130
|
+
operationalLimitsGroupsIsDuplicate?: boolean | null | undefined;
|
|
131
|
+
applicability: string;
|
|
132
|
+
currentLimits: {
|
|
133
|
+
temporaryLimits?: {
|
|
134
|
+
name?: string | null | undefined;
|
|
135
|
+
value?: number | null | undefined;
|
|
136
|
+
acceptableDuration?: number | null | undefined;
|
|
137
|
+
}[] | undefined;
|
|
138
|
+
permanentLimit: number;
|
|
139
|
+
};
|
|
140
|
+
id: string;
|
|
141
|
+
name: string;
|
|
142
|
+
}[] | undefined;
|
|
143
|
+
selectedOperationalLimitsGroupId1: string | null | undefined;
|
|
144
|
+
selectedOperationalLimitsGroupId2: string | null | undefined;
|
|
145
|
+
enableOLGModification: boolean | undefined;
|
|
146
|
+
}, import('yup').AnyObject, {
|
|
147
|
+
operationalLimitsGroups: undefined;
|
|
148
|
+
selectedOperationalLimitsGroupId1: undefined;
|
|
149
|
+
selectedOperationalLimitsGroupId2: undefined;
|
|
150
|
+
enableOLGModification: undefined;
|
|
151
|
+
}, "">;
|
|
152
|
+
};
|
|
153
|
+
export declare const getLimitsEmptyFormDataProps: (isModification?: boolean) => {
|
|
154
|
+
operationalLimitsGroups: never[];
|
|
155
|
+
selectedOperationalLimitsGroupId1: null;
|
|
156
|
+
selectedOperationalLimitsGroupId2: null;
|
|
157
|
+
enableOLGModification: boolean;
|
|
158
|
+
};
|
|
159
|
+
export declare const getLimitsEmptyFormData: (isModification?: boolean, id?: FieldConstants) => {
|
|
160
|
+
[x: string]: {
|
|
161
|
+
operationalLimitsGroups: never[];
|
|
162
|
+
selectedOperationalLimitsGroupId1: null;
|
|
163
|
+
selectedOperationalLimitsGroupId2: null;
|
|
164
|
+
enableOLGModification: boolean;
|
|
165
|
+
};
|
|
166
|
+
};
|
|
167
|
+
export declare const formatTemporaryLimitsModificationToFormSchema: (temporaryLimits: TemporaryLimit[]) => TemporaryLimitFormSchema[];
|
|
168
|
+
export declare const formatOpLimitGroupsToFormInfos: (limitGroups?: OperationalLimitsGroup[] | OperationalLimitsGroupModificationInfos[] | null) => OperationalLimitsGroupFormSchema[];
|
|
169
|
+
export declare const getAllLimitsFormDataProperties: (operationalLimitsGroups?: OperationalLimitsGroupFormSchema[], selectedOperationalLimitsGroupId1?: string | null, selectedOperationalLimitsGroupId2?: string | null, enableOLGModification?: boolean | null) => {
|
|
170
|
+
operationalLimitsGroups: OperationalLimitsGroupFormSchema[];
|
|
171
|
+
selectedOperationalLimitsGroupId1: string | null;
|
|
172
|
+
selectedOperationalLimitsGroupId2: string | null;
|
|
173
|
+
enableOLGModification: boolean;
|
|
174
|
+
};
|
|
175
|
+
export declare const getAllLimitsFormData: (operationalLimitsGroups?: OperationalLimitsGroupFormSchema[], selectedOperationalLimitsGroupId1?: string | null, selectedOperationalLimitsGroupId2?: string | null, enableOLGModification?: boolean | null, id?: FieldConstants) => {
|
|
176
|
+
[x: string]: {
|
|
177
|
+
operationalLimitsGroups: OperationalLimitsGroupFormSchema[];
|
|
178
|
+
selectedOperationalLimitsGroupId1: string | null;
|
|
179
|
+
selectedOperationalLimitsGroupId2: string | null;
|
|
180
|
+
enableOLGModification: boolean;
|
|
181
|
+
};
|
|
182
|
+
};
|
|
183
|
+
/**
|
|
184
|
+
* sanitizes limit names and filters out the empty temporary limits lines
|
|
185
|
+
*/
|
|
186
|
+
export declare const sanitizeLimitsGroups: (limitsGroups?: LimitsGroupFormData[]) => OperationalLimitsGroupFormSchema[];
|
|
187
|
+
export declare const sanitizeLimitNames: (temporaryLimitList: TemporaryLimitFormSchema[]) => TemporaryLimitFormSchema[];
|
|
188
|
+
export declare const formatMapInfosToTemporaryLimitsFormSchema: (temporaryLimits: TemporaryLimitsData[]) => TemporaryLimitFormSchema[];
|
|
189
|
+
export declare const mapServerLimitsGroupsToFormInfos: (currentLimits: CurrentLimitsData[]) => {
|
|
190
|
+
id: string;
|
|
191
|
+
name: string;
|
|
192
|
+
applicability: string;
|
|
193
|
+
limitsProperties: import('./limits.types').LimitsProperty[] | undefined;
|
|
194
|
+
currentLimits: {
|
|
195
|
+
id: string;
|
|
196
|
+
permanentLimit: number;
|
|
197
|
+
temporaryLimits: TemporaryLimitFormSchema[];
|
|
198
|
+
};
|
|
199
|
+
}[];
|
|
200
|
+
export declare const convertToOperationalLimitsGroupFormSchema: (currentLimits: CurrentLimitsData[]) => OperationalLimitsGroupFormSchema[];
|
|
201
|
+
export declare const addModificationTypeToTemporaryLimits: (formTemporaryLimits: TemporaryLimitFormSchema[]) => TemporaryLimit[];
|
|
202
|
+
export declare function addOperationTypeToSelectedOpLG(selectedOpLG: string | null | undefined, noSelectionString: string): AttributeModification<string> | null;
|
|
203
|
+
/**
|
|
204
|
+
* converts the limits groups into a modification limits group
|
|
205
|
+
* ie mostly add the ADD, MODIFY, MODIFY_OR_ADD, DELETE and REPLACE tags to the data using a delta between the form and the network values
|
|
206
|
+
* note : for now only MODIFY_OR_ADD is handled, the others have been disabled for various reasons
|
|
207
|
+
*
|
|
208
|
+
* @param limitsGroupsForm current data from the form
|
|
209
|
+
*/
|
|
210
|
+
export declare const addModificationTypeToOpLimitsGroups: (limitsGroupsForm: OperationalLimitsGroupFormSchema[]) => OperationalLimitsGroup[];
|
|
211
|
+
export declare function generateEmptyOperationalLimitsGroup(name: string): OperationalLimitsGroupFormSchema;
|
|
212
|
+
export declare function generateUniqueId(baseName: string, names: string[]): string;
|
|
213
|
+
export {};
|