@gridsuite/commons-ui 0.171.0 → 0.172.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 (38) hide show
  1. package/dist/components/index.js +6 -1
  2. package/dist/components/parameters/common/contingency-table/contingency-table.d.ts +4 -2
  3. package/dist/components/parameters/common/contingency-table/contingency-table.js +22 -11
  4. package/dist/components/parameters/common/contingency-table/types.d.ts +4 -0
  5. package/dist/components/parameters/common/parameters.js +1 -1
  6. package/dist/components/parameters/index.js +6 -1
  7. package/dist/components/parameters/security-analysis/security-analysis-parameters-form.d.ts +4 -2
  8. package/dist/components/parameters/security-analysis/security-analysis-parameters-form.js +4 -2
  9. package/dist/components/parameters/security-analysis/security-analysis-parameters-inline.d.ts +4 -2
  10. package/dist/components/parameters/security-analysis/security-analysis-parameters-inline.js +3 -1
  11. package/dist/components/parameters/short-circuit/constants.d.ts +5 -0
  12. package/dist/components/parameters/short-circuit/constants.js +10 -0
  13. package/dist/components/parameters/short-circuit/index.js +6 -1
  14. package/dist/components/parameters/short-circuit/short-circuit-general-tab-panel.d.ts +10 -0
  15. package/dist/components/parameters/short-circuit/short-circuit-general-tab-panel.js +206 -0
  16. package/dist/components/parameters/short-circuit/short-circuit-parameters-content.d.ts +7 -0
  17. package/dist/components/parameters/short-circuit/short-circuit-parameters-content.js +108 -0
  18. package/dist/components/parameters/short-circuit/short-circuit-parameters-dialog.js +1 -0
  19. package/dist/components/parameters/short-circuit/short-circuit-parameters-form.js +33 -30
  20. package/dist/components/parameters/short-circuit/short-circuit-parameters-utils.d.ts +5 -0
  21. package/dist/components/parameters/short-circuit/short-circuit-parameters-utils.js +72 -25
  22. package/dist/components/parameters/short-circuit/short-circuit-power-electronics-tab-panel.d.ts +2 -0
  23. package/dist/components/parameters/short-circuit/short-circuit-power-electronics-tab-panel.js +95 -0
  24. package/dist/components/parameters/short-circuit/short-circuit-study-area-tab-panel.d.ts +2 -0
  25. package/dist/components/parameters/short-circuit/short-circuit-study-area-tab-panel.js +143 -0
  26. package/dist/components/parameters/short-circuit/use-short-circuit-parameters-form.d.ts +5 -0
  27. package/dist/components/parameters/short-circuit/use-short-circuit-parameters-form.js +28 -8
  28. package/dist/index.js +6 -1
  29. package/dist/services/directory.js +1 -1
  30. package/dist/services/explore.js +1 -1
  31. package/dist/translations/en/parameters.d.ts +10 -1
  32. package/dist/translations/en/parameters.js +10 -1
  33. package/dist/translations/fr/parameters.d.ts +10 -1
  34. package/dist/translations/fr/parameters.js +10 -1
  35. package/dist/utils/constants/adornments.js +1 -1
  36. package/package.json +1 -1
  37. package/dist/components/parameters/short-circuit/short-circuit-fields.d.ts +0 -10
  38. package/dist/components/parameters/short-circuit/short-circuit-fields.js +0 -276
@@ -1,6 +1,6 @@
1
1
  import { useForm } from "react-hook-form";
2
2
  import { yupResolver } from "@hookform/resolvers/yup";
3
- import { useState, useMemo, useCallback, useEffect } from "react";
3
+ import { useState, useCallback, useMemo, useEffect } from "react";
4
4
  import "../../../utils/yupConfig.js";
5
5
  import "react/jsx-runtime";
6
6
  import "react-intl";
@@ -37,14 +37,14 @@ import "../../inputs/reactQueryBuilder/CustomReactQueryBuilder.js";
37
37
  import "uuid";
38
38
  import "../../inputs/reactQueryBuilder/PropertyValueEditor.js";
39
39
  import "react-querybuilder";
40
- import { SHORT_CIRCUIT_PREDEFINED_PARAMS, PredefinedParameters, SHORT_CIRCUIT_WITH_LOADS, SHORT_CIRCUIT_WITH_VSC_CONVERTER_STATIONS, SHORT_CIRCUIT_WITH_SHUNT_COMPENSATORS, SHORT_CIRCUIT_WITH_NEUTRAL_POSITION, SHORT_CIRCUIT_INITIAL_VOLTAGE_PROFILE_MODE, InitialVoltage, SHORT_CIRCUIT_ONLY_STARTED_GENERATORS_IN_CALCULATION_CLUSTER, SHORT_CIRCUIT_VOLTAGE_RANGES } from "./constants.js";
40
+ import { SHORT_CIRCUIT_PREDEFINED_PARAMS, PredefinedParameters, SHORT_CIRCUIT_WITH_LOADS, SHORT_CIRCUIT_WITH_VSC_CONVERTER_STATIONS, SHORT_CIRCUIT_WITH_SHUNT_COMPENSATORS, SHORT_CIRCUIT_WITH_NEUTRAL_POSITION, SHORT_CIRCUIT_INITIAL_VOLTAGE_PROFILE_MODE, InitialVoltage, SHORT_CIRCUIT_ONLY_STARTED_GENERATORS_IN_CALCULATION_CLUSTER, SHORT_CIRCUIT_VOLTAGE_RANGES, SHORT_CIRCUIT_POWER_ELECTRONICS_MATERIALS, SHORT_CIRCUIT_POWER_ELECTRONICS_CLUSTERS, SHORT_CIRCUIT_ONLY_STARTED_GENERATORS_OUTSIDE_CALCULATION_CLUSTER, NODE_CLUSTER_FILTER_IDS } from "./constants.js";
41
41
  import "../../filter/HeaderFilterForm.js";
