@gridsuite/commons-ui 0.179.0 → 0.181.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/index.js +78 -1
- package/dist/components/inputs/index.js +2 -0
- package/dist/components/inputs/reactHookForm/CheckboxNullableInput.d.ts +15 -0
- package/dist/components/inputs/reactHookForm/CheckboxNullableInput.js +75 -0
- package/dist/components/inputs/reactHookForm/index.d.ts +1 -0
- package/dist/components/inputs/reactHookForm/index.js +2 -0
- package/dist/components/network-modifications/common/connectivity/BranchConnectivityForm.d.ts +7 -0
- package/dist/components/network-modifications/common/connectivity/BranchConnectivityForm.js +63 -0
- package/dist/components/network-modifications/common/connectivity/ConnectivityForm.d.ts +37 -0
- package/dist/components/network-modifications/common/connectivity/ConnectivityForm.js +267 -0
- package/dist/components/network-modifications/common/connectivity/connectivity.type.d.ts +34 -0
- package/dist/components/network-modifications/common/connectivity/connectivity.type.js +1 -0
- package/dist/components/network-modifications/common/connectivity/connectivityForm.utils.d.ts +241 -0
- package/dist/components/network-modifications/common/connectivity/connectivityForm.utils.js +196 -0
- package/dist/components/network-modifications/common/connectivity/index.d.ts +10 -0
- package/dist/components/network-modifications/common/connectivity/index.js +25 -0
- package/dist/components/network-modifications/common/index.d.ts +4 -1
- package/dist/components/network-modifications/common/index.js +56 -1
- package/dist/components/network-modifications/common/measurements/BranchActiveReactivePowerMeasurementsForm.d.ts +2 -0
- package/dist/components/network-modifications/common/measurements/BranchActiveReactivePowerMeasurementsForm.js +37 -0
- package/dist/components/network-modifications/common/measurements/PowerMeasurementsForm.d.ts +9 -0
- package/dist/components/network-modifications/common/measurements/PowerMeasurementsForm.js +52 -0
- package/dist/components/network-modifications/common/measurements/PowerWithValidityForm.d.ts +2 -0
- package/dist/components/network-modifications/common/measurements/PowerWithValidityForm.js +74 -0
- package/dist/components/network-modifications/common/measurements/branchActiveReactivePowerForm.utils.d.ts +56 -0
- package/dist/components/network-modifications/common/measurements/branchActiveReactivePowerForm.utils.js +69 -0
- package/dist/components/network-modifications/common/measurements/index.d.ts +13 -0
- package/dist/components/network-modifications/common/measurements/index.js +26 -0
- package/dist/components/network-modifications/common/measurements/injectionActiveReactivePowerForm.utils.d.ts +58 -0
- package/dist/components/network-modifications/common/measurements/injectionActiveReactivePowerForm.utils.js +55 -0
- package/dist/components/network-modifications/common/measurements/measurement.type.d.ts +13 -0
- package/dist/components/network-modifications/common/measurements/measurement.type.js +1 -0
- package/dist/components/network-modifications/common/measurements/powerWithValidity.utils.d.ts +22 -0
- package/dist/components/network-modifications/common/measurements/powerWithValidity.utils.js +36 -0
- package/dist/components/network-modifications/common/setpoints/SetPointsForm.d.ts +15 -0
- package/dist/components/network-modifications/common/setpoints/SetPointsForm.js +71 -0
- package/dist/components/network-modifications/common/setpoints/index.d.ts +8 -0
- package/dist/components/network-modifications/common/setpoints/index.js +10 -0
- package/dist/components/network-modifications/common/setpoints/setPoints.utils.d.ts +16 -0
- package/dist/components/network-modifications/common/setpoints/setPoints.utils.js +62 -0
- package/dist/components/network-modifications/index.d.ts +1 -0
- package/dist/components/network-modifications/index.js +76 -1
- package/dist/components/network-modifications/load/common/LoadDialogHeader.d.ts +6 -0
- package/dist/components/network-modifications/load/common/LoadDialogHeader.js +100 -0
- package/dist/components/network-modifications/load/common/LoadDialogTabs.d.ts +14 -0
- package/dist/components/network-modifications/load/common/LoadDialogTabs.js +49 -0
- package/dist/components/network-modifications/load/common/LoadDialogTabsContent.d.ts +8 -0
- package/dist/components/network-modifications/load/common/LoadDialogTabsContent.js +61 -0
- package/dist/components/network-modifications/load/common/LoadForm.d.ts +6 -0
- package/dist/components/network-modifications/load/common/LoadForm.js +65 -0
- package/dist/components/network-modifications/load/common/index.d.ts +12 -0
- package/dist/components/network-modifications/load/common/index.js +12 -0
- package/dist/components/network-modifications/load/common/load.types.d.ts +16 -0
- package/dist/components/network-modifications/load/common/load.types.js +1 -0
- package/dist/components/network-modifications/load/common/load.utils.d.ts +11 -0
- package/dist/components/network-modifications/load/common/load.utils.js +8 -0
- package/dist/components/network-modifications/load/creation/index.d.ts +8 -0
- package/dist/components/network-modifications/load/creation/index.js +7 -0
- package/dist/components/network-modifications/load/creation/loadCreation.types.d.ts +16 -0
- package/dist/components/network-modifications/load/creation/loadCreation.types.js +1 -0
- package/dist/components/network-modifications/load/creation/loadCreation.utils.d.ts +53 -0
- package/dist/components/network-modifications/load/creation/loadCreation.utils.js +98 -0
- package/dist/components/network-modifications/load/index.d.ts +9 -0
- package/dist/components/network-modifications/load/index.js +22 -0
- package/dist/components/network-modifications/load/modification/index.d.ts +8 -0
- package/dist/components/network-modifications/load/modification/index.js +7 -0
- package/dist/components/network-modifications/load/modification/loadModification.types.d.ts +21 -0
- package/dist/components/network-modifications/load/modification/loadModification.types.js +1 -0
- package/dist/components/network-modifications/load/modification/loadModification.utils.d.ts +69 -0
- package/dist/components/network-modifications/load/modification/loadModification.utils.js +106 -0
- package/dist/components/network-modifications/substation/creation/substationCreation.utils.js +2 -1
- package/dist/components/network-modifications/voltage-level/index.d.ts +1 -0
- package/dist/components/network-modifications/voltage-level/voltage-level.type.d.ts +12 -0
- package/dist/components/network-modifications/voltage-level/voltage-level.type.js +1 -0
- package/dist/index.js +88 -3
- package/dist/translations/en/networkModificationsEn.d.ts +22 -0
- package/dist/translations/en/networkModificationsEn.js +23 -1
- package/dist/translations/fr/networkModificationsFr.d.ts +22 -0
- package/dist/translations/fr/networkModificationsFr.js +23 -1
- package/dist/utils/constants/fieldConstants.d.ts +24 -1
- package/dist/utils/constants/fieldConstants.js +24 -1
- package/dist/utils/index.js +10 -2
- package/dist/utils/ts-utils.d.ts +5 -6
- package/dist/utils/ts-utils.js +11 -0
- package/dist/utils/types/equipmentType.d.ts +18 -0
- package/dist/utils/types/equipmentType.js +27 -1
- package/dist/utils/types/index.js +8 -2
- package/package.json +1 -1
|
@@ -0,0 +1,14 @@
|
|
|
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
|
+
interface LoadDialogTabsProps {
|
|
8
|
+
tabIndex: number;
|
|
9
|
+
tabIndexesWithError: number[];
|
|
10
|
+
setTabIndex: (newTabIndex: number) => void;
|
|
11
|
+
isModification?: boolean;
|
|
12
|
+
}
|
|
13
|
+
export declare function LoadDialogTabs({ tabIndex, tabIndexesWithError, setTabIndex, isModification, }: Readonly<LoadDialogTabsProps>): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Grid, Tabs, Tab } from "@mui/material";
|
|
3
|
+
import { FormattedMessage } from "react-intl";
|
|
4
|
+
import { LoadDialogTab } from "./load.utils.js";
|
|
5
|
+
import { getTabIndicatorStyle, getTabStyle } from "../../../parameters/parameters-style.js";
|
|
6
|
+
function LoadDialogTabs({
|
|
7
|
+
tabIndex,
|
|
8
|
+
tabIndexesWithError,
|
|
9
|
+
setTabIndex,
|
|
10
|
+
isModification = false
|
|
11
|
+
}) {
|
|
12
|
+
return /* @__PURE__ */ jsx(Grid, { container: true, children: /* @__PURE__ */ jsxs(
|
|
13
|
+
Tabs,
|
|
14
|
+
{
|
|
15
|
+
value: tabIndex,
|
|
16
|
+
variant: "scrollable",
|
|
17
|
+
onChange: (event, newValue) => setTabIndex(newValue),
|
|
18
|
+
TabIndicatorProps: {
|
|
19
|
+
sx: getTabIndicatorStyle(tabIndexesWithError, tabIndex)
|
|
20
|
+
},
|
|
21
|
+
children: [
|
|
22
|
+
/* @__PURE__ */ jsx(
|
|
23
|
+
Tab,
|
|
24
|
+
{
|
|
25
|
+
label: /* @__PURE__ */ jsx(FormattedMessage, { id: "ConnectivityTab" }),
|
|
26
|
+
sx: getTabStyle(tabIndexesWithError, LoadDialogTab.CONNECTIVITY_TAB)
|
|
27
|
+
}
|
|
28
|
+
),
|
|
29
|
+
/* @__PURE__ */ jsx(
|
|
30
|
+
Tab,
|
|
31
|
+
{
|
|
32
|
+
label: /* @__PURE__ */ jsx(FormattedMessage, { id: "LineCharacteristicsTab" }),
|
|
33
|
+
sx: getTabStyle(tabIndexesWithError, LoadDialogTab.CHARACTERISTICS_TAB)
|
|
34
|
+
}
|
|
35
|
+
),
|
|
36
|
+
isModification && /* @__PURE__ */ jsx(
|
|
37
|
+
Tab,
|
|
38
|
+
{
|
|
39
|
+
label: /* @__PURE__ */ jsx(FormattedMessage, { id: "StateEstimationTab" }),
|
|
40
|
+
sx: getTabStyle(tabIndexesWithError, LoadDialogTab.STATE_ESTIMATION_TAB)
|
|
41
|
+
}
|
|
42
|
+
)
|
|
43
|
+
]
|
|
44
|
+
}
|
|
45
|
+
) });
|
|
46
|
+
}
|
|
47
|
+
export {
|
|
48
|
+
LoadDialogTabs
|
|
49
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { LoadFormInfos } from './load.types';
|
|
2
|
+
import { ConnectivityNetworkProps } from '../../common/connectivity/connectivity.type';
|
|
3
|
+
export interface LoadDialogTabsContentProps extends ConnectivityNetworkProps {
|
|
4
|
+
loadToModify?: LoadFormInfos | null;
|
|
5
|
+
isModification?: boolean;
|
|
6
|
+
tabIndex: number;
|
|
7
|
+
}
|
|
8
|
+
export declare function LoadDialogTabsContent({ loadToModify, isModification, tabIndex, voltageLevelOptions, PositionDiagramPane, fetchBusesOrBusbarSections, }: Readonly<LoadDialogTabsContentProps>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { jsxs, Fragment, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Box } from "@mui/material";
|
|
3
|
+
import { LoadDialogTab } from "./load.utils.js";
|
|
4
|
+
import { PowerMeasurementsForm } from "../../common/measurements/PowerMeasurementsForm.js";
|
|
5
|
+
import GridSection from "../../../grid/grid-section.js";
|
|
6
|
+
import { ConnectivityForm } from "../../common/connectivity/ConnectivityForm.js";
|
|
7
|
+
import { PropertiesForm } from "../../common/properties/PropertiesForm.js";
|
|
8
|
+
import { SetPointsForm } from "../../common/setpoints/SetPointsForm.js";
|
|
9
|
+
function LoadDialogTabsContent({
|
|
10
|
+
loadToModify,
|
|
11
|
+
isModification = false,
|
|
12
|
+
tabIndex,
|
|
13
|
+
voltageLevelOptions = [],
|
|
14
|
+
PositionDiagramPane,
|
|
15
|
+
fetchBusesOrBusbarSections
|
|
16
|
+
}) {
|
|
17
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
18
|
+
/* @__PURE__ */ jsx(Box, { hidden: tabIndex !== LoadDialogTab.CONNECTIVITY_TAB, p: 1, children: /* @__PURE__ */ jsx(
|
|
19
|
+
ConnectivityForm,
|
|
20
|
+
{
|
|
21
|
+
withPosition: true,
|
|
22
|
+
isEquipmentModification: isModification,
|
|
23
|
+
previousValues: {
|
|
24
|
+
connectablePosition: loadToModify?.connectablePosition,
|
|
25
|
+
voltageLevelId: loadToModify?.voltageLevelId,
|
|
26
|
+
busOrBusbarSectionId: loadToModify?.busOrBusbarSectionId,
|
|
27
|
+
terminalConnected: loadToModify?.terminalConnected
|
|
28
|
+
},
|
|
29
|
+
voltageLevelOptions,
|
|
30
|
+
PositionDiagramPane,
|
|
31
|
+
fetchBusesOrBusbarSections
|
|
32
|
+
}
|
|
33
|
+
) }),
|
|
34
|
+
/* @__PURE__ */ jsxs(Box, { hidden: tabIndex !== LoadDialogTab.CHARACTERISTICS_TAB, p: 1, sx: { marginTop: -4 }, children: [
|
|
35
|
+
/* @__PURE__ */ jsx(
|
|
36
|
+
SetPointsForm,
|
|
37
|
+
{
|
|
38
|
+
previousValues: {
|
|
39
|
+
activePower: loadToModify?.p0,
|
|
40
|
+
reactivePower: loadToModify?.q0
|
|
41
|
+
},
|
|
42
|
+
isModification
|
|
43
|
+
}
|
|
44
|
+
),
|
|
45
|
+
/* @__PURE__ */ jsx(PropertiesForm, { networkElementType: "load", isModification })
|
|
46
|
+
] }),
|
|
47
|
+
isModification && /* @__PURE__ */ jsxs(Box, { hidden: tabIndex !== LoadDialogTab.STATE_ESTIMATION_TAB, p: 1, sx: { marginTop: -4 }, children: [
|
|
48
|
+
/* @__PURE__ */ jsx(GridSection, { title: "MeasurementsSection" }),
|
|
49
|
+
/* @__PURE__ */ jsx(
|
|
50
|
+
PowerMeasurementsForm,
|
|
51
|
+
{
|
|
52
|
+
activePowerMeasurement: loadToModify?.measurementP,
|
|
53
|
+
reactivePowerMeasurement: loadToModify?.measurementQ
|
|
54
|
+
}
|
|
55
|
+
)
|
|
56
|
+
] })
|
|
57
|
+
] });
|
|
58
|
+
}
|
|
59
|
+
export {
|
|
60
|
+
LoadDialogTabsContent
|
|
61
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { LoadDialogTabsContentProps } from './LoadDialogTabsContent';
|
|
2
|
+
import { LoadDialogHeaderProps } from './LoadDialogHeader';
|
|
3
|
+
interface LoadFormProps extends LoadDialogHeaderProps, Omit<LoadDialogTabsContentProps, 'tabIndex' | 'isModification' | 'loadToModify'> {
|
|
4
|
+
}
|
|
5
|
+
export declare function LoadForm({ loadToModify, isModification, voltageLevelOptions, fetchBusesOrBusbarSections, PositionDiagramPane, }: Readonly<LoadFormProps>): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export {};
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useState, useEffect } from "react";
|
|
3
|
+
import { Grid } from "@mui/material";
|
|
4
|
+
import { useFormState } from "react-hook-form";
|
|
5
|
+
import { LoadDialogTabsContent } from "./LoadDialogTabsContent.js";
|
|
6
|
+
import { LoadDialogHeader } from "./LoadDialogHeader.js";
|
|
7
|
+
import { LoadDialogTab } from "./load.utils.js";
|
|
8
|
+
import { FieldConstants } from "../../../../utils/constants/fieldConstants.js";
|
|
9
|
+
import "../../../../utils/conversionUtils.js";
|
|
10
|
+
import "../../../../utils/types/equipmentType.js";
|
|
11
|
+
import "@mui/icons-material";
|
|
12
|
+
import "../../../../utils/yupConfig.js";
|
|
13
|
+
import { LoadDialogTabs } from "./LoadDialogTabs.js";
|
|
14
|
+
function LoadForm({
|
|
15
|
+
loadToModify,
|
|
16
|
+
isModification,
|
|
17
|
+
voltageLevelOptions,
|
|
18
|
+
fetchBusesOrBusbarSections,
|
|
19
|
+
PositionDiagramPane
|
|
20
|
+
}) {
|
|
21
|
+
const [tabIndexesWithError, setTabIndexesWithError] = useState([]);
|
|
22
|
+
const [tabIndex, setTabIndex] = useState(LoadDialogTab.CONNECTIVITY_TAB);
|
|
23
|
+
const { errors } = useFormState();
|
|
24
|
+
useEffect(() => {
|
|
25
|
+
const tabsInError = [];
|
|
26
|
+
if (errors?.[FieldConstants.CONNECTIVITY] !== void 0) {
|
|
27
|
+
tabsInError.push(LoadDialogTab.CONNECTIVITY_TAB);
|
|
28
|
+
}
|
|
29
|
+
if (errors?.[FieldConstants.ACTIVE_POWER_SET_POINT] !== void 0 || errors?.[FieldConstants.REACTIVE_POWER_SET_POINT] !== void 0 || errors?.[FieldConstants.ADDITIONAL_PROPERTIES] !== void 0) {
|
|
30
|
+
tabsInError.push(LoadDialogTab.CHARACTERISTICS_TAB);
|
|
31
|
+
}
|
|
32
|
+
if (tabsInError.length > 0) {
|
|
33
|
+
setTabIndex((currentTabIndex) => {
|
|
34
|
+
return tabsInError.includes(currentTabIndex) ? currentTabIndex : tabsInError[0];
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
setTabIndexesWithError(tabsInError);
|
|
38
|
+
}, [errors]);
|
|
39
|
+
return /* @__PURE__ */ jsxs(Grid, { container: true, direction: "column", spacing: 2, children: [
|
|
40
|
+
/* @__PURE__ */ jsx(Grid, { item: true, children: /* @__PURE__ */ jsx(LoadDialogHeader, { loadToModify, isModification }) }),
|
|
41
|
+
/* @__PURE__ */ jsx(Grid, { item: true, children: /* @__PURE__ */ jsx(
|
|
42
|
+
LoadDialogTabs,
|
|
43
|
+
{
|
|
44
|
+
tabIndex,
|
|
45
|
+
tabIndexesWithError,
|
|
46
|
+
setTabIndex,
|
|
47
|
+
isModification
|
|
48
|
+
}
|
|
49
|
+
) }),
|
|
50
|
+
/* @__PURE__ */ jsx(Grid, { item: true, children: /* @__PURE__ */ jsx(
|
|
51
|
+
LoadDialogTabsContent,
|
|
52
|
+
{
|
|
53
|
+
tabIndex,
|
|
54
|
+
loadToModify,
|
|
55
|
+
isModification,
|
|
56
|
+
voltageLevelOptions,
|
|
57
|
+
fetchBusesOrBusbarSections,
|
|
58
|
+
PositionDiagramPane
|
|
59
|
+
}
|
|
60
|
+
) })
|
|
61
|
+
] });
|
|
62
|
+
}
|
|
63
|
+
export {
|
|
64
|
+
LoadForm
|
|
65
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
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 './load.types';
|
|
8
|
+
export * from './load.utils';
|
|
9
|
+
export * from './LoadDialogTabs';
|
|
10
|
+
export * from './LoadDialogTabsContent';
|
|
11
|
+
export * from './LoadDialogHeader';
|
|
12
|
+
export * from './LoadForm';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { LoadDialogTab } from "./load.utils.js";
|
|
2
|
+
import { LoadDialogTabs } from "./LoadDialogTabs.js";
|
|
3
|
+
import { LoadDialogTabsContent } from "./LoadDialogTabsContent.js";
|
|
4
|
+
import { LoadDialogHeader } from "./LoadDialogHeader.js";
|
|
5
|
+
import { LoadForm } from "./LoadForm.js";
|
|
6
|
+
export {
|
|
7
|
+
LoadDialogHeader,
|
|
8
|
+
LoadDialogTab,
|
|
9
|
+
LoadDialogTabs,
|
|
10
|
+
LoadDialogTabsContent,
|
|
11
|
+
LoadForm
|
|
12
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { MeasurementInfo } from '../../common/measurements/measurement.type';
|
|
2
|
+
import { ConnectablePositionFormInfos } from '../../common/connectivity/connectivity.type';
|
|
3
|
+
export interface LoadFormInfos {
|
|
4
|
+
id: string;
|
|
5
|
+
name: string;
|
|
6
|
+
type: string;
|
|
7
|
+
p0: number;
|
|
8
|
+
q0: number;
|
|
9
|
+
voltageLevelId: string;
|
|
10
|
+
connectablePosition: ConnectablePositionFormInfos;
|
|
11
|
+
busOrBusbarSectionId: string;
|
|
12
|
+
terminalConnected?: boolean | null;
|
|
13
|
+
measurementP: MeasurementInfo | undefined;
|
|
14
|
+
measurementQ: MeasurementInfo | undefined;
|
|
15
|
+
properties: Record<string, string> | undefined;
|
|
16
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -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 const LoadDialogTab: {
|
|
8
|
+
CONNECTIVITY_TAB: number;
|
|
9
|
+
CHARACTERISTICS_TAB: number;
|
|
10
|
+
STATE_ESTIMATION_TAB: number;
|
|
11
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
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 './loadCreation.types';
|
|
8
|
+
export * from './loadCreation.utils';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Property } from '../../common';
|
|
2
|
+
export interface LoadCreationDto {
|
|
3
|
+
type: string;
|
|
4
|
+
equipmentId: string;
|
|
5
|
+
equipmentName: string | null;
|
|
6
|
+
loadType: string;
|
|
7
|
+
p0: number;
|
|
8
|
+
q0: number;
|
|
9
|
+
voltageLevelId: string;
|
|
10
|
+
busOrBusbarSectionId: string;
|
|
11
|
+
connectionDirection: string | null;
|
|
12
|
+
connectionName?: string | null;
|
|
13
|
+
connectionPosition?: number | null;
|
|
14
|
+
terminalConnected?: boolean | null;
|
|
15
|
+
properties: Property[] | null;
|
|
16
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { InferType } from 'yup';
|
|
2
|
+
import { DeepNullable } from '../../../../utils';
|
|
3
|
+
import { LoadCreationDto } from './loadCreation.types';
|
|
4
|
+
export declare const loadCreationFormSchema: import('yup').ObjectSchema<NonNullable<{
|
|
5
|
+
equipmentID: string;
|
|
6
|
+
equipmentName: string | null | undefined;
|
|
7
|
+
loadType: string | null | undefined;
|
|
8
|
+
activePowerSetpoint: number;
|
|
9
|
+
reactivePowerSetpoint: number;
|
|
10
|
+
connectivity: {
|
|
11
|
+
terminalConnected?: boolean | null | undefined;
|
|
12
|
+
connectionDirection?: string | null | undefined;
|
|
13
|
+
connectionName?: string | undefined;
|
|
14
|
+
connectionPosition?: number | null | undefined;
|
|
15
|
+
busOrBusbarSection: {
|
|
16
|
+
id?: string | undefined;
|
|
17
|
+
} | null;
|
|
18
|
+
voltageLevel: {
|
|
19
|
+
id?: string | undefined;
|
|
20
|
+
} | null;
|
|
21
|
+
};
|
|
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
|
+
equipmentID: undefined;
|
|
32
|
+
equipmentName: undefined;
|
|
33
|
+
loadType: undefined;
|
|
34
|
+
activePowerSetpoint: undefined;
|
|
35
|
+
reactivePowerSetpoint: undefined;
|
|
36
|
+
connectivity: {
|
|
37
|
+
voltageLevel: {
|
|
38
|
+
id: undefined;
|
|
39
|
+
};
|
|
40
|
+
busOrBusbarSection: {
|
|
41
|
+
id: undefined;
|
|
42
|
+
};
|
|
43
|
+
connectionDirection: undefined;
|
|
44
|
+
connectionName: undefined;
|
|
45
|
+
connectionPosition: undefined;
|
|
46
|
+
terminalConnected: undefined;
|
|
47
|
+
};
|
|
48
|
+
AdditionalProperties: "";
|
|
49
|
+
}, "">;
|
|
50
|
+
export type LoadCreationFormData = InferType<typeof loadCreationFormSchema>;
|
|
51
|
+
export declare const loadCreationEmptyFormData: DeepNullable<LoadCreationFormData>;
|
|
52
|
+
export declare const loadCreationDtoToForm: (loadDto: LoadCreationDto) => LoadCreationFormData;
|
|
53
|
+
export declare const loadCreationFormToDto: (loadForm: LoadCreationFormData) => LoadCreationDto;
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { object, number, string } from "yup";
|
|
2
|
+
import { FieldConstants } from "../../../../utils/constants/fieldConstants.js";
|
|
3
|
+
import { YUP_REQUIRED } from "../../../../utils/constants/translationKeys.js";
|
|
4
|
+
import "../../../../utils/conversionUtils.js";
|
|
5
|
+
import { UNDEFINED_CONNECTION_DIRECTION, UNDEFINED_LOAD_TYPE } from "../../../../utils/types/equipmentType.js";
|
|
6
|
+
import { ModificationType } from "../../../../utils/types/modificationType.js";
|
|
7
|
+
import "react/jsx-runtime";
|
|
8
|
+
import "@mui/icons-material";
|
|
9
|
+
import { sanitizeString } from "../../../../utils/ts-utils.js";
|
|
10
|
+
import "../../../../utils/yupConfig.js";
|
|
11
|
+
import { getConnectivityWithPositionSchema, getConnectivityWithPositionEmptyFormDataProps, getConnectivityFormDataProps } from "../../common/connectivity/connectivityForm.utils.js";
|
|
12
|
+
import "@mui/material";
|
|
13
|
+
import "react";
|
|
14
|
+
import "react-hook-form";
|
|
15
|
+
import "react-intl";
|
|
16
|
+
import "../../../overflowableText/OverflowableText.js";
|
|
17
|
+
import "localized-countries";
|
|
18
|
+
import "localized-countries/data/fr";
|
|
19
|
+
import "localized-countries/data/en";
|
|
20
|
+
import "notistack";
|
|
21
|
+
import "../../../inputs/reactHookForm/provider/CustomFormProvider.js";
|
|
22
|
+
import "../../../treeViewFinder/TreeViewFinder.js";
|
|
23
|
+
import "../../../inputs/reactHookForm/agGridTable/BottomRightButtons.js";
|
|
24
|
+
import "../../../customAGGrid/customAggrid.js";
|
|
25
|
+
import "ag-grid-community";
|
|
26
|
+
import "react-papaparse";
|
|
27
|
+
import "react-csv-downloader";
|
|
28
|
+
import "../../../inputs/reactHookForm/numbers/RangeInput.js";
|
|
29
|
+
import "@material-symbols/svg-400/outlined/left_panel_open.svg?react";
|
|
30
|
+
import "@material-symbols/svg-400/outlined/arrows_output.svg?react";
|
|
31
|
+
import "@material-symbols/svg-400/outlined/left_panel_close.svg?react";
|
|
32
|
+
import "@material-symbols/svg-400/outlined/add_notes.svg?react";
|
|
33
|
+
import "../../../dialogs/descriptionModificationDialog/DescriptionModificationDialog.js";
|
|
34
|
+
import "@react-querybuilder/material";
|
|
35
|
+
import "../../../filter/expert/expertFilterConstants.js";
|
|
36
|
+
import "../../../inputs/reactQueryBuilder/CustomReactQueryBuilder.js";
|
|
37
|
+
import "uuid";
|
|
38
|
+
import "../../../inputs/reactQueryBuilder/PropertyValueEditor.js";
|
|
39
|
+
import "react-querybuilder";
|
|
40
|
+
import { creationPropertiesSchema, getFilledPropertiesFromModification, toModificationProperties } from "../../common/properties/propertyUtils.js";
|
|
41
|
+
const loadCreationFormSchema = object().shape({
|
|
42
|
+
[FieldConstants.EQUIPMENT_ID]: string().required(YUP_REQUIRED),
|
|
43
|
+
[FieldConstants.EQUIPMENT_NAME]: string().nullable(),
|
|
44
|
+
[FieldConstants.LOAD_TYPE]: string().nullable(),
|
|
45
|
+
[FieldConstants.ACTIVE_POWER_SET_POINT]: number().nullable().required(YUP_REQUIRED),
|
|
46
|
+
[FieldConstants.REACTIVE_POWER_SET_POINT]: number().nullable().required(YUP_REQUIRED),
|
|
47
|
+
[FieldConstants.CONNECTIVITY]: getConnectivityWithPositionSchema(false)
|
|
48
|
+
}).concat(creationPropertiesSchema).required(YUP_REQUIRED);
|
|
49
|
+
const loadCreationEmptyFormData = {
|
|
50
|
+
equipmentID: "",
|
|
51
|
+
equipmentName: "",
|
|
52
|
+
loadType: null,
|
|
53
|
+
activePowerSetpoint: null,
|
|
54
|
+
reactivePowerSetpoint: null,
|
|
55
|
+
AdditionalProperties: [],
|
|
56
|
+
connectivity: getConnectivityWithPositionEmptyFormDataProps()
|
|
57
|
+
};
|
|
58
|
+
const loadCreationDtoToForm = (loadDto) => {
|
|
59
|
+
return {
|
|
60
|
+
equipmentID: loadDto.equipmentId,
|
|
61
|
+
equipmentName: loadDto.equipmentName ?? "",
|
|
62
|
+
loadType: loadDto.loadType,
|
|
63
|
+
activePowerSetpoint: loadDto.p0,
|
|
64
|
+
reactivePowerSetpoint: loadDto.q0,
|
|
65
|
+
AdditionalProperties: getFilledPropertiesFromModification(loadDto.properties),
|
|
66
|
+
connectivity: getConnectivityFormDataProps({
|
|
67
|
+
voltageLevelId: loadDto.voltageLevelId,
|
|
68
|
+
busbarSectionId: loadDto.busOrBusbarSectionId,
|
|
69
|
+
connectionDirection: loadDto.connectionDirection,
|
|
70
|
+
connectionName: loadDto.connectionName,
|
|
71
|
+
connectionPosition: loadDto.connectionPosition,
|
|
72
|
+
terminalConnected: loadDto.terminalConnected
|
|
73
|
+
})
|
|
74
|
+
};
|
|
75
|
+
};
|
|
76
|
+
const loadCreationFormToDto = (loadForm) => {
|
|
77
|
+
return {
|
|
78
|
+
type: ModificationType.LOAD_CREATION,
|
|
79
|
+
equipmentId: loadForm.equipmentID,
|
|
80
|
+
equipmentName: sanitizeString(loadForm.equipmentName),
|
|
81
|
+
loadType: loadForm.loadType ?? UNDEFINED_LOAD_TYPE,
|
|
82
|
+
p0: loadForm.activePowerSetpoint,
|
|
83
|
+
q0: loadForm.reactivePowerSetpoint,
|
|
84
|
+
voltageLevelId: loadForm.connectivity.voltageLevel?.id ?? "",
|
|
85
|
+
busOrBusbarSectionId: loadForm.connectivity.busOrBusbarSection?.id ?? "",
|
|
86
|
+
connectionDirection: loadForm.connectivity.connectionDirection ?? UNDEFINED_CONNECTION_DIRECTION,
|
|
87
|
+
connectionName: sanitizeString(loadForm.connectivity.connectionName),
|
|
88
|
+
connectionPosition: loadForm.connectivity.connectionPosition,
|
|
89
|
+
terminalConnected: loadForm.connectivity.terminalConnected,
|
|
90
|
+
properties: toModificationProperties(loadForm)
|
|
91
|
+
};
|
|
92
|
+
};
|
|
93
|
+
export {
|
|
94
|
+
loadCreationDtoToForm,
|
|
95
|
+
loadCreationEmptyFormData,
|
|
96
|
+
loadCreationFormSchema,
|
|
97
|
+
loadCreationFormToDto
|
|
98
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
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 './common';
|
|
8
|
+
export * from './creation';
|
|
9
|
+
export * from './modification';
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { LoadDialogTab } from "./common/load.utils.js";
|
|
2
|
+
import { LoadDialogTabs } from "./common/LoadDialogTabs.js";
|
|
3
|
+
import { LoadDialogTabsContent } from "./common/LoadDialogTabsContent.js";
|
|
4
|
+
import { LoadDialogHeader } from "./common/LoadDialogHeader.js";
|
|
5
|
+
import { LoadForm } from "./common/LoadForm.js";
|
|
6
|
+
import { loadCreationDtoToForm, loadCreationEmptyFormData, loadCreationFormSchema, loadCreationFormToDto } from "./creation/loadCreation.utils.js";
|
|
7
|
+
import { loadModificationDtoToForm, loadModificationEmptyFormData, loadModificationFormSchema, loadModificationFormToDto } from "./modification/loadModification.utils.js";
|
|
8
|
+
export {
|
|
9
|
+
LoadDialogHeader,
|
|
10
|
+
LoadDialogTab,
|
|
11
|
+
LoadDialogTabs,
|
|
12
|
+
LoadDialogTabsContent,
|
|
13
|
+
LoadForm,
|
|
14
|
+
loadCreationDtoToForm,
|
|
15
|
+
loadCreationEmptyFormData,
|
|
16
|
+
loadCreationFormSchema,
|
|
17
|
+
loadCreationFormToDto,
|
|
18
|
+
loadModificationDtoToForm,
|
|
19
|
+
loadModificationEmptyFormData,
|
|
20
|
+
loadModificationFormSchema,
|
|
21
|
+
loadModificationFormToDto
|
|
22
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
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 './loadModification.types';
|
|
8
|
+
export * from './loadModification.utils';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { loadModificationDtoToForm, loadModificationEmptyFormData, loadModificationFormSchema, loadModificationFormToDto } from "./loadModification.utils.js";
|
|
2
|
+
export {
|
|
3
|
+
loadModificationDtoToForm,
|
|
4
|
+
loadModificationEmptyFormData,
|
|
5
|
+
loadModificationFormSchema,
|
|
6
|
+
loadModificationFormToDto
|
|
7
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Property } from '../../common';
|
|
2
|
+
import { AttributeModification, ModificationType } from '../../../../utils';
|
|
3
|
+
export interface LoadModificationDto {
|
|
4
|
+
type: ModificationType;
|
|
5
|
+
equipmentId: string;
|
|
6
|
+
equipmentName: AttributeModification<string> | null;
|
|
7
|
+
loadType: AttributeModification<string> | null;
|
|
8
|
+
p0: AttributeModification<number> | null;
|
|
9
|
+
q0: AttributeModification<number> | null;
|
|
10
|
+
voltageLevelId: AttributeModification<string> | null;
|
|
11
|
+
busOrBusbarSectionId: AttributeModification<string> | null;
|
|
12
|
+
connectionDirection: AttributeModification<string> | null;
|
|
13
|
+
connectionName: AttributeModification<string> | null;
|
|
14
|
+
connectionPosition: AttributeModification<number> | null;
|
|
15
|
+
terminalConnected: AttributeModification<boolean> | null;
|
|
16
|
+
pMeasurementValue: AttributeModification<number> | null;
|
|
17
|
+
pMeasurementValidity: AttributeModification<boolean> | null;
|
|
18
|
+
qMeasurementValue: AttributeModification<number> | null;
|
|
19
|
+
qMeasurementValidity: AttributeModification<boolean> | null;
|
|
20
|
+
properties: Property[] | null;
|
|
21
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { InferType } from 'yup';
|
|
2
|
+
import { DeepNullable } from '../../../../utils';
|
|
3
|
+
import { LoadModificationDto } from './loadModification.types';
|
|
4
|
+
export declare const loadModificationFormSchema: import('yup').ObjectSchema<NonNullable<{
|
|
5
|
+
connectivity: {
|
|
6
|
+
terminalConnected?: boolean | null | undefined;
|
|
7
|
+
connectionDirection?: string | null | undefined;
|
|
8
|
+
connectionName?: string | undefined;
|
|
9
|
+
connectionPosition?: number | null | undefined;
|
|
10
|
+
busOrBusbarSection: {
|
|
11
|
+
id?: string | undefined;
|
|
12
|
+
} | null;
|
|
13
|
+
voltageLevel: {
|
|
14
|
+
id?: string | undefined;
|
|
15
|
+
} | null;
|
|
16
|
+
};
|
|
17
|
+
stateEstimation: {
|
|
18
|
+
[x: string]: {
|
|
19
|
+
validity?: boolean | null | undefined;
|
|
20
|
+
value?: number | null | undefined;
|
|
21
|
+
};
|
|
22
|
+
[x: number]: {
|
|
23
|
+
validity?: boolean | null | undefined;
|
|
24
|
+
value?: number | null | undefined;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
reactivePowerSetpoint: number | null | undefined;
|
|
28
|
+
activePowerSetpoint: number | undefined;
|
|
29
|
+
equipmentID: string;
|
|
30
|
+
equipmentName: string | null | undefined;
|
|
31
|
+
loadType: string | null | undefined;
|
|
32
|
+
} & {
|
|
33
|
+
AdditionalProperties: {
|
|
34
|
+
previousValue?: string | null | undefined;
|
|
35
|
+
value?: string | null | undefined;
|
|
36
|
+
added: NonNullable<boolean | undefined>;
|
|
37
|
+
deletionMark: NonNullable<boolean | undefined>;
|
|
38
|
+
name: string;
|
|
39
|
+
}[] | undefined;
|
|
40
|
+
}>, import('yup').AnyObject, {
|
|
41
|
+
connectivity: {
|
|
42
|
+
voltageLevel: {
|
|
43
|
+
id: undefined;
|
|
44
|
+
};
|
|
45
|
+
busOrBusbarSection: {
|
|
46
|
+
id: undefined;
|
|
47
|
+
};
|
|
48
|
+
connectionDirection: undefined;
|
|
49
|
+
connectionName: undefined;
|
|
50
|
+
connectionPosition: undefined;
|
|
51
|
+
terminalConnected: undefined;
|
|
52
|
+
};
|
|
53
|
+
stateEstimation: {
|
|
54
|
+
[x: string]: {
|
|
55
|
+
value: undefined;
|
|
56
|
+
validity: undefined;
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
reactivePowerSetpoint: undefined;
|
|
60
|
+
activePowerSetpoint: undefined;
|
|
61
|
+
equipmentID: undefined;
|
|
62
|
+
equipmentName: undefined;
|
|
63
|
+
loadType: undefined;
|
|
64
|
+
AdditionalProperties: "";
|
|
65
|
+
}, "">;
|
|
66
|
+
export type LoadModificationFormData = InferType<typeof loadModificationFormSchema>;
|
|
67
|
+
export declare const loadModificationEmptyFormData: DeepNullable<LoadModificationFormData>;
|
|
68
|
+
export declare const loadModificationDtoToForm: (loadDto: LoadModificationDto, includePreviousValues?: boolean) => LoadModificationFormData;
|
|
69
|
+
export declare const loadModificationFormToDto: (loadForm: LoadModificationFormData) => LoadModificationDto;
|