@gridsuite/commons-ui 0.106.0 → 0.107.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 (57) hide show
  1. package/dist/components/grid/grid-item.d.ts +8 -0
  2. package/dist/components/grid/grid-item.js +8 -0
  3. package/dist/components/grid/grid-section.d.ts +8 -0
  4. package/dist/components/grid/grid-section.js +9 -0
  5. package/dist/components/grid/index.d.ts +8 -0
  6. package/dist/components/grid/index.js +3 -0
  7. package/dist/components/index.d.ts +1 -0
  8. package/dist/components/index.js +19 -0
  9. package/dist/components/parameters/common/index.d.ts +1 -0
  10. package/dist/components/parameters/common/parameters-edition-dialog-props.d.ts +14 -0
  11. package/dist/components/parameters/common/parameters-edition-dialog-props.js +1 -0
  12. package/dist/components/parameters/index.d.ts +1 -0
  13. package/dist/components/parameters/index.js +16 -0
  14. package/dist/components/parameters/loadflow/load-flow-parameters-dialog.d.ts +1 -14
  15. package/dist/components/parameters/loadflow/load-flow-parameters-dialog.js +1 -1
  16. package/dist/components/parameters/loadflow/load-flow-parameters-utils.d.ts +0 -3
  17. package/dist/components/parameters/loadflow/load-flow-parameters-utils.js +0 -35
  18. package/dist/components/parameters/loadflow/use-load-flow-parameters-form.js +1 -2
  19. package/dist/components/parameters/network-visualizations/network-visualizations-form.js +4 -4
  20. package/dist/components/parameters/network-visualizations/network-visualizations-parameters-dialog.d.ts +2 -14
  21. package/dist/components/parameters/network-visualizations/network-visualizations-parameters-dialog.js +7 -1
  22. package/dist/components/parameters/network-visualizations/network-visualizations-parameters-inline.js +7 -1
  23. package/dist/components/parameters/network-visualizations/use-network-visualizations-parameters-form.d.ts +16 -2
  24. package/dist/components/parameters/network-visualizations/use-network-visualizations-parameters-form.js +15 -6
  25. package/dist/components/parameters/short-circuit/constants.d.ts +37 -0
  26. package/dist/components/parameters/short-circuit/constants.js +58 -0
  27. package/dist/components/parameters/short-circuit/index.d.ts +10 -0
  28. package/dist/components/parameters/short-circuit/index.js +18 -0
  29. package/dist/components/parameters/short-circuit/short-circuit-fields.d.ts +9 -0
  30. package/dist/components/parameters/short-circuit/short-circuit-fields.js +169 -0
  31. package/dist/components/parameters/short-circuit/short-circuit-parameters-dialog.d.ts +2 -0
  32. package/dist/components/parameters/short-circuit/short-circuit-parameters-dialog.js +91 -0
  33. package/dist/components/parameters/short-circuit/short-circuit-parameters-form.d.ts +9 -0
  34. package/dist/components/parameters/short-circuit/short-circuit-parameters-form.js +69 -0
  35. package/dist/components/parameters/short-circuit/short-circuit-parameters-inline.d.ts +8 -0
  36. package/dist/components/parameters/short-circuit/short-circuit-parameters-inline.js +147 -0
  37. package/dist/components/parameters/short-circuit/short-circuit-parameters.type.d.ts +38 -0
  38. package/dist/components/parameters/short-circuit/short-circuit-parameters.type.js +1 -0
  39. package/dist/components/parameters/short-circuit/short-circuit-voltage-table.d.ts +5 -0
  40. package/dist/components/parameters/short-circuit/short-circuit-voltage-table.js +38 -0
  41. package/dist/components/parameters/short-circuit/use-short-circuit-parameters-form.d.ts +29 -0
  42. package/dist/components/parameters/short-circuit/use-short-circuit-parameters-form.js +222 -0
  43. package/dist/index.js +23 -1
  44. package/dist/services/index.js +4 -1
  45. package/dist/services/short-circuit-analysis.d.ts +2 -0
  46. package/dist/services/short-circuit-analysis.js +13 -0
  47. package/dist/services/study.d.ts +4 -0
  48. package/dist/services/study.js +25 -1
  49. package/dist/translations/en/networkModificationsEn.d.ts +2 -0
  50. package/dist/translations/en/networkModificationsEn.js +2 -0
  51. package/dist/translations/en/parameters.d.ts +28 -0
  52. package/dist/translations/en/parameters.js +29 -1
  53. package/dist/translations/fr/networkModificationsFr.d.ts +2 -0
  54. package/dist/translations/fr/networkModificationsFr.js +2 -0
  55. package/dist/translations/fr/parameters.d.ts +28 -0
  56. package/dist/translations/fr/parameters.js +29 -1
  57. package/package.json +1 -1
