@gridsuite/commons-ui 0.132.0 → 0.134.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/authentication/utils/authService.js +6 -9
- package/dist/components/checkBoxList/CheckBoxList.js +1 -1
- package/dist/components/checkBoxList/CheckBoxListItem.js +3 -3
- package/dist/components/checkBoxList/CheckBoxListItemContent.js +3 -3
- package/dist/components/checkBoxList/CheckBoxListItems.js +4 -4
- package/dist/components/checkBoxList/DraggableCheckBoxListItem.js +5 -5
- package/dist/components/checkBoxList/DraggableCheckBoxListItemContent.js +1 -1
- package/dist/components/contingencyList/criteriaBased/criteriaBasedUtils.js +7 -7
- package/dist/components/csvDownloader/use-csv-export.js +1 -4
- package/dist/components/customAGGrid/customAggrid.js +2 -2
- package/dist/components/dialogs/customMuiDialog/CustomMuiDialog.js +2 -2
- package/dist/components/dialogs/descriptionModificationDialog/DescriptionModificationDialog.js +1 -2
- package/dist/components/dialogs/elementSaveDialog/ElementSaveDialog.js +6 -6
- package/dist/components/dialogs/elementSaveDialog/utils.js +1 -1
- package/dist/components/dialogs/modifyElementSelection/ModifyElementSelection.js +1 -1
- package/dist/components/directoryItemSelector/DirectoryItemSelector.js +3 -4
- package/dist/components/dnd-table/dnd-table-bottom-right-buttons.js +2 -3
- package/dist/components/dnd-table/dnd-table.js +7 -7
- package/dist/components/elementSearch/elementItem/EquipmentItem.js +6 -7
- package/dist/components/elementSearch/elementSearchDialog/ElementSearchDialog.js +1 -1
- package/dist/components/elementSearch/tagRenderer/TagRenderer.js +3 -4
- package/dist/components/filter/FilterCreationDialog.js +23 -13
- package/dist/components/filter/FilterForm.js +2 -2
- package/dist/components/filter/expert/ExpertFilterEditionDialog.js +13 -6
- package/dist/components/filter/expert/ExpertFilterForm.d.ts +0 -1
- package/dist/components/filter/expert/ExpertFilterForm.js +11 -21
- package/dist/components/filter/expert/expertFilterConstants.d.ts +13 -12
- package/dist/components/filter/expert/expertFilterConstants.js +17 -48
- package/dist/components/filter/expert/expertFilterUtils.js +21 -25
- package/dist/components/filter/expert/index.js +1 -2
- package/dist/components/filter/explicitNaming/ExplicitNamingFilterEditionDialog.js +2 -4
- package/dist/components/filter/explicitNaming/ExplicitNamingFilterForm.js +11 -18
- package/dist/components/filter/index.js +1 -2
- package/dist/components/filter/utils/filterApi.js +14 -6
- package/dist/components/flatParameters/FlatParameters.js +2 -2
- package/dist/components/index.js +1 -4
- package/dist/components/inputs/SelectClearable.js +1 -1
- package/dist/components/inputs/index.js +0 -2
- package/dist/components/inputs/reactHookForm/DirectoryItemsInput.js +44 -48
- package/dist/components/inputs/reactHookForm/agGridTable/CustomAgGridTable.js +3 -4
- package/dist/components/inputs/reactHookForm/agGridTable/csvUploader/CsvUploader.js +1 -1
- package/dist/components/inputs/reactHookForm/autocompleteInputs/AutocompleteInput.js +4 -4
- package/dist/components/inputs/reactHookForm/chip-items-input.js +3 -3
- package/dist/components/inputs/reactHookForm/errorManagement/ErrorInput.js +1 -2
- package/dist/components/inputs/reactHookForm/index.js +0 -2
- package/dist/components/inputs/reactHookForm/numbers/FloatInput.js +1 -1
- package/dist/components/inputs/reactHookForm/numbers/SliderInput.js +1 -1
- package/dist/components/inputs/reactHookForm/selectInputs/InputWithPopupConfirmation.js +2 -2
- package/dist/components/inputs/reactHookForm/selectInputs/SelectInput.js +3 -3
- package/dist/components/inputs/reactHookForm/tableInputs/table-numerical-input.js +4 -4
- package/dist/components/inputs/reactHookForm/tableInputs/table-text-input.js +3 -3
- package/dist/components/inputs/reactHookForm/text/ExpandingTextField.js +2 -2
- package/dist/components/inputs/reactHookForm/text/TextInput.js +5 -5
- package/dist/components/inputs/reactHookForm/text/UniqueNameInput.js +2 -2
- package/dist/components/inputs/reactHookForm/utils/SubmitButton.js +1 -1
- package/dist/components/inputs/reactHookForm/utils/functions.js +2 -3
- package/dist/components/inputs/reactHookForm/utils/index.d.ts +0 -1
- package/dist/components/inputs/reactHookForm/utils/index.js +0 -2
- package/dist/components/inputs/reactQueryBuilder/OperatorSelector.js +2 -2
- package/dist/components/inputs/reactQueryBuilder/PropertyValueEditor.js +8 -9
- package/dist/components/inputs/reactQueryBuilder/TextValueEditor.js +1 -1
- package/dist/components/inputs/reactQueryBuilder/TranslatedValueEditor.js +1 -1
- package/dist/components/inputs/reactQueryBuilder/ValueEditor.js +2 -3
- package/dist/components/inputs/reactQueryBuilder/compositeRuleEditor/GroupValueEditor.js +12 -15
- package/dist/components/inputs/reactQueryBuilder/compositeRuleEditor/RuleValueEditor.js +3 -4
- package/dist/components/notifications/hooks/useListenerManager.js +2 -4
- package/dist/components/overflowableText/OverflowableText.js +4 -5
- package/dist/components/parameters/common/computing-type.d.ts +2 -1
- package/dist/components/parameters/common/computing-type.js +3 -0
- package/dist/components/parameters/common/limitreductions/columns-definitions.js +1 -1
- package/dist/components/parameters/common/limitreductions/limit-reductions-form-util.js +1 -1
- package/dist/components/parameters/loadflow/load-flow-general-parameters.js +1 -1
- package/dist/components/parameters/loadflow/load-flow-parameters-content.js +1 -1
- package/dist/components/parameters/loadflow/load-flow-parameters-form.js +1 -1
- package/dist/components/parameters/loadflow/load-flow-parameters-utils.js +3 -3
- package/dist/components/parameters/loadflow/use-load-flow-parameters-form.js +15 -16
- package/dist/components/parameters/network-visualizations/map-parameters.js +13 -17
- package/dist/components/parameters/network-visualizations/network-area-diagram-parameters.js +1 -2
- package/dist/components/parameters/network-visualizations/network-visualizations-form.js +2 -2
- package/dist/components/parameters/network-visualizations/single-line-diagram-parameters.js +2 -3
- package/dist/components/parameters/security-analysis/security-analysis-parameters-form.js +2 -3
- package/dist/components/parameters/security-analysis/security-analysis-parameters-selector.js +3 -3
- package/dist/components/parameters/security-analysis/security-analysis-violations-hiding.js +1 -1
- package/dist/components/parameters/security-analysis/use-security-analysis-parameters-form.js +5 -5
- package/dist/components/parameters/sensi/sensitivity-analysis-parameters-form.js +1 -1
- package/dist/components/parameters/sensi/sensitivity-table.js +2 -3
- package/dist/components/parameters/sensi/use-sensitivity-analysis-parameters.js +42 -54
- package/dist/components/parameters/sensi/utils.js +16 -27
- package/dist/components/parameters/short-circuit/short-circuit-parameters-form.js +2 -2
- package/dist/components/parameters/short-circuit/short-circuit-parameters-inline.js +1 -1
- package/dist/components/parameters/voltage-init/use-voltage-init-parameters-form.js +1 -1
- package/dist/components/parameters/voltage-init/voltage-init-form-utils.js +47 -56
- package/dist/components/parameters/voltage-init/voltage-init-parameters-form.js +1 -1
- package/dist/components/parameters/voltage-init/voltage-init-parameters-inline.js +1 -1
- package/dist/components/snackbarProvider/SnackbarProvider.js +1 -4
- package/dist/components/topBar/TopBar.js +33 -36
- package/dist/components/topBar/UserInformationDialog.js +7 -8
- package/dist/components/topBar/UserSettingsDialog.js +1 -1
- package/dist/components/treeViewFinder/TreeViewFinder.js +13 -13
- package/dist/hooks/use-parameters-backend.js +5 -5
- package/dist/hooks/use-unique-name-validation.js +2 -3
- package/dist/hooks/useConfidentialityWarning.js +1 -1
- package/dist/hooks/usePredefinedProperties.js +1 -2
- package/dist/index.js +9 -5
- package/dist/redux/commonStore.js +1 -2
- package/dist/services/businessErrorCode.d.ts +11 -0
- package/dist/services/businessErrorCode.js +10 -0
- package/dist/services/index.d.ts +1 -0
- package/dist/services/index.js +2 -0
- package/dist/services/utils.js +13 -7
- package/dist/translations/en/businessErrorsEn.d.ts +28 -0
- package/dist/translations/en/businessErrorsEn.js +25 -0
- package/dist/translations/en/equipmentsEn.d.ts +1 -0
- package/dist/translations/en/equipmentsEn.js +2 -1
- package/dist/translations/en/index.d.ts +1 -0
- package/dist/translations/en/index.js +2 -0
- package/dist/translations/fr/businessErrorsFr.d.ts +28 -0
- package/dist/translations/fr/businessErrorsFr.js +25 -0
- package/dist/translations/fr/equipmentsFr.d.ts +1 -0
- package/dist/translations/fr/equipmentsFr.js +2 -1
- package/dist/translations/fr/index.d.ts +1 -0
- package/dist/translations/fr/index.js +2 -0
- package/dist/utils/index.js +2 -1
- package/dist/utils/types/equipmentType.d.ts +162 -8
- package/dist/utils/types/equipmentType.js +126 -22
- package/dist/utils/types/index.js +2 -1
- package/package.json +6 -6
- package/dist/components/inputs/reactHookForm/utils/RefreshButton.d.ts +0 -2
- package/dist/components/inputs/reactHookForm/utils/RefreshButton.js +0 -9
package/dist/index.js
CHANGED
|
@@ -43,7 +43,7 @@ import { DISTRIBUTION_KEY, FilterType, NO_ITEM_SELECTION_FOR_COPY } from "./comp
|
|
|
43
43
|
import { CriteriaBasedForm } from "./components/contingencyList/criteriaBased/CriteriaBasedForm.js";
|
|
44
44
|
import { getCriteriaBasedFormData, getCriteriaBasedSchema } from "./components/contingencyList/criteriaBased/criteriaBasedUtils.js";
|
|
45
45
|
import { ExpertFilterEditionDialog } from "./components/filter/expert/ExpertFilterEditionDialog.js";
|
|
46
|
-
import { ExpertFilterForm, expertFilterSchema, getExpertFilterEmptyFormData
|
|
46
|
+
import { ExpertFilterForm, expertFilterSchema, getExpertFilterEmptyFormData } from "./components/filter/expert/ExpertFilterForm.js";
|
|
47
47
|
import { CombinatorType, DataType, OperatorType } from "./components/filter/expert/expertFilter.type.js";
|
|
48
48
|
import { COMBINATOR_OPTIONS, CONVERTERS_MODE_OPTIONS, ENERGY_SOURCE_OPTIONS, EXPERT_FILTER_EQUIPMENTS, EXPERT_FILTER_FIELDS, EXPERT_FILTER_QUERY, FIELDS_OPTIONS, LOAD_TYPE_OPTIONS, OPERATOR_OPTIONS, PHASE_REGULATION_MODE_OPTIONS, RATIO_REGULATION_MODE_OPTIONS, REGULATION_TYPE_OPTIONS, RULES, SHUNT_COMPENSATOR_TYPE_OPTIONS, SVAR_REGULATION_MODE_OPTIONS } from "./components/filter/expert/expertFilterConstants.js";
|
|
49
49
|
import { countRules, exportExpertRules, getFilterEquipmentTypeLabel, getNumberOfSiblings, getOperators, importExpertRules, queryValidator, recursiveRemove, testQuery } from "./components/filter/expert/expertFilterUtils.js";
|
|
@@ -93,7 +93,6 @@ import { UniqueNameInput } from "./components/inputs/reactHookForm/text/UniqueNa
|
|
|
93
93
|
import { CancelButton } from "./components/inputs/reactHookForm/utils/CancelButton.js";
|
|
94
94
|
import { FieldLabel } from "./components/inputs/reactHookForm/utils/FieldLabel.js";
|
|
95
95
|
import { SubmitButton } from "./components/inputs/reactHookForm/utils/SubmitButton.js";
|
|
96
|
-
import { RefreshButton } from "./components/inputs/reactHookForm/utils/RefreshButton.js";
|
|
97
96
|
import { TextFieldWithAdornment } from "./components/inputs/reactHookForm/utils/TextFieldWithAdornment.js";
|
|
98
97
|
import { genHelperError, gridItem, identity, isFieldRequired, toFloatOrNullValue } from "./components/inputs/reactHookForm/utils/functions.js";
|
|
99
98
|
import { HelperPreviousValue } from "./components/inputs/reactHookForm/utils/HelperPreviousValue.js";
|
|
@@ -199,6 +198,7 @@ import { getNetworkVisualizationsParameters } from "./services/study-config.js";
|
|
|
199
198
|
import { fetchCurrentAnnouncement, fetchUserDetails } from "./services/userAdmin.js";
|
|
200
199
|
import { getVoltageInitParameters, getVoltageInitUrl } from "./services/voltage-init.js";
|
|
201
200
|
import { fetchDefaultSecurityAnalysisProvider, fetchSecurityAnalysisParameters, fetchSecurityAnalysisProviders, getSecurityAnalysisDefaultLimitReductions, getSecurityAnalysisParameters, getStudyUrl, safeEncodeURIComponent, setSecurityAnalysisParameters, updateSecurityAnalysisParameters, updateSecurityAnalysisProvider } from "./services/security-analysis.js";
|
|
201
|
+
import { CustomError } from "./services/businessErrorCode.js";
|
|
202
202
|
import { equalsArray } from "./utils/algos.js";
|
|
203
203
|
import { FetchStatus } from "./utils/constants/fetchStatus.js";
|
|
204
204
|
import { FieldConstants } from "./utils/constants/fieldConstants.js";
|
|
@@ -213,7 +213,7 @@ import { equipmentTypesForPredefinedPropertiesMapper } from "./utils/mapper/equi
|
|
|
213
213
|
import { NotificationsUrlKeys, PREFIX_CONFIG_NOTIFICATION_WS, PREFIX_DIRECTORY_NOTIFICATION_WS, PREFIX_STUDY_NOTIFICATION_WS } from "./utils/constants/notificationsProvider.js";
|
|
214
214
|
import { DARK_THEME, LIGHT_THEME, makeComposeClasses, mergeSx, toNestedGlobalSelectors } from "./utils/styles.js";
|
|
215
215
|
import { ElementType } from "./utils/types/elementType.js";
|
|
216
|
-
import { BASE_EQUIPMENTS, EQUIPMENT_TYPE, EquipmentType, ExtendedEquipmentType, HvdcType, OperatingStatus, SEARCH_EQUIPMENTS, TYPE_TAG_MAX_SIZE, VL_TAG_MAX_SIZE, equipmentStyles, getEquipmentsInfosForSearchBar } from "./utils/types/equipmentType.js";
|
|
216
|
+
import { ALL_EQUIPMENTS, BASE_EQUIPMENTS, EQUIPMENT_TYPE, EquipmentType, ExtendedEquipmentType, HvdcType, OperatingStatus, SEARCH_EQUIPMENTS, TYPE_TAG_MAX_SIZE, VL_TAG_MAX_SIZE, equipmentStyles, getEquipmentsInfosForSearchBar } from "./utils/types/equipmentType.js";
|
|
217
217
|
import { Battery, BusBar, DanglingLine, Generator, Hvdc, LCC, Line, Load, SVC, ShuntCompensator, Substation, ThreeWindingTransfo, TwoWindingTransfo, VSC, VoltageLevel } from "./utils/types/equipmentTypes.js";
|
|
218
218
|
import { AnnouncementSeverity, ArrayAction } from "./utils/types/types.js";
|
|
219
219
|
import { MODIFICATION_TYPES, ModificationType } from "./utils/types/modificationType.js";
|
|
@@ -224,6 +224,7 @@ import { DistributionType, SensitivityType } from "./utils/types/sensitivity-ana
|
|
|
224
224
|
import { toNumber, validateValueIsANumber } from "./utils/validation-functions.js";
|
|
225
225
|
import "./utils/yupConfig.js";
|
|
226
226
|
import { cardErrorBoundaryEn } from "./translations/en/cardErrorBoundaryEn.js";
|
|
227
|
+
import { businessErrorsEn } from "./translations/en/businessErrorsEn.js";
|
|
227
228
|
import { commonButtonEn } from "./translations/en/commonButtonEn.js";
|
|
228
229
|
import { csvEn } from "./translations/en/csvEn.js";
|
|
229
230
|
import { descriptionEn } from "./translations/en/descriptionEn.js";
|
|
@@ -250,6 +251,7 @@ import { componentsEn } from "./translations/en/componentsEn.js";
|
|
|
250
251
|
import { parametersEn } from "./translations/en/parameters.js";
|
|
251
252
|
import { useUniqueNameValidationEn } from "./translations/en/use-unique-name-validation-en.js";
|
|
252
253
|
import { cardErrorBoundaryFr } from "./translations/fr/cardErrorBoundaryFr.js";
|
|
254
|
+
import { businessErrorsFr } from "./translations/fr/businessErrorsFr.js";
|
|
253
255
|
import { commonButtonFr } from "./translations/fr/commonButtonFr.js";
|
|
254
256
|
import { csvFr } from "./translations/fr/csvFr.js";
|
|
255
257
|
import { descriptionFr } from "./translations/fr/descriptionFr.js";
|
|
@@ -277,6 +279,7 @@ import { parametersFr } from "./translations/fr/parameters.js";
|
|
|
277
279
|
import { useUniqueNameValidationFr } from "./translations/fr/use-unique-name-validation-fr.js";
|
|
278
280
|
import * as yup from "yup";
|
|
279
281
|
export {
|
|
282
|
+
ALL_EQUIPMENTS,
|
|
280
283
|
AMPERE,
|
|
281
284
|
AboutDialog,
|
|
282
285
|
ActivableChip,
|
|
@@ -329,6 +332,7 @@ export {
|
|
|
329
332
|
CsvUploader,
|
|
330
333
|
CustomAGGrid,
|
|
331
334
|
CustomAgGridTable,
|
|
335
|
+
CustomError,
|
|
332
336
|
CustomFormContext,
|
|
333
337
|
CustomFormProvider,
|
|
334
338
|
CustomMenuItem,
|
|
@@ -558,7 +562,6 @@ export {
|
|
|
558
562
|
RangeType,
|
|
559
563
|
RawReadOnlyInput,
|
|
560
564
|
ReactivePowerAdornment,
|
|
561
|
-
RefreshButton,
|
|
562
565
|
RemoveButton,
|
|
563
566
|
RuleValueEditor,
|
|
564
567
|
SEARCH_EQUIPMENTS,
|
|
@@ -663,6 +666,8 @@ export {
|
|
|
663
666
|
backendFetchFile,
|
|
664
667
|
backendFetchJson,
|
|
665
668
|
backendFetchText,
|
|
669
|
+
businessErrorsEn,
|
|
670
|
+
businessErrorsFr,
|
|
666
671
|
cardErrorBoundaryEn,
|
|
667
672
|
cardErrorBoundaryFr,
|
|
668
673
|
catchErrorHandler,
|
|
@@ -804,7 +809,6 @@ export {
|
|
|
804
809
|
resetAuthenticationRouterError,
|
|
805
810
|
roundToDefaultPrecision,
|
|
806
811
|
roundToPrecision,
|
|
807
|
-
rqbQuerySchemaValidator,
|
|
808
812
|
safeEncodeURIComponent,
|
|
809
813
|
sanitizePercentageValue,
|
|
810
814
|
saveExpertFilter,
|
|
@@ -3,8 +3,7 @@ function setCommonStore(store) {
|
|
|
3
3
|
commonStore = store;
|
|
4
4
|
}
|
|
5
5
|
function getUserToken() {
|
|
6
|
-
|
|
7
|
-
return (_a = commonStore == null ? void 0 : commonStore.getState().user) == null ? void 0 : _a.id_token;
|
|
6
|
+
return commonStore?.getState().user?.id_token;
|
|
8
7
|
}
|
|
9
8
|
export {
|
|
10
9
|
getUserToken,
|
|
@@ -0,0 +1,11 @@
|
|
|
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
|
+
export declare class CustomError extends Error {
|
|
8
|
+
status: number;
|
|
9
|
+
businessErrorCode?: string;
|
|
10
|
+
constructor(message: string, status: number, businessErrorCode?: string);
|
|
11
|
+
}
|
package/dist/services/index.d.ts
CHANGED
package/dist/services/index.js
CHANGED
|
@@ -8,7 +8,9 @@ import { getNetworkVisualizationsParameters } from "./study-config.js";
|
|
|
8
8
|
import { fetchCurrentAnnouncement, fetchUserDetails } from "./userAdmin.js";
|
|
9
9
|
import { getVoltageInitParameters, getVoltageInitUrl } from "./voltage-init.js";
|
|
10
10
|
import { fetchDefaultSecurityAnalysisProvider, fetchSecurityAnalysisParameters, fetchSecurityAnalysisProviders, getSecurityAnalysisDefaultLimitReductions, getSecurityAnalysisParameters, getStudyUrl, safeEncodeURIComponent, setSecurityAnalysisParameters, updateSecurityAnalysisParameters, updateSecurityAnalysisProvider } from "./security-analysis.js";
|
|
11
|
+
import { CustomError } from "./businessErrorCode.js";
|
|
11
12
|
export {
|
|
13
|
+
CustomError,
|
|
12
14
|
NetworkTimeoutError,
|
|
13
15
|
PREFIX_STUDY_QUERIES,
|
|
14
16
|
backendFetch,
|
package/dist/services/utils.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { getUserToken } from "../redux/commonStore.js";
|
|
2
|
+
import { CustomError } from "./businessErrorCode.js";
|
|
2
3
|
const DEFAULT_TIMEOUT_MS = 5e4;
|
|
3
4
|
class NetworkTimeoutError extends Error {
|
|
4
5
|
constructor(messageKey = "errors.network.timeout") {
|
|
@@ -14,8 +15,8 @@ const parseError = (text) => {
|
|
|
14
15
|
}
|
|
15
16
|
};
|
|
16
17
|
const ensureSignal = (init) => {
|
|
17
|
-
if (init
|
|
18
|
-
const timeoutMs = typeof
|
|
18
|
+
if (init?.signal) return init;
|
|
19
|
+
const timeoutMs = typeof init?.timeoutMs === "number" ? init.timeoutMs : DEFAULT_TIMEOUT_MS;
|
|
19
20
|
return {
|
|
20
21
|
...init,
|
|
21
22
|
signal: AbortSignal.timeout(timeoutMs)
|
|
@@ -36,14 +37,19 @@ const handleError = (response) => {
|
|
|
36
37
|
const errorName = "HttpResponseError : ";
|
|
37
38
|
const errorJson = parseError(text);
|
|
38
39
|
let customError;
|
|
40
|
+
if (errorJson?.businessErrorCode != null) {
|
|
41
|
+
throw new CustomError(errorJson.message, errorJson.status, errorJson.businessErrorCode);
|
|
42
|
+
}
|
|
39
43
|
if (errorJson && errorJson.status && errorJson.error && errorJson.message) {
|
|
40
|
-
customError = new
|
|
41
|
-
`${errorName + errorJson.status} ${errorJson.error}, message : ${errorJson.message}
|
|
44
|
+
customError = new CustomError(
|
|
45
|
+
`${errorName + errorJson.status} ${errorJson.error}, message : ${errorJson.message}`,
|
|
46
|
+
errorJson.status
|
|
42
47
|
);
|
|
43
|
-
customError.status = errorJson.status;
|
|
44
48
|
} else {
|
|
45
|
-
customError = new
|
|
46
|
-
|
|
49
|
+
customError = new CustomError(
|
|
50
|
+
`${errorName + response.status} ${response.statusText}, message : ${text}`,
|
|
51
|
+
response.status
|
|
52
|
+
);
|
|
47
53
|
}
|
|
48
54
|
throw customError;
|
|
49
55
|
});
|
|
@@ -0,0 +1,28 @@
|
|
|
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
|
+
export declare const businessErrorsEn: {
|
|
8
|
+
'directory.permissionDenied': string;
|
|
9
|
+
'directory.elementNameBlank': string;
|
|
10
|
+
'directory.notDirectory': string;
|
|
11
|
+
'directory.elementNameConflict': string;
|
|
12
|
+
'directory.moveInDescendantNotAllowed': string;
|
|
13
|
+
'directory.someElementsAreMissing': string;
|
|
14
|
+
'directory.elementNotFound': string;
|
|
15
|
+
'explore.permissionDenied': string;
|
|
16
|
+
'explore.maxElementsExceeded': string;
|
|
17
|
+
'explore.incorrectCaseFile': string;
|
|
18
|
+
'useradmin.permissionDenied': string;
|
|
19
|
+
'useradmin.userNotFound': string;
|
|
20
|
+
'useradmin.userAlreadyExists': string;
|
|
21
|
+
'useradmin.profileNotFound': string;
|
|
22
|
+
'useradmin.profileAlreadyExists': string;
|
|
23
|
+
'useradmin.groupNotFound': string;
|
|
24
|
+
'useradmin.groupAlreadyExists': string;
|
|
25
|
+
'useradmin.announcementInvalidPeriod': string;
|
|
26
|
+
'useradmin.announcementOverlap': string;
|
|
27
|
+
'filter.filterCycleDetected': string;
|
|
28
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
const businessErrorsEn = {
|
|
2
|
+
"directory.permissionDenied": "You are not allowed to perform this action.",
|
|
3
|
+
"directory.elementNameBlank": "Element name must not be blank.",
|
|
4
|
+
"directory.notDirectory": "The selected element is not a directory.",
|
|
5
|
+
"directory.elementNameConflict": "An element with the same name already exists in the directory.",
|
|
6
|
+
"directory.moveInDescendantNotAllowed": "Cannot move an element inside one of its descendants.",
|
|
7
|
+
"directory.someElementsAreMissing": "Some of the requested directory elements are missing.",
|
|
8
|
+
"directory.elementNotFound": "The requested directory element could not be found.",
|
|
9
|
+
"explore.permissionDenied": "You are not allowed to perform this action.",
|
|
10
|
+
"explore.maxElementsExceeded": "The number of allowed elements has been exceeded.",
|
|
11
|
+
"explore.incorrectCaseFile": "The provided case file is incorrect.",
|
|
12
|
+
"useradmin.permissionDenied": "You don't have permission to perform this action.",
|
|
13
|
+
"useradmin.userNotFound": "User not found.",
|
|
14
|
+
"useradmin.userAlreadyExists": "User already exists.",
|
|
15
|
+
"useradmin.profileNotFound": "User profile not found.",
|
|
16
|
+
"useradmin.profileAlreadyExists": "User profile already exists.",
|
|
17
|
+
"useradmin.groupNotFound": "User's group not found.",
|
|
18
|
+
"useradmin.groupAlreadyExists": "User group already exists.",
|
|
19
|
+
"useradmin.announcementInvalidPeriod": "The announcement has an invalid time period.",
|
|
20
|
+
"useradmin.announcementOverlap": "The announcement period overlaps with an existing one.",
|
|
21
|
+
"filter.filterCycleDetected": "Filter cycle detected."
|
|
22
|
+
};
|
|
23
|
+
export {
|
|
24
|
+
businessErrorsEn
|
|
25
|
+
};
|
|
@@ -16,7 +16,8 @@ const equipmentsEn = {
|
|
|
16
16
|
Other: "Other",
|
|
17
17
|
LccConverterStations: "LCC converter stations",
|
|
18
18
|
VscConverterStations: "VSC converter stations",
|
|
19
|
-
StaticVarCompensators: "Static var compensators"
|
|
19
|
+
StaticVarCompensators: "Static var compensators",
|
|
20
|
+
BusBarSections: "Busbar sections"
|
|
20
21
|
};
|
|
21
22
|
export {
|
|
22
23
|
equipmentsEn
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { cardErrorBoundaryEn } from "./cardErrorBoundaryEn.js";
|
|
2
|
+
import { businessErrorsEn } from "./businessErrorsEn.js";
|
|
2
3
|
import { commonButtonEn } from "./commonButtonEn.js";
|
|
3
4
|
import { csvEn } from "./csvEn.js";
|
|
4
5
|
import { descriptionEn } from "./descriptionEn.js";
|
|
@@ -25,6 +26,7 @@ import { componentsEn } from "./componentsEn.js";
|
|
|
25
26
|
import { parametersEn } from "./parameters.js";
|
|
26
27
|
import { useUniqueNameValidationEn } from "./use-unique-name-validation-en.js";
|
|
27
28
|
export {
|
|
29
|
+
businessErrorsEn,
|
|
28
30
|
cardErrorBoundaryEn,
|
|
29
31
|
commonButtonEn,
|
|
30
32
|
componentsEn,
|
|
@@ -0,0 +1,28 @@
|
|
|
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
|
+
export declare const businessErrorsFr: {
|
|
8
|
+
'directory.permissionDenied': string;
|
|
9
|
+
'directory.elementNameBlank': string;
|
|
10
|
+
'directory.notDirectory': string;
|
|
11
|
+
'directory.elementNameConflict': string;
|
|
12
|
+
'directory.moveInDescendantNotAllowed': string;
|
|
13
|
+
'directory.someElementsAreMissing': string;
|
|
14
|
+
'directory.elementNotFound': string;
|
|
15
|
+
'explore.permissionDenied': string;
|
|
16
|
+
'explore.maxElementsExceeded': string;
|
|
17
|
+
'explore.incorrectCaseFile': string;
|
|
18
|
+
'useradmin.permissionDenied': string;
|
|
19
|
+
'useradmin.userNotFound': string;
|
|
20
|
+
'useradmin.userAlreadyExists': string;
|
|
21
|
+
'useradmin.profileNotFound': string;
|
|
22
|
+
'useradmin.profileAlreadyExists': string;
|
|
23
|
+
'useradmin.groupNotFound': string;
|
|
24
|
+
'useradmin.groupAlreadyExists': string;
|
|
25
|
+
'useradmin.announcementInvalidPeriod': string;
|
|
26
|
+
'useradmin.announcementOverlap': string;
|
|
27
|
+
'filter.filterCycleDetected': string;
|
|
28
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
const businessErrorsFr = {
|
|
2
|
+
"directory.permissionDenied": "Vous n'êtes pas autorisé à effectuer cette action.",
|
|
3
|
+
"directory.elementNameBlank": "Le nom de l'élément ne peut pas être vide.",
|
|
4
|
+
"directory.notDirectory": "L'élément sélectionné n'est pas un dossier.",
|
|
5
|
+
"directory.elementNameConflict": "Un élément portant le même nom existe déjà dans le dossier.",
|
|
6
|
+
"directory.moveInDescendantNotAllowed": "Impossible de déplacer un élément dans l’un de ses descendants.",
|
|
7
|
+
"directory.someElementsAreMissing": "Certains des éléments demandés sont manquants.",
|
|
8
|
+
"directory.elementNotFound": "L'élément du dossier demandé est introuvable.",
|
|
9
|
+
"explore.permissionDenied": "Vous n'êtes pas autorisé à effectuer cette action.",
|
|
10
|
+
"explore.maxElementsExceeded": "Le nombre d'éléments autorisés a été dépassé.",
|
|
11
|
+
"explore.incorrectCaseFile": "Le fichier réseau fourni est incorrect.",
|
|
12
|
+
"useradmin.permissionDenied": "Vous n'avez pas la permission d'effectuer cette action.",
|
|
13
|
+
"useradmin.userNotFound": "Utilisateur introuvable.",
|
|
14
|
+
"useradmin.userAlreadyExists": "L'utilisateur existe déjà.",
|
|
15
|
+
"useradmin.profileNotFound": "Profil utilisateur introuvable.",
|
|
16
|
+
"useradmin.profileAlreadyExists": "Le profil utilisateur existe déjà.",
|
|
17
|
+
"useradmin.groupNotFound": "Le groupe de l'utilisateur est introuvable.",
|
|
18
|
+
"useradmin.groupAlreadyExists": "Le groupe d'utilisateurs existe déjà.",
|
|
19
|
+
"useradmin.announcementInvalidPeriod": "La période de l'annonce est invalide.",
|
|
20
|
+
"useradmin.announcementOverlap": "La période de l'annonce chevauche une autre annonce existante.",
|
|
21
|
+
"filter.filterCycleDetected": "Cycle de filtre détecté."
|
|
22
|
+
};
|
|
23
|
+
export {
|
|
24
|
+
businessErrorsFr
|
|
25
|
+
};
|
|
@@ -16,7 +16,8 @@ const equipmentsFr = {
|
|
|
16
16
|
Other: "Autre",
|
|
17
17
|
LccConverterStations: "Stations de conversion LCC",
|
|
18
18
|
VscConverterStations: "Stations de conversion VSC",
|
|
19
|
-
StaticVarCompensators: "CSPR"
|
|
19
|
+
StaticVarCompensators: "CSPR",
|
|
20
|
+
BusBarSections: "Sections de jeux de barres"
|
|
20
21
|
};
|
|
21
22
|
export {
|
|
22
23
|
equipmentsFr
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { cardErrorBoundaryFr } from "./cardErrorBoundaryFr.js";
|
|
2
|
+
import { businessErrorsFr } from "./businessErrorsFr.js";
|
|
2
3
|
import { commonButtonFr } from "./commonButtonFr.js";
|
|
3
4
|
import { csvFr } from "./csvFr.js";
|
|
4
5
|
import { descriptionFr } from "./descriptionFr.js";
|
|
@@ -25,6 +26,7 @@ import { componentsFr } from "./componentsFr.js";
|
|
|
25
26
|
import { parametersFr } from "./parameters.js";
|
|
26
27
|
import { useUniqueNameValidationFr } from "./use-unique-name-validation-fr.js";
|
|
27
28
|
export {
|
|
29
|
+
businessErrorsFr,
|
|
28
30
|
cardErrorBoundaryFr,
|
|
29
31
|
commonButtonFr,
|
|
30
32
|
componentsFr,
|
package/dist/utils/index.js
CHANGED
|
@@ -12,7 +12,7 @@ import { equipmentTypesForPredefinedPropertiesMapper } from "./mapper/equipmentT
|
|
|
12
12
|
import { NotificationsUrlKeys, PREFIX_CONFIG_NOTIFICATION_WS, PREFIX_DIRECTORY_NOTIFICATION_WS, PREFIX_STUDY_NOTIFICATION_WS } from "./constants/notificationsProvider.js";
|
|
13
13
|
import { DARK_THEME, LIGHT_THEME, makeComposeClasses, mergeSx, toNestedGlobalSelectors } from "./styles.js";
|
|
14
14
|
import { ElementType } from "./types/elementType.js";
|
|
15
|
-
import { BASE_EQUIPMENTS, EQUIPMENT_TYPE, EquipmentType, ExtendedEquipmentType, HvdcType, OperatingStatus, SEARCH_EQUIPMENTS, TYPE_TAG_MAX_SIZE, VL_TAG_MAX_SIZE, equipmentStyles, getEquipmentsInfosForSearchBar } from "./types/equipmentType.js";
|
|
15
|
+
import { ALL_EQUIPMENTS, BASE_EQUIPMENTS, EQUIPMENT_TYPE, EquipmentType, ExtendedEquipmentType, HvdcType, OperatingStatus, SEARCH_EQUIPMENTS, TYPE_TAG_MAX_SIZE, VL_TAG_MAX_SIZE, equipmentStyles, getEquipmentsInfosForSearchBar } from "./types/equipmentType.js";
|
|
16
16
|
import { Battery, BusBar, DanglingLine, Generator, Hvdc, LCC, Line, Load, SVC, ShuntCompensator, Substation, ThreeWindingTransfo, TwoWindingTransfo, VSC, VoltageLevel } from "./types/equipmentTypes.js";
|
|
17
17
|
import { AnnouncementSeverity, ArrayAction } from "./types/types.js";
|
|
18
18
|
import { MODIFICATION_TYPES, ModificationType } from "./types/modificationType.js";
|
|
@@ -24,6 +24,7 @@ import { toNumber, validateValueIsANumber } from "./validation-functions.js";
|
|
|
24
24
|
import "./yupConfig.js";
|
|
25
25
|
import * as yup from "yup";
|
|
26
26
|
export {
|
|
27
|
+
ALL_EQUIPMENTS,
|
|
27
28
|
AMPERE,
|
|
28
29
|
AnnouncementSeverity,
|
|
29
30
|
ArrayAction,
|
|
@@ -71,18 +71,172 @@ export declare enum ExtendedEquipmentType {
|
|
|
71
71
|
HVDC_LINE_LCC = "HVDC_LINE_LCC",
|
|
72
72
|
HVDC_LINE_VSC = "HVDC_LINE_VSC"
|
|
73
73
|
}
|
|
74
|
-
export declare const
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
74
|
+
export declare const ALL_EQUIPMENTS: {
|
|
75
|
+
SUBSTATION: {
|
|
76
|
+
id: EquipmentType;
|
|
77
|
+
label: string;
|
|
78
|
+
};
|
|
79
|
+
VOLTAGE_LEVEL: {
|
|
80
|
+
id: EquipmentType;
|
|
81
|
+
label: string;
|
|
82
|
+
};
|
|
83
|
+
LINE: {
|
|
84
|
+
id: EquipmentType;
|
|
85
|
+
label: string;
|
|
86
|
+
};
|
|
87
|
+
TWO_WINDINGS_TRANSFORMER: {
|
|
88
|
+
id: EquipmentType;
|
|
89
|
+
label: string;
|
|
90
|
+
};
|
|
91
|
+
THREE_WINDINGS_TRANSFORMER: {
|
|
92
|
+
id: EquipmentType;
|
|
93
|
+
label: string;
|
|
94
|
+
};
|
|
95
|
+
GENERATOR: {
|
|
96
|
+
id: EquipmentType;
|
|
97
|
+
label: string;
|
|
98
|
+
};
|
|
99
|
+
BATTERY: {
|
|
100
|
+
id: EquipmentType;
|
|
101
|
+
label: string;
|
|
102
|
+
};
|
|
103
|
+
LOAD: {
|
|
104
|
+
id: EquipmentType;
|
|
105
|
+
label: string;
|
|
106
|
+
};
|
|
107
|
+
SHUNT_COMPENSATOR: {
|
|
108
|
+
id: EquipmentType;
|
|
109
|
+
label: string;
|
|
110
|
+
};
|
|
111
|
+
STATIC_VAR_COMPENSATOR: {
|
|
112
|
+
id: EquipmentType;
|
|
113
|
+
label: string;
|
|
114
|
+
};
|
|
115
|
+
DANGLING_LINE: {
|
|
116
|
+
id: EquipmentType;
|
|
117
|
+
label: string;
|
|
118
|
+
};
|
|
119
|
+
BUSBAR_SECTION: {
|
|
120
|
+
id: EquipmentType;
|
|
121
|
+
label: string;
|
|
122
|
+
};
|
|
123
|
+
HVDC_LINE: {
|
|
124
|
+
id: EquipmentType;
|
|
125
|
+
label: string;
|
|
126
|
+
};
|
|
127
|
+
HVDC_LINE_LCC: {
|
|
128
|
+
id: ExtendedEquipmentType;
|
|
129
|
+
label: string;
|
|
130
|
+
};
|
|
131
|
+
HVDC_LINE_VSC: {
|
|
132
|
+
id: ExtendedEquipmentType;
|
|
133
|
+
label: string;
|
|
134
|
+
};
|
|
135
|
+
};
|
|
136
|
+
export declare const BASE_EQUIPMENTS: {
|
|
137
|
+
SUBSTATION: {
|
|
138
|
+
id: EquipmentType;
|
|
139
|
+
label: string;
|
|
140
|
+
};
|
|
141
|
+
VOLTAGE_LEVEL: {
|
|
142
|
+
id: EquipmentType;
|
|
143
|
+
label: string;
|
|
144
|
+
};
|
|
145
|
+
LINE: {
|
|
146
|
+
id: EquipmentType;
|
|
147
|
+
label: string;
|
|
148
|
+
};
|
|
149
|
+
TWO_WINDINGS_TRANSFORMER: {
|
|
150
|
+
id: EquipmentType;
|
|
151
|
+
label: string;
|
|
152
|
+
};
|
|
153
|
+
THREE_WINDINGS_TRANSFORMER: {
|
|
154
|
+
id: EquipmentType;
|
|
155
|
+
label: string;
|
|
156
|
+
};
|
|
157
|
+
GENERATOR: {
|
|
158
|
+
id: EquipmentType;
|
|
159
|
+
label: string;
|
|
160
|
+
};
|
|
161
|
+
BATTERY: {
|
|
162
|
+
id: EquipmentType;
|
|
163
|
+
label: string;
|
|
164
|
+
};
|
|
165
|
+
LOAD: {
|
|
166
|
+
id: EquipmentType;
|
|
167
|
+
label: string;
|
|
168
|
+
};
|
|
169
|
+
SHUNT_COMPENSATOR: {
|
|
170
|
+
id: EquipmentType;
|
|
171
|
+
label: string;
|
|
172
|
+
};
|
|
173
|
+
STATIC_VAR_COMPENSATOR: {
|
|
174
|
+
id: EquipmentType;
|
|
175
|
+
label: string;
|
|
176
|
+
};
|
|
177
|
+
DANGLING_LINE: {
|
|
178
|
+
id: EquipmentType;
|
|
179
|
+
label: string;
|
|
180
|
+
};
|
|
181
|
+
};
|
|
78
182
|
export declare const EQUIPMENT_TYPE: Partial<Record<EquipmentType | ExtendedEquipmentType, {
|
|
79
183
|
name: EquipmentType | ExtendedEquipmentType;
|
|
80
184
|
tagLabel: string;
|
|
81
185
|
} | undefined>>;
|
|
82
|
-
export declare const SEARCH_EQUIPMENTS:
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
186
|
+
export declare const SEARCH_EQUIPMENTS: {
|
|
187
|
+
HVDC_LINE_LCC: {
|
|
188
|
+
id: ExtendedEquipmentType;
|
|
189
|
+
label: string;
|
|
190
|
+
};
|
|
191
|
+
HVDC_LINE_VSC: {
|
|
192
|
+
id: ExtendedEquipmentType;
|
|
193
|
+
label: string;
|
|
194
|
+
};
|
|
195
|
+
SUBSTATION: {
|
|
196
|
+
id: EquipmentType;
|
|
197
|
+
label: string;
|
|
198
|
+
};
|
|
199
|
+
VOLTAGE_LEVEL: {
|
|
200
|
+
id: EquipmentType;
|
|
201
|
+
label: string;
|
|
202
|
+
};
|
|
203
|
+
LINE: {
|
|
204
|
+
id: EquipmentType;
|
|
205
|
+
label: string;
|
|
206
|
+
};
|
|
207
|
+
TWO_WINDINGS_TRANSFORMER: {
|
|
208
|
+
id: EquipmentType;
|
|
209
|
+
label: string;
|
|
210
|
+
};
|
|
211
|
+
THREE_WINDINGS_TRANSFORMER: {
|
|
212
|
+
id: EquipmentType;
|
|
213
|
+
label: string;
|
|
214
|
+
};
|
|
215
|
+
GENERATOR: {
|
|
216
|
+
id: EquipmentType;
|
|
217
|
+
label: string;
|
|
218
|
+
};
|
|
219
|
+
BATTERY: {
|
|
220
|
+
id: EquipmentType;
|
|
221
|
+
label: string;
|
|
222
|
+
};
|
|
223
|
+
LOAD: {
|
|
224
|
+
id: EquipmentType;
|
|
225
|
+
label: string;
|
|
226
|
+
};
|
|
227
|
+
SHUNT_COMPENSATOR: {
|
|
228
|
+
id: EquipmentType;
|
|
229
|
+
label: string;
|
|
230
|
+
};
|
|
231
|
+
STATIC_VAR_COMPENSATOR: {
|
|
232
|
+
id: EquipmentType;
|
|
233
|
+
label: string;
|
|
234
|
+
};
|
|
235
|
+
DANGLING_LINE: {
|
|
236
|
+
id: EquipmentType;
|
|
237
|
+
label: string;
|
|
238
|
+
};
|
|
239
|
+
};
|
|
86
240
|
export interface Identifiable {
|
|
87
241
|
id: string;
|
|
88
242
|
name?: string;
|