@gridsuite/commons-ui 0.216.0 → 0.218.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.
Files changed (22) hide show
  1. package/dist/features/index.js +7 -0
  2. package/dist/features/network-modifications/index.js +7 -0
  3. package/dist/features/network-modifications/shunt-compensator/index.d.ts +1 -0
  4. package/dist/features/network-modifications/shunt-compensator/index.js +8 -1
  5. package/dist/features/network-modifications/shunt-compensator/modification/ShuntCompensatorModificationForm.d.ts +6 -0
  6. package/dist/features/network-modifications/shunt-compensator/modification/ShuntCompensatorModificationForm.js +126 -0
  7. package/dist/features/network-modifications/shunt-compensator/modification/index.d.ts +9 -0
  8. package/dist/features/network-modifications/shunt-compensator/modification/index.js +9 -0
  9. package/dist/features/network-modifications/shunt-compensator/modification/shuntCompensatorModification.types.d.ts +22 -0
  10. package/dist/features/network-modifications/shunt-compensator/modification/shuntCompensatorModification.types.js +1 -0
  11. package/dist/features/network-modifications/shunt-compensator/modification/shuntCompensatorModification.utils.d.ts +142 -0
  12. package/dist/features/network-modifications/shunt-compensator/modification/shuntCompensatorModification.utils.js +132 -0
  13. package/dist/features/notifications/NotificationsProvider.js +6 -6
  14. package/dist/index.js +10 -1
  15. package/dist/redux/commonStore.d.ts +3 -0
  16. package/dist/redux/commonStore.js +10 -1
  17. package/dist/redux/index.js +4 -2
  18. package/dist/translations/en/networkModificationsEn.d.ts +3 -0
  19. package/dist/translations/en/networkModificationsEn.js +3 -0
  20. package/dist/translations/fr/networkModificationsFr.d.ts +3 -0
  21. package/dist/translations/fr/networkModificationsFr.js +3 -0
  22. package/package.json +1 -1
@@ -162,6 +162,8 @@ import { CharacteristicsForm } from "./network-modifications/shunt-compensator/c
162
162
  import { getCharacteristicsCreateFormDataFromSearchCopy, getCharacteristicsEmptyFormData, getCharacteristicsFormData, getCharacteristicsFormValidationSchema } from "./network-modifications/shunt-compensator/common/characteristicsForm.utils.js";
163
163
  import { ShuntCompensatorCreationForm } from "./network-modifications/shunt-compensator/creation/ShuntCompensatorCreationForm.js";
164
164
  import { shuntCompensatorCreationDtoToForm, shuntCompensatorCreationEmptyFormData, shuntCompensatorCreationFormSchema, shuntCompensatorCreationFormToDto } from "./network-modifications/shunt-compensator/creation/shuntCompensatorCreation.utils.js";
165
+ import { ShuntCompensatorModificationForm } from "./network-modifications/shunt-compensator/modification/ShuntCompensatorModificationForm.js";
166
+ import { shuntCompensatorModificationDtoToForm, shuntCompensatorModificationEmptyFormData, shuntCompensatorModificationFormSchema, shuntCompensatorModificationFormToDto } from "./network-modifications/shunt-compensator/modification/shuntCompensatorModification.utils.js";
165
167
  import { BuildStatusChip } from "./node/build-status-chip.js";
166
168
  import { BuildStatus } from "./node/constant.js";
167
169
  import { COLUMNS_WITHOUT_BORDER, DEPTH_CELL_WIDTH, DROP_FORBIDDEN_INDICATOR_BOTTOM, DROP_FORBIDDEN_INDICATOR_TOP, DROP_INDICATOR_BOTTOM, DROP_INDICATOR_TOP, MODIFICATION_ROW_HEIGHT, createCellBorderColor, createCellContentWrapperSx, createCellStyle, createEditDescriptionStyle, createHeaderCellStyle, createModificationNameCellStyle, createNameCellLabelBoxSx, createNameCellRootStyle, createRootNetworkChipCellSx, createRowSx, networkModificationTableStyles } from "./network-modification-table/network-modification-table-styles.js";
