@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,11 +1,11 @@
|
|
|
1
1
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useState, useRef, useCallback, useEffect } from "react";
|
|
3
3
|
import { useIntl } from "react-intl";
|
|
4
|
-
import { toNestedGlobalSelectors, makeComposeClasses } from "../../utils/styles.js";
|
|
5
4
|
import { styled } from "@mui/system";
|
|
6
5
|
import { Dialog, DialogTitle, DialogContent, DialogContentText, DialogActions, Button, Typography } from "@mui/material";
|
|
7
6
|
import { TreeView, TreeItem } from "@mui/x-tree-view";
|
|
8
7
|
import { ChevronRight, ExpandMore, Check } from "@mui/icons-material";
|
|
8
|
+
import { toNestedGlobalSelectors, makeComposeClasses } from "../../utils/styles.js";
|
|
9
9
|
import CancelButton from "../inputs/react-hook-form/utils/cancel-button.js";
|
|
10
10
|
const cssDialogPaper = "dialogPaper";
|
|
11
11
|
const cssLabelRoot = "labelRoot";
|
|
@@ -35,7 +35,7 @@ const defaultStyles = {
|
|
|
35
35
|
};
|
|
36
36
|
const generateTreeViewFinderClass = (className) => `GsiTreeViewFinder-${className}`;
|
|
37
37
|
const composeClasses = makeComposeClasses(generateTreeViewFinderClass);
|
|
38
|
-
|
|
38
|
+
function TreeViewFinder(props) {
|
|
39
39
|
const intl = useIntl();
|
|
40
40
|
const {
|
|
41
41
|
classes = {},
|
|
@@ -65,18 +65,18 @@ const TreeViewFinder = (props) => {
|
|
|
65
65
|
);
|
|
66
66
|
const scrollRef = useRef([]);
|
|
67
67
|
const [autoScrollAllowed, setAutoScrollAllowed] = useState(true);
|
|
68
|
-
const isSelectable = (node) => {
|
|
69
|
-
return onlyLeaves ? isLeaf(node) : true;
|
|
70
|
-
};
|
|
71
68
|
const isLeaf = (node) => {
|
|
72
69
|
return node && node.children === void 0;
|
|
73
70
|
};
|
|
71
|
+
const isSelectable = (node) => {
|
|
72
|
+
return onlyLeaves ? isLeaf(node) : true;
|
|
73
|
+
};
|
|
74
74
|
const isValidationDisabled = () => {
|
|
75
75
|
return (selected == null ? void 0 : selected.length) === 0 || (selected == null ? void 0 : selected.length) === (selectedProp == null ? void 0 : selectedProp.length) && (selected == null ? void 0 : selected.every((nodeId) => selectedProp == null ? void 0 : selectedProp.includes(nodeId)));
|
|
76
76
|
};
|
|
77
77
|
const computeMapPrintedNodes = useCallback(
|
|
78
78
|
(nodes) => {
|
|
79
|
-
|
|
79
|
+
const newMapPrintedNodes = {};
|
|
80
80
|
nodes == null ? void 0 : nodes.forEach((node) => {
|
|
81
81
|
newMapPrintedNodes[node.id] = node;
|
|
82
82
|
if (!isLeaf(node)) {
|
|
@@ -91,7 +91,7 @@ const TreeViewFinder = (props) => {
|
|
|
91
91
|
[]
|
|
92
92
|
);
|
|
93
93
|
useEffect(() => {
|
|
94
|
-
|
|
94
|
+
const newMapPrintedNodes = computeMapPrintedNodes(data);
|
|
95
95
|
setMapPrintedNodes(newMapPrintedNodes);
|
|
96
96
|
}, [data, computeMapPrintedNodes]);
|
|
97
97
|
const computeSelectedNodes = () => {
|
|
@@ -105,7 +105,7 @@ const TreeViewFinder = (props) => {
|
|
|
105
105
|
const handleNodeToggle = (_e, nodeIds) => {
|
|
106
106
|
nodeIds.every((nodeId) => {
|
|
107
107
|
if (!(expanded == null ? void 0 : expanded.includes(nodeId))) {
|
|
108
|
-
onTreeBrowse
|
|
108
|
+
onTreeBrowse == null ? void 0 : onTreeBrowse(nodeId);
|
|
109
109
|
return false;
|
|
110
110
|
}
|
|
111
111
|
return true;
|
|
@@ -118,7 +118,7 @@ const TreeViewFinder = (props) => {
|
|
|
118
118
|
}
|
|
119
119
|
if (selectedProp.length > 0) {
|
|
120
120
|
setSelected((oldSelectedNodes) => [
|
|
121
|
-
...oldSelectedNodes
|
|
121
|
+
...oldSelectedNodes ?? [],
|
|
122
122
|
...selectedProp
|
|
123
123
|
]);
|
|
124
124
|
}
|
|
@@ -129,7 +129,7 @@ const TreeViewFinder = (props) => {
|
|
|
129
129
|
}
|
|
130
130
|
if (expandedProp.length > 0) {
|
|
131
131
|
setExpanded((oldExpandedNodes) => [
|
|
132
|
-
...oldExpandedNodes
|
|
132
|
+
...oldExpandedNodes ?? [],
|
|
133
133
|
...expandedProp
|
|
134
134
|
]);
|
|
135
135
|
}
|
|
@@ -158,35 +158,32 @@ const TreeViewFinder = (props) => {
|
|
|
158
158
|
setSelected(
|
|
159
159
|
values.filter((nodeId) => isSelectable(mapPrintedNodes[nodeId]))
|
|
160
160
|
);
|
|
161
|
-
} else {
|
|
162
|
-
if (
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
);
|
|
169
|
-
}
|
|
161
|
+
} else if (!Array.isArray(values)) {
|
|
162
|
+
if (selected == null ? void 0 : selected.includes(values)) {
|
|
163
|
+
setSelected([]);
|
|
164
|
+
} else {
|
|
165
|
+
setSelected(
|
|
166
|
+
isSelectable(mapPrintedNodes[values]) ? [values] : []
|
|
167
|
+
);
|
|
170
168
|
}
|
|
171
169
|
}
|
|
172
170
|
};
|
|
173
171
|
const getValidationButtonText = () => {
|
|
174
172
|
if (validationButtonText) {
|
|
175
173
|
return validationButtonText;
|
|
174
|
+
}
|
|
175
|
+
let buttonLabelId = "";
|
|
176
|
+
if (Array.isArray(selectedProp)) {
|
|
177
|
+
buttonLabelId = (selectedProp == null ? void 0 : selectedProp.length) > 0 ? "treeview_finder/replaceElementsValidation" : "treeview_finder/addElementsValidation";
|
|
176
178
|
} else {
|
|
177
|
-
|
|
178
|
-
if (Array.isArray(selectedProp)) {
|
|
179
|
-
buttonLabelId = (selectedProp == null ? void 0 : selectedProp.length) > 0 ? "treeview_finder/replaceElementsValidation" : "treeview_finder/addElementsValidation";
|
|
180
|
-
} else {
|
|
181
|
-
buttonLabelId = selectedProp ? "treeview_finder/replaceElementsValidation" : "treeview_finder/addElementsValidation";
|
|
182
|
-
}
|
|
183
|
-
return intl.formatMessage(
|
|
184
|
-
{ id: buttonLabelId },
|
|
185
|
-
{
|
|
186
|
-
nbElements: selected == null ? void 0 : selected.length
|
|
187
|
-
}
|
|
188
|
-
);
|
|
179
|
+
buttonLabelId = selectedProp ? "treeview_finder/replaceElementsValidation" : "treeview_finder/addElementsValidation";
|
|
189
180
|
}
|
|
181
|
+
return intl.formatMessage(
|
|
182
|
+
{ id: buttonLabelId },
|
|
183
|
+
{
|
|
184
|
+
nbElements: selected == null ? void 0 : selected.length
|
|
185
|
+
}
|
|
186
|
+
);
|
|
190
187
|
};
|
|
191
188
|
const getNodeIcon = (node) => {
|
|
192
189
|
if (!node) {
|
|
@@ -194,13 +191,11 @@ const TreeViewFinder = (props) => {
|
|
|
194
191
|
}
|
|
195
192
|
if (isSelectable(node) && (selected == null ? void 0 : selected.find((nodeId) => nodeId === node.id))) {
|
|
196
193
|
return /* @__PURE__ */ jsx(Check, { className: composeClasses(classes, cssLabelIcon) });
|
|
197
|
-
} else {
|
|
198
|
-
if (node.icon) {
|
|
199
|
-
return /* @__PURE__ */ jsx("div", { className: composeClasses(classes, cssLabelIcon), children: node.icon });
|
|
200
|
-
} else {
|
|
201
|
-
return null;
|
|
202
|
-
}
|
|
203
194
|
}
|
|
195
|
+
if (node.icon) {
|
|
196
|
+
return /* @__PURE__ */ jsx("div", { className: composeClasses(classes, cssLabelIcon), children: node.icon });
|
|
197
|
+
}
|
|
198
|
+
return null;
|
|
204
199
|
};
|
|
205
200
|
const renderTreeItemLabel = (node) => {
|
|
206
201
|
return /* @__PURE__ */ jsxs("div", { className: composeClasses(classes, cssLabelRoot), children: [
|
|
@@ -213,7 +208,18 @@ const TreeViewFinder = (props) => {
|
|
|
213
208
|
};
|
|
214
209
|
const renderTree = (node) => {
|
|
215
210
|
if (!node) {
|
|
216
|
-
return;
|
|
211
|
+
return null;
|
|
212
|
+
}
|
|
213
|
+
let childrenNodes = null;
|
|
214
|
+
if (Array.isArray(node.children)) {
|
|
215
|
+
if (node.children.length) {
|
|
216
|
+
const sortedChildren = node.children.sort(sortMethod);
|
|
217
|
+
childrenNodes = sortedChildren.map(
|
|
218
|
+
(child) => renderTree(child)
|
|
219
|
+
);
|
|
220
|
+
} else {
|
|
221
|
+
childrenNodes = [false];
|
|
222
|
+
}
|
|
217
223
|
}
|
|
218
224
|
return /* @__PURE__ */ jsx(
|
|
219
225
|
TreeItem,
|
|
@@ -237,7 +243,7 @@ const TreeViewFinder = (props) => {
|
|
|
237
243
|
scrollRef.current.push(element);
|
|
238
244
|
}
|
|
239
245
|
},
|
|
240
|
-
children:
|
|
246
|
+
children: childrenNodes
|
|
241
247
|
},
|
|
242
248
|
node.id
|
|
243
249
|
);
|
|
@@ -260,7 +266,7 @@ const TreeViewFinder = (props) => {
|
|
|
260
266
|
open,
|
|
261
267
|
onClose: (e, r) => {
|
|
262
268
|
if (r === "escapeKeyDown" || r === "backdropClick") {
|
|
263
|
-
onClose
|
|
269
|
+
onClose == null ? void 0 : onClose([]);
|
|
264
270
|
setSelected([]);
|
|
265
271
|
}
|
|
266
272
|
},
|
|
@@ -270,12 +276,12 @@ const TreeViewFinder = (props) => {
|
|
|
270
276
|
paper: composeClasses(classes, cssDialogPaper)
|
|
271
277
|
},
|
|
272
278
|
children: [
|
|
273
|
-
/* @__PURE__ */ jsx(DialogTitle, { id: "TreeViewFindertitle", children: title
|
|
279
|
+
/* @__PURE__ */ jsx(DialogTitle, { id: "TreeViewFindertitle", children: title ?? intl.formatMessage(
|
|
274
280
|
{ id: "treeview_finder/finderTitle" },
|
|
275
281
|
{ multiSelect }
|
|
276
282
|
) }),
|
|
277
283
|
/* @__PURE__ */ jsxs(DialogContent, { children: [
|
|
278
|
-
/* @__PURE__ */ jsx(DialogContentText, { children: contentText
|
|
284
|
+
/* @__PURE__ */ jsx(DialogContentText, { children: contentText ?? intl.formatMessage(
|
|
279
285
|
{ id: "treeview_finder/contentText" },
|
|
280
286
|
{ multiSelect }
|
|
281
287
|
) }),
|
|
@@ -296,7 +302,7 @@ const TreeViewFinder = (props) => {
|
|
|
296
302
|
{
|
|
297
303
|
style: { float: "left", margin: "5px" },
|
|
298
304
|
onClick: () => {
|
|
299
|
-
onClose
|
|
305
|
+
onClose == null ? void 0 : onClose([]);
|
|
300
306
|
setSelected([]);
|
|
301
307
|
setAutoScrollAllowed(true);
|
|
302
308
|
},
|
|
@@ -309,7 +315,7 @@ const TreeViewFinder = (props) => {
|
|
|
309
315
|
variant: "outlined",
|
|
310
316
|
style: { float: "left", margin: "5px" },
|
|
311
317
|
onClick: () => {
|
|
312
|
-
onClose
|
|
318
|
+
onClose == null ? void 0 : onClose(computeSelectedNodes());
|
|
313
319
|
setSelected([]);
|
|
314
320
|
setAutoScrollAllowed(true);
|
|
315
321
|
},
|
|
@@ -321,7 +327,7 @@ const TreeViewFinder = (props) => {
|
|
|
321
327
|
]
|
|
322
328
|
}
|
|
323
329
|
);
|
|
324
|
-
}
|
|
330
|
+
}
|
|
325
331
|
const nestedGlobalSelectorsStyles = toNestedGlobalSelectors(
|
|
326
332
|
defaultStyles,
|
|
327
333
|
generateTreeViewFinderClass
|
|
@@ -4,5 +4,5 @@
|
|
|
4
4
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
5
5
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
6
6
|
*/
|
|
7
|
-
export { default, generateTreeViewFinderClass } from './TreeViewFinder';
|
|
7
|
+
export { default as TreeViewFinder, generateTreeViewFinderClass, } from './TreeViewFinder';
|
|
8
8
|
export type { TreeViewFinderProps, TreeViewFinderNodeProps, } from './TreeViewFinder';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { MergedFormContextProps } from '../inputs/react-hook-form/provider/custom-form-provider';
|
|
2
2
|
import { FieldErrors, UseFormReturn } from 'react-hook-form';
|
|
3
|
-
import { default as React
|
|
3
|
+
import { default as React } from 'react';
|
|
4
4
|
|
|
5
5
|
import * as yup from 'yup';
|
|
6
6
|
interface ICustomMuiDialog {
|
|
@@ -18,5 +18,5 @@ interface ICustomMuiDialog {
|
|
|
18
18
|
isDataFetching?: boolean;
|
|
19
19
|
language?: string;
|
|
20
20
|
}
|
|
21
|
-
declare
|
|
21
|
+
declare function CustomMuiDialog({ open, formSchema, formMethods, onClose, onSave, isDataFetching, onValidationError, titleId, disabledSave, removeOptional, onCancel, children, language, }: ICustomMuiDialog): import("react/jsx-runtime").JSX.Element;
|
|
22
22
|
export default CustomMuiDialog;
|
|
@@ -13,7 +13,7 @@ const styles = {
|
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
15
|
};
|
|
16
|
-
|
|
16
|
+
function CustomMuiDialog({
|
|
17
17
|
open,
|
|
18
18
|
formSchema,
|
|
19
19
|
formMethods,
|
|
@@ -27,10 +27,10 @@ const CustomMuiDialog = ({
|
|
|
27
27
|
onCancel,
|
|
28
28
|
children,
|
|
29
29
|
language
|
|
30
|
-
})
|
|
30
|
+
}) {
|
|
31
31
|
const { handleSubmit } = formMethods;
|
|
32
32
|
const handleCancel = (event) => {
|
|
33
|
-
onCancel
|
|
33
|
+
onCancel == null ? void 0 : onCancel();
|
|
34
34
|
onClose(event);
|
|
35
35
|
};
|
|
36
36
|
const handleClose = (event, reason) => {
|
|
@@ -44,7 +44,7 @@ const CustomMuiDialog = ({
|
|
|
44
44
|
onClose(data);
|
|
45
45
|
};
|
|
46
46
|
const handleValidationError = (errors) => {
|
|
47
|
-
onValidationError
|
|
47
|
+
onValidationError == null ? void 0 : onValidationError(errors);
|
|
48
48
|
};
|
|
49
49
|
return /* @__PURE__ */ jsx(
|
|
50
50
|
CustomFormProvider,
|
|
@@ -83,7 +83,7 @@ const CustomMuiDialog = ({
|
|
|
83
83
|
)
|
|
84
84
|
}
|
|
85
85
|
);
|
|
86
|
-
}
|
|
86
|
+
}
|
|
87
87
|
export {
|
|
88
88
|
CustomMuiDialog as default
|
|
89
89
|
};
|
|
@@ -1,5 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2023, RTE (http://www.rte-france.com)
|
|
3
|
+
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
4
|
+
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
5
|
+
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
6
|
+
*/
|
|
3
7
|
export interface IDescriptionModificationDialog {
|
|
4
8
|
elementUuid: string;
|
|
5
9
|
description: string;
|
|
@@ -7,5 +11,5 @@ export interface IDescriptionModificationDialog {
|
|
|
7
11
|
onClose: () => void;
|
|
8
12
|
updateElement: (uuid: string, data: Record<string, string>) => Promise<void>;
|
|
9
13
|
}
|
|
10
|
-
declare
|
|
14
|
+
declare function DescriptionModificationDialog({ elementUuid, description, open, onClose, updateElement, }: IDescriptionModificationDialog): import("react/jsx-runtime").JSX.Element;
|
|
11
15
|
export default DescriptionModificationDialog;
|
|
@@ -1,18 +1,24 @@
|
|
|
1
1
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useCallback } from "react";
|
|
3
|
-
import "../../utils/yup-config.js";
|
|
4
|
-
import { FieldConstants } from "../../utils/field-constants.js";
|
|
5
3
|
import { useForm } from "react-hook-form";
|
|
6
4
|
import { yupResolver } from "@hookform/resolvers/yup";
|
|
5
|
+
import { Box } from "@mui/material";
|
|
6
|
+
import "../../utils/yup-config.js";
|
|
7
|
+
import FieldConstants from "../../utils/field-constants.js";
|
|
7
8
|
import { useSnackMessage } from "../../hooks/useSnackMessage.js";
|
|
8
9
|
import CustomMuiDialog from "./custom-mui-dialog.js";
|
|
9
10
|
import ExpandingTextField from "../inputs/react-hook-form/ExpandingTextField.js";
|
|
10
|
-
import { Box } from "@mui/material";
|
|
11
11
|
import * as yup from "yup";
|
|
12
12
|
const schema = yup.object().shape({
|
|
13
13
|
[FieldConstants.DESCRIPTION]: yup.string().max(500, "descriptionLimitError")
|
|
14
14
|
});
|
|
15
|
-
|
|
15
|
+
function DescriptionModificationDialog({
|
|
16
|
+
elementUuid,
|
|
17
|
+
description,
|
|
18
|
+
open,
|
|
19
|
+
onClose,
|
|
20
|
+
updateElement
|
|
21
|
+
}) {
|
|
16
22
|
const { snackError } = useSnackMessage();
|
|
17
23
|
const emptyFormData = {
|
|
18
24
|
[FieldConstants.DESCRIPTION]: description ?? ""
|
|
@@ -65,7 +71,7 @@ const DescriptionModificationDialog = ({ elementUuid, description, open, onClose
|
|
|
65
71
|
]
|
|
66
72
|
}
|
|
67
73
|
);
|
|
68
|
-
}
|
|
74
|
+
}
|
|
69
75
|
export {
|
|
70
76
|
DescriptionModificationDialog as default
|
|
71
77
|
};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { ElementType } from '../../utils/ElementType';
|
|
2
2
|
import { UUID } from 'crypto';
|
|
3
|
-
import { default as React } from 'react';
|
|
4
3
|
|
|
5
4
|
export interface ModifyElementSelectionProps {
|
|
6
5
|
elementType: ElementType;
|
|
@@ -10,5 +9,5 @@ export interface ModifyElementSelectionProps {
|
|
|
10
9
|
noElementMessageLabel?: string;
|
|
11
10
|
onElementValidated?: (elementId: UUID) => void;
|
|
12
11
|
}
|
|
13
|
-
declare
|
|
12
|
+
declare function ModifyElementSelection(props: ModifyElementSelectionProps): import("react/jsx-runtime").JSX.Element;
|
|
14
13
|
export default ModifyElementSelection;
|
|
@@ -3,12 +3,20 @@ import { useState, useEffect } from "react";
|
|
|
3
3
|
import { Grid, Button, Typography } from "@mui/material";
|
|
4
4
|
import { useIntl, FormattedMessage } from "react-intl";
|
|
5
5
|
import { useController } from "react-hook-form";
|
|
6
|
-
import
|
|
6
|
+
import FieldConstants from "../../utils/field-constants.js";
|
|
7
7
|
import DirectoryItemSelector from "../DirectoryItemSelector/directory-item-selector.js";
|
|
8
8
|
import { ElementType } from "../../utils/ElementType.js";
|
|
9
9
|
import { fetchDirectoryElementPath } from "../../services/directory.js";
|
|
10
|
-
|
|
10
|
+
function ModifyElementSelection(props) {
|
|
11
11
|
const intl = useIntl();
|
|
12
|
+
const {
|
|
13
|
+
elementType,
|
|
14
|
+
dialogTitleLabel,
|
|
15
|
+
dialogMessageLabel,
|
|
16
|
+
dialogOpeningButtonLabel,
|
|
17
|
+
noElementMessageLabel,
|
|
18
|
+
onElementValidated
|
|
19
|
+
} = props;
|
|
12
20
|
const [open, setOpen] = useState(false);
|
|
13
21
|
const [activeDirectoryName, setActiveDirectoryName] = useState("");
|
|
14
22
|
const {
|
|
@@ -31,8 +39,8 @@ const ModifyElementSelection = (props) => {
|
|
|
31
39
|
const handleClose = (nodes) => {
|
|
32
40
|
if (nodes.length) {
|
|
33
41
|
onChange(nodes[0].id);
|
|
34
|
-
if (
|
|
35
|
-
|
|
42
|
+
if (onElementValidated) {
|
|
43
|
+
onElementValidated(nodes[0].id);
|
|
36
44
|
}
|
|
37
45
|
}
|
|
38
46
|
setOpen(false);
|
|
@@ -56,7 +64,7 @@ const ModifyElementSelection = (props) => {
|
|
|
56
64
|
},
|
|
57
65
|
color: "primary",
|
|
58
66
|
component: "label",
|
|
59
|
-
children: /* @__PURE__ */ jsx(FormattedMessage, { id:
|
|
67
|
+
children: /* @__PURE__ */ jsx(FormattedMessage, { id: dialogOpeningButtonLabel })
|
|
60
68
|
}
|
|
61
69
|
),
|
|
62
70
|
/* @__PURE__ */ jsx(
|
|
@@ -66,9 +74,9 @@ const ModifyElementSelection = (props) => {
|
|
|
66
74
|
marginLeft: "10px",
|
|
67
75
|
fontWeight: "bold"
|
|
68
76
|
},
|
|
69
|
-
children: activeDirectoryName
|
|
70
|
-
id:
|
|
71
|
-
}) : ""
|
|
77
|
+
children: activeDirectoryName || ((props == null ? void 0 : props.noElementMessageLabel) ? intl.formatMessage({
|
|
78
|
+
id: noElementMessageLabel
|
|
79
|
+
}) : "")
|
|
72
80
|
}
|
|
73
81
|
),
|
|
74
82
|
/* @__PURE__ */ jsx(
|
|
@@ -76,24 +84,24 @@ const ModifyElementSelection = (props) => {
|
|
|
76
84
|
{
|
|
77
85
|
open,
|
|
78
86
|
onClose: handleClose,
|
|
79
|
-
types: [
|
|
80
|
-
onlyLeaves:
|
|
87
|
+
types: [elementType],
|
|
88
|
+
onlyLeaves: elementType !== ElementType.DIRECTORY,
|
|
81
89
|
multiSelect: false,
|
|
82
90
|
validationButtonText: intl.formatMessage({
|
|
83
91
|
id: "confirmDirectoryDialog"
|
|
84
92
|
}),
|
|
85
93
|
title: intl.formatMessage({
|
|
86
|
-
id:
|
|
94
|
+
id: dialogTitleLabel
|
|
87
95
|
}),
|
|
88
96
|
contentText: intl.formatMessage({
|
|
89
|
-
id:
|
|
97
|
+
id: dialogMessageLabel
|
|
90
98
|
})
|
|
91
99
|
}
|
|
92
100
|
)
|
|
93
101
|
]
|
|
94
102
|
}
|
|
95
103
|
);
|
|
96
|
-
}
|
|
104
|
+
}
|
|
97
105
|
export {
|
|
98
106
|
ModifyElementSelection as default
|
|
99
107
|
};
|
|
@@ -1,5 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2024, RTE (http://www.rte-france.com)
|
|
3
|
+
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
4
|
+
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
5
|
+
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
6
|
+
*/
|
|
3
7
|
export interface PopupConfirmationDialogProps {
|
|
4
8
|
message: string;
|
|
5
9
|
validateButtonLabel: string;
|
|
@@ -7,5 +11,5 @@ export interface PopupConfirmationDialogProps {
|
|
|
7
11
|
setOpenConfirmationPopup: (value: boolean) => void;
|
|
8
12
|
handlePopupConfirmation: () => void;
|
|
9
13
|
}
|
|
10
|
-
declare
|
|
14
|
+
declare function PopupConfirmationDialog({ message, validateButtonLabel, openConfirmationPopup, setOpenConfirmationPopup, handlePopupConfirmation, }: PopupConfirmationDialogProps): import("react/jsx-runtime").JSX.Element;
|
|
11
15
|
export default PopupConfirmationDialog;
|
|
@@ -7,13 +7,13 @@ import DialogActions from "@mui/material/DialogActions";
|
|
|
7
7
|
import Button from "@mui/material/Button";
|
|
8
8
|
import { FormattedMessage } from "react-intl";
|
|
9
9
|
import CancelButton from "../inputs/react-hook-form/utils/cancel-button.js";
|
|
10
|
-
|
|
10
|
+
function PopupConfirmationDialog({
|
|
11
11
|
message,
|
|
12
12
|
validateButtonLabel,
|
|
13
13
|
openConfirmationPopup,
|
|
14
14
|
setOpenConfirmationPopup,
|
|
15
15
|
handlePopupConfirmation
|
|
16
|
-
})
|
|
16
|
+
}) {
|
|
17
17
|
return /* @__PURE__ */ jsxs(
|
|
18
18
|
Dialog,
|
|
19
19
|
{
|
|
@@ -29,10 +29,7 @@ const PopupConfirmationDialog = ({
|
|
|
29
29
|
]
|
|
30
30
|
}
|
|
31
31
|
);
|
|
32
|
-
}
|
|
33
|
-
PopupConfirmationDialog.defaultProps = {
|
|
34
|
-
validateButtonLabel: void 0
|
|
35
|
-
};
|
|
32
|
+
}
|
|
36
33
|
export {
|
|
37
34
|
PopupConfirmationDialog as default
|
|
38
35
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ElementExistsType } from '../../../utils/ElementType';
|
|
2
2
|
import { UUID } from 'crypto';
|
|
3
|
-
import { Dispatch,
|
|
3
|
+
import { Dispatch, SetStateAction } from 'react';
|
|
4
4
|
|
|
5
5
|
export type SelectionCopy = {
|
|
6
6
|
sourceItemUuid: UUID | null;
|
|
@@ -8,7 +8,6 @@ export type SelectionCopy = {
|
|
|
8
8
|
description: string | null;
|
|
9
9
|
parentDirectoryUuid: UUID | null;
|
|
10
10
|
};
|
|
11
|
-
export type elementExistsType = (directory: UUID, value: string, elementType: ElementType) => Promise<boolean>;
|
|
12
11
|
export declare const noSelectionForCopy: SelectionCopy;
|
|
13
12
|
interface CriteriaBasedFilterEditionDialogProps {
|
|
14
13
|
id: string;
|
|
@@ -21,8 +20,8 @@ interface CriteriaBasedFilterEditionDialogProps {
|
|
|
21
20
|
selectionForCopy: SelectionCopy;
|
|
22
21
|
setSelelectionForCopy: (selection: SelectionCopy) => Dispatch<SetStateAction<SelectionCopy>>;
|
|
23
22
|
activeDirectory?: UUID;
|
|
24
|
-
elementExists?:
|
|
23
|
+
elementExists?: ElementExistsType;
|
|
25
24
|
language?: string;
|
|
26
25
|
}
|
|
27
|
-
declare
|
|
26
|
+
declare function CriteriaBasedFilterEditionDialog({ id, name, titleId, open, onClose, broadcastChannel, getFilterById, selectionForCopy, setSelelectionForCopy, activeDirectory, elementExists, language, }: CriteriaBasedFilterEditionDialogProps): import("react/jsx-runtime").JSX.Element;
|
|
28
27
|
export default CriteriaBasedFilterEditionDialog;
|
|
@@ -1,19 +1,126 @@
|
|
|
1
|
-
import "react/jsx-runtime";
|
|
2
|
-
import "react";
|
|
3
|
-
import "
|
|
4
|
-
import "
|
|
5
|
-
import "
|
|
6
|
-
import "
|
|
7
|
-
import "
|
|
8
|
-
import "
|
|
9
|
-
import "./criteria-based-filter-form.js";
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useState, useEffect, useCallback } from "react";
|
|
3
|
+
import { useForm } from "react-hook-form";
|
|
4
|
+
import { yupResolver } from "@hookform/resolvers/yup";
|
|
5
|
+
import FieldConstants from "../../../utils/field-constants.js";
|
|
6
|
+
import { backToFrontTweak, frontToBackTweak } from "./criteria-based-filter-utils.js";
|
|
7
|
+
import CustomMuiDialog from "../../dialogs/custom-mui-dialog.js";
|
|
8
|
+
import { useSnackMessage } from "../../../hooks/useSnackMessage.js";
|
|
9
|
+
import { criteriaBasedFilterSchema } from "./criteria-based-filter-form.js";
|
|
10
10
|
import "../../../utils/yup-config.js";
|
|
11
|
-
import {
|
|
12
|
-
import "
|
|
13
|
-
import "../../../
|
|
14
|
-
import "
|
|
15
|
-
import "yup";
|
|
11
|
+
import { FilterType } from "../constants/filter-constants.js";
|
|
12
|
+
import FetchStatus from "../../../utils/FetchStatus.js";
|
|
13
|
+
import { saveFilter } from "../../../services/explore.js";
|
|
14
|
+
import FilterForm from "../filter-form.js";
|
|
15
|
+
import * as yup from "yup";
|
|
16
|
+
const noSelectionForCopy = {
|
|
17
|
+
sourceItemUuid: null,
|
|
18
|
+
name: null,
|
|
19
|
+
description: null,
|
|
20
|
+
parentDirectoryUuid: null
|
|
21
|
+
};
|
|
22
|
+
const formSchema = yup.object().shape({
|
|
23
|
+
[FieldConstants.NAME]: yup.string().trim().required("nameEmpty"),
|
|
24
|
+
[FieldConstants.FILTER_TYPE]: yup.string().required(),
|
|
25
|
+
[FieldConstants.EQUIPMENT_TYPE]: yup.string().required(),
|
|
26
|
+
...criteriaBasedFilterSchema
|
|
27
|
+
}).required();
|
|
28
|
+
function CriteriaBasedFilterEditionDialog({
|
|
29
|
+
id,
|
|
30
|
+
name,
|
|
31
|
+
titleId,
|
|
32
|
+
open,
|
|
33
|
+
onClose,
|
|
34
|
+
broadcastChannel,
|
|
35
|
+
getFilterById,
|
|
36
|
+
selectionForCopy,
|
|
37
|
+
setSelelectionForCopy,
|
|
38
|
+
activeDirectory,
|
|
39
|
+
elementExists,
|
|
40
|
+
language
|
|
41
|
+
}) {
|
|
42
|
+
var _a;
|
|
43
|
+
const { snackError } = useSnackMessage();
|
|
44
|
+
const [dataFetchStatus, setDataFetchStatus] = useState(FetchStatus.IDLE);
|
|
45
|
+
const formMethods = useForm({
|
|
46
|
+
resolver: yupResolver(formSchema)
|
|
47
|
+
});
|
|
48
|
+
const {
|
|
49
|
+
reset,
|
|
50
|
+
formState: { errors }
|
|
51
|
+
} = formMethods;
|
|
52
|
+
const nameError = errors[FieldConstants.NAME];
|
|
53
|
+
const isValidating = (_a = errors.root) == null ? void 0 : _a.isValidating;
|
|
54
|
+
useEffect(() => {
|
|
55
|
+
if (id && open) {
|
|
56
|
+
setDataFetchStatus(FetchStatus.FETCHING);
|
|
57
|
+
getFilterById(id).then((response) => {
|
|
58
|
+
setDataFetchStatus(FetchStatus.FETCH_SUCCESS);
|
|
59
|
+
reset({
|
|
60
|
+
[FieldConstants.NAME]: name,
|
|
61
|
+
[FieldConstants.FILTER_TYPE]: FilterType.CRITERIA_BASED.id,
|
|
62
|
+
...backToFrontTweak(response)
|
|
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
|
+
saveFilter(
|
|
76
|
+
frontToBackTweak(id, filterForm),
|
|
77
|
+
filterForm[FieldConstants.NAME]
|
|
78
|
+
).then(() => {
|
|
79
|
+
if (selectionForCopy.sourceItemUuid === id) {
|
|
80
|
+
setSelelectionForCopy(noSelectionForCopy);
|
|
81
|
+
broadcastChannel.postMessage({
|
|
82
|
+
noSelectionForCopy
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
}).catch((error) => {
|
|
86
|
+
snackError({
|
|
87
|
+
messageTxt: error.message
|
|
88
|
+
});
|
|
89
|
+
});
|
|
90
|
+
},
|
|
91
|
+
[
|
|
92
|
+
broadcastChannel,
|
|
93
|
+
id,
|
|
94
|
+
selectionForCopy.sourceItemUuid,
|
|
95
|
+
snackError,
|
|
96
|
+
setSelelectionForCopy
|
|
97
|
+
]
|
|
98
|
+
);
|
|
99
|
+
const isDataReady = dataFetchStatus === FetchStatus.FETCH_SUCCESS;
|
|
100
|
+
return /* @__PURE__ */ jsx(
|
|
101
|
+
CustomMuiDialog,
|
|
102
|
+
{
|
|
103
|
+
open,
|
|
104
|
+
onClose,
|
|
105
|
+
onSave: onSubmit,
|
|
106
|
+
formSchema,
|
|
107
|
+
formMethods,
|
|
108
|
+
titleId,
|
|
109
|
+
removeOptional: true,
|
|
110
|
+
disabledSave: !!nameError || !!isValidating,
|
|
111
|
+
isDataFetching: dataFetchStatus === FetchStatus.FETCHING,
|
|
112
|
+
language,
|
|
113
|
+
children: isDataReady && /* @__PURE__ */ jsx(
|
|
114
|
+
FilterForm,
|
|
115
|
+
{
|
|
116
|
+
activeDirectory,
|
|
117
|
+
elementExists
|
|
118
|
+
}
|
|
119
|
+
)
|
|
120
|
+
}
|
|
121
|
+
);
|
|
122
|
+
}
|
|
16
123
|
export {
|
|
17
|
-
|
|
18
|
-
|
|
124
|
+
CriteriaBasedFilterEditionDialog as default,
|
|
125
|
+
noSelectionForCopy
|
|
19
126
|
};
|