@gridsuite/commons-ui 0.143.0 → 0.144.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 (63) hide show
  1. package/dist/components/dialogs/elementSaveDialog/ElementSaveDialog.js +1 -1
  2. package/dist/components/dnd-table/dnd-table-add-rows-dialog.js +2 -2
  3. package/dist/components/dnd-table/dnd-table.js +3 -3
  4. package/dist/components/inputs/reactHookForm/DirectoryItemsInput.d.ts +2 -1
  5. package/dist/components/inputs/reactHookForm/DirectoryItemsInput.js +118 -75
  6. package/dist/components/inputs/reactHookForm/OverflowableChip.d.ts +3 -2
  7. package/dist/components/inputs/reactHookForm/OverflowableChip.js +5 -5
  8. package/dist/components/inputs/reactHookForm/OverflowableChipWithHelperText.d.ts +1 -1
  9. package/dist/components/inputs/reactHookForm/OverflowableChipWithHelperText.js +20 -4
  10. package/dist/components/inputs/reactHookForm/selectInputs/SelectInput.js +3 -1
  11. package/dist/components/inputs/reactHookForm/text/DescriptionField.d.ts +3 -1
  12. package/dist/components/inputs/reactHookForm/text/DescriptionField.js +13 -4
  13. package/dist/components/overflowableText/OverflowableText.js +9 -1
  14. package/dist/components/parameters/common/ProviderParam.js +3 -3
  15. package/dist/components/parameters/common/limitreductions/limit-reduction-table-cell.js +3 -3
  16. package/dist/components/parameters/common/limitreductions/limit-reductions-table-form.js +2 -2
  17. package/dist/components/parameters/common/name-element-editor/name-element-editor-utils.js +3 -3
  18. package/dist/components/parameters/common/voltage-level-table/custom-voltage-level-table-cell.js +3 -3
  19. package/dist/components/parameters/common/widget/parameter-float.js +3 -3
  20. package/dist/components/parameters/common/widget/parameter-line-directory-items-input.js +3 -3
  21. package/dist/components/parameters/common/widget/parameter-line-slider.js +3 -3
  22. package/dist/components/parameters/loadflow/load-flow-general-parameters.js +2 -2
  23. package/dist/components/parameters/loadflow/load-flow-parameter-field.js +3 -3
  24. package/dist/components/parameters/loadflow/load-flow-parameters-form.js +3 -3
  25. package/dist/components/parameters/loadflow/load-flow-parameters-header.js +3 -3
  26. package/dist/components/parameters/loadflow/use-load-flow-parameters-form.js +7 -4
  27. package/dist/components/parameters/network-visualizations/network-area-diagram-parameters.js +3 -3
  28. package/dist/components/parameters/network-visualizations/network-visualizations-form.js +2 -2
  29. package/dist/components/parameters/network-visualizations/use-network-visualizations-parameters-form.js +1 -1
  30. package/dist/components/parameters/pcc-min/pcc-min-form-utils.js +3 -3
  31. package/dist/components/parameters/pcc-min/pcc-min-parameters-form.js +3 -3
  32. package/dist/components/parameters/security-analysis/security-analysis-parameters-form.js +3 -3
  33. package/dist/components/parameters/security-analysis/security-analysis-violations-hiding.js +3 -3
  34. package/dist/components/parameters/sensi/sensitivity-Flow-parameters.js +3 -3
  35. package/dist/components/parameters/sensi/sensitivity-analysis-parameters-form.js +3 -3
  36. package/dist/components/parameters/sensi/sensitivity-table.js +1 -1
  37. package/dist/components/parameters/sensi/table-cell.js +3 -3
  38. package/dist/components/parameters/short-circuit/short-circuit-fields.js +1 -1
  39. package/dist/components/parameters/short-circuit/short-circuit-parameters-form.js +3 -3
  40. package/dist/components/parameters/short-circuit/use-short-circuit-parameters-form.js +1 -1
  41. package/dist/components/parameters/voltage-init/equipment-selection-parameters.js +3 -3
  42. package/dist/components/parameters/voltage-init/use-voltage-init-parameters-form.js +1 -1
  43. package/dist/components/parameters/voltage-init/voltage-init-form-utils.js +3 -3
  44. package/dist/components/parameters/voltage-init/voltage-init-parameters-form.js +3 -3
  45. package/dist/index.js +2 -1
  46. package/dist/services/index.js +1 -2
  47. package/dist/services/utils.d.ts +0 -4
  48. package/dist/services/utils.js +4 -10
  49. package/dist/translations/en/businessErrorsEn.d.ts +17 -0
  50. package/dist/translations/en/businessErrorsEn.js +20 -3
  51. package/dist/translations/en/inputsEn.d.ts +1 -1
  52. package/dist/translations/en/inputsEn.js +1 -1
  53. package/dist/translations/fr/businessErrorsFr.d.ts +17 -0
  54. package/dist/translations/fr/businessErrorsFr.js +20 -3
  55. package/dist/translations/fr/inputsFr.d.ts +1 -1
  56. package/dist/translations/fr/inputsFr.js +1 -1
  57. package/dist/utils/error.js +8 -0
  58. package/dist/utils/index.js +2 -0
  59. package/dist/utils/types/NetworkTimeoutError.d.ts +10 -0
  60. package/dist/utils/types/NetworkTimeoutError.js +9 -0
  61. package/dist/utils/types/index.d.ts +1 -0
  62. package/dist/utils/types/index.js +2 -0
  63. package/package.json +1 -1