@@ -428,6 +430,7 @@ export {
428
430
  ShortCircuitParametersEditionDialog,
429
431
  ShortCircuitParametersInLine,
430
432
  ShuntCompensatorCreationForm,
433
+ ShuntCompensatorModificationForm,
431
434
  ShuntCompensatorSelectionForm,
432
435
  SignInCallbackHandler,
433
436
  SilentRenewCallbackHandler,
@@ -615,6 +618,10 @@ export {
615
618
  shuntCompensatorCreationEmptyFormData,
616
619
  shuntCompensatorCreationFormSchema,
617
620
  shuntCompensatorCreationFormToDto,
621
+ shuntCompensatorModificationDtoToForm,
622
+ shuntCompensatorModificationEmptyFormData,
623
+ shuntCompensatorModificationFormSchema,
624
+ shuntCompensatorModificationFormToDto,
618
625
  standardTextField,
619
626
  substationCreationDtoToForm,
620
627
  substationCreationEmptyFormData,
@@ -94,6 +94,8 @@ import { CharacteristicsForm } from "./shunt-compensator/common/CharacteristicsF
94
94
  import { getCharacteristicsCreateFormDataFromSearchCopy, getCharacteristicsEmptyFormData, getCharacteristicsFormData, getCharacteristicsFormValidationSchema } from "./shunt-compensator/common/characteristicsForm.utils.js";
95
95
  import { ShuntCompensatorCreationForm } from "./shunt-compensator/creation/ShuntCompensatorCreationForm.js";
96
96
  import { shuntCompensatorCreationDtoToForm, shuntCompensatorCreationEmptyFormData, shuntCompensatorCreationFormSchema, shuntCompensatorCreationFormToDto } from "./shunt-compensator/creation/shuntCompensatorCreation.utils.js";
97
+ import { ShuntCompensatorModificationForm } from "./shunt-compensator/modification/ShuntCompensatorModificationForm.js";
98
+ import { shuntCompensatorModificationDtoToForm, shuntCompensatorModificationEmptyFormData, shuntCompensatorModificationFormSchema, shuntCompensatorModificationFormToDto } from "./shunt-compensator/modification/shuntCompensatorModification.utils.js";
97
99
  export {
98
100
  ActivePowerControlForm,
99
101
  DataType as AssignmentDataType,
@@ -133,6 +135,7 @@ export {
133
135
  SetPointsForm,
134
136
  ShortCircuitForm,
135
137
  ShuntCompensatorCreationForm,
138
+ ShuntCompensatorModificationForm,
136
139
  ShuntCompensatorSelectionForm,
137
140
  SubstationCreationForm,
138
141
  SubstationModificationForm,
@@ -253,6 +256,10 @@ export {
253
256
  shuntCompensatorCreationEmptyFormData,
254
257
  shuntCompensatorCreationFormSchema,
255
258
  shuntCompensatorCreationFormToDto,
259
+ shuntCompensatorModificationDtoToForm,
260
+ shuntCompensatorModificationEmptyFormData,
261
+ shuntCompensatorModificationFormSchema,
262
+ shuntCompensatorModificationFormToDto,
256
263
  standardTextField,
257
264
  substationCreationDtoToForm,
258
265
  substationCreationEmptyFormData,
@@ -6,3 +6,4 @@
6
6
  */
7
7
  export * from './common';
8
8
  export * from './creation';
9
+ export * from './modification';
@@ -3,11 +3,14 @@ import { CharacteristicsForm } from "./common/CharacteristicsForm.js";
3
3
  import { getCharacteristicsCreateFormDataFromSearchCopy, getCharacteristicsEmptyFormData, getCharacteristicsFormData, getCharacteristicsFormValidationSchema } from "./common/characteristicsForm.utils.js";
4
4
  import { ShuntCompensatorCreationForm } from "./creation/ShuntCompensatorCreationForm.js";
5
5
  import { shuntCompensatorCreationDtoToForm, shuntCompensatorCreationEmptyFormData, shuntCompensatorCreationFormSchema, shuntCompensatorCreationFormToDto } from "./creation/shuntCompensatorCreation.utils.js";
6
+ import { ShuntCompensatorModificationForm } from "./modification/ShuntCompensatorModificationForm.js";
7
+ import { shuntCompensatorModificationDtoToForm, shuntCompensatorModificationEmptyFormData, shuntCompensatorModificationFormSchema, shuntCompensatorModificationFormToDto } from "./modification/shuntCompensatorModification.utils.js";
6
8
  export {
7
9
  CHARACTERISTICS_CHOICES,
8
10
  CharacteristicsForm,
9
11
  SHUNT_COMPENSATOR_TYPES,
10
12
  ShuntCompensatorCreationForm,
13
+ ShuntCompensatorModificationForm,
11
14
  computeSwitchedOnValue,
12
15
  getCharacteristicsCreateFormDataFromSearchCopy,
13
16
  getCharacteristicsEmptyFormData,
@@ -16,5 +19,9 @@ export {
16
19
  shuntCompensatorCreationDtoToForm,
17
20
  shuntCompensatorCreationEmptyFormData,
18
21
  shuntCompensatorCreationFormSchema,
19
- shuntCompensatorCreationFormToDto
22
+ shuntCompensatorCreationFormToDto,
23
+ shuntCompensatorModificationDtoToForm,
24
+ shuntCompensatorModificationEmptyFormData,
25
+ shuntCompensatorModificationFormSchema,
26
+ shuntCompensatorModificationFormToDto
20
27
  };
@@ -0,0 +1,6 @@
1
+ import { ConnectivityNetworkProps } from '../../common/connectivity/connectivity.type';
2
+ import { ShuntCompensatorFormInfos } from '../common/shuntCompensator.types';
3
+ export interface ShuntCompensatorModificationFormProps extends ConnectivityNetworkProps {
4
+ shuntCompensatorToModify?: ShuntCompensatorFormInfos | null;
5
+ }
6
+ export declare function ShuntCompensatorModificationForm({ shuntCompensatorToModify, voltageLevelOptions, fetchBusesOrBusbarSections, PositionDiagramPane, }: Readonly<ShuntCompensatorModificationFormProps>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,126 @@
1
+ import { jsxs, jsx } from "react/jsx-runtime";
2
+ import { Grid2, TextField } from "@mui/material";
3
+ import { useWatch } from "react-hook-form";
4
+ import "@mui/icons-material";
5
+ import "react-intl";
6
+ import "../../../../components/ui/overflowableText/OverflowableText.js";
7
+ import { FieldConstants } from "../../../../utils/constants/fieldConstants.js";
8
+ import "../../../../utils/conversionUtils.js";
9
+ import "../../../../utils/types/equipmentType.js";
10
+ import "react";
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 "yup";
17
+ import "../../../../components/ui/treeViewFinder/TreeViewFinder.js";
18
+ import { TextInput } from "../../../../components/ui/reactHookForm/text/TextInput.js";
19
+ import "../../../../components/ui/reactHookForm/numbers/RangeInput.js";
20
+ import "@material-symbols/svg-400/outlined/left_panel_open.svg?react";
21
+ import "@material-symbols/svg-400/outlined/arrows_output.svg?react";
22
+ import "@material-symbols/svg-400/outlined/arrows_input.svg?react";
23
+ import "@material-symbols/svg-400/outlined/left_panel_close.svg?react";
24
+ import "@material-symbols/svg-400/outlined/add_notes.svg?react";
25
+ import "../../../../components/ui/dialogs/descriptionModificationDialog/DescriptionModificationDialog.js";
26
+ import "../../../../components/ui/reactHookForm/expandableInput/ExpandableInput.js";
27
+ import "@hello-pangea/dnd";
28
+ import "../../../../components/ui/dialogs/elementSaveDialog/ElementSaveDialog.js";
29
+ import "../../../../components/ui/snackbarProvider/SnackbarProvider.js";
30
+ import "mui-nested-menu";
31
+ import "react-resizable-panels";
32
+ import GridSection from "../../../../components/composite/grid/grid-section.js";
33
+ import { ConnectivityForm } from "../../common/connectivity/ConnectivityForm.js";
34
+ import { PropertiesForm } from "../../common/properties/PropertiesForm.js";
35
+ import { PowerMeasurementsForm } from "../../common/measurements/PowerMeasurementsForm.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/BottomRightButtons.js";
56
+ import "../../../../components/composite/customAGGrid/customAggrid.js";
57
+ import "ag-grid-community";
58
+ import "react-papaparse";
59
+ import "react-csv-downloader";
60
+ import "../../common/regulatingTerminal/RegulatingTerminalForm.js";
61
+ import { CharacteristicsForm } from "../common/CharacteristicsForm.js";
62
+ function ShuntCompensatorModificationForm({
63
+ shuntCompensatorToModify,
64
+ voltageLevelOptions = [],
65
+ fetchBusesOrBusbarSections,
66
+ PositionDiagramPane
67
+ }) {
68
+ const equipmentId = useWatch({ name: FieldConstants.EQUIPMENT_ID });
69
+ return /* @__PURE__ */ jsxs(Grid2, { container: true, direction: "column", spacing: 2, children: [
70
+ /* @__PURE__ */ jsx(Grid2, { children: /* @__PURE__ */ jsxs(Grid2, { container: true, spacing: 2, children: [
71
+ /* @__PURE__ */ jsx(Grid2, { size: 4, children: /* @__PURE__ */ jsx(
72
+ TextField,
73
+ {
74
+ size: "small",
75
+ fullWidth: true,
76
+ label: "ID",
77
+ value: equipmentId ?? "",
78
+ slotProps: { input: { readOnly: true } },
79
+ disabled: true,
80
+ ...filledTextField
81
+ }
82
+ ) }),
83
+ /* @__PURE__ */ jsx(Grid2, { size: 4, children: /* @__PURE__ */ jsx(
84
+ TextInput,
85
+ {
86
+ name: FieldConstants.EQUIPMENT_NAME,
87
+ label: "Name",
88
+ formProps: filledTextField,
89
+ previousValue: shuntCompensatorToModify?.name,
90
+ clearable: true
91
+ }
92
+ ) })
93
+ ] }) }),
94
+ /* @__PURE__ */ jsxs(Grid2, { children: [
95
+ /* @__PURE__ */ jsx(GridSection, { title: "Connectivity" }),
96
+ /* @__PURE__ */ jsx(Grid2, { container: true, spacing: 2, children: /* @__PURE__ */ jsx(Grid2, { size: 12, children: /* @__PURE__ */ jsx(
97
+ ConnectivityForm,
98
+ {
99
+ isEquipmentModification: true,
100
+ previousValues: shuntCompensatorToModify ?? void 0,
101
+ voltageLevelOptions,
102
+ PositionDiagramPane,
103
+ fetchBusesOrBusbarSections
104
+ }
105
+ ) }) })
106
+ ] }),
107
+ /* @__PURE__ */ jsxs(Grid2, { children: [
108
+ /* @__PURE__ */ jsx(GridSection, { title: "Characteristics" }),
109
+ /* @__PURE__ */ jsx(Grid2, { container: true, spacing: 2, children: /* @__PURE__ */ jsx(Grid2, { size: 12, children: /* @__PURE__ */ jsx(CharacteristicsForm, { previousValues: shuntCompensatorToModify ?? void 0, isModification: true }) }) })
110
+ ] }),
111
+ /* @__PURE__ */ jsxs(Grid2, { children: [
112
+ /* @__PURE__ */ jsx(GridSection, { title: "MeasurementsSection" }),
113
+ /* @__PURE__ */ jsx(Grid2, { container: true, spacing: 2, children: /* @__PURE__ */ jsx(Grid2, { size: 12, children: /* @__PURE__ */ jsx(
114
+ PowerMeasurementsForm,
115
+ {
116
+ reactivePowerMeasurement: shuntCompensatorToModify?.measurementQ,
117
+ reactivePowerOnly: true
118
+ }
119
+ ) }) })
120
+ ] }),
121
+ /* @__PURE__ */ jsx(Grid2, { children: /* @__PURE__ */ jsx(PropertiesForm, { networkElementType: "shuntCompensator", isModification: true }) })
122
+ ] });
123
+ }
124
+ export {
125
+ ShuntCompensatorModificationForm
126
+ };
@@ -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 './ShuntCompensatorModificationForm';
8
+ export * from './shuntCompensatorModification.types';
9
+ export * from './shuntCompensatorModification.utils';
@@ -0,0 +1,9 @@
1
+ import { ShuntCompensatorModificationForm } from "./ShuntCompensatorModificationForm.js";
2
+ import { shuntCompensatorModificationDtoToForm, shuntCompensatorModificationEmptyFormData, shuntCompensatorModificationFormSchema, shuntCompensatorModificationFormToDto } from "./shuntCompensatorModification.utils.js";
3
+ export {
4
+ ShuntCompensatorModificationForm,
5
+ shuntCompensatorModificationDtoToForm,
6
+ shuntCompensatorModificationEmptyFormData,
7
+ shuntCompensatorModificationFormSchema,
8
+ shuntCompensatorModificationFormToDto
9
+ };
@@ -0,0 +1,22 @@
1
+ import { AttributeModification, ModificationType } from '../../../../utils';
2
+ import { Property } from '../../common';
3
+ export interface ShuntCompensatorModificationDto {
4
+ type: ModificationType;
5
+ uuid?: string;
6
+ equipmentId: string;
7
+ equipmentName: AttributeModification<string> | null;
8
+ maxSusceptance: AttributeModification<number> | null;
9
+ maxQAtNominalV: AttributeModification<number> | null;
10
+ shuntCompensatorType: AttributeModification<string> | null;
11
+ sectionCount: AttributeModification<number> | null;
12
+ maximumSectionCount: AttributeModification<number> | null;
13
+ voltageLevelId: AttributeModification<string> | null;
14
+ busOrBusbarSectionId: AttributeModification<string> | null;
15
+ connectionDirection: AttributeModification<string> | null;
16
+ connectionName?: AttributeModification<string> | null;
17
+ connectionPosition?: AttributeModification<number> | null;
18
+ terminalConnected?: AttributeModification<boolean> | null;
19
+ qMeasurementValue: AttributeModification<number> | null;
20
+ qMeasurementValidity: AttributeModification<boolean> | null;
21
+ properties: Property[] | null;
22
+ }
@@ -0,0 +1,142 @@
1
+ import { InferType } from 'yup';
2
+ import { DeepNullable } from '../../../../utils';
3
+ import { ShuntCompensatorModificationDto } from './shuntCompensatorModification.types';
4
+ export declare const shuntCompensatorModificationFormSchema: import('yup').ObjectSchema<NonNullable<({
5
+ maxQAtNominalV: number | null;
6
+ maxSusceptance: number | null;
7
+ maximumSectionCount: number | null;
8
+ sectionCount: number | null;
9
+ switchedOnQAtNominalV: number | null | undefined;
10
+ switchedOnSusceptance: number | null | undefined;
11
+ characteristicsChoice: string;
12
+ shuntCompensatorType: string | null;
13
+ equipmentID: string;
14
+ equipmentName: string | null | undefined;
15
+ connectivity: {
16
+ terminalConnected?: boolean | null | undefined;
17
+ connectionDirection?: string | null | undefined;
18
+ connectionName?: string | undefined;
19
+ connectionPosition?: number | null | undefined;
20
+ busOrBusbarSection: {
21
+ id?: string | undefined;
22
+ } | null;
23
+ voltageLevel: {
24
+ id?: string | undefined;
25
+ } | null;
26
+ };
27
+ stateEstimation: {
28
+ [x: string]: {
29
+ validity?: boolean | null | undefined;
30
+ value?: number | null | undefined;
31
+ };
32
+ [x: number]: {
33
+ validity?: boolean | null | undefined;
34
+ value?: number | null | undefined;
35
+ };
36
+ };
37
+ } | {
38
+ maxQAtNominalV: number | null;
39
+ maxSusceptance: number | null;
40
+ maximumSectionCount: number;
41
+ sectionCount: number;
42
+ switchedOnQAtNominalV: import('yup').Maybe<number | undefined>;
43
+ switchedOnSusceptance: import('yup').Maybe<number | undefined>;
44
+ characteristicsChoice: string;
45
+ shuntCompensatorType: string | null;
46
+ equipmentID: string;
47
+ equipmentName: string | null | undefined;
48
+ connectivity: {
49
+ terminalConnected?: boolean | null | undefined;
50
+ connectionDirection?: string | null | undefined;
51
+ connectionName?: string | undefined;
52
+ connectionPosition?: number | null | undefined;
53
+ busOrBusbarSection: {
54
+ id?: string | undefined;
55
+ } | null;
56
+ voltageLevel: {
57
+ id?: string | undefined;
58
+ } | null;
59
+ };
60
+ stateEstimation: {
61
+ [x: string]: {
62
+ validity?: boolean | null | undefined;
63
+ value?: number | null | undefined;
64
+ };
65
+ [x: number]: {
66
+ validity?: boolean | null | undefined;
67
+ value?: number | null | undefined;
68
+ };
69
+ };
70
+ }) & {
71
+ AdditionalProperties: {
72
+ previousValue?: string | null | undefined;
73
+ value?: string | null | undefined;
74
+ added: NonNullable<boolean | undefined>;
75
+ deletionMark: NonNullable<boolean | undefined>;
76
+ name: string;
77
+ }[] | undefined;
78
+ }>, import('yup').AnyObject, {
79
+ maxQAtNominalV: null;
80
+ maxSusceptance: null;
81
+ maximumSectionCount: null;
82
+ sectionCount: null;
83
+ switchedOnQAtNominalV: undefined;
84
+ switchedOnSusceptance: undefined;
85
+ characteristicsChoice: undefined;
86
+ shuntCompensatorType: null;
87
+ equipmentID: undefined;
88
+ equipmentName: undefined;
89
+ connectivity: {
90
+ voltageLevel: {
91
+ id: undefined;
92
+ };
93
+ busOrBusbarSection: {
94
+ id: undefined;
95
+ };
96
+ connectionDirection: undefined;
97
+ connectionName: undefined;
98
+ connectionPosition: undefined;
99
+ terminalConnected: undefined;
100
+ };
101
+ stateEstimation: {
102
+ [x: string]: {
103
+ value: undefined;
104
+ validity: undefined;
105
+ };
106
+ };
107
+ AdditionalProperties: "";
108
+ } | {
109
+ maxQAtNominalV: null;
110
+ maxSusceptance: null;
111
+ maximumSectionCount: undefined;
112
+ sectionCount: undefined;
113
+ switchedOnQAtNominalV: undefined;
114
+ switchedOnSusceptance: undefined;
115
+ characteristicsChoice: undefined;
116
+ shuntCompensatorType: null;
117
+ equipmentID: undefined;
118
+ equipmentName: undefined;
119
+ connectivity: {
120
+ voltageLevel: {
121
+ id: undefined;
122
+ };
123
+ busOrBusbarSection: {
124
+ id: undefined;
125
+ };
126
+ connectionDirection: undefined;
127
+ connectionName: undefined;
128
+ connectionPosition: undefined;
129
+ terminalConnected: undefined;
130
+ };
131
+ stateEstimation: {
132
+ [x: string]: {
133
+ value: undefined;
134
+ validity: undefined;
135
+ };
136
+ };
137
+ AdditionalProperties: "";
138
+ }, "">;
139
+ export type ShuntCompensatorModificationFormData = InferType<typeof shuntCompensatorModificationFormSchema>;
140
+ export declare const shuntCompensatorModificationEmptyFormData: DeepNullable<ShuntCompensatorModificationFormData>;
141
+ export declare const shuntCompensatorModificationDtoToForm: (shuntDto: ShuntCompensatorModificationDto, includePreviousValues?: boolean) => ShuntCompensatorModificationFormData;
142
+ export declare const shuntCompensatorModificationFormToDto: (shuntForm: ShuntCompensatorModificationFormData) => ShuntCompensatorModificationDto;
@@ -0,0 +1,132 @@
1
+ import { object, string } from "yup";
2
+ import { FieldConstants } from "../../../../utils/constants/fieldConstants.js";
3
+ import { toModificationOperation } from "../../../../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 { sanitizeString } from "../../../../utils/ts-utils.js";
9
+ import "react";
10
+ import "react-hook-form";
11
+ import { modificationPropertiesSchema, getPropertiesFromModification, toModificationProperties } from "../../common/properties/propertyUtils.js";
12
+ import "@mui/material";
13
+ import "react-intl";
14
+ import "../../../../components/ui/overflowableText/OverflowableText.js";
15
+ import "localized-countries";
16
+ import "localized-countries/data/fr";
17
+ import "localized-countries/data/en";
18
+ import "notistack";
19
+ import "../../../../components/ui/reactHookForm/provider/CustomFormProvider.js";
20
+ import "../../../../components/ui/treeViewFinder/TreeViewFinder.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.svg?react";
27
+ import "../../../../components/ui/dialogs/descriptionModificationDialog/DescriptionModificationDialog.js";
28
+ import "../../../../components/ui/reactHookForm/expandableInput/ExpandableInput.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 { getInjectionActiveReactivePowerValidationSchemaProperties, getInjectionActiveReactivePowerEmptyFormDataProperties, getInjectionActiveReactivePowerEditDataProperties } from "../../common/measurements/injectionActiveReactivePowerForm.utils.js";
35
+ import "react-dom";
36
+ import "autosuggest-highlight/match";
37
+ import "autosuggest-highlight/parse";
38
+ import "clsx";
39
+ import "../../../../components/composite/filter/FilterCreationDialog.js";
40
+ import "../../../../components/composite/filter/HeaderFilterForm.js";
41
+ import "../../../../components/composite/filter/explicitNaming/ExplicitNamingFilterForm.js";
42
+ import "../../../../components/composite/filter/expert/ExpertFilterForm.js";
43
+ import "../../../../components/composite/filter/expert/ExpertFilterEditionDialog.js";
44
+ import "../../../../components/composite/filter/expert/expertFilterConstants.js";
45
+ import "react-querybuilder";
46
+ import "uuid";
47
+ import "../../../../components/composite/filter/explicitNaming/ExplicitNamingFilterEditionDialog.js";
48
+ import "../../../../components/composite/filter/utils/filterFormUtils.js";
49
+ import "@react-querybuilder/material";
50
+ import "../../../../components/composite/reactQueryBuilder/CustomReactQueryBuilder.js";
51
+ import "../../../../components/composite/reactQueryBuilder/PropertyValueEditor.js";
52
+ import "../../../../components/composite/agGridTable/BottomRightButtons.js";
53
+ import "../../../../components/composite/customAGGrid/customAggrid.js";
54
+ import "ag-grid-community";
55
+ import "react-papaparse";
56
+ import "react-csv-downloader";
57
+ import { getConnectivityWithPositionSchema, getConnectivityWithPositionEmptyFormDataProps, getConnectivityFormDataProps } from "../../common/connectivity/connectivityForm.utils.js";
58
+ import "../../common/regulatingTerminal/RegulatingTerminalForm.js";
59
+ import { CHARACTERISTICS_CHOICES } from "../common/shuntCompensator.utils.js";
60
+ import { getCharacteristicsFormValidationSchema, getCharacteristicsEmptyFormData, getCharacteristicsFormData } from "../common/characteristicsForm.utils.js";
61
+ const shuntCompensatorModificationFormSchema = object().shape({
62
+ [FieldConstants.EQUIPMENT_ID]: string().required(),
63
+ [FieldConstants.EQUIPMENT_NAME]: string().nullable(),
64
+ [FieldConstants.CONNECTIVITY]: getConnectivityWithPositionSchema(true),
65
+ [FieldConstants.STATE_ESTIMATION]: getInjectionActiveReactivePowerValidationSchemaProperties(),
66
+ ...getCharacteristicsFormValidationSchema(true)
67
+ }).concat(modificationPropertiesSchema).required();
68
+ const shuntCompensatorModificationEmptyFormData = {
69
+ [FieldConstants.EQUIPMENT_ID]: "",
70
+ [FieldConstants.EQUIPMENT_NAME]: "",
71
+ [FieldConstants.CONNECTIVITY]: getConnectivityWithPositionEmptyFormDataProps(true),
72
+ [FieldConstants.STATE_ESTIMATION]: getInjectionActiveReactivePowerEmptyFormDataProperties(),
73
+ ...getCharacteristicsEmptyFormData(),
74
+ [FieldConstants.ADDITIONAL_PROPERTIES]: []
75
+ };
76
+ const shuntCompensatorModificationDtoToForm = (shuntDto, includePreviousValues = true) => ({
77
+ [FieldConstants.EQUIPMENT_ID]: shuntDto.equipmentId,
78
+ [FieldConstants.EQUIPMENT_NAME]: shuntDto.equipmentName?.value ?? "",
79
+ [FieldConstants.CONNECTIVITY]: getConnectivityFormDataProps({
80
+ voltageLevelId: shuntDto.voltageLevelId?.value ?? null,
81
+ busbarSectionId: shuntDto.busOrBusbarSectionId?.value ?? null,
82
+ connectionName: shuntDto.connectionName?.value ?? "",
83
+ connectionDirection: shuntDto.connectionDirection?.value ?? null,
84
+ connectionPosition: shuntDto.connectionPosition?.value ?? null,
85
+ terminalConnected: shuntDto.terminalConnected?.value ?? null,
86
+ isEquipmentModification: true
87
+ }),
88
+ ...getCharacteristicsFormData({
89
+ maxSusceptance: shuntDto.maxSusceptance?.value ?? null,
90
+ maxQAtNominalV: shuntDto.maxQAtNominalV?.value ?? null,
91
+ shuntCompensatorType: shuntDto.shuntCompensatorType?.value ?? null,
92
+ sectionCount: shuntDto.sectionCount?.value ?? null,
93
+ maximumSectionCount: shuntDto.maximumSectionCount?.value ?? null
94
+ }),
95
+ [FieldConstants.STATE_ESTIMATION]: getInjectionActiveReactivePowerEditDataProperties(shuntDto),
96
+ ...getPropertiesFromModification(shuntDto.properties, includePreviousValues)
97
+ });
98
+ const shuntCompensatorModificationFormToDto = (shuntForm) => {
99
+ const choice = shuntForm[FieldConstants.CHARACTERISTICS_CHOICE];
100
+ const stateEstimationData = shuntForm[FieldConstants.STATE_ESTIMATION];
101
+ return {
102
+ type: ModificationType.SHUNT_COMPENSATOR_MODIFICATION,
103
+ equipmentId: shuntForm[FieldConstants.EQUIPMENT_ID],
104
+ equipmentName: toModificationOperation(sanitizeString(shuntForm[FieldConstants.EQUIPMENT_NAME])),
105
+ maximumSectionCount: toModificationOperation(shuntForm[FieldConstants.MAXIMUM_SECTION_COUNT]),
106
+ sectionCount: toModificationOperation(shuntForm[FieldConstants.SECTION_COUNT]),
107
+ maxSusceptance: toModificationOperation(
108
+ choice === CHARACTERISTICS_CHOICES.SUSCEPTANCE.id ? shuntForm[FieldConstants.MAX_SUSCEPTANCE] : null
109
+ ),
110
+ maxQAtNominalV: toModificationOperation(
111
+ choice === CHARACTERISTICS_CHOICES.Q_AT_NOMINAL_V.id ? shuntForm[FieldConstants.MAX_Q_AT_NOMINAL_V] : null
112
+ ),
113
+ shuntCompensatorType: toModificationOperation(
114
+ choice === CHARACTERISTICS_CHOICES.Q_AT_NOMINAL_V.id ? shuntForm[FieldConstants.SHUNT_COMPENSATOR_TYPE] : null
115
+ ),
116
+ voltageLevelId: toModificationOperation(shuntForm[FieldConstants.CONNECTIVITY]?.voltageLevel?.id),
117
+ busOrBusbarSectionId: toModificationOperation(shuntForm[FieldConstants.CONNECTIVITY]?.busOrBusbarSection?.id),
118
+ connectionName: toModificationOperation(sanitizeString(shuntForm[FieldConstants.CONNECTIVITY]?.connectionName)),
119
+ connectionDirection: toModificationOperation(shuntForm[FieldConstants.CONNECTIVITY]?.connectionDirection),
120
+ connectionPosition: toModificationOperation(shuntForm[FieldConstants.CONNECTIVITY]?.connectionPosition),
121
+ terminalConnected: toModificationOperation(shuntForm[FieldConstants.CONNECTIVITY]?.terminalConnected),
122
+ qMeasurementValue: toModificationOperation(stateEstimationData?.measurementQ?.value),
123
+ qMeasurementValidity: toModificationOperation(stateEstimationData?.measurementQ?.validity),
124
+ properties: toModificationProperties(shuntForm)
125
+ };
126
+ };
127
+ export {
128
+ shuntCompensatorModificationDtoToForm,
129
+ shuntCompensatorModificationEmptyFormData,
130
+ shuntCompensatorModificationFormSchema,
131
+ shuntCompensatorModificationFormToDto
132
+ };
@@ -1,9 +1,9 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
- import { useEffect, useMemo } from "react";
2
+ import { useSyncExternalStore, useEffect, useMemo } from "react";
3
3
  import ReconnectingWebSocket from "reconnecting-websocket";
4
4
  import { NotificationsContext } from "./contexts/NotificationsContext.js";
5
5
  import { useListenerManager } from "./hooks/useListenerManager.js";
6
- import { getUserToken } from "../../redux/commonStore.js";
6
+ import { subscribeToUserState, getUser, getUserToken } from "../../redux/commonStore.js";
7
7
  const DELAY_BEFORE_WEBSOCKET_CONNECTED = 12e3;
8
8
  function isUrlDefined(tuple) {
9
9
  return tuple[1] !== void 0;
@@ -23,15 +23,15 @@ function NotificationsProvider({ urls, children }) {
23
23
  addListener: addListenerOnReopen,
24
24
  removeListener: removeListenerOnReopen
25
25
  } = useListenerManager(urls);
26
+ const isAuthenticated = useSyncExternalStore(subscribeToUserState, () => getUser() !== null);
26
27
  useEffect(() => {
27
28
  const token = getUserToken();
28
- if (!token) {
29
+ if (!isAuthenticated || !token) {
29
30
  console.info("Skipping Notification WebSockets: no user token available");
30
31
  return void 0;
31
32
  }
32
33
  const connections = Object.entries(urls).filter(isUrlDefined).map(([urlKey, url]) => {
33
- const urlWithToken = appendTokenToUrl(url, token);
34
- const rws = new ReconnectingWebSocket(urlWithToken, [], {
34
+ const rws = new ReconnectingWebSocket(() => appendTokenToUrl(url, getUserToken() ?? ""), [], {
35
35
  // this option set the minimum duration being connected before reset the retry count to 0
36
36
  minUptime: DELAY_BEFORE_WEBSOCKET_CONNECTED
37
37
  });
@@ -49,7 +49,7 @@ function NotificationsProvider({ urls, children }) {
49
49
  return rws;
50
50
  });
51
51
  return () => connections.forEach((c) => c.close());
52
- }, [broadcastMessage, broadcastOnReopen, urls]);
52
+ }, [broadcastMessage, broadcastOnReopen, urls, isAuthenticated]);
53
53
  const contextValue = useMemo(
54
54
  () => ({
55
55
  addListenerEvent: addListenerMessage,
package/dist/index.js CHANGED
@@ -319,6 +319,8 @@ import { CharacteristicsForm } from "./features/network-modifications/shunt-comp
319
319
  import { getCharacteristicsCreateFormDataFromSearchCopy, getCharacteristicsEmptyFormData, getCharacteristicsFormData, getCharacteristicsFormValidationSchema } from "./features/network-modifications/shunt-compensator/common/characteristicsForm.utils.js";
320
320
  import { ShuntCompensatorCreationForm } from "./features/network-modifications/shunt-compensator/creation/ShuntCompensatorCreationForm.js";
321
321
  import { shuntCompensatorCreationDtoToForm, shuntCompensatorCreationEmptyFormData, shuntCompensatorCreationFormSchema, shuntCompensatorCreationFormToDto } from "./features/network-modifications/shunt-compensator/creation/shuntCompensatorCreation.utils.js";
322
+ import { ShuntCompensatorModificationForm } from "./features/network-modifications/shunt-compensator/modification/ShuntCompensatorModificationForm.js";
323
+ import { shuntCompensatorModificationDtoToForm, shuntCompensatorModificationEmptyFormData, shuntCompensatorModificationFormSchema, shuntCompensatorModificationFormToDto } from "./features/network-modifications/shunt-compensator/modification/shuntCompensatorModification.utils.js";
322
324
  import { BuildStatusChip } from "./features/node/build-status-chip.js";
323
325
  import { BuildStatus } from "./features/node/constant.js";
324
326
  import { COLUMNS_WITHOUT_BORDER, DEPTH_CELL_WIDTH, DROP_FORBIDDEN_INDICATOR_BOTTOM, DROP_FORBIDDEN_INDICATOR_TOP, DROP_INDICATOR_BOTTOM, DROP_INDICATOR_TOP, MODIFICATION_ROW_HEIGHT, createCellBorderColor, createCellContentWrapperSx, createCellStyle, createEditDescriptionStyle, createHeaderCellStyle, createModificationNameCellStyle, createNameCellLabelBoxSx, createNameCellRootStyle, createRootNetworkChipCellSx, createRowSx, networkModificationTableStyles } from "./features/network-modification-table/network-modification-table-styles.js";
@@ -356,7 +358,7 @@ import { useSelectAppearance } from "./hooks/useSelectAppearance.js";
356
358
  import { OptionalServicesStatus, useParametersBackend } from "./hooks/use-parameters-backend.js";
357
359
  import { useGetLabelEquipmentTypes } from "./hooks/useGetLabelEquipmentTypes.js";
358
360
  import { LOGOUT_ERROR, RESET_AUTHENTICATION_ROUTER_ERROR, SHOW_AUTH_INFO_LOGIN, SIGNIN_CALLBACK_ERROR, UNAUTHORIZED_USER_INFO, USER, USER_VALIDATION_ERROR, resetAuthenticationRouterError, setLoggedUser, setLogoutError, setShowAuthenticationRouterLogin, setSignInCallbackError, setUnauthorizedUserInfo, setUserValidationError } from "./redux/actions/authActions.js";
359
- import { getUserToken, setCommonStore } from "./redux/commonStore.js";
361
+ import { getUser, getUserToken, setCommonStore, subscribeToUserState } from "./redux/commonStore.js";
360
362
  import { cardErrorBoundaryEn } from "./translations/en/cardErrorBoundaryEn.js";
361
363
  import { businessErrorsEn } from "./translations/en/businessErrorsEn.js";
362
364
  import { commonButtonEn } from "./translations/en/commonButtonEn.js";
@@ -885,6 +887,7 @@ export {
885
887
  ShortCircuitParametersInLine,
886
888
  ShuntCompensator,
887
889
  ShuntCompensatorCreationForm,
890
+ ShuntCompensatorModificationForm,
888
891
  ShuntCompensatorSelectionForm,
889
892
  SignInCallbackHandler,
890
893
  SilentRenewCallbackHandler,
@@ -1206,6 +1209,7 @@ export {
1206
1209
  getStudyUrlWithNodeUuid,
1207
1210
  getStudyUrlWithNodeUuidAndRootNetworkUuid,
1208
1211
  getSystemLanguage,
1212
+ getUser,
1209
1213
  getUserToken,
1210
1214
  getVoltageInitParameters,
1211
1215
  getVoltageInitUrl,
@@ -1313,9 +1317,14 @@ export {
1313
1317
  shuntCompensatorCreationEmptyFormData,
1314
1318
  shuntCompensatorCreationFormSchema,
1315
1319
  shuntCompensatorCreationFormToDto,
1320
+ shuntCompensatorModificationDtoToForm,
1321
+ shuntCompensatorModificationEmptyFormData,
1322
+ shuntCompensatorModificationFormSchema,
1323
+ shuntCompensatorModificationFormToDto,
1316
1324
  snackWithFallback,
1317
1325
  standardTextField,
1318
1326
  styles,
1327
+ subscribeToUserState,
1319
1328
  substationCreationDtoToForm,
1320
1329
  substationCreationEmptyFormData,
1321
1330
  substationCreationFormSchema,
@@ -4,6 +4,7 @@ export type CommonStoreState = {
4
4
  };
5
5
  interface CommonStore {
6
6
  getState(): CommonStoreState;
7
+ subscribe(listener: () => void): () => void;
7
8
  }
8
9
  /**
9
10
  * Set a copy of the reference to the store to be able to access it from this library.
@@ -11,5 +12,7 @@ interface CommonStore {
11
12
  * NB : temporary solution before refactoring the token management in the whole gridsuite stack.
12
13
  */
13
14
  export declare function setCommonStore(store: CommonStore): void;
15
+ export declare function getUser(): User | null;
14
16
  export declare function getUserToken(): string | undefined;
17
+ export declare function subscribeToUserState(listener: () => void): () => void;
15
18
  export {};
@@ -2,10 +2,19 @@ let commonStore;
2
2
  function setCommonStore(store) {
3
3
  commonStore = store;
4
4
  }
5
+ function getUser() {
6
+ return commonStore?.getState().user ?? null;
7
+ }
5
8
  function getUserToken() {
6
9
  return commonStore?.getState().user?.id_token;
7
10
  }
11
+ function subscribeToUserState(listener) {
12
+ return commonStore?.subscribe(listener) ?? (() => {
13
+ });
14
+ }
8
15
  export {
16
+ getUser,
9
17
  getUserToken,
10
- setCommonStore
18
+ setCommonStore,
19
+ subscribeToUserState
11
20
  };
@@ -1,5 +1,5 @@
1
1
  import { LOGOUT_ERROR, RESET_AUTHENTICATION_ROUTER_ERROR, SHOW_AUTH_INFO_LOGIN, SIGNIN_CALLBACK_ERROR, UNAUTHORIZED_USER_INFO, USER, USER_VALIDATION_ERROR, resetAuthenticationRouterError, setLoggedUser, setLogoutError, setShowAuthenticationRouterLogin, setSignInCallbackError, setUnauthorizedUserInfo, setUserValidationError } from "./actions/authActions.js";
2
- import { getUserToken, setCommonStore } from "./commonStore.js";
2
+ import { getUser, getUserToken, setCommonStore, subscribeToUserState } from "./commonStore.js";
3
3
  export {
4
4
  LOGOUT_ERROR,
5
5
  RESET_AUTHENTICATION_ROUTER_ERROR,
@@ -8,6 +8,7 @@ export {
8
8
  UNAUTHORIZED_USER_INFO,
9
9
  USER,
10
10
  USER_VALIDATION_ERROR,
11
+ getUser,
11
12
  getUserToken,
12
13
  resetAuthenticationRouterError,
13
14
  setCommonStore,
@@ -16,5 +17,6 @@ export {
16
17
  setShowAuthenticationRouterLogin,
17
18
  setSignInCallbackError,
18
19
  setUnauthorizedUserInfo,
19
- setUserValidationError
20
+ setUserValidationError,
21
+ subscribeToUserState
20
22
  };
@@ -127,6 +127,9 @@ export declare const networkModificationsEn: {
127
127
  loadType: string;
128
128
  CreateShuntCompensator: string;
129
129
  ShuntCompensatorCreationError: string;
130
+ ModifyShuntCompensator: string;
131
+ ShuntCompensatorModificationError: string;
132
+ ShuntCompensatorNonlinearError: string;
130
133
  Reactor: string;
131
134
  Capacitor: string;
132
135
  QatNominalVLabel: string;
@@ -132,6 +132,9 @@ const networkModificationsEn = {
132
132
  loadType: "Type",
133
133
  CreateShuntCompensator: "Create shunt compensator (Linear)",
134
134
  ShuntCompensatorCreationError: "Error while creating shunt compensator",
135
+ ModifyShuntCompensator: "Modify shunt compensator (Linear)",
136
+ ShuntCompensatorModificationError: "Error while modifying shunt compensator",
137
+ ShuntCompensatorNonlinearError: "It is currently not possible to modify non-linear shunt compensator",
135
138
  Reactor: "Reactor",
136
139
  Capacitor: "Capacitor",
137
140
  QatNominalVLabel: "Q at nominal voltage (Mvar)",
@@ -127,6 +127,9 @@ export declare const networkModificationsFr: {
127
127
  loadType: string;
128
128
  CreateShuntCompensator: string;
129
129
  ShuntCompensatorCreationError: string;
130
+ ModifyShuntCompensator: string;
131
+ ShuntCompensatorModificationError: string;
132
+ ShuntCompensatorNonlinearError: string;
130
133
  Reactor: string;
131
134
  Capacitor: string;
132
135
  QatNominalVLabel: string;
@@ -132,6 +132,9 @@ const networkModificationsFr = {
132
132
  loadType: "Type",
133
133
  CreateShuntCompensator: "Créer un moyen de compensation statique (Linéaire)",
134
134
  ShuntCompensatorCreationError: "Erreur lors de la création d'un moyen de compensation",
135
+ ModifyShuntCompensator: "Modifier un moyen de compensation statique (Linéaire)",
136
+ ShuntCompensatorModificationError: "Erreur lors de la modification d'un moyen de compensation",
137
+ ShuntCompensatorNonlinearError: "La modification d'un moyen de compensation non linéaire n'est pas possible pour le moment",
135
138
  Reactor: "Réactance",
136
139
  Capacitor: "Condensateur",
137
140
  QatNominalVLabel: "Q à Unom (Mvar)",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gridsuite/commons-ui",
3
- "version": "0.216.0",
3
+ "version": "0.218.0",
4
4
  "description": "common react components for gridsuite applications",
5
5
  "author": "gridsuite team",
6
6
  "homepage": "https://github.com/gridsuite",