@gridsuite/commons-ui 0.87.0 → 0.88.1

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 (34) hide show
  1. package/dist/components/checkBoxList/DraggableClickableRowItem.js +1 -0
  2. package/dist/components/dialogs/elementCreationDialog/ElementCreationDialog.js +1 -0
  3. package/dist/components/filter/HeaderFilterForm.d.ts +10 -0
  4. package/dist/components/filter/HeaderFilterForm.js +61 -8
  5. package/dist/components/filter/expert/ExpertFilterForm.js +3 -1
  6. package/dist/components/filter/explicitNaming/ExplicitNamingFilterForm.js +3 -1
  7. package/dist/components/filter/utils/filterFormUtils.d.ts +4 -1
  8. package/dist/components/filter/utils/filterFormUtils.js +5 -75
  9. package/dist/components/inputs/reactHookForm/text/DescriptionField.d.ts +6 -7
  10. package/dist/components/inputs/reactHookForm/text/DescriptionField.js +7 -3
  11. package/dist/components/inputs/reactHookForm/text/UniqueNameInput.d.ts +4 -2
  12. package/dist/components/inputs/reactHookForm/text/UniqueNameInput.js +7 -2
  13. package/dist/hooks/useModificationLabelComputer.d.ts +3 -0
  14. package/dist/hooks/useModificationLabelComputer.js +10 -2
  15. package/dist/index.js +4 -2
  16. package/dist/translations/en/descriptionEn.d.ts +1 -0
  17. package/dist/translations/en/descriptionEn.js +3 -2
  18. package/dist/translations/en/equipmentSearchEn.d.ts +2 -0
  19. package/dist/translations/en/equipmentSearchEn.js +2 -0
  20. package/dist/translations/en/networkModificationsEn.d.ts +1 -0
  21. package/dist/translations/en/networkModificationsEn.js +2 -1
  22. package/dist/translations/fr/descriptionFr.d.ts +1 -0
  23. package/dist/translations/fr/descriptionFr.js +3 -2
  24. package/dist/translations/fr/equipmentSearchFr.d.ts +2 -0
  25. package/dist/translations/fr/equipmentSearchFr.js +2 -0
  26. package/dist/translations/fr/networkModificationsFr.d.ts +1 -0
  27. package/dist/translations/fr/networkModificationsFr.js +2 -1
  28. package/dist/utils/index.js +4 -2
  29. package/dist/utils/types/equipmentType.d.ts +16 -8
  30. package/dist/utils/types/equipmentType.js +114 -24
  31. package/dist/utils/types/index.js +4 -2
  32. package/dist/utils/types/modificationType.d.ts +3 -0
  33. package/dist/utils/types/modificationType.js +3 -0
  34. package/package.json +1 -1
@@ -5,6 +5,7 @@ import { OverflowableText } from "../overflowableText/OverflowableText.js";
5
5
  import "../../utils/conversionUtils.js";
6
6
  import "@mui/icons-material";
7
7
  import { mergeSx } from "../../utils/styles.js";
8
+ import "../../utils/types/equipmentType.js";
8
9
  import "../../utils/yupConfig.js";
