@gridsuite/commons-ui 0.57.0 → 0.58.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/_mocks_/svg.d.ts +4 -0
- package/dist/_mocks_/svg.js +8 -0
- package/dist/chunks/{criteria-based-filter-edition-dialog.BEXoNmzz.js → criteria-based-filter-edition-dialog.CbhgOSRk.js} +139 -110
- package/dist/chunks/{filter-properties.GRon8-ML.js → filter-properties.B7-q_yPf.js} +4 -4
- package/dist/components/DirectoryItemSelector/directory-item-selector.js +2 -1
- package/dist/components/ElementSearchDialog/element-search-dialog.d.ts +18 -15
- package/dist/components/ElementSearchDialog/element-search-dialog.js +28 -65
- package/dist/components/ElementSearchDialog/equipment-item.js +4 -3
- package/dist/components/OverflowableText/overflowable-text.js +39 -9
- package/dist/components/TreeViewFinder/TreeViewFinder.js +1 -1
- package/dist/components/TreeViewFinder/index.d.ts +7 -0
- package/dist/components/dialogs/custom-mui-dialog.d.ts +2 -1
- package/dist/components/dialogs/custom-mui-dialog.js +6 -4
- package/dist/components/dialogs/description-modification-dialog.js +2 -2
- package/dist/components/dialogs/modify-element-selection.d.ts +14 -0
- package/dist/components/dialogs/modify-element-selection.js +108 -0
- package/dist/components/dialogs/popup-confirmation-dialog.js +1 -1
- package/dist/components/filter/criteria-based/criteria-based-filter-edition-dialog.d.ts +1 -2
- package/dist/components/filter/criteria-based/criteria-based-filter-edition-dialog.js +4 -4
- package/dist/components/filter/criteria-based/criteria-based-filter-form.js +5 -3
- package/dist/components/filter/criteria-based/criteria-based-filter-utils.d.ts +12 -6
- package/dist/components/filter/criteria-based/criteria-based-filter-utils.js +44 -4
- package/dist/components/filter/criteria-based/criteria-based-form.d.ts +2 -0
- package/dist/components/filter/criteria-based/criteria-based-form.js +6 -6
- package/dist/components/filter/criteria-based/filter-free-properties.js +5 -5
- package/dist/components/filter/criteria-based/filter-properties.js +3 -3
- package/dist/components/filter/criteria-based/filter-property.js +3 -3
- package/dist/components/filter/{constants → expert}/expert-filter-constants.js +7 -6
- package/dist/components/filter/expert/expert-filter-edition-dialog.d.ts +3 -3
- package/dist/components/filter/expert/expert-filter-edition-dialog.js +5 -6
- package/dist/components/filter/expert/expert-filter-form.js +5 -5
- package/dist/components/filter/expert/expert-filter-utils.js +1 -1
- package/dist/components/filter/explicit-naming/explicit-naming-filter-edition-dialog.d.ts +0 -2
- package/dist/components/filter/explicit-naming/explicit-naming-filter-edition-dialog.js +4 -4
- package/dist/components/filter/explicit-naming/explicit-naming-filter-form.d.ts +10 -2
- package/dist/components/filter/explicit-naming/explicit-naming-filter-form.js +12 -8
- package/dist/components/filter/filter-context.d.ts +1 -0
- package/dist/components/filter/filter-context.js +2 -1
- package/dist/components/filter/filter-creation-dialog.d.ts +5 -2
- package/dist/components/filter/filter-creation-dialog.js +3 -3
- package/dist/components/filter/filter-form.d.ts +4 -0
- package/dist/components/filter/filter-form.js +6 -5
- package/dist/components/filter/utils/filter-api.d.ts +5 -0
- package/dist/components/filter/utils/{filters-utils.js → filter-api.js} +16 -10
- package/dist/components/filter/utils/filter-form-utils.d.ts +17 -0
- package/dist/components/filter/utils/{criteria-based-utils.js → filter-form-utils.js} +5 -45
- package/dist/components/{react-hook-form/ag-grid-table-rhf → inputs/react-hook-form/ag-grid-table}/bottom-right-buttons.js +1 -1
- package/dist/components/{react-hook-form/ag-grid-table-rhf → inputs/react-hook-form/ag-grid-table}/csv-uploader/csv-uploader.js +23 -23
- package/dist/components/{react-hook-form/ag-grid-table-rhf → inputs/react-hook-form/ag-grid-table}/custom-ag-grid-table.js +2 -2
- package/dist/components/{react-hook-form → inputs/react-hook-form/autocomplete-inputs}/autocomplete-input.d.ts +3 -3
- package/dist/components/{react-hook-form → inputs/react-hook-form/autocomplete-inputs}/autocomplete-input.js +4 -4
- package/dist/components/{react-hook-form → inputs/react-hook-form}/autocomplete-inputs/multiple-autocomplete-input.js +1 -1
- package/dist/components/{react-hook-form → inputs/react-hook-form}/directory-items-input.js +5 -5
- package/dist/components/{react-hook-form → inputs/react-hook-form}/numbers/integer-input.d.ts +3 -3
- package/dist/components/{react-hook-form → inputs/react-hook-form}/provider/custom-form-provider.js +1 -1
- package/dist/components/{react-hook-form → inputs/react-hook-form}/range-input.d.ts +1 -1
- package/dist/components/{react-hook-form → inputs/react-hook-form}/range-input.js +2 -2
- package/dist/components/{react-hook-form → inputs/react-hook-form}/select-inputs/countries-input.d.ts +1 -1
- package/dist/components/{react-hook-form → inputs/react-hook-form}/select-inputs/countries-input.js +2 -3
- package/dist/components/{react-hook-form → inputs/react-hook-form}/select-inputs/input-with-popup-confirmation.js +1 -1
- package/dist/components/{react-hook-form → inputs/react-hook-form}/select-inputs/select-input.d.ts +2 -2
- package/dist/components/{react-hook-form → inputs/react-hook-form}/select-inputs/select-input.js +4 -1
- package/dist/components/{react-hook-form → inputs/react-hook-form}/text-input.d.ts +1 -1
- package/dist/components/{react-hook-form → inputs/react-hook-form}/unique-name-input.d.ts +2 -2
- package/dist/components/{react-hook-form → inputs/react-hook-form}/unique-name-input.js +2 -2
- package/dist/components/{react-hook-form → inputs/react-hook-form}/utils/text-field-with-adornment.d.ts +1 -1
- package/dist/components/{react-query-builder-inputs → inputs/react-query-builder}/combinator-selector.js +1 -1
- package/dist/components/{react-query-builder-inputs → inputs/react-query-builder}/country-value-editor.js +1 -1
- package/dist/components/{react-query-builder-inputs → inputs/react-query-builder}/custom-react-query-builder.js +3 -3
- package/dist/components/{react-query-builder-inputs → inputs/react-query-builder}/element-value-editor.js +22 -22
- package/dist/components/{react-query-builder-inputs → inputs/react-query-builder}/property-value-editor.js +3 -3
- package/dist/components/{react-query-builder-inputs → inputs/react-query-builder}/remove-button.js +2 -2
- package/dist/components/{react-query-builder-inputs → inputs/react-query-builder}/use-convert-value.js +1 -1
- package/dist/components/inputs/react-query-builder/value-editor.js +18 -0
- package/dist/components/inputs/select-clearable.js +1 -1
- package/dist/hooks/useDebounce.d.ts +1 -1
- package/dist/hooks/useSnackMessage.d.ts +4 -7
- package/dist/hooks/useSnackMessage.js +36 -43
- package/dist/index.d.ts +51 -39
- package/dist/index.js +129 -120
- package/dist/redux/commonStore.d.ts +15 -0
- package/dist/redux/commonStore.js +11 -0
- package/dist/services/explore.d.ts +4 -0
- package/dist/services/explore.js +34 -0
- package/dist/services/study.d.ts +3 -0
- package/dist/services/study.js +16 -0
- package/dist/services/utils.d.ts +8 -0
- package/dist/services/utils.js +58 -0
- package/dist/utils/AuthService.js +1 -1
- package/dist/utils/types.d.ts +1 -1
- package/package.json +8 -7
- package/dist/components/filter/utils/criteria-based-utils.d.ts +0 -28
- package/dist/components/filter/utils/filters-utils.d.ts +0 -5
- package/dist/components/react-query-builder-inputs/value-editor.js +0 -18
- /package/dist/components/filter/{constants → expert}/expert-filter-constants.d.ts +0 -0
- /package/dist/components/{react-hook-form → inputs/react-hook-form}/ExpandingTextField.d.ts +0 -0
- /package/dist/components/{react-hook-form → inputs/react-hook-form}/ExpandingTextField.js +0 -0
- /package/dist/components/{react-hook-form/ag-grid-table-rhf → inputs/react-hook-form/ag-grid-table}/bottom-right-buttons.d.ts +0 -0
- /package/dist/components/{react-hook-form/ag-grid-table-rhf → inputs/react-hook-form/ag-grid-table}/cell-editors/numericEditor.d.ts +0 -0
- /package/dist/components/{react-hook-form/ag-grid-table-rhf → inputs/react-hook-form/ag-grid-table}/cell-editors/numericEditor.js +0 -0
- /package/dist/components/{react-hook-form/ag-grid-table-rhf → inputs/react-hook-form/ag-grid-table}/csv-uploader/csv-uploader.d.ts +0 -0
- /package/dist/components/{react-hook-form/ag-grid-table-rhf → inputs/react-hook-form/ag-grid-table}/custom-ag-grid-table.d.ts +0 -0
- /package/dist/components/{react-hook-form → inputs/react-hook-form}/autocomplete-inputs/multiple-autocomplete-input.d.ts +0 -0
- /package/dist/components/{react-hook-form → inputs/react-hook-form}/booleans/boolean-input.d.ts +0 -0
- /package/dist/components/{react-hook-form → inputs/react-hook-form}/booleans/boolean-input.js +0 -0
- /package/dist/components/{react-hook-form → inputs/react-hook-form}/booleans/checkbox-input.d.ts +0 -0
- /package/dist/components/{react-hook-form → inputs/react-hook-form}/booleans/checkbox-input.js +0 -0
- /package/dist/components/{react-hook-form → inputs/react-hook-form}/booleans/switch-input.d.ts +0 -0
- /package/dist/components/{react-hook-form → inputs/react-hook-form}/booleans/switch-input.js +0 -0
- /package/dist/components/{react-hook-form → inputs/react-hook-form}/directory-items-input.d.ts +0 -0
- /package/dist/components/{react-hook-form → inputs/react-hook-form}/error-management/error-input.d.ts +0 -0
- /package/dist/components/{react-hook-form → inputs/react-hook-form}/error-management/error-input.js +0 -0
- /package/dist/components/{react-hook-form → inputs/react-hook-form}/error-management/field-error-alert.d.ts +0 -0
- /package/dist/components/{react-hook-form → inputs/react-hook-form}/error-management/field-error-alert.js +0 -0
- /package/dist/components/{react-hook-form → inputs/react-hook-form}/error-management/mid-form-error.d.ts +0 -0
- /package/dist/components/{react-hook-form → inputs/react-hook-form}/error-management/mid-form-error.js +0 -0
- /package/dist/components/{react-hook-form → inputs/react-hook-form}/numbers/float-input.d.ts +0 -0
- /package/dist/components/{react-hook-form → inputs/react-hook-form}/numbers/float-input.js +0 -0
- /package/dist/components/{react-hook-form → inputs/react-hook-form}/numbers/integer-input.js +0 -0
- /package/dist/components/{react-hook-form → inputs/react-hook-form}/numbers/utils.d.ts +0 -0
- /package/dist/components/{react-hook-form → inputs/react-hook-form}/numbers/utils.js +0 -0
- /package/dist/components/{react-hook-form → inputs/react-hook-form}/provider/custom-form-provider.d.ts +0 -0
- /package/dist/components/{react-hook-form → inputs/react-hook-form}/provider/use-custom-form-context.d.ts +0 -0
- /package/dist/components/{react-hook-form → inputs/react-hook-form}/provider/use-custom-form-context.js +0 -0
- /package/dist/components/{react-hook-form → inputs/react-hook-form}/radio-input.d.ts +0 -0
- /package/dist/components/{react-hook-form → inputs/react-hook-form}/radio-input.js +0 -0
- /package/dist/components/{react-hook-form → inputs/react-hook-form}/raw-read-only-input.d.ts +0 -0
- /package/dist/components/{react-hook-form → inputs/react-hook-form}/raw-read-only-input.js +0 -0
- /package/dist/components/{react-hook-form → inputs/react-hook-form}/select-inputs/input-with-popup-confirmation.d.ts +0 -0
- /package/dist/components/{react-hook-form → inputs/react-hook-form}/select-inputs/mui-select-input.d.ts +0 -0
- /package/dist/components/{react-hook-form → inputs/react-hook-form}/select-inputs/mui-select-input.js +0 -0
- /package/dist/components/{react-hook-form → inputs/react-hook-form}/slider-input.d.ts +0 -0
- /package/dist/components/{react-hook-form → inputs/react-hook-form}/slider-input.js +0 -0
- /package/dist/components/{react-hook-form → inputs/react-hook-form}/text-input.js +0 -0
- /package/dist/components/{react-hook-form → inputs/react-hook-form}/utils/cancel-button.d.ts +0 -0
- /package/dist/components/{react-hook-form → inputs/react-hook-form}/utils/cancel-button.js +0 -0
- /package/dist/components/{react-hook-form → inputs/react-hook-form}/utils/field-label.d.ts +0 -0
- /package/dist/components/{react-hook-form → inputs/react-hook-form}/utils/field-label.js +0 -0
- /package/dist/components/{react-hook-form → inputs/react-hook-form}/utils/functions.d.ts +0 -0
- /package/dist/components/{react-hook-form → inputs/react-hook-form}/utils/functions.js +0 -0
- /package/dist/components/{react-hook-form → inputs/react-hook-form}/utils/submit-button.d.ts +0 -0
- /package/dist/components/{react-hook-form → inputs/react-hook-form}/utils/submit-button.js +0 -0
- /package/dist/components/{react-hook-form → inputs/react-hook-form}/utils/text-field-with-adornment.js +0 -0
- /package/dist/components/{react-query-builder-inputs → inputs/react-query-builder}/add-button.d.ts +0 -0
- /package/dist/components/{react-query-builder-inputs → inputs/react-query-builder}/add-button.js +0 -0
- /package/dist/components/{react-query-builder-inputs → inputs/react-query-builder}/combinator-selector.d.ts +0 -0
- /package/dist/components/{react-query-builder-inputs → inputs/react-query-builder}/country-value-editor.d.ts +0 -0
- /package/dist/components/{react-query-builder-inputs → inputs/react-query-builder}/custom-react-query-builder.d.ts +0 -0
- /package/dist/components/{react-query-builder-inputs → inputs/react-query-builder}/element-value-editor.d.ts +0 -0
- /package/dist/components/{react-query-builder-inputs → inputs/react-query-builder}/property-value-editor.d.ts +0 -0
- /package/dist/components/{react-query-builder-inputs → inputs/react-query-builder}/remove-button.d.ts +0 -0
- /package/dist/components/{react-query-builder-inputs → inputs/react-query-builder}/text-value-editor.d.ts +0 -0
- /package/dist/components/{react-query-builder-inputs → inputs/react-query-builder}/text-value-editor.js +0 -0
- /package/dist/components/{react-query-builder-inputs → inputs/react-query-builder}/translated-value-editor.d.ts +0 -0
- /package/dist/components/{react-query-builder-inputs → inputs/react-query-builder}/translated-value-editor.js +0 -0
- /package/dist/components/{react-query-builder-inputs → inputs/react-query-builder}/use-convert-value.d.ts +0 -0
- /package/dist/components/{react-query-builder-inputs → inputs/react-query-builder}/use-valid.d.ts +0 -0
- /package/dist/components/{react-query-builder-inputs → inputs/react-query-builder}/use-valid.js +0 -0
- /package/dist/components/{react-query-builder-inputs → inputs/react-query-builder}/value-editor.d.ts +0 -0
- /package/dist/components/{react-query-builder-inputs → inputs/react-query-builder}/value-selector.d.ts +0 -0
- /package/dist/components/{react-query-builder-inputs → inputs/react-query-builder}/value-selector.js +0 -0
- /package/dist/{utils → redux}/actions.d.ts +0 -0
- /package/dist/{utils → redux}/actions.js +0 -0
- /package/dist/{components/filter/constants → utils}/equipment-types.d.ts +0 -0
- /package/dist/{components/filter/constants → utils}/equipment-types.js +0 -0
- /package/dist/{components/filter/constants → utils}/field-constants.d.ts +0 -0
- /package/dist/{components/filter/constants → utils}/field-constants.js +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import '../assets/criteria-based-filter-edition-dialog.css';
|
|
2
2
|
import { jsxs, Fragment, jsx } from "react/jsx-runtime";
|
|
3
3
|
import React, { useState, useMemo, useEffect, useCallback, useContext } from "react";
|
|
4
|
-
import { FieldConstants } from "../
|
|
4
|
+
import { FieldConstants } from "../utils/field-constants.js";
|
|
5
5
|
import { backToFrontTweak, frontToBackTweak } from "../components/filter/criteria-based/criteria-based-filter-utils.js";
|
|
6
6
|
import CustomMuiDialog from "../components/dialogs/custom-mui-dialog.js";
|
|
7
7
|
import { useSnackMessage } from "../hooks/useSnackMessage.js";
|
|
@@ -9,7 +9,7 @@ import { useWatch, useFormContext, useFieldArray, useController, useForm } from
|
|
|
9
9
|
import { yupResolver } from "@hookform/resolvers/yup";
|
|
10
10
|
import CriteriaBasedFilterForm, { criteriaBasedFilterEmptyFormData, criteriaBasedFilterSchema } from "../components/filter/criteria-based/criteria-based-filter-form.js";
|
|
11
11
|
import "../utils/yup-config.js";
|
|
12
|
-
import { UniqueNameInput } from "../components/react-hook-form/unique-name-input.js";
|
|
12
|
+
import { UniqueNameInput } from "../components/inputs/react-hook-form/unique-name-input.js";
|
|
13
13
|
import { AgGridReact } from "ag-grid-react";
|
|
14
14
|
import "ag-grid-community/styles/ag-grid.css";
|
|
15
15
|
import "ag-grid-community/styles/ag-theme-alpine.css";
|
|
@@ -42,68 +42,70 @@ import "../components/ReportViewer/log-table.js";
|
|
|
42
42
|
import "../components/ReportViewer/report-tree-view-context.js";
|
|
43
43
|
import "@mui/x-tree-view";
|
|
44
44
|
import "../components/OverflowableText/overflowable-text.js";
|
|
45
|
-
import "../components/ElementSearchDialog/element-search-dialog.js";
|
|
46
45
|
import "../components/ElementSearchDialog/tag-renderer.js";
|
|
47
|
-
import "../components/react-hook-form/utils/submit-button.js";
|
|
48
|
-
import CancelButton from "../components/react-hook-form/utils/cancel-button.js";
|
|
49
|
-
import "../components/react-hook-form/provider/custom-form-provider.js";
|
|
46
|
+
import "../components/inputs/react-hook-form/utils/submit-button.js";
|
|
47
|
+
import CancelButton from "../components/inputs/react-hook-form/utils/cancel-button.js";
|
|
48
|
+
import "../components/inputs/react-hook-form/provider/custom-form-provider.js";
|
|
50
49
|
import "../components/dialogs/description-modification-dialog.js";
|
|
50
|
+
import { FilterContext } from "../components/filter/filter-context.js";
|
|
51
|
+
import "notistack";
|
|
51
52
|
import * as yup from "yup";
|
|
52
53
|
import "../components/dialogs/popup-confirmation-dialog.js";
|
|
53
|
-
import { FILTER_EQUIPMENTS } from "../components/filter/utils/criteria-based-utils.js";
|
|
54
54
|
import "autosuggest-highlight/match";
|
|
55
55
|
import "autosuggest-highlight/parse";
|
|
56
56
|
import "clsx";
|
|
57
57
|
import "../components/CardErrorBoundary/card-error-boundary.js";
|
|
58
|
-
import "
|
|
59
|
-
import "../components/react-hook-form/
|
|
60
|
-
import "../components/react-hook-form/
|
|
61
|
-
import "../components/react-hook-form/booleans/
|
|
62
|
-
import "../components/react-hook-form/booleans/switch-input.js";
|
|
58
|
+
import "../components/inputs/react-hook-form/slider-input.js";
|
|
59
|
+
import "../components/inputs/react-hook-form/numbers/integer-input.js";
|
|
60
|
+
import "../components/inputs/react-hook-form/booleans/checkbox-input.js";
|
|
61
|
+
import "../components/inputs/react-hook-form/booleans/switch-input.js";
|
|
63
62
|
import "@mui/icons-material/Folder";
|
|
64
|
-
import {
|
|
65
|
-
import { saveExplicitNamingFilter, saveCriteriaBasedFilter, saveExpertFilter } from "../components/filter/utils/filters-utils.js";
|
|
63
|
+
import { saveExplicitNamingFilter, saveCriteriaBasedFilter, saveExpertFilter } from "../components/filter/utils/filter-api.js";
|
|
66
64
|
import { formatQuery, QueryBuilder } from "react-querybuilder";
|
|
67
65
|
import { getNumberOfSiblings, recursiveRemove, countRules, getOperators, queryValidator, testQuery, importExpertRules } from "../components/filter/expert/expert-filter-utils.js";
|
|
68
|
-
import { COMBINATOR_OPTIONS, RULES, EXPERT_FILTER_EQUIPMENTS, OPERATOR_OPTIONS, fields } from "../components/filter/
|
|
66
|
+
import { COMBINATOR_OPTIONS, RULES, EXPERT_FILTER_EQUIPMENTS, OPERATOR_OPTIONS, fields } from "../components/filter/expert/expert-filter-constants.js";
|
|
69
67
|
import { FieldType, OperatorType, DataType } from "../components/filter/expert/expert-filter.type.js";
|
|
70
68
|
import { QueryBuilderDnD } from "@react-querybuilder/dnd";
|
|
71
69
|
import * as ReactDnD from "react-dnd";
|
|
72
70
|
import * as ReactDndHtml5Backend from "react-dnd-html5-backend";
|
|
73
71
|
import { MaterialValueEditor, QueryBuilderMaterial } from "@react-querybuilder/material";
|
|
74
|
-
import CombinatorSelector from "../components/react-query-builder
|
|
75
|
-
import AddButton from "../components/react-query-builder
|
|
76
|
-
import CountryValueEditor from "../components/react-query-builder
|
|
77
|
-
import TranslatedValueEditor from "../components/react-query-builder
|
|
78
|
-
import TextValueEditor from "../components/react-query-builder
|
|
72
|
+
import CombinatorSelector from "../components/inputs/react-query-builder/combinator-selector.js";
|
|
73
|
+
import AddButton from "../components/inputs/react-query-builder/add-button.js";
|
|
74
|
+
import CountryValueEditor from "../components/inputs/react-query-builder/country-value-editor.js";
|
|
75
|
+
import TranslatedValueEditor from "../components/inputs/react-query-builder/translated-value-editor.js";
|
|
76
|
+
import TextValueEditor from "../components/inputs/react-query-builder/text-value-editor.js";
|
|
79
77
|
import Box from "@mui/material/Box";
|
|
80
|
-
import { Generator, Load, VoltageLevel, Substation, noSelectionForCopy as noSelectionForCopy$1 } from "../
|
|
81
|
-
import { useCustomFormContext } from "../components/react-hook-form/provider/use-custom-form-context.js";
|
|
82
|
-
import DirectoryItemsInput from "../components/react-hook-form/directory-items-input.js";
|
|
78
|
+
import { Generator, Load, VoltageLevel, Substation, noSelectionForCopy as noSelectionForCopy$1 } from "../utils/equipment-types.js";
|
|
79
|
+
import { useCustomFormContext } from "../components/inputs/react-hook-form/provider/use-custom-form-context.js";
|
|
80
|
+
import DirectoryItemsInput from "../components/inputs/react-hook-form/directory-items-input.js";
|
|
83
81
|
import { DISTRIBUTION_KEY, FilterType } from "../components/filter/constants/filter-constants.js";
|
|
84
82
|
import { FetchStatus } from "../utils/FetchStatus.js";
|
|
85
83
|
import PropTypes from "prop-types";
|
|
86
|
-
import "
|
|
87
|
-
import "
|
|
88
|
-
import "../components/react-hook-form/
|
|
84
|
+
import { saveFilter } from "../services/explore.js";
|
|
85
|
+
import "./filter-properties.B7-q_yPf.js";
|
|
86
|
+
import "../components/inputs/react-hook-form/range-input.js";
|
|
87
|
+
import "../components/inputs/react-hook-form/select-inputs/mui-select-input.js";
|
|
89
88
|
import "localized-countries";
|
|
90
89
|
import "localized-countries/data/fr";
|
|
91
90
|
import "localized-countries/data/en";
|
|
92
91
|
import "@mui/icons-material/Check";
|
|
93
92
|
import "@mui/material/CircularProgress";
|
|
94
93
|
import "@mui/material/TextField";
|
|
94
|
+
import { FILTER_EQUIPMENTS } from "../components/filter/utils/filter-form-utils.js";
|
|
95
95
|
import { ElementType } from "../utils/ElementType.js";
|
|
96
|
-
import PropertyValueEditor from "../components/react-query-builder
|
|
97
|
-
import ValueSelector from "../components/react-query-builder
|
|
98
|
-
import ErrorInput from "../components/react-hook-form/error-management/error-input.js";
|
|
99
|
-
import FieldErrorAlert from "../components/react-hook-form/error-management/field-error-alert.js";
|
|
100
|
-
import InputWithPopupConfirmation from "../components/react-hook-form/select-inputs/input-with-popup-confirmation.js";
|
|
101
|
-
import SelectInput from "../components/react-hook-form/select-inputs/select-input.js";
|
|
96
|
+
import PropertyValueEditor from "../components/inputs/react-query-builder/property-value-editor.js";
|
|
97
|
+
import ValueSelector from "../components/inputs/react-query-builder/value-selector.js";
|
|
98
|
+
import ErrorInput from "../components/inputs/react-hook-form/error-management/error-input.js";
|
|
99
|
+
import FieldErrorAlert from "../components/inputs/react-hook-form/error-management/field-error-alert.js";
|
|
100
|
+
import InputWithPopupConfirmation from "../components/inputs/react-hook-form/select-inputs/input-with-popup-confirmation.js";
|
|
101
|
+
import SelectInput from "../components/inputs/react-hook-form/select-inputs/select-input.js";
|
|
102
102
|
import { styled } from "@mui/material/styles";
|
|
103
|
-
import { NumericEditor } from "../components/react-hook-form/ag-grid-table
|
|
104
|
-
import { toFloatOrNullValue } from "../components/react-hook-form/utils/functions.js";
|
|
105
|
-
import
|
|
106
|
-
import
|
|
103
|
+
import { NumericEditor } from "../components/inputs/react-hook-form/ag-grid-table/cell-editors/numericEditor.js";
|
|
104
|
+
import { toFloatOrNullValue } from "../components/inputs/react-hook-form/utils/functions.js";
|
|
105
|
+
import ModifyElementSelection from "../components/dialogs/modify-element-selection.js";
|
|
106
|
+
import { exportFilter } from "../services/study.js";
|
|
107
|
+
import RadioInput from "../components/inputs/react-hook-form/radio-input.js";
|
|
108
|
+
import ExpandingTextField from "../components/inputs/react-hook-form/ExpandingTextField.js";
|
|
107
109
|
const CsvUploader = ({
|
|
108
110
|
name,
|
|
109
111
|
onClose,
|
|
@@ -657,13 +659,22 @@ function getExplicitNamingFilterEmptyFormData() {
|
|
|
657
659
|
[FILTER_EQUIPMENTS_ATTRIBUTES]: makeDefaultTableRows()
|
|
658
660
|
};
|
|
659
661
|
}
|
|
660
|
-
const ExplicitNamingFilterForm = () => {
|
|
662
|
+
const ExplicitNamingFilterForm = ({ sourceFilterForExplicitNamingConversion }) => {
|
|
661
663
|
const intl = useIntl();
|
|
664
|
+
const { snackError } = useSnackMessage();
|
|
662
665
|
const { getValues, setValue } = useFormContext();
|
|
663
666
|
const watchEquipmentType = useWatch({
|
|
664
667
|
name: FieldConstants.EQUIPMENT_TYPE
|
|
665
668
|
});
|
|
666
669
|
const forGeneratorOrLoad = isGeneratorOrLoad(watchEquipmentType);
|
|
670
|
+
useEffect(() => {
|
|
671
|
+
if (sourceFilterForExplicitNamingConversion) {
|
|
672
|
+
setValue(
|
|
673
|
+
FieldConstants.EQUIPMENT_TYPE,
|
|
674
|
+
sourceFilterForExplicitNamingConversion.equipmentType
|
|
675
|
+
);
|
|
676
|
+
}
|
|
677
|
+
}, [sourceFilterForExplicitNamingConversion, setValue]);
|
|
667
678
|
const columnDefs = useMemo(() => {
|
|
668
679
|
const columnDefs2 = [
|
|
669
680
|
...ROW_DRAGGING_SELECTION_COLUMN_DEF,
|
|
@@ -729,20 +740,51 @@ const ExplicitNamingFilterForm = () => {
|
|
|
729
740
|
const handleResetOnConfirmation = () => {
|
|
730
741
|
setValue(FILTER_EQUIPMENTS_ATTRIBUTES, makeDefaultTableRows());
|
|
731
742
|
};
|
|
743
|
+
const onStudySelected = (studyUuid) => {
|
|
744
|
+
exportFilter(studyUuid, sourceFilterForExplicitNamingConversion == null ? void 0 : sourceFilterForExplicitNamingConversion.id).then((matchingEquipments) => {
|
|
745
|
+
setValue(
|
|
746
|
+
FILTER_EQUIPMENTS_ATTRIBUTES,
|
|
747
|
+
matchingEquipments.length === 0 ? makeDefaultTableRows() : matchingEquipments.map((equipment) => ({
|
|
748
|
+
[FieldConstants.AG_GRID_ROW_UUID]: v4(),
|
|
749
|
+
[FieldConstants.EQUIPMENT_ID]: equipment.id,
|
|
750
|
+
[DISTRIBUTION_KEY]: equipment.distributionKey
|
|
751
|
+
}))
|
|
752
|
+
);
|
|
753
|
+
}).catch(
|
|
754
|
+
(error) => snackError({
|
|
755
|
+
messageTxt: error.message,
|
|
756
|
+
headerId: "convertIntoExplicitNamingFilterError"
|
|
757
|
+
})
|
|
758
|
+
);
|
|
759
|
+
};
|
|
732
760
|
return /* @__PURE__ */ jsxs(Grid, { container: true, item: true, spacing: 2, children: [
|
|
733
|
-
/* @__PURE__ */
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
761
|
+
/* @__PURE__ */ jsxs(Grid, { item: true, xs: 12, children: [
|
|
762
|
+
/* @__PURE__ */ jsx(
|
|
763
|
+
InputWithPopupConfirmation,
|
|
764
|
+
{
|
|
765
|
+
Input: SelectInput,
|
|
766
|
+
name: FieldConstants.EQUIPMENT_TYPE,
|
|
767
|
+
options: Object.values(FILTER_EQUIPMENTS),
|
|
768
|
+
disabled: sourceFilterForExplicitNamingConversion,
|
|
769
|
+
label: "equipmentType",
|
|
770
|
+
shouldOpenPopup: openConfirmationPopup,
|
|
771
|
+
resetOnConfirmation: handleResetOnConfirmation,
|
|
772
|
+
message: "changeTypeMessage",
|
|
773
|
+
validateButtonLabel: "button.changeType"
|
|
774
|
+
}
|
|
775
|
+
),
|
|
776
|
+
sourceFilterForExplicitNamingConversion && /* @__PURE__ */ jsx(
|
|
777
|
+
ModifyElementSelection,
|
|
778
|
+
{
|
|
779
|
+
elementType: ElementType.STUDY,
|
|
780
|
+
onElementValidated: onStudySelected,
|
|
781
|
+
dialogOpeningButtonLabel: "selectStudyDialogButton",
|
|
782
|
+
dialogTitleLabel: "selectStudyDialogTitle",
|
|
783
|
+
dialogMessageLabel: "selectStudyText",
|
|
784
|
+
noElementMessageLabel: "noSelectedStudyText"
|
|
785
|
+
}
|
|
786
|
+
)
|
|
787
|
+
] }),
|
|
746
788
|
watchEquipmentType && /* @__PURE__ */ jsx(Grid, { item: true, xs: 12, children: /* @__PURE__ */ jsx(
|
|
747
789
|
CustomAgGridTable,
|
|
748
790
|
{
|
|
@@ -1108,6 +1150,11 @@ const FilterForm = (props) => {
|
|
|
1108
1150
|
const handleChange = (_event, value) => {
|
|
1109
1151
|
setValue(FieldConstants.FILTER_TYPE, value);
|
|
1110
1152
|
};
|
|
1153
|
+
useEffect(() => {
|
|
1154
|
+
if (props.sourceFilterForExplicitNamingConversion) {
|
|
1155
|
+
setValue(FieldConstants.FILTER_TYPE, FilterType.EXPLICIT_NAMING.id);
|
|
1156
|
+
}
|
|
1157
|
+
}, [props.sourceFilterForExplicitNamingConversion, setValue]);
|
|
1111
1158
|
return /* @__PURE__ */ jsxs(Grid$1, { container: true, spacing: 2, children: [
|
|
1112
1159
|
/* @__PURE__ */ jsx(Grid$1, { item: true, xs: 12, children: /* @__PURE__ */ jsx(
|
|
1113
1160
|
UniqueNameInput,
|
|
@@ -1130,7 +1177,7 @@ const FilterForm = (props) => {
|
|
|
1130
1177
|
rows: 5
|
|
1131
1178
|
}
|
|
1132
1179
|
) }) }),
|
|
1133
|
-
/* @__PURE__ */ jsx(Grid$1, { item: true, children: /* @__PURE__ */ jsx(
|
|
1180
|
+
!props.sourceFilterForExplicitNamingConversion && /* @__PURE__ */ jsx(Grid$1, { item: true, children: /* @__PURE__ */ jsx(
|
|
1134
1181
|
RadioInput,
|
|
1135
1182
|
{
|
|
1136
1183
|
name: FieldConstants.FILTER_TYPE,
|
|
@@ -1140,7 +1187,12 @@ const FilterForm = (props) => {
|
|
|
1140
1187
|
) })
|
|
1141
1188
|
] }),
|
|
1142
1189
|
filterType === FilterType.CRITERIA_BASED.id && /* @__PURE__ */ jsx(CriteriaBasedFilterForm, {}),
|
|
1143
|
-
filterType === FilterType.EXPLICIT_NAMING.id && /* @__PURE__ */ jsx(
|
|
1190
|
+
filterType === FilterType.EXPLICIT_NAMING.id && /* @__PURE__ */ jsx(
|
|
1191
|
+
ExplicitNamingFilterForm,
|
|
1192
|
+
{
|
|
1193
|
+
sourceFilterForExplicitNamingConversion: props.sourceFilterForExplicitNamingConversion
|
|
1194
|
+
}
|
|
1195
|
+
),
|
|
1144
1196
|
filterType === FilterType.EXPERT.id && /* @__PURE__ */ jsx(ExpertFilterForm, {})
|
|
1145
1197
|
] });
|
|
1146
1198
|
};
|
|
@@ -1166,24 +1218,21 @@ const FilterCreationDialog = ({
|
|
|
1166
1218
|
open,
|
|
1167
1219
|
onClose,
|
|
1168
1220
|
activeDirectory,
|
|
1169
|
-
createFilter,
|
|
1170
|
-
saveFilter,
|
|
1171
1221
|
fetchAppsAndUrls,
|
|
1172
1222
|
elementExists,
|
|
1173
1223
|
language,
|
|
1174
1224
|
fetchDirectoryContent,
|
|
1175
1225
|
fetchRootFolders,
|
|
1176
|
-
fetchElementsInfos
|
|
1226
|
+
fetchElementsInfos,
|
|
1227
|
+
fetchPath,
|
|
1228
|
+
sourceFilterForExplicitNamingConversion = void 0
|
|
1177
1229
|
}) => {
|
|
1178
1230
|
var _a;
|
|
1179
1231
|
const { snackError } = useSnackMessage();
|
|
1180
|
-
const formMethods = {
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
}),
|
|
1185
|
-
language
|
|
1186
|
-
};
|
|
1232
|
+
const formMethods = useForm({
|
|
1233
|
+
defaultValues: emptyFormData,
|
|
1234
|
+
resolver: yupResolver(formSchema$3)
|
|
1235
|
+
});
|
|
1187
1236
|
const {
|
|
1188
1237
|
formState: { errors }
|
|
1189
1238
|
} = formMethods;
|
|
@@ -1205,8 +1254,6 @@ const FilterCreationDialog = ({
|
|
|
1205
1254
|
});
|
|
1206
1255
|
},
|
|
1207
1256
|
onClose,
|
|
1208
|
-
createFilter,
|
|
1209
|
-
saveFilter,
|
|
1210
1257
|
activeDirectory
|
|
1211
1258
|
);
|
|
1212
1259
|
} else if (filterForm[FieldConstants.FILTER_TYPE] === FilterType.CRITERIA_BASED.id) {
|
|
@@ -1218,8 +1265,7 @@ const FilterCreationDialog = ({
|
|
|
1218
1265
|
snackError({
|
|
1219
1266
|
messageTxt: error
|
|
1220
1267
|
});
|
|
1221
|
-
}
|
|
1222
|
-
createFilter
|
|
1268
|
+
}
|
|
1223
1269
|
);
|
|
1224
1270
|
} else if (filterForm[FieldConstants.FILTER_TYPE] === FilterType.EXPERT.id) {
|
|
1225
1271
|
saveExpertFilter(
|
|
@@ -1235,13 +1281,11 @@ const FilterCreationDialog = ({
|
|
|
1235
1281
|
snackError({
|
|
1236
1282
|
messageTxt: error
|
|
1237
1283
|
});
|
|
1238
|
-
}
|
|
1239
|
-
createFilter,
|
|
1240
|
-
saveFilter
|
|
1284
|
+
}
|
|
1241
1285
|
);
|
|
1242
1286
|
}
|
|
1243
1287
|
},
|
|
1244
|
-
[activeDirectory, snackError, onClose
|
|
1288
|
+
[activeDirectory, snackError, onClose]
|
|
1245
1289
|
);
|
|
1246
1290
|
return /* @__PURE__ */ jsx(
|
|
1247
1291
|
CustomMuiDialog,
|
|
@@ -1251,9 +1295,10 @@ const FilterCreationDialog = ({
|
|
|
1251
1295
|
onSave: onSubmit,
|
|
1252
1296
|
formSchema: formSchema$3,
|
|
1253
1297
|
formMethods,
|
|
1254
|
-
titleId: "createNewFilter",
|
|
1298
|
+
titleId: sourceFilterForExplicitNamingConversion ? "convertIntoExplicitNamingFilter" : "createNewFilter",
|
|
1255
1299
|
removeOptional: true,
|
|
1256
1300
|
disabledSave: !!nameError || !!isValidating,
|
|
1301
|
+
language,
|
|
1257
1302
|
children: /* @__PURE__ */ jsx(
|
|
1258
1303
|
FilterContext.Provider,
|
|
1259
1304
|
{
|
|
@@ -1261,14 +1306,16 @@ const FilterCreationDialog = ({
|
|
|
1261
1306
|
fetchDirectoryContent,
|
|
1262
1307
|
fetchRootFolders,
|
|
1263
1308
|
fetchElementsInfos,
|
|
1264
|
-
fetchAppsAndUrls
|
|
1309
|
+
fetchAppsAndUrls,
|
|
1310
|
+
fetchPath
|
|
1265
1311
|
},
|
|
1266
1312
|
children: /* @__PURE__ */ jsx(
|
|
1267
1313
|
FilterForm,
|
|
1268
1314
|
{
|
|
1269
1315
|
creation: true,
|
|
1270
1316
|
activeDirectory,
|
|
1271
|
-
elementExists
|
|
1317
|
+
elementExists,
|
|
1318
|
+
sourceFilterForExplicitNamingConversion
|
|
1272
1319
|
}
|
|
1273
1320
|
)
|
|
1274
1321
|
}
|
|
@@ -1292,24 +1339,20 @@ const ExpertFilterEditionDialog = ({
|
|
|
1292
1339
|
selectionForCopy,
|
|
1293
1340
|
getFilterById,
|
|
1294
1341
|
setSelectionForCopy,
|
|
1295
|
-
createFilter,
|
|
1296
|
-
saveFilter,
|
|
1297
1342
|
activeDirectory,
|
|
1298
1343
|
elementExists,
|
|
1299
1344
|
language,
|
|
1300
1345
|
fetchDirectoryContent,
|
|
1301
1346
|
fetchRootFolders,
|
|
1302
|
-
fetchElementsInfos
|
|
1347
|
+
fetchElementsInfos,
|
|
1348
|
+
fetchAppsAndUrls
|
|
1303
1349
|
}) => {
|
|
1304
1350
|
var _a;
|
|
1305
1351
|
const { snackError } = useSnackMessage();
|
|
1306
1352
|
const [dataFetchStatus, setDataFetchStatus] = useState(FetchStatus.IDLE);
|
|
1307
|
-
const formMethods = {
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
}),
|
|
1311
|
-
language
|
|
1312
|
-
};
|
|
1353
|
+
const formMethods = useForm({
|
|
1354
|
+
resolver: yupResolver(formSchema$2)
|
|
1355
|
+
});
|
|
1313
1356
|
const {
|
|
1314
1357
|
reset,
|
|
1315
1358
|
formState: { errors }
|
|
@@ -1354,9 +1397,7 @@ const ExpertFilterEditionDialog = ({
|
|
|
1354
1397
|
snackError({
|
|
1355
1398
|
messageTxt: error
|
|
1356
1399
|
});
|
|
1357
|
-
}
|
|
1358
|
-
createFilter,
|
|
1359
|
-
saveFilter
|
|
1400
|
+
}
|
|
1360
1401
|
);
|
|
1361
1402
|
if (selectionForCopy.sourceItemUuid === id) {
|
|
1362
1403
|
setSelectionForCopy(noSelectionForCopy$1);
|
|
@@ -1371,9 +1412,7 @@ const ExpertFilterEditionDialog = ({
|
|
|
1371
1412
|
onClose,
|
|
1372
1413
|
selectionForCopy.sourceItemUuid,
|
|
1373
1414
|
snackError,
|
|
1374
|
-
setSelectionForCopy
|
|
1375
|
-
saveFilter,
|
|
1376
|
-
createFilter
|
|
1415
|
+
setSelectionForCopy
|
|
1377
1416
|
]
|
|
1378
1417
|
);
|
|
1379
1418
|
const isDataReady = dataFetchStatus === FetchStatus.FETCH_SUCCESS;
|
|
@@ -1389,13 +1428,15 @@ const ExpertFilterEditionDialog = ({
|
|
|
1389
1428
|
removeOptional: true,
|
|
1390
1429
|
disabledSave: !!nameError || !!isValidating,
|
|
1391
1430
|
isDataFetching: dataFetchStatus === FetchStatus.FETCHING,
|
|
1431
|
+
language,
|
|
1392
1432
|
children: /* @__PURE__ */ jsx(
|
|
1393
1433
|
FilterContext.Provider,
|
|
1394
1434
|
{
|
|
1395
1435
|
value: {
|
|
1396
1436
|
fetchDirectoryContent,
|
|
1397
1437
|
fetchRootFolders,
|
|
1398
|
-
fetchElementsInfos
|
|
1438
|
+
fetchElementsInfos,
|
|
1439
|
+
fetchAppsAndUrls
|
|
1399
1440
|
},
|
|
1400
1441
|
children: isDataReady && /* @__PURE__ */ jsx(
|
|
1401
1442
|
FilterForm,
|
|
@@ -1425,8 +1466,6 @@ const ExplicitNamingFilterEditionDialog = ({
|
|
|
1425
1466
|
selectionForCopy,
|
|
1426
1467
|
setSelectionForCopy,
|
|
1427
1468
|
getFilterById,
|
|
1428
|
-
createFilter,
|
|
1429
|
-
saveFilter,
|
|
1430
1469
|
activeDirectory,
|
|
1431
1470
|
elementExists,
|
|
1432
1471
|
language
|
|
@@ -1434,12 +1473,9 @@ const ExplicitNamingFilterEditionDialog = ({
|
|
|
1434
1473
|
var _a;
|
|
1435
1474
|
const { snackError } = useSnackMessage();
|
|
1436
1475
|
const [dataFetchStatus, setDataFetchStatus] = useState(FetchStatus.IDLE);
|
|
1437
|
-
const formMethods = {
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
}),
|
|
1441
|
-
language
|
|
1442
|
-
};
|
|
1476
|
+
const formMethods = useForm({
|
|
1477
|
+
resolver: yupResolver(formSchema$1)
|
|
1478
|
+
});
|
|
1443
1479
|
const {
|
|
1444
1480
|
reset,
|
|
1445
1481
|
formState: { errors }
|
|
@@ -1484,9 +1520,7 @@ const ExplicitNamingFilterEditionDialog = ({
|
|
|
1484
1520
|
messageTxt: error
|
|
1485
1521
|
});
|
|
1486
1522
|
},
|
|
1487
|
-
onClose
|
|
1488
|
-
createFilter,
|
|
1489
|
-
saveFilter
|
|
1523
|
+
onClose
|
|
1490
1524
|
);
|
|
1491
1525
|
if (selectionForCopy.sourceItemUuid === id) {
|
|
1492
1526
|
setSelectionForCopy(noSelectionForCopy$1);
|
|
@@ -1501,8 +1535,6 @@ const ExplicitNamingFilterEditionDialog = ({
|
|
|
1501
1535
|
selectionForCopy,
|
|
1502
1536
|
onClose,
|
|
1503
1537
|
snackError,
|
|
1504
|
-
createFilter,
|
|
1505
|
-
saveFilter,
|
|
1506
1538
|
setSelectionForCopy
|
|
1507
1539
|
]
|
|
1508
1540
|
);
|
|
@@ -1519,6 +1551,7 @@ const ExplicitNamingFilterEditionDialog = ({
|
|
|
1519
1551
|
removeOptional: true,
|
|
1520
1552
|
disabledSave: !!nameError || !!isValidating,
|
|
1521
1553
|
isDataFetching: dataFetchStatus === FetchStatus.FETCHING,
|
|
1554
|
+
language,
|
|
1522
1555
|
children: isDataReady && /* @__PURE__ */ jsx(
|
|
1523
1556
|
FilterForm,
|
|
1524
1557
|
{
|
|
@@ -1556,7 +1589,6 @@ const CriteriaBasedFilterEditionDialog = ({
|
|
|
1556
1589
|
onClose,
|
|
1557
1590
|
broadcastChannel,
|
|
1558
1591
|
getFilterById,
|
|
1559
|
-
saveFilter,
|
|
1560
1592
|
selectionForCopy,
|
|
1561
1593
|
setSelelectionForCopy,
|
|
1562
1594
|
activeDirectory,
|
|
@@ -1566,12 +1598,9 @@ const CriteriaBasedFilterEditionDialog = ({
|
|
|
1566
1598
|
var _a;
|
|
1567
1599
|
const { snackError } = useSnackMessage();
|
|
1568
1600
|
const [dataFetchStatus, setDataFetchStatus] = useState(FetchStatus.IDLE);
|
|
1569
|
-
const formMethods = {
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
}),
|
|
1573
|
-
language
|
|
1574
|
-
};
|
|
1601
|
+
const formMethods = useForm({
|
|
1602
|
+
resolver: yupResolver(formSchema)
|
|
1603
|
+
});
|
|
1575
1604
|
const {
|
|
1576
1605
|
reset,
|
|
1577
1606
|
formState: { errors }
|
|
@@ -1620,7 +1649,6 @@ const CriteriaBasedFilterEditionDialog = ({
|
|
|
1620
1649
|
id,
|
|
1621
1650
|
selectionForCopy.sourceItemUuid,
|
|
1622
1651
|
snackError,
|
|
1623
|
-
saveFilter,
|
|
1624
1652
|
setSelelectionForCopy
|
|
1625
1653
|
]
|
|
1626
1654
|
);
|
|
@@ -1637,6 +1665,7 @@ const CriteriaBasedFilterEditionDialog = ({
|
|
|
1637
1665
|
removeOptional: true,
|
|
1638
1666
|
disabledSave: !!nameError || !!isValidating,
|
|
1639
1667
|
isDataFetching: dataFetchStatus === FetchStatus.FETCHING,
|
|
1668
|
+
language,
|
|
1640
1669
|
children: isDataReady && /* @__PURE__ */ jsx(
|
|
1641
1670
|
FilterForm,
|
|
1642
1671
|
{
|
|
@@ -3,12 +3,12 @@ import Grid$1 from "@mui/material/Grid";
|
|
|
3
3
|
import { useMemo, useEffect } from "react";
|
|
4
4
|
import { useWatch, useFieldArray } from "react-hook-form";
|
|
5
5
|
import { FormattedMessage } from "react-intl";
|
|
6
|
-
import { Line, Hvdc, Substation, Load, Generator, TwoWindingTransfo, Battery, ShuntCompensator, VoltageLevel } from "../
|
|
6
|
+
import { Line, Hvdc, Substation, Load, Generator, TwoWindingTransfo, Battery, ShuntCompensator, VoltageLevel } from "../utils/equipment-types.js";
|
|
7
7
|
import { areArrayElementsUnique } from "../utils/functions.js";
|
|
8
|
-
import { FieldConstants } from "../
|
|
8
|
+
import { FieldConstants } from "../utils/field-constants.js";
|
|
9
9
|
import "../utils/yup-config.js";
|
|
10
|
-
import ErrorInput from "../components/react-hook-form/error-management/error-input.js";
|
|
11
|
-
import FieldErrorAlert from "../components/react-hook-form/error-management/field-error-alert.js";
|
|
10
|
+
import ErrorInput from "../components/inputs/react-hook-form/error-management/error-input.js";
|
|
11
|
+
import FieldErrorAlert from "../components/inputs/react-hook-form/error-management/field-error-alert.js";
|
|
12
12
|
import { Grid, ListItem, Button } from "@mui/material";
|
|
13
13
|
import FilterProperty, { PROPERTY_NAME, PROPERTY_VALUES_1, PROPERTY_VALUES_2, PROPERTY_VALUES } from "../components/filter/criteria-based/filter-property.js";
|
|
14
14
|
import { usePredefinedProperties } from "../hooks/predefined-properties-hook.js";
|
|
@@ -96,7 +96,8 @@ const DirectoryItemSelector = ({
|
|
|
96
96
|
}, [convertRoots, types, snackError, fetchRootFolders]);
|
|
97
97
|
const fetchDirectory = useCallback(
|
|
98
98
|
(nodeId) => {
|
|
99
|
-
|
|
99
|
+
const typeList = types.includes(ElementType.DIRECTORY) ? [] : types;
|
|
100
|
+
fetchDirectoryContent && fetchDirectoryContent(nodeId, typeList).then((children) => {
|
|
100
101
|
const childrenMatchedTypes = children.filter(
|
|
101
102
|
(item) => contentFilter().has(item.type)
|
|
102
103
|
);
|
|
@@ -1,16 +1,19 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
1
|
+
import { EquipmentInfos } from '../../index';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
|
|
4
|
+
interface ElementSearchDialogProps {
|
|
5
|
+
open: boolean;
|
|
6
|
+
onClose: () => void;
|
|
7
|
+
searchingLabel?: string;
|
|
8
|
+
searchTerm: string;
|
|
9
|
+
onSearchTermChange: (searchTerm: string) => void;
|
|
10
|
+
onSelectionChange: (selection: EquipmentInfos) => void;
|
|
11
|
+
elementsFound: EquipmentInfos[];
|
|
12
|
+
renderElement: (props: any) => ReactNode;
|
|
13
|
+
searchTermDisabled?: boolean;
|
|
14
|
+
searchTermDisableReason?: string;
|
|
15
|
+
isLoading: boolean;
|
|
16
|
+
loadingText?: string;
|
|
16
17
|
}
|
|
18
|
+
declare const ElementSearchDialog: (props: ElementSearchDialogProps) => import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
export default ElementSearchDialog;
|