@gridsuite/commons-ui 0.236.0 → 0.237.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/features/parameters/common/parameters-edition-dialog-props.d.ts +2 -2
- package/dist/features/parameters/loadflow/load-flow-parameters-dialog.d.ts +1 -1
- package/dist/features/parameters/loadflow/load-flow-parameters-dialog.js +14 -8
- package/dist/features/parameters/network-visualizations/network-visualizations-form.d.ts +3 -3
- package/dist/features/parameters/network-visualizations/network-visualizations-form.js +5 -5
- package/dist/features/parameters/network-visualizations/network-visualizations-parameters-dialog.d.ts +1 -1
- package/dist/features/parameters/network-visualizations/network-visualizations-parameters-dialog.js +2 -2
- package/dist/features/parameters/network-visualizations/network-visualizations-parameters-inline.d.ts +3 -3
- package/dist/features/parameters/network-visualizations/network-visualizations-parameters-inline.js +2 -2
- package/dist/features/parameters/security-analysis/security-analysis-parameters-dialog.d.ts +1 -1
- package/dist/features/parameters/security-analysis/security-analysis-parameters-dialog.js +2 -2
- package/dist/features/parameters/sensi/sensitivity-analysis-parameters-dialog.d.ts +1 -1
- package/dist/features/parameters/sensi/sensitivity-analysis-parameters-dialog.js +2 -2
- package/dist/features/parameters/short-circuit/short-circuit-parameters-dialog.d.ts +1 -1
- package/dist/features/parameters/short-circuit/short-circuit-parameters-dialog.js +12 -6
- package/dist/hooks/use-parameters-backend.d.ts +2 -2
- package/dist/hooks/use-parameters-backend.js +3 -3
- package/dist/translations/en/external/importParamsEn.d.ts +1 -0
- package/dist/translations/en/external/importParamsEn.js +1 -0
- package/dist/translations/fr/external/importParamsFr.d.ts +1 -0
- package/dist/translations/fr/external/importParamsFr.js +1 -0
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { UUID } from 'node:crypto';
|
|
2
|
-
import {
|
|
2
|
+
import { UserProfile } from 'oidc-client-ts';
|
|
3
3
|
import { GsLang } from '../../../utils';
|
|
4
4
|
import { BuildStatus } from '../../node/constant';
|
|
5
5
|
export interface ParametersEditionDialogProps {
|
|
@@ -12,7 +12,7 @@ export interface ParametersEditionDialogProps {
|
|
|
12
12
|
activeDirectory: UUID;
|
|
13
13
|
isRootNode?: boolean;
|
|
14
14
|
language?: GsLang;
|
|
15
|
-
|
|
15
|
+
userProfile: UserProfile | null;
|
|
16
16
|
globalBuildStatus?: BuildStatus;
|
|
17
17
|
isDeveloperMode?: boolean;
|
|
18
18
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { ParametersEditionDialogProps } from '../common';
|
|
2
|
-
export declare function LoadFlowParametersEditionDialog({ id, open, onClose, titleId, name, description, activeDirectory,
|
|
2
|
+
export declare function LoadFlowParametersEditionDialog({ id, open, onClose, titleId, name, description, activeDirectory, userProfile, language, isDeveloperMode, }: Readonly<ParametersEditionDialogProps>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -51,17 +51,23 @@ function LoadFlowParametersEditionDialog({
|
|
|
51
51
|
name,
|
|
52
52
|
description,
|
|
53
53
|
activeDirectory,
|
|
54
|
-
|
|
54
|
+
userProfile,
|
|
55
55
|
language = LANG_ENGLISH,
|
|
56
56
|
isDeveloperMode = false
|
|
57
57
|
}) {
|
|
58
|
-
const parametersBackend = useParametersBackend(
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
58
|
+
const parametersBackend = useParametersBackend(
|
|
59
|
+
userProfile,
|
|
60
|
+
id,
|
|
61
|
+
ComputingType.LOAD_FLOW,
|
|
62
|
+
OptionalServicesStatus.Up,
|
|
63
|
+
{
|
|
64
|
+
backendFetchProviders: getLoadFlowProviders,
|
|
65
|
+
backendFetchParameters: fetchLoadFlowParameters,
|
|
66
|
+
backendUpdateParameters: setLoadFlowParameters,
|
|
67
|
+
backendFetchSpecificParametersDescription: getLoadFlowSpecificParametersDescription,
|
|
68
|
+
backendFetchDefaultLimitReductions: getLoadFlowDefaultLimitReductions
|
|
69
|
+
}
|
|
70
|
+
);
|
|
65
71
|
const loadflowMethods = useLoadFlowParametersForm(parametersBackend, isDeveloperMode, id, name, description);
|
|
66
72
|
const {
|
|
67
73
|
formState: { errors, dirtyFields }
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { UserProfile } from 'oidc-client-ts';
|
|
3
3
|
import { UseNetworkVisualizationParametersFormReturn } from './use-network-visualizations-parameters-form';
|
|
4
4
|
interface NetworkVisualizationParametersFormProps {
|
|
5
5
|
networkVisuMethods: UseNetworkVisualizationParametersFormReturn;
|
|
6
6
|
renderTitleFields?: () => ReactNode;
|
|
7
7
|
renderActions?: () => ReactNode;
|
|
8
|
-
|
|
8
|
+
userProfile: UserProfile | null;
|
|
9
9
|
}
|
|
10
|
-
export declare function NetworkVisualizationParametersForm({ networkVisuMethods, renderTitleFields, renderActions,
|
|
10
|
+
export declare function NetworkVisualizationParametersForm({ networkVisuMethods, renderTitleFields, renderActions, userProfile, }: Readonly<NetworkVisualizationParametersFormProps>): import("react/jsx-runtime").JSX.Element;
|
|
11
11
|
export {};
|
|
@@ -40,26 +40,26 @@ import "../common/contingency-table/contingency-table.js";
|
|
|
40
40
|
import "../common/contingency-table/columns-definitions.js";
|
|
41
41
|
import "@hookform/resolvers/yup";
|
|
42
42
|
import "../../../components/composite/filter/HeaderFilterForm.js";
|
|
43
|
-
const useGetAvailableComponentLibraries = (
|
|
43
|
+
const useGetAvailableComponentLibraries = (userProfile) => {
|
|
44
44
|
const [componentLibraries, setComponentLibraries] = useState([]);
|
|
45
45
|
useEffect(() => {
|
|
46
|
-
if (
|
|
46
|
+
if (userProfile !== null) {
|
|
47
47
|
getAvailableComponentLibraries().then((libraries) => {
|
|
48
48
|
if (libraries != null) {
|
|
49
49
|
setComponentLibraries(libraries);
|
|
50
50
|
}
|
|
51
51
|
});
|
|
52
52
|
}
|
|
53
|
-
}, [
|
|
53
|
+
}, [userProfile]);
|
|
54
54
|
return componentLibraries;
|
|
55
55
|
};
|
|
56
56
|
function NetworkVisualizationParametersForm({
|
|
57
57
|
networkVisuMethods,
|
|
58
58
|
renderTitleFields,
|
|
59
59
|
renderActions,
|
|
60
|
-
|
|
60
|
+
userProfile
|
|
61
61
|
}) {
|
|
62
|
-
const componentLibraries = useGetAvailableComponentLibraries(
|
|
62
|
+
const componentLibraries = useGetAvailableComponentLibraries(userProfile);
|
|
63
63
|
const { formMethods, formSchema, selectedTab, handleTabChange, paramsLoading } = networkVisuMethods;
|
|
64
64
|
return /* @__PURE__ */ jsx(CustomFormProvider, { validationSchema: formSchema, ...formMethods, removeOptional: true, children: /* @__PURE__ */ jsxs(Grid, { container: true, direction: "column", children: [
|
|
65
65
|
/* @__PURE__ */ jsx(Grid, { item: true, container: true, direction: "column", children: renderTitleFields?.() }),
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { ParametersEditionDialogProps } from '../common';
|
|
2
|
-
export declare function NetworkVisualizationsParametersEditionDialog({ id, open, onClose, titleId, name, description, activeDirectory, language,
|
|
2
|
+
export declare function NetworkVisualizationsParametersEditionDialog({ id, open, onClose, titleId, name, description, activeDirectory, language, userProfile, }: Readonly<ParametersEditionDialogProps>): import("react/jsx-runtime").JSX.Element;
|
package/dist/features/parameters/network-visualizations/network-visualizations-parameters-dialog.js
CHANGED
|
@@ -42,7 +42,7 @@ function NetworkVisualizationsParametersEditionDialog({
|
|
|
42
42
|
description,
|
|
43
43
|
activeDirectory,
|
|
44
44
|
language,
|
|
45
|
-
|
|
45
|
+
userProfile
|
|
46
46
|
}) {
|
|
47
47
|
const networkVisuMethods = useNetworkVisualizationParametersForm({
|
|
48
48
|
parametersUuid: id,
|
|
@@ -78,7 +78,7 @@ function NetworkVisualizationsParametersEditionDialog({
|
|
|
78
78
|
children: /* @__PURE__ */ jsx(
|
|
79
79
|
NetworkVisualizationParametersForm,
|
|
80
80
|
{
|
|
81
|
-
|
|
81
|
+
userProfile,
|
|
82
82
|
networkVisuMethods,
|
|
83
83
|
renderTitleFields: () => {
|
|
84
84
|
return /* @__PURE__ */ jsx(
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { UUID } from 'node:crypto';
|
|
2
|
-
import {
|
|
2
|
+
import { UserProfile } from 'oidc-client-ts';
|
|
3
3
|
import { NetworkVisualizationParameters } from './network-visualizations.types';
|
|
4
|
-
export declare function NetworkVisualizationParametersInline({ studyUuid, setHaveDirtyFields,
|
|
4
|
+
export declare function NetworkVisualizationParametersInline({ studyUuid, setHaveDirtyFields, userProfile, parameters, }: Readonly<{
|
|
5
5
|
studyUuid: UUID | null;
|
|
6
6
|
setHaveDirtyFields: (isDirty: boolean) => void;
|
|
7
|
-
|
|
7
|
+
userProfile: UserProfile | null;
|
|
8
8
|
parameters: NetworkVisualizationParameters | null;
|
|
9
9
|
}>): import("react/jsx-runtime").JSX.Element;
|
package/dist/features/parameters/network-visualizations/network-visualizations-parameters-inline.js
CHANGED
|
@@ -46,7 +46,7 @@ import { useNetworkVisualizationParametersForm } from "./use-network-visualizati
|
|
|
46
46
|
function NetworkVisualizationParametersInline({
|
|
47
47
|
studyUuid,
|
|
48
48
|
setHaveDirtyFields,
|
|
49
|
-
|
|
49
|
+
userProfile,
|
|
50
50
|
parameters
|
|
51
51
|
}) {
|
|
52
52
|
const networkVisuMethods = useNetworkVisualizationParametersForm({
|
|
@@ -83,7 +83,7 @@ function NetworkVisualizationParametersInline({
|
|
|
83
83
|
return /* @__PURE__ */ jsx(
|
|
84
84
|
NetworkVisualizationParametersForm,
|
|
85
85
|
{
|
|
86
|
-
|
|
86
|
+
userProfile,
|
|
87
87
|
networkVisuMethods,
|
|
88
88
|
renderActions: () => {
|
|
89
89
|
return /* @__PURE__ */ jsxs(Box, { children: [
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { ParametersEditionDialogProps } from '../common';
|
|
2
|
-
export declare function SecurityAnalysisParametersDialog({ id, open, onClose, titleId, name, description, activeDirectory, language,
|
|
2
|
+
export declare function SecurityAnalysisParametersDialog({ id, open, onClose, titleId, name, description, activeDirectory, language, userProfile, isDeveloperMode, }: Readonly<ParametersEditionDialogProps>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -50,11 +50,11 @@ function SecurityAnalysisParametersDialog({
|
|
|
50
50
|
description,
|
|
51
51
|
activeDirectory,
|
|
52
52
|
language,
|
|
53
|
-
|
|
53
|
+
userProfile,
|
|
54
54
|
isDeveloperMode = false
|
|
55
55
|
}) {
|
|
56
56
|
const parametersBackend = useParametersBackend(
|
|
57
|
-
|
|
57
|
+
userProfile,
|
|
58
58
|
id,
|
|
59
59
|
ComputingType.SECURITY_ANALYSIS,
|
|
60
60
|
OptionalServicesStatus.Up,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { ParametersEditionDialogProps } from '../common';
|
|
2
|
-
export declare function SensitivityAnalysisParametersDialog({ id, open, onClose, titleId, name, description, activeDirectory, language,
|
|
2
|
+
export declare function SensitivityAnalysisParametersDialog({ id, open, onClose, titleId, name, description, activeDirectory, language, userProfile, globalBuildStatus, isRootNode, isDeveloperMode, }: Readonly<ParametersEditionDialogProps>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -50,13 +50,13 @@ function SensitivityAnalysisParametersDialog({
|
|
|
50
50
|
description,
|
|
51
51
|
activeDirectory,
|
|
52
52
|
language,
|
|
53
|
-
|
|
53
|
+
userProfile,
|
|
54
54
|
globalBuildStatus,
|
|
55
55
|
isRootNode = false,
|
|
56
56
|
isDeveloperMode = false
|
|
57
57
|
}) {
|
|
58
58
|
const parametersBackend = useParametersBackend(
|
|
59
|
-
|
|
59
|
+
userProfile,
|
|
60
60
|
id,
|
|
61
61
|
ComputingType.SENSITIVITY_ANALYSIS,
|
|
62
62
|
OptionalServicesStatus.Up,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { ParametersEditionDialogProps } from '../common';
|
|
2
|
-
export declare function ShortCircuitParametersEditionDialog({ id, open, onClose, titleId, name, description, activeDirectory,
|
|
2
|
+
export declare function ShortCircuitParametersEditionDialog({ id, open, onClose, titleId, name, description, activeDirectory, userProfile, language, }: Readonly<ParametersEditionDialogProps>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -49,14 +49,20 @@ function ShortCircuitParametersEditionDialog({
|
|
|
49
49
|
name,
|
|
50
50
|
description,
|
|
51
51
|
activeDirectory,
|
|
52
|
-
|
|
52
|
+
userProfile,
|
|
53
53
|
language
|
|
54
54
|
}) {
|
|
55
|
-
const parametersBackend = useParametersBackend(
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
55
|
+
const parametersBackend = useParametersBackend(
|
|
56
|
+
userProfile,
|
|
57
|
+
id,
|
|
58
|
+
ComputingType.SHORT_CIRCUIT,
|
|
59
|
+
OptionalServicesStatus.Up,
|
|
60
|
+
{
|
|
61
|
+
backendFetchParameters: fetchShortCircuitParameters,
|
|
62
|
+
backendUpdateParameters: updateShortCircuitParameters,
|
|
63
|
+
backendFetchSpecificParametersDescription: getShortCircuitSpecificParametersDescription
|
|
64
|
+
}
|
|
65
|
+
);
|
|
60
66
|
const shortCircuitMethods = useShortCircuitParametersForm({
|
|
61
67
|
parametersBackend,
|
|
62
68
|
parametersUuid: id,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { UUID } from 'node:crypto';
|
|
2
|
-
import {
|
|
2
|
+
import { UserProfile } from 'oidc-client-ts';
|
|
3
3
|
import { ComputingType } from '../features/parameters/common/computing-type';
|
|
4
4
|
import { BackendFunctions, UseParametersBackendReturnProps } from '../utils/types/parameters.type';
|
|
5
5
|
export declare enum OptionalServicesStatus {
|
|
@@ -7,4 +7,4 @@ export declare enum OptionalServicesStatus {
|
|
|
7
7
|
Down = "DOWN",
|
|
8
8
|
Pending = "PENDING"
|
|
9
9
|
}
|
|
10
|
-
export declare const useParametersBackend: <T extends ComputingType>(
|
|
10
|
+
export declare const useParametersBackend: <T extends ComputingType>(userProfile: UserProfile | null, studyUuid: UUID | null, type: T, optionalServiceStatus: OptionalServicesStatus | undefined, backendFunctions: BackendFunctions<T>) => UseParametersBackendReturnProps<T>;
|
|
@@ -8,7 +8,7 @@ var OptionalServicesStatus = /* @__PURE__ */ ((OptionalServicesStatus2) => {
|
|
|
8
8
|
OptionalServicesStatus2["Pending"] = "PENDING";
|
|
9
9
|
return OptionalServicesStatus2;
|
|
10
10
|
})(OptionalServicesStatus || {});
|
|
11
|
-
const useParametersBackend = (
|
|
11
|
+
const useParametersBackend = (userProfile, studyUuid, type, optionalServiceStatus, backendFunctions) => {
|
|
12
12
|
const { snackError, snackWarning } = useSnackMessage();
|
|
13
13
|
const {
|
|
14
14
|
backendFetchProviders,
|
|
@@ -39,10 +39,10 @@ const useParametersBackend = (user, studyUuid, type, optionalServiceStatus, back
|
|
|
39
39
|
});
|
|
40
40
|
}, [backendFetchProviders, snackError, type]);
|
|
41
41
|
useEffect(() => {
|
|
42
|
-
if (
|
|
42
|
+
if (userProfile !== null && optionalServiceStatus === "UP") {
|
|
43
43
|
fetchAvailableProviders();
|
|
44
44
|
}
|
|
45
|
-
}, [fetchAvailableProviders, optionalServiceStatus,
|
|
45
|
+
}, [fetchAvailableProviders, optionalServiceStatus, userProfile]);
|
|
46
46
|
const fetchSpecificParametersDescription = useCallback(() => {
|
|
47
47
|
backendFetchSpecificParametersDescription?.().then((specificParams) => {
|
|
48
48
|
setSpecificParamsDescription(specificParams);
|
|
@@ -74,6 +74,7 @@ export declare const importParamsEn: {
|
|
|
74
74
|
'iidm.import.xml.included.extensions.desc': string;
|
|
75
75
|
'iidm.import.xml.included.extensions.activePowerControl': string;
|
|
76
76
|
'iidm.import.xml.included.extensions.baseVoltageMapping': string;
|
|
77
|
+
'iidm.import.xml.included.extensions.batteryShortCircuit': string;
|
|
77
78
|
'iidm.import.xml.included.extensions.branchObservability': string;
|
|
78
79
|
'iidm.import.xml.included.extensions.busbarSectionPosition': string;
|
|
79
80
|
'iidm.import.xml.included.extensions.branchStatus': string;
|
|
@@ -73,6 +73,7 @@ const importParamsEn = {
|
|
|
73
73
|
"iidm.import.xml.included.extensions.desc": "Import with these extensions",
|
|
74
74
|
"iidm.import.xml.included.extensions.activePowerControl": "Active power control",
|
|
75
75
|
"iidm.import.xml.included.extensions.baseVoltageMapping": "Base voltage mapping",
|
|
76
|
+
"iidm.import.xml.included.extensions.batteryShortCircuit": "Battery short circuit",
|
|
76
77
|
"iidm.import.xml.included.extensions.branchObservability": "Branch observability",
|
|
77
78
|
"iidm.import.xml.included.extensions.busbarSectionPosition": "Busbar section position",
|
|
78
79
|
"iidm.import.xml.included.extensions.branchStatus": "Branch status (IIDM version < 1.12)",
|
|
@@ -85,6 +85,7 @@ export declare const importParamsFr: {
|
|
|
85
85
|
'iidm.import.xml.extensions.desc': string;
|
|
86
86
|
'iidm.import.xml.included.extensions.activePowerControl': string;
|
|
87
87
|
'iidm.import.xml.included.extensions.baseVoltageMapping': string;
|
|
88
|
+
'iidm.import.xml.included.extensions.batteryShortCircuit': string;
|
|
88
89
|
'iidm.import.xml.included.extensions.branchObservability': string;
|
|
89
90
|
'iidm.import.xml.included.extensions.busbarSectionPosition': string;
|
|
90
91
|
'iidm.import.xml.included.extensions.branchStatus': string;
|
|
@@ -84,6 +84,7 @@ const importParamsFr = {
|
|
|
84
84
|
"iidm.import.xml.extensions.desc": "Importer avec ces extensions",
|
|
85
85
|
"iidm.import.xml.included.extensions.activePowerControl": "Compensation",
|
|
86
86
|
"iidm.import.xml.included.extensions.baseVoltageMapping": "Tension nominale",
|
|
87
|
+
"iidm.import.xml.included.extensions.batteryShortCircuit": "Données de court-circuit des batteries",
|
|
87
88
|
"iidm.import.xml.included.extensions.branchObservability": "Observabilité des quadripôles",
|
|
88
89
|
"iidm.import.xml.included.extensions.busbarSectionPosition": "Position des SJBs",
|
|
89
90
|
"iidm.import.xml.included.extensions.branchStatus": "Statut de consignation et de déclenchement (Version IIDM < 1.12)",
|