9
10
  const styles = {
10
11
  dragIcon: (theme) => ({
@@ -10,6 +10,7 @@ import { MAX_CHAR_DESCRIPTION } from "../../../utils/constants/uiConstants.js";
10
10
  import "../../../utils/conversionUtils.js";
11
11
  import "@mui/icons-material";
12
12
  import { ElementType } from "../../../utils/types/elementType.js";
13
+ import "../../../utils/types/equipmentType.js";
13
14
  import { CustomMuiDialog } from "../customMuiDialog/CustomMuiDialog.js";
14
15
  import "@mui/icons-material/Folder";
15
16
  import "../../inputs/reactHookForm/provider/CustomFormProvider.js";
@@ -1,6 +1,16 @@
1
1
  import { UUID } from 'crypto';
2
2
  import { default as yup } from '../../utils/yupConfig';
3
3
 
4
+ export declare const filterStyles: {
5
+ textField: {
6
+ minWidth: string;
7
+ width: string;
8
+ };
9
+ description: {
10
+ minWidth: string;
11
+ width: string;
12
+ };
13
+ };
4
14
  export interface FilterFormProps {
5
15
  creation?: boolean;
6
16
  activeDirectory?: UUID;
@@ -1,14 +1,64 @@
1
1
  import { jsxs, jsx, Fragment } from "react/jsx-runtime";
2
2
  import { Grid } from "@mui/material";
3
3
  import { FieldConstants } from "../../utils/constants/fieldConstants.js";
4
- import { FilterType } from "./constants/FilterConstants.js";
5
- import { UniqueNameInput } from "../inputs/reactHookForm/text/UniqueNameInput.js";
4
+ import { MAX_CHAR_DESCRIPTION } from "../../utils/constants/uiConstants.js";
5
+ import "../../utils/conversionUtils.js";
6
+ import "@mui/icons-material";
6
7
  import { ElementType } from "../../utils/types/elementType.js";
7
- import { DescriptionField } from "../inputs/reactHookForm/text/DescriptionField.js";
8
- import { RadioInput } from "../inputs/reactHookForm/booleans/RadioInput.js";
8
+ import "../../utils/types/equipmentType.js";
9
9
  import "../../utils/yupConfig.js";
10
- import { MAX_CHAR_DESCRIPTION } from "../../utils/constants/uiConstants.js";
10
+ import { FilterType } from "./constants/FilterConstants.js";
11
+ import "react-intl";
12
+ import "@mui/icons-material/Folder";
13
+ import "react";
14
+ import "react-hook-form";
15
+ import "../inputs/reactHookForm/provider/CustomFormProvider.js";
11
16
  import * as yup from "yup";
17
+ import "notistack";
18
+ import "../overflowableText/OverflowableText.js";
19
+ import "../treeViewFinder/TreeViewFinder.js";
20
+ import "../inputs/reactHookForm/agGridTable/BottomRightButtons.js";
21
+ import "ag-grid-community/styles/ag-grid.css";
22
+ import "ag-grid-community/styles/ag-theme-alpine.css";
23
+ import "../customAGGrid/customAggrid.js";
24
+ import "ag-grid-community";
25
+ import "@mui/material/Dialog";
26
+ import "@mui/material/DialogTitle";
27
+ import "@mui/material/DialogContent";
28
+ import "@mui/material/DialogActions";
29
+ import "react-papaparse";
30
+ import "@mui/material/Button";
31
+ import "@mui/material/Grid";
32
+ import "react-csv-downloader";
33
+ import "@mui/material/Alert";
34
+ import "@mui/material/styles";
35
+ import { RadioInput } from "../inputs/reactHookForm/booleans/RadioInput.js";
36
+ import "../inputs/reactHookForm/numbers/RangeInput.js";
37
+ import "localized-countries";
38
+ import "localized-countries/data/fr";
39
+ import "localized-countries/data/en";
40
+ import { DescriptionField } from "../inputs/reactHookForm/text/DescriptionField.js";
41
+ import { UniqueNameInput } from "../inputs/reactHookForm/text/UniqueNameInput.js";
42
+ import "@mui/icons-material/ControlPoint";
43
+ import "@react-querybuilder/material";
44
+ import "./expert/expertFilterConstants.js";
45
+ import "../inputs/reactQueryBuilder/CustomReactQueryBuilder.js";
46
+ import "uuid";
47
+ import "../inputs/reactQueryBuilder/PropertyValueEditor.js";
48
+ import "@mui/material/IconButton";
49
+ import "@mui/icons-material/Delete";
50
+ import "react-querybuilder";
51
+ import "@mui/material/Box";
52
+ const filterStyles = {
53
+ textField: {
54
+ minWidth: "250px",
55
+ width: "33%"
56
+ },
57
+ description: {
58
+ minWidth: "250px",
59
+ width: "50%"
60
+ }
61
+ };
12
62
  const HeaderFilterSchema = {
13
63
  [FieldConstants.NAME]: yup.string().trim().required("nameEmpty"),
14
64
  [FieldConstants.FILTER_TYPE]: yup.string().required(),
@@ -30,11 +80,13 @@ function HeaderFilterForm({
30
80
  label: "nameProperty",
31
81
  elementType: ElementType.FILTER,
32
82
  autoFocus: creation,
33
- activeDirectory
83
+ activeDirectory,
84
+ sx: filterStyles.textField,
85
+ fullWidth: false
34
86
  }
35
87
  ) }),
36
88
  /* @__PURE__ */ jsxs(Fragment, { children: [
37
- /* @__PURE__ */ jsx(Grid, { item: true, xs: 12, children: /* @__PURE__ */ jsx(DescriptionField, {}) }),
89
+ /* @__PURE__ */ jsx(Grid, { item: true, xs: 12, children: /* @__PURE__ */ jsx(DescriptionField, { expandingTextSx: filterStyles.description }) }),
38
90
  creation && !sourceFilterForExplicitNamingConversion && /* @__PURE__ */ jsx(Grid, { item: true, children: /* @__PURE__ */ jsx(
39
91
  RadioInput,
40
92
  {
@@ -48,5 +100,6 @@ function HeaderFilterForm({
48
100
  }
49
101
  export {
50
102
  HeaderFilterForm,
51
- HeaderFilterSchema
103
+ HeaderFilterSchema,
104
+ filterStyles
52
105
  };
@@ -27,6 +27,7 @@ import "@mui/material/Button";
27
27
  import "@mui/material/styles";
28
28
  import { FieldType } from "../../../utils/types/fieldType.js";
29
29
  import { useFormatLabelWithUnit } from "../../../hooks/useFormatLabelWithUnit.js";
30
+ import { filterStyles } from "../HeaderFilterForm.js";
30
31
  yup.setLocale({
31
32
  mixed: {
32
33
  required: "YupRequired",
@@ -107,7 +108,8 @@ function ExpertFilterForm() {
107
108
  shouldOpenPopup: openConfirmationPopup,
108
109
  resetOnConfirmation: handleResetOnConfirmation,
109
110
  message: "changeTypeMessage",
110
- validateButtonLabel: "button.changeType"
111
+ validateButtonLabel: "button.changeType",
112
+ sx: filterStyles.textField
111
113
  }
112
114
  ) }),
113
115
  /* @__PURE__ */ jsx(Box, { sx: unscrollableDialogStyles.scrollableContent, children: watchEquipmentType && isSupportedEquipmentType(watchEquipmentType) && /* @__PURE__ */ jsx(CustomReactQueryBuilder, { name: EXPERT_FILTER_QUERY, fields: translatedFields }) })
@@ -28,6 +28,7 @@ import "@mui/material/DialogActions";
28
28
  import "@mui/material/Button";
29
29
  import "@mui/material/styles";
30
30
  import { FILTER_EQUIPMENTS_ATTRIBUTES } from "./ExplicitNamingFilterConstants.js";
31
+ import { filterStyles } from "../HeaderFilterForm.js";
31
32
  import * as yup from "yup";
32
33
  function isGeneratorOrLoad(equipmentType) {
33
34
  return equipmentType === Generator.type || equipmentType === Load.type;
@@ -178,7 +179,8 @@ function ExplicitNamingFilterForm({ sourceFilterForExplicitNamingConversion }) {
178
179
  shouldOpenPopup: openConfirmationPopup,
179
180
  resetOnConfirmation: handleResetOnConfirmation,
180
181
  message: "changeTypeMessage",
181
- validateButtonLabel: "button.changeType"
182
+ validateButtonLabel: "button.changeType",
183
+ sx: filterStyles.textField
182
184
  }
183
185
  ),
184
186
  sourceFilterForExplicitNamingConversion && /* @__PURE__ */ jsx(
@@ -14,4 +14,7 @@ export type FormEquipment = {
14
14
  fields: FormField[];
15
15
  };
16
16
  export declare const CONTINGENCY_LIST_EQUIPMENTS: Record<EquipmentType.BUSBAR_SECTION | EquipmentType.LINE | EquipmentType.TWO_WINDINGS_TRANSFORMER | EquipmentType.THREE_WINDINGS_TRANSFORMER | EquipmentType.GENERATOR | EquipmentType.BATTERY | EquipmentType.LOAD | EquipmentType.SHUNT_COMPENSATOR | EquipmentType.STATIC_VAR_COMPENSATOR | EquipmentType.HVDC_LINE | EquipmentType.DANGLING_LINE, FormEquipment>;
17
- export declare const FILTER_EQUIPMENTS: Record<EquipmentType.SUBSTATION | EquipmentType.VOLTAGE_LEVEL | EquipmentType.LINE | EquipmentType.TWO_WINDINGS_TRANSFORMER | EquipmentType.THREE_WINDINGS_TRANSFORMER | EquipmentType.GENERATOR | EquipmentType.BATTERY | EquipmentType.LOAD | EquipmentType.SHUNT_COMPENSATOR | EquipmentType.STATIC_VAR_COMPENSATOR | EquipmentType.HVDC_LINE | EquipmentType.DANGLING_LINE, FormEquipment>;
17
+ export declare const FILTER_EQUIPMENTS: Partial<Record<EquipmentType, {
18
+ id: EquipmentType;
19
+ label: string;
20
+ }>>;
@@ -1,7 +1,7 @@
1
1
  import { FieldConstants } from "../../../utils/constants/fieldConstants.js";
2
2
  import { RangeInput } from "../../inputs/reactHookForm/numbers/RangeInput.js";
3
3
  import { CountriesInput } from "../../inputs/reactHookForm/selectInputs/CountriesInput.js";
4
- import { SelectInput } from "../../inputs/reactHookForm/selectInputs/SelectInput.js";
4
+ import { EquipmentType, BASE_EQUIPMENTS } from "../../../utils/types/equipmentType.js";
5
5
  const countries = {
6
6
  renderer: CountriesInput,
7
7
  props: {
@@ -51,21 +51,6 @@ const nominalVoltage3 = {
51
51
  name: `${FieldConstants.CRITERIA_BASED}.${FieldConstants.NOMINAL_VOLTAGE_3}`
52
52
  }
53
53
  };
54
- const energySource = {
55
- renderer: SelectInput,
56
- props: {
57
- label: "EnergySourceText",
58
- name: `${FieldConstants.CRITERIA_BASED}.${FieldConstants.ENERGY_SOURCE}`,
59
- options: [
60
- { id: "HYDRO", label: "Hydro" },
61
- { id: "NUCLEAR", label: "Nuclear" },
62
- { id: "WIND", label: "Wind" },
63
- { id: "THERMAL", label: "Thermal" },
64
- { id: "SOLAR", label: "Solar" },
65
- { id: "OTHER", label: "Other" }
66
- ]
67
- }
68
- };
69
54
  const CONTINGENCY_LIST_EQUIPMENTS = {
70
55
  BUSBAR_SECTION: {
71
56
  id: "BUSBAR_SECTION",
@@ -124,65 +109,10 @@ const CONTINGENCY_LIST_EQUIPMENTS = {
124
109
  }
125
110
  };
126
111
  const FILTER_EQUIPMENTS = {
127
- SUBSTATION: {
128
- id: "SUBSTATION",
129
- label: "Substations",
130
- fields: [countries]
131
- },
132
- VOLTAGE_LEVEL: {
133
- id: "VOLTAGE_LEVEL",
134
- label: "VoltageLevels",
135
- fields: [countries, nominalVoltage]
136
- },
137
- LINE: {
138
- id: "LINE",
139
- label: "Lines",
140
- fields: [countries1, countries2, nominalVoltage1, nominalVoltage2]
141
- },
142
- TWO_WINDINGS_TRANSFORMER: {
143
- id: "TWO_WINDINGS_TRANSFORMER",
144
- label: "TwoWindingsTransformers",
145
- fields: [countries, nominalVoltage1, nominalVoltage2]
146
- },
147
- THREE_WINDINGS_TRANSFORMER: {
148
- id: "THREE_WINDINGS_TRANSFORMER",
149
- label: "ThreeWindingsTransformers",
150
- fields: [countries, nominalVoltage1, nominalVoltage2, nominalVoltage3]
151
- },
152
- GENERATOR: {
153
- id: "GENERATOR",
154
- label: "Generators",
155
- fields: [countries, energySource, nominalVoltage]
156
- },
157
- BATTERY: {
158
- id: "BATTERY",
159
- label: "Batteries",
160
- fields: [countries, nominalVoltage]
161
- },
162
- LOAD: {
163
- id: "LOAD",
164
- label: "Loads",
165
- fields: [countries, nominalVoltage]
166
- },
167
- SHUNT_COMPENSATOR: {
168
- id: "SHUNT_COMPENSATOR",
169
- label: "ShuntCompensators",
170
- fields: [countries, nominalVoltage]
171
- },
172
- STATIC_VAR_COMPENSATOR: {
173
- id: "STATIC_VAR_COMPENSATOR",
174
- label: "StaticVarCompensators",
175
- fields: [countries, nominalVoltage]
176
- },
177
- HVDC_LINE: {
178
- id: "HVDC_LINE",
179
- label: "Hvdc",
180
- fields: [countries1, countries2, nominalVoltage]
181
- },
182
- DANGLING_LINE: {
183
- id: "DANGLING_LINE",
184
- label: "DanglingLines",
185
- fields: [countries, nominalVoltage]
112
+ ...BASE_EQUIPMENTS,
113
+ [EquipmentType.HVDC_LINE]: {
114
+ id: EquipmentType.HVDC_LINE,
115
+ label: "Hvdc"
186
116
  }
187
117
  };
188
118
  export {
@@ -1,7 +1,6 @@
1
- /**
2
- * Copyright (c) 2024, 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 function DescriptionField(): import("react/jsx-runtime").JSX.Element;
1
+ import { SxProps, Theme } from '@mui/material';
2
+
3
+ export interface DescriptionFieldProps {
4
+ expandingTextSx?: SxProps<Theme>;
5
+ }
6
+ export declare function DescriptionField({ expandingTextSx }: Readonly<DescriptionFieldProps>): import("react/jsx-runtime").JSX.Element;
@@ -2,12 +2,16 @@ import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import { useState } from "react";
3
3
  import { FormattedMessage } from "react-intl";
4
4
  import { Box, Button } from "@mui/material";
5
- import AddIcon from "@mui/icons-material/Add";
5
+ import AddIcon from "@mui/icons-material/ControlPoint";
6
6
  import DeleteIcon from "@mui/icons-material/Delete";
7
7
  import { useFormContext } from "react-hook-form";
8
8
  import { FieldConstants } from "../../../../utils/constants/fieldConstants.js";
9
+ import "../../../../utils/conversionUtils.js";
10
+ import "@mui/icons-material";
11
+ import "../../../../utils/types/equipmentType.js";
12
+ import "../../../../utils/yupConfig.js";
9
13
  import { ExpandingTextField } from "./ExpandingTextField.js";
10
- function DescriptionField() {
14
+ function DescriptionField({ expandingTextSx }) {
11
15
  const { setValue, getValues } = useFormContext();
12
16
  const description = getValues(FieldConstants.DESCRIPTION);
13
17
  const [isDescriptionFieldVisible, setIsDescriptionFieldVisible] = useState(!!description);
@@ -26,7 +30,7 @@ function DescriptionField() {
26
30
  label: "descriptionProperty",
27
31
  minRows: 3,
28
32
  rows: 3,
29
- sx: { flexGrow: 1 }
33
+ sx: expandingTextSx
30
34
  }
31
35
  ),
32
36
  /* @__PURE__ */ jsx(
@@ -1,4 +1,4 @@
1
- import { TextFieldProps } from '@mui/material';
1
+ import { SxProps, TextFieldProps, Theme } from '@mui/material';
2
2
  import { UUID } from 'crypto';
3
3
  import { ElementType } from '../../../../utils';
4
4
 
@@ -10,8 +10,10 @@ export interface UniqueNameInputProps {
10
10
  onManualChangeCallback?: () => void;
11
11
  formProps?: Omit<TextFieldProps, 'value' | 'onChange' | 'name' | 'label' | 'inputRef' | 'inputProps' | 'InputProps'>;
12
12
  activeDirectory?: UUID;
13
+ sx?: SxProps<Theme>;
14
+ fullWidth?: boolean;
13
15
  }
14
16
  /**
15
17
  * Input component that constantly check if the field's value is available or not
16
18
  */
17
- export declare function UniqueNameInput({ name, label, elementType, autoFocus, onManualChangeCallback, formProps, activeDirectory, }: Readonly<UniqueNameInputProps>): import("react/jsx-runtime").JSX.Element;
19
+ export declare function UniqueNameInput({ name, label, elementType, autoFocus, onManualChangeCallback, formProps, activeDirectory, sx, fullWidth, }: Readonly<UniqueNameInputProps>): import("react/jsx-runtime").JSX.Element;
@@ -6,6 +6,7 @@ import CheckIcon from "@mui/icons-material/Check";
6
6
  import { useController, useFormContext } from "react-hook-form";
7
7
  import CircularProgress from "@mui/material/CircularProgress";
8
8
  import TextField from "@mui/material/TextField";
9
+ import "../../../../utils/types/equipmentType.js";
9
10
  import { elementAlreadyExists } from "../../../../services/directory.js";
10
11
  import { useDebounce } from "../../../../hooks/useDebounce.js";
11
12
  import "localized-countries";
@@ -23,7 +24,9 @@ function UniqueNameInput({
23
24
  autoFocus,
24
25
  onManualChangeCallback,
25
26
  formProps,
26
- activeDirectory
27
+ activeDirectory,
28
+ sx,
29
+ fullWidth = true
27
30
  }) {
28
31
  var _a;
29
32
  const {
@@ -108,6 +111,7 @@ function UniqueNameInput({
108
111
  return /* @__PURE__ */ jsx(
109
112
  TextField,
110
113
  {
114
+ autoComplete: "new-password",
111
115
  onChange: handleManualChange,
112
116
  onBlur,
113
117
  value,
@@ -117,7 +121,8 @@ function UniqueNameInput({
117
121
  type: "text",
118
122
  autoFocus,
119
123
  margin: "dense",
120
- fullWidth: true,
124
+ sx,
125
+ fullWidth,
121
126
  error: !!error,
122
127
  helperText: translatedError,
123
128
  InputProps: { endAdornment },
@@ -18,6 +18,9 @@ export declare const useModificationLabelComputer: () => {
18
18
  equipmentAttributeName: string;
19
19
  equipmentAttributeValue: string;
20
20
  computedLabel: string | import("react/jsx-runtime").JSX.Element;
21
+ } | {
22
+ voltageLevelEquipmentId: string | import("react/jsx-runtime").JSX.Element;
23
+ substationEquipmentId: string | import("react/jsx-runtime").JSX.Element;
21
24
  } | {
22
25
  computedLabel: any;
23
26
  };
@@ -2,7 +2,7 @@ import { jsx } from "react/jsx-runtime";
2
2
  import { useIntl } from "react-intl";
3
3
  import { useCallback } from "react";
4
4
  import { MODIFICATION_TYPES } from "../utils/types/modificationType.js";
5
- import { EQUIPMENT_TYPE } from "../utils/types/equipmentType.js";
5
+ import { EquipmentType } from "../utils/types/equipmentType.js";
6
6
  const getOperatingStatusModificationValues = (modification, formatBold) => {
7
7
  return {
8
8
  action: modification.action,
@@ -17,6 +17,12 @@ const getEquipmentAttributeModificationValues = (modification, formatBold) => {
17
17
  computedLabel: formatBold ? /* @__PURE__ */ jsx("strong", { children: modification.equipmentId }) : modification.equipmentId
18
18
  };
19
19
  };
20
+ const getVoltageLevelWithSubstationModificationValues = (modification, formatBold) => {
21
+ return {
22
+ voltageLevelEquipmentId: formatBold ? /* @__PURE__ */ jsx("strong", { children: modification.voltageLevelEquipmentId }) : modification.voltageLevelEquipmentId,
23
+ substationEquipmentId: formatBold ? /* @__PURE__ */ jsx("strong", { children: modification.substationEquipmentId }) : modification.substationEquipmentId
24
+ };
25
+ };
20
26
  const useModificationLabelComputer = () => {
21
27
  const intl = useIntl();
22
28
  const getLabel = useCallback(
@@ -39,7 +45,7 @@ const useModificationLabelComputer = () => {
39
45
  });
40
46
  case MODIFICATION_TYPES.BY_FILTER_DELETION.type:
41
47
  return intl.formatMessage({
42
- id: modificationMetadata.equipmentType === EQUIPMENT_TYPE.HVDC_LINE ? "Hvdc" : modificationMetadata.equipmentType
48
+ id: modificationMetadata.equipmentType === EquipmentType.HVDC_LINE ? "Hvdc" : modificationMetadata.equipmentType
43
49
  });
44
50
  case MODIFICATION_TYPES.TABULAR_CREATION.type:
45
51
  return intl.formatMessage({
@@ -59,6 +65,8 @@ const useModificationLabelComputer = () => {
59
65
  return getOperatingStatusModificationValues(modificationValues, formatBold);
60
66
  case MODIFICATION_TYPES.EQUIPMENT_ATTRIBUTE_MODIFICATION.type:
61
67
  return getEquipmentAttributeModificationValues(modificationValues, formatBold);
68
+ case MODIFICATION_TYPES.VOLTAGE_LEVEL_CREATION_SUBSTATION_CREATION.type:
69
+ return getVoltageLevelWithSubstationModificationValues(modificationValues, formatBold);
62
70
  default:
63
71
  return { computedLabel: formatBold ? /* @__PURE__ */ jsx("strong", { children: getLabel(modif) }) : getLabel(modif) };
64
72
  }
package/dist/index.js CHANGED
@@ -135,7 +135,7 @@ import { getFileIcon } from "./utils/mapper/getFileIcon.js";
135
135
  import { equipmentTypesForPredefinedPropertiesMapper } from "./utils/mapper/equipmentTypesForPredefinedPropertiesMapper.js";
136
136
  import { makeComposeClasses, mergeSx, toNestedGlobalSelectors } from "./utils/styles.js";
137
137
  import { ElementType } from "./utils/types/elementType.js";
138
- import { EQUIPMENT_TYPE, EquipmentType, HvdcType, OperatingStatus, TYPE_TAG_MAX_SIZE, VL_TAG_MAX_SIZE, equipmentStyles, getEquipmentsInfosForSearchBar } from "./utils/types/equipmentType.js";
138
+ import { BASE_EQUIPMENTS, EQUIPMENT_TYPE, EquipmentType, ExtendedEquipmentType, OperatingStatus, SEARCH_EQUIPMENTS, TYPE_TAG_MAX_SIZE, VL_TAG_MAX_SIZE, equipmentStyles, getEquipmentsInfosForSearchBar } from "./utils/types/equipmentType.js";
139
139
  import { Battery, BusBar, DanglingLine, Generator, Hvdc, LCC, Line, Load, SVC, ShuntCompensator, Substation, ThreeWindingTransfo, TwoWindingTransfo, VSC, VoltageLevel } from "./utils/types/equipmentTypes.js";
140
140
  import { MODIFICATION_TYPES, ModificationType } from "./utils/types/modificationType.js";
141
141
  import { FieldType } from "./utils/types/fieldType.js";
@@ -191,6 +191,7 @@ export {
191
191
  default3 as AuthenticationRouterErrorDisplay,
192
192
  AutocompleteInput,
193
193
  AutocompleteWithFavorites,
194
+ BASE_EQUIPMENTS,
194
195
  Battery,
195
196
  BooleanInput,
196
197
  BottomRightButtons,
@@ -245,6 +246,7 @@ export {
245
246
  ExpertFilterForm,
246
247
  ExplicitNamingFilterEditionDialog,
247
248
  ExplicitNamingFilterForm,
249
+ ExtendedEquipmentType,
248
250
  FIELDS_OPTIONS,
249
251
  FILTER_EQUIPMENTS,
250
252
  FILTER_EQUIPMENTS_ATTRIBUTES,
@@ -263,7 +265,6 @@ export {
263
265
  GridLogo,
264
266
  GroupValueEditor,
265
267
  Hvdc,
266
- HvdcType,
267
268
  InputWithPopupConfirmation,
268
269
  IntegerInput,
269
270
  KILO_AMPERE,
@@ -317,6 +318,7 @@ export {
317
318
  RawReadOnlyInput,
318
319
  RemoveButton,
319
320
  RuleValueEditor,
321
+ SEARCH_EQUIPMENTS,
320
322
  SHOW_AUTH_INFO_LOGIN,
321
323
  SHUNT_COMPENSATOR_TYPE_OPTIONS,
322
324
  SIEMENS,
@@ -9,4 +9,5 @@ export declare const descriptionEn: {
9
9
  descriptionProperty: string;
10
10
  descriptionModificationError: string;
11
11
  descriptionLimitError: string;
12
+ AddDescription: string;
12
13
  };
@@ -1,8 +1,9 @@
1
1
  const descriptionEn = {
2
2
  description: "Description",
3
- descriptionProperty: "Description (optional)",
3
+ descriptionProperty: "Description",
4
4
  descriptionModificationError: "An error occurred while editing the description",
5
- descriptionLimitError: "Description exceeds character limit"
5
+ descriptionLimitError: "Description exceeds character limit",
6
+ AddDescription: "Add a description"
6
7
  };
7
8
  export {
8
9
  descriptionEn
@@ -17,6 +17,8 @@ export declare const equipmentSearchEn: {
17
17
  'equipment_search/shuntTag': string;
18
18
  'equipment_search/svcTag': string;
19
19
  'equipment_search/hvdcLineTag': string;
20
+ 'equipment_search/hvdcLineVscTag': string;
21
+ 'equipment_search/hvdcLineLccTag': string;
20
22
  'equipment_search/hvdcStationTag': string;
21
23
  'equipment_search/voltageLevelTag': string;
22
24
  'equipment_search/substationTag': string;
@@ -11,6 +11,8 @@ const equipmentSearchEn = {
11
11
  "equipment_search/shuntTag": "SHUNT",
12
12
  "equipment_search/svcTag": "SVC",
13
13
  "equipment_search/hvdcLineTag": "HVDC LINE",
14
+ "equipment_search/hvdcLineVscTag": "HVDC LINE (VSC)",
15
+ "equipment_search/hvdcLineLccTag": "HVDC LINE (LCC)",
14
16
  "equipment_search/hvdcStationTag": "HVDC STATION",
15
17
  "equipment_search/voltageLevelTag": "VOLTAGE LEVEL",
16
18
  "equipment_search/substationTag": "SUBSTATION",
@@ -59,4 +59,5 @@ export declare const networkModificationsEn: {
59
59
  'network_modifications.tabular.GENERATOR_CREATION': string;
60
60
  'network_modifications.LCC_CREATION': string;
61
61
  'network_modifications.STATIC_VAR_COMPENSATOR_CREATION': string;
62
+ 'network_modifications.VOLTAGE_LEVEL_CREATION_SUBSTATION_CREATION': string;
62
63
  };
@@ -52,7 +52,8 @@ const networkModificationsEn = {
52
52
  "network_modifications.TABULAR_CREATION": "Tabular creation - {computedLabel}",
53
53
  "network_modifications.tabular.GENERATOR_CREATION": "generator creations",
54
54
  "network_modifications.LCC_CREATION": "Creating HVDC (LCC) {computedLabel}",
55
- "network_modifications.STATIC_VAR_COMPENSATOR_CREATION": "Creating static var compensator {computedLabel}"
55
+ "network_modifications.STATIC_VAR_COMPENSATOR_CREATION": "Creating static var compensator {computedLabel}",
56
+ "network_modifications.VOLTAGE_LEVEL_CREATION_SUBSTATION_CREATION": "Creating voltage level {voltageLevelEquipmentId} and substation {substationEquipmentId}"
56
57
  };
57
58
  export {
58
59
  networkModificationsEn
@@ -9,4 +9,5 @@ export declare const descriptionFr: {
9
9
  descriptionProperty: string;
10
10
  descriptionModificationError: string;
11
11
  descriptionLimitError: string;
12
+ AddDescription: string;
12
13
  };
@@ -1,8 +1,9 @@
1
1
  const descriptionFr = {
2
2
  description: "Description",
3
- descriptionProperty: "Description (optionnel)",
3
+ descriptionProperty: "Description",
4
4
  descriptionModificationError: "Erreur lors de la modification de la description",
5
- descriptionLimitError: "La description dépasse la limite de caractères"
5
+ descriptionLimitError: "La description dépasse la limite de caractères",
6
+ AddDescription: "Ajouter une description"
6
7
  };
7
8
  export {
8
9
  descriptionFr
@@ -17,6 +17,8 @@ export declare const equipmentSearchFr: {
17
17
  'equipment_search/shuntTag': string;
18
18
  'equipment_search/svcTag': string;
19
19
  'equipment_search/hvdcLineTag': string;
20
+ 'equipment_search/hvdcLineVscTag': string;
21
+ 'equipment_search/hvdcLineLccTag': string;
20
22
  'equipment_search/hvdcStationTag': string;
21
23
  'equipment_search/voltageLevelTag': string;
22
24
  'equipment_search/substationTag': string;
@@ -11,6 +11,8 @@ const equipmentSearchFr = {
11
11
  "equipment_search/shuntTag": "MCS",
12
12
  "equipment_search/svcTag": "CSPR",
13
13
  "equipment_search/hvdcLineTag": "LIGNE HVDC",
14
+ "equipment_search/hvdcLineVscTag": "LIGNE HVDC (VSC)",
15
+ "equipment_search/hvdcLineLccTag": "LIGNE HVDC (LCC)",
14
16
  "equipment_search/hvdcStationTag": "STATION HVDC",
15
17
  "equipment_search/voltageLevelTag": "POSTE",
16
18
  "equipment_search/substationTag": "SITE",
@@ -59,4 +59,5 @@ export declare const networkModificationsFr: {
59
59
  'network_modifications.tabular.GENERATOR_CREATION': string;
60
60
  'network_modifications.LCC_CREATION': string;
61
61
  'network_modifications.STATIC_VAR_COMPENSATOR_CREATION': string;
62
+ 'network_modifications.VOLTAGE_LEVEL_CREATION_SUBSTATION_CREATION': string;
62
63
  };
@@ -52,7 +52,8 @@ const networkModificationsFr = {
52
52
  "network_modifications.TABULAR_CREATION": "Création tabulaire - {computedLabel}",
53
53
  "network_modifications.tabular.GENERATOR_CREATION": "créations de générateurs",
54
54
  "network_modifications.LCC_CREATION": "Création de la HVDC (LCC) {computedLabel}",
55
- "network_modifications.STATIC_VAR_COMPENSATOR_CREATION": "Création de CSPR {computedLabel}"
55
+ "network_modifications.STATIC_VAR_COMPENSATOR_CREATION": "Création de CSPR {computedLabel}",
56
+ "network_modifications.VOLTAGE_LEVEL_CREATION_SUBSTATION_CREATION": "Création du poste {voltageLevelEquipmentId} et du site {substationEquipmentId}"
56
57
  };
57
58
  export {
58
59
  networkModificationsFr
@@ -10,7 +10,7 @@ import { getFileIcon } from "./mapper/getFileIcon.js";
10
10
  import { equipmentTypesForPredefinedPropertiesMapper } from "./mapper/equipmentTypesForPredefinedPropertiesMapper.js";
11
11
  import { makeComposeClasses, mergeSx, toNestedGlobalSelectors } from "./styles.js";
12
12
  import { ElementType } from "./types/elementType.js";
13
- import { EQUIPMENT_TYPE, EquipmentType, HvdcType, OperatingStatus, TYPE_TAG_MAX_SIZE, VL_TAG_MAX_SIZE, equipmentStyles, getEquipmentsInfosForSearchBar } from "./types/equipmentType.js";
13
+ import { BASE_EQUIPMENTS, EQUIPMENT_TYPE, EquipmentType, ExtendedEquipmentType, OperatingStatus, SEARCH_EQUIPMENTS, TYPE_TAG_MAX_SIZE, VL_TAG_MAX_SIZE, equipmentStyles, getEquipmentsInfosForSearchBar } from "./types/equipmentType.js";
14
14
  import { Battery, BusBar, DanglingLine, Generator, Hvdc, LCC, Line, Load, SVC, ShuntCompensator, Substation, ThreeWindingTransfo, TwoWindingTransfo, VSC, VoltageLevel } from "./types/equipmentTypes.js";
15
15
  import { MODIFICATION_TYPES, ModificationType } from "./types/modificationType.js";
16
16
  import { FieldType } from "./types/fieldType.js";
@@ -18,6 +18,7 @@ import "./yupConfig.js";
18
18
  import * as yup from "yup";
19
19
  export {
20
20
  AMPERE,
21
+ BASE_EQUIPMENTS,
21
22
  Battery,
22
23
  BusBar,
23
24
  DARK_THEME,
@@ -26,13 +27,13 @@ export {
26
27
  EQUIPMENT_TYPE,
27
28
  ElementType,
28
29
  EquipmentType,
30
+ ExtendedEquipmentType,
29
31
  FetchStatus,
30
32
  FieldConstants,
31
33
  FieldType,
32
34
  GRIDSUITE_DEFAULT_PRECISION,
33
35
  Generator,
34
36
  Hvdc,
35
- HvdcType,
36
37
  KILO_AMPERE,
37
38
  KILO_METER,
38
39
  KILO_VOLT,
@@ -53,6 +54,7 @@ export {
53
54
  OHM,
54
55
  OperatingStatus,
55
56
  PERCENTAGE,
57
+ SEARCH_EQUIPMENTS,
56
58
  SIEMENS,
57
59
  SVC,
58
60
  ShuntCompensator,
@@ -63,26 +63,34 @@ export declare enum EquipmentType {
63
63
  DISCONNECTOR = "DISCONNECTOR",
64
64
  BREAKER = "BREAKER"
65
65
  }
66
- export declare enum HvdcType {
67
- LCC = "LCC",
68
- VSC = "VSC"
66
+ export declare enum ExtendedEquipmentType {
67
+ HVDC_LINE_LCC = "HVDC_LINE_LCC",
68
+ HVDC_LINE_VSC = "HVDC_LINE_VSC"
69
69
  }
70
- export declare const EQUIPMENT_TYPE: Record<EquipmentType, {
71
- name: EquipmentType;
70
+ export declare const BASE_EQUIPMENTS: Partial<Record<EquipmentType, {
71
+ id: EquipmentType;
72
+ label: string;
73
+ }>>;
74
+ export declare const EQUIPMENT_TYPE: Partial<Record<EquipmentType | ExtendedEquipmentType, {
75
+ name: EquipmentType | ExtendedEquipmentType;
72
76
  tagLabel: string;
73
- } | undefined>;
77
+ } | undefined>>;
78
+ export declare const SEARCH_EQUIPMENTS: Partial<Record<EquipmentType | ExtendedEquipmentType, {
79
+ id: EquipmentType | ExtendedEquipmentType;
80
+ label: string;
81
+ }>>;
74
82
  export interface Identifiable {
75
83
  id: string;
76
84
  name?: string;
77
85
  }
78
86
  export interface Equipment extends Identifiable {
79
- type: EquipmentType;
87
+ type: EquipmentType | ExtendedEquipmentType;
80
88
  voltageLevels?: Identifiable[];
81
89
  }
82
90
  export interface EquipmentInfos extends Identifiable {
83
91
  label: string;
84
92
  key: string;
85
- type: EquipmentType;
93
+ type: EquipmentType | ExtendedEquipmentType;
86
94
  voltageLevelLabel?: string;
87
95
  voltageLevelId?: string;
88
96
  operatingStatus?: string;
@@ -65,11 +65,90 @@ var EquipmentType = /* @__PURE__ */ ((EquipmentType2) => {
65
65
  EquipmentType2["BREAKER"] = "BREAKER";
66
66
  return EquipmentType2;
67
67
  })(EquipmentType || {});
68
- var HvdcType = /* @__PURE__ */ ((HvdcType2) => {
69
- HvdcType2["LCC"] = "LCC";
70
- HvdcType2["VSC"] = "VSC";
71
- return HvdcType2;
72
- })(HvdcType || {});
68
+ var ExtendedEquipmentType = /* @__PURE__ */ ((ExtendedEquipmentType2) => {
69
+ ExtendedEquipmentType2["HVDC_LINE_LCC"] = "HVDC_LINE_LCC";
70
+ ExtendedEquipmentType2["HVDC_LINE_VSC"] = "HVDC_LINE_VSC";
71
+ return ExtendedEquipmentType2;
72
+ })(ExtendedEquipmentType || {});
73
+ const BASE_EQUIPMENTS = {
74
+ [
75
+ "SUBSTATION"
76
+ /* SUBSTATION */
77
+ ]: {
78
+ id: "SUBSTATION",
79
+ label: "Substations"
80
+ },
81
+ [
82
+ "VOLTAGE_LEVEL"
83
+ /* VOLTAGE_LEVEL */
84
+ ]: {
85
+ id: "VOLTAGE_LEVEL",
86
+ label: "VoltageLevels"
87
+ },
88
+ [
89
+ "LINE"
90
+ /* LINE */
91
+ ]: {
92
+ id: "LINE",
93
+ label: "Lines"
94
+ },
95
+ [
96
+ "TWO_WINDINGS_TRANSFORMER"
97
+ /* TWO_WINDINGS_TRANSFORMER */
98
+ ]: {
99
+ id: "TWO_WINDINGS_TRANSFORMER",
100
+ label: "TwoWindingsTransformers"
101
+ },
102
+ [
103
+ "THREE_WINDINGS_TRANSFORMER"
104
+ /* THREE_WINDINGS_TRANSFORMER */
105
+ ]: {
106
+ id: "THREE_WINDINGS_TRANSFORMER",
107
+ label: "ThreeWindingsTransformers"
108
+ },
109
+ [
110
+ "GENERATOR"
111
+ /* GENERATOR */
112
+ ]: {
113
+ id: "GENERATOR",
114
+ label: "Generators"
115
+ },
116
+ [
117
+ "BATTERY"
118
+ /* BATTERY */
119
+ ]: {
120
+ id: "BATTERY",
121
+ label: "Batteries"
122
+ },
123
+ [
124
+ "LOAD"
125
+ /* LOAD */
126
+ ]: {
127
+ id: "LOAD",
128
+ label: "Loads"
129
+ },
130
+ [
131
+ "SHUNT_COMPENSATOR"
132
+ /* SHUNT_COMPENSATOR */
133
+ ]: {
134
+ id: "SHUNT_COMPENSATOR",
135
+ label: "ShuntCompensators"
136
+ },
137
+ [
138
+ "STATIC_VAR_COMPENSATOR"
139
+ /* STATIC_VAR_COMPENSATOR */
140
+ ]: {
141
+ id: "STATIC_VAR_COMPENSATOR",
142
+ label: "StaticVarCompensators"
143
+ },
144
+ [
145
+ "DANGLING_LINE"
146
+ /* DANGLING_LINE */
147
+ ]: {
148
+ id: "DANGLING_LINE",
149
+ label: "DanglingLines"
150
+ }
151
+ };
73
152
  const EQUIPMENT_TYPE = {
74
153
  [
75
154
  "SUBSTATION"
@@ -107,11 +186,18 @@ const EQUIPMENT_TYPE = {
107
186
  tagLabel: "equipment_search/3wtTag"
108
187
  },
109
188
  [
110
- "HVDC_LINE"
111
- /* HVDC_LINE */
189
+ "HVDC_LINE_LCC"
190
+ /* HVDC_LINE_LCC */
191
+ ]: {
192
+ name: "HVDC_LINE_LCC",
193
+ tagLabel: "equipment_search/hvdcLineLccTag"
194
+ },
195
+ [
196
+ "HVDC_LINE_VSC"
197
+ /* HVDC_LINE_VSC */
112
198
  ]: {
113
- name: "HVDC_LINE",
114
- tagLabel: "equipment_search/hvdcLineTag"
199
+ name: "HVDC_LINE_VSC",
200
+ tagLabel: "equipment_search/hvdcLineVscTag"
115
201
  },
116
202
  [
117
203
  "GENERATOR"
@@ -196,22 +282,24 @@ const EQUIPMENT_TYPE = {
196
282
  ]: {
197
283
  name: "LCC_CONVERTER_STATION",
198
284
  tagLabel: "equipment_search/lccConverterStationTag"
199
- },
200
- [
201
- "TIE_LINE"
202
- /* TIE_LINE */
203
- ]: void 0,
204
- // Not used in the UI
285
+ }
286
+ };
287
+ const SEARCH_EQUIPMENTS = {
288
+ ...BASE_EQUIPMENTS,
205
289
  [
206
- "DISCONNECTOR"
207
- /* DISCONNECTOR */
208
- ]: void 0,
209
- // Not used in the UI
290
+ "HVDC_LINE_LCC"
291
+ /* HVDC_LINE_LCC */
292
+ ]: {
293
+ id: "HVDC_LINE_LCC",
294
+ label: "LCC"
295
+ },
210
296
  [
211
- "BREAKER"
212
- /* BREAKER */
213
- ]: void 0
214
- // Not used in the UI
297
+ "HVDC_LINE_VSC"
298
+ /* HVDC_LINE_VSC */
299
+ ]: {
300
+ id: "HVDC_LINE_VSC",
301
+ label: "VSC"
302
+ }
215
303
  };
216
304
  const OperatingStatus = {
217
305
  IN_OPERATION: "IN_OPERATION",
@@ -242,10 +330,12 @@ const getEquipmentsInfosForSearchBar = (equipmentsInfos, getNameOrId) => {
242
330
  });
243
331
  };
244
332
  export {
333
+ BASE_EQUIPMENTS,
245
334
  EQUIPMENT_TYPE,
246
335
  EquipmentType,
247
- HvdcType,
336
+ ExtendedEquipmentType,
248
337
  OperatingStatus,
338
+ SEARCH_EQUIPMENTS,
249
339
  TYPE_TAG_MAX_SIZE,
250
340
  VL_TAG_MAX_SIZE,
251
341
  equipmentStyles,
@@ -1,25 +1,27 @@
1
1
  import { ElementType } from "./elementType.js";
2
- import { EQUIPMENT_TYPE, EquipmentType, HvdcType, OperatingStatus, TYPE_TAG_MAX_SIZE, VL_TAG_MAX_SIZE, equipmentStyles, getEquipmentsInfosForSearchBar } from "./equipmentType.js";
2
+ import { BASE_EQUIPMENTS, EQUIPMENT_TYPE, EquipmentType, ExtendedEquipmentType, OperatingStatus, SEARCH_EQUIPMENTS, TYPE_TAG_MAX_SIZE, VL_TAG_MAX_SIZE, equipmentStyles, getEquipmentsInfosForSearchBar } from "./equipmentType.js";
3
3
  import { Battery, BusBar, DanglingLine, Generator, Hvdc, LCC, Line, Load, SVC, ShuntCompensator, Substation, ThreeWindingTransfo, TwoWindingTransfo, VSC, VoltageLevel } from "./equipmentTypes.js";
4
4
  import { MODIFICATION_TYPES, ModificationType } from "./modificationType.js";
5
5
  import { FieldType } from "./fieldType.js";
6
6
  export {
7
+ BASE_EQUIPMENTS,
7
8
  Battery,
8
9
  BusBar,
9
10
  DanglingLine,
10
11
  EQUIPMENT_TYPE,
11
12
  ElementType,
12
13
  EquipmentType,
14
+ ExtendedEquipmentType,
13
15
  FieldType,
14
16
  Generator,
15
17
  Hvdc,
16
- HvdcType,
17
18
  LCC,
18
19
  Line,
19
20
  Load,
20
21
  MODIFICATION_TYPES,
21
22
  ModificationType,
22
23
  OperatingStatus,
24
+ SEARCH_EQUIPMENTS,
23
25
  SVC,
24
26
  ShuntCompensator,
25
27
  Substation,
@@ -175,4 +175,7 @@ export declare const MODIFICATION_TYPES: {
175
175
  LCC_CREATION: {
176
176
  type: ModificationType;
177
177
  };
178
+ VOLTAGE_LEVEL_CREATION_SUBSTATION_CREATION: {
179
+ type: string;
180
+ };
178
181
  };
@@ -210,6 +210,9 @@ const MODIFICATION_TYPES = {
210
210
  LCC_CREATION: {
211
211
  type: "LCC_CREATION"
212
212
  /* LCC_CREATION */
213
+ },
214
+ VOLTAGE_LEVEL_CREATION_SUBSTATION_CREATION: {
215
+ type: "VOLTAGE_LEVEL_CREATION_SUBSTATION_CREATION"
213
216
  }
214
217
  };
215
218
  export {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gridsuite/commons-ui",
3
- "version": "0.87.0",
3
+ "version": "0.88.1",
4
4
  "description": "common react components for gridsuite applications",
5
5
  "engines": {
6
6
  "node": ">=22",