@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
|
@@ -4,7 +4,7 @@ async function fetchEnv() {
|
|
|
4
4
|
async function fetchAppsMetadata() {
|
|
5
5
|
console.info(`Fetching apps and urls...`);
|
|
6
6
|
const env = await fetchEnv();
|
|
7
|
-
const res = await fetch(env.appsMetadataServerUrl
|
|
7
|
+
const res = await fetch(`${env.appsMetadataServerUrl}/apps-metadata.json`);
|
|
8
8
|
return res.json();
|
|
9
9
|
}
|
|
10
10
|
const isStudyMetadata = (metadata) => {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { getRequestParamFromList, backendFetchJson } from "./utils.js";
|
|
2
|
-
const PREFIX_DIRECTORY_SERVER_QUERIES = "api/gateway/directory
|
|
2
|
+
const PREFIX_DIRECTORY_SERVER_QUERIES = `${"api/gateway"}/directory`;
|
|
3
3
|
function fetchRootFolders(types) {
|
|
4
4
|
console.info("Fetching Root Directories");
|
|
5
5
|
const urlSearchParams = getRequestParamFromList(
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
"elementTypes",
|
|
7
|
+
types
|
|
8
8
|
).toString();
|
|
9
9
|
const fetchRootFoldersUrl = `${PREFIX_DIRECTORY_SERVER_QUERIES}/v1/root-directories?${urlSearchParams}`;
|
|
10
10
|
return backendFetchJson(fetchRootFoldersUrl, {
|
|
@@ -15,10 +15,10 @@ function fetchRootFolders(types) {
|
|
|
15
15
|
function fetchDirectoryContent(directoryUuid, types) {
|
|
16
16
|
console.info("Fetching Folder content '%s'", directoryUuid);
|
|
17
17
|
const urlSearchParams = getRequestParamFromList(
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
"elementTypes",
|
|
19
|
+
types
|
|
20
20
|
).toString();
|
|
21
|
-
|
|
21
|
+
const fetchDirectoryContentUrl = `${PREFIX_DIRECTORY_SERVER_QUERIES}/v1/directories/${directoryUuid}/elements${urlSearchParams ? `?${urlSearchParams}` : ""}`;
|
|
22
22
|
return backendFetchJson(fetchDirectoryContentUrl, {
|
|
23
23
|
method: "get",
|
|
24
24
|
headers: { "Content-Type": "application/json" }
|
package/dist/services/explore.js
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { backendFetch, getRequestParamFromList, backendFetchJson } from "./utils.js";
|
|
2
|
-
const PREFIX_EXPLORE_SERVER_QUERIES = "api/gateway/explore
|
|
2
|
+
const PREFIX_EXPLORE_SERVER_QUERIES = `${"api/gateway"}/explore`;
|
|
3
3
|
function createFilter(newFilter, name, description, parentDirectoryUuid, token) {
|
|
4
|
-
|
|
4
|
+
const urlSearchParams = new URLSearchParams();
|
|
5
5
|
urlSearchParams.append("name", name);
|
|
6
6
|
urlSearchParams.append("description", description);
|
|
7
|
-
|
|
7
|
+
if (parentDirectoryUuid) {
|
|
8
|
+
urlSearchParams.append("parentDirectoryUuid", parentDirectoryUuid);
|
|
9
|
+
}
|
|
8
10
|
return backendFetch(
|
|
9
|
-
PREFIX_EXPLORE_SERVER_QUERIES
|
|
11
|
+
`${PREFIX_EXPLORE_SERVER_QUERIES}/v1/explore/filters?${urlSearchParams.toString()}`,
|
|
10
12
|
{
|
|
11
13
|
method: "post",
|
|
12
14
|
headers: { "Content-Type": "application/json" },
|
|
@@ -16,10 +18,10 @@ function createFilter(newFilter, name, description, parentDirectoryUuid, token)
|
|
|
16
18
|
);
|
|
17
19
|
}
|
|
18
20
|
function saveFilter(filter, name, token) {
|
|
19
|
-
|
|
21
|
+
const urlSearchParams = new URLSearchParams();
|
|
20
22
|
urlSearchParams.append("name", name);
|
|
21
23
|
return backendFetch(
|
|
22
|
-
PREFIX_EXPLORE_SERVER_QUERIES
|
|
24
|
+
`${PREFIX_EXPLORE_SERVER_QUERIES}/v1/explore/filters/${filter.id}?${urlSearchParams.toString()}`,
|
|
23
25
|
{
|
|
24
26
|
method: "put",
|
|
25
27
|
headers: { "Content-Type": "application/json" },
|
|
@@ -31,17 +33,17 @@ function saveFilter(filter, name, token) {
|
|
|
31
33
|
function fetchElementsInfos(ids, elementTypes, equipmentTypes) {
|
|
32
34
|
console.info("Fetching elements metadata");
|
|
33
35
|
const idsParams = getRequestParamFromList(
|
|
34
|
-
ids
|
|
36
|
+
"ids",
|
|
37
|
+
ids.filter((id) => id)
|
|
35
38
|
// filter falsy elements
|
|
36
|
-
"ids"
|
|
37
39
|
);
|
|
38
40
|
const equipmentTypesParams = getRequestParamFromList(
|
|
39
|
-
equipmentTypes,
|
|
40
|
-
|
|
41
|
+
"equipmentTypes",
|
|
42
|
+
equipmentTypes
|
|
41
43
|
);
|
|
42
44
|
const elementTypesParams = getRequestParamFromList(
|
|
43
|
-
elementTypes,
|
|
44
|
-
|
|
45
|
+
"elementTypes",
|
|
46
|
+
elementTypes
|
|
45
47
|
);
|
|
46
48
|
const urlSearchParams = new URLSearchParams([
|
|
47
49
|
...idsParams,
|
package/dist/services/index.d.ts
CHANGED
|
@@ -5,12 +5,7 @@
|
|
|
5
5
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
6
6
|
*/
|
|
7
7
|
export * from './utils';
|
|
8
|
-
export type * from './utils';
|
|
9
8
|
export * from './explore';
|
|
10
|
-
export type * from './explore';
|
|
11
9
|
export * from './apps-metadata';
|
|
12
|
-
export type * from './apps-metadata';
|
|
13
10
|
export * from './directory';
|
|
14
|
-
export type * from './directory';
|
|
15
11
|
export * from './study';
|
|
16
|
-
export type * from './study';
|
package/dist/services/study.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { backendFetchJson } from "./utils.js";
|
|
2
|
-
const PREFIX_STUDY_QUERIES = "api/gateway/study
|
|
2
|
+
const PREFIX_STUDY_QUERIES = `${"api/gateway"}/study`;
|
|
3
3
|
function exportFilter(studyUuid, filterUuid, token) {
|
|
4
4
|
console.info("get filter export on study root node");
|
|
5
5
|
return backendFetchJson(
|
|
6
|
-
PREFIX_STUDY_QUERIES
|
|
6
|
+
`${PREFIX_STUDY_QUERIES}/v1/studies/${studyUuid}/filters/${filterUuid}/elements`,
|
|
7
7
|
{
|
|
8
8
|
method: "get",
|
|
9
9
|
headers: { "Content-Type": "application/json" }
|
package/dist/services/utils.d.ts
CHANGED
|
@@ -6,4 +6,4 @@
|
|
|
6
6
|
*/
|
|
7
7
|
export declare const backendFetch: (url: string, init: any, token?: string) => Promise<any>;
|
|
8
8
|
export declare const backendFetchJson: (url: string, init: any, token?: string) => Promise<any>;
|
|
9
|
-
export declare const getRequestParamFromList: (
|
|
9
|
+
export declare const getRequestParamFromList: (paramName: string, params?: string[]) => URLSearchParams;
|
package/dist/services/utils.js
CHANGED
|
@@ -1,31 +1,23 @@
|
|
|
1
1
|
import { getUserToken } from "../redux/commonStore.js";
|
|
2
|
-
const
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
return safeFetch(url, initCopy).then(
|
|
9
|
-
(safeResponse) => safeResponse.status === 204 ? null : safeResponse.json()
|
|
10
|
-
);
|
|
2
|
+
const parseError = (text) => {
|
|
3
|
+
try {
|
|
4
|
+
return JSON.parse(text);
|
|
5
|
+
} catch (err) {
|
|
6
|
+
return null;
|
|
7
|
+
}
|
|
11
8
|
};
|
|
12
9
|
const prepareRequest = (init, token) => {
|
|
13
10
|
if (!(typeof init === "undefined" || typeof init === "object")) {
|
|
14
11
|
throw new TypeError(
|
|
15
|
-
|
|
12
|
+
`First argument of prepareRequest is not an object : ${typeof init}`
|
|
16
13
|
);
|
|
17
14
|
}
|
|
18
|
-
const initCopy =
|
|
15
|
+
const initCopy = { ...init };
|
|
19
16
|
initCopy.headers = new Headers(initCopy.headers || {});
|
|
20
17
|
const tokenCopy = token ?? getUserToken();
|
|
21
|
-
initCopy.headers.append("Authorization",
|
|
18
|
+
initCopy.headers.append("Authorization", `Bearer ${tokenCopy}`);
|
|
22
19
|
return initCopy;
|
|
23
20
|
};
|
|
24
|
-
const safeFetch = (url, initCopy) => {
|
|
25
|
-
return fetch(url, initCopy).then(
|
|
26
|
-
(response) => response.ok ? response : handleError(response)
|
|
27
|
-
);
|
|
28
|
-
};
|
|
29
21
|
const handleError = (response) => {
|
|
30
22
|
return response.text().then((text) => {
|
|
31
23
|
const errorName = "HttpResponseError : ";
|
|
@@ -33,26 +25,34 @@ const handleError = (response) => {
|
|
|
33
25
|
let customError;
|
|
34
26
|
if (errorJson && errorJson.status && errorJson.error && errorJson.message) {
|
|
35
27
|
customError = new Error(
|
|
36
|
-
errorName + errorJson.status
|
|
28
|
+
`${errorName + errorJson.status} ${errorJson.error}, message : ${errorJson.message}`
|
|
37
29
|
);
|
|
38
30
|
customError.status = errorJson.status;
|
|
39
31
|
} else {
|
|
40
32
|
customError = new Error(
|
|
41
|
-
errorName + response.status
|
|
33
|
+
`${errorName + response.status} ${response.statusText}, message : ${text}`
|
|
42
34
|
);
|
|
43
35
|
customError.status = response.status;
|
|
44
36
|
}
|
|
45
37
|
throw customError;
|
|
46
38
|
});
|
|
47
39
|
};
|
|
48
|
-
const
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
40
|
+
const safeFetch = (url, initCopy) => {
|
|
41
|
+
return fetch(url, initCopy).then(
|
|
42
|
+
(response) => response.ok ? response : handleError(response)
|
|
43
|
+
);
|
|
44
|
+
};
|
|
45
|
+
const backendFetch = (url, init, token) => {
|
|
46
|
+
const initCopy = prepareRequest(init, token);
|
|
47
|
+
return safeFetch(url, initCopy);
|
|
48
|
+
};
|
|
49
|
+
const backendFetchJson = (url, init, token) => {
|
|
50
|
+
const initCopy = prepareRequest(init, token);
|
|
51
|
+
return safeFetch(url, initCopy).then(
|
|
52
|
+
(safeResponse) => safeResponse.status === 204 ? null : safeResponse.json()
|
|
53
|
+
);
|
|
54
54
|
};
|
|
55
|
-
const getRequestParamFromList = (params = []
|
|
55
|
+
const getRequestParamFromList = (paramName, params = []) => {
|
|
56
56
|
return new URLSearchParams(params.map((param) => [paramName, param]));
|
|
57
57
|
};
|
|
58
58
|
export {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Dispatch } from 'react';
|
|
1
|
+
import { AuthenticationActions } from '../redux/authActions';
|
|
3
2
|
import { User, UserManager } from 'oidc-client';
|
|
3
|
+
import { Location, NavigateFunction } from 'react-router-dom';
|
|
4
|
+
import { Dispatch } from 'react';
|
|
4
5
|
|
|
5
6
|
type UserValidationFunc = (user: User) => Promise<boolean>;
|
|
6
7
|
type IdpSettingsGetter = () => Promise<IdpSettings>;
|
|
@@ -18,12 +19,12 @@ type CustomUserManager = UserManager & {
|
|
|
18
19
|
maxExpiresIn?: number;
|
|
19
20
|
};
|
|
20
21
|
};
|
|
21
|
-
export declare function
|
|
22
|
-
export declare function
|
|
23
|
-
export declare function
|
|
24
|
-
export declare function logout(dispatch: Dispatch<unknown>, userManagerInstance: UserManager): Promise<void | undefined>;
|
|
25
|
-
export declare function dispatchUser(dispatch: Dispatch<unknown>, userManagerInstance: CustomUserManager, validateUser: UserValidationFunc): Promise<void | undefined>;
|
|
22
|
+
export declare function login(location: Location, userManagerInstance: UserManager | null): Promise<void> | undefined;
|
|
23
|
+
export declare function logout(dispatch: Dispatch<AuthenticationActions>, userManagerInstance: UserManager | null): Promise<void> | undefined;
|
|
24
|
+
export declare function dispatchUser(dispatch: Dispatch<AuthenticationActions>, userManagerInstance: CustomUserManager, validateUser: UserValidationFunc): Promise<void>;
|
|
26
25
|
export declare function getPreLoginPath(): string | null;
|
|
27
|
-
export declare function handleSigninCallback(dispatch: Dispatch<
|
|
26
|
+
export declare function handleSigninCallback(dispatch: Dispatch<AuthenticationActions>, navigate: NavigateFunction, userManagerInstance: UserManager): void;
|
|
28
27
|
export declare function handleSilentRenewCallback(userManagerInstance: UserManager): void;
|
|
28
|
+
export declare function initializeAuthenticationDev(dispatch: Dispatch<AuthenticationActions>, isSilentRenew: boolean, validateUser: UserValidationFunc, isSigninCallback: boolean): Promise<UserManager>;
|
|
29
|
+
export declare function initializeAuthenticationProd(dispatch: Dispatch<AuthenticationActions>, isSilentRenew: boolean, idpSettingsGetter: IdpSettingsGetter, validateUser: UserValidationFunc, isSigninCallback: boolean): Promise<CustomUserManager>;
|
|
29
30
|
export {};
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { Log, UserManager } from "oidc-client";
|
|
2
|
-
import { UserManagerMock } from "./UserManagerMock.js";
|
|
3
|
-
import { setShowAuthenticationRouterLogin, setLoggedUser, setLogoutError, setUnauthorizedUserInfo, setUserValidationError, setSignInCallbackError, resetAuthenticationRouterError } from "../redux/actions.js";
|
|
4
1
|
import { jwtDecode } from "jwt-decode";
|
|
2
|
+
import { Log, UserManager } from "oidc-client";
|
|
3
|
+
import UserManagerMock from "./UserManagerMock.js";
|
|
4
|
+
import { setLoggedUser, setLogoutError, setUnauthorizedUserInfo, setUserValidationError, setSignInCallbackError, setShowAuthenticationRouterLogin, resetAuthenticationRouterError } from "../redux/authActions.js";
|
|
5
5
|
window.OIDCLog = Log;
|
|
6
6
|
const hackAuthorityKey = "oidc.hack.authority";
|
|
7
7
|
const oidcHackReloadedKey = "gridsuite-oidc-hack-reloaded";
|
|
8
8
|
const pathKey = "powsybl-gridsuite-current-path";
|
|
9
|
+
const accessTokenExpiringNotificationTime = 60;
|
|
9
10
|
function isIssuerError(error) {
|
|
10
11
|
return error.message.includes("Invalid issuer in token");
|
|
11
12
|
}
|
|
@@ -28,6 +29,14 @@ function reloadTimerOnExpiresIn(user, userManager, expiresIn) {
|
|
|
28
29
|
userManager.getUser();
|
|
29
30
|
});
|
|
30
31
|
}
|
|
32
|
+
function getIdTokenExpiresIn(user) {
|
|
33
|
+
const now = Date.now() / 1e3;
|
|
34
|
+
const { exp } = jwtDecode(user.id_token);
|
|
35
|
+
if (exp === void 0) {
|
|
36
|
+
return 0;
|
|
37
|
+
}
|
|
38
|
+
return exp - now;
|
|
39
|
+
}
|
|
31
40
|
function handleSigninSilent(dispatch, userManager) {
|
|
32
41
|
userManager.getUser().then((user) => {
|
|
33
42
|
if (user == null || getIdTokenExpiresIn(user) < 0) {
|
|
@@ -39,53 +48,12 @@ function handleSigninSilent(dispatch, userManager) {
|
|
|
39
48
|
}
|
|
40
49
|
});
|
|
41
50
|
}
|
|
51
|
+
return Promise.resolve();
|
|
42
52
|
});
|
|
43
53
|
}
|
|
44
|
-
async function initializeAuthenticationDev(dispatch, isSilentRenew, validateUser, isSigninCallback) {
|
|
45
|
-
let userManager = new UserManagerMock(
|
|
46
|
-
{}
|
|
47
|
-
);
|
|
48
|
-
if (!isSilentRenew) {
|
|
49
|
-
handleUser(dispatch, userManager, validateUser);
|
|
50
|
-
if (!isSigninCallback) {
|
|
51
|
-
handleSigninSilent(dispatch, userManager);
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
return userManager;
|
|
55
|
-
}
|
|
56
|
-
const accessTokenExpiringNotificationTime = 60;
|
|
57
|
-
async function initializeAuthenticationProd(dispatch, isSilentRenew, idpSettingsGetter, validateUser, isSigninCallback) {
|
|
58
|
-
const idpSettings = await idpSettingsGetter();
|
|
59
|
-
try {
|
|
60
|
-
const settings = {
|
|
61
|
-
authority: sessionStorage.getItem(hackAuthorityKey) || idpSettings.authority,
|
|
62
|
-
client_id: idpSettings.client_id,
|
|
63
|
-
redirect_uri: idpSettings.redirect_uri,
|
|
64
|
-
post_logout_redirect_uri: idpSettings.post_logout_redirect_uri,
|
|
65
|
-
silent_redirect_uri: idpSettings.silent_redirect_uri,
|
|
66
|
-
scope: idpSettings.scope,
|
|
67
|
-
automaticSilentRenew: !isSilentRenew,
|
|
68
|
-
accessTokenExpiringNotificationTime,
|
|
69
|
-
response_type: "code"
|
|
70
|
-
};
|
|
71
|
-
let userManager = new UserManager(settings);
|
|
72
|
-
userManager.idpSettings = idpSettings;
|
|
73
|
-
if (!isSilentRenew) {
|
|
74
|
-
handleUser(dispatch, userManager, validateUser);
|
|
75
|
-
if (!isSigninCallback) {
|
|
76
|
-
handleSigninSilent(dispatch, userManager);
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
return userManager;
|
|
80
|
-
} catch (error) {
|
|
81
|
-
console.debug("error when importing the idp settings", error);
|
|
82
|
-
dispatch(setShowAuthenticationRouterLogin(true));
|
|
83
|
-
throw error;
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
54
|
function computeMinExpiresIn(expiresIn, idToken, maxExpiresIn) {
|
|
87
55
|
const now = Date.now() / 1e3;
|
|
88
|
-
const exp = jwtDecode(idToken)
|
|
56
|
+
const { exp } = jwtDecode(idToken);
|
|
89
57
|
if (exp === void 0) {
|
|
90
58
|
return expiresIn;
|
|
91
59
|
}
|
|
@@ -102,22 +70,22 @@ function computeMinExpiresIn(expiresIn, idToken, maxExpiresIn) {
|
|
|
102
70
|
}
|
|
103
71
|
if (newExpiresInReplaceReason) {
|
|
104
72
|
console.debug(
|
|
105
|
-
|
|
73
|
+
`Replacing expiresIn in user to ${newExpiresIn} because ${newExpiresInReplaceReason}. `,
|
|
106
74
|
"debug:",
|
|
107
|
-
|
|
108
|
-
|
|
75
|
+
`original expires_in: ${expiresIn}, `,
|
|
76
|
+
`idTokenExpiresIn: ${idTokenExpiresIn}, idpSettings maxExpiresIn: ${maxExpiresIn}`
|
|
109
77
|
);
|
|
110
78
|
}
|
|
111
79
|
return newExpiresIn;
|
|
112
80
|
}
|
|
113
81
|
function login(location, userManagerInstance) {
|
|
114
82
|
sessionStorage.setItem(pathKey, location.pathname + location.search);
|
|
115
|
-
return userManagerInstance.signinRedirect().then(() => console.debug("login"));
|
|
83
|
+
return userManagerInstance == null ? void 0 : userManagerInstance.signinRedirect().then(() => console.debug("login"));
|
|
116
84
|
}
|
|
117
85
|
function logout(dispatch, userManagerInstance) {
|
|
118
86
|
sessionStorage.removeItem(hackAuthorityKey);
|
|
119
87
|
sessionStorage.removeItem(oidcHackReloadedKey);
|
|
120
|
-
return userManagerInstance.getUser().then((user) => {
|
|
88
|
+
return userManagerInstance == null ? void 0 : userManagerInstance.getUser().then((user) => {
|
|
121
89
|
if (user) {
|
|
122
90
|
return userManagerInstance.signoutRedirect({
|
|
123
91
|
extraQueryParams: {
|
|
@@ -131,19 +99,11 @@ function logout(dispatch, userManagerInstance) {
|
|
|
131
99
|
dispatch(setLoggedUser(null));
|
|
132
100
|
dispatch(setLogoutError((_a = user == null ? void 0 : user.profile) == null ? void 0 : _a.name, { error: e }));
|
|
133
101
|
});
|
|
134
|
-
} else {
|
|
135
|
-
console.log("Error nobody to logout ");
|
|
136
102
|
}
|
|
103
|
+
console.log("Error nobody to logout ");
|
|
104
|
+
return Promise.resolve();
|
|
137
105
|
});
|
|
138
106
|
}
|
|
139
|
-
function getIdTokenExpiresIn(user) {
|
|
140
|
-
const now = Date.now() / 1e3;
|
|
141
|
-
const exp = jwtDecode(user.id_token).exp;
|
|
142
|
-
if (exp === void 0) {
|
|
143
|
-
return 0;
|
|
144
|
-
}
|
|
145
|
-
return exp - now;
|
|
146
|
-
}
|
|
147
107
|
function dispatchUser(dispatch, userManagerInstance, validateUser) {
|
|
148
108
|
return userManagerInstance.getUser().then((user) => {
|
|
149
109
|
if (user) {
|
|
@@ -151,9 +111,9 @@ function dispatchUser(dispatch, userManagerInstance, validateUser) {
|
|
|
151
111
|
console.debug(
|
|
152
112
|
"User token is expired and will not be dispatched"
|
|
153
113
|
);
|
|
154
|
-
return;
|
|
114
|
+
return Promise.resolve();
|
|
155
115
|
}
|
|
156
|
-
|
|
116
|
+
const validateUserPromise = (validateUser == null ? void 0 : validateUser(user)) || Promise.resolve(true);
|
|
157
117
|
return validateUserPromise.then((valid) => {
|
|
158
118
|
var _a, _b;
|
|
159
119
|
if (!valid) {
|
|
@@ -186,9 +146,9 @@ function dispatchUser(dispatch, userManagerInstance, validateUser) {
|
|
|
186
146
|
})
|
|
187
147
|
);
|
|
188
148
|
});
|
|
189
|
-
} else {
|
|
190
|
-
console.debug("You are not logged in.");
|
|
191
149
|
}
|
|
150
|
+
console.debug("You are not logged in.");
|
|
151
|
+
return Promise.resolve();
|
|
192
152
|
});
|
|
193
153
|
}
|
|
194
154
|
function getPreLoginPath() {
|
|
@@ -202,20 +162,20 @@ function navigateToPreLoginPath(navigate) {
|
|
|
202
162
|
}
|
|
203
163
|
function handleSigninCallback(dispatch, navigate, userManagerInstance) {
|
|
204
164
|
let reloadAfterNavigate = false;
|
|
205
|
-
userManagerInstance.signinRedirectCallback().catch(
|
|
165
|
+
userManagerInstance.signinRedirectCallback().catch((e) => {
|
|
206
166
|
if (isIssuerError(e)) {
|
|
207
167
|
extractIssuerToSessionStorage(e);
|
|
208
168
|
reloadAfterNavigate = true;
|
|
209
169
|
} else {
|
|
210
170
|
throw e;
|
|
211
171
|
}
|
|
212
|
-
}).then(
|
|
172
|
+
}).then(() => {
|
|
213
173
|
dispatch(setSignInCallbackError(null));
|
|
214
174
|
navigateToPreLoginPath(navigate);
|
|
215
175
|
if (reloadAfterNavigate) {
|
|
216
176
|
reload();
|
|
217
177
|
}
|
|
218
|
-
}).catch(
|
|
178
|
+
}).catch((e) => {
|
|
219
179
|
dispatch(setSignInCallbackError(e));
|
|
220
180
|
console.error(e);
|
|
221
181
|
});
|
|
@@ -242,18 +202,20 @@ function handleUser(dispatch, userManager, validateUser) {
|
|
|
242
202
|
const idTokenExpiresIn = getIdTokenExpiresIn(user);
|
|
243
203
|
if (idTokenExpiresIn < 0) {
|
|
244
204
|
console.log(
|
|
245
|
-
|
|
205
|
+
`Error in silent renew, idtoken expired: ${idTokenExpiresIn} => Logging out.`,
|
|
246
206
|
error
|
|
247
207
|
);
|
|
248
208
|
dispatch(setShowAuthenticationRouterLogin(true));
|
|
249
209
|
dispatch(resetAuthenticationRouterError());
|
|
250
|
-
|
|
251
|
-
|
|
210
|
+
dispatch(setLoggedUser(null));
|
|
211
|
+
return;
|
|
212
|
+
}
|
|
213
|
+
if ((_a = userManager.idpSettings) == null ? void 0 : _a.maxExpiresIn) {
|
|
252
214
|
if (idTokenExpiresIn < userManager.idpSettings.maxExpiresIn) {
|
|
253
215
|
console.log(
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
216
|
+
`Error in silent renew, but idtoken ALMOST expiring (expiring in${idTokenExpiresIn}) => last chance, next error will logout`,
|
|
217
|
+
`maxExpiresIn = ${userManager.idpSettings.maxExpiresIn}`,
|
|
218
|
+
`last renew attempt in ${idTokenExpiresIn - accessTokenExpiringNotificationTime}seconds`,
|
|
257
219
|
error
|
|
258
220
|
);
|
|
259
221
|
reloadTimerOnExpiresIn(
|
|
@@ -263,7 +225,7 @@ function handleUser(dispatch, userManager, validateUser) {
|
|
|
263
225
|
);
|
|
264
226
|
} else {
|
|
265
227
|
console.log(
|
|
266
|
-
|
|
228
|
+
`Error in silent renew, but idtoken NOT expiring (expiring in${idTokenExpiresIn}) => postponing expiration to${userManager.idpSettings.maxExpiresIn}`,
|
|
267
229
|
error
|
|
268
230
|
);
|
|
269
231
|
reloadTimerOnExpiresIn(
|
|
@@ -274,7 +236,7 @@ function handleUser(dispatch, userManager, validateUser) {
|
|
|
274
236
|
}
|
|
275
237
|
} else {
|
|
276
238
|
console.log(
|
|
277
|
-
|
|
239
|
+
`Error in silent renew, unsupported configuration: token still valid for ${idTokenExpiresIn} but maxExpiresIn is not configured:${(_b = userManager.idpSettings) == null ? void 0 : _b.maxExpiresIn}`,
|
|
278
240
|
error
|
|
279
241
|
);
|
|
280
242
|
}
|
|
@@ -284,6 +246,45 @@ function handleUser(dispatch, userManager, validateUser) {
|
|
|
284
246
|
console.debug("dispatch user");
|
|
285
247
|
dispatchUser(dispatch, userManager, validateUser);
|
|
286
248
|
}
|
|
249
|
+
async function initializeAuthenticationDev(dispatch, isSilentRenew, validateUser, isSigninCallback) {
|
|
250
|
+
const userManager = new UserManagerMock({});
|
|
251
|
+
if (!isSilentRenew) {
|
|
252
|
+
handleUser(dispatch, userManager, validateUser);
|
|
253
|
+
if (!isSigninCallback) {
|
|
254
|
+
handleSigninSilent(dispatch, userManager);
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
return userManager;
|
|
258
|
+
}
|
|
259
|
+
async function initializeAuthenticationProd(dispatch, isSilentRenew, idpSettingsGetter, validateUser, isSigninCallback) {
|
|
260
|
+
const idpSettings = await idpSettingsGetter();
|
|
261
|
+
try {
|
|
262
|
+
const settings = {
|
|
263
|
+
authority: sessionStorage.getItem(hackAuthorityKey) || idpSettings.authority,
|
|
264
|
+
client_id: idpSettings.client_id,
|
|
265
|
+
redirect_uri: idpSettings.redirect_uri,
|
|
266
|
+
post_logout_redirect_uri: idpSettings.post_logout_redirect_uri,
|
|
267
|
+
silent_redirect_uri: idpSettings.silent_redirect_uri,
|
|
268
|
+
scope: idpSettings.scope,
|
|
269
|
+
automaticSilentRenew: !isSilentRenew,
|
|
270
|
+
accessTokenExpiringNotificationTime,
|
|
271
|
+
response_type: "code"
|
|
272
|
+
};
|
|
273
|
+
const userManager = new UserManager(settings);
|
|
274
|
+
userManager.idpSettings = idpSettings;
|
|
275
|
+
if (!isSilentRenew) {
|
|
276
|
+
handleUser(dispatch, userManager, validateUser);
|
|
277
|
+
if (!isSigninCallback) {
|
|
278
|
+
handleSigninSilent(dispatch, userManager);
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
return userManager;
|
|
282
|
+
} catch (error) {
|
|
283
|
+
console.debug("error when importing the idp settings", error);
|
|
284
|
+
dispatch(setShowAuthenticationRouterLogin(true));
|
|
285
|
+
throw error;
|
|
286
|
+
}
|
|
287
|
+
}
|
|
287
288
|
export {
|
|
288
289
|
dispatchUser,
|
|
289
290
|
getPreLoginPath,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { SxProps, Theme } from '@mui/material';
|
|
2
1
|
import { ElementType } from './ElementType';
|
|
2
|
+
import { SxProps, Theme } from '@mui/material';
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
declare function getFileIcon(type: ElementType, style: SxProps<Theme>): import("react/jsx-runtime").JSX.Element | undefined;
|
|
5
|
+
export default getFileIcon;
|
|
@@ -20,11 +20,12 @@ function getFileIcon(type, style) {
|
|
|
20
20
|
case ElementType.SHORT_CIRCUIT_PARAMETERS:
|
|
21
21
|
return /* @__PURE__ */ jsx(Settings, { sx: style });
|
|
22
22
|
case ElementType.DIRECTORY:
|
|
23
|
-
return;
|
|
23
|
+
return void 0;
|
|
24
24
|
default:
|
|
25
|
-
console.warn(
|
|
25
|
+
console.warn(`unknown type [${type}]`);
|
|
26
26
|
}
|
|
27
|
+
return void 0;
|
|
27
28
|
}
|
|
28
29
|
export {
|
|
29
|
-
getFileIcon
|
|
30
|
+
getFileIcon as default
|
|
30
31
|
};
|
|
@@ -1,9 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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
|
-
*/
|
|
1
|
+
import { UUID } from 'crypto';
|
|
2
|
+
|
|
7
3
|
export declare enum ElementType {
|
|
8
4
|
DIRECTORY = "DIRECTORY",
|
|
9
5
|
STUDY = "STUDY",
|
|
@@ -17,3 +13,4 @@ export declare enum ElementType {
|
|
|
17
13
|
SENSITIVITY_PARAMETERS = "SENSITIVITY_PARAMETERS",
|
|
18
14
|
SHORT_CIRCUIT_PARAMETERS = "SHORT_CIRCUIT_PARAMETERS"
|
|
19
15
|
}
|
|
16
|
+
export type ElementExistsType = (directory: UUID, value: string, elementType: ElementType) => Promise<boolean>;
|
|
@@ -19,7 +19,7 @@ const equipmentStyles = {
|
|
|
19
19
|
fontSize: "x-small",
|
|
20
20
|
textAlign: "center",
|
|
21
21
|
color: (
|
|
22
|
-
//TODO remove first condition when gridstudy is updated
|
|
22
|
+
// TODO remove first condition when gridstudy is updated
|
|
23
23
|
theme === LIGHT_THEME || typeof theme !== "string" && ((_a = theme == null ? void 0 : theme.palette) == null ? void 0 : _a.mode) === "light" ? "inherit" : "black"
|
|
24
24
|
)
|
|
25
25
|
};
|
|
@@ -193,7 +193,7 @@ const EQUIPMENT_TYPE = {
|
|
|
193
193
|
const getEquipmentsInfosForSearchBar = (equipmentsInfos, getNameOrId) => {
|
|
194
194
|
return equipmentsInfos.flatMap((e) => {
|
|
195
195
|
var _a;
|
|
196
|
-
|
|
196
|
+
const label = getNameOrId(e);
|
|
197
197
|
return e.type === "SUBSTATION" ? [
|
|
198
198
|
{
|
|
199
199
|
label,
|
|
@@ -205,7 +205,7 @@ const getEquipmentsInfosForSearchBar = (equipmentsInfos, getNameOrId) => {
|
|
|
205
205
|
return {
|
|
206
206
|
label,
|
|
207
207
|
id: e.id,
|
|
208
|
-
key: e.id
|
|
208
|
+
key: `${e.id}_${vli.id}`,
|
|
209
209
|
type: e.type,
|
|
210
210
|
voltageLevelLabel: getNameOrId(vli),
|
|
211
211
|
voltageLevelId: vli.id
|
|
@@ -4,9 +4,10 @@
|
|
|
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
|
-
|
|
7
|
+
declare const FetchStatus: {
|
|
8
8
|
IDLE: string;
|
|
9
9
|
FETCHING: string;
|
|
10
10
|
FETCH_SUCCESS: string;
|
|
11
11
|
FETCH_ERROR: string;
|
|
12
12
|
};
|
|
13
|
+
export default FetchStatus;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { PredefinedProperties } from './types';
|
|
2
|
+
|
|
3
|
+
export interface Metadata {
|
|
4
|
+
name: string;
|
|
5
|
+
url: string;
|
|
6
|
+
appColor: string;
|
|
7
|
+
hiddenInAppsMenu: boolean;
|
|
8
|
+
resources: unknown;
|
|
9
|
+
}
|
|
10
|
+
export interface StudyMetadata extends Metadata {
|
|
11
|
+
name: 'Study';
|
|
12
|
+
predefinedEquipmentProperties: {
|
|
13
|
+
[networkElementType: string]: PredefinedProperties;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|