@gridsuite/commons-ui 0.144.0 → 0.146.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/csvDownloader/csv-export.type.d.ts +2 -2
- package/dist/components/dialogs/customMuiDialog/CustomMuiDialog.d.ts +2 -1
- package/dist/components/dialogs/customMuiDialog/CustomMuiDialog.js +2 -0
- package/dist/components/filter/FilterCreationDialog.d.ts +2 -1
- package/dist/components/filter/FilterCreationDialog.js +4 -2
- package/dist/components/filter/FilterForm.d.ts +2 -3
- package/dist/components/filter/FilterForm.js +3 -3
- package/dist/components/filter/expert/ExpertFilterEditionDialog.d.ts +1 -1
- package/dist/components/filter/expert/ExpertFilterEditionDialog.js +4 -2
- package/dist/components/filter/expert/ExpertFilterForm.d.ts +5 -1
- package/dist/components/filter/expert/ExpertFilterForm.js +18 -3
- package/dist/components/filter/explicitNaming/ExplicitNamingFilterEditionDialog.d.ts +1 -1
- package/dist/components/filter/explicitNaming/ExplicitNamingFilterEditionDialog.js +4 -9
- package/dist/components/filter/explicitNaming/ExplicitNamingFilterForm.d.ts +2 -3
- package/dist/components/filter/explicitNaming/ExplicitNamingFilterForm.js +20 -4
- package/dist/components/filter/filter.type.d.ts +1 -0
- package/dist/components/icons/EditNoteIcon.d.ts +12 -0
- package/dist/components/icons/EditNoteIcon.js +18 -0
- package/dist/components/icons/index.d.ts +1 -0
- package/dist/components/icons/index.js +2 -0
- package/dist/components/index.js +2 -0
- package/dist/components/inputs/reactHookForm/DirectoryItemsInput.js +1 -1
- package/dist/components/inputs/reactHookForm/chip-items-input.js +1 -1
- package/dist/components/inputs/reactHookForm/provider/CustomFormProvider.d.ts +1 -0
- package/dist/components/inputs/reactHookForm/provider/CustomFormProvider.js +21 -4
- package/dist/components/inputs/reactQueryBuilder/OperatorSelector.js +1 -1
- package/dist/components/parameters/common/parameters-creation-dialog.js +1 -1
- package/dist/components/parameters/common/parameters-edition-dialog-props.d.ts +1 -1
- package/dist/components/parameters/loadflow/load-flow-parameters-content.js +1 -1
- package/dist/components/parameters/loadflow/load-flow-parameters-dialog.d.ts +1 -1
- package/dist/components/parameters/loadflow/load-flow-parameters-dialog.js +2 -2
- package/dist/components/parameters/loadflow/load-flow-parameters-inline.d.ts +2 -2
- package/dist/components/parameters/loadflow/load-flow-parameters-inline.js +3 -3
- package/dist/components/parameters/loadflow/load-flow-parameters-utils.js +1 -1
- package/dist/components/parameters/loadflow/use-load-flow-parameters-form.d.ts +1 -1
- package/dist/components/parameters/loadflow/use-load-flow-parameters-form.js +4 -4
- package/dist/components/parameters/network-visualizations/map-parameters.js +1 -1
- package/dist/components/parameters/network-visualizations/network-visualizations-parameters-inline.js +1 -1
- package/dist/components/parameters/network-visualizations/single-line-diagram-parameters.js +1 -1
- package/dist/components/parameters/pcc-min/pcc-min-parameters-inline.js +1 -1
- package/dist/components/parameters/pcc-min/use-pcc-min-parameters-form.js +1 -1
- package/dist/components/parameters/security-analysis/security-analysis-parameters-dialog.d.ts +1 -1
- package/dist/components/parameters/security-analysis/security-analysis-parameters-dialog.js +3 -3
- package/dist/components/parameters/security-analysis/security-analysis-parameters-form.d.ts +2 -2
- package/dist/components/parameters/security-analysis/security-analysis-parameters-form.js +2 -2
- package/dist/components/parameters/security-analysis/security-analysis-parameters-inline.d.ts +2 -2
- package/dist/components/parameters/security-analysis/security-analysis-parameters-inline.js +2 -2
- package/dist/components/parameters/security-analysis/security-analysis-parameters-selector.d.ts +2 -2
- package/dist/components/parameters/security-analysis/security-analysis-parameters-selector.js +4 -4
- package/dist/components/parameters/sensi/sensitivity-analysis-parameters-dialog.d.ts +1 -1
- package/dist/components/parameters/sensi/sensitivity-analysis-parameters-dialog.js +3 -3
- package/dist/components/parameters/sensi/sensitivity-analysis-parameters-form.d.ts +2 -2
- package/dist/components/parameters/sensi/sensitivity-analysis-parameters-form.js +2 -2
- package/dist/components/parameters/sensi/sensitivity-analysis-parameters-inline.d.ts +2 -2
- package/dist/components/parameters/sensi/sensitivity-analysis-parameters-inline.js +2 -2
- package/dist/components/parameters/sensi/sensitivity-parameters-selector.d.ts +2 -2
- package/dist/components/parameters/sensi/sensitivity-parameters-selector.js +5 -5
- package/dist/components/parameters/sensi/use-sensitivity-analysis-parameters.js +1 -1
- package/dist/components/parameters/short-circuit/short-circuit-fields.d.ts +2 -2
- package/dist/components/parameters/short-circuit/short-circuit-fields.js +5 -5
- package/dist/components/parameters/short-circuit/short-circuit-parameters-dialog.d.ts +2 -2
- package/dist/components/parameters/short-circuit/short-circuit-parameters-dialog.js +2 -2
- package/dist/components/parameters/short-circuit/short-circuit-parameters-form.d.ts +2 -2
- package/dist/components/parameters/short-circuit/short-circuit-parameters-form.js +2 -2
- package/dist/components/parameters/short-circuit/short-circuit-parameters-inline.d.ts +2 -2
- package/dist/components/parameters/short-circuit/short-circuit-parameters-inline.js +3 -3
- package/dist/components/parameters/short-circuit/short-circuit-parameters-utils.js +1 -1
- package/dist/components/parameters/voltage-init/general-parameters.js +1 -1
- package/dist/components/parameters/voltage-init/voltage-init-parameters-inline.js +1 -1
- package/dist/hooks/useModificationLabelComputer.d.ts +1 -0
- package/dist/hooks/useModificationLabelComputer.js +14 -1
- package/dist/index.js +6 -3
- package/dist/services/index.js +2 -1
- package/dist/services/utils.d.ts +1 -0
- package/dist/services/utils.js +23 -24
- package/dist/translations/en/errorsEn.d.ts +1 -0
- package/dist/translations/en/errorsEn.js +2 -1
- package/dist/translations/fr/errorsFr.d.ts +1 -0
- package/dist/translations/fr/errorsFr.js +2 -1
- package/dist/utils/constants/configConstants.d.ts +1 -1
- package/dist/utils/constants/configConstants.js +1 -1
- package/dist/utils/error.js +21 -7
- package/dist/utils/index.js +2 -2
- package/dist/utils/types/{CustomError.d.ts → ProblemDetailError.d.ts} +6 -3
- package/dist/utils/types/{CustomError.js → ProblemDetailError.js} +6 -3
- package/dist/utils/types/index.d.ts +1 -1
- package/dist/utils/types/index.js +2 -2
- package/dist/utils/types/metadata.d.ts +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -133,6 +133,7 @@ import { LeftPanelCloseIcon } from "./components/icons/LeftPanelCloseIcon.js";
|
|
|
133
133
|
import { DeviceHubIcon } from "./components/icons/DeviceHubIcon.js";
|
|
134
134
|
import { TuneIcon } from "./components/icons/TuneIcon.js";
|
|
135
135
|
import { PhotoLibraryIcon } from "./components/icons/PhotoLibraryIcon.js";
|
|
136
|
+
import { EditNoteIcon } from "./components/icons/EditNoteIcon.js";
|
|
136
137
|
import { ComputingType, formatComputingTypeLabel, isValidComputingType } from "./components/parameters/common/computing-type.js";
|
|
137
138
|
import { COMMON_PARAMETERS, PARAM_SA_FLOW_PROPORTIONAL_THRESHOLD, PARAM_SA_HIGH_VOLTAGE_ABSOLUTE_THRESHOLD, PARAM_SA_HIGH_VOLTAGE_PROPORTIONAL_THRESHOLD, PARAM_SA_LOW_VOLTAGE_ABSOLUTE_THRESHOLD, PARAM_SA_LOW_VOLTAGE_PROPORTIONAL_THRESHOLD, PARAM_SA_PROVIDER, PROVIDER, ReactivePowerAdornment, SPECIFIC_PARAMETERS, VERSION_PARAMETER, VOLTAGE_LEVEL, VoltageAdornment } from "./components/parameters/common/constant.js";
|
|
138
139
|
import { LineSeparator } from "./components/parameters/common/line-separator.js";
|
|
@@ -203,7 +204,7 @@ import { fetchDefaultSecurityAnalysisProvider, fetchSecurityAnalysisParameters,
|
|
|
203
204
|
import { exportFilter, getAvailableComponentLibraries, getStudyNetworkVisualizationsParameters, getStudyShortCircuitParameters, setStudyNetworkVisualizationParameters, updateVoltageInitParameters } from "./services/study.js";
|
|
204
205
|
import { getNetworkVisualizationsParameters } from "./services/study-config.js";
|
|
205
206
|
import { fetchCurrentAnnouncement, fetchUserDetails } from "./services/userAdmin.js";
|
|
206
|
-
import { backendFetch, backendFetchFile, backendFetchJson, backendFetchText, getRequestParamFromList } from "./services/utils.js";
|
|
207
|
+
import { backendFetch, backendFetchFile, backendFetchJson, backendFetchText, convertToCustomError, getRequestParamFromList } from "./services/utils.js";
|
|
207
208
|
import { getVoltageInitParameters, getVoltageInitUrl } from "./services/voltage-init.js";
|
|
208
209
|
import { fetchShortCircuitParameters, getShortCircuitSpecificParametersDescription, updateShortCircuitParameters } from "./services/short-circuit-analysis.js";
|
|
209
210
|
import { equalsArray } from "./utils/algos.js";
|
|
@@ -222,7 +223,7 @@ import { equipmentTypesForPredefinedPropertiesMapper } from "./utils/mapper/equi
|
|
|
222
223
|
import { copyToClipboard } from "./utils/navigator-clipboard.js";
|
|
223
224
|
import { NotificationsUrlKeys, PREFIX_CONFIG_NOTIFICATION_WS, PREFIX_DIRECTORY_NOTIFICATION_WS, PREFIX_STUDY_NOTIFICATION_WS } from "./utils/constants/notificationsProvider.js";
|
|
224
225
|
import { DARK_THEME, LIGHT_THEME, makeComposeClasses, mergeSx, toNestedGlobalSelectors } from "./utils/styles.js";
|
|
225
|
-
import {
|
|
226
|
+
import { ProblemDetailError, formatMessageValues } from "./utils/types/ProblemDetailError.js";
|
|
226
227
|
import { NetworkTimeoutError } from "./utils/types/NetworkTimeoutError.js";
|
|
227
228
|
import { ElementType } from "./utils/types/elementType.js";
|
|
228
229
|
import { ALL_EQUIPMENTS, BASE_EQUIPMENTS, EquipmentType, ExtendedEquipmentType, HvdcType, OperatingStatus, SEARCH_EQUIPMENTS, TYPE_TAG_MAX_SIZE, VL_TAG_MAX_SIZE, equipmentStyles, getEquipmentsInfosForSearchBar } from "./utils/types/equipmentType.js";
|
|
@@ -351,7 +352,6 @@ export {
|
|
|
351
352
|
CsvUploader,
|
|
352
353
|
CustomAGGrid,
|
|
353
354
|
CustomAgGridTable,
|
|
354
|
-
CustomError,
|
|
355
355
|
CustomFormContext,
|
|
356
356
|
CustomFormProvider,
|
|
357
357
|
CustomMenuItem,
|
|
@@ -396,6 +396,7 @@ export {
|
|
|
396
396
|
EXPERT_FILTER_EQUIPMENTS,
|
|
397
397
|
EXPERT_FILTER_FIELDS,
|
|
398
398
|
EXPERT_FILTER_QUERY,
|
|
399
|
+
EditNoteIcon,
|
|
399
400
|
ElementSaveDialog,
|
|
400
401
|
ElementSearchDialog,
|
|
401
402
|
ElementSearchInput,
|
|
@@ -576,6 +577,7 @@ export {
|
|
|
576
577
|
PhotoLibraryIcon,
|
|
577
578
|
PopupConfirmationDialog,
|
|
578
579
|
PredefinedParameters,
|
|
580
|
+
ProblemDetailError,
|
|
579
581
|
PropertyValueEditor,
|
|
580
582
|
ProviderParam,
|
|
581
583
|
RATIO_REGULATION_MODE_OPTIONS,
|
|
@@ -709,6 +711,7 @@ export {
|
|
|
709
711
|
componentsFr,
|
|
710
712
|
convertInputValue,
|
|
711
713
|
convertOutputValue,
|
|
714
|
+
convertToCustomError,
|
|
712
715
|
copyToClipboard,
|
|
713
716
|
countRules,
|
|
714
717
|
createFilter,
|
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 } from "./utils.js";
|
|
11
|
+
import { backendFetch, backendFetchFile, backendFetchJson, backendFetchText, convertToCustomError, getRequestParamFromList } 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 {
|
|
@@ -18,6 +18,7 @@ export {
|
|
|
18
18
|
backendFetchFile,
|
|
19
19
|
backendFetchJson,
|
|
20
20
|
backendFetchText,
|
|
21
|
+
convertToCustomError,
|
|
21
22
|
createFilter,
|
|
22
23
|
createParameter,
|
|
23
24
|
elementAlreadyExists,
|
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 convertToCustomError: (textError: string) => Error;
|
|
12
13
|
export declare const backendFetch: (url: string, init?: FetchInitWithTimeout, token?: string) => Promise<Response>;
|
|
13
14
|
export declare const backendFetchJson: (url: string, init?: FetchInitWithTimeout, token?: string) => Promise<any>;
|
|
14
15
|
export declare function backendFetchText(url: string, init?: FetchInitWithTimeout, token?: string): Promise<string>;
|
package/dist/services/utils.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getUserToken } from "../redux/commonStore.js";
|
|
2
|
-
import {
|
|
2
|
+
import { ProblemDetailError } from "../utils/types/ProblemDetailError.js";
|
|
3
3
|
import { NetworkTimeoutError } from "../utils/types/NetworkTimeoutError.js";
|
|
4
4
|
const DEFAULT_TIMEOUT_MS = 5e4;
|
|
5
5
|
const parseError = (text) => {
|
|
@@ -27,31 +27,29 @@ const prepareRequest = (init, token) => {
|
|
|
27
27
|
initWithSignal.headers.append("Authorization", `Bearer ${tokenCopy}`);
|
|
28
28
|
return initWithSignal;
|
|
29
29
|
};
|
|
30
|
+
const convertToCustomError = (textError) => {
|
|
31
|
+
const errorJson = parseError(textError);
|
|
32
|
+
if (errorJson?.server && errorJson?.timestamp && errorJson?.traceId && errorJson?.detail) {
|
|
33
|
+
let date = /* @__PURE__ */ new Date();
|
|
34
|
+
try {
|
|
35
|
+
date = new Date(errorJson.timestamp);
|
|
36
|
+
} catch {
|
|
37
|
+
}
|
|
38
|
+
return new ProblemDetailError(
|
|
39
|
+
errorJson.detail,
|
|
40
|
+
errorJson.server,
|
|
41
|
+
date,
|
|
42
|
+
errorJson.traceId,
|
|
43
|
+
errorJson.status,
|
|
44
|
+
errorJson.businessErrorCode,
|
|
45
|
+
errorJson.businessErrorValues
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
return new Error(textError);
|
|
49
|
+
};
|
|
30
50
|
const handleError = (response) => {
|
|
31
51
|
return response.text().then((text) => {
|
|
32
|
-
|
|
33
|
-
const errorJson = parseError(text);
|
|
34
|
-
let customError;
|
|
35
|
-
if (errorJson?.businessErrorCode != null) {
|
|
36
|
-
throw new CustomError(
|
|
37
|
-
errorJson.detail,
|
|
38
|
-
errorJson.status,
|
|
39
|
-
errorJson.businessErrorCode,
|
|
40
|
-
errorJson.businessErrorValues
|
|
41
|
-
);
|
|
42
|
-
}
|
|
43
|
-
if (errorJson && errorJson.status && errorJson.error && errorJson.detail) {
|
|
44
|
-
customError = new CustomError(
|
|
45
|
-
`${errorName + errorJson.status} ${errorJson.error}, message : ${errorJson.detail}`,
|
|
46
|
-
errorJson.status
|
|
47
|
-
);
|
|
48
|
-
} else {
|
|
49
|
-
customError = new CustomError(
|
|
50
|
-
`${errorName + response.status} ${response.statusText}, message : ${text}`,
|
|
51
|
-
response.status
|
|
52
|
-
);
|
|
53
|
-
}
|
|
54
|
-
throw customError;
|
|
52
|
+
throw convertToCustomError(text);
|
|
55
53
|
});
|
|
56
54
|
};
|
|
57
55
|
const handleTimeoutError = (error) => {
|
|
@@ -87,5 +85,6 @@ export {
|
|
|
87
85
|
backendFetchFile,
|
|
88
86
|
backendFetchJson,
|
|
89
87
|
backendFetchText,
|
|
88
|
+
convertToCustomError,
|
|
90
89
|
getRequestParamFromList
|
|
91
90
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
const errorsEn = {
|
|
2
|
-
"errors.network.timeout": "The request timed out. Please try again."
|
|
2
|
+
"errors.network.timeout": "The request timed out. Please try again.",
|
|
3
|
+
"errors.technicalError": "Server error: {message}\n (server: {serverName}, timestamp: {timestamp}, trace ID: {traceId})"
|
|
3
4
|
};
|
|
4
5
|
export {
|
|
5
6
|
errorsEn
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
const errorsFr = {
|
|
2
|
-
"errors.network.timeout": "La requête a expiré. Veuillez réessayer."
|
|
2
|
+
"errors.network.timeout": "La requête a expiré. Veuillez réessayer.",
|
|
3
|
+
"errors.technicalError": "Erreur serveur: {message}\n (serveur: {serverName}, horodatage: {timestamp}, trace ID: {traceId})"
|
|
3
4
|
};
|
|
4
5
|
export {
|
|
5
6
|
errorsFr
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export declare const PARAM_THEME = "theme";
|
|
2
2
|
export declare const PARAM_LANGUAGE = "language";
|
|
3
|
-
export declare const PARAM_DEVELOPER_MODE = "
|
|
3
|
+
export declare const PARAM_DEVELOPER_MODE = "isDeveloperMode";
|
|
4
4
|
export declare const LAST_SELECTED_DIRECTORY = "lastSelectedDirectory";
|
|
5
5
|
export declare const COMMON_CONFIG_PARAMS_NAMES: Set<string>;
|
|
6
6
|
export declare const COMMON_APP_NAME = "common";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const PARAM_THEME = "theme";
|
|
2
2
|
const PARAM_LANGUAGE = "language";
|
|
3
|
-
const PARAM_DEVELOPER_MODE = "
|
|
3
|
+
const PARAM_DEVELOPER_MODE = "isDeveloperMode";
|
|
4
4
|
const LAST_SELECTED_DIRECTORY = "lastSelectedDirectory";
|
|
5
5
|
const COMMON_CONFIG_PARAMS_NAMES = /* @__PURE__ */ new Set([
|
|
6
6
|
PARAM_THEME,
|
package/dist/utils/error.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ProblemDetailError, formatMessageValues } from "./types/ProblemDetailError.js";
|
|
2
2
|
import { NetworkTimeoutError } from "./types/NetworkTimeoutError.js";
|
|
3
3
|
function catchErrorHandler(error, callback) {
|
|
4
4
|
if (error instanceof Object && "message" in error && typeof error.message === "string") {
|
|
@@ -15,12 +15,26 @@ function snackWithFallback(snackError, error, headerInputs) {
|
|
|
15
15
|
});
|
|
16
16
|
return;
|
|
17
17
|
}
|
|
18
|
-
if (error instanceof
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
18
|
+
if (error instanceof ProblemDetailError) {
|
|
19
|
+
if (error.businessErrorCode) {
|
|
20
|
+
snackError({
|
|
21
|
+
messageId: error.businessErrorCode,
|
|
22
|
+
messageValues: error.businessErrorValues ? formatMessageValues(error.businessErrorValues) : void 0,
|
|
23
|
+
...headerInputs
|
|
24
|
+
});
|
|
25
|
+
} else {
|
|
26
|
+
snackError({
|
|
27
|
+
messageId: "errors.technicalError",
|
|
28
|
+
messageValues: {
|
|
29
|
+
message: error.message,
|
|
30
|
+
serverName: error.serverName,
|
|
31
|
+
timestamp: error.timestamp.toLocaleString(),
|
|
32
|
+
// It would require refactoring to adapt with GS language so we keep it like that for now
|
|
33
|
+
traceId: error.traceId
|
|
34
|
+
},
|
|
35
|
+
...headerInputs
|
|
36
|
+
});
|
|
37
|
+
}
|
|
24
38
|
} else {
|
|
25
39
|
catchErrorHandler(error, (message) => {
|
|
26
40
|
snackError({
|
package/dist/utils/index.js
CHANGED
|
@@ -14,7 +14,7 @@ import { equipmentTypesForPredefinedPropertiesMapper } from "./mapper/equipmentT
|
|
|
14
14
|
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
|
-
import {
|
|
17
|
+
import { ProblemDetailError, formatMessageValues } from "./types/ProblemDetailError.js";
|
|
18
18
|
import { NetworkTimeoutError } from "./types/NetworkTimeoutError.js";
|
|
19
19
|
import { ElementType } from "./types/elementType.js";
|
|
20
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";
|
|
@@ -39,7 +39,6 @@ export {
|
|
|
39
39
|
BusBar,
|
|
40
40
|
COMMON_APP_NAME,
|
|
41
41
|
COMMON_CONFIG_PARAMS_NAMES,
|
|
42
|
-
CustomError,
|
|
43
42
|
DARK_THEME,
|
|
44
43
|
DEGREE,
|
|
45
44
|
DanglingLine,
|
|
@@ -88,6 +87,7 @@ export {
|
|
|
88
87
|
PREFIX_DIRECTORY_NOTIFICATION_WS,
|
|
89
88
|
PREFIX_STUDY_NOTIFICATION_WS,
|
|
90
89
|
ParameterType,
|
|
90
|
+
ProblemDetailError,
|
|
91
91
|
SEARCH_EQUIPMENTS,
|
|
92
92
|
SIEMENS,
|
|
93
93
|
SVC,
|
|
@@ -4,10 +4,13 @@
|
|
|
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 declare class
|
|
8
|
-
|
|
7
|
+
export declare class ProblemDetailError extends Error {
|
|
8
|
+
serverName: string;
|
|
9
|
+
timestamp: Date;
|
|
10
|
+
traceId: string;
|
|
11
|
+
status?: number;
|
|
9
12
|
businessErrorCode?: string;
|
|
10
13
|
businessErrorValues?: Record<string, unknown>;
|
|
11
|
-
constructor(message: string,
|
|
14
|
+
constructor(message: string, serverName: string, timestamp: Date, traceId: string, status?: number, businessErrorCode?: string, businessErrorValues?: Record<string, unknown>);
|
|
12
15
|
}
|
|
13
16
|
export declare function formatMessageValues(properties: Record<string, unknown>): Record<string, string>;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
class
|
|
2
|
-
constructor(message, status, businessErrorCode, businessErrorValues) {
|
|
1
|
+
class ProblemDetailError extends Error {
|
|
2
|
+
constructor(message, serverName, timestamp, traceId, status, businessErrorCode, businessErrorValues) {
|
|
3
3
|
super(message);
|
|
4
|
+
this.serverName = serverName;
|
|
5
|
+
this.timestamp = timestamp;
|
|
6
|
+
this.traceId = traceId;
|
|
4
7
|
this.status = status;
|
|
5
8
|
this.businessErrorCode = businessErrorCode;
|
|
6
9
|
this.businessErrorValues = businessErrorValues;
|
|
@@ -15,6 +18,6 @@ function formatMessageValues(properties) {
|
|
|
15
18
|
);
|
|
16
19
|
}
|
|
17
20
|
export {
|
|
18
|
-
|
|
21
|
+
ProblemDetailError,
|
|
19
22
|
formatMessageValues
|
|
20
23
|
};
|
|
@@ -4,7 +4,7 @@
|
|
|
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 * from './
|
|
7
|
+
export * from './ProblemDetailError';
|
|
8
8
|
export * from './NetworkTimeoutError';
|
|
9
9
|
export * from './elementType';
|
|
10
10
|
export * from './equipmentType';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ProblemDetailError, formatMessageValues } from "./ProblemDetailError.js";
|
|
2
2
|
import { NetworkTimeoutError } from "./NetworkTimeoutError.js";
|
|
3
3
|
import { ElementType } from "./elementType.js";
|
|
4
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";
|
|
@@ -16,7 +16,6 @@ export {
|
|
|
16
16
|
BASE_EQUIPMENTS,
|
|
17
17
|
Battery,
|
|
18
18
|
BusBar,
|
|
19
|
-
CustomError,
|
|
20
19
|
DanglingLine,
|
|
21
20
|
DistributionType,
|
|
22
21
|
ElementType,
|
|
@@ -34,6 +33,7 @@ export {
|
|
|
34
33
|
NetworkTimeoutError,
|
|
35
34
|
OperatingStatus,
|
|
36
35
|
ParameterType,
|
|
36
|
+
ProblemDetailError,
|
|
37
37
|
SEARCH_EQUIPMENTS,
|
|
38
38
|
SVC,
|
|
39
39
|
SensitivityType,
|
|
@@ -17,7 +17,7 @@ export type StudyMetadata = Metadata & {
|
|
|
17
17
|
[networkElementType: string]: PredefinedProperties;
|
|
18
18
|
};
|
|
19
19
|
defaultParametersValues?: {
|
|
20
|
-
|
|
20
|
+
isDeveloperMode?: boolean;
|
|
21
21
|
};
|
|
22
22
|
defaultCountry?: string;
|
|
23
23
|
favoriteCountries?: string[];
|