@gridsuite/commons-ui 0.58.0 → 0.59.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.
Files changed (182) hide show
  1. package/dist/chunks/{criteria-based-filter-edition-dialog.CbhgOSRk.js → criteria-based-filter-edition-dialog.p2pUWzxc.js} +20 -65
  2. package/dist/components/AuthenticationRouter/AuthenticationRouter.d.ts +28 -9
  3. package/dist/components/AuthenticationRouter/AuthenticationRouter.js +1 -1
  4. package/dist/components/AuthenticationRouter/index.d.ts +6 -0
  5. package/dist/components/CardErrorBoundary/card-error-boundary.d.ts +27 -13
  6. package/dist/components/CardErrorBoundary/card-error-boundary.js +7 -6
  7. package/dist/components/CardErrorBoundary/index.d.ts +6 -0
  8. package/dist/components/DirectoryItemSelector/directory-item-selector.d.ts +0 -4
  9. package/dist/components/DirectoryItemSelector/directory-item-selector.js +13 -26
  10. package/dist/components/ElementSearchDialog/equipment-item.d.ts +25 -16
  11. package/dist/components/ElementSearchDialog/equipment-item.js +5 -5
  12. package/dist/components/ElementSearchDialog/index.d.ts +6 -0
  13. package/dist/components/ElementSearchDialog/tag-renderer.d.ts +20 -10
  14. package/dist/components/ElementSearchDialog/tag-renderer.js +6 -11
  15. package/dist/components/FlatParameters/FlatParameters.d.ts +29 -9
  16. package/dist/components/FlatParameters/FlatParameters.js +3 -3
  17. package/dist/components/FlatParameters/index.d.ts +6 -0
  18. package/dist/components/Login/Login.d.ts +11 -4
  19. package/dist/components/Login/Logout.d.ts +11 -4
  20. package/dist/components/Login/index.d.ts +6 -0
  21. package/dist/components/MuiVirtualizedTable/ColumnHeader.d.ts +25 -2
  22. package/dist/components/MuiVirtualizedTable/ColumnHeader.js +68 -59
  23. package/dist/components/MuiVirtualizedTable/KeyedColumnsRowIndexer.d.ts +72 -61
  24. package/dist/components/MuiVirtualizedTable/KeyedColumnsRowIndexer.js +69 -83
  25. package/dist/components/MuiVirtualizedTable/MuiVirtualizedTable.d.ts +93 -113
  26. package/dist/components/MuiVirtualizedTable/MuiVirtualizedTable.js +84 -106
  27. package/dist/components/MuiVirtualizedTable/index.d.ts +7 -1
  28. package/dist/components/MultipleSelectionDialog/MultipleSelectionDialog.d.ts +16 -9
  29. package/dist/components/MultipleSelectionDialog/MultipleSelectionDialog.js +1 -1
  30. package/dist/components/MultipleSelectionDialog/index.d.ts +6 -0
  31. package/dist/components/OverflowableText/index.d.ts +6 -0
  32. package/dist/components/OverflowableText/overflowable-text.d.ts +11 -1
  33. package/dist/components/OverflowableText/overflowable-text.js +1 -18
  34. package/dist/components/ReportViewer/filter-button.d.ts +11 -1
  35. package/dist/components/ReportViewer/filter-button.js +5 -2
  36. package/dist/components/ReportViewer/index.d.ts +6 -0
  37. package/dist/components/ReportViewer/log-report-item.d.ts +14 -64
  38. package/dist/components/ReportViewer/log-report-item.js +13 -47
  39. package/dist/components/ReportViewer/log-report.d.ts +16 -17
  40. package/dist/components/ReportViewer/log-report.js +2 -1
  41. package/dist/components/ReportViewer/log-severity.d.ts +13 -0
  42. package/dist/components/ReportViewer/log-severity.js +35 -0
  43. package/dist/components/ReportViewer/log-table.d.ts +9 -6
  44. package/dist/components/ReportViewer/log-table.js +6 -4
  45. package/dist/components/ReportViewer/multi-select-list.d.ts +17 -1
  46. package/dist/components/ReportViewer/report-item.d.ts +12 -12
  47. package/dist/components/ReportViewer/report-item.js +0 -7
  48. package/dist/components/ReportViewer/report-tree-view-context.d.ts +11 -1
  49. package/dist/components/ReportViewer/report-viewer.d.ts +7 -4
  50. package/dist/components/ReportViewer/report-viewer.js +8 -6
  51. package/dist/components/ReportViewer/report.type.d.ts +22 -0
  52. package/dist/components/ReportViewer/report.type.js +1 -0
  53. package/dist/components/ReportViewerDialog/index.d.ts +6 -0
  54. package/dist/components/ReportViewerDialog/report-viewer-dialog.d.ts +9 -1
  55. package/dist/components/SignInCallbackHandler/SignInCallbackHandler.d.ts +7 -4
  56. package/dist/components/SignInCallbackHandler/SignInCallbackHandler.js +4 -1
  57. package/dist/components/SignInCallbackHandler/index.d.ts +6 -0
  58. package/dist/components/SilentRenewCallbackHandler/SilentRenewCallbackHandler.d.ts +7 -4
  59. package/dist/components/SilentRenewCallbackHandler/index.d.ts +6 -0
  60. package/dist/components/SnackbarProvider/SnackbarProvider.d.ts +3 -1
  61. package/dist/components/SnackbarProvider/SnackbarProvider.js +9 -7
  62. package/dist/components/SnackbarProvider/index.d.ts +6 -0
  63. package/dist/components/TopBar/AboutDialog.d.ts +30 -23
  64. package/dist/components/TopBar/AboutDialog.js +4 -22
  65. package/dist/components/TopBar/GridLogo.d.ts +13 -32
  66. package/dist/components/TopBar/GridLogo.js +12 -15
  67. package/dist/components/TopBar/TopBar.d.ts +52 -51
  68. package/dist/components/TopBar/TopBar.js +389 -380
  69. package/dist/components/TopBar/TopBar.test.d.ts +6 -0
  70. package/dist/components/TopBar/index.d.ts +6 -0
  71. package/dist/components/dialogs/modify-element-selection.d.ts +1 -1
  72. package/dist/components/dialogs/modify-element-selection.js +5 -14
  73. package/dist/components/filter/criteria-based/criteria-based-filter-edition-dialog.d.ts +1 -1
  74. package/dist/components/filter/criteria-based/criteria-based-filter-edition-dialog.js +1 -1
  75. package/dist/components/filter/criteria-based/filter-free-properties.d.ts +1 -1
  76. package/dist/components/filter/criteria-based/filter-property.d.ts +1 -1
  77. package/dist/components/filter/expert/expert-filter-constants.d.ts +22 -1
  78. package/dist/components/filter/expert/expert-filter-constants.js +39 -10
  79. package/dist/components/filter/expert/expert-filter-edition-dialog.d.ts +0 -6
  80. package/dist/components/filter/expert/expert-filter-edition-dialog.js +1 -2
  81. package/dist/components/filter/expert/expert-filter-form.js +1 -1
  82. package/dist/components/filter/expert/expert-filter.type.d.ts +4 -1
  83. package/dist/components/filter/expert/expert-filter.type.js +3 -0
  84. package/dist/components/filter/explicit-naming/explicit-naming-filter-edition-dialog.js +1 -1
  85. package/dist/components/filter/explicit-naming/explicit-naming-filter-form.js +1 -1
  86. package/dist/components/filter/filter-creation-dialog.d.ts +0 -7
  87. package/dist/components/filter/filter-creation-dialog.js +1 -2
  88. package/dist/components/filter/filter-form.js +1 -1
  89. package/dist/components/filter/utils/filter-form-utils.js +11 -18
  90. package/dist/components/inputs/react-hook-form/ag-grid-table/bottom-right-buttons.js +1 -1
  91. package/dist/components/inputs/react-hook-form/ag-grid-table/csv-uploader/csv-uploader.js +5 -13
  92. package/dist/components/inputs/react-hook-form/ag-grid-table/custom-ag-grid-table.js +1 -1
  93. package/dist/components/inputs/react-hook-form/autocomplete-inputs/autocomplete-input.d.ts +1 -1
  94. package/dist/components/inputs/react-hook-form/booleans/boolean-input.d.ts +9 -15
  95. package/dist/components/inputs/react-hook-form/booleans/boolean-input.js +0 -7
  96. package/dist/components/inputs/react-hook-form/booleans/checkbox-input.d.ts +8 -13
  97. package/dist/components/inputs/react-hook-form/booleans/checkbox-input.js +0 -6
  98. package/dist/components/inputs/react-hook-form/booleans/switch-input.d.ts +8 -13
  99. package/dist/components/inputs/react-hook-form/booleans/switch-input.js +0 -6
  100. package/dist/components/inputs/react-hook-form/directory-items-input.d.ts +0 -2
  101. package/dist/components/inputs/react-hook-form/directory-items-input.js +10 -14
  102. package/dist/components/inputs/react-hook-form/error-management/mid-form-error.d.ts +5 -3
  103. package/dist/components/inputs/react-hook-form/numbers/integer-input.d.ts +3 -20
  104. package/dist/components/inputs/react-hook-form/numbers/integer-input.js +1 -4
  105. package/dist/components/inputs/react-hook-form/range-input.d.ts +1 -1
  106. package/dist/components/inputs/react-hook-form/select-inputs/countries-input.js +12 -1
  107. package/dist/components/inputs/react-hook-form/select-inputs/select-input.d.ts +1 -1
  108. package/dist/components/inputs/react-hook-form/slider-input.d.ts +7 -20
  109. package/dist/components/inputs/react-hook-form/slider-input.js +4 -12
  110. package/dist/components/inputs/react-hook-form/text-input.d.ts +1 -1
  111. package/dist/components/inputs/react-hook-form/unique-name-input.d.ts +1 -1
  112. package/dist/components/inputs/react-hook-form/utils/text-field-with-adornment.d.ts +1 -1
  113. package/dist/components/inputs/react-query-builder/custom-react-query-builder.js +1 -1
  114. package/dist/components/inputs/react-query-builder/element-value-editor.js +7 -14
  115. package/dist/components/inputs/react-query-builder/remove-button.js +1 -1
  116. package/dist/components/inputs/react-query-builder/value-editor.js +1 -1
  117. package/dist/components/translations/card-error-boundary-en.d.ts +1 -1
  118. package/dist/components/translations/card-error-boundary-fr.d.ts +1 -1
  119. package/dist/components/translations/common-button-en.d.ts +10 -4
  120. package/dist/components/translations/common-button-fr.d.ts +10 -4
  121. package/dist/components/translations/directory-items-input-en.d.ts +1 -1
  122. package/dist/components/translations/directory-items-input-fr.d.ts +1 -1
  123. package/dist/components/translations/element-search-en.d.ts +1 -1
  124. package/dist/components/translations/element-search-fr.d.ts +1 -1
  125. package/dist/components/translations/equipment-search-en.d.ts +1 -1
  126. package/dist/components/translations/equipment-search-fr.d.ts +1 -1
  127. package/dist/components/translations/filter-en.d.ts +27 -21
  128. package/dist/components/translations/filter-en.js +2 -1
  129. package/dist/components/translations/filter-expert-en.d.ts +73 -0
  130. package/dist/components/translations/filter-expert-en.js +69 -0
  131. package/dist/components/translations/filter-expert-fr.d.ts +73 -0
  132. package/dist/components/translations/filter-expert-fr.js +69 -0
  133. package/dist/components/translations/filter-fr.d.ts +27 -21
  134. package/dist/components/translations/filter-fr.js +2 -1
  135. package/dist/components/translations/flat-parameters-en.d.ts +1 -1
  136. package/dist/components/translations/flat-parameters-fr.d.ts +1 -1
  137. package/dist/components/translations/inputs-en.d.ts +1 -1
  138. package/dist/components/translations/inputs-fr.d.ts +1 -1
  139. package/dist/components/translations/login-en.d.ts +1 -1
  140. package/dist/components/translations/login-fr.d.ts +1 -1
  141. package/dist/components/translations/multiple-selection-dialog-en.d.ts +1 -1
  142. package/dist/components/translations/multiple-selection-dialog-fr.d.ts +1 -1
  143. package/dist/components/translations/report-viewer-en.d.ts +1 -1
  144. package/dist/components/translations/report-viewer-fr.d.ts +1 -1
  145. package/dist/components/translations/table-en.d.ts +1 -1
  146. package/dist/components/translations/table-fr.d.ts +1 -1
  147. package/dist/components/translations/top-bar-en.d.ts +1 -1
  148. package/dist/components/translations/top-bar-fr.d.ts +1 -1
  149. package/dist/components/translations/treeview-finder-en.d.ts +1 -1
  150. package/dist/components/translations/treeview-finder-fr.d.ts +1 -1
  151. package/dist/hooks/localized-countries-hook.d.ts +10 -4
  152. package/dist/hooks/localized-countries-hook.js +1 -1
  153. package/dist/hooks/predefined-properties-hook.d.ts +1 -15
  154. package/dist/hooks/predefined-properties-hook.js +8 -16
  155. package/dist/index.d.ts +63 -217
  156. package/dist/index.js +102 -77
  157. package/dist/redux/actions.d.ts +33 -29
  158. package/dist/services/apps-metadata.d.ts +32 -0
  159. package/dist/services/apps-metadata.js +26 -0
  160. package/dist/services/directory.d.ts +6 -0
  161. package/dist/services/directory.js +42 -0
  162. package/dist/services/explore.d.ts +2 -0
  163. package/dist/services/explore.js +29 -1
  164. package/dist/services/index.d.ts +16 -0
  165. package/dist/services/index.js +20 -0
  166. package/dist/services/utils.d.ts +1 -0
  167. package/dist/services/utils.js +5 -1
  168. package/dist/utils/AuthService.d.ts +20 -9
  169. package/dist/utils/AuthService.js +29 -13
  170. package/dist/utils/ElementIcon.d.ts +4 -1
  171. package/dist/utils/UserManagerMock.d.ts +14 -14
  172. package/dist/utils/UserManagerMock.js +9 -15
  173. package/dist/utils/algos.d.ts +1 -1
  174. package/dist/utils/equipment-types-for-predefined-properties-mapper.d.ts +1 -1
  175. package/dist/utils/functions.d.ts +0 -1
  176. package/dist/utils/functions.js +1 -3
  177. package/dist/utils/styles.d.ts +5 -3
  178. package/dist/utils/styles.js +4 -1
  179. package/dist/utils/types.d.ts +13 -3
  180. package/package.json +2 -1
  181. package/dist/components/filter/filter-context.d.ts +0 -13
  182. package/dist/components/filter/filter-context.js +0 -11
