@gridsuite/commons-ui 0.148.0 → 0.150.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/index.js +2 -0
- package/dist/components/parameters/short-circuit/short-circuit-fields.js +15 -27
- package/dist/components/treeViewFinder/TreeViewFinder.js +2 -1
- package/dist/components/treeViewFinder/TreeViewUtils.d.ts +2 -0
- package/dist/components/treeViewFinder/TreeViewUtils.js +6 -0
- package/dist/components/treeViewFinder/index.d.ts +1 -0
- package/dist/components/treeViewFinder/index.js +2 -0
- package/dist/index.js +2 -0
- package/dist/translations/en/parameters.js +1 -1
- package/dist/translations/fr/parameters.js +1 -1
- package/dist/utils/constants/unitsConstants.d.ts +1 -1
- package/dist/utils/constants/unitsConstants.js +1 -1
- package/package.json +4 -4
package/dist/components/index.js
CHANGED
|
@@ -122,6 +122,7 @@ import { GridLogo, LogoText } from "./topBar/GridLogo.js";
|
|
|
122
122
|
import { DevModeBanner } from "./topBar/DevModeBanner.js";
|
|
123
123
|
import { TopBar } from "./topBar/TopBar.js";
|
|
124
124
|
import { TreeViewFinder, generateTreeViewFinderClass } from "./treeViewFinder/TreeViewFinder.js";
|
|
125
|
+
import { doesNodeHasChildren } from "./treeViewFinder/TreeViewUtils.js";
|
|
125
126
|
import { NotificationsProvider } from "./notifications/NotificationsProvider.js";
|
|
126
127
|
import { NotificationsContext } from "./notifications/contexts/NotificationsContext.js";
|
|
127
128
|
import { useNotificationsListener } from "./notifications/hooks/useNotificationsListener.js";
|
|
@@ -498,6 +499,7 @@ export {
|
|
|
498
499
|
alertThresholdMarks,
|
|
499
500
|
countRules,
|
|
500
501
|
dispatchUser,
|
|
502
|
+
doesNodeHasChildren,
|
|
501
503
|
expertFilterSchema,
|
|
502
504
|
explicitNamingFilterSchema,
|
|
503
505
|
exportExpertRules,
|
|
@@ -5,7 +5,7 @@ import { green, red } from "@mui/material/colors";
|
|
|
5
5
|
import { Lens } from "@mui/icons-material";
|
|
6
6
|
import { useWatch, useFormContext } from "react-hook-form";
|
|
7
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, intlPredefinedParametersOptions,
|
|
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, intlPredefinedParametersOptions, intlInitialVoltageProfileMode, onlyStartedGeneratorsOptions, PredefinedParameters, InitialVoltage, SHORT_CIRCUIT_POWER_ELECTRONICS_MATERIALS, SHORT_CIRCUIT_WITH_FEEDER_RESULT, SHORT_CIRCUIT_MODEL_POWER_ELECTRONICS } from "./constants.js";
|
|
9
9
|
import { VoltageTable } from "./short-circuit-voltage-table.js";
|
|
10
10
|
import GridItem from "../../grid/grid-item.js";
|
|
11
11
|
import GridSection from "../../grid/grid-section.js";
|
|
@@ -94,12 +94,8 @@ function ShortCircuitFields({ resetAll, isDeveloperMode = true }) {
|
|
|
94
94
|
return !watchLoads && !watchShuntCompensators && watchVSC && !watchNeutralPosition && !watchOnlyStartedGenerators;
|
|
95
95
|
}, [watchLoads, watchShuntCompensators, watchVSC, watchNeutralPosition, watchOnlyStartedGenerators]);
|
|
96
96
|
const predefinedParamsOptions = useMemo(() => {
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
return options.filter((opt) => opt.id !== PredefinedParameters.ICC_MIN_WITH_NOMINAL_VOLTAGE_MAP);
|
|
100
|
-
}
|
|
101
|
-
return options;
|
|
102
|
-
}, [isDeveloperMode]);
|
|
97
|
+
return intlPredefinedParametersOptions();
|
|
98
|
+
}, []);
|
|
103
99
|
const initialVoltageProfileMode = useMemo(() => {
|
|
104
100
|
return intlInitialVoltageProfileMode();
|
|
105
101
|
}, []);
|
|
@@ -114,16 +110,6 @@ function ShortCircuitFields({ resetAll, isDeveloperMode = true }) {
|
|
|
114
110
|
resetAll(newPredefinedParameters);
|
|
115
111
|
};
|
|
116
112
|
const { setValue } = useFormContext();
|
|
117
|
-
useEffect(() => {
|
|
118
|
-
if (!isDeveloperMode) {
|
|
119
|
-
if (watchPredefinedParams === PredefinedParameters.ICC_MIN_WITH_NOMINAL_VOLTAGE_MAP) {
|
|
120
|
-
setValue(SHORT_CIRCUIT_PREDEFINED_PARAMS, PredefinedParameters.ICC_MAX_WITH_NOMINAL_VOLTAGE_MAP, {
|
|
121
|
-
shouldDirty: false,
|
|
122
|
-
shouldValidate: true
|
|
123
|
-
});
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
}, [isDeveloperMode, watchPredefinedParams, setValue]);
|
|
127
113
|
const feederResult = /* @__PURE__ */ jsxs(Grid, { container: true, alignItems: "center", spacing: 2, direction: "row", children: [
|
|
128
114
|
/* @__PURE__ */ jsx(Grid, { item: true, xs: 10, children: /* @__PURE__ */ jsx(FieldLabel, { label: "descWithFeederResult" }) }),
|
|
129
115
|
/* @__PURE__ */ jsx(Grid, { item: true, xs: 2, children: /* @__PURE__ */ jsx(SwitchInput, { name: `${COMMON_PARAMETERS}.${SHORT_CIRCUIT_WITH_FEEDER_RESULT}` }) })
|
|
@@ -230,16 +216,18 @@ function ShortCircuitFields({ resetAll, isDeveloperMode = true }) {
|
|
|
230
216
|
isThereSpecificParameters && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
231
217
|
/* @__PURE__ */ jsx(GridSection, { title: "ShortCircuitStartedGeneratorsMode", heading: 4 }),
|
|
232
218
|
/* @__PURE__ */ jsx(Grid, { container: true, children: /* @__PURE__ */ jsx(GridItem, { size: 12, children: onlyStartedGenerators }) }),
|
|
233
|
-
/* @__PURE__ */
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
219
|
+
isDeveloperMode && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
220
|
+
/* @__PURE__ */ jsx(GridSection, { title: "ShortCircuitPowerElectronicsSection", heading: 4 }),
|
|
221
|
+
/* @__PURE__ */ jsx(Grid, { container: true, children: /* @__PURE__ */ jsx(GridItem, { size: 12, children: modelPowerElectronics }) }),
|
|
222
|
+
/* @__PURE__ */ jsx(
|
|
223
|
+
ShortCircuitIccMaterialTable,
|
|
224
|
+
{
|
|
225
|
+
formName: `${SPECIFIC_PARAMETERS}.${SHORT_CIRCUIT_POWER_ELECTRONICS_MATERIALS}`,
|
|
226
|
+
tableHeight: 300,
|
|
227
|
+
columnsDefinition: columnsDef
|
|
228
|
+
}
|
|
229
|
+
)
|
|
230
|
+
] })
|
|
243
231
|
] })
|
|
244
232
|
] });
|
|
245
233
|
}
|
|
@@ -6,6 +6,7 @@ import { SimpleTreeView, TreeItem } from "@mui/x-tree-view";
|
|
|
6
6
|
import { ExpandMore, ChevronRight, Check } from "@mui/icons-material";
|
|
7
7
|
import { toNestedGlobalSelectors, makeComposeClasses } from "../../utils/styles.js";
|
|
8
8
|
import { CancelButton } from "../inputs/reactHookForm/utils/CancelButton.js";
|
|
9
|
+
import { doesNodeHasChildren } from "./TreeViewUtils.js";
|
|
9
10
|
const cssDialogPaper = "dialogPaper";
|
|
10
11
|
const cssLabelRoot = "labelRoot";
|
|
11
12
|
const cssLabelText = "labelText";
|
|
@@ -224,7 +225,7 @@ function TreeViewFinderComponant(props) {
|
|
|
224
225
|
}
|
|
225
226
|
let childrenNodes = null;
|
|
226
227
|
const showExpandIcon = showChevron(node);
|
|
227
|
-
if (
|
|
228
|
+
if (doesNodeHasChildren(node)) {
|
|
228
229
|
childrenNodes = node.children.toSorted(sortMethod).map(renderTree);
|
|
229
230
|
} else if (showExpandIcon) {
|
|
230
231
|
childrenNodes = [/* @__PURE__ */ jsx("span", { style: { display: "none" } }, "placeholder")];
|
package/dist/index.js
CHANGED
|
@@ -123,6 +123,7 @@ import { GridLogo, LogoText } from "./components/topBar/GridLogo.js";
|
|
|
123
123
|
import { DevModeBanner } from "./components/topBar/DevModeBanner.js";
|
|
124
124
|
import { TopBar } from "./components/topBar/TopBar.js";
|
|
125
125
|
import { TreeViewFinder, generateTreeViewFinderClass } from "./components/treeViewFinder/TreeViewFinder.js";
|
|
126
|
+
import { doesNodeHasChildren } from "./components/treeViewFinder/TreeViewUtils.js";
|
|
126
127
|
import { NotificationsProvider } from "./components/notifications/NotificationsProvider.js";
|
|
127
128
|
import { NotificationsContext } from "./components/notifications/contexts/NotificationsContext.js";
|
|
128
129
|
import { useNotificationsListener } from "./components/notifications/hooks/useNotificationsListener.js";
|
|
@@ -728,6 +729,7 @@ export {
|
|
|
728
729
|
dispatchUser,
|
|
729
730
|
dndTableEn,
|
|
730
731
|
dndTableFr,
|
|
732
|
+
doesNodeHasChildren,
|
|
731
733
|
elementAlreadyExists,
|
|
732
734
|
elementSearchEn,
|
|
733
735
|
elementSearchFr,
|
|
@@ -157,7 +157,7 @@ const parametersEn = {
|
|
|
157
157
|
ReactiveSlacksThresholdMustBeGreaterOrEqualToZero: "The threshold must be greater or equal to 0",
|
|
158
158
|
ShuntCompensatorActivationThreshold: "Alert threshold on shunt compensator activation",
|
|
159
159
|
ShuntCompensatorActivationThresholdMustBeGreaterOrEqualToZero: "The threshold must be greater or equal to 0",
|
|
160
|
-
ShuntCompensatorActivationThresholdDescription: "Threshold (in
|
|
160
|
+
ShuntCompensatorActivationThresholdDescription: "Threshold (in Mvar) above which the difference between discretized and optimal value for shunt compensator activation is considered significant (and will thus be recorded in the functional logs)",
|
|
161
161
|
VoltageInitParametersError: "An error occurred while updating the voltage profile initialization parameters",
|
|
162
162
|
AdjustExistingLimits: "Adjust existing limits",
|
|
163
163
|
AdjustExistingLimitsInfo: "Please enter a positive number in order to increase an existing voltage limit and a negative number in order to decrease an existing voltage limit (new limit = existing limit + user input).",
|
|
@@ -157,7 +157,7 @@ const parametersFr = {
|
|
|
157
157
|
ReactiveSlacksThresholdMustBeGreaterOrEqualToZero: "Le seuil doit être supérieur ou égal à 0",
|
|
158
158
|
ShuntCompensatorActivationThreshold: "Seuil d'alerte sur l'enclenchement des MCS",
|
|
159
159
|
ShuntCompensatorActivationThresholdMustBeGreaterOrEqualToZero: "Le seuil doit être supérieur ou égal à 0",
|
|
160
|
-
ShuntCompensatorActivationThresholdDescription: "Seuil (en
|
|
160
|
+
ShuntCompensatorActivationThresholdDescription: "Seuil (en Mvar) au-dessus duquel on considère qu'il y a un écart significatif (et donc tracé dans les logs fonctionnels) entre valeur arrondie et valeur théorique pour l'enclenchement d'un MCS",
|
|
161
161
|
VoltageInitParametersError: "Erreur lors de la mise à jour des paramètres d'initialisation du plan de tension",
|
|
162
162
|
voltageInitCancelError: "L'initialisation du plan de tension n'a pas pu être annulée",
|
|
163
163
|
AdjustExistingLimits: "Modifier les limites existantes",
|
|
@@ -8,7 +8,7 @@ export declare const MICRO_SIEMENS = "\u00B5S";
|
|
|
8
8
|
export declare const SIEMENS = "S";
|
|
9
9
|
export declare const AMPERE = "A";
|
|
10
10
|
export declare const KILO_AMPERE = "kA";
|
|
11
|
-
export declare const MEGA_VAR = "
|
|
11
|
+
export declare const MEGA_VAR = "Mvar";
|
|
12
12
|
export declare const MEGA_VOLT_AMPERE = "MVA";
|
|
13
13
|
export declare const OHM = "\u03A9";
|
|
14
14
|
export declare const MEGA_WATT = "MW";
|
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gridsuite/commons-ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.150.0",
|
|
4
4
|
"description": "common react components for gridsuite applications",
|
|
5
5
|
"author": "gridsuite team",
|
|
6
6
|
"homepage": "https://github.com/gridsuite",
|
|
7
7
|
"license": "MPL-2.0",
|
|
8
8
|
"repository": "git://github.com/gridsuite/commons-ui.git",
|
|
9
9
|
"engines": {
|
|
10
|
-
"node": ">=
|
|
11
|
-
"npm": "^
|
|
10
|
+
"node": ">=24",
|
|
11
|
+
"npm": "^11.6.2"
|
|
12
12
|
},
|
|
13
13
|
"type": "module",
|
|
14
14
|
"exports": "./dist/index.js",
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
"@mui/icons-material": "^5.16.14",
|
|
66
66
|
"@mui/lab": "5.0.0-alpha.175",
|
|
67
67
|
"@mui/material": "^5.16.14",
|
|
68
|
-
"@mui/x-tree-view": "^
|
|
68
|
+
"@mui/x-tree-view": "^8.21.0",
|
|
69
69
|
"ag-grid-community": "^33.0.3",
|
|
70
70
|
"ag-grid-react": "^33.0.4",
|
|
71
71
|
"notistack": "^3.0.2",
|