@gridsuite/commons-ui 0.278.0 → 0.280.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/customAGGrid/separatorCellRenderer.d.ts +7 -2
- package/dist/components/composite/customAGGrid/separatorCellRenderer.js +2 -2
- package/dist/features/index.d.ts +1 -0
- package/dist/features/index.js +19 -0
- package/dist/features/network-modifications/index.js +13 -0
- package/dist/features/network-modifications/voltageLevel/common/HeaderWithTooltip.d.ts +8 -0
- package/dist/features/network-modifications/voltageLevel/common/HeaderWithTooltip.js +119 -0
- package/dist/features/network-modifications/voltageLevel/common/index.d.ts +1 -0
- package/dist/features/network-modifications/voltageLevel/common/index.js +4 -0
- package/dist/features/network-modifications/voltageLevel/index.d.ts +2 -0
- package/dist/features/network-modifications/voltageLevel/index.js +13 -0
- package/dist/features/network-modifications/voltageLevel/moveFeederBays/MoveVoltageLevelFeederBaysForm.d.ts +8 -0
- package/dist/features/network-modifications/voltageLevel/moveFeederBays/MoveVoltageLevelFeederBaysForm.js +387 -0
- package/dist/features/network-modifications/voltageLevel/moveFeederBays/feederBay/FeederBayDirectionCellRender.d.ts +6 -0
- package/dist/features/network-modifications/voltageLevel/moveFeederBays/feederBay/FeederBayDirectionCellRender.js +64 -0
- package/dist/features/network-modifications/voltageLevel/moveFeederBays/feederBay/FeederBayPositionCellRender.d.ts +6 -0
- package/dist/features/network-modifications/voltageLevel/moveFeederBays/feederBay/FeederBayPositionCellRender.js +102 -0
- package/dist/features/network-modifications/voltageLevel/moveFeederBays/feederBay/index.d.ts +2 -0
- package/dist/features/network-modifications/voltageLevel/moveFeederBays/feederBay/index.js +6 -0
- package/dist/features/network-modifications/voltageLevel/moveFeederBays/index.d.ts +4 -0
- package/dist/features/network-modifications/voltageLevel/moveFeederBays/index.js +13 -0
- package/dist/features/network-modifications/voltageLevel/moveFeederBays/moveVoltageLevelFeederBays.type.d.ts +36 -0
- package/dist/features/network-modifications/voltageLevel/moveFeederBays/moveVoltageLevelFeederBays.type.js +1 -0
- package/dist/features/network-modifications/voltageLevel/moveFeederBays/moveVoltageLevelFeederBays.utils.d.ts +37 -0
- package/dist/features/network-modifications/voltageLevel/moveFeederBays/moveVoltageLevelFeederBays.utils.js +86 -0
- package/dist/features/side-bar/AppSideBar.d.ts +27 -0
- package/dist/features/side-bar/AppSideBar.js +102 -0
- package/dist/features/side-bar/AppSideBarHeader.d.ts +11 -0
- package/dist/features/side-bar/AppSideBarHeader.js +54 -0
- package/dist/features/side-bar/dialogs/AppSideBarDialogProvider.d.ts +14 -0
- package/dist/features/side-bar/dialogs/AppSideBarDialogProvider.js +36 -0
- package/dist/features/side-bar/dialogs/AppSideBarDialogs.d.ts +14 -0
- package/dist/features/side-bar/dialogs/AppSideBarDialogs.js +56 -0
- package/dist/features/side-bar/footer/AppSideBarFooter.d.ts +15 -0
- package/dist/features/side-bar/footer/AppSideBarFooter.js +60 -0
- package/dist/features/side-bar/footer/applications/ApplicationMenu.d.ts +5 -0
- package/dist/features/side-bar/footer/applications/ApplicationMenu.js +83 -0
- package/dist/features/side-bar/footer/applications/OtherAppRedirection.d.ts +6 -0
- package/dist/features/side-bar/footer/applications/OtherAppRedirection.js +105 -0
- package/dist/features/side-bar/footer/common/MinimizedSubMenuHeader.d.ts +9 -0
- package/dist/features/side-bar/footer/common/MinimizedSubMenuHeader.js +22 -0
- package/dist/features/side-bar/footer/common/SideBarMenuItem.d.ts +10 -0
- package/dist/features/side-bar/footer/common/SideBarMenuItem.js +76 -0
- package/dist/features/side-bar/footer/common/submenu-footer.style.d.ts +23 -0
- package/dist/features/side-bar/footer/common/submenu-footer.style.js +20 -0
- package/dist/features/side-bar/footer/profile/ProfileInfos.d.ts +4 -0
- package/dist/features/side-bar/footer/profile/ProfileInfos.js +32 -0
- package/dist/features/side-bar/footer/profile/ProfileMenu.d.ts +7 -0
- package/dist/features/side-bar/footer/profile/ProfileMenu.js +95 -0
- package/dist/features/side-bar/footer/profile/UserIcon.d.ts +9 -0
- package/dist/features/side-bar/footer/profile/UserIcon.js +33 -0
- package/dist/features/side-bar/footer/settings/DarkModeToggle.d.ts +7 -0
- package/dist/features/side-bar/footer/settings/DarkModeToggle.js +74 -0
- package/dist/features/side-bar/footer/settings/LanguageSelection.d.ts +8 -0
- package/dist/features/side-bar/footer/settings/LanguageSelection.js +75 -0
- package/dist/features/side-bar/footer/settings/SettingsMenu.d.ts +10 -0
- package/dist/features/side-bar/footer/settings/SettingsMenu.js +112 -0
- package/dist/features/side-bar/index.d.ts +7 -0
- package/dist/features/side-bar/index.js +4 -0
- package/dist/features/topBar/index.d.ts +2 -0
- package/dist/features/topBar/index.js +5 -1
- package/dist/index.js +19 -0
- package/dist/translations/en/networkModificationsEn.d.ts +12 -0
- package/dist/translations/en/networkModificationsEn.js +13 -1
- package/dist/translations/en/topBarEn.d.ts +7 -0
- package/dist/translations/en/topBarEn.js +7 -0
- package/dist/translations/fr/networkModificationsFr.d.ts +12 -0
- package/dist/translations/fr/networkModificationsFr.js +13 -1
- package/dist/translations/fr/topBarFr.d.ts +7 -0
- package/dist/translations/fr/topBarFr.js +7 -0
- package/dist/utils/constants/fieldConstants.d.ts +7 -1
- package/dist/utils/constants/fieldConstants.js +6 -0
- package/package.json +1 -1
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { InferType } from 'yup';
|
|
2
|
+
import { MoveVoltageLevelFeederBaysDto } from './moveVoltageLevelFeederBays.type';
|
|
3
|
+
import * as yup from 'yup';
|
|
4
|
+
export declare const emptyMoveVoltageLevelFeederBaysFormData: {
|
|
5
|
+
equipmentID: null;
|
|
6
|
+
moveVoltageLevelFeederBaysTable: {
|
|
7
|
+
equipmentID: null;
|
|
8
|
+
busbarSectionId: null;
|
|
9
|
+
busbarSectionIds: never[];
|
|
10
|
+
connectionSide: null;
|
|
11
|
+
connectionName: null;
|
|
12
|
+
connectionDirection: null;
|
|
13
|
+
connectionPosition: null;
|
|
14
|
+
isRemoved: boolean;
|
|
15
|
+
isSeparator: boolean;
|
|
16
|
+
}[];
|
|
17
|
+
};
|
|
18
|
+
export declare const moveVoltageLevelFeederBaysFormSchema: yup.ObjectSchema<{
|
|
19
|
+
equipmentID: string;
|
|
20
|
+
moveVoltageLevelFeederBaysTable: {
|
|
21
|
+
connectionSide?: string | null | undefined;
|
|
22
|
+
connectionDirection?: string | null | undefined;
|
|
23
|
+
connectionName?: string | null | undefined;
|
|
24
|
+
connectionPosition?: number | null | undefined;
|
|
25
|
+
equipmentID?: string | undefined;
|
|
26
|
+
busbarSectionId?: string | undefined;
|
|
27
|
+
busbarSectionIds?: (string | undefined)[] | undefined;
|
|
28
|
+
isRemoved?: boolean | undefined;
|
|
29
|
+
isSeparator?: boolean | undefined;
|
|
30
|
+
}[] | undefined;
|
|
31
|
+
}, yup.AnyObject, {
|
|
32
|
+
equipmentID: undefined;
|
|
33
|
+
moveVoltageLevelFeederBaysTable: "";
|
|
34
|
+
}, "">;
|
|
35
|
+
export type MoveVoltageLevelFeederBaysFormSchemaType = InferType<typeof moveVoltageLevelFeederBaysFormSchema>;
|
|
36
|
+
export declare const moveVoltageLevelFeederBaysDtoToForm: (moveVoltageLevelFeederBays: MoveVoltageLevelFeederBaysDto) => MoveVoltageLevelFeederBaysFormSchemaType;
|
|
37
|
+
export declare const moveVoltageLevelFeederBaysFormToDto: (moveVoltageLevelFeederBays: MoveVoltageLevelFeederBaysFormSchemaType) => MoveVoltageLevelFeederBaysDto;
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import * as yup from "yup";
|
|
2
|
+
import { isNumber } from "mathjs";
|
|
3
|
+
import { FieldConstants } from "../../../../utils/constants/fieldConstants.js";
|
|
4
|
+
import "../../../../utils/conversionUtils.js";
|
|
5
|
+
import "../../../../utils/types/equipmentType.js";
|
|
6
|
+
import { ModificationType } from "../../../../utils/types/modificationType.js";
|
|
7
|
+
import "react/jsx-runtime";
|
|
8
|
+
import "@mui/icons-material";
|
|
9
|
+
const emptyMoveVoltageLevelFeederBaysFormData = {
|
|
10
|
+
[FieldConstants.EQUIPMENT_ID]: null,
|
|
11
|
+
[FieldConstants.MOVE_VOLTAGE_LEVEL_FEEDER_BAYS_TABLE]: [
|
|
12
|
+
{
|
|
13
|
+
[FieldConstants.EQUIPMENT_ID]: null,
|
|
14
|
+
[FieldConstants.BUSBAR_SECTION_ID]: null,
|
|
15
|
+
[FieldConstants.BUSBAR_SECTION_IDS]: [],
|
|
16
|
+
[FieldConstants.CONNECTION_SIDE]: null,
|
|
17
|
+
[FieldConstants.CONNECTION_NAME]: null,
|
|
18
|
+
[FieldConstants.CONNECTION_DIRECTION]: null,
|
|
19
|
+
[FieldConstants.CONNECTION_POSITION]: null,
|
|
20
|
+
[FieldConstants.IS_REMOVED]: false,
|
|
21
|
+
[FieldConstants.IS_SEPARATOR]: false
|
|
22
|
+
}
|
|
23
|
+
]
|
|
24
|
+
};
|
|
25
|
+
function requiredWhenActive(schema) {
|
|
26
|
+
return schema.when(
|
|
27
|
+
[FieldConstants.IS_REMOVED, FieldConstants.IS_SEPARATOR],
|
|
28
|
+
([isRemoved, isSeparator], baseSchema) => !isRemoved && !isSeparator ? baseSchema.nullable().required() : baseSchema.nullable()
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
const moveVoltageLevelFeederBaysFormSchema = yup.object().shape({
|
|
32
|
+
[FieldConstants.EQUIPMENT_ID]: yup.string().required(),
|
|
33
|
+
[FieldConstants.MOVE_VOLTAGE_LEVEL_FEEDER_BAYS_TABLE]: yup.array().of(
|
|
34
|
+
yup.object().shape({
|
|
35
|
+
[FieldConstants.EQUIPMENT_ID]: requiredWhenActive(yup.string()),
|
|
36
|
+
[FieldConstants.BUSBAR_SECTION_ID]: requiredWhenActive(yup.string()),
|
|
37
|
+
[FieldConstants.BUSBAR_SECTION_IDS]: requiredWhenActive(yup.array().of(yup.string())),
|
|
38
|
+
[FieldConstants.CONNECTION_SIDE]: yup.string().nullable(),
|
|
39
|
+
[FieldConstants.CONNECTION_NAME]: yup.string().nullable(),
|
|
40
|
+
[FieldConstants.CONNECTION_DIRECTION]: yup.string().nullable(),
|
|
41
|
+
[FieldConstants.CONNECTION_POSITION]: yup.number().nullable().positive(),
|
|
42
|
+
[FieldConstants.IS_REMOVED]: yup.boolean(),
|
|
43
|
+
[FieldConstants.IS_SEPARATOR]: yup.boolean()
|
|
44
|
+
})
|
|
45
|
+
)
|
|
46
|
+
});
|
|
47
|
+
const moveVoltageLevelFeederBaysDtoToForm = (moveVoltageLevelFeederBays) => {
|
|
48
|
+
const moveVoltageLevelFeederBaysTable = moveVoltageLevelFeederBays.feederBays.map((row, index) => ({
|
|
49
|
+
[FieldConstants.EQUIPMENT_ID]: row.equipmentId ?? "",
|
|
50
|
+
[FieldConstants.BUSBAR_SECTION_ID]: row.busbarSectionId ?? "",
|
|
51
|
+
[FieldConstants.BUSBAR_SECTION_IDS]: [],
|
|
52
|
+
[FieldConstants.CONNECTION_SIDE]: row.connectionSide ?? null,
|
|
53
|
+
[FieldConstants.CONNECTION_NAME]: row.connectionName ?? null,
|
|
54
|
+
[FieldConstants.CONNECTION_DIRECTION]: row.connectionDirection ?? null,
|
|
55
|
+
[FieldConstants.CONNECTION_POSITION]: isNumber(row.connectionPosition) ? Number.parseInt(row.connectionPosition, 10) : null,
|
|
56
|
+
[FieldConstants.IS_REMOVED]: false,
|
|
57
|
+
[FieldConstants.IS_SEPARATOR]: false,
|
|
58
|
+
[FieldConstants.ROW_ID]: `${row.equipmentId}-${row.connectionSide}-${index}`
|
|
59
|
+
}));
|
|
60
|
+
return {
|
|
61
|
+
[FieldConstants.EQUIPMENT_ID]: moveVoltageLevelFeederBays.voltageLevelId,
|
|
62
|
+
[FieldConstants.MOVE_VOLTAGE_LEVEL_FEEDER_BAYS_TABLE]: moveVoltageLevelFeederBaysTable
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
const moveVoltageLevelFeederBaysFormToDto = (moveVoltageLevelFeederBays) => {
|
|
66
|
+
const tableData = moveVoltageLevelFeederBays[FieldConstants.MOVE_VOLTAGE_LEVEL_FEEDER_BAYS_TABLE];
|
|
67
|
+
const feederBays = tableData && Array.isArray(tableData) ? tableData.filter((row) => row != null).map((row) => ({
|
|
68
|
+
equipmentId: row[FieldConstants.EQUIPMENT_ID] ?? "",
|
|
69
|
+
busbarSectionId: row[FieldConstants.BUSBAR_SECTION_ID] ?? "",
|
|
70
|
+
connectionSide: row[FieldConstants.CONNECTION_SIDE] ?? null,
|
|
71
|
+
connectionPosition: isNumber(row[FieldConstants.CONNECTION_POSITION]) ? row[FieldConstants.CONNECTION_POSITION].toString() : null,
|
|
72
|
+
connectionName: row[FieldConstants.CONNECTION_NAME] ?? null,
|
|
73
|
+
connectionDirection: row[FieldConstants.CONNECTION_DIRECTION] ?? null
|
|
74
|
+
})) : [];
|
|
75
|
+
return {
|
|
76
|
+
type: ModificationType.MOVE_VOLTAGE_LEVEL_FEEDER_BAYS,
|
|
77
|
+
voltageLevelId: moveVoltageLevelFeederBays[FieldConstants.EQUIPMENT_ID],
|
|
78
|
+
feederBays
|
|
79
|
+
};
|
|
80
|
+
};
|
|
81
|
+
export {
|
|
82
|
+
emptyMoveVoltageLevelFeederBaysFormData,
|
|
83
|
+
moveVoltageLevelFeederBaysDtoToForm,
|
|
84
|
+
moveVoltageLevelFeederBaysFormSchema,
|
|
85
|
+
moveVoltageLevelFeederBaysFormToDto
|
|
86
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Breakpoint, Theme } from '@mui/material';
|
|
2
|
+
import { UserProfile } from 'oidc-client-ts';
|
|
3
|
+
import { ReactNode } from 'react';
|
|
4
|
+
import { GridSuiteModule } from '../topBar';
|
|
5
|
+
import { GsLang, GsTheme, Metadata } from '../../utils';
|
|
6
|
+
type SideBarProps = {
|
|
7
|
+
sideBarTheme: Theme;
|
|
8
|
+
isDeveloperMode: boolean;
|
|
9
|
+
smallScreenBreakpoint: number | Breakpoint;
|
|
10
|
+
handleChangeDeveloperMode: (newValue: boolean) => void;
|
|
11
|
+
currentTheme: GsTheme;
|
|
12
|
+
setTheme: (newTheme: GsTheme) => void;
|
|
13
|
+
selectedLanguage: GsLang;
|
|
14
|
+
setSelectedLanguage: (newSelectedLanguage: GsLang) => void;
|
|
15
|
+
userProfile?: UserProfile;
|
|
16
|
+
appsAndUrls: Metadata[];
|
|
17
|
+
onLogoutClick?: () => void;
|
|
18
|
+
appName: string;
|
|
19
|
+
appNameColor: string;
|
|
20
|
+
appLogo: ReactNode;
|
|
21
|
+
appLicense?: string;
|
|
22
|
+
appVersion?: string;
|
|
23
|
+
globalVersionPromise: () => Promise<string>;
|
|
24
|
+
additionalModulesPromise: () => Promise<GridSuiteModule[]>;
|
|
25
|
+
};
|
|
26
|
+
export declare function AppSideBar({ sideBarTheme, isDeveloperMode, smallScreenBreakpoint, handleChangeDeveloperMode, currentTheme, setTheme, selectedLanguage, setSelectedLanguage, userProfile, appsAndUrls, appName, appNameColor, appLogo, appLicense, appVersion, globalVersionPromise, additionalModulesPromise, onLogoutClick, }: Readonly<SideBarProps>): import("react").JSX.Element;
|
|
27
|
+
export {};
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useMediaQuery, ThemeProvider, ScopedCssBaseline, Stack, Box } from "@mui/material";
|
|
3
|
+
import { useState, useEffect } from "react";
|
|
4
|
+
import { AppSideBarHeader } from "./AppSideBarHeader.js";
|
|
5
|
+
import { AppSideBarFooter } from "./footer/AppSideBarFooter.js";
|
|
6
|
+
import { AppSideBarDialogProvider } from "./dialogs/AppSideBarDialogProvider.js";
|
|
7
|
+
import { AppSideBarDialogs } from "./dialogs/AppSideBarDialogs.js";
|
|
8
|
+
function AppSideBar({
|
|
9
|
+
sideBarTheme,
|
|
10
|
+
isDeveloperMode,
|
|
11
|
+
smallScreenBreakpoint,
|
|
12
|
+
handleChangeDeveloperMode,
|
|
13
|
+
currentTheme,
|
|
14
|
+
setTheme,
|
|
15
|
+
selectedLanguage,
|
|
16
|
+
setSelectedLanguage,
|
|
17
|
+
userProfile,
|
|
18
|
+
appsAndUrls,
|
|
19
|
+
appName,
|
|
20
|
+
appNameColor,
|
|
21
|
+
appLogo,
|
|
22
|
+
appLicense,
|
|
23
|
+
appVersion,
|
|
24
|
+
globalVersionPromise,
|
|
25
|
+
additionalModulesPromise,
|
|
26
|
+
onLogoutClick
|
|
27
|
+
}) {
|
|
28
|
+
const [isMinimized, setIsMinimized] = useState(true);
|
|
29
|
+
const toggleSideBarMinimized = () => {
|
|
30
|
+
setIsMinimized((previousIsSideBarMinimized) => !previousIsSideBarMinimized);
|
|
31
|
+
};
|
|
32
|
+
const isSmallScreen = useMediaQuery((theme) => theme.breakpoints.down(smallScreenBreakpoint));
|
|
33
|
+
useEffect(() => {
|
|
34
|
+
if (isSmallScreen) {
|
|
35
|
+
setIsMinimized(true);
|
|
36
|
+
}
|
|
37
|
+
}, [isSmallScreen]);
|
|
38
|
+
return /* @__PURE__ */ jsxs(AppSideBarDialogProvider, { children: [
|
|
39
|
+
/* @__PURE__ */ jsx(
|
|
40
|
+
AppSideBarDialogs,
|
|
41
|
+
{
|
|
42
|
+
appLicense,
|
|
43
|
+
appVersion,
|
|
44
|
+
additionalModulesPromise,
|
|
45
|
+
globalVersionPromise,
|
|
46
|
+
appName,
|
|
47
|
+
userProfile,
|
|
48
|
+
isDeveloperMode,
|
|
49
|
+
handleChangeDeveloperMode
|
|
50
|
+
}
|
|
51
|
+
),
|
|
52
|
+
/* @__PURE__ */ jsx(ThemeProvider, { theme: sideBarTheme, children: /* @__PURE__ */ jsx(ScopedCssBaseline, { children: /* @__PURE__ */ jsxs(
|
|
53
|
+
Stack,
|
|
54
|
+
{
|
|
55
|
+
component: "aside",
|
|
56
|
+
sx: {
|
|
57
|
+
width: isMinimized ? 64 : 224,
|
|
58
|
+
height: "100%"
|
|
59
|
+
},
|
|
60
|
+
children: [
|
|
61
|
+
/* @__PURE__ */ jsx(
|
|
62
|
+
AppSideBarHeader,
|
|
63
|
+
{
|
|
64
|
+
isMinimized,
|
|
65
|
+
isLoggedIn: !!userProfile,
|
|
66
|
+
appName,
|
|
67
|
+
appNameColor,
|
|
68
|
+
appLogo,
|
|
69
|
+
appVersion
|
|
70
|
+
}
|
|
71
|
+
),
|
|
72
|
+
/* @__PURE__ */ jsx(
|
|
73
|
+
Box,
|
|
74
|
+
{
|
|
75
|
+
sx: {
|
|
76
|
+
flex: 1
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
),
|
|
80
|
+
/* @__PURE__ */ jsx(
|
|
81
|
+
AppSideBarFooter,
|
|
82
|
+
{
|
|
83
|
+
isMinimized,
|
|
84
|
+
isSmallScreen,
|
|
85
|
+
toggleSideBarMinimized,
|
|
86
|
+
currentTheme,
|
|
87
|
+
setTheme,
|
|
88
|
+
selectedLanguage,
|
|
89
|
+
setSelectedLanguage,
|
|
90
|
+
userProfile,
|
|
91
|
+
appsAndUrls,
|
|
92
|
+
onLogoutClick
|
|
93
|
+
}
|
|
94
|
+
)
|
|
95
|
+
]
|
|
96
|
+
}
|
|
97
|
+
) }) })
|
|
98
|
+
] });
|
|
99
|
+
}
|
|
100
|
+
export {
|
|
101
|
+
AppSideBar
|
|
102
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
interface AppSideBarHeaderProps {
|
|
3
|
+
isMinimized: boolean;
|
|
4
|
+
isLoggedIn: boolean;
|
|
5
|
+
appName: string;
|
|
6
|
+
appNameColor: string;
|
|
7
|
+
appLogo: ReactNode;
|
|
8
|
+
appVersion?: string;
|
|
9
|
+
}
|
|
10
|
+
export declare function AppSideBarHeader({ isMinimized, isLoggedIn, appName, appNameColor, appLogo, appVersion, }: Readonly<AppSideBarHeaderProps>): import("react").JSX.Element;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { jsxs, jsx, Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { Stack, Typography, Box, Tooltip, IconButton, Divider } from "@mui/material";
|
|
3
|
+
import { Info } from "@mui/icons-material";
|
|
4
|
+
import { useAppSideBarDialogs, SideBarDialogType } from "./dialogs/AppSideBarDialogProvider.js";
|
|
5
|
+
function AppSideBarHeader({
|
|
6
|
+
isMinimized,
|
|
7
|
+
isLoggedIn,
|
|
8
|
+
appName,
|
|
9
|
+
appNameColor,
|
|
10
|
+
appLogo,
|
|
11
|
+
appVersion
|
|
12
|
+
}) {
|
|
13
|
+
const { setOpenDialog } = useAppSideBarDialogs();
|
|
14
|
+
return /* @__PURE__ */ jsxs(
|
|
15
|
+
Stack,
|
|
16
|
+
{
|
|
17
|
+
sx: {
|
|
18
|
+
px: 1.5,
|
|
19
|
+
pt: 3
|
|
20
|
+
},
|
|
21
|
+
spacing: 1,
|
|
22
|
+
children: [
|
|
23
|
+
/* @__PURE__ */ jsxs(Stack, { direction: "row", alignItems: "center", justifyContent: isMinimized ? "center" : "flex-start", children: [
|
|
24
|
+
appLogo,
|
|
25
|
+
!isMinimized && /* @__PURE__ */ jsxs(Typography, { variant: "h6", children: [
|
|
26
|
+
"Grid",
|
|
27
|
+
/* @__PURE__ */ jsx(Box, { component: "span", sx: { color: appNameColor }, children: appName })
|
|
28
|
+
] })
|
|
29
|
+
] }),
|
|
30
|
+
/* @__PURE__ */ jsx(
|
|
31
|
+
Stack,
|
|
32
|
+
{
|
|
33
|
+
direction: "row",
|
|
34
|
+
visibility: isLoggedIn ? "inherit" : "hidden",
|
|
35
|
+
alignItems: "center",
|
|
36
|
+
justifyContent: isMinimized ? "center" : "end",
|
|
37
|
+
spacing: 1,
|
|
38
|
+
children: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
39
|
+
!isMinimized && /* @__PURE__ */ jsxs(Typography, { variant: "caption", children: [
|
|
40
|
+
"V",
|
|
41
|
+
appVersion
|
|
42
|
+
] }),
|
|
43
|
+
/* @__PURE__ */ jsx(Tooltip, { title: `V${appVersion}`, disableHoverListener: !isMinimized, children: /* @__PURE__ */ jsx(IconButton, { sx: { padding: 0 }, onClick: () => setOpenDialog(SideBarDialogType.ABOUT), children: /* @__PURE__ */ jsx(Info, { fontSize: "small", color: "disabled" }) }) })
|
|
44
|
+
] })
|
|
45
|
+
}
|
|
46
|
+
),
|
|
47
|
+
/* @__PURE__ */ jsx(Divider, {})
|
|
48
|
+
]
|
|
49
|
+
}
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
export {
|
|
53
|
+
AppSideBarHeader
|
|
54
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { PropsWithChildren } from 'react';
|
|
2
|
+
export declare enum SideBarDialogType {
|
|
3
|
+
ABOUT = "ABOUT",
|
|
4
|
+
PROFILE = "PROFILE",
|
|
5
|
+
PROFILE_SETTINGS = "PROFILE_SETTINGS"
|
|
6
|
+
}
|
|
7
|
+
type AppSideBarDialogContextValue = {
|
|
8
|
+
openDialog: SideBarDialogType | null;
|
|
9
|
+
setOpenDialog: (dialog: SideBarDialogType) => void;
|
|
10
|
+
closeDialog: () => void;
|
|
11
|
+
};
|
|
12
|
+
export declare function AppSideBarDialogProvider({ children }: Readonly<PropsWithChildren>): import("react").JSX.Element;
|
|
13
|
+
export declare function useAppSideBarDialogs(): AppSideBarDialogContextValue;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { createContext, useState, useCallback, useMemo, useContext } from "react";
|
|
3
|
+
var SideBarDialogType = /* @__PURE__ */ ((SideBarDialogType2) => {
|
|
4
|
+
SideBarDialogType2["ABOUT"] = "ABOUT";
|
|
5
|
+
SideBarDialogType2["PROFILE"] = "PROFILE";
|
|
6
|
+
SideBarDialogType2["PROFILE_SETTINGS"] = "PROFILE_SETTINGS";
|
|
7
|
+
return SideBarDialogType2;
|
|
8
|
+
})(SideBarDialogType || {});
|
|
9
|
+
const AppSideBarDialogContext = createContext(void 0);
|
|
10
|
+
function AppSideBarDialogProvider({ children }) {
|
|
11
|
+
const [openDialog, setOpenDialog] = useState(null);
|
|
12
|
+
const closeDialog = useCallback(() => {
|
|
13
|
+
setOpenDialog(null);
|
|
14
|
+
}, []);
|
|
15
|
+
const contextValue = useMemo(
|
|
16
|
+
() => ({
|
|
17
|
+
openDialog,
|
|
18
|
+
setOpenDialog,
|
|
19
|
+
closeDialog
|
|
20
|
+
}),
|
|
21
|
+
[closeDialog, openDialog]
|
|
22
|
+
);
|
|
23
|
+
return /* @__PURE__ */ jsx(AppSideBarDialogContext.Provider, { value: contextValue, children });
|
|
24
|
+
}
|
|
25
|
+
function useAppSideBarDialogs() {
|
|
26
|
+
const dialogs = useContext(AppSideBarDialogContext);
|
|
27
|
+
if (!dialogs) {
|
|
28
|
+
throw new Error("useAppSideBarDialogs must be used within an AppSideBarDialogProvider");
|
|
29
|
+
}
|
|
30
|
+
return dialogs;
|
|
31
|
+
}
|
|
32
|
+
export {
|
|
33
|
+
AppSideBarDialogProvider,
|
|
34
|
+
SideBarDialogType,
|
|
35
|
+
useAppSideBarDialogs
|
|
36
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { UserProfile } from 'oidc-client-ts';
|
|
2
|
+
import { GridSuiteModule } from '../../topBar';
|
|
3
|
+
type AppSideBarDialogsProps = {
|
|
4
|
+
isDeveloperMode: boolean;
|
|
5
|
+
handleChangeDeveloperMode: (newValue: boolean) => void;
|
|
6
|
+
userProfile?: UserProfile;
|
|
7
|
+
appName: string;
|
|
8
|
+
appLicense?: string;
|
|
9
|
+
appVersion?: string;
|
|
10
|
+
globalVersionPromise: () => Promise<string>;
|
|
11
|
+
additionalModulesPromise: () => Promise<GridSuiteModule[]>;
|
|
12
|
+
};
|
|
13
|
+
export declare function AppSideBarDialogs({ appLicense, appVersion, additionalModulesPromise, globalVersionPromise, appName, userProfile, isDeveloperMode, handleChangeDeveloperMode, }: Readonly<AppSideBarDialogsProps>): import("react").JSX.Element;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { jsxs, Fragment, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { AboutDialog } from "../../topBar/AboutDialog.js";
|
|
3
|
+
import "@mui/material";
|
|
4
|
+
import "@mui/icons-material";
|
|
5
|
+
import "react";
|
|
6
|
+
import "react-intl";
|
|
7
|
+
import "../../topBar/TopBar.js";
|
|
8
|
+
import UserInformationDialog from "../../topBar/UserInformationDialog.js";
|
|
9
|
+
import UserSettingsDialog from "../../topBar/UserSettingsDialog.js";
|
|
10
|
+
import { useAppSideBarDialogs, SideBarDialogType } from "./AppSideBarDialogProvider.js";
|
|
11
|
+
function AppSideBarDialogs({
|
|
12
|
+
appLicense,
|
|
13
|
+
appVersion,
|
|
14
|
+
additionalModulesPromise,
|
|
15
|
+
globalVersionPromise,
|
|
16
|
+
appName,
|
|
17
|
+
userProfile,
|
|
18
|
+
isDeveloperMode,
|
|
19
|
+
handleChangeDeveloperMode
|
|
20
|
+
}) {
|
|
21
|
+
const { openDialog, closeDialog } = useAppSideBarDialogs();
|
|
22
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
23
|
+
/* @__PURE__ */ jsx(
|
|
24
|
+
AboutDialog,
|
|
25
|
+
{
|
|
26
|
+
appLicense,
|
|
27
|
+
appVersion,
|
|
28
|
+
open: openDialog === SideBarDialogType.ABOUT,
|
|
29
|
+
onClose: closeDialog,
|
|
30
|
+
additionalModulesPromise,
|
|
31
|
+
globalVersionPromise,
|
|
32
|
+
appName
|
|
33
|
+
}
|
|
34
|
+
),
|
|
35
|
+
/* @__PURE__ */ jsx(
|
|
36
|
+
UserInformationDialog,
|
|
37
|
+
{
|
|
38
|
+
openDialog: openDialog === SideBarDialogType.PROFILE,
|
|
39
|
+
onClose: closeDialog,
|
|
40
|
+
userProfile: userProfile ?? void 0
|
|
41
|
+
}
|
|
42
|
+
),
|
|
43
|
+
/* @__PURE__ */ jsx(
|
|
44
|
+
UserSettingsDialog,
|
|
45
|
+
{
|
|
46
|
+
openDialog: openDialog === SideBarDialogType.PROFILE_SETTINGS,
|
|
47
|
+
onClose: closeDialog,
|
|
48
|
+
developerMode: isDeveloperMode,
|
|
49
|
+
onDeveloperModeClick: handleChangeDeveloperMode
|
|
50
|
+
}
|
|
51
|
+
)
|
|
52
|
+
] });
|
|
53
|
+
}
|
|
54
|
+
export {
|
|
55
|
+
AppSideBarDialogs
|
|
56
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { UserProfile } from 'oidc-client-ts';
|
|
2
|
+
import { GsLang, GsTheme, Metadata } from '../../../utils';
|
|
3
|
+
export interface AppSideBarFooterProps {
|
|
4
|
+
isMinimized: boolean;
|
|
5
|
+
isSmallScreen: boolean;
|
|
6
|
+
toggleSideBarMinimized: () => void;
|
|
7
|
+
currentTheme: GsTheme;
|
|
8
|
+
setTheme: (newTheme: GsTheme) => void;
|
|
9
|
+
selectedLanguage: GsLang;
|
|
10
|
+
setSelectedLanguage: (newSelectedLanguage: GsLang) => void;
|
|
11
|
+
userProfile?: UserProfile;
|
|
12
|
+
appsAndUrls: Metadata[];
|
|
13
|
+
onLogoutClick?: () => void;
|
|
14
|
+
}
|
|
15
|
+
export declare function AppSideBarFooter({ isMinimized, isSmallScreen, toggleSideBarMinimized, currentTheme, setTheme, selectedLanguage, setSelectedLanguage, userProfile, appsAndUrls, onLogoutClick, }: Readonly<AppSideBarFooterProps>): import("react").JSX.Element;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { Stack, MenuList, Divider } from "@mui/material";
|
|
3
|
+
import { Logout, KeyboardDoubleArrowRight, KeyboardDoubleArrowLeft } from "@mui/icons-material";
|
|
4
|
+
import { ApplicationMenu } from "./applications/ApplicationMenu.js";
|
|
5
|
+
import { SideBarMenuItem } from "./common/SideBarMenuItem.js";
|
|
6
|
+
import { ProfileMenu } from "./profile/ProfileMenu.js";
|
|
7
|
+
import { SettingsMenu } from "./settings/SettingsMenu.js";
|
|
8
|
+
function AppSideBarFooter({
|
|
9
|
+
isMinimized,
|
|
10
|
+
isSmallScreen,
|
|
11
|
+
toggleSideBarMinimized,
|
|
12
|
+
currentTheme,
|
|
13
|
+
setTheme,
|
|
14
|
+
selectedLanguage,
|
|
15
|
+
setSelectedLanguage,
|
|
16
|
+
userProfile,
|
|
17
|
+
appsAndUrls,
|
|
18
|
+
onLogoutClick
|
|
19
|
+
}) {
|
|
20
|
+
const isUserLoggedIn = !!userProfile;
|
|
21
|
+
return /* @__PURE__ */ jsx(Stack, { p: 1, children: /* @__PURE__ */ jsxs(MenuList, { disablePadding: true, children: [
|
|
22
|
+
isUserLoggedIn && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
23
|
+
/* @__PURE__ */ jsx(ApplicationMenu, { isMinimized, appsAndUrls }),
|
|
24
|
+
/* @__PURE__ */ jsx(ProfileMenu, { isMinimized, userProfile }),
|
|
25
|
+
/* @__PURE__ */ jsx(
|
|
26
|
+
SettingsMenu,
|
|
27
|
+
{
|
|
28
|
+
isMinimized,
|
|
29
|
+
currentTheme,
|
|
30
|
+
setTheme,
|
|
31
|
+
selectedLanguage,
|
|
32
|
+
setSelectedLanguage
|
|
33
|
+
}
|
|
34
|
+
),
|
|
35
|
+
/* @__PURE__ */ jsx(
|
|
36
|
+
SideBarMenuItem,
|
|
37
|
+
{
|
|
38
|
+
label: "top-bar/logout",
|
|
39
|
+
icon: /* @__PURE__ */ jsx(Logout, {}),
|
|
40
|
+
onClick: onLogoutClick,
|
|
41
|
+
showLabel: !isMinimized
|
|
42
|
+
}
|
|
43
|
+
)
|
|
44
|
+
] }),
|
|
45
|
+
/* @__PURE__ */ jsx(Divider, {}),
|
|
46
|
+
/* @__PURE__ */ jsx(
|
|
47
|
+
SideBarMenuItem,
|
|
48
|
+
{
|
|
49
|
+
label: "top-bar/minimize",
|
|
50
|
+
icon: isMinimized ? /* @__PURE__ */ jsx(KeyboardDoubleArrowRight, {}) : /* @__PURE__ */ jsx(KeyboardDoubleArrowLeft, {}),
|
|
51
|
+
onClick: toggleSideBarMinimized,
|
|
52
|
+
showLabel: !isMinimized,
|
|
53
|
+
disabled: isSmallScreen
|
|
54
|
+
}
|
|
55
|
+
)
|
|
56
|
+
] }) });
|
|
57
|
+
}
|
|
58
|
+
export {
|
|
59
|
+
AppSideBarFooter
|
|
60
|
+
};
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Apps } from "@mui/icons-material";
|
|
3
|
+
import { useIntl } from "react-intl";
|
|
4
|
+
import { OtherAppRedirection } from "./OtherAppRedirection.js";
|
|
5
|
+
import { MinimizedSubMenuHeader } from "../common/MinimizedSubMenuHeader.js";
|
|
6
|
+
import { submenuFooterStyle } from "../common/submenu-footer.style.js";
|
|
7
|
+
import "@mui/material";
|
|
8
|
+
import "../../../../components/ui/overflowableText/OverflowableText.js";
|
|
9
|
+
import "../../../../utils/conversionUtils.js";
|
|
10
|
+
import "../../../../utils/types/equipmentType.js";
|
|
11
|
+
import "react";
|
|
12
|
+
import "react-hook-form";
|
|
13
|
+
import "localized-countries";
|
|
14
|
+
import "localized-countries/data/fr";
|
|
15
|
+
import "localized-countries/data/en";
|
|
16
|
+
import "notistack";
|
|
17
|
+
import "../../../../components/ui/reactHookForm/provider/CustomFormProvider.js";
|
|
18
|
+
import "yup";
|
|
19
|
+
import "../../../../components/ui/treeViewFinder/TreeViewFinder.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 { CustomNestedMenuItem } from "../../../../components/ui/menus/custom-nested-menu.js";
|
|
33
|
+
import "react-resizable-panels";
|
|
34
|
+
import "react-papaparse";
|
|
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/BottomTableButtons.js";
|
|
53
|
+
import "../../../../components/composite/agGridTable/CustomAgGridTable.js";
|
|
54
|
+
import "ag-grid-community";
|
|
55
|
+
import "../../../../components/composite/customAGGrid/customAggrid.js";
|
|
56
|
+
import "../../../../components/composite/customAGGrid/context/custom-aggrid-context.js";
|
|
57
|
+
import "mathjs";
|
|
58
|
+
import "../../../../components/composite/report/report-viewer/log-table/log-table.js";
|
|
59
|
+
import "react-window";
|
|
60
|
+
import "../../../../components/composite/report/report-treeview/treeview-item.js";
|
|
61
|
+
import "../../../../components/composite/report/report-viewer/context/report-viewer-context.js";
|
|
62
|
+
function ApplicationMenu({
|
|
63
|
+
isMinimized,
|
|
64
|
+
appsAndUrls
|
|
65
|
+
}) {
|
|
66
|
+
const intl = useIntl();
|
|
67
|
+
const applicationLabel = intl.formatMessage({ id: "top-bar/myApps" });
|
|
68
|
+
return /* @__PURE__ */ jsxs(
|
|
69
|
+
CustomNestedMenuItem,
|
|
70
|
+
{
|
|
71
|
+
label: !isMinimized ? applicationLabel : "",
|
|
72
|
+
leftIcon: /* @__PURE__ */ jsx(Apps, {}),
|
|
73
|
+
sx: submenuFooterStyle.subMenu,
|
|
74
|
+
children: [
|
|
75
|
+
isMinimized && /* @__PURE__ */ jsx(MinimizedSubMenuHeader, { label: applicationLabel }),
|
|
76
|
+
appsAndUrls?.filter((item) => !item.hiddenInAppsMenu).map((item) => /* @__PURE__ */ jsx(OtherAppRedirection, { app: item }, item.name))
|
|
77
|
+
]
|
|
78
|
+
}
|
|
79
|
+
);
|
|
80
|
+
}
|
|
81
|
+
export {
|
|
82
|
+
ApplicationMenu
|
|
83
|
+
};
|