@gridsuite/commons-ui 0.294.0 → 0.296.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/features/network-modifications/hvdcLine/vsc/creation/vscHvdcLineCreation.utils.js +2 -2
- package/dist/features/network-modifications/hvdcLine/vsc/modification/vscHvdcLineModification.utils.js +7 -4
- package/dist/features/notifications/NotificationsProvider.js +12 -8
- package/package.json +1 -1
package/dist/features/network-modifications/hvdcLine/vsc/creation/vscHvdcLineCreation.utils.js
CHANGED
|
@@ -36,8 +36,8 @@ const vscHvdcLineCreationFormSchema = object().shape({
|
|
|
36
36
|
[FieldConstants.CONVERTER_STATION_2]: getVscConverterStationCreationSchema()
|
|
37
37
|
}).concat(creationPropertiesSchema).required();
|
|
38
38
|
const vscHvdcLineCreationEmptyFormData = {
|
|
39
|
-
[FieldConstants.EQUIPMENT_ID]:
|
|
40
|
-
[FieldConstants.EQUIPMENT_NAME]:
|
|
39
|
+
[FieldConstants.EQUIPMENT_ID]: "",
|
|
40
|
+
[FieldConstants.EQUIPMENT_NAME]: "",
|
|
41
41
|
[FieldConstants.HVDC_LINE]: getVscHvdcLineCharacteristicsEmptyFormData(false),
|
|
42
42
|
[FieldConstants.CONVERTER_STATION_1]: getVscConverterStationEmptyFormData(false),
|
|
43
43
|
[FieldConstants.CONVERTER_STATION_2]: getVscConverterStationEmptyFormData(false),
|
|
@@ -28,7 +28,7 @@ import "react-resizable-panels";
|
|
|
28
28
|
import "react-papaparse";
|
|
29
29
|
import { getVscHvdcLineCharacteristicsModificationSchema, getVscHvdcLineCharacteristicsEmptyFormData, getVscHvdcLineCharacteristicsModificationDtoToForm } from "../common/characteristics/vscHvdcLineCharacteristicsPane.utils.js";
|
|
30
30
|
import { getVscConverterStationModificationSchema, getVscConverterStationEmptyFormData, converterStationModificationDtoToForm, converterStationModificationFormToDto } from "../common/converterStation/vscConverterStationPane.utils.js";
|
|
31
|
-
import { getInjectionActiveReactivePowerValidationSchemaProperties, getInjectionActiveReactivePowerEditDataProperties } from "../../../common/measurements/injectionActiveReactivePowerForm.utils.js";
|
|
31
|
+
import { getInjectionActiveReactivePowerValidationSchemaProperties, getInjectionActiveReactivePowerEmptyFormDataProperties, getInjectionActiveReactivePowerEditDataProperties } from "../../../common/measurements/injectionActiveReactivePowerForm.utils.js";
|
|
32
32
|
import "react-dom";
|
|
33
33
|
import "../../../../../chunks/index.BJsVzTMz.js";
|
|
34
34
|
import "clsx";
|
|
@@ -72,13 +72,16 @@ const vscHvdcLineModificationFormSchema = object().shape({
|
|
|
72
72
|
[FieldConstants.STATE_ESTIMATION]: vscHvdcLineEstimationFormSchema
|
|
73
73
|
}).concat(modificationPropertiesSchema).required();
|
|
74
74
|
const vscHvdcLineModificationEmptyFormData = {
|
|
75
|
-
[FieldConstants.EQUIPMENT_ID]:
|
|
76
|
-
[FieldConstants.EQUIPMENT_NAME]:
|
|
75
|
+
[FieldConstants.EQUIPMENT_ID]: "",
|
|
76
|
+
[FieldConstants.EQUIPMENT_NAME]: "",
|
|
77
77
|
[FieldConstants.HVDC_LINE]: getVscHvdcLineCharacteristicsEmptyFormData(true),
|
|
78
78
|
[FieldConstants.CONVERTER_STATION_1]: getVscConverterStationEmptyFormData(true),
|
|
79
79
|
[FieldConstants.CONVERTER_STATION_2]: getVscConverterStationEmptyFormData(true),
|
|
80
80
|
[FieldConstants.ADDITIONAL_PROPERTIES]: [],
|
|
81
|
-
[FieldConstants.STATE_ESTIMATION]:
|
|
81
|
+
[FieldConstants.STATE_ESTIMATION]: {
|
|
82
|
+
[FieldConstants.CONVERTER_STATION_1]: getInjectionActiveReactivePowerEmptyFormDataProperties(),
|
|
83
|
+
[FieldConstants.CONVERTER_STATION_2]: getInjectionActiveReactivePowerEmptyFormDataProperties()
|
|
84
|
+
}
|
|
82
85
|
};
|
|
83
86
|
const vscHvdcLineModificationDtoToForm = (lineDto, includePreviousValues = true) => {
|
|
84
87
|
return {
|
|
@@ -8,10 +8,6 @@ const DELAY_BEFORE_WEBSOCKET_CONNECTED = 12e3;
|
|
|
8
8
|
function isUrlDefined(tuple) {
|
|
9
9
|
return tuple[1] !== void 0;
|
|
10
10
|
}
|
|
11
|
-
function appendTokenToUrl(url, token) {
|
|
12
|
-
const sep = url.includes("?") ? "&" : "?";
|
|
13
|
-
return `${url}${sep}access_token=${encodeURIComponent(token)}`;
|
|
14
|
-
}
|
|
15
11
|
function NotificationsProvider({ urls, children }) {
|
|
16
12
|
const {
|
|
17
13
|
broadcast: broadcastMessage,
|
|
@@ -31,10 +27,18 @@ function NotificationsProvider({ urls, children }) {
|
|
|
31
27
|
return void 0;
|
|
32
28
|
}
|
|
33
29
|
const connections = Object.entries(urls).filter(isUrlDefined).map(([urlKey, url]) => {
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
30
|
+
const protocols = ["token", ""];
|
|
31
|
+
const rws = new ReconnectingWebSocket(
|
|
32
|
+
() => {
|
|
33
|
+
protocols[1] = getUserToken() ?? "";
|
|
34
|
+
return url;
|
|
35
|
+
},
|
|
36
|
+
protocols,
|
|
37
|
+
{
|
|
38
|
+
// this option set the minimum duration being connected before reset the retry count to 0
|
|
39
|
+
minUptime: DELAY_BEFORE_WEBSOCKET_CONNECTED
|
|
40
|
+
}
|
|
41
|
+
);
|
|
38
42
|
rws.onmessage = broadcastMessage(urlKey);
|
|
39
43
|
rws.onclose = (event) => {
|
|
40
44
|
console.error(`Unexpected ${urlKey} Notification WebSocket closed`, event);
|