@@ -1,4 +1,5 @@
1
1
  import { CustomError, formatMessageValues } from "./types/CustomError.js";
2
+ import { NetworkTimeoutError } from "./types/NetworkTimeoutError.js";
2
3
  function catchErrorHandler(error, callback) {
3
4
  if (error instanceof Object && "message" in error && typeof error.message === "string") {
4
5
  callback(error.message);
@@ -7,6 +8,13 @@ function catchErrorHandler(error, callback) {
7
8
  }
8
9
  }
9
10
  function snackWithFallback(snackError, error, headerInputs) {
11
+ if (error instanceof NetworkTimeoutError) {
12
+ snackError({
13
+ messageId: error.message,
14
+ ...headerInputs
15
+ });
16
+ return;
17
+ }
10
18
  if (error instanceof CustomError && error.businessErrorCode) {
11
19
  snackError({
12
20
  messageId: error.businessErrorCode,
@@ -15,6 +15,7 @@ import { copyToClipboard } from "./navigator-clipboard.js";
15
15
  import { NotificationsUrlKeys, PREFIX_CONFIG_NOTIFICATION_WS, PREFIX_DIRECTORY_NOTIFICATION_WS, PREFIX_STUDY_NOTIFICATION_WS } from "./constants/notificationsProvider.js";
16
16
  import { DARK_THEME, LIGHT_THEME, makeComposeClasses, mergeSx, toNestedGlobalSelectors } from "./styles.js";
17
17
  import { CustomError, formatMessageValues } from "./types/CustomError.js";
18
+ import { NetworkTimeoutError } from "./types/NetworkTimeoutError.js";
18
19
  import { ElementType } from "./types/elementType.js";
19
20
  import { ALL_EQUIPMENTS, BASE_EQUIPMENTS, EquipmentType, ExtendedEquipmentType, HvdcType, OperatingStatus, SEARCH_EQUIPMENTS, TYPE_TAG_MAX_SIZE, VL_TAG_MAX_SIZE, equipmentStyles, getEquipmentsInfosForSearchBar } from "./types/equipmentType.js";
20
21
  import { Battery, BusBar, DanglingLine, Generator, Hvdc, LCC, Line, Load, SVC, ShuntCompensator, Substation, ThreeWindingTransfo, TwoWindingTransfo, VSC, VoltageLevel } from "./types/equipmentTypes.js";
@@ -75,6 +76,7 @@ export {
75
76
  MICRO_SIEMENS,
76
77
  MODIFICATION_TYPES,
77
78
  ModificationType,
79
+ NetworkTimeoutError,
78
80
  NotificationsUrlKeys,
79
81
  OHM,
80
82
  OperatingStatus,
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Copyright (c) 2025, RTE (http://www.rte-france.com)
3
+ * This Source Code Form is subject to the terms of the Mozilla Public
4
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
5
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
6
+ */
7
+ /** Custom error type thrown when AbortSignal.timeout triggers. */
8
+ export declare class NetworkTimeoutError extends Error {
9
+ constructor(messageKey?: string);
10
+ }
@@ -0,0 +1,9 @@
1
+ class NetworkTimeoutError extends Error {
2
+ constructor(messageKey = "errors.network.timeout") {
3
+ super(messageKey);
4
+ this.name = "NetworkTimeoutError";
5
+ }
6
+ }
7
+ export {
8
+ NetworkTimeoutError
9
+ };
@@ -5,6 +5,7 @@
5
5
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
6
6
  */
7
7
  export * from './CustomError';
8
+ export * from './NetworkTimeoutError';
8
9
  export * from './elementType';
9
10
  export * from './equipmentType';
10
11
  export * from './equipmentTypes';
@@ -1,4 +1,5 @@
1
1
  import { CustomError, formatMessageValues } from "./CustomError.js";
2
+ import { NetworkTimeoutError } from "./NetworkTimeoutError.js";
2
3
  import { ElementType } from "./elementType.js";
3
4
  import { ALL_EQUIPMENTS, BASE_EQUIPMENTS, EquipmentType, ExtendedEquipmentType, HvdcType, OperatingStatus, SEARCH_EQUIPMENTS, TYPE_TAG_MAX_SIZE, VL_TAG_MAX_SIZE, equipmentStyles, getEquipmentsInfosForSearchBar } from "./equipmentType.js";
4
5
  import { Battery, BusBar, DanglingLine, Generator, Hvdc, LCC, Line, Load, SVC, ShuntCompensator, Substation, ThreeWindingTransfo, TwoWindingTransfo, VSC, VoltageLevel } from "./equipmentTypes.js";
@@ -30,6 +31,7 @@ export {
30
31
  Load,
31
32
  MODIFICATION_TYPES,
32
33
  ModificationType,
34
+ NetworkTimeoutError,
33
35
  OperatingStatus,
34
36
  ParameterType,
35
37
  SEARCH_EQUIPMENTS,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gridsuite/commons-ui",
3
- "version": "0.143.0",
3
+ "version": "0.144.0",
4
4
  "description": "common react components for gridsuite applications",
5
5
  "author": "gridsuite team",
6
6
  "homepage": "https://github.com/gridsuite",