@gridsuite/commons-ui 0.68.0 → 0.68.1
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/topBar/TopBar.js +9 -2
- package/dist/components/topBar/UserInformationDialog.js +5 -8
- package/dist/translations/en/topBarEn.d.ts +1 -1
- package/dist/translations/en/topBarEn.js +1 -1
- package/dist/translations/fr/topBarFr.d.ts +1 -1
- package/dist/translations/fr/topBarFr.js +2 -2
- package/dist/utils/types/metadata.d.ts +1 -0
- package/package.json +1 -1
|
@@ -183,6 +183,13 @@ function TopBar({
|
|
|
183
183
|
setAboutDialogOpen(true);
|
|
184
184
|
}
|
|
185
185
|
};
|
|
186
|
+
const isHiddenUserInformation = () => {
|
|
187
|
+
if (appsAndUrls) {
|
|
188
|
+
const app = appsAndUrls.find((item) => item.name === appName);
|
|
189
|
+
return (app == null ? void 0 : app.hiddenUserInformation) ?? false;
|
|
190
|
+
}
|
|
191
|
+
return false;
|
|
192
|
+
};
|
|
186
193
|
const onUserInformationDialogClicked = () => {
|
|
187
194
|
setAnchorElSettingsMenu(null);
|
|
188
195
|
openUserInformationDialog();
|
|
@@ -438,7 +445,7 @@ function TopBar({
|
|
|
438
445
|
}
|
|
439
446
|
) }) })
|
|
440
447
|
] }),
|
|
441
|
-
/* @__PURE__ */ jsxs(
|
|
448
|
+
!isHiddenUserInformation() && /* @__PURE__ */ jsxs(
|
|
442
449
|
StyledMenuItem,
|
|
443
450
|
{
|
|
444
451
|
sx: styles.borderBottom,
|
|
@@ -487,7 +494,7 @@ function TopBar({
|
|
|
487
494
|
/* @__PURE__ */ jsx(
|
|
488
495
|
AboutDialog,
|
|
489
496
|
{
|
|
490
|
-
open: isAboutDialogOpen,
|
|
497
|
+
open: isAboutDialogOpen && !!user,
|
|
491
498
|
onClose: () => setAboutDialogOpen(false),
|
|
492
499
|
appName,
|
|
493
500
|
appVersion,
|
|
@@ -22,15 +22,12 @@ function UserInformationDialog({ openDialog, user, onClose }) {
|
|
|
22
22
|
});
|
|
23
23
|
};
|
|
24
24
|
useEffect(() => {
|
|
25
|
-
if (
|
|
26
|
-
onClose();
|
|
27
|
-
}
|
|
28
|
-
if (user == null ? void 0 : user.profile.sub) {
|
|
25
|
+
if (openDialog && (user == null ? void 0 : user.profile.sub)) {
|
|
29
26
|
getUserDetails(user == null ? void 0 : user.profile.sub);
|
|
30
27
|
}
|
|
31
|
-
}, [
|
|
32
|
-
return /* @__PURE__ */ jsxs(Dialog, { open: openDialog && !!userDetails, onClose, children: [
|
|
33
|
-
/* @__PURE__ */ jsx(DialogTitle, { sx: styles.DialogTitle, children: /* @__PURE__ */ jsx(FormattedMessage, { id: "user-information-dialog/title" }) }),
|
|
28
|
+
}, [openDialog, user]);
|
|
29
|
+
return /* @__PURE__ */ jsxs(Dialog, { open: openDialog && !!user && !!userDetails, onClose, children: [
|
|
30
|
+
/* @__PURE__ */ jsx(DialogTitle, { fontWeight: "bold", sx: styles.DialogTitle, children: /* @__PURE__ */ jsx(FormattedMessage, { id: "user-information-dialog/title" }) }),
|
|
34
31
|
/* @__PURE__ */ jsxs(DialogContent, { children: [
|
|
35
32
|
/* @__PURE__ */ jsxs(Grid, { container: true, spacing: 2, sx: styles.DialogContent, children: [
|
|
36
33
|
/* @__PURE__ */ jsx(Grid, { item: true, xs: 6, children: /* @__PURE__ */ jsx(Typography, { fontWeight: "bold", children: /* @__PURE__ */ jsx(FormattedMessage, { id: "user-information-dialog/role" }) }) }),
|
|
@@ -40,7 +37,7 @@ function UserInformationDialog({ openDialog, user, onClose }) {
|
|
|
40
37
|
id: (userDetails == null ? void 0 : userDetails.isAdmin) ? "user-information-dialog/role-admin" : "user-information-dialog/role-user"
|
|
41
38
|
}
|
|
42
39
|
) }) }),
|
|
43
|
-
/* @__PURE__ */ jsx(Grid, { item: true, xs: 6, children: /* @__PURE__ */ jsx(Typography, { fontWeight: "bold", children: /* @__PURE__ */ jsx(FormattedMessage, { id: "user-information-dialog/
|
|
40
|
+
/* @__PURE__ */ jsx(Grid, { item: true, xs: 6, children: /* @__PURE__ */ jsx(Typography, { fontWeight: "bold", children: /* @__PURE__ */ jsx(FormattedMessage, { id: "user-information-dialog/profile" }) }) }),
|
|
44
41
|
/* @__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 }) })
|
|
45
42
|
] }),
|
|
46
43
|
/* @__PURE__ */ jsxs(Box, { mt: 3, sx: styles.quotasBox, children: [
|
|
@@ -31,7 +31,7 @@ export declare const topBarEn: {
|
|
|
31
31
|
'user-information-dialog/role': string;
|
|
32
32
|
'user-information-dialog/role-user': string;
|
|
33
33
|
'user-information-dialog/role-admin': string;
|
|
34
|
-
'user-information-dialog/
|
|
34
|
+
'user-information-dialog/profile': string;
|
|
35
35
|
'user-information-dialog/no-profile': string;
|
|
36
36
|
'user-information-dialog/quotas': string;
|
|
37
37
|
'user-information-dialog/number-of-cases-or-studies': string;
|
|
@@ -25,7 +25,7 @@ const topBarEn = {
|
|
|
25
25
|
"user-information-dialog/role": "Role",
|
|
26
26
|
"user-information-dialog/role-user": "Basic user",
|
|
27
27
|
"user-information-dialog/role-admin": "Admin",
|
|
28
|
-
"user-information-dialog/
|
|
28
|
+
"user-information-dialog/profile": "Profile",
|
|
29
29
|
"user-information-dialog/no-profile": "No profile",
|
|
30
30
|
"user-information-dialog/quotas": "User quotas",
|
|
31
31
|
"user-information-dialog/number-of-cases-or-studies": "Number of cases or studies",
|
|
@@ -31,7 +31,7 @@ export declare const topBarFr: {
|
|
|
31
31
|
'user-information-dialog/role': string;
|
|
32
32
|
'user-information-dialog/role-user': string;
|
|
33
33
|
'user-information-dialog/role-admin': string;
|
|
34
|
-
'user-information-dialog/
|
|
34
|
+
'user-information-dialog/profile': string;
|
|
35
35
|
'user-information-dialog/no-profile': string;
|
|
36
36
|
'user-information-dialog/quotas': string;
|
|
37
37
|
'user-information-dialog/number-of-cases-or-studies': string;
|
|
@@ -25,8 +25,8 @@ const topBarFr = {
|
|
|
25
25
|
"user-information-dialog/role": "Rôle",
|
|
26
26
|
"user-information-dialog/role-user": "Utilisateur simple",
|
|
27
27
|
"user-information-dialog/role-admin": "Admin",
|
|
28
|
-
"user-information-dialog/
|
|
29
|
-
"user-information-dialog/no-profile": "Pas de
|
|
28
|
+
"user-information-dialog/profile": "Profil",
|
|
29
|
+
"user-information-dialog/no-profile": "Pas de profil",
|
|
30
30
|
"user-information-dialog/quotas": "Quotas",
|
|
31
31
|
"user-information-dialog/number-of-cases-or-studies": "Nombre situations ou études",
|
|
32
32
|
"user-information-dialog/used": "Utilisé",
|