@atlaskit/user-picker 8.3.1 → 8.3.5
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/CHANGELOG.md +24 -0
- package/dist/cjs/components/smart-user-picker/components/index.js +5 -4
- package/dist/cjs/components/smart-user-picker/config/index.js +3 -2
- package/dist/cjs/components/smart-user-picker/service/UsersClient.js +1 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/components/smart-user-picker/components/index.js +4 -3
- package/dist/es2019/components/smart-user-picker/config/index.js +3 -3
- package/dist/es2019/components/smart-user-picker/service/UsersClient.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/components/smart-user-picker/components/index.js +5 -4
- package/dist/esm/components/smart-user-picker/config/index.js +3 -2
- package/dist/esm/components/smart-user-picker/service/UsersClient.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/components/smart-user-picker/components/index.d.ts +1 -1
- package/dist/types/components/smart-user-picker/config/index.d.ts +1 -1
- package/dist/types/components/smart-user-picker/service/UsersClient.d.ts +1 -0
- package/package.json +3 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,29 @@
|
|
|
1
1
|
# @atlaskit/user-picker
|
|
2
2
|
|
|
3
|
+
## 8.3.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
|
|
9
|
+
## 8.3.4
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`7f48efc8487`](https://bitbucket.org/atlassian/atlassian-frontend/commits/7f48efc8487) - Use baseUrl prop in default user value hydration query
|
|
14
|
+
|
|
15
|
+
## 8.3.3
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- Updated dependencies
|
|
20
|
+
|
|
21
|
+
## 8.3.2
|
|
22
|
+
|
|
23
|
+
### Patch Changes
|
|
24
|
+
|
|
25
|
+
- [`9fd6117d5e4`](https://bitbucket.org/atlassian/atlassian-frontend/commits/9fd6117d5e4) - Fix behavior of base URL so that API calls use baseUrl as base url
|
|
26
|
+
|
|
3
27
|
## 8.3.1
|
|
4
28
|
|
|
5
29
|
### Patch Changes
|
|
@@ -114,7 +114,7 @@ function isOptionData(option) {
|
|
|
114
114
|
*/
|
|
115
115
|
|
|
116
116
|
|
|
117
|
-
function hydrateDefaultValues(_x, _x2) {
|
|
117
|
+
function hydrateDefaultValues(_x, _x2, _x3) {
|
|
118
118
|
return _hydrateDefaultValues.apply(this, arguments);
|
|
119
119
|
}
|
|
120
120
|
/**
|
|
@@ -123,7 +123,7 @@ function hydrateDefaultValues(_x, _x2) {
|
|
|
123
123
|
|
|
124
124
|
|
|
125
125
|
function _hydrateDefaultValues() {
|
|
126
|
-
_hydrateDefaultValues = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3(value, productKey) {
|
|
126
|
+
_hydrateDefaultValues = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3(value, productKey, baseUrl) {
|
|
127
127
|
var accountIds, results;
|
|
128
128
|
return _regenerator.default.wrap(function _callee3$(_context3) {
|
|
129
129
|
while (1) {
|
|
@@ -183,7 +183,8 @@ function _hydrateDefaultValues() {
|
|
|
183
183
|
_context3.next = 16;
|
|
184
184
|
return (0, _UsersClient.default)({
|
|
185
185
|
productKey: productKey,
|
|
186
|
-
accountIds: accountIds
|
|
186
|
+
accountIds: accountIds,
|
|
187
|
+
baseUrl: baseUrl
|
|
187
188
|
});
|
|
188
189
|
|
|
189
190
|
case 16:
|
|
@@ -495,7 +496,7 @@ var SmartUserPicker = /*#__PURE__*/function (_React$Component) {
|
|
|
495
496
|
case 0:
|
|
496
497
|
_context2.prev = 0;
|
|
497
498
|
_context2.next = 3;
|
|
498
|
-
return hydrateDefaultValues(this.props.defaultValue, this.props.productKey);
|
|
499
|
+
return hydrateDefaultValues(this.props.defaultValue, this.props.productKey, this.props.baseUrl);
|
|
499
500
|
|
|
500
501
|
case 3:
|
|
501
502
|
value = _context2.sent;
|
|
@@ -16,10 +16,11 @@ var LOCAL_CONFIG = {
|
|
|
16
16
|
};
|
|
17
17
|
var PRD_CONFIG = {
|
|
18
18
|
getRecommendationServiceUrl: function getRecommendationServiceUrl(baseUrl) {
|
|
19
|
-
return baseUrl ? "
|
|
19
|
+
return baseUrl ? "".concat(baseUrl, "/gateway/api/v1/recommendations") : '/gateway/api/v1/recommendations';
|
|
20
20
|
},
|
|
21
21
|
getUsersServiceUrl: function getUsersServiceUrl(productKey) {
|
|
22
|
-
|
|
22
|
+
var baseUrl = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
|
23
|
+
return productKey === 'jira' ? "".concat(baseUrl, "/rest/api/3/user/bulk") : "".concat(baseUrl, "/wiki/rest/api/user/bulk");
|
|
23
24
|
}
|
|
24
25
|
};
|
|
25
26
|
/**
|
|
@@ -10,7 +10,7 @@ var _config = require("../config");
|
|
|
10
10
|
var _types = require("../../../types");
|
|
11
11
|
|
|
12
12
|
var getUsersById = function getUsersById(request) {
|
|
13
|
-
var url = "".concat((0, _config.getConfig)().getUsersServiceUrl(request.productKey));
|
|
13
|
+
var url = "".concat((0, _config.getConfig)().getUsersServiceUrl(request.productKey, request.baseUrl));
|
|
14
14
|
var params = new URLSearchParams();
|
|
15
15
|
request.accountIds.map(function (id) {
|
|
16
16
|
return params.append('accountId', id);
|
package/dist/cjs/version.json
CHANGED
|
@@ -60,7 +60,7 @@ function isOptionData(option) {
|
|
|
60
60
|
*/
|
|
61
61
|
|
|
62
62
|
|
|
63
|
-
export async function hydrateDefaultValues(value, productKey) {
|
|
63
|
+
export async function hydrateDefaultValues(value, productKey, baseUrl) {
|
|
64
64
|
//return if no value
|
|
65
65
|
if (!value) {
|
|
66
66
|
return [];
|
|
@@ -96,7 +96,8 @@ export async function hydrateDefaultValues(value, productKey) {
|
|
|
96
96
|
|
|
97
97
|
const results = await getUsersById({
|
|
98
98
|
productKey,
|
|
99
|
-
accountIds
|
|
99
|
+
accountIds,
|
|
100
|
+
baseUrl
|
|
100
101
|
});
|
|
101
102
|
return sortResults(results, accountIds);
|
|
102
103
|
}
|
|
@@ -319,7 +320,7 @@ class SmartUserPicker extends React.Component {
|
|
|
319
320
|
|
|
320
321
|
async componentDidMount() {
|
|
321
322
|
try {
|
|
322
|
-
const value = await hydrateDefaultValues(this.props.defaultValue, this.props.productKey);
|
|
323
|
+
const value = await hydrateDefaultValues(this.props.defaultValue, this.props.productKey, this.props.baseUrl);
|
|
323
324
|
this.setState({
|
|
324
325
|
defaultValue: value
|
|
325
326
|
});
|
|
@@ -12,11 +12,11 @@ const LOCAL_CONFIG = {
|
|
|
12
12
|
};
|
|
13
13
|
const PRD_CONFIG = {
|
|
14
14
|
getRecommendationServiceUrl(baseUrl) {
|
|
15
|
-
return baseUrl ?
|
|
15
|
+
return baseUrl ? `${baseUrl}/gateway/api/v1/recommendations` : '/gateway/api/v1/recommendations';
|
|
16
16
|
},
|
|
17
17
|
|
|
18
|
-
getUsersServiceUrl(productKey) {
|
|
19
|
-
return productKey === 'jira' ?
|
|
18
|
+
getUsersServiceUrl(productKey, baseUrl = '') {
|
|
19
|
+
return productKey === 'jira' ? `${baseUrl}/rest/api/3/user/bulk` : `${baseUrl}/wiki/rest/api/user/bulk`;
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
};
|
|
@@ -5,7 +5,7 @@ import { UserType } from '../../../types';
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
const getUsersById = request => {
|
|
8
|
-
const url = `${getConfig().getUsersServiceUrl(request.productKey)}`;
|
|
8
|
+
const url = `${getConfig().getUsersServiceUrl(request.productKey, request.baseUrl)}`;
|
|
9
9
|
let params = new URLSearchParams();
|
|
10
10
|
request.accountIds.map(id => params.append('accountId', id));
|
|
11
11
|
params.append('maxResults', '2000');
|
package/dist/es2019/version.json
CHANGED
|
@@ -84,7 +84,7 @@ function isOptionData(option) {
|
|
|
84
84
|
*/
|
|
85
85
|
|
|
86
86
|
|
|
87
|
-
export function hydrateDefaultValues(_x, _x2) {
|
|
87
|
+
export function hydrateDefaultValues(_x, _x2, _x3) {
|
|
88
88
|
return _hydrateDefaultValues.apply(this, arguments);
|
|
89
89
|
}
|
|
90
90
|
/**
|
|
@@ -92,7 +92,7 @@ export function hydrateDefaultValues(_x, _x2) {
|
|
|
92
92
|
*/
|
|
93
93
|
|
|
94
94
|
function _hydrateDefaultValues() {
|
|
95
|
-
_hydrateDefaultValues = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(value, productKey) {
|
|
95
|
+
_hydrateDefaultValues = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(value, productKey, baseUrl) {
|
|
96
96
|
var accountIds, results;
|
|
97
97
|
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
98
98
|
while (1) {
|
|
@@ -152,7 +152,8 @@ function _hydrateDefaultValues() {
|
|
|
152
152
|
_context3.next = 16;
|
|
153
153
|
return getUsersById({
|
|
154
154
|
productKey: productKey,
|
|
155
|
-
accountIds: accountIds
|
|
155
|
+
accountIds: accountIds,
|
|
156
|
+
baseUrl: baseUrl
|
|
156
157
|
});
|
|
157
158
|
|
|
158
159
|
case 16:
|
|
@@ -474,7 +475,7 @@ var SmartUserPicker = /*#__PURE__*/function (_React$Component) {
|
|
|
474
475
|
case 0:
|
|
475
476
|
_context2.prev = 0;
|
|
476
477
|
_context2.next = 3;
|
|
477
|
-
return hydrateDefaultValues(this.props.defaultValue, this.props.productKey);
|
|
478
|
+
return hydrateDefaultValues(this.props.defaultValue, this.props.productKey, this.props.baseUrl);
|
|
478
479
|
|
|
479
480
|
case 3:
|
|
480
481
|
value = _context2.sent;
|
|
@@ -10,10 +10,11 @@ var LOCAL_CONFIG = {
|
|
|
10
10
|
};
|
|
11
11
|
var PRD_CONFIG = {
|
|
12
12
|
getRecommendationServiceUrl: function getRecommendationServiceUrl(baseUrl) {
|
|
13
|
-
return baseUrl ? "
|
|
13
|
+
return baseUrl ? "".concat(baseUrl, "/gateway/api/v1/recommendations") : '/gateway/api/v1/recommendations';
|
|
14
14
|
},
|
|
15
15
|
getUsersServiceUrl: function getUsersServiceUrl(productKey) {
|
|
16
|
-
|
|
16
|
+
var baseUrl = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
|
17
|
+
return productKey === 'jira' ? "".concat(baseUrl, "/rest/api/3/user/bulk") : "".concat(baseUrl, "/wiki/rest/api/user/bulk");
|
|
17
18
|
}
|
|
18
19
|
};
|
|
19
20
|
/**
|
|
@@ -5,7 +5,7 @@ import { UserType } from '../../../types';
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
var getUsersById = function getUsersById(request) {
|
|
8
|
-
var url = "".concat(getConfig().getUsersServiceUrl(request.productKey));
|
|
8
|
+
var url = "".concat(getConfig().getUsersServiceUrl(request.productKey, request.baseUrl));
|
|
9
9
|
var params = new URLSearchParams();
|
|
10
10
|
request.accountIds.map(function (id) {
|
|
11
11
|
return params.append('accountId', id);
|
package/dist/esm/version.json
CHANGED
|
@@ -180,7 +180,7 @@ export interface RecommendationRequest {
|
|
|
180
180
|
/**
|
|
181
181
|
* @deprecated Please use @atlassian/smart-user-picker
|
|
182
182
|
*/
|
|
183
|
-
export declare function hydrateDefaultValues(value: DefaultValue, productKey: SupportedProduct): Promise<User[]>;
|
|
183
|
+
export declare function hydrateDefaultValues(value: DefaultValue, productKey: SupportedProduct, baseUrl?: string): Promise<User[]>;
|
|
184
184
|
/**
|
|
185
185
|
* @deprecated
|
|
186
186
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/user-picker",
|
|
3
|
-
"version": "8.3.
|
|
3
|
+
"version": "8.3.5",
|
|
4
4
|
"description": "Fabric component for display a dropdown to select a user from",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"@atlaskit/select": "^15.2.0",
|
|
35
35
|
"@atlaskit/spinner": "^15.1.4",
|
|
36
36
|
"@atlaskit/theme": "^12.1.0",
|
|
37
|
-
"@atlaskit/tokens": "^0.
|
|
37
|
+
"@atlaskit/tokens": "^0.6.0",
|
|
38
38
|
"@atlaskit/tooltip": "^17.5.0",
|
|
39
39
|
"@babel/runtime": "^7.0.0",
|
|
40
40
|
"lodash": "^4.17.21",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"@atlaskit/range": "^5.0.11",
|
|
58
58
|
"@atlaskit/section-message": "^6.0.0",
|
|
59
59
|
"@atlaskit/textfield": "^5.0.0",
|
|
60
|
-
"@atlaskit/util-data-test": "^17.
|
|
60
|
+
"@atlaskit/util-data-test": "^17.2.0",
|
|
61
61
|
"@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
|
|
62
62
|
"@testing-library/dom": "^7.7.3",
|
|
63
63
|
"@testing-library/jest-dom": "^4.1.0",
|
|
@@ -76,10 +76,5 @@
|
|
|
76
76
|
"fabric",
|
|
77
77
|
"ui"
|
|
78
78
|
],
|
|
79
|
-
"techstack": {
|
|
80
|
-
"@repo/internal": {
|
|
81
|
-
"theming": "tokens"
|
|
82
|
-
}
|
|
83
|
-
},
|
|
84
79
|
"prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.1"
|
|
85
80
|
}
|