@jetbrains/ring-ui-built 7.0.0-beta.1 → 7.0.0-beta.3
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/_helpers/_rollupPluginBabelHelpers.js +1 -504
- package/components/_helpers/anchor.js +7 -5
- package/components/_helpers/button__classes.js +15 -13
- package/components/_helpers/caption.js +11 -17
- package/components/_helpers/card.js +92 -96
- package/components/_helpers/dialog__body-scroll-preventer.js +10 -17
- package/components/_helpers/header.js +1 -1
- package/components/_helpers/icon__svg.js +27 -23
- package/components/_helpers/input.js +150 -171
- package/components/_helpers/query-assist__suggestions.js +78 -93
- package/components/_helpers/select__filter.js +56 -67
- package/components/_helpers/services-link.js +23 -29
- package/components/_helpers/sidebar.js +91 -93
- package/components/_helpers/tab-link.js +8 -6
- package/components/_helpers/theme.js +55 -51
- package/components/_helpers/title.js +59 -69
- package/components/alert/alert.js +112 -156
- package/components/alert/container.js +32 -39
- package/components/alert-service/alert-service.js +104 -161
- package/components/analytics/analytics.js +12 -20
- package/components/analytics/analytics__custom-plugin.js +52 -68
- package/components/auth/auth.js +2 -27
- package/components/auth/auth__core.d.ts +1 -1
- package/components/auth/auth__core.js +742 -1428
- package/components/auth/background-flow.js +84 -121
- package/components/auth/down-notification.js +31 -69
- package/components/auth/iframe-flow.js +70 -123
- package/components/auth/request-builder.js +46 -77
- package/components/auth/response-parser.js +84 -112
- package/components/auth/storage.js +160 -318
- package/components/auth/token-validator.js +132 -227
- package/components/auth/window-flow.js +84 -121
- package/components/auth-dialog/auth-dialog.js +99 -150
- package/components/auth-dialog-service/auth-dialog-service.js +6 -26
- package/components/avatar/avatar-example-datauri.js +1 -1
- package/components/avatar/avatar.js +94 -123
- package/components/avatar/fallback-avatar.js +20 -34
- package/components/badge/badge.js +32 -38
- package/components/breadcrumbs/breadcrumbs.js +13 -17
- package/components/button/button.js +67 -80
- package/components/button-group/button-group.js +27 -36
- package/components/button-set/button-set.js +19 -27
- package/components/button-toolbar/button-toolbar.js +17 -25
- package/components/caret/caret.js +184 -211
- package/components/checkbox/checkbox.js +69 -86
- package/components/clipboard/clipboard-fallback.js +7 -7
- package/components/clipboard/clipboard.js +36 -128
- package/components/code/code.js +83 -151
- package/components/collapse/collapse-content.js +42 -60
- package/components/collapse/collapse-context.js +2 -2
- package/components/collapse/collapse-control.js +12 -12
- package/components/collapse/collapse.js +12 -17
- package/components/collapse/consts.js +4 -4
- package/components/collapse/utils.js +1 -3
- package/components/confirm/confirm.js +57 -87
- package/components/confirm-service/confirm-service.js +23 -44
- package/components/content-layout/content-layout.js +41 -56
- package/components/content-layout/sidebar.js +1 -1
- package/components/contenteditable/contenteditable.js +38 -46
- package/components/control-help/control-help.js +5 -3
- package/components/control-label/control-label.js +9 -8
- package/components/data-list/data-list.js +113 -156
- package/components/data-list/data-list.mock.js +3 -5
- package/components/data-list/item.js +120 -140
- package/components/data-list/selection.js +77 -135
- package/components/data-list/title.js +2 -10
- package/components/date-picker/consts.js +16 -22
- package/components/date-picker/date-input.js +99 -124
- package/components/date-picker/date-picker.js +140 -184
- package/components/date-picker/date-popup.js +280 -327
- package/components/date-picker/day.js +71 -94
- package/components/date-picker/month-names.js +41 -59
- package/components/date-picker/month-slider.js +42 -61
- package/components/date-picker/month.js +17 -24
- package/components/date-picker/months.js +44 -49
- package/components/date-picker/weekdays.js +12 -21
- package/components/date-picker/years.js +77 -98
- package/components/dialog/dialog.js +151 -187
- package/components/dialog/dialog__body-scroll-preventer.js +0 -3
- package/components/dropdown/anchor.js +0 -6
- package/components/dropdown/dropdown.js +134 -154
- package/components/dropdown-menu/dropdown-menu.js +59 -87
- package/components/editable-heading/editable-heading.js +69 -116
- package/components/error-bubble/error-bubble.js +29 -54
- package/components/error-message/error-message.js +34 -49
- package/components/footer/footer.js +27 -28
- package/components/global/compose.js +1 -8
- package/components/global/composeRefs.d.ts +0 -3
- package/components/global/composeRefs.js +8 -15
- package/components/global/controls-height.js +2 -2
- package/components/global/create-stateful-context.js +14 -13
- package/components/global/data-tests.js +7 -12
- package/components/global/dom.js +49 -82
- package/components/global/focus-sensor-hoc.js +99 -106
- package/components/global/fuzzy-highlight.js +23 -34
- package/components/global/get-event-key.js +8 -8
- package/components/global/get-uid.js +3 -7
- package/components/global/inject-styles.js +7 -14
- package/components/global/listeners.js +28 -47
- package/components/global/memoize.js +6 -10
- package/components/global/normalize-indent.js +19 -46
- package/components/global/promise-with-timeout.js +6 -8
- package/components/global/prop-types.js +3 -5
- package/components/global/react-dom-renderer.js +29 -40
- package/components/global/rerender-hoc.js +16 -32
- package/components/global/schedule-raf.js +4 -4
- package/components/global/sniffer.js +1 -1
- package/components/global/theme.d.ts +3 -0
- package/components/global/theme.js +2 -19
- package/components/global/trivial-template-tag.js +4 -9
- package/components/global/typescript-utils.js +2 -6
- package/components/global/url.js +20 -23
- package/components/global/use-event-callback.js +7 -4
- package/components/grid/col.js +27 -39
- package/components/grid/grid.js +18 -27
- package/components/grid/row.js +23 -30
- package/components/group/group.js +16 -22
- package/components/header/header-icon.js +19 -31
- package/components/header/header.d.ts +0 -1
- package/components/header/header.js +30 -64
- package/components/header/links.d.ts +2 -0
- package/components/header/links.js +20 -0
- package/components/header/logo.js +15 -26
- package/components/header/profile.js +124 -150
- package/components/header/services-link.js +1 -3
- package/components/header/services.js +64 -97
- package/components/header/smart-profile.js +101 -178
- package/components/header/smart-services.js +55 -90
- package/components/header/tray.js +21 -30
- package/components/heading/heading.js +21 -20
- package/components/http/http.js +162 -319
- package/components/http/http.mock.js +50 -98
- package/components/hub-source/hub-source.js +77 -182
- package/components/hub-source/hub-source__user.js +9 -37
- package/components/hub-source/hub-source__users-groups.js +34 -60
- package/components/i18n/i18n-context.js +7 -8
- package/components/i18n/i18n.js +3 -6
- package/components/icon/icon.js +60 -74
- package/components/icon/icon__svg.js +0 -5
- package/components/icon/index.js +0 -5
- package/components/input/input.js +1 -11
- package/components/island/adaptive-island-hoc.js +29 -37
- package/components/island/content.js +100 -110
- package/components/island/header.js +56 -66
- package/components/island/island.js +25 -33
- package/components/island-legacy/content-legacy.js +16 -22
- package/components/island-legacy/header-legacy.js +19 -25
- package/components/island-legacy/island-legacy.js +16 -22
- package/components/link/clickableLink.js +33 -42
- package/components/link/link.js +47 -55
- package/components/list/consts.js +2 -2
- package/components/list/list.js +399 -486
- package/components/list/list__custom.js +51 -61
- package/components/list/list__hint.js +9 -17
- package/components/list/list__item.js +147 -178
- package/components/list/list__link.js +38 -47
- package/components/list/list__separator.js +15 -24
- package/components/list/list__title.js +25 -34
- package/components/list/list__users-groups-source.js +55 -121
- package/components/loader/loader.js +38 -60
- package/components/loader/loader__core.js +123 -184
- package/components/loader-inline/loader-inline.js +24 -32
- package/components/loader-screen/loader-screen.js +24 -40
- package/components/login-dialog/login-dialog.js +81 -121
- package/components/login-dialog/service.js +6 -29
- package/components/markdown/markdown.js +16 -24
- package/components/message/message.js +170 -201
- package/components/old-browsers-message/old-browsers-message.js +11 -14
- package/components/old-browsers-message/old-browsers-message__stop.js +1 -4
- package/components/old-browsers-message/white-list.js +8 -13
- package/components/pager/pager.js +212 -257
- package/components/panel/panel.js +16 -22
- package/components/permissions/permissions.js +118 -161
- package/components/permissions/permissions__cache.js +191 -218
- package/components/popup/popup.consts.js +1 -1
- package/components/popup/popup.js +237 -288
- package/components/popup/popup.target.js +9 -7
- package/components/popup/position.js +94 -101
- package/components/popup-menu/popup-menu.js +33 -67
- package/components/progress-bar/progress-bar.js +57 -68
- package/components/query-assist/query-assist.js +583 -652
- package/components/query-assist/query-assist__suggestions.js +2 -26
- package/components/radio/radio.js +15 -27
- package/components/radio/radio__item.js +52 -62
- package/components/scrollable-section/scrollable-section.js +53 -0
- package/components/select/select.js +701 -796
- package/components/select/select__filter.js +1 -26
- package/components/select/select__popup.js +316 -413
- package/components/shortcuts/core.js +147 -195
- package/components/shortcuts/shortcut-title.js +6 -10
- package/components/shortcuts/shortcuts-hoc.js +23 -41
- package/components/shortcuts/shortcuts.js +41 -64
- package/components/slider/slider.js +93 -112
- package/components/slider/slider.utils.js +16 -23
- package/components/storage/storage.js +3 -27
- package/components/storage/storage__fallback.js +137 -210
- package/components/storage/storage__local.js +89 -147
- package/components/style.css +1 -1
- package/components/tab-trap/tab-trap.js +35 -53
- package/components/table/cell.js +11 -21
- package/components/table/disable-hover-hoc.js +27 -42
- package/components/table/header-cell.js +59 -75
- package/components/table/header.js +89 -110
- package/components/table/multitable.js +83 -89
- package/components/table/row-with-focus-sensor.js +25 -57
- package/components/table/row.js +169 -200
- package/components/table/selection-adapter.js +2 -2
- package/components/table/selection-shortcuts-hoc.js +108 -113
- package/components/table/selection.js +150 -217
- package/components/table/simple-table.js +19 -55
- package/components/table/smart-table.js +42 -76
- package/components/table/table.js +267 -327
- package/components/tabs/collapsible-more.js +47 -73
- package/components/tabs/collapsible-tab.js +32 -36
- package/components/tabs/collapsible-tabs.js +89 -148
- package/components/tabs/custom-item.js +4 -2
- package/components/tabs/dumb-tabs.js +60 -92
- package/components/tabs/smart-tabs.js +29 -61
- package/components/tabs/tab-link.js +1 -3
- package/components/tabs/tab.js +15 -24
- package/components/tabs/tabs.js +1 -26
- package/components/tag/tag.d.ts +0 -2
- package/components/tag/tag.js +120 -162
- package/components/tags-input/tags-input.js +222 -304
- package/components/tags-list/tags-list.js +45 -61
- package/components/text/text.js +28 -37
- package/components/toggle/toggle.js +51 -61
- package/components/tooltip/tooltip.js +109 -141
- package/components/user-agreement/service.js +259 -400
- package/components/user-agreement/user-agreement.js +80 -108
- package/components/user-card/card.js +1 -25
- package/components/user-card/smart-user-card-tooltip.js +52 -103
- package/components/user-card/tooltip.js +35 -65
- package/components/user-card/user-card.js +1 -25
- package/package.json +1 -1
- package/components/global/react-render-adapter.d.ts +0 -1
- package/components/global/react-render-adapter.js +0 -6
- package/components/header/scrollable-section.js +0 -47
- package/components/header/tray-icon.d.ts +0 -1
- package/components/header/tray-icon.js +0 -26
- /package/components/{header → scrollable-section}/scrollable-section.d.ts +0 -0
@@ -1,5 +1,5 @@
|
|
1
|
-
import { _ as _defineProperty, a as
|
2
|
-
import 'core-js/modules/
|
1
|
+
import { _ as _defineProperty, a as _objectWithoutProperties, b as _objectSpread2 } from '../_helpers/_rollupPluginBabelHelpers.js';
|
2
|
+
import 'core-js/modules/web.dom-collections.iterator.js';
|
3
3
|
import { PureComponent } from 'react';
|
4
4
|
import PropTypes from 'prop-types';
|
5
5
|
import '../auth/auth.js';
|
@@ -8,21 +8,13 @@ import Profile from './profile.js';
|
|
8
8
|
import { jsx } from 'react/jsx-runtime';
|
9
9
|
import Auth, { USER_CHANGED_EVENT, LOGOUT_POSTPONED_EVENT, USER_CHANGE_POSTPONED_EVENT } from '../auth/auth__core.js';
|
10
10
|
import '../auth/window-flow.js';
|
11
|
-
import 'core-js/modules/es.object.to-string.js';
|
12
|
-
import 'core-js/modules/es.promise.js';
|
13
11
|
import '../auth/response-parser.js';
|
14
|
-
import 'core-js/modules/es.array.index-of.js';
|
15
12
|
import 'core-js/modules/es.regexp.exec.js';
|
16
|
-
import 'core-js/modules/es.regexp.to-string.js';
|
17
13
|
import 'core-js/modules/es.string.replace.js';
|
18
|
-
import 'core-js/modules/web.dom-collections.for-each.js';
|
19
14
|
import 'es6-error';
|
20
15
|
import '../global/url.js';
|
21
|
-
import 'core-js/modules/es.string.match.js';
|
22
16
|
import '../auth/down-notification.js';
|
23
|
-
import 'core-js/modules/es.array.filter.js';
|
24
17
|
import '../alert/alert.js';
|
25
|
-
import 'core-js/modules/es.object.values.js';
|
26
18
|
import 'classnames';
|
27
19
|
import '@jetbrains/icons/exception';
|
28
20
|
import '@jetbrains/icons/checkmark';
|
@@ -32,20 +24,11 @@ import '../icon/icon.js';
|
|
32
24
|
import 'util-deprecate';
|
33
25
|
import '../icon/icon__constants.js';
|
34
26
|
import '../_helpers/icon__svg.js';
|
35
|
-
import 'core-js/modules/es.string.starts-with.js';
|
36
27
|
import '../global/memoize.js';
|
37
|
-
import 'core-js/modules/es.array.iterator.js';
|
38
|
-
import 'core-js/modules/es.map.js';
|
39
|
-
import 'core-js/modules/es.weak-map.js';
|
40
|
-
import 'core-js/modules/web.dom-collections.iterator.js';
|
41
28
|
import '../loader-inline/loader-inline.js';
|
42
29
|
import '../global/data-tests.js';
|
43
30
|
import 'core-js/modules/es.array.reduce.js';
|
44
|
-
import 'core-js/modules/es.object.entries.js';
|
45
31
|
import '../global/dom.js';
|
46
|
-
import 'core-js/modules/es.object.assign.js';
|
47
|
-
import 'core-js/modules/es.set.js';
|
48
|
-
import 'core-js/modules/es.string.split.js';
|
49
32
|
import '../button/button.js';
|
50
33
|
import '@jetbrains/icons/chevron-down';
|
51
34
|
import '../link/clickableLink.js';
|
@@ -58,13 +41,7 @@ import '../popup/popup.js';
|
|
58
41
|
import '../global/get-uid.js';
|
59
42
|
import '../global/schedule-raf.js';
|
60
43
|
import '../shortcuts/shortcuts.js';
|
61
|
-
import 'core-js/modules/es.array.map.js';
|
62
44
|
import '../shortcuts/core.js';
|
63
|
-
import 'core-js/modules/es.array.find-index.js';
|
64
|
-
import 'core-js/modules/es.array.includes.js';
|
65
|
-
import 'core-js/modules/es.array.slice.js';
|
66
|
-
import 'core-js/modules/es.array.splice.js';
|
67
|
-
import 'core-js/modules/es.string.includes.js';
|
68
45
|
import 'combokeys';
|
69
46
|
import '../global/sniffer.js';
|
70
47
|
import 'sniffr';
|
@@ -77,13 +54,11 @@ import '../link/link.js';
|
|
77
54
|
import '../_helpers/link.js';
|
78
55
|
import '../group/group.js';
|
79
56
|
import 'react-dom/client';
|
80
|
-
import 'core-js/modules/es.string.search.js';
|
81
57
|
import 'core-js/modules/web.url.js';
|
82
58
|
import 'core-js/modules/web.url.to-json.js';
|
83
59
|
import 'core-js/modules/web.url-search-params.js';
|
84
60
|
import '../global/listeners.js';
|
85
61
|
import '../http/http.js';
|
86
|
-
import 'core-js/modules/es.reflect.delete-property.js';
|
87
62
|
import '../global/promise-with-timeout.js';
|
88
63
|
import '../i18n/i18n.js';
|
89
64
|
import '../auth/storage.js';
|
@@ -97,12 +72,9 @@ import '../auth/background-flow.js';
|
|
97
72
|
import '../auth/token-validator.js';
|
98
73
|
import '../avatar/avatar.js';
|
99
74
|
import '../avatar/fallback-avatar.js';
|
100
|
-
import 'core-js/modules/es.array.from.js';
|
101
75
|
import '../dropdown-menu/dropdown-menu.js';
|
102
76
|
import '../list/list.js';
|
103
|
-
import 'core-js/modules/es.symbol.js';
|
104
77
|
import 'core-js/modules/es.symbol.description.js';
|
105
|
-
import 'core-js/modules/es.array.find.js';
|
106
78
|
import 'react-virtualized/dist/es/List';
|
107
79
|
import 'react-virtualized/dist/es/AutoSizer';
|
108
80
|
import 'react-virtualized/dist/es/WindowScroller';
|
@@ -132,166 +104,117 @@ import '../popup-menu/popup-menu.js';
|
|
132
104
|
import '../i18n/i18n-context.js';
|
133
105
|
import '../_helpers/header.js';
|
134
106
|
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
142
|
-
args[_key] = arguments[_key];
|
143
|
-
}
|
144
|
-
_this = _callSuper(this, SmartProfile, [].concat(args));
|
145
|
-
_defineProperty(_this, "state", {
|
107
|
+
const _excluded = ["auth", "profileUrl"];
|
108
|
+
const CERTIFICATE_MISMATCH_HEADER = 'x-client-certificate-token-mismatch';
|
109
|
+
class SmartProfile extends PureComponent {
|
110
|
+
constructor() {
|
111
|
+
super(...arguments);
|
112
|
+
_defineProperty(this, "state", {
|
146
113
|
user: null,
|
147
114
|
size: Profile.defaultProps.size,
|
148
115
|
isLogoutPostponed: false,
|
149
116
|
isUserChangePostponed: false
|
150
117
|
});
|
151
|
-
_defineProperty(
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
case 6:
|
165
|
-
_context.prev = 6;
|
166
|
-
_context.t0 = _context["catch"](1);
|
167
|
-
case 8:
|
168
|
-
_context.prev = 8;
|
169
|
-
_this.setState({
|
170
|
-
loading: false
|
171
|
-
});
|
172
|
-
return _context.finish(8);
|
173
|
-
case 11:
|
174
|
-
case "end":
|
175
|
-
return _context.stop();
|
176
|
-
}
|
177
|
-
}, _callee, null, [[1, 6, 8, 11]]);
|
178
|
-
})));
|
179
|
-
_defineProperty(_this, "logout", function () {
|
180
|
-
return _this.props.auth.logout();
|
181
|
-
});
|
182
|
-
_defineProperty(_this, "switchUser", function () {
|
183
|
-
return _this.props.auth.switchUser();
|
118
|
+
_defineProperty(this, "login", async () => {
|
119
|
+
this.setState({
|
120
|
+
loading: true
|
121
|
+
});
|
122
|
+
try {
|
123
|
+
await this.props.auth.login();
|
124
|
+
} catch (err) {
|
125
|
+
// do nothing
|
126
|
+
} finally {
|
127
|
+
this.setState({
|
128
|
+
loading: false
|
129
|
+
});
|
130
|
+
}
|
184
131
|
});
|
185
|
-
_defineProperty(
|
186
|
-
|
187
|
-
|
132
|
+
_defineProperty(this, "logout", () => this.props.auth.logout());
|
133
|
+
_defineProperty(this, "switchUser", () => this.props.auth.switchUser());
|
134
|
+
_defineProperty(this, "onRevertPostponement", () => {
|
135
|
+
if (this.state.isLogoutPostponed) {
|
136
|
+
this.props.auth.login();
|
188
137
|
}
|
189
|
-
if (
|
190
|
-
|
138
|
+
if (this.state.isUserChangePostponed) {
|
139
|
+
this.props.auth.updateUser();
|
191
140
|
}
|
192
141
|
});
|
193
|
-
return _this;
|
194
142
|
}
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
auth.addListener(LOGOUT_POSTPONED_EVENT, function () {
|
228
|
-
_this2.setState({
|
229
|
-
isLogoutPostponed: true
|
230
|
-
});
|
231
|
-
});
|
232
|
-
auth.addListener(USER_CHANGE_POSTPONED_EVENT, function () {
|
233
|
-
_this2.setState({
|
234
|
-
isUserChangePostponed: true
|
235
|
-
});
|
236
|
-
});
|
237
|
-
_context2.next = 14;
|
238
|
-
break;
|
239
|
-
case 12:
|
240
|
-
_context2.prev = 12;
|
241
|
-
_context2.t0 = _context2["catch"](0);
|
242
|
-
case 14:
|
243
|
-
case "end":
|
244
|
-
return _context2.stop();
|
245
|
-
}
|
246
|
-
}, _callee2, this, [[0, 12]]);
|
247
|
-
}));
|
248
|
-
function requestUser() {
|
249
|
-
return _requestUser.apply(this, arguments);
|
250
|
-
}
|
251
|
-
return requestUser;
|
252
|
-
}()
|
253
|
-
}, {
|
254
|
-
key: "checkUserCertificateMismatch",
|
255
|
-
value: function checkUserCertificateMismatch(user) {
|
256
|
-
var _userMeta$headers;
|
257
|
-
var _this$props = this.props,
|
258
|
-
auth = _this$props.auth,
|
259
|
-
translations = _this$props.translations;
|
260
|
-
var userMeta = auth.http.getMetaForResponse(user);
|
261
|
-
if (userMeta !== null && userMeta !== void 0 && (_userMeta$headers = userMeta.headers) !== null && _userMeta$headers !== void 0 && _userMeta$headers.has(CERTIFICATE_MISMATCH_HEADER)) {
|
262
|
-
var message = (translations === null || translations === void 0 ? void 0 : translations.certificateMismatch) || "You are authenticated as ".concat(user.login || user.name, ". To authenticate with the client certificate for your account, log out, then click the \"Log in with certificate\" option on the login page.");
|
263
|
-
alertService.warning(message, 0);
|
264
|
-
}
|
143
|
+
componentDidMount() {
|
144
|
+
this.requestUser();
|
145
|
+
}
|
146
|
+
async requestUser() {
|
147
|
+
try {
|
148
|
+
const {
|
149
|
+
auth
|
150
|
+
} = this.props;
|
151
|
+
const user = await auth.requestUser();
|
152
|
+
this.checkUserCertificateMismatch(user);
|
153
|
+
this.setState({
|
154
|
+
user
|
155
|
+
});
|
156
|
+
auth.addListener(USER_CHANGED_EVENT, newUser => {
|
157
|
+
this.setState({
|
158
|
+
user: newUser,
|
159
|
+
isLogoutPostponed: false,
|
160
|
+
isUserChangePostponed: false
|
161
|
+
});
|
162
|
+
});
|
163
|
+
auth.addListener(LOGOUT_POSTPONED_EVENT, () => {
|
164
|
+
this.setState({
|
165
|
+
isLogoutPostponed: true
|
166
|
+
});
|
167
|
+
});
|
168
|
+
auth.addListener(USER_CHANGE_POSTPONED_EVENT, () => {
|
169
|
+
this.setState({
|
170
|
+
isUserChangePostponed: true
|
171
|
+
});
|
172
|
+
});
|
173
|
+
} catch (e) {
|
174
|
+
// noop
|
265
175
|
}
|
266
|
-
}
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
props = _objectWithoutProperties(_this$props2, _excluded);
|
278
|
-
var url = profileUrl || (user ? "".concat(auth.config.serverUri, "users/").concat(user.id) : '');
|
279
|
-
return /*#__PURE__*/jsx(Profile, _objectSpread2({
|
280
|
-
onLogin: this.login,
|
281
|
-
onLogout: this.logout,
|
282
|
-
onSwitchUser: this.switchUser,
|
283
|
-
loading: loading,
|
284
|
-
user: user,
|
285
|
-
profileUrl: url,
|
286
|
-
showApplyChangedUser: isUserChangePostponed,
|
287
|
-
showLogIn: isLogoutPostponed,
|
288
|
-
showLogOut: !isLogoutPostponed,
|
289
|
-
showSwitchUser: auth._canShowDialogs() && !isLogoutPostponed && !isUserChangePostponed,
|
290
|
-
onRevertPostponement: this.onRevertPostponement
|
291
|
-
}, props));
|
176
|
+
}
|
177
|
+
checkUserCertificateMismatch(user) {
|
178
|
+
var _userMeta$headers;
|
179
|
+
const {
|
180
|
+
auth,
|
181
|
+
translations
|
182
|
+
} = this.props;
|
183
|
+
const userMeta = auth.http.getMetaForResponse(user);
|
184
|
+
if (userMeta !== null && userMeta !== void 0 && (_userMeta$headers = userMeta.headers) !== null && _userMeta$headers !== void 0 && _userMeta$headers.has(CERTIFICATE_MISMATCH_HEADER)) {
|
185
|
+
const message = (translations === null || translations === void 0 ? void 0 : translations.certificateMismatch) || "You are authenticated as ".concat(user.login || user.name, ". To authenticate with the client certificate for your account, log out, then click the \"Log in with certificate\" option on the login page.");
|
186
|
+
alertService.warning(message, 0);
|
292
187
|
}
|
293
|
-
}
|
294
|
-
|
188
|
+
}
|
189
|
+
render() {
|
190
|
+
const {
|
191
|
+
user,
|
192
|
+
loading,
|
193
|
+
isLogoutPostponed,
|
194
|
+
isUserChangePostponed
|
195
|
+
} = this.state;
|
196
|
+
const _this$props = this.props,
|
197
|
+
{
|
198
|
+
auth,
|
199
|
+
profileUrl
|
200
|
+
} = _this$props,
|
201
|
+
props = _objectWithoutProperties(_this$props, _excluded);
|
202
|
+
const url = profileUrl || (user ? "".concat(auth.config.serverUri, "users/").concat(user.id) : '');
|
203
|
+
return /*#__PURE__*/jsx(Profile, _objectSpread2({
|
204
|
+
onLogin: this.login,
|
205
|
+
onLogout: this.logout,
|
206
|
+
onSwitchUser: this.switchUser,
|
207
|
+
loading: loading,
|
208
|
+
user: user,
|
209
|
+
profileUrl: url,
|
210
|
+
showApplyChangedUser: isUserChangePostponed,
|
211
|
+
showLogIn: isLogoutPostponed,
|
212
|
+
showLogOut: !isLogoutPostponed,
|
213
|
+
showSwitchUser: auth._canShowDialogs() && !isLogoutPostponed && !isUserChangePostponed,
|
214
|
+
onRevertPostponement: this.onRevertPostponement
|
215
|
+
}, props));
|
216
|
+
}
|
217
|
+
}
|
295
218
|
_defineProperty(SmartProfile, "propTypes", {
|
296
219
|
auth: PropTypes.instanceOf(Auth).isRequired,
|
297
220
|
className: PropTypes.string,
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import { _ as _defineProperty, a as
|
2
|
-
import 'core-js/modules/
|
1
|
+
import { _ as _defineProperty, a as _objectWithoutProperties, b as _objectSpread2 } from '../_helpers/_rollupPluginBabelHelpers.js';
|
2
|
+
import 'core-js/modules/web.dom-collections.iterator.js';
|
3
3
|
import { Component } from 'react';
|
4
4
|
import PropTypes from 'prop-types';
|
5
5
|
import '../auth/auth.js';
|
@@ -8,25 +8,16 @@ import Services from './services.js';
|
|
8
8
|
import { jsx } from 'react/jsx-runtime';
|
9
9
|
import Auth from '../auth/auth__core.js';
|
10
10
|
import '../auth/window-flow.js';
|
11
|
-
import 'core-js/modules/es.object.to-string.js';
|
12
|
-
import 'core-js/modules/es.promise.js';
|
13
11
|
import '../auth/response-parser.js';
|
14
|
-
import 'core-js/modules/es.array.index-of.js';
|
15
12
|
import 'core-js/modules/es.regexp.exec.js';
|
16
|
-
import 'core-js/modules/es.regexp.to-string.js';
|
17
13
|
import 'core-js/modules/es.string.replace.js';
|
18
|
-
import 'core-js/modules/web.dom-collections.for-each.js';
|
19
14
|
import 'es6-error';
|
20
15
|
import '../global/url.js';
|
21
|
-
import 'core-js/modules/es.string.match.js';
|
22
16
|
import '../auth/down-notification.js';
|
23
|
-
import 'core-js/modules/es.array.filter.js';
|
24
17
|
import '../alert-service/alert-service.js';
|
25
|
-
import 'core-js/modules/es.array.map.js';
|
26
18
|
import 'react-dom/client';
|
27
19
|
import '../global/get-uid.js';
|
28
20
|
import '../alert/alert.js';
|
29
|
-
import 'core-js/modules/es.object.values.js';
|
30
21
|
import 'classnames';
|
31
22
|
import '@jetbrains/icons/exception';
|
32
23
|
import '@jetbrains/icons/checkmark';
|
@@ -36,20 +27,11 @@ import '../icon/icon.js';
|
|
36
27
|
import 'util-deprecate';
|
37
28
|
import '../icon/icon__constants.js';
|
38
29
|
import '../_helpers/icon__svg.js';
|
39
|
-
import 'core-js/modules/es.string.starts-with.js';
|
40
30
|
import '../global/memoize.js';
|
41
|
-
import 'core-js/modules/es.array.iterator.js';
|
42
|
-
import 'core-js/modules/es.map.js';
|
43
|
-
import 'core-js/modules/es.weak-map.js';
|
44
|
-
import 'core-js/modules/web.dom-collections.iterator.js';
|
45
31
|
import '../loader-inline/loader-inline.js';
|
46
32
|
import '../global/data-tests.js';
|
47
33
|
import 'core-js/modules/es.array.reduce.js';
|
48
|
-
import 'core-js/modules/es.object.entries.js';
|
49
34
|
import '../global/dom.js';
|
50
|
-
import 'core-js/modules/es.object.assign.js';
|
51
|
-
import 'core-js/modules/es.set.js';
|
52
|
-
import 'core-js/modules/es.string.split.js';
|
53
35
|
import '../button/button.js';
|
54
36
|
import '@jetbrains/icons/chevron-down';
|
55
37
|
import '../link/clickableLink.js';
|
@@ -62,11 +44,6 @@ import '../popup/popup.js';
|
|
62
44
|
import '../global/schedule-raf.js';
|
63
45
|
import '../shortcuts/shortcuts.js';
|
64
46
|
import '../shortcuts/core.js';
|
65
|
-
import 'core-js/modules/es.array.find-index.js';
|
66
|
-
import 'core-js/modules/es.array.includes.js';
|
67
|
-
import 'core-js/modules/es.array.slice.js';
|
68
|
-
import 'core-js/modules/es.array.splice.js';
|
69
|
-
import 'core-js/modules/es.string.includes.js';
|
70
47
|
import 'combokeys';
|
71
48
|
import '../global/sniffer.js';
|
72
49
|
import 'sniffr';
|
@@ -78,7 +55,6 @@ import '../alert/container.js';
|
|
78
55
|
import '../link/link.js';
|
79
56
|
import '../_helpers/link.js';
|
80
57
|
import '../group/group.js';
|
81
|
-
import 'core-js/modules/es.reflect.delete-property.js';
|
82
58
|
import '@jetbrains/icons/services-20px';
|
83
59
|
import '../dropdown/dropdown.js';
|
84
60
|
import '../global/typescript-utils.js';
|
@@ -87,7 +63,6 @@ import '@jetbrains/icons/chevron-10px';
|
|
87
63
|
import './header-icon.js';
|
88
64
|
import '../_helpers/header.js';
|
89
65
|
import '../_helpers/services-link.js';
|
90
|
-
import 'core-js/modules/es.string.search.js';
|
91
66
|
import 'core-js/modules/web.url.js';
|
92
67
|
import 'core-js/modules/web.url.to-json.js';
|
93
68
|
import 'core-js/modules/web.url-search-params.js';
|
@@ -104,86 +79,76 @@ import 'simply-uuid';
|
|
104
79
|
import '../auth/background-flow.js';
|
105
80
|
import '../auth/token-validator.js';
|
106
81
|
|
107
|
-
|
82
|
+
const _excluded = ["auth"];
|
108
83
|
function noop() {}
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
114
|
-
args[_key] = arguments[_key];
|
115
|
-
}
|
116
|
-
_this = _callSuper(this, SmartServices, [].concat(args));
|
117
|
-
_defineProperty(_this, "state", {
|
84
|
+
class SmartServices extends Component {
|
85
|
+
constructor() {
|
86
|
+
super(...arguments);
|
87
|
+
_defineProperty(this, "state", {
|
118
88
|
visible: true,
|
119
89
|
loading: false,
|
120
90
|
services: null
|
121
91
|
});
|
122
|
-
_defineProperty(
|
123
|
-
_defineProperty(
|
124
|
-
|
92
|
+
_defineProperty(this, "http", void 0);
|
93
|
+
_defineProperty(this, "stopLoading", () => {
|
94
|
+
this.setState({
|
125
95
|
loading: false
|
126
96
|
});
|
127
97
|
});
|
128
|
-
_defineProperty(
|
98
|
+
_defineProperty(this, "getServicesContent", () => {
|
129
99
|
var _this$getServices;
|
130
|
-
|
100
|
+
this.setState({
|
131
101
|
loading: true
|
132
102
|
});
|
133
|
-
(_this$getServices =
|
134
|
-
|
103
|
+
(_this$getServices = this.getServices(SmartServices.allFields)) === null || _this$getServices === void 0 || _this$getServices.then(services => {
|
104
|
+
this.setState({
|
135
105
|
services
|
136
106
|
});
|
137
|
-
|
138
|
-
}).catch(
|
107
|
+
this.stopLoading();
|
108
|
+
}).catch(this.stopLoading);
|
139
109
|
});
|
140
|
-
return _this;
|
141
110
|
}
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
visible: false
|
154
|
-
});
|
155
|
-
}
|
156
|
-
}).catch(noop);
|
157
|
-
}
|
158
|
-
}, {
|
159
|
-
key: "getServices",
|
160
|
-
value: function getServices(fields) {
|
161
|
-
var _this$http;
|
162
|
-
return (_this$http = this.http) === null || _this$http === void 0 ? void 0 : _this$http.get("services/header?fields=".concat(fields));
|
163
|
-
}
|
164
|
-
}, {
|
165
|
-
key: "render",
|
166
|
-
value: function render() {
|
167
|
-
var _this$state = this.state,
|
168
|
-
services = _this$state.services,
|
169
|
-
visible = _this$state.visible,
|
170
|
-
loading = _this$state.loading;
|
171
|
-
var _this$props = this.props,
|
172
|
-
auth = _this$props.auth,
|
173
|
-
props = _objectWithoutProperties(_this$props, _excluded);
|
174
|
-
if (!visible) {
|
175
|
-
return null;
|
111
|
+
componentDidMount() {
|
112
|
+
var _this$getServices2;
|
113
|
+
const {
|
114
|
+
auth
|
115
|
+
} = this.props;
|
116
|
+
this.http = new HTTP(auth, auth.getAPIPath());
|
117
|
+
(_this$getServices2 = this.getServices(SmartServices.countFields)) === null || _this$getServices2 === void 0 || _this$getServices2.then(services => {
|
118
|
+
if (!services.length) {
|
119
|
+
this.setState({
|
120
|
+
visible: false
|
121
|
+
});
|
176
122
|
}
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
123
|
+
}).catch(noop);
|
124
|
+
}
|
125
|
+
getServices(fields) {
|
126
|
+
var _this$http;
|
127
|
+
return (_this$http = this.http) === null || _this$http === void 0 ? void 0 : _this$http.get("services/header?fields=".concat(fields));
|
128
|
+
}
|
129
|
+
render() {
|
130
|
+
const {
|
131
|
+
services,
|
132
|
+
visible,
|
133
|
+
loading
|
134
|
+
} = this.state;
|
135
|
+
const _this$props = this.props,
|
136
|
+
{
|
137
|
+
auth
|
138
|
+
} = _this$props,
|
139
|
+
props = _objectWithoutProperties(_this$props, _excluded);
|
140
|
+
if (!visible) {
|
141
|
+
return null;
|
184
142
|
}
|
185
|
-
|
186
|
-
|
143
|
+
return /*#__PURE__*/jsx(Services, _objectSpread2(_objectSpread2({}, props), {}, {
|
144
|
+
clientId: auth.config.clientId,
|
145
|
+
initShown: true,
|
146
|
+
loading: loading,
|
147
|
+
onClick: this.getServicesContent,
|
148
|
+
services: services
|
149
|
+
}));
|
150
|
+
}
|
151
|
+
}
|
187
152
|
_defineProperty(SmartServices, "propTypes", {
|
188
153
|
auth: PropTypes.instanceOf(Auth).isRequired
|
189
154
|
});
|
@@ -1,39 +1,30 @@
|
|
1
|
-
import { _ as _defineProperty, a as
|
2
|
-
import '
|
3
|
-
import { Children, Component } from 'react';
|
1
|
+
import { _ as _defineProperty, a as _objectWithoutProperties, b as _objectSpread2 } from '../_helpers/_rollupPluginBabelHelpers.js';
|
2
|
+
import { Component, Children } from 'react';
|
4
3
|
import PropTypes from 'prop-types';
|
5
4
|
import classNames from 'classnames';
|
6
5
|
import { m as modules_47759f5e } from '../_helpers/header.js';
|
7
6
|
import { jsx } from 'react/jsx-runtime';
|
8
7
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
8
|
+
const _excluded = ["children", "className"];
|
9
|
+
const wrapChild = child => child && /*#__PURE__*/jsx("div", {
|
10
|
+
className: modules_47759f5e.trayItem,
|
11
|
+
children: child
|
12
|
+
});
|
13
|
+
class Tray extends Component {
|
14
|
+
render() {
|
15
|
+
const _this$props = this.props,
|
16
|
+
{
|
17
|
+
children,
|
18
|
+
className
|
19
|
+
} = _this$props,
|
20
|
+
restProps = _objectWithoutProperties(_this$props, _excluded);
|
21
|
+
const classes = classNames(modules_47759f5e.tray, className);
|
22
|
+
return /*#__PURE__*/jsx("div", _objectSpread2(_objectSpread2({}, restProps), {}, {
|
23
|
+
className: classes,
|
24
|
+
children: Children.map(children, wrapChild)
|
25
|
+
}));
|
20
26
|
}
|
21
|
-
|
22
|
-
return _createClass(Tray, [{
|
23
|
-
key: "render",
|
24
|
-
value: function render() {
|
25
|
-
var _this$props = this.props,
|
26
|
-
children = _this$props.children,
|
27
|
-
className = _this$props.className,
|
28
|
-
restProps = _objectWithoutProperties(_this$props, _excluded);
|
29
|
-
var classes = classNames(modules_47759f5e.tray, className);
|
30
|
-
return /*#__PURE__*/jsx("div", _objectSpread2(_objectSpread2({}, restProps), {}, {
|
31
|
-
className: classes,
|
32
|
-
children: Children.map(children, wrapChild)
|
33
|
-
}));
|
34
|
-
}
|
35
|
-
}]);
|
36
|
-
}(Component);
|
27
|
+
}
|
37
28
|
_defineProperty(Tray, "propTypes", {
|
38
29
|
className: PropTypes.string,
|
39
30
|
children: PropTypes.node
|