@gridsuite/commons-ui 0.62.0 → 0.63.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/AuthenticationRouter/AuthenticationRouter.d.ts +21 -20
- package/dist/components/AuthenticationRouter/AuthenticationRouter.js +15 -13
- package/dist/components/AuthenticationRouter/index.d.ts +4 -7
- package/dist/components/AuthenticationRouter/index.js +2 -2
- package/dist/components/CardErrorBoundary/card-error-boundary.d.ts +0 -1
- package/dist/components/CardErrorBoundary/card-error-boundary.js +5 -3
- package/dist/components/CardErrorBoundary/index.d.ts +3 -7
- package/dist/components/CardErrorBoundary/index.js +2 -2
- package/dist/components/CustomAGGrid/custom-aggrid.js +1 -1
- package/dist/components/CustomAGGrid/custom-aggrid.style.js +5 -5
- package/dist/components/DirectoryItemSelector/directory-item-selector.d.ts +2 -3
- package/dist/components/DirectoryItemSelector/directory-item-selector.js +108 -105
- package/dist/components/ElementSearchDialog/element-search-dialog.d.ts +1 -1
- package/dist/components/ElementSearchDialog/element-search-dialog.js +2 -2
- package/dist/components/ElementSearchDialog/element-search-input.d.ts +1 -1
- package/dist/components/ElementSearchDialog/element-search-input.js +4 -6
- package/dist/components/ElementSearchDialog/equipment-item.d.ts +3 -3
- package/dist/components/ElementSearchDialog/equipment-item.js +13 -13
- package/dist/components/ElementSearchDialog/index.d.ts +3 -3
- package/dist/components/ElementSearchDialog/index.js +5 -5
- package/dist/components/ElementSearchDialog/tag-renderer.d.ts +11 -12
- package/dist/components/ElementSearchDialog/tag-renderer.js +5 -6
- package/dist/components/ElementSearchDialog/use-element-search.d.ts +2 -2
- package/dist/components/ElementSearchDialog/use-element-search.js +2 -2
- package/dist/components/ExpandableGroup/expandable-group.d.ts +3 -3
- package/dist/components/ExpandableGroup/expandable-group.js +6 -6
- package/dist/components/ExpandableGroup/index.d.ts +3 -7
- package/dist/components/ExpandableGroup/index.js +2 -2
- package/dist/components/FlatParameters/FlatParameters.d.ts +1 -1
- package/dist/components/FlatParameters/FlatParameters.js +46 -46
- package/dist/components/FlatParameters/index.d.ts +3 -7
- package/dist/components/Login/Login.d.ts +1 -7
- package/dist/components/Login/Login.js +3 -9
- package/dist/components/Login/Logout.d.ts +1 -1
- package/dist/components/Login/Logout.js +11 -11
- package/dist/components/Login/index.d.ts +3 -7
- package/dist/components/Login/index.js +2 -2
- package/dist/components/MuiVirtualizedTable/ColumnHeader.js +9 -8
- package/dist/components/MuiVirtualizedTable/KeyedColumnsRowIndexer.d.ts +24 -9
- package/dist/components/MuiVirtualizedTable/KeyedColumnsRowIndexer.js +200 -205
- package/dist/components/MuiVirtualizedTable/MuiVirtualizedTable.js +6 -6
- package/dist/components/MuiVirtualizedTable/index.d.ts +2 -2
- package/dist/components/MuiVirtualizedTable/index.js +3 -3
- package/dist/components/MultipleSelectionDialog/MultipleSelectionDialog.d.ts +1 -1
- package/dist/components/MultipleSelectionDialog/MultipleSelectionDialog.js +5 -15
- package/dist/components/MultipleSelectionDialog/index.d.ts +3 -7
- package/dist/components/MultipleSelectionDialog/index.js +2 -2
- package/dist/components/OverflowableText/index.d.ts +3 -7
- package/dist/components/OverflowableText/overflowable-text.js +2 -2
- package/dist/components/ReportViewer/filter-button.d.ts +1 -1
- package/dist/components/ReportViewer/filter-button.js +3 -3
- package/dist/components/ReportViewer/index.d.ts +3 -7
- package/dist/components/ReportViewer/index.js +2 -2
- package/dist/components/ReportViewer/log-report-item.d.ts +1 -1
- package/dist/components/ReportViewer/log-report-item.js +12 -9
- package/dist/components/ReportViewer/log-report.js +3 -3
- package/dist/components/ReportViewer/log-table.d.ts +2 -1
- package/dist/components/ReportViewer/log-table.js +6 -5
- package/dist/components/ReportViewer/multi-select-list.d.ts +1 -1
- package/dist/components/ReportViewer/multi-select-list.js +3 -3
- package/dist/components/ReportViewer/report-item.js +4 -3
- package/dist/components/ReportViewer/report-viewer.js +11 -12
- package/dist/components/ReportViewerDialog/index.d.ts +3 -7
- package/dist/components/ReportViewerDialog/index.js +2 -2
- package/dist/components/SignInCallbackHandler/SignInCallbackHandler.d.ts +2 -2
- package/dist/components/SignInCallbackHandler/SignInCallbackHandler.js +3 -3
- package/dist/components/SignInCallbackHandler/index.d.ts +3 -7
- package/dist/components/SignInCallbackHandler/index.js +2 -2
- package/dist/components/SilentRenewCallbackHandler/SilentRenewCallbackHandler.d.ts +2 -2
- package/dist/components/SilentRenewCallbackHandler/SilentRenewCallbackHandler.js +3 -3
- package/dist/components/SilentRenewCallbackHandler/index.d.ts +3 -7
- package/dist/components/SilentRenewCallbackHandler/index.js +2 -2
- package/dist/components/SnackbarProvider/SnackbarProvider.d.ts +1 -1
- package/dist/components/SnackbarProvider/SnackbarProvider.js +14 -13
- package/dist/components/SnackbarProvider/index.d.ts +3 -7
- package/dist/components/SnackbarProvider/index.js +2 -2
- package/dist/components/TopBar/AboutDialog.d.ts +2 -3
- package/dist/components/TopBar/AboutDialog.js +151 -153
- package/dist/components/TopBar/GridLogo.d.ts +2 -2
- package/dist/components/TopBar/GridLogo.js +24 -24
- package/dist/components/TopBar/TopBar.d.ts +5 -29
- package/dist/components/TopBar/TopBar.js +9 -33
- package/dist/components/TopBar/index.d.ts +1 -1
- package/dist/components/TopBar/index.js +1 -1
- package/dist/components/TreeViewFinder/TreeViewFinder.js +51 -45
- package/dist/components/TreeViewFinder/index.d.ts +1 -1
- package/dist/components/TreeViewFinder/index.js +1 -1
- package/dist/components/dialogs/custom-mui-dialog.d.ts +2 -2
- package/dist/components/dialogs/custom-mui-dialog.js +5 -5
- package/dist/components/dialogs/description-modification-dialog.d.ts +7 -3
- package/dist/components/dialogs/description-modification-dialog.js +11 -5
- package/dist/components/dialogs/modify-element-selection.d.ts +1 -2
- package/dist/components/dialogs/modify-element-selection.js +21 -13
- package/dist/components/dialogs/popup-confirmation-dialog.d.ts +7 -3
- package/dist/components/dialogs/popup-confirmation-dialog.js +3 -6
- package/dist/components/filter/criteria-based/criteria-based-filter-edition-dialog.d.ts +4 -5
- package/dist/components/filter/criteria-based/criteria-based-filter-edition-dialog.js +123 -16
- package/dist/components/filter/criteria-based/criteria-based-filter-form.d.ts +1 -2
- package/dist/components/filter/criteria-based/criteria-based-filter-form.js +6 -5
- package/dist/components/filter/criteria-based/criteria-based-filter-utils.js +27 -20
- package/dist/components/filter/criteria-based/criteria-based-form.d.ts +1 -2
- package/dist/components/filter/criteria-based/criteria-based-form.js +17 -6
- package/dist/components/filter/criteria-based/filter-free-properties.d.ts +5 -3
- package/dist/components/filter/criteria-based/filter-free-properties.js +69 -13
- package/dist/components/filter/criteria-based/filter-properties.d.ts +1 -6
- package/dist/components/filter/criteria-based/filter-properties.js +124 -16
- package/dist/components/filter/criteria-based/filter-property.d.ts +1 -2
- package/dist/components/filter/criteria-based/filter-property.js +16 -16
- package/dist/components/filter/expert/expert-filter-constants.d.ts +1 -1
- package/dist/components/filter/expert/expert-filter-edition-dialog.d.ts +3 -4
- package/dist/components/filter/expert/expert-filter-edition-dialog.js +128 -15
- package/dist/components/filter/expert/expert-filter-form.d.ts +1 -2
- package/dist/components/filter/expert/expert-filter-form.js +141 -20
- package/dist/components/filter/expert/expert-filter-utils.d.ts +2 -2
- package/dist/components/filter/expert/expert-filter-utils.js +45 -46
- package/dist/components/filter/explicit-naming/explicit-naming-filter-edition-dialog.d.ts +3 -4
- package/dist/components/filter/explicit-naming/explicit-naming-filter-edition-dialog.js +136 -16
- package/dist/components/filter/explicit-naming/explicit-naming-filter-form.d.ts +4 -5
- package/dist/components/filter/explicit-naming/explicit-naming-filter-form.js +241 -24
- package/dist/components/filter/filter-creation-dialog.d.ts +3 -4
- package/dist/components/filter/filter-creation-dialog.js +125 -13
- package/dist/components/filter/filter-form.d.ts +4 -5
- package/dist/components/filter/filter-form.js +73 -14
- package/dist/components/filter/utils/filter-api.js +1 -1
- package/dist/components/filter/utils/filter-form-utils.js +1 -1
- package/dist/components/inputs/react-hook-form/ExpandingTextField.d.ts +1 -2
- package/dist/components/inputs/react-hook-form/ExpandingTextField.js +5 -5
- package/dist/components/inputs/react-hook-form/ag-grid-table/bottom-right-buttons.d.ts +1 -2
- package/dist/components/inputs/react-hook-form/ag-grid-table/bottom-right-buttons.js +102 -13
- package/dist/components/inputs/react-hook-form/ag-grid-table/cell-editors/numericEditor.d.ts +7 -6
- package/dist/components/inputs/react-hook-form/ag-grid-table/cell-editors/numericEditor.js +13 -15
- package/dist/components/inputs/react-hook-form/ag-grid-table/csv-uploader/csv-uploader.d.ts +7 -3
- package/dist/components/inputs/react-hook-form/ag-grid-table/csv-uploader/csv-uploader.js +220 -61
- package/dist/components/inputs/react-hook-form/ag-grid-table/custom-ag-grid-table.d.ts +1 -2
- package/dist/components/inputs/react-hook-form/ag-grid-table/custom-ag-grid-table.js +243 -11
- package/dist/components/inputs/react-hook-form/autocomplete-inputs/autocomplete-input.d.ts +4 -2
- package/dist/components/inputs/react-hook-form/autocomplete-inputs/autocomplete-input.js +12 -12
- package/dist/components/inputs/react-hook-form/autocomplete-inputs/multiple-autocomplete-input.d.ts +1 -1
- package/dist/components/inputs/react-hook-form/autocomplete-inputs/multiple-autocomplete-input.js +2 -2
- package/dist/components/inputs/react-hook-form/booleans/boolean-input.d.ts +1 -1
- package/dist/components/inputs/react-hook-form/booleans/boolean-input.js +2 -2
- package/dist/components/inputs/react-hook-form/booleans/checkbox-input.d.ts +1 -1
- package/dist/components/inputs/react-hook-form/booleans/checkbox-input.js +3 -3
- package/dist/components/inputs/react-hook-form/booleans/switch-input.d.ts +1 -1
- package/dist/components/inputs/react-hook-form/booleans/switch-input.js +3 -3
- package/dist/components/inputs/react-hook-form/directory-items-input.d.ts +11 -3
- package/dist/components/inputs/react-hook-form/directory-items-input.js +11 -11
- package/dist/components/inputs/react-hook-form/error-management/error-input.d.ts +2 -2
- package/dist/components/inputs/react-hook-form/error-management/error-input.js +7 -9
- package/dist/components/inputs/react-hook-form/error-management/field-error-alert.d.ts +2 -2
- package/dist/components/inputs/react-hook-form/error-management/field-error-alert.js +2 -4
- package/dist/components/inputs/react-hook-form/error-management/mid-form-error.d.ts +2 -2
- package/dist/components/inputs/react-hook-form/error-management/mid-form-error.js +2 -2
- package/dist/components/inputs/react-hook-form/numbers/float-input.d.ts +1 -2
- package/dist/components/inputs/react-hook-form/numbers/float-input.js +6 -5
- package/dist/components/inputs/react-hook-form/numbers/integer-input.d.ts +1 -1
- package/dist/components/inputs/react-hook-form/numbers/integer-input.js +5 -5
- package/dist/components/inputs/react-hook-form/provider/custom-form-provider.d.ts +1 -1
- package/dist/components/inputs/react-hook-form/provider/custom-form-provider.js +11 -8
- package/dist/components/inputs/react-hook-form/provider/use-custom-form-context.d.ts +2 -1
- package/dist/components/inputs/react-hook-form/provider/use-custom-form-context.js +1 -1
- package/dist/components/inputs/react-hook-form/radio-input.d.ts +1 -1
- package/dist/components/inputs/react-hook-form/radio-input.js +2 -8
- package/dist/components/inputs/react-hook-form/range-input.d.ts +1 -2
- package/dist/components/inputs/react-hook-form/range-input.js +5 -5
- package/dist/components/inputs/react-hook-form/raw-read-only-input.d.ts +2 -1
- package/dist/components/inputs/react-hook-form/raw-read-only-input.js +1 -1
- package/dist/components/inputs/react-hook-form/select-inputs/countries-input.d.ts +1 -3
- package/dist/components/inputs/react-hook-form/select-inputs/countries-input.js +4 -8
- package/dist/components/inputs/react-hook-form/select-inputs/input-with-popup-confirmation.d.ts +3 -1
- package/dist/components/inputs/react-hook-form/select-inputs/input-with-popup-confirmation.js +4 -4
- package/dist/components/inputs/react-hook-form/select-inputs/mui-select-input.d.ts +1 -2
- package/dist/components/inputs/react-hook-form/select-inputs/mui-select-input.js +11 -10
- package/dist/components/inputs/react-hook-form/select-inputs/select-input.d.ts +1 -2
- package/dist/components/inputs/react-hook-form/select-inputs/select-input.js +16 -8
- package/dist/components/inputs/react-hook-form/slider-input.d.ts +1 -1
- package/dist/components/inputs/react-hook-form/slider-input.js +6 -6
- package/dist/components/inputs/react-hook-form/text-input.d.ts +6 -2
- package/dist/components/inputs/react-hook-form/text-input.js +9 -9
- package/dist/components/inputs/react-hook-form/unique-name-input.d.ts +4 -6
- package/dist/components/inputs/react-hook-form/unique-name-input.js +12 -12
- package/dist/components/inputs/react-hook-form/utils/cancel-button.d.ts +9 -10
- package/dist/components/inputs/react-hook-form/utils/cancel-button.js +2 -6
- package/dist/components/inputs/react-hook-form/utils/field-label.d.ts +1 -1
- package/dist/components/inputs/react-hook-form/utils/field-label.js +3 -3
- package/dist/components/inputs/react-hook-form/utils/functions.js +1 -1
- package/dist/components/inputs/react-hook-form/utils/submit-button.d.ts +9 -10
- package/dist/components/inputs/react-hook-form/utils/submit-button.js +2 -6
- package/dist/components/inputs/react-hook-form/utils/text-field-with-adornment.d.ts +1 -2
- package/dist/components/inputs/react-hook-form/utils/text-field-with-adornment.js +7 -7
- package/dist/components/inputs/react-query-builder/add-button.d.ts +1 -2
- package/dist/components/inputs/react-query-builder/add-button.js +13 -10
- package/dist/components/inputs/react-query-builder/combinator-selector.d.ts +1 -2
- package/dist/components/inputs/react-query-builder/combinator-selector.js +7 -6
- package/dist/components/inputs/react-query-builder/composite-rule-editor/group-value-editor.d.ts +1 -1
- package/dist/components/inputs/react-query-builder/composite-rule-editor/group-value-editor.js +2 -2
- package/dist/components/inputs/react-query-builder/composite-rule-editor/rule-value-editor.d.ts +1 -1
- package/dist/components/inputs/react-query-builder/composite-rule-editor/rule-value-editor.js +5 -5
- package/dist/components/inputs/react-query-builder/country-value-editor.d.ts +1 -2
- package/dist/components/inputs/react-query-builder/country-value-editor.js +18 -18
- package/dist/components/inputs/react-query-builder/custom-react-query-builder.d.ts +1 -1
- package/dist/components/inputs/react-query-builder/custom-react-query-builder.js +92 -19
- package/dist/components/inputs/react-query-builder/element-value-editor.d.ts +7 -3
- package/dist/components/inputs/react-query-builder/element-value-editor.js +50 -62
- package/dist/components/inputs/react-query-builder/property-value-editor.d.ts +1 -2
- package/dist/components/inputs/react-query-builder/property-value-editor.js +5 -5
- package/dist/components/inputs/react-query-builder/remove-button.d.ts +1 -2
- package/dist/components/inputs/react-query-builder/remove-button.js +26 -7
- package/dist/components/inputs/react-query-builder/text-value-editor.d.ts +1 -2
- package/dist/components/inputs/react-query-builder/text-value-editor.js +17 -17
- package/dist/components/inputs/react-query-builder/translated-value-editor.d.ts +1 -2
- package/dist/components/inputs/react-query-builder/translated-value-editor.js +22 -26
- package/dist/components/inputs/react-query-builder/value-editor.d.ts +1 -2
- package/dist/components/inputs/react-query-builder/value-editor.js +119 -18
- package/dist/components/inputs/react-query-builder/value-selector.d.ts +1 -1
- package/dist/components/inputs/react-query-builder/value-selector.js +2 -2
- package/dist/components/inputs/select-clearable.d.ts +1 -2
- package/dist/components/inputs/select-clearable.js +6 -5
- package/dist/components/translations/card-error-boundary-en.d.ts +2 -2
- package/dist/components/translations/card-error-boundary-en.js +2 -2
- package/dist/components/translations/card-error-boundary-fr.d.ts +2 -2
- package/dist/components/translations/card-error-boundary-fr.js +2 -2
- package/dist/components/translations/common-button-en.d.ts +2 -2
- package/dist/components/translations/common-button-en.js +2 -2
- package/dist/components/translations/common-button-fr.d.ts +2 -2
- package/dist/components/translations/common-button-fr.js +2 -2
- package/dist/components/translations/directory-items-input-en.d.ts +2 -2
- package/dist/components/translations/directory-items-input-en.js +2 -2
- package/dist/components/translations/directory-items-input-fr.d.ts +2 -2
- package/dist/components/translations/directory-items-input-fr.js +2 -2
- package/dist/components/translations/element-search-en.d.ts +2 -2
- package/dist/components/translations/element-search-en.js +2 -2
- package/dist/components/translations/element-search-fr.d.ts +2 -2
- package/dist/components/translations/element-search-fr.js +2 -2
- package/dist/components/translations/equipment-search-en.d.ts +2 -2
- package/dist/components/translations/equipment-search-en.js +2 -2
- package/dist/components/translations/equipment-search-fr.d.ts +2 -2
- package/dist/components/translations/equipment-search-fr.js +2 -2
- package/dist/components/translations/filter-en.d.ts +3 -2
- package/dist/components/translations/filter-en.js +3 -2
- package/dist/components/translations/filter-expert-en.d.ts +2 -2
- package/dist/components/translations/filter-expert-en.js +2 -2
- package/dist/components/translations/filter-expert-fr.d.ts +2 -2
- package/dist/components/translations/filter-expert-fr.js +2 -2
- package/dist/components/translations/filter-fr.d.ts +3 -2
- package/dist/components/translations/filter-fr.js +3 -2
- package/dist/components/translations/flat-parameters-en.d.ts +2 -2
- package/dist/components/translations/flat-parameters-en.js +2 -2
- package/dist/components/translations/flat-parameters-fr.d.ts +2 -2
- package/dist/components/translations/flat-parameters-fr.js +2 -2
- package/dist/components/translations/inputs-en.d.ts +2 -2
- package/dist/components/translations/inputs-en.js +2 -2
- package/dist/components/translations/inputs-fr.d.ts +2 -2
- package/dist/components/translations/inputs-fr.js +2 -2
- package/dist/components/translations/login-en.d.ts +2 -2
- package/dist/components/translations/login-en.js +2 -2
- package/dist/components/translations/login-fr.d.ts +2 -2
- package/dist/components/translations/login-fr.js +2 -2
- package/dist/components/translations/multiple-selection-dialog-en.d.ts +2 -2
- package/dist/components/translations/multiple-selection-dialog-en.js +2 -2
- package/dist/components/translations/multiple-selection-dialog-fr.d.ts +2 -2
- package/dist/components/translations/multiple-selection-dialog-fr.js +2 -2
- package/dist/components/translations/report-viewer-en.d.ts +2 -2
- package/dist/components/translations/report-viewer-en.js +2 -2
- package/dist/components/translations/report-viewer-fr.d.ts +2 -2
- package/dist/components/translations/report-viewer-fr.js +2 -2
- package/dist/components/translations/table-en.d.ts +2 -2
- package/dist/components/translations/table-en.js +2 -2
- package/dist/components/translations/table-fr.d.ts +2 -2
- package/dist/components/translations/table-fr.js +2 -2
- package/dist/components/translations/top-bar-en.d.ts +2 -2
- package/dist/components/translations/top-bar-en.js +2 -2
- package/dist/components/translations/top-bar-fr.d.ts +2 -2
- package/dist/components/translations/top-bar-fr.js +2 -2
- package/dist/components/translations/treeview-finder-en.d.ts +2 -2
- package/dist/components/translations/treeview-finder-en.js +2 -2
- package/dist/components/translations/treeview-finder-fr.d.ts +2 -2
- package/dist/components/translations/treeview-finder-fr.js +2 -2
- package/dist/hooks/localized-countries-hook.js +1 -1
- package/dist/hooks/predefined-properties-hook.d.ts +2 -1
- package/dist/hooks/predefined-properties-hook.js +2 -2
- package/dist/hooks/useDebounce.d.ts +2 -1
- package/dist/hooks/useDebounce.js +1 -1
- package/dist/hooks/useIntlRef.d.ts +2 -1
- package/dist/hooks/useIntlRef.js +1 -1
- package/dist/hooks/useSnackMessage.d.ts +2 -2
- package/dist/hooks/useSnackMessage.js +36 -36
- package/dist/index.d.ts +19 -16
- package/dist/index.js +164 -158
- package/dist/redux/authActions.d.ts +56 -0
- package/dist/redux/commonStore.d.ts +4 -3
- package/dist/redux/commonStore.js +2 -1
- package/dist/services/apps-metadata.js +1 -1
- package/dist/services/directory.js +6 -6
- package/dist/services/explore.js +14 -12
- package/dist/services/index.d.ts +0 -5
- package/dist/services/study.js +2 -2
- package/dist/services/utils.d.ts +1 -1
- package/dist/services/utils.js +26 -26
- package/dist/utils/AuthService.d.ts +9 -8
- package/dist/utils/AuthService.js +77 -76
- package/dist/utils/ElementIcon.d.ts +3 -2
- package/dist/utils/ElementIcon.js +4 -3
- package/dist/utils/ElementType.d.ts +3 -6
- package/dist/utils/EquipmentType.js +3 -3
- package/dist/utils/FetchStatus.d.ts +2 -1
- package/dist/utils/FetchStatus.js +1 -1
- package/dist/utils/Metadata.d.ts +15 -0
- package/dist/utils/Metadata.js +1 -0
- package/dist/utils/UserManagerMock.d.ts +50 -25
- package/dist/utils/UserManagerMock.js +118 -11
- package/dist/utils/algos.d.ts +2 -1
- package/dist/utils/algos.js +2 -2
- package/dist/utils/equipment-types-for-predefined-properties-mapper.d.ts +2 -1
- package/dist/utils/equipment-types-for-predefined-properties-mapper.js +3 -1
- package/dist/utils/field-constants.d.ts +2 -1
- package/dist/utils/field-constants.js +1 -1
- package/dist/utils/functions.js +5 -2
- package/dist/utils/types.d.ts +1 -1
- package/dist/utils/yup-config.js +1 -2
- package/package.json +10 -4
- package/dist/chunks/criteria-based-filter-edition-dialog.CAT38SvB.js +0 -1694
- package/dist/chunks/filter-properties.B7-q_yPf.js +0 -195
- package/dist/redux/actions.d.ts +0 -54
- /package/dist/assets/{criteria-based-filter-edition-dialog.css → expert-filter-form.css} +0 -0
- /package/dist/redux/{actions.js → authActions.js} +0 -0
|
@@ -1,1694 +0,0 @@
|
|
|
1
|
-
import '../assets/criteria-based-filter-edition-dialog.css';
|
|
2
|
-
import { jsxs, Fragment, jsx } from "react/jsx-runtime";
|
|
3
|
-
import React, { useState, useMemo, useEffect, useCallback } from "react";
|
|
4
|
-
import { FieldConstants } from "../utils/field-constants.js";
|
|
5
|
-
import { backToFrontTweak, frontToBackTweak } from "../components/filter/criteria-based/criteria-based-filter-utils.js";
|
|
6
|
-
import CustomMuiDialog from "../components/dialogs/custom-mui-dialog.js";
|
|
7
|
-
import { useSnackMessage } from "../hooks/useSnackMessage.js";
|
|
8
|
-
import { useWatch, useFormContext, useFieldArray, useController, useForm } from "react-hook-form";
|
|
9
|
-
import { yupResolver } from "@hookform/resolvers/yup";
|
|
10
|
-
import CriteriaBasedFilterForm, { criteriaBasedFilterEmptyFormData, criteriaBasedFilterSchema } from "../components/filter/criteria-based/criteria-based-filter-form.js";
|
|
11
|
-
import "../utils/yup-config.js";
|
|
12
|
-
import { UniqueNameInput } from "../components/inputs/react-hook-form/unique-name-input.js";
|
|
13
|
-
import { AgGridReact } from "ag-grid-react";
|
|
14
|
-
import "ag-grid-community/styles/ag-grid.css";
|
|
15
|
-
import "ag-grid-community/styles/ag-theme-alpine.css";
|
|
16
|
-
import { DialogContentText, Grid as Grid$1, Tooltip, useTheme } from "@mui/material";
|
|
17
|
-
import IconButton from "@mui/material/IconButton";
|
|
18
|
-
import { Upload, ArrowCircleUp, ArrowCircleDown } from "@mui/icons-material";
|
|
19
|
-
import AddIcon from "@mui/icons-material/ControlPoint";
|
|
20
|
-
import DeleteIcon from "@mui/icons-material/Delete";
|
|
21
|
-
import Dialog from "@mui/material/Dialog";
|
|
22
|
-
import DialogTitle from "@mui/material/DialogTitle";
|
|
23
|
-
import DialogContent from "@mui/material/DialogContent";
|
|
24
|
-
import DialogActions from "@mui/material/DialogActions";
|
|
25
|
-
import { useCSVReader } from "react-papaparse";
|
|
26
|
-
import Button from "@mui/material/Button";
|
|
27
|
-
import Grid from "@mui/material/Grid";
|
|
28
|
-
import { useIntl, FormattedMessage } from "react-intl";
|
|
29
|
-
import CsvDownloader from "react-csv-downloader";
|
|
30
|
-
import Alert from "@mui/material/Alert";
|
|
31
|
-
import "../components/TreeViewFinder/TreeViewFinder.js";
|
|
32
|
-
import "../components/TopBar/TopBar.js";
|
|
33
|
-
import "@mui/lab";
|
|
34
|
-
import "notistack";
|
|
35
|
-
import "react-router-dom";
|
|
36
|
-
import "../utils/AuthService.js";
|
|
37
|
-
import "../components/MuiVirtualizedTable/MuiVirtualizedTable.js";
|
|
38
|
-
import "../components/ReportViewer/report-item.js";
|
|
39
|
-
import { v4, validate } from "uuid";
|
|
40
|
-
import "../components/ReportViewer/log-table.js";
|
|
41
|
-
import "../components/ReportViewer/report-tree-view-context.js";
|
|
42
|
-
import "@mui/x-tree-view";
|
|
43
|
-
import "../components/OverflowableText/overflowable-text.js";
|
|
44
|
-
import "clsx";
|
|
45
|
-
import "../components/inputs/react-hook-form/utils/submit-button.js";
|
|
46
|
-
import CancelButton from "../components/inputs/react-hook-form/utils/cancel-button.js";
|
|
47
|
-
import "../components/inputs/react-hook-form/provider/custom-form-provider.js";
|
|
48
|
-
import "../components/dialogs/description-modification-dialog.js";
|
|
49
|
-
import * as yup from "yup";
|
|
50
|
-
import "../components/dialogs/popup-confirmation-dialog.js";
|
|
51
|
-
import "autosuggest-highlight/match";
|
|
52
|
-
import "autosuggest-highlight/parse";
|
|
53
|
-
import "../components/CardErrorBoundary/card-error-boundary.js";
|
|
54
|
-
import "@mui/icons-material/Folder";
|
|
55
|
-
import "../components/CustomAGGrid/custom-aggrid.js";
|
|
56
|
-
import { saveExplicitNamingFilter, saveCriteriaBasedFilter, saveExpertFilter } from "../components/filter/utils/filter-api.js";
|
|
57
|
-
import { formatQuery, QueryBuilder } from "react-querybuilder";
|
|
58
|
-
import { getNumberOfSiblings, recursiveRemove, countRules, getOperators, queryValidator, testQuery, importExpertRules } from "../components/filter/expert/expert-filter-utils.js";
|
|
59
|
-
import { OPERATOR_OPTIONS, COMBINATOR_OPTIONS, RULES, EXPERT_FILTER_EQUIPMENTS, fields } from "../components/filter/expert/expert-filter-constants.js";
|
|
60
|
-
import { FieldType, DataType } from "../components/filter/expert/expert-filter.type.js";
|
|
61
|
-
import { QueryBuilderDnD } from "@react-querybuilder/dnd";
|
|
62
|
-
import * as ReactDnD from "react-dnd";
|
|
63
|
-
import * as ReactDndHtml5Backend from "react-dnd-html5-backend";
|
|
64
|
-
import { MaterialValueEditor, QueryBuilderMaterial } from "@react-querybuilder/material";
|
|
65
|
-
import CombinatorSelector from "../components/inputs/react-query-builder/combinator-selector.js";
|
|
66
|
-
import AddButton from "../components/inputs/react-query-builder/add-button.js";
|
|
67
|
-
import CountryValueEditor from "../components/inputs/react-query-builder/country-value-editor.js";
|
|
68
|
-
import TranslatedValueEditor from "../components/inputs/react-query-builder/translated-value-editor.js";
|
|
69
|
-
import TextValueEditor from "../components/inputs/react-query-builder/text-value-editor.js";
|
|
70
|
-
import Box from "@mui/material/Box";
|
|
71
|
-
import { Generator, Load, VoltageLevel, Substation, noSelectionForCopy as noSelectionForCopy$1 } from "../utils/equipment-types.js";
|
|
72
|
-
import { fetchElementsInfos, saveFilter } from "../services/explore.js";
|
|
73
|
-
import { useCustomFormContext } from "../components/inputs/react-hook-form/provider/use-custom-form-context.js";
|
|
74
|
-
import DirectoryItemsInput from "../components/inputs/react-hook-form/directory-items-input.js";
|
|
75
|
-
import { DISTRIBUTION_KEY, FilterType } from "../components/filter/constants/filter-constants.js";
|
|
76
|
-
import { FetchStatus } from "../utils/FetchStatus.js";
|
|
77
|
-
import PropTypes from "prop-types";
|
|
78
|
-
import "./filter-properties.B7-q_yPf.js";
|
|
79
|
-
import "../components/inputs/react-hook-form/range-input.js";
|
|
80
|
-
import "../components/inputs/react-hook-form/select-inputs/mui-select-input.js";
|
|
81
|
-
import "localized-countries";
|
|
82
|
-
import "localized-countries/data/fr";
|
|
83
|
-
import "localized-countries/data/en";
|
|
84
|
-
import { RECORD_SEP, UNIT_SEP } from "papaparse";
|
|
85
|
-
import "@mui/icons-material/Check";
|
|
86
|
-
import "@mui/material/CircularProgress";
|
|
87
|
-
import "@mui/material/TextField";
|
|
88
|
-
import { FILTER_EQUIPMENTS } from "../components/filter/utils/filter-form-utils.js";
|
|
89
|
-
import { ElementType } from "../utils/ElementType.js";
|
|
90
|
-
import PropertyValueEditor from "../components/inputs/react-query-builder/property-value-editor.js";
|
|
91
|
-
import GroupValueEditor from "../components/inputs/react-query-builder/composite-rule-editor/group-value-editor.js";
|
|
92
|
-
import ValueSelector from "../components/inputs/react-query-builder/value-selector.js";
|
|
93
|
-
import ErrorInput from "../components/inputs/react-hook-form/error-management/error-input.js";
|
|
94
|
-
import FieldErrorAlert from "../components/inputs/react-hook-form/error-management/field-error-alert.js";
|
|
95
|
-
import InputWithPopupConfirmation from "../components/inputs/react-hook-form/select-inputs/input-with-popup-confirmation.js";
|
|
96
|
-
import SelectInput from "../components/inputs/react-hook-form/select-inputs/select-input.js";
|
|
97
|
-
import { styled } from "@mui/material/styles";
|
|
98
|
-
import { NumericEditor } from "../components/inputs/react-hook-form/ag-grid-table/cell-editors/numericEditor.js";
|
|
99
|
-
import { toFloatOrNullValue } from "../components/inputs/react-hook-form/utils/functions.js";
|
|
100
|
-
import ModifyElementSelection from "../components/dialogs/modify-element-selection.js";
|
|
101
|
-
import { exportFilter } from "../services/study.js";
|
|
102
|
-
import ExpandableGroup from "../components/ExpandableGroup/expandable-group.js";
|
|
103
|
-
import RadioInput from "../components/inputs/react-hook-form/radio-input.js";
|
|
104
|
-
import ExpandingTextField from "../components/inputs/react-hook-form/ExpandingTextField.js";
|
|
105
|
-
const CsvUploader = ({
|
|
106
|
-
name,
|
|
107
|
-
onClose,
|
|
108
|
-
open,
|
|
109
|
-
title,
|
|
110
|
-
fileHeaders,
|
|
111
|
-
fileName,
|
|
112
|
-
csvData,
|
|
113
|
-
validateData = (_rows) => true,
|
|
114
|
-
getDataFromCsv,
|
|
115
|
-
useFieldArrayOutput
|
|
116
|
-
}) => {
|
|
117
|
-
const watchTableValues = useWatch({ name });
|
|
118
|
-
const { append, replace } = useFieldArrayOutput;
|
|
119
|
-
const [createError, setCreateError] = React.useState("");
|
|
120
|
-
const intl = useIntl();
|
|
121
|
-
const { CSVReader } = useCSVReader();
|
|
122
|
-
const [importedData, setImportedData] = useState([]);
|
|
123
|
-
const [isConfirmationPopupOpen, setOpenConfirmationPopup] = useState(false);
|
|
124
|
-
const data = useMemo(() => {
|
|
125
|
-
const data2 = [...[fileHeaders]];
|
|
126
|
-
if (Array.isArray(csvData)) {
|
|
127
|
-
csvData.forEach((row) => data2.push([row]));
|
|
128
|
-
}
|
|
129
|
-
return data2;
|
|
130
|
-
}, [csvData, fileHeaders]);
|
|
131
|
-
const handleClose = () => {
|
|
132
|
-
onClose();
|
|
133
|
-
setCreateError("");
|
|
134
|
-
};
|
|
135
|
-
const validateCsvFile = (rows) => {
|
|
136
|
-
if (rows.length === 0) {
|
|
137
|
-
setCreateError(intl.formatMessage({ id: "noDataInCsvFile" }));
|
|
138
|
-
return false;
|
|
139
|
-
}
|
|
140
|
-
for (let i = 0; i < fileHeaders.length; i++) {
|
|
141
|
-
if (fileHeaders[i] !== "" && rows[0][i] !== fileHeaders[i]) {
|
|
142
|
-
setCreateError(
|
|
143
|
-
intl.formatMessage({ id: "wrongCsvHeadersError" })
|
|
144
|
-
);
|
|
145
|
-
return false;
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
return validateData(rows);
|
|
149
|
-
};
|
|
150
|
-
const getResultsFromImportedData = () => {
|
|
151
|
-
return importedData.filter((row) => {
|
|
152
|
-
if (row[0].startsWith("#")) {
|
|
153
|
-
return false;
|
|
154
|
-
}
|
|
155
|
-
return row.some((column) => !!(column == null ? void 0 : column.trim()));
|
|
156
|
-
});
|
|
157
|
-
};
|
|
158
|
-
const handleFileSubmit = (keepTableValues) => {
|
|
159
|
-
if (importedData.length !== 0) {
|
|
160
|
-
const result = getResultsFromImportedData();
|
|
161
|
-
if (validateCsvFile(result)) {
|
|
162
|
-
result.splice(0, 1);
|
|
163
|
-
const dataFromCsv = getDataFromCsv(result);
|
|
164
|
-
if (keepTableValues) {
|
|
165
|
-
append(dataFromCsv);
|
|
166
|
-
} else {
|
|
167
|
-
replace(dataFromCsv);
|
|
168
|
-
}
|
|
169
|
-
handleClose();
|
|
170
|
-
}
|
|
171
|
-
} else {
|
|
172
|
-
setCreateError(intl.formatMessage({ id: "noDataInCsvFile" }));
|
|
173
|
-
}
|
|
174
|
-
};
|
|
175
|
-
const handleOpenCSVConfirmationDataDialog = () => {
|
|
176
|
-
const isValuesInTable = Array.isArray(watchTableValues) && watchTableValues.some(
|
|
177
|
-
(val) => val && Object.keys(val).filter(
|
|
178
|
-
(key) => key !== FieldConstants.AG_GRID_ROW_UUID
|
|
179
|
-
).some(
|
|
180
|
-
(e) => val[e] !== void 0 && val[e] !== null && String(val[e]).trim().length > 0
|
|
181
|
-
)
|
|
182
|
-
);
|
|
183
|
-
if (isValuesInTable && getResultsFromImportedData().length > 0) {
|
|
184
|
-
setOpenConfirmationPopup(true);
|
|
185
|
-
} else {
|
|
186
|
-
setOpenConfirmationPopup(false);
|
|
187
|
-
handleFileSubmit(false);
|
|
188
|
-
}
|
|
189
|
-
};
|
|
190
|
-
const handleAddPopupConfirmation = () => {
|
|
191
|
-
handleFileSubmit(true);
|
|
192
|
-
setOpenConfirmationPopup(false);
|
|
193
|
-
};
|
|
194
|
-
const handleReplacePopupConfirmation = () => {
|
|
195
|
-
handleFileSubmit(false);
|
|
196
|
-
setOpenConfirmationPopup(false);
|
|
197
|
-
};
|
|
198
|
-
const handleCancelDialog = () => {
|
|
199
|
-
setOpenConfirmationPopup(false);
|
|
200
|
-
};
|
|
201
|
-
const renderConfirmationCsvData = () => {
|
|
202
|
-
return /* @__PURE__ */ jsxs(
|
|
203
|
-
Dialog,
|
|
204
|
-
{
|
|
205
|
-
open: isConfirmationPopupOpen,
|
|
206
|
-
"aria-labelledby": "dialog-confirmation-csv-data",
|
|
207
|
-
children: [
|
|
208
|
-
/* @__PURE__ */ jsx(DialogTitle, { id: "dialog-confirmation-csv-data", children: "Confirmation" }),
|
|
209
|
-
/* @__PURE__ */ jsx(DialogContent, { children: /* @__PURE__ */ jsx(DialogContentText, { children: intl.formatMessage({ id: "keepCSVDataMessage" }) }) }),
|
|
210
|
-
/* @__PURE__ */ jsxs(DialogActions, { children: [
|
|
211
|
-
/* @__PURE__ */ jsx(CancelButton, { onClick: handleCancelDialog }),
|
|
212
|
-
/* @__PURE__ */ jsx(
|
|
213
|
-
Button,
|
|
214
|
-
{
|
|
215
|
-
onClick: () => handleReplacePopupConfirmation(),
|
|
216
|
-
variant: "outlined",
|
|
217
|
-
children: /* @__PURE__ */ jsx(FormattedMessage, { id: "replace" })
|
|
218
|
-
}
|
|
219
|
-
),
|
|
220
|
-
/* @__PURE__ */ jsx(
|
|
221
|
-
Button,
|
|
222
|
-
{
|
|
223
|
-
onClick: () => handleAddPopupConfirmation(),
|
|
224
|
-
variant: "outlined",
|
|
225
|
-
children: /* @__PURE__ */ jsx(FormattedMessage, { id: "add" })
|
|
226
|
-
}
|
|
227
|
-
)
|
|
228
|
-
] })
|
|
229
|
-
]
|
|
230
|
-
}
|
|
231
|
-
);
|
|
232
|
-
};
|
|
233
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
234
|
-
/* @__PURE__ */ jsxs(Dialog, { open, onClose: handleClose, fullWidth: true, children: [
|
|
235
|
-
/* @__PURE__ */ jsx(DialogTitle, { children: title }),
|
|
236
|
-
/* @__PURE__ */ jsx(DialogContent, { children: /* @__PURE__ */ jsxs("div", { children: [
|
|
237
|
-
/* @__PURE__ */ jsxs(Grid, { container: true, spacing: 2, children: [
|
|
238
|
-
/* @__PURE__ */ jsx(Grid, { container: true, item: true, children: /* @__PURE__ */ jsx(Grid, { item: true, xs: 6, children: /* @__PURE__ */ jsx(
|
|
239
|
-
CsvDownloader,
|
|
240
|
-
{
|
|
241
|
-
datas: data,
|
|
242
|
-
filename: fileName,
|
|
243
|
-
separator: ",",
|
|
244
|
-
children: /* @__PURE__ */ jsx(Button, { variant: "contained", children: /* @__PURE__ */ jsx(FormattedMessage, { id: "GenerateCSV" }) })
|
|
245
|
-
}
|
|
246
|
-
) }) }),
|
|
247
|
-
/* @__PURE__ */ jsx(Grid, { container: true, item: true, spacing: 3, children: /* @__PURE__ */ jsx(
|
|
248
|
-
CSVReader,
|
|
249
|
-
{
|
|
250
|
-
onUploadAccepted: (results) => {
|
|
251
|
-
setImportedData([...results.data]);
|
|
252
|
-
setCreateError("");
|
|
253
|
-
},
|
|
254
|
-
config: {
|
|
255
|
-
// We use | for multi values in one cell, then we remove it from the default value for this config, to avoid delimiter autodetection
|
|
256
|
-
delimitersToGuess: [
|
|
257
|
-
",",
|
|
258
|
-
" ",
|
|
259
|
-
";",
|
|
260
|
-
RECORD_SEP,
|
|
261
|
-
UNIT_SEP
|
|
262
|
-
]
|
|
263
|
-
},
|
|
264
|
-
children: ({ getRootProps, acceptedFile }) => /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs(Grid, { item: true, children: [
|
|
265
|
-
/* @__PURE__ */ jsx(
|
|
266
|
-
Button,
|
|
267
|
-
{
|
|
268
|
-
...getRootProps(),
|
|
269
|
-
variant: "contained",
|
|
270
|
-
children: /* @__PURE__ */ jsx(FormattedMessage, { id: "UploadCSV" })
|
|
271
|
-
}
|
|
272
|
-
),
|
|
273
|
-
/* @__PURE__ */ jsx(
|
|
274
|
-
"span",
|
|
275
|
-
{
|
|
276
|
-
style: {
|
|
277
|
-
marginLeft: "10px",
|
|
278
|
-
fontWeight: "bold"
|
|
279
|
-
},
|
|
280
|
-
children: acceptedFile ? acceptedFile.name : intl.formatMessage({
|
|
281
|
-
id: "uploadMessage"
|
|
282
|
-
})
|
|
283
|
-
}
|
|
284
|
-
)
|
|
285
|
-
] }) })
|
|
286
|
-
}
|
|
287
|
-
) })
|
|
288
|
-
] }),
|
|
289
|
-
createError !== "" && /* @__PURE__ */ jsx(Alert, { severity: "error", children: createError })
|
|
290
|
-
] }) }),
|
|
291
|
-
/* @__PURE__ */ jsxs(DialogActions, { children: [
|
|
292
|
-
/* @__PURE__ */ jsx(CancelButton, { onClick: handleClose }),
|
|
293
|
-
/* @__PURE__ */ jsx(
|
|
294
|
-
Button,
|
|
295
|
-
{
|
|
296
|
-
variant: "outlined",
|
|
297
|
-
onClick: () => handleOpenCSVConfirmationDataDialog(),
|
|
298
|
-
disabled: createError !== "",
|
|
299
|
-
children: /* @__PURE__ */ jsx(FormattedMessage, { id: "validate" })
|
|
300
|
-
}
|
|
301
|
-
)
|
|
302
|
-
] })
|
|
303
|
-
] }),
|
|
304
|
-
renderConfirmationCsvData()
|
|
305
|
-
] });
|
|
306
|
-
};
|
|
307
|
-
const InnerColoredButton = styled(IconButton)(({ theme }) => {
|
|
308
|
-
return {
|
|
309
|
-
color: theme.palette.primary.main
|
|
310
|
-
};
|
|
311
|
-
});
|
|
312
|
-
const BottomRightButtons = ({
|
|
313
|
-
name,
|
|
314
|
-
disableUp,
|
|
315
|
-
disableDown,
|
|
316
|
-
disableDelete,
|
|
317
|
-
handleAddRow,
|
|
318
|
-
handleDeleteRows,
|
|
319
|
-
handleMoveRowUp,
|
|
320
|
-
handleMoveRowDown,
|
|
321
|
-
useFieldArrayOutput,
|
|
322
|
-
csvProps
|
|
323
|
-
}) => {
|
|
324
|
-
const [uploaderOpen, setUploaderOpen] = useState(false);
|
|
325
|
-
const intl = useIntl();
|
|
326
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
327
|
-
/* @__PURE__ */ jsxs(Grid$1, { container: true, paddingTop: 1, paddingLeft: 2, children: [
|
|
328
|
-
/* @__PURE__ */ jsx(Grid$1, { item: true, xs: 1, children: csvProps && /* @__PURE__ */ jsx(
|
|
329
|
-
InnerColoredButton,
|
|
330
|
-
{
|
|
331
|
-
onClick: () => setUploaderOpen(true),
|
|
332
|
-
children: /* @__PURE__ */ jsx(
|
|
333
|
-
Tooltip,
|
|
334
|
-
{
|
|
335
|
-
title: intl.formatMessage({
|
|
336
|
-
id: "ImportCSV"
|
|
337
|
-
}),
|
|
338
|
-
placement: "bottom",
|
|
339
|
-
children: /* @__PURE__ */ jsx(Upload, {})
|
|
340
|
-
}
|
|
341
|
-
)
|
|
342
|
-
}
|
|
343
|
-
) }),
|
|
344
|
-
/* @__PURE__ */ jsxs(
|
|
345
|
-
Grid$1,
|
|
346
|
-
{
|
|
347
|
-
item: true,
|
|
348
|
-
xs: 11,
|
|
349
|
-
sx: { display: "flex", justifyContent: "right" },
|
|
350
|
-
children: [
|
|
351
|
-
/* @__PURE__ */ jsx(
|
|
352
|
-
InnerColoredButton,
|
|
353
|
-
{
|
|
354
|
-
onClick: handleAddRow,
|
|
355
|
-
children: /* @__PURE__ */ jsx(AddIcon, {})
|
|
356
|
-
},
|
|
357
|
-
"addButton"
|
|
358
|
-
),
|
|
359
|
-
/* @__PURE__ */ jsx(
|
|
360
|
-
InnerColoredButton,
|
|
361
|
-
{
|
|
362
|
-
onClick: handleDeleteRows,
|
|
363
|
-
disabled: disableDelete,
|
|
364
|
-
children: /* @__PURE__ */ jsx(DeleteIcon, {})
|
|
365
|
-
},
|
|
366
|
-
"DeleteButton"
|
|
367
|
-
),
|
|
368
|
-
/* @__PURE__ */ jsx(
|
|
369
|
-
InnerColoredButton,
|
|
370
|
-
{
|
|
371
|
-
disabled: disableUp,
|
|
372
|
-
onClick: handleMoveRowUp,
|
|
373
|
-
children: /* @__PURE__ */ jsx(ArrowCircleUp, {})
|
|
374
|
-
},
|
|
375
|
-
"upButton"
|
|
376
|
-
),
|
|
377
|
-
/* @__PURE__ */ jsx(
|
|
378
|
-
InnerColoredButton,
|
|
379
|
-
{
|
|
380
|
-
disabled: disableDown,
|
|
381
|
-
onClick: handleMoveRowDown,
|
|
382
|
-
children: /* @__PURE__ */ jsx(ArrowCircleDown, {})
|
|
383
|
-
},
|
|
384
|
-
"downButton"
|
|
385
|
-
)
|
|
386
|
-
]
|
|
387
|
-
}
|
|
388
|
-
)
|
|
389
|
-
] }),
|
|
390
|
-
/* @__PURE__ */ jsx(Grid$1, { item: true, xs: 12, children: /* @__PURE__ */ jsx(ErrorInput, { name, InputField: FieldErrorAlert }) }),
|
|
391
|
-
/* @__PURE__ */ jsx(
|
|
392
|
-
CsvUploader,
|
|
393
|
-
{
|
|
394
|
-
open: uploaderOpen,
|
|
395
|
-
onClose: () => setUploaderOpen(false),
|
|
396
|
-
name,
|
|
397
|
-
useFieldArrayOutput,
|
|
398
|
-
...csvProps
|
|
399
|
-
}
|
|
400
|
-
)
|
|
401
|
-
] });
|
|
402
|
-
};
|
|
403
|
-
const ROW_DRAGGING_SELECTION_COLUMN_DEF = [
|
|
404
|
-
{
|
|
405
|
-
rowDrag: true,
|
|
406
|
-
headerCheckboxSelection: true,
|
|
407
|
-
checkboxSelection: true,
|
|
408
|
-
maxWidth: 50
|
|
409
|
-
}
|
|
410
|
-
];
|
|
411
|
-
const style = (customProps) => ({
|
|
412
|
-
grid: (theme) => ({
|
|
413
|
-
width: "auto",
|
|
414
|
-
height: "100%",
|
|
415
|
-
position: "relative",
|
|
416
|
-
// - AG Grid colors override -
|
|
417
|
-
// It shouldn't be exactly like this, but I couldn't make it works otherwise
|
|
418
|
-
// https://www.ag-grid.com/react-data-grid/global-style-customisation/
|
|
419
|
-
"--ag-alpine-active-color": theme.palette.primary.main + " !important",
|
|
420
|
-
"--ag-checkbox-indeterminate-color": theme.palette.primary.main + " !important",
|
|
421
|
-
"--ag-background-color": theme.agGridBackground.color + " !important",
|
|
422
|
-
"--ag-header-background-color": theme.agGridBackground.color + " !important",
|
|
423
|
-
"--ag-odd-row-background-color": theme.agGridBackground.color + " !important",
|
|
424
|
-
"--ag-modal-overlay-background-color": theme.agGridBackground.color + " !important",
|
|
425
|
-
"--ag-selected-row-background-color": "transparent !important",
|
|
426
|
-
"--ag-range-selection-border-color": "transparent !important",
|
|
427
|
-
//overrides the default computed max height for ag grid default selector editor to make it more usable
|
|
428
|
-
//can be removed if a custom selector editor is implemented
|
|
429
|
-
"& .ag-select-list": {
|
|
430
|
-
maxHeight: "300px !important"
|
|
431
|
-
},
|
|
432
|
-
"& .ag-root-wrapper-body": {
|
|
433
|
-
maxHeight: "500px"
|
|
434
|
-
},
|
|
435
|
-
"& .ag-cell": {
|
|
436
|
-
boxShadow: "none"
|
|
437
|
-
},
|
|
438
|
-
"& .ag-cell-edit-wrapper": {
|
|
439
|
-
height: "inherit"
|
|
440
|
-
},
|
|
441
|
-
"& .ag-row-hover": {
|
|
442
|
-
cursor: "text"
|
|
443
|
-
},
|
|
444
|
-
"& .ag-overlay-loading-center": {
|
|
445
|
-
border: "none",
|
|
446
|
-
boxShadow: "none"
|
|
447
|
-
},
|
|
448
|
-
"& .numeric-input": {
|
|
449
|
-
fontSize: "calc(var(--ag-font-size) + 1px)",
|
|
450
|
-
paddingLeft: "calc(var(--ag-cell-horizontal-padding) - 1px)",
|
|
451
|
-
width: "100%",
|
|
452
|
-
height: "100%",
|
|
453
|
-
border: "inherit",
|
|
454
|
-
outline: "inherit",
|
|
455
|
-
backgroundColor: theme.agGridBackground.color
|
|
456
|
-
},
|
|
457
|
-
"& .Mui-focused .MuiOutlinedInput-root": {
|
|
458
|
-
// borders moves row height
|
|
459
|
-
outline: "var(--ag-borders-input) var(--ag-input-focus-border-color)",
|
|
460
|
-
outlineOffset: "-1px",
|
|
461
|
-
backgroundColor: theme.agGridBackground.color
|
|
462
|
-
},
|
|
463
|
-
...customProps
|
|
464
|
-
})
|
|
465
|
-
});
|
|
466
|
-
const CustomAgGridTable = ({
|
|
467
|
-
name,
|
|
468
|
-
columnDefs,
|
|
469
|
-
makeDefaultRowData: makeDefaultRowData2,
|
|
470
|
-
csvProps,
|
|
471
|
-
cssProps,
|
|
472
|
-
defaultColDef,
|
|
473
|
-
pagination,
|
|
474
|
-
paginationPageSize,
|
|
475
|
-
suppressRowClickSelection,
|
|
476
|
-
alwaysShowVerticalScroll,
|
|
477
|
-
stopEditingWhenCellsLoseFocus,
|
|
478
|
-
...props
|
|
479
|
-
}) => {
|
|
480
|
-
var _a, _b;
|
|
481
|
-
const theme = useTheme();
|
|
482
|
-
const [gridApi, setGridApi] = useState(null);
|
|
483
|
-
const [selectedRows, setSelectedRows] = useState([]);
|
|
484
|
-
const [newRowAdded, setNewRowAdded] = useState(false);
|
|
485
|
-
const [isSortApplied, setIsSortApplied] = useState(false);
|
|
486
|
-
const { control, getValues, watch } = useFormContext();
|
|
487
|
-
const useFieldArrayOutput = useFieldArray({
|
|
488
|
-
control,
|
|
489
|
-
name
|
|
490
|
-
});
|
|
491
|
-
const { append, remove, update, swap, move } = useFieldArrayOutput;
|
|
492
|
-
const rowData = watch(name);
|
|
493
|
-
const isFirstSelected = Boolean(
|
|
494
|
-
(rowData == null ? void 0 : rowData.length) && ((_a = gridApi == null ? void 0 : gridApi.api.getRowNode(rowData[0][FieldConstants.AG_GRID_ROW_UUID])) == null ? void 0 : _a.isSelected())
|
|
495
|
-
);
|
|
496
|
-
const isLastSelected = Boolean(
|
|
497
|
-
(rowData == null ? void 0 : rowData.length) && ((_b = gridApi == null ? void 0 : gridApi.api.getRowNode(
|
|
498
|
-
rowData[rowData.length - 1][FieldConstants.AG_GRID_ROW_UUID]
|
|
499
|
-
)) == null ? void 0 : _b.isSelected())
|
|
500
|
-
);
|
|
501
|
-
const noRowSelected = selectedRows.length === 0;
|
|
502
|
-
const handleMoveRowUp = () => {
|
|
503
|
-
selectedRows.map((row) => getIndex(row)).sort().forEach((idx) => {
|
|
504
|
-
swap(idx, idx - 1);
|
|
505
|
-
});
|
|
506
|
-
};
|
|
507
|
-
const handleMoveRowDown = () => {
|
|
508
|
-
selectedRows.map((row) => getIndex(row)).sort().reverse().forEach((idx) => {
|
|
509
|
-
swap(idx, idx + 1);
|
|
510
|
-
});
|
|
511
|
-
};
|
|
512
|
-
const handleDeleteRows = () => {
|
|
513
|
-
if (selectedRows.length === rowData.length) {
|
|
514
|
-
remove();
|
|
515
|
-
} else {
|
|
516
|
-
selectedRows.forEach((val) => {
|
|
517
|
-
const idx = getIndex(val);
|
|
518
|
-
remove(idx);
|
|
519
|
-
});
|
|
520
|
-
}
|
|
521
|
-
};
|
|
522
|
-
useEffect(() => {
|
|
523
|
-
if (gridApi) {
|
|
524
|
-
gridApi.api.refreshCells({
|
|
525
|
-
force: true
|
|
526
|
-
});
|
|
527
|
-
}
|
|
528
|
-
}, [gridApi, rowData]);
|
|
529
|
-
const handleAddRow = () => {
|
|
530
|
-
append(makeDefaultRowData2());
|
|
531
|
-
setNewRowAdded(true);
|
|
532
|
-
};
|
|
533
|
-
const getIndex = useCallback(
|
|
534
|
-
(val) => {
|
|
535
|
-
return getValues(name).findIndex(
|
|
536
|
-
(row) => row[FieldConstants.AG_GRID_ROW_UUID] === val[FieldConstants.AG_GRID_ROW_UUID]
|
|
537
|
-
);
|
|
538
|
-
},
|
|
539
|
-
[getValues, name]
|
|
540
|
-
);
|
|
541
|
-
useEffect(() => {
|
|
542
|
-
if (gridApi) {
|
|
543
|
-
gridApi.api.sizeColumnsToFit();
|
|
544
|
-
}
|
|
545
|
-
}, [columnDefs, gridApi]);
|
|
546
|
-
const intl = useIntl();
|
|
547
|
-
const getLocaleText = useCallback(
|
|
548
|
-
(params) => {
|
|
549
|
-
const key = "agGrid." + params.key;
|
|
550
|
-
return intl.messages[key] || params.defaultValue;
|
|
551
|
-
},
|
|
552
|
-
[intl]
|
|
553
|
-
);
|
|
554
|
-
const onGridReady = (params) => {
|
|
555
|
-
setGridApi(params);
|
|
556
|
-
};
|
|
557
|
-
const onRowDataUpdated = () => {
|
|
558
|
-
setNewRowAdded(false);
|
|
559
|
-
if (gridApi == null ? void 0 : gridApi.api) {
|
|
560
|
-
const lastIndex = rowData.length - 1;
|
|
561
|
-
gridApi.api.paginationGoToLastPage();
|
|
562
|
-
gridApi.api.ensureIndexVisible(lastIndex, "bottom");
|
|
563
|
-
}
|
|
564
|
-
};
|
|
565
|
-
const onCellEditingStopped = useCallback(
|
|
566
|
-
(event) => {
|
|
567
|
-
const rowIndex = getIndex(event.data);
|
|
568
|
-
if (rowIndex === -1) {
|
|
569
|
-
return;
|
|
570
|
-
}
|
|
571
|
-
update(rowIndex, event.data);
|
|
572
|
-
},
|
|
573
|
-
[getIndex, update]
|
|
574
|
-
);
|
|
575
|
-
const onSortChanged = useCallback((event) => {
|
|
576
|
-
const isAnycolumnhasSort = event.api.getColumnState().some((col) => col.sort);
|
|
577
|
-
setIsSortApplied(isAnycolumnhasSort);
|
|
578
|
-
}, []);
|
|
579
|
-
return /* @__PURE__ */ jsxs(Grid$1, { container: true, spacing: 2, children: [
|
|
580
|
-
/* @__PURE__ */ jsx(
|
|
581
|
-
Grid$1,
|
|
582
|
-
{
|
|
583
|
-
item: true,
|
|
584
|
-
xs: 12,
|
|
585
|
-
className: theme.aggrid.theme,
|
|
586
|
-
sx: style(cssProps).grid,
|
|
587
|
-
children: /* @__PURE__ */ jsx(
|
|
588
|
-
AgGridReact,
|
|
589
|
-
{
|
|
590
|
-
rowData,
|
|
591
|
-
onGridReady,
|
|
592
|
-
getLocaleText,
|
|
593
|
-
cacheOverflowSize: 10,
|
|
594
|
-
rowSelection: "multiple",
|
|
595
|
-
domLayout: "autoHeight",
|
|
596
|
-
rowDragEntireRow: true,
|
|
597
|
-
rowDragManaged: true,
|
|
598
|
-
onRowDragEnd: (e) => move(getIndex(e.node.data), e.overIndex),
|
|
599
|
-
suppressBrowserResizeObserver: true,
|
|
600
|
-
columnDefs,
|
|
601
|
-
detailRowAutoHeight: true,
|
|
602
|
-
onSelectionChanged: (event) => {
|
|
603
|
-
setSelectedRows(gridApi.api.getSelectedRows());
|
|
604
|
-
},
|
|
605
|
-
onRowDataUpdated: newRowAdded ? onRowDataUpdated : void 0,
|
|
606
|
-
onCellEditingStopped,
|
|
607
|
-
onSortChanged,
|
|
608
|
-
getRowId: (row) => row.data[FieldConstants.AG_GRID_ROW_UUID],
|
|
609
|
-
pagination,
|
|
610
|
-
paginationPageSize,
|
|
611
|
-
suppressRowClickSelection,
|
|
612
|
-
alwaysShowVerticalScroll,
|
|
613
|
-
stopEditingWhenCellsLoseFocus,
|
|
614
|
-
...props
|
|
615
|
-
}
|
|
616
|
-
)
|
|
617
|
-
}
|
|
618
|
-
),
|
|
619
|
-
/* @__PURE__ */ jsx(
|
|
620
|
-
BottomRightButtons,
|
|
621
|
-
{
|
|
622
|
-
name,
|
|
623
|
-
handleAddRow,
|
|
624
|
-
handleDeleteRows,
|
|
625
|
-
handleMoveRowDown,
|
|
626
|
-
handleMoveRowUp,
|
|
627
|
-
disableUp: noRowSelected || isFirstSelected || isSortApplied,
|
|
628
|
-
disableDown: noRowSelected || isLastSelected || isSortApplied,
|
|
629
|
-
disableDelete: noRowSelected,
|
|
630
|
-
csvProps,
|
|
631
|
-
useFieldArrayOutput
|
|
632
|
-
}
|
|
633
|
-
)
|
|
634
|
-
] });
|
|
635
|
-
};
|
|
636
|
-
const FILTER_EQUIPMENTS_ATTRIBUTES = "filterEquipmentsAttributes";
|
|
637
|
-
const explicitNamingFilterSchema = {
|
|
638
|
-
[FILTER_EQUIPMENTS_ATTRIBUTES]: yup.array().of(
|
|
639
|
-
yup.object().shape({
|
|
640
|
-
[FieldConstants.EQUIPMENT_ID]: yup.string().nullable(),
|
|
641
|
-
[DISTRIBUTION_KEY]: yup.number().nullable()
|
|
642
|
-
})
|
|
643
|
-
).compact(
|
|
644
|
-
(row) => !row[DISTRIBUTION_KEY] && !row[FieldConstants.EQUIPMENT_ID]
|
|
645
|
-
).when([FieldConstants.FILTER_TYPE], {
|
|
646
|
-
is: FilterType.EXPLICIT_NAMING.id,
|
|
647
|
-
then: (schema) => schema.min(1, "emptyFilterError").when([FieldConstants.EQUIPMENT_TYPE], {
|
|
648
|
-
is: (equipmentType) => isGeneratorOrLoad(equipmentType),
|
|
649
|
-
then: (schema2) => schema2.test(
|
|
650
|
-
"noKeyWithoutId",
|
|
651
|
-
"distributionKeyWithMissingIdError",
|
|
652
|
-
(array) => {
|
|
653
|
-
return !array.some(
|
|
654
|
-
(row) => !row[FieldConstants.EQUIPMENT_ID]
|
|
655
|
-
);
|
|
656
|
-
}
|
|
657
|
-
).test(
|
|
658
|
-
"ifOneKeyThenKeyEverywhere",
|
|
659
|
-
"missingDistributionKeyError",
|
|
660
|
-
(array) => {
|
|
661
|
-
return !(array.some(
|
|
662
|
-
(row) => row[DISTRIBUTION_KEY]
|
|
663
|
-
) && array.some(
|
|
664
|
-
(row) => !row[DISTRIBUTION_KEY]
|
|
665
|
-
));
|
|
666
|
-
}
|
|
667
|
-
)
|
|
668
|
-
})
|
|
669
|
-
})
|
|
670
|
-
};
|
|
671
|
-
function isGeneratorOrLoad(equipmentType) {
|
|
672
|
-
return equipmentType === Generator.type || equipmentType === Load.type;
|
|
673
|
-
}
|
|
674
|
-
function makeDefaultRowData() {
|
|
675
|
-
return {
|
|
676
|
-
[FieldConstants.AG_GRID_ROW_UUID]: v4(),
|
|
677
|
-
[FieldConstants.EQUIPMENT_ID]: "",
|
|
678
|
-
[DISTRIBUTION_KEY]: null
|
|
679
|
-
};
|
|
680
|
-
}
|
|
681
|
-
function makeDefaultTableRows() {
|
|
682
|
-
return [makeDefaultRowData(), makeDefaultRowData(), makeDefaultRowData()];
|
|
683
|
-
}
|
|
684
|
-
function getExplicitNamingFilterEmptyFormData() {
|
|
685
|
-
return {
|
|
686
|
-
[FILTER_EQUIPMENTS_ATTRIBUTES]: makeDefaultTableRows()
|
|
687
|
-
};
|
|
688
|
-
}
|
|
689
|
-
const ExplicitNamingFilterForm = ({ sourceFilterForExplicitNamingConversion }) => {
|
|
690
|
-
const intl = useIntl();
|
|
691
|
-
const { snackError } = useSnackMessage();
|
|
692
|
-
const { getValues, setValue } = useFormContext();
|
|
693
|
-
const watchEquipmentType = useWatch({
|
|
694
|
-
name: FieldConstants.EQUIPMENT_TYPE
|
|
695
|
-
});
|
|
696
|
-
const forGeneratorOrLoad = isGeneratorOrLoad(watchEquipmentType);
|
|
697
|
-
useEffect(() => {
|
|
698
|
-
if (sourceFilterForExplicitNamingConversion) {
|
|
699
|
-
setValue(
|
|
700
|
-
FieldConstants.EQUIPMENT_TYPE,
|
|
701
|
-
sourceFilterForExplicitNamingConversion.equipmentType
|
|
702
|
-
);
|
|
703
|
-
}
|
|
704
|
-
}, [sourceFilterForExplicitNamingConversion, setValue]);
|
|
705
|
-
const columnDefs = useMemo(() => {
|
|
706
|
-
const columnDefs2 = [
|
|
707
|
-
...ROW_DRAGGING_SELECTION_COLUMN_DEF,
|
|
708
|
-
{
|
|
709
|
-
headerName: intl.formatMessage({
|
|
710
|
-
id: FieldConstants.EQUIPMENT_ID
|
|
711
|
-
}),
|
|
712
|
-
field: FieldConstants.EQUIPMENT_ID,
|
|
713
|
-
editable: true,
|
|
714
|
-
singleClickEdit: true,
|
|
715
|
-
valueParser: (params) => {
|
|
716
|
-
var _a;
|
|
717
|
-
return ((_a = params.newValue) == null ? void 0 : _a.trim()) ?? null;
|
|
718
|
-
}
|
|
719
|
-
}
|
|
720
|
-
];
|
|
721
|
-
if (forGeneratorOrLoad) {
|
|
722
|
-
columnDefs2.push({
|
|
723
|
-
headerName: intl.formatMessage({ id: DISTRIBUTION_KEY }),
|
|
724
|
-
field: DISTRIBUTION_KEY,
|
|
725
|
-
editable: true,
|
|
726
|
-
singleClickEdit: true,
|
|
727
|
-
cellEditor: NumericEditor,
|
|
728
|
-
maxWidth: 200
|
|
729
|
-
});
|
|
730
|
-
}
|
|
731
|
-
return columnDefs2;
|
|
732
|
-
}, [intl, forGeneratorOrLoad]);
|
|
733
|
-
const defaultColDef = useMemo(
|
|
734
|
-
() => ({
|
|
735
|
-
suppressMovable: true
|
|
736
|
-
}),
|
|
737
|
-
[]
|
|
738
|
-
);
|
|
739
|
-
const csvFileHeaders = useMemo(() => {
|
|
740
|
-
const csvFileHeaders2 = [
|
|
741
|
-
intl.formatMessage({ id: FieldConstants.EQUIPMENT_ID })
|
|
742
|
-
];
|
|
743
|
-
if (forGeneratorOrLoad) {
|
|
744
|
-
csvFileHeaders2.push(intl.formatMessage({ id: DISTRIBUTION_KEY }));
|
|
745
|
-
}
|
|
746
|
-
return csvFileHeaders2;
|
|
747
|
-
}, [intl, forGeneratorOrLoad]);
|
|
748
|
-
const getDataFromCsvFile = useCallback((csvData) => {
|
|
749
|
-
if (csvData) {
|
|
750
|
-
return csvData.map((value) => {
|
|
751
|
-
var _a, _b;
|
|
752
|
-
return {
|
|
753
|
-
[FieldConstants.AG_GRID_ROW_UUID]: v4(),
|
|
754
|
-
[FieldConstants.EQUIPMENT_ID]: (_a = value[0]) == null ? void 0 : _a.trim(),
|
|
755
|
-
[DISTRIBUTION_KEY]: toFloatOrNullValue((_b = value[1]) == null ? void 0 : _b.trim())
|
|
756
|
-
};
|
|
757
|
-
});
|
|
758
|
-
} else {
|
|
759
|
-
return [];
|
|
760
|
-
}
|
|
761
|
-
}, []);
|
|
762
|
-
const openConfirmationPopup = () => {
|
|
763
|
-
return getValues(FILTER_EQUIPMENTS_ATTRIBUTES).some(
|
|
764
|
-
(row) => row[DISTRIBUTION_KEY] || row[FieldConstants.EQUIPMENT_ID]
|
|
765
|
-
);
|
|
766
|
-
};
|
|
767
|
-
const handleResetOnConfirmation = () => {
|
|
768
|
-
setValue(FILTER_EQUIPMENTS_ATTRIBUTES, makeDefaultTableRows());
|
|
769
|
-
};
|
|
770
|
-
const onStudySelected = (studyUuid) => {
|
|
771
|
-
exportFilter(studyUuid, sourceFilterForExplicitNamingConversion == null ? void 0 : sourceFilterForExplicitNamingConversion.id).then((matchingEquipments) => {
|
|
772
|
-
setValue(
|
|
773
|
-
FILTER_EQUIPMENTS_ATTRIBUTES,
|
|
774
|
-
matchingEquipments.length === 0 ? makeDefaultTableRows() : matchingEquipments.map((equipment) => ({
|
|
775
|
-
[FieldConstants.AG_GRID_ROW_UUID]: v4(),
|
|
776
|
-
[FieldConstants.EQUIPMENT_ID]: equipment.id,
|
|
777
|
-
[DISTRIBUTION_KEY]: equipment.distributionKey
|
|
778
|
-
}))
|
|
779
|
-
);
|
|
780
|
-
}).catch(
|
|
781
|
-
(error) => snackError({
|
|
782
|
-
messageTxt: error.message,
|
|
783
|
-
headerId: "convertIntoExplicitNamingFilterError"
|
|
784
|
-
})
|
|
785
|
-
);
|
|
786
|
-
};
|
|
787
|
-
return /* @__PURE__ */ jsxs(Grid, { container: true, item: true, spacing: 2, children: [
|
|
788
|
-
/* @__PURE__ */ jsxs(Grid, { item: true, xs: 12, children: [
|
|
789
|
-
/* @__PURE__ */ jsx(
|
|
790
|
-
InputWithPopupConfirmation,
|
|
791
|
-
{
|
|
792
|
-
Input: SelectInput,
|
|
793
|
-
name: FieldConstants.EQUIPMENT_TYPE,
|
|
794
|
-
options: Object.values(FILTER_EQUIPMENTS),
|
|
795
|
-
disabled: sourceFilterForExplicitNamingConversion,
|
|
796
|
-
label: "equipmentType",
|
|
797
|
-
shouldOpenPopup: openConfirmationPopup,
|
|
798
|
-
resetOnConfirmation: handleResetOnConfirmation,
|
|
799
|
-
message: "changeTypeMessage",
|
|
800
|
-
validateButtonLabel: "button.changeType"
|
|
801
|
-
}
|
|
802
|
-
),
|
|
803
|
-
sourceFilterForExplicitNamingConversion && /* @__PURE__ */ jsx(
|
|
804
|
-
ModifyElementSelection,
|
|
805
|
-
{
|
|
806
|
-
elementType: ElementType.STUDY,
|
|
807
|
-
onElementValidated: onStudySelected,
|
|
808
|
-
dialogOpeningButtonLabel: "selectStudyDialogButton",
|
|
809
|
-
dialogTitleLabel: "selectStudyDialogTitle",
|
|
810
|
-
dialogMessageLabel: "selectStudyText",
|
|
811
|
-
noElementMessageLabel: "noSelectedStudyText"
|
|
812
|
-
}
|
|
813
|
-
)
|
|
814
|
-
] }),
|
|
815
|
-
watchEquipmentType && /* @__PURE__ */ jsx(Grid, { item: true, xs: 12, children: /* @__PURE__ */ jsx(
|
|
816
|
-
CustomAgGridTable,
|
|
817
|
-
{
|
|
818
|
-
name: FILTER_EQUIPMENTS_ATTRIBUTES,
|
|
819
|
-
columnDefs,
|
|
820
|
-
defaultColDef,
|
|
821
|
-
makeDefaultRowData,
|
|
822
|
-
pagination: true,
|
|
823
|
-
paginationPageSize: 100,
|
|
824
|
-
suppressRowClickSelection: true,
|
|
825
|
-
alwaysShowVerticalScroll: true,
|
|
826
|
-
stopEditingWhenCellsLoseFocus: true,
|
|
827
|
-
csvProps: {
|
|
828
|
-
fileName: intl.formatMessage({
|
|
829
|
-
id: "filterCsvFileName"
|
|
830
|
-
}),
|
|
831
|
-
fileHeaders: csvFileHeaders,
|
|
832
|
-
getDataFromCsv: getDataFromCsvFile
|
|
833
|
-
},
|
|
834
|
-
cssProps: {
|
|
835
|
-
"& .ag-root-wrapper-body": {
|
|
836
|
-
maxHeight: "430px"
|
|
837
|
-
}
|
|
838
|
-
}
|
|
839
|
-
}
|
|
840
|
-
) })
|
|
841
|
-
] });
|
|
842
|
-
};
|
|
843
|
-
const RemoveButton = (props) => {
|
|
844
|
-
const {
|
|
845
|
-
field: { value: query, onChange }
|
|
846
|
-
} = useController({ name: EXPERT_FILTER_QUERY });
|
|
847
|
-
function handleDelete(e) {
|
|
848
|
-
onChange(recursiveRemove(query, props.path));
|
|
849
|
-
}
|
|
850
|
-
const isLastRuleOrGroup = props.path.toString() === [0].toString() && getNumberOfSiblings(props.path, query) === 1;
|
|
851
|
-
return /* @__PURE__ */ jsx(
|
|
852
|
-
IconButton,
|
|
853
|
-
{
|
|
854
|
-
size: "small",
|
|
855
|
-
onClick: handleDelete,
|
|
856
|
-
className: props.className,
|
|
857
|
-
children: !isLastRuleOrGroup && /* @__PURE__ */ jsx(DeleteIcon, {})
|
|
858
|
-
}
|
|
859
|
-
);
|
|
860
|
-
};
|
|
861
|
-
const ElementValueEditor = (props) => {
|
|
862
|
-
const { setValue } = useCustomFormContext();
|
|
863
|
-
useEffect(() => {
|
|
864
|
-
if (props.defaultValue && Array.isArray(props.defaultValue) && props.defaultValue.length > 0 && props.defaultValue[0].length > 0 && validate(props.defaultValue[0])) {
|
|
865
|
-
fetchElementsInfos(props.defaultValue).then(
|
|
866
|
-
(childrenWithMetadata) => {
|
|
867
|
-
setValue(
|
|
868
|
-
props.name,
|
|
869
|
-
childrenWithMetadata.map((v) => {
|
|
870
|
-
return {
|
|
871
|
-
id: v.elementUuid,
|
|
872
|
-
name: v.elementName,
|
|
873
|
-
specificMetadata: v.specificMetadata
|
|
874
|
-
};
|
|
875
|
-
})
|
|
876
|
-
);
|
|
877
|
-
}
|
|
878
|
-
);
|
|
879
|
-
}
|
|
880
|
-
}, [props.name, props.defaultValue, props.elementType, setValue]);
|
|
881
|
-
return /* @__PURE__ */ jsx(
|
|
882
|
-
DirectoryItemsInput,
|
|
883
|
-
{
|
|
884
|
-
name: props.name,
|
|
885
|
-
elementType: props.elementType,
|
|
886
|
-
equipmentTypes: props.equipmentTypes,
|
|
887
|
-
titleId: props.titleId,
|
|
888
|
-
hideErrorMessage: props.hideErrorMessage,
|
|
889
|
-
label: "filter",
|
|
890
|
-
itemFilter: props.itemFilter,
|
|
891
|
-
onChange: props.onChange,
|
|
892
|
-
labelRequiredFromContext: false
|
|
893
|
-
}
|
|
894
|
-
);
|
|
895
|
-
};
|
|
896
|
-
const styles = {
|
|
897
|
-
noArrows: {
|
|
898
|
-
"& input::-webkit-outer-spin-button, & input::-webkit-inner-spin-button": {
|
|
899
|
-
display: "none"
|
|
900
|
-
},
|
|
901
|
-
"& input[type=number]": {
|
|
902
|
-
MozAppearance: "textfield"
|
|
903
|
-
}
|
|
904
|
-
}
|
|
905
|
-
};
|
|
906
|
-
const ValueEditor = (props) => {
|
|
907
|
-
const formContext = useFormContext();
|
|
908
|
-
const { getValues } = formContext;
|
|
909
|
-
const itemFilter = useCallback(
|
|
910
|
-
(value) => {
|
|
911
|
-
var _a, _b, _c;
|
|
912
|
-
if ((value == null ? void 0 : value.type) === ElementType.FILTER) {
|
|
913
|
-
return (
|
|
914
|
-
// we do not authorize to use an expert filter in the rules of
|
|
915
|
-
// another expert filter, to prevent potential cycle problems
|
|
916
|
-
((_a = value == null ? void 0 : value.specificMetadata) == null ? void 0 : _a.type) !== FilterType.EXPERT.id && (props.field === FieldType.ID && ((_b = value == null ? void 0 : value.specificMetadata) == null ? void 0 : _b.equipmentType) === getValues(FieldConstants.EQUIPMENT_TYPE) || (props.field === FieldType.VOLTAGE_LEVEL_ID || props.field === FieldType.VOLTAGE_LEVEL_ID_1 || props.field === FieldType.VOLTAGE_LEVEL_ID_2) && ((_c = value == null ? void 0 : value.specificMetadata) == null ? void 0 : _c.equipmentType) === VoltageLevel.type)
|
|
917
|
-
);
|
|
918
|
-
}
|
|
919
|
-
return true;
|
|
920
|
-
},
|
|
921
|
-
[props.field, getValues]
|
|
922
|
-
);
|
|
923
|
-
if (props.operator === OPERATOR_OPTIONS.EXISTS.name || props.operator === OPERATOR_OPTIONS.NOT_EXISTS.name) {
|
|
924
|
-
return null;
|
|
925
|
-
}
|
|
926
|
-
if ([FieldType.COUNTRY, FieldType.COUNTRY_1, FieldType.COUNTRY_2].includes(
|
|
927
|
-
props.field
|
|
928
|
-
)) {
|
|
929
|
-
return /* @__PURE__ */ jsx(CountryValueEditor, { ...props });
|
|
930
|
-
}
|
|
931
|
-
if (props.field === FieldType.REGULATION_TYPE || props.field === FieldType.SVAR_REGULATION_MODE || props.field === FieldType.ENERGY_SOURCE || props.field === FieldType.SHUNT_COMPENSATOR_TYPE || props.field === FieldType.LOAD_TYPE || props.field === FieldType.RATIO_REGULATION_MODE || props.field === FieldType.PHASE_REGULATION_MODE) {
|
|
932
|
-
return /* @__PURE__ */ jsx(TranslatedValueEditor, { ...props });
|
|
933
|
-
}
|
|
934
|
-
if (props.operator === OPERATOR_OPTIONS.IS_PART_OF.name || props.operator === OPERATOR_OPTIONS.IS_NOT_PART_OF.name) {
|
|
935
|
-
let equipmentTypes;
|
|
936
|
-
if (props.field === FieldType.VOLTAGE_LEVEL_ID || props.field === FieldType.VOLTAGE_LEVEL_ID_1 || props.field === FieldType.VOLTAGE_LEVEL_ID_2) {
|
|
937
|
-
equipmentTypes = [VoltageLevel.type];
|
|
938
|
-
} else if (props.field === FieldType.ID) {
|
|
939
|
-
equipmentTypes = [getValues(FieldConstants.EQUIPMENT_TYPE)];
|
|
940
|
-
}
|
|
941
|
-
return /* @__PURE__ */ jsx(
|
|
942
|
-
ElementValueEditor,
|
|
943
|
-
{
|
|
944
|
-
name: DataType.FILTER_UUID + props.rule.id,
|
|
945
|
-
elementType: ElementType.FILTER,
|
|
946
|
-
equipmentTypes,
|
|
947
|
-
titleId: "selectFilterDialogTitle",
|
|
948
|
-
hideErrorMessage: true,
|
|
949
|
-
onChange: (e) => {
|
|
950
|
-
props.handleOnChange(e.map((v) => v.id));
|
|
951
|
-
},
|
|
952
|
-
itemFilter,
|
|
953
|
-
defaultValue: props.value
|
|
954
|
-
}
|
|
955
|
-
);
|
|
956
|
-
} else if (props.field === FieldType.ID || props.field === FieldType.NAME || props.field === FieldType.REGULATING_TERMINAL_VL_ID || props.field === FieldType.REGULATING_TERMINAL_CONNECTABLE_ID || props.field === FieldType.VOLTAGE_LEVEL_ID || props.field === FieldType.VOLTAGE_LEVEL_ID_1 || props.field === FieldType.VOLTAGE_LEVEL_ID_2) {
|
|
957
|
-
return /* @__PURE__ */ jsx(TextValueEditor, { ...props });
|
|
958
|
-
} else if (props.field === FieldType.PROPERTY || props.field === FieldType.SUBSTATION_PROPERTY || props.field === FieldType.SUBSTATION_PROPERTY_1 || props.field === FieldType.SUBSTATION_PROPERTY_2 || props.field === FieldType.VOLTAGE_LEVEL_PROPERTY || props.field === FieldType.VOLTAGE_LEVEL_PROPERTY_1 || props.field === FieldType.VOLTAGE_LEVEL_PROPERTY_2) {
|
|
959
|
-
let equipmentType;
|
|
960
|
-
if (props.field === FieldType.SUBSTATION_PROPERTY || props.field === FieldType.SUBSTATION_PROPERTY_1 || props.field === FieldType.SUBSTATION_PROPERTY_2) {
|
|
961
|
-
equipmentType = Substation.type;
|
|
962
|
-
} else if (props.field === FieldType.VOLTAGE_LEVEL_PROPERTY || props.field === FieldType.VOLTAGE_LEVEL_PROPERTY_1 || props.field === FieldType.VOLTAGE_LEVEL_PROPERTY_2) {
|
|
963
|
-
equipmentType = VoltageLevel.type;
|
|
964
|
-
} else {
|
|
965
|
-
equipmentType = getValues(FieldConstants.EQUIPMENT_TYPE);
|
|
966
|
-
}
|
|
967
|
-
return /* @__PURE__ */ jsx(
|
|
968
|
-
PropertyValueEditor,
|
|
969
|
-
{
|
|
970
|
-
equipmentType,
|
|
971
|
-
valueEditorProps: props
|
|
972
|
-
}
|
|
973
|
-
);
|
|
974
|
-
} else if (props.fieldData.dataType === DataType.COMBINATOR) {
|
|
975
|
-
return /* @__PURE__ */ jsx(GroupValueEditor, { ...props });
|
|
976
|
-
}
|
|
977
|
-
return /* @__PURE__ */ jsx(Box, { sx: props.inputType === "number" ? styles.noArrows : void 0, children: /* @__PURE__ */ jsx(
|
|
978
|
-
MaterialValueEditor,
|
|
979
|
-
{
|
|
980
|
-
...props,
|
|
981
|
-
title: void 0
|
|
982
|
-
}
|
|
983
|
-
) });
|
|
984
|
-
};
|
|
985
|
-
const CustomReactQueryBuilder = (props) => {
|
|
986
|
-
const {
|
|
987
|
-
getValues,
|
|
988
|
-
setValue,
|
|
989
|
-
watch,
|
|
990
|
-
formState: { isSubmitted }
|
|
991
|
-
// Set to true after the form is submitted. Will remain true until the reset method is invoked.
|
|
992
|
-
} = useFormContext();
|
|
993
|
-
const intl = useIntl();
|
|
994
|
-
const query = watch(props.name);
|
|
995
|
-
const handleQueryChange = useCallback(
|
|
996
|
-
(newQuery) => {
|
|
997
|
-
const oldQuery = getValues(props.name);
|
|
998
|
-
const hasQueryChanged = formatQuery(oldQuery, "json_without_ids") !== formatQuery(newQuery, "json_without_ids");
|
|
999
|
-
const hasAddedRules = countRules(newQuery) > countRules(oldQuery);
|
|
1000
|
-
setValue(props.name, newQuery, {
|
|
1001
|
-
shouldDirty: hasQueryChanged,
|
|
1002
|
-
shouldValidate: isSubmitted && hasQueryChanged && !hasAddedRules
|
|
1003
|
-
});
|
|
1004
|
-
},
|
|
1005
|
-
[getValues, setValue, isSubmitted, props.name]
|
|
1006
|
-
);
|
|
1007
|
-
const combinators = useMemo(() => {
|
|
1008
|
-
return Object.values(COMBINATOR_OPTIONS).map((c) => ({
|
|
1009
|
-
name: c.name,
|
|
1010
|
-
label: intl.formatMessage({ id: c.label })
|
|
1011
|
-
}));
|
|
1012
|
-
}, [intl]);
|
|
1013
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1014
|
-
/* @__PURE__ */ jsx(Grid, { item: true, xs: 12, children: /* @__PURE__ */ jsx(QueryBuilderMaterial, { children: /* @__PURE__ */ jsx(
|
|
1015
|
-
QueryBuilderDnD,
|
|
1016
|
-
{
|
|
1017
|
-
dnd: { ...ReactDnD, ...ReactDndHtml5Backend },
|
|
1018
|
-
children: /* @__PURE__ */ jsx(
|
|
1019
|
-
QueryBuilder,
|
|
1020
|
-
{
|
|
1021
|
-
fields: props.fields,
|
|
1022
|
-
query,
|
|
1023
|
-
addRuleToNewGroups: true,
|
|
1024
|
-
combinators,
|
|
1025
|
-
onQueryChange: handleQueryChange,
|
|
1026
|
-
getOperators: (fieldName) => getOperators(fieldName, intl),
|
|
1027
|
-
validator: queryValidator,
|
|
1028
|
-
controlClassnames: {
|
|
1029
|
-
queryBuilder: "queryBuilder-branches"
|
|
1030
|
-
},
|
|
1031
|
-
controlElements: {
|
|
1032
|
-
addRuleAction: (props2) => /* @__PURE__ */ jsx(AddButton, { ...props2, label: "rule" }),
|
|
1033
|
-
addGroupAction: (props2) => /* @__PURE__ */ jsx(AddButton, { ...props2, label: "subGroup" }),
|
|
1034
|
-
combinatorSelector: CombinatorSelector,
|
|
1035
|
-
removeRuleAction: RemoveButton,
|
|
1036
|
-
removeGroupAction: RemoveButton,
|
|
1037
|
-
valueEditor: ValueEditor,
|
|
1038
|
-
operatorSelector: ValueSelector,
|
|
1039
|
-
fieldSelector: ValueSelector,
|
|
1040
|
-
valueSourceSelector: ValueSelector
|
|
1041
|
-
},
|
|
1042
|
-
listsAsArrays: true
|
|
1043
|
-
}
|
|
1044
|
-
)
|
|
1045
|
-
}
|
|
1046
|
-
) }) }),
|
|
1047
|
-
/* @__PURE__ */ jsx(Grid, { item: true, xs: 12, children: /* @__PURE__ */ jsx(ErrorInput, { name: props.name, InputField: FieldErrorAlert }) })
|
|
1048
|
-
] });
|
|
1049
|
-
};
|
|
1050
|
-
yup.setLocale({
|
|
1051
|
-
mixed: {
|
|
1052
|
-
required: "YupRequired",
|
|
1053
|
-
notType: ({ type }) => {
|
|
1054
|
-
if (type === "number") {
|
|
1055
|
-
return "YupNotTypeNumber";
|
|
1056
|
-
} else {
|
|
1057
|
-
return "YupNotTypeDefault";
|
|
1058
|
-
}
|
|
1059
|
-
}
|
|
1060
|
-
}
|
|
1061
|
-
});
|
|
1062
|
-
const EXPERT_FILTER_QUERY = "rules";
|
|
1063
|
-
const expertFilterSchema = {
|
|
1064
|
-
[EXPERT_FILTER_QUERY]: yup.object().when([FieldConstants.FILTER_TYPE], {
|
|
1065
|
-
is: FilterType.EXPERT.id,
|
|
1066
|
-
then: (schema) => schema.when([FieldConstants.EQUIPMENT_TYPE], {
|
|
1067
|
-
is: (equipmentType) => isSupportedEquipmentType(equipmentType),
|
|
1068
|
-
then: (schema2) => schema2.test(
|
|
1069
|
-
RULES.EMPTY_GROUP,
|
|
1070
|
-
RULES.EMPTY_GROUP,
|
|
1071
|
-
(query) => {
|
|
1072
|
-
return testQuery(
|
|
1073
|
-
RULES.EMPTY_GROUP,
|
|
1074
|
-
query
|
|
1075
|
-
);
|
|
1076
|
-
}
|
|
1077
|
-
).test(
|
|
1078
|
-
RULES.EMPTY_RULE,
|
|
1079
|
-
RULES.EMPTY_RULE,
|
|
1080
|
-
(query) => {
|
|
1081
|
-
return testQuery(
|
|
1082
|
-
RULES.EMPTY_RULE,
|
|
1083
|
-
query
|
|
1084
|
-
);
|
|
1085
|
-
}
|
|
1086
|
-
).test(
|
|
1087
|
-
RULES.INCORRECT_RULE,
|
|
1088
|
-
RULES.INCORRECT_RULE,
|
|
1089
|
-
(query) => {
|
|
1090
|
-
return testQuery(
|
|
1091
|
-
RULES.INCORRECT_RULE,
|
|
1092
|
-
query
|
|
1093
|
-
);
|
|
1094
|
-
}
|
|
1095
|
-
).test(
|
|
1096
|
-
RULES.BETWEEN_RULE,
|
|
1097
|
-
RULES.BETWEEN_RULE,
|
|
1098
|
-
(query) => {
|
|
1099
|
-
return testQuery(
|
|
1100
|
-
RULES.BETWEEN_RULE,
|
|
1101
|
-
query
|
|
1102
|
-
);
|
|
1103
|
-
}
|
|
1104
|
-
)
|
|
1105
|
-
})
|
|
1106
|
-
})
|
|
1107
|
-
};
|
|
1108
|
-
function isSupportedEquipmentType(equipmentType) {
|
|
1109
|
-
return Object.values(EXPERT_FILTER_EQUIPMENTS).map((equipments) => equipments.id).includes(equipmentType);
|
|
1110
|
-
}
|
|
1111
|
-
const defaultQuery = {
|
|
1112
|
-
combinator: COMBINATOR_OPTIONS.AND.name,
|
|
1113
|
-
rules: [
|
|
1114
|
-
{
|
|
1115
|
-
id: v4(),
|
|
1116
|
-
field: FieldType.ID,
|
|
1117
|
-
operator: OPERATOR_OPTIONS.CONTAINS.name,
|
|
1118
|
-
value: ""
|
|
1119
|
-
}
|
|
1120
|
-
]
|
|
1121
|
-
};
|
|
1122
|
-
function getExpertFilterEmptyFormData() {
|
|
1123
|
-
return {
|
|
1124
|
-
[EXPERT_FILTER_QUERY]: defaultQuery
|
|
1125
|
-
};
|
|
1126
|
-
}
|
|
1127
|
-
const ExpertFilterForm = () => {
|
|
1128
|
-
const intl = useIntl();
|
|
1129
|
-
const { getValues, setValue } = useFormContext();
|
|
1130
|
-
const openConfirmationPopup = useCallback(() => {
|
|
1131
|
-
return formatQuery(getValues(EXPERT_FILTER_QUERY), "json_without_ids") !== formatQuery(defaultQuery, "json_without_ids");
|
|
1132
|
-
}, [getValues]);
|
|
1133
|
-
const handleResetOnConfirmation = useCallback(() => {
|
|
1134
|
-
setValue(EXPERT_FILTER_QUERY, defaultQuery);
|
|
1135
|
-
}, [setValue]);
|
|
1136
|
-
const watchEquipmentType = useWatch({
|
|
1137
|
-
name: FieldConstants.EQUIPMENT_TYPE
|
|
1138
|
-
});
|
|
1139
|
-
const translatedFields = useMemo(() => {
|
|
1140
|
-
var _a;
|
|
1141
|
-
return (_a = fields[watchEquipmentType]) == null ? void 0 : _a.map((field) => {
|
|
1142
|
-
return {
|
|
1143
|
-
...field,
|
|
1144
|
-
label: intl.formatMessage({ id: field.label })
|
|
1145
|
-
};
|
|
1146
|
-
});
|
|
1147
|
-
}, [intl, watchEquipmentType]);
|
|
1148
|
-
return /* @__PURE__ */ jsxs(Grid, { container: true, item: true, spacing: 2, children: [
|
|
1149
|
-
/* @__PURE__ */ jsx(Grid, { item: true, xs: 12, children: /* @__PURE__ */ jsx(
|
|
1150
|
-
InputWithPopupConfirmation,
|
|
1151
|
-
{
|
|
1152
|
-
Input: SelectInput,
|
|
1153
|
-
name: FieldConstants.EQUIPMENT_TYPE,
|
|
1154
|
-
options: Object.values(EXPERT_FILTER_EQUIPMENTS),
|
|
1155
|
-
label: "equipmentType",
|
|
1156
|
-
shouldOpenPopup: openConfirmationPopup,
|
|
1157
|
-
resetOnConfirmation: handleResetOnConfirmation,
|
|
1158
|
-
message: "changeTypeMessage",
|
|
1159
|
-
validateButtonLabel: "button.changeType"
|
|
1160
|
-
}
|
|
1161
|
-
) }),
|
|
1162
|
-
watchEquipmentType && isSupportedEquipmentType(watchEquipmentType) && /* @__PURE__ */ jsx(
|
|
1163
|
-
CustomReactQueryBuilder,
|
|
1164
|
-
{
|
|
1165
|
-
name: EXPERT_FILTER_QUERY,
|
|
1166
|
-
fields: translatedFields
|
|
1167
|
-
}
|
|
1168
|
-
)
|
|
1169
|
-
] });
|
|
1170
|
-
};
|
|
1171
|
-
const FilterForm = (props) => {
|
|
1172
|
-
const { setValue } = useFormContext();
|
|
1173
|
-
const filterType = useWatch({ name: FieldConstants.FILTER_TYPE });
|
|
1174
|
-
const handleChange = (_event, value) => {
|
|
1175
|
-
setValue(FieldConstants.FILTER_TYPE, value);
|
|
1176
|
-
};
|
|
1177
|
-
useEffect(() => {
|
|
1178
|
-
if (props.sourceFilterForExplicitNamingConversion) {
|
|
1179
|
-
setValue(FieldConstants.FILTER_TYPE, FilterType.EXPLICIT_NAMING.id);
|
|
1180
|
-
}
|
|
1181
|
-
}, [props.sourceFilterForExplicitNamingConversion, setValue]);
|
|
1182
|
-
return /* @__PURE__ */ jsxs(Grid$1, { container: true, spacing: 2, children: [
|
|
1183
|
-
/* @__PURE__ */ jsx(Grid$1, { item: true, xs: 12, children: /* @__PURE__ */ jsx(
|
|
1184
|
-
UniqueNameInput,
|
|
1185
|
-
{
|
|
1186
|
-
name: FieldConstants.NAME,
|
|
1187
|
-
label: "nameProperty",
|
|
1188
|
-
elementType: ElementType.FILTER,
|
|
1189
|
-
autoFocus: props.creation,
|
|
1190
|
-
activeDirectory: props.activeDirectory,
|
|
1191
|
-
elementExists: props.elementExists
|
|
1192
|
-
}
|
|
1193
|
-
) }),
|
|
1194
|
-
props.creation && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1195
|
-
/* @__PURE__ */ jsx(Grid$1, { item: true, xs: 12, children: /* @__PURE__ */ jsx(ExpandableGroup, { renderHeader: "Description", children: /* @__PURE__ */ jsx(
|
|
1196
|
-
ExpandingTextField,
|
|
1197
|
-
{
|
|
1198
|
-
name: FieldConstants.DESCRIPTION,
|
|
1199
|
-
label: "descriptionProperty",
|
|
1200
|
-
minRows: 3,
|
|
1201
|
-
rows: 5
|
|
1202
|
-
}
|
|
1203
|
-
) }) }),
|
|
1204
|
-
!props.sourceFilterForExplicitNamingConversion && /* @__PURE__ */ jsx(Grid$1, { item: true, children: /* @__PURE__ */ jsx(
|
|
1205
|
-
RadioInput,
|
|
1206
|
-
{
|
|
1207
|
-
name: FieldConstants.FILTER_TYPE,
|
|
1208
|
-
options: Object.values(FilterType),
|
|
1209
|
-
formProps: { onChange: handleChange }
|
|
1210
|
-
}
|
|
1211
|
-
) })
|
|
1212
|
-
] }),
|
|
1213
|
-
filterType === FilterType.CRITERIA_BASED.id && /* @__PURE__ */ jsx(CriteriaBasedFilterForm, {}),
|
|
1214
|
-
filterType === FilterType.EXPLICIT_NAMING.id && /* @__PURE__ */ jsx(
|
|
1215
|
-
ExplicitNamingFilterForm,
|
|
1216
|
-
{
|
|
1217
|
-
sourceFilterForExplicitNamingConversion: props.sourceFilterForExplicitNamingConversion
|
|
1218
|
-
}
|
|
1219
|
-
),
|
|
1220
|
-
filterType === FilterType.EXPERT.id && /* @__PURE__ */ jsx(ExpertFilterForm, {})
|
|
1221
|
-
] });
|
|
1222
|
-
};
|
|
1223
|
-
const emptyFormData = {
|
|
1224
|
-
[FieldConstants.NAME]: "",
|
|
1225
|
-
[FieldConstants.DESCRIPTION]: "",
|
|
1226
|
-
[FieldConstants.FILTER_TYPE]: FilterType.CRITERIA_BASED.id,
|
|
1227
|
-
[FieldConstants.EQUIPMENT_TYPE]: null,
|
|
1228
|
-
...criteriaBasedFilterEmptyFormData,
|
|
1229
|
-
...getExplicitNamingFilterEmptyFormData(),
|
|
1230
|
-
...getExpertFilterEmptyFormData()
|
|
1231
|
-
};
|
|
1232
|
-
const formSchema$3 = yup.object().shape({
|
|
1233
|
-
[FieldConstants.NAME]: yup.string().trim().required("nameEmpty"),
|
|
1234
|
-
[FieldConstants.DESCRIPTION]: yup.string().max(500, "descriptionLimitError"),
|
|
1235
|
-
[FieldConstants.FILTER_TYPE]: yup.string().required(),
|
|
1236
|
-
[FieldConstants.EQUIPMENT_TYPE]: yup.string().required(),
|
|
1237
|
-
...criteriaBasedFilterSchema,
|
|
1238
|
-
...explicitNamingFilterSchema,
|
|
1239
|
-
...expertFilterSchema
|
|
1240
|
-
}).required();
|
|
1241
|
-
const FilterCreationDialog = ({
|
|
1242
|
-
open,
|
|
1243
|
-
onClose,
|
|
1244
|
-
activeDirectory,
|
|
1245
|
-
elementExists,
|
|
1246
|
-
language,
|
|
1247
|
-
sourceFilterForExplicitNamingConversion = void 0
|
|
1248
|
-
}) => {
|
|
1249
|
-
var _a;
|
|
1250
|
-
const { snackError } = useSnackMessage();
|
|
1251
|
-
const formMethods = useForm({
|
|
1252
|
-
defaultValues: emptyFormData,
|
|
1253
|
-
resolver: yupResolver(formSchema$3)
|
|
1254
|
-
});
|
|
1255
|
-
const {
|
|
1256
|
-
formState: { errors }
|
|
1257
|
-
} = formMethods;
|
|
1258
|
-
const nameError = errors[FieldConstants.NAME];
|
|
1259
|
-
const isValidating = (_a = errors.root) == null ? void 0 : _a.isValidating;
|
|
1260
|
-
const onSubmit = useCallback(
|
|
1261
|
-
(filterForm) => {
|
|
1262
|
-
if (filterForm[FieldConstants.FILTER_TYPE] === FilterType.EXPLICIT_NAMING.id) {
|
|
1263
|
-
saveExplicitNamingFilter(
|
|
1264
|
-
filterForm[FILTER_EQUIPMENTS_ATTRIBUTES],
|
|
1265
|
-
true,
|
|
1266
|
-
filterForm[FieldConstants.EQUIPMENT_TYPE],
|
|
1267
|
-
filterForm[FieldConstants.NAME],
|
|
1268
|
-
filterForm[FieldConstants.DESCRIPTION],
|
|
1269
|
-
null,
|
|
1270
|
-
(error) => {
|
|
1271
|
-
snackError({
|
|
1272
|
-
messageTxt: error
|
|
1273
|
-
});
|
|
1274
|
-
},
|
|
1275
|
-
onClose,
|
|
1276
|
-
activeDirectory
|
|
1277
|
-
);
|
|
1278
|
-
} else if (filterForm[FieldConstants.FILTER_TYPE] === FilterType.CRITERIA_BASED.id) {
|
|
1279
|
-
saveCriteriaBasedFilter(
|
|
1280
|
-
filterForm,
|
|
1281
|
-
activeDirectory,
|
|
1282
|
-
onClose,
|
|
1283
|
-
(error) => {
|
|
1284
|
-
snackError({
|
|
1285
|
-
messageTxt: error
|
|
1286
|
-
});
|
|
1287
|
-
}
|
|
1288
|
-
);
|
|
1289
|
-
} else if (filterForm[FieldConstants.FILTER_TYPE] === FilterType.EXPERT.id) {
|
|
1290
|
-
saveExpertFilter(
|
|
1291
|
-
null,
|
|
1292
|
-
filterForm[EXPERT_FILTER_QUERY],
|
|
1293
|
-
filterForm[FieldConstants.EQUIPMENT_TYPE],
|
|
1294
|
-
filterForm[FieldConstants.NAME],
|
|
1295
|
-
filterForm[FieldConstants.DESCRIPTION],
|
|
1296
|
-
true,
|
|
1297
|
-
activeDirectory,
|
|
1298
|
-
onClose,
|
|
1299
|
-
(error) => {
|
|
1300
|
-
snackError({
|
|
1301
|
-
messageTxt: error
|
|
1302
|
-
});
|
|
1303
|
-
}
|
|
1304
|
-
);
|
|
1305
|
-
}
|
|
1306
|
-
},
|
|
1307
|
-
[activeDirectory, snackError, onClose]
|
|
1308
|
-
);
|
|
1309
|
-
return /* @__PURE__ */ jsx(
|
|
1310
|
-
CustomMuiDialog,
|
|
1311
|
-
{
|
|
1312
|
-
open,
|
|
1313
|
-
onClose,
|
|
1314
|
-
onSave: onSubmit,
|
|
1315
|
-
formSchema: formSchema$3,
|
|
1316
|
-
formMethods,
|
|
1317
|
-
titleId: sourceFilterForExplicitNamingConversion ? "convertIntoExplicitNamingFilter" : "createNewFilter",
|
|
1318
|
-
removeOptional: true,
|
|
1319
|
-
disabledSave: !!nameError || !!isValidating,
|
|
1320
|
-
language,
|
|
1321
|
-
children: /* @__PURE__ */ jsx(
|
|
1322
|
-
FilterForm,
|
|
1323
|
-
{
|
|
1324
|
-
creation: true,
|
|
1325
|
-
activeDirectory,
|
|
1326
|
-
elementExists,
|
|
1327
|
-
sourceFilterForExplicitNamingConversion
|
|
1328
|
-
}
|
|
1329
|
-
)
|
|
1330
|
-
}
|
|
1331
|
-
);
|
|
1332
|
-
};
|
|
1333
|
-
const formSchema$2 = yup.object().shape({
|
|
1334
|
-
[FieldConstants.NAME]: yup.string().trim().required("nameEmpty"),
|
|
1335
|
-
[FieldConstants.FILTER_TYPE]: yup.string().required(),
|
|
1336
|
-
[FieldConstants.EQUIPMENT_TYPE]: yup.string().required(),
|
|
1337
|
-
...expertFilterSchema
|
|
1338
|
-
}).required();
|
|
1339
|
-
const ExpertFilterEditionDialog = ({
|
|
1340
|
-
id,
|
|
1341
|
-
name,
|
|
1342
|
-
titleId,
|
|
1343
|
-
open,
|
|
1344
|
-
onClose,
|
|
1345
|
-
broadcastChannel,
|
|
1346
|
-
selectionForCopy,
|
|
1347
|
-
getFilterById,
|
|
1348
|
-
setSelectionForCopy,
|
|
1349
|
-
activeDirectory,
|
|
1350
|
-
elementExists,
|
|
1351
|
-
language
|
|
1352
|
-
}) => {
|
|
1353
|
-
var _a;
|
|
1354
|
-
const { snackError } = useSnackMessage();
|
|
1355
|
-
const [dataFetchStatus, setDataFetchStatus] = useState(FetchStatus.IDLE);
|
|
1356
|
-
const formMethods = useForm({
|
|
1357
|
-
resolver: yupResolver(formSchema$2)
|
|
1358
|
-
});
|
|
1359
|
-
const {
|
|
1360
|
-
reset,
|
|
1361
|
-
formState: { errors }
|
|
1362
|
-
} = formMethods;
|
|
1363
|
-
const nameError = errors[FieldConstants.NAME];
|
|
1364
|
-
const isValidating = (_a = errors.root) == null ? void 0 : _a.isValidating;
|
|
1365
|
-
useEffect(() => {
|
|
1366
|
-
if (id && open) {
|
|
1367
|
-
setDataFetchStatus(FetchStatus.FETCHING);
|
|
1368
|
-
getFilterById(id).then((response) => {
|
|
1369
|
-
setDataFetchStatus(FetchStatus.FETCH_SUCCESS);
|
|
1370
|
-
reset({
|
|
1371
|
-
[FieldConstants.NAME]: name,
|
|
1372
|
-
[FieldConstants.FILTER_TYPE]: FilterType.EXPERT.id,
|
|
1373
|
-
[FieldConstants.EQUIPMENT_TYPE]: response[FieldConstants.EQUIPMENT_TYPE],
|
|
1374
|
-
[EXPERT_FILTER_QUERY]: importExpertRules(
|
|
1375
|
-
response[EXPERT_FILTER_QUERY]
|
|
1376
|
-
)
|
|
1377
|
-
});
|
|
1378
|
-
}).catch((error) => {
|
|
1379
|
-
setDataFetchStatus(FetchStatus.FETCH_ERROR);
|
|
1380
|
-
snackError({
|
|
1381
|
-
messageTxt: error.message,
|
|
1382
|
-
headerId: "cannotRetrieveFilter"
|
|
1383
|
-
});
|
|
1384
|
-
});
|
|
1385
|
-
}
|
|
1386
|
-
}, [id, name, open, reset, snackError, getFilterById]);
|
|
1387
|
-
const onSubmit = useCallback(
|
|
1388
|
-
(filterForm) => {
|
|
1389
|
-
saveExpertFilter(
|
|
1390
|
-
id,
|
|
1391
|
-
filterForm[EXPERT_FILTER_QUERY],
|
|
1392
|
-
filterForm[FieldConstants.EQUIPMENT_TYPE],
|
|
1393
|
-
filterForm[FieldConstants.NAME],
|
|
1394
|
-
"",
|
|
1395
|
-
// The description can not be edited from this dialog
|
|
1396
|
-
false,
|
|
1397
|
-
null,
|
|
1398
|
-
onClose,
|
|
1399
|
-
(error) => {
|
|
1400
|
-
snackError({
|
|
1401
|
-
messageTxt: error
|
|
1402
|
-
});
|
|
1403
|
-
}
|
|
1404
|
-
);
|
|
1405
|
-
if (selectionForCopy.sourceItemUuid === id) {
|
|
1406
|
-
setSelectionForCopy(noSelectionForCopy$1);
|
|
1407
|
-
broadcastChannel.postMessage({
|
|
1408
|
-
noSelectionForCopy: noSelectionForCopy$1
|
|
1409
|
-
});
|
|
1410
|
-
}
|
|
1411
|
-
},
|
|
1412
|
-
[
|
|
1413
|
-
broadcastChannel,
|
|
1414
|
-
id,
|
|
1415
|
-
onClose,
|
|
1416
|
-
selectionForCopy.sourceItemUuid,
|
|
1417
|
-
snackError,
|
|
1418
|
-
setSelectionForCopy
|
|
1419
|
-
]
|
|
1420
|
-
);
|
|
1421
|
-
const isDataReady = dataFetchStatus === FetchStatus.FETCH_SUCCESS;
|
|
1422
|
-
return /* @__PURE__ */ jsx(
|
|
1423
|
-
CustomMuiDialog,
|
|
1424
|
-
{
|
|
1425
|
-
open,
|
|
1426
|
-
onClose,
|
|
1427
|
-
onSave: onSubmit,
|
|
1428
|
-
formSchema: formSchema$2,
|
|
1429
|
-
formMethods,
|
|
1430
|
-
titleId,
|
|
1431
|
-
removeOptional: true,
|
|
1432
|
-
disabledSave: !!nameError || !!isValidating,
|
|
1433
|
-
isDataFetching: dataFetchStatus === FetchStatus.FETCHING,
|
|
1434
|
-
language,
|
|
1435
|
-
children: isDataReady && /* @__PURE__ */ jsx(
|
|
1436
|
-
FilterForm,
|
|
1437
|
-
{
|
|
1438
|
-
activeDirectory,
|
|
1439
|
-
elementExists
|
|
1440
|
-
}
|
|
1441
|
-
)
|
|
1442
|
-
}
|
|
1443
|
-
);
|
|
1444
|
-
};
|
|
1445
|
-
const formSchema$1 = yup.object().shape({
|
|
1446
|
-
[FieldConstants.NAME]: yup.string().trim().required("nameEmpty"),
|
|
1447
|
-
[FieldConstants.FILTER_TYPE]: yup.string().required(),
|
|
1448
|
-
[FieldConstants.EQUIPMENT_TYPE]: yup.string().required(),
|
|
1449
|
-
...explicitNamingFilterSchema
|
|
1450
|
-
}).required();
|
|
1451
|
-
const ExplicitNamingFilterEditionDialog = ({
|
|
1452
|
-
id,
|
|
1453
|
-
name,
|
|
1454
|
-
titleId,
|
|
1455
|
-
open,
|
|
1456
|
-
onClose,
|
|
1457
|
-
broadcastChannel,
|
|
1458
|
-
selectionForCopy,
|
|
1459
|
-
setSelectionForCopy,
|
|
1460
|
-
getFilterById,
|
|
1461
|
-
activeDirectory,
|
|
1462
|
-
elementExists,
|
|
1463
|
-
language
|
|
1464
|
-
}) => {
|
|
1465
|
-
var _a;
|
|
1466
|
-
const { snackError } = useSnackMessage();
|
|
1467
|
-
const [dataFetchStatus, setDataFetchStatus] = useState(FetchStatus.IDLE);
|
|
1468
|
-
const formMethods = useForm({
|
|
1469
|
-
resolver: yupResolver(formSchema$1)
|
|
1470
|
-
});
|
|
1471
|
-
const {
|
|
1472
|
-
reset,
|
|
1473
|
-
formState: { errors }
|
|
1474
|
-
} = formMethods;
|
|
1475
|
-
const nameError = errors[FieldConstants.NAME];
|
|
1476
|
-
const isValidating = (_a = errors.root) == null ? void 0 : _a.isValidating;
|
|
1477
|
-
useEffect(() => {
|
|
1478
|
-
if (id && open) {
|
|
1479
|
-
setDataFetchStatus(FetchStatus.FETCHING);
|
|
1480
|
-
getFilterById(id).then((response) => {
|
|
1481
|
-
setDataFetchStatus(FetchStatus.FETCH_SUCCESS);
|
|
1482
|
-
reset({
|
|
1483
|
-
[FieldConstants.NAME]: name,
|
|
1484
|
-
[FieldConstants.FILTER_TYPE]: FilterType.EXPLICIT_NAMING.id,
|
|
1485
|
-
[FieldConstants.EQUIPMENT_TYPE]: response[FieldConstants.EQUIPMENT_TYPE],
|
|
1486
|
-
[FILTER_EQUIPMENTS_ATTRIBUTES]: response[FILTER_EQUIPMENTS_ATTRIBUTES].map((row) => ({
|
|
1487
|
-
[FieldConstants.AG_GRID_ROW_UUID]: v4(),
|
|
1488
|
-
...row
|
|
1489
|
-
}))
|
|
1490
|
-
});
|
|
1491
|
-
}).catch((error) => {
|
|
1492
|
-
setDataFetchStatus(FetchStatus.FETCH_ERROR);
|
|
1493
|
-
snackError({
|
|
1494
|
-
messageTxt: error.message,
|
|
1495
|
-
headerId: "cannotRetrieveFilter"
|
|
1496
|
-
});
|
|
1497
|
-
});
|
|
1498
|
-
}
|
|
1499
|
-
}, [id, name, open, reset, snackError, getFilterById]);
|
|
1500
|
-
const onSubmit = useCallback(
|
|
1501
|
-
(filterForm) => {
|
|
1502
|
-
saveExplicitNamingFilter(
|
|
1503
|
-
filterForm[FILTER_EQUIPMENTS_ATTRIBUTES],
|
|
1504
|
-
false,
|
|
1505
|
-
filterForm[FieldConstants.EQUIPMENT_TYPE],
|
|
1506
|
-
filterForm[FieldConstants.NAME],
|
|
1507
|
-
"",
|
|
1508
|
-
// The description can not be edited from this dialog
|
|
1509
|
-
id,
|
|
1510
|
-
(error) => {
|
|
1511
|
-
snackError({
|
|
1512
|
-
messageTxt: error
|
|
1513
|
-
});
|
|
1514
|
-
},
|
|
1515
|
-
onClose
|
|
1516
|
-
);
|
|
1517
|
-
if (selectionForCopy.sourceItemUuid === id) {
|
|
1518
|
-
setSelectionForCopy(noSelectionForCopy$1);
|
|
1519
|
-
broadcastChannel.postMessage({
|
|
1520
|
-
noSelectionForCopy: noSelectionForCopy$1
|
|
1521
|
-
});
|
|
1522
|
-
}
|
|
1523
|
-
},
|
|
1524
|
-
[
|
|
1525
|
-
broadcastChannel,
|
|
1526
|
-
id,
|
|
1527
|
-
selectionForCopy,
|
|
1528
|
-
onClose,
|
|
1529
|
-
snackError,
|
|
1530
|
-
setSelectionForCopy
|
|
1531
|
-
]
|
|
1532
|
-
);
|
|
1533
|
-
const isDataReady = dataFetchStatus === FetchStatus.FETCH_SUCCESS;
|
|
1534
|
-
return /* @__PURE__ */ jsx(
|
|
1535
|
-
CustomMuiDialog,
|
|
1536
|
-
{
|
|
1537
|
-
open,
|
|
1538
|
-
onClose,
|
|
1539
|
-
onSave: onSubmit,
|
|
1540
|
-
formSchema: formSchema$1,
|
|
1541
|
-
formMethods,
|
|
1542
|
-
titleId,
|
|
1543
|
-
removeOptional: true,
|
|
1544
|
-
disabledSave: !!nameError || !!isValidating,
|
|
1545
|
-
isDataFetching: dataFetchStatus === FetchStatus.FETCHING,
|
|
1546
|
-
language,
|
|
1547
|
-
children: isDataReady && /* @__PURE__ */ jsx(
|
|
1548
|
-
FilterForm,
|
|
1549
|
-
{
|
|
1550
|
-
activeDirectory,
|
|
1551
|
-
elementExists
|
|
1552
|
-
}
|
|
1553
|
-
)
|
|
1554
|
-
}
|
|
1555
|
-
);
|
|
1556
|
-
};
|
|
1557
|
-
ExplicitNamingFilterEditionDialog.prototype = {
|
|
1558
|
-
id: PropTypes.string,
|
|
1559
|
-
name: PropTypes.string,
|
|
1560
|
-
titleId: PropTypes.string.isRequired,
|
|
1561
|
-
open: PropTypes.bool,
|
|
1562
|
-
onClose: PropTypes.func.isRequired
|
|
1563
|
-
};
|
|
1564
|
-
const noSelectionForCopy = {
|
|
1565
|
-
sourceItemUuid: null,
|
|
1566
|
-
name: null,
|
|
1567
|
-
description: null,
|
|
1568
|
-
parentDirectoryUuid: null
|
|
1569
|
-
};
|
|
1570
|
-
const formSchema = yup.object().shape({
|
|
1571
|
-
[FieldConstants.NAME]: yup.string().trim().required("nameEmpty"),
|
|
1572
|
-
[FieldConstants.FILTER_TYPE]: yup.string().required(),
|
|
1573
|
-
[FieldConstants.EQUIPMENT_TYPE]: yup.string().required(),
|
|
1574
|
-
...criteriaBasedFilterSchema
|
|
1575
|
-
}).required();
|
|
1576
|
-
const CriteriaBasedFilterEditionDialog = ({
|
|
1577
|
-
id,
|
|
1578
|
-
name,
|
|
1579
|
-
titleId,
|
|
1580
|
-
open,
|
|
1581
|
-
onClose,
|
|
1582
|
-
broadcastChannel,
|
|
1583
|
-
getFilterById,
|
|
1584
|
-
selectionForCopy,
|
|
1585
|
-
setSelelectionForCopy,
|
|
1586
|
-
activeDirectory,
|
|
1587
|
-
elementExists,
|
|
1588
|
-
language
|
|
1589
|
-
}) => {
|
|
1590
|
-
var _a;
|
|
1591
|
-
const { snackError } = useSnackMessage();
|
|
1592
|
-
const [dataFetchStatus, setDataFetchStatus] = useState(FetchStatus.IDLE);
|
|
1593
|
-
const formMethods = useForm({
|
|
1594
|
-
resolver: yupResolver(formSchema)
|
|
1595
|
-
});
|
|
1596
|
-
const {
|
|
1597
|
-
reset,
|
|
1598
|
-
formState: { errors }
|
|
1599
|
-
} = formMethods;
|
|
1600
|
-
const nameError = errors[FieldConstants.NAME];
|
|
1601
|
-
const isValidating = (_a = errors.root) == null ? void 0 : _a.isValidating;
|
|
1602
|
-
useEffect(() => {
|
|
1603
|
-
if (id && open) {
|
|
1604
|
-
setDataFetchStatus(FetchStatus.FETCHING);
|
|
1605
|
-
getFilterById(id).then((response) => {
|
|
1606
|
-
setDataFetchStatus(FetchStatus.FETCH_SUCCESS);
|
|
1607
|
-
reset({
|
|
1608
|
-
[FieldConstants.NAME]: name,
|
|
1609
|
-
[FieldConstants.FILTER_TYPE]: FilterType.CRITERIA_BASED.id,
|
|
1610
|
-
...backToFrontTweak(response)
|
|
1611
|
-
});
|
|
1612
|
-
}).catch((error) => {
|
|
1613
|
-
setDataFetchStatus(FetchStatus.FETCH_ERROR);
|
|
1614
|
-
snackError({
|
|
1615
|
-
messageTxt: error.message,
|
|
1616
|
-
headerId: "cannotRetrieveFilter"
|
|
1617
|
-
});
|
|
1618
|
-
});
|
|
1619
|
-
}
|
|
1620
|
-
}, [id, name, open, reset, snackError, getFilterById]);
|
|
1621
|
-
const onSubmit = useCallback(
|
|
1622
|
-
(filterForm) => {
|
|
1623
|
-
saveFilter(
|
|
1624
|
-
frontToBackTweak(id, filterForm),
|
|
1625
|
-
filterForm[FieldConstants.NAME]
|
|
1626
|
-
).then(() => {
|
|
1627
|
-
if (selectionForCopy.sourceItemUuid === id) {
|
|
1628
|
-
setSelelectionForCopy(noSelectionForCopy);
|
|
1629
|
-
broadcastChannel.postMessage({
|
|
1630
|
-
noSelectionForCopy
|
|
1631
|
-
});
|
|
1632
|
-
}
|
|
1633
|
-
}).catch((error) => {
|
|
1634
|
-
snackError({
|
|
1635
|
-
messageTxt: error.message
|
|
1636
|
-
});
|
|
1637
|
-
});
|
|
1638
|
-
},
|
|
1639
|
-
[
|
|
1640
|
-
broadcastChannel,
|
|
1641
|
-
id,
|
|
1642
|
-
selectionForCopy.sourceItemUuid,
|
|
1643
|
-
snackError,
|
|
1644
|
-
setSelelectionForCopy
|
|
1645
|
-
]
|
|
1646
|
-
);
|
|
1647
|
-
const isDataReady = dataFetchStatus === FetchStatus.FETCH_SUCCESS;
|
|
1648
|
-
return /* @__PURE__ */ jsx(
|
|
1649
|
-
CustomMuiDialog,
|
|
1650
|
-
{
|
|
1651
|
-
open,
|
|
1652
|
-
onClose,
|
|
1653
|
-
onSave: onSubmit,
|
|
1654
|
-
formSchema,
|
|
1655
|
-
formMethods,
|
|
1656
|
-
titleId,
|
|
1657
|
-
removeOptional: true,
|
|
1658
|
-
disabledSave: !!nameError || !!isValidating,
|
|
1659
|
-
isDataFetching: dataFetchStatus === FetchStatus.FETCHING,
|
|
1660
|
-
language,
|
|
1661
|
-
children: isDataReady && /* @__PURE__ */ jsx(
|
|
1662
|
-
FilterForm,
|
|
1663
|
-
{
|
|
1664
|
-
activeDirectory,
|
|
1665
|
-
elementExists
|
|
1666
|
-
}
|
|
1667
|
-
)
|
|
1668
|
-
}
|
|
1669
|
-
);
|
|
1670
|
-
};
|
|
1671
|
-
export {
|
|
1672
|
-
BottomRightButtons as B,
|
|
1673
|
-
CustomAgGridTable as C,
|
|
1674
|
-
ExpertFilterEditionDialog as E,
|
|
1675
|
-
FilterCreationDialog as F,
|
|
1676
|
-
ROW_DRAGGING_SELECTION_COLUMN_DEF as R,
|
|
1677
|
-
ValueEditor as V,
|
|
1678
|
-
ExplicitNamingFilterEditionDialog as a,
|
|
1679
|
-
CriteriaBasedFilterEditionDialog as b,
|
|
1680
|
-
CsvUploader as c,
|
|
1681
|
-
FILTER_EQUIPMENTS_ATTRIBUTES as d,
|
|
1682
|
-
explicitNamingFilterSchema as e,
|
|
1683
|
-
ExplicitNamingFilterForm as f,
|
|
1684
|
-
getExplicitNamingFilterEmptyFormData as g,
|
|
1685
|
-
RemoveButton as h,
|
|
1686
|
-
ElementValueEditor as i,
|
|
1687
|
-
CustomReactQueryBuilder as j,
|
|
1688
|
-
EXPERT_FILTER_QUERY as k,
|
|
1689
|
-
expertFilterSchema as l,
|
|
1690
|
-
getExpertFilterEmptyFormData as m,
|
|
1691
|
-
ExpertFilterForm as n,
|
|
1692
|
-
FilterForm as o,
|
|
1693
|
-
noSelectionForCopy as p
|
|
1694
|
-
};
|