42
42
  import { getNameElementEditorSchema, getNameElementEditorEmptyFormData } from "../common/name-element-editor/name-element-editor-utils.js";
43
43
  import { SPECIFIC_PARAMETERS, COMMON_PARAMETERS, VERSION_PARAMETER, PROVIDER } from "../common/constants.js";
44
44
  import "../../dialogs/elementSaveDialog/ElementSaveDialog.js";
45
45
  import "../common/widget/parameter-line-slider.js";
46
46
  import "../common/limitreductions/columns-definitions.js";
47
- import { getDefaultShortCircuitSpecificParamsValues, getSpecificShortCircuitParametersFormSchema, getCommonShortCircuitParametersFormSchema, getShortCircuitSpecificParametersValues, formatShortCircuitSpecificParameters } from "./short-circuit-parameters-utils.js";
47
+ import { ShortCircuitParametersTabValues, getDefaultShortCircuitSpecificParamsValues, getSpecificShortCircuitParametersFormSchema, getCommonShortCircuitParametersFormSchema, getShortCircuitSpecificParametersValues, formatShortCircuitSpecificParameters } from "./short-circuit-parameters-utils.js";
48
48
  const useShortCircuitParametersForm = ({
49
49
  parametersBackend,
50
50
  parametersUuid,
@@ -53,8 +53,15 @@ const useShortCircuitParametersForm = ({
53
53
  }) => {
54
54
  const { params, updateParameters, specificParamsDescription } = parametersBackend;
55
55
  const provider = params?.provider;
56
+ const [selectedTab, setSelectedTab] = useState(
57
+ ShortCircuitParametersTabValues.GENERAL
58
+ );
59
+ const [tabIndexesWithError, setTabIndexesWithError] = useState([]);
56
60
  const [paramsLoaded, setParamsLoaded] = useState(false);
57
61
  const { snackError } = useSnackMessage();
62
+ const handleTabChange = useCallback((event, newValue) => {
63
+ setSelectedTab(newValue);
64
+ }, []);
58
65
  const specificParametersDescriptionForProvider = useMemo(() => {
59
66
  return provider && specificParamsDescription?.[provider] ? specificParamsDescription[provider] : [];
60
67
  }, [provider, specificParamsDescription]);
@@ -145,7 +152,7 @@ const useShortCircuitParametersForm = ({
145
152
  return {};
146
153
  }
147
154
  const specificParamsListForCurrentProvider = _params.specificParametersPerProvider[provider];
148
- const values = {
155
+ return {
149
156
  [PROVIDER]: _params.provider,
150
157
  [SHORT_CIRCUIT_PREDEFINED_PARAMS]: _params.predefinedParameters,
151
158
  [COMMON_PARAMETERS]: {
@@ -162,13 +169,23 @@ const useShortCircuitParametersForm = ({
162
169
  )
163
170
  }
164
171
  };
165
- return values;
166
172
  },
167
173
  [provider, snackError, specificParametersDescriptionForProvider]
168
174
  );
169
- const onValidationError = useCallback((_errors) => {
170
- console.error("onValidationError: ", _errors);
171
- }, []);
175
+ const onValidationError = useCallback(
176
+ (_errors) => {
177
+ console.error("onValidationError: ", _errors);
178
+ const tabsInError = [];
179
+ if ((_errors?.[SHORT_CIRCUIT_POWER_ELECTRONICS_MATERIALS] || _errors?.[SHORT_CIRCUIT_POWER_ELECTRONICS_CLUSTERS]) && ShortCircuitParametersTabValues.POWER_ELECTRONICS !== selectedTab) {
180
+ tabsInError.push(ShortCircuitParametersTabValues.POWER_ELECTRONICS);
181
+ }
182
+ if ((_errors?.[SHORT_CIRCUIT_ONLY_STARTED_GENERATORS_IN_CALCULATION_CLUSTER] || _errors?.[SHORT_CIRCUIT_ONLY_STARTED_GENERATORS_OUTSIDE_CALCULATION_CLUSTER] || _errors?.[NODE_CLUSTER_FILTER_IDS]) && ShortCircuitParametersTabValues.STUDY_AREA !== selectedTab) {
183
+ tabsInError.push(ShortCircuitParametersTabValues.STUDY_AREA);
184
+ }
185
+ setTabIndexesWithError(tabsInError);
186
+ },
187
+ [selectedTab]
188
+ );
172
189
  const onSaveInline = useCallback(
173
190
  (formData) => {
174
191
  const data = formatNewParams(formData);
@@ -202,6 +219,9 @@ const useShortCircuitParametersForm = ({
202
219
  return {
203
220
  formMethods,
204
221
  formSchema,
222
+ selectedTab,
223
+ handleTabChange,
224
+ tabIndexesWithError,
205
225
  specificParametersDescriptionForProvider,
206
226
  toShortCircuitFormValues,
207
227
  formatNewParams,
package/dist/index.js CHANGED
@@ -161,7 +161,7 @@ import { NetworkVisualizationsParametersEditionDialog } from "./components/param
161
161
  import { BALANCE_TYPE, CONNECTED_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, TWT_SPLIT_SHUNT_ADMITTANCE, USE_REACTIVE_LIMITS, VOLTAGE_INIT_MODE, WRITE_SLACK_BUS, alertThresholdMarks } from "./components/parameters/loadflow/constants.js";
162
162
  import { LoadFlowParametersInline } from "./components/parameters/loadflow/load-flow-parameters-inline.js";
163
163
  import { LoadFlowParametersEditionDialog } from "./components/parameters/loadflow/load-flow-parameters-dialog.js";
164
- import { InitialVoltage, PredefinedParameters, SHORT_CIRCUIT_INITIAL_VOLTAGE_PROFILE_MODE, SHORT_CIRCUIT_MODEL_POWER_ELECTRONICS, SHORT_CIRCUIT_ONLY_STARTED_GENERATORS_IN_CALCULATION_CLUSTER, SHORT_CIRCUIT_POWER_ELECTRONICS_CLUSTERS, SHORT_CIRCUIT_POWER_ELECTRONICS_MATERIALS, SHORT_CIRCUIT_PREDEFINED_PARAMS, SHORT_CIRCUIT_VOLTAGE_RANGES, 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, onlyStartedGeneratorsOptions } from "./components/parameters/short-circuit/constants.js";
164
+ import { InitialVoltage, NODE_CLUSTER, NODE_CLUSTER_FILTER_IDS, PredefinedParameters, SHORT_CIRCUIT_INITIAL_VOLTAGE_PROFILE_MODE, SHORT_CIRCUIT_MODEL_POWER_ELECTRONICS, SHORT_CIRCUIT_ONLY_STARTED_GENERATORS_IN_CALCULATION_CLUSTER, SHORT_CIRCUIT_ONLY_STARTED_GENERATORS_OUTSIDE_CALCULATION_CLUSTER, SHORT_CIRCUIT_POWER_ELECTRONICS_CLUSTERS, SHORT_CIRCUIT_POWER_ELECTRONICS_MATERIALS, SHORT_CIRCUIT_PREDEFINED_PARAMS, SHORT_CIRCUIT_VOLTAGE_RANGES, 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, STARTED_GENERATORS_IN_CALCULATION_CLUSTER_THRESHOLD, STARTED_GENERATORS_OUTSIDE_CALCULATION_CLUSTER_THRESHOLD, intlInitialVoltageProfileMode, intlPredefinedParametersOptions, onlyStartedGeneratorsOptions } from "./components/parameters/short-circuit/constants.js";
165
165
  import { ShortCircuitParametersInLine } from "./components/parameters/short-circuit/short-circuit-parameters-inline.js";
166
166
  import { ShortCircuitParametersEditionDialog } from "./components/parameters/short-circuit/short-circuit-parameters-dialog.js";
167
167
  import { DEFAULT_GENERAL_APPLY_MODIFICATIONS, DEFAULT_REACTIVE_SLACKS_THRESHOLD, DEFAULT_SHUNT_COMPENSATOR_ACTIVATION_THRESHOLD, DEFAULT_UPDATE_BUS_VOLTAGE, GENERAL, GENERAL_APPLY_MODIFICATIONS, GENERATORS_SELECTION_TYPE, HIGH_VOLTAGE_LIMIT, LEG_SIDE, LOW_VOLTAGE_LIMIT, PRIORITY, RATIO_TAP_CHANGER_POSITION, RATIO_TAP_CHANGER_TARGET_V, REACTIVE_SLACKS_THRESHOLD, SELECTION_TYPE, SHUNT_COMPENSATORS_SELECTION_TYPE, SHUNT_COMPENSATOR_ACTIVATION_THRESHOLD, TRANSFORMERS_SELECTION_TYPE, UPDATE_BUS_VOLTAGE, VARIABLE_Q_GENERATORS, VARIABLE_SHUNT_COMPENSATORS, VARIABLE_TRANSFORMERS, VOLTAGE_LIMITS_DEFAULT, VOLTAGE_LIMITS_MODIFICATION, VoltageInitTabValues } from "./components/parameters/voltage-init/constants.js";
@@ -556,6 +556,8 @@ export {
556
556
  NAD_POSITIONS_GENERATION_MODE,
557
557
  NAD_POSITIONS_GENERATION_MODE_LABEL,
558
558
  NAME,
559
+ NODE_CLUSTER,
560
+ NODE_CLUSTER_FILTER_IDS,
559
561
  NO_ITEM_SELECTION_FOR_COPY,
560
562
  NadPositionsGenerationMode,
561
563
  NetworkModificationNameCellRenderer,
@@ -651,6 +653,7 @@ export {
651
653
  SHORT_CIRCUIT_INITIAL_VOLTAGE_PROFILE_MODE,
652
654
  SHORT_CIRCUIT_MODEL_POWER_ELECTRONICS,
653
655
  SHORT_CIRCUIT_ONLY_STARTED_GENERATORS_IN_CALCULATION_CLUSTER,
656
+ SHORT_CIRCUIT_ONLY_STARTED_GENERATORS_OUTSIDE_CALCULATION_CLUSTER,
654
657
  SHORT_CIRCUIT_POWER_ELECTRONICS_CLUSTERS,
655
658
  SHORT_CIRCUIT_POWER_ELECTRONICS_MATERIALS,
656
659
  SHORT_CIRCUIT_PREDEFINED_PARAMS,
@@ -668,6 +671,8 @@ export {
668
671
  SIEMENS,
669
672
  SIGNIN_CALLBACK_ERROR,
670
673
  SPECIFIC_PARAMETERS,
674
+ STARTED_GENERATORS_IN_CALCULATION_CLUSTER_THRESHOLD,
675
+ STARTED_GENERATORS_OUTSIDE_CALCULATION_CLUSTER_THRESHOLD,
671
676
  START_TIME,
672
677
  STOP_TIME,
673
678
  SUBSTATION_LAYOUT,
@@ -1,4 +1,4 @@
1
- import { getRequestParamFromList, backendFetchJson, backendFetch } from "./utils.js";
1
+ import { backendFetchJson, getRequestParamFromList, backendFetch } from "./utils.js";
2
2
  const PREFIX_EXPLORE_SERVER_QUERIES = `${"api/gateway"}/explore`;
3
3
  function fetchRootFolders(types) {
4
4
  console.info("Fetching Root Directories");
@@ -1,4 +1,4 @@
1
- import { backendFetch, getRequestParamFromList, backendFetchJson } from "./utils.js";
1
+ import { getRequestParamFromList, backendFetchJson, backendFetch } from "./utils.js";
2
2
  const PREFIX_EXPLORE_SERVER_QUERIES = `${"api/gateway"}/explore`;
3
3
  function createFilter(newFilter, name, description, parentDirectoryUuid, token) {
4
4
  const urlSearchParams = new URLSearchParams();
@@ -53,6 +53,8 @@ export declare const parametersEn: {
53
53
  RealPercentage: string;
54
54
  General: string;
55
55
  LimitReductions: string;
56
+ StudyArea: string;
57
+ PowerElectronics: string;
56
58
  IST: string;
57
59
  LimitVoltageInterval: string;
58
60
  LimitVoltageAfterIST: string;
@@ -112,6 +114,11 @@ export declare const parametersEn: {
112
114
  ShortCircuitCharacteristics: string;
113
115
  ShortCircuitVoltageProfileMode: string;
114
116
  ShortCircuitStartedGeneratorsMode: string;
117
+ ShortCircuitInClusterFilter: string;
118
+ ShortCircuitInCluster: string;
119
+ ShortCircuitOutCluster: string;
120
+ startedGeneratorsInCalculationClusterThreshold: string;
121
+ startedGeneratorsOutsideCalculationClusterThreshold: string;
115
122
  ShortCircuitPowerElectronicsSection: string;
116
123
  ShortCircuitModelPowerElectronics: string;
117
124
  ShortCircuitIccActive: string;
@@ -197,7 +204,9 @@ export declare const parametersEn: {
197
204
  AddContingencyList: string;
198
205
  DeleteContingencyList: string;
199
206
  getContingencyListError: string;
200
- xContingenciesWillBeSimulated: string;
207
+ xContingenciesWillBeSimulatedAndYNotFound: string;
208
+ contingencyCountImpossibleOnUnbuiltNode: string;
209
+ noContingency: string;
201
210
  resultsThreshold: string;
202
211
  SensitivityBranches: string;
203
212
  SensitivityInjectionsSet: string;
@@ -47,6 +47,8 @@ const parametersEn = {
47
47
  RealPercentage: "This value must be between 0 and 1",
48
48
  General: "General",
49
49
  LimitReductions: "Limit reductions",
50
+ StudyArea: "Study area",
51
+ PowerElectronics: "Power electronics",
50
52
  IST: "PATL",
51
53
  LimitVoltageInterval: "Between TATL{lowBound} and TATL{highBound}",
52
54
  LimitVoltageAfterIST: "Between PATL and TATL{highBound}",
@@ -106,6 +108,11 @@ const parametersEn = {
106
108
  ShortCircuitCharacteristics: "Features considered",
107
109
  ShortCircuitVoltageProfileMode: "Initial voltage profile",
108
110
  ShortCircuitStartedGeneratorsMode: "Generators started",
111
+ ShortCircuitInClusterFilter: "In cluster filters",
112
+ ShortCircuitInCluster: "In cluster",
113
+ ShortCircuitOutCluster: "Out cluster",
114
+ startedGeneratorsInCalculationClusterThreshold: "Threshold",
115
+ startedGeneratorsOutsideCalculationClusterThreshold: "Threshold",
109
116
  ShortCircuitPowerElectronicsSection: "Modeling of power electronics connected equipment",
110
117
  ShortCircuitModelPowerElectronics: "Consider following Icc characteristics",
111
118
  ShortCircuitIccActive: "Activate",
@@ -191,7 +198,9 @@ const parametersEn = {
191
198
  AddContingencyList: "Add",
192
199
  DeleteContingencyList: "Delete",
193
200
  getContingencyListError: "Can't fetch contingencies lists",
194
- xContingenciesWillBeSimulated: "{x} contingencies to be simulated",
201
+ xContingenciesWillBeSimulatedAndYNotFound: "{x, plural, =0 {no contingency} =1 {1 contingency} other {{x} contingencies}} to be simulated {y, plural, =0 {} other {and {y} not found}}",
202
+ contingencyCountImpossibleOnUnbuiltNode: "Can't estimate contingencies on an unbuilt node",
203
+ noContingency: "No contingency",
195
204
  resultsThreshold: "Minimum sensitivity threshold",
196
205
  SensitivityBranches: "Branches",
197
206
  SensitivityInjectionsSet: "Relatively to injections set :",
@@ -53,6 +53,8 @@ export declare const parametersFr: {
53
53
  RealPercentage: string;
54
54
  General: string;
55
55
  LimitReductions: string;
56
+ StudyArea: string;
57
+ PowerElectronics: string;
56
58
  IST: string;
57
59
  LimitVoltageInterval: string;
58
60
  LimitVoltageAfterIST: string;
@@ -112,6 +114,11 @@ export declare const parametersFr: {
112
114
  ShortCircuitCharacteristics: string;
113
115
  ShortCircuitVoltageProfileMode: string;
114
116
  ShortCircuitStartedGeneratorsMode: string;
117
+ ShortCircuitInClusterFilter: string;
118
+ ShortCircuitInCluster: string;
119
+ ShortCircuitOutCluster: string;
120
+ startedGeneratorsInCalculationClusterThreshold: string;
121
+ startedGeneratorsOutsideCalculationClusterThreshold: string;
115
122
  ShortCircuitPowerElectronicsSection: string;
116
123
  ShortCircuitModelPowerElectronics: string;
117
124
  ShortCircuitIccActive: string;
@@ -198,7 +205,9 @@ export declare const parametersFr: {
198
205
  AddContingencyList: string;
199
206
  DeleteContingencyList: string;
200
207
  getContingencyListError: string;
201
- xContingenciesWillBeSimulated: string;
208
+ xContingenciesWillBeSimulatedAndYNotFound: string;
209
+ contingencyCountImpossibleOnUnbuiltNode: string;
210
+ noContingency: string;
202
211
  resultsThreshold: string;
203
212
  SensitivityBranches: string;
204
213
  SensitivityInjectionsSet: string;
@@ -47,6 +47,8 @@ const parametersFr = {
47
47
  RealPercentage: "Cette valeur doit être comprise entre 0 et 1",
48
48
  General: "Général",
49
49
  LimitReductions: "Abattements",
50
+ StudyArea: "Zone d'étude",
51
+ PowerElectronics: "Electronique de puissance",
50
52
  IST: "IST",
51
53
  LimitVoltageInterval: "Entre IT{lowBound} et IT{highBound}",
52
54
  LimitVoltageAfterIST: "Entre IST et IT{highBound}",
@@ -106,6 +108,11 @@ const parametersFr = {
106
108
  ShortCircuitCharacteristics: "Caractéristiques prises en compte",
107
109
  ShortCircuitVoltageProfileMode: "Plan de tension initial",
108
110
  ShortCircuitStartedGeneratorsMode: "Démarrage des groupes",
111
+ ShortCircuitInClusterFilter: "Regroupements de la zone intérieure",
112
+ ShortCircuitInCluster: "Zone intérieure",
113
+ ShortCircuitOutCluster: "Zone extérieure",
114
+ startedGeneratorsInCalculationClusterThreshold: "Seuil",
115
+ startedGeneratorsOutsideCalculationClusterThreshold: "Seuil",
109
116
  ShortCircuitPowerElectronicsSection: "Modélisation des équipements raccordés par de l'électronique de puissance",
110
117
  ShortCircuitModelPowerElectronics: "Prise en compte des caractéristiques d'Icc suivantes",
111
118
  ShortCircuitIccActive: "Actif",
@@ -192,7 +199,9 @@ const parametersFr = {
192
199
  AddContingencyList: "Ajouter",
193
200
  DeleteContingencyList: "Supprimer",
194
201
  getContingencyListError: "Impossible de récupérer les listes d'aléas",
195
- xContingenciesWillBeSimulated: "{x} défauts à simuler",
202
+ xContingenciesWillBeSimulatedAndYNotFound: "{x, plural, =0 {aucun défaut} =1 {1 défaut} other {{x} défauts}} à simuler {y, plural, =0 {} =1 {et 1 non trouvé} other {et {y} non trouvés}}",
203
+ contingencyCountImpossibleOnUnbuiltNode: "Impossible d'estimer le nombre d'aléas sur un noeud non réalisé",
204
+ noContingency: "Aucun défaut",
196
205
  resultsThreshold: "Seuil minimal de sensibilité",
197
206
  SensitivityBranches: "Quadripôles",
198
207
  SensitivityInjectionsSet: "Par rapport à un ensemble d'injections :",
@@ -1,4 +1,4 @@
1
- import { MICRO_SIEMENS, SIEMENS, OHM, AMPERE, KILO_AMPERE, MEGA_WATT, MEGA_VAR, MEGA_VOLT_AMPERE, KILO_VOLT, KILO_METER, PERCENTAGE } from "./unitsConstants.js";
1
+ import { MEGA_WATT, MICRO_SIEMENS, SIEMENS, OHM, AMPERE, KILO_AMPERE, MEGA_VAR, MEGA_VOLT_AMPERE, KILO_VOLT, KILO_METER, PERCENTAGE } from "./unitsConstants.js";
2
2
  const MicroSusceptanceAdornment = {
3
3
  position: "end",
4
4
  text: MICRO_SIEMENS
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gridsuite/commons-ui",
3
- "version": "0.171.0",
3
+ "version": "0.172.0",
4
4
  "description": "common react components for gridsuite applications",
5
5
  "author": "gridsuite team",
6
6
  "homepage": "https://github.com/gridsuite",
@@ -1,10 +0,0 @@
1
- import { PredefinedParameters } from './constants';
2
- export interface ShortCircuitFieldsProps {
3
- resetAll: (predefinedParams: PredefinedParameters) => void;
4
- isDeveloperMode: boolean;
5
- }
6
- export declare enum Status {
7
- SUCCESS = "SUCCESS",
8
- ERROR = "ERROR"
9
- }
10
- export declare function ShortCircuitFields({ resetAll, isDeveloperMode }: Readonly<ShortCircuitFieldsProps>): import("react/jsx-runtime").JSX.Element;
@@ -1,276 +0,0 @@
1
- import { jsx, jsxs, Fragment } from "react/jsx-runtime";
2
- import { useState, useMemo, useEffect } from "react";
3
- import { Grid } from "@mui/material";
4
- import { green, red } from "@mui/material/colors";
5
- import { Lens } from "@mui/icons-material";
6
- import { useWatch, useFormContext } from "react-hook-form";
7
- import { FormattedMessage } from "react-intl";
8
- import { SHORT_CIRCUIT_INITIAL_VOLTAGE_PROFILE_MODE, SHORT_CIRCUIT_PREDEFINED_PARAMS, SHORT_CIRCUIT_WITH_LOADS, SHORT_CIRCUIT_WITH_SHUNT_COMPENSATORS, SHORT_CIRCUIT_WITH_VSC_CONVERTER_STATIONS, SHORT_CIRCUIT_WITH_NEUTRAL_POSITION, SHORT_CIRCUIT_ONLY_STARTED_GENERATORS_IN_CALCULATION_CLUSTER, intlPredefinedParametersOptions, intlInitialVoltageProfileMode, onlyStartedGeneratorsOptions, PredefinedParameters, InitialVoltage, SHORT_CIRCUIT_POWER_ELECTRONICS_MATERIALS, SHORT_CIRCUIT_POWER_ELECTRONICS_CLUSTERS, SHORT_CIRCUIT_WITH_FEEDER_RESULT, SHORT_CIRCUIT_MODEL_POWER_ELECTRONICS } from "./constants.js";
9
- import { VoltageTable } from "./short-circuit-voltage-table.js";
10
- import GridItem from "../../grid/grid-item.js";
11
- import GridSection from "../../grid/grid-section.js";
12
- import { FieldLabel } from "../../inputs/reactHookForm/utils/FieldLabel.js";
13
- import "../../overflowableText/OverflowableText.js";
14
- import "../../../utils/conversionUtils.js";
15
- import "../../../utils/types/equipmentType.js";
16
- import "../../../utils/yupConfig.js";
17
- import "localized-countries";
18
- import "localized-countries/data/fr";
19
- import "localized-countries/data/en";
20
- import "notistack";
21
- import "../../inputs/reactHookForm/provider/CustomFormProvider.js";
22
- import "yup";
23
- import "../../treeViewFinder/TreeViewFinder.js";
24
- import "../../inputs/reactHookForm/agGridTable/BottomRightButtons.js";
25
- import "../../customAGGrid/customAggrid.js";
26
- import "ag-grid-community";
27
- import "react-papaparse";
28
- import "react-csv-downloader";
29
- import { CheckboxInput } from "../../inputs/reactHookForm/booleans/CheckboxInput.js";
30
- import { RadioInput } from "../../inputs/reactHookForm/booleans/RadioInput.js";
31
- import { SwitchInput } from "../../inputs/reactHookForm/booleans/SwitchInput.js";
32
- import "../../inputs/reactHookForm/numbers/RangeInput.js";
33
- import { MuiSelectInput } from "../../inputs/reactHookForm/selectInputs/MuiSelectInput.js";
34
- import "@material-symbols/svg-400/outlined/left_panel_open.svg?react";
35
- import "@material-symbols/svg-400/outlined/arrows_output.svg?react";
36
- import "@material-symbols/svg-400/outlined/left_panel_close.svg?react";
37
- import "@material-symbols/svg-400/outlined/add_notes.svg?react";
38
- import "../../dialogs/descriptionModificationDialog/DescriptionModificationDialog.js";
39
- import "@react-querybuilder/material";
40
- import "../../filter/expert/expertFilterConstants.js";
41
- import "../../inputs/reactQueryBuilder/CustomReactQueryBuilder.js";
42
- import "uuid";
43
- import "../../inputs/reactQueryBuilder/PropertyValueEditor.js";
44
- import "react-querybuilder";
45
- import { COMMON_PARAMETERS, SPECIFIC_PARAMETERS } from "../common/constants.js";
46
- import "../../dialogs/elementSaveDialog/ElementSaveDialog.js";
47
- import "../common/widget/parameter-line-slider.js";
48
- import "../common/limitreductions/columns-definitions.js";
49
- import { ShortCircuitIccMaterialTable } from "./short-circuit-icc-material-table.js";
50
- import { COLUMNS_DEFINITIONS_ICC_MATERIALS, COLUMNS_DEFINITIONS_ICC_CLUSTERS } from "./columns-definition.js";
51
- import { ShortCircuitIccClusterTable } from "./short-circuit-icc-cluster-table.js";
52
- var Status = /* @__PURE__ */ ((Status2) => {
53
- Status2["SUCCESS"] = "SUCCESS";
54
- Status2["ERROR"] = "ERROR";
55
- return Status2;
56
- })(Status || {});
57
- const iccMaterialsColumnsDef = COLUMNS_DEFINITIONS_ICC_MATERIALS.map((col) => ({
58
- ...col,
59
- label: /* @__PURE__ */ jsx(FormattedMessage, { id: col.label }),
60
- tooltip: /* @__PURE__ */ jsx(FormattedMessage, { id: col.tooltip })
61
- }));
62
- const iccClustersColumnsDef = COLUMNS_DEFINITIONS_ICC_CLUSTERS.map((col) => ({
63
- ...col,
64
- label: /* @__PURE__ */ jsx(FormattedMessage, { id: col.label }),
65
- tooltip: /* @__PURE__ */ jsx(FormattedMessage, { id: col.tooltip })
66
- }));
67
- function createRows() {
68
- const rowData = {};
69
- iccClustersColumnsDef.forEach((column) => {
70
- rowData[column.dataKey] = column.initialValue;
71
- });
72
- return rowData;
73
- }
74
- function ShortCircuitFields({ resetAll, isDeveloperMode = true }) {
75
- const [status, setStatus] = useState(
76
- "SUCCESS"
77
- /* SUCCESS */
78
- );
79
- const watchInitialVoltageProfileMode = useWatch({
80
- name: `${COMMON_PARAMETERS}.${SHORT_CIRCUIT_INITIAL_VOLTAGE_PROFILE_MODE}`
81
- });
82
- const watchPredefinedParams = useWatch({
83
- name: SHORT_CIRCUIT_PREDEFINED_PARAMS
84
- });
85
- const watchLoads = useWatch({
86
- name: `${COMMON_PARAMETERS}.${SHORT_CIRCUIT_WITH_LOADS}`
87
- });
88
- const watchShuntCompensators = useWatch({
89
- name: `${COMMON_PARAMETERS}.${SHORT_CIRCUIT_WITH_SHUNT_COMPENSATORS}`
90
- });
91
- const watchVSC = useWatch({
92
- name: `${COMMON_PARAMETERS}.${SHORT_CIRCUIT_WITH_VSC_CONVERTER_STATIONS}`
93
- });
94
- const watchNeutralPosition = useWatch({
95
- name: `${COMMON_PARAMETERS}.${SHORT_CIRCUIT_WITH_NEUTRAL_POSITION}`
96
- });
97
- const watchSpecificParameters = useWatch({
98
- name: `${SPECIFIC_PARAMETERS}`
99
- });
100
- const isThereSpecificParameters = useMemo(
101
- () => Object.keys(watchSpecificParameters).length > 0 && watchSpecificParameters.constructor === Object,
102
- [watchSpecificParameters]
103
- );
104
- const watchOnlyStartedGeneratorsInCalculationCluster = useWatch({
105
- name: `${SPECIFIC_PARAMETERS}.${SHORT_CIRCUIT_ONLY_STARTED_GENERATORS_IN_CALCULATION_CLUSTER}`
106
- });
107
- const isIccMinFeaturesDefaultConfiguration = useMemo(() => {
108
- return !watchLoads && !watchShuntCompensators && !watchVSC && !watchNeutralPosition && // if watchOnlyStartedGeneratorsInCalculationCluster is undefined, we consider IccMinFeaturesDefaultConfiguration as true
109
- (watchOnlyStartedGeneratorsInCalculationCluster ?? true);
110
- }, [
111
- watchLoads,
112
- watchShuntCompensators,
113
- watchVSC,
114
- watchNeutralPosition,
115
- watchOnlyStartedGeneratorsInCalculationCluster
116
- ]);
117
- const isIccMaxFeaturesDefaultConfiguration = useMemo(() => {
118
- return !watchLoads && !watchShuntCompensators && watchVSC && !watchNeutralPosition && // if watchOnlyStartedGeneratorsInCalculationCluster is undefined, we consider IccMaxFeaturesDefaultConfiguration as true
119
- !(watchOnlyStartedGeneratorsInCalculationCluster ?? false);
120
- }, [
121
- watchLoads,
122
- watchShuntCompensators,
123
- watchVSC,
124
- watchNeutralPosition,
125
- watchOnlyStartedGeneratorsInCalculationCluster
126
- ]);
127
- const predefinedParamsOptions = useMemo(() => {
128
- return intlPredefinedParametersOptions();
129
- }, []);
130
- const initialVoltageProfileMode = useMemo(() => {
131
- return intlInitialVoltageProfileMode();
132
- }, []);
133
- const statusColor = useMemo(
134
- () => ({ color: status === "SUCCESS" ? green[500] : red[500] }),
135
- [status]
136
- );
137
- const statusToShow = /* @__PURE__ */ jsx(Lens, { fontSize: "medium", sx: statusColor });
138
- const onPredefinedParametersManualChange = (event) => {
139
- const newPredefinedParameters = event.target.value;
140
- console.debug("onPredefinedParametersManualChange new:", newPredefinedParameters);
141
- resetAll(newPredefinedParameters);
142
- };
143
- const { setValue } = useFormContext();
144
- const feederResult = /* @__PURE__ */ jsxs(Grid, { container: true, alignItems: "center", spacing: 2, direction: "row", children: [
145
- /* @__PURE__ */ jsx(Grid, { item: true, xs: 10, children: /* @__PURE__ */ jsx(FieldLabel, { label: "descWithFeederResult" }) }),
146
- /* @__PURE__ */ jsx(Grid, { item: true, xs: 2, children: /* @__PURE__ */ jsx(SwitchInput, { name: `${COMMON_PARAMETERS}.${SHORT_CIRCUIT_WITH_FEEDER_RESULT}` }) })
147
- ] });
148
- const predefinedParameters = /* @__PURE__ */ jsx(
149
- MuiSelectInput,
150
- {
151
- name: SHORT_CIRCUIT_PREDEFINED_PARAMS,
152
- options: predefinedParamsOptions,
153
- onChange: onPredefinedParametersManualChange,
154
- fullWidth: true
155
- }
156
- );
157
- const initialVoltageProfileModeField = /* @__PURE__ */ jsx(
158
- RadioInput,
159
- {
160
- name: `${COMMON_PARAMETERS}.${SHORT_CIRCUIT_INITIAL_VOLTAGE_PROFILE_MODE}`,
161
- options: Object.values(initialVoltageProfileMode)
162
- }
163
- );
164
- const loads = /* @__PURE__ */ jsx(CheckboxInput, { name: `${COMMON_PARAMETERS}.${SHORT_CIRCUIT_WITH_LOADS}`, label: "shortCircuitLoads" });
165
- const vsc = /* @__PURE__ */ jsx(
166
- CheckboxInput,
167
- {
168
- name: `${COMMON_PARAMETERS}.${SHORT_CIRCUIT_WITH_VSC_CONVERTER_STATIONS}`,
169
- label: "shortCircuitHvdc"
170
- }
171
- );
172
- const shuntCompensators = /* @__PURE__ */ jsx(
173
- CheckboxInput,
174
- {
175
- name: `${COMMON_PARAMETERS}.${SHORT_CIRCUIT_WITH_SHUNT_COMPENSATORS}`,
176
- label: "shortCircuitShuntCompensators"
177
- }
178
- );
179
- const neutralPosition = /* @__PURE__ */ jsx(
180
- CheckboxInput,
181
- {
182
- name: `${COMMON_PARAMETERS}.${SHORT_CIRCUIT_WITH_NEUTRAL_POSITION}`,
183
- label: "shortCircuitNeutralPosition"
184
- }
185
- );
186
- const onlyStartedGeneratorsInCalculationCluster = /* @__PURE__ */ jsx(
187
- RadioInput,
188
- {
189
- name: `${SPECIFIC_PARAMETERS}.${SHORT_CIRCUIT_ONLY_STARTED_GENERATORS_IN_CALCULATION_CLUSTER}`,
190
- options: Object.values(onlyStartedGeneratorsOptions),
191
- formProps: {
192
- onChange: (_event, value) => {
193
- setValue(
194
- `${SPECIFIC_PARAMETERS}.${SHORT_CIRCUIT_ONLY_STARTED_GENERATORS_IN_CALCULATION_CLUSTER}`,
195
- value === "true",
196
- {
197
- shouldDirty: true
198
- }
199
- );
200
- }
201
- }
202
- }
203
- );
204
- const modelPowerElectronics = /* @__PURE__ */ jsxs(Grid, { container: true, alignItems: "center", spacing: 2, direction: "row", children: [
205
- /* @__PURE__ */ jsx(Grid, { item: true, xs: 10, children: /* @__PURE__ */ jsx(FieldLabel, { label: "ShortCircuitModelPowerElectronics" }) }),
206
- /* @__PURE__ */ jsx(Grid, { item: true, xs: 2, children: /* @__PURE__ */ jsx(SwitchInput, { name: `${SPECIFIC_PARAMETERS}.${SHORT_CIRCUIT_MODEL_POWER_ELECTRONICS}` }) })
207
- ] });
208
- useEffect(() => {
209
- const isIccMaxWithNominalVoltageMap = watchPredefinedParams === PredefinedParameters.ICC_MAX_WITH_NOMINAL_VOLTAGE_MAP;
210
- const isIccMinWithNominal = watchPredefinedParams === PredefinedParameters.ICC_MIN_WITH_NOMINAL_VOLTAGE_MAP;
211
- const isInitialVoltageNominal = watchInitialVoltageProfileMode === InitialVoltage.NOMINAL;
212
- const isIccMaxNominalDefaultConfiguration = isIccMaxWithNominalVoltageMap && isInitialVoltageNominal;
213
- const isIccMinNominalDefaultConfiguration = isIccMinWithNominal && isInitialVoltageNominal;
214
- const isCEI909DefaultConfiguration = watchPredefinedParams === PredefinedParameters.ICC_MAX_WITH_CEI909 && watchInitialVoltageProfileMode === InitialVoltage.CEI909;
215
- const isIccMaxDefaultConfiguration = (isIccMaxNominalDefaultConfiguration || isCEI909DefaultConfiguration) && isIccMaxFeaturesDefaultConfiguration;
216
- const isIccMinDefaultConfiguration = isIccMinNominalDefaultConfiguration && isIccMinFeaturesDefaultConfiguration;
217
- setStatus(
218
- isIccMaxDefaultConfiguration || isIccMinDefaultConfiguration ? "SUCCESS" : "ERROR"
219
- /* ERROR */
220
- );
221
- }, [
222
- watchInitialVoltageProfileMode,
223
- watchPredefinedParams,
224
- isIccMaxFeaturesDefaultConfiguration,
225
- isIccMinFeaturesDefaultConfiguration
226
- ]);
227
- return /* @__PURE__ */ jsxs(Grid, { container: true, spacing: 2, paddingLeft: 2, children: [
228
- /* @__PURE__ */ jsx(Grid, { container: true, paddingTop: 2, xl: 6, children: /* @__PURE__ */ jsx(GridItem, { size: 10, children: feederResult }) }),
229
- /* @__PURE__ */ jsx(GridSection, { title: "ShortCircuitPredefinedParameters", heading: 4 }),
230
- /* @__PURE__ */ jsxs(Grid, { xl: 6, container: true, spacing: 1, alignItems: "center", children: [
231
- /* @__PURE__ */ jsx(GridItem, { size: 9, children: predefinedParameters }),
232
- /* @__PURE__ */ jsx(GridItem, { size: 2, children: statusToShow })
233
- ] }),
234
- /* @__PURE__ */ jsx(GridSection, { title: "ShortCircuitCharacteristics", heading: 4 }),
235
- /* @__PURE__ */ jsxs(Grid, { container: true, spacing: 5, children: [
236
- /* @__PURE__ */ jsxs(Grid, { item: true, children: [
237
- /* @__PURE__ */ jsx(GridItem, { children: loads }),
238
- /* @__PURE__ */ jsx(GridItem, { children: shuntCompensators })
239
- ] }),
240
- /* @__PURE__ */ jsxs(Grid, { item: true, xs: 8, children: [
241
- /* @__PURE__ */ jsx(GridItem, { children: vsc }),
242
- /* @__PURE__ */ jsx(GridItem, { children: neutralPosition })
243
- ] })
244
- ] }),
245
- /* @__PURE__ */ jsx(GridSection, { title: "ShortCircuitVoltageProfileMode", heading: 4 }),
246
- /* @__PURE__ */ jsx(Grid, { container: true, children: /* @__PURE__ */ jsx(GridItem, { size: 12, children: initialVoltageProfileModeField }) }),
247
- /* @__PURE__ */ jsx(VoltageTable, { voltageProfileMode: watchInitialVoltageProfileMode }),
248
- isThereSpecificParameters && /* @__PURE__ */ jsxs(Fragment, { children: [
249
- /* @__PURE__ */ jsx(GridSection, { title: "ShortCircuitStartedGeneratorsMode", heading: 4 }),
250
- /* @__PURE__ */ jsx(Grid, { container: true, children: /* @__PURE__ */ jsx(GridItem, { size: 12, children: onlyStartedGeneratorsInCalculationCluster }) }),
251
- isDeveloperMode && /* @__PURE__ */ jsxs(Fragment, { children: [
252
- /* @__PURE__ */ jsx(GridSection, { title: "ShortCircuitPowerElectronicsSection", heading: 4 }),
253
- /* @__PURE__ */ jsx(Grid, { container: true, xl: 6, children: /* @__PURE__ */ jsx(GridItem, { size: 10, children: modelPowerElectronics }) }),
254
- /* @__PURE__ */ jsx(
255
- ShortCircuitIccMaterialTable,
256
- {
257
- formName: `${SPECIFIC_PARAMETERS}.${SHORT_CIRCUIT_POWER_ELECTRONICS_MATERIALS}`,
258
- columnsDefinition: iccMaterialsColumnsDef
259
- }
260
- ),
261
- /* @__PURE__ */ jsx(
262
- ShortCircuitIccClusterTable,
263
- {
264
- formName: `${SPECIFIC_PARAMETERS}.${SHORT_CIRCUIT_POWER_ELECTRONICS_CLUSTERS}`,
265
- columnsDefinition: iccClustersColumnsDef,
266
- createRows
267
- }
268
- )
269
- ] })
270
- ] })
271
- ] });
272
- }
273
- export {
274
- ShortCircuitFields,
275
- Status
276
- };