@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,19 +1,139 @@
|
|
|
1
|
-
import "react/jsx-runtime";
|
|
2
|
-
import "react";
|
|
3
|
-
import "prop-types";
|
|
4
|
-
import "
|
|
5
|
-
import "
|
|
6
|
-
import "
|
|
7
|
-
import "
|
|
8
|
-
import "
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useState, useEffect, useCallback } from "react";
|
|
3
|
+
import PropTypes from "prop-types";
|
|
4
|
+
import { useForm } from "react-hook-form";
|
|
5
|
+
import { yupResolver } from "@hookform/resolvers/yup";
|
|
6
|
+
import { v4 } from "uuid";
|
|
7
|
+
import { saveExplicitNamingFilter } from "../utils/filter-api.js";
|
|
8
|
+
import { useSnackMessage } from "../../../hooks/useSnackMessage.js";
|
|
9
|
+
import CustomMuiDialog from "../../dialogs/custom-mui-dialog.js";
|
|
9
10
|
import "../../../utils/yup-config.js";
|
|
10
|
-
import {
|
|
11
|
-
import "../../../utils/field-constants.js";
|
|
12
|
-
import "
|
|
13
|
-
import "../../../utils/equipment-types.js";
|
|
14
|
-
import "../constants/filter-constants.js";
|
|
15
|
-
import "../../../utils/FetchStatus.js";
|
|
16
|
-
import "yup";
|
|
11
|
+
import { explicitNamingFilterSchema, FILTER_EQUIPMENTS_ATTRIBUTES } from "./explicit-naming-filter-form.js";
|
|
12
|
+
import FieldConstants from "../../../utils/field-constants.js";
|
|
13
|
+
import FilterForm from "../filter-form.js";
|
|
14
|
+
import { noSelectionForCopy } from "../../../utils/equipment-types.js";
|
|
15
|
+
import { FilterType } from "../constants/filter-constants.js";
|
|
16
|
+
import FetchStatus from "../../../utils/FetchStatus.js";
|
|
17
|
+
import * as yup from "yup";
|
|
18
|
+
const formSchema = yup.object().shape({
|
|
19
|
+
[FieldConstants.NAME]: yup.string().trim().required("nameEmpty"),
|
|
20
|
+
[FieldConstants.FILTER_TYPE]: yup.string().required(),
|
|
21
|
+
[FieldConstants.EQUIPMENT_TYPE]: yup.string().required(),
|
|
22
|
+
...explicitNamingFilterSchema
|
|
23
|
+
}).required();
|
|
24
|
+
function ExplicitNamingFilterEditionDialog({
|
|
25
|
+
id,
|
|
26
|
+
name,
|
|
27
|
+
titleId,
|
|
28
|
+
open,
|
|
29
|
+
onClose,
|
|
30
|
+
broadcastChannel,
|
|
31
|
+
selectionForCopy,
|
|
32
|
+
setSelectionForCopy,
|
|
33
|
+
getFilterById,
|
|
34
|
+
activeDirectory,
|
|
35
|
+
elementExists,
|
|
36
|
+
language
|
|
37
|
+
}) {
|
|
38
|
+
var _a;
|
|
39
|
+
const { snackError } = useSnackMessage();
|
|
40
|
+
const [dataFetchStatus, setDataFetchStatus] = useState(FetchStatus.IDLE);
|
|
41
|
+
const formMethods = useForm({
|
|
42
|
+
resolver: yupResolver(formSchema)
|
|
43
|
+
});
|
|
44
|
+
const {
|
|
45
|
+
reset,
|
|
46
|
+
formState: { errors }
|
|
47
|
+
} = formMethods;
|
|
48
|
+
const nameError = errors[FieldConstants.NAME];
|
|
49
|
+
const isValidating = (_a = errors.root) == null ? void 0 : _a.isValidating;
|
|
50
|
+
useEffect(() => {
|
|
51
|
+
if (id && open) {
|
|
52
|
+
setDataFetchStatus(FetchStatus.FETCHING);
|
|
53
|
+
getFilterById(id).then((response) => {
|
|
54
|
+
setDataFetchStatus(FetchStatus.FETCH_SUCCESS);
|
|
55
|
+
reset({
|
|
56
|
+
[FieldConstants.NAME]: name,
|
|
57
|
+
[FieldConstants.FILTER_TYPE]: FilterType.EXPLICIT_NAMING.id,
|
|
58
|
+
[FieldConstants.EQUIPMENT_TYPE]: response[FieldConstants.EQUIPMENT_TYPE],
|
|
59
|
+
[FILTER_EQUIPMENTS_ATTRIBUTES]: response[FILTER_EQUIPMENTS_ATTRIBUTES].map((row) => ({
|
|
60
|
+
[FieldConstants.AG_GRID_ROW_UUID]: v4(),
|
|
61
|
+
...row
|
|
62
|
+
}))
|
|
63
|
+
});
|
|
64
|
+
}).catch((error) => {
|
|
65
|
+
setDataFetchStatus(FetchStatus.FETCH_ERROR);
|
|
66
|
+
snackError({
|
|
67
|
+
messageTxt: error.message,
|
|
68
|
+
headerId: "cannotRetrieveFilter"
|
|
69
|
+
});
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
}, [id, name, open, reset, snackError, getFilterById]);
|
|
73
|
+
const onSubmit = useCallback(
|
|
74
|
+
(filterForm) => {
|
|
75
|
+
saveExplicitNamingFilter(
|
|
76
|
+
filterForm[FILTER_EQUIPMENTS_ATTRIBUTES],
|
|
77
|
+
false,
|
|
78
|
+
filterForm[FieldConstants.EQUIPMENT_TYPE],
|
|
79
|
+
filterForm[FieldConstants.NAME],
|
|
80
|
+
"",
|
|
81
|
+
// The description can not be edited from this dialog
|
|
82
|
+
id,
|
|
83
|
+
(error) => {
|
|
84
|
+
snackError({
|
|
85
|
+
messageTxt: error
|
|
86
|
+
});
|
|
87
|
+
},
|
|
88
|
+
onClose
|
|
89
|
+
);
|
|
90
|
+
if (selectionForCopy.sourceItemUuid === id) {
|
|
91
|
+
setSelectionForCopy(noSelectionForCopy);
|
|
92
|
+
broadcastChannel.postMessage({
|
|
93
|
+
noSelectionForCopy
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
[
|
|
98
|
+
broadcastChannel,
|
|
99
|
+
id,
|
|
100
|
+
selectionForCopy,
|
|
101
|
+
onClose,
|
|
102
|
+
snackError,
|
|
103
|
+
setSelectionForCopy
|
|
104
|
+
]
|
|
105
|
+
);
|
|
106
|
+
const isDataReady = dataFetchStatus === FetchStatus.FETCH_SUCCESS;
|
|
107
|
+
return /* @__PURE__ */ jsx(
|
|
108
|
+
CustomMuiDialog,
|
|
109
|
+
{
|
|
110
|
+
open,
|
|
111
|
+
onClose,
|
|
112
|
+
onSave: onSubmit,
|
|
113
|
+
formSchema,
|
|
114
|
+
formMethods,
|
|
115
|
+
titleId,
|
|
116
|
+
removeOptional: true,
|
|
117
|
+
disabledSave: !!nameError || !!isValidating,
|
|
118
|
+
isDataFetching: dataFetchStatus === FetchStatus.FETCHING,
|
|
119
|
+
language,
|
|
120
|
+
children: isDataReady && /* @__PURE__ */ jsx(
|
|
121
|
+
FilterForm,
|
|
122
|
+
{
|
|
123
|
+
activeDirectory,
|
|
124
|
+
elementExists
|
|
125
|
+
}
|
|
126
|
+
)
|
|
127
|
+
}
|
|
128
|
+
);
|
|
129
|
+
}
|
|
130
|
+
ExplicitNamingFilterEditionDialog.prototype = {
|
|
131
|
+
id: PropTypes.string,
|
|
132
|
+
name: PropTypes.string,
|
|
133
|
+
titleId: PropTypes.string.isRequired,
|
|
134
|
+
open: PropTypes.bool,
|
|
135
|
+
onClose: PropTypes.func.isRequired
|
|
136
|
+
};
|
|
17
137
|
export {
|
|
18
|
-
|
|
138
|
+
ExplicitNamingFilterEditionDialog as default
|
|
19
139
|
};
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { UUID } from 'crypto';
|
|
2
1
|
import { DISTRIBUTION_KEY } from '../constants/filter-constants';
|
|
3
2
|
import { default as yup } from '../../../utils/yup-config';
|
|
4
|
-
import { FieldConstants } from '../../../utils/field-constants';
|
|
5
|
-
import {
|
|
3
|
+
import { default as FieldConstants } from '../../../utils/field-constants';
|
|
4
|
+
import { UUID } from 'crypto';
|
|
6
5
|
|
|
7
6
|
export declare const FILTER_EQUIPMENTS_ATTRIBUTES = "filterEquipmentsAttributes";
|
|
8
7
|
export declare const explicitNamingFilterSchema: {
|
|
@@ -21,10 +20,10 @@ export declare function getExplicitNamingFilterEmptyFormData(): {
|
|
|
21
20
|
};
|
|
22
21
|
export interface FilterForExplicitConversionProps {
|
|
23
22
|
id: UUID;
|
|
24
|
-
equipmentType:
|
|
23
|
+
equipmentType: string;
|
|
25
24
|
}
|
|
26
25
|
interface ExplicitNamingFilterFormProps {
|
|
27
26
|
sourceFilterForExplicitNamingConversion?: FilterForExplicitConversionProps;
|
|
28
27
|
}
|
|
29
|
-
declare
|
|
28
|
+
declare function ExplicitNamingFilterForm({ sourceFilterForExplicitNamingConversion, }: ExplicitNamingFilterFormProps): import("react/jsx-runtime").JSX.Element;
|
|
30
29
|
export default ExplicitNamingFilterForm;
|
|
@@ -1,27 +1,244 @@
|
|
|
1
|
-
import "react/jsx-runtime";
|
|
2
|
-
import "react";
|
|
3
|
-
import "
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useMemo, useCallback } from "react";
|
|
3
|
+
import { useIntl } from "react-intl";
|
|
4
|
+
import { useFormContext, useWatch } from "react-hook-form";
|
|
5
|
+
import Grid from "@mui/material/Grid";
|
|
6
|
+
import { v4 } from "uuid";
|
|
7
|
+
import FieldConstants from "../../../utils/field-constants.js";
|
|
4
8
|
import "../../../utils/yup-config.js";
|
|
5
|
-
import
|
|
6
|
-
import "react-
|
|
7
|
-
import "
|
|
8
|
-
import "
|
|
9
|
-
import "../../inputs/react-hook-form/select-inputs/
|
|
10
|
-
import "
|
|
11
|
-
import "
|
|
12
|
-
import "
|
|
13
|
-
import "
|
|
14
|
-
import "
|
|
15
|
-
import "
|
|
16
|
-
import "
|
|
17
|
-
import "
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
9
|
+
import CustomAgGridTable, { ROW_DRAGGING_SELECTION_COLUMN_DEF } from "../../inputs/react-hook-form/ag-grid-table/custom-ag-grid-table.js";
|
|
10
|
+
import SelectInput from "../../inputs/react-hook-form/select-inputs/select-input.js";
|
|
11
|
+
import { Generator, Load } from "../../../utils/equipment-types.js";
|
|
12
|
+
import NumericEditor from "../../inputs/react-hook-form/ag-grid-table/cell-editors/numericEditor.js";
|
|
13
|
+
import InputWithPopupConfirmation from "../../inputs/react-hook-form/select-inputs/input-with-popup-confirmation.js";
|
|
14
|
+
import { toFloatOrNullValue } from "../../inputs/react-hook-form/utils/functions.js";
|
|
15
|
+
import { DISTRIBUTION_KEY, FilterType } from "../constants/filter-constants.js";
|
|
16
|
+
import { FILTER_EQUIPMENTS } from "../utils/filter-form-utils.js";
|
|
17
|
+
import { useSnackMessage } from "../../../hooks/useSnackMessage.js";
|
|
18
|
+
import { ElementType } from "../../../utils/ElementType.js";
|
|
19
|
+
import ModifyElementSelection from "../../dialogs/modify-element-selection.js";
|
|
20
|
+
import { exportFilter } from "../../../services/study.js";
|
|
21
|
+
import * as yup from "yup";
|
|
22
|
+
const FILTER_EQUIPMENTS_ATTRIBUTES = "filterEquipmentsAttributes";
|
|
23
|
+
function isGeneratorOrLoad(equipmentType) {
|
|
24
|
+
return equipmentType === Generator.type || equipmentType === Load.type;
|
|
25
|
+
}
|
|
26
|
+
const explicitNamingFilterSchema = {
|
|
27
|
+
[FILTER_EQUIPMENTS_ATTRIBUTES]: yup.array().of(
|
|
28
|
+
yup.object().shape({
|
|
29
|
+
[FieldConstants.EQUIPMENT_ID]: yup.string().nullable(),
|
|
30
|
+
[DISTRIBUTION_KEY]: yup.number().nullable()
|
|
31
|
+
})
|
|
32
|
+
).compact(
|
|
33
|
+
(row) => !row[DISTRIBUTION_KEY] && !row[FieldConstants.EQUIPMENT_ID]
|
|
34
|
+
).when([FieldConstants.FILTER_TYPE], {
|
|
35
|
+
is: FilterType.EXPLICIT_NAMING.id,
|
|
36
|
+
then: (schema) => schema.min(1, "emptyFilterError").when([FieldConstants.EQUIPMENT_TYPE], {
|
|
37
|
+
is: (equipmentType) => isGeneratorOrLoad(equipmentType),
|
|
38
|
+
then: (innerSchema) => innerSchema.test(
|
|
39
|
+
"noKeyWithoutId",
|
|
40
|
+
"distributionKeyWithMissingIdError",
|
|
41
|
+
(array) => {
|
|
42
|
+
return !array.some(
|
|
43
|
+
(row) => !row[FieldConstants.EQUIPMENT_ID]
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
).test(
|
|
47
|
+
"ifOneKeyThenKeyEverywhere",
|
|
48
|
+
"missingDistributionKeyError",
|
|
49
|
+
(array) => {
|
|
50
|
+
return !(array.some(
|
|
51
|
+
(row) => row[DISTRIBUTION_KEY]
|
|
52
|
+
) && array.some(
|
|
53
|
+
(row) => !row[DISTRIBUTION_KEY]
|
|
54
|
+
));
|
|
55
|
+
}
|
|
56
|
+
)
|
|
57
|
+
})
|
|
58
|
+
})
|
|
59
|
+
};
|
|
60
|
+
function makeDefaultRowData() {
|
|
61
|
+
return {
|
|
62
|
+
[FieldConstants.AG_GRID_ROW_UUID]: v4(),
|
|
63
|
+
[FieldConstants.EQUIPMENT_ID]: "",
|
|
64
|
+
[DISTRIBUTION_KEY]: null
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
function makeDefaultTableRows() {
|
|
68
|
+
return [makeDefaultRowData(), makeDefaultRowData(), makeDefaultRowData()];
|
|
69
|
+
}
|
|
70
|
+
function getExplicitNamingFilterEmptyFormData() {
|
|
71
|
+
return {
|
|
72
|
+
[FILTER_EQUIPMENTS_ATTRIBUTES]: makeDefaultTableRows()
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
function ExplicitNamingFilterForm({
|
|
76
|
+
sourceFilterForExplicitNamingConversion
|
|
77
|
+
}) {
|
|
78
|
+
const intl = useIntl();
|
|
79
|
+
const { snackError } = useSnackMessage();
|
|
80
|
+
const { getValues, setValue } = useFormContext();
|
|
81
|
+
const watchEquipmentType = useWatch({
|
|
82
|
+
name: FieldConstants.EQUIPMENT_TYPE
|
|
83
|
+
});
|
|
84
|
+
useEffect(() => {
|
|
85
|
+
if (watchEquipmentType && !(watchEquipmentType in FILTER_EQUIPMENTS)) {
|
|
86
|
+
snackError({
|
|
87
|
+
headerId: "obsoleteFilter"
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
}, [snackError, watchEquipmentType]);
|
|
91
|
+
const forGeneratorOrLoad = isGeneratorOrLoad(watchEquipmentType);
|
|
92
|
+
useEffect(() => {
|
|
93
|
+
if (sourceFilterForExplicitNamingConversion) {
|
|
94
|
+
setValue(
|
|
95
|
+
FieldConstants.EQUIPMENT_TYPE,
|
|
96
|
+
sourceFilterForExplicitNamingConversion.equipmentType
|
|
97
|
+
);
|
|
98
|
+
}
|
|
99
|
+
}, [sourceFilterForExplicitNamingConversion, setValue]);
|
|
100
|
+
const columnDefs = useMemo(() => {
|
|
101
|
+
const newColumnDefs = [
|
|
102
|
+
...ROW_DRAGGING_SELECTION_COLUMN_DEF,
|
|
103
|
+
{
|
|
104
|
+
headerName: intl.formatMessage({
|
|
105
|
+
id: FieldConstants.EQUIPMENT_ID
|
|
106
|
+
}),
|
|
107
|
+
field: FieldConstants.EQUIPMENT_ID,
|
|
108
|
+
editable: true,
|
|
109
|
+
singleClickEdit: true,
|
|
110
|
+
valueParser: (params) => {
|
|
111
|
+
var _a;
|
|
112
|
+
return ((_a = params.newValue) == null ? void 0 : _a.trim()) ?? null;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
];
|
|
116
|
+
if (forGeneratorOrLoad) {
|
|
117
|
+
newColumnDefs.push({
|
|
118
|
+
headerName: intl.formatMessage({ id: DISTRIBUTION_KEY }),
|
|
119
|
+
field: DISTRIBUTION_KEY,
|
|
120
|
+
editable: true,
|
|
121
|
+
singleClickEdit: true,
|
|
122
|
+
cellEditor: NumericEditor,
|
|
123
|
+
maxWidth: 200
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
return newColumnDefs;
|
|
127
|
+
}, [intl, forGeneratorOrLoad]);
|
|
128
|
+
const defaultColDef = useMemo(
|
|
129
|
+
() => ({
|
|
130
|
+
suppressMovable: true
|
|
131
|
+
}),
|
|
132
|
+
[]
|
|
133
|
+
);
|
|
134
|
+
const csvFileHeaders = useMemo(() => {
|
|
135
|
+
const newCsvFileHeaders = [
|
|
136
|
+
intl.formatMessage({ id: FieldConstants.EQUIPMENT_ID })
|
|
137
|
+
];
|
|
138
|
+
if (forGeneratorOrLoad) {
|
|
139
|
+
newCsvFileHeaders.push(
|
|
140
|
+
intl.formatMessage({ id: DISTRIBUTION_KEY })
|
|
141
|
+
);
|
|
142
|
+
}
|
|
143
|
+
return newCsvFileHeaders;
|
|
144
|
+
}, [intl, forGeneratorOrLoad]);
|
|
145
|
+
const getDataFromCsvFile = useCallback((csvData) => {
|
|
146
|
+
if (csvData) {
|
|
147
|
+
return csvData.map((value) => {
|
|
148
|
+
var _a, _b;
|
|
149
|
+
return {
|
|
150
|
+
[FieldConstants.AG_GRID_ROW_UUID]: v4(),
|
|
151
|
+
[FieldConstants.EQUIPMENT_ID]: (_a = value[0]) == null ? void 0 : _a.trim(),
|
|
152
|
+
[DISTRIBUTION_KEY]: toFloatOrNullValue((_b = value[1]) == null ? void 0 : _b.trim())
|
|
153
|
+
};
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
return [];
|
|
157
|
+
}, []);
|
|
158
|
+
const openConfirmationPopup = () => {
|
|
159
|
+
return getValues(FILTER_EQUIPMENTS_ATTRIBUTES).some(
|
|
160
|
+
(row) => row[DISTRIBUTION_KEY] || row[FieldConstants.EQUIPMENT_ID]
|
|
161
|
+
);
|
|
162
|
+
};
|
|
163
|
+
const handleResetOnConfirmation = () => {
|
|
164
|
+
setValue(FILTER_EQUIPMENTS_ATTRIBUTES, makeDefaultTableRows());
|
|
165
|
+
};
|
|
166
|
+
const onStudySelected = (studyUuid) => {
|
|
167
|
+
exportFilter(studyUuid, sourceFilterForExplicitNamingConversion == null ? void 0 : sourceFilterForExplicitNamingConversion.id).then((matchingEquipments) => {
|
|
168
|
+
setValue(
|
|
169
|
+
FILTER_EQUIPMENTS_ATTRIBUTES,
|
|
170
|
+
matchingEquipments.length === 0 ? makeDefaultTableRows() : matchingEquipments.map((equipment) => ({
|
|
171
|
+
[FieldConstants.AG_GRID_ROW_UUID]: v4(),
|
|
172
|
+
[FieldConstants.EQUIPMENT_ID]: equipment.id,
|
|
173
|
+
[DISTRIBUTION_KEY]: equipment.distributionKey
|
|
174
|
+
}))
|
|
175
|
+
);
|
|
176
|
+
}).catch(
|
|
177
|
+
(error) => snackError({
|
|
178
|
+
messageTxt: error.message,
|
|
179
|
+
headerId: "convertIntoExplicitNamingFilterError"
|
|
180
|
+
})
|
|
181
|
+
);
|
|
182
|
+
};
|
|
183
|
+
return /* @__PURE__ */ jsxs(Grid, { container: true, item: true, spacing: 2, children: [
|
|
184
|
+
/* @__PURE__ */ jsxs(Grid, { item: true, xs: 12, children: [
|
|
185
|
+
/* @__PURE__ */ jsx(
|
|
186
|
+
InputWithPopupConfirmation,
|
|
187
|
+
{
|
|
188
|
+
Input: SelectInput,
|
|
189
|
+
name: FieldConstants.EQUIPMENT_TYPE,
|
|
190
|
+
options: Object.values(FILTER_EQUIPMENTS),
|
|
191
|
+
disabled: sourceFilterForExplicitNamingConversion,
|
|
192
|
+
label: "equipmentType",
|
|
193
|
+
shouldOpenPopup: openConfirmationPopup,
|
|
194
|
+
resetOnConfirmation: handleResetOnConfirmation,
|
|
195
|
+
message: "changeTypeMessage",
|
|
196
|
+
validateButtonLabel: "button.changeType"
|
|
197
|
+
}
|
|
198
|
+
),
|
|
199
|
+
sourceFilterForExplicitNamingConversion && /* @__PURE__ */ jsx(
|
|
200
|
+
ModifyElementSelection,
|
|
201
|
+
{
|
|
202
|
+
elementType: ElementType.STUDY,
|
|
203
|
+
onElementValidated: onStudySelected,
|
|
204
|
+
dialogOpeningButtonLabel: "selectStudyDialogButton",
|
|
205
|
+
dialogTitleLabel: "selectStudyDialogTitle",
|
|
206
|
+
dialogMessageLabel: "selectStudyText",
|
|
207
|
+
noElementMessageLabel: "noSelectedStudyText"
|
|
208
|
+
}
|
|
209
|
+
)
|
|
210
|
+
] }),
|
|
211
|
+
watchEquipmentType && /* @__PURE__ */ jsx(Grid, { item: true, xs: 12, children: /* @__PURE__ */ jsx(
|
|
212
|
+
CustomAgGridTable,
|
|
213
|
+
{
|
|
214
|
+
name: FILTER_EQUIPMENTS_ATTRIBUTES,
|
|
215
|
+
columnDefs,
|
|
216
|
+
defaultColDef,
|
|
217
|
+
makeDefaultRowData,
|
|
218
|
+
pagination: true,
|
|
219
|
+
paginationPageSize: 100,
|
|
220
|
+
suppressRowClickSelection: true,
|
|
221
|
+
alwaysShowVerticalScroll: true,
|
|
222
|
+
stopEditingWhenCellsLoseFocus: true,
|
|
223
|
+
csvProps: {
|
|
224
|
+
fileName: intl.formatMessage({
|
|
225
|
+
id: "filterCsvFileName"
|
|
226
|
+
}),
|
|
227
|
+
fileHeaders: csvFileHeaders,
|
|
228
|
+
getDataFromCsv: getDataFromCsvFile
|
|
229
|
+
},
|
|
230
|
+
cssProps: {
|
|
231
|
+
"& .ag-root-wrapper-body": {
|
|
232
|
+
maxHeight: "430px"
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
) })
|
|
237
|
+
] });
|
|
238
|
+
}
|
|
22
239
|
export {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
240
|
+
FILTER_EQUIPMENTS_ATTRIBUTES,
|
|
241
|
+
ExplicitNamingFilterForm as default,
|
|
242
|
+
explicitNamingFilterSchema,
|
|
243
|
+
getExplicitNamingFilterEmptyFormData
|
|
27
244
|
};
|
|
@@ -1,17 +1,16 @@
|
|
|
1
|
+
import { ElementExistsType } from '../../utils/ElementType';
|
|
1
2
|
import { UUID } from 'crypto';
|
|
2
|
-
import { elementExistsType } from './criteria-based/criteria-based-filter-edition-dialog';
|
|
3
|
-
import { FunctionComponent } from 'react';
|
|
4
3
|
|
|
5
4
|
export interface FilterCreationDialogProps {
|
|
6
5
|
open: boolean;
|
|
7
6
|
onClose: () => void;
|
|
8
7
|
activeDirectory?: UUID;
|
|
9
|
-
elementExists?:
|
|
8
|
+
elementExists?: ElementExistsType;
|
|
10
9
|
language?: string;
|
|
11
10
|
sourceFilterForExplicitNamingConversion?: {
|
|
12
11
|
id: UUID;
|
|
13
12
|
equipmentType: string;
|
|
14
13
|
};
|
|
15
14
|
}
|
|
16
|
-
declare
|
|
15
|
+
declare function FilterCreationDialog({ open, onClose, activeDirectory, elementExists, language, sourceFilterForExplicitNamingConversion, }: FilterCreationDialogProps): import("react/jsx-runtime").JSX.Element;
|
|
17
16
|
export default FilterCreationDialog;
|
|
@@ -1,16 +1,128 @@
|
|
|
1
|
-
import "react/jsx-runtime";
|
|
2
|
-
import "react";
|
|
3
|
-
import "
|
|
4
|
-
import "
|
|
5
|
-
import "
|
|
6
|
-
import "
|
|
7
|
-
import "
|
|
8
|
-
import {
|
|
9
|
-
import "
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback } from "react";
|
|
3
|
+
import { useForm } from "react-hook-form";
|
|
4
|
+
import { yupResolver } from "@hookform/resolvers/yup";
|
|
5
|
+
import { saveExplicitNamingFilter, saveCriteriaBasedFilter, saveExpertFilter } from "./utils/filter-api.js";
|
|
6
|
+
import { useSnackMessage } from "../../hooks/useSnackMessage.js";
|
|
7
|
+
import CustomMuiDialog from "../dialogs/custom-mui-dialog.js";
|
|
8
|
+
import { criteriaBasedFilterEmptyFormData, criteriaBasedFilterSchema } from "./criteria-based/criteria-based-filter-form.js";
|
|
9
|
+
import { getExplicitNamingFilterEmptyFormData, explicitNamingFilterSchema, FILTER_EQUIPMENTS_ATTRIBUTES } from "./explicit-naming/explicit-naming-filter-form.js";
|
|
10
|
+
import FieldConstants from "../../utils/field-constants.js";
|
|
10
11
|
import "../../utils/yup-config.js";
|
|
11
|
-
import "
|
|
12
|
-
import "./
|
|
13
|
-
import "
|
|
12
|
+
import FilterForm from "./filter-form.js";
|
|
13
|
+
import { getExpertFilterEmptyFormData, expertFilterSchema, EXPERT_FILTER_QUERY } from "./expert/expert-filter-form.js";
|
|
14
|
+
import { FilterType } from "./constants/filter-constants.js";
|
|
15
|
+
import * as yup from "yup";
|
|
16
|
+
const emptyFormData = {
|
|
17
|
+
[FieldConstants.NAME]: "",
|
|
18
|
+
[FieldConstants.DESCRIPTION]: "",
|
|
19
|
+
[FieldConstants.FILTER_TYPE]: FilterType.CRITERIA_BASED.id,
|
|
20
|
+
[FieldConstants.EQUIPMENT_TYPE]: null,
|
|
21
|
+
...criteriaBasedFilterEmptyFormData,
|
|
22
|
+
...getExplicitNamingFilterEmptyFormData(),
|
|
23
|
+
...getExpertFilterEmptyFormData()
|
|
24
|
+
};
|
|
25
|
+
const formSchema = yup.object().shape({
|
|
26
|
+
[FieldConstants.NAME]: yup.string().trim().required("nameEmpty"),
|
|
27
|
+
[FieldConstants.DESCRIPTION]: yup.string().max(500, "descriptionLimitError"),
|
|
28
|
+
[FieldConstants.FILTER_TYPE]: yup.string().required(),
|
|
29
|
+
[FieldConstants.EQUIPMENT_TYPE]: yup.string().required(),
|
|
30
|
+
...criteriaBasedFilterSchema,
|
|
31
|
+
...explicitNamingFilterSchema,
|
|
32
|
+
...expertFilterSchema
|
|
33
|
+
}).required();
|
|
34
|
+
function FilterCreationDialog({
|
|
35
|
+
open,
|
|
36
|
+
onClose,
|
|
37
|
+
activeDirectory,
|
|
38
|
+
elementExists,
|
|
39
|
+
language,
|
|
40
|
+
sourceFilterForExplicitNamingConversion = void 0
|
|
41
|
+
}) {
|
|
42
|
+
var _a;
|
|
43
|
+
const { snackError } = useSnackMessage();
|
|
44
|
+
const formMethods = useForm({
|
|
45
|
+
defaultValues: emptyFormData,
|
|
46
|
+
resolver: yupResolver(formSchema)
|
|
47
|
+
});
|
|
48
|
+
const {
|
|
49
|
+
formState: { errors }
|
|
50
|
+
} = formMethods;
|
|
51
|
+
const nameError = errors[FieldConstants.NAME];
|
|
52
|
+
const isValidating = (_a = errors.root) == null ? void 0 : _a.isValidating;
|
|
53
|
+
const onSubmit = useCallback(
|
|
54
|
+
(filterForm) => {
|
|
55
|
+
if (filterForm[FieldConstants.FILTER_TYPE] === FilterType.EXPLICIT_NAMING.id) {
|
|
56
|
+
saveExplicitNamingFilter(
|
|
57
|
+
filterForm[FILTER_EQUIPMENTS_ATTRIBUTES],
|
|
58
|
+
true,
|
|
59
|
+
filterForm[FieldConstants.EQUIPMENT_TYPE],
|
|
60
|
+
filterForm[FieldConstants.NAME],
|
|
61
|
+
filterForm[FieldConstants.DESCRIPTION],
|
|
62
|
+
null,
|
|
63
|
+
(error) => {
|
|
64
|
+
snackError({
|
|
65
|
+
messageTxt: error
|
|
66
|
+
});
|
|
67
|
+
},
|
|
68
|
+
onClose,
|
|
69
|
+
activeDirectory
|
|
70
|
+
);
|
|
71
|
+
} else if (filterForm[FieldConstants.FILTER_TYPE] === FilterType.CRITERIA_BASED.id) {
|
|
72
|
+
saveCriteriaBasedFilter(
|
|
73
|
+
filterForm,
|
|
74
|
+
activeDirectory,
|
|
75
|
+
onClose,
|
|
76
|
+
(error) => {
|
|
77
|
+
snackError({
|
|
78
|
+
messageTxt: error
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
);
|
|
82
|
+
} else if (filterForm[FieldConstants.FILTER_TYPE] === FilterType.EXPERT.id) {
|
|
83
|
+
saveExpertFilter(
|
|
84
|
+
null,
|
|
85
|
+
filterForm[EXPERT_FILTER_QUERY],
|
|
86
|
+
filterForm[FieldConstants.EQUIPMENT_TYPE],
|
|
87
|
+
filterForm[FieldConstants.NAME],
|
|
88
|
+
filterForm[FieldConstants.DESCRIPTION],
|
|
89
|
+
true,
|
|
90
|
+
activeDirectory,
|
|
91
|
+
onClose,
|
|
92
|
+
(error) => {
|
|
93
|
+
snackError({
|
|
94
|
+
messageTxt: error
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
);
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
[activeDirectory, snackError, onClose]
|
|
101
|
+
);
|
|
102
|
+
return /* @__PURE__ */ jsx(
|
|
103
|
+
CustomMuiDialog,
|
|
104
|
+
{
|
|
105
|
+
open,
|
|
106
|
+
onClose,
|
|
107
|
+
onSave: onSubmit,
|
|
108
|
+
formSchema,
|
|
109
|
+
formMethods,
|
|
110
|
+
titleId: sourceFilterForExplicitNamingConversion ? "convertIntoExplicitNamingFilter" : "createNewFilter",
|
|
111
|
+
removeOptional: true,
|
|
112
|
+
disabledSave: !!nameError || !!isValidating,
|
|
113
|
+
language,
|
|
114
|
+
children: /* @__PURE__ */ jsx(
|
|
115
|
+
FilterForm,
|
|
116
|
+
{
|
|
117
|
+
creation: true,
|
|
118
|
+
activeDirectory,
|
|
119
|
+
elementExists,
|
|
120
|
+
sourceFilterForExplicitNamingConversion
|
|
121
|
+
}
|
|
122
|
+
)
|
|
123
|
+
}
|
|
124
|
+
);
|
|
125
|
+
}
|
|
14
126
|
export {
|
|
15
|
-
|
|
127
|
+
FilterCreationDialog as default
|
|
16
128
|
};
|
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ElementExistsType } from '../../utils/ElementType';
|
|
2
2
|
import { UUID } from 'crypto';
|
|
3
|
-
import { FunctionComponent } from 'react';
|
|
4
3
|
|
|
5
4
|
interface FilterFormProps {
|
|
6
5
|
creation?: boolean;
|
|
7
6
|
activeDirectory?: UUID;
|
|
8
|
-
elementExists?:
|
|
7
|
+
elementExists?: ElementExistsType;
|
|
9
8
|
sourceFilterForExplicitNamingConversion?: {
|
|
10
9
|
id: UUID;
|
|
11
10
|
equipmentType: string;
|
|
12
11
|
};
|
|
13
12
|
}
|
|
14
|
-
|
|
15
|
-
export
|
|
13
|
+
declare function FilterForm(props: FilterFormProps): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export default FilterForm;
|