@gridsuite/commons-ui 0.233.0 → 0.235.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/ui/index.d.ts +1 -0
- package/dist/components/ui/index.js +2 -0
- package/dist/components/ui/tablepagination/custom-table-pagination.d.ts +6 -0
- package/dist/components/ui/tablepagination/custom-table-pagination.js +45 -0
- package/dist/components/ui/tablepagination/index.d.ts +7 -0
- package/dist/components/ui/tablepagination/index.js +4 -0
- package/dist/features/index.d.ts +2 -0
- package/dist/features/index.js +23 -0
- package/dist/features/parameters/pcc-min/pcc-min-parameters-form.js +1 -1
- package/dist/features/parameters/pcc-min/use-pcc-min-parameters-form.js +1 -1
- package/dist/features/process-configs/index.d.ts +8 -0
- package/dist/features/process-configs/index.js +12 -0
- package/dist/features/process-configs/process-configs.type.d.ts +28 -0
- package/dist/features/process-configs/process-configs.type.js +8 -0
- package/dist/features/process-configs/security-analysis/index.d.ts +8 -0
- package/dist/features/process-configs/security-analysis/index.js +10 -0
- package/dist/features/process-configs/security-analysis/update-sa-process-config-dialog.d.ts +14 -0
- package/dist/features/process-configs/security-analysis/update-sa-process-config-dialog.js +130 -0
- package/dist/features/process-configs/security-analysis/update-sa-process-config.d.ts +7 -0
- package/dist/features/process-configs/security-analysis/update-sa-process-config.js +103 -0
- package/dist/features/process-configs/security-analysis/update-sa-process-configs-utils.d.ts +64 -0
- package/dist/features/process-configs/security-analysis/update-sa-process-configs-utils.js +80 -0
- package/dist/features/process-configs/update-process-config-modifications.d.ts +3 -0
- package/dist/features/process-configs/update-process-config-modifications.js +99 -0
- package/dist/features/results/securityanalysis/index.d.ts +10 -0
- package/dist/features/results/securityanalysis/index.js +15 -0
- package/dist/features/results/securityanalysis/security-analysis-result-nmk.d.ts +2 -0
- package/dist/features/results/securityanalysis/security-analysis-result-nmk.js +131 -0
- package/dist/features/results/securityanalysis/security-analysis-table.d.ts +2 -0
- package/dist/features/results/securityanalysis/security-analysis-table.js +95 -0
- package/dist/features/results/securityanalysis/security-analysis.type.d.ts +121 -0
- package/dist/features/results/securityanalysis/security-analysis.type.js +9 -0
- package/dist/features/results/securityanalysis/utils.d.ts +10 -0
- package/dist/features/results/securityanalysis/utils.js +148 -0
- package/dist/index.js +31 -1
- package/dist/translations/en/businessErrorsEn.d.ts +1 -0
- package/dist/translations/en/businessErrorsEn.js +1 -0
- package/dist/translations/en/external/exportParamsEn.d.ts +78 -69
- package/dist/translations/en/external/exportParamsEn.js +83 -69
- package/dist/translations/en/external/importParamsEn.d.ts +76 -59
- package/dist/translations/en/external/importParamsEn.js +80 -59
- package/dist/translations/en/index.d.ts +1 -0
- package/dist/translations/en/index.js +2 -0
- package/dist/translations/en/parameters.d.ts +1 -0
- package/dist/translations/en/parameters.js +1 -0
- package/dist/translations/en/processConfigEn.d.ts +13 -0
- package/dist/translations/en/processConfigEn.js +10 -0
- package/dist/translations/fr/businessErrorsFr.d.ts +1 -0
- package/dist/translations/fr/businessErrorsFr.js +1 -0
- package/dist/translations/fr/external/exportParamsFr.d.ts +93 -69
- package/dist/translations/fr/external/exportParamsFr.js +98 -69
- package/dist/translations/fr/external/importParamsFr.d.ts +85 -57
- package/dist/translations/fr/external/importParamsFr.js +91 -59
- package/dist/translations/fr/index.d.ts +1 -0
- package/dist/translations/fr/index.js +2 -0
- package/dist/translations/fr/parameters.d.ts +1 -0
- package/dist/translations/fr/parameters.js +1 -0
- package/dist/translations/fr/processConfigFr.d.ts +13 -0
- package/dist/translations/fr/processConfigFr.js +10 -0
- package/dist/utils/constants/fieldConstants.d.ts +3 -0
- package/dist/utils/constants/fieldConstants.js +3 -0
- package/dist/utils/functions.d.ts +1 -0
- package/dist/utils/functions.js +5 -0
- package/dist/utils/index.js +2 -1
- package/dist/utils/running-status.d.ts +20 -0
- package/dist/utils/running-status.js +10 -0
- package/package.json +2 -1
package/dist/components/index.js
CHANGED
|
@@ -72,6 +72,7 @@ import { CsvPicker } from "./ui/csvPicker/csv-picker.js";
|
|
|
72
72
|
import { TreeViewFinder, generateTreeViewFinderClass } from "./ui/treeViewFinder/TreeViewFinder.js";
|
|
73
73
|
import { doesNodeHasChildren } from "./ui/treeViewFinder/TreeViewUtils.js";
|
|
74
74
|
import { DirectoryItemSelector } from "./ui/directoryItemSelector/DirectoryItemSelector.js";
|
|
75
|
+
import { CustomTablePagination } from "./ui/tablepagination/custom-table-pagination.js";
|
|
75
76
|
import { DndTable } from "./composite/dnd-table/dnd-table.js";
|
|
76
77
|
import { DndColumnType, MAX_ROWS_NUMBER, SELECTED } from "./composite/dnd-table/dnd-table.type.js";
|
|
77
78
|
import { getDefaultRowData } from "./composite/dnd-table/dnd-table-utils.js";
|
|
@@ -162,6 +163,7 @@ export {
|
|
|
162
163
|
CustomMuiDialog,
|
|
163
164
|
CustomNestedMenuItem,
|
|
164
165
|
CustomReactQueryBuilder,
|
|
166
|
+
CustomTablePagination,
|
|
165
167
|
CustomTooltip,
|
|
166
168
|
DEFAULT_RANGE_VALUE,
|
|
167
169
|
DESCRIPTION,
|
|
@@ -72,6 +72,7 @@ import { CsvPicker } from "./csvPicker/csv-picker.js";
|
|
|
72
72
|
import { TreeViewFinder, generateTreeViewFinderClass } from "./treeViewFinder/TreeViewFinder.js";
|
|
73
73
|
import { doesNodeHasChildren } from "./treeViewFinder/TreeViewUtils.js";
|
|
74
74
|
import { DirectoryItemSelector } from "./directoryItemSelector/DirectoryItemSelector.js";
|
|
75
|
+
import { CustomTablePagination } from "./tablepagination/custom-table-pagination.js";
|
|
75
76
|
export {
|
|
76
77
|
ActivableChip,
|
|
77
78
|
AddButton,
|
|
@@ -95,6 +96,7 @@ export {
|
|
|
95
96
|
CustomMenuItem,
|
|
96
97
|
CustomMuiDialog,
|
|
97
98
|
CustomNestedMenuItem,
|
|
99
|
+
CustomTablePagination,
|
|
98
100
|
CustomTooltip,
|
|
99
101
|
DEFAULT_RANGE_VALUE,
|
|
100
102
|
DESCRIPTION,
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { TablePaginationProps } from '@mui/material';
|
|
2
|
+
type CustomTablePaginationProps = TablePaginationProps & {
|
|
3
|
+
labelRowsPerPageId?: string;
|
|
4
|
+
};
|
|
5
|
+
export declare function CustomTablePagination(props: CustomTablePaginationProps): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export {};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useIntl } from "react-intl";
|
|
3
|
+
import { TablePagination } from "@mui/material";
|
|
4
|
+
function CustomTablePagination(props) {
|
|
5
|
+
const { labelRowsPerPageId, ...otherProps } = props;
|
|
6
|
+
const intl = useIntl();
|
|
7
|
+
const customLabelDisplayedRows = ({ from, to, count }) => {
|
|
8
|
+
return `${from}-${to} ${intl.formatMessage({ id: "muiTablePaginationOfLabel" })} ${count}`;
|
|
9
|
+
};
|
|
10
|
+
const customLabelRowsPerPage = intl.formatMessage({
|
|
11
|
+
id: labelRowsPerPageId ?? "muiTablePaginationLabelRowsPerPage"
|
|
12
|
+
});
|
|
13
|
+
const customLabelNextPage = intl.formatMessage({ id: "muiTablePaginationNext" });
|
|
14
|
+
const customLabelPreviousPage = intl.formatMessage({ id: "muiTablePaginationPrevious" });
|
|
15
|
+
const customLabelFirstPage = intl.formatMessage({ id: "muiTablePaginationFirst" });
|
|
16
|
+
const customLabelLastPage = intl.formatMessage({ id: "muiTablePaginationLast" });
|
|
17
|
+
return /* @__PURE__ */ jsx(
|
|
18
|
+
TablePagination,
|
|
19
|
+
{
|
|
20
|
+
component: "div",
|
|
21
|
+
showFirstButton: true,
|
|
22
|
+
showLastButton: true,
|
|
23
|
+
labelDisplayedRows: customLabelDisplayedRows,
|
|
24
|
+
labelRowsPerPage: customLabelRowsPerPage,
|
|
25
|
+
getItemAriaLabel: (type) => {
|
|
26
|
+
switch (type) {
|
|
27
|
+
case "next":
|
|
28
|
+
return customLabelNextPage;
|
|
29
|
+
case "previous":
|
|
30
|
+
return customLabelPreviousPage;
|
|
31
|
+
case "last":
|
|
32
|
+
return customLabelLastPage;
|
|
33
|
+
case "first":
|
|
34
|
+
return customLabelFirstPage;
|
|
35
|
+
default:
|
|
36
|
+
return "";
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
...otherProps
|
|
40
|
+
}
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
export {
|
|
44
|
+
CustomTablePagination
|
|
45
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2026, 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 { CustomTablePagination } from './custom-table-pagination';
|
package/dist/features/index.d.ts
CHANGED
package/dist/features/index.js
CHANGED
|
@@ -201,6 +201,13 @@ import { MAX_COMPOSITE_NESTING_DEPTH, fetchSubModificationsForExpandedRows, find
|
|
|
201
201
|
import { AnnouncementBanner } from "./announcement/AnnouncementBanner.js";
|
|
202
202
|
import { AnnouncementNotification } from "./announcement/AnnouncementNotification.js";
|
|
203
203
|
import { useGlobalAnnouncement } from "./announcement/useGlobalAnnouncement.js";
|
|
204
|
+
import { SecurityAnalysisResultNmk } from "./results/securityanalysis/security-analysis-result-nmk.js";
|
|
205
|
+
import { SecurityAnalysisTable } from "./results/securityanalysis/security-analysis-table.js";
|
|
206
|
+
import { NmkType } from "./results/securityanalysis/security-analysis.type.js";
|
|
207
|
+
import { PAGE_OPTIONS, flattenNmKResultsConstraints, flattenNmKResultsContingencies, getNoRowsMessage, handlePostSortRows, mapNmKResultsCutOffPower } from "./results/securityanalysis/utils.js";
|
|
208
|
+
import { UpdateSAProcessConfigDialog } from "./process-configs/security-analysis/update-sa-process-config-dialog.js";
|
|
209
|
+
import { getSAProcessConfigBackendFromFormData, getSAProcessConfigFormDataFromFetchedElement, isProcessType, toSAProcessConfig, updateSAProcessConfigFormSchema } from "./process-configs/security-analysis/update-sa-process-configs-utils.js";
|
|
210
|
+
import { ProcessType } from "./process-configs/process-configs.type.js";
|
|
204
211
|
export {
|
|
205
212
|
ACCURACY,
|
|
206
213
|
ACTIVE,
|
|
@@ -366,8 +373,10 @@ export {
|
|
|
366
373
|
NetworkVisualizationParametersInline,
|
|
367
374
|
NetworkVisualizationTabValues,
|
|
368
375
|
NetworkVisualizationsParametersEditionDialog,
|
|
376
|
+
NmkType,
|
|
369
377
|
NotificationsContext,
|
|
370
378
|
NotificationsProvider,
|
|
379
|
+
PAGE_OPTIONS,
|
|
371
380
|
PARAM_CENTER_LABEL,
|
|
372
381
|
PARAM_COMPONENT_LIBRARY,
|
|
373
382
|
PARAM_DIAGONAL_LABEL,
|
|
@@ -401,6 +410,7 @@ export {
|
|
|
401
410
|
PowerMeasurementsForm,
|
|
402
411
|
PowerWithValidityForm,
|
|
403
412
|
PredefinedParameters,
|
|
413
|
+
ProcessType,
|
|
404
414
|
PropertiesForm,
|
|
405
415
|
PropertyForm,
|
|
406
416
|
ProviderParam,
|
|
@@ -447,6 +457,8 @@ export {
|
|
|
447
457
|
SWITCH_TYPE,
|
|
448
458
|
SecurityAnalysisParametersDialog,
|
|
449
459
|
SecurityAnalysisParametersInline,
|
|
460
|
+
SecurityAnalysisResultNmk,
|
|
461
|
+
SecurityAnalysisTable,
|
|
450
462
|
SelectCell,
|
|
451
463
|
SelectCellRenderer,
|
|
452
464
|
SelectHeaderCell,
|
|
@@ -481,6 +493,7 @@ export {
|
|
|
481
493
|
UPDATE_BUS_VOLTAGE,
|
|
482
494
|
USE_REACTIVE_LIMITS,
|
|
483
495
|
UnauthorizedAccessAlert,
|
|
496
|
+
UpdateSAProcessConfigDialog,
|
|
484
497
|
UserManagerMock,
|
|
485
498
|
VARIABLE_Q_GENERATORS,
|
|
486
499
|
VARIABLE_SHUNT_COMPENSATORS,
|
|
@@ -543,6 +556,8 @@ export {
|
|
|
543
556
|
findAllLoadedCompositeModifications,
|
|
544
557
|
findDepth,
|
|
545
558
|
findModificationInTree,
|
|
559
|
+
flattenNmKResultsConstraints,
|
|
560
|
+
flattenNmKResultsContingencies,
|
|
546
561
|
formatComputingTypeLabel,
|
|
547
562
|
formatToComposedModification,
|
|
548
563
|
generatorCreationDtoToForm,
|
|
@@ -596,6 +611,7 @@ export {
|
|
|
596
611
|
getInjectionActiveReactivePowerValidationSchemaProperties,
|
|
597
612
|
getLimitReductionsFormSchema,
|
|
598
613
|
getNewVoltageLevelData,
|
|
614
|
+
getNoRowsMessage,
|
|
599
615
|
getPowerWithValidityEditData,
|
|
600
616
|
getPowerWithValidityEmptyFormData,
|
|
601
617
|
getPowerWithValidityValidationSchema,
|
|
@@ -616,6 +632,8 @@ export {
|
|
|
616
632
|
getRegulatingTerminalFormData,
|
|
617
633
|
getRegulatingTerminalVoltageLevelData,
|
|
618
634
|
getRowEmptyFormData,
|
|
635
|
+
getSAProcessConfigBackendFromFormData,
|
|
636
|
+
getSAProcessConfigFormDataFromFetchedElement,
|
|
619
637
|
getSetPointsEmptyFormData,
|
|
620
638
|
getSetPointsSchema,
|
|
621
639
|
getShortCircuitEmptyFormData,
|
|
@@ -623,6 +641,7 @@ export {
|
|
|
623
641
|
getShortCircuitFormSchema,
|
|
624
642
|
getVoltageRegulationEmptyFormData,
|
|
625
643
|
getVoltageRegulationSchema,
|
|
644
|
+
handlePostSortRows,
|
|
626
645
|
handleSigninCallback,
|
|
627
646
|
handleSilentRenewCallback,
|
|
628
647
|
initializeAuthenticationDev,
|
|
@@ -631,6 +650,7 @@ export {
|
|
|
631
650
|
intlInitialVoltageProfileMode,
|
|
632
651
|
intlPredefinedParametersOptions,
|
|
633
652
|
isCompositeModification,
|
|
653
|
+
isProcessType,
|
|
634
654
|
isValidComputingType,
|
|
635
655
|
isValidContingencyRow,
|
|
636
656
|
italicFontTextField,
|
|
@@ -644,6 +664,7 @@ export {
|
|
|
644
664
|
loadModificationFormToDto,
|
|
645
665
|
login,
|
|
646
666
|
logout,
|
|
667
|
+
mapNmKResultsCutOffPower,
|
|
647
668
|
mergeModificationAndEquipmentProperties,
|
|
648
669
|
mergeSubModificationsIntoTree,
|
|
649
670
|
modificationByAssignmentDtoToForm,
|
|
@@ -681,8 +702,10 @@ export {
|
|
|
681
702
|
toModificationProperties,
|
|
682
703
|
toReactiveCapabilityCurveChoiceForGeneratorCreation,
|
|
683
704
|
toReactiveCapabilityCurveChoiceForGeneratorModification,
|
|
705
|
+
toSAProcessConfig,
|
|
684
706
|
translateSwitchKinds,
|
|
685
707
|
updateModificationFieldInTree,
|
|
708
|
+
updateSAProcessConfigFormSchema,
|
|
686
709
|
updateSubModificationsOfACompositeInTree,
|
|
687
710
|
useGlobalAnnouncement,
|
|
688
711
|
useHvdcLccDeletion,
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2026, 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 https://mozilla.org/MPL/2.0/.
|
|
6
|
+
*/
|
|
7
|
+
export * from './security-analysis';
|
|
8
|
+
export * from './process-configs.type';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { UpdateSAProcessConfigDialog } from "./security-analysis/update-sa-process-config-dialog.js";
|
|
2
|
+
import { getSAProcessConfigBackendFromFormData, getSAProcessConfigFormDataFromFetchedElement, isProcessType, toSAProcessConfig, updateSAProcessConfigFormSchema } from "./security-analysis/update-sa-process-configs-utils.js";
|
|
3
|
+
import { ProcessType } from "./process-configs.type.js";
|
|
4
|
+
export {
|
|
5
|
+
ProcessType,
|
|
6
|
+
UpdateSAProcessConfigDialog,
|
|
7
|
+
getSAProcessConfigBackendFromFormData,
|
|
8
|
+
getSAProcessConfigFormDataFromFetchedElement,
|
|
9
|
+
isProcessType,
|
|
10
|
+
toSAProcessConfig,
|
|
11
|
+
updateSAProcessConfigFormSchema
|
|
12
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { UUID } from 'node:crypto';
|
|
2
|
+
import { IdName } from '../../utils';
|
|
3
|
+
export declare enum ProcessType {
|
|
4
|
+
SECURITY_ANALYSIS = "SECURITY_ANALYSIS",
|
|
5
|
+
LOADFLOW = "LOADFLOW"
|
|
6
|
+
}
|
|
7
|
+
export interface ProcessConfigBaseBackend {
|
|
8
|
+
processType: ProcessType;
|
|
9
|
+
modificationUuids: UUID[];
|
|
10
|
+
}
|
|
11
|
+
export interface SecurityAnalysisProcessConfigBackend extends ProcessConfigBaseBackend {
|
|
12
|
+
processType: ProcessType.SECURITY_ANALYSIS;
|
|
13
|
+
securityAnalysisParametersUuid: UUID;
|
|
14
|
+
loadflowParametersUuid: UUID;
|
|
15
|
+
}
|
|
16
|
+
export type ProcessConfigBackend = SecurityAnalysisProcessConfigBackend;
|
|
17
|
+
export type PersistedProcessConfigBackend = {
|
|
18
|
+
id: UUID;
|
|
19
|
+
processConfig: ProcessConfigBackend;
|
|
20
|
+
};
|
|
21
|
+
export type SecurityAnalysisProcessConfig = Omit<SecurityAnalysisProcessConfigBackend, 'securityAnalysisParametersUuid' | 'loadflowParametersUuid' | 'modificationUuids'> & {
|
|
22
|
+
modifications: (IdName & {
|
|
23
|
+
enabled: boolean;
|
|
24
|
+
description?: string;
|
|
25
|
+
})[];
|
|
26
|
+
loadflowParameters: IdName;
|
|
27
|
+
securityAnalysisParameters: IdName;
|
|
28
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2026, 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 https://mozilla.org/MPL/2.0/.
|
|
6
|
+
*/
|
|
7
|
+
export * from './update-sa-process-config-dialog';
|
|
8
|
+
export * from './update-sa-process-configs-utils';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { UpdateSAProcessConfigDialog } from "./update-sa-process-config-dialog.js";
|
|
2
|
+
import { getSAProcessConfigBackendFromFormData, getSAProcessConfigFormDataFromFetchedElement, isProcessType, toSAProcessConfig, updateSAProcessConfigFormSchema } from "./update-sa-process-configs-utils.js";
|
|
3
|
+
export {
|
|
4
|
+
UpdateSAProcessConfigDialog,
|
|
5
|
+
getSAProcessConfigBackendFromFormData,
|
|
6
|
+
getSAProcessConfigFormDataFromFetchedElement,
|
|
7
|
+
isProcessType,
|
|
8
|
+
toSAProcessConfig,
|
|
9
|
+
updateSAProcessConfigFormSchema
|
|
10
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { UUID } from 'node:crypto';
|
|
2
|
+
import { PersistedProcessConfigBackend, SecurityAnalysisProcessConfigBackend } from '../process-configs.type';
|
|
3
|
+
interface UpdateSAProcessConfigDialogProps {
|
|
4
|
+
open: boolean;
|
|
5
|
+
onClose: () => void;
|
|
6
|
+
processConfigId: UUID;
|
|
7
|
+
name: string;
|
|
8
|
+
description: string | null;
|
|
9
|
+
directory: UUID;
|
|
10
|
+
fetchSAProcessConfig: (processConfigUuid: UUID) => Promise<PersistedProcessConfigBackend>;
|
|
11
|
+
updateSAProcessConfig: (processConfigUuid: UUID, name: string, description: string, processConfig: SecurityAnalysisProcessConfigBackend) => Promise<void>;
|
|
12
|
+
}
|
|
13
|
+
export declare function UpdateSAProcessConfigDialog({ onClose, open, processConfigId, description, name, directory, fetchSAProcessConfig, updateSAProcessConfig, }: Readonly<UpdateSAProcessConfigDialogProps>): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useState, useCallback, useEffect } from "react";
|
|
3
|
+
import { useForm } from "react-hook-form";
|
|
4
|
+
import { yupResolver } from "@hookform/resolvers/yup";
|
|
5
|
+
import { LinearProgress } from "@mui/material";
|
|
6
|
+
import { UpdateSaProcessConfig } from "./update-sa-process-config.js";
|
|
7
|
+
import { updateSAProcessConfigFormSchema, toSAProcessConfig, getSAProcessConfigFormDataFromFetchedElement, getSAProcessConfigBackendFromFormData } from "./update-sa-process-configs-utils.js";
|
|
8
|
+
import "@mui/icons-material";
|
|
9
|
+
import "react-intl";
|
|
10
|
+
import "../../../components/ui/overflowableText/OverflowableText.js";
|
|
11
|
+
import { FieldConstants } from "../../../utils/constants/fieldConstants.js";
|
|
12
|
+
import "../../../utils/conversionUtils.js";
|
|
13
|
+
import "../../../utils/types/equipmentType.js";
|
|
14
|
+
import "localized-countries";
|
|
15
|
+
import "localized-countries/data/fr";
|
|
16
|
+
import "localized-countries/data/en";
|
|
17
|
+
import "notistack";
|
|
18
|
+
import "../../../components/ui/reactHookForm/provider/CustomFormProvider.js";
|
|
19
|
+
import "yup";
|
|
20
|
+
import "../../../components/ui/treeViewFinder/TreeViewFinder.js";
|
|
21
|
+
import "../../../components/ui/reactHookForm/numbers/RangeInput.js";
|
|
22
|
+
import "@material-symbols/svg-400/outlined/left_panel_open.svg?react";
|
|
23
|
+
import "@material-symbols/svg-400/outlined/arrows_output.svg?react";
|
|
24
|
+
import "@material-symbols/svg-400/outlined/arrows_input.svg?react";
|
|
25
|
+
import "@material-symbols/svg-400/outlined/left_panel_close.svg?react";
|
|
26
|
+
import "@material-symbols/svg-400/outlined/add_notes.svg?react";
|
|
27
|
+
import "../../../components/ui/dialogs/descriptionModificationDialog/DescriptionModificationDialog.js";
|
|
28
|
+
import "../../../components/ui/reactHookForm/expandableInput/ExpandableInput.js";
|
|
29
|
+
import "@hello-pangea/dnd";
|
|
30
|
+
import { CustomMuiDialog } from "../../../components/ui/dialogs/customMuiDialog/CustomMuiDialog.js";
|
|
31
|
+
import "../../../components/ui/dialogs/elementSaveDialog/ElementSaveDialog.js";
|
|
32
|
+
import "../../../components/ui/snackbarProvider/SnackbarProvider.js";
|
|
33
|
+
import "mui-nested-menu";
|
|
34
|
+
import "react-resizable-panels";
|
|
35
|
+
import "react-papaparse";
|
|
36
|
+
import "react-dom";
|
|
37
|
+
import "autosuggest-highlight/match";
|
|
38
|
+
import "autosuggest-highlight/parse";
|
|
39
|
+
import "clsx";
|
|
40
|
+
import "../../../components/composite/filter/FilterCreationDialog.js";
|
|
41
|
+
import "../../../components/composite/filter/HeaderFilterForm.js";
|
|
42
|
+
import "../../../components/composite/filter/explicitNaming/ExplicitNamingFilterForm.js";
|
|
43
|
+
import "../../../components/composite/filter/expert/ExpertFilterForm.js";
|
|
44
|
+
import "../../../components/composite/filter/expert/ExpertFilterEditionDialog.js";
|
|
45
|
+
import "../../../components/composite/filter/expert/expertFilterConstants.js";
|
|
46
|
+
import "react-querybuilder";
|
|
47
|
+
import "uuid";
|
|
48
|
+
import "../../../components/composite/filter/explicitNaming/ExplicitNamingFilterEditionDialog.js";
|
|
49
|
+
import "../../../components/composite/filter/utils/filterFormUtils.js";
|
|
50
|
+
import "@react-querybuilder/material";
|
|
51
|
+
import "../../../components/composite/reactQueryBuilder/CustomReactQueryBuilder.js";
|
|
52
|
+
import "../../../components/composite/reactQueryBuilder/PropertyValueEditor.js";
|
|
53
|
+
import "../../../components/composite/agGridTable/BottomTableButtons.js";
|
|
54
|
+
import "../../../components/composite/agGridTable/CustomAgGridTable.js";
|
|
55
|
+
import "ag-grid-community";
|
|
56
|
+
import "../../../components/composite/customAGGrid/customAggrid.js";
|
|
57
|
+
function UpdateSAProcessConfigDialog({
|
|
58
|
+
onClose,
|
|
59
|
+
open,
|
|
60
|
+
processConfigId,
|
|
61
|
+
description,
|
|
62
|
+
name,
|
|
63
|
+
directory,
|
|
64
|
+
fetchSAProcessConfig,
|
|
65
|
+
updateSAProcessConfig
|
|
66
|
+
}) {
|
|
67
|
+
const [isLoading, setIsLoading] = useState(false);
|
|
68
|
+
const emptyFormData = {
|
|
69
|
+
name,
|
|
70
|
+
description: description ?? "",
|
|
71
|
+
modifications: [],
|
|
72
|
+
loadflowParameters: [],
|
|
73
|
+
securityAnalysisParameters: []
|
|
74
|
+
};
|
|
75
|
+
const methods = useForm({
|
|
76
|
+
defaultValues: emptyFormData,
|
|
77
|
+
resolver: yupResolver(updateSAProcessConfigFormSchema)
|
|
78
|
+
});
|
|
79
|
+
const {
|
|
80
|
+
reset,
|
|
81
|
+
formState: { errors }
|
|
82
|
+
} = methods;
|
|
83
|
+
const fetchSAProcessConfigData = useCallback(async () => {
|
|
84
|
+
const persistedProcessConfig = await fetchSAProcessConfig(processConfigId);
|
|
85
|
+
if (persistedProcessConfig) {
|
|
86
|
+
const processConfigData = await toSAProcessConfig(persistedProcessConfig);
|
|
87
|
+
const formData = getSAProcessConfigFormDataFromFetchedElement(processConfigData, name, description);
|
|
88
|
+
reset({ ...formData });
|
|
89
|
+
}
|
|
90
|
+
}, [description, fetchSAProcessConfig, name, processConfigId, reset]);
|
|
91
|
+
useEffect(() => {
|
|
92
|
+
setIsLoading(true);
|
|
93
|
+
fetchSAProcessConfigData().finally(() => setIsLoading(false));
|
|
94
|
+
}, [fetchSAProcessConfigData]);
|
|
95
|
+
const handleUpdateProcessConfig = useCallback(
|
|
96
|
+
(processConfigFormData) => {
|
|
97
|
+
updateSAProcessConfig(
|
|
98
|
+
processConfigId,
|
|
99
|
+
processConfigFormData.name,
|
|
100
|
+
processConfigFormData.description ?? "",
|
|
101
|
+
getSAProcessConfigBackendFromFormData(processConfigFormData)
|
|
102
|
+
).then(() => onClose());
|
|
103
|
+
},
|
|
104
|
+
[processConfigId, onClose, updateSAProcessConfig]
|
|
105
|
+
);
|
|
106
|
+
const nameError = errors[FieldConstants.NAME];
|
|
107
|
+
const isValidating = errors.root?.isValidating;
|
|
108
|
+
return /* @__PURE__ */ jsxs(
|
|
109
|
+
CustomMuiDialog,
|
|
110
|
+
{
|
|
111
|
+
titleId: "process_config/editSAProcessConfigTitle",
|
|
112
|
+
formContext: {
|
|
113
|
+
...methods,
|
|
114
|
+
validationSchema: updateSAProcessConfigFormSchema,
|
|
115
|
+
removeOptional: true
|
|
116
|
+
},
|
|
117
|
+
open,
|
|
118
|
+
onClose,
|
|
119
|
+
onSave: handleUpdateProcessConfig,
|
|
120
|
+
disabledSave: Boolean(nameError || isValidating),
|
|
121
|
+
children: [
|
|
122
|
+
!isLoading && /* @__PURE__ */ jsx(UpdateSaProcessConfig, { directory, processConfigName: name }),
|
|
123
|
+
isLoading && /* @__PURE__ */ jsx(LinearProgress, {})
|
|
124
|
+
]
|
|
125
|
+
}
|
|
126
|
+
);
|
|
127
|
+
}
|
|
128
|
+
export {
|
|
129
|
+
UpdateSAProcessConfigDialog
|
|
130
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { UUID } from 'node:crypto';
|
|
2
|
+
interface UpdateSaProcessConfigProps {
|
|
3
|
+
directory: UUID;
|
|
4
|
+
processConfigName: string;
|
|
5
|
+
}
|
|
6
|
+
export declare function UpdateSaProcessConfig({ directory, processConfigName }: Readonly<UpdateSaProcessConfigProps>): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { jsxs, Fragment, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Box } from "@mui/material";
|
|
3
|
+
import { FormattedMessage } from "react-intl";
|
|
4
|
+
import { UpdateProcessConfigModifications } from "../update-process-config-modifications.js";
|
|
5
|
+
import { FieldConstants } from "../../../utils/constants/fieldConstants.js";
|
|
6
|
+
import "../../../utils/conversionUtils.js";
|
|
7
|
+
import { ElementType } from "../../../utils/types/elementType.js";
|
|
8
|
+
import "../../../utils/types/equipmentType.js";
|
|
9
|
+
import "@mui/icons-material";
|
|
10
|
+
import "react";
|
|
11
|
+
import "localized-countries";
|
|
12
|
+
import "localized-countries/data/fr";
|
|
13
|
+
import "localized-countries/data/en";
|
|
14
|
+
import "notistack";
|
|
15
|
+
import "react-hook-form";
|
|
16
|
+
import "../../../components/ui/reactHookForm/provider/CustomFormProvider.js";
|
|
17
|
+
import "../../../components/ui/dialogs/descriptionModificationDialog/DescriptionModificationDialog.js";
|
|
18
|
+
import "../../../components/ui/dialogs/elementSaveDialog/ElementSaveDialog.js";
|
|
19
|
+
import "../../../components/ui/treeViewFinder/TreeViewFinder.js";
|
|
20
|
+
import "@hello-pangea/dnd";
|
|
21
|
+
import "../../../components/ui/overflowableText/OverflowableText.js";
|
|
22
|
+
import "yup";
|
|
23
|
+
import "../../../components/ui/reactHookForm/numbers/RangeInput.js";
|
|
24
|
+
import "@material-symbols/svg-400/outlined/left_panel_open.svg?react";
|
|
25
|
+
import "@material-symbols/svg-400/outlined/arrows_output.svg?react";
|
|
26
|
+
import "@material-symbols/svg-400/outlined/arrows_input.svg?react";
|
|
27
|
+
import "@material-symbols/svg-400/outlined/left_panel_close.svg?react";
|
|
28
|
+
import "@material-symbols/svg-400/outlined/add_notes.svg?react";
|
|
29
|
+
import "../../../components/ui/reactHookForm/expandableInput/ExpandableInput.js";
|
|
30
|
+
import "../../../components/ui/snackbarProvider/SnackbarProvider.js";
|
|
31
|
+
import "mui-nested-menu";
|
|
32
|
+
import "react-resizable-panels";
|
|
33
|
+
import "react-papaparse";
|
|
34
|
+
import { ParameterLineDirectoryItemsInput } from "../../parameters/common/widget/parameter-line-directory-items-input.js";
|
|
35
|
+
import "../../parameters/common/widget/parameter-line-slider.js";
|
|
36
|
+
import "../../parameters/common/limitreductions/columns-definitions.js";
|
|
37
|
+
import "../../parameters/common/contingency-table/contingency-table.js";
|
|
38
|
+
import "../../parameters/common/contingency-table/columns-definitions.js";
|
|
39
|
+
import "@hookform/resolvers/yup";
|
|
40
|
+
import { NameElementEditorForm } from "../../parameters/common/name-element-editor/name-element-editor-form.js";
|
|
41
|
+
import "../../parameters/network-visualizations/constants.js";
|
|
42
|
+
import "../../parameters/loadflow/load-flow-parameters-context.js";
|
|
43
|
+
import "../../parameters/loadflow/load-flow-parameters-content.js";
|
|
44
|
+
import "../../parameters/short-circuit/short-circuit-parameters-content.js";
|
|
45
|
+
import "react-dom";
|
|
46
|
+
import "../../parameters/sensi/utils.js";
|
|
47
|
+
import "../../parameters/sensi/columns-definitions.js";
|
|
48
|
+
import "../../parameters/dynamic-simulation/use-dynamic-simulation-parameters-form.js";
|
|
49
|
+
import "../../parameters/dynamic-simulation/time-delay/time-delay-parameters-utils.js";
|
|
50
|
+
import "../../parameters/dynamic-simulation/time-delay/time-delay-parameters.js";
|
|
51
|
+
import "../../parameters/dynamic-simulation/solver/solver-parameters-utils.js";
|
|
52
|
+
import "../../parameters/dynamic-simulation/solver/solver-parameters.js";
|
|
53
|
+
import "../../parameters/dynamic-simulation/mapping/mapping-parameters-utils.js";
|
|
54
|
+
import "../../parameters/dynamic-simulation/network/network-parameters-utils.js";
|
|
55
|
+
import "../../parameters/dynamic-simulation/network/network-parameters.js";
|
|
56
|
+
import "../../parameters/dynamic-simulation/curve/dialog/curve-preview.js";
|
|
57
|
+
import "../../parameters/dynamic-simulation/curve/dialog/curve-selector.js";
|
|
58
|
+
import "../../parameters/dynamic-simulation/curve/common/grid-search.js";
|
|
59
|
+
import "../../../components/composite/customAGGrid/customAggrid.js";
|
|
60
|
+
import "../../parameters/dynamic-security-analysis/use-dynamic-security-analysis-parameters-form.js";
|
|
61
|
+
import "../../parameters/dynamic-security-analysis/scenario-parameters.js";
|
|
62
|
+
import "../../parameters/dynamic-security-analysis/contingency-parameters.js";
|
|
63
|
+
import "../../parameters/dynamic-margin-calculation/time-delay-parameters.js";
|
|
64
|
+
import "../../parameters/dynamic-margin-calculation/loads-variations-parameters.js";
|
|
65
|
+
import "../../parameters/dynamic-margin-calculation/use-dynamic-margin-calculation-parameters-form.js";
|
|
66
|
+
function UpdateSaProcessConfig({ directory, processConfigName }) {
|
|
67
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
68
|
+
/* @__PURE__ */ jsx(
|
|
69
|
+
NameElementEditorForm,
|
|
70
|
+
{
|
|
71
|
+
activeDirectory: directory,
|
|
72
|
+
elementType: ElementType.PROCESS_CONFIG,
|
|
73
|
+
initialElementName: processConfigName
|
|
74
|
+
}
|
|
75
|
+
),
|
|
76
|
+
/* @__PURE__ */ jsx(Box, { component: "h3", children: /* @__PURE__ */ jsx(FormattedMessage, { id: "process_config/modifications" }) }),
|
|
77
|
+
/* @__PURE__ */ jsx(UpdateProcessConfigModifications, { name: FieldConstants.MODIFICATIONS }),
|
|
78
|
+
/* @__PURE__ */ jsx(Box, { component: "h3", children: /* @__PURE__ */ jsx(FormattedMessage, { id: "process_config/providersParameters" }) }),
|
|
79
|
+
/* @__PURE__ */ jsx(
|
|
80
|
+
ParameterLineDirectoryItemsInput,
|
|
81
|
+
{
|
|
82
|
+
label: "process_config/loadflow",
|
|
83
|
+
elementType: ElementType.LOADFLOW_PARAMETERS,
|
|
84
|
+
name: FieldConstants.LOADFLOW_PARAMETERS,
|
|
85
|
+
allowMultiSelect: false,
|
|
86
|
+
hideErrorMessage: false
|
|
87
|
+
}
|
|
88
|
+
),
|
|
89
|
+
/* @__PURE__ */ jsx(
|
|
90
|
+
ParameterLineDirectoryItemsInput,
|
|
91
|
+
{
|
|
92
|
+
label: "process_config/securityAnalysis",
|
|
93
|
+
elementType: ElementType.SECURITY_ANALYSIS_PARAMETERS,
|
|
94
|
+
name: FieldConstants.SECURITY_ANALYSIS_PARAMETERS,
|
|
95
|
+
allowMultiSelect: false,
|
|
96
|
+
hideErrorMessage: false
|
|
97
|
+
}
|
|
98
|
+
)
|
|
99
|
+
] });
|
|
100
|
+
}
|
|
101
|
+
export {
|
|
102
|
+
UpdateSaProcessConfig
|
|
103
|
+
};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { PersistedProcessConfigBackend, ProcessType, SecurityAnalysisProcessConfig, SecurityAnalysisProcessConfigBackend } from '../process-configs.type';
|
|
2
|
+
/**
|
|
3
|
+
* Copyright (c) 2026, RTE (http://www.rte-france.com)
|
|
4
|
+
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
5
|
+
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
6
|
+
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
7
|
+
*/
|
|
8
|
+
import * as yup from 'yup';
|
|
9
|
+
export declare function getSAProcessConfigFormDataFromFetchedElement(processConfig: SecurityAnalysisProcessConfig, name: string, description: string | null): {
|
|
10
|
+
name: string;
|
|
11
|
+
description: string | undefined;
|
|
12
|
+
modifications: {
|
|
13
|
+
modification: {
|
|
14
|
+
id: `${string}-${string}-${string}-${string}-${string}`;
|
|
15
|
+
name: string | undefined;
|
|
16
|
+
}[];
|
|
17
|
+
}[];
|
|
18
|
+
securityAnalysisParameters: import('../../..').IdName[];
|
|
19
|
+
loadflowParameters: import('../../..').IdName[];
|
|
20
|
+
};
|
|
21
|
+
export declare function getSAProcessConfigBackendFromFormData(formData: UpdateSAProcessConfigFormData): SecurityAnalysisProcessConfigBackend;
|
|
22
|
+
export declare const updateSAProcessConfigFormSchema: yup.ObjectSchema<{
|
|
23
|
+
name: string;
|
|
24
|
+
description: string | undefined;
|
|
25
|
+
modifications: {
|
|
26
|
+
modification: {
|
|
27
|
+
id: string;
|
|
28
|
+
name: string;
|
|
29
|
+
}[];
|
|
30
|
+
}[];
|
|
31
|
+
loadflowParameters: {
|
|
32
|
+
id: string;
|
|
33
|
+
name: string;
|
|
34
|
+
}[];
|
|
35
|
+
securityAnalysisParameters: {
|
|
36
|
+
id: string;
|
|
37
|
+
name: string;
|
|
38
|
+
}[];
|
|
39
|
+
}, yup.AnyObject, {
|
|
40
|
+
name: undefined;
|
|
41
|
+
description: undefined;
|
|
42
|
+
modifications: "";
|
|
43
|
+
loadflowParameters: "";
|
|
44
|
+
securityAnalysisParameters: "";
|
|
45
|
+
}, "">;
|
|
46
|
+
export type UpdateSAProcessConfigFormData = yup.InferType<typeof updateSAProcessConfigFormSchema>;
|
|
47
|
+
export declare function toSAProcessConfig(persistedProcessConfig: PersistedProcessConfigBackend): Promise<{
|
|
48
|
+
processType: ProcessType.SECURITY_ANALYSIS;
|
|
49
|
+
modifications: {
|
|
50
|
+
id: `${string}-${string}-${string}-${string}-${string}`;
|
|
51
|
+
name: string;
|
|
52
|
+
enabled: true;
|
|
53
|
+
description: undefined;
|
|
54
|
+
}[];
|
|
55
|
+
securityAnalysisParameters: {
|
|
56
|
+
id: `${string}-${string}-${string}-${string}-${string}`;
|
|
57
|
+
name: string;
|
|
58
|
+
};
|
|
59
|
+
loadflowParameters: {
|
|
60
|
+
id: `${string}-${string}-${string}-${string}-${string}`;
|
|
61
|
+
name: string;
|
|
62
|
+
};
|
|
63
|
+
}>;
|
|
64
|
+
export declare function isProcessType(type: string): type is ProcessType;
|