@gridsuite/commons-ui 0.232.0 → 0.234.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/composite/agGridTable/CustomAgGridTable.js +49 -1
- 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 +1 -1
|
@@ -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;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import * as yup from "yup";
|
|
2
|
+
import { ProcessType } from "../process-configs.type.js";
|
|
3
|
+
import { FieldConstants } from "../../../utils/constants/fieldConstants.js";
|
|
4
|
+
import { YUP_REQUIRED } from "../../../utils/constants/translationKeys.js";
|
|
5
|
+
import "../../../utils/conversionUtils.js";
|
|
6
|
+
import "../../../utils/types/equipmentType.js";
|
|
7
|
+
import "react/jsx-runtime";
|
|
8
|
+
import "@mui/icons-material";
|
|
9
|
+
import { fetchElementNames } from "../../../services/directory.js";
|
|
10
|
+
function getSAProcessConfigFormDataFromFetchedElement(processConfig, name, description) {
|
|
11
|
+
return {
|
|
12
|
+
name,
|
|
13
|
+
description: description ?? void 0,
|
|
14
|
+
modifications: processConfig.modifications.map((modification) => ({
|
|
15
|
+
modification: [{ id: modification.id, name: modification.name }]
|
|
16
|
+
})),
|
|
17
|
+
securityAnalysisParameters: [processConfig.securityAnalysisParameters],
|
|
18
|
+
loadflowParameters: [processConfig.loadflowParameters]
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
function getSAProcessConfigBackendFromFormData(formData) {
|
|
22
|
+
return {
|
|
23
|
+
processType: ProcessType.SECURITY_ANALYSIS,
|
|
24
|
+
loadflowParametersUuid: formData.loadflowParameters[0].id,
|
|
25
|
+
securityAnalysisParametersUuid: formData.securityAnalysisParameters[0].id,
|
|
26
|
+
modificationUuids: formData.modifications.map((modification) => modification.modification[0].id)
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
const updateSAProcessConfigFormSchema = yup.object().shape({
|
|
30
|
+
[FieldConstants.NAME]: yup.string().required(),
|
|
31
|
+
[FieldConstants.DESCRIPTION]: yup.string(),
|
|
32
|
+
[FieldConstants.MODIFICATIONS]: yup.array().required().of(
|
|
33
|
+
yup.object().shape({
|
|
34
|
+
modification: yup.array().required().of(
|
|
35
|
+
yup.object().shape({
|
|
36
|
+
id: yup.string().required(),
|
|
37
|
+
name: yup.string().required()
|
|
38
|
+
}).required()
|
|
39
|
+
).length(1, YUP_REQUIRED)
|
|
40
|
+
})
|
|
41
|
+
),
|
|
42
|
+
[FieldConstants.LOADFLOW_PARAMETERS]: yup.array().required().of(yup.object().shape({ id: yup.string().required(), name: yup.string().required() })).length(1, YUP_REQUIRED),
|
|
43
|
+
[FieldConstants.SECURITY_ANALYSIS_PARAMETERS]: yup.array().required().of(yup.object().shape({ id: yup.string().required(), name: yup.string().required() })).length(1, YUP_REQUIRED)
|
|
44
|
+
});
|
|
45
|
+
async function toSAProcessConfig(persistedProcessConfig) {
|
|
46
|
+
const { processConfig } = persistedProcessConfig;
|
|
47
|
+
const allUuids = /* @__PURE__ */ new Set([
|
|
48
|
+
...processConfig.modificationUuids,
|
|
49
|
+
processConfig.securityAnalysisParametersUuid,
|
|
50
|
+
processConfig.loadflowParametersUuid
|
|
51
|
+
]);
|
|
52
|
+
const elementNamesByUuid = await fetchElementNames(allUuids);
|
|
53
|
+
return {
|
|
54
|
+
processType: processConfig.processType,
|
|
55
|
+
modifications: processConfig.modificationUuids.map((uuid) => ({
|
|
56
|
+
id: uuid,
|
|
57
|
+
name: elementNamesByUuid[uuid],
|
|
58
|
+
enabled: true,
|
|
59
|
+
description: void 0
|
|
60
|
+
})),
|
|
61
|
+
securityAnalysisParameters: {
|
|
62
|
+
id: processConfig.securityAnalysisParametersUuid,
|
|
63
|
+
name: elementNamesByUuid[processConfig.securityAnalysisParametersUuid]
|
|
64
|
+
},
|
|
65
|
+
loadflowParameters: {
|
|
66
|
+
id: processConfig.loadflowParametersUuid,
|
|
67
|
+
name: elementNamesByUuid[processConfig.loadflowParametersUuid]
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
function isProcessType(type) {
|
|
72
|
+
return Object.values(ProcessType).includes(type);
|
|
73
|
+
}
|
|
74
|
+
export {
|
|
75
|
+
getSAProcessConfigBackendFromFormData,
|
|
76
|
+
getSAProcessConfigFormDataFromFetchedElement,
|
|
77
|
+
isProcessType,
|
|
78
|
+
toSAProcessConfig,
|
|
79
|
+
updateSAProcessConfigFormSchema
|
|
80
|
+
};
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useFieldArray } from "react-hook-form";
|
|
3
|
+
import { useCallback, useMemo } from "react";
|
|
4
|
+
import { useIntl } from "react-intl";
|
|
5
|
+
import "@mui/material";
|
|
6
|
+
import "@mui/icons-material";
|
|
7
|
+
import "../../components/ui/overflowableText/OverflowableText.js";
|
|
8
|
+
import "../../utils/conversionUtils.js";
|
|
9
|
+
import { ElementType } from "../../utils/types/elementType.js";
|
|
10
|
+
import "../../utils/types/equipmentType.js";
|
|
11
|
+
import "localized-countries";
|
|
12
|
+
import "localized-countries/data/fr";
|
|
13
|
+
import "localized-countries/data/en";
|
|
14
|
+
import "notistack";
|
|
15
|
+
import "../../components/ui/reactHookForm/provider/CustomFormProvider.js";
|
|
16
|
+
import "yup";
|
|
17
|
+
import { DirectoryItemsInput } from "../../components/ui/reactHookForm/DirectoryItemsInput.js";
|
|
18
|
+
import "../../components/ui/reactHookForm/numbers/RangeInput.js";
|
|
19
|
+
import "@material-symbols/svg-400/outlined/left_panel_open.svg?react";
|
|
20
|
+
import "@material-symbols/svg-400/outlined/arrows_output.svg?react";
|
|
21
|
+
import "@material-symbols/svg-400/outlined/arrows_input.svg?react";
|
|
22
|
+
import "@material-symbols/svg-400/outlined/left_panel_close.svg?react";
|
|
23
|
+
import "@material-symbols/svg-400/outlined/add_notes.svg?react";
|
|
24
|
+
import "../../components/ui/dialogs/descriptionModificationDialog/DescriptionModificationDialog.js";
|
|
25
|
+
import "../../components/ui/reactHookForm/expandableInput/ExpandableInput.js";
|
|
26
|
+
import "@hello-pangea/dnd";
|
|
27
|
+
import "../../components/ui/dialogs/elementSaveDialog/ElementSaveDialog.js";
|
|
28
|
+
import "../../components/ui/treeViewFinder/TreeViewFinder.js";
|
|
29
|
+
import "../../components/ui/snackbarProvider/SnackbarProvider.js";
|
|
30
|
+
import "mui-nested-menu";
|
|
31
|
+
import "react-resizable-panels";
|
|
32
|
+
import "react-papaparse";
|
|
33
|
+
import { DndTable } from "../../components/composite/dnd-table/dnd-table.js";
|
|
34
|
+
import { DndColumnType } from "../../components/composite/dnd-table/dnd-table.type.js";
|
|
35
|
+
import "autosuggest-highlight/match";
|
|
36
|
+
import "autosuggest-highlight/parse";
|
|
37
|
+
import "clsx";
|
|
38
|
+
import "../../components/composite/filter/FilterCreationDialog.js";
|
|
39
|
+
import "../../components/composite/filter/HeaderFilterForm.js";
|
|
40
|
+
import "../../components/composite/filter/explicitNaming/ExplicitNamingFilterForm.js";
|
|
41
|
+
import "../../components/composite/filter/expert/ExpertFilterForm.js";
|
|
42
|
+
import "../../components/composite/filter/expert/ExpertFilterEditionDialog.js";
|
|
43
|
+
import "../../components/composite/filter/expert/expertFilterConstants.js";
|
|
44
|
+
import "react-querybuilder";
|
|
45
|
+
import "uuid";
|
|
46
|
+
import "../../components/composite/filter/explicitNaming/ExplicitNamingFilterEditionDialog.js";
|
|
47
|
+
import "../../components/composite/filter/utils/filterFormUtils.js";
|
|
48
|
+
import "@react-querybuilder/material";
|
|
49
|
+
import "../../components/composite/reactQueryBuilder/CustomReactQueryBuilder.js";
|
|
50
|
+
import "../../components/composite/reactQueryBuilder/PropertyValueEditor.js";
|
|
51
|
+
import "../../components/composite/agGridTable/BottomTableButtons.js";
|
|
52
|
+
import "../../components/composite/agGridTable/CustomAgGridTable.js";
|
|
53
|
+
import "ag-grid-community";
|
|
54
|
+
import "../../components/composite/customAGGrid/customAggrid.js";
|
|
55
|
+
function UpdateProcessConfigModifications({ name }) {
|
|
56
|
+
const intl = useIntl();
|
|
57
|
+
const useFieldArrayModifications = useFieldArray({
|
|
58
|
+
name
|
|
59
|
+
});
|
|
60
|
+
const modificationSelector = useCallback(
|
|
61
|
+
(rowIndex) => /* @__PURE__ */ jsx(
|
|
62
|
+
DirectoryItemsInput,
|
|
63
|
+
{
|
|
64
|
+
name: `${name}[${rowIndex}].modification`,
|
|
65
|
+
allowMultiSelect: false,
|
|
66
|
+
elementType: ElementType.MODIFICATION,
|
|
67
|
+
titleId: "modifications",
|
|
68
|
+
label: void 0
|
|
69
|
+
}
|
|
70
|
+
),
|
|
71
|
+
[name]
|
|
72
|
+
);
|
|
73
|
+
const columnsDefinition = useMemo(() => {
|
|
74
|
+
return [
|
|
75
|
+
{
|
|
76
|
+
dataKey: name,
|
|
77
|
+
type: DndColumnType.CUSTOM,
|
|
78
|
+
// ColumnDirectoryItem does not allow allowMultiSelect to false
|
|
79
|
+
editable: true,
|
|
80
|
+
label: intl.formatMessage({ id: "process_config/modifications" }),
|
|
81
|
+
component: modificationSelector
|
|
82
|
+
}
|
|
83
|
+
];
|
|
84
|
+
}, [modificationSelector, name, intl]);
|
|
85
|
+
const createModification = () => [{ modification: [] }];
|
|
86
|
+
return /* @__PURE__ */ jsx(
|
|
87
|
+
DndTable,
|
|
88
|
+
{
|
|
89
|
+
name,
|
|
90
|
+
useFieldArrayOutput: useFieldArrayModifications,
|
|
91
|
+
createRows: createModification,
|
|
92
|
+
columnsDefinition,
|
|
93
|
+
withAddRowsDialog: false
|
|
94
|
+
}
|
|
95
|
+
);
|
|
96
|
+
}
|
|
97
|
+
export {
|
|
98
|
+
UpdateProcessConfigModifications
|
|
99
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
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 * from './security-analysis-result-nmk';
|
|
8
|
+
export * from './security-analysis-table';
|
|
9
|
+
export * from './security-analysis.type';
|
|
10
|
+
export * from './utils';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { SecurityAnalysisResultNmk } from "./security-analysis-result-nmk.js";
|
|
2
|
+
import { SecurityAnalysisTable } from "./security-analysis-table.js";
|
|
3
|
+
import { NmkType } from "./security-analysis.type.js";
|
|
4
|
+
import { PAGE_OPTIONS, flattenNmKResultsConstraints, flattenNmKResultsContingencies, getNoRowsMessage, handlePostSortRows, mapNmKResultsCutOffPower } from "./utils.js";
|
|
5
|
+
export {
|
|
6
|
+
NmkType,
|
|
7
|
+
PAGE_OPTIONS,
|
|
8
|
+
SecurityAnalysisResultNmk,
|
|
9
|
+
SecurityAnalysisTable,
|
|
10
|
+
flattenNmKResultsConstraints,
|
|
11
|
+
flattenNmKResultsContingencies,
|
|
12
|
+
getNoRowsMessage,
|
|
13
|
+
handlePostSortRows,
|
|
14
|
+
mapNmKResultsCutOffPower
|
|
15
|
+
};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { SecurityAnalysisResultNmkProps } from './security-analysis.type';
|
|
2
|
+
export declare function SecurityAnalysisResultNmk({ result, columnDefs, nmkType, paginationProps, isLoadingResult, resultStatusMessages, securityAnalysisStatus, onGridReady, }: SecurityAnalysisResultNmkProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo, useCallback } from "react";
|
|
3
|
+
import { useIntl } from "react-intl";
|
|
4
|
+
import { useTheme, Box } from "@mui/material";
|
|
5
|
+
import { NmkType } from "./security-analysis.type.js";
|
|
6
|
+
import { SecurityAnalysisTable } from "./security-analysis-table.js";
|
|
7
|
+
import "@mui/icons-material";
|
|
8
|
+
import "../../../components/ui/overflowableText/OverflowableText.js";
|
|
9
|
+
import "../../../utils/conversionUtils.js";
|
|
10
|
+
import "../../../utils/types/equipmentType.js";
|
|
11
|
+
import { getRows } from "../../../utils/functions.js";
|
|
12
|
+
import "react-hook-form";
|
|
13
|
+
import "localized-countries";
|
|
14
|
+
import "localized-countries/data/fr";
|
|
15
|
+
import "localized-countries/data/en";
|
|
16
|
+
import "notistack";
|
|
17
|
+
import "../../../components/ui/reactHookForm/provider/CustomFormProvider.js";
|
|
18
|
+
import "yup";
|
|
19
|
+
import "../../../components/ui/treeViewFinder/TreeViewFinder.js";
|
|
20
|
+
import "../../../components/ui/reactHookForm/numbers/RangeInput.js";
|
|
21
|
+
import "@material-symbols/svg-400/outlined/left_panel_open.svg?react";
|
|
22
|
+
import "@material-symbols/svg-400/outlined/arrows_output.svg?react";
|
|
23
|
+
import "@material-symbols/svg-400/outlined/arrows_input.svg?react";
|
|
24
|
+
import "@material-symbols/svg-400/outlined/left_panel_close.svg?react";
|
|
25
|
+
import "@material-symbols/svg-400/outlined/add_notes.svg?react";
|
|
26
|
+
import "../../../components/ui/dialogs/descriptionModificationDialog/DescriptionModificationDialog.js";
|
|
27
|
+
import "../../../components/ui/reactHookForm/expandableInput/ExpandableInput.js";
|
|
28
|
+
import "@hello-pangea/dnd";
|
|
29
|
+
import "../../../components/ui/dialogs/elementSaveDialog/ElementSaveDialog.js";
|
|
30
|
+
import "../../../components/ui/snackbarProvider/SnackbarProvider.js";
|
|
31
|
+
import "mui-nested-menu";
|
|
32
|
+
import "react-resizable-panels";
|
|
33
|
+
import "react-papaparse";
|
|
34
|
+
import { CustomTablePagination } from "../../../components/ui/tablepagination/custom-table-pagination.js";
|
|
35
|
+
import "react-dom";
|
|
36
|
+
import "autosuggest-highlight/match";
|
|
37
|
+
import "autosuggest-highlight/parse";
|
|
38
|
+
import "clsx";
|
|
39
|
+
import "../../../components/composite/filter/FilterCreationDialog.js";
|
|
40
|
+
import "../../../components/composite/filter/HeaderFilterForm.js";
|
|
41
|
+
import "../../../components/composite/filter/explicitNaming/ExplicitNamingFilterForm.js";
|
|
42
|
+
import "../../../components/composite/filter/expert/ExpertFilterForm.js";
|
|
43
|
+
import "../../../components/composite/filter/expert/ExpertFilterEditionDialog.js";
|
|
44
|
+
import "../../../components/composite/filter/expert/expertFilterConstants.js";
|
|
45
|
+
import "react-querybuilder";
|
|
46
|
+
import "uuid";
|
|
47
|
+
import "../../../components/composite/filter/explicitNaming/ExplicitNamingFilterEditionDialog.js";
|
|
48
|
+
import "../../../components/composite/filter/utils/filterFormUtils.js";
|
|
49
|
+
import "@react-querybuilder/material";
|
|
50
|
+
import "../../../components/composite/reactQueryBuilder/CustomReactQueryBuilder.js";
|
|
51
|
+
import "../../../components/composite/reactQueryBuilder/PropertyValueEditor.js";
|
|
52
|
+
import "../../../components/composite/agGridTable/BottomTableButtons.js";
|
|
53
|
+
import "../../../components/composite/agGridTable/CustomAgGridTable.js";
|
|
54
|
+
import "ag-grid-community";
|
|
55
|
+
import "../../../components/composite/customAGGrid/customAggrid.js";
|
|
56
|
+
import { mapNmKResultsCutOffPower, flattenNmKResultsConstraints, flattenNmKResultsContingencies, handlePostSortRows, getNoRowsMessage, PAGE_OPTIONS } from "./utils.js";
|
|
57
|
+
const styles = {
|
|
58
|
+
container: {
|
|
59
|
+
display: "flex",
|
|
60
|
+
flexDirection: "column",
|
|
61
|
+
height: "100%"
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
function SecurityAnalysisResultNmk({
|
|
65
|
+
result,
|
|
66
|
+
columnDefs,
|
|
67
|
+
nmkType,
|
|
68
|
+
paginationProps,
|
|
69
|
+
isLoadingResult,
|
|
70
|
+
resultStatusMessages,
|
|
71
|
+
securityAnalysisStatus,
|
|
72
|
+
onGridReady
|
|
73
|
+
}) {
|
|
74
|
+
const content = result?.content ?? null;
|
|
75
|
+
const theme = useTheme();
|
|
76
|
+
const intl = useIntl();
|
|
77
|
+
const rows = useMemo(() => {
|
|
78
|
+
switch (nmkType) {
|
|
79
|
+
case NmkType.CONSTRAINTS_FROM_CONTINGENCIES:
|
|
80
|
+
return flattenNmKResultsContingencies(intl, content);
|
|
81
|
+
case NmkType.CONTINGENCIES_FROM_CONSTRAINTS:
|
|
82
|
+
return flattenNmKResultsConstraints(intl, content);
|
|
83
|
+
case NmkType.CUT_OFF_POWER_FROM_CONSTRAINTS:
|
|
84
|
+
return mapNmKResultsCutOffPower(content);
|
|
85
|
+
default:
|
|
86
|
+
return void 0;
|
|
87
|
+
}
|
|
88
|
+
}, [nmkType, intl, content]);
|
|
89
|
+
const rowsToShow = getRows(rows, securityAnalysisStatus);
|
|
90
|
+
const getRowStyle = useCallback(
|
|
91
|
+
(params) => {
|
|
92
|
+
if (nmkType === NmkType.CONSTRAINTS_FROM_CONTINGENCIES && params?.data?.contingencyId || nmkType === NmkType.CONTINGENCIES_FROM_CONSTRAINTS && params?.data?.subjectId) {
|
|
93
|
+
return {
|
|
94
|
+
backgroundColor: theme.selectedRow.background
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
return void 0;
|
|
98
|
+
},
|
|
99
|
+
[nmkType, theme.selectedRow.background]
|
|
100
|
+
);
|
|
101
|
+
const agGridProps = useMemo(
|
|
102
|
+
() => ({
|
|
103
|
+
postSortRows: handlePostSortRows(nmkType === NmkType.CONSTRAINTS_FROM_CONTINGENCIES),
|
|
104
|
+
getRowStyle,
|
|
105
|
+
tooltipShowDelay: 0
|
|
106
|
+
}),
|
|
107
|
+
[getRowStyle, nmkType]
|
|
108
|
+
);
|
|
109
|
+
const overlayNoRowsTemplate = getNoRowsMessage(
|
|
110
|
+
resultStatusMessages,
|
|
111
|
+
rows,
|
|
112
|
+
securityAnalysisStatus,
|
|
113
|
+
!isLoadingResult
|
|
114
|
+
);
|
|
115
|
+
return /* @__PURE__ */ jsxs(Box, { sx: styles.container, children: [
|
|
116
|
+
/* @__PURE__ */ jsx(Box, { sx: { flexGrow: 1 }, children: /* @__PURE__ */ jsx(
|
|
117
|
+
SecurityAnalysisTable,
|
|
118
|
+
{
|
|
119
|
+
rowData: rowsToShow,
|
|
120
|
+
columnDefs,
|
|
121
|
+
overlayNoRowsTemplate,
|
|
122
|
+
agGridProps,
|
|
123
|
+
onGridReady
|
|
124
|
+
}
|
|
125
|
+
) }),
|
|
126
|
+
/* @__PURE__ */ jsx(Box, { children: /* @__PURE__ */ jsx(CustomTablePagination, { rowsPerPageOptions: PAGE_OPTIONS, ...paginationProps }) })
|
|
127
|
+
] });
|
|
128
|
+
}
|
|
129
|
+
export {
|
|
130
|
+
SecurityAnalysisResultNmk
|
|
131
|
+
};
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo } from "react";
|
|
3
|
+
import "@mui/material";
|
|
4
|
+
import "@mui/icons-material";
|
|
5
|
+
import "react-intl";
|
|
6
|
+
import "../../../components/ui/overflowableText/OverflowableText.js";
|
|
7
|
+
import "../../../utils/conversionUtils.js";
|
|
8
|
+
import "../../../utils/types/equipmentType.js";
|
|
9
|
+
import "react-hook-form";
|
|
10
|
+
import "localized-countries";
|
|
11
|
+
import "localized-countries/data/fr";
|
|
12
|
+
import "localized-countries/data/en";
|
|
13
|
+
import "notistack";
|
|
14
|
+
import "../../../components/ui/reactHookForm/provider/CustomFormProvider.js";
|
|
15
|
+
import "yup";
|
|
16
|
+
import "../../../components/ui/treeViewFinder/TreeViewFinder.js";
|
|
17
|
+
import "../../../components/ui/reactHookForm/numbers/RangeInput.js";
|
|
18
|
+
import "@material-symbols/svg-400/outlined/left_panel_open.svg?react";
|
|
19
|
+
import "@material-symbols/svg-400/outlined/arrows_output.svg?react";
|
|
20
|
+
import "@material-symbols/svg-400/outlined/arrows_input.svg?react";
|
|
21
|
+
import "@material-symbols/svg-400/outlined/left_panel_close.svg?react";
|
|
22
|
+
import "@material-symbols/svg-400/outlined/add_notes.svg?react";
|
|
23
|
+
import "../../../components/ui/dialogs/descriptionModificationDialog/DescriptionModificationDialog.js";
|
|
24
|
+
import "../../../components/ui/reactHookForm/expandableInput/ExpandableInput.js";
|
|
25
|
+
import "@hello-pangea/dnd";
|
|
26
|
+
import "../../../components/ui/dialogs/elementSaveDialog/ElementSaveDialog.js";
|
|
27
|
+
import "../../../components/ui/snackbarProvider/SnackbarProvider.js";
|
|
28
|
+
import "mui-nested-menu";
|
|
29
|
+
import "react-resizable-panels";
|
|
30
|
+
import "react-papaparse";
|
|
31
|
+
import "react-dom";
|
|
32
|
+
import "autosuggest-highlight/match";
|
|
33
|
+
import "autosuggest-highlight/parse";
|
|
34
|
+
import "clsx";
|
|
35
|
+
import "../../../components/composite/filter/FilterCreationDialog.js";
|
|
36
|
+
import "../../../components/composite/filter/HeaderFilterForm.js";
|
|
37
|
+
import "../../../components/composite/filter/explicitNaming/ExplicitNamingFilterForm.js";
|
|
38
|
+
import "../../../components/composite/filter/expert/ExpertFilterForm.js";
|
|
39
|
+
import "../../../components/composite/filter/expert/ExpertFilterEditionDialog.js";
|
|
40
|
+
import "../../../components/composite/filter/expert/expertFilterConstants.js";
|
|
41
|
+
import "react-querybuilder";
|
|
42
|
+
import "uuid";
|
|
43
|
+
import "../../../components/composite/filter/explicitNaming/ExplicitNamingFilterEditionDialog.js";
|
|
44
|
+
import "../../../components/composite/filter/utils/filterFormUtils.js";
|
|
45
|
+
import "@react-querybuilder/material";
|
|
46
|
+
import "../../../components/composite/reactQueryBuilder/CustomReactQueryBuilder.js";
|
|
47
|
+
import "../../../components/composite/reactQueryBuilder/PropertyValueEditor.js";
|
|
48
|
+
import "../../../components/composite/agGridTable/BottomTableButtons.js";
|
|
49
|
+
import "../../../components/composite/agGridTable/CustomAgGridTable.js";
|
|
50
|
+
import "ag-grid-community";
|
|
51
|
+
import { CustomAGGrid } from "../../../components/composite/customAGGrid/customAggrid.js";
|
|
52
|
+
import { DefaultCellRenderer } from "../../../components/composite/customAGGrid/cell-renderers.js";
|
|
53
|
+
import { AGGRID_LOCALES } from "../../../translations/not-intl/aggrid-locales.js";
|
|
54
|
+
function SecurityAnalysisTable({
|
|
55
|
+
rowData,
|
|
56
|
+
columnDefs,
|
|
57
|
+
overlayNoRowsTemplate,
|
|
58
|
+
agGridProps,
|
|
59
|
+
onGridReady
|
|
60
|
+
}) {
|
|
61
|
+
const defaultColDef = useMemo(
|
|
62
|
+
() => ({
|
|
63
|
+
resizable: true,
|
|
64
|
+
wrapHeaderText: true,
|
|
65
|
+
autoHeaderHeight: true,
|
|
66
|
+
suppressMovable: true,
|
|
67
|
+
flex: 1,
|
|
68
|
+
cellRenderer: DefaultCellRenderer,
|
|
69
|
+
comparator: () => 0
|
|
70
|
+
}),
|
|
71
|
+
[]
|
|
72
|
+
);
|
|
73
|
+
return /* @__PURE__ */ jsx(
|
|
74
|
+
CustomAGGrid,
|
|
75
|
+
{
|
|
76
|
+
rowData: rowData ?? [],
|
|
77
|
+
columnDefs,
|
|
78
|
+
defaultColDef,
|
|
79
|
+
onGridReady,
|
|
80
|
+
onModelUpdated: ({ api }) => {
|
|
81
|
+
if (api.getDisplayedRowCount()) {
|
|
82
|
+
api.hideOverlay();
|
|
83
|
+
} else {
|
|
84
|
+
api.showNoRowsOverlay();
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
overlayNoRowsTemplate,
|
|
88
|
+
overrideLocales: AGGRID_LOCALES,
|
|
89
|
+
...agGridProps
|
|
90
|
+
}
|
|
91
|
+
);
|
|
92
|
+
}
|
|
93
|
+
export {
|
|
94
|
+
SecurityAnalysisTable
|
|
95
|
+
};
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { ColDef, GridReadyEvent } from 'ag-grid-community';
|
|
2
|
+
import { AgGridReactProps } from 'ag-grid-react';
|
|
3
|
+
import { TablePaginationProps } from '@mui/material';
|
|
4
|
+
import { RunningStatus, RunningStatusMessage } from '../../../utils/running-status';
|
|
5
|
+
export declare enum NmkType {
|
|
6
|
+
CONSTRAINTS_FROM_CONTINGENCIES = "constraints-from-contingencies",
|
|
7
|
+
CONTINGENCIES_FROM_CONSTRAINTS = "contingencies-from-constraints",
|
|
8
|
+
CUT_OFF_POWER_FROM_CONSTRAINTS = "cut-off-power-from-constraints"
|
|
9
|
+
}
|
|
10
|
+
export interface LimitViolation {
|
|
11
|
+
subjectId?: string;
|
|
12
|
+
acceptableDuration?: number;
|
|
13
|
+
upcomingAcceptableDuration?: number;
|
|
14
|
+
limit?: number;
|
|
15
|
+
patlLimit?: number;
|
|
16
|
+
limitName?: string;
|
|
17
|
+
nextLimitName?: string;
|
|
18
|
+
limitReduction?: number;
|
|
19
|
+
limitType?: string;
|
|
20
|
+
loading?: number;
|
|
21
|
+
patlLoading?: number;
|
|
22
|
+
side?: string;
|
|
23
|
+
value?: number;
|
|
24
|
+
locationId?: string;
|
|
25
|
+
}
|
|
26
|
+
interface Element {
|
|
27
|
+
elementType?: string;
|
|
28
|
+
id?: string;
|
|
29
|
+
}
|
|
30
|
+
export interface ContingencyItem {
|
|
31
|
+
status?: string;
|
|
32
|
+
contingencyId?: string;
|
|
33
|
+
elements?: Element[];
|
|
34
|
+
}
|
|
35
|
+
export interface Contingency {
|
|
36
|
+
contingency?: ContingencyItem;
|
|
37
|
+
limitViolation?: LimitViolation;
|
|
38
|
+
}
|
|
39
|
+
export interface SecurityAnalysisNmkTableRow {
|
|
40
|
+
subjectId?: string;
|
|
41
|
+
locationId?: string;
|
|
42
|
+
acceptableDuration?: number | null;
|
|
43
|
+
upcomingAcceptableDuration?: number | null;
|
|
44
|
+
status?: string;
|
|
45
|
+
disconnectedLoadActivePower?: number;
|
|
46
|
+
disconnectedGenerationActivePower?: number;
|
|
47
|
+
contingencyEquipmentsIds?: (string | undefined)[];
|
|
48
|
+
contingencyId?: string;
|
|
49
|
+
limit?: number;
|
|
50
|
+
patlLimit?: number;
|
|
51
|
+
limitName?: string | null;
|
|
52
|
+
nextLimitName?: string | null;
|
|
53
|
+
limitType?: string;
|
|
54
|
+
elementId?: number;
|
|
55
|
+
linkedElementId?: number;
|
|
56
|
+
loading?: number;
|
|
57
|
+
patlLoading?: number;
|
|
58
|
+
side?: string;
|
|
59
|
+
value?: number;
|
|
60
|
+
violationCount?: number;
|
|
61
|
+
}
|
|
62
|
+
export interface Constraint {
|
|
63
|
+
limitViolation?: LimitViolation;
|
|
64
|
+
subjectId?: string;
|
|
65
|
+
}
|
|
66
|
+
export interface ContingenciesFromConstraintItem {
|
|
67
|
+
subjectId?: string;
|
|
68
|
+
contingencies?: Contingency[];
|
|
69
|
+
}
|
|
70
|
+
export interface ConstraintsFromContingencyItem {
|
|
71
|
+
subjectLimitViolations?: Constraint[];
|
|
72
|
+
contingency?: ContingencyItem;
|
|
73
|
+
}
|
|
74
|
+
export interface CutOffPowerFromConstraintsItem {
|
|
75
|
+
status?: string;
|
|
76
|
+
contingencyId?: string;
|
|
77
|
+
connectivityResult?: ConnectivityResult;
|
|
78
|
+
}
|
|
79
|
+
export interface ConnectivityResult {
|
|
80
|
+
disconnectedLoadActivePower: number;
|
|
81
|
+
disconnectedGenerationActivePower: number;
|
|
82
|
+
}
|
|
83
|
+
export type SecurityAnalysisNmkResult = {
|
|
84
|
+
content?: (ContingenciesFromConstraintItem[] | ConstraintsFromContingencyItem[] | CutOffPowerFromConstraintsItem[] | null)[];
|
|
85
|
+
[key: string]: unknown;
|
|
86
|
+
};
|
|
87
|
+
export interface SecurityAnalysisNTableRow {
|
|
88
|
+
subjectId?: string;
|
|
89
|
+
locationId?: string;
|
|
90
|
+
limit?: number;
|
|
91
|
+
limitName?: string | null;
|
|
92
|
+
limitType?: string;
|
|
93
|
+
nextLimitName?: string | null;
|
|
94
|
+
value?: number;
|
|
95
|
+
loading?: number;
|
|
96
|
+
patlLoading?: number;
|
|
97
|
+
patlLimit?: number;
|
|
98
|
+
acceptableDuration?: number | null;
|
|
99
|
+
upcomingAcceptableDuration?: number | null;
|
|
100
|
+
side?: string;
|
|
101
|
+
}
|
|
102
|
+
export interface SecurityAnalysisTableProps {
|
|
103
|
+
rowData: SecurityAnalysisNTableRow[] | SecurityAnalysisNmkTableRow[] | undefined;
|
|
104
|
+
columnDefs: ColDef[];
|
|
105
|
+
isLoadingResult?: boolean;
|
|
106
|
+
computationSubType?: string;
|
|
107
|
+
overlayNoRowsTemplate?: string;
|
|
108
|
+
agGridProps?: AgGridReactProps;
|
|
109
|
+
onGridReady?: (params: GridReadyEvent) => void;
|
|
110
|
+
}
|
|
111
|
+
export interface SecurityAnalysisResultNmkProps {
|
|
112
|
+
result?: SecurityAnalysisNmkResult;
|
|
113
|
+
columnDefs: ColDef[];
|
|
114
|
+
isLoadingResult: boolean;
|
|
115
|
+
nmkType: NmkType;
|
|
116
|
+
onGridReady: (params: GridReadyEvent) => void;
|
|
117
|
+
resultStatusMessages: RunningStatusMessage;
|
|
118
|
+
securityAnalysisStatus: RunningStatus;
|
|
119
|
+
paginationProps: TablePaginationProps;
|
|
120
|
+
}
|
|
121
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
var NmkType = /* @__PURE__ */ ((NmkType2) => {
|
|
2
|
+
NmkType2["CONSTRAINTS_FROM_CONTINGENCIES"] = "constraints-from-contingencies";
|
|
3
|
+
NmkType2["CONTINGENCIES_FROM_CONSTRAINTS"] = "contingencies-from-constraints";
|
|
4
|
+
NmkType2["CUT_OFF_POWER_FROM_CONSTRAINTS"] = "cut-off-power-from-constraints";
|
|
5
|
+
return NmkType2;
|
|
6
|
+
})(NmkType || {});
|
|
7
|
+
export {
|
|
8
|
+
NmkType
|
|
9
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { IntlShape } from 'react-intl';
|
|
2
|
+
import { PostSortRowsParams } from 'ag-grid-community';
|
|
3
|
+
import { ConstraintsFromContingencyItem, ContingenciesFromConstraintItem, CutOffPowerFromConstraintsItem, SecurityAnalysisNmkTableRow } from './security-analysis.type';
|
|
4
|
+
import { RunningStatusMessage } from '../../../utils/running-status';
|
|
5
|
+
export declare function getNoRowsMessage(messages: RunningStatusMessage, rows: any[] | undefined, status: string, isDataReady?: boolean): string | undefined;
|
|
6
|
+
export declare const PAGE_OPTIONS: number[];
|
|
7
|
+
export declare const flattenNmKResultsContingencies: (intl: IntlShape, result: ConstraintsFromContingencyItem[] | null) => SecurityAnalysisNmkTableRow[] | undefined;
|
|
8
|
+
export declare const flattenNmKResultsConstraints: (intl: IntlShape, result: ContingenciesFromConstraintItem[] | null) => SecurityAnalysisNmkTableRow[] | undefined;
|
|
9
|
+
export declare const mapNmKResultsCutOffPower: (result: CutOffPowerFromConstraintsItem[] | null) => SecurityAnalysisNmkTableRow[] | undefined;
|
|
10
|
+
export declare const handlePostSortRows: (isFromContingency: boolean) => (params: PostSortRowsParams) => void;
|