@gridsuite/commons-ui 0.145.0 → 0.146.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/csvDownloader/csv-export.type.d.ts +2 -2
- package/dist/components/dialogs/customMuiDialog/CustomMuiDialog.d.ts +2 -1
- package/dist/components/dialogs/customMuiDialog/CustomMuiDialog.js +2 -0
- package/dist/components/filter/FilterCreationDialog.d.ts +2 -1
- package/dist/components/filter/FilterCreationDialog.js +4 -2
- package/dist/components/filter/FilterForm.d.ts +2 -3
- package/dist/components/filter/FilterForm.js +3 -3
- package/dist/components/filter/expert/ExpertFilterEditionDialog.d.ts +1 -1
- package/dist/components/filter/expert/ExpertFilterEditionDialog.js +4 -2
- package/dist/components/filter/expert/ExpertFilterForm.d.ts +5 -1
- package/dist/components/filter/expert/ExpertFilterForm.js +18 -3
- package/dist/components/filter/explicitNaming/ExplicitNamingFilterEditionDialog.d.ts +1 -1
- package/dist/components/filter/explicitNaming/ExplicitNamingFilterEditionDialog.js +4 -9
- package/dist/components/filter/explicitNaming/ExplicitNamingFilterForm.d.ts +2 -3
- package/dist/components/filter/explicitNaming/ExplicitNamingFilterForm.js +20 -4
- package/dist/components/filter/filter.type.d.ts +1 -0
- package/dist/components/icons/EditNoteIcon.d.ts +12 -0
- package/dist/components/icons/EditNoteIcon.js +18 -0
- package/dist/components/icons/index.d.ts +1 -0
- package/dist/components/icons/index.js +2 -0
- package/dist/components/index.js +2 -0
- package/dist/components/inputs/reactHookForm/DirectoryItemsInput.js +1 -1
- package/dist/components/inputs/reactHookForm/chip-items-input.js +1 -1
- package/dist/components/inputs/reactHookForm/provider/CustomFormProvider.d.ts +1 -0
- package/dist/components/inputs/reactHookForm/provider/CustomFormProvider.js +21 -4
- package/dist/components/inputs/reactQueryBuilder/OperatorSelector.js +1 -1
- package/dist/components/parameters/common/parameters-creation-dialog.js +1 -1
- package/dist/components/parameters/common/parameters-edition-dialog-props.d.ts +1 -1
- package/dist/components/parameters/loadflow/load-flow-parameters-content.js +1 -1
- package/dist/components/parameters/loadflow/load-flow-parameters-dialog.d.ts +1 -1
- package/dist/components/parameters/loadflow/load-flow-parameters-dialog.js +2 -2
- package/dist/components/parameters/loadflow/load-flow-parameters-inline.d.ts +2 -2
- package/dist/components/parameters/loadflow/load-flow-parameters-inline.js +3 -3
- package/dist/components/parameters/loadflow/load-flow-parameters-utils.js +1 -1
- package/dist/components/parameters/loadflow/use-load-flow-parameters-form.d.ts +1 -1
- package/dist/components/parameters/loadflow/use-load-flow-parameters-form.js +4 -4
- package/dist/components/parameters/network-visualizations/map-parameters.js +1 -1
- package/dist/components/parameters/network-visualizations/network-visualizations-parameters-inline.js +1 -1
- package/dist/components/parameters/network-visualizations/single-line-diagram-parameters.js +1 -1
- package/dist/components/parameters/pcc-min/pcc-min-parameters-inline.js +1 -1
- package/dist/components/parameters/pcc-min/use-pcc-min-parameters-form.js +1 -1
- package/dist/components/parameters/security-analysis/security-analysis-parameters-dialog.d.ts +1 -1
- package/dist/components/parameters/security-analysis/security-analysis-parameters-dialog.js +3 -3
- package/dist/components/parameters/security-analysis/security-analysis-parameters-form.d.ts +2 -2
- package/dist/components/parameters/security-analysis/security-analysis-parameters-form.js +2 -2
- package/dist/components/parameters/security-analysis/security-analysis-parameters-inline.d.ts +2 -2
- package/dist/components/parameters/security-analysis/security-analysis-parameters-inline.js +2 -2
- package/dist/components/parameters/security-analysis/security-analysis-parameters-selector.d.ts +2 -2
- package/dist/components/parameters/security-analysis/security-analysis-parameters-selector.js +4 -4
- package/dist/components/parameters/sensi/sensitivity-analysis-parameters-dialog.d.ts +1 -1
- package/dist/components/parameters/sensi/sensitivity-analysis-parameters-dialog.js +3 -3
- package/dist/components/parameters/sensi/sensitivity-analysis-parameters-form.d.ts +2 -2
- package/dist/components/parameters/sensi/sensitivity-analysis-parameters-form.js +2 -2
- package/dist/components/parameters/sensi/sensitivity-analysis-parameters-inline.d.ts +2 -2
- package/dist/components/parameters/sensi/sensitivity-analysis-parameters-inline.js +2 -2
- package/dist/components/parameters/sensi/sensitivity-parameters-selector.d.ts +2 -2
- package/dist/components/parameters/sensi/sensitivity-parameters-selector.js +5 -5
- package/dist/components/parameters/sensi/use-sensitivity-analysis-parameters.js +1 -1
- package/dist/components/parameters/short-circuit/short-circuit-fields.d.ts +2 -2
- package/dist/components/parameters/short-circuit/short-circuit-fields.js +5 -5
- package/dist/components/parameters/short-circuit/short-circuit-parameters-dialog.d.ts +2 -2
- package/dist/components/parameters/short-circuit/short-circuit-parameters-dialog.js +2 -2
- package/dist/components/parameters/short-circuit/short-circuit-parameters-form.d.ts +2 -2
- package/dist/components/parameters/short-circuit/short-circuit-parameters-form.js +2 -2
- package/dist/components/parameters/short-circuit/short-circuit-parameters-inline.d.ts +2 -2
- package/dist/components/parameters/short-circuit/short-circuit-parameters-inline.js +3 -3
- package/dist/components/parameters/short-circuit/short-circuit-parameters-utils.js +1 -1
- package/dist/components/parameters/voltage-init/general-parameters.js +1 -1
- package/dist/components/parameters/voltage-init/voltage-init-parameters-inline.js +1 -1
- package/dist/hooks/useModificationLabelComputer.d.ts +1 -0
- package/dist/hooks/useModificationLabelComputer.js +4 -1
- package/dist/index.js +4 -2
- package/dist/services/utils.d.ts +7 -2
- package/dist/services/utils.js +15 -10
- package/dist/translations/en/errorsEn.d.ts +1 -0
- package/dist/translations/en/errorsEn.js +2 -1
- package/dist/translations/fr/errorsFr.d.ts +1 -0
- package/dist/translations/fr/errorsFr.js +2 -1
- package/dist/utils/constants/configConstants.d.ts +1 -1
- package/dist/utils/constants/configConstants.js +1 -1
- package/dist/utils/error.js +21 -7
- package/dist/utils/index.js +2 -2
- package/dist/utils/types/{CustomError.d.ts → ProblemDetailError.d.ts} +5 -2
- package/dist/utils/types/{CustomError.js → ProblemDetailError.js} +6 -3
- package/dist/utils/types/index.d.ts +1 -1
- package/dist/utils/types/index.js +2 -2
- package/dist/utils/types/metadata.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { ColDef, CsvExportParams } from 'ag-grid-community';
|
|
2
|
-
import {
|
|
2
|
+
import { GsLangUser } from '../../utils';
|
|
3
3
|
export type CsvDownloadProps = {
|
|
4
4
|
columns: ColDef[];
|
|
5
5
|
tableName: string;
|
|
6
6
|
tableNamePrefix?: string;
|
|
7
7
|
skipColumnHeaders?: boolean;
|
|
8
8
|
skipPinnedBottom?: boolean;
|
|
9
|
-
language:
|
|
9
|
+
language: GsLangUser;
|
|
10
10
|
getData: (params?: CsvExportParams) => string | undefined | void;
|
|
11
11
|
};
|
|
12
12
|
export type CsvExportProps = CsvDownloadProps & {
|
|
@@ -19,6 +19,7 @@ export type CustomMuiDialogProps<T extends FieldValues = FieldValues> = DialogPr
|
|
|
19
19
|
language?: GsLang;
|
|
20
20
|
confirmationMessageKey?: string;
|
|
21
21
|
unscrollableFullHeight?: boolean;
|
|
22
|
+
isDeveloperMode?: boolean;
|
|
22
23
|
};
|
|
23
24
|
/**
|
|
24
25
|
* all those styles are made to work with each other in order to control the scroll behavior:
|
|
@@ -52,4 +53,4 @@ export declare const unscrollableDialogStyles: {
|
|
|
52
53
|
readonly padding: 1;
|
|
53
54
|
};
|
|
54
55
|
};
|
|
55
|
-
export declare function CustomMuiDialog<T extends FieldValues = FieldValues>({ open, formSchema, formMethods, onClose, onSave, isDataFetching, onValidationError, titleId, disabledSave, removeOptional, onCancel, children, language, confirmationMessageKey, unscrollableFullHeight, ...dialogProps }: Readonly<CustomMuiDialogProps<T>>): import("react/jsx-runtime").JSX.Element;
|
|
56
|
+
export declare function CustomMuiDialog<T extends FieldValues = FieldValues>({ open, formSchema, formMethods, onClose, onSave, isDataFetching, onValidationError, titleId, disabledSave, removeOptional, onCancel, children, language, isDeveloperMode, confirmationMessageKey, unscrollableFullHeight, ...dialogProps }: Readonly<CustomMuiDialogProps<T>>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -52,6 +52,7 @@ function CustomMuiDialog({
|
|
|
52
52
|
onCancel,
|
|
53
53
|
children,
|
|
54
54
|
language,
|
|
55
|
+
isDeveloperMode,
|
|
55
56
|
confirmationMessageKey,
|
|
56
57
|
unscrollableFullHeight = false,
|
|
57
58
|
...dialogProps
|
|
@@ -109,6 +110,7 @@ function CustomMuiDialog({
|
|
|
109
110
|
validationSchema: formSchema,
|
|
110
111
|
removeOptional,
|
|
111
112
|
language,
|
|
113
|
+
isDeveloperMode,
|
|
112
114
|
children: [
|
|
113
115
|
/* @__PURE__ */ jsxs(
|
|
114
116
|
Dialog,
|
|
@@ -13,5 +13,6 @@ export interface FilterCreationDialogProps {
|
|
|
13
13
|
id: string;
|
|
14
14
|
label: string;
|
|
15
15
|
};
|
|
16
|
+
isDeveloperMode: boolean;
|
|
16
17
|
}
|
|
17
|
-
export declare function FilterCreationDialog({ open, onClose, activeDirectory, language, sourceFilterForExplicitNamingConversion, filterType, }: FilterCreationDialogProps): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export declare function FilterCreationDialog({ open, onClose, activeDirectory, language, sourceFilterForExplicitNamingConversion, filterType, isDeveloperMode, }: FilterCreationDialogProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -36,7 +36,8 @@ function FilterCreationDialog({
|
|
|
36
36
|
activeDirectory,
|
|
37
37
|
language,
|
|
38
38
|
sourceFilterForExplicitNamingConversion = void 0,
|
|
39
|
-
filterType
|
|
39
|
+
filterType,
|
|
40
|
+
isDeveloperMode
|
|
40
41
|
}) {
|
|
41
42
|
const { snackError } = useSnackMessage();
|
|
42
43
|
const formSchema = useMemo(() => formSchemaByFilterType(filterType), [filterType]);
|
|
@@ -104,6 +105,7 @@ function FilterCreationDialog({
|
|
|
104
105
|
removeOptional: true,
|
|
105
106
|
disabledSave: !!nameError || !!isValidating,
|
|
106
107
|
language,
|
|
108
|
+
isDeveloperMode,
|
|
107
109
|
unscrollableFullHeight: true,
|
|
108
110
|
children: /* @__PURE__ */ jsx(
|
|
109
111
|
FilterForm,
|
|
@@ -112,7 +114,7 @@ function FilterCreationDialog({
|
|
|
112
114
|
activeDirectory,
|
|
113
115
|
filterType,
|
|
114
116
|
sourceFilterForExplicitNamingConversion,
|
|
115
|
-
|
|
117
|
+
isEditing: false
|
|
116
118
|
}
|
|
117
119
|
)
|
|
118
120
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { UUID } from 'node:crypto';
|
|
2
|
-
import { GsLang } from '../../utils';
|
|
3
2
|
export interface FilterFormProps {
|
|
4
3
|
creation?: boolean;
|
|
5
4
|
activeDirectory?: UUID;
|
|
@@ -11,6 +10,6 @@ export interface FilterFormProps {
|
|
|
11
10
|
id: UUID;
|
|
12
11
|
equipmentType: string;
|
|
13
12
|
};
|
|
14
|
-
|
|
13
|
+
isEditing: boolean;
|
|
15
14
|
}
|
|
16
|
-
export declare function FilterForm({ sourceFilterForExplicitNamingConversion, creation, activeDirectory, filterType,
|
|
15
|
+
export declare function FilterForm({ sourceFilterForExplicitNamingConversion, creation, activeDirectory, filterType, isEditing, }: Readonly<FilterFormProps>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -21,7 +21,7 @@ function FilterForm({
|
|
|
21
21
|
creation,
|
|
22
22
|
activeDirectory,
|
|
23
23
|
filterType,
|
|
24
|
-
|
|
24
|
+
isEditing
|
|
25
25
|
}) {
|
|
26
26
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
27
27
|
/* @__PURE__ */ jsx(Box, { sx: unscrollableDialogStyles.unscrollableHeader, children: /* @__PURE__ */ jsx(HeaderFilterForm, { creation, activeDirectory }) }),
|
|
@@ -29,10 +29,10 @@ function FilterForm({
|
|
|
29
29
|
ExplicitNamingFilterForm,
|
|
30
30
|
{
|
|
31
31
|
sourceFilterForExplicitNamingConversion,
|
|
32
|
-
|
|
32
|
+
isEditing
|
|
33
33
|
}
|
|
34
34
|
),
|
|
35
|
-
filterType?.id === FilterType.EXPERT.id && /* @__PURE__ */ jsx(ExpertFilterForm, {})
|
|
35
|
+
filterType?.id === FilterType.EXPERT.id && /* @__PURE__ */ jsx(ExpertFilterForm, { isEditing })
|
|
36
36
|
] });
|
|
37
37
|
}
|
|
38
38
|
export {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { FilterEditionProps } from '../filter.type';
|
|
2
|
-
export declare function ExpertFilterEditionDialog({ id, name, titleId, open, onClose, broadcastChannel, itemSelectionForCopy, getFilterById, setItemSelectionForCopy, activeDirectory, language, description, }: Readonly<FilterEditionProps>): import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export declare function ExpertFilterEditionDialog({ id, name, titleId, open, onClose, broadcastChannel, itemSelectionForCopy, getFilterById, setItemSelectionForCopy, activeDirectory, language, description, isDeveloperMode, }: Readonly<FilterEditionProps>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -32,7 +32,8 @@ function ExpertFilterEditionDialog({
|
|
|
32
32
|
setItemSelectionForCopy,
|
|
33
33
|
activeDirectory,
|
|
34
34
|
language,
|
|
35
|
-
description
|
|
35
|
+
description,
|
|
36
|
+
isDeveloperMode
|
|
36
37
|
}) {
|
|
37
38
|
const { snackError } = useSnackMessage();
|
|
38
39
|
const [dataFetchStatus, setDataFetchStatus] = useState(FetchStatus.IDLE);
|
|
@@ -98,8 +99,9 @@ function ExpertFilterEditionDialog({
|
|
|
98
99
|
disabledSave: !!nameError || !!isValidating,
|
|
99
100
|
isDataFetching: dataFetchStatus === FetchStatus.FETCHING,
|
|
100
101
|
language,
|
|
102
|
+
isDeveloperMode,
|
|
101
103
|
unscrollableFullHeight: true,
|
|
102
|
-
children: isDataReady && /* @__PURE__ */ jsx(FilterForm, { activeDirectory, filterType: FilterType.EXPERT })
|
|
104
|
+
children: isDataReady && /* @__PURE__ */ jsx(FilterForm, { activeDirectory, filterType: FilterType.EXPERT, isEditing: true })
|
|
103
105
|
}
|
|
104
106
|
);
|
|
105
107
|
}
|
|
@@ -14,4 +14,8 @@ export declare function getExpertFilterEmptyFormData(): {
|
|
|
14
14
|
}[];
|
|
15
15
|
};
|
|
16
16
|
};
|
|
17
|
-
|
|
17
|
+
interface ExpertFilterFormProps {
|
|
18
|
+
isEditing: boolean;
|
|
19
|
+
}
|
|
20
|
+
export declare function ExpertFilterForm({ isEditing }: Readonly<ExpertFilterFormProps>): import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs, Fragment, jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useCallback, useMemo } from "react";
|
|
3
3
|
import { formatQuery } from "react-querybuilder/formatQuery";
|
|
4
|
-
import {
|
|
4
|
+
import { useWatch } from "react-hook-form";
|
|
5
5
|
import * as yup from "yup";
|
|
6
6
|
import { v4 } from "uuid";
|
|
7
7
|
import { Box } from "@mui/material";
|
|
@@ -24,6 +24,20 @@ import { FieldType } from "../../../utils/types/fieldType.js";
|
|
|
24
24
|
import "../../../utils/yupConfig.js";
|
|
25
25
|
import { useFormatLabelWithUnit } from "../../../hooks/useFormatLabelWithUnit.js";
|
|
26
26
|
import { filterStyles } from "../HeaderFilterForm.js";
|
|
27
|
+
import "../../overflowableText/OverflowableText.js";
|
|
28
|
+
import "localized-countries";
|
|
29
|
+
import "localized-countries/data/fr";
|
|
30
|
+
import "localized-countries/data/en";
|
|
31
|
+
import "../../inputs/reactHookForm/provider/CustomFormProvider.js";
|
|
32
|
+
import { useCustomFormContext } from "../../inputs/reactHookForm/provider/useCustomFormContext.js";
|
|
33
|
+
import "../../inputs/reactHookForm/agGridTable/BottomRightButtons.js";
|
|
34
|
+
import "../../customAGGrid/customAggrid.js";
|
|
35
|
+
import "ag-grid-community";
|
|
36
|
+
import "react-papaparse";
|
|
37
|
+
import "react-csv-downloader";
|
|
38
|
+
import "../../inputs/reactHookForm/numbers/RangeInput.js";
|
|
39
|
+
import "@react-querybuilder/material";
|
|
40
|
+
import "../../inputs/reactQueryBuilder/PropertyValueEditor.js";
|
|
27
41
|
yup.setLocale({
|
|
28
42
|
mixed: {
|
|
29
43
|
required: "YupRequired",
|
|
@@ -65,8 +79,8 @@ function getExpertFilterEmptyFormData() {
|
|
|
65
79
|
[EXPERT_FILTER_QUERY]: defaultQuery
|
|
66
80
|
};
|
|
67
81
|
}
|
|
68
|
-
function ExpertFilterForm() {
|
|
69
|
-
const { getValues, setValue } =
|
|
82
|
+
function ExpertFilterForm({ isEditing }) {
|
|
83
|
+
const { getValues, setValue, isDeveloperMode } = useCustomFormContext();
|
|
70
84
|
const openConfirmationPopup = useCallback(() => {
|
|
71
85
|
return formatQuery(getValues(EXPERT_FILTER_QUERY), "json_without_ids") !== formatQuery(defaultQuery, "json_without_ids");
|
|
72
86
|
}, [getValues]);
|
|
@@ -90,6 +104,7 @@ function ExpertFilterForm() {
|
|
|
90
104
|
InputWithPopupConfirmation,
|
|
91
105
|
{
|
|
92
106
|
Input: SelectInput,
|
|
107
|
+
disabled: isEditing && !isDeveloperMode,
|
|
93
108
|
name: FieldConstants.EQUIPMENT_TYPE,
|
|
94
109
|
options: Object.values(EXPERT_FILTER_EQUIPMENTS),
|
|
95
110
|
label: "equipmentType",
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { FilterEditionProps } from '../filter.type';
|
|
2
|
-
export declare function ExplicitNamingFilterEditionDialog({ id, name, titleId, open, onClose, broadcastChannel, itemSelectionForCopy, setItemSelectionForCopy, getFilterById, activeDirectory, language, description, }: Readonly<FilterEditionProps>): import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export declare function ExplicitNamingFilterEditionDialog({ id, name, titleId, open, onClose, broadcastChannel, itemSelectionForCopy, setItemSelectionForCopy, getFilterById, activeDirectory, language, description, isDeveloperMode, }: Readonly<FilterEditionProps>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -33,7 +33,8 @@ function ExplicitNamingFilterEditionDialog({
|
|
|
33
33
|
getFilterById,
|
|
34
34
|
activeDirectory,
|
|
35
35
|
language,
|
|
36
|
-
description
|
|
36
|
+
description,
|
|
37
|
+
isDeveloperMode
|
|
37
38
|
}) {
|
|
38
39
|
const { snackError } = useSnackMessage();
|
|
39
40
|
const [dataFetchStatus, setDataFetchStatus] = useState(FetchStatus.IDLE);
|
|
@@ -101,15 +102,9 @@ function ExplicitNamingFilterEditionDialog({
|
|
|
101
102
|
disabledSave: !!nameError || !!isValidating,
|
|
102
103
|
isDataFetching: dataFetchStatus === FetchStatus.FETCHING,
|
|
103
104
|
language,
|
|
105
|
+
isDeveloperMode,
|
|
104
106
|
unscrollableFullHeight: true,
|
|
105
|
-
children: isDataReady && /* @__PURE__ */ jsx(
|
|
106
|
-
FilterForm,
|
|
107
|
-
{
|
|
108
|
-
activeDirectory,
|
|
109
|
-
filterType: FilterType.EXPLICIT_NAMING,
|
|
110
|
-
language
|
|
111
|
-
}
|
|
112
|
-
)
|
|
107
|
+
children: isDataReady && /* @__PURE__ */ jsx(FilterForm, { activeDirectory, filterType: FilterType.EXPLICIT_NAMING, isEditing: true })
|
|
113
108
|
}
|
|
114
109
|
);
|
|
115
110
|
}
|
|
@@ -2,7 +2,6 @@ import { UUID } from 'node:crypto';
|
|
|
2
2
|
import { FieldConstants } from '../../../utils/constants/fieldConstants';
|
|
3
3
|
import { default as yup } from '../../../utils/yupConfig';
|
|
4
4
|
import { DISTRIBUTION_KEY } from '../constants/FilterConstants';
|
|
5
|
-
import { GsLang } from '../../../utils';
|
|
6
5
|
export declare const explicitNamingFilterSchema: {
|
|
7
6
|
filterEquipmentsAttributes: yup.ArraySchema<{
|
|
8
7
|
equipmentID?: string | null | undefined;
|
|
@@ -23,7 +22,7 @@ export interface FilterForExplicitConversionProps {
|
|
|
23
22
|
}
|
|
24
23
|
interface ExplicitNamingFilterFormProps {
|
|
25
24
|
sourceFilterForExplicitNamingConversion?: FilterForExplicitConversionProps;
|
|
26
|
-
|
|
25
|
+
isEditing: boolean;
|
|
27
26
|
}
|
|
28
|
-
export declare function ExplicitNamingFilterForm({ sourceFilterForExplicitNamingConversion,
|
|
27
|
+
export declare function ExplicitNamingFilterForm({ sourceFilterForExplicitNamingConversion, isEditing, }: Readonly<ExplicitNamingFilterFormProps>): import("react/jsx-runtime").JSX.Element;
|
|
29
28
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs, Fragment, jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useEffect, useMemo, useCallback } from "react";
|
|
3
3
|
import { useIntl } from "react-intl";
|
|
4
|
-
import {
|
|
4
|
+
import { useWatch } from "react-hook-form";
|
|
5
5
|
import { Box } from "@mui/material";
|
|
6
6
|
import { v4 } from "uuid";
|
|
7
7
|
import { FieldConstants } from "../../../utils/constants/fieldConstants.js";
|
|
@@ -27,6 +27,22 @@ import "../../../utils/conversionUtils.js";
|
|
|
27
27
|
import { snackWithFallback } from "../../../utils/error.js";
|
|
28
28
|
import "@mui/icons-material";
|
|
29
29
|
import "../../../utils/types/equipmentType.js";
|
|
30
|
+
import "../../overflowableText/OverflowableText.js";
|
|
31
|
+
import "localized-countries";
|
|
32
|
+
import "localized-countries/data/fr";
|
|
33
|
+
import "localized-countries/data/en";
|
|
34
|
+
import "../../inputs/reactHookForm/provider/CustomFormProvider.js";
|
|
35
|
+
import { useCustomFormContext } from "../../inputs/reactHookForm/provider/useCustomFormContext.js";
|
|
36
|
+
import "../../treeViewFinder/TreeViewFinder.js";
|
|
37
|
+
import "../../inputs/reactHookForm/agGridTable/BottomRightButtons.js";
|
|
38
|
+
import "react-papaparse";
|
|
39
|
+
import "react-csv-downloader";
|
|
40
|
+
import "../../inputs/reactHookForm/numbers/RangeInput.js";
|
|
41
|
+
import "@react-querybuilder/material";
|
|
42
|
+
import "../expert/expertFilterConstants.js";
|
|
43
|
+
import "../../inputs/reactQueryBuilder/CustomReactQueryBuilder.js";
|
|
44
|
+
import "../../inputs/reactQueryBuilder/PropertyValueEditor.js";
|
|
45
|
+
import "react-querybuilder";
|
|
30
46
|
import * as yup from "yup";
|
|
31
47
|
function isGeneratorOrLoad(equipmentType) {
|
|
32
48
|
return equipmentType === Generator.type || equipmentType === Load.type;
|
|
@@ -63,11 +79,11 @@ function getExplicitNamingFilterEmptyFormData() {
|
|
|
63
79
|
}
|
|
64
80
|
function ExplicitNamingFilterForm({
|
|
65
81
|
sourceFilterForExplicitNamingConversion,
|
|
66
|
-
|
|
82
|
+
isEditing
|
|
67
83
|
}) {
|
|
68
84
|
const intl = useIntl();
|
|
69
85
|
const { snackError } = useSnackMessage();
|
|
70
|
-
const { getValues, setValue } =
|
|
86
|
+
const { getValues, setValue, isDeveloperMode, language } = useCustomFormContext();
|
|
71
87
|
const watchEquipmentType = useWatch({
|
|
72
88
|
name: FieldConstants.EQUIPMENT_TYPE
|
|
73
89
|
});
|
|
@@ -165,7 +181,7 @@ function ExplicitNamingFilterForm({
|
|
|
165
181
|
Input: SelectInput,
|
|
166
182
|
name: FieldConstants.EQUIPMENT_TYPE,
|
|
167
183
|
options: Object.values(FILTER_EQUIPMENTS),
|
|
168
|
-
disabled: !!sourceFilterForExplicitNamingConversion,
|
|
184
|
+
disabled: !!sourceFilterForExplicitNamingConversion || isEditing && !isDeveloperMode,
|
|
169
185
|
label: "equipmentType",
|
|
170
186
|
shouldOpenPopup: openConfirmationPopup,
|
|
171
187
|
resetOnConfirmation: handleResetOnConfirmation,
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025, 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
|
+
type EditNoteIconProps = {
|
|
8
|
+
empty?: boolean;
|
|
9
|
+
hidden?: boolean;
|
|
10
|
+
};
|
|
11
|
+
export declare function EditNoteIcon({ empty, hidden }: Readonly<EditNoteIconProps>): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import AddNote from "@material-symbols/svg-400/outlined/add_notes.svg?react";
|
|
3
|
+
import { useTheme } from "@mui/material";
|
|
4
|
+
import { StickyNote2Outlined } from "@mui/icons-material";
|
|
5
|
+
function EditNoteIcon({ empty = false, hidden = false }) {
|
|
6
|
+
const theme = useTheme();
|
|
7
|
+
const size = 25;
|
|
8
|
+
const style = {
|
|
9
|
+
width: size,
|
|
10
|
+
height: size,
|
|
11
|
+
fill: theme.palette.text.primary,
|
|
12
|
+
visibility: hidden ? "hidden" : "visible"
|
|
13
|
+
};
|
|
14
|
+
return empty ? /* @__PURE__ */ jsx(AddNote, { style }) : /* @__PURE__ */ jsx(StickyNote2Outlined, { sx: style });
|
|
15
|
+
}
|
|
16
|
+
export {
|
|
17
|
+
EditNoteIcon
|
|
18
|
+
};
|
|
@@ -4,9 +4,11 @@ import { LeftPanelCloseIcon } from "./LeftPanelCloseIcon.js";
|
|
|
4
4
|
import { DeviceHubIcon } from "./DeviceHubIcon.js";
|
|
5
5
|
import { TuneIcon } from "./TuneIcon.js";
|
|
6
6
|
import { PhotoLibraryIcon } from "./PhotoLibraryIcon.js";
|
|
7
|
+
import { EditNoteIcon } from "./EditNoteIcon.js";
|
|
7
8
|
export {
|
|
8
9
|
ArrowsOutputIcon,
|
|
9
10
|
DeviceHubIcon,
|
|
11
|
+
EditNoteIcon,
|
|
10
12
|
LeftPanelCloseIcon,
|
|
11
13
|
LeftPanelOpenIcon,
|
|
12
14
|
PhotoLibraryIcon,
|
package/dist/components/index.js
CHANGED
|
@@ -132,6 +132,7 @@ import { LeftPanelCloseIcon } from "./icons/LeftPanelCloseIcon.js";
|
|
|
132
132
|
import { DeviceHubIcon } from "./icons/DeviceHubIcon.js";
|
|
133
133
|
import { TuneIcon } from "./icons/TuneIcon.js";
|
|
134
134
|
import { PhotoLibraryIcon } from "./icons/PhotoLibraryIcon.js";
|
|
135
|
+
import { EditNoteIcon } from "./icons/EditNoteIcon.js";
|
|
135
136
|
import { ComputingType, formatComputingTypeLabel, isValidComputingType } from "./parameters/common/computing-type.js";
|
|
136
137
|
import { COMMON_PARAMETERS, PARAM_SA_FLOW_PROPORTIONAL_THRESHOLD, PARAM_SA_HIGH_VOLTAGE_ABSOLUTE_THRESHOLD, PARAM_SA_HIGH_VOLTAGE_PROPORTIONAL_THRESHOLD, PARAM_SA_LOW_VOLTAGE_ABSOLUTE_THRESHOLD, PARAM_SA_LOW_VOLTAGE_PROPORTIONAL_THRESHOLD, PARAM_SA_PROVIDER, PROVIDER, ReactivePowerAdornment, SPECIFIC_PARAMETERS, VERSION_PARAMETER, VOLTAGE_LEVEL, VoltageAdornment } from "./parameters/common/constant.js";
|
|
137
138
|
import { LineSeparator } from "./parameters/common/line-separator.js";
|
|
@@ -263,6 +264,7 @@ export {
|
|
|
263
264
|
EXPERT_FILTER_EQUIPMENTS,
|
|
264
265
|
EXPERT_FILTER_FIELDS,
|
|
265
266
|
EXPERT_FILTER_QUERY,
|
|
267
|
+
EditNoteIcon,
|
|
266
268
|
ElementSaveDialog,
|
|
267
269
|
ElementSearchDialog,
|
|
268
270
|
ElementSearchInput,
|
|
@@ -8,9 +8,9 @@ import "./provider/CustomFormProvider.js";
|
|
|
8
8
|
import { useCustomFormContext } from "./provider/useCustomFormContext.js";
|
|
9
9
|
import { ErrorInput } from "./errorManagement/ErrorInput.js";
|
|
10
10
|
import { MidFormError } from "./errorManagement/MidFormError.js";
|
|
11
|
-
import "../../../utils/types/equipmentType.js";
|
|
12
11
|
import "../../../utils/conversionUtils.js";
|
|
13
12
|
import { mergeSx } from "../../../utils/styles.js";
|
|
13
|
+
import "../../../utils/types/equipmentType.js";
|
|
14
14
|
import { ArrayAction } from "../../../utils/types/types.js";
|
|
15
15
|
import { getEquipmentTypeShortLabel } from "../../../utils/labelUtils.js";
|
|
16
16
|
import "../../../utils/yupConfig.js";
|
|
@@ -3,9 +3,9 @@ import { FormControl, Chip, TextField } from "@mui/material";
|
|
|
3
3
|
import { useState, useCallback, useMemo } from "react";
|
|
4
4
|
import { useFieldArray, useController } from "react-hook-form";
|
|
5
5
|
import "react-intl";
|
|
6
|
-
import "../../../utils/types/equipmentType.js";
|
|
7
6
|
import "../../../utils/conversionUtils.js";
|
|
8
7
|
import "@mui/icons-material";
|
|
8
|
+
import "../../../utils/types/equipmentType.js";
|
|
9
9
|
import "../../../utils/yupConfig.js";
|
|
10
10
|
import "localized-countries";
|
|
11
11
|
import "localized-countries/data/fr";
|
|
@@ -8,6 +8,7 @@ type CustomFormContextProps<TFieldValues extends FieldValues = FieldValues> = {
|
|
|
8
8
|
language?: GsLang;
|
|
9
9
|
isNodeBuilt?: boolean;
|
|
10
10
|
isUpdate?: boolean;
|
|
11
|
+
isDeveloperMode?: boolean;
|
|
11
12
|
};
|
|
12
13
|
export type MergedFormContextProps<TFieldValues extends FieldValues = FieldValues> = UseFormReturn<TFieldValues> & CustomFormContextProps<TFieldValues>;
|
|
13
14
|
export declare const CustomFormContext: import('react').Context<CustomFormContextProps<FieldValues>>;
|
|
@@ -8,16 +8,33 @@ const CustomFormContext = createContext({
|
|
|
8
8
|
validationSchema: yup.object(),
|
|
9
9
|
language: getSystemLanguage(),
|
|
10
10
|
isNodeBuilt: false,
|
|
11
|
-
isUpdate: false
|
|
11
|
+
isUpdate: false,
|
|
12
|
+
isDeveloperMode: false
|
|
12
13
|
});
|
|
13
14
|
function CustomFormProvider(props) {
|
|
14
|
-
const {
|
|
15
|
+
const {
|
|
16
|
+
validationSchema,
|
|
17
|
+
removeOptional,
|
|
18
|
+
language,
|
|
19
|
+
isNodeBuilt,
|
|
20
|
+
isUpdate,
|
|
21
|
+
isDeveloperMode,
|
|
22
|
+
children,
|
|
23
|
+
...formMethods
|
|
24
|
+
} = props;
|
|
15
25
|
return /* @__PURE__ */ jsx(FormProvider, { ...formMethods, children: /* @__PURE__ */ jsx(
|
|
16
26
|
CustomFormContext.Provider,
|
|
17
27
|
{
|
|
18
28
|
value: useMemo(
|
|
19
|
-
() => ({
|
|
20
|
-
|
|
29
|
+
() => ({
|
|
30
|
+
validationSchema,
|
|
31
|
+
removeOptional,
|
|
32
|
+
language,
|
|
33
|
+
isNodeBuilt,
|
|
34
|
+
isUpdate,
|
|
35
|
+
isDeveloperMode
|
|
36
|
+
}),
|
|
37
|
+
[validationSchema, removeOptional, language, isNodeBuilt, isUpdate, isDeveloperMode]
|
|
21
38
|
),
|
|
22
39
|
children
|
|
23
40
|
}
|
|
@@ -2,9 +2,9 @@ import { jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { MaterialValueSelector } from "@react-querybuilder/material";
|
|
3
3
|
import "react";
|
|
4
4
|
import "react-intl";
|
|
5
|
-
import "../../../utils/types/equipmentType.js";
|
|
6
5
|
import "../../../utils/conversionUtils.js";
|
|
7
6
|
import "@mui/icons-material";
|
|
7
|
+
import "../../../utils/types/equipmentType.js";
|
|
8
8
|
import "../../../utils/yupConfig.js";
|
|
9
9
|
import "@mui/material";
|
|
10
10
|
import "localized-countries";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useCallback } from "react";
|
|
3
3
|
import "react-intl";
|
|
4
|
-
import "../../../utils/types/equipmentType.js";
|
|
5
4
|
import "../../../utils/conversionUtils.js";
|
|
6
5
|
import { snackWithFallback } from "../../../utils/error.js";
|
|
7
6
|
import "@mui/icons-material";
|
|
7
|
+
import "../../../utils/types/equipmentType.js";
|
|
8
8
|
import "../../../utils/yupConfig.js";
|
|
9
9
|
import { createParameter, updateParameter } from "../../../services/explore.js";
|
|
10
10
|
import "@mui/material";
|
|
@@ -5,9 +5,9 @@ import LoadFlowGeneralParameters from "./load-flow-general-parameters.js";
|
|
|
5
5
|
import { TabPanel } from "../common/parameters.js";
|
|
6
6
|
import "react";
|
|
7
7
|
import "react-intl";
|
|
8
|
-
import "../../../utils/types/equipmentType.js";
|
|
9
8
|
import "../../../utils/conversionUtils.js";
|
|
10
9
|
import "@mui/icons-material";
|
|
10
|
+
import "../../../utils/types/equipmentType.js";
|
|
11
11
|
import "../../../utils/yupConfig.js";
|
|
12
12
|
import "localized-countries";
|
|
13
13
|
import "localized-countries/data/fr";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { ParametersEditionDialogProps } from '../common';
|
|
2
|
-
export declare function LoadFlowParametersEditionDialog({ id, open, onClose, titleId, name, description, activeDirectory, user, language,
|
|
2
|
+
export declare function LoadFlowParametersEditionDialog({ id, open, onClose, titleId, name, description, activeDirectory, user, language, isDeveloperMode, }: Readonly<ParametersEditionDialogProps>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -51,7 +51,7 @@ function LoadFlowParametersEditionDialog({
|
|
|
51
51
|
activeDirectory,
|
|
52
52
|
user,
|
|
53
53
|
language = LANG_ENGLISH,
|
|
54
|
-
|
|
54
|
+
isDeveloperMode = false
|
|
55
55
|
}) {
|
|
56
56
|
const parametersBackend = useParametersBackend(
|
|
57
57
|
user,
|
|
@@ -67,7 +67,7 @@ function LoadFlowParametersEditionDialog({
|
|
|
67
67
|
getLoadFlowSpecificParametersDescription,
|
|
68
68
|
getLoadFlowDefaultLimitReductions
|
|
69
69
|
);
|
|
70
|
-
const loadflowMethods = useLoadFlowParametersForm(parametersBackend,
|
|
70
|
+
const loadflowMethods = useLoadFlowParametersForm(parametersBackend, isDeveloperMode, id, name, description);
|
|
71
71
|
const {
|
|
72
72
|
formState: { errors, dirtyFields }
|
|
73
73
|
} = loadflowMethods.formMethods;
|
|
@@ -2,10 +2,10 @@ import { UUID } from 'node:crypto';
|
|
|
2
2
|
import { UseParametersBackendReturnProps } from '../../../utils/types/parameters.type';
|
|
3
3
|
import { ComputingType } from '../common/computing-type';
|
|
4
4
|
import { GsLang } from '../../../utils';
|
|
5
|
-
export declare function LoadFlowParametersInline({ studyUuid, language, parametersBackend, setHaveDirtyFields,
|
|
5
|
+
export declare function LoadFlowParametersInline({ studyUuid, language, parametersBackend, setHaveDirtyFields, isDeveloperMode, }: Readonly<{
|
|
6
6
|
studyUuid: UUID | null;
|
|
7
7
|
language: GsLang;
|
|
8
8
|
parametersBackend: UseParametersBackendReturnProps<ComputingType.LOAD_FLOW>;
|
|
9
9
|
setHaveDirtyFields: (isDirty: boolean) => void;
|
|
10
|
-
|
|
10
|
+
isDeveloperMode: boolean;
|
|
11
11
|
}>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -4,12 +4,12 @@ import { Box, Grid } from "@mui/material";
|
|
|
4
4
|
import { useIntl, FormattedMessage } from "react-intl";
|
|
5
5
|
import { LoadFlowProvider } from "./load-flow-parameters-provider.js";
|
|
6
6
|
import { parametersStyles } from "../parameters-style.js";
|
|
7
|
-
import "../../../utils/types/equipmentType.js";
|
|
8
7
|
import "../../../utils/conversionUtils.js";
|
|
9
8
|
import { snackWithFallback } from "../../../utils/error.js";
|
|
10
9
|
import "@mui/icons-material";
|
|
11
10
|
import { ElementType } from "../../../utils/types/elementType.js";
|
|
12
11
|
import { mergeSx } from "../../../utils/styles.js";
|
|
12
|
+
import "../../../utils/types/equipmentType.js";
|
|
13
13
|
import "../../../utils/yupConfig.js";
|
|
14
14
|
import { fetchLoadFlowParameters } from "../../../services/loadflow.js";
|
|
15
15
|
import "localized-countries";
|
|
@@ -49,10 +49,10 @@ function LoadFlowParametersInline({
|
|
|
49
49
|
language,
|
|
50
50
|
parametersBackend,
|
|
51
51
|
setHaveDirtyFields,
|
|
52
|
-
|
|
52
|
+
isDeveloperMode
|
|
53
53
|
}) {
|
|
54
54
|
const [, , , , resetProvider, , , , resetParameters, ,] = parametersBackend;
|
|
55
|
-
const loadflowMethods = useLoadFlowParametersForm(parametersBackend,
|
|
55
|
+
const loadflowMethods = useLoadFlowParametersForm(parametersBackend, isDeveloperMode, null, null, null);
|
|
56
56
|
const intl = useIntl();
|
|
57
57
|
const [openCreateParameterDialog, setOpenCreateParameterDialog] = useState(false);
|
|
58
58
|
const [openSelectParameterDialog, setOpenSelectParameterDialog] = useState(false);
|
|
@@ -3,9 +3,9 @@ import "react/jsx-runtime";
|
|
|
3
3
|
import "@mui/material";
|
|
4
4
|
import "react-intl";
|
|
5
5
|
import "react";
|
|
6
|
-
import "../../../utils/types/equipmentType.js";
|
|
7
6
|
import "../../../utils/conversionUtils.js";
|
|
8
7
|
import "@mui/icons-material";
|
|
8
|
+
import "../../../utils/types/equipmentType.js";
|
|
9
9
|
import "../../../utils/yupConfig.js";
|
|
10
10
|
import "localized-countries";
|
|
11
11
|
import "localized-countries/data/fr";
|
|
@@ -29,4 +29,4 @@ export interface UseLoadFlowParametersFormReturn {
|
|
|
29
29
|
onSaveInline: (formData: Record<string, any>) => void;
|
|
30
30
|
onSaveDialog: (formData: Record<string, any>) => void;
|
|
31
31
|
}
|
|
32
|
-
export declare const useLoadFlowParametersForm: (parametersBackend: UseParametersBackendReturnProps<ComputingType.LOAD_FLOW>,
|
|
32
|
+
export declare const useLoadFlowParametersForm: (parametersBackend: UseParametersBackendReturnProps<ComputingType.LOAD_FLOW>, isDeveloperMode: boolean, parametersUuid: UUID | null, name: string | null, description: string | null) => UseLoadFlowParametersFormReturn;
|
|
@@ -6,11 +6,11 @@ import { PROVIDER, SPECIFIC_PARAMETERS, COMMON_PARAMETERS, VERSION_PARAMETER } f
|
|
|
6
6
|
import "react/jsx-runtime";
|
|
7
7
|
import "@mui/material";
|
|
8
8
|
import "react-intl";
|
|
9
|
-
import "../../../utils/types/equipmentType.js";
|
|
10
9
|
import "../../../utils/conversionUtils.js";
|
|
11
10
|
import { snackWithFallback } from "../../../utils/error.js";
|
|
12
11
|
import "@mui/icons-material";
|
|
13
12
|
import { ElementType } from "../../../utils/types/elementType.js";
|
|
13
|
+
import "../../../utils/types/equipmentType.js";
|
|
14
14
|
import "../../../utils/yupConfig.js";
|
|
15
15
|
import { updateParameter } from "../../../services/explore.js";
|
|
16
16
|
import "localized-countries";
|
|
@@ -43,7 +43,7 @@ import { PARAM_LIMIT_REDUCTION, PARAM_PROVIDER_OPENLOADFLOW } from "./constants.
|
|
|
43
43
|
import "../../filter/HeaderFilterForm.js";
|
|
44
44
|
import { getNameElementEditorSchema, getNameElementEditorEmptyFormData } from "../common/name-element-editor/name-element-editor-utils.js";
|
|
45
45
|
import { getDefaultSpecificParamsValues, getSpecificParametersFormSchema, getAllSpecificParametersValues, formatSpecificParameters, setSpecificParameters } from "../common/utils.js";
|
|
46
|
-
const useLoadFlowParametersForm = (parametersBackend,
|
|
46
|
+
const useLoadFlowParametersForm = (parametersBackend, isDeveloperMode, parametersUuid, name, description) => {
|
|
47
47
|
const [
|
|
48
48
|
providers,
|
|
49
49
|
provider,
|
|
@@ -159,11 +159,11 @@ const useLoadFlowParametersForm = (parametersBackend, enableDeveloperMode, param
|
|
|
159
159
|
);
|
|
160
160
|
const paramsLoaded = useMemo(() => !!params && !!currentProvider, [currentProvider, params]);
|
|
161
161
|
const formattedProviders = useMemo(() => {
|
|
162
|
-
return Object.entries(providers).filter(([key]) => !key.includes("DynaFlow") ||
|
|
162
|
+
return Object.entries(providers).filter(([key]) => !key.includes("DynaFlow") || isDeveloperMode).map(([key, value]) => ({
|
|
163
163
|
id: key,
|
|
164
164
|
label: value
|
|
165
165
|
}));
|
|
166
|
-
}, [providers,
|
|
166
|
+
}, [providers, isDeveloperMode]);
|
|
167
167
|
const onValidationError = useCallback(
|
|
168
168
|
(errors) => {
|
|
169
169
|
const tabsInError = [];
|