@jetbrains/ring-ui 7.0.62 → 7.0.64
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/components/alert/alert.css +1 -1
- package/components/alert/alert.d.ts +1 -1
- package/components/alert/alert.js +3 -3
- package/components/alert/container.css +2 -2
- package/components/alert/container.d.ts +1 -1
- package/components/alert/container.js +1 -1
- package/components/alert-service/alert-service.d.ts +2 -2
- package/components/analytics/{analytics__custom-plugin.d.ts → analytics-custom-plugin.d.ts} +1 -1
- package/components/analytics/{analytics__custom-plugin.js → analytics-custom-plugin.js} +2 -2
- package/components/auth/{auth__core.d.ts → auth-core.d.ts} +9 -8
- package/components/auth/{auth__core.js → auth-core.js} +14 -18
- package/components/auth/auth.d.ts +2 -2
- package/components/auth/auth.js +2 -2
- package/components/auth/background-flow.d.ts +2 -2
- package/components/auth/background-flow.js +0 -1
- package/components/auth/down-notification.css +1 -1
- package/components/auth/down-notification.js +1 -1
- package/components/auth/iframe-flow.d.ts +3 -3
- package/components/auth/iframe-flow.js +3 -5
- package/components/auth/request-builder.d.ts +2 -1
- package/components/auth/request-builder.js +1 -2
- package/components/auth/storage.d.ts +3 -3
- package/components/auth/storage.js +4 -8
- package/components/auth/token-validator.d.ts +2 -1
- package/components/auth/token-validator.js +6 -1
- package/components/auth/window-flow.d.ts +3 -3
- package/components/auth/window-flow.js +7 -7
- package/components/auth-dialog/auth-dialog.css +2 -2
- package/components/auth-dialog/auth-dialog.js +1 -1
- package/components/auth-dialog-service/auth-dialog-service.d.ts +1 -1
- package/components/avatar/avatar-info.d.ts +1 -1
- package/components/avatar/avatar.css +1 -1
- package/components/avatar/avatar.d.ts +1 -1
- package/components/avatar/avatar.figma.js +1 -1
- package/components/avatar/avatar.js +5 -7
- package/components/avatar/fallback-avatar.js +4 -8
- package/components/avatar-stack/avatar-stack.css +1 -1
- package/components/avatar-stack/avatar-stack.d.ts +3 -3
- package/components/avatar-stack/avatar-stack.figma.js +1 -1
- package/components/avatar-stack/avatar-stack.js +1 -1
- package/components/banner/banner.css +2 -2
- package/components/banner/banner.js +1 -1
- package/components/breadcrumbs/breadcrumbs.d.ts +1 -1
- package/components/breadcrumbs/breadcrumbs.figma.js +1 -1
- package/components/button/{button__classes.d.ts → button.classes.d.ts} +1 -1
- package/components/button/button.css +19 -16
- package/components/button/button.d.ts +4 -4
- package/components/button/button.figma.js +1 -1
- package/components/button/button.js +6 -6
- package/components/button-group/button-group.css +6 -6
- package/components/button-group/button-group.d.ts +1 -1
- package/components/button-group/button-group.js +1 -1
- package/components/button-group/caption.d.ts +1 -1
- package/components/button-set/button-set.css +2 -2
- package/components/button-set/button-set.d.ts +1 -1
- package/components/button-toolbar/button-toolbar.css +2 -2
- package/components/button-toolbar/button-toolbar.d.ts +1 -1
- package/components/caret/caret.js +23 -18
- package/components/checkbox/checkbox-group.figma.js +1 -1
- package/components/checkbox/checkbox.css +1 -1
- package/components/checkbox/checkbox.d.ts +1 -1
- package/components/checkbox/checkbox.figma.js +1 -1
- package/components/checkbox/checkbox.js +5 -5
- package/components/clipboard/clipboard.js +2 -2
- package/components/code/code.css +1 -1
- package/components/code/code.d.ts +1 -1
- package/components/code/code.js +5 -3
- package/components/collapse/collapse-content.d.ts +3 -3
- package/components/collapse/collapse-control.d.ts +2 -2
- package/components/collapse/collapse.css +1 -1
- package/components/collapse/collapse.d.ts +3 -3
- package/components/confirm/confirm.d.ts +1 -1
- package/components/confirm/confirm.js +1 -1
- package/components/confirm-service/confirm-service.d.ts +3 -3
- package/components/content-layout/content-layout.css +2 -2
- package/components/content-layout/content-layout.d.ts +1 -1
- package/components/content-layout/content-layout.js +2 -2
- package/components/content-layout/sidebar.d.ts +1 -1
- package/components/contenteditable/contenteditable.d.ts +1 -1
- package/components/contenteditable/contenteditable.js +2 -1
- package/components/control-help/control-help.css +1 -1
- package/components/control-help/control-help.d.ts +1 -1
- package/components/control-label/control-label.d.ts +1 -1
- package/components/data-list/data-list.css +1 -1
- package/components/data-list/data-list.d.ts +5 -5
- package/components/data-list/data-list.js +2 -2
- package/components/data-list/data-list.mock.d.ts +2 -2
- package/components/data-list/data-list.mock.js +20 -20
- package/components/data-list/item.d.ts +3 -3
- package/components/data-list/item.js +2 -2
- package/components/data-list/selection.d.ts +1 -1
- package/components/data-list/selection.js +8 -1
- package/components/data-list/title.d.ts +2 -2
- package/components/date-picker/consts.d.ts +1 -1
- package/components/date-picker/date-input.d.ts +1 -1
- package/components/date-picker/date-input.js +2 -2
- package/components/date-picker/date-picker.css +15 -15
- package/components/date-picker/date-picker.d.ts +5 -5
- package/components/date-picker/date-picker.js +17 -19
- package/components/date-picker/date-popup.d.ts +1 -1
- package/components/date-picker/date-popup.js +5 -3
- package/components/date-picker/day.d.ts +2 -2
- package/components/date-picker/day.js +4 -5
- package/components/date-picker/formats.js +1 -0
- package/components/date-picker/month-names.d.ts +1 -1
- package/components/date-picker/month-names.js +1 -1
- package/components/date-picker/month-slider.d.ts +2 -2
- package/components/date-picker/month-slider.js +1 -1
- package/components/date-picker/month.d.ts +1 -1
- package/components/date-picker/months.d.ts +1 -1
- package/components/date-picker/months.js +2 -2
- package/components/date-picker/years.d.ts +1 -1
- package/components/date-picker/years.js +2 -2
- package/components/dialog/{dialog__body-scroll-preventer.js → dialog-body-scroll-preventer.js} +6 -2
- package/components/dialog/dialog.css +5 -5
- package/components/dialog/dialog.d.ts +1 -1
- package/components/dialog/dialog.js +7 -7
- package/components/dropdown/anchor.d.ts +1 -1
- package/components/dropdown/dropdown.css +1 -1
- package/components/dropdown/dropdown.d.ts +2 -2
- package/components/dropdown/dropdown.js +2 -2
- package/components/dropdown-menu/dropdown-menu.d.ts +5 -5
- package/components/dropdown-menu/dropdown-menu.js +1 -1
- package/components/editable-heading/editable-heading.css +6 -8
- package/components/editable-heading/editable-heading.d.ts +1 -1
- package/components/editable-heading/editable-heading.js +3 -2
- package/components/error-bubble/error-bubble-legacy.css +3 -3
- package/components/error-bubble/error-bubble.css +5 -5
- package/components/error-bubble/error-bubble.d.ts +1 -1
- package/components/error-bubble/error-bubble.figma.js +1 -1
- package/components/error-bubble/error-bubble.js +2 -2
- package/components/error-message/error-message.css +1 -1
- package/components/error-message/error-message.d.ts +2 -2
- package/components/error-message/error-message.js +2 -2
- package/components/error-page/error-page.css +3 -3
- package/components/footer/footer.css +2 -2
- package/components/footer/footer.d.ts +1 -1
- package/components/footer/footer.js +1 -1
- package/components/form/form.css +3 -3
- package/components/global/compose-refs.d.ts +2 -0
- package/components/global/compose-refs.js +14 -0
- package/components/global/composeRefs.d.ts +6 -2
- package/components/global/composeRefs.js +7 -14
- package/components/global/create-stateful-context.d.ts +1 -1
- package/components/global/dom.d.ts +1 -1
- package/components/global/dom.js +2 -4
- package/components/global/focus-sensor-hoc.d.ts +1 -1
- package/components/global/focus-sensor-hoc.js +2 -2
- package/components/global/fuzzy-highlight.d.ts +2 -2
- package/components/global/get-event-key.d.ts +1 -1
- package/components/global/global.css +2 -2
- package/components/global/memoize.js +1 -1
- package/components/global/rerender-hoc.d.ts +1 -1
- package/components/global/rerender-hoc.js +2 -2
- package/components/global/theme.d.ts +1 -1
- package/components/global/theme.js +2 -2
- package/components/global/url.js +3 -3
- package/components/global/use-event-callback.js +1 -1
- package/components/global/variables.css +1 -1
- package/components/grid/col.d.ts +1 -1
- package/components/grid/col.js +1 -1
- package/components/grid/grid.css +4 -4
- package/components/grid/grid.d.ts +1 -1
- package/components/grid/grid.js +1 -1
- package/components/grid/row.d.ts +1 -1
- package/components/grid/row.js +1 -1
- package/components/group/group.css +1 -1
- package/components/group/group.d.ts +1 -1
- package/components/group/group.js +1 -1
- package/components/header/header-icon.d.ts +2 -2
- package/components/header/header.css +4 -4
- package/components/header/header.d.ts +1 -1
- package/components/header/links.d.ts +1 -1
- package/components/header/logo.d.ts +1 -1
- package/components/header/profile.d.ts +5 -5
- package/components/header/profile.js +3 -3
- package/components/header/services-link.d.ts +1 -1
- package/components/header/services-link.js +3 -3
- package/components/header/services.css +1 -1
- package/components/header/services.d.ts +2 -2
- package/components/header/services.js +3 -3
- package/components/header/smart-profile.d.ts +3 -3
- package/components/header/smart-profile.js +2 -1
- package/components/header/smart-services.d.ts +3 -3
- package/components/header/tray.d.ts +1 -1
- package/components/heading/heading.css +2 -2
- package/components/heading/heading.d.ts +1 -1
- package/components/http/http.mock.d.ts +1 -1
- package/components/hub-source/{hub-source__user.d.ts → hub-source-user.d.ts} +3 -2
- package/components/hub-source/{hub-source__users-groups.d.ts → hub-source-users-groups.d.ts} +3 -2
- package/components/hub-source/hub-source.d.ts +2 -2
- package/components/icon/{icon__svg.d.ts → icon-svg.d.ts} +1 -1
- package/components/icon/icon.css +5 -5
- package/components/icon/icon.d.ts +2 -2
- package/components/icon/icon.js +3 -3
- package/components/input/input-legacy.css +2 -2
- package/components/input/input.css +5 -5
- package/components/input/input.d.ts +3 -3
- package/components/input/input.figma.js +1 -1
- package/components/input/input.js +8 -8
- package/components/input-size/input-size.css +1 -1
- package/components/island/adaptive-island-hoc.d.ts +1 -1
- package/components/island/content.d.ts +1 -1
- package/components/island/content.js +2 -2
- package/components/island/header.d.ts +1 -1
- package/components/island/header.js +4 -4
- package/components/island/island.css +3 -3
- package/components/island/island.d.ts +1 -1
- package/components/line/line.css +1 -1
- package/components/link/clickable-link.d.ts +12 -0
- package/components/link/clickable-link.js +25 -0
- package/components/link/clickableLink.d.ts +11 -12
- package/components/link/clickableLink.js +4 -25
- package/components/link/link.css +1 -1
- package/components/link/link.d.ts +2 -2
- package/components/link/link.js +4 -4
- package/components/list/consts.d.ts +4 -5
- package/components/list/{list__custom.d.ts → list-custom.d.ts} +1 -1
- package/components/list/{list__custom.js → list-custom.js} +1 -1
- package/components/list/{list__hint.d.ts → list-hint.d.ts} +1 -1
- package/components/list/{list__hint.js → list-hint.js} +1 -1
- package/components/list/{list__item.d.ts → list-item.d.ts} +2 -2
- package/components/list/{list__item.js → list-item.js} +6 -5
- package/components/list/{list__separator.d.ts → list-separator.d.ts} +1 -1
- package/components/list/{list__separator.js → list-separator.js} +1 -1
- package/components/list/{list__title.d.ts → list-title.d.ts} +1 -1
- package/components/list/{list__title.js → list-title.js} +1 -1
- package/components/list/{list__users-groups-source.d.ts → list-users-groups-source.d.ts} +3 -2
- package/components/list/{list__users-groups-source.js → list-users-groups-source.js} +1 -1
- package/components/list/{list__classes.d.ts → list.classes.d.ts} +1 -1
- package/components/list/list.css +5 -5
- package/components/list/list.d.ts +7 -7
- package/components/list/list.js +34 -28
- package/components/loader/{loader__core.js → loader-core.js} +2 -2
- package/components/loader/loader.css +1 -1
- package/components/loader/loader.d.ts +2 -2
- package/components/loader/loader.js +1 -1
- package/components/loader-inline/loader-inline.css +2 -2
- package/components/loader-inline/loader-inline.d.ts +1 -1
- package/components/loader-screen/loader-screen.css +2 -2
- package/components/loader-screen/loader-screen.d.ts +1 -1
- package/components/login-dialog/login-dialog.css +2 -2
- package/components/login-dialog/login-dialog.d.ts +1 -1
- package/components/login-dialog/login-dialog.js +1 -1
- package/components/login-dialog/service.d.ts +1 -1
- package/components/markdown/markdown.css +3 -3
- package/components/markdown/markdown.d.ts +1 -1
- package/components/markdown/markdown.js +1 -1
- package/components/message/message.css +3 -3
- package/components/message/message.d.ts +4 -4
- package/components/message/message.js +3 -3
- package/components/old-browsers-message/old-browsers-message.css +2 -2
- package/components/old-browsers-message/old-browsers-message.js +1 -1
- package/components/pager/pager.css +1 -1
- package/components/pager/pager.d.ts +2 -2
- package/components/pager/pager.js +11 -12
- package/components/panel/panel.css +1 -1
- package/components/panel/panel.d.ts +1 -1
- package/components/panel/panel.js +1 -1
- package/components/permissions/{permissions__cache.js → permissions-cache.js} +4 -5
- package/components/permissions/permissions.d.ts +2 -2
- package/components/permissions/permissions.js +2 -4
- package/components/popup/popup.css +3 -3
- package/components/popup/popup.d.ts +2 -2
- package/components/popup/popup.js +6 -5
- package/components/popup/popup.target.d.ts +1 -1
- package/components/popup/position-css.js +6 -10
- package/components/popup/position.js +10 -10
- package/components/popup-menu/popup-menu.d.ts +4 -4
- package/components/progress-bar/progress-bar.css +6 -8
- package/components/progress-bar/progress-bar.d.ts +1 -1
- package/components/progress-bar/progress-bar.js +1 -1
- package/components/query-assist/{query-assist__suggestions.d.ts → query-assist-suggestions.d.ts} +1 -1
- package/components/query-assist/query-assist.css +11 -11
- package/components/query-assist/query-assist.d.ts +4 -4
- package/components/query-assist/query-assist.js +11 -11
- package/components/radio/{radio__item.d.ts → radio-item.d.ts} +1 -1
- package/components/radio/{radio__item.js → radio-item.js} +2 -2
- package/components/radio/radio.css +2 -2
- package/components/radio/radio.d.ts +2 -2
- package/components/radio/radio.js +1 -1
- package/components/scrollable-section/scrollable-section.d.ts +1 -1
- package/components/scrollable-section/scrollable-section.js +1 -1
- package/components/select/{select__filter.d.ts → select-filter.d.ts} +2 -2
- package/components/select/{select__filter.js → select-filter.js} +1 -1
- package/components/select/select-popup.css +5 -5
- package/components/select/{select__popup.d.ts → select-popup.d.ts} +8 -8
- package/components/select/{select__popup.js → select-popup.js} +11 -7
- package/components/select/select.css +10 -9
- package/components/select/select.d.ts +6 -6
- package/components/select/select.js +27 -25
- package/components/shortcuts/core.js +7 -7
- package/components/shortcuts/shortcuts-hoc.d.ts +2 -2
- package/components/shortcuts/shortcuts.d.ts +1 -1
- package/components/sidebar/sidebar.css +1 -1
- package/components/slider/slider.css +2 -2
- package/components/slider/slider.d.ts +5 -5
- package/components/slider/slider.js +5 -5
- package/components/slider/slider.utils.d.ts +1 -1
- package/components/slider/slider.utils.js +2 -4
- package/components/storage/{storage__local.d.ts → storage-local.d.ts} +1 -1
- package/components/storage/{storage__local.js → storage-local.js} +7 -7
- package/components/storage/storage.d.ts +1 -1
- package/components/storage/storage.js +1 -1
- package/components/tab-trap/tab-trap.css +1 -1
- package/components/tab-trap/tab-trap.d.ts +1 -1
- package/components/tab-trap/tab-trap.js +2 -5
- package/components/table/cell.d.ts +1 -1
- package/components/table/disable-hover-hoc.d.ts +1 -1
- package/components/table/header-cell.d.ts +1 -1
- package/components/table/header-cell.js +1 -1
- package/components/table/header.d.ts +2 -2
- package/components/table/header.js +2 -2
- package/components/table/multitable.d.ts +3 -3
- package/components/table/multitable.js +1 -1
- package/components/table/row-with-focus-sensor.d.ts +3 -3
- package/components/table/row.d.ts +4 -4
- package/components/table/row.js +1 -1
- package/components/table/selection-adapter.d.ts +2 -1
- package/components/table/selection-shortcuts-hoc.d.ts +4 -3
- package/components/table/selection-shortcuts-hoc.js +1 -3
- package/components/table/selection.js +4 -8
- package/components/table/simple-table.d.ts +2 -2
- package/components/table/smart-table.d.ts +2 -2
- package/components/table/table.css +6 -6
- package/components/table/table.d.ts +7 -7
- package/components/table/table.js +3 -3
- package/components/tabs/collapsible-more.d.ts +3 -3
- package/components/tabs/collapsible-more.js +2 -2
- package/components/tabs/collapsible-tab.d.ts +2 -2
- package/components/tabs/collapsible-tab.js +1 -1
- package/components/tabs/collapsible-tabs.d.ts +2 -2
- package/components/tabs/collapsible-tabs.js +6 -8
- package/components/tabs/custom-item.d.ts +2 -2
- package/components/tabs/dumb-tabs.d.ts +3 -3
- package/components/tabs/dumb-tabs.js +3 -3
- package/components/tabs/smart-tabs.d.ts +1 -1
- package/components/tabs/tab-link.d.ts +2 -2
- package/components/tabs/tab.d.ts +2 -2
- package/components/tabs/tabs.css +6 -6
- package/components/tag/tag.css +10 -8
- package/components/tag/tag.d.ts +5 -3
- package/components/tag/tag.js +5 -3
- package/components/tags-input/tags-input.css +3 -3
- package/components/tags-input/tags-input.d.ts +8 -8
- package/components/tags-input/tags-input.js +13 -7
- package/components/tags-list/tags-list.d.ts +2 -2
- package/components/tags-list/tags-list.js +1 -1
- package/components/text/text.css +1 -1
- package/components/text/text.d.ts +1 -1
- package/components/toggle/toggle.css +2 -2
- package/components/toggle/toggle.d.ts +1 -1
- package/components/toggle/toggle.js +1 -1
- package/components/tooltip/tooltip.css +1 -1
- package/components/tooltip/tooltip.d.ts +2 -2
- package/components/tooltip/tooltip.js +1 -1
- package/components/upload/upload.css +1 -1
- package/components/upload/upload.d.ts +3 -3
- package/components/upload/upload.js +2 -2
- package/components/user-agreement/service.d.ts +2 -2
- package/components/user-agreement/service.js +3 -5
- package/components/user-agreement/user-agreement.css +2 -2
- package/components/user-agreement/user-agreement.d.ts +1 -1
- package/components/user-agreement/user-agreement.js +1 -1
- package/components/user-card/card.d.ts +1 -1
- package/components/user-card/card.js +3 -2
- package/components/user-card/smart-user-card-tooltip.d.ts +2 -2
- package/components/user-card/smart-user-card-tooltip.js +1 -1
- package/components/user-card/tooltip.d.ts +3 -3
- package/components/user-card/user-card.css +1 -1
- package/package.json +4 -1
- /package/components/button/{button__classes.js → button.classes.js} +0 -0
- /package/components/dialog/{dialog__body-scroll-preventer.d.ts → dialog-body-scroll-preventer.d.ts} +0 -0
- /package/components/global/{variables.d.ts → variables.interface.d.ts} +0 -0
- /package/components/global/{variables.js → variables.interface.js} +0 -0
- /package/components/hub-source/{hub-source__user.js → hub-source-user.js} +0 -0
- /package/components/hub-source/{hub-source__users-groups.js → hub-source-users-groups.js} +0 -0
- /package/components/icon/{icon__svg.js → icon-svg.js} +0 -0
- /package/components/icon/{icon__constants.d.ts → icon.constants.d.ts} +0 -0
- /package/components/icon/{icon__constants.js → icon.constants.js} +0 -0
- /package/components/list/{list__classes.js → list.classes.js} +0 -0
- /package/components/loader/{loader__core.d.ts → loader-core.d.ts} +0 -0
- /package/components/old-browsers-message/{old-browsers-message__stop.d.ts → old-browsers-message-stop.d.ts} +0 -0
- /package/components/old-browsers-message/{old-browsers-message__stop.js → old-browsers-message-stop.js} +0 -0
- /package/components/permissions/{permissions__cache.d.ts → permissions-cache.d.ts} +0 -0
- /package/components/query-assist/{query-assist__suggestions.js → query-assist-suggestions.js} +0 -0
|
@@ -118,7 +118,7 @@ export default class Alert extends PureComponent {
|
|
|
118
118
|
[styles.withCloseButton]: this.props.closeable,
|
|
119
119
|
}), onClick: this._handleCaptionsLinksClick,
|
|
120
120
|
// We only process clicks on `a` elements, see above
|
|
121
|
-
role:
|
|
121
|
+
role: 'presentation', children: this.props.children }));
|
|
122
122
|
}
|
|
123
123
|
/**
|
|
124
124
|
* @private
|
|
@@ -129,7 +129,7 @@ export default class Alert extends PureComponent {
|
|
|
129
129
|
if (glyph) {
|
|
130
130
|
return _jsx(Icon, { glyph: glyph, className: styles.icon, color: TypeToIconColor[this.props.type] || Color.DEFAULT });
|
|
131
131
|
}
|
|
132
|
-
|
|
132
|
+
if (this.props.type === AlertType.LOADING) {
|
|
133
133
|
return _jsx(Loader, { className: styles.loader });
|
|
134
134
|
}
|
|
135
135
|
return '';
|
|
@@ -149,7 +149,7 @@ export default class Alert extends PureComponent {
|
|
|
149
149
|
});
|
|
150
150
|
const height = this.state.height;
|
|
151
151
|
const style = height ? { marginBottom: -height } : undefined;
|
|
152
|
-
return (_jsxs(ThemeProvider, { theme: theme, className: classes, "data-test": dataTests('alert', dataTest), "data-test-type": type, style: style, ref: this.storeAlertRef, children: [this._getIcon(), this._getCaption(), this.props.closeable ? (_jsx(Button, { icon: closeIcon, className: classNames(styles.close, closeButtonClassName), "data-test":
|
|
152
|
+
return (_jsxs(ThemeProvider, { theme: theme, className: classes, "data-test": dataTests('alert', dataTest), "data-test-type": type, style: style, ref: this.storeAlertRef, children: [this._getIcon(), this._getCaption(), this.props.closeable ? (_jsx(Button, { icon: closeIcon, className: classNames(styles.close, closeButtonClassName), "data-test": 'alert-close', "aria-label": 'close alert', onClick: this.closeRequest })) : ('')] }));
|
|
153
153
|
}
|
|
154
154
|
}
|
|
155
155
|
export { default as Container } from './container';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
@import
|
|
1
|
+
@import '../global/variables.css';
|
|
2
2
|
|
|
3
3
|
.alertContainer {
|
|
4
4
|
position: fixed;
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
.alertInContainer {
|
|
23
|
-
composes: alert from
|
|
23
|
+
composes: alert from './alert.css';
|
|
24
24
|
|
|
25
25
|
overflow-y: auto;
|
|
26
26
|
|
|
@@ -11,7 +11,7 @@ export default class Alerts extends PureComponent {
|
|
|
11
11
|
if (!show) {
|
|
12
12
|
return null;
|
|
13
13
|
}
|
|
14
|
-
return createPortal(_jsx("div", { "data-test":
|
|
14
|
+
return createPortal(_jsx("div", { "data-test": 'alert-container', className: classes, "aria-live": 'polite', ...restProps, children: Children.map(children, child => {
|
|
15
15
|
if (!isValidElement(child)) {
|
|
16
16
|
return child;
|
|
17
17
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ReactNode, Ref } from 'react';
|
|
2
|
-
import Alert, { AlertProps, AlertType } from '../alert/alert';
|
|
1
|
+
import { type ReactNode, type Ref } from 'react';
|
|
2
|
+
import Alert, { type AlertProps, type AlertType } from '../alert/alert';
|
|
3
3
|
export interface AlertItem extends Partial<Omit<AlertProps, 'children'>> {
|
|
4
4
|
key: string | number;
|
|
5
5
|
message: ReactNode;
|
|
@@ -34,7 +34,7 @@ export default class AnalyticsCustomPlugin {
|
|
|
34
34
|
}
|
|
35
35
|
_initSendSchedule() {
|
|
36
36
|
window.addEventListener('beforeunload', () => this._flush?.());
|
|
37
|
-
if (this._flush
|
|
37
|
+
if (this._flush) {
|
|
38
38
|
setInterval(this._flush, this._flushInterval);
|
|
39
39
|
}
|
|
40
40
|
this._hasSendSchedule = true;
|
|
@@ -51,7 +51,7 @@ export default class AnalyticsCustomPlugin {
|
|
|
51
51
|
}
|
|
52
52
|
_addDataToFlushingPack(sendingData) {
|
|
53
53
|
this._data.push(sendingData);
|
|
54
|
-
if (this._flushMaxPackSize
|
|
54
|
+
if (this._flushMaxPackSize && this._data.length >= this._flushMaxPackSize) {
|
|
55
55
|
this._flush?.();
|
|
56
56
|
}
|
|
57
57
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import Listeners, { Handler } from '../global/listeners';
|
|
2
|
-
import HTTP, { HTTPAuth, RequestParams } from '../http/http';
|
|
3
|
-
import type
|
|
4
|
-
import
|
|
5
|
-
import { AuthError, AuthResponse } from './response-parser';
|
|
1
|
+
import Listeners, { type Handler } from '../global/listeners';
|
|
2
|
+
import HTTP, { type HTTPAuth, type RequestParams } from '../http/http';
|
|
3
|
+
import AuthStorage, { type AuthState } from './storage';
|
|
4
|
+
import { type AuthError, type AuthResponse } from './response-parser';
|
|
6
5
|
import AuthRequestBuilder from './request-builder';
|
|
7
6
|
import BackgroundFlow from './background-flow';
|
|
8
|
-
import TokenValidator, { TokenValidationError, TokenValidatorConfig } from './token-validator';
|
|
7
|
+
import TokenValidator, { type TokenValidationError, type TokenValidatorConfig } from './token-validator';
|
|
8
|
+
import type AuthDialogService from '../auth-dialog-service/auth-dialog-service';
|
|
9
9
|
export declare const DEFAULT_EXPIRES_TIMEOUT: number;
|
|
10
10
|
export declare const DEFAULT_BACKGROUND_TIMEOUT: number;
|
|
11
11
|
export declare const USER_CHANGED_EVENT = "userChange";
|
|
@@ -116,7 +116,7 @@ declare global {
|
|
|
116
116
|
pr?: string;
|
|
117
117
|
}
|
|
118
118
|
}
|
|
119
|
-
|
|
119
|
+
declare class Auth implements HTTPAuth {
|
|
120
120
|
static DEFAULT_CONFIG: Omit<AuthConfig, "serverUri">;
|
|
121
121
|
static API_PATH: string;
|
|
122
122
|
static API_AUTH_PATH: string;
|
|
@@ -233,4 +233,5 @@ export default class Auth implements HTTPAuth {
|
|
|
233
233
|
*/
|
|
234
234
|
setHash(hash: string): void;
|
|
235
235
|
}
|
|
236
|
-
export
|
|
236
|
+
export default Auth;
|
|
237
|
+
export { Auth };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/* eslint-disable no-underscore-dangle,max-lines */
|
|
1
2
|
import { fixUrl, getAbsoluteBaseURL } from '../global/url';
|
|
2
3
|
import Listeners from '../global/listeners';
|
|
3
4
|
import HTTP from '../http/http';
|
|
@@ -45,7 +46,7 @@ const DEFAULT_CONFIG = {
|
|
|
45
46
|
waitForRedirectTimeout: DEFAULT_WAIT_FOR_REDIRECT_TIMEOUT,
|
|
46
47
|
translations: null,
|
|
47
48
|
};
|
|
48
|
-
|
|
49
|
+
class Auth {
|
|
49
50
|
static DEFAULT_CONFIG = DEFAULT_CONFIG;
|
|
50
51
|
static API_PATH = 'api/rest/';
|
|
51
52
|
static API_AUTH_PATH = 'oauth2/auth';
|
|
@@ -75,10 +76,10 @@ export default class Auth {
|
|
|
75
76
|
if (!config) {
|
|
76
77
|
throw new Error('Config is required');
|
|
77
78
|
}
|
|
78
|
-
if (config.serverUri
|
|
79
|
+
if (config.serverUri === null || config.serverUri === undefined) {
|
|
79
80
|
throw new Error('"serverUri" property is required');
|
|
80
81
|
}
|
|
81
|
-
const unsupportedParams = ['redirect_uri', 'request_credentials', 'client_id'].filter(param =>
|
|
82
|
+
const unsupportedParams = ['redirect_uri', 'request_credentials', 'client_id'].filter(param => Object.prototype.hasOwnProperty.call(config, param));
|
|
82
83
|
if (unsupportedParams.length !== 0) {
|
|
83
84
|
throw new Error(`The following parameters are no longer supported: ${unsupportedParams.join(', ')}. Please change them from snake_case to camelCase.`);
|
|
84
85
|
}
|
|
@@ -186,6 +187,7 @@ export default class Auth {
|
|
|
186
187
|
* @return {Promise.<string>} absolute URL promise that is resolved to a URL
|
|
187
188
|
* that should be restored after returning back from auth server.
|
|
188
189
|
*/
|
|
190
|
+
// eslint-disable-next-line complexity
|
|
189
191
|
async init() {
|
|
190
192
|
this._storage?.onTokenChange(async (token) => {
|
|
191
193
|
const isGuest = this.user ? this.user.guest : false;
|
|
@@ -262,7 +264,7 @@ export default class Auth {
|
|
|
262
264
|
}
|
|
263
265
|
async sendRedirect(error) {
|
|
264
266
|
const authRequest = await this._requestBuilder?.prepareAuthRequest();
|
|
265
|
-
if (authRequest
|
|
267
|
+
if (authRequest) {
|
|
266
268
|
this._redirectCurrentPage(authRequest.url);
|
|
267
269
|
}
|
|
268
270
|
// HUB-10867 Since we already redirecting the page, there is no actual need to throw an error
|
|
@@ -384,11 +386,9 @@ export default class Auth {
|
|
|
384
386
|
});
|
|
385
387
|
});
|
|
386
388
|
}
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
this._redirectCurrentPage(authRequest.url);
|
|
391
|
-
}
|
|
389
|
+
const authRequest = await this._requestBuilder?.prepareAuthRequest();
|
|
390
|
+
if (authRequest) {
|
|
391
|
+
this._redirectCurrentPage(authRequest.url);
|
|
392
392
|
}
|
|
393
393
|
throw new TokenValidator.TokenValidationError(error.message);
|
|
394
394
|
}
|
|
@@ -415,9 +415,7 @@ export default class Auth {
|
|
|
415
415
|
if (this.config.cacheCurrentUser) {
|
|
416
416
|
return this._storage?.getCachedUser(() => this.http.authorizedFetch(Auth.API_PROFILE_PATH, accessToken, this.config.userParams));
|
|
417
417
|
}
|
|
418
|
-
|
|
419
|
-
return this.http.authorizedFetch(Auth.API_PROFILE_PATH, accessToken, this.config.userParams);
|
|
420
|
-
}
|
|
418
|
+
return this.http.authorizedFetch(Auth.API_PROFILE_PATH, accessToken, this.config.userParams);
|
|
421
419
|
}
|
|
422
420
|
/**
|
|
423
421
|
* @return {Promise.<object>}
|
|
@@ -640,7 +638,6 @@ export default class Auth {
|
|
|
640
638
|
*/
|
|
641
639
|
async logout(extraParams) {
|
|
642
640
|
const requestParams = {
|
|
643
|
-
// eslint-disable-next-line camelcase
|
|
644
641
|
request_credentials: 'required',
|
|
645
642
|
...extraParams,
|
|
646
643
|
};
|
|
@@ -649,7 +646,7 @@ export default class Auth {
|
|
|
649
646
|
this._updateDomainUser(null);
|
|
650
647
|
await this._storage?.wipeToken();
|
|
651
648
|
const authRequest = await this._requestBuilder?.prepareAuthRequest(requestParams);
|
|
652
|
-
if (authRequest
|
|
649
|
+
if (authRequest) {
|
|
653
650
|
this._redirectCurrentPage(authRequest.url);
|
|
654
651
|
}
|
|
655
652
|
}
|
|
@@ -659,9 +656,6 @@ export default class Auth {
|
|
|
659
656
|
this._isLoginWindowOpen = true;
|
|
660
657
|
return await this._embeddedFlow?.authorize();
|
|
661
658
|
}
|
|
662
|
-
catch (e) {
|
|
663
|
-
throw e;
|
|
664
|
-
}
|
|
665
659
|
finally {
|
|
666
660
|
this._isLoginWindowOpen = false;
|
|
667
661
|
}
|
|
@@ -751,7 +745,7 @@ export default class Auth {
|
|
|
751
745
|
const scopes = scope ? scope.split(' ') : newState.scopes || defaultScope || [];
|
|
752
746
|
const effectiveExpiresIn = expiresIn ? parseInt(expiresIn, 10) : defaultExpiresIn;
|
|
753
747
|
const expires = TokenValidator._epoch() + effectiveExpiresIn;
|
|
754
|
-
if (accessToken
|
|
748
|
+
if (accessToken) {
|
|
755
749
|
await this._storage?.saveToken({ accessToken, scopes, expires, lifeTime: effectiveExpiresIn });
|
|
756
750
|
}
|
|
757
751
|
return newState;
|
|
@@ -844,3 +838,5 @@ export default class Auth {
|
|
|
844
838
|
}
|
|
845
839
|
}
|
|
846
840
|
}
|
|
841
|
+
export default Auth;
|
|
842
|
+
export { Auth };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import Auth from './
|
|
2
|
-
export * from './
|
|
1
|
+
import Auth from './auth-core';
|
|
2
|
+
export * from './auth-core';
|
|
3
3
|
export default Auth;
|
package/components/auth/auth.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import WindowFlow from './window-flow';
|
|
2
2
|
import defaultOnBackendDown from './down-notification';
|
|
3
|
-
import Auth from './
|
|
3
|
+
import Auth from './auth-core';
|
|
4
4
|
/**
|
|
5
5
|
* @name Auth
|
|
6
6
|
*
|
|
@@ -38,5 +38,5 @@ Auth.DEFAULT_CONFIG = {
|
|
|
38
38
|
EmbeddedLoginFlow: WindowFlow,
|
|
39
39
|
onBackendDown: defaultOnBackendDown,
|
|
40
40
|
};
|
|
41
|
-
export * from './
|
|
41
|
+
export * from './auth-core';
|
|
42
42
|
export default Auth;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import AuthRequestBuilder from './request-builder';
|
|
2
|
-
import AuthStorage from './storage';
|
|
1
|
+
import type AuthRequestBuilder from './request-builder';
|
|
2
|
+
import type AuthStorage from './storage';
|
|
3
3
|
export declare const HUB_AUTH_PAGE_OPENED = "HUB_AUTH_PAGE_OPENED";
|
|
4
4
|
export default class BackgroundFlow {
|
|
5
5
|
_requestBuilder: AuthRequestBuilder;
|
|
@@ -41,7 +41,6 @@ export default class BackgroundFlow {
|
|
|
41
41
|
*/
|
|
42
42
|
async _load() {
|
|
43
43
|
const authRequest = await this._requestBuilder
|
|
44
|
-
// eslint-disable-next-line camelcase
|
|
45
44
|
.prepareAuthRequest({ request_credentials: 'silent' }, { nonRedirect: true });
|
|
46
45
|
return new Promise((resolve, reject) => {
|
|
47
46
|
function onMessage(e) {
|
|
@@ -18,7 +18,7 @@ function renderAlert(message, type = Alert.Type.WARNING) {
|
|
|
18
18
|
}
|
|
19
19
|
function Message({ translations, onCheckAgain }) {
|
|
20
20
|
const { backendIsNotAvailable, checkAgain, errorMessage } = translations;
|
|
21
|
-
return (_jsxs("div", { "data-test":
|
|
21
|
+
return (_jsxs("div", { "data-test": 'ring-backend-down-notification', children: [_jsx(Group, { children: _jsx("div", { className: styles.title, children: backendIsNotAvailable }) }), _jsxs("span", { className: styles.error, children: [errorMessage, " "] }), _jsx(Link, { onClick: onCheckAgain, "data-test": 'check-again', children: checkAgain })] }));
|
|
22
22
|
}
|
|
23
23
|
export default function onBackendDown({ onCheckAgain, translations }) {
|
|
24
24
|
async function checkAgainWithoutClosing(e) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { AuthTranslations, LoginFlow } from './
|
|
2
|
-
import AuthRequestBuilder from './request-builder';
|
|
3
|
-
import AuthStorage from './storage';
|
|
1
|
+
import { type AuthTranslations, type LoginFlow } from './auth-core';
|
|
2
|
+
import type AuthRequestBuilder from './request-builder';
|
|
3
|
+
import type AuthStorage from './storage';
|
|
4
4
|
export default class IFrameFlow implements LoginFlow {
|
|
5
5
|
hideDialog: (() => void) | null;
|
|
6
6
|
private _requestBuilder;
|
|
@@ -20,10 +20,8 @@ export default class IFrameFlow {
|
|
|
20
20
|
* Initiates authorization in window
|
|
21
21
|
*/
|
|
22
22
|
async _load() {
|
|
23
|
-
const authRequest = await this._requestBuilder.prepareAuthRequest(
|
|
24
|
-
|
|
25
|
-
{ request_credentials: 'required', auth_mode: 'bypass_to_login' }, { nonRedirect: false });
|
|
26
|
-
const renderFallbackLink = () => (_jsx(Link, { href: authRequest.url, target: "_self", children: this._translations.nothingHappensLink }));
|
|
23
|
+
const authRequest = await this._requestBuilder.prepareAuthRequest({ request_credentials: 'required', auth_mode: 'bypass_to_login' }, { nonRedirect: false });
|
|
24
|
+
const renderFallbackLink = () => (_jsx(Link, { href: authRequest.url, target: '_self', children: this._translations.nothingHappensLink }));
|
|
27
25
|
return new Promise((resolve, reject) => {
|
|
28
26
|
this.hideDialog = loginDialogService({
|
|
29
27
|
url: authRequest.url,
|
|
@@ -71,7 +69,7 @@ export default class IFrameFlow {
|
|
|
71
69
|
this._reset();
|
|
72
70
|
}
|
|
73
71
|
authorize() {
|
|
74
|
-
if (this._promise
|
|
72
|
+
if (this._promise && this._loginWindow && !this._loginWindow.closed) {
|
|
75
73
|
return this._promise;
|
|
76
74
|
}
|
|
77
75
|
this._promise = this._load();
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import uuid from 'simply-uuid';
|
|
2
|
-
import
|
|
2
|
+
import type { AuthState } from './storage';
|
|
3
|
+
import type AuthStorage from './storage';
|
|
3
4
|
export interface AuthRequestBuilderConfig {
|
|
4
5
|
authorization: string;
|
|
5
6
|
redirectUri?: string | null | undefined;
|
|
@@ -29,9 +29,9 @@ export default class AuthRequestBuilder {
|
|
|
29
29
|
* @return {Promise.<string>} promise that is resolved to authURL
|
|
30
30
|
*/
|
|
31
31
|
async prepareAuthRequest(extraParams, extraState) {
|
|
32
|
+
// eslint-disable-next-line no-underscore-dangle
|
|
32
33
|
const stateId = AuthRequestBuilder._uuid();
|
|
33
34
|
const scopes = this.config.scopes.map(scope => encodeURIComponent(scope));
|
|
34
|
-
/* eslint-disable camelcase */
|
|
35
35
|
const request = Object.assign({
|
|
36
36
|
response_type: 'token',
|
|
37
37
|
state: stateId,
|
|
@@ -40,7 +40,6 @@ export default class AuthRequestBuilder {
|
|
|
40
40
|
client_id: this.config.clientId,
|
|
41
41
|
scope: scopes.join(' '),
|
|
42
42
|
}, extraParams || {});
|
|
43
|
-
/* eslint-enable camelcase */
|
|
44
43
|
const authURL = encodeURL(this.config.authorization, request);
|
|
45
44
|
const state = Object.assign({
|
|
46
45
|
restoreLocation: window.location.href,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { StorageClass, StorageInterface } from '../storage/storage';
|
|
2
|
-
import { AuthUser } from './
|
|
3
|
-
import { AuthResponse } from './response-parser';
|
|
1
|
+
import { type StorageClass, type StorageInterface } from '../storage/storage';
|
|
2
|
+
import { type AuthUser } from './auth-core';
|
|
3
|
+
import { type AuthResponse } from './response-parser';
|
|
4
4
|
export interface StoredToken {
|
|
5
5
|
accessToken: string;
|
|
6
6
|
scopes?: string[];
|
|
@@ -100,9 +100,7 @@ export default class AuthStorage {
|
|
|
100
100
|
await this.cleanStates();
|
|
101
101
|
return this.saveState(id, state, true);
|
|
102
102
|
}
|
|
103
|
-
|
|
104
|
-
throw e;
|
|
105
|
-
}
|
|
103
|
+
throw e;
|
|
106
104
|
}
|
|
107
105
|
return undefined;
|
|
108
106
|
}
|
|
@@ -114,7 +112,7 @@ export default class AuthStorage {
|
|
|
114
112
|
async cleanStates(removeStateId) {
|
|
115
113
|
const now = Date.now();
|
|
116
114
|
const removalResult = await this._stateStorage.each((key, value) => {
|
|
117
|
-
if (value
|
|
115
|
+
if (value === null || value === undefined) {
|
|
118
116
|
return undefined;
|
|
119
117
|
}
|
|
120
118
|
// Remove requested state
|
|
@@ -137,7 +135,7 @@ export default class AuthStorage {
|
|
|
137
135
|
}
|
|
138
136
|
return undefined;
|
|
139
137
|
});
|
|
140
|
-
const currentStates = removalResult.filter((state) => state
|
|
138
|
+
const currentStates = removalResult.filter((state) => state !== null && state !== undefined);
|
|
141
139
|
let stateStorageSize = currentStates.reduce((overallSize, state) => state.size + overallSize, 0);
|
|
142
140
|
if (stateStorageSize > this.stateQuota) {
|
|
143
141
|
currentStates.sort((a, b) => a.created - b.created);
|
|
@@ -205,9 +203,7 @@ export default class AuthStorage {
|
|
|
205
203
|
setTimeout(loadAndCache, UPDATE_USER_TIMEOUT);
|
|
206
204
|
return user;
|
|
207
205
|
}
|
|
208
|
-
|
|
209
|
-
return loadAndCache();
|
|
210
|
-
}
|
|
206
|
+
return loadAndCache();
|
|
211
207
|
}
|
|
212
208
|
/**
|
|
213
209
|
* Remove cached user if any
|
|
@@ -45,7 +45,9 @@ export default class TokenValidator {
|
|
|
45
45
|
*/
|
|
46
46
|
validateTokenLocally() {
|
|
47
47
|
return this._getValidatedToken([
|
|
48
|
+
// eslint-disable-next-line no-underscore-dangle
|
|
48
49
|
TokenValidator._validateExistence,
|
|
50
|
+
// eslint-disable-next-line no-underscore-dangle
|
|
49
51
|
TokenValidator._validateExpiration,
|
|
50
52
|
this._validateScopes.bind(this),
|
|
51
53
|
]);
|
|
@@ -56,7 +58,9 @@ export default class TokenValidator {
|
|
|
56
58
|
*/
|
|
57
59
|
validateToken() {
|
|
58
60
|
return this._getValidatedToken([
|
|
61
|
+
// eslint-disable-next-line no-underscore-dangle
|
|
59
62
|
TokenValidator._validateExistence,
|
|
63
|
+
// eslint-disable-next-line no-underscore-dangle
|
|
60
64
|
TokenValidator._validateExpiration,
|
|
61
65
|
this._validateScopes.bind(this),
|
|
62
66
|
this._validateAgainstUser.bind(this),
|
|
@@ -82,6 +86,7 @@ export default class TokenValidator {
|
|
|
82
86
|
static _validateExpiration({ expires, lifeTime }) {
|
|
83
87
|
const REFRESH_BEFORE_RATIO = 6;
|
|
84
88
|
const refreshBefore = lifeTime ? Math.ceil(lifeTime / REFRESH_BEFORE_RATIO) : TokenValidator.DEFAULT_REFRESH_BEFORE;
|
|
89
|
+
// eslint-disable-next-line no-underscore-dangle
|
|
85
90
|
if (expires && expires < TokenValidator._epoch() + refreshBefore) {
|
|
86
91
|
throw new TokenValidator.TokenValidationError('Token expired');
|
|
87
92
|
}
|
|
@@ -150,7 +155,7 @@ export default class TokenValidator {
|
|
|
150
155
|
*/
|
|
151
156
|
async _getValidatedToken(validators) {
|
|
152
157
|
const storedToken = await this._storage.getToken();
|
|
153
|
-
if (storedToken
|
|
158
|
+
if (storedToken === null || storedToken === undefined) {
|
|
154
159
|
throw new TokenValidator.TokenValidationError('Token not found');
|
|
155
160
|
}
|
|
156
161
|
for (let i = 0; i < validators.length; i++) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { LoginFlow } from './
|
|
2
|
-
import AuthRequestBuilder from './request-builder';
|
|
3
|
-
import AuthStorage from './storage';
|
|
1
|
+
import { type LoginFlow } from './auth-core';
|
|
2
|
+
import type AuthRequestBuilder from './request-builder';
|
|
3
|
+
import type AuthStorage from './storage';
|
|
4
4
|
export default class WindowFlow implements LoginFlow {
|
|
5
5
|
private _timeoutId;
|
|
6
6
|
private _requestBuilder;
|
|
@@ -30,9 +30,7 @@ export default class WindowFlow {
|
|
|
30
30
|
* Initiates authorization in window
|
|
31
31
|
*/
|
|
32
32
|
async _load() {
|
|
33
|
-
const authRequest = await this._requestBuilder.prepareAuthRequest(
|
|
34
|
-
// eslint-disable-next-line camelcase
|
|
35
|
-
{ request_credentials: 'required', auth_mode: 'bypass_to_login' }, { nonRedirect: true });
|
|
33
|
+
const authRequest = await this._requestBuilder.prepareAuthRequest({ request_credentials: 'required', auth_mode: 'bypass_to_login' }, { nonRedirect: true });
|
|
36
34
|
return new Promise((resolve, reject) => {
|
|
37
35
|
this.reject = reject;
|
|
38
36
|
let cleanRun;
|
|
@@ -60,10 +58,12 @@ export default class WindowFlow {
|
|
|
60
58
|
reject(new AuthResponseParser.AuthError(state));
|
|
61
59
|
}
|
|
62
60
|
});
|
|
63
|
-
if (this._loginWindow
|
|
61
|
+
if (this._loginWindow === null ||
|
|
62
|
+
this._loginWindow === undefined ||
|
|
63
|
+
(this._loginWindow && this._loginWindow.closed)) {
|
|
64
64
|
this._loginWindow = this._openWindow(authRequest.url);
|
|
65
65
|
}
|
|
66
|
-
else {
|
|
66
|
+
else if (this._loginWindow) {
|
|
67
67
|
this._loginWindow.location.href = authRequest.url;
|
|
68
68
|
}
|
|
69
69
|
this.checkIsClosed();
|
|
@@ -82,7 +82,7 @@ export default class WindowFlow {
|
|
|
82
82
|
clearTimeout(this._timeoutId);
|
|
83
83
|
};
|
|
84
84
|
stop() {
|
|
85
|
-
if (this._loginWindow
|
|
85
|
+
if (this._loginWindow !== null && this._loginWindow !== undefined) {
|
|
86
86
|
this._loginWindow.close();
|
|
87
87
|
}
|
|
88
88
|
if (this.reject) {
|
|
@@ -91,7 +91,7 @@ export default class WindowFlow {
|
|
|
91
91
|
this._reset();
|
|
92
92
|
}
|
|
93
93
|
authorize() {
|
|
94
|
-
if (this._promise
|
|
94
|
+
if (this._promise && this._loginWindow && !this._loginWindow.closed) {
|
|
95
95
|
this._loginWindow.focus();
|
|
96
96
|
return this._promise;
|
|
97
97
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
@import
|
|
1
|
+
@import '../global/variables.css';
|
|
2
2
|
|
|
3
3
|
.dialog.dialog {
|
|
4
4
|
width: auto;
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
}
|
|
7
7
|
|
|
8
8
|
.content {
|
|
9
|
-
composes: font from
|
|
9
|
+
composes: font from '../global/global.css';
|
|
10
10
|
|
|
11
11
|
display: flex;
|
|
12
12
|
align-items: center;
|
|
@@ -54,6 +54,6 @@ export default class AuthDialog extends Component {
|
|
|
54
54
|
const title = (this.props.title || defaultTitle)
|
|
55
55
|
.replace('%serviceName%', serviceName ?? '')
|
|
56
56
|
.replace('{{serviceName}}', serviceName ?? '');
|
|
57
|
-
return (_jsx(Dialog, { label: title, "data-test":
|
|
57
|
+
return (_jsx(Dialog, { label: title, "data-test": 'ring-auth-dialog', className: className, contentClassName: classNames(className, styles.dialog), onEscPress: this.onEscPress, show: show, trapFocus: true, children: _jsx(Content, { children: _jsxs("div", { className: styles.content, children: [serviceImage && _jsx("img", { alt: `${serviceName} logo`, className: styles.logo, src: serviceImage }), _jsx(H2, { className: styles.title, children: title }), errorMessage && _jsx("div", { className: styles.error, children: errorMessage }), _jsx(Button, { primary: true, className: styles.firstButton, "data-test": 'auth-dialog-confirm-button', onClick: onConfirm, children: confirmLabel }), onTryAgain && (_jsx(Button, { className: styles.button, "data-test": 'auth-dialog-retry-button', onClick: () => this.onRetryPress(), loader: retrying, disabled: retrying, children: tryAgainLabel })), _jsx(Button, { className: styles.button, "data-test": 'auth-dialog-cancel-button', onClick: onCancel, children: cancelLabel })] }) }) }));
|
|
58
58
|
}
|
|
59
59
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import AuthDialog, { AuthDialogProps } from '../auth-dialog/auth-dialog';
|
|
1
|
+
import AuthDialog, { type AuthDialogProps } from '../auth-dialog/auth-dialog';
|
|
2
2
|
export declare const reactRoot: import("react-dom/client").Root;
|
|
3
3
|
type AuthDialogAttributes = React.JSX.LibraryManagedAttributes<typeof AuthDialog, AuthDialogProps>;
|
|
4
4
|
export default function showAuthDialog(props?: AuthDialogAttributes): () => void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PureComponent, ImgHTMLAttributes, ReactNode } from 'react';
|
|
1
|
+
import { PureComponent, type ImgHTMLAttributes, type ReactNode } from 'react';
|
|
2
2
|
import { Size } from './avatar-size';
|
|
3
3
|
export { Size };
|
|
4
4
|
export interface AvatarProps extends ImgHTMLAttributes<HTMLImageElement> {
|
|
@@ -49,9 +49,9 @@ export default class Avatar extends PureComponent {
|
|
|
49
49
|
[styles.round]: round,
|
|
50
50
|
});
|
|
51
51
|
if (!url || this.state.errorUrl === url) {
|
|
52
|
-
return (_jsxs("span", { ...restProps, "data-test":
|
|
53
|
-
[styles.empty]: username
|
|
54
|
-
}), style: styleObj, children: [username
|
|
52
|
+
return (_jsxs("span", { ...restProps, "data-test": 'avatar', className: classNames(classes, {
|
|
53
|
+
[styles.empty]: (username === null || username === undefined) && (info === null || info === undefined),
|
|
54
|
+
}), style: styleObj, children: [username && _jsx(FallbackAvatar, { size: size, round: round, username: username }), info && _jsx(AvatarInfo, { size: size, children: info })] }));
|
|
55
55
|
}
|
|
56
56
|
let src = url;
|
|
57
57
|
if (!skipParams && !isDataURI(url)) {
|
|
@@ -72,10 +72,8 @@ export default class Avatar extends PureComponent {
|
|
|
72
72
|
subavatarSizeString,
|
|
73
73
|
};
|
|
74
74
|
subavatarSrc = skipParams ? subavatar : encodeURL(urlStart, queryParams);
|
|
75
|
-
return (_jsxs("div", { children: [_jsx("img", { ...restProps, onError: this.handleError, onLoad: this.handleSuccess, className: classNames(classes, styles.avatarShadow), style: styleObj, src: src, alt:
|
|
76
|
-
}
|
|
77
|
-
else {
|
|
78
|
-
return (_jsx("img", { ...restProps, "data-test": "avatar", onError: this.handleError, onLoad: this.handleSuccess, className: classNames(classes, styles.avatarShadow), style: styleObj, src: src, alt: "User avatar" }));
|
|
75
|
+
return (_jsxs("div", { children: [_jsx("img", { ...restProps, onError: this.handleError, onLoad: this.handleSuccess, className: classNames(classes, styles.avatarShadow), style: styleObj, src: src, alt: 'User avatar' }), _jsx("img", { ...restProps, "data-test": 'avatar', onError: this.handleError, onLoad: this.handleSuccess, className: classNames(styles.subavatar), style: styleObjGroup, src: subavatarSrc, alt: 'Subavatar' })] }));
|
|
79
76
|
}
|
|
77
|
+
return (_jsx("img", { ...restProps, "data-test": 'avatar', onError: this.handleError, onLoad: this.handleSuccess, className: classNames(classes, styles.avatarShadow), style: styleObj, src: src, alt: 'User avatar' }));
|
|
80
78
|
}
|
|
81
79
|
}
|