@gridsuite/commons-ui 0.61.4 → 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 +1 -1
- package/dist/components/AuthenticationRouter/AuthenticationRouter.js +5 -5
- package/dist/components/AuthenticationRouter/index.d.ts +3 -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 +1 -1
- 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 +1 -1
- 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 +1 -2
- 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 +2 -27
- 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 +13 -14
- package/dist/index.js +163 -157
- package/dist/redux/commonStore.d.ts +1 -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 +21 -12
- package/dist/utils/AuthService.js +88 -143
- 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/assets/{criteria-based-filter-edition-dialog.css → expert-filter-form.css} +0 -0
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,21 +1,30 @@
|
|
|
1
|
-
import { Location, NavigateFunction } from 'react-router-dom';
|
|
2
|
-
import { Dispatch } from 'react';
|
|
3
1
|
import { AuthenticationActions } from '../redux/authActions';
|
|
4
2
|
import { User, UserManager } from 'oidc-client';
|
|
3
|
+
import { Location, NavigateFunction } from 'react-router-dom';
|
|
4
|
+
import { Dispatch } from 'react';
|
|
5
5
|
|
|
6
6
|
type UserValidationFunc = (user: User) => Promise<boolean>;
|
|
7
|
+
type IdpSettingsGetter = () => Promise<IdpSettings>;
|
|
8
|
+
export type IdpSettings = {
|
|
9
|
+
authority: string;
|
|
10
|
+
client_id: string;
|
|
11
|
+
redirect_uri: string;
|
|
12
|
+
post_logout_redirect_uri: string;
|
|
13
|
+
silent_redirect_uri: string;
|
|
14
|
+
scope: string;
|
|
15
|
+
maxExpiresIn?: number;
|
|
16
|
+
};
|
|
7
17
|
type CustomUserManager = UserManager & {
|
|
8
|
-
authorizationCodeFlowEnabled?: boolean;
|
|
9
18
|
idpSettings?: {
|
|
10
19
|
maxExpiresIn?: number;
|
|
11
20
|
};
|
|
12
21
|
};
|
|
13
|
-
declare function
|
|
14
|
-
declare function
|
|
15
|
-
declare function
|
|
16
|
-
declare function
|
|
17
|
-
declare function
|
|
18
|
-
declare function
|
|
19
|
-
declare function
|
|
20
|
-
declare function
|
|
21
|
-
export {
|
|
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>;
|
|
25
|
+
export declare function getPreLoginPath(): string | null;
|
|
26
|
+
export declare function handleSigninCallback(dispatch: Dispatch<AuthenticationActions>, navigate: NavigateFunction, userManagerInstance: UserManager): void;
|
|
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>;
|
|
30
|
+
export {};
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import { Log, UserManager } from "oidc-client";
|
|
2
|
-
import { UserManagerMock } from "./UserManagerMock.js";
|
|
3
|
-
import { setShowAuthenticationRouterLogin, setLoggedUser, setLogoutError, setUnauthorizedUserInfo, setUserValidationError, setSignInCallbackError, resetAuthenticationRouterError } from "../redux/authActions.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
|
-
|
|
9
|
+
const accessTokenExpiringNotificationTime = 60;
|
|
10
|
+
function isIssuerError(error) {
|
|
10
11
|
return error.message.includes("Invalid issuer in token");
|
|
11
12
|
}
|
|
12
13
|
function extractIssuerToSessionStorage(error) {
|
|
@@ -28,119 +29,31 @@ 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) {
|
|
34
43
|
return userManager.signinSilent().catch((error) => {
|
|
35
44
|
dispatch(setShowAuthenticationRouterLogin(true));
|
|
36
|
-
|
|
37
|
-
const errorIssuerImplicitFlow = error.message === "authority mismatch on settings vs. signin state";
|
|
38
|
-
if (errorIssuerCodeFlow) {
|
|
45
|
+
if (isIssuerError(error)) {
|
|
39
46
|
extractIssuerToSessionStorage(error);
|
|
40
|
-
}
|
|
41
|
-
if (errorIssuerCodeFlow || errorIssuerImplicitFlow) {
|
|
42
47
|
reload();
|
|
43
48
|
}
|
|
44
49
|
});
|
|
45
50
|
}
|
|
46
|
-
|
|
47
|
-
}
|
|
48
|
-
function initializeAuthenticationDev(dispatch, isSilentRenew, validateUser, isSigninCallback) {
|
|
49
|
-
let userManager = new UserManagerMock(
|
|
50
|
-
{}
|
|
51
|
-
);
|
|
52
|
-
if (!isSilentRenew) {
|
|
53
|
-
handleUser(dispatch, userManager, validateUser);
|
|
54
|
-
if (!isSigninCallback) {
|
|
55
|
-
handleSigninSilent(dispatch, userManager);
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
return Promise.resolve(userManager);
|
|
59
|
-
}
|
|
60
|
-
const accessTokenExpiringNotificationTime = 60;
|
|
61
|
-
function initializeAuthenticationProd(dispatch, isSilentRenew, idpSettings, validateUser, authorizationCodeFlowEnabled, isSigninCallback) {
|
|
62
|
-
return idpSettings.then((r) => r.json()).then((idpSettings2) => {
|
|
63
|
-
const regextoken = /id_token=[^&]*/;
|
|
64
|
-
const regexstate = /state=[^&]*/;
|
|
65
|
-
const regexexpires = /expires_in=[^&]*/;
|
|
66
|
-
let authority;
|
|
67
|
-
if (window.location.hash) {
|
|
68
|
-
const matched_id_token = window.location.hash.match(regextoken);
|
|
69
|
-
const matched_state = window.location.hash.match(regexstate);
|
|
70
|
-
if (matched_id_token != null && matched_state != null) {
|
|
71
|
-
const id_token = matched_id_token[0].split("=")[1];
|
|
72
|
-
const state = matched_state[0].split("=")[1];
|
|
73
|
-
const strState = localStorage.getItem("oidc." + state);
|
|
74
|
-
if (strState != null) {
|
|
75
|
-
const decoded = jwtDecode(id_token);
|
|
76
|
-
authority = decoded.iss;
|
|
77
|
-
const storedState = JSON.parse(strState);
|
|
78
|
-
console.debug(
|
|
79
|
-
"Replacing authority in storedState. Before: ",
|
|
80
|
-
storedState.authority,
|
|
81
|
-
"after: ",
|
|
82
|
-
authority
|
|
83
|
-
);
|
|
84
|
-
storedState.authority = authority;
|
|
85
|
-
localStorage.setItem(
|
|
86
|
-
"oidc." + state,
|
|
87
|
-
JSON.stringify(storedState)
|
|
88
|
-
);
|
|
89
|
-
if (authority !== void 0) {
|
|
90
|
-
sessionStorage.setItem(hackAuthorityKey, authority);
|
|
91
|
-
}
|
|
92
|
-
const matched_expires = window.location.hash.match(regexexpires);
|
|
93
|
-
if (matched_expires != null) {
|
|
94
|
-
const expires_in = parseInt(
|
|
95
|
-
matched_expires[0].split("=")[1]
|
|
96
|
-
);
|
|
97
|
-
window.location.hash = window.location.hash.replace(
|
|
98
|
-
matched_expires[0],
|
|
99
|
-
"expires_in=" + computeMinExpiresIn(
|
|
100
|
-
expires_in,
|
|
101
|
-
id_token,
|
|
102
|
-
idpSettings2.maxExpiresIn
|
|
103
|
-
)
|
|
104
|
-
);
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
authority = authority || sessionStorage.getItem(hackAuthorityKey) || idpSettings2.authority;
|
|
110
|
-
const responseSettings = authorizationCodeFlowEnabled ? { response_type: "code" } : {
|
|
111
|
-
response_type: "id_token token",
|
|
112
|
-
response_mode: "fragment"
|
|
113
|
-
};
|
|
114
|
-
const settings = {
|
|
115
|
-
authority,
|
|
116
|
-
client_id: idpSettings2.client_id,
|
|
117
|
-
redirect_uri: idpSettings2.redirect_uri,
|
|
118
|
-
post_logout_redirect_uri: idpSettings2.post_logout_redirect_uri,
|
|
119
|
-
silent_redirect_uri: idpSettings2.silent_redirect_uri,
|
|
120
|
-
scope: idpSettings2.scope,
|
|
121
|
-
automaticSilentRenew: !isSilentRenew,
|
|
122
|
-
accessTokenExpiringNotificationTime,
|
|
123
|
-
...responseSettings
|
|
124
|
-
};
|
|
125
|
-
let userManager = new UserManager(settings);
|
|
126
|
-
userManager.idpSettings = idpSettings2;
|
|
127
|
-
userManager.authorizationCodeFlowEnabled = authorizationCodeFlowEnabled;
|
|
128
|
-
if (!isSilentRenew) {
|
|
129
|
-
handleUser(dispatch, userManager, validateUser);
|
|
130
|
-
if (!isSigninCallback) {
|
|
131
|
-
handleSigninSilent(dispatch, userManager);
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
return userManager;
|
|
135
|
-
}).catch((error) => {
|
|
136
|
-
console.debug("error when importing the idp settings", error);
|
|
137
|
-
dispatch(setShowAuthenticationRouterLogin(true));
|
|
138
|
-
throw error;
|
|
51
|
+
return Promise.resolve();
|
|
139
52
|
});
|
|
140
53
|
}
|
|
141
54
|
function computeMinExpiresIn(expiresIn, idToken, maxExpiresIn) {
|
|
142
55
|
const now = Date.now() / 1e3;
|
|
143
|
-
const exp = jwtDecode(idToken)
|
|
56
|
+
const { exp } = jwtDecode(idToken);
|
|
144
57
|
if (exp === void 0) {
|
|
145
58
|
return expiresIn;
|
|
146
59
|
}
|
|
@@ -157,10 +70,10 @@ function computeMinExpiresIn(expiresIn, idToken, maxExpiresIn) {
|
|
|
157
70
|
}
|
|
158
71
|
if (newExpiresInReplaceReason) {
|
|
159
72
|
console.debug(
|
|
160
|
-
|
|
73
|
+
`Replacing expiresIn in user to ${newExpiresIn} because ${newExpiresInReplaceReason}. `,
|
|
161
74
|
"debug:",
|
|
162
|
-
|
|
163
|
-
|
|
75
|
+
`original expires_in: ${expiresIn}, `,
|
|
76
|
+
`idTokenExpiresIn: ${idTokenExpiresIn}, idpSettings maxExpiresIn: ${maxExpiresIn}`
|
|
164
77
|
);
|
|
165
78
|
}
|
|
166
79
|
return newExpiresIn;
|
|
@@ -171,6 +84,7 @@ function login(location, userManagerInstance) {
|
|
|
171
84
|
}
|
|
172
85
|
function logout(dispatch, userManagerInstance) {
|
|
173
86
|
sessionStorage.removeItem(hackAuthorityKey);
|
|
87
|
+
sessionStorage.removeItem(oidcHackReloadedKey);
|
|
174
88
|
return userManagerInstance == null ? void 0 : userManagerInstance.getUser().then((user) => {
|
|
175
89
|
if (user) {
|
|
176
90
|
return userManagerInstance.signoutRedirect({
|
|
@@ -185,19 +99,11 @@ function logout(dispatch, userManagerInstance) {
|
|
|
185
99
|
dispatch(setLoggedUser(null));
|
|
186
100
|
dispatch(setLogoutError((_a = user == null ? void 0 : user.profile) == null ? void 0 : _a.name, { error: e }));
|
|
187
101
|
});
|
|
188
|
-
} else {
|
|
189
|
-
console.log("Error nobody to logout ");
|
|
190
102
|
}
|
|
103
|
+
console.log("Error nobody to logout ");
|
|
104
|
+
return Promise.resolve();
|
|
191
105
|
});
|
|
192
106
|
}
|
|
193
|
-
function getIdTokenExpiresIn(user) {
|
|
194
|
-
const now = Date.now() / 1e3;
|
|
195
|
-
const exp = jwtDecode(user.id_token).exp;
|
|
196
|
-
if (exp === void 0) {
|
|
197
|
-
return 0;
|
|
198
|
-
}
|
|
199
|
-
return exp - now;
|
|
200
|
-
}
|
|
201
107
|
function dispatchUser(dispatch, userManagerInstance, validateUser) {
|
|
202
108
|
return userManagerInstance.getUser().then((user) => {
|
|
203
109
|
if (user) {
|
|
@@ -205,9 +111,9 @@ function dispatchUser(dispatch, userManagerInstance, validateUser) {
|
|
|
205
111
|
console.debug(
|
|
206
112
|
"User token is expired and will not be dispatched"
|
|
207
113
|
);
|
|
208
|
-
return;
|
|
114
|
+
return Promise.resolve();
|
|
209
115
|
}
|
|
210
|
-
|
|
116
|
+
const validateUserPromise = (validateUser == null ? void 0 : validateUser(user)) || Promise.resolve(true);
|
|
211
117
|
return validateUserPromise.then((valid) => {
|
|
212
118
|
var _a, _b;
|
|
213
119
|
if (!valid) {
|
|
@@ -221,17 +127,15 @@ function dispatchUser(dispatch, userManagerInstance, validateUser) {
|
|
|
221
127
|
console.debug(
|
|
222
128
|
"User has been successfully loaded from store."
|
|
223
129
|
);
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
);
|
|
234
|
-
}
|
|
130
|
+
reloadTimerOnExpiresIn(
|
|
131
|
+
user,
|
|
132
|
+
userManagerInstance,
|
|
133
|
+
computeMinExpiresIn(
|
|
134
|
+
user.expires_in,
|
|
135
|
+
user.id_token,
|
|
136
|
+
(_b = userManagerInstance.idpSettings) == null ? void 0 : _b.maxExpiresIn
|
|
137
|
+
)
|
|
138
|
+
);
|
|
235
139
|
return dispatch(setLoggedUser(user));
|
|
236
140
|
}).catch((e) => {
|
|
237
141
|
var _a;
|
|
@@ -242,9 +146,9 @@ function dispatchUser(dispatch, userManagerInstance, validateUser) {
|
|
|
242
146
|
})
|
|
243
147
|
);
|
|
244
148
|
});
|
|
245
|
-
} else {
|
|
246
|
-
console.debug("You are not logged in.");
|
|
247
149
|
}
|
|
150
|
+
console.debug("You are not logged in.");
|
|
151
|
+
return Promise.resolve();
|
|
248
152
|
});
|
|
249
153
|
}
|
|
250
154
|
function getPreLoginPath() {
|
|
@@ -258,20 +162,20 @@ function navigateToPreLoginPath(navigate) {
|
|
|
258
162
|
}
|
|
259
163
|
function handleSigninCallback(dispatch, navigate, userManagerInstance) {
|
|
260
164
|
let reloadAfterNavigate = false;
|
|
261
|
-
userManagerInstance.signinRedirectCallback().catch(
|
|
262
|
-
if (
|
|
165
|
+
userManagerInstance.signinRedirectCallback().catch((e) => {
|
|
166
|
+
if (isIssuerError(e)) {
|
|
263
167
|
extractIssuerToSessionStorage(e);
|
|
264
168
|
reloadAfterNavigate = true;
|
|
265
169
|
} else {
|
|
266
170
|
throw e;
|
|
267
171
|
}
|
|
268
|
-
}).then(
|
|
172
|
+
}).then(() => {
|
|
269
173
|
dispatch(setSignInCallbackError(null));
|
|
270
174
|
navigateToPreLoginPath(navigate);
|
|
271
175
|
if (reloadAfterNavigate) {
|
|
272
176
|
reload();
|
|
273
177
|
}
|
|
274
|
-
}).catch(
|
|
178
|
+
}).catch((e) => {
|
|
275
179
|
dispatch(setSignInCallbackError(e));
|
|
276
180
|
console.error(e);
|
|
277
181
|
});
|
|
@@ -298,18 +202,20 @@ function handleUser(dispatch, userManager, validateUser) {
|
|
|
298
202
|
const idTokenExpiresIn = getIdTokenExpiresIn(user);
|
|
299
203
|
if (idTokenExpiresIn < 0) {
|
|
300
204
|
console.log(
|
|
301
|
-
|
|
205
|
+
`Error in silent renew, idtoken expired: ${idTokenExpiresIn} => Logging out.`,
|
|
302
206
|
error
|
|
303
207
|
);
|
|
304
208
|
dispatch(setShowAuthenticationRouterLogin(true));
|
|
305
209
|
dispatch(resetAuthenticationRouterError());
|
|
306
|
-
|
|
307
|
-
|
|
210
|
+
dispatch(setLoggedUser(null));
|
|
211
|
+
return;
|
|
212
|
+
}
|
|
213
|
+
if ((_a = userManager.idpSettings) == null ? void 0 : _a.maxExpiresIn) {
|
|
308
214
|
if (idTokenExpiresIn < userManager.idpSettings.maxExpiresIn) {
|
|
309
215
|
console.log(
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
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`,
|
|
313
219
|
error
|
|
314
220
|
);
|
|
315
221
|
reloadTimerOnExpiresIn(
|
|
@@ -319,7 +225,7 @@ function handleUser(dispatch, userManager, validateUser) {
|
|
|
319
225
|
);
|
|
320
226
|
} else {
|
|
321
227
|
console.log(
|
|
322
|
-
|
|
228
|
+
`Error in silent renew, but idtoken NOT expiring (expiring in${idTokenExpiresIn}) => postponing expiration to${userManager.idpSettings.maxExpiresIn}`,
|
|
323
229
|
error
|
|
324
230
|
);
|
|
325
231
|
reloadTimerOnExpiresIn(
|
|
@@ -330,7 +236,7 @@ function handleUser(dispatch, userManager, validateUser) {
|
|
|
330
236
|
}
|
|
331
237
|
} else {
|
|
332
238
|
console.log(
|
|
333
|
-
|
|
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}`,
|
|
334
240
|
error
|
|
335
241
|
);
|
|
336
242
|
}
|
|
@@ -340,6 +246,45 @@ function handleUser(dispatch, userManager, validateUser) {
|
|
|
340
246
|
console.debug("dispatch user");
|
|
341
247
|
dispatchUser(dispatch, userManager, validateUser);
|
|
342
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
|
+
}
|
|
343
288
|
export {
|
|
344
289
|
dispatchUser,
|
|
345
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
|
+
|