@gridsuite/commons-ui 0.102.0 → 0.104.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/icons/DeviceHubIcon.d.ts +11 -0
- package/dist/components/icons/DeviceHubIcon.js +15 -0
- package/dist/components/icons/index.d.ts +1 -0
- package/dist/components/icons/index.js +2 -0
- package/dist/components/index.js +2 -0
- package/dist/components/topBar/UserInformationDialog.js +14 -7
- package/dist/hooks/useModificationLabelComputer.js +2 -0
- package/dist/index.js +2 -0
- package/dist/translations/en/networkModificationsEn.d.ts +1 -0
- package/dist/translations/en/networkModificationsEn.js +2 -1
- package/dist/translations/en/topBarEn.d.ts +4 -2
- package/dist/translations/en/topBarEn.js +4 -2
- package/dist/translations/fr/networkModificationsFr.d.ts +1 -0
- package/dist/translations/fr/networkModificationsFr.js +2 -1
- package/dist/translations/fr/topBarFr.d.ts +4 -2
- package/dist/translations/fr/topBarFr.js +4 -2
- package/dist/utils/types/modificationType.d.ts +5 -1
- package/dist/utils/types/modificationType.js +5 -0
- package/package.json +1 -1
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025, RTE (http://www.rte-france.com)
|
|
3
|
+
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
4
|
+
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
5
|
+
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
6
|
+
*/
|
|
7
|
+
interface DeviceHubProps {
|
|
8
|
+
style?: React.CSSProperties;
|
|
9
|
+
}
|
|
10
|
+
export declare function DeviceHubIcon({ style }: DeviceHubProps): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import DeviceHub from "@material-symbols/svg-400/outlined/device_hub.svg?react";
|
|
3
|
+
import { useTheme } from "@mui/material";
|
|
4
|
+
function DeviceHubIcon({ style }) {
|
|
5
|
+
const theme = useTheme();
|
|
6
|
+
const defaultStyle = {
|
|
7
|
+
width: 15,
|
|
8
|
+
height: 15,
|
|
9
|
+
fill: theme.palette.text.primary
|
|
10
|
+
};
|
|
11
|
+
return /* @__PURE__ */ jsx(DeviceHub, { style: { ...defaultStyle, ...style } });
|
|
12
|
+
}
|
|
13
|
+
export {
|
|
14
|
+
DeviceHubIcon
|
|
15
|
+
};
|
package/dist/components/index.js
CHANGED
|
@@ -111,6 +111,7 @@ import { useNotificationsListener } from "./notifications/hooks/useNotifications
|
|
|
111
111
|
import { useListenerManager } from "./notifications/hooks/useListenerManager.js";
|
|
112
112
|
import { LeftPanelOpenIcon } from "./icons/LeftPanelOpenIcon.js";
|
|
113
113
|
import { LeftPanelCloseIcon } from "./icons/LeftPanelCloseIcon.js";
|
|
114
|
+
import { DeviceHubIcon } from "./icons/DeviceHubIcon.js";
|
|
114
115
|
import { ComputingType, formatComputingTypeLabel, isValidComputingType } from "./parameters/common/computing-type.js";
|
|
115
116
|
import { PARAM_SA_FLOW_PROPORTIONAL_THRESHOLD, PARAM_SA_HIGH_VOLTAGE_ABSOLUTE_THRESHOLD, PARAM_SA_HIGH_VOLTAGE_PROPORTIONAL_THRESHOLD, PARAM_SA_LOW_VOLTAGE_ABSOLUTE_THRESHOLD, PARAM_SA_LOW_VOLTAGE_PROPORTIONAL_THRESHOLD, PARAM_SA_PROVIDER, PROVIDER, VOLTAGE_LEVEL } from "./parameters/common/constant.js";
|
|
116
117
|
import { LineSeparator } from "./parameters/common/line-separator.js";
|
|
@@ -191,6 +192,7 @@ export {
|
|
|
191
192
|
DescriptionField,
|
|
192
193
|
DescriptionModificationDialog,
|
|
193
194
|
DevModeBanner,
|
|
195
|
+
DeviceHubIcon,
|
|
194
196
|
DirectoryItemSelector,
|
|
195
197
|
DirectoryItemsInput,
|
|
196
198
|
ENERGY_SOURCE_OPTIONS,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
2
|
import { Dialog, DialogTitle, DialogContent, Grid, Typography, Box, DialogActions } from "@mui/material";
|
|
3
3
|
import { FormattedMessage } from "react-intl";
|
|
4
|
-
import { useState, useEffect } from "react";
|
|
4
|
+
import { useState, useEffect, Fragment } from "react";
|
|
5
5
|
import { CancelButton } from "../inputs/reactHookForm/utils/CancelButton.js";
|
|
6
6
|
import { fetchUserDetails } from "../../services/userAdmin.js";
|
|
7
7
|
const styles = {
|
|
@@ -12,6 +12,7 @@ const styles = {
|
|
|
12
12
|
usedTopography: { marginLeft: "15%" }
|
|
13
13
|
};
|
|
14
14
|
function UserInformationDialog({ openDialog, user, onClose }) {
|
|
15
|
+
var _a;
|
|
15
16
|
const [userDetails, setUserDetails] = useState(void 0);
|
|
16
17
|
const getUserDetails = (userName) => {
|
|
17
18
|
fetchUserDetails(userName).then((response) => {
|
|
@@ -25,17 +26,23 @@ function UserInformationDialog({ openDialog, user, onClose }) {
|
|
|
25
26
|
getUserDetails(user == null ? void 0 : user.profile.sub);
|
|
26
27
|
}
|
|
27
28
|
}, [openDialog, user]);
|
|
29
|
+
const rolesString = ((_a = user == null ? void 0 : user.profile) == null ? void 0 : _a.profile) ?? "";
|
|
30
|
+
const rolesList = rolesString ? rolesString.split("|").map((role) => role.trim()) : [];
|
|
28
31
|
return /* @__PURE__ */ jsxs(Dialog, { open: openDialog && !!user && !!userDetails, onClose, children: [
|
|
29
32
|
/* @__PURE__ */ jsx(DialogTitle, { fontWeight: "bold", sx: styles.DialogTitle, children: /* @__PURE__ */ jsx(FormattedMessage, { id: "user-information-dialog/title" }) }),
|
|
30
33
|
/* @__PURE__ */ jsxs(DialogContent, { children: [
|
|
31
34
|
/* @__PURE__ */ jsxs(Grid, { container: true, spacing: 2, sx: styles.DialogContent, children: [
|
|
32
35
|
/* @__PURE__ */ jsx(Grid, { item: true, xs: 6, children: /* @__PURE__ */ jsx(Typography, { fontWeight: "bold", children: /* @__PURE__ */ jsx(FormattedMessage, { id: "user-information-dialog/role" }) }) }),
|
|
33
|
-
/* @__PURE__ */ jsx(Grid, { item: true, xs: 6, children: /* @__PURE__ */ jsx(Typography, { children: /* @__PURE__ */
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
36
|
+
/* @__PURE__ */ jsx(Grid, { item: true, xs: 6, children: rolesList.length > 0 ? /* @__PURE__ */ jsx(Typography, { children: rolesList.map((role, index) => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
37
|
+
index > 0 && " | ",
|
|
38
|
+
/* @__PURE__ */ jsx(
|
|
39
|
+
FormattedMessage,
|
|
40
|
+
{
|
|
41
|
+
id: `user-information-dialog/${role}`,
|
|
42
|
+
defaultMessage: role
|
|
43
|
+
}
|
|
44
|
+
)
|
|
45
|
+
] }, role)) }) : /* @__PURE__ */ jsx(Typography, { children: /* @__PURE__ */ jsx(FormattedMessage, { id: "user-information-dialog/no-roles" }) }) }),
|
|
39
46
|
/* @__PURE__ */ jsx(Grid, { item: true, xs: 6, children: /* @__PURE__ */ jsx(Typography, { fontWeight: "bold", children: /* @__PURE__ */ jsx(FormattedMessage, { id: "user-information-dialog/profile" }) }) }),
|
|
40
47
|
/* @__PURE__ */ jsx(Grid, { item: true, xs: 6, children: (userDetails == null ? void 0 : userDetails.profileName) === null ? /* @__PURE__ */ jsx(FormattedMessage, { id: "user-information-dialog/no-profile" }) : /* @__PURE__ */ jsx(Typography, { children: userDetails == null ? void 0 : userDetails.profileName }) })
|
|
41
48
|
] }),
|
|
@@ -51,6 +51,8 @@ const useModificationLabelComputer = () => {
|
|
|
51
51
|
return intl.formatMessage({
|
|
52
52
|
id: `network_modifications.tabular.${modificationMetadata.tabularCreationType}`
|
|
53
53
|
});
|
|
54
|
+
case MODIFICATION_TYPES.COUPLING_DEVICE_CREATION.type:
|
|
55
|
+
return modificationMetadata.voltageLevelId;
|
|
54
56
|
default:
|
|
55
57
|
return modificationMetadata.equipmentId || "";
|
|
56
58
|
}
|
package/dist/index.js
CHANGED
|
@@ -112,6 +112,7 @@ import { useNotificationsListener } from "./components/notifications/hooks/useNo
|
|
|
112
112
|
import { useListenerManager } from "./components/notifications/hooks/useListenerManager.js";
|
|
113
113
|
import { LeftPanelOpenIcon } from "./components/icons/LeftPanelOpenIcon.js";
|
|
114
114
|
import { LeftPanelCloseIcon } from "./components/icons/LeftPanelCloseIcon.js";
|
|
115
|
+
import { DeviceHubIcon } from "./components/icons/DeviceHubIcon.js";
|
|
115
116
|
import { ComputingType, formatComputingTypeLabel, isValidComputingType } from "./components/parameters/common/computing-type.js";
|
|
116
117
|
import { PARAM_SA_FLOW_PROPORTIONAL_THRESHOLD, PARAM_SA_HIGH_VOLTAGE_ABSOLUTE_THRESHOLD, PARAM_SA_HIGH_VOLTAGE_PROPORTIONAL_THRESHOLD, PARAM_SA_LOW_VOLTAGE_ABSOLUTE_THRESHOLD, PARAM_SA_LOW_VOLTAGE_PROPORTIONAL_THRESHOLD, PARAM_SA_PROVIDER, PROVIDER, VOLTAGE_LEVEL } from "./components/parameters/common/constant.js";
|
|
117
118
|
import { LineSeparator } from "./components/parameters/common/line-separator.js";
|
|
@@ -291,6 +292,7 @@ export {
|
|
|
291
292
|
DescriptionField,
|
|
292
293
|
DescriptionModificationDialog,
|
|
293
294
|
DevModeBanner,
|
|
295
|
+
DeviceHubIcon,
|
|
294
296
|
DirectoryItemSelector,
|
|
295
297
|
DirectoryItemsInput,
|
|
296
298
|
DistributionType,
|
|
@@ -62,4 +62,5 @@ export declare const networkModificationsEn: {
|
|
|
62
62
|
'network_modifications.STATIC_VAR_COMPENSATOR_CREATION': string;
|
|
63
63
|
'network_modifications.VOLTAGE_LEVEL_CREATION_SUBSTATION_CREATION': string;
|
|
64
64
|
'network_modifications.VOLTAGE_LEVEL_TOPOLOGY_MODIFICATION': string;
|
|
65
|
+
'network_modifications.COUPLING_DEVICE_CREATION': string;
|
|
65
66
|
};
|
|
@@ -55,7 +55,8 @@ const networkModificationsEn = {
|
|
|
55
55
|
"network_modifications.LCC_MODIFICATION": "Modifying HVDC (LCC) {computedLabel}",
|
|
56
56
|
"network_modifications.STATIC_VAR_COMPENSATOR_CREATION": "Creating static var compensator {computedLabel}",
|
|
57
57
|
"network_modifications.VOLTAGE_LEVEL_CREATION_SUBSTATION_CREATION": "Creating voltage level {voltageLevelEquipmentId} and substation {substationEquipmentId}",
|
|
58
|
-
"network_modifications.VOLTAGE_LEVEL_TOPOLOGY_MODIFICATION": "Modifying voltage level topology {computedLabel}"
|
|
58
|
+
"network_modifications.VOLTAGE_LEVEL_TOPOLOGY_MODIFICATION": "Modifying voltage level topology {computedLabel}",
|
|
59
|
+
"network_modifications.COUPLING_DEVICE_CREATION": "Creating a coupling device in voltage level {computedLabel}"
|
|
59
60
|
};
|
|
60
61
|
export {
|
|
61
62
|
networkModificationsEn
|
|
@@ -30,8 +30,10 @@ export declare const topBarEn: {
|
|
|
30
30
|
'about-dialog/module-tooltip-other': string;
|
|
31
31
|
'user-information-dialog/title': string;
|
|
32
32
|
'user-information-dialog/role': string;
|
|
33
|
-
'user-information-dialog/
|
|
34
|
-
'user-information-dialog/
|
|
33
|
+
'user-information-dialog/UTILISATEURS': string;
|
|
34
|
+
'user-information-dialog/ADMIN': string;
|
|
35
|
+
'user-information-dialog/ADMIN_EXPLORE': string;
|
|
36
|
+
'user-information-dialog/no-roles': string;
|
|
35
37
|
'user-information-dialog/profile': string;
|
|
36
38
|
'user-information-dialog/no-profile': string;
|
|
37
39
|
'user-information-dialog/quotas': string;
|
|
@@ -24,8 +24,10 @@ const topBarEn = {
|
|
|
24
24
|
"about-dialog/module-tooltip-other": "other",
|
|
25
25
|
"user-information-dialog/title": "User information",
|
|
26
26
|
"user-information-dialog/role": "Role",
|
|
27
|
-
"user-information-dialog/
|
|
28
|
-
"user-information-dialog/
|
|
27
|
+
"user-information-dialog/UTILISATEURS": "User",
|
|
28
|
+
"user-information-dialog/ADMIN": "Admin",
|
|
29
|
+
"user-information-dialog/ADMIN_EXPLORE": "Admin Explore",
|
|
30
|
+
"user-information-dialog/no-roles": "No roles",
|
|
29
31
|
"user-information-dialog/profile": "Profile",
|
|
30
32
|
"user-information-dialog/no-profile": "No profile",
|
|
31
33
|
"user-information-dialog/quotas": "User quotas",
|
|
@@ -62,4 +62,5 @@ export declare const networkModificationsFr: {
|
|
|
62
62
|
'network_modifications.STATIC_VAR_COMPENSATOR_CREATION': string;
|
|
63
63
|
'network_modifications.VOLTAGE_LEVEL_CREATION_SUBSTATION_CREATION': string;
|
|
64
64
|
'network_modifications.VOLTAGE_LEVEL_TOPOLOGY_MODIFICATION': string;
|
|
65
|
+
'network_modifications.COUPLING_DEVICE_CREATION': string;
|
|
65
66
|
};
|
|
@@ -55,7 +55,8 @@ const networkModificationsFr = {
|
|
|
55
55
|
"network_modifications.LCC_MODIFICATION": "Modification de la HVDC (LCC) {computedLabel}",
|
|
56
56
|
"network_modifications.STATIC_VAR_COMPENSATOR_CREATION": "Création de CSPR {computedLabel}",
|
|
57
57
|
"network_modifications.VOLTAGE_LEVEL_CREATION_SUBSTATION_CREATION": "Création du poste {voltageLevelEquipmentId} et du site {substationEquipmentId}",
|
|
58
|
-
"network_modifications.VOLTAGE_LEVEL_TOPOLOGY_MODIFICATION": "Modification de la topologie du poste {computedLabel}"
|
|
58
|
+
"network_modifications.VOLTAGE_LEVEL_TOPOLOGY_MODIFICATION": "Modification de la topologie du poste {computedLabel}",
|
|
59
|
+
"network_modifications.COUPLING_DEVICE_CREATION": "Création de couplage / omnibus dans le poste {computedLabel}"
|
|
59
60
|
};
|
|
60
61
|
export {
|
|
61
62
|
networkModificationsFr
|
|
@@ -30,8 +30,10 @@ export declare const topBarFr: {
|
|
|
30
30
|
'about-dialog/module-tooltip-other': string;
|
|
31
31
|
'user-information-dialog/title': string;
|
|
32
32
|
'user-information-dialog/role': string;
|
|
33
|
-
'user-information-dialog/
|
|
34
|
-
'user-information-dialog/
|
|
33
|
+
'user-information-dialog/UTILISATEURS': string;
|
|
34
|
+
'user-information-dialog/ADMIN': string;
|
|
35
|
+
'user-information-dialog/ADMIN_EXPLORE': string;
|
|
36
|
+
'user-information-dialog/no-roles': string;
|
|
35
37
|
'user-information-dialog/profile': string;
|
|
36
38
|
'user-information-dialog/no-profile': string;
|
|
37
39
|
'user-information-dialog/quotas': string;
|
|
@@ -24,8 +24,10 @@ const topBarFr = {
|
|
|
24
24
|
"about-dialog/module-tooltip-other": "autre",
|
|
25
25
|
"user-information-dialog/title": "Informations utilisateur",
|
|
26
26
|
"user-information-dialog/role": "Rôle",
|
|
27
|
-
"user-information-dialog/
|
|
28
|
-
"user-information-dialog/
|
|
27
|
+
"user-information-dialog/UTILISATEURS": "Utilisateur",
|
|
28
|
+
"user-information-dialog/ADMIN": "Admin",
|
|
29
|
+
"user-information-dialog/ADMIN_EXPLORE": "Admin Explore",
|
|
30
|
+
"user-information-dialog/no-roles": "Pas de rôle",
|
|
29
31
|
"user-information-dialog/profile": "Profil",
|
|
30
32
|
"user-information-dialog/no-profile": "Pas de profil",
|
|
31
33
|
"user-information-dialog/quotas": "Quotas",
|
|
@@ -49,7 +49,8 @@ export declare enum ModificationType {
|
|
|
49
49
|
LCC_CONVERTER_STATION_MODIFICATION = "LCC_CONVERTER_STATION_MODIFICATION",
|
|
50
50
|
LCC_CREATION = "LCC_CREATION",
|
|
51
51
|
LCC_MODIFICATION = "LCC_MODIFICATION",
|
|
52
|
-
VOLTAGE_LEVEL_TOPOLOGY_MODIFICATION = "VOLTAGE_LEVEL_TOPOLOGY_MODIFICATION"
|
|
52
|
+
VOLTAGE_LEVEL_TOPOLOGY_MODIFICATION = "VOLTAGE_LEVEL_TOPOLOGY_MODIFICATION",
|
|
53
|
+
COUPLING_DEVICE_CREATION = "COUPLING_DEVICE_CREATION"
|
|
53
54
|
}
|
|
54
55
|
export declare const MODIFICATION_TYPES: {
|
|
55
56
|
GROOVY_SCRIPT: {
|
|
@@ -190,4 +191,7 @@ export declare const MODIFICATION_TYPES: {
|
|
|
190
191
|
VOLTAGE_LEVEL_TOPOLOGY_MODIFICATION: {
|
|
191
192
|
type: ModificationType;
|
|
192
193
|
};
|
|
194
|
+
COUPLING_DEVICE_CREATION: {
|
|
195
|
+
type: ModificationType;
|
|
196
|
+
};
|
|
193
197
|
};
|
|
@@ -44,6 +44,7 @@ var ModificationType = /* @__PURE__ */ ((ModificationType2) => {
|
|
|
44
44
|
ModificationType2["LCC_CREATION"] = "LCC_CREATION";
|
|
45
45
|
ModificationType2["LCC_MODIFICATION"] = "LCC_MODIFICATION";
|
|
46
46
|
ModificationType2["VOLTAGE_LEVEL_TOPOLOGY_MODIFICATION"] = "VOLTAGE_LEVEL_TOPOLOGY_MODIFICATION";
|
|
47
|
+
ModificationType2["COUPLING_DEVICE_CREATION"] = "COUPLING_DEVICE_CREATION";
|
|
47
48
|
return ModificationType2;
|
|
48
49
|
})(ModificationType || {});
|
|
49
50
|
const MODIFICATION_TYPES = {
|
|
@@ -228,6 +229,10 @@ const MODIFICATION_TYPES = {
|
|
|
228
229
|
VOLTAGE_LEVEL_TOPOLOGY_MODIFICATION: {
|
|
229
230
|
type: "VOLTAGE_LEVEL_TOPOLOGY_MODIFICATION"
|
|
230
231
|
/* VOLTAGE_LEVEL_TOPOLOGY_MODIFICATION */
|
|
232
|
+
},
|
|
233
|
+
COUPLING_DEVICE_CREATION: {
|
|
234
|
+
type: "COUPLING_DEVICE_CREATION"
|
|
235
|
+
/* COUPLING_DEVICE_CREATION */
|
|
231
236
|
}
|
|
232
237
|
};
|
|
233
238
|
export {
|