@@ -0,0 +1,222 @@
1
+ import { useForm } from "react-hook-form";
2
+ import { yupResolver } from "@hookform/resolvers/yup";
3
+ import { useState, useMemo, useCallback, useEffect } from "react";
4
+ import "../../../utils/yupConfig.js";
5
+ import "react/jsx-runtime";
6
+ import "react-intl";
7
+ import "@mui/material";
8
+ import { DESCRIPTION_INPUT, NAME } from "../../inputs/reactHookForm/DirectoryItemsInput.js";
9
+ import "../../inputs/reactHookForm/agGridTable/BottomRightButtons.js";
10
+ import "../../customAGGrid/customAggrid.js";
11
+ import "ag-grid-community";
12
+ import "react-papaparse";
13
+ import "react-csv-downloader";
14
+ import * as yup from "yup";
15
+ import "../../inputs/reactHookForm/provider/CustomFormProvider.js";
16
+ import "@mui/icons-material";
17
+ import "../../inputs/reactHookForm/numbers/RangeInput.js";
18
+ import "localized-countries";
19
+ import "localized-countries/data/fr";
20
+ import "localized-countries/data/en";
21
+ import "../../../utils/conversionUtils.js";
22
+ import { ElementType } from "../../../utils/types/elementType.js";
23
+ import "../../../utils/types/equipmentType.js";
24
+ import { updateParameter } from "../../../services/explore.js";
25
+ import { setStudyShortCircuitParameters, invalidateStudyShortCircuitStatus } from "../../../services/study.js";
26
+ import { useSnackMessage } from "../../../hooks/useSnackMessage.js";
27
+ import "@react-querybuilder/material";
28
+ import "../../filter/expert/expertFilterConstants.js";
29
+ import "../../inputs/reactQueryBuilder/CustomReactQueryBuilder.js";
30
+ import "uuid";
31
+ import "../../inputs/reactQueryBuilder/PropertyValueEditor.js";
32
+ import "react-querybuilder";
33
+ import { SHORT_CIRCUIT_INITIAL_VOLTAGE_PROFILE_MODE, InitialVoltage, SHORT_CIRCUIT_WITH_NEUTRAL_POSITION, SHORT_CIRCUIT_WITH_SHUNT_COMPENSATORS, SHORT_CIRCUIT_WITH_VSC_CONVERTER_STATIONS, SHORT_CIRCUIT_WITH_LOADS, SHORT_CIRCUIT_PREDEFINED_PARAMS, PredefinedParameters, SHORT_CIRCUIT_WITH_FEEDER_RESULT } from "./constants.js";
34
+ import "../../filter/HeaderFilterForm.js";
35
+ import { getNameElementEditorSchema, getNameElementEditorEmptyFormData } from "../common/name-element-editor/name-element-editor-utils.js";
36
+ import { fetchShortCircuitParameters } from "../../../services/short-circuit-analysis.js";
37
+ const useShortCircuitParametersForm = ({
38
+ parametersUuid,
39
+ name,
40
+ description,
41
+ studyUuid,
42
+ studyShortCircuitParameters
43
+ }) => {
44
+ const { snackError } = useSnackMessage();
45
+ const [paramsLoading, setParamsLoading] = useState(false);
46
+ const [shortCircuitParameters, setShortCircuitParameters] = useState();
47
+ const formSchema = useMemo(() => {
48
+ return yup.object().shape({
49
+ [SHORT_CIRCUIT_WITH_FEEDER_RESULT]: yup.boolean().required(),
50
+ [SHORT_CIRCUIT_PREDEFINED_PARAMS]: yup.mixed().oneOf(Object.values(PredefinedParameters)).required(),
51
+ [SHORT_CIRCUIT_WITH_LOADS]: yup.boolean().required(),
52
+ [SHORT_CIRCUIT_WITH_VSC_CONVERTER_STATIONS]: yup.boolean().required(),
53
+ [SHORT_CIRCUIT_WITH_SHUNT_COMPENSATORS]: yup.boolean().required(),
54
+ [SHORT_CIRCUIT_WITH_NEUTRAL_POSITION]: yup.boolean().required(),
55
+ [SHORT_CIRCUIT_INITIAL_VOLTAGE_PROFILE_MODE]: yup.mixed().oneOf(Object.values(InitialVoltage)).required()
56
+ }).required().concat(getNameElementEditorSchema(name));
57
+ }, [name]);
58
+ const emptyFormData = useMemo(() => {
59
+ return {
60
+ ...getNameElementEditorEmptyFormData(name, description),
61
+ [SHORT_CIRCUIT_WITH_FEEDER_RESULT]: false,
62
+ [SHORT_CIRCUIT_PREDEFINED_PARAMS]: PredefinedParameters.ICC_MAX_WITH_CEI909,
63
+ [SHORT_CIRCUIT_WITH_LOADS]: false,
64
+ [SHORT_CIRCUIT_WITH_VSC_CONVERTER_STATIONS]: false,
65
+ [SHORT_CIRCUIT_WITH_SHUNT_COMPENSATORS]: false,
66
+ [SHORT_CIRCUIT_WITH_NEUTRAL_POSITION]: false,
67
+ [SHORT_CIRCUIT_INITIAL_VOLTAGE_PROFILE_MODE]: InitialVoltage.CEI909
68
+ };
69
+ }, [name, description]);
70
+ const formMethods = useForm({
71
+ defaultValues: emptyFormData,
72
+ resolver: yupResolver(formSchema)
73
+ });
74
+ const { getValues, reset, setValue } = formMethods;
75
+ const resetAll = useCallback(
76
+ (predefinedParameter) => {
77
+ const dirty = { shouldDirty: true };
78
+ setValue(SHORT_CIRCUIT_WITH_FEEDER_RESULT, true, dirty);
79
+ setValue(SHORT_CIRCUIT_WITH_LOADS, false, dirty);
80
+ setValue(
81
+ SHORT_CIRCUIT_WITH_VSC_CONVERTER_STATIONS,
82
+ predefinedParameter !== PredefinedParameters.ICC_MIN_WITH_NOMINAL_VOLTAGE_MAP,
83
+ dirty
84
+ );
85
+ setValue(SHORT_CIRCUIT_WITH_SHUNT_COMPENSATORS, false, dirty);
86
+ setValue(SHORT_CIRCUIT_WITH_NEUTRAL_POSITION, false, dirty);
87
+ const initialVoltageProfileMode = predefinedParameter === PredefinedParameters.ICC_MAX_WITH_CEI909 ? InitialVoltage.CEI909 : InitialVoltage.NOMINAL;
88
+ setValue(SHORT_CIRCUIT_INITIAL_VOLTAGE_PROFILE_MODE, initialVoltageProfileMode, dirty);
89
+ setValue(SHORT_CIRCUIT_PREDEFINED_PARAMS, predefinedParameter, dirty);
90
+ },
91
+ [setValue]
92
+ );
93
+ const prepareDataToSend = (shortCircuitParams, newParameters) => {
94
+ const oldParameters = { ...shortCircuitParams.parameters };
95
+ const {
96
+ predefinedParameters: omit,
97
+ [NAME]: omit2,
98
+ [DESCRIPTION_INPUT]: omit3,
99
+ ...newParametersWithoutPredefinedParameters
100
+ } = newParameters;
101
+ let parameters = {
102
+ ...oldParameters,
103
+ ...newParametersWithoutPredefinedParameters,
104
+ // we need to add voltageRanges to the parameters only when initialVoltageProfileMode is equals to CEI909
105
+ voltageRanges: void 0,
106
+ withNeutralPosition: !newParameters.withNeutralPosition
107
+ };
108
+ if (newParameters.initialVoltageProfileMode === InitialVoltage.CEI909) {
109
+ parameters = {
110
+ ...parameters,
111
+ voltageRanges: shortCircuitParams.cei909VoltageRanges,
112
+ initialVoltageProfileMode: InitialVoltage.CONFIGURED
113
+ };
114
+ }
115
+ return {
116
+ predefinedParameters: newParameters.predefinedParameters,
117
+ parameters
118
+ };
119
+ };
120
+ const getCurrentValues = useCallback(() => {
121
+ if (shortCircuitParameters) {
122
+ const currentValues = getValues();
123
+ return { ...prepareDataToSend(shortCircuitParameters, currentValues) };
124
+ }
125
+ return {};
126
+ }, [shortCircuitParameters, getValues]);
127
+ const formatShortCircuitParameters = (parameters, predefinedParameters) => {
128
+ return {
129
+ [SHORT_CIRCUIT_WITH_FEEDER_RESULT]: parameters.withFeederResult,
130
+ [SHORT_CIRCUIT_PREDEFINED_PARAMS]: predefinedParameters,
131
+ [SHORT_CIRCUIT_WITH_LOADS]: parameters.withLoads,
132
+ [SHORT_CIRCUIT_WITH_VSC_CONVERTER_STATIONS]: parameters.withVSCConverterStations,
133
+ [SHORT_CIRCUIT_WITH_SHUNT_COMPENSATORS]: parameters.withShuntCompensators,
134
+ [SHORT_CIRCUIT_WITH_NEUTRAL_POSITION]: !parameters.withNeutralPosition,
135
+ [SHORT_CIRCUIT_INITIAL_VOLTAGE_PROFILE_MODE]: parameters.initialVoltageProfileMode === InitialVoltage.CONFIGURED ? InitialVoltage.CEI909 : parameters.initialVoltageProfileMode
136
+ };
137
+ };
138
+ const onSaveInline = useCallback(
139
+ (formData) => {
140
+ if (studyUuid && shortCircuitParameters) {
141
+ const oldParams = shortCircuitParameters;
142
+ setStudyShortCircuitParameters(studyUuid, {
143
+ ...prepareDataToSend(shortCircuitParameters, formData)
144
+ }).then(() => {
145
+ invalidateStudyShortCircuitStatus(studyUuid).catch((error) => {
146
+ snackError({
147
+ messageTxt: error.message,
148
+ headerId: "invalidateShortCircuitStatusError"
149
+ });
150
+ });
151
+ }).catch((error) => {
152
+ setShortCircuitParameters(oldParams);
153
+ snackError({
154
+ messageTxt: error.message,
155
+ headerId: "paramsChangingError"
156
+ });
157
+ });
158
+ }
159
+ },
160
+ [shortCircuitParameters, setShortCircuitParameters, snackError, studyUuid]
161
+ );
162
+ const onSaveDialog = useCallback(
163
+ (formData) => {
164
+ if (parametersUuid && shortCircuitParameters) {
165
+ updateParameter(
166
+ parametersUuid,
167
+ prepareDataToSend(shortCircuitParameters, formData),
168
+ formData[NAME],
169
+ ElementType.SHORT_CIRCUIT_PARAMETERS,
170
+ formData[DESCRIPTION_INPUT] ?? ""
171
+ ).catch((error) => {
172
+ snackError({
173
+ messageTxt: error.message,
174
+ headerId: "paramsChangingError"
175
+ });
176
+ });
177
+ }
178
+ },
179
+ [parametersUuid, shortCircuitParameters, snackError]
180
+ );
181
+ useEffect(() => {
182
+ if (parametersUuid) {
183
+ const timer = setTimeout(() => {
184
+ setParamsLoading(true);
185
+ }, 700);
186
+ fetchShortCircuitParameters(parametersUuid).then((params) => {
187
+ setShortCircuitParameters(params);
188
+ }).catch((error) => {
189
+ snackError({
190
+ messageTxt: error.message,
191
+ headerId: "paramsRetrievingError"
192
+ });
193
+ }).finally(() => {
194
+ clearTimeout(timer);
195
+ setParamsLoading(false);
196
+ });
197
+ }
198
+ }, [parametersUuid, snackError]);
199
+ useEffect(() => {
200
+ if (studyShortCircuitParameters) {
201
+ setShortCircuitParameters(studyShortCircuitParameters);
202
+ }
203
+ }, [studyShortCircuitParameters]);
204
+ useEffect(() => {
205
+ if (shortCircuitParameters) {
206
+ const { parameters, predefinedParameters } = shortCircuitParameters;
207
+ reset(formatShortCircuitParameters(parameters, predefinedParameters));
208
+ }
209
+ }, [reset, shortCircuitParameters]);
210
+ return {
211
+ formMethods,
212
+ formSchema,
213
+ paramsLoading,
214
+ onSaveInline,
215
+ onSaveDialog,
216
+ resetAll,
217
+ getCurrentValues
218
+ };
219
+ };
220
+ export {
221
+ useShortCircuitParametersForm
222
+ };
package/dist/index.js CHANGED
@@ -44,6 +44,9 @@ import { FILTER_EQUIPMENTS_ATTRIBUTES } from "./components/filter/explicitNaming
44
44
  import { saveExpertFilter, saveExplicitNamingFilter } from "./components/filter/utils/filterApi.js";