@@ -1,50 +1,54 @@
1
- export function setLoggedUser(user: any): {
1
+ import { User } from 'oidc-client';
2
+
3
+ export declare const USER = "USER";
4
+ export declare function setLoggedUser(user: User | null): {
2
5
  type: string;
3
- user: any;
6
+ user: User | null;
4
7
  };
5
- export function setSignInCallbackError(signInCallbackError: any): {
8
+ export declare const SIGNIN_CALLBACK_ERROR = "SIGNIN_CALLBACK_ERROR";
9
+ export declare function setSignInCallbackError(signInCallbackError: string | null): {
6
10
  type: string;
7
- signInCallbackError: any;
11
+ signInCallbackError: string | null;
8
12
  };
9
- export function setUnauthorizedUserInfo(userName: any, unauthorizedUserInfo: any): {
13
+ export declare const UNAUTHORIZED_USER_INFO = "UNAUTHORIZED_USER_INFO";
14
+ export declare function setUnauthorizedUserInfo(userName: string | undefined, unauthorizedUserInfo: string): {
10
15
  type: string;
11
16
  authenticationRouterError: {
12
- userName: any;
13
- unauthorizedUserInfo: any;
17
+ userName: string | undefined;
18
+ unauthorizedUserInfo: string;
14
19
  };
15
20
  };
16
- export function setLogoutError(userName: any, logoutError: any): {
21
+ export declare const LOGOUT_ERROR = "LOGOUT_ERROR";
22
+ export declare function setLogoutError(userName: string | undefined, logoutError: {
23
+ error: Error;
24
+ }): {
17
25
  type: string;
18
26
  authenticationRouterError: {
19
- userName: any;
20
- logoutError: any;
27
+ userName: string | undefined;
28
+ logoutError: {
29
+ error: Error;
30
+ };
21
31
  };
22
32
  };
23
- export function setUserValidationError(userName: any, userValidationError: any): {
33
+ export declare const USER_VALIDATION_ERROR = "USER_VALIDATION_ERROR";
34
+ export declare function setUserValidationError(userName: string | undefined, userValidationError: {
35
+ error: Error;
36
+ }): {
24
37
  type: string;
25
38
  authenticationRouterError: {
26
- userName: any;
27
- userValidationError: any;
39
+ userName: string | undefined;
40
+ userValidationError: {
41
+ error: Error;
42
+ };
28
43
  };
29
44
  };
30
- export function resetAuthenticationRouterError(): {
45
+ export declare const RESET_AUTHENTICATION_ROUTER_ERROR = "RESET_AUTHENTICATION_ROUTER_ERROR";
46
+ export declare function resetAuthenticationRouterError(): {
31
47
  type: string;
32
48
  authenticationRouterError: null;
33
49
  };
34
- export function setShowAuthenticationRouterLogin(showAuthenticationRouterLogin: any): {
50
+ export declare const SHOW_AUTH_INFO_LOGIN = "SHOW_AUTH_INFO_LOGIN";
51
+ export declare function setShowAuthenticationRouterLogin(showAuthenticationRouterLogin: boolean): {
35
52
  type: string;
36
- showAuthenticationRouterLogin: any;
53
+ showAuthenticationRouterLogin: boolean;
37
54
  };
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,32 @@
1
+ import { PredefinedProperties } from '../utils/types';
2
+
3
+ export type Url = string | URL;
4
+ export type Env = {
5
+ appsMetadataServerUrl?: Url;
6
+ mapBoxToken?: string;
7
+ };
8
+ export declare function fetchEnv(): Promise<Env>;
9
+ export type CommonMetadata = {
10
+ name: string;
11
+ url: Url;
12
+ appColor: string;
13
+ hiddenInAppsMenu: boolean;
14
+ };
15
+ export type StudyMetadata = CommonMetadata & {
16
+ readonly name: 'Study';
17
+ resources?: {
18
+ types: string[];
19
+ path: string;
20
+ }[];
21
+ predefinedEquipmentProperties?: {
22
+ [networkElementType: string]: PredefinedProperties;
23
+ };
24
+ defaultParametersValues?: {
25
+ fluxConvention?: string;
26
+ enableDeveloperMode?: string;
27
+ mapManualRefresh?: string;
28
+ };
29
+ defaultCountry?: string;
30
+ };
31
+ export declare function fetchAppsMetadata(): Promise<CommonMetadata[]>;
32
+ export declare function fetchStudyMetadata(): Promise<StudyMetadata>;
@@ -0,0 +1,26 @@
1
+ async function fetchEnv() {
2
+ return (await fetch("env.json")).json();
3
+ }
4
+ async function fetchAppsMetadata() {
5
+ console.info(`Fetching apps and urls...`);
6
+ const env = await fetchEnv();
7
+ const res = await fetch(env.appsMetadataServerUrl + "/apps-metadata.json");
8
+ return res.json();
9
+ }
10
+ const isStudyMetadata = (metadata) => {
11
+ return metadata.name === "Study";
12
+ };
13
+ async function fetchStudyMetadata() {
14
+ console.info(`Fetching study metadata...`);
15
+ const studyMetadata = (await fetchAppsMetadata()).filter(isStudyMetadata);
16
+ if (!studyMetadata) {
17
+ throw new Error("Study entry could not be found in metadata");
18
+ } else {
19
+ return studyMetadata[0];
20
+ }
21
+ }
22
+ export {
23
+ fetchAppsMetadata,
24
+ fetchEnv,
25
+ fetchStudyMetadata
26
+ };
@@ -0,0 +1,6 @@
1
+ import { ElementAttributes } from '../utils/types';
2
+ import { UUID } from 'crypto';
3
+
4
+ export declare function fetchRootFolders(types: string[]): Promise<ElementAttributes[]>;
5
+ export declare function fetchDirectoryContent(directoryUuid: UUID, types?: string[]): Promise<ElementAttributes[]>;
6
+ export declare function fetchDirectoryElementPath(elementUuid: UUID): Promise<ElementAttributes[]>;
@@ -0,0 +1,42 @@
1
+ import { getRequestParamFromList, backendFetchJson } from "./utils.js";
2
+ const PREFIX_DIRECTORY_SERVER_QUERIES = "api/gateway/directory";
3
+ function fetchRootFolders(types) {
4
+ console.info("Fetching Root Directories");
5
+ const urlSearchParams = getRequestParamFromList(
6
+ types,
7
+ "elementTypes"
8
+ ).toString();
9
+ const fetchRootFoldersUrl = `${PREFIX_DIRECTORY_SERVER_QUERIES}/v1/root-directories?${urlSearchParams}`;
10
+ return backendFetchJson(fetchRootFoldersUrl, {
11
+ method: "get",
12
+ headers: { "Content-Type": "application/json" }
13
+ });
14
+ }
15
+ function fetchDirectoryContent(directoryUuid, types) {
16
+ console.info("Fetching Folder content '%s'", directoryUuid);
17
+ const urlSearchParams = getRequestParamFromList(
18
+ types,
19
+ "elementTypes"
20
+ ).toString();
21
+ let fetchDirectoryContentUrl = `${PREFIX_DIRECTORY_SERVER_QUERIES}/v1/directories/${directoryUuid}/elements${urlSearchParams ? "?" + urlSearchParams : ""}`;
22
+ return backendFetchJson(fetchDirectoryContentUrl, {
23
+ method: "get",
24
+ headers: { "Content-Type": "application/json" }
25
+ });
26
+ }
27
+ function fetchDirectoryElementPath(elementUuid) {
28
+ console.info(`Fetching element '${elementUuid}' and its parents info ...`);
29
+ const fetchPathUrl = `${PREFIX_DIRECTORY_SERVER_QUERIES}/v1/elements/${encodeURIComponent(
30
+ elementUuid
31
+ )}/path`;
32
+ console.debug(fetchPathUrl);
33
+ return backendFetchJson(fetchPathUrl, {
34
+ method: "get",
35
+ headers: { "Content-Type": "application/json" }
36
+ });
37
+ }
38
+ export {
39
+ fetchDirectoryContent,
40
+ fetchDirectoryElementPath,
41
+ fetchRootFolders
42
+ };
@@ -1,4 +1,6 @@
1
+ import { ElementAttributes } from '../utils/types';
1
2
  import { UUID } from 'crypto';
2
3
 
3
4
  export declare function createFilter(newFilter: any, name: string, description: string, parentDirectoryUuid?: UUID, token?: string): Promise<any>;
4
5
  export declare function saveFilter(filter: any, name: string, token?: string): Promise<any>;
6
+ export declare function fetchElementsInfos(ids: UUID[], elementTypes?: string[], equipmentTypes?: string[]): Promise<ElementAttributes[]>;
@@ -1,4 +1,4 @@
1
- import { backendFetch } from "./utils.js";
1
+ import { backendFetch, getRequestParamFromList, backendFetchJson } from "./utils.js";
2
2
  const PREFIX_EXPLORE_SERVER_QUERIES = "api/gateway/explore";
3
3
  function createFilter(newFilter, name, description, parentDirectoryUuid, token) {
4
4
  let urlSearchParams = new URLSearchParams();
@@ -28,7 +28,35 @@ function saveFilter(filter, name, token) {
28
28
  token
29
29
  );
30
30
  }
31
+ function fetchElementsInfos(ids, elementTypes, equipmentTypes) {
32
+ console.info("Fetching elements metadata");
33
+ const idsParams = getRequestParamFromList(
34
+ ids.filter((id) => id),
35
+ // filter falsy elements
36
+ "ids"
37
+ );
38
+ const equipmentTypesParams = getRequestParamFromList(
39
+ equipmentTypes,
40
+ "equipmentTypes"
41
+ );
42
+ const elementTypesParams = getRequestParamFromList(
43
+ elementTypes,
44
+ "elementTypes"
45
+ );
46
+ const urlSearchParams = new URLSearchParams([
47
+ ...idsParams,
48
+ ...equipmentTypesParams,
49
+ ...elementTypesParams
50
+ ]).toString();
51
+ const url = `${PREFIX_EXPLORE_SERVER_QUERIES}/v1/explore/elements/metadata?${urlSearchParams}`;
52
+ console.debug(url);
53
+ return backendFetchJson(url, {
54
+ method: "get",
55
+ headers: { "Content-Type": "application/json" }
56
+ });
57
+ }
31
58
  export {
32
59
  createFilter,
60
+ fetchElementsInfos,
33
61
  saveFilter
34
62
  };
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Copyright (c) 2024, 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 * from './utils';
8
+ export type * from './utils';
9
+ export * from './explore';
10
+ export type * from './explore';
11
+ export * from './apps-metadata';
12
+ export type * from './apps-metadata';
13
+ export * from './directory';
14
+ export type * from './directory';
15
+ export * from './study';
16
+ export type * from './study';
@@ -0,0 +1,20 @@
1
+ import { backendFetch, backendFetchJson, getRequestParamFromList } from "./utils.js";
2
+ import { createFilter, fetchElementsInfos, saveFilter } from "./explore.js";
3
+ import { fetchAppsMetadata, fetchEnv, fetchStudyMetadata } from "./apps-metadata.js";
4
+ import { fetchDirectoryContent, fetchDirectoryElementPath, fetchRootFolders } from "./directory.js";
5
+ import { exportFilter } from "./study.js";
6
+ export {
7
+ backendFetch,
8
+ backendFetchJson,
9
+ createFilter,
10
+ exportFilter,
11
+ fetchAppsMetadata,
12
+ fetchDirectoryContent,
13
+ fetchDirectoryElementPath,
14
+ fetchElementsInfos,
15
+ fetchEnv,
16
+ fetchRootFolders,
17
+ fetchStudyMetadata,
18
+ getRequestParamFromList,
19
+ saveFilter
20
+ };
@@ -6,3 +6,4 @@
6
6
  */
7
7
  export declare const backendFetch: (url: string, init: any, token?: string) => Promise<any>;
8
8
  export declare const backendFetchJson: (url: string, init: any, token?: string) => Promise<any>;
9
+ export declare const getRequestParamFromList: (params: string[] | undefined, paramName: string) => URLSearchParams;
@@ -52,7 +52,11 @@ const parseError = (text) => {
52
52
  return null;
53
53
  }
54
54
  };
55
+ const getRequestParamFromList = (params = [], paramName) => {
56
+ return new URLSearchParams(params.map((param) => [paramName, param]));
57
+ };
55
58
  export {
56
59
  backendFetch,
57
- backendFetchJson
60
+ backendFetchJson,
61
+ getRequestParamFromList
58
62
  };
@@ -1,9 +1,20 @@
1
- import { UserManagerMock } from './UserManagerMock';
2
- export function initializeAuthenticationDev(dispatch: any, isSilentRenew: any, validateUser: any, isSigninCallback: any): Promise<UserManagerMock>;
3
- export function initializeAuthenticationProd(dispatch: any, isSilentRenew: any, idpSettings: any, validateUser: any, authorizationCodeFlowEnabled: any, isSigninCallback: any): any;
4
- export function handleSilentRenewCallback(userManagerInstance: any): void;
5
- export function login(location: any, userManagerInstance: any): any;
6
- export function logout(dispatch: any, userManagerInstance: any): any;
7
- export function dispatchUser(dispatch: any, userManagerInstance: any, validateUser: any): any;
8
- export function handleSigninCallback(dispatch: any, navigate: any, userManagerInstance: any): void;
9
- export function getPreLoginPath(): string | null;
1
+ import { NavigateFunction } from 'react-router-dom';
2
+ import { Dispatch } from 'react';
3
+ import { User, UserManager } from 'oidc-client';
4
+
5
+ type UserValidationFunc = (user: User) => Promise<boolean>;
6
+ type CustomUserManager = UserManager & {
7
+ authorizationCodeFlowEnabled?: boolean;
8
+ idpSettings?: {
9
+ maxExpiresIn?: number;
10
+ };
11
+ };
12
+ declare function initializeAuthenticationDev(dispatch: Dispatch<unknown>, isSilentRenew: boolean, validateUser: UserValidationFunc, isSigninCallback: boolean): Promise<UserManager>;
13
+ declare function initializeAuthenticationProd(dispatch: Dispatch<unknown>, isSilentRenew: boolean, idpSettings: Promise<Response>, validateUser: UserValidationFunc, authorizationCodeFlowEnabled: boolean, isSigninCallback: boolean): Promise<CustomUserManager>;
14
+ declare function login(location: Location, userManagerInstance: UserManager): Promise<void>;
15
+ declare function logout(dispatch: Dispatch<unknown>, userManagerInstance: UserManager): Promise<void | undefined>;
16
+ declare function dispatchUser(dispatch: Dispatch<unknown>, userManagerInstance: CustomUserManager, validateUser: UserValidationFunc): Promise<void | undefined>;
17
+ declare function getPreLoginPath(): string | null;
18
+ declare function handleSigninCallback(dispatch: Dispatch<unknown>, navigate: NavigateFunction, userManagerInstance: UserManager): void;
19
+ declare function handleSilentRenewCallback(userManagerInstance: UserManager): void;
20
+ export { initializeAuthenticationDev, initializeAuthenticationProd, handleSilentRenewCallback, login, logout, dispatchUser, handleSigninCallback, getPreLoginPath, };
@@ -11,11 +11,13 @@ function isIssuerErrorForCodeFlow(error) {
11
11
  }
12
12
  function extractIssuerToSessionStorage(error) {
13
13
  const issuer = error.message.split(" ").pop();
14
- sessionStorage.setItem(hackAuthorityKey, issuer);
14
+ if (issuer !== void 0) {
15
+ sessionStorage.setItem(hackAuthorityKey, issuer);
16
+ }
15
17
  }
16
18
  function reload() {
17
19
  if (!sessionStorage.getItem(oidcHackReloadedKey)) {
18
- sessionStorage.setItem(oidcHackReloadedKey, true);
20
+ sessionStorage.setItem(oidcHackReloadedKey, true.toString());
19
21
  console.log("Hack oidc, reload page to make login work");
20
22
  window.location.reload();
21
23
  }
@@ -44,7 +46,9 @@ function handleSigninSilent(dispatch, userManager) {
44
46
  });
45
47
  }
46
48
  function initializeAuthenticationDev(dispatch, isSilentRenew, validateUser, isSigninCallback) {
47
- let userManager = new UserManagerMock({});
49
+ let userManager = new UserManagerMock(
50
+ {}
51
+ );
48
52
  if (!isSilentRenew) {
49
53
  handleUser(dispatch, userManager, validateUser);
50
54
  if (!isSigninCallback) {
@@ -82,7 +86,9 @@ function initializeAuthenticationProd(dispatch, isSilentRenew, idpSettings, vali
82
86
  "oidc." + state,
83
87
  JSON.stringify(storedState)
84
88
  );
85
- sessionStorage.setItem(hackAuthorityKey, authority);
89
+ if (authority !== void 0) {
90
+ sessionStorage.setItem(hackAuthorityKey, authority);
91
+ }
86
92
  const matched_expires = window.location.hash.match(regexexpires);
87
93
  if (matched_expires != null) {
88
94
  const expires_in = parseInt(
@@ -133,8 +139,11 @@ function initializeAuthenticationProd(dispatch, isSilentRenew, idpSettings, vali
133
139
  });
134
140
  }
135
141
  function computeMinExpiresIn(expiresIn, idToken, maxExpiresIn) {
136
- const now = parseInt(Date.now() / 1e3);
142
+ const now = Date.now() / 1e3;
137
143
  const exp = jwtDecode(idToken).exp;
144
+ if (exp === void 0) {
145
+ return expiresIn;
146
+ }
138
147
  const idTokenExpiresIn = exp - now;
139
148
  let newExpiresIn = expiresIn;
140
149
  let newExpiresInReplaceReason;
@@ -182,8 +191,11 @@ function logout(dispatch, userManagerInstance) {
182
191
  });
183
192
  }
184
193
  function getIdTokenExpiresIn(user) {
185
- const now = parseInt(Date.now() / 1e3);
194
+ const now = Date.now() / 1e3;
186
195
  const exp = jwtDecode(user.id_token).exp;
196
+ if (exp === void 0) {
197
+ return 0;
198
+ }
187
199
  return exp - now;
188
200
  }
189
201
  function dispatchUser(dispatch, userManagerInstance, validateUser) {
@@ -197,13 +209,13 @@ function dispatchUser(dispatch, userManagerInstance, validateUser) {
197
209
  }
198
210
  let validateUserPromise = validateUser && validateUser(user) || Promise.resolve(true);
199
211
  return validateUserPromise.then((valid) => {
200
- var _a;
212
+ var _a, _b;
201
213
  if (!valid) {
202
214
  console.debug(
203
215
  "User isn't authorized to log in and will not be dispatched"
204
216
  );
205
217
  return dispatch(
206
- setUnauthorizedUserInfo((_a = user == null ? void 0 : user.profile) == null ? void 0 : _a.name, {})
218
+ setUnauthorizedUserInfo((_a = user == null ? void 0 : user.profile) == null ? void 0 : _a.name, "")
207
219
  );
208
220
  }
209
221
  console.debug(
@@ -216,7 +228,7 @@ function dispatchUser(dispatch, userManagerInstance, validateUser) {
216
228
  computeMinExpiresIn(
217
229
  user.expires_in,
218
230
  user.id_token,
219
- userManagerInstance.idpSettings.maxExpiresIn
231
+ (_b = userManagerInstance.idpSettings) == null ? void 0 : _b.maxExpiresIn
220
232
  )
221
233
  );
222
234
  }
@@ -240,7 +252,9 @@ function getPreLoginPath() {
240
252
  }
241
253
  function navigateToPreLoginPath(navigate) {
242
254
  const previousPath = getPreLoginPath();
243
- navigate(previousPath);
255
+ if (previousPath !== null) {
256
+ navigate(previousPath);
257
+ }
244
258
  }
245
259
  function handleSigninCallback(dispatch, navigate, userManagerInstance) {
246
260
  let reloadAfterNavigate = false;
@@ -274,10 +288,12 @@ function handleUser(dispatch, userManager, validateUser) {
274
288
  console.debug(error);
275
289
  window.setTimeout(() => {
276
290
  userManager.getUser().then((user) => {
291
+ var _a, _b;
277
292
  if (!user) {
278
293
  console.error(
279
294
  "user is null at silent renew error, it shouldn't happen."
280
295
  );
296
+ return;
281
297
  }
282
298
  const idTokenExpiresIn = getIdTokenExpiresIn(user);
283
299
  if (idTokenExpiresIn < 0) {
@@ -288,12 +304,12 @@ function handleUser(dispatch, userManager, validateUser) {
288
304
  dispatch(setShowAuthenticationRouterLogin(true));
289
305
  dispatch(resetAuthenticationRouterError());
290
306
  return dispatch(setLoggedUser(null));
291
- } else if (userManager.idpSettings.maxExpiresIn) {
307
+ } else if ((_a = userManager.idpSettings) == null ? void 0 : _a.maxExpiresIn) {
292
308
  if (idTokenExpiresIn < userManager.idpSettings.maxExpiresIn) {
293
309
  console.log(
294
310
  "Error in silent renew, but idtoken ALMOST expiring (expiring in" + idTokenExpiresIn + ") => last chance, next error will logout",
295
311
  "maxExpiresIn = " + userManager.idpSettings.maxExpiresIn,
296
- "last renew attempt in " + idTokenExpiresIn - accessTokenExpiringNotificationTime + "seconds",
312
+ "last renew attempt in " + (idTokenExpiresIn - accessTokenExpiringNotificationTime) + "seconds",
297
313
  error
298
314
  );
299
315
  reloadTimerOnExpiresIn(
@@ -314,7 +330,7 @@ function handleUser(dispatch, userManager, validateUser) {
314
330
  }
315
331
  } else {
316
332
  console.log(
317
- "Error in silent renew, unsupported configuration: token still valid for " + idTokenExpiresIn + " but maxExpiresIn is not configured:" + userManager.idpSettings.maxExpiresIn,
333
+ "Error in silent renew, unsupported configuration: token still valid for " + idTokenExpiresIn + " but maxExpiresIn is not configured:" + ((_b = userManager.idpSettings) == null ? void 0 : _b.maxExpiresIn),
318
334
  error
319
335
  );
320
336
  }
@@ -1 +1,4 @@
1
- export function getFileIcon(type: any, style: any): import("react/jsx-runtime").JSX.Element | undefined;
1
+ import { SxProps } from '@mui/material';
2
+ import { ElementType } from './ElementType';
3
+
4
+ export declare function getFileIcon(type: ElementType, style: SxProps): import("react/jsx-runtime").JSX.Element | undefined;
@@ -1,6 +1,16 @@
1
- export class UserManagerMock {
2
- constructor(settings: any);
3
- settings: any;
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
+ declare class Events {
8
+ userLoadedCallbacks: ((data: any) => void)[];
9
+ addUserLoaded(callback: (data: any) => void): void;
10
+ addSilentRenewError(callback: (data: any) => void): void;
11
+ }
12
+ export declare class UserManagerMock {
13
+ settings: unknown;
4
14
  events: Events;
5
15
  user: {
6
16
  profile: {
@@ -13,6 +23,7 @@ export class UserManagerMock {
13
23
  token_type: string;
14
24
  scope: string;
15
25
  };
26
+ constructor(settings: unknown);
16
27
  getUser(): Promise<any>;
17
28
  signinSilent(): Promise<any>;
18
29
  signinSilentCallback(): Promise<never>;
@@ -20,15 +31,4 @@ export class UserManagerMock {
20
31
  signoutRedirect(): Promise<null>;
21
32
  signinRedirectCallback(): Promise<string>;
22
33
  }
23
- /**
24
- * Copyright (c) 2020, RTE (http://www.rte-france.com)
25
- * This Source Code Form is subject to the terms of the Mozilla Public
26
- * License, v. 2.0. If a copy of the MPL was not distributed with this
27
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
28
- */
29
- declare class Events {
30
- userLoadedCallbacks: any[];
31
- addUserLoaded(callback: any): void;
32
- addSilentRenewError(callback: any): void;
33
- }
34
34
  export {};
@@ -1,12 +1,6 @@
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
1
  class Events {
8
2
  constructor() {
9
- __publicField(this, "userLoadedCallbacks", []);
3
+ this.userLoadedCallbacks = [];
10
4
  }
11
5
  addUserLoaded(callback) {
12
6
  this.userLoadedCallbacks.push(callback);
@@ -16,28 +10,28 @@ class Events {
16
10
  }
17
11
  class UserManagerMock {
18
12
  constructor(settings) {
19
- __publicField(this, "settings");
20
- __publicField(this, "events");
21
- __publicField(this, "user", {
13
+ this.user = {
22
14
  profile: { name: "John Doe", email: "Jhon.Doe@rte-france.com" },
23
15
  id_token: "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6IllNRUxIVDBndmIwbXhvU0RvWWZvbWpxZmpZVSJ9.eyJhdWQiOiI5YzQwMjQ2MS1iMmFiLTQ3NjctOWRiMy02Njg1OWJiMGZjZDAiLCJpc3MiOiJodHRwczovL2xvZ2luLm1pY3Jvc29mdG9ubGluZS5jb20vNzUwMmRhZDUtZDY0Yy00NmM3LTlkNDctYjE2ZjU4MGZjZmE5L3YyLjAiLCJpYXQiOjE1ODUzMzEyNDksIm5iZiI6MTU4NTMzMTI0OSwiZXhwIjoyNTg1MzM1MTQ5LCJhaW8iOiJBV1FBbS84UEFBQUF3Q0xyTDRIUEUvTnVjOU9OdHN0SUV4cVpyMUlqa1FGbXJvUW5EUzJBaksyWnpneUhQTldPdkE3bitveHkvRzgxWElsb1A0TitsQjZINFJteElwakhNYVArTjIyTzVnMUFaR04yc1d6VHA5T3JWMDIvOXhndXJBMjZrdUNXbGg2RSIsImF0X2hhc2giOiJJaWRYdGRHdzVkbjlOZDFQblVvbDh3IiwiaWRwIjoiaHR0cHM6Ly9zdHMud2luZG93cy5uZXQvOTE4ODA0MGQtNmM2Ny00YzViLWIxMTItMzZhMzA0YjY2ZGFkLyIsIm5vbmNlIjoiMjkzZTcxNzhmOWE5NGZlNjg1ZWY3MjdlZTg5MTYxYjEiLCJzdWIiOiJyTnZjWXJMSXJSN25iSDJPQlhoOFkzU05wZEtPc3dfTUNkX3F3NF9vNDRJIiwidGlkIjoiNzUwMmRhZDUtZDY0Yy00NmM3LTlkNDctYjE2ZjU4MGZjZmE5IiwidXRpIjoiUFBYdkw1UWxDMG1oMGp2N3NaNGJBQSIsInZlciI6IjIuMCJ9.dPAh24KTfsqmDaRoBtMLcayAWnDqVtydQ97P1a99dg93JsDu4Jhxju9vlzvjd6Ro5a1RZdrKFKB_pgC2DkQ3wSeYjpdSNyBAlW1_ryq65JkTJVMp33OsM_7SdjaRIiJfPiJ3U9jRBSyj7ofoHCLUjD_Uu-XreKxpMGhFHOQIO72UfXg8TBpsapjkEv9Dyz2UqMa2BQvO5mxKw93LNg5BI6j2a5LhbMEmmRWqfxWGITJ9TWfHjYdFkrXKcmvWZ9D2b4tsw_5NorDxkuzVFhA89M_0ASzOXoj1Yb6LgdkzWXDimssvyyz5Oe4V3gdkAe8Jj7Uwz-9AR-MO2kNkH7ytHA",
24
16
  session_state: "session state",
25
17
  access_token: "eyJ0eXAiOiJKV1QiLCJub25jZSI6InhKWHlQeXVrU1paQ3BOeEcxZUQway1lVDF0YzZtQ01ZVkZKcnBDOTJxc28iLCJhbGciOiJSUzI1NiIsIng1dCI6IllNRUxIVDBndmIwbXhvU0RvWWZvbWpxZmpZVSIsImtpZCI6IllNRUxIVDBndmIwbXhvU0RvWWZvbWpxZmpZVSJ9.eyJhdWQiOiIwMDAwMDAwMy0wMDAwLTAwMDAtYzAwMC0wMDAwMDAwMDAwMDAiLCJpc3MiOiJodHRwczovL3N0cy53aW5kb3dzLm5ldC83NTAyZGFkNS1kNjRjLTQ2YzctOWQ0Ny1iMTZmNTgwZmNmYTkvIiwiaWF0IjoxNTg1MzMxMjQ5LCJuYmYiOjE1ODUzMzEyNDksImV4cCI6MTU4NTMzNTE0OSwiYWNjdCI6MCwiYWNyIjoiMSIsImFpbyI6IkFVUUF1LzhQQUFBQXdwc3RYMlVkY2VDQWx4dU9tVHpIY0R3RlhTWUtYanIvZUNTSi9PdTRqbTJyUVBCUml0U1dWMThmNldCVEdNdnQ5ZGx0Ry9lTXB1VXZqaTN2NCtzanh3PT0iLCJhbHRzZWNpZCI6IjE6bGl2ZS5jb206MDAwMzQwMDExOUZEOTIxMiIsImFtciI6WyJwd2QiXSwiYXBwX2Rpc3BsYXluYW1lIjoic3BhIiwiYXBwaWQiOiI5YzQwMjQ2MS1iMmFiLTQ3NjctOWRiMy02Njg1OWJiMGZjZDAiLCJhcHBpZGFjciI6IjAiLCJlbWFpbCI6ImNoYW1zZWRkaW5lLmJlbmhhbWVkQGVuc2ktdW1hLnRuIiwiZmFtaWx5X25hbWUiOiJCRU5IQU1FRCIsImdpdmVuX25hbWUiOiJDaGFtc2VkZGluZSIsImlkcCI6ImxpdmUuY29tIiwiaXBhZGRyIjoiNzcuMjA0LjE0Ni4xNTkiLCJuYW1lIjoiQ2hhbXNlZGRpbmUgQkVOSEFNRUQiLCJvaWQiOiIzNTIzYmQ3OC0yZjIxLTQ3ZjYtODhlOC1hYWIzYjZmMjdmNjAiLCJwbGF0ZiI6IjE0IiwicHVpZCI6IjEwMDMyMDAwOURFMDg1NkEiLCJzY3AiOiJVc2VyLlJlYWQgcHJvZmlsZSBvcGVuaWQgZW1haWwiLCJzdWIiOiJjVEd5LVlfV3FLR2x1cmRUVDdSUVlfY3FjSDJoVHpEdllZTmotQ3hONXA4IiwidGlkIjoiNzUwMmRhZDUtZDY0Yy00NmM3LTlkNDctYjE2ZjU4MGZjZmE5IiwidW5pcXVlX25hbWUiOiJsaXZlLmNvbSNjaGFtc2VkZGluZS5iZW5oYW1lZEBlbnNpLXVtYS50biIsInV0aSI6IlBQWHZMNVFsQzBtaDBqdjdzWjRiQUEiLCJ2ZXIiOiIxLjAiLCJ4bXNfc3QiOnsic3ViIjoick52Y1lyTElyUjduYkgyT0JYaDhZM1NOcGRLT3N3X01DZF9xdzRfbzQ0SSJ9LCJ4bXNfdGNkdCI6MTU4MjgyMDM1Mn0.W_ccOGW_AGdg37KSMi7LWHtvm3Mw5p1dHjgDIrUaXduKF2iLS4dCaPw7yeo4VjAcOyV6C0h6ABLDCtkwVt8BSDTIIU7DaT8k2bRbMCCq69BmeiYPsbp-yX6ywGCx5DHsnOLqI2oHbBQktA2Nmv9Va651Pbm3OpSPuGPdVimkFCcnisiGlUOej1ZMNwyVT6386O2pERPtxmFUt_D1dKLxBXxBNxLVUG5BG3bI7wMpBOHEUA5CbaBzYXmGrLMXVVbrj9OsF-WQ6aNoqsm9cicX6pJB60lFz1dxLeSgcFO7Zh2K3PFe4FnXCqAvNPadQMz_kJEO9_phlDV85c2MPqeXbA",
26
18
  token_type: "Bearer",
27
19
  scope: "scopes"
28
- });
20
+ };
29
21
  this.settings = settings;
30
22
  this.events = new Events();
31
23
  }
32
24
  getUser() {
33
25
  return Promise.resolve(
34
- JSON.parse(sessionStorage.getItem("powsybl-gridsuite-mock-user"))
26
+ JSON.parse(
27
+ sessionStorage.getItem("powsybl-gridsuite-mock-user") ?? "null"
28
+ )
35
29
  );
36
30
  }
37
31
  signinSilent() {
38
32
  console.info("signinSilent..............");
39
33
  const localStorageUser = JSON.parse(
40
- localStorage.getItem("powsybl-gridsuite-mock-user")
34
+ localStorage.getItem("powsybl-gridsuite-mock-user") ?? "null"
41
35
  );
42
36
  if (localStorageUser === null) {
43
37
  return Promise.reject(
@@ -62,13 +56,13 @@ class UserManagerMock {
62
56
  "powsybl-gridsuite-mock-user",
63
57
  JSON.stringify(this.user)
64
58
  );
65
- window.location = "./sign-in-callback";
59
+ window.location.href = "./sign-in-callback";
66
60
  return Promise.resolve(null);
67
61
  }
68
62
  signoutRedirect() {
69
63
  sessionStorage.removeItem("powsybl-gridsuite-mock-user");
70
64
  localStorage.removeItem("powsybl-gridsuite-mock-user");
71
- window.location = ".";
65
+ window.location.href = ".";
72
66
  return Promise.resolve(null);
73
67
  }
74
68
  signinRedirectCallback() {
@@ -4,4 +4,4 @@
4
4
  * License, v. 2.0. If a copy of the MPL was not distributed with this
5
5
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
6
6
  */
7
- export function equalsArray(a: any, b: any): boolean;
7
+ export declare function equalsArray(a: Array<any>, b: Array<any>): boolean;
@@ -1,3 +1,3 @@
1
- import { EquipmentType } from './types.ts';
1
+ import { EquipmentType } from './types';
2
2
 
3
3
  export declare const mapEquipmentTypeForPredefinedProperties: (type: EquipmentType) => string | undefined;
@@ -10,5 +10,4 @@
10
10
  */
11
11
  export declare function keyGenerator(): () => number;
12
12
  export declare const areArrayElementsUnique: (array: unknown[]) => boolean;
13
- export declare const mergeSx: (...allSx: unknown[]) => unknown[];
14
13
  export declare const isObjectEmpty: (object: object) => boolean;
@@ -6,11 +6,9 @@ const areArrayElementsUnique = (array) => {
6
6
  let uniqueValues = [...new Set(array)];
7
7
  return uniqueValues.length === array.length;
8
8
  };
9
- const mergeSx = (...allSx) => allSx.flat();
10
9
  const isObjectEmpty = (object) => object && Object.keys(object).length === 0;
11
10
  export {
12
11
  areArrayElementsUnique,
13
12
  isObjectEmpty,
14
- keyGenerator,
15
- mergeSx
13
+ keyGenerator
16
14
  };
@@ -1,5 +1,7 @@
1
- export function makeComposeClasses(generateGlobalClass: any): (classes: any, ruleName: any) => string;
2
- export function toNestedGlobalSelectors(styles: any, generateGlobalClass: any): {
1
+ import { SxProps } from '@mui/material';
2
+
3
+ export declare const makeComposeClasses: (generateGlobalClass: (className: string) => string) => (classes: Record<string, string>, ruleName: string) => string;
4
+ export declare const toNestedGlobalSelectors: (styles: object, generateGlobalClass: (className: string) => string) => {
3
5
  [k: string]: any;
4
6
  };
5
- export function mergeSx(...allSx: any[]): any[];
7
+ export declare const mergeSx: (...allSx: (SxProps | undefined)[]) => (boolean | import('@mui/system').SystemStyleObject<{}> | ((theme: {}) => import('@mui/system').SystemStyleObject<{}>) | ((theme: {}) => import('@mui/system').SystemStyleObject<{}>))[];
@@ -5,7 +5,10 @@ const toNestedGlobalSelectors = (styles, generateGlobalClass) => Object.fromEntr
5
5
  v
6
6
  ])
7
7
  );
8
- const mergeSx = (...allSx) => allSx.flat();
8
+ const isSxProps = (sx) => {
9
+ return sx !== void 0;
10
+ };
11
+ const mergeSx = (...allSx) => allSx.filter(isSxProps).flat();
9
12
  export {
10
13
  makeComposeClasses,
11
14
  mergeSx,