@gridsuite/commons-ui 0.46.0 → 0.48.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/README.md +0 -17
- package/dist/components/AuthenticationRouter/AuthenticationRouter.d.ts +10 -0
- package/dist/components/AuthenticationRouter/AuthenticationRouter.js +147 -0
- package/dist/components/AuthenticationRouter/index.d.ts +1 -0
- package/dist/components/CardErrorBoundary/card-error-boundary.d.ts +18 -0
- package/dist/components/CardErrorBoundary/card-error-boundary.js +110 -0
- package/dist/components/CardErrorBoundary/index.d.ts +1 -0
- package/dist/components/DirectoryItemSelector/directory-item-selector.d.ts +22 -0
- package/dist/components/DirectoryItemSelector/directory-item-selector.js +254 -0
- package/dist/components/ElementSearchDialog/element-search-dialog.d.ts +16 -0
- package/dist/components/ElementSearchDialog/element-search-dialog.js +139 -0
- package/dist/components/ElementSearchDialog/equipment-item.d.ts +16 -0
- package/dist/components/ElementSearchDialog/equipment-item.js +77 -0
- package/dist/components/ElementSearchDialog/index.d.ts +2 -0
- package/dist/components/ElementSearchDialog/tag-renderer.d.ts +11 -0
- package/dist/components/ElementSearchDialog/tag-renderer.js +34 -0
- package/dist/components/FlatParameters/FlatParameters.d.ts +10 -0
- package/dist/components/FlatParameters/FlatParameters.js +411 -0
- package/dist/components/FlatParameters/index.d.ts +1 -0
- package/dist/components/Login/Login.d.ts +5 -0
- package/dist/components/Login/Login.js +78 -0
- package/dist/components/Login/Logout.d.ts +5 -0
- package/dist/components/Login/Logout.js +69 -0
- package/dist/components/Login/index.d.ts +1 -0
- package/dist/components/MuiVirtualizedTable/ColumnHeader.d.ts +4 -0
- package/dist/components/MuiVirtualizedTable/ColumnHeader.js +127 -0
- package/dist/components/MuiVirtualizedTable/KeyedColumnsRowIndexer.d.ts +104 -0
- package/dist/components/MuiVirtualizedTable/KeyedColumnsRowIndexer.js +548 -0
- package/dist/components/MuiVirtualizedTable/MuiVirtualizedTable.d.ts +131 -0
- package/dist/components/MuiVirtualizedTable/MuiVirtualizedTable.js +790 -0
- package/dist/components/MuiVirtualizedTable/index.d.ts +2 -0
- package/dist/components/MultipleSelectionDialog/MultipleSelectionDialog.d.ts +10 -0
- package/dist/components/MultipleSelectionDialog/MultipleSelectionDialog.js +87 -0
- package/dist/components/MultipleSelectionDialog/index.d.ts +1 -0
- package/dist/components/OverflowableText/index.d.ts +1 -0
- package/dist/components/OverflowableText/overflowable-text.d.ts +2 -0
- package/dist/components/OverflowableText/overflowable-text.js +87 -0
- package/dist/components/ReportViewer/filter-button.d.ts +1 -0
- package/dist/components/ReportViewer/filter-button.js +64 -0
- package/dist/components/ReportViewer/index.d.ts +1 -0
- package/dist/components/ReportViewer/log-report-item.d.ts +68 -0
- package/dist/components/ReportViewer/log-report-item.js +95 -0
- package/dist/components/ReportViewer/log-report.d.ts +21 -0
- package/dist/components/ReportViewer/log-report.js +49 -0
- package/dist/components/ReportViewer/log-table.d.ts +8 -0
- package/dist/components/ReportViewer/log-table.js +131 -0
- package/dist/components/ReportViewer/multi-select-list.d.ts +1 -0
- package/dist/components/ReportViewer/multi-select-list.js +40 -0
- package/dist/components/ReportViewer/report-item.d.ts +13 -0
- package/dist/components/ReportViewer/report-item.js +112 -0
- package/dist/components/ReportViewer/report-tree-view-context.d.ts +2 -0
- package/dist/components/ReportViewer/report-tree-view-context.js +8 -0
- package/dist/components/ReportViewer/report-viewer.d.ts +4 -0
- package/dist/components/ReportViewer/report-viewer.js +158 -0
- package/dist/components/ReportViewerDialog/index.d.ts +1 -0
- package/dist/components/ReportViewerDialog/report-viewer-dialog.d.ts +1 -0
- package/dist/components/ReportViewerDialog/report-viewer-dialog.js +61 -0
- package/dist/components/SignInCallbackHandler/SignInCallbackHandler.d.ts +5 -0
- package/dist/components/SignInCallbackHandler/SignInCallbackHandler.js +13 -0
- package/dist/components/SignInCallbackHandler/index.d.ts +1 -0
- package/dist/components/SilentRenewCallbackHandler/SilentRenewCallbackHandler.d.ts +5 -0
- package/dist/components/SilentRenewCallbackHandler/SilentRenewCallbackHandler.js +16 -0
- package/dist/components/SilentRenewCallbackHandler/index.d.ts +1 -0
- package/dist/components/SnackbarProvider/SnackbarProvider.d.ts +3 -0
- package/dist/components/SnackbarProvider/SnackbarProvider.js +28 -0
- package/dist/components/SnackbarProvider/index.d.ts +1 -0
- package/dist/components/TopBar/AboutDialog.d.ts +24 -0
- package/dist/components/TopBar/AboutDialog.js +467 -0
- package/dist/components/TopBar/GridLogo.d.ts +34 -0
- package/dist/components/TopBar/GridLogo.js +71 -0
- package/dist/components/TopBar/TopBar.d.ts +53 -0
- package/dist/components/TopBar/TopBar.js +679 -0
- package/dist/components/TopBar/index.d.ts +3 -0
- package/dist/components/TreeViewFinder/TreeViewFinder.d.ts +57 -0
- package/dist/components/TreeViewFinder/TreeViewFinder.js +288 -0
- package/dist/components/TreeViewFinder/index.d.ts +1 -0
- package/dist/components/react-hook-form/autocomplete-input.d.ts +30 -0
- package/dist/components/react-hook-form/autocomplete-input.js +96 -0
- package/dist/components/react-hook-form/booleans/boolean-input.d.ts +16 -0
- package/dist/components/react-hook-form/booleans/boolean-input.js +49 -0
- package/dist/components/react-hook-form/booleans/checkbox-input.d.ts +14 -0
- package/dist/components/react-hook-form/booleans/checkbox-input.js +24 -0
- package/dist/components/react-hook-form/booleans/switch-input.d.ts +14 -0
- package/dist/components/react-hook-form/booleans/switch-input.js +24 -0
- package/dist/components/react-hook-form/directory-items-input.d.ts +28 -0
- package/dist/components/react-hook-form/directory-items-input.js +185 -0
- package/dist/components/react-hook-form/error-management/error-input.d.ts +5 -0
- package/dist/components/react-hook-form/error-management/error-input.js +42 -0
- package/dist/components/react-hook-form/error-management/field-error-alert.d.ts +4 -0
- package/dist/components/react-hook-form/error-management/field-error-alert.js +9 -0
- package/dist/components/react-hook-form/error-management/mid-form-error.d.ts +4 -0
- package/dist/components/react-hook-form/error-management/mid-form-error.js +20 -0
- package/dist/components/react-hook-form/numbers/float-input.d.ts +18 -0
- package/dist/components/react-hook-form/numbers/float-input.js +51 -0
- package/dist/components/react-hook-form/numbers/integer-input.d.ts +18 -0
- package/dist/components/react-hook-form/numbers/integer-input.js +36 -0
- package/dist/components/react-hook-form/numbers/utils.d.ts +2 -0
- package/dist/components/react-hook-form/numbers/utils.js +10 -0
- package/dist/components/react-hook-form/radio-input.d.ts +18 -0
- package/dist/components/react-hook-form/radio-input.js +44 -0
- package/{es/components/MultipleSelectionDialog/index.js → dist/components/react-hook-form/raw-read-only-input.d.ts} +3 -2
- package/dist/components/react-hook-form/raw-read-only-input.js +10 -0
- package/dist/components/react-hook-form/select-input.d.ts +17 -0
- package/dist/components/react-hook-form/select-input.js +31 -0
- package/dist/components/react-hook-form/slider-input.d.ts +21 -0
- package/dist/components/react-hook-form/slider-input.js +43 -0
- package/dist/components/react-hook-form/text-input.d.ts +33 -0
- package/dist/components/react-hook-form/text-input.js +94 -0
- package/dist/components/react-hook-form/utils/cancel-button.d.ts +10 -0
- package/dist/components/react-hook-form/utils/cancel-button.js +16 -0
- package/dist/components/react-hook-form/utils/field-label.d.ts +6 -0
- package/dist/components/react-hook-form/utils/field-label.js +12 -0
- package/dist/components/react-hook-form/utils/functions.d.ts +11 -0
- package/dist/components/react-hook-form/utils/functions.js +41 -0
- package/dist/components/react-hook-form/utils/submit-button.d.ts +10 -0
- package/dist/components/react-hook-form/utils/submit-button.js +23 -0
- package/dist/components/react-hook-form/utils/text-field-with-adornment.d.ts +12 -0
- package/dist/components/react-hook-form/utils/text-field-with-adornment.js +96 -0
- package/{es/components/translations/report-viewer-fr.js → dist/components/translations/card-error-boundary-en.d.ts} +5 -6
- package/dist/components/translations/card-error-boundary-en.js +8 -0
- package/dist/components/translations/card-error-boundary-fr.d.ts +12 -0
- package/dist/components/translations/card-error-boundary-fr.js +8 -0
- package/dist/components/translations/common-button-en.d.ts +5 -0
- package/dist/components/translations/common-button-en.js +7 -0
- package/dist/components/translations/common-button-fr.d.ts +5 -0
- package/dist/components/translations/common-button-fr.js +7 -0
- package/{es/components/translations/element-search-en.js → dist/components/translations/element-search-en.d.ts} +4 -5
- package/dist/components/translations/element-search-en.js +7 -0
- package/dist/components/translations/element-search-fr.d.ts +11 -0
- package/dist/components/translations/element-search-fr.js +7 -0
- package/dist/components/translations/equipment-search-en.d.ts +25 -0
- package/dist/components/translations/equipment-search-en.js +21 -0
- package/dist/components/translations/equipment-search-fr.d.ts +25 -0
- package/dist/components/translations/equipment-search-fr.js +21 -0
- package/{es/components/translations/flat-parameters-en.js → dist/components/translations/flat-parameters-en.d.ts} +5 -6
- package/dist/components/translations/flat-parameters-en.js +8 -0
- package/{es/components/translations/common-button-en.js → dist/components/translations/flat-parameters-fr.d.ts} +5 -5
- package/dist/components/translations/flat-parameters-fr.js +8 -0
- package/dist/components/translations/login-en.d.ts +18 -0
- package/dist/components/translations/login-en.js +14 -0
- package/dist/components/translations/login-fr.d.ts +18 -0
- package/dist/components/translations/login-fr.js +14 -0
- package/{es/components/translations/flat-parameters-fr.js → dist/components/translations/multiple-selection-dialog-en.d.ts} +5 -6
- package/dist/components/translations/multiple-selection-dialog-en.js +8 -0
- package/{es/components/translations/common-button-fr.js → dist/components/translations/multiple-selection-dialog-fr.d.ts} +5 -5
- package/dist/components/translations/multiple-selection-dialog-fr.js +8 -0
- package/{es/components/translations/report-viewer-en.js → dist/components/translations/report-viewer-en.d.ts} +5 -6
- package/dist/components/translations/report-viewer-en.js +8 -0
- package/{es/components/translations/element-search-fr.js → dist/components/translations/report-viewer-fr.d.ts} +5 -5
- package/dist/components/translations/report-viewer-fr.js +8 -0
- package/{es/components/translations/table-en.js → dist/components/translations/table-en.d.ts} +3 -4
- package/dist/components/translations/table-en.js +6 -0
- package/{es/components/translations/table-fr.js → dist/components/translations/table-fr.d.ts} +3 -4
- package/dist/components/translations/table-fr.js +6 -0
- package/dist/components/translations/top-bar-en.d.ts +31 -0
- package/dist/components/translations/top-bar-en.js +27 -0
- package/dist/components/translations/top-bar-fr.d.ts +31 -0
- package/dist/components/translations/top-bar-fr.js +27 -0
- package/dist/components/translations/treeview-finder-en.d.ts +16 -0
- package/dist/components/translations/treeview-finder-en.js +12 -0
- package/dist/components/translations/treeview-finder-fr.d.ts +16 -0
- package/dist/components/translations/treeview-finder-fr.js +12 -0
- package/dist/hooks/useDebounce.d.ts +1 -0
- package/dist/hooks/useDebounce.js +17 -0
- package/{es/components/ElementSearchDialog/index.js → dist/hooks/useIntlRef.d.ts} +2 -2
- package/dist/hooks/useIntlRef.js +13 -0
- package/dist/hooks/useSnackMessage.d.ts +5 -0
- package/dist/hooks/useSnackMessage.js +81 -0
- package/dist/index.d.ts +234 -0
- package/dist/index.js +158 -0
- package/dist/utils/AuthService.d.ts +9 -0
- package/dist/utils/AuthService.js +336 -0
- package/dist/utils/ElementType.d.ts +13 -0
- package/dist/utils/ElementType.js +42 -0
- package/dist/utils/EquipmentType.d.ts +136 -0
- package/dist/utils/EquipmentType.js +132 -0
- package/dist/utils/UserManagerMock.d.ts +34 -0
- package/dist/utils/UserManagerMock.js +85 -0
- package/dist/utils/actions.d.ts +50 -0
- package/dist/utils/actions.js +71 -0
- package/{es/components/CardErrorBoundary/index.js → dist/utils/algos.d.ts} +1 -1
- package/dist/utils/algos.js +24 -0
- package/dist/utils/styles.d.ts +5 -0
- package/dist/utils/styles.js +13 -0
- package/package.json +36 -21
- package/es/components/AuthenticationRouter/AuthenticationRouter.js +0 -102
- package/es/components/AuthenticationRouter/index.js +0 -7
- package/es/components/CardErrorBoundary/card-error-boundary.js +0 -138
- package/es/components/ElementSearchDialog/element-search-dialog.js +0 -153
- package/es/components/ElementSearchDialog/equipment-item.js +0 -63
- package/es/components/ElementSearchDialog/tag-renderer.js +0 -29
- package/es/components/FlatParameters/FlatParameters.js +0 -448
- package/es/components/FlatParameters/index.js +0 -8
- package/es/components/Login/Login.js +0 -79
- package/es/components/Login/Logout.js +0 -78
- package/es/components/Login/index.js +0 -7
- package/es/components/MuiVirtualizedTable/ColumnHeader.js +0 -125
- package/es/components/MuiVirtualizedTable/KeyedColumnsRowIndexer.js +0 -619
- package/es/components/MuiVirtualizedTable/MuiVirtualizedTable.js +0 -780
- package/es/components/MuiVirtualizedTable/index.js +0 -9
- package/es/components/MultipleSelectionDialog/MultipleSelectionDialog.js +0 -95
- package/es/components/OverflowableText/index.js +0 -7
- package/es/components/OverflowableText/overflowable-text.js +0 -81
- package/es/components/ReportViewer/filter-button.js +0 -77
- package/es/components/ReportViewer/index.js +0 -7
- package/es/components/ReportViewer/log-report-item.js +0 -97
- package/es/components/ReportViewer/log-report.js +0 -63
- package/es/components/ReportViewer/log-table.js +0 -130
- package/es/components/ReportViewer/multi-select-list.js +0 -56
- package/es/components/ReportViewer/report-item.js +0 -131
- package/es/components/ReportViewer/report-tree-view-context.js +0 -13
- package/es/components/ReportViewer/report-viewer.js +0 -167
- package/es/components/ReportViewerDialog/index.js +0 -7
- package/es/components/ReportViewerDialog/report-viewer-dialog.js +0 -67
- package/es/components/SignInCallbackHandler/SignInCallbackHandler.js +0 -19
- package/es/components/SignInCallbackHandler/index.js +0 -7
- package/es/components/SilentRenewCallbackHandler/SilentRenewCallbackHandler.js +0 -19
- package/es/components/SilentRenewCallbackHandler/index.js +0 -7
- package/es/components/SnackbarProvider/SnackbarProvider.js +0 -39
- package/es/components/SnackbarProvider/index.js +0 -7
- package/es/components/TopBar/AboutDialog.js +0 -456
- package/es/components/TopBar/GridLogo.js +0 -73
- package/es/components/TopBar/TopBar.js +0 -487
- package/es/components/TopBar/index.js +0 -9
- package/es/components/TreeViewFinder/TreeViewFinder.js +0 -341
- package/es/components/TreeViewFinder/index.js +0 -7
- package/es/components/images/powsybl_logo.svg +0 -35
- package/es/components/react-hook-form/autocomplete-input.js +0 -110
- package/es/components/react-hook-form/booleans/boolean-input.js +0 -56
- package/es/components/react-hook-form/booleans/checkbox-input.js +0 -28
- package/es/components/react-hook-form/booleans/switch-input.js +0 -28
- package/es/components/react-hook-form/error-management/error-input.js +0 -50
- package/es/components/react-hook-form/error-management/field-error-alert.js +0 -22
- package/es/components/react-hook-form/error-management/mid-form-error.js +0 -25
- package/es/components/react-hook-form/numbers/float-input.js +0 -105
- package/es/components/react-hook-form/numbers/integer-input.js +0 -35
- package/es/components/react-hook-form/numbers/utils.js +0 -6
- package/es/components/react-hook-form/radio-input.js +0 -55
- package/es/components/react-hook-form/select-input.js +0 -40
- package/es/components/react-hook-form/slider-input.js +0 -48
- package/es/components/react-hook-form/text-input.js +0 -100
- package/es/components/react-hook-form/utils/cancel-button.js +0 -28
- package/es/components/react-hook-form/utils/field-label.js +0 -15
- package/es/components/react-hook-form/utils/functions.js +0 -42
- package/es/components/react-hook-form/utils/submit-button.js +0 -29
- package/es/components/react-hook-form/utils/text-field-with-adornment.js +0 -92
- package/es/components/translations/card-error-boundary-en.js +0 -13
- package/es/components/translations/card-error-boundary-fr.js +0 -13
- package/es/components/translations/equipment-search-en.js +0 -26
- package/es/components/translations/equipment-search-fr.js +0 -26
- package/es/components/translations/inputs-en.js +0 -25
- package/es/components/translations/inputs-fr.js +0 -25
- package/es/components/translations/login-en.js +0 -19
- package/es/components/translations/login-fr.js +0 -19
- package/es/components/translations/multiple-selection-dialog-en.js +0 -13
- package/es/components/translations/multiple-selection-dialog-fr.js +0 -13
- package/es/components/translations/top-bar-en.js +0 -32
- package/es/components/translations/top-bar-fr.js +0 -32
- package/es/components/translations/treeview-finder-en.js +0 -17
- package/es/components/translations/treeview-finder-fr.js +0 -17
- package/es/hooks/useDebounce.js +0 -26
- package/es/hooks/useIntlRef.js +0 -22
- package/es/hooks/useSnackMessage.js +0 -81
- package/es/index.js +0 -71
- package/es/utils/AuthService.js +0 -312
- package/es/utils/ElementType.js +0 -53
- package/es/utils/EquipmentType.js +0 -133
- package/es/utils/UserManagerMock.js +0 -81
- package/es/utils/actions.js +0 -65
- package/es/utils/algos.js +0 -29
- package/es/utils/styles.js +0 -35
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3
|
+
var __publicField = (obj, key, value) => {
|
|
4
|
+
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
5
|
+
return value;
|
|
6
|
+
};
|
|
7
|
+
class Events {
|
|
8
|
+
constructor() {
|
|
9
|
+
__publicField(this, "userLoadedCallbacks", []);
|
|
10
|
+
}
|
|
11
|
+
addUserLoaded(callback) {
|
|
12
|
+
this.userLoadedCallbacks.push(callback);
|
|
13
|
+
}
|
|
14
|
+
addSilentRenewError(callback) {
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
class UserManagerMock {
|
|
18
|
+
constructor(settings) {
|
|
19
|
+
__publicField(this, "settings");
|
|
20
|
+
__publicField(this, "events");
|
|
21
|
+
__publicField(this, "user", {
|
|
22
|
+
profile: { name: "John Doe", email: "Jhon.Doe@rte-france.com" },
|
|
23
|
+
id_token: "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6IllNRUxIVDBndmIwbXhvU0RvWWZvbWpxZmpZVSJ9.eyJhdWQiOiI5YzQwMjQ2MS1iMmFiLTQ3NjctOWRiMy02Njg1OWJiMGZjZDAiLCJpc3MiOiJodHRwczovL2xvZ2luLm1pY3Jvc29mdG9ubGluZS5jb20vNzUwMmRhZDUtZDY0Yy00NmM3LTlkNDctYjE2ZjU4MGZjZmE5L3YyLjAiLCJpYXQiOjE1ODUzMzEyNDksIm5iZiI6MTU4NTMzMTI0OSwiZXhwIjoyNTg1MzM1MTQ5LCJhaW8iOiJBV1FBbS84UEFBQUF3Q0xyTDRIUEUvTnVjOU9OdHN0SUV4cVpyMUlqa1FGbXJvUW5EUzJBaksyWnpneUhQTldPdkE3bitveHkvRzgxWElsb1A0TitsQjZINFJteElwakhNYVArTjIyTzVnMUFaR04yc1d6VHA5T3JWMDIvOXhndXJBMjZrdUNXbGg2RSIsImF0X2hhc2giOiJJaWRYdGRHdzVkbjlOZDFQblVvbDh3IiwiaWRwIjoiaHR0cHM6Ly9zdHMud2luZG93cy5uZXQvOTE4ODA0MGQtNmM2Ny00YzViLWIxMTItMzZhMzA0YjY2ZGFkLyIsIm5vbmNlIjoiMjkzZTcxNzhmOWE5NGZlNjg1ZWY3MjdlZTg5MTYxYjEiLCJzdWIiOiJyTnZjWXJMSXJSN25iSDJPQlhoOFkzU05wZEtPc3dfTUNkX3F3NF9vNDRJIiwidGlkIjoiNzUwMmRhZDUtZDY0Yy00NmM3LTlkNDctYjE2ZjU4MGZjZmE5IiwidXRpIjoiUFBYdkw1UWxDMG1oMGp2N3NaNGJBQSIsInZlciI6IjIuMCJ9.dPAh24KTfsqmDaRoBtMLcayAWnDqVtydQ97P1a99dg93JsDu4Jhxju9vlzvjd6Ro5a1RZdrKFKB_pgC2DkQ3wSeYjpdSNyBAlW1_ryq65JkTJVMp33OsM_7SdjaRIiJfPiJ3U9jRBSyj7ofoHCLUjD_Uu-XreKxpMGhFHOQIO72UfXg8TBpsapjkEv9Dyz2UqMa2BQvO5mxKw93LNg5BI6j2a5LhbMEmmRWqfxWGITJ9TWfHjYdFkrXKcmvWZ9D2b4tsw_5NorDxkuzVFhA89M_0ASzOXoj1Yb6LgdkzWXDimssvyyz5Oe4V3gdkAe8Jj7Uwz-9AR-MO2kNkH7ytHA",
|
|
24
|
+
session_state: "session state",
|
|
25
|
+
access_token: "eyJ0eXAiOiJKV1QiLCJub25jZSI6InhKWHlQeXVrU1paQ3BOeEcxZUQway1lVDF0YzZtQ01ZVkZKcnBDOTJxc28iLCJhbGciOiJSUzI1NiIsIng1dCI6IllNRUxIVDBndmIwbXhvU0RvWWZvbWpxZmpZVSIsImtpZCI6IllNRUxIVDBndmIwbXhvU0RvWWZvbWpxZmpZVSJ9.eyJhdWQiOiIwMDAwMDAwMy0wMDAwLTAwMDAtYzAwMC0wMDAwMDAwMDAwMDAiLCJpc3MiOiJodHRwczovL3N0cy53aW5kb3dzLm5ldC83NTAyZGFkNS1kNjRjLTQ2YzctOWQ0Ny1iMTZmNTgwZmNmYTkvIiwiaWF0IjoxNTg1MzMxMjQ5LCJuYmYiOjE1ODUzMzEyNDksImV4cCI6MTU4NTMzNTE0OSwiYWNjdCI6MCwiYWNyIjoiMSIsImFpbyI6IkFVUUF1LzhQQUFBQXdwc3RYMlVkY2VDQWx4dU9tVHpIY0R3RlhTWUtYanIvZUNTSi9PdTRqbTJyUVBCUml0U1dWMThmNldCVEdNdnQ5ZGx0Ry9lTXB1VXZqaTN2NCtzanh3PT0iLCJhbHRzZWNpZCI6IjE6bGl2ZS5jb206MDAwMzQwMDExOUZEOTIxMiIsImFtciI6WyJwd2QiXSwiYXBwX2Rpc3BsYXluYW1lIjoic3BhIiwiYXBwaWQiOiI5YzQwMjQ2MS1iMmFiLTQ3NjctOWRiMy02Njg1OWJiMGZjZDAiLCJhcHBpZGFjciI6IjAiLCJlbWFpbCI6ImNoYW1zZWRkaW5lLmJlbmhhbWVkQGVuc2ktdW1hLnRuIiwiZmFtaWx5X25hbWUiOiJCRU5IQU1FRCIsImdpdmVuX25hbWUiOiJDaGFtc2VkZGluZSIsImlkcCI6ImxpdmUuY29tIiwiaXBhZGRyIjoiNzcuMjA0LjE0Ni4xNTkiLCJuYW1lIjoiQ2hhbXNlZGRpbmUgQkVOSEFNRUQiLCJvaWQiOiIzNTIzYmQ3OC0yZjIxLTQ3ZjYtODhlOC1hYWIzYjZmMjdmNjAiLCJwbGF0ZiI6IjE0IiwicHVpZCI6IjEwMDMyMDAwOURFMDg1NkEiLCJzY3AiOiJVc2VyLlJlYWQgcHJvZmlsZSBvcGVuaWQgZW1haWwiLCJzdWIiOiJjVEd5LVlfV3FLR2x1cmRUVDdSUVlfY3FjSDJoVHpEdllZTmotQ3hONXA4IiwidGlkIjoiNzUwMmRhZDUtZDY0Yy00NmM3LTlkNDctYjE2ZjU4MGZjZmE5IiwidW5pcXVlX25hbWUiOiJsaXZlLmNvbSNjaGFtc2VkZGluZS5iZW5oYW1lZEBlbnNpLXVtYS50biIsInV0aSI6IlBQWHZMNVFsQzBtaDBqdjdzWjRiQUEiLCJ2ZXIiOiIxLjAiLCJ4bXNfc3QiOnsic3ViIjoick52Y1lyTElyUjduYkgyT0JYaDhZM1NOcGRLT3N3X01DZF9xdzRfbzQ0SSJ9LCJ4bXNfdGNkdCI6MTU4MjgyMDM1Mn0.W_ccOGW_AGdg37KSMi7LWHtvm3Mw5p1dHjgDIrUaXduKF2iLS4dCaPw7yeo4VjAcOyV6C0h6ABLDCtkwVt8BSDTIIU7DaT8k2bRbMCCq69BmeiYPsbp-yX6ywGCx5DHsnOLqI2oHbBQktA2Nmv9Va651Pbm3OpSPuGPdVimkFCcnisiGlUOej1ZMNwyVT6386O2pERPtxmFUt_D1dKLxBXxBNxLVUG5BG3bI7wMpBOHEUA5CbaBzYXmGrLMXVVbrj9OsF-WQ6aNoqsm9cicX6pJB60lFz1dxLeSgcFO7Zh2K3PFe4FnXCqAvNPadQMz_kJEO9_phlDV85c2MPqeXbA",
|
|
26
|
+
token_type: "Bearer",
|
|
27
|
+
scope: "scopes"
|
|
28
|
+
});
|
|
29
|
+
this.settings = settings;
|
|
30
|
+
this.events = new Events();
|
|
31
|
+
}
|
|
32
|
+
getUser() {
|
|
33
|
+
return Promise.resolve(
|
|
34
|
+
JSON.parse(sessionStorage.getItem("powsybl-gridsuite-mock-user"))
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
signinSilent() {
|
|
38
|
+
console.info("signinSilent..............");
|
|
39
|
+
const localStorageUser = JSON.parse(
|
|
40
|
+
localStorage.getItem("powsybl-gridsuite-mock-user")
|
|
41
|
+
);
|
|
42
|
+
if (localStorageUser === null) {
|
|
43
|
+
return Promise.reject(
|
|
44
|
+
new Error("End-User authentication required")
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
sessionStorage.setItem(
|
|
48
|
+
"powsybl-gridsuite-mock-user",
|
|
49
|
+
JSON.stringify(localStorageUser)
|
|
50
|
+
);
|
|
51
|
+
this.events.userLoadedCallbacks.forEach((c) => c(localStorageUser));
|
|
52
|
+
return Promise.resolve(localStorageUser);
|
|
53
|
+
}
|
|
54
|
+
signinSilentCallback() {
|
|
55
|
+
console.error(
|
|
56
|
+
"Unsupported, iframe signinSilentCallback in UserManagerMock (dev mode)"
|
|
57
|
+
);
|
|
58
|
+
return Promise.reject();
|
|
59
|
+
}
|
|
60
|
+
signinRedirect() {
|
|
61
|
+
localStorage.setItem(
|
|
62
|
+
"powsybl-gridsuite-mock-user",
|
|
63
|
+
JSON.stringify(this.user)
|
|
64
|
+
);
|
|
65
|
+
window.location = "./sign-in-callback";
|
|
66
|
+
return Promise.resolve(null);
|
|
67
|
+
}
|
|
68
|
+
signoutRedirect() {
|
|
69
|
+
sessionStorage.removeItem("powsybl-gridsuite-mock-user");
|
|
70
|
+
localStorage.removeItem("powsybl-gridsuite-mock-user");
|
|
71
|
+
window.location = ".";
|
|
72
|
+
return Promise.resolve(null);
|
|
73
|
+
}
|
|
74
|
+
signinRedirectCallback() {
|
|
75
|
+
sessionStorage.setItem(
|
|
76
|
+
"powsybl-gridsuite-mock-user",
|
|
77
|
+
JSON.stringify(this.user)
|
|
78
|
+
);
|
|
79
|
+
this.events.userLoadedCallbacks.forEach((c) => c(this.user));
|
|
80
|
+
return Promise.resolve("");
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
export {
|
|
84
|
+
UserManagerMock
|
|
85
|
+
};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
export function setLoggedUser(user: any): {
|
|
2
|
+
type: string;
|
|
3
|
+
user: any;
|
|
4
|
+
};
|
|
5
|
+
export function setSignInCallbackError(signInCallbackError: any): {
|
|
6
|
+
type: string;
|
|
7
|
+
signInCallbackError: any;
|
|
8
|
+
};
|
|
9
|
+
export function setUnauthorizedUserInfo(userName: any, unauthorizedUserInfo: any): {
|
|
10
|
+
type: string;
|
|
11
|
+
authenticationRouterError: {
|
|
12
|
+
userName: any;
|
|
13
|
+
unauthorizedUserInfo: any;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
export function setLogoutError(userName: any, logoutError: any): {
|
|
17
|
+
type: string;
|
|
18
|
+
authenticationRouterError: {
|
|
19
|
+
userName: any;
|
|
20
|
+
logoutError: any;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
export function setUserValidationError(userName: any, userValidationError: any): {
|
|
24
|
+
type: string;
|
|
25
|
+
authenticationRouterError: {
|
|
26
|
+
userName: any;
|
|
27
|
+
userValidationError: any;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
export function resetAuthenticationRouterError(): {
|
|
31
|
+
type: string;
|
|
32
|
+
authenticationRouterError: null;
|
|
33
|
+
};
|
|
34
|
+
export function setShowAuthenticationRouterLogin(showAuthenticationRouterLogin: any): {
|
|
35
|
+
type: string;
|
|
36
|
+
showAuthenticationRouterLogin: any;
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* Copyright (c) 2020, RTE (http://www.rte-france.com)
|
|
40
|
+
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
41
|
+
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
42
|
+
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
43
|
+
*/
|
|
44
|
+
export const USER: "USER";
|
|
45
|
+
export const SIGNIN_CALLBACK_ERROR: "SIGNIN_CALLBACK_ERROR";
|
|
46
|
+
export const UNAUTHORIZED_USER_INFO: "UNAUTHORIZED_USER_INFO";
|
|
47
|
+
export const LOGOUT_ERROR: "LOGOUT_ERROR";
|
|
48
|
+
export const USER_VALIDATION_ERROR: "USER_VALIDATION_ERROR";
|
|
49
|
+
export const RESET_AUTHENTICATION_ROUTER_ERROR: "RESET_AUTHENTICATION_ROUTER_ERROR";
|
|
50
|
+
export const SHOW_AUTH_INFO_LOGIN: "SHOW_AUTH_INFO_LOGIN";
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
const USER = "USER";
|
|
2
|
+
function setLoggedUser(user) {
|
|
3
|
+
return { type: USER, user };
|
|
4
|
+
}
|
|
5
|
+
const SIGNIN_CALLBACK_ERROR = "SIGNIN_CALLBACK_ERROR";
|
|
6
|
+
function setSignInCallbackError(signInCallbackError) {
|
|
7
|
+
return {
|
|
8
|
+
type: SIGNIN_CALLBACK_ERROR,
|
|
9
|
+
signInCallbackError
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
const UNAUTHORIZED_USER_INFO = "UNAUTHORIZED_USER_INFO";
|
|
13
|
+
function setUnauthorizedUserInfo(userName, unauthorizedUserInfo) {
|
|
14
|
+
return {
|
|
15
|
+
type: UNAUTHORIZED_USER_INFO,
|
|
16
|
+
authenticationRouterError: {
|
|
17
|
+
userName,
|
|
18
|
+
unauthorizedUserInfo
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
const LOGOUT_ERROR = "LOGOUT_ERROR";
|
|
23
|
+
function setLogoutError(userName, logoutError) {
|
|
24
|
+
return {
|
|
25
|
+
type: LOGOUT_ERROR,
|
|
26
|
+
authenticationRouterError: {
|
|
27
|
+
userName,
|
|
28
|
+
logoutError
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
const USER_VALIDATION_ERROR = "USER_VALIDATION_ERROR";
|
|
33
|
+
function setUserValidationError(userName, userValidationError) {
|
|
34
|
+
return {
|
|
35
|
+
type: USER_VALIDATION_ERROR,
|
|
36
|
+
authenticationRouterError: {
|
|
37
|
+
userName,
|
|
38
|
+
userValidationError
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
const RESET_AUTHENTICATION_ROUTER_ERROR = "RESET_AUTHENTICATION_ROUTER_ERROR";
|
|
43
|
+
function resetAuthenticationRouterError() {
|
|
44
|
+
return {
|
|
45
|
+
type: RESET_AUTHENTICATION_ROUTER_ERROR,
|
|
46
|
+
authenticationRouterError: null
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
const SHOW_AUTH_INFO_LOGIN = "SHOW_AUTH_INFO_LOGIN";
|
|
50
|
+
function setShowAuthenticationRouterLogin(showAuthenticationRouterLogin) {
|
|
51
|
+
return {
|
|
52
|
+
type: SHOW_AUTH_INFO_LOGIN,
|
|
53
|
+
showAuthenticationRouterLogin
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
export {
|
|
57
|
+
LOGOUT_ERROR,
|
|
58
|
+
RESET_AUTHENTICATION_ROUTER_ERROR,
|
|
59
|
+
SHOW_AUTH_INFO_LOGIN,
|
|
60
|
+
SIGNIN_CALLBACK_ERROR,
|
|
61
|
+
UNAUTHORIZED_USER_INFO,
|
|
62
|
+
USER,
|
|
63
|
+
USER_VALIDATION_ERROR,
|
|
64
|
+
resetAuthenticationRouterError,
|
|
65
|
+
setLoggedUser,
|
|
66
|
+
setLogoutError,
|
|
67
|
+
setShowAuthenticationRouterLogin,
|
|
68
|
+
setSignInCallbackError,
|
|
69
|
+
setUnauthorizedUserInfo,
|
|
70
|
+
setUserValidationError
|
|
71
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
function equalsArray(a, b) {
|
|
2
|
+
if (b === a) {
|
|
3
|
+
return true;
|
|
4
|
+
}
|
|
5
|
+
if (!b || !a) {
|
|
6
|
+
return false;
|
|
7
|
+
}
|
|
8
|
+
if (a.length !== b.length) {
|
|
9
|
+
return false;
|
|
10
|
+
}
|
|
11
|
+
for (var i = 0, l = a.length; i < l; i++) {
|
|
12
|
+
if (a[i] instanceof Array && b[i] instanceof Array) {
|
|
13
|
+
if (!equalsArray(a[i], b[i])) {
|
|
14
|
+
return false;
|
|
15
|
+
}
|
|
16
|
+
} else if (a[i] !== b[i]) {
|
|
17
|
+
return false;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
return true;
|
|
21
|
+
}
|
|
22
|
+
export {
|
|
23
|
+
equalsArray
|
|
24
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
const makeComposeClasses = (generateGlobalClass) => (classes, ruleName) => [generateGlobalClass(ruleName), classes[ruleName]].filter((x) => x).join(" ");
|
|
2
|
+
const toNestedGlobalSelectors = (styles, generateGlobalClass) => Object.fromEntries(
|
|
3
|
+
Object.entries(styles).map(([k, v]) => [
|
|
4
|
+
`& .${generateGlobalClass(k)}`,
|
|
5
|
+
v
|
|
6
|
+
])
|
|
7
|
+
);
|
|
8
|
+
const mergeSx = (...allSx) => allSx.flat();
|
|
9
|
+
export {
|
|
10
|
+
makeComposeClasses,
|
|
11
|
+
mergeSx,
|
|
12
|
+
toNestedGlobalSelectors
|
|
13
|
+
};
|
package/package.json
CHANGED
|
@@ -1,27 +1,26 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gridsuite/commons-ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.48.0",
|
|
4
4
|
"description": "common react components for gridsuite applications",
|
|
5
5
|
"engines": {
|
|
6
6
|
"npm": ">=9",
|
|
7
7
|
"node": ">=18"
|
|
8
8
|
},
|
|
9
|
-
"exports": "
|
|
10
|
-
"module": "
|
|
9
|
+
"exports": "./dist/index.js",
|
|
10
|
+
"module": "./dist/index.js",
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
11
12
|
"files": [
|
|
12
|
-
"
|
|
13
|
-
"es",
|
|
14
|
-
"lib",
|
|
15
|
-
"umd"
|
|
13
|
+
"dist"
|
|
16
14
|
],
|
|
17
15
|
"scripts": {
|
|
18
|
-
"
|
|
19
|
-
"
|
|
16
|
+
"start": "vite demo/ --config vite.config.mts",
|
|
17
|
+
"build": "npm install && tsc && vite build && npm prune --production",
|
|
18
|
+
"build:only": "vite build",
|
|
20
19
|
"prepublishOnly": "npm run build",
|
|
21
|
-
"
|
|
22
|
-
"test": "
|
|
23
|
-
"test:
|
|
24
|
-
"
|
|
20
|
+
"test": "jest",
|
|
21
|
+
"test:coverage": "jest --coverage",
|
|
22
|
+
"test:watch": "jest --watch",
|
|
23
|
+
"lint": "eslint . --ext js,mjs,jsx,ts,mts,tsx --max-warnings 0"
|
|
25
24
|
},
|
|
26
25
|
"dependencies": {
|
|
27
26
|
"autosuggest-highlight": "^3.2.0",
|
|
@@ -32,7 +31,8 @@
|
|
|
32
31
|
"prop-types": "^15.7.2",
|
|
33
32
|
"react-csv-downloader": "^2.7.0",
|
|
34
33
|
"react-request-fullscreen": "^1.1.2",
|
|
35
|
-
"react-virtualized": "^9.
|
|
34
|
+
"react-virtualized": "^9.22.5",
|
|
35
|
+
"uuid": "^3.4.0"
|
|
36
36
|
},
|
|
37
37
|
"peerDependencies": {
|
|
38
38
|
"@emotion/react": "^11.8.1",
|
|
@@ -50,6 +50,9 @@
|
|
|
50
50
|
"yup": "^1.0.0"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
|
+
"@babel/preset-env": "^7.23.8",
|
|
54
|
+
"@babel/preset-react": "^7.23.3",
|
|
55
|
+
"@babel/preset-typescript": "^7.23.3",
|
|
53
56
|
"@emotion/react": "^11.8.1",
|
|
54
57
|
"@emotion/styled": "^11.8.1",
|
|
55
58
|
"@mui/icons-material": "^5.5.0",
|
|
@@ -58,33 +61,43 @@
|
|
|
58
61
|
"@mui/styles": "^5.5.0",
|
|
59
62
|
"@hookform/resolvers": "^3.0.0",
|
|
60
63
|
"@babel/helper-builder-react-jsx": "7.15.4",
|
|
61
|
-
"@
|
|
64
|
+
"@types/react": "^18.2.56",
|
|
65
|
+
"@types/react-dom": "^18.2.19",
|
|
66
|
+
"@typescript-eslint/eslint-plugin": "5.62.0",
|
|
67
|
+
"@typescript-eslint/parser": "5.62.0",
|
|
68
|
+
"@vitejs/plugin-react": "^4.2.1",
|
|
62
69
|
"babel-eslint": "^10.1.0",
|
|
63
70
|
"bufferutil": "^4.0.1",
|
|
64
71
|
"eslint": "^7.9.0",
|
|
65
72
|
"eslint-config-prettier": "^8.0.0",
|
|
66
73
|
"eslint-config-react-app": "^6.0.0",
|
|
67
|
-
"eslint-webpack-plugin": "^2.0.0",
|
|
68
74
|
"eslint-plugin-flowtype": "^5.2.0",
|
|
69
75
|
"eslint-plugin-import": "^2.22.0",
|
|
70
76
|
"eslint-plugin-jsx-a11y": "^6.3.1",
|
|
71
77
|
"eslint-plugin-prettier": "^4.0.0",
|
|
72
78
|
"eslint-plugin-react": "^7.21.0",
|
|
73
79
|
"eslint-plugin-react-hooks": "^4.1.2",
|
|
80
|
+
"jest": "^29.7.0",
|
|
81
|
+
"jest-environment-jsdom": "^29.7.0",
|
|
82
|
+
"jest-svg-transformer": "^1.0.0",
|
|
74
83
|
"notistack": "^3.0.0",
|
|
75
|
-
"nwb": "^0.25.x",
|
|
76
84
|
"prettier": "^2.0.0",
|
|
77
|
-
"puppeteer": "^17.0.0",
|
|
78
85
|
"react": "^18.0.0",
|
|
79
86
|
"react-dom": "^18.0.0",
|
|
80
87
|
"react-intl": "^6.0.0",
|
|
81
88
|
"react-hook-form": "^7.41.0",
|
|
82
89
|
"react-router-dom": "^6.0.0",
|
|
90
|
+
"ts-node": "^10.9.2",
|
|
83
91
|
"type-fest": "^2.0.0",
|
|
92
|
+
"typescript": "5.1.6",
|
|
84
93
|
"utf-8-validate": "^5.0.2",
|
|
85
|
-
"webpack-plugin-serve": "^1.0.1",
|
|
86
94
|
"@react-hook/window-size": "^3.1.1",
|
|
87
95
|
"react-resizable": "^3.0.4",
|
|
96
|
+
"vite": "^5.0.11",
|
|
97
|
+
"vite-plugin-eslint": "^1.8.1",
|
|
98
|
+
"vite-plugin-externalize-deps": "^0.8.0",
|
|
99
|
+
"vite-plugin-svgr": "^4.2.0",
|
|
100
|
+
"vite-plugin-dts": "^2.3.0",
|
|
88
101
|
"yup": "^1.0.0"
|
|
89
102
|
},
|
|
90
103
|
"eslintConfig": {
|
|
@@ -92,10 +105,12 @@
|
|
|
92
105
|
"react-app",
|
|
93
106
|
"plugin:prettier/recommended"
|
|
94
107
|
],
|
|
108
|
+
"ignorePatterns": [
|
|
109
|
+
"dist"
|
|
110
|
+
],
|
|
95
111
|
"rules": {
|
|
96
112
|
"prettier/prettier": "warn",
|
|
97
|
-
"curly": "error"
|
|
98
|
-
"import/no-webpack-loader-syntax": "off"
|
|
113
|
+
"curly": "error"
|
|
99
114
|
}
|
|
100
115
|
},
|
|
101
116
|
"author": "gridsuite team",
|
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) 2020, 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
|
-
|
|
8
|
-
import React, { useCallback } from 'react';
|
|
9
|
-
import { Navigate, Route, Routes } from 'react-router-dom';
|
|
10
|
-
import SignInCallbackHandler from '../SignInCallbackHandler';
|
|
11
|
-
import { handleSigninCallback, handleSilentRenewCallback, login, logout } from '../../utils/AuthService';
|
|
12
|
-
import SilentRenewCallbackHandler from '../SilentRenewCallbackHandler';
|
|
13
|
-
import Login from '../Login';
|
|
14
|
-
import Logout from '../Login/Logout';
|
|
15
|
-
import { Grid } from '@mui/material';
|
|
16
|
-
import Alert from '@mui/material/Alert';
|
|
17
|
-
import AlertTitle from '@mui/material/AlertTitle';
|
|
18
|
-
import { FormattedMessage } from 'react-intl';
|
|
19
|
-
var AuthenticationRouter = function AuthenticationRouter(_ref) {
|
|
20
|
-
var userManager = _ref.userManager,
|
|
21
|
-
signInCallbackError = _ref.signInCallbackError,
|
|
22
|
-
authenticationRouterError = _ref.authenticationRouterError,
|
|
23
|
-
showAuthenticationRouterLogin = _ref.showAuthenticationRouterLogin,
|
|
24
|
-
dispatch = _ref.dispatch,
|
|
25
|
-
navigate = _ref.navigate,
|
|
26
|
-
location = _ref.location;
|
|
27
|
-
var handleSigninCallbackClosure = useCallback(function () {
|
|
28
|
-
return handleSigninCallback(dispatch, navigate, userManager.instance);
|
|
29
|
-
}, [dispatch, navigate, userManager.instance]);
|
|
30
|
-
var handleSilentRenewCallbackClosure = useCallback(function () {
|
|
31
|
-
return handleSilentRenewCallback(userManager.instance);
|
|
32
|
-
}, [userManager.instance]);
|
|
33
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Grid, {
|
|
34
|
-
container: true,
|
|
35
|
-
alignContent: 'center',
|
|
36
|
-
alignItems: 'center',
|
|
37
|
-
direction: 'column'
|
|
38
|
-
}, userManager.error !== null && /*#__PURE__*/React.createElement("h1", null, "Error : Getting userManager; ", userManager.error), signInCallbackError !== null && /*#__PURE__*/React.createElement("h1", null, "Error : SignIn Callback Error;", signInCallbackError.message), /*#__PURE__*/React.createElement(Routes, null, /*#__PURE__*/React.createElement(Route, {
|
|
39
|
-
path: "sign-in-callback",
|
|
40
|
-
element: /*#__PURE__*/React.createElement(SignInCallbackHandler, {
|
|
41
|
-
userManager: userManager.instance,
|
|
42
|
-
handleSignInCallback: handleSigninCallbackClosure
|
|
43
|
-
})
|
|
44
|
-
}), /*#__PURE__*/React.createElement(Route, {
|
|
45
|
-
path: "silent-renew-callback",
|
|
46
|
-
element: /*#__PURE__*/React.createElement(SilentRenewCallbackHandler, {
|
|
47
|
-
userManager: userManager.instance,
|
|
48
|
-
handleSilentRenewCallback: handleSilentRenewCallbackClosure
|
|
49
|
-
})
|
|
50
|
-
}), /*#__PURE__*/React.createElement(Route, {
|
|
51
|
-
path: "logout-callback",
|
|
52
|
-
element: /*#__PURE__*/React.createElement(Navigate, {
|
|
53
|
-
to: "/"
|
|
54
|
-
})
|
|
55
|
-
}), /*#__PURE__*/React.createElement(Route, {
|
|
56
|
-
path: "*",
|
|
57
|
-
element: showAuthenticationRouterLogin && authenticationRouterError == null && /*#__PURE__*/React.createElement(Login, {
|
|
58
|
-
disabled: userManager.instance === null,
|
|
59
|
-
onLoginClick: function onLoginClick() {
|
|
60
|
-
return login(location, userManager.instance);
|
|
61
|
-
}
|
|
62
|
-
})
|
|
63
|
-
})), authenticationRouterError !== null && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Grid, {
|
|
64
|
-
item: true
|
|
65
|
-
}, /*#__PURE__*/React.createElement(Logout, {
|
|
66
|
-
disabled: userManager.instance === null,
|
|
67
|
-
onLogoutClick: function onLogoutClick() {
|
|
68
|
-
return logout(location, userManager.instance);
|
|
69
|
-
}
|
|
70
|
-
})), /*#__PURE__*/React.createElement(Grid, {
|
|
71
|
-
item: true,
|
|
72
|
-
xs: 4
|
|
73
|
-
}, authenticationRouterError.logoutError != null && /*#__PURE__*/React.createElement(Alert, {
|
|
74
|
-
severity: "error"
|
|
75
|
-
}, /*#__PURE__*/React.createElement(AlertTitle, null, /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
76
|
-
id: "login/errorInLogout"
|
|
77
|
-
})), /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
78
|
-
id: "login/errorInLogoutMessage",
|
|
79
|
-
values: {
|
|
80
|
-
userName: authenticationRouterError.userName
|
|
81
|
-
}
|
|
82
|
-
}), /*#__PURE__*/React.createElement("p", null, authenticationRouterError.logoutError.error.message)), (authenticationRouterError === null || authenticationRouterError === void 0 ? void 0 : authenticationRouterError.userValidationError) != null && /*#__PURE__*/React.createElement(Alert, {
|
|
83
|
-
severity: "error"
|
|
84
|
-
}, /*#__PURE__*/React.createElement(AlertTitle, null, /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
85
|
-
id: "login/errorInUserValidation"
|
|
86
|
-
})), /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
87
|
-
id: "login/errorInUserValidationMessage",
|
|
88
|
-
values: {
|
|
89
|
-
userName: authenticationRouterError.userName
|
|
90
|
-
}
|
|
91
|
-
}), /*#__PURE__*/React.createElement("p", null, authenticationRouterError.userValidationError.error.message)), (authenticationRouterError === null || authenticationRouterError === void 0 ? void 0 : authenticationRouterError.unauthorizedUserInfo) != null && /*#__PURE__*/React.createElement(Alert, {
|
|
92
|
-
severity: "info"
|
|
93
|
-
}, /*#__PURE__*/React.createElement(AlertTitle, null, /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
94
|
-
id: "login/unauthorizedAccess"
|
|
95
|
-
})), /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
96
|
-
id: "login/unauthorizedAccessMessage",
|
|
97
|
-
values: {
|
|
98
|
-
userName: authenticationRouterError.userName
|
|
99
|
-
}
|
|
100
|
-
}))))));
|
|
101
|
-
};
|
|
102
|
-
export default AuthenticationRouter;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) 2020, 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 { default } from './AuthenticationRouter';
|
|
@@ -1,138 +0,0 @@
|
|
|
1
|
-
var _excluded = ["expand"];
|
|
2
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
3
|
-
function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); }
|
|
4
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
5
|
-
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
6
|
-
/**
|
|
7
|
-
* Copyright (c) 2022, RTE (http://www.rte-france.com)
|
|
8
|
-
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
9
|
-
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
10
|
-
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
// adapted from
|
|
14
|
-
// https://reactjs.org/docs/error-boundaries.html
|
|
15
|
-
// https://mui.com/material-ui/react-card/#complex-interaction
|
|
16
|
-
|
|
17
|
-
import * as React from 'react';
|
|
18
|
-
import Box from '@mui/material/Box';
|
|
19
|
-
import Card from '@mui/material/Card';
|
|
20
|
-
import CardHeader from '@mui/material/CardHeader';
|
|
21
|
-
import CardContent from '@mui/material/CardContent';
|
|
22
|
-
import CardActions from '@mui/material/CardActions';
|
|
23
|
-
import Collapse from '@mui/material/Collapse';
|
|
24
|
-
import IconButton from '@mui/material/IconButton';
|
|
25
|
-
import ExpandMoreIcon from '@mui/icons-material/ExpandMore';
|
|
26
|
-
import ReplayIcon from '@mui/icons-material/Replay';
|
|
27
|
-
import Typography from '@mui/material/Typography';
|
|
28
|
-
import { styled } from '@mui/material/styles';
|
|
29
|
-
import { FormattedMessage } from 'react-intl';
|
|
30
|
-
var ExpandMore = styled(function (props) {
|
|
31
|
-
var expand = props.expand,
|
|
32
|
-
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
33
|
-
return /*#__PURE__*/React.createElement(IconButton, other);
|
|
34
|
-
})(function (_ref) {
|
|
35
|
-
var theme = _ref.theme,
|
|
36
|
-
expand = _ref.expand;
|
|
37
|
-
return {
|
|
38
|
-
transform: !expand ? 'rotate(0deg)' : 'rotate(180deg)',
|
|
39
|
-
marginLeft: 'auto',
|
|
40
|
-
transition: theme.transitions.create('transform', {
|
|
41
|
-
duration: theme.transitions.duration.shortest
|
|
42
|
-
})
|
|
43
|
-
};
|
|
44
|
-
});
|
|
45
|
-
var CardErrorBoundary = /*#__PURE__*/function (_React$Component) {
|
|
46
|
-
_inheritsLoose(CardErrorBoundary, _React$Component);
|
|
47
|
-
function CardErrorBoundary(props) {
|
|
48
|
-
var _this;
|
|
49
|
-
_this = _React$Component.call(this, props) || this;
|
|
50
|
-
_this.state = {
|
|
51
|
-
hasError: false,
|
|
52
|
-
expanded: false,
|
|
53
|
-
error: undefined
|
|
54
|
-
};
|
|
55
|
-
_this.handleExpandClick = _this.handleExpandClick.bind(_assertThisInitialized(_this));
|
|
56
|
-
_this.handleReloadClick = _this.handleReloadClick.bind(_assertThisInitialized(_this));
|
|
57
|
-
return _this;
|
|
58
|
-
}
|
|
59
|
-
CardErrorBoundary.getDerivedStateFromError = function getDerivedStateFromError(error) {
|
|
60
|
-
// Update state so the next render will show the fallback UI.
|
|
61
|
-
return {
|
|
62
|
-
hasError: true,
|
|
63
|
-
error: error
|
|
64
|
-
};
|
|
65
|
-
};
|
|
66
|
-
var _proto = CardErrorBoundary.prototype;
|
|
67
|
-
_proto.componentDidCatch = function componentDidCatch(error, errorInfo) {
|
|
68
|
-
// You can also log the error to an error reporting service
|
|
69
|
-
console.error('CardErrorBoundary caught: ', error, errorInfo);
|
|
70
|
-
};
|
|
71
|
-
_proto.handleExpandClick = function handleExpandClick() {
|
|
72
|
-
this.setState(function (state) {
|
|
73
|
-
return {
|
|
74
|
-
expanded: !state.expanded
|
|
75
|
-
};
|
|
76
|
-
});
|
|
77
|
-
};
|
|
78
|
-
_proto.handleReloadClick = function handleReloadClick() {
|
|
79
|
-
this.setState(function (state) {
|
|
80
|
-
return {
|
|
81
|
-
hasError: false,
|
|
82
|
-
expanded: false,
|
|
83
|
-
error: undefined
|
|
84
|
-
};
|
|
85
|
-
});
|
|
86
|
-
};
|
|
87
|
-
_proto.render = function render() {
|
|
88
|
-
if (this.state.hasError) {
|
|
89
|
-
var _this$state = this.state,
|
|
90
|
-
error = _this$state.error,
|
|
91
|
-
expanded = _this$state.expanded;
|
|
92
|
-
return /*#__PURE__*/React.createElement(Box, {
|
|
93
|
-
sx: {
|
|
94
|
-
p: 4
|
|
95
|
-
}
|
|
96
|
-
}, /*#__PURE__*/React.createElement(Card, {
|
|
97
|
-
sx: {
|
|
98
|
-
mx: 'auto',
|
|
99
|
-
maxWidth: 600
|
|
100
|
-
}
|
|
101
|
-
}, /*#__PURE__*/React.createElement(CardHeader, {
|
|
102
|
-
title: /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
103
|
-
id: "card_error_boundary/title",
|
|
104
|
-
defaultMessage: "Sorry, Unexpected error :("
|
|
105
|
-
})
|
|
106
|
-
}), /*#__PURE__*/React.createElement(CardContent, null, /*#__PURE__*/React.createElement(Typography, {
|
|
107
|
-
variant: "body2",
|
|
108
|
-
color: "text.secondary"
|
|
109
|
-
}, /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
110
|
-
id: "card_error_boundary/content",
|
|
111
|
-
defaultMessage: "Please reload, or close and reopen this application, or contact support."
|
|
112
|
-
}))), /*#__PURE__*/React.createElement(CardActions, {
|
|
113
|
-
disableSpacing: true
|
|
114
|
-
}, /*#__PURE__*/React.createElement(IconButton, {
|
|
115
|
-
onClick: this.handleReloadClick,
|
|
116
|
-
"aria-label": "reload"
|
|
117
|
-
}, /*#__PURE__*/React.createElement(ReplayIcon, null)), /*#__PURE__*/React.createElement(ExpandMore, {
|
|
118
|
-
expand: expanded,
|
|
119
|
-
onClick: this.handleExpandClick,
|
|
120
|
-
"aria-expanded": expanded,
|
|
121
|
-
"aria-label": "show more"
|
|
122
|
-
}, /*#__PURE__*/React.createElement(ExpandMoreIcon, null))), /*#__PURE__*/React.createElement(Collapse, {
|
|
123
|
-
"in": expanded
|
|
124
|
-
}, /*#__PURE__*/React.createElement(CardContent, null, /*#__PURE__*/React.createElement(Typography, {
|
|
125
|
-
variant: "body2",
|
|
126
|
-
color: "text.secondary"
|
|
127
|
-
}, /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
128
|
-
id: "card_error_boundary/expandederrorheader",
|
|
129
|
-
defaultMessage: "Error message (and see more information in the developper console):"
|
|
130
|
-
})), /*#__PURE__*/React.createElement(Typography, {
|
|
131
|
-
variant: "caption"
|
|
132
|
-
}, error.message)))));
|
|
133
|
-
}
|
|
134
|
-
return this.props.children;
|
|
135
|
-
};
|
|
136
|
-
return CardErrorBoundary;
|
|
137
|
-
}(React.Component);
|
|
138
|
-
export default CardErrorBoundary;
|