45
45
  import { CONTINGENCY_LIST_EQUIPMENTS, FILTER_EQUIPMENTS } from "./components/filter/utils/filterFormUtils.js";
46
46
  import { FlatParameters, extractDefault } from "./components/flatParameters/FlatParameters.js";
47
+ import "react/jsx-runtime";
48
+ import "@mui/material";
49
+ import "react-intl";
47
50
  import { SelectClearable } from "./components/inputs/SelectClearable.js";
48
51
  import { DESCRIPTION_INPUT, DirectoryItemsInput, NAME } from "./components/inputs/reactHookForm/DirectoryItemsInput.js";
49
52
  import { RawReadOnlyInput } from "./components/inputs/reactHookForm/RawReadOnlyInput.js";
@@ -140,6 +143,9 @@ import { getTabIndicatorStyle, getTabStyle, parametersStyles } from "./component
140
143
  import { BALANCE_TYPE, COMMON_PARAMETERS, CONNECTED_COMPONENT_MODE, COUNTRIES_TO_BALANCE, DC, DC_POWER_FACTOR, DC_USE_TRANSFORMER_RATIO, DEFAULT_LIMIT_REDUCTION_VALUE, DISTRIBUTED_SLACK, HVDC_AC_EMULATION, MAX_VALUE_ALLOWED_FOR_LIMIT_REDUCTION, MIN_VALUE_ALLOWED_FOR_LIMIT_REDUCTION, PARAM_LIMIT_REDUCTION, PARAM_PROVIDER_OPENLOADFLOW, PHASE_SHIFTER_REGULATION_ON, READ_SLACK_BUS, SHUNT_COMPENSATOR_VOLTAGE_CONTROL_ON, SPECIFIC_PARAMETERS, TRANSFORMER_VOLTAGE_CONTROL_ON, TWT_SPLIT_SHUNT_ADMITTANCE, USE_REACTIVE_LIMITS, VOLTAGE_INIT_MODE, WRITE_SLACK_BUS, alertThresholdMarks } from "./components/parameters/loadflow/constants.js";
