@jetbrains/ring-ui 4.0.48 → 4.0.52
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/auth/auth.test.js +14 -7
- package/components/auth/auth__core.js +7 -0
- package/components/avatar/avatar.js +6 -3
- package/components/dropdown-menu/dropdown-menu.js +0 -1
- package/components/dropdown-menu/dropdown-menu.test.js +2 -1
- package/components/tooltip/tooltip.js +2 -2
- package/package.json +36 -36
|
@@ -203,7 +203,8 @@ describe('Auth', () => {
|
|
|
203
203
|
redirectUri: 'http://localhost:8080/hub',
|
|
204
204
|
clientId: '1-1-1-1-1',
|
|
205
205
|
scope: ['0-0-0-0-0', 'youtrack'],
|
|
206
|
-
optionalScopes: ['youtrack']
|
|
206
|
+
optionalScopes: ['youtrack'],
|
|
207
|
+
waitForRedirectTimeout: 0
|
|
207
208
|
});
|
|
208
209
|
try {
|
|
209
210
|
await auth.init();
|
|
@@ -226,7 +227,8 @@ describe('Auth', () => {
|
|
|
226
227
|
auth = new Auth({
|
|
227
228
|
serverUri: '',
|
|
228
229
|
redirect: true,
|
|
229
|
-
cleanHash: true
|
|
230
|
+
cleanHash: true,
|
|
231
|
+
waitForRedirectTimeout: 0
|
|
230
232
|
});
|
|
231
233
|
|
|
232
234
|
try {
|
|
@@ -245,7 +247,8 @@ describe('Auth', () => {
|
|
|
245
247
|
auth = new Auth({
|
|
246
248
|
serverUri: '',
|
|
247
249
|
redirect: true,
|
|
248
|
-
cleanHash: true
|
|
250
|
+
cleanHash: true,
|
|
251
|
+
waitForRedirectTimeout: 0
|
|
249
252
|
});
|
|
250
253
|
|
|
251
254
|
try {
|
|
@@ -265,7 +268,8 @@ describe('Auth', () => {
|
|
|
265
268
|
auth = new Auth({
|
|
266
269
|
serverUri: '',
|
|
267
270
|
redirect: true,
|
|
268
|
-
cleanHash: false
|
|
271
|
+
cleanHash: false,
|
|
272
|
+
waitForRedirectTimeout: 0
|
|
269
273
|
});
|
|
270
274
|
|
|
271
275
|
try {
|
|
@@ -284,7 +288,8 @@ describe('Auth', () => {
|
|
|
284
288
|
serverUri: '',
|
|
285
289
|
redirect: true,
|
|
286
290
|
redirectUri: 'http://localhost:8080/hub',
|
|
287
|
-
requestCredentials: 'skip'
|
|
291
|
+
requestCredentials: 'skip',
|
|
292
|
+
waitForRedirectTimeout: 0
|
|
288
293
|
});
|
|
289
294
|
try {
|
|
290
295
|
await auth.init();
|
|
@@ -313,7 +318,8 @@ describe('Auth', () => {
|
|
|
313
318
|
redirectUri: 'http://localhost:8080/hub',
|
|
314
319
|
clientId: '1-1-1-1-1',
|
|
315
320
|
scope: ['0-0-0-0-0', 'youtrack'],
|
|
316
|
-
optionalScopes: ['youtrack']
|
|
321
|
+
optionalScopes: ['youtrack'],
|
|
322
|
+
waitForRedirectTimeout: 0
|
|
317
323
|
});
|
|
318
324
|
|
|
319
325
|
auth._storage._tokenStorage = auth._storage._stateStorage =
|
|
@@ -330,7 +336,8 @@ describe('Auth', () => {
|
|
|
330
336
|
auth._storage.saveToken({
|
|
331
337
|
accessToken: 'token',
|
|
332
338
|
expires: TokenValidator._epoch() + HOUR,
|
|
333
|
-
scopes: ['0-0-0-0-0']
|
|
339
|
+
scopes: ['0-0-0-0-0'],
|
|
340
|
+
waitForRedirectTimeout: 0
|
|
334
341
|
});
|
|
335
342
|
});
|
|
336
343
|
|
|
@@ -14,6 +14,7 @@ export const DEFAULT_EXPIRES_TIMEOUT = 40 * 60;
|
|
|
14
14
|
export const DEFAULT_BACKGROUND_TIMEOUT = 10 * 1000;
|
|
15
15
|
const DEFAULT_BACKEND_CHECK_TIMEOUT = 10 * 1000;
|
|
16
16
|
const BACKGROUND_REDIRECT_TIMEOUT = 20 * 1000;
|
|
17
|
+
const DEFAULT_WAIT_FOR_REDIRECT_TIMEOUT = 5 * 1000;
|
|
17
18
|
/* eslint-enable no-magic-numbers */
|
|
18
19
|
|
|
19
20
|
export const USER_CHANGED_EVENT = 'userChange';
|
|
@@ -46,6 +47,7 @@ const DEFAULT_CONFIG = {
|
|
|
46
47
|
onBackendDown: () => {},
|
|
47
48
|
|
|
48
49
|
defaultExpiresIn: DEFAULT_EXPIRES_TIMEOUT,
|
|
50
|
+
waitForRedirectTimeout: DEFAULT_WAIT_FOR_REDIRECT_TIMEOUT,
|
|
49
51
|
translations: {
|
|
50
52
|
login: 'Log in',
|
|
51
53
|
loginTo: 'Log in to %serviceName%',
|
|
@@ -311,6 +313,11 @@ export default class Auth {
|
|
|
311
313
|
const authRequest = await this._requestBuilder.prepareAuthRequest();
|
|
312
314
|
this._redirectCurrentPage(authRequest.url);
|
|
313
315
|
|
|
316
|
+
// HUB-10867 Since we already redirecting the page, there is no actual need to throw an error
|
|
317
|
+
// and scare user with flashing error
|
|
318
|
+
// But let's keep it just in case redirect was not successful
|
|
319
|
+
await new Promise(resolve => setTimeout(resolve, this.config.waitForRedirectTimeout));
|
|
320
|
+
|
|
314
321
|
throw error;
|
|
315
322
|
}
|
|
316
323
|
|
|
@@ -16,6 +16,7 @@ export const Size = {
|
|
|
16
16
|
Size18: 18,
|
|
17
17
|
Size20: 20,
|
|
18
18
|
Size24: 24,
|
|
19
|
+
Size28: 28,
|
|
19
20
|
Size32: 32,
|
|
20
21
|
Size40: 40,
|
|
21
22
|
Size48: 48,
|
|
@@ -32,7 +33,8 @@ export default class Avatar extends PureComponent {
|
|
|
32
33
|
round: PropTypes.bool,
|
|
33
34
|
subavatar: PropTypes.string,
|
|
34
35
|
subavatarSize: PropTypes.number,
|
|
35
|
-
username: PropTypes.string
|
|
36
|
+
username: PropTypes.string,
|
|
37
|
+
skipParams: PropTypes.bool
|
|
36
38
|
};
|
|
37
39
|
|
|
38
40
|
static defaultProps = {
|
|
@@ -64,6 +66,7 @@ export default class Avatar extends PureComponent {
|
|
|
64
66
|
subavatar,
|
|
65
67
|
subavatarSize,
|
|
66
68
|
username,
|
|
69
|
+
skipParams,
|
|
67
70
|
...restProps
|
|
68
71
|
} = this.props;
|
|
69
72
|
const sizeString = `${size}px`;
|
|
@@ -105,7 +108,7 @@ export default class Avatar extends PureComponent {
|
|
|
105
108
|
}
|
|
106
109
|
|
|
107
110
|
let src = url;
|
|
108
|
-
if (!isDataURI(url)) {
|
|
111
|
+
if (!skipParams && !isDataURI(url)) {
|
|
109
112
|
const [urlStart, query] = url.split('?');
|
|
110
113
|
const queryParams = {
|
|
111
114
|
...parseQueryString(query),
|
|
@@ -124,7 +127,7 @@ export default class Avatar extends PureComponent {
|
|
|
124
127
|
subavatarSizeString
|
|
125
128
|
};
|
|
126
129
|
|
|
127
|
-
subavatarSrc = encodeURL(urlStart, queryParams);
|
|
130
|
+
subavatarSrc = skipParams ? subavatar : encodeURL(urlStart, queryParams);
|
|
128
131
|
return (
|
|
129
132
|
<div>
|
|
130
133
|
<img
|
|
@@ -66,7 +66,8 @@ describe('Dropdown Menu', () => {
|
|
|
66
66
|
it('should add accessibility attributes to anchor', async () => {
|
|
67
67
|
const wrapper = await mountAndWaitForMenuContent({
|
|
68
68
|
anchor: 'Anchor text',
|
|
69
|
-
data: [{key: 'key1'}, {key: 'key2'}]
|
|
69
|
+
data: [{key: 'key1'}, {key: 'key2'}],
|
|
70
|
+
menuProps: {activateFirstItem: true}
|
|
70
71
|
});
|
|
71
72
|
|
|
72
73
|
const anchorProps = wrapper.update().find(Anchor).props();
|
|
@@ -20,7 +20,7 @@ export default class Tooltip extends Component {
|
|
|
20
20
|
delay: PropTypes.number,
|
|
21
21
|
selfOverflowOnly: PropTypes.bool,
|
|
22
22
|
popupProps: PropTypes.object,
|
|
23
|
-
title: PropTypes.
|
|
23
|
+
title: PropTypes.node,
|
|
24
24
|
children: PropTypes.node,
|
|
25
25
|
'data-test': PropTypes.string
|
|
26
26
|
};
|
|
@@ -146,7 +146,7 @@ export default class Tooltip extends Component {
|
|
|
146
146
|
{...restProps}
|
|
147
147
|
ref={this.containerRef}
|
|
148
148
|
data-test={dataTests('ring-tooltip', dataTest)}
|
|
149
|
-
data-test-title={title}
|
|
149
|
+
data-test-title={typeof title === 'string' ? title : undefined}
|
|
150
150
|
>
|
|
151
151
|
{children}
|
|
152
152
|
<Popup
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jetbrains/ring-ui",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.52",
|
|
4
4
|
"description": "JetBrains UI library",
|
|
5
5
|
"author": "JetBrains",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -66,27 +66,27 @@
|
|
|
66
66
|
"readmeFilename": "README.md",
|
|
67
67
|
"devDependencies": {
|
|
68
68
|
"@babel/cli": "^7.15.7",
|
|
69
|
-
"@babel/eslint-parser": "^7.15.
|
|
69
|
+
"@babel/eslint-parser": "^7.15.8",
|
|
70
70
|
"@jetbrains/eslint-config": "^5.3.1",
|
|
71
|
-
"@jetbrains/generator-ring-ui": "^4.0.
|
|
71
|
+
"@jetbrains/generator-ring-ui": "^4.0.40",
|
|
72
72
|
"@jetbrains/stylelint-config": "^2.0.1",
|
|
73
|
-
"@primer/octicons": "^
|
|
74
|
-
"@storybook/addon-a11y": "6.3.
|
|
75
|
-
"@storybook/addon-docs": "6.3.
|
|
76
|
-
"@storybook/addon-essentials": "6.3.
|
|
73
|
+
"@primer/octicons": "^16.0.0",
|
|
74
|
+
"@storybook/addon-a11y": "6.3.11",
|
|
75
|
+
"@storybook/addon-docs": "6.3.10",
|
|
76
|
+
"@storybook/addon-essentials": "6.3.11",
|
|
77
77
|
"@storybook/addon-storyshots": "6.3.2",
|
|
78
78
|
"@storybook/addon-storyshots-puppeteer": "6.3.2",
|
|
79
|
-
"@storybook/addon-storysource": "6.3.
|
|
80
|
-
"@storybook/addons": "6.3.
|
|
81
|
-
"@storybook/builder-webpack5": "6.3.
|
|
82
|
-
"@storybook/client-api": "6.3.
|
|
83
|
-
"@storybook/core": "6.3.
|
|
84
|
-
"@storybook/html": "6.3.
|
|
85
|
-
"@storybook/manager-webpack5": "^6.3.
|
|
86
|
-
"@storybook/source-loader": "6.3.
|
|
87
|
-
"@storybook/theming": "6.3.
|
|
88
|
-
"@testing-library/react": "^12.1.
|
|
89
|
-
"@testing-library/user-event": "^13.
|
|
79
|
+
"@storybook/addon-storysource": "6.3.11",
|
|
80
|
+
"@storybook/addons": "6.3.10",
|
|
81
|
+
"@storybook/builder-webpack5": "6.3.10",
|
|
82
|
+
"@storybook/client-api": "6.3.10",
|
|
83
|
+
"@storybook/core": "6.3.11",
|
|
84
|
+
"@storybook/html": "6.3.10",
|
|
85
|
+
"@storybook/manager-webpack5": "^6.3.10",
|
|
86
|
+
"@storybook/source-loader": "6.3.10",
|
|
87
|
+
"@storybook/theming": "6.3.10",
|
|
88
|
+
"@testing-library/react": "^12.1.2",
|
|
89
|
+
"@testing-library/user-event": "^13.3.0",
|
|
90
90
|
"@wojtekmaj/enzyme-adapter-react-17": "^0.6.3",
|
|
91
91
|
"angular": "^1.8.2",
|
|
92
92
|
"angular-mocks": "^1.8.2",
|
|
@@ -98,21 +98,21 @@
|
|
|
98
98
|
"chai-dom": "^1.10.0",
|
|
99
99
|
"chai-enzyme": "1.0.0-beta.1",
|
|
100
100
|
"cheerio": "^0.22.0",
|
|
101
|
-
"core-js": "^3.18.
|
|
101
|
+
"core-js": "^3.18.2",
|
|
102
102
|
"enzyme": "^3.11.0",
|
|
103
103
|
"eslint": "^7.32.0",
|
|
104
104
|
"eslint-import-resolver-webpack": "^0.13.1",
|
|
105
|
-
"eslint-plugin-angular": "^4.0
|
|
105
|
+
"eslint-plugin-angular": "^4.1.0",
|
|
106
106
|
"eslint-plugin-bdd": "^2.1.1",
|
|
107
|
-
"eslint-plugin-import": "^2.
|
|
107
|
+
"eslint-plugin-import": "^2.25.1",
|
|
108
108
|
"eslint-plugin-jsx-a11y": "^6.4.1",
|
|
109
|
-
"eslint-plugin-react": "^7.
|
|
109
|
+
"eslint-plugin-react": "^7.26.1",
|
|
110
110
|
"events": "^3.3.0",
|
|
111
111
|
"html-webpack-plugin": "^5.3.2",
|
|
112
112
|
"husky": "^7.0.2",
|
|
113
113
|
"identity-obj-proxy": "^3.0.0",
|
|
114
114
|
"imports-loader": "^3.0.0",
|
|
115
|
-
"jest": "~27.2.
|
|
115
|
+
"jest": "~27.2.5",
|
|
116
116
|
"jest-teamcity": "^1.10.0",
|
|
117
117
|
"karma": "^6.3.4",
|
|
118
118
|
"karma-chrome-launcher": "3.1.0",
|
|
@@ -121,11 +121,11 @@
|
|
|
121
121
|
"karma-teamcity-reporter": "^2.0.0",
|
|
122
122
|
"karma-webpack": "^5.0.0",
|
|
123
123
|
"lerna": "^4.0.0",
|
|
124
|
-
"lint-staged": "^11.
|
|
124
|
+
"lint-staged": "^11.2.3",
|
|
125
125
|
"merge-options": "^3.0.4",
|
|
126
|
-
"mocha": "^9.1.
|
|
126
|
+
"mocha": "^9.1.2",
|
|
127
127
|
"pinst": "^2.1.6",
|
|
128
|
-
"puppeteer": "^10.
|
|
128
|
+
"puppeteer": "^10.4.0",
|
|
129
129
|
"raw-loader": "^4.0.2",
|
|
130
130
|
"react": "^17.0.2",
|
|
131
131
|
"react-dom": "^17.0.2",
|
|
@@ -139,8 +139,8 @@
|
|
|
139
139
|
"teamcity-service-messages": "^0.1.11",
|
|
140
140
|
"terser-webpack-plugin": "^5.2.4",
|
|
141
141
|
"wallaby-webpack": "^3.9.16",
|
|
142
|
-
"webpack": "^5.
|
|
143
|
-
"webpack-cli": "^4.
|
|
142
|
+
"webpack": "^5.58.2",
|
|
143
|
+
"webpack-cli": "^4.9.0",
|
|
144
144
|
"xmlappend": "^1.0.4",
|
|
145
145
|
"yo": "^4.3.0"
|
|
146
146
|
},
|
|
@@ -148,10 +148,10 @@
|
|
|
148
148
|
"core-js": ">=3.0.0",
|
|
149
149
|
"react": ">=16.8.0",
|
|
150
150
|
"react-dom": ">=16.8.0",
|
|
151
|
-
"webpack": "^5.
|
|
151
|
+
"webpack": "^5.58.2"
|
|
152
152
|
},
|
|
153
153
|
"dependencies": {
|
|
154
|
-
"@babel/core": "^7.15.
|
|
154
|
+
"@babel/core": "^7.15.8",
|
|
155
155
|
"@jetbrains/angular-elastic": "^2.5.1",
|
|
156
156
|
"@jetbrains/babel-preset-jetbrains": "^2.3.1",
|
|
157
157
|
"@jetbrains/icons": "^3.17.1",
|
|
@@ -166,8 +166,8 @@
|
|
|
166
166
|
"combokeys": "^3.0.1",
|
|
167
167
|
"compile-code-loader": "^1.0.0",
|
|
168
168
|
"conic-gradient": "^1.0.0",
|
|
169
|
-
"css-loader": "^6.
|
|
170
|
-
"date-fns": "^2.
|
|
169
|
+
"css-loader": "^6.4.0",
|
|
170
|
+
"date-fns": "^2.25.0",
|
|
171
171
|
"deep-equal": "^2.0.4",
|
|
172
172
|
"element-resize-detector": "^1.2.3",
|
|
173
173
|
"es6-error": "^4.1.1",
|
|
@@ -175,14 +175,14 @@
|
|
|
175
175
|
"extricate-loader": "^3.0.0",
|
|
176
176
|
"fastdom": "^1.0.10",
|
|
177
177
|
"file-loader": "^6.2.0",
|
|
178
|
-
"focus-trap": "^6.
|
|
178
|
+
"focus-trap": "^6.7.1",
|
|
179
179
|
"focus-visible": "^5.2.0",
|
|
180
180
|
"highlight.js": "^10.7.2",
|
|
181
181
|
"html-loader": "^1.3.2",
|
|
182
182
|
"interpolate-loader": "^2.0.1",
|
|
183
183
|
"just-debounce-it": "^1.5.0",
|
|
184
184
|
"memoize-one": "^5.2.1",
|
|
185
|
-
"postcss": "^8.3.
|
|
185
|
+
"postcss": "^8.3.9",
|
|
186
186
|
"postcss-calc": "^8.0.0",
|
|
187
187
|
"postcss-flexbugs-fixes": "^5.0.2",
|
|
188
188
|
"postcss-font-family-system-ui": "^5.0.0",
|
|
@@ -199,7 +199,7 @@
|
|
|
199
199
|
"scrollbar-width": "^3.1.1",
|
|
200
200
|
"simply-uuid": "^1.0.1",
|
|
201
201
|
"sniffr": "^1.2.0",
|
|
202
|
-
"style-loader": "~3.
|
|
202
|
+
"style-loader": "~3.3.0",
|
|
203
203
|
"url-loader": "^4.1.1",
|
|
204
204
|
"util-deprecate": "^1.0.2"
|
|
205
205
|
},
|
|
@@ -207,5 +207,5 @@
|
|
|
207
207
|
"node": ">=7.4",
|
|
208
208
|
"npm": ">=6.0.0"
|
|
209
209
|
},
|
|
210
|
-
"gitHead": "
|
|
210
|
+
"gitHead": "081813df7cd0a278be5c00c10286f34540409715"
|
|
211
211
|
}
|