@gridsuite/commons-ui 0.158.0 → 0.160.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/checkBoxList/CheckBoxListItem.js +1 -1
- package/dist/components/checkBoxList/CheckBoxListItemContent.js +1 -1
- package/dist/components/checkBoxList/DraggableCheckBoxListItem.js +1 -1
- package/dist/components/checkBoxList/DraggableCheckBoxListItemContent.js +1 -1
- package/dist/components/csvDownloader/use-csv-export.js +1 -1
- package/dist/components/customAGGrid/cell-renderers.js +1 -1
- package/dist/components/customAGGrid/separatorCellRenderer.js +1 -1
- package/dist/components/dialogs/elementSaveDialog/ElementSaveDialog.js +1 -1
- package/dist/components/directoryItemSelector/utils.js +2 -2
- package/dist/components/dnd-table/dnd-table-add-rows-dialog.js +1 -1
- package/dist/components/filter/FilterForm.js +1 -1
- package/dist/components/filter/HeaderFilterForm.js +1 -1
- package/dist/components/filter/expert/ExpertFilterForm.js +1 -1
- package/dist/components/filter/expert/expertFilterConstants.js +1 -1
- package/dist/components/filter/utils/filterFormUtils.js +1 -1
- package/dist/components/icons/EditNoteIcon.d.ts +3 -9
- package/dist/components/icons/EditNoteIcon.js +4 -12
- package/dist/components/icons/LeftPanelCloseIcon.d.ts +2 -7
- package/dist/components/icons/LeftPanelCloseIcon.js +3 -13
- package/dist/components/icons/LeftPanelOpenIcon.d.ts +2 -7
- package/dist/components/icons/LeftPanelOpenIcon.js +3 -13
- package/dist/components/index.js +2 -2
- package/dist/components/inputs/reactHookForm/DirectoryItemsInput.js +1 -1
- package/dist/components/inputs/reactHookForm/OverflowableChipWithHelperText.js +1 -1
- package/dist/components/inputs/reactHookForm/agGridTable/CustomAgGridTable.js +1 -1
- package/dist/components/inputs/reactHookForm/agGridTable/csvUploader/CsvUploader.js +1 -1
- package/dist/components/inputs/reactHookForm/chip-items-input.js +1 -1
- package/dist/components/inputs/reactQueryBuilder/CountryValueEditor.js +1 -1
- package/dist/components/inputs/reactQueryBuilder/ElementValueEditor.js +1 -1
- package/dist/components/inputs/reactQueryBuilder/OperatorSelector.js +1 -1
- package/dist/components/overflowableText/OverflowableText.js +1 -1
- package/dist/components/parameters/common/ProviderParam.js +1 -1
- package/dist/components/parameters/common/limitreductions/limit-reduction-table-cell.js +1 -1
- package/dist/components/parameters/common/limitreductions/limit-reductions-table-form.js +1 -1
- package/dist/components/parameters/common/name-element-editor/name-element-editor-form.js +1 -1
- package/dist/components/parameters/common/name-element-editor/name-element-editor-utils.js +1 -1
- package/dist/components/parameters/common/utils.js +2 -2
- package/dist/components/parameters/common/voltage-level-table/custom-voltage-level-table-cell.js +1 -1
- package/dist/components/parameters/common/widget/parameter-float.js +1 -1
- package/dist/components/parameters/common/widget/parameter-line-directory-items-input.js +1 -1
- package/dist/components/parameters/common/widget/parameter-line-slider.js +1 -1
- package/dist/components/parameters/index.js +2 -2
- package/dist/components/parameters/loadflow/load-flow-general-parameters.js +1 -1
- package/dist/components/parameters/loadflow/load-flow-parameter-field.js +1 -1
- package/dist/components/parameters/loadflow/load-flow-parameters-content.js +1 -1
- package/dist/components/parameters/loadflow/load-flow-parameters-dialog.js +2 -2
- package/dist/components/parameters/loadflow/load-flow-parameters-form.js +1 -1
- package/dist/components/parameters/loadflow/load-flow-parameters-header.js +1 -1
- package/dist/components/parameters/loadflow/load-flow-parameters-utils.js +1 -1
- package/dist/components/parameters/network-visualizations/network-area-diagram-parameters.js +1 -1
- package/dist/components/parameters/network-visualizations/network-visualizations-form.js +1 -1
- package/dist/components/parameters/network-visualizations/network-visualizations-parameters-dialog.js +1 -1
- package/dist/components/parameters/network-visualizations/single-line-diagram-parameters.js +1 -1
- package/dist/components/parameters/pcc-min/pcc-min-form-utils.js +1 -1
- package/dist/components/parameters/pcc-min/pcc-min-parameters-dialog.js +1 -1
- package/dist/components/parameters/pcc-min/pcc-min-parameters-form.js +1 -1
- package/dist/components/parameters/security-analysis/security-analysis-parameters-dialog.js +1 -1
- package/dist/components/parameters/security-analysis/security-analysis-parameters-form.js +1 -1
- package/dist/components/parameters/security-analysis/security-analysis-parameters-selector.js +1 -1
- package/dist/components/parameters/sensi/columns-definitions.js +2 -2
- package/dist/components/parameters/sensi/sensitivity-Flow-parameters.js +1 -1
- package/dist/components/parameters/sensi/sensitivity-analysis-parameters-dialog.js +1 -1
- package/dist/components/parameters/sensi/sensitivity-analysis-parameters-form.js +1 -1
- package/dist/components/parameters/sensi/sensitivity-parameters-selector.js +1 -1
- package/dist/components/parameters/sensi/table-cell.js +1 -1
- package/dist/components/parameters/sensi/utils.js +2 -2
- package/dist/components/parameters/short-circuit/constants.d.ts +1 -1
- package/dist/components/parameters/short-circuit/constants.js +2 -2
- package/dist/components/parameters/short-circuit/index.js +2 -2
- package/dist/components/parameters/short-circuit/short-circuit-fields.js +29 -13
- package/dist/components/parameters/short-circuit/short-circuit-icc-material-table-cell.js +1 -1
- package/dist/components/parameters/short-circuit/short-circuit-parameters-dialog.js +1 -1
- package/dist/components/parameters/short-circuit/short-circuit-parameters-form.js +1 -1
- package/dist/components/parameters/short-circuit/short-circuit-parameters-utils.js +1 -1
- package/dist/components/parameters/short-circuit/use-short-circuit-parameters-form.js +2 -2
- package/dist/components/parameters/voltage-init/equipment-selection-parameters.js +1 -1
- package/dist/components/parameters/voltage-init/general-parameters.js +1 -1
- package/dist/components/parameters/voltage-init/voltage-init-form-utils.js +1 -1
- package/dist/components/parameters/voltage-init/voltage-init-parameters-dialog.js +1 -1
- package/dist/components/parameters/voltage-init/voltage-init-parameters-form.js +1 -1
- package/dist/hooks/use-unique-name-validation.js +1 -1
- package/dist/hooks/useConfidentialityWarning.js +1 -1
- package/dist/hooks/useModificationLabelComputer.js +1 -1
- package/dist/hooks/useSnackMessage.d.ts +5 -2
- package/dist/index.js +5 -5
- package/dist/services/config.js +1 -1
- package/dist/services/directory.js +1 -1
- package/dist/services/index.js +2 -1
- package/dist/services/utils.d.ts +1 -0
- package/dist/services/utils.js +23 -2
- package/dist/translations/en/businessErrorsEn.d.ts +4 -0
- package/dist/translations/en/businessErrorsEn.js +4 -0
- package/dist/translations/fr/businessErrorsFr.d.ts +4 -0
- package/dist/translations/fr/businessErrorsFr.js +4 -0
- package/dist/utils/error.js +3 -2
- package/dist/utils/index.js +1 -2
- package/dist/utils/mapper/getFileIcon.js +3 -1
- package/dist/utils/types/ProblemDetailError.d.ts +1 -2
- package/dist/utils/types/ProblemDetailError.js +13 -11
- package/dist/utils/types/elementType.d.ts +2 -1
- package/dist/utils/types/elementType.js +1 -0
- package/dist/utils/types/index.js +1 -2
- package/package.json +1 -1
package/dist/services/index.js
CHANGED
|
@@ -8,7 +8,7 @@ import { fetchDefaultSecurityAnalysisProvider, fetchSecurityAnalysisParameters,
|
|
|
8
8
|
import { exportFilter, getAvailableComponentLibraries, getStudyNetworkVisualizationsParameters, getStudyShortCircuitParameters, setStudyNetworkVisualizationParameters, updateVoltageInitParameters } from "./study.js";
|
|
9
9
|
import { getNetworkVisualizationsParameters } from "./study-config.js";
|
|
10
10
|
import { fetchCurrentAnnouncement, fetchUserDetails } from "./userAdmin.js";
|
|
11
|
-
import { backendFetch, backendFetchFile, backendFetchJson, backendFetchText, getRequestParamFromList, handleNotOkResponse } from "./utils.js";
|
|
11
|
+
import { backendFetch, backendFetchFile, backendFetchJson, backendFetchText, getRequestParamFromList, handleNotOkResponse, parseError } from "./utils.js";
|
|
12
12
|
import { getVoltageInitParameters, getVoltageInitUrl } from "./voltage-init.js";
|
|
13
13
|
import { fetchShortCircuitParameters, getShortCircuitSpecificParametersDescription, updateShortCircuitParameters } from "./short-circuit-analysis.js";
|
|
14
14
|
export {
|
|
@@ -63,6 +63,7 @@ export {
|
|
|
63
63
|
handleNotOkResponse,
|
|
64
64
|
hasElementPermission,
|
|
65
65
|
isStudyMetadata,
|
|
66
|
+
parseError,
|
|
66
67
|
safeEncodeURIComponent,
|
|
67
68
|
saveFilter,
|
|
68
69
|
setLoadFlowParameters,
|
package/dist/services/utils.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ type FetchInitWithTimeout = RequestInit & {
|
|
|
9
9
|
/** If provided and no signal is set, use this as the timeout override (ms). */
|
|
10
10
|
timeoutMs?: number;
|
|
11
11
|
};
|
|
12
|
+
export declare const parseError: (errorTxt: string) => Error;
|
|
12
13
|
export declare const handleNotOkResponse: (response: Response) => Promise<never>;
|
|
13
14
|
export declare const backendFetch: (url: string, init?: FetchInitWithTimeout, token?: string) => Promise<Response>;
|
|
14
15
|
export declare const backendFetchJson: (url: string, init?: FetchInitWithTimeout, token?: string) => Promise<any>;
|
package/dist/services/utils.js
CHANGED
|
@@ -28,6 +28,26 @@ const isProblemDetail = (error) => {
|
|
|
28
28
|
const e = error;
|
|
29
29
|
return typeof e.status === "number" && typeof e.server === "string" && typeof e.timestamp === "string" && typeof e.traceId === "string" && typeof e.detail === "string";
|
|
30
30
|
};
|
|
31
|
+
const parseError = (errorTxt) => {
|
|
32
|
+
let error;
|
|
33
|
+
try {
|
|
34
|
+
error = JSON.parse(errorTxt);
|
|
35
|
+
} catch {
|
|
36
|
+
return new Error(errorTxt);
|
|
37
|
+
}
|
|
38
|
+
if (isProblemDetail(error)) {
|
|
39
|
+
return new ProblemDetailError(
|
|
40
|
+
error.status,
|
|
41
|
+
error.detail,
|
|
42
|
+
error.server,
|
|
43
|
+
error.timestamp,
|
|
44
|
+
error.traceId,
|
|
45
|
+
error.businessErrorCode,
|
|
46
|
+
error.businessErrorValues
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
return new Error(errorTxt);
|
|
50
|
+
};
|
|
31
51
|
const handleNotOkResponse = async (response) => {
|
|
32
52
|
let bodyText;
|
|
33
53
|
try {
|
|
@@ -38,7 +58,7 @@ const handleNotOkResponse = async (response) => {
|
|
|
38
58
|
});
|
|
39
59
|
}
|
|
40
60
|
const contentType = response.headers.get("content-type") ?? "";
|
|
41
|
-
if (!contentType.includes("application/json")) {
|
|
61
|
+
if (!contentType.includes("application/json") && !contentType.includes("application/problem+json")) {
|
|
42
62
|
throw new CustomError(response.status, bodyText);
|
|
43
63
|
}
|
|
44
64
|
let body;
|
|
@@ -97,5 +117,6 @@ export {
|
|
|
97
117
|
backendFetchJson,
|
|
98
118
|
backendFetchText,
|
|
99
119
|
getRequestParamFromList,
|
|
100
|
-
handleNotOkResponse
|
|
120
|
+
handleNotOkResponse,
|
|
121
|
+
parseError
|
|
101
122
|
};
|
|
@@ -12,6 +12,9 @@ export declare const businessErrorsEn: {
|
|
|
12
12
|
'directory.moveInDescendantNotAllowed': string;
|
|
13
13
|
'directory.someElementsAreMissing': string;
|
|
14
14
|
'directory.elementNotFound': string;
|
|
15
|
+
'directory.parentPermissionDenied': string;
|
|
16
|
+
'directory.childPermissionDenied': string;
|
|
17
|
+
'directory.targetPermissionDenied': string;
|
|
15
18
|
'explore.permissionDenied': string;
|
|
16
19
|
'explore.maxElementsExceeded': string;
|
|
17
20
|
'explore.incorrectCaseFile': string;
|
|
@@ -33,6 +36,7 @@ export declare const businessErrorsEn: {
|
|
|
33
36
|
'study.networkExportFailed': string;
|
|
34
37
|
'study.tooManyNadConfigs': string;
|
|
35
38
|
'study.tooManyMapCards': string;
|
|
39
|
+
'study.elementAlreadyExists': string;
|
|
36
40
|
'useradmin.permissionDenied': string;
|
|
37
41
|
'useradmin.userNotFound': string;
|
|
38
42
|
'useradmin.userAlreadyExists': string;
|
|
@@ -6,6 +6,9 @@ const businessErrorsEn = {
|
|
|
6
6
|
"directory.moveInDescendantNotAllowed": "Cannot move an element inside one of its descendants.",
|
|
7
7
|
"directory.someElementsAreMissing": "Some of the requested directory elements are missing.",
|
|
8
8
|
"directory.elementNotFound": "The requested directory element could not be found.",
|
|
9
|
+
"directory.parentPermissionDenied": "You don't have sufficient rights on parent folder",
|
|
10
|
+
"directory.childPermissionDenied": "The folder contains at least one subfolder for which you do not have sufficient rights",
|
|
11
|
+
"directory.targetPermissionDenied": "You don't have sufficient rights on target folder",
|
|
9
12
|
"explore.permissionDenied": "You are not allowed to perform this action.",
|
|
10
13
|
"explore.maxElementsExceeded": "You have reached your user quota for cases and studies ({limit} cases and studies).",
|
|
11
14
|
"explore.incorrectCaseFile": "The provided case file is incorrect.",
|
|
@@ -27,6 +30,7 @@ const businessErrorsEn = {
|
|
|
27
30
|
"study.networkExportFailed": "Failed to export network.",
|
|
28
31
|
"study.tooManyNadConfigs": "Maximum number of NAD configuration exceeded.",
|
|
29
32
|
"study.tooManyMapCards": "Maximum number of cards exceeded.",
|
|
33
|
+
"study.elementAlreadyExists": "An element with the same name already exists",
|
|
30
34
|
"useradmin.permissionDenied": "You don't have permission to perform this action.",
|
|
31
35
|
"useradmin.userNotFound": "User not found.",
|
|
32
36
|
"useradmin.userAlreadyExists": "User already exists.",
|
|
@@ -12,6 +12,9 @@ export declare const businessErrorsFr: {
|
|
|
12
12
|
'directory.moveInDescendantNotAllowed': string;
|
|
13
13
|
'directory.someElementsAreMissing': string;
|
|
14
14
|
'directory.elementNotFound': string;
|
|
15
|
+
'directory.parentPermissionDenied': string;
|
|
16
|
+
'directory.childPermissionDenied': string;
|
|
17
|
+
'directory.targetPermissionDenied': string;
|
|
15
18
|
'explore.permissionDenied': string;
|
|
16
19
|
'explore.maxElementsExceeded': string;
|
|
17
20
|
'explore.incorrectCaseFile': string;
|
|
@@ -33,6 +36,7 @@ export declare const businessErrorsFr: {
|
|
|
33
36
|
'study.networkExportFailed': string;
|
|
34
37
|
'study.tooManyNadConfigs': string;
|
|
35
38
|
'study.tooManyMapCards': string;
|
|
39
|
+
'study.elementAlreadyExists': string;
|
|
36
40
|
'useradmin.permissionDenied': string;
|
|
37
41
|
'useradmin.userNotFound': string;
|
|
38
42
|
'useradmin.userAlreadyExists': string;
|
|
@@ -6,6 +6,9 @@ const businessErrorsFr = {
|
|
|
6
6
|
"directory.moveInDescendantNotAllowed": "Impossible de déplacer un élément dans l’un de ses descendants.",
|
|
7
7
|
"directory.someElementsAreMissing": "Certains des éléments demandés sont manquants.",
|
|
8
8
|
"directory.elementNotFound": "L'élément du dossier demandé est introuvable.",
|
|
9
|
+
"directory.parentPermissionDenied": "Vous n'avez pas les droits d'accès suffisant sur le dossier parent",
|
|
10
|
+
"directory.childPermissionDenied": "Le dossier contient au moins un sous-dossier pour lequel vous n'avez pas les droits d'accès suffisant",
|
|
11
|
+
"directory.targetPermissionDenied": "Vous n'avez pas les droits d'accès suffisant sur le dossier cible",
|
|
9
12
|
"explore.permissionDenied": "Vous n'êtes pas autorisé à effectuer cette action.",
|
|
10
13
|
"explore.maxElementsExceeded": "Vous avez atteint votre quota utilisateur en termes de situations et d'études ({limit} situations et études).",
|
|
11
14
|
"explore.incorrectCaseFile": "Le fichier réseau fourni est incorrect.",
|
|
@@ -27,6 +30,7 @@ const businessErrorsFr = {
|
|
|
27
30
|
"study.networkExportFailed": "Échec de l'export de réseau.",
|
|
28
31
|
"study.tooManyNadConfigs": "Nombre maximal de configurations d'image nodale de zone atteint.",
|
|
29
32
|
"study.tooManyMapCards": "Nombre maximal de carte atteint.",
|
|
33
|
+
"study.elementAlreadyExists": "Un élément avec le même nom est déjà présent",
|
|
30
34
|
"useradmin.permissionDenied": "Vous n'avez pas la permission d'effectuer cette action.",
|
|
31
35
|
"useradmin.userNotFound": "Utilisateur introuvable.",
|
|
32
36
|
"useradmin.userAlreadyExists": "L'utilisateur existe déjà.",
|
package/dist/utils/error.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { ProblemDetailError
|
|
1
|
+
import { ProblemDetailError } from "./types/ProblemDetailError.js";
|
|
2
2
|
import { NetworkTimeoutError } from "./types/NetworkTimeoutError.js";
|
|
3
|
+
import "./types/equipmentType.js";
|
|
3
4
|
function catchErrorHandler(error, callback) {
|
|
4
5
|
if (error instanceof Object && "message" in error && typeof error.message === "string") {
|
|
5
6
|
callback(error.message);
|
|
@@ -19,7 +20,7 @@ function snackWithFallback(snackError, error, headerInputs) {
|
|
|
19
20
|
if (error.businessErrorCode) {
|
|
20
21
|
snackError({
|
|
21
22
|
messageId: error.businessErrorCode,
|
|
22
|
-
messageValues: error.businessErrorValues
|
|
23
|
+
messageValues: error.businessErrorValues,
|
|
23
24
|
...headerInputs
|
|
24
25
|
});
|
|
25
26
|
} else {
|
package/dist/utils/index.js
CHANGED
|
@@ -15,7 +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 } from "./types/CustomError.js";
|
|
18
|
-
import { ProblemDetailError
|
|
18
|
+
import { ProblemDetailError } from "./types/ProblemDetailError.js";
|
|
19
19
|
import { NetworkTimeoutError } from "./types/NetworkTimeoutError.js";
|
|
20
20
|
import { ElementType } from "./types/elementType.js";
|
|
21
21
|
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";
|
|
@@ -112,7 +112,6 @@ export {
|
|
|
112
112
|
equalsArray,
|
|
113
113
|
equipmentStyles,
|
|
114
114
|
equipmentTypesForPredefinedPropertiesMapper,
|
|
115
|
-
formatMessageValues,
|
|
116
115
|
getEquipmentTypeShortLabel,
|
|
117
116
|
getEquipmentTypeTagLabel,
|
|
118
117
|
getEquipmentsInfosForSearchBar,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { Hub, TableView, Calculate, Settings, Article, NoteAlt, OfflineBolt, Photo, PhotoLibrary } from "@mui/icons-material";
|
|
2
|
+
import { Dashboard, Hub, TableView, Calculate, Settings, Article, NoteAlt, OfflineBolt, Photo, PhotoLibrary } from "@mui/icons-material";
|
|
3
3
|
import { ElementType } from "../types/elementType.js";
|
|
4
4
|
function getFileIcon(type, style) {
|
|
5
5
|
switch (type) {
|
|
@@ -27,6 +27,8 @@ function getFileIcon(type, style) {
|
|
|
27
27
|
return /* @__PURE__ */ jsx(TableView, { sx: style });
|
|
28
28
|
case ElementType.DIAGRAM_CONFIG:
|
|
29
29
|
return /* @__PURE__ */ jsx(Hub, { sx: style });
|
|
30
|
+
case ElementType.WORKSPACE:
|
|
31
|
+
return /* @__PURE__ */ jsx(Dashboard, { sx: style });
|
|
30
32
|
case ElementType.DIRECTORY:
|
|
31
33
|
return void 0;
|
|
32
34
|
default:
|
|
@@ -4,7 +4,6 @@ export declare class ProblemDetailError extends CustomError {
|
|
|
4
4
|
timestamp: string;
|
|
5
5
|
traceId: string;
|
|
6
6
|
businessErrorCode?: string;
|
|
7
|
-
businessErrorValues?: Record<string,
|
|
7
|
+
businessErrorValues?: Record<string, string>;
|
|
8
8
|
constructor(status: number, message: string, serverName: string, timestamp: string, traceId: string, businessErrorCode?: string, businessErrorValues?: Record<string, unknown>);
|
|
9
9
|
}
|
|
10
|
-
export declare function formatMessageValues(properties: Record<string, unknown>): Record<string, string>;
|
|
@@ -1,4 +1,15 @@
|
|
|
1
1
|
import { CustomError } from "./CustomError.js";
|
|
2
|
+
function formatMessageValues(properties) {
|
|
3
|
+
if (properties === void 0) {
|
|
4
|
+
return void 0;
|
|
5
|
+
}
|
|
6
|
+
return Object.fromEntries(
|
|
7
|
+
Object.entries(properties).map(([key, value]) => [
|
|
8
|
+
key,
|
|
9
|
+
typeof value === "object" && value !== null ? JSON.stringify(value) : String(value)
|
|
10
|
+
])
|
|
11
|
+
);
|
|
12
|
+
}
|
|
2
13
|
class ProblemDetailError extends CustomError {
|
|
3
14
|
constructor(status, message, serverName, timestamp, traceId, businessErrorCode, businessErrorValues) {
|
|
4
15
|
super(status, message);
|
|
@@ -6,18 +17,9 @@ class ProblemDetailError extends CustomError {
|
|
|
6
17
|
this.timestamp = timestamp;
|
|
7
18
|
this.traceId = traceId;
|
|
8
19
|
this.businessErrorCode = businessErrorCode;
|
|
9
|
-
this.businessErrorValues = businessErrorValues;
|
|
20
|
+
this.businessErrorValues = formatMessageValues(businessErrorValues);
|
|
10
21
|
}
|
|
11
22
|
}
|
|
12
|
-
function formatMessageValues(properties) {
|
|
13
|
-
return Object.fromEntries(
|
|
14
|
-
Object.entries(properties).map(([key, value]) => [
|
|
15
|
-
key,
|
|
16
|
-
typeof value === "object" && value !== null ? JSON.stringify(value) : String(value)
|
|
17
|
-
])
|
|
18
|
-
);
|
|
19
|
-
}
|
|
20
23
|
export {
|
|
21
|
-
ProblemDetailError
|
|
22
|
-
formatMessageValues
|
|
24
|
+
ProblemDetailError
|
|
23
25
|
};
|
|
@@ -23,5 +23,6 @@ export declare enum ElementType {
|
|
|
23
23
|
NETWORK_VISUALIZATIONS_PARAMETERS = "NETWORK_VISUALIZATIONS_PARAMETERS",
|
|
24
24
|
SPREADSHEET_CONFIG = "SPREADSHEET_CONFIG",
|
|
25
25
|
SPREADSHEET_CONFIG_COLLECTION = "SPREADSHEET_CONFIG_COLLECTION",
|
|
26
|
-
DIAGRAM_CONFIG = "DIAGRAM_CONFIG"
|
|
26
|
+
DIAGRAM_CONFIG = "DIAGRAM_CONFIG",
|
|
27
|
+
WORKSPACE = "WORKSPACE"
|
|
27
28
|
}
|
|
@@ -15,6 +15,7 @@ var ElementType = /* @__PURE__ */ ((ElementType2) => {
|
|
|
15
15
|
ElementType2["SPREADSHEET_CONFIG"] = "SPREADSHEET_CONFIG";
|
|
16
16
|
ElementType2["SPREADSHEET_CONFIG_COLLECTION"] = "SPREADSHEET_CONFIG_COLLECTION";
|
|
17
17
|
ElementType2["DIAGRAM_CONFIG"] = "DIAGRAM_CONFIG";
|
|
18
|
+
ElementType2["WORKSPACE"] = "WORKSPACE";
|
|
18
19
|
return ElementType2;
|
|
19
20
|
})(ElementType || {});
|
|
20
21
|
export {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CustomError } from "./CustomError.js";
|
|
2
|
-
import { ProblemDetailError
|
|
2
|
+
import { ProblemDetailError } from "./ProblemDetailError.js";
|
|
3
3
|
import { NetworkTimeoutError } from "./NetworkTimeoutError.js";
|
|
4
4
|
import { ElementType } from "./elementType.js";
|
|
5
5
|
import { ALL_EQUIPMENTS, BASE_EQUIPMENTS, EquipmentType, ExtendedEquipmentType, HvdcType, OperatingStatus, SEARCH_EQUIPMENTS, TYPE_TAG_MAX_SIZE, VL_TAG_MAX_SIZE, equipmentStyles, getEquipmentsInfosForSearchBar } from "./equipmentType.js";
|
|
@@ -49,6 +49,5 @@ export {
|
|
|
49
49
|
VSC,
|
|
50
50
|
VoltageLevel,
|
|
51
51
|
equipmentStyles,
|
|
52
|
-
formatMessageValues,
|
|
53
52
|
getEquipmentsInfosForSearchBar
|
|
54
53
|
};
|