@gridsuite/commons-ui 0.266.0 → 0.268.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/composite/grid/grid-section.d.ts +5 -2
- package/dist/components/composite/grid/grid-section.js +56 -4
- package/dist/components/ui/inputs/checkbox-autocomplete/checkbox-autocomplete.js +2 -1
- package/dist/components/ui/reactHookForm/CheckboxNullableInput.js +4 -2
- package/dist/components/ui/reactHookForm/autocompleteInputs/MultipleAutocompleteInput.js +3 -2
- package/dist/components/ui/reactHookForm/booleans/BooleanInput.d.ts +1 -1
- package/dist/components/ui/reactHookForm/booleans/BooleanInput.js +5 -7
- package/dist/components/ui/reactHookForm/tableInputs/table-numerical-input.js +4 -2
- package/dist/components/ui/reactHookForm/tableInputs/table-text-input.d.ts +1 -1
- package/dist/components/ui/reactHookForm/tableInputs/table-text-input.js +2 -3
- package/dist/components/ui/reactHookForm/text/ExpandingTextField.js +15 -13
- package/dist/components/ui/reactHookForm/text/TextInput.js +4 -2
- package/dist/components/ui/reactHookForm/text/UniqueNameInput.js +4 -2
- package/dist/components/ui/reactHookForm/utils/TextFieldWithAdornment.js +2 -1
- package/dist/features/common/index.d.ts +7 -0
- package/dist/features/common/index.js +4 -0
- package/dist/features/common/renderTable-ExportCsv.d.ts +18 -0
- package/dist/features/common/renderTable-ExportCsv.js +136 -0
- package/dist/features/index.d.ts +5 -0
- package/dist/features/index.js +50 -2
- package/dist/features/network-modifications/common/connectivity/connectivity.type.d.ts +1 -1
- package/dist/features/network-modifications/index.d.ts +1 -0
- package/dist/features/network-modifications/index.js +40 -1
- package/dist/features/network-modifications/static-var-compensator/common/constants.d.ts +20 -0
- package/dist/features/network-modifications/static-var-compensator/common/constants.js +9 -0
- package/dist/features/network-modifications/static-var-compensator/common/index.d.ts +13 -0
- package/dist/features/network-modifications/static-var-compensator/common/index.js +20 -0
- package/dist/features/network-modifications/static-var-compensator/common/set-points-limits-form-utils.d.ts +91 -0
- package/dist/features/network-modifications/static-var-compensator/common/set-points-limits-form-utils.js +166 -0
- package/dist/features/network-modifications/static-var-compensator/common/set-points-limits-form.d.ts +8 -0
- package/dist/features/network-modifications/static-var-compensator/common/set-points-limits-form.js +200 -0
- package/dist/features/network-modifications/static-var-compensator/common/standby-automaton-form-utils.d.ts +66 -0
- package/dist/features/network-modifications/static-var-compensator/common/standby-automaton-form-utils.js +149 -0
- package/dist/features/network-modifications/static-var-compensator/common/standby-automaton-form.d.ts +7 -0
- package/dist/features/network-modifications/static-var-compensator/common/standby-automaton-form.js +153 -0
- package/dist/features/network-modifications/static-var-compensator/common/static-var-compensator-dialog-header.d.ts +7 -0
- package/dist/features/network-modifications/static-var-compensator/common/static-var-compensator-dialog-header.js +72 -0
- package/dist/features/network-modifications/static-var-compensator/common/static-var-compensator-dialog-tabs.d.ts +7 -0
- package/dist/features/network-modifications/static-var-compensator/common/static-var-compensator-dialog-tabs.js +44 -0
- package/dist/features/network-modifications/static-var-compensator/common/static-var-compensator-tab-utils.d.ts +8 -0
- package/dist/features/network-modifications/static-var-compensator/common/static-var-compensator-tab-utils.js +34 -0
- package/dist/features/network-modifications/static-var-compensator/common/static-var-compensator-tabs-content.d.ts +9 -0
- package/dist/features/network-modifications/static-var-compensator/common/static-var-compensator-tabs-content.js +100 -0
- package/dist/features/network-modifications/static-var-compensator/common/static-var-compensator.types.d.ts +68 -0
- package/dist/features/network-modifications/static-var-compensator/common/static-var-compensator.types.js +1 -0
- package/dist/features/network-modifications/static-var-compensator/common/susceptance-area.d.ts +7 -0
- package/dist/features/network-modifications/static-var-compensator/common/susceptance-area.js +161 -0
- package/dist/features/network-modifications/static-var-compensator/creation/index.d.ts +9 -0
- package/dist/features/network-modifications/static-var-compensator/creation/index.js +9 -0
- package/dist/features/network-modifications/static-var-compensator/creation/static-var-compensator-creation-form.d.ts +8 -0
- package/dist/features/network-modifications/static-var-compensator/creation/static-var-compensator-creation-form.js +105 -0
- package/dist/features/network-modifications/static-var-compensator/creation/static-var-compensator-creation-utils.d.ts +114 -0
- package/dist/features/network-modifications/static-var-compensator/creation/static-var-compensator-creation-utils.js +189 -0
- package/dist/features/network-modifications/static-var-compensator/creation/static-var-compensator-creation.types.d.ts +34 -0
- package/dist/features/network-modifications/static-var-compensator/creation/static-var-compensator-creation.types.js +1 -0
- package/dist/features/network-modifications/static-var-compensator/index.d.ts +8 -0
- package/dist/features/network-modifications/static-var-compensator/index.js +27 -0
- package/dist/features/network-modifications/voltageLevel/coupling-device/coupling-device-creation-form.d.ts +8 -0
- package/dist/features/network-modifications/voltageLevel/coupling-device/coupling-device-creation-form.js +153 -0
- package/dist/features/network-modifications/voltageLevel/coupling-device/coupling-device-creation-utils.d.ts +20 -0
- package/dist/features/network-modifications/voltageLevel/coupling-device/coupling-device-creation-utils.js +40 -0
- package/dist/features/network-modifications/voltageLevel/coupling-device/coupling-device-creation.types.d.ts +11 -0
- package/dist/features/network-modifications/voltageLevel/coupling-device/coupling-device-creation.types.js +1 -0
- package/dist/features/network-modifications/voltageLevel/coupling-device/index.d.ts +3 -0
- package/dist/features/network-modifications/voltageLevel/coupling-device/index.js +9 -0
- package/dist/features/network-modifications/voltageLevel/creation/index.js +1 -1
- package/dist/features/network-modifications/voltageLevel/index.d.ts +2 -0
- package/dist/features/network-modifications/voltageLevel/index.js +15 -1
- package/dist/features/network-modifications/voltageLevel/topology/CreateVoltageLevelTopologyForm.d.ts +6 -0
- package/dist/features/network-modifications/voltageLevel/topology/CreateVoltageLevelTopologyForm.js +145 -0
- package/dist/features/network-modifications/voltageLevel/topology/index.d.ts +9 -0
- package/dist/features/network-modifications/voltageLevel/topology/index.js +9 -0
- package/dist/features/network-modifications/voltageLevel/topology/voltageLevelTopologyCreation.types.d.ts +8 -0
- package/dist/features/network-modifications/voltageLevel/topology/voltageLevelTopologyCreation.types.js +1 -0
- package/dist/features/network-modifications/voltageLevel/topology/voltageLevelTopologyCreation.utils.d.ts +25 -0
- package/dist/features/network-modifications/voltageLevel/topology/voltageLevelTopologyCreation.utils.js +48 -0
- package/dist/features/results/constants.d.ts +7 -0
- package/dist/features/results/constants.js +4 -0
- package/dist/features/results/hooks/index.d.ts +7 -0
- package/dist/features/results/hooks/index.js +4 -0
- package/dist/features/results/hooks/useIntlResultStatusMessages.d.ts +19 -0
- package/dist/features/results/hooks/useIntlResultStatusMessages.js +23 -0
- package/dist/features/results/loadflow/index.d.ts +8 -0
- package/dist/features/results/loadflow/index.js +4 -0
- package/dist/features/results/loadflow/limit-violation-result.d.ts +2 -0
- package/dist/features/results/loadflow/limit-violation-result.js +134 -0
- package/dist/features/results/loadflow/load-flow-result.type.d.ts +29 -0
- package/dist/features/results/loadflow/load-flow-result.type.js +1 -0
- package/dist/features/results/securityanalysis/index.js +1 -2
- package/dist/features/results/securityanalysis/security-analysis-result-nmk.js +2 -1
- package/dist/features/results/securityanalysis/utils.d.ts +0 -2
- package/dist/features/results/securityanalysis/utils.js +0 -22
- package/dist/features/results/utils/index.d.ts +7 -0
- package/dist/features/results/utils/index.js +4 -0
- package/dist/features/results/utils/no-rows-message.d.ts +2 -0
- package/dist/features/results/utils/no-rows-message.js +24 -0
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/index.js +2 -0
- package/dist/hooks/useOpenLoaderShortWait.d.ts +18 -0
- package/dist/hooks/useOpenLoaderShortWait.js +19 -0
- package/dist/index.js +53 -1
- package/dist/translations/en/networkModificationsEn.d.ts +35 -0
- package/dist/translations/en/networkModificationsEn.js +38 -1
- package/dist/translations/fr/networkModificationsFr.d.ts +35 -0
- package/dist/translations/fr/networkModificationsFr.js +38 -1
- package/dist/utils/constants/fieldConstants.d.ts +28 -1
- package/dist/utils/constants/fieldConstants.js +27 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.js +2 -0
- package/package.json +1 -1
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { StaticVarCompensatorDialogHeader } from "./common/static-var-compensator-dialog-header.js";
|
|
2
|
+
import { StaticVarCompensatorDialogTabs } from "./common/static-var-compensator-dialog-tabs.js";
|
|
3
|
+
import { STATIC_VAR_COMPENSATOR_TAB_FIELDS, StaticVarCompensatorDialogTab } from "./common/static-var-compensator-tab-utils.js";
|
|
4
|
+
import { VOLTAGE_REGULATION_MODES } from "./common/constants.js";
|
|
5
|
+
import { getReactiveFormData, getReactiveFormEmptyFormData, getReactiveFormValidationSchema } from "./common/set-points-limits-form-utils.js";
|
|
6
|
+
import { computeQ0, getStandbyAutomatonEmptyFormData, getStandbyAutomatonFormData, getStandbyAutomatonFormValidationSchema } from "./common/standby-automaton-form-utils.js";
|
|
7
|
+
import { StaticVarCompensatorCreationForm } from "./creation/static-var-compensator-creation-form.js";
|
|
8
|
+
import { staticVarCompensatorCreationEmptyFormData, staticVarCompensatorCreationFormSchema, staticVarCompensatorCreationFormToDto, staticVarCompensatorDtoToForm } from "./creation/static-var-compensator-creation-utils.js";
|
|
9
|
+
export {
|
|
10
|
+
STATIC_VAR_COMPENSATOR_TAB_FIELDS,
|
|
11
|
+
StaticVarCompensatorCreationForm,
|
|
12
|
+
StaticVarCompensatorDialogHeader,
|
|
13
|
+
StaticVarCompensatorDialogTab,
|
|
14
|
+
StaticVarCompensatorDialogTabs,
|
|
15
|
+
VOLTAGE_REGULATION_MODES,
|
|
16
|
+
computeQ0,
|
|
17
|
+
getReactiveFormData,
|
|
18
|
+
getReactiveFormEmptyFormData,
|
|
19
|
+
getReactiveFormValidationSchema,
|
|
20
|
+
getStandbyAutomatonEmptyFormData,
|
|
21
|
+
getStandbyAutomatonFormData,
|
|
22
|
+
getStandbyAutomatonFormValidationSchema,
|
|
23
|
+
staticVarCompensatorCreationEmptyFormData,
|
|
24
|
+
staticVarCompensatorCreationFormSchema,
|
|
25
|
+
staticVarCompensatorCreationFormToDto,
|
|
26
|
+
staticVarCompensatorDtoToForm
|
|
27
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Option } from '../../../../utils';
|
|
2
|
+
import { PositionDiagramPaneType } from '../../common';
|
|
3
|
+
export interface CouplingDeviceCreationFormProps {
|
|
4
|
+
sectionOptions: Option[];
|
|
5
|
+
canOpenPositionDiagramPane?: boolean;
|
|
6
|
+
PositionDiagramPane?: PositionDiagramPaneType;
|
|
7
|
+
}
|
|
8
|
+
export declare function CouplingDeviceCreationForm({ sectionOptions, canOpenPositionDiagramPane, PositionDiagramPane, }: Readonly<CouplingDeviceCreationFormProps>): import("react").JSX.Element;
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { TextField, Grid, Button, Box } from "@mui/material";
|
|
3
|
+
import { useIntl, FormattedMessage } from "react-intl";
|
|
4
|
+
import { useWatch } from "react-hook-form";
|
|
5
|
+
import { useState } from "react";
|
|
6
|
+
import { InfoOutlined } from "@mui/icons-material";
|
|
7
|
+
import "../../../../components/ui/overflowableText/OverflowableText.js";
|
|
8
|
+
import { FieldConstants } from "../../../../utils/constants/fieldConstants.js";
|
|
9
|
+
import "../../../../utils/conversionUtils.js";
|
|
10
|
+
import "../../../../utils/types/equipmentType.js";
|
|
11
|
+
import { getObjectId } from "../../../../utils/ts-utils.js";
|
|
12
|
+
import "localized-countries";
|
|
13
|
+
import "localized-countries/data/fr";
|
|
14
|
+
import "localized-countries/data/en";
|
|
15
|
+
import "notistack";
|
|
16
|
+
import "../../../../components/ui/reactHookForm/provider/CustomFormProvider.js";
|
|
17
|
+
import "yup";
|
|
18
|
+
import { CustomTooltip } from "../../../../components/ui/tooltip/CustomTooltip.js";
|
|
19
|
+
import "../../../../components/ui/treeViewFinder/TreeViewFinder.js";
|
|
20
|
+
import { AutocompleteInput } from "../../../../components/ui/reactHookForm/autocompleteInputs/AutocompleteInput.js";
|
|
21
|
+
import "../../../../components/ui/reactHookForm/numbers/RangeInput.js";
|
|
22
|
+
import "@material-symbols/svg-400/outlined/left_panel_open.svg?react";
|
|
23
|
+
import "@material-symbols/svg-400/outlined/arrows_output.svg?react";
|
|
24
|
+
import "@material-symbols/svg-400/outlined/arrows_input.svg?react";
|
|
25
|
+
import "@material-symbols/svg-400/outlined/left_panel_close.svg?react";
|
|
26
|
+
import "@material-symbols/svg-400/outlined/add_notes-fill.svg?react";
|
|
27
|
+
import "../../../../components/ui/dialogs/descriptionModificationDialog/DescriptionModificationDialog.js";
|
|
28
|
+
import "../../../../components/ui/reactHookForm/expandableInput/ExpandableInput.js";
|
|
29
|
+
import "../../../../components/ui/reactHookForm/directory-item-input/directory-item-utils.js";
|
|
30
|
+
import "@hello-pangea/dnd";
|
|
31
|
+
import "../../../../components/ui/dialogs/elementSaveDialog/ElementSaveDialog.js";
|
|
32
|
+
import "../../../../components/ui/snackbarProvider/SnackbarProvider.js";
|
|
33
|
+
import "mui-nested-menu";
|
|
34
|
+
import "react-resizable-panels";
|
|
35
|
+
import "react-papaparse";
|
|
36
|
+
import "react-dom";
|
|
37
|
+
import "autosuggest-highlight/match";
|
|
38
|
+
import "autosuggest-highlight/parse";
|
|
39
|
+
import "clsx";
|
|
40
|
+
import "../../../../components/composite/filter/FilterCreationDialog.js";
|
|
41
|
+
import "../../../../components/composite/filter/HeaderFilterForm.js";
|
|
42
|
+
import "../../../../components/composite/filter/explicitNaming/ExplicitNamingFilterForm.js";
|
|
43
|
+
import "../../../../components/composite/filter/expert/ExpertFilterForm.js";
|
|
44
|
+
import "../../../../components/composite/filter/expert/ExpertFilterEditionDialog.js";
|
|
45
|
+
import "../../../../components/composite/filter/expert/expertFilterConstants.js";
|
|
46
|
+
import "react-querybuilder";
|
|
47
|
+
import "uuid";
|
|
48
|
+
import "../../../../components/composite/filter/explicitNaming/ExplicitNamingFilterEditionDialog.js";
|
|
49
|
+
import "../../../../components/composite/filter/utils/filterFormUtils.js";
|
|
50
|
+
import { GridItem } from "../../../../components/composite/grid/grid-item.js";
|
|
51
|
+
import { GridSection } from "../../../../components/composite/grid/grid-section.js";
|
|
52
|
+
import "@react-querybuilder/material";
|
|
53
|
+
import "../../../../components/composite/reactQueryBuilder/CustomReactQueryBuilder.js";
|
|
54
|
+
import "../../../../components/composite/reactQueryBuilder/PropertyValueEditor.js";
|
|
55
|
+
import "../../../../components/composite/agGridTable/BottomTableButtons.js";
|
|
56
|
+
import "../../../../components/composite/agGridTable/CustomAgGridTable.js";
|
|
57
|
+
import "ag-grid-community";
|
|
58
|
+
import "../../../../components/composite/customAGGrid/customAggrid.js";
|
|
59
|
+
import "../../../../components/composite/customAGGrid/context/custom-aggrid-context.js";
|
|
60
|
+
import "mathjs";
|
|
61
|
+
import "../../../../components/composite/report/report-viewer/log-table/log-table.js";
|
|
62
|
+
import "react-window";
|
|
63
|
+
import "../../../../components/composite/report/report-treeview/treeview-item.js";
|
|
64
|
+
import "../../../../components/composite/report/report-viewer/context/report-viewer-context.js";
|
|
65
|
+
import { filledTextField } from "../../common/form.utils.js";
|
|
66
|
+
import "../../common/properties/propertyUtils.js";
|
|
67
|
+
import "../../common/regulatingTerminal/RegulatingTerminalForm.js";
|
|
68
|
+
import "@mui/material/colors";
|
|
69
|
+
import "@mui/x-charts";
|
|
70
|
+
import "../../common/currentLimits/limitsPane.utils.js";
|
|
71
|
+
function CouplingDeviceCreationForm({
|
|
72
|
+
sectionOptions,
|
|
73
|
+
canOpenPositionDiagramPane,
|
|
74
|
+
PositionDiagramPane
|
|
75
|
+
}) {
|
|
76
|
+
const intl = useIntl();
|
|
77
|
+
const equipmentId = useWatch({ name: FieldConstants.EQUIPMENT_ID });
|
|
78
|
+
const [isDiagramPaneOpen, setIsDiagramPaneOpen] = useState(false);
|
|
79
|
+
const canOpenDiagram = Boolean(PositionDiagramPane && canOpenPositionDiagramPane);
|
|
80
|
+
const voltageLevelIdField = /* @__PURE__ */ jsx(
|
|
81
|
+
TextField,
|
|
82
|
+
{
|
|
83
|
+
size: "small",
|
|
84
|
+
fullWidth: true,
|
|
85
|
+
label: intl.formatMessage({ id: "VoltageLevelId" }),
|
|
86
|
+
value: equipmentId ?? "",
|
|
87
|
+
slotProps: {
|
|
88
|
+
input: { readOnly: true }
|
|
89
|
+
},
|
|
90
|
+
disabled: true,
|
|
91
|
+
...filledTextField
|
|
92
|
+
}
|
|
93
|
+
);
|
|
94
|
+
const busBarSectionId1Field = /* @__PURE__ */ jsx(
|
|
95
|
+
AutocompleteInput,
|
|
96
|
+
{
|
|
97
|
+
allowNewValue: true,
|
|
98
|
+
forcePopupIcon: !!sectionOptions,
|
|
99
|
+
name: `${FieldConstants.BUS_BAR_SECTION_ID1}`,
|
|
100
|
+
label: "BusBarSectionID1",
|
|
101
|
+
options: sectionOptions ?? [],
|
|
102
|
+
getOptionLabel: getObjectId,
|
|
103
|
+
size: "small",
|
|
104
|
+
sx: { paddingTop: 2, paddingRight: 1 }
|
|
105
|
+
}
|
|
106
|
+
);
|
|
107
|
+
const busBarSectionId2Field = /* @__PURE__ */ jsx(
|
|
108
|
+
AutocompleteInput,
|
|
109
|
+
{
|
|
110
|
+
allowNewValue: true,
|
|
111
|
+
forcePopupIcon: !!sectionOptions,
|
|
112
|
+
name: `${FieldConstants.BUS_BAR_SECTION_ID2}`,
|
|
113
|
+
label: "BusBarSectionID2",
|
|
114
|
+
options: sectionOptions ?? [],
|
|
115
|
+
getOptionLabel: getObjectId,
|
|
116
|
+
size: "small",
|
|
117
|
+
sx: { paddingTop: 2, paddingRight: 4 }
|
|
118
|
+
}
|
|
119
|
+
);
|
|
120
|
+
const diagramToolTip = canOpenDiagram ? /* @__PURE__ */ jsx(CustomTooltip, { sx: { paddingLeft: 1 }, title: intl.formatMessage({ id: "builtNodeTooltipForDiagram" }), children: /* @__PURE__ */ jsx(InfoOutlined, { color: "info", fontSize: "medium" }) }) : null;
|
|
121
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
122
|
+
/* @__PURE__ */ jsxs(Grid, { container: true, spacing: 2, children: [
|
|
123
|
+
/* @__PURE__ */ jsx(GridItem, { size: 4, children: voltageLevelIdField }),
|
|
124
|
+
canOpenDiagram && /* @__PURE__ */ jsx(GridItem, { size: 3, children: /* @__PURE__ */ jsxs(Grid, { sx: { paddingTop: 1 }, children: [
|
|
125
|
+
/* @__PURE__ */ jsx(Button, { onClick: () => setIsDiagramPaneOpen(true), variant: "outlined", children: /* @__PURE__ */ jsx(FormattedMessage, { id: "CreateCouplingDeviceDiagramButton" }) }),
|
|
126
|
+
diagramToolTip
|
|
127
|
+
] }) })
|
|
128
|
+
] }),
|
|
129
|
+
/* @__PURE__ */ jsx(
|
|
130
|
+
GridSection,
|
|
131
|
+
{
|
|
132
|
+
title: "CouplingDeviceText",
|
|
133
|
+
tooltipEnabled: true,
|
|
134
|
+
tooltipMessage: "CouplingDeviceBusBarSectionToolTipText"
|
|
135
|
+
}
|
|
136
|
+
),
|
|
137
|
+
/* @__PURE__ */ jsxs(Grid, { container: true, children: [
|
|
138
|
+
/* @__PURE__ */ jsx(GridItem, { size: 4, children: busBarSectionId1Field }),
|
|
139
|
+
/* @__PURE__ */ jsx(GridItem, { size: 4, children: busBarSectionId2Field })
|
|
140
|
+
] }),
|
|
141
|
+
PositionDiagramPane && /* @__PURE__ */ jsx(Box, { children: /* @__PURE__ */ jsx(
|
|
142
|
+
PositionDiagramPane,
|
|
143
|
+
{
|
|
144
|
+
open: isDiagramPaneOpen,
|
|
145
|
+
onClose: () => setIsDiagramPaneOpen(false),
|
|
146
|
+
voltageLevelId: equipmentId
|
|
147
|
+
}
|
|
148
|
+
) })
|
|
149
|
+
] });
|
|
150
|
+
}
|
|
151
|
+
export {
|
|
152
|
+
CouplingDeviceCreationForm
|
|
153
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { InferType } from 'yup';
|
|
2
|
+
import { CouplingDeviceCreationDto } from './coupling-device-creation.types';
|
|
3
|
+
import * as yup from 'yup';
|
|
4
|
+
export declare const emptyCouplingDeviceCreationFormData: {
|
|
5
|
+
equipmentID: null;
|
|
6
|
+
busbarSectionId1: null;
|
|
7
|
+
busbarSectionId2: null;
|
|
8
|
+
};
|
|
9
|
+
export declare const couplingDeviceCreationFormSchema: yup.ObjectSchema<{
|
|
10
|
+
equipmentID: string;
|
|
11
|
+
busbarSectionId1: string;
|
|
12
|
+
busbarSectionId2: string;
|
|
13
|
+
}, yup.AnyObject, {
|
|
14
|
+
equipmentID: undefined;
|
|
15
|
+
busbarSectionId1: undefined;
|
|
16
|
+
busbarSectionId2: undefined;
|
|
17
|
+
}, "">;
|
|
18
|
+
export type CouplingDeviceCreationFormData = InferType<typeof couplingDeviceCreationFormSchema>;
|
|
19
|
+
export declare const couplingDeviceCreationDtoToForm: (couplingDeviceCreation: CouplingDeviceCreationDto) => CouplingDeviceCreationFormData;
|
|
20
|
+
export declare const couplingDeviceCreationFormToDto: (couplingDeviceCreation: CouplingDeviceCreationFormData) => CouplingDeviceCreationDto;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import * as yup from "yup";
|
|
2
|
+
import { FieldConstants } from "../../../../utils/constants/fieldConstants.js";
|
|
3
|
+
import "../../../../utils/conversionUtils.js";
|
|
4
|
+
import "../../../../utils/types/equipmentType.js";
|
|
5
|
+
import { ModificationType } from "../../../../utils/types/modificationType.js";
|
|
6
|
+
import "react/jsx-runtime";
|
|
7
|
+
import "@mui/icons-material";
|
|
8
|
+
const emptyCouplingDeviceCreationFormData = {
|
|
9
|
+
[FieldConstants.EQUIPMENT_ID]: null,
|
|
10
|
+
[FieldConstants.BUS_BAR_SECTION_ID1]: null,
|
|
11
|
+
[FieldConstants.BUS_BAR_SECTION_ID2]: null
|
|
12
|
+
};
|
|
13
|
+
const couplingDeviceCreationFormSchema = yup.object().shape({
|
|
14
|
+
[FieldConstants.EQUIPMENT_ID]: yup.string().required(),
|
|
15
|
+
[FieldConstants.BUS_BAR_SECTION_ID1]: yup.string().nullable().required(),
|
|
16
|
+
[FieldConstants.BUS_BAR_SECTION_ID2]: yup.string().nullable().required().notOneOf([yup.ref(FieldConstants.BUS_BAR_SECTION_ID1), null], "CreateCouplingDeviceIdenticalBusBar")
|
|
17
|
+
});
|
|
18
|
+
const couplingDeviceCreationDtoToForm = (couplingDeviceCreation) => {
|
|
19
|
+
return {
|
|
20
|
+
[FieldConstants.EQUIPMENT_ID]: couplingDeviceCreation.voltageLevelId,
|
|
21
|
+
[FieldConstants.BUS_BAR_SECTION_ID1]: couplingDeviceCreation.couplingDeviceInfos.busbarSectionId1,
|
|
22
|
+
[FieldConstants.BUS_BAR_SECTION_ID2]: couplingDeviceCreation.couplingDeviceInfos.busbarSectionId2
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
const couplingDeviceCreationFormToDto = (couplingDeviceCreation) => {
|
|
26
|
+
return {
|
|
27
|
+
type: ModificationType.CREATE_COUPLING_DEVICE,
|
|
28
|
+
voltageLevelId: couplingDeviceCreation[FieldConstants.EQUIPMENT_ID],
|
|
29
|
+
couplingDeviceInfos: {
|
|
30
|
+
busbarSectionId1: couplingDeviceCreation[FieldConstants.BUS_BAR_SECTION_ID1],
|
|
31
|
+
busbarSectionId2: couplingDeviceCreation[FieldConstants.BUS_BAR_SECTION_ID2]
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
export {
|
|
36
|
+
couplingDeviceCreationDtoToForm,
|
|
37
|
+
couplingDeviceCreationFormSchema,
|
|
38
|
+
couplingDeviceCreationFormToDto,
|
|
39
|
+
emptyCouplingDeviceCreationFormData
|
|
40
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { UUID } from 'node:crypto';
|
|
2
|
+
import { ModificationType } from '../../../../utils';
|
|
3
|
+
export interface CouplingDeviceCreationDto {
|
|
4
|
+
type: ModificationType.CREATE_COUPLING_DEVICE;
|
|
5
|
+
uuid?: UUID;
|
|
6
|
+
voltageLevelId: string;
|
|
7
|
+
couplingDeviceInfos: {
|
|
8
|
+
busbarSectionId1: string;
|
|
9
|
+
busbarSectionId2: string;
|
|
10
|
+
};
|
|
11
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { CouplingDeviceCreationForm } from "./coupling-device-creation-form.js";
|
|
2
|
+
import { couplingDeviceCreationDtoToForm, couplingDeviceCreationFormSchema, couplingDeviceCreationFormToDto, emptyCouplingDeviceCreationFormData } from "./coupling-device-creation-utils.js";
|
|
3
|
+
export {
|
|
4
|
+
CouplingDeviceCreationForm,
|
|
5
|
+
couplingDeviceCreationDtoToForm,
|
|
6
|
+
couplingDeviceCreationFormSchema,
|
|
7
|
+
couplingDeviceCreationFormToDto,
|
|
8
|
+
emptyCouplingDeviceCreationFormData
|
|
9
|
+
};
|
|
@@ -5,9 +5,9 @@ import "react";
|
|
|
5
5
|
import "react-hook-form";
|
|
6
6
|
import "react-intl";
|
|
7
7
|
import "@mui/icons-material";
|
|
8
|
-
import "../../../../components/ui/overflowableText/OverflowableText.js";
|
|
9
8
|
import "../../../../utils/conversionUtils.js";
|
|
10
9
|
import "../../../../utils/types/equipmentType.js";
|
|
10
|
+
import "../../../../components/ui/overflowableText/OverflowableText.js";
|
|
11
11
|
import "localized-countries";
|
|
12
12
|
import "localized-countries/data/fr";
|
|
13
13
|
import "localized-countries/data/en";
|
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
5
5
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
6
6
|
*/
|
|
7
|
+
export * from './coupling-device';
|
|
7
8
|
export * from './creation';
|
|
8
9
|
export * from './voltage-level.type';
|
|
9
10
|
export * from './modification';
|
|
11
|
+
export * from './topology';
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { CouplingDeviceCreationForm } from "./coupling-device/coupling-device-creation-form.js";
|
|
2
|
+
import { couplingDeviceCreationDtoToForm, couplingDeviceCreationFormSchema, couplingDeviceCreationFormToDto, emptyCouplingDeviceCreationFormData } from "./coupling-device/coupling-device-creation-utils.js";
|
|
1
3
|
import { SwitchesBetweenSections } from "./creation/tabs/structureTab/switchesBetweenSections/SwitchesBetweenSections.js";
|
|
2
4
|
import "react/jsx-runtime";
|
|
3
5
|
import "@mui/material";
|
|
@@ -5,9 +7,9 @@ import "react";
|
|
|
5
7
|
import "react-hook-form";
|
|
6
8
|
import "react-intl";
|
|
7
9
|
import "@mui/icons-material";
|
|
8
|
-
import "../../../components/ui/overflowableText/OverflowableText.js";
|
|
9
10
|
import "../../../utils/conversionUtils.js";
|
|
10
11
|
import "../../../utils/types/equipmentType.js";
|
|
12
|
+
import "../../../components/ui/overflowableText/OverflowableText.js";
|
|
11
13
|
import "localized-countries";
|
|
12
14
|
import "localized-countries/data/fr";
|
|
13
15
|
import "localized-countries/data/en";
|
|
@@ -68,7 +70,11 @@ import { SWITCH_TYPE, buildNewBusbarSections, getCreateSwitchesEmptyFormData, ge
|
|
|
68
70
|
import { SwitchKind } from "./creation/voltageLevelCreation.types.js";
|
|
69
71
|
import { VoltageLevelModificationForm } from "./modification/VoltageLevelModificationForm.js";
|
|
70
72
|
import { voltageLevelModificationDtoToForm, voltageLevelModificationEmptyFormData, voltageLevelModificationFormSchema, voltageLevelModificationFormToDto, voltageLevelModificationWithMeasurementsDtoToForm, voltageLevelModificationWithMeasurementsFormSchema, voltageLevelModificationWithMeasurementsFormToDto } from "./modification/voltageLevelModification.utils.js";
|
|
73
|
+
import { createVoltageLevelTopologyDtoToForm, createVoltageLevelTopologyEmptyFormData, createVoltageLevelTopologyFormSchema, createVoltageLevelTopologyFormToDto } from "./topology/voltageLevelTopologyCreation.utils.js";
|
|
74
|
+
import { CreateVoltageLevelTopologyForm } from "./topology/CreateVoltageLevelTopologyForm.js";
|
|
71
75
|
export {
|
|
76
|
+
CouplingDeviceCreationForm,
|
|
77
|
+
CreateVoltageLevelTopologyForm,
|
|
72
78
|
MAX_SECTIONS_COUNT,
|
|
73
79
|
SWITCH_TYPE,
|
|
74
80
|
SwitchKind,
|
|
@@ -76,6 +82,14 @@ export {
|
|
|
76
82
|
VoltageLevelCreationForm,
|
|
77
83
|
VoltageLevelModificationForm,
|
|
78
84
|
buildNewBusbarSections,
|
|
85
|
+
couplingDeviceCreationDtoToForm,
|
|
86
|
+
couplingDeviceCreationFormSchema,
|
|
87
|
+
couplingDeviceCreationFormToDto,
|
|
88
|
+
createVoltageLevelTopologyDtoToForm,
|
|
89
|
+
createVoltageLevelTopologyEmptyFormData,
|
|
90
|
+
createVoltageLevelTopologyFormSchema,
|
|
91
|
+
createVoltageLevelTopologyFormToDto,
|
|
92
|
+
emptyCouplingDeviceCreationFormData,
|
|
79
93
|
getCreateSwitchesEmptyFormData,
|
|
80
94
|
getCreateSwitchesValidationSchema,
|
|
81
95
|
translateSwitchKinds,
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { PositionDiagramPaneType } from '../../common';
|
|
2
|
+
export interface CreateVoltageLevelTopologyFormProps {
|
|
3
|
+
voltageLevelId: string;
|
|
4
|
+
PositionDiagramPane?: PositionDiagramPaneType;
|
|
5
|
+
}
|
|
6
|
+
export declare function CreateVoltageLevelTopologyForm({ voltageLevelId, PositionDiagramPane, }: Readonly<CreateVoltageLevelTopologyFormProps>): import("react").JSX.Element;
|
package/dist/features/network-modifications/voltageLevel/topology/CreateVoltageLevelTopologyForm.js
ADDED
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useState, useRef, useEffect, useMemo } from "react";
|
|
3
|
+
import { TextField, Stack, Grid, Button, Tooltip, Box } from "@mui/material";
|
|
4
|
+
import { useIntl, FormattedMessage } from "react-intl";
|
|
5
|
+
import { InfoOutlined } from "@mui/icons-material";
|
|
6
|
+
import { useFormContext, useWatch } from "react-hook-form";
|
|
7
|
+
import "../../../../components/ui/overflowableText/OverflowableText.js";
|
|
8
|
+
import { FieldConstants } from "../../../../utils/constants/fieldConstants.js";
|
|
9
|
+
import "../../../../utils/conversionUtils.js";
|
|
10
|
+
import "../../../../utils/types/equipmentType.js";
|
|
11
|
+
import "localized-countries";
|
|
12
|
+
import "localized-countries/data/fr";
|
|
13
|
+
import "localized-countries/data/en";
|
|
14
|
+
import "notistack";
|
|
15
|
+
import "../../../../components/ui/reactHookForm/provider/CustomFormProvider.js";
|
|
16
|
+
import { useCustomFormContext } from "../../../../components/ui/reactHookForm/provider/useCustomFormContext.js";
|
|
17
|
+
import "yup";
|
|
18
|
+
import "../../../../components/ui/treeViewFinder/TreeViewFinder.js";
|
|
19
|
+
import { IntegerInput } from "../../../../components/ui/reactHookForm/numbers/IntegerInput.js";
|
|
20
|
+
import "../../../../components/ui/reactHookForm/numbers/RangeInput.js";
|
|
21
|
+
import "@material-symbols/svg-400/outlined/left_panel_open.svg?react";
|
|
22
|
+
import "@material-symbols/svg-400/outlined/arrows_output.svg?react";
|
|
23
|
+
import "@material-symbols/svg-400/outlined/arrows_input.svg?react";
|
|
24
|
+
import "@material-symbols/svg-400/outlined/left_panel_close.svg?react";
|
|
25
|
+
import "@material-symbols/svg-400/outlined/add_notes-fill.svg?react";
|
|
26
|
+
import "../../../../components/ui/dialogs/descriptionModificationDialog/DescriptionModificationDialog.js";
|
|
27
|
+
import "../../../../components/ui/reactHookForm/expandableInput/ExpandableInput.js";
|
|
28
|
+
import "../../../../components/ui/reactHookForm/directory-item-input/directory-item-utils.js";
|
|
29
|
+
import "@hello-pangea/dnd";
|
|
30
|
+
import "../../../../components/ui/dialogs/elementSaveDialog/ElementSaveDialog.js";
|
|
31
|
+
import "../../../../components/ui/snackbarProvider/SnackbarProvider.js";
|
|
32
|
+
import "mui-nested-menu";
|
|
33
|
+
import "react-resizable-panels";
|
|
34
|
+
import "react-papaparse";
|
|
35
|
+
import { SwitchesBetweenSections } from "../creation/tabs/structureTab/switchesBetweenSections/SwitchesBetweenSections.js";
|
|
36
|
+
import { filledTextField } from "../../common/form.utils.js";
|
|
37
|
+
import "../../common/properties/propertyUtils.js";
|
|
38
|
+
import "react-dom";
|
|
39
|
+
import "autosuggest-highlight/match";
|
|
40
|
+
import "autosuggest-highlight/parse";
|
|
41
|
+
import "clsx";
|
|
42
|
+
import "../../../../components/composite/filter/FilterCreationDialog.js";
|
|
43
|
+
import "../../../../components/composite/filter/HeaderFilterForm.js";
|
|
44
|
+
import "../../../../components/composite/filter/explicitNaming/ExplicitNamingFilterForm.js";
|
|
45
|
+
import "../../../../components/composite/filter/expert/ExpertFilterForm.js";
|
|
46
|
+
import "../../../../components/composite/filter/expert/ExpertFilterEditionDialog.js";
|
|
47
|
+
import "../../../../components/composite/filter/expert/expertFilterConstants.js";
|
|
48
|
+
import "react-querybuilder";
|
|
49
|
+
import "uuid";
|
|
50
|
+
import "../../../../components/composite/filter/explicitNaming/ExplicitNamingFilterEditionDialog.js";
|
|
51
|
+
import "../../../../components/composite/filter/utils/filterFormUtils.js";
|
|
52
|
+
import "@react-querybuilder/material";
|
|
53
|
+
import "../../../../components/composite/reactQueryBuilder/CustomReactQueryBuilder.js";
|
|
54
|
+
import "../../../../components/composite/reactQueryBuilder/PropertyValueEditor.js";
|
|
55
|
+
import "../../../../components/composite/agGridTable/BottomTableButtons.js";
|
|
56
|
+
import "../../../../components/composite/agGridTable/CustomAgGridTable.js";
|
|
57
|
+
import "ag-grid-community";
|
|
58
|
+
import "../../../../components/composite/customAGGrid/customAggrid.js";
|
|
59
|
+
import "../../../../components/composite/customAGGrid/context/custom-aggrid-context.js";
|
|
60
|
+
import "mathjs";
|
|
61
|
+
import "../../../../components/composite/report/report-viewer/log-table/log-table.js";
|
|
62
|
+
import "react-window";
|
|
63
|
+
import "../../../../components/composite/report/report-treeview/treeview-item.js";
|
|
64
|
+
import "../../../../components/composite/report/report-viewer/context/report-viewer-context.js";
|
|
65
|
+
import "../../common/regulatingTerminal/RegulatingTerminalForm.js";
|
|
66
|
+
import "@mui/material/colors";
|
|
67
|
+
import "@mui/x-charts";
|
|
68
|
+
import "../../common/currentLimits/limitsPane.utils.js";
|
|
69
|
+
import "../creation/voltageLevel.constants.js";
|
|
70
|
+
import "../creation/voltageLevelCreation.utils.js";
|
|
71
|
+
function CreateVoltageLevelTopologyForm({
|
|
72
|
+
voltageLevelId,
|
|
73
|
+
PositionDiagramPane
|
|
74
|
+
}) {
|
|
75
|
+
const [isDiagramPaneOpen, setIsDiagramPaneOpen] = useState(false);
|
|
76
|
+
const intl = useIntl();
|
|
77
|
+
const { isNodeBuilt } = useCustomFormContext();
|
|
78
|
+
const { trigger } = useFormContext();
|
|
79
|
+
const watchSectionCount = useWatch({ name: FieldConstants.SECTION_COUNT });
|
|
80
|
+
const isFirstRender = useRef(true);
|
|
81
|
+
useEffect(() => {
|
|
82
|
+
if (isFirstRender.current) {
|
|
83
|
+
isFirstRender.current = false;
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
trigger(FieldConstants.SECTION_COUNT);
|
|
87
|
+
}, [watchSectionCount, trigger]);
|
|
88
|
+
const handleCloseDiagramPane = () => {
|
|
89
|
+
setIsDiagramPaneOpen(false);
|
|
90
|
+
};
|
|
91
|
+
const handleClickOpenDiagramPane = () => {
|
|
92
|
+
setIsDiagramPaneOpen(true);
|
|
93
|
+
};
|
|
94
|
+
const voltageLevelIdField = useMemo(
|
|
95
|
+
() => /* @__PURE__ */ jsx(
|
|
96
|
+
TextField,
|
|
97
|
+
{
|
|
98
|
+
size: "small",
|
|
99
|
+
fullWidth: true,
|
|
100
|
+
label: intl.formatMessage({ id: "VoltageLevelId" }),
|
|
101
|
+
value: voltageLevelId ?? "",
|
|
102
|
+
slotProps: {
|
|
103
|
+
input: {
|
|
104
|
+
readOnly: true
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
disabled: true,
|
|
108
|
+
...filledTextField
|
|
109
|
+
}
|
|
110
|
+
),
|
|
111
|
+
[intl, voltageLevelId]
|
|
112
|
+
);
|
|
113
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
114
|
+
/* @__PURE__ */ jsxs(Stack, { children: [
|
|
115
|
+
/* @__PURE__ */ jsx(Grid, { children: /* @__PURE__ */ jsxs(Stack, { spacing: 2, children: [
|
|
116
|
+
/* @__PURE__ */ jsx(Grid, { children: /* @__PURE__ */ jsxs(Grid, { container: true, spacing: 3, alignItems: "center", children: [
|
|
117
|
+
/* @__PURE__ */ jsx(Grid, { size: 4, children: voltageLevelIdField }),
|
|
118
|
+
PositionDiagramPane && isNodeBuilt && /* @__PURE__ */ jsx(Grid, { children: /* @__PURE__ */ jsxs(Grid, { container: true, spacing: 1, children: [
|
|
119
|
+
/* @__PURE__ */ jsx(Grid, { children: /* @__PURE__ */ jsx(Button, { onClick: handleClickOpenDiagramPane, variant: "outlined", children: /* @__PURE__ */ jsx(FormattedMessage, { id: "CreateCouplingDeviceDiagramButton" }) }) }),
|
|
120
|
+
/* @__PURE__ */ jsx(Grid, { children: /* @__PURE__ */ jsx(
|
|
121
|
+
Tooltip,
|
|
122
|
+
{
|
|
123
|
+
title: intl.formatMessage({ id: "builtNodeTooltipForDiagram" }),
|
|
124
|
+
children: /* @__PURE__ */ jsx(InfoOutlined, { color: "info", fontSize: "small" })
|
|
125
|
+
}
|
|
126
|
+
) })
|
|
127
|
+
] }) })
|
|
128
|
+
] }) }),
|
|
129
|
+
/* @__PURE__ */ jsx(Grid, { children: /* @__PURE__ */ jsx(Grid, { container: true, spacing: 3, children: /* @__PURE__ */ jsx(Grid, { size: 4, children: /* @__PURE__ */ jsx(IntegerInput, { name: FieldConstants.SECTION_COUNT, label: "SectionCount" }) }) }) })
|
|
130
|
+
] }) }),
|
|
131
|
+
/* @__PURE__ */ jsx(Grid, { children: /* @__PURE__ */ jsx(SwitchesBetweenSections, {}) })
|
|
132
|
+
] }),
|
|
133
|
+
PositionDiagramPane && /* @__PURE__ */ jsx(Box, { children: /* @__PURE__ */ jsx(
|
|
134
|
+
PositionDiagramPane,
|
|
135
|
+
{
|
|
136
|
+
open: isDiagramPaneOpen,
|
|
137
|
+
onClose: handleCloseDiagramPane,
|
|
138
|
+
voltageLevelId
|
|
139
|
+
}
|
|
140
|
+
) })
|
|
141
|
+
] });
|
|
142
|
+
}
|
|
143
|
+
export {
|
|
144
|
+
CreateVoltageLevelTopologyForm
|
|
145
|
+
};
|
|
@@ -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 './voltageLevelTopologyCreation.types';
|
|
8
|
+
export * from './voltageLevelTopologyCreation.utils';
|
|
9
|
+
export * from './CreateVoltageLevelTopologyForm';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { createVoltageLevelTopologyDtoToForm, createVoltageLevelTopologyEmptyFormData, createVoltageLevelTopologyFormSchema, createVoltageLevelTopologyFormToDto } from "./voltageLevelTopologyCreation.utils.js";
|
|
2
|
+
import { CreateVoltageLevelTopologyForm } from "./CreateVoltageLevelTopologyForm.js";
|
|
3
|
+
export {
|
|
4
|
+
CreateVoltageLevelTopologyForm,
|
|
5
|
+
createVoltageLevelTopologyDtoToForm,
|
|
6
|
+
createVoltageLevelTopologyEmptyFormData,
|
|
7
|
+
createVoltageLevelTopologyFormSchema,
|
|
8
|
+
createVoltageLevelTopologyFormToDto
|
|
9
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { IntlShape } from 'react-intl';
|
|
2
|
+
import { DeepNullable } from '../../../../utils';
|
|
3
|
+
import { CreateVoltageLevelTopologyDto } from './voltageLevelTopologyCreation.types';
|
|
4
|
+
/**
|
|
5
|
+
* Copyright (c) 2026, RTE (http://www.rte-france.com)
|
|
6
|
+
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
7
|
+
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
8
|
+
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
9
|
+
*/
|
|
10
|
+
import * as yup from 'yup';
|
|
11
|
+
export declare const createVoltageLevelTopologyFormSchema: yup.ObjectSchema<{
|
|
12
|
+
sectionCount: number | null;
|
|
13
|
+
switchesBetweenSections: string | null | undefined;
|
|
14
|
+
switchKinds: {
|
|
15
|
+
switchKind: string;
|
|
16
|
+
}[] | null | undefined;
|
|
17
|
+
}, yup.AnyObject, {
|
|
18
|
+
sectionCount: undefined;
|
|
19
|
+
switchesBetweenSections: undefined;
|
|
20
|
+
switchKinds: "";
|
|
21
|
+
}, "">;
|
|
22
|
+
export type CreateVoltageLevelTopologyDialogSchemaForm = yup.InferType<typeof createVoltageLevelTopologyFormSchema>;
|
|
23
|
+
export declare const createVoltageLevelTopologyEmptyFormData: DeepNullable<CreateVoltageLevelTopologyDialogSchemaForm>;
|
|
24
|
+
export declare const createVoltageLevelTopologyDtoToForm: (editData: CreateVoltageLevelTopologyDto | undefined, intl: IntlShape) => DeepNullable<CreateVoltageLevelTopologyDialogSchemaForm>;
|
|
25
|
+
export declare const createVoltageLevelTopologyFormToDto: (voltageLevelTopology: CreateVoltageLevelTopologyDialogSchemaForm, voltageLevelId: string) => CreateVoltageLevelTopologyDto;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import * as yup from "yup";
|
|
2
|
+
import { FieldConstants } from "../../../../utils/constants/fieldConstants.js";
|
|
3
|
+
import "../../../../utils/conversionUtils.js";
|
|
4
|
+
import "../../../../utils/types/equipmentType.js";
|
|
5
|
+
import { ModificationType } from "../../../../utils/types/modificationType.js";
|
|
6
|
+
import "react/jsx-runtime";
|
|
7
|
+
import "@mui/icons-material";
|
|
8
|
+
import { MAX_SECTIONS_COUNT } from "../creation/voltageLevel.constants.js";
|
|
9
|
+
const createVoltageLevelTopologyFormSchema = yup.object().shape({
|
|
10
|
+
[FieldConstants.SECTION_COUNT]: yup.number().required().nullable().min(1, "AtLeastOneSectionAdded").max(MAX_SECTIONS_COUNT, "SectionCountMustBeLessThanOrEqualToTwenty"),
|
|
11
|
+
[FieldConstants.SWITCHES_BETWEEN_SECTIONS]: yup.string().nullable().when([FieldConstants.SECTION_COUNT], {
|
|
12
|
+
is: (sectionCount) => sectionCount > 1,
|
|
13
|
+
then: (schema) => schema.required()
|
|
14
|
+
}),
|
|
15
|
+
[FieldConstants.SWITCH_KINDS]: yup.array().of(
|
|
16
|
+
yup.object().shape({
|
|
17
|
+
[FieldConstants.SWITCH_KIND]: yup.string().required()
|
|
18
|
+
})
|
|
19
|
+
).nullable()
|
|
20
|
+
}).required();
|
|
21
|
+
const createVoltageLevelTopologyEmptyFormData = {
|
|
22
|
+
[FieldConstants.SECTION_COUNT]: null,
|
|
23
|
+
[FieldConstants.SWITCHES_BETWEEN_SECTIONS]: "",
|
|
24
|
+
[FieldConstants.SWITCH_KINDS]: []
|
|
25
|
+
};
|
|
26
|
+
const createVoltageLevelTopologyDtoToForm = (editData, intl) => {
|
|
27
|
+
const switchKinds = editData?.switchKinds?.map((switchKind) => ({ [FieldConstants.SWITCH_KIND]: switchKind })) || [];
|
|
28
|
+
const switchesBetweenSections = editData?.switchKinds?.map((switchKind) => intl.formatMessage({ id: switchKind })).join(" / ") || "";
|
|
29
|
+
return {
|
|
30
|
+
[FieldConstants.SECTION_COUNT]: editData?.sectionCount ?? null,
|
|
31
|
+
[FieldConstants.SWITCHES_BETWEEN_SECTIONS]: switchesBetweenSections,
|
|
32
|
+
[FieldConstants.SWITCH_KINDS]: switchKinds
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
const createVoltageLevelTopologyFormToDto = (voltageLevelTopology, voltageLevelId) => ({
|
|
36
|
+
type: ModificationType.CREATE_VOLTAGE_LEVEL_TOPOLOGY,
|
|
37
|
+
voltageLevelId,
|
|
38
|
+
sectionCount: voltageLevelTopology[FieldConstants.SECTION_COUNT],
|
|
39
|
+
switchKinds: voltageLevelTopology[FieldConstants.SWITCH_KINDS]?.map(
|
|
40
|
+
(switchKindData) => switchKindData[FieldConstants.SWITCH_KIND]
|
|
41
|
+
)
|
|
42
|
+
});
|
|
43
|
+
export {
|
|
44
|
+
createVoltageLevelTopologyDtoToForm,
|
|
45
|
+
createVoltageLevelTopologyEmptyFormData,
|
|
46
|
+
createVoltageLevelTopologyFormSchema,
|
|
47
|
+
createVoltageLevelTopologyFormToDto
|
|
48
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
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 declare const RESULTS_LOADING_DELAY = 500;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2024, 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 './useIntlResultStatusMessages';
|