141
144
  import { LoadFlowParametersInline } from "./components/parameters/loadflow/load-flow-parameters-inline.js";
142
145
  import { LoadFlowParametersEditionDialog } from "./components/parameters/loadflow/load-flow-parameters-dialog.js";
146
+ import { InitialVoltage, PredefinedParameters, SHORT_CIRCUIT_INITIAL_VOLTAGE_PROFILE_MODE, SHORT_CIRCUIT_PREDEFINED_PARAMS, SHORT_CIRCUIT_WITH_FEEDER_RESULT, SHORT_CIRCUIT_WITH_LOADS, SHORT_CIRCUIT_WITH_NEUTRAL_POSITION, SHORT_CIRCUIT_WITH_SHUNT_COMPENSATORS, SHORT_CIRCUIT_WITH_VSC_CONVERTER_STATIONS, intlInitialVoltageProfileMode, intlPredefinedParametersOptions } from "./components/parameters/short-circuit/constants.js";
147
+ import { ShortCircuitParametersInLine } from "./components/parameters/short-circuit/short-circuit-parameters-inline.js";
148
+ import { ShortCircuitParametersEditionDialog } from "./components/parameters/short-circuit/short-circuit-parameters-dialog.js";
143
149
  import { CustomMenuItem, CustomNestedMenuItem } from "./components/menus/custom-nested-menu.js";
144
150
  import { useStateBoolean } from "./hooks/customStates/useStateBoolean.js";
145
151
  import { useStateNumber } from "./hooks/customStates/useStateNumber.js";
