@atlaskit/user-picker 8.8.4 → 9.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +26 -0
- package/dist/cjs/analytics.js +1 -84
- package/dist/cjs/components/EmailOption/main.js +2 -2
- package/dist/cjs/components/ExternalUserOption/InfoIcon.js +1 -1
- package/dist/cjs/components/ExternalUserOption/main.js +2 -2
- package/dist/cjs/components/GroupOption/main.js +2 -2
- package/dist/cjs/components/TeamOption/main.js +2 -2
- package/dist/cjs/components/UserOption.js +3 -3
- package/dist/cjs/components/i18n.js +1 -1
- package/dist/cjs/index.js +0 -26
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/analytics.js +0 -62
- package/dist/es2019/components/EmailOption/main.js +2 -2
- package/dist/es2019/components/ExternalUserOption/InfoIcon.js +1 -1
- package/dist/es2019/components/ExternalUserOption/main.js +2 -2
- package/dist/es2019/components/GroupOption/main.js +2 -2
- package/dist/es2019/components/TeamOption/main.js +2 -2
- package/dist/es2019/components/UserOption.js +3 -3
- package/dist/es2019/components/i18n.js +1 -1
- package/dist/es2019/index.js +0 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/analytics.js +0 -66
- package/dist/esm/components/EmailOption/main.js +2 -2
- package/dist/esm/components/ExternalUserOption/InfoIcon.js +1 -1
- package/dist/esm/components/ExternalUserOption/main.js +2 -2
- package/dist/esm/components/GroupOption/main.js +2 -2
- package/dist/esm/components/TeamOption/main.js +2 -2
- package/dist/esm/components/UserOption.js +3 -3
- package/dist/esm/components/i18n.js +1 -1
- package/dist/esm/index.js +0 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/analytics.d.ts +0 -10
- package/dist/types/components/BaseUserPicker.d.ts +1 -1
- package/dist/types/components/PopupUserPicker.d.ts +1 -1
- package/dist/types/components/UserPicker.d.ts +1 -1
- package/dist/types/index.d.ts +0 -2
- package/docs/1-smart-user-picker.tsx +1 -1
- package/package.json +2 -2
- package/dist/cjs/components/smart-user-picker/components/index.js +0 -602
- package/dist/cjs/components/smart-user-picker/config/index.js +0 -50
- package/dist/cjs/components/smart-user-picker/index.js +0 -41
- package/dist/cjs/components/smart-user-picker/service/UsersClient.js +0 -85
- package/dist/cjs/components/smart-user-picker/service/index.js +0 -15
- package/dist/cjs/components/smart-user-picker/service/recommendationClient.js +0 -75
- package/dist/cjs/components/smart-user-picker/service/users-transformer.js +0 -98
- package/dist/es2019/components/smart-user-picker/components/index.js +0 -398
- package/dist/es2019/components/smart-user-picker/config/index.js +0 -37
- package/dist/es2019/components/smart-user-picker/index.js +0 -7
- package/dist/es2019/components/smart-user-picker/service/UsersClient.js +0 -65
- package/dist/es2019/components/smart-user-picker/service/index.js +0 -1
- package/dist/es2019/components/smart-user-picker/service/recommendationClient.js +0 -56
- package/dist/es2019/components/smart-user-picker/service/users-transformer.js +0 -77
- package/dist/esm/components/smart-user-picker/components/index.js +0 -582
- package/dist/esm/components/smart-user-picker/config/index.js +0 -38
- package/dist/esm/components/smart-user-picker/index.js +0 -7
- package/dist/esm/components/smart-user-picker/service/UsersClient.js +0 -79
- package/dist/esm/components/smart-user-picker/service/index.js +0 -1
- package/dist/esm/components/smart-user-picker/service/recommendationClient.js +0 -64
- package/dist/esm/components/smart-user-picker/service/users-transformer.js +0 -87
- package/dist/types/components/smart-user-picker/components/index.d.ts +0 -196
- package/dist/types/components/smart-user-picker/config/index.d.ts +0 -17
- package/dist/types/components/smart-user-picker/index.d.ts +0 -8
- package/dist/types/components/smart-user-picker/service/UsersClient.d.ts +0 -14
- package/dist/types/components/smart-user-picker/service/index.d.ts +0 -1
- package/dist/types/components/smart-user-picker/service/recommendationClient.d.ts +0 -23
- package/dist/types/components/smart-user-picker/service/users-transformer.d.ts +0 -25
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import { getConfig } from '../config';
|
|
2
|
-
import { UserType } from '../../../types';
|
|
3
|
-
/**
|
|
4
|
-
* @deprecated Please use @atlaskit/smart-user-picker. Alternatively, @atlaskit/smart-hooks will be ready by end of FY22Q4. Contact #help-smart-experiences for further details.
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
var getUsersById = function getUsersById(request) {
|
|
8
|
-
var url = "".concat(getConfig().getUsersServiceUrl(request.productKey, request.baseUrl));
|
|
9
|
-
var params = new URLSearchParams();
|
|
10
|
-
request.accountIds.map(function (id) {
|
|
11
|
-
return params.append('accountId', id);
|
|
12
|
-
});
|
|
13
|
-
params.append('maxResults', '2000');
|
|
14
|
-
return fetch("".concat(url, "?").concat(params), {
|
|
15
|
-
method: 'GET',
|
|
16
|
-
credentials: 'include',
|
|
17
|
-
headers: {
|
|
18
|
-
'content-type': 'application/json'
|
|
19
|
-
}
|
|
20
|
-
}).then(function (response) {
|
|
21
|
-
if (response.status === 200) {
|
|
22
|
-
return response.json();
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
return Promise.reject({
|
|
26
|
-
message: "error calling users service, statusCode=".concat(response.status, ", statusText=").concat(response.statusText)
|
|
27
|
-
});
|
|
28
|
-
}).then(request.productKey === 'jira' ? transformJiraUsers : transformConfluenceUsers);
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
var transformJiraUsers = function transformJiraUsers(userResponse) {
|
|
32
|
-
return userResponse.values.map(transformJiraUser).filter(function (user) {
|
|
33
|
-
return !!user;
|
|
34
|
-
}).map(function (user) {
|
|
35
|
-
return user;
|
|
36
|
-
});
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
var transformJiraUser = function transformJiraUser(item) {
|
|
40
|
-
if (!item) {
|
|
41
|
-
return null;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
return {
|
|
45
|
-
id: item.accountId,
|
|
46
|
-
type: UserType,
|
|
47
|
-
avatarUrl: item.avatarUrls ? item.avatarUrls['16x16'] : '',
|
|
48
|
-
name: item.displayName,
|
|
49
|
-
email: item.emailAddress
|
|
50
|
-
};
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
var transformConfluenceUsers = function transformConfluenceUsers(userResponse) {
|
|
54
|
-
return userResponse.results.map(transformConfluenceUser).filter(function (user) {
|
|
55
|
-
return !!user;
|
|
56
|
-
}).map(function (user) {
|
|
57
|
-
return user;
|
|
58
|
-
});
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
var transformConfluenceUser = function transformConfluenceUser(item) {
|
|
62
|
-
if (!item) {
|
|
63
|
-
return null;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
return {
|
|
67
|
-
id: item.accountId,
|
|
68
|
-
type: UserType,
|
|
69
|
-
avatarUrl: item.profilePicture ? item.profilePicture.path : '',
|
|
70
|
-
name: item.publicName,
|
|
71
|
-
email: item.email
|
|
72
|
-
};
|
|
73
|
-
};
|
|
74
|
-
/**
|
|
75
|
-
* @deprecated Please use @atlaskit/smart-user-picker. Alternatively, @atlaskit/smart-hooks will be ready by end of FY22Q4. Contact #help-smart-experiences for further details.
|
|
76
|
-
*/
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
export default getUsersById;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as getUserRecommendations } from './recommendationClient';
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
|
|
3
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
4
|
-
|
|
5
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
6
|
-
|
|
7
|
-
import { transformUsers } from './users-transformer';
|
|
8
|
-
import { getConfig } from '../config';
|
|
9
|
-
|
|
10
|
-
var getUserRecommendations = function getUserRecommendations(request, intl) {
|
|
11
|
-
var _request$context, _request$context$prod;
|
|
12
|
-
|
|
13
|
-
var url = getConfig().getRecommendationServiceUrl(request.baseUrl || '');
|
|
14
|
-
return fetch(url, {
|
|
15
|
-
method: 'POST',
|
|
16
|
-
credentials: 'include',
|
|
17
|
-
headers: {
|
|
18
|
-
'content-type': 'application/json'
|
|
19
|
-
},
|
|
20
|
-
body: JSON.stringify({
|
|
21
|
-
context: request.context,
|
|
22
|
-
includeUsers: request.includeUsers,
|
|
23
|
-
includeGroups: request.includeGroups,
|
|
24
|
-
includeTeams: request.includeTeams,
|
|
25
|
-
maxNumberOfResults: request.maxNumberOfResults,
|
|
26
|
-
performSearchQueryOnly: false,
|
|
27
|
-
searchQuery: _objectSpread(_objectSpread({
|
|
28
|
-
cpusQueryHighlights: {
|
|
29
|
-
query: '',
|
|
30
|
-
field: ''
|
|
31
|
-
}
|
|
32
|
-
}, ((_request$context = request.context) === null || _request$context === void 0 ? void 0 : (_request$context$prod = _request$context.productAttributes) === null || _request$context$prod === void 0 ? void 0 : _request$context$prod.isEntitledConfluenceExternalCollaborator) && {
|
|
33
|
-
productAccessPermissionIds: ['write', 'external-collaborator-write']
|
|
34
|
-
}), {}, {
|
|
35
|
-
customQuery: '',
|
|
36
|
-
customerDirectoryId: '',
|
|
37
|
-
filter: request.searchQueryFilter || '',
|
|
38
|
-
minimumAccessLevel: 'APPLICATION',
|
|
39
|
-
queryString: request.query,
|
|
40
|
-
restrictTo: {
|
|
41
|
-
userIds: [],
|
|
42
|
-
groupIds: []
|
|
43
|
-
},
|
|
44
|
-
searchUserbase: false
|
|
45
|
-
})
|
|
46
|
-
})
|
|
47
|
-
}).then(function (response) {
|
|
48
|
-
if (response.status === 200) {
|
|
49
|
-
return response.json();
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
return Promise.reject({
|
|
53
|
-
message: "error calling smart service, statusCode=".concat(response.status, ", statusText=").concat(response.statusText)
|
|
54
|
-
});
|
|
55
|
-
}).then(function (response) {
|
|
56
|
-
return transformUsers(response, intl);
|
|
57
|
-
});
|
|
58
|
-
};
|
|
59
|
-
/**
|
|
60
|
-
* @deprecated Please use @atlaskit/smart-user-picker. Alternatively, @atlaskit/smart-hooks will be ready by end of FY22Q4. Contact #help-smart-experiences for further details.
|
|
61
|
-
*/
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
export default getUserRecommendations;
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
import { TeamType, UserType, GroupType } from '../../../types';
|
|
2
|
-
import { messages } from '../../i18n';
|
|
3
|
-
var EntityType;
|
|
4
|
-
|
|
5
|
-
(function (EntityType) {
|
|
6
|
-
EntityType["USER"] = "USER";
|
|
7
|
-
EntityType["TEAM"] = "TEAM";
|
|
8
|
-
EntityType["GROUP"] = "GROUP";
|
|
9
|
-
})(EntityType || (EntityType = {}));
|
|
10
|
-
|
|
11
|
-
var getLozenzeProperties = function getLozenzeProperties(entity, intl) {
|
|
12
|
-
var _entity$attributes, _entity$attributes2;
|
|
13
|
-
|
|
14
|
-
if ((_entity$attributes = entity.attributes) !== null && _entity$attributes !== void 0 && _entity$attributes.workspaceMember) {
|
|
15
|
-
return intl.formatMessage(messages.memberLozengeText);
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
if ((_entity$attributes2 = entity.attributes) !== null && _entity$attributes2 !== void 0 && _entity$attributes2.isConfluenceExternalCollaborator) {
|
|
19
|
-
var lozengeTooltipMessage = entity.entityType === EntityType.GROUP ? messages.guestGroupLozengeTooltip : messages.guestUserLozengeTooltip;
|
|
20
|
-
return {
|
|
21
|
-
text: intl.formatMessage(messages.guestLozengeText),
|
|
22
|
-
tooltip: intl.formatMessage(lozengeTooltipMessage),
|
|
23
|
-
appearance: 'new'
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
return undefined;
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
var transformUser = function transformUser(item, intl) {
|
|
31
|
-
var type = item.entityType;
|
|
32
|
-
|
|
33
|
-
if (type === EntityType.USER) {
|
|
34
|
-
var user = item;
|
|
35
|
-
var lozenge = getLozenzeProperties(user, intl);
|
|
36
|
-
return {
|
|
37
|
-
id: user.id,
|
|
38
|
-
type: UserType,
|
|
39
|
-
avatarUrl: user.avatarUrl,
|
|
40
|
-
name: user.name,
|
|
41
|
-
email: user.email,
|
|
42
|
-
lozenge: lozenge
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
if (type === EntityType.TEAM) {
|
|
47
|
-
var team = item;
|
|
48
|
-
return {
|
|
49
|
-
id: team.id,
|
|
50
|
-
type: TeamType,
|
|
51
|
-
description: team.description || '',
|
|
52
|
-
name: team.displayName || '',
|
|
53
|
-
memberCount: team.memberCount,
|
|
54
|
-
includesYou: team.includesYou,
|
|
55
|
-
avatarUrl: team.largeAvatarImageUrl || team.smallAvatarImageUrl
|
|
56
|
-
};
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
if (type === EntityType.GROUP) {
|
|
60
|
-
var group = item;
|
|
61
|
-
|
|
62
|
-
var _lozenge = getLozenzeProperties(group, intl);
|
|
63
|
-
|
|
64
|
-
return {
|
|
65
|
-
id: group.id,
|
|
66
|
-
type: GroupType,
|
|
67
|
-
name: group.name || '',
|
|
68
|
-
lozenge: _lozenge
|
|
69
|
-
};
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
return;
|
|
73
|
-
};
|
|
74
|
-
/**
|
|
75
|
-
* @deprecated Please use @atlaskit/smart-user-picker. Alternatively, @atlaskit/smart-hooks will be ready by end of FY22Q4. Contact #help-smart-experiences for further details.
|
|
76
|
-
*/
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
export var transformUsers = function transformUsers(serverResponse, intl) {
|
|
80
|
-
return (serverResponse.recommendedUsers || []).map(function (item) {
|
|
81
|
-
return transformUser(item, intl);
|
|
82
|
-
}).filter(function (user) {
|
|
83
|
-
return !!user;
|
|
84
|
-
}).map(function (user) {
|
|
85
|
-
return user;
|
|
86
|
-
});
|
|
87
|
-
};
|
|
@@ -1,196 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
|
|
3
|
-
import { DefaultValue, UserPickerProps, OptionData, OnChange, OnInputChange, User } from '../../../types';
|
|
4
|
-
import { Context } from '../service/recommendationClient';
|
|
5
|
-
declare type OnError = (error: any, request: RecommendationRequest) => Promise<OptionData[]> | void;
|
|
6
|
-
declare type OnValueError = (error: any, defaultValue: DefaultValue) => Promise<OptionData[]> | void;
|
|
7
|
-
declare type OnEmpty = (query: string) => Promise<OptionData[]>;
|
|
8
|
-
/**
|
|
9
|
-
* @deprecated Please use @atlaskit/smart-user-picker. Alternatively, @atlaskit/smart-hooks will be ready by end of FY22Q4. Contact #help-smart-experiences for further details.
|
|
10
|
-
*/
|
|
11
|
-
export declare type SupportedProduct = 'jira' | 'confluence' | 'people' | 'bitbucket' | 'compass';
|
|
12
|
-
/**
|
|
13
|
-
* @deprecated Please use @atlaskit/smart-user-picker. Alternatively, @atlaskit/smart-hooks will be ready by end of FY22Q4. Contact #help-smart-experiences for further details.
|
|
14
|
-
*/
|
|
15
|
-
export declare type ProductAttributes = BitbucketAttributes | ConfluenceAttributes;
|
|
16
|
-
declare type FilterOptions = (options: OptionData[], query: string) => OptionData[];
|
|
17
|
-
/**
|
|
18
|
-
* @deprecated Please use @atlaskit/smart-user-picker. Alternatively, @atlaskit/smart-hooks will be ready by end of FY22Q4. Contact #help-smart-experiences for further details.
|
|
19
|
-
*/
|
|
20
|
-
export interface BitbucketAttributes {
|
|
21
|
-
/**
|
|
22
|
-
* Identifies whether this is a public repository or not.
|
|
23
|
-
*/
|
|
24
|
-
isPublicRepo?: boolean;
|
|
25
|
-
/**
|
|
26
|
-
* A list of bitbucket workspace Ids used within container result set and noted in analytics.
|
|
27
|
-
*/
|
|
28
|
-
workspaceIds?: string[];
|
|
29
|
-
/**
|
|
30
|
-
* The users current email domain which may be used to boost the results for relevant users.
|
|
31
|
-
*/
|
|
32
|
-
emailDomain?: string;
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* @deprecated Please use @atlaskit/smart-user-picker. Alternatively, @atlaskit/smart-hooks will be ready by end of FY22Q4. Contact #help-smart-experiences for further details.
|
|
36
|
-
*/
|
|
37
|
-
export interface ConfluenceAttributes {
|
|
38
|
-
/**
|
|
39
|
-
* Identifies whether this user is a confluence guest
|
|
40
|
-
*/
|
|
41
|
-
isEntitledConfluenceExternalCollaborator?: boolean;
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* @deprecated Please use @atlaskit/smart-user-picker. Alternatively, @atlaskit/smart-hooks will be ready by end of FY22Q4. Contact #help-smart-experiences for further details.
|
|
45
|
-
*/
|
|
46
|
-
export interface SmartProps {
|
|
47
|
-
/**
|
|
48
|
-
* The base URL of the site eg: hello.atlassian.net
|
|
49
|
-
*/
|
|
50
|
-
baseUrl?: string;
|
|
51
|
-
/**
|
|
52
|
-
* Context information for analytics in URS. Eg: if a user picker was put inside a comment, the childObjectId would be the ID of the comment
|
|
53
|
-
*/
|
|
54
|
-
childObjectId?: string;
|
|
55
|
-
/**
|
|
56
|
-
* The container Id to identify context. e.g. projectId/spaceId/repositoryId.
|
|
57
|
-
*/
|
|
58
|
-
containerId?: string;
|
|
59
|
-
/**
|
|
60
|
-
* Whether to include groups in the resultset. @default false
|
|
61
|
-
*/
|
|
62
|
-
includeGroups?: boolean;
|
|
63
|
-
/**
|
|
64
|
-
* Whether to include teams in the resultset. @default false
|
|
65
|
-
*/
|
|
66
|
-
includeTeams?: boolean;
|
|
67
|
-
/**
|
|
68
|
-
* Whether to include users in the resultset. @default true
|
|
69
|
-
*/
|
|
70
|
-
includeUsers?: boolean;
|
|
71
|
-
/**
|
|
72
|
-
* An identifier of the closest context object, e.g. issueId, pageId, pullRequestId
|
|
73
|
-
*/
|
|
74
|
-
objectId?: string;
|
|
75
|
-
/**
|
|
76
|
-
* Id of the user interacting with the component.
|
|
77
|
-
* If principalId is not provided, server will extract principalId from the context header, assuming that the user is logged in when making the request @default “context”
|
|
78
|
-
*/
|
|
79
|
-
principalId?: string;
|
|
80
|
-
/**
|
|
81
|
-
* Product Attributes - you should pass in the attribute type that matches your current SupportedProduct.
|
|
82
|
-
* Currently we support additional attributes (BitbucketAttributes) for bitbucket and (ConfluenceAttributes) for Confluence.
|
|
83
|
-
*/
|
|
84
|
-
productAttributes?: ProductAttributes;
|
|
85
|
-
/**
|
|
86
|
-
* Product identifier. Currently supports 'jira' 'confluence' 'people'
|
|
87
|
-
*/
|
|
88
|
-
productKey: SupportedProduct;
|
|
89
|
-
/**
|
|
90
|
-
* Identifier for the product's tenant, also known as tenantId or cloudId
|
|
91
|
-
*/
|
|
92
|
-
siteId: string;
|
|
93
|
-
/**
|
|
94
|
-
* Identifier for the organization in which to search for teams.
|
|
95
|
-
*/
|
|
96
|
-
orgId?: string;
|
|
97
|
-
}
|
|
98
|
-
/**
|
|
99
|
-
* @deprecated Please use @atlaskit/smart-user-picker. Alternatively, @atlaskit/smart-hooks will be ready by end of FY22Q4. Contact #help-smart-experiences for further details.
|
|
100
|
-
*/
|
|
101
|
-
export interface Props extends SmartProps, UserPickerProps, WithAnalyticsEventsProps {
|
|
102
|
-
/**
|
|
103
|
-
* User options to show when the query is blank. If not provided, smart user picker will still provide a ranked list of suggestions for blank queries.
|
|
104
|
-
*/
|
|
105
|
-
bootstrapOptions?: OptionData[];
|
|
106
|
-
/**
|
|
107
|
-
* Time to debounce the suggestions fetching (in milliseconds)
|
|
108
|
-
*/
|
|
109
|
-
debounceTime?: number;
|
|
110
|
-
/**
|
|
111
|
-
* Identifier for informing the server on where the user picker has been mounted.
|
|
112
|
-
* Unlike User Picker, the fieldId in Smart User Picker is mandatory.
|
|
113
|
-
* The server uses the fieldId to determine which model to utilize when
|
|
114
|
-
* generating suggestions. Supported contexts: "assignee", "mentions".
|
|
115
|
-
* All other fieldId will be bucketed into a generic model.
|
|
116
|
-
*/
|
|
117
|
-
fieldId: string;
|
|
118
|
-
/**
|
|
119
|
-
* Function to transform options suggested by the server before showing to the user. Can be used to filter out suggestions.
|
|
120
|
-
* The options that are passed by the filterOptions are the options that are displayed in the list.
|
|
121
|
-
*/
|
|
122
|
-
filterOptions?: FilterOptions;
|
|
123
|
-
onChange?: OnChange;
|
|
124
|
-
/**
|
|
125
|
-
* Custom handler to give opportunity for caller to return list of options when server returns empty list.
|
|
126
|
-
* this is called if server returns empty list or all returned list is filtered out by the passed filter {@see filterOptions}.
|
|
127
|
-
*/
|
|
128
|
-
onEmpty?: OnEmpty;
|
|
129
|
-
/**
|
|
130
|
-
* Error handler for when the server fails to suggest users and returns with an error response.
|
|
131
|
-
* `error`: the error.
|
|
132
|
-
* `RecommendationRequest`: the original recommendationRequest containing the query and other search parameters.
|
|
133
|
-
* This may be used to provide a fail over search direct to the product backend.
|
|
134
|
-
* Helper fail over clients exist under /helpers.
|
|
135
|
-
* Note that OnError results are not filtered - so you may wish to provide additional `filterOptions`.
|
|
136
|
-
*/
|
|
137
|
-
onError?: OnError;
|
|
138
|
-
onInputChange?: OnInputChange;
|
|
139
|
-
/**
|
|
140
|
-
* Error handler used to provide OptionData[] values when the server fails to hydrate `defaultValue` prop `OptionIdentifier` types.
|
|
141
|
-
* error response. */
|
|
142
|
-
onValueError?: OnValueError;
|
|
143
|
-
/**
|
|
144
|
-
* Prefetch the list of suggested assignees before the user picker is focused.
|
|
145
|
-
* WARNING: please consider carefully before deciding to prefetch your suggestions
|
|
146
|
-
* as this will increase the load on the recommendations services.
|
|
147
|
-
* A heads-up on #smrt-experiences for a ballpark on the expected request volume will
|
|
148
|
-
* be greatly appreciated.
|
|
149
|
-
*/
|
|
150
|
-
prefetch?: boolean;
|
|
151
|
-
/**
|
|
152
|
-
* Filter to be applied to the eventual query to CPUS for user suggestions.
|
|
153
|
-
* Example:`account_status:"active" AND (NOT email_domain:"connect.atlassian.com")`
|
|
154
|
-
* will remove inactive users from the list of suggestions.
|
|
155
|
-
*/
|
|
156
|
-
searchQueryFilter?: string;
|
|
157
|
-
}
|
|
158
|
-
/**
|
|
159
|
-
* @deprecated Please use @atlaskit/smart-user-picker. Alternatively, @atlaskit/smart-hooks will be ready by end of FY22Q4. Contact #help-smart-experiences for further details.
|
|
160
|
-
*/
|
|
161
|
-
export interface State {
|
|
162
|
-
users: OptionData[];
|
|
163
|
-
loading: boolean;
|
|
164
|
-
closed: boolean;
|
|
165
|
-
error: boolean;
|
|
166
|
-
query: string;
|
|
167
|
-
sessionId?: string;
|
|
168
|
-
defaultValue?: OptionData[];
|
|
169
|
-
bootstrapOptions: OptionData[];
|
|
170
|
-
}
|
|
171
|
-
/**
|
|
172
|
-
* @deprecated Please use @atlaskit/smart-user-picker. Alternatively, @atlaskit/smart-hooks will be ready by end of FY22Q4. Contact #help-smart-experiences for further details.
|
|
173
|
-
*/
|
|
174
|
-
export interface RecommendationRequest {
|
|
175
|
-
baseUrl?: string;
|
|
176
|
-
context: Context;
|
|
177
|
-
maxNumberOfResults: number;
|
|
178
|
-
query?: string;
|
|
179
|
-
searchQueryFilter?: string;
|
|
180
|
-
includeUsers?: boolean;
|
|
181
|
-
includeGroups?: boolean;
|
|
182
|
-
includeTeams?: boolean;
|
|
183
|
-
}
|
|
184
|
-
/**
|
|
185
|
-
* @deprecated Please use @atlaskit/smart-user-picker. Alternatively, @atlaskit/smart-hooks will be ready by end of FY22Q4. Contact #help-smart-experiences for further details.
|
|
186
|
-
*/
|
|
187
|
-
export declare function hydrateDefaultValues(value: DefaultValue, productKey: SupportedProduct, baseUrl?: string): Promise<User[]>;
|
|
188
|
-
/**
|
|
189
|
-
* @deprecated
|
|
190
|
-
*/
|
|
191
|
-
declare const SmartUserPickerWithIntlProvider: React.FunctionComponent<Props>;
|
|
192
|
-
/**
|
|
193
|
-
* Please use AK/SUP instead
|
|
194
|
-
* @deprecated
|
|
195
|
-
*/
|
|
196
|
-
export default SmartUserPickerWithIntlProvider;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
interface Config {
|
|
2
|
-
getRecommendationServiceUrl(baseUrl: string): string;
|
|
3
|
-
getUsersServiceUrl(productKey: string, baseUrl?: string): string;
|
|
4
|
-
}
|
|
5
|
-
/**
|
|
6
|
-
* @deprecated Please use @atlaskit/smart-user-picker. Alternatively, @atlaskit/smart-hooks will be ready by end of FY22Q4. Contact #help-smart-experiences for further details.
|
|
7
|
-
*/
|
|
8
|
-
export declare const setSmartUserPickerEnv: (newEnv: 'prod' | 'local') => "prod" | "local";
|
|
9
|
-
/**
|
|
10
|
-
* @deprecated Please use @atlaskit/smart-user-picker. Alternatively, @atlaskit/smart-hooks will be ready by end of FY22Q4. Contact #help-smart-experiences for further details.
|
|
11
|
-
*/
|
|
12
|
-
export declare const getConfig: () => Config;
|
|
13
|
-
/**
|
|
14
|
-
* @deprecated Please use @atlaskit/smart-user-picker. Alternatively, @atlaskit/smart-hooks will be ready by end of FY22Q4. Contact #help-smart-experiences for further details.
|
|
15
|
-
*/
|
|
16
|
-
export declare const JDOG_CLOUD_ID = "49d8b9d6-ee7d-4931-a0ca-7fcae7d1c3b5";
|
|
17
|
-
export {};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Please use AK/SUP instead
|
|
3
|
-
* @deprecated
|
|
4
|
-
*/
|
|
5
|
-
export { default as SmartUserPicker, hydrateDefaultValues } from './components';
|
|
6
|
-
export { getUserRecommendations } from './service';
|
|
7
|
-
export type { SupportedProduct, RecommendationRequest, Props as SmartUserPickerProps, State as SmartUserPickerState, SmartProps, } from './components';
|
|
8
|
-
export { setSmartUserPickerEnv } from './config';
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { User } from '../../../types';
|
|
2
|
-
/**
|
|
3
|
-
* @deprecated Please use @atlaskit/smart-user-picker. Alternatively, @atlaskit/smart-hooks will be ready by end of FY22Q4. Contact #help-smart-experiences for further details.
|
|
4
|
-
*/
|
|
5
|
-
export interface UsersRequest {
|
|
6
|
-
accountIds: string[];
|
|
7
|
-
productKey: 'jira' | 'confluence';
|
|
8
|
-
baseUrl?: string;
|
|
9
|
-
}
|
|
10
|
-
declare const getUsersById: (request: UsersRequest) => Promise<User[]>;
|
|
11
|
-
/**
|
|
12
|
-
* @deprecated Please use @atlaskit/smart-user-picker. Alternatively, @atlaskit/smart-hooks will be ready by end of FY22Q4. Contact #help-smart-experiences for further details.
|
|
13
|
-
*/
|
|
14
|
-
export default getUsersById;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as getUserRecommendations } from './recommendationClient';
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { OptionData } from '../../../types';
|
|
2
|
-
import { ProductAttributes, RecommendationRequest } from '../components';
|
|
3
|
-
import { IntlShape } from 'react-intl-next';
|
|
4
|
-
/**
|
|
5
|
-
* @deprecated Please use @atlaskit/smart-user-picker. Alternatively, @atlaskit/smart-hooks will be ready by end of FY22Q4. Contact #help-smart-experiences for further details.
|
|
6
|
-
*/
|
|
7
|
-
export interface Context {
|
|
8
|
-
containerId?: string;
|
|
9
|
-
contextType: string;
|
|
10
|
-
objectId?: string;
|
|
11
|
-
sessionId?: string;
|
|
12
|
-
principalId?: string;
|
|
13
|
-
childObjectId?: string;
|
|
14
|
-
productKey: 'jira' | 'confluence' | 'people' | 'bitbucket' | 'compass';
|
|
15
|
-
siteId: string;
|
|
16
|
-
orgId?: string;
|
|
17
|
-
productAttributes?: ProductAttributes;
|
|
18
|
-
}
|
|
19
|
-
declare const getUserRecommendations: (request: RecommendationRequest, intl: IntlShape) => Promise<OptionData[]>;
|
|
20
|
-
/**
|
|
21
|
-
* @deprecated Please use @atlaskit/smart-user-picker. Alternatively, @atlaskit/smart-hooks will be ready by end of FY22Q4. Contact #help-smart-experiences for further details.
|
|
22
|
-
*/
|
|
23
|
-
export default getUserRecommendations;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { OptionData } from '../../../types';
|
|
2
|
-
import { IntlShape } from 'react-intl-next';
|
|
3
|
-
interface ServerItem {
|
|
4
|
-
id: string;
|
|
5
|
-
name?: string;
|
|
6
|
-
entityType: EntityType;
|
|
7
|
-
avatarUrl: string;
|
|
8
|
-
description?: string;
|
|
9
|
-
teamAri?: string;
|
|
10
|
-
displayName?: string;
|
|
11
|
-
}
|
|
12
|
-
interface ServerResponse {
|
|
13
|
-
recommendedUsers: ServerItem[];
|
|
14
|
-
intl: IntlShape;
|
|
15
|
-
}
|
|
16
|
-
declare enum EntityType {
|
|
17
|
-
USER = "USER",
|
|
18
|
-
TEAM = "TEAM",
|
|
19
|
-
GROUP = "GROUP"
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* @deprecated Please use @atlaskit/smart-user-picker. Alternatively, @atlaskit/smart-hooks will be ready by end of FY22Q4. Contact #help-smart-experiences for further details.
|
|
23
|
-
*/
|
|
24
|
-
export declare const transformUsers: (serverResponse: ServerResponse, intl: IntlShape) => OptionData[];
|
|
25
|
-
export {};
|