@gridsuite/commons-ui 0.220.0 → 0.221.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.
- package/dist/components/composite/agGridTable/CustomAgGridTable.d.ts +3 -2
- package/dist/components/composite/agGridTable/CustomAgGridTable.js +122 -127
- package/dist/components/composite/filter/explicitNaming/ExplicitNamingFilterForm.js +0 -1
- package/dist/features/network-modifications/battery/creation/BatteryCreationForm.js +2 -1
- package/dist/features/network-modifications/battery/creation/batteryCreation.utils.js +2 -1
- package/dist/features/network-modifications/battery/modification/BatteryDialogHeader.js +2 -1
- package/dist/features/network-modifications/battery/modification/BatteryDialogTabsContent.js +2 -1
- package/dist/features/network-modifications/battery/modification/batteryModification.utils.js +2 -1
- package/dist/features/network-modifications/common/measurements/BusbarSectionVoltageMeasurementsForm.js +2 -1
- package/dist/features/network-modifications/equipmentDeletion/EquipmentDeletionForm.js +2 -1
- package/dist/features/network-modifications/load/common/LoadDialogHeader.js +2 -1
- package/dist/features/network-modifications/load/modification/loadModification.utils.js +2 -1
- package/dist/features/network-modifications/shunt-compensator/creation/ShuntCompensatorCreationForm.js +2 -1
- package/dist/features/network-modifications/shunt-compensator/creation/shuntCompensatorCreation.utils.js +2 -1
- package/dist/features/network-modifications/shunt-compensator/modification/ShuntCompensatorModificationForm.js +2 -1
- package/dist/features/network-modifications/shunt-compensator/modification/shuntCompensatorModification.utils.js +2 -1
- package/dist/features/network-modifications/substation/creation/SubstationCreationForm.js +2 -1
- package/dist/features/network-modifications/substation/modification/SubstationModificationForm.js +2 -1
- package/dist/features/network-modifications/voltageLevel/creation/VoltageLevelCreationForm.js +2 -1
- package/dist/features/network-modifications/voltageLevel/creation/index.js +2 -1
- package/dist/features/network-modifications/voltageLevel/creation/tabs/substationTab/SubstationCreationSection.js +2 -1
- package/dist/features/network-modifications/voltageLevel/creation/voltageLevelCreation.utils.js +2 -1
- package/dist/features/network-modifications/voltageLevel/index.js +2 -1
- package/dist/features/network-modifications/voltageLevel/modification/VoltageLevelModificationForm.js +2 -1
- package/dist/features/parameters/common/contingency-table/columns-definitions.js +2 -1
- package/dist/features/parameters/dynamic-margin-calculation/loads-variations-parameters.js +2 -1
- package/dist/features/parameters/sensi/utils.js +8 -7
- package/dist/features/parameters/short-circuit/short-circuit-parameters-utils.js +2 -1
- package/dist/features/parameters/voltage-init/use-voltage-init-parameters-form.js +3 -2
- package/dist/translations/en/parameters.d.ts +0 -2
- package/dist/translations/en/parameters.js +0 -2
- package/dist/translations/fr/parameters.d.ts +0 -2
- package/dist/translations/fr/parameters.js +0 -2
- package/package.json +1 -1
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import { FieldValues, UseFieldArrayReturn } from 'react-hook-form';
|
|
1
2
|
import { CustomAGGridProps } from '../customAGGrid';
|
|
2
|
-
export type CustomAgGridTableProps = Required<Pick<CustomAGGridProps, 'columnDefs'
|
|
3
|
+
export type CustomAgGridTableProps = Required<Pick<CustomAGGridProps, 'columnDefs'>> & Pick<CustomAGGridProps, 'defaultColDef' | 'pagination' | 'paginationPageSize' | 'alwaysShowVerticalScroll' | 'stopEditingWhenCellsLoseFocus' | 'rowSelection' | 'overrideLocales' | 'loading'> & {
|
|
3
4
|
name: string;
|
|
4
5
|
makeDefaultRowData: any;
|
|
5
6
|
csvProps: unknown;
|
|
6
7
|
cssProps: unknown;
|
|
7
8
|
};
|
|
8
|
-
export declare
|
|
9
|
+
export declare const CustomAgGridTable: import('react').ForwardRefExoticComponent<Readonly<CustomAgGridTableProps> & import('react').RefAttributes<UseFieldArrayReturn<FieldValues, string>>>;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { jsxs, Fragment, jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useState, useCallback, useEffect } from "react";
|
|
2
|
+
import { forwardRef, useState, useImperativeHandle, useCallback, useEffect } from "react";
|
|
3
3
|
import { useFormContext, useFieldArray } from "react-hook-form";
|
|
4
4
|
import { useTheme, Box } from "@mui/material";
|
|
5
5
|
import { BottomRightButtons } from "./BottomRightButtons.js";
|
|
6
6
|
import { FieldConstants } from "../../../utils/constants/fieldConstants.js";
|
|
7
|
-
import { CustomAGGrid } from "../customAGGrid/customAggrid.js";
|
|
8
7
|
import "../../../utils/conversionUtils.js";
|
|
9
8
|
import "../../../utils/types/equipmentType.js";
|
|
10
9
|
import "@mui/icons-material";
|
|
10
|
+
import { CustomAGGrid } from "../customAGGrid/customAggrid.js";
|
|
11
11
|
import "react-intl";
|
|
12
12
|
const style = (customProps) => ({
|
|
13
13
|
grid: (theme) => ({
|
|
@@ -64,137 +64,132 @@ const style = (customProps) => ({
|
|
|
64
64
|
...customProps
|
|
65
65
|
})
|
|
66
66
|
});
|
|
67
|
-
|
|
68
|
-
name,
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
})
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
const [newRowAdded, setNewRowAdded] = useState(false);
|
|
79
|
-
const [isSortApplied, setIsSortApplied] = useState(false);
|
|
80
|
-
const { control, getValues, watch } = useFormContext();
|
|
81
|
-
const useFieldArrayOutput = useFieldArray({
|
|
82
|
-
control,
|
|
83
|
-
name
|
|
84
|
-
});
|
|
85
|
-
const { append, remove, update, swap, move } = useFieldArrayOutput;
|
|
86
|
-
const rowData = watch(name);
|
|
87
|
-
const isFirstSelected = Boolean(
|
|
88
|
-
rowData?.length && gridApi?.api.getRowNode(rowData[0][FieldConstants.AG_GRID_ROW_UUID])?.isSelected()
|
|
89
|
-
);
|
|
90
|
-
const isLastSelected = Boolean(
|
|
91
|
-
rowData?.length && gridApi?.api.getRowNode(rowData[rowData.length - 1][FieldConstants.AG_GRID_ROW_UUID])?.isSelected()
|
|
92
|
-
);
|
|
93
|
-
const noRowSelected = selectedRows.length === 0;
|
|
94
|
-
const getIndex = useCallback(
|
|
95
|
-
(val) => {
|
|
96
|
-
return getValues(name).findIndex(
|
|
97
|
-
(row) => row[FieldConstants.AG_GRID_ROW_UUID] === val[FieldConstants.AG_GRID_ROW_UUID]
|
|
98
|
-
);
|
|
99
|
-
},
|
|
100
|
-
[getValues, name]
|
|
101
|
-
);
|
|
102
|
-
const handleMoveRowUp = () => {
|
|
103
|
-
selectedRows.map((row) => getIndex(row)).sort((n1, n2) => n1 - n2).forEach((idx) => {
|
|
104
|
-
swap(idx, idx - 1);
|
|
67
|
+
const CustomAgGridTable = forwardRef(
|
|
68
|
+
function CustomAgGridTable2({ name, makeDefaultRowData, csvProps, cssProps, rowSelection, stopEditingWhenCellsLoseFocus = true, ...props }, ref) {
|
|
69
|
+
const theme = useTheme();
|
|
70
|
+
const [gridApi, setGridApi] = useState(null);
|
|
71
|
+
const [selectedRows, setSelectedRows] = useState([]);
|
|
72
|
+
const [newRowAdded, setNewRowAdded] = useState(false);
|
|
73
|
+
const [isSortApplied, setIsSortApplied] = useState(false);
|
|
74
|
+
const { control, getValues, watch } = useFormContext();
|
|
75
|
+
const useFieldArrayOutput = useFieldArray({
|
|
76
|
+
control,
|
|
77
|
+
name
|
|
105
78
|
});
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
79
|
+
const { append, remove, update, swap, move } = useFieldArrayOutput;
|
|
80
|
+
useImperativeHandle(ref, () => useFieldArrayOutput, [useFieldArrayOutput]);
|
|
81
|
+
const rowData = watch(name);
|
|
82
|
+
const isFirstSelected = Boolean(
|
|
83
|
+
rowData?.length && gridApi?.api.getRowNode(rowData[0][FieldConstants.AG_GRID_ROW_UUID])?.isSelected()
|
|
84
|
+
);
|
|
85
|
+
const isLastSelected = Boolean(
|
|
86
|
+
rowData?.length && gridApi?.api.getRowNode(rowData[rowData.length - 1][FieldConstants.AG_GRID_ROW_UUID])?.isSelected()
|
|
87
|
+
);
|
|
88
|
+
const noRowSelected = selectedRows.length === 0;
|
|
89
|
+
const getIndex = useCallback(
|
|
90
|
+
(val) => {
|
|
91
|
+
return getValues(name).findIndex(
|
|
92
|
+
(row) => row[FieldConstants.AG_GRID_ROW_UUID] === val[FieldConstants.AG_GRID_ROW_UUID]
|
|
93
|
+
);
|
|
94
|
+
},
|
|
95
|
+
[getValues, name]
|
|
96
|
+
);
|
|
97
|
+
const handleMoveRowUp = () => {
|
|
98
|
+
selectedRows.map((row) => getIndex(row)).sort((n1, n2) => n1 - n2).forEach((idx) => {
|
|
99
|
+
swap(idx, idx - 1);
|
|
119
100
|
});
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
gridApi.api.refreshCells({
|
|
125
|
-
force: true
|
|
101
|
+
};
|
|
102
|
+
const handleMoveRowDown = () => {
|
|
103
|
+
selectedRows.map((row) => getIndex(row)).sort((n1, n2) => n1 - n2).reverse().forEach((idx) => {
|
|
104
|
+
swap(idx, idx + 1);
|
|
126
105
|
});
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
const onRowDataUpdated = () => {
|
|
137
|
-
setNewRowAdded(false);
|
|
138
|
-
if (gridApi?.api) {
|
|
139
|
-
const lastIndex = rowData.length - 1;
|
|
140
|
-
gridApi.api.paginationGoToLastPage();
|
|
141
|
-
gridApi.api.ensureIndexVisible(lastIndex, "bottom");
|
|
142
|
-
}
|
|
143
|
-
};
|
|
144
|
-
const onCellEditingStopped = useCallback(
|
|
145
|
-
(event) => {
|
|
146
|
-
const rowIndex = getIndex(event.data);
|
|
147
|
-
if (rowIndex === -1) {
|
|
148
|
-
return;
|
|
106
|
+
};
|
|
107
|
+
const handleDeleteRows = () => {
|
|
108
|
+
if (selectedRows.length === rowData.length) {
|
|
109
|
+
remove();
|
|
110
|
+
} else {
|
|
111
|
+
selectedRows.forEach((val) => {
|
|
112
|
+
const idx = getIndex(val);
|
|
113
|
+
remove(idx);
|
|
114
|
+
});
|
|
149
115
|
}
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
setIsSortApplied(isAnycolumnhasSort);
|
|
157
|
-
}, []);
|
|
158
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
159
|
-
/* @__PURE__ */ jsx(Box, { className: theme.aggrid.theme, sx: style(cssProps).grid, children: /* @__PURE__ */ jsx(
|
|
160
|
-
CustomAGGrid,
|
|
161
|
-
{
|
|
162
|
-
rowData,
|
|
163
|
-
onGridReady,
|
|
164
|
-
cacheOverflowSize: 10,
|
|
165
|
-
rowSelection: rowSelection ?? "multiple",
|
|
166
|
-
rowDragEntireRow: true,
|
|
167
|
-
rowDragManaged: true,
|
|
168
|
-
onRowDragEnd: (e) => move(getIndex(e.node.data), e.overIndex),
|
|
169
|
-
detailRowAutoHeight: true,
|
|
170
|
-
onSelectionChanged: () => {
|
|
171
|
-
setSelectedRows(gridApi.api.getSelectedRows());
|
|
172
|
-
},
|
|
173
|
-
onRowDataUpdated: newRowAdded ? onRowDataUpdated : void 0,
|
|
174
|
-
onCellEditingStopped,
|
|
175
|
-
onSortChanged,
|
|
176
|
-
getRowId: (row) => row.data[FieldConstants.AG_GRID_ROW_UUID],
|
|
177
|
-
theme: "legacy",
|
|
178
|
-
...props
|
|
116
|
+
};
|
|
117
|
+
useEffect(() => {
|
|
118
|
+
if (gridApi) {
|
|
119
|
+
gridApi.api.refreshCells({
|
|
120
|
+
force: true
|
|
121
|
+
});
|
|
179
122
|
}
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
123
|
+
}, [gridApi, rowData]);
|
|
124
|
+
const handleAddRow = () => {
|
|
125
|
+
append(makeDefaultRowData());
|
|
126
|
+
setNewRowAdded(true);
|
|
127
|
+
};
|
|
128
|
+
const onGridReady = (params) => {
|
|
129
|
+
setGridApi(params);
|
|
130
|
+
};
|
|
131
|
+
const onRowDataUpdated = () => {
|
|
132
|
+
setNewRowAdded(false);
|
|
133
|
+
if (gridApi?.api) {
|
|
134
|
+
const lastIndex = rowData.length - 1;
|
|
135
|
+
gridApi.api.paginationGoToLastPage();
|
|
136
|
+
gridApi.api.ensureIndexVisible(lastIndex, "bottom");
|
|
194
137
|
}
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
138
|
+
};
|
|
139
|
+
const onCellEditingStopped = useCallback(
|
|
140
|
+
(event) => {
|
|
141
|
+
const rowIndex = getIndex(event.data);
|
|
142
|
+
if (rowIndex === -1) {
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
145
|
+
update(rowIndex, event.data);
|
|
146
|
+
},
|
|
147
|
+
[getIndex, update]
|
|
148
|
+
);
|
|
149
|
+
const onSortChanged = useCallback((event) => {
|
|
150
|
+
const isAnycolumnhasSort = event.api.getColumnState().some((col) => col.sort);
|
|
151
|
+
setIsSortApplied(isAnycolumnhasSort);
|
|
152
|
+
}, []);
|
|
153
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
154
|
+
/* @__PURE__ */ jsx(Box, { className: theme.aggrid.theme, sx: style(cssProps).grid, children: /* @__PURE__ */ jsx(
|
|
155
|
+
CustomAGGrid,
|
|
156
|
+
{
|
|
157
|
+
rowData,
|
|
158
|
+
onGridReady,
|
|
159
|
+
cacheOverflowSize: 10,
|
|
160
|
+
rowSelection: rowSelection ?? "multiple",
|
|
161
|
+
onRowDragMove: (e) => move(getIndex(e.node.data), e.overIndex),
|
|
162
|
+
detailRowAutoHeight: true,
|
|
163
|
+
onSelectionChanged: () => {
|
|
164
|
+
setSelectedRows(gridApi.api.getSelectedRows());
|
|
165
|
+
},
|
|
166
|
+
onRowDataUpdated: newRowAdded ? onRowDataUpdated : void 0,
|
|
167
|
+
onCellEditingStopped,
|
|
168
|
+
onSortChanged,
|
|
169
|
+
getRowId: (row) => row.data[FieldConstants.AG_GRID_ROW_UUID],
|
|
170
|
+
stopEditingWhenCellsLoseFocus,
|
|
171
|
+
theme: "legacy",
|
|
172
|
+
...props
|
|
173
|
+
}
|
|
174
|
+
) }),
|
|
175
|
+
/* @__PURE__ */ jsx(
|
|
176
|
+
BottomRightButtons,
|
|
177
|
+
{
|
|
178
|
+
name,
|
|
179
|
+
handleAddRow,
|
|
180
|
+
handleDeleteRows,
|
|
181
|
+
handleMoveRowDown,
|
|
182
|
+
handleMoveRowUp,
|
|
183
|
+
disableUp: noRowSelected || isFirstSelected || isSortApplied,
|
|
184
|
+
disableDown: noRowSelected || isLastSelected || isSortApplied,
|
|
185
|
+
disableDelete: noRowSelected,
|
|
186
|
+
csvProps,
|
|
187
|
+
useFieldArrayOutput
|
|
188
|
+
}
|
|
189
|
+
)
|
|
190
|
+
] });
|
|
191
|
+
}
|
|
192
|
+
);
|
|
198
193
|
export {
|
|
199
194
|
CustomAgGridTable
|
|
200
195
|
};
|
|
@@ -54,10 +54,11 @@ import "@react-querybuilder/material";
|
|
|
54
54
|
import "../../../../components/composite/reactQueryBuilder/CustomReactQueryBuilder.js";
|
|
55
55
|
import "../../../../components/composite/reactQueryBuilder/PropertyValueEditor.js";
|
|
56
56
|
import "../../../../components/composite/agGridTable/BottomRightButtons.js";
|
|
57
|
-
import "../../../../components/composite/
|
|
57
|
+
import "../../../../components/composite/agGridTable/CustomAgGridTable.js";
|
|
58
58
|
import "ag-grid-community";
|
|
59
59
|
import "react-papaparse";
|
|
60
60
|
import "react-csv-downloader";
|
|
61
|
+
import "../../../../components/composite/customAGGrid/customAggrid.js";
|
|
61
62
|
import { SetPointsForm } from "../../common/setpoints/SetPointsForm.js";
|
|
62
63
|
import { ConnectivityForm } from "../../common/connectivity/ConnectivityForm.js";
|
|
63
64
|
import { ActivePowerControlForm } from "../../common/activePowerControl/ActivePowerControlForm.js";
|
|
@@ -50,10 +50,11 @@ import "@react-querybuilder/material";
|
|
|
50
50
|
import "../../../../components/composite/reactQueryBuilder/CustomReactQueryBuilder.js";
|
|
51
51
|
import "../../../../components/composite/reactQueryBuilder/PropertyValueEditor.js";
|
|
52
52
|
import "../../../../components/composite/agGridTable/BottomRightButtons.js";
|
|
53
|
-
import "../../../../components/composite/
|
|
53
|
+
import "../../../../components/composite/agGridTable/CustomAgGridTable.js";
|
|
54
54
|
import "ag-grid-community";
|
|
55
55
|
import "react-papaparse";
|
|
56
56
|
import "react-csv-downloader";
|
|
57
|
+
import "../../../../components/composite/customAGGrid/customAggrid.js";
|
|
57
58
|
import { getSetPointsSchema, getSetPointsEmptyFormData } from "../../common/setpoints/setPoints.utils.js";
|
|
58
59
|
import { getActivePowerControlSchema, getActivePowerControlEmptyFormData } from "../../common/activePowerControl/activePowerControlForm.utils.js";
|
|
59
60
|
import { getShortCircuitFormSchema, getShortCircuitEmptyFormData, getShortCircuitFormData } from "../../common/shortCircuit/shortCircuitForm.utils.js";
|
|
@@ -49,10 +49,11 @@ import "@react-querybuilder/material";
|
|
|
49
49
|
import "../../../../components/composite/reactQueryBuilder/CustomReactQueryBuilder.js";
|
|
50
50
|
import "../../../../components/composite/reactQueryBuilder/PropertyValueEditor.js";
|
|
51
51
|
import "../../../../components/composite/agGridTable/BottomRightButtons.js";
|
|
52
|
-
import "../../../../components/composite/
|
|
52
|
+
import "../../../../components/composite/agGridTable/CustomAgGridTable.js";
|
|
53
53
|
import "ag-grid-community";
|
|
54
54
|
import "react-papaparse";
|
|
55
55
|
import "react-csv-downloader";
|
|
56
|
+
import "../../../../components/composite/customAGGrid/customAggrid.js";
|
|
56
57
|
import "../../common/regulatingTerminal/RegulatingTerminalForm.js";
|
|
57
58
|
function BatteryDialogHeader({ batteryToModify, equipmentId }) {
|
|
58
59
|
return /* @__PURE__ */ jsxs(Grid, { container: true, spacing: 2, children: [
|
package/dist/features/network-modifications/battery/modification/BatteryDialogTabsContent.js
CHANGED
|
@@ -54,10 +54,11 @@ import "@react-querybuilder/material";
|
|
|
54
54
|
import "../../../../components/composite/reactQueryBuilder/CustomReactQueryBuilder.js";
|
|
55
55
|
import "../../../../components/composite/reactQueryBuilder/PropertyValueEditor.js";
|
|
56
56
|
import "../../../../components/composite/agGridTable/BottomRightButtons.js";
|
|
57
|
-
import "../../../../components/composite/
|
|
57
|
+
import "../../../../components/composite/agGridTable/CustomAgGridTable.js";
|
|
58
58
|
import "ag-grid-community";
|
|
59
59
|
import "react-papaparse";
|
|
60
60
|
import "react-csv-downloader";
|
|
61
|
+
import "../../../../components/composite/customAGGrid/customAggrid.js";
|
|
61
62
|
import { ConnectivityForm } from "../../common/connectivity/ConnectivityForm.js";
|
|
62
63
|
import { ActivePowerControlForm } from "../../common/activePowerControl/ActivePowerControlForm.js";
|
|
63
64
|
import { ShortCircuitForm } from "../../common/shortCircuit/ShortCircuitForm.js";
|
package/dist/features/network-modifications/battery/modification/batteryModification.utils.js
CHANGED
|
@@ -50,10 +50,11 @@ import "@react-querybuilder/material";
|
|
|
50
50
|
import "../../../../components/composite/reactQueryBuilder/CustomReactQueryBuilder.js";
|
|
51
51
|
import "../../../../components/composite/reactQueryBuilder/PropertyValueEditor.js";
|
|
52
52
|
import "../../../../components/composite/agGridTable/BottomRightButtons.js";
|
|
53
|
-
import "../../../../components/composite/
|
|
53
|
+
import "../../../../components/composite/agGridTable/CustomAgGridTable.js";
|
|
54
54
|
import "ag-grid-community";
|
|
55
55
|
import "react-papaparse";
|
|
56
56
|
import "react-csv-downloader";
|
|
57
|
+
import "../../../../components/composite/customAGGrid/customAggrid.js";
|
|
57
58
|
import { getSetPointsSchema, getSetPointsEmptyFormData } from "../../common/setpoints/setPoints.utils.js";
|
|
58
59
|
import { getConnectivityWithPositionSchema, getConnectivityWithPositionEmptyFormDataProps, getConnectivityFormDataProps } from "../../common/connectivity/connectivityForm.utils.js";
|
|
59
60
|
import { getActivePowerControlSchema, getActivePowerControlEmptyFormData } from "../../common/activePowerControl/activePowerControlForm.utils.js";
|
|
@@ -49,10 +49,11 @@ import "@react-querybuilder/material";
|
|
|
49
49
|
import "../../../../components/composite/reactQueryBuilder/CustomReactQueryBuilder.js";
|
|
50
50
|
import "../../../../components/composite/reactQueryBuilder/PropertyValueEditor.js";
|
|
51
51
|
import "../../../../components/composite/agGridTable/BottomRightButtons.js";
|
|
52
|
-
import "../../../../components/composite/
|
|
52
|
+
import "../../../../components/composite/agGridTable/CustomAgGridTable.js";
|
|
53
53
|
import "ag-grid-community";
|
|
54
54
|
import "react-papaparse";
|
|
55
55
|
import "react-csv-downloader";
|
|
56
|
+
import "../../../../components/composite/customAGGrid/customAggrid.js";
|
|
56
57
|
const BUSBAR_SECTION_V_MEASUREMENTS = "busbarSectionVMeasurements";
|
|
57
58
|
function BusbarSectionVoltageMeasurementsForm({
|
|
58
59
|
busbarSections
|
|
@@ -53,10 +53,11 @@ import "@react-querybuilder/material";
|
|
|
53
53
|
import "../../../components/composite/reactQueryBuilder/CustomReactQueryBuilder.js";
|
|
54
54
|
import "../../../components/composite/reactQueryBuilder/PropertyValueEditor.js";
|
|
55
55
|
import "../../../components/composite/agGridTable/BottomRightButtons.js";
|
|
56
|
-
import "../../../components/composite/
|
|
56
|
+
import "../../../components/composite/agGridTable/CustomAgGridTable.js";
|
|
57
57
|
import "ag-grid-community";
|
|
58
58
|
import "react-papaparse";
|
|
59
59
|
import "react-csv-downloader";
|
|
60
|
+
import "../../../components/composite/customAGGrid/customAggrid.js";
|
|
60
61
|
import "../common/regulatingTerminal/RegulatingTerminalForm.js";
|
|
61
62
|
import { HvdcLccDeletionSpecificForm } from "./hvdcLccDeletion/HvdcLccDeletionSpecificForm.js";
|
|
62
63
|
const NULL_UUID = "00000000-0000-0000-0000-000000000000";
|
|
@@ -50,10 +50,11 @@ import "@react-querybuilder/material";
|
|
|
50
50
|
import "../../../../components/composite/reactQueryBuilder/CustomReactQueryBuilder.js";
|
|
51
51
|
import "../../../../components/composite/reactQueryBuilder/PropertyValueEditor.js";
|
|
52
52
|
import "../../../../components/composite/agGridTable/BottomRightButtons.js";
|
|
53
|
-
import "../../../../components/composite/
|
|
53
|
+
import "../../../../components/composite/agGridTable/CustomAgGridTable.js";
|
|
54
54
|
import "ag-grid-community";
|
|
55
55
|
import "react-papaparse";
|
|
56
56
|
import "react-csv-downloader";
|
|
57
|
+
import "../../../../components/composite/customAGGrid/customAggrid.js";
|
|
57
58
|
import "../../common/regulatingTerminal/RegulatingTerminalForm.js";
|
|
58
59
|
function LoadDialogHeader({ loadToModify, isModification = false }) {
|
|
59
60
|
const intl = useIntl();
|
|
@@ -50,10 +50,11 @@ import "@react-querybuilder/material";
|
|
|
50
50
|
import "../../../../components/composite/reactQueryBuilder/CustomReactQueryBuilder.js";
|
|
51
51
|
import "../../../../components/composite/reactQueryBuilder/PropertyValueEditor.js";
|
|
52
52
|
import "../../../../components/composite/agGridTable/BottomRightButtons.js";
|
|
53
|
-
import "../../../../components/composite/
|
|
53
|
+
import "../../../../components/composite/agGridTable/CustomAgGridTable.js";
|
|
54
54
|
import "ag-grid-community";
|
|
55
55
|
import "react-papaparse";
|
|
56
56
|
import "react-csv-downloader";
|
|
57
|
+
import "../../../../components/composite/customAGGrid/customAggrid.js";
|
|
57
58
|
import { getSetPointsSchema } from "../../common/setpoints/setPoints.utils.js";
|
|
58
59
|
import { getConnectivityWithPositionSchema, getConnectivityWithPositionEmptyFormDataProps, getConnectivityFormDataProps } from "../../common/connectivity/connectivityForm.utils.js";
|
|
59
60
|
import "../../common/regulatingTerminal/RegulatingTerminalForm.js";
|
|
@@ -52,10 +52,11 @@ import "@react-querybuilder/material";
|
|
|
52
52
|
import "../../../../components/composite/reactQueryBuilder/CustomReactQueryBuilder.js";
|
|
53
53
|
import "../../../../components/composite/reactQueryBuilder/PropertyValueEditor.js";
|
|
54
54
|
import "../../../../components/composite/agGridTable/BottomRightButtons.js";
|
|
55
|
-
import "../../../../components/composite/
|
|
55
|
+
import "../../../../components/composite/agGridTable/CustomAgGridTable.js";
|
|
56
56
|
import "ag-grid-community";
|
|
57
57
|
import "react-papaparse";
|
|
58
58
|
import "react-csv-downloader";
|
|
59
|
+
import "../../../../components/composite/customAGGrid/customAggrid.js";
|
|
59
60
|
import "../../common/regulatingTerminal/RegulatingTerminalForm.js";
|
|
60
61
|
import { CharacteristicsForm } from "../common/CharacteristicsForm.js";
|
|
61
62
|
function ShuntCompensatorCreationForm({
|
|
@@ -49,10 +49,11 @@ import "@react-querybuilder/material";
|
|
|
49
49
|
import "../../../../components/composite/reactQueryBuilder/CustomReactQueryBuilder.js";
|
|
50
50
|
import "../../../../components/composite/reactQueryBuilder/PropertyValueEditor.js";
|
|
51
51
|
import "../../../../components/composite/agGridTable/BottomRightButtons.js";
|
|
52
|
-
import "../../../../components/composite/
|
|
52
|
+
import "../../../../components/composite/agGridTable/CustomAgGridTable.js";
|
|
53
53
|
import "ag-grid-community";
|
|
54
54
|
import "react-papaparse";
|
|
55
55
|
import "react-csv-downloader";
|
|
56
|
+
import "../../../../components/composite/customAGGrid/customAggrid.js";
|
|
56
57
|
import { getConnectivityWithPositionSchema, getConnectivityWithPositionEmptyFormDataProps, getConnectivityFormDataProps } from "../../common/connectivity/connectivityForm.utils.js";
|
|
57
58
|
import "../../common/regulatingTerminal/RegulatingTerminalForm.js";
|
|
58
59
|
import { CHARACTERISTICS_CHOICES } from "../common/shuntCompensator.utils.js";
|
|
@@ -53,10 +53,11 @@ import "@react-querybuilder/material";
|
|
|
53
53
|
import "../../../../components/composite/reactQueryBuilder/CustomReactQueryBuilder.js";
|
|
54
54
|
import "../../../../components/composite/reactQueryBuilder/PropertyValueEditor.js";
|
|
55
55
|
import "../../../../components/composite/agGridTable/BottomRightButtons.js";
|
|
56
|
-
import "../../../../components/composite/
|
|
56
|
+
import "../../../../components/composite/agGridTable/CustomAgGridTable.js";
|
|
57
57
|
import "ag-grid-community";
|
|
58
58
|
import "react-papaparse";
|
|
59
59
|
import "react-csv-downloader";
|
|
60
|
+
import "../../../../components/composite/customAGGrid/customAggrid.js";
|
|
60
61
|
import "../../common/regulatingTerminal/RegulatingTerminalForm.js";
|
|
61
62
|
import { CharacteristicsForm } from "../common/CharacteristicsForm.js";
|
|
62
63
|
function ShuntCompensatorModificationForm({
|
|
@@ -50,10 +50,11 @@ import "@react-querybuilder/material";
|
|
|
50
50
|
import "../../../../components/composite/reactQueryBuilder/CustomReactQueryBuilder.js";
|
|
51
51
|
import "../../../../components/composite/reactQueryBuilder/PropertyValueEditor.js";
|
|
52
52
|
import "../../../../components/composite/agGridTable/BottomRightButtons.js";
|
|
53
|
-
import "../../../../components/composite/
|
|
53
|
+
import "../../../../components/composite/agGridTable/CustomAgGridTable.js";
|
|
54
54
|
import "ag-grid-community";
|
|
55
55
|
import "react-papaparse";
|
|
56
56
|
import "react-csv-downloader";
|
|
57
|
+
import "../../../../components/composite/customAGGrid/customAggrid.js";
|
|
57
58
|
import { getConnectivityWithPositionSchema, getConnectivityWithPositionEmptyFormDataProps, getConnectivityFormDataProps } from "../../common/connectivity/connectivityForm.utils.js";
|
|
58
59
|
import "../../common/regulatingTerminal/RegulatingTerminalForm.js";
|
|
59
60
|
import { CHARACTERISTICS_CHOICES } from "../common/shuntCompensator.utils.js";
|
|
@@ -51,10 +51,11 @@ import "@react-querybuilder/material";
|
|
|
51
51
|
import "../../../../components/composite/reactQueryBuilder/CustomReactQueryBuilder.js";
|
|
52
52
|
import "../../../../components/composite/reactQueryBuilder/PropertyValueEditor.js";
|
|
53
53
|
import "../../../../components/composite/agGridTable/BottomRightButtons.js";
|
|
54
|
-
import "../../../../components/composite/
|
|
54
|
+
import "../../../../components/composite/agGridTable/CustomAgGridTable.js";
|
|
55
55
|
import "ag-grid-community";
|
|
56
56
|
import "react-papaparse";
|
|
57
57
|
import "react-csv-downloader";
|
|
58
|
+
import "../../../../components/composite/customAGGrid/customAggrid.js";
|
|
58
59
|
import "../../common/regulatingTerminal/RegulatingTerminalForm.js";
|
|
59
60
|
function SubstationCreationForm() {
|
|
60
61
|
return /* @__PURE__ */ jsxs(Grid, { container: true, direction: "column", spacing: 2, children: [
|
package/dist/features/network-modifications/substation/modification/SubstationModificationForm.js
CHANGED
|
@@ -49,10 +49,11 @@ import "@react-querybuilder/material";
|
|
|
49
49
|
import "../../../../components/composite/reactQueryBuilder/CustomReactQueryBuilder.js";
|
|
50
50
|
import "../../../../components/composite/reactQueryBuilder/PropertyValueEditor.js";
|
|
51
51
|
import "../../../../components/composite/agGridTable/BottomRightButtons.js";
|
|
52
|
-
import "../../../../components/composite/
|
|
52
|
+
import "../../../../components/composite/agGridTable/CustomAgGridTable.js";
|
|
53
53
|
import "ag-grid-community";
|
|
54
54
|
import "react-papaparse";
|
|
55
55
|
import "react-csv-downloader";
|
|
56
|
+
import "../../../../components/composite/customAGGrid/customAggrid.js";
|
|
56
57
|
import "../../common/regulatingTerminal/RegulatingTerminalForm.js";
|
|
57
58
|
function SubstationModificationForm({ substationToModify }) {
|
|
58
59
|
const { locale } = useIntl();
|
package/dist/features/network-modifications/voltageLevel/creation/VoltageLevelCreationForm.js
CHANGED
|
@@ -55,10 +55,11 @@ import "@react-querybuilder/material";
|
|
|
55
55
|
import "../../../../components/composite/reactQueryBuilder/CustomReactQueryBuilder.js";
|
|
56
56
|
import "../../../../components/composite/reactQueryBuilder/PropertyValueEditor.js";
|
|
57
57
|
import "../../../../components/composite/agGridTable/BottomRightButtons.js";
|
|
58
|
-
import "../../../../components/composite/
|
|
58
|
+
import "../../../../components/composite/agGridTable/CustomAgGridTable.js";
|
|
59
59
|
import "ag-grid-community";
|
|
60
60
|
import "react-papaparse";
|
|
61
61
|
import "react-csv-downloader";
|
|
62
|
+
import "../../../../components/composite/customAGGrid/customAggrid.js";
|
|
62
63
|
import "../../common/regulatingTerminal/RegulatingTerminalForm.js";
|
|
63
64
|
import { getTabIndicatorStyle, getTabStyle } from "../../../parameters/parameters-style.js";
|
|
64
65
|
import { useTabsWithError } from "../../hooks/useTabsWithError.js";
|
|
@@ -47,10 +47,11 @@ import "@react-querybuilder/material";
|
|
|
47
47
|
import "../../../../components/composite/reactQueryBuilder/CustomReactQueryBuilder.js";
|
|
48
48
|
import "../../../../components/composite/reactQueryBuilder/PropertyValueEditor.js";
|
|
49
49
|
import "../../../../components/composite/agGridTable/BottomRightButtons.js";
|
|
50
|
-
import "../../../../components/composite/
|
|
50
|
+
import "../../../../components/composite/agGridTable/CustomAgGridTable.js";
|
|
51
51
|
import "ag-grid-community";
|
|
52
52
|
import "react-papaparse";
|
|
53
53
|
import "react-csv-downloader";
|
|
54
|
+
import "../../../../components/composite/customAGGrid/customAggrid.js";
|
|
54
55
|
import "../../common/regulatingTerminal/RegulatingTerminalForm.js";
|
|
55
56
|
import { MAX_SECTIONS_COUNT } from "./voltageLevel.constants.js";
|
|
56
57
|
import { VoltageLevelCreationForm } from "./VoltageLevelCreationForm.js";
|
|
@@ -52,10 +52,11 @@ import "@react-querybuilder/material";
|
|
|
52
52
|
import "../../../../../../components/composite/reactQueryBuilder/CustomReactQueryBuilder.js";
|
|
53
53
|
import "../../../../../../components/composite/reactQueryBuilder/PropertyValueEditor.js";
|
|
54
54
|
import "../../../../../../components/composite/agGridTable/BottomRightButtons.js";
|
|
55
|
-
import "../../../../../../components/composite/
|
|
55
|
+
import "../../../../../../components/composite/agGridTable/CustomAgGridTable.js";
|
|
56
56
|
import "ag-grid-community";
|
|
57
57
|
import "react-papaparse";
|
|
58
58
|
import "react-csv-downloader";
|
|
59
|
+
import "../../../../../../components/composite/customAGGrid/customAggrid.js";
|
|
59
60
|
import "../../../../common/regulatingTerminal/RegulatingTerminalForm.js";
|
|
60
61
|
function SubstationCreationSection({
|
|
61
62
|
showDeleteButton = true,
|
package/dist/features/network-modifications/voltageLevel/creation/voltageLevelCreation.utils.js
CHANGED
|
@@ -51,10 +51,11 @@ import "@react-querybuilder/material";
|
|
|
51
51
|
import "../../../../components/composite/reactQueryBuilder/CustomReactQueryBuilder.js";
|
|
52
52
|
import "../../../../components/composite/reactQueryBuilder/PropertyValueEditor.js";
|
|
53
53
|
import "../../../../components/composite/agGridTable/BottomRightButtons.js";
|
|
54
|
-
import "../../../../components/composite/
|
|
54
|
+
import "../../../../components/composite/agGridTable/CustomAgGridTable.js";
|
|
55
55
|
import "ag-grid-community";
|
|
56
56
|
import "react-papaparse";
|
|
57
57
|
import "react-csv-downloader";
|
|
58
|
+
import "../../../../components/composite/customAGGrid/customAggrid.js";
|
|
58
59
|
import "../../common/regulatingTerminal/RegulatingTerminalForm.js";
|
|
59
60
|
import { substationCreationEmptyFormData } from "../../substation/creation/substationCreation.utils.js";
|
|
60
61
|
import "../../substation/modification/substationModification.utils.js";
|
|
@@ -47,10 +47,11 @@ import "@react-querybuilder/material";
|
|
|
47
47
|
import "../../../components/composite/reactQueryBuilder/CustomReactQueryBuilder.js";
|
|
48
48
|
import "../../../components/composite/reactQueryBuilder/PropertyValueEditor.js";
|
|
49
49
|
import "../../../components/composite/agGridTable/BottomRightButtons.js";
|
|
50
|
-
import "../../../components/composite/
|
|
50
|
+
import "../../../components/composite/agGridTable/CustomAgGridTable.js";
|
|
51
51
|
import "ag-grid-community";
|
|
52
52
|
import "react-papaparse";
|
|
53
53
|
import "react-csv-downloader";
|
|
54
|
+
import "../../../components/composite/customAGGrid/customAggrid.js";
|
|
54
55
|
import "../common/regulatingTerminal/RegulatingTerminalForm.js";
|
|
55
56
|
import { MAX_SECTIONS_COUNT } from "./creation/voltageLevel.constants.js";
|
|
56
57
|
import { VoltageLevelCreationForm } from "./creation/VoltageLevelCreationForm.js";
|
|
@@ -57,10 +57,11 @@ import "@react-querybuilder/material";
|
|
|
57
57
|
import "../../../../components/composite/reactQueryBuilder/CustomReactQueryBuilder.js";
|
|
58
58
|
import "../../../../components/composite/reactQueryBuilder/PropertyValueEditor.js";
|
|
59
59
|
import "../../../../components/composite/agGridTable/BottomRightButtons.js";
|
|
60
|
-
import "../../../../components/composite/
|
|
60
|
+
import "../../../../components/composite/agGridTable/CustomAgGridTable.js";
|
|
61
61
|
import "ag-grid-community";
|
|
62
62
|
import "react-papaparse";
|
|
63
63
|
import "react-csv-downloader";
|
|
64
|
+
import "../../../../components/composite/customAGGrid/customAggrid.js";
|
|
64
65
|
function VoltageLevelModificationForm({
|
|
65
66
|
voltageLevelToModify,
|
|
66
67
|
busbarSections = []
|
|
@@ -11,6 +11,7 @@ import "react-dom";
|
|
|
11
11
|
import "@hello-pangea/dnd";
|
|
12
12
|
import { DndColumnType } from "../../../../components/composite/dnd-table-v2/dnd-table.type.js";
|
|
13
13
|
import "../../../../components/ui/overflowableText/OverflowableText.js";
|
|
14
|
+
import { YUP_REQUIRED } from "../../../../utils/constants/translationKeys.js";
|
|
14
15
|
import "../../../../utils/conversionUtils.js";
|
|
15
16
|
import { ElementType } from "../../../../utils/types/elementType.js";
|
|
16
17
|
import "../../../../utils/types/equipmentType.js";
|
|
@@ -73,7 +74,7 @@ const getContingencyListsInfosFormSchema = () => {
|
|
|
73
74
|
[ID]: yup.string().required(),
|
|
74
75
|
[NAME]: yup.string().required()
|
|
75
76
|
})
|
|
76
|
-
).required().min(1,
|
|
77
|
+
).required().min(1, YUP_REQUIRED),
|
|
77
78
|
[DESCRIPTION]: yup.string(),
|
|
78
79
|
[ACTIVATED]: yup.boolean().required()
|
|
79
80
|
})
|
|
@@ -5,6 +5,7 @@ import { Grid } from "@mui/material";
|
|
|
5
5
|
import * as yup from "yup";
|
|
6
6
|
import { LOADS_VARIATIONS, ACTIVE, VARIATION, LOAD_FILTERS, LOAD_MODELS_RULE, ACCURACY, CALCULATION_TYPE } from "./constants.js";
|
|
7
7
|
import { ID } from "../../../utils/constants/filterConstant.js";
|
|
8
|
+
import { YUP_REQUIRED } from "../../../utils/constants/translationKeys.js";
|
|
8
9
|
import "../../../utils/conversionUtils.js";
|
|
9
10
|
import { ElementType } from "../../../utils/types/elementType.js";
|
|
10
11
|
import { EquipmentType } from "../../../utils/types/equipmentType.js";
|
|
@@ -50,7 +51,7 @@ const formSchema = yup.object().shape({
|
|
|
50
51
|
[ID]: yup.string().required(),
|
|
51
52
|
[NAME]: yup.string().nullable().notRequired()
|
|
52
53
|
})
|
|
53
|
-
).min(1,
|
|
54
|
+
).min(1, YUP_REQUIRED),
|
|
54
55
|
[VARIATION]: yup.number().min(0, "mustBeGreaterOrEqualToZero").required(),
|
|
55
56
|
[ACTIVE]: yup.boolean().nullable().notRequired()
|
|
56
57
|
})
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as yup from "yup";
|
|
2
2
|
import { FLOW_VOLTAGE_SENSITIVITY_VALUE_THRESHOLD, ANGLE_FLOW_SENSITIVITY_VALUE_THRESHOLD, FLOW_FLOW_SENSITIVITY_VALUE_THRESHOLD, PARAMETER_SENSI_NODES, EQUIPMENTS_IN_VOLTAGE_REGULATION, SUPERVISED_VOLTAGE_LEVELS, PARAMETER_SENSI_PST, PSTS, PARAMETER_SENSI_HVDC, HVDC_LINES, PARAMETER_SENSI_INJECTION, INJECTIONS, PARAMETER_SENSI_INJECTIONS_SET, DISTRIBUTION_TYPE, SENSITIVITY_TYPE, MONITORED_BRANCHES, CONTAINER_NAME, CONTAINER_ID } from "./constants.js";
|
|
3
3
|
import { ID } from "../../../utils/constants/filterConstant.js";
|
|
4
|
+
import { YUP_REQUIRED } from "../../../utils/constants/translationKeys.js";
|
|
4
5
|
import "../../../utils/conversionUtils.js";
|
|
5
6
|
import "../../../utils/types/equipmentType.js";
|
|
6
7
|
import { DistributionType, SensitivityType } from "../../../utils/types/sensitivity-analysis.type.js";
|
|
@@ -50,7 +51,7 @@ const getMonitoredBranchesSchema = () => {
|
|
|
50
51
|
})
|
|
51
52
|
).required().when([ACTIVATED], {
|
|
52
53
|
is: (activated) => activated,
|
|
53
|
-
then: (schema) => schema.min(1,
|
|
54
|
+
then: (schema) => schema.min(1, YUP_REQUIRED)
|
|
54
55
|
})
|
|
55
56
|
};
|
|
56
57
|
};
|
|
@@ -85,7 +86,7 @@ const getSensiHVDCsFormSchema = () => ({
|
|
|
85
86
|
})
|
|
86
87
|
).required().when([ACTIVATED], {
|
|
87
88
|
is: (activated) => activated,
|
|
88
|
-
then: (schema) => schema.min(1,
|
|
89
|
+
then: (schema) => schema.min(1, YUP_REQUIRED)
|
|
89
90
|
}),
|
|
90
91
|
...getContingenciesSchema()
|
|
91
92
|
})
|
|
@@ -130,7 +131,7 @@ const getSensiInjectionsFormSchema = () => ({
|
|
|
130
131
|
})
|
|
131
132
|
).required().when([ACTIVATED], {
|
|
132
133
|
is: (activated) => activated,
|
|
133
|
-
then: (schema) => schema.min(1,
|
|
134
|
+
then: (schema) => schema.min(1, YUP_REQUIRED)
|
|
134
135
|
}),
|
|
135
136
|
...getContingenciesSchema()
|
|
136
137
|
})
|
|
@@ -174,7 +175,7 @@ const getSensiInjectionsSetFormSchema = () => ({
|
|
|
174
175
|
})
|
|
175
176
|
).required().when([ACTIVATED], {
|
|
176
177
|
is: (activated) => activated,
|
|
177
|
-
then: (schema) => schema.min(1,
|
|
178
|
+
then: (schema) => schema.min(1, YUP_REQUIRED)
|
|
178
179
|
}),
|
|
179
180
|
[DISTRIBUTION_TYPE]: yup.mixed().oneOf(Object.values(DistributionType)).when([ACTIVATED], {
|
|
180
181
|
is: (activated) => activated,
|
|
@@ -231,7 +232,7 @@ const getSensiNodesFormSchema = () => ({
|
|
|
231
232
|
})
|
|
232
233
|
).when([ACTIVATED], {
|
|
233
234
|
is: (activated) => activated,
|
|
234
|
-
then: (schema) => schema.min(1,
|
|
235
|
+
then: (schema) => schema.min(1, YUP_REQUIRED)
|
|
235
236
|
}),
|
|
236
237
|
[EQUIPMENTS_IN_VOLTAGE_REGULATION]: yup.array().of(
|
|
237
238
|
yup.object().shape({
|
|
@@ -240,7 +241,7 @@ const getSensiNodesFormSchema = () => ({
|
|
|
240
241
|
})
|
|
241
242
|
).when([ACTIVATED], {
|
|
242
243
|
is: (activated) => activated,
|
|
243
|
-
then: (schema) => schema.min(1,
|
|
244
|
+
then: (schema) => schema.min(1, YUP_REQUIRED)
|
|
244
245
|
}),
|
|
245
246
|
...getContingenciesSchema()
|
|
246
247
|
})
|
|
@@ -287,7 +288,7 @@ const getSensiPSTsFormSchema = () => ({
|
|
|
287
288
|
})
|
|
288
289
|
).required().when([ACTIVATED], {
|
|
289
290
|
is: (activated) => activated,
|
|
290
|
-
then: (schema) => schema.min(1,
|
|
291
|
+
then: (schema) => schema.min(1, YUP_REQUIRED)
|
|
291
292
|
}),
|
|
292
293
|
...getContingenciesSchema()
|
|
293
294
|
})
|
|
@@ -6,6 +6,7 @@ import "@mui/material";
|
|
|
6
6
|
import "react-intl";
|
|
7
7
|
import "react";
|
|
8
8
|
import { ID } from "../../../utils/constants/filterConstant.js";
|
|
9
|
+
import { YUP_REQUIRED } from "../../../utils/constants/translationKeys.js";
|
|
9
10
|
import "../../../utils/conversionUtils.js";
|
|
10
11
|
import { snackWithFallback } from "../../../utils/error.js";
|
|
11
12
|
import "../../../utils/types/equipmentType.js";
|
|
@@ -103,7 +104,7 @@ const getSpecificShortCircuitParametersFormSchema = (specificParametersDescripti
|
|
|
103
104
|
})
|
|
104
105
|
).nullable().when("active", {
|
|
105
106
|
is: true,
|
|
106
|
-
then: (s) => s.required().min(1,
|
|
107
|
+
then: (s) => s.required().min(1, YUP_REQUIRED),
|
|
107
108
|
otherwise: (s) => s.notRequired().nullable()
|
|
108
109
|
}),
|
|
109
110
|
type: requiredWhenActive(yup.string().oneOf(["GENERATOR", "HVDC"]).nullable())
|
|
@@ -8,6 +8,7 @@ import "@mui/icons-material";
|
|
|
8
8
|
import "react-intl";
|
|
9
9
|
import "../../../components/ui/overflowableText/OverflowableText.js";
|
|
10
10
|
import { ID, FILTERS } from "../../../utils/constants/filterConstant.js";
|
|
11
|
+
import { YUP_REQUIRED } from "../../../utils/constants/translationKeys.js";
|
|
11
12
|
import { isBlankOrEmpty } from "../../../utils/conversionUtils.js";
|
|
12
13
|
import { snackWithFallback } from "../../../utils/error.js";
|
|
13
14
|
import { ElementType } from "../../../utils/types/elementType.js";
|
|
@@ -71,7 +72,7 @@ const useVoltageInitParametersForm = ({
|
|
|
71
72
|
[ID]: yup.string().required(),
|
|
72
73
|
[NAME]: yup.string().required()
|
|
73
74
|
})
|
|
74
|
-
).min(1,
|
|
75
|
+
).min(1, YUP_REQUIRED),
|
|
75
76
|
[LOW_VOLTAGE_LIMIT]: yup.number().nullable(),
|
|
76
77
|
[HIGH_VOLTAGE_LIMIT]: yup.number().nullable()
|
|
77
78
|
})
|
|
@@ -84,7 +85,7 @@ const useVoltageInitParametersForm = ({
|
|
|
84
85
|
[ID]: yup.string().required(),
|
|
85
86
|
[NAME]: yup.string().required()
|
|
86
87
|
})
|
|
87
|
-
).min(1,
|
|
88
|
+
).min(1, YUP_REQUIRED),
|
|
88
89
|
[LOW_VOLTAGE_LIMIT]: yup.number().min(0, "mustBeGreaterOrEqualToZero").nullable().test((value, context) => {
|
|
89
90
|
return !isBlankOrEmpty(value) || !isBlankOrEmpty(context.parent[HIGH_VOLTAGE_LIMIT]);
|
|
90
91
|
}),
|
|
@@ -168,8 +168,6 @@ export declare const parametersEn: {
|
|
|
168
168
|
LowVoltageLimitAdjustment: string;
|
|
169
169
|
HighVoltageLimitAdjustment: string;
|
|
170
170
|
VoltageLevelFilterTooltip: string;
|
|
171
|
-
FilterInputMinError: string;
|
|
172
|
-
ContingencyListInputMinError: string;
|
|
173
171
|
EquipmentSelection: string;
|
|
174
172
|
ReactiveSlacksThreshold: string;
|
|
175
173
|
ReactiveSlacksThresholdMustBeGreaterOrEqualToZero: string;
|
|
@@ -162,8 +162,6 @@ const parametersEn = {
|
|
|
162
162
|
LowVoltageLimitAdjustment: "Low voltage limit adjustment",
|
|
163
163
|
HighVoltageLimitAdjustment: "High voltage limit adjustment",
|
|
164
164
|
VoltageLevelFilterTooltip: "User entries are applied one after another starting at the top of the list. If a voltage level is included in more than one filter, an entry can therefore be replaced by a subsequent entry",
|
|
165
|
-
FilterInputMinError: "You must pick at least one filter",
|
|
166
|
-
ContingencyListInputMinError: "You must pick at least one contingency list",
|
|
167
165
|
EquipmentSelection: "Equipment selection",
|
|
168
166
|
ReactiveSlacksThreshold: "Alert threshold on reactive slacks",
|
|
169
167
|
ReactiveSlacksThresholdMustBeGreaterOrEqualToZero: "The threshold must be greater or equal to 0",
|
|
@@ -168,8 +168,6 @@ export declare const parametersFr: {
|
|
|
168
168
|
LowVoltageLimitAdjustment: string;
|
|
169
169
|
HighVoltageLimitAdjustment: string;
|
|
170
170
|
VoltageLevelFilterTooltip: string;
|
|
171
|
-
FilterInputMinError: string;
|
|
172
|
-
ContingencyListInputMinError: string;
|
|
173
171
|
EquipmentSelection: string;
|
|
174
172
|
ReactiveSlacksThreshold: string;
|
|
175
173
|
ReactiveSlacksThresholdMustBeGreaterOrEqualToZero: string;
|
|
@@ -162,8 +162,6 @@ const parametersFr = {
|
|
|
162
162
|
LowVoltageLimitAdjustment: "Modification limite basse",
|
|
163
163
|
HighVoltageLimitAdjustment: "Modification limite haute",
|
|
164
164
|
VoltageLevelFilterTooltip: "Les saisies sont appliquées dans l'ordre de la liste (en remplaçant éventuellement des saisies au fur et à mesure si un poste est inclus dans plusieurs filtres)",
|
|
165
|
-
FilterInputMinError: "Vous devez sélectionner au moins un filtre",
|
|
166
|
-
ContingencyListInputMinError: "Vous devez sélectionner au moins une liste d'aléas",
|
|
167
165
|
EquipmentSelection: "Sélection des ouvrages",
|
|
168
166
|
ReactiveSlacksThreshold: "Seuil d'alerte sur les investissements réactifs",
|
|
169
167
|
ReactiveSlacksThresholdMustBeGreaterOrEqualToZero: "Le seuil doit être supérieur ou égal à 0",
|