@@ -161,7 +167,7 @@ import { createFilter, createParameter, fetchElementsInfos, saveFilter, updatePa
161
167
  import { fetchAppsMetadata, fetchDefaultCountry, fetchEnv, fetchFavoriteAndDefaultCountries, fetchStudyMetadata, isStudyMetadata } from "./services/appsMetadata.js";
162
168
  import { elementAlreadyExists, fetchDirectoryContent, fetchDirectoryElementPath, fetchRootFolders } from "./services/directory.js";
163
169
  import { PREFIX_STUDY_QUERIES, fetchLoadFlowParameters, getDefaultLoadFlowProvider, getLoadFlowDefaultLimitReductions, getLoadFlowProviders, getLoadFlowSpecificParametersDescription, getLoadFlowUrl, setLoadFlowParameters } from "./services/loadflow.js";
164
- import { exportFilter, getAvailableComponentLibraries, getStudyNetworkVisualizationsParameters, setStudyNetworkVisualizationParameters } from "./services/study.js";
170
+ import { exportFilter, getAvailableComponentLibraries, getStudyNetworkVisualizationsParameters, getStudyShortCircuitParameters, invalidateStudyShortCircuitStatus, setStudyNetworkVisualizationParameters, setStudyShortCircuitParameters } from "./services/study.js";
165
171
  import { getNetworkVisualizationsParameters } from "./services/study-config.js";
166
172
  import { fetchCurrentAnnouncement, fetchUserDetails } from "./services/userAdmin.js";
167
173
  import { equalsArray } from "./utils/algos.js";
@@ -353,6 +359,7 @@ export {
353
359
  INTL_MAP_BASE_MAP_OPTIONS,
354
360
  INTL_SUBSTATION_LAYOUT_OPTIONS,
355
361
  IST_FORM,
362
+ InitialVoltage,
356
363
  InputWithPopupConfirmation,
357
364
  IntegerInput,
358
365
  KILO_AMPERE,
@@ -450,6 +457,7 @@ export {
450
457
  ParameterSwitch,
451
458
  ParameterType,
452
459
  PopupConfirmationDialog,
460
+ PredefinedParameters,
453
461
  PropertyValueEditor,
454
462
  ProviderParam,
455
463
  RATIO_REGULATION_MODE_OPTIONS,
@@ -464,6 +472,13 @@ export {
464
472
  RemoveButton,
465
473
  RuleValueEditor,
466
474
  SEARCH_EQUIPMENTS,
475
+ SHORT_CIRCUIT_INITIAL_VOLTAGE_PROFILE_MODE,
476
+ SHORT_CIRCUIT_PREDEFINED_PARAMS,
477
+ SHORT_CIRCUIT_WITH_FEEDER_RESULT,
478
+ SHORT_CIRCUIT_WITH_LOADS,
479
+ SHORT_CIRCUIT_WITH_NEUTRAL_POSITION,
480
+ SHORT_CIRCUIT_WITH_SHUNT_COMPENSATORS,
481
+ SHORT_CIRCUIT_WITH_VSC_CONVERTER_STATIONS,
467
482
  SHOW_AUTH_INFO_LOGIN,
468
483
  SHUNT_COMPENSATOR_TYPE_OPTIONS,
469
484
  SHUNT_COMPENSATOR_VOLTAGE_CONTROL_ON,
@@ -476,6 +491,8 @@ export {
476
491
  SelectClearable,
477
492
  SelectInput,
478
493
  SensitivityType,
494
+ ShortCircuitParametersEditionDialog,
495
+ ShortCircuitParametersInLine,
479
496
  ShuntCompensator,
480
497
  SignInCallbackHandler,
481
498
  SilentRenewCallbackHandler,
@@ -602,6 +619,7 @@ export {
602
619
  getRequestParamFromList,
603
620
  getSAParametersFromSchema,
604
621
  getStudyNetworkVisualizationsParameters,
622
+ getStudyShortCircuitParameters,
605
623
  getSystemLanguage,
606
624
  getTabIndicatorStyle,
607
625
  getTabStyle,
@@ -617,6 +635,9 @@ export {
617
635
  initializeAuthenticationProd,
618
636
  inputsEn,
619
637
  inputsFr,
638
+ intlInitialVoltageProfileMode,
639
+ intlPredefinedParametersOptions,
640
+ invalidateStudyShortCircuitStatus,
620
641
  isBlankOrEmpty,
621
642
  isFieldRequired,
622
643
  isFloatNumber,
@@ -659,6 +680,7 @@ export {
659
680
  setShowAuthenticationRouterLogin,
660
681
  setSignInCallbackError,
661
682
  setStudyNetworkVisualizationParameters,
683
+ setStudyShortCircuitParameters,
662
684
  setUnauthorizedUserInfo,
663
685
  setUserValidationError,
664
686
  styles,
@@ -3,7 +3,7 @@ import { createFilter, createParameter, fetchElementsInfos, saveFilter, updatePa
3
3
  import { fetchAppsMetadata, fetchDefaultCountry, fetchEnv, fetchFavoriteAndDefaultCountries, fetchStudyMetadata, isStudyMetadata } from "./appsMetadata.js";
4
4
  import { elementAlreadyExists, fetchDirectoryContent, fetchDirectoryElementPath, fetchRootFolders } from "./directory.js";
5
5
  import { PREFIX_STUDY_QUERIES, fetchLoadFlowParameters, getDefaultLoadFlowProvider, getLoadFlowDefaultLimitReductions, getLoadFlowProviders, getLoadFlowSpecificParametersDescription, getLoadFlowUrl, setLoadFlowParameters } from "./loadflow.js";
6
- import { exportFilter, getAvailableComponentLibraries, getStudyNetworkVisualizationsParameters, setStudyNetworkVisualizationParameters } from "./study.js";
6
+ import { exportFilter, getAvailableComponentLibraries, getStudyNetworkVisualizationsParameters, getStudyShortCircuitParameters, invalidateStudyShortCircuitStatus, setStudyNetworkVisualizationParameters, setStudyShortCircuitParameters } from "./study.js";
7
7
  import { getNetworkVisualizationsParameters } from "./study-config.js";
8
8
  import { fetchCurrentAnnouncement, fetchUserDetails } from "./userAdmin.js";
9
9
  export {
@@ -37,9 +37,12 @@ export {
37
37
  getNetworkVisualizationsParameters,
38
38
  getRequestParamFromList,
39
39
  getStudyNetworkVisualizationsParameters,
40
+ getStudyShortCircuitParameters,
41
+ invalidateStudyShortCircuitStatus,
40
42
  isStudyMetadata,
41
43
  saveFilter,
42
44
  setLoadFlowParameters,
43
45
  setStudyNetworkVisualizationParameters,
46
+ setStudyShortCircuitParameters,
44
47
  updateParameter
45
48
  };
@@ -0,0 +1,2 @@
1
+ import { ShortCircuitParametersInfos } from '../components/parameters/short-circuit/short-circuit-parameters.type';
2
+ export declare function fetchShortCircuitParameters(parameterUuid: string): Promise<ShortCircuitParametersInfos>;
@@ -0,0 +1,13 @@
1
+ import { backendFetchJson } from "./utils.js";
2
+ const PREFIX_SHORT_CIRCUIT_SERVER_QUERIES = `${"api/gateway"}/shortcircuit`;
3
+ function getShortCircuitUrl() {
4
+ return `${PREFIX_SHORT_CIRCUIT_SERVER_QUERIES}/v1`;
5
+ }
6
+ function fetchShortCircuitParameters(parameterUuid) {
7
+ console.info("get short circuit analysis parameters");
8
+ const url = `${getShortCircuitUrl()}/parameters/${encodeURIComponent(parameterUuid)}`;
9
+ return backendFetchJson(url);
10
+ }
11
+ export {
12
+ fetchShortCircuitParameters
13
+ };
@@ -1,6 +1,10 @@
1
1
  import { UUID } from 'crypto';
2
2
  import { NetworkVisualizationParameters } from '../components/parameters/network-visualizations/network-visualizations.types';
3
+ import { ShortCircuitParameters, ShortCircuitParametersInfos } from '../components/parameters/short-circuit/short-circuit-parameters.type';
3
4
  export declare function exportFilter(studyUuid: UUID, filterUuid?: UUID, token?: string): Promise<any>;
4
5
  export declare function getAvailableComponentLibraries(): Promise<string[]>;
5
6
  export declare function getStudyNetworkVisualizationsParameters(studyUuid: UUID): Promise<NetworkVisualizationParameters>;
6
7
  export declare function setStudyNetworkVisualizationParameters(studyUuid: UUID, newParams: Record<string, any>): Promise<Response>;
8
+ export declare function getStudyShortCircuitParameters(studyUuid: UUID): Promise<ShortCircuitParametersInfos>;
9
+ export declare function setStudyShortCircuitParameters(studyUuid: UUID, newParams: ShortCircuitParameters): Promise<Response>;
10
+ export declare function invalidateStudyShortCircuitStatus(studyUuid: UUID): Promise<Response>;
@@ -30,9 +30,33 @@ function setStudyNetworkVisualizationParameters(studyUuid, newParams) {
30
30
  body: JSON.stringify(newParams)
31
31
  });
32
32
  }
33
+ function getStudyShortCircuitParameters(studyUuid) {
34
+ console.info("get study short-circuit parameters");
35
+ return backendFetchJson(`${PREFIX_STUDY_QUERIES}/v1/studies/${studyUuid}/short-circuit-analysis/parameters`);
36
+ }
37
+ function setStudyShortCircuitParameters(studyUuid, newParams) {
38
+ console.info("set study short-circuit parameters", newParams);
39
+ return backendFetch(`${PREFIX_STUDY_QUERIES}/v1/studies/${studyUuid}/short-circuit-analysis/parameters`, {
40
+ method: "POST",
41
+ headers: {
42
+ Accept: "application/json",
43
+ "Content-Type": "application/json"
44
+ },
45
+ body: newParams ? JSON.stringify(newParams) : null
46
+ });
47
+ }
48
+ function invalidateStudyShortCircuitStatus(studyUuid) {
49
+ console.info("invalidate study short circuit status");
50
+ return backendFetch(`${PREFIX_STUDY_QUERIES}/v1/studies/${studyUuid}/short-circuit/invalidate-status`, {
51
+ method: "PUT"
52
+ });
53
+ }
33
54
  export {
34
55
  exportFilter,
35
56
  getAvailableComponentLibraries,
36
57
  getStudyNetworkVisualizationsParameters,
37
- setStudyNetworkVisualizationParameters
58
+ getStudyShortCircuitParameters,
59
+ invalidateStudyShortCircuitStatus,
60
+ setStudyNetworkVisualizationParameters,
61
+ setStudyShortCircuitParameters
38
62
  };
@@ -57,6 +57,8 @@ export declare const networkModificationsEn: {
57
57
  'network_modifications.tabular.SUBSTATION_MODIFICATION': string;
58
58
  'network_modifications.TABULAR_CREATION': string;
59
59
  'network_modifications.tabular.GENERATOR_CREATION': string;
60
+ 'network_modifications.tabular.BATTERY_CREATION': string;
61
+ 'network_modifications.tabular.LOAD_CREATION': string;
60
62
  'network_modifications.tabular.SHUNT_COMPENSATOR_CREATION': string;
61
63
  'network_modifications.LCC_CREATION': string;
62
64
  'network_modifications.LCC_MODIFICATION': string;
@@ -51,6 +51,8 @@ const networkModificationsEn = {
51
51
  "network_modifications.tabular.SUBSTATION_MODIFICATION": "substation modifications",
52
52
  "network_modifications.TABULAR_CREATION": "Tabular creation - {computedLabel}",
53
53
  "network_modifications.tabular.GENERATOR_CREATION": "generator creations",
54
+ "network_modifications.tabular.BATTERY_CREATION": "battery creations",
55
+ "network_modifications.tabular.LOAD_CREATION": "load creations",
54
56
  "network_modifications.tabular.SHUNT_COMPENSATOR_CREATION": "linear shunt compensator creations",
55
57
  "network_modifications.LCC_CREATION": "Creating HVDC (LCC) {computedLabel}",
56
58
  "network_modifications.LCC_MODIFICATION": "Modifying HVDC (LCC) {computedLabel}",
@@ -88,4 +88,32 @@ export declare const parametersEn: {
88
88
  FlatDesign: string;
89
89
  Carto: string;
90
90
  CartoNoLabel: string;
91
+ getNetworkVisualizationsParametersError: string;
92
+ updateNetworkVisualizationsParametersError: string;
93
+ paramsChangingError: string;
94
+ paramsChangingDenied: string;
95
+ paramsRetrievingError: string;
96
+ paramsCreatingError: string;
97
+ paramsUpdateError: string;
98
+ paramsCreationMsg: string;
99
+ paramsUpdateMsg: string;
100
+ optionalServicesRetrievingError: string;
101
+ defaultSensiResultsThresholdRetrievingError: string;
102
+ fetchDefaultLimitReductionsError: string;
103
+ descWithFeederResult: string;
104
+ ShortCircuitPredefinedParameters: string;
105
+ ShortCircuitCharacteristics: string;
106
+ ShortCircuitVoltageProfileMode: string;
107
+ shortCircuitLoads: string;
108
+ shortCircuitHvdc: string;
109
+ shortCircuitShuntCompensators: string;
110
+ shortCircuitNeutralPosition: string;
111
+ shortCircuitNominalVoltage: string;
112
+ shortCircuitInitialVoltage: string;
113
+ iccMawWithNominalVoltageMapPredefinedParams: string;
114
+ iccMaxWithCEIPredefinedParams: string;
115
+ iscMinWithNominalVoltageMapPredefinedParams: string;
116
+ nominalInitialVoltageProfileMode: string;
117
+ cei909InitialVoltageProfileMode: string;
118
+ Or: string;
91
119
  };
@@ -81,7 +81,35 @@ const parametersEn = {
81
81
  Convergence: "Convergence",
82
82
  FlatDesign: "Flat_Design",
83
83
  Carto: "Carto",
84
- CartoNoLabel: "Carto without labels"
84
+ CartoNoLabel: "Carto without labels",
85
+ getNetworkVisualizationsParametersError: "An error occurred while reading the network visualizations parameters",
86
+ updateNetworkVisualizationsParametersError: "An error occurred while updating the network visualizations parameters",
87
+ paramsChangingError: "An error occurred when changing the parameters",
88
+ paramsChangingDenied: "The requested changes have been rejected",
89
+ paramsRetrievingError: "An error occurred while retrieving the parameters",
90
+ paramsCreatingError: "An error occurred while creating the parameters",
91
+ paramsUpdateError: "An error occurred while updating the parameters {item}",
92
+ paramsCreationMsg: "Parameters created in {directory}",
93
+ paramsUpdateMsg: "Parameters {item} updated",
94
+ optionalServicesRetrievingError: "An error occurred while retrieving the status of optional services",
95
+ defaultSensiResultsThresholdRetrievingError: "An error occurred while retrieving the sensitivity analysis results default threshold",
96
+ fetchDefaultLimitReductionsError: "An error occurred while fetching the default limit reductions",
97
+ descWithFeederResult: "With feeder results",
98
+ ShortCircuitPredefinedParameters: "Preset parameters",
99
+ ShortCircuitCharacteristics: "Features considered",
100
+ ShortCircuitVoltageProfileMode: "Initial voltage profile",
101
+ shortCircuitLoads: "Loads",
102
+ shortCircuitHvdc: "HVDC (VSC)",
103
+ shortCircuitShuntCompensators: "Shunt compensators",
104
+ shortCircuitNeutralPosition: "Tap position of ratio tap changers",
105
+ shortCircuitNominalVoltage: "Nominal voltage (kV)",
106
+ shortCircuitInitialVoltage: "Initial voltage (kV)",
107
+ iccMawWithNominalVoltageMapPredefinedParams: "ISC max with nominal voltage profile",
108
+ iccMaxWithCEIPredefinedParams: "ISC max with standard IEC 909",
109
+ iscMinWithNominalVoltageMapPredefinedParams: "ISC min with nominal voltage profile",
110
+ nominalInitialVoltageProfileMode: "Nominal",
111
+ cei909InitialVoltageProfileMode: "IEC 909",
112
+ Or: "or"
85
113
  };
86
114
  export {
87
115
  parametersEn
@@ -57,6 +57,8 @@ export declare const networkModificationsFr: {
57
57
  'network_modifications.tabular.SUBSTATION_MODIFICATION': string;
58
58
  'network_modifications.TABULAR_CREATION': string;
59
59
  'network_modifications.tabular.GENERATOR_CREATION': string;
60
+ 'network_modifications.tabular.BATTERY_CREATION': string;
61
+ 'network_modifications.tabular.LOAD_CREATION': string;
60
62
  'network_modifications.tabular.SHUNT_COMPENSATOR_CREATION': string;
61
63
  'network_modifications.LCC_CREATION': string;
62
64
  'network_modifications.LCC_MODIFICATION': string;
@@ -51,6 +51,8 @@ const networkModificationsFr = {
51
51
  "network_modifications.tabular.SUBSTATION_MODIFICATION": "modifications de sites",
52
52
  "network_modifications.TABULAR_CREATION": "Création tabulaire - {computedLabel}",
53
53
  "network_modifications.tabular.GENERATOR_CREATION": "créations de générateurs",
54
+ "network_modifications.tabular.BATTERY_CREATION": "créations de batteries",
55
+ "network_modifications.tabular.LOAD_CREATION": "créations de consommations",
54
56
  "network_modifications.tabular.SHUNT_COMPENSATOR_CREATION": "créations de MCS linéaires",
55
57
  "network_modifications.LCC_CREATION": "Création de la HVDC (LCC) {computedLabel}",
56
58
  "network_modifications.LCC_MODIFICATION": "Modification de la HVDC (LCC) {computedLabel}",
@@ -88,4 +88,32 @@ export declare const parametersFr: {
88
88
  FlatDesign: string;
89
89
  Carto: string;
90
90
  CartoNoLabel: string;
91
+ getNetworkVisualizationsParametersError: string;
92
+ updateNetworkVisualizationsParametersError: string;
93
+ paramsChangingError: string;
94
+ paramsChangingDenied: string;
95
+ paramsRetrievingError: string;
96
+ paramsCreatingError: string;
97
+ paramsUpdateError: string;
98
+ paramsCreationMsg: string;
99
+ paramsUpdateMsg: string;
100
+ optionalServicesRetrievingError: string;
101
+ defaultSensiResultsThresholdRetrievingError: string;
102
+ fetchDefaultLimitReductionsError: string;
103
+ descWithFeederResult: string;
104
+ ShortCircuitPredefinedParameters: string;
105
+ ShortCircuitCharacteristics: string;
106
+ ShortCircuitVoltageProfileMode: string;
107
+ shortCircuitLoads: string;
108
+ shortCircuitHvdc: string;
109
+ shortCircuitShuntCompensators: string;
110
+ shortCircuitNeutralPosition: string;
111
+ shortCircuitNominalVoltage: string;
112
+ shortCircuitInitialVoltage: string;
113
+ iccMawWithNominalVoltageMapPredefinedParams: string;
114
+ iccMaxWithCEIPredefinedParams: string;
115
+ iscMinWithNominalVoltageMapPredefinedParams: string;
116
+ nominalInitialVoltageProfileMode: string;
117
+ cei909InitialVoltageProfileMode: string;
118
+ Or: string;
91
119
  };
@@ -81,7 +81,35 @@ const parametersFr = {
81
81
  Convergence: "Convergence",
82
82
  FlatDesign: "Flat_Design",
83
83
  Carto: "Carto",
84
- CartoNoLabel: "Carto sans labels"
84
+ CartoNoLabel: "Carto sans labels",
85
+ getNetworkVisualizationsParametersError: "Une erreur est survenue lors de la récupération des paramètres des images réseau",
86
+ updateNetworkVisualizationsParametersError: "Une erreur est survenue lors de la mise a jour des paramètres des images réseau",
87
+ paramsChangingError: "Une erreur est survenue lors de la modification des paramètres",
88
+ paramsChangingDenied: "Les changements demandés ont été rejetés",
89
+ paramsRetrievingError: "Une erreur est survenue lors de la récupération des paramètres",
90
+ paramsCreatingError: "Une erreur est survenue lors de la création des paramètres",
91
+ paramsUpdateError: "Une erreur est survenue lors de la mise à jour des paramètres {item}",
92
+ paramsCreationMsg: "Création de paramètres dans {directory}",
93
+ paramsUpdateMsg: "Mise à jour des paramètres {item}",
94
+ optionalServicesRetrievingError: "Une erreur est survenue lors de la récupération de l'état des services optionnels",
95
+ defaultSensiResultsThresholdRetrievingError: "Une erreur est survenue lors de la récupération du seuil par défaut des résultats de l'analyse de sensibilité",
96
+ fetchDefaultLimitReductionsError: "Une erreur est survenue lors de la récupération des abattements par défaut",
97
+ descWithFeederResult: "Avec apports",
98
+ ShortCircuitPredefinedParameters: "Paramètres prédéfinis",
99
+ ShortCircuitCharacteristics: "Caractéristiques prises en compte",
100
+ ShortCircuitVoltageProfileMode: "Plan de tension initial",
101
+ shortCircuitLoads: "Charges",
102
+ shortCircuitHvdc: "HVDC (VSC)",
103
+ shortCircuitShuntCompensators: "MCS",
104
+ shortCircuitNeutralPosition: "Prises courantes des régleurs en charge",
105
+ shortCircuitNominalVoltage: "Tension nominale (kV)",
106
+ shortCircuitInitialVoltage: "Tension initiale (kV)",
107
+ iccMawWithNominalVoltageMapPredefinedParams: "ICC max avec plan de tension normalisé",
108
+ iccMaxWithCEIPredefinedParams: "ICC max avec norme CEI 909",
109
+ iscMinWithNominalVoltageMapPredefinedParams: "Pcc min à tension normalisée",
110
+ nominalInitialVoltageProfileMode: "Normalisé",
111
+ cei909InitialVoltageProfileMode: "CEI 909",
112
+ Or: "ou"
85
113
  };
86
114
  export {
87
115
  parametersFr
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gridsuite/commons-ui",
3
- "version": "0.106.0",
3
+ "version": "0.107.0",
4
4
  "description": "common react components for gridsuite applications",
5
5
  "author": "gridsuite team",
6
6
  "homepage": "https://github.com/gridsuite",