@atlaskit/profilecard 19.5.12 → 19.5.13
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 +6 -0
- package/dist/cjs/client/TeamCentralCardClient.js +3 -3
- package/dist/cjs/client/UserProfileCardClient.js +3 -3
- package/dist/cjs/client/getTeamFromAGG.js +1 -1
- package/dist/cjs/util/analytics.js +1 -1
- package/dist/es2019/client/TeamCentralCardClient.js +2 -2
- package/dist/es2019/client/UserProfileCardClient.js +17 -17
- package/dist/es2019/client/getTeamFromAGG.js +1 -1
- package/dist/es2019/util/analytics.js +1 -1
- package/dist/esm/client/TeamCentralCardClient.js +2 -2
- package/dist/esm/client/UserProfileCardClient.js +2 -2
- package/dist/esm/client/getTeamFromAGG.js +1 -1
- package/dist/esm/util/analytics.js +1 -1
- package/dist/types/client/TeamCentralCardClient.d.ts +13 -0
- package/dist/types/client/UserProfileCardClient.d.ts +12 -0
- package/dist/types-ts4.5/client/TeamCentralCardClient.d.ts +13 -0
- package/dist/types-ts4.5/client/UserProfileCardClient.d.ts +12 -0
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @atlaskit/profilecard
|
|
2
2
|
|
|
3
|
+
## 19.5.13
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#41140](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/41140) [`e54969bc4d1`](https://bitbucket.org/atlassian/atlassian-frontend/commits/e54969bc4d1) - PTC-7540 as a PIR, add unit tests for graphql queries
|
|
8
|
+
|
|
3
9
|
## 19.5.12
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
|
@@ -4,7 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.default = void 0;
|
|
7
|
+
exports.default = exports.buildReportingLinesQuery = exports.buildCheckFeatureFlagQuery = void 0;
|
|
8
8
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
9
9
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
10
10
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
@@ -16,7 +16,7 @@ var _CachingClient2 = _interopRequireDefault(require("./CachingClient"));
|
|
|
16
16
|
var _graphqlUtils = require("./graphqlUtils");
|
|
17
17
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
18
18
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
19
|
-
var buildReportingLinesQuery = function buildReportingLinesQuery(aaid) {
|
|
19
|
+
var buildReportingLinesQuery = exports.buildReportingLinesQuery = function buildReportingLinesQuery(aaid) {
|
|
20
20
|
return {
|
|
21
21
|
query: "\n fragment ReportingLinesUserPII on UserPII {\n name\n picture\n }\n\n fragment ReportingLinesUserFragment on ReportingLinesUser {\n accountIdentifier\n identifierType\n pii {\n ...ReportingLinesUserPII\n }\n }\n\n query ReportingLines($aaid: String) {\n reportingLines(aaidOrHash: $aaid) {\n managers {\n ...ReportingLinesUserFragment\n }\n reports {\n ...ReportingLinesUserFragment\n }\n }\n }\n ",
|
|
22
22
|
variables: {
|
|
@@ -24,7 +24,7 @@ var buildReportingLinesQuery = function buildReportingLinesQuery(aaid) {
|
|
|
24
24
|
}
|
|
25
25
|
};
|
|
26
26
|
};
|
|
27
|
-
var buildCheckFeatureFlagQuery = function buildCheckFeatureFlagQuery(featureKey, context) {
|
|
27
|
+
var buildCheckFeatureFlagQuery = exports.buildCheckFeatureFlagQuery = function buildCheckFeatureFlagQuery(featureKey, context) {
|
|
28
28
|
return {
|
|
29
29
|
query: "\n query isFeatureKeyEnabled($featureKey: String!, $context: [IsFeatureEnabledContextInput]) {\n isFeatureEnabled(featureKey: $featureKey, context: $context) {\n enabled\n }\n }\n ",
|
|
30
30
|
variables: {
|
|
@@ -4,7 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.modifyResponse = exports.default = void 0;
|
|
7
|
+
exports.modifyResponse = exports.default = exports.buildUserQuery = void 0;
|
|
8
8
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
9
9
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
10
10
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
@@ -57,9 +57,9 @@ var modifyResponse = exports.modifyResponse = function modifyResponse(response)
|
|
|
57
57
|
* @param {string} cloudId
|
|
58
58
|
* @return {string} GraphQL Query String
|
|
59
59
|
*/
|
|
60
|
-
var buildUserQuery = function buildUserQuery(cloudId, userId) {
|
|
60
|
+
var buildUserQuery = exports.buildUserQuery = function buildUserQuery(cloudId, userId) {
|
|
61
61
|
return {
|
|
62
|
-
query: "query User($userId: String!, $cloudId: String!) {\n User: CloudUser(userId: $userId, cloudId: $cloudId) {\n id
|
|
62
|
+
query: "query User($userId: String!, $cloudId: String!) {\n User: CloudUser(userId: $userId, cloudId: $cloudId) {\n id\n isCurrentUser\n status\n statusModifiedDate\n isBot\n isNotMentionable\n fullName\n nickname\n email\n meta: title\n location\n companyName\n avatarUrl(size: 192)\n remoteWeekdayIndex: localTime(format: \"d\")\n remoteWeekdayString: localTime(format: \"ddd\")\n remoteTimeString: localTime(format: \"h:mma\")\n }\n }",
|
|
63
63
|
variables: {
|
|
64
64
|
cloudId: cloudId,
|
|
65
65
|
userId: userId
|
|
@@ -60,7 +60,7 @@ var addHeaders = exports.addHeaders = function addHeaders(headers) {
|
|
|
60
60
|
headers.append('X-ExperimentalApi', 'teams-beta');
|
|
61
61
|
headers.append('X-ExperimentalApi', 'team-members-beta');
|
|
62
62
|
headers.append('atl-client-name', "@atlaskit/profilecard");
|
|
63
|
-
headers.append('atl-client-version', "19.5.
|
|
63
|
+
headers.append('atl-client-version', "19.5.13");
|
|
64
64
|
return headers;
|
|
65
65
|
};
|
|
66
66
|
function getTeamFromAGG(_x, _x2, _x3) {
|
|
@@ -44,7 +44,7 @@ var createEvent = function createEvent(eventType, action, actionSubject, actionS
|
|
|
44
44
|
actionSubjectId: actionSubjectId,
|
|
45
45
|
attributes: _objectSpread(_objectSpread({
|
|
46
46
|
packageName: "@atlaskit/profilecard",
|
|
47
|
-
packageVersion: "19.5.
|
|
47
|
+
packageVersion: "19.5.13"
|
|
48
48
|
}, attributes), {}, {
|
|
49
49
|
firedAt: Math.round((0, _performance.getPageTime)())
|
|
50
50
|
})
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import CachingClient from './CachingClient';
|
|
2
2
|
import { directoryGraphqlQuery } from './graphqlUtils';
|
|
3
|
-
const buildReportingLinesQuery = aaid => ({
|
|
3
|
+
export const buildReportingLinesQuery = aaid => ({
|
|
4
4
|
query: `
|
|
5
5
|
fragment ReportingLinesUserPII on UserPII {
|
|
6
6
|
name
|
|
@@ -30,7 +30,7 @@ const buildReportingLinesQuery = aaid => ({
|
|
|
30
30
|
aaid
|
|
31
31
|
}
|
|
32
32
|
});
|
|
33
|
-
const buildCheckFeatureFlagQuery = (featureKey, context) => ({
|
|
33
|
+
export const buildCheckFeatureFlagQuery = (featureKey, context) => ({
|
|
34
34
|
query: `
|
|
35
35
|
query isFeatureKeyEnabled($featureKey: String!, $context: [IsFeatureEnabledContextInput]) {
|
|
36
36
|
isFeatureEnabled(featureKey: $featureKey, context: $context) {
|
|
@@ -41,25 +41,25 @@ export const modifyResponse = response => {
|
|
|
41
41
|
* @param {string} cloudId
|
|
42
42
|
* @return {string} GraphQL Query String
|
|
43
43
|
*/
|
|
44
|
-
const buildUserQuery = (cloudId, userId) => ({
|
|
44
|
+
export const buildUserQuery = (cloudId, userId) => ({
|
|
45
45
|
query: `query User($userId: String!, $cloudId: String!) {
|
|
46
46
|
User: CloudUser(userId: $userId, cloudId: $cloudId) {
|
|
47
|
-
id
|
|
48
|
-
isCurrentUser
|
|
49
|
-
status
|
|
50
|
-
statusModifiedDate
|
|
51
|
-
isBot
|
|
52
|
-
isNotMentionable
|
|
53
|
-
fullName
|
|
54
|
-
nickname
|
|
55
|
-
email
|
|
56
|
-
meta: title
|
|
57
|
-
location
|
|
58
|
-
companyName
|
|
59
|
-
avatarUrl(size: 192)
|
|
60
|
-
remoteWeekdayIndex: localTime(format: "d")
|
|
61
|
-
remoteWeekdayString: localTime(format: "ddd")
|
|
62
|
-
remoteTimeString: localTime(format: "h:mma")
|
|
47
|
+
id
|
|
48
|
+
isCurrentUser
|
|
49
|
+
status
|
|
50
|
+
statusModifiedDate
|
|
51
|
+
isBot
|
|
52
|
+
isNotMentionable
|
|
53
|
+
fullName
|
|
54
|
+
nickname
|
|
55
|
+
email
|
|
56
|
+
meta: title
|
|
57
|
+
location
|
|
58
|
+
companyName
|
|
59
|
+
avatarUrl(size: 192)
|
|
60
|
+
remoteWeekdayIndex: localTime(format: "d")
|
|
61
|
+
remoteWeekdayString: localTime(format: "ddd")
|
|
62
|
+
remoteTimeString: localTime(format: "h:mma")
|
|
63
63
|
}
|
|
64
64
|
}`,
|
|
65
65
|
variables: {
|
|
@@ -77,7 +77,7 @@ export const addHeaders = headers => {
|
|
|
77
77
|
headers.append('X-ExperimentalApi', 'teams-beta');
|
|
78
78
|
headers.append('X-ExperimentalApi', 'team-members-beta');
|
|
79
79
|
headers.append('atl-client-name', "@atlaskit/profilecard");
|
|
80
|
-
headers.append('atl-client-version', "19.5.
|
|
80
|
+
headers.append('atl-client-version', "19.5.13");
|
|
81
81
|
return headers;
|
|
82
82
|
};
|
|
83
83
|
export async function getTeamFromAGG(url, teamId, siteId) {
|
|
@@ -31,7 +31,7 @@ const createEvent = (eventType, action, actionSubject, actionSubjectId, attribut
|
|
|
31
31
|
actionSubjectId,
|
|
32
32
|
attributes: {
|
|
33
33
|
packageName: "@atlaskit/profilecard",
|
|
34
|
-
packageVersion: "19.5.
|
|
34
|
+
packageVersion: "19.5.13",
|
|
35
35
|
...attributes,
|
|
36
36
|
firedAt: Math.round(getPageTime())
|
|
37
37
|
}
|
|
@@ -9,7 +9,7 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
|
|
|
9
9
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
10
10
|
import CachingClient from './CachingClient';
|
|
11
11
|
import { directoryGraphqlQuery } from './graphqlUtils';
|
|
12
|
-
var buildReportingLinesQuery = function buildReportingLinesQuery(aaid) {
|
|
12
|
+
export var buildReportingLinesQuery = function buildReportingLinesQuery(aaid) {
|
|
13
13
|
return {
|
|
14
14
|
query: "\n fragment ReportingLinesUserPII on UserPII {\n name\n picture\n }\n\n fragment ReportingLinesUserFragment on ReportingLinesUser {\n accountIdentifier\n identifierType\n pii {\n ...ReportingLinesUserPII\n }\n }\n\n query ReportingLines($aaid: String) {\n reportingLines(aaidOrHash: $aaid) {\n managers {\n ...ReportingLinesUserFragment\n }\n reports {\n ...ReportingLinesUserFragment\n }\n }\n }\n ",
|
|
15
15
|
variables: {
|
|
@@ -17,7 +17,7 @@ var buildReportingLinesQuery = function buildReportingLinesQuery(aaid) {
|
|
|
17
17
|
}
|
|
18
18
|
};
|
|
19
19
|
};
|
|
20
|
-
var buildCheckFeatureFlagQuery = function buildCheckFeatureFlagQuery(featureKey, context) {
|
|
20
|
+
export var buildCheckFeatureFlagQuery = function buildCheckFeatureFlagQuery(featureKey, context) {
|
|
21
21
|
return {
|
|
22
22
|
query: "\n query isFeatureKeyEnabled($featureKey: String!, $context: [IsFeatureEnabledContextInput]) {\n isFeatureEnabled(featureKey: $featureKey, context: $context) {\n enabled\n }\n }\n ",
|
|
23
23
|
variables: {
|
|
@@ -51,9 +51,9 @@ export var modifyResponse = function modifyResponse(response) {
|
|
|
51
51
|
* @param {string} cloudId
|
|
52
52
|
* @return {string} GraphQL Query String
|
|
53
53
|
*/
|
|
54
|
-
var buildUserQuery = function buildUserQuery(cloudId, userId) {
|
|
54
|
+
export var buildUserQuery = function buildUserQuery(cloudId, userId) {
|
|
55
55
|
return {
|
|
56
|
-
query: "query User($userId: String!, $cloudId: String!) {\n User: CloudUser(userId: $userId, cloudId: $cloudId) {\n id
|
|
56
|
+
query: "query User($userId: String!, $cloudId: String!) {\n User: CloudUser(userId: $userId, cloudId: $cloudId) {\n id\n isCurrentUser\n status\n statusModifiedDate\n isBot\n isNotMentionable\n fullName\n nickname\n email\n meta: title\n location\n companyName\n avatarUrl(size: 192)\n remoteWeekdayIndex: localTime(format: \"d\")\n remoteWeekdayString: localTime(format: \"ddd\")\n remoteTimeString: localTime(format: \"h:mma\")\n }\n }",
|
|
57
57
|
variables: {
|
|
58
58
|
cloudId: cloudId,
|
|
59
59
|
userId: userId
|
|
@@ -51,7 +51,7 @@ export var addHeaders = function addHeaders(headers) {
|
|
|
51
51
|
headers.append('X-ExperimentalApi', 'teams-beta');
|
|
52
52
|
headers.append('X-ExperimentalApi', 'team-members-beta');
|
|
53
53
|
headers.append('atl-client-name', "@atlaskit/profilecard");
|
|
54
|
-
headers.append('atl-client-version', "19.5.
|
|
54
|
+
headers.append('atl-client-version', "19.5.13");
|
|
55
55
|
return headers;
|
|
56
56
|
};
|
|
57
57
|
export function getTeamFromAGG(_x, _x2, _x3) {
|
|
@@ -38,7 +38,7 @@ var createEvent = function createEvent(eventType, action, actionSubject, actionS
|
|
|
38
38
|
actionSubjectId: actionSubjectId,
|
|
39
39
|
attributes: _objectSpread(_objectSpread({
|
|
40
40
|
packageName: "@atlaskit/profilecard",
|
|
41
|
-
packageVersion: "19.5.
|
|
41
|
+
packageVersion: "19.5.13"
|
|
42
42
|
}, attributes), {}, {
|
|
43
43
|
firedAt: Math.round(getPageTime())
|
|
44
44
|
})
|
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
import { ProfileClientOptions, TeamCentralReportingLinesData } from '../types';
|
|
2
2
|
import CachingClient from './CachingClient';
|
|
3
|
+
export declare const buildReportingLinesQuery: (aaid: string) => {
|
|
4
|
+
query: string;
|
|
5
|
+
variables: {
|
|
6
|
+
aaid: string;
|
|
7
|
+
};
|
|
8
|
+
};
|
|
9
|
+
export declare const buildCheckFeatureFlagQuery: (featureKey: string, context?: FeatureFlagExtraContext[]) => {
|
|
10
|
+
query: string;
|
|
11
|
+
variables: {
|
|
12
|
+
featureKey: string;
|
|
13
|
+
context: FeatureFlagExtraContext[];
|
|
14
|
+
};
|
|
15
|
+
};
|
|
3
16
|
type TeamCentralCardClientOptions = ProfileClientOptions & {
|
|
4
17
|
teamCentralUrl: string;
|
|
5
18
|
};
|
|
@@ -10,6 +10,18 @@ import CachingClient from './CachingClient';
|
|
|
10
10
|
* @return {object}
|
|
11
11
|
*/
|
|
12
12
|
export declare const modifyResponse: (response: ApiClientResponse) => ProfileCardClientData;
|
|
13
|
+
/**
|
|
14
|
+
* @param {string} userId
|
|
15
|
+
* @param {string} cloudId
|
|
16
|
+
* @return {string} GraphQL Query String
|
|
17
|
+
*/
|
|
18
|
+
export declare const buildUserQuery: (cloudId: string, userId: string) => {
|
|
19
|
+
query: string;
|
|
20
|
+
variables: {
|
|
21
|
+
cloudId: string;
|
|
22
|
+
userId: string;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
13
25
|
export default class UserProfileCardClient extends CachingClient<any> {
|
|
14
26
|
options: ProfileClientOptions;
|
|
15
27
|
constructor(options: ProfileClientOptions);
|
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
import { ProfileClientOptions, TeamCentralReportingLinesData } from '../types';
|
|
2
2
|
import CachingClient from './CachingClient';
|
|
3
|
+
export declare const buildReportingLinesQuery: (aaid: string) => {
|
|
4
|
+
query: string;
|
|
5
|
+
variables: {
|
|
6
|
+
aaid: string;
|
|
7
|
+
};
|
|
8
|
+
};
|
|
9
|
+
export declare const buildCheckFeatureFlagQuery: (featureKey: string, context?: FeatureFlagExtraContext[]) => {
|
|
10
|
+
query: string;
|
|
11
|
+
variables: {
|
|
12
|
+
featureKey: string;
|
|
13
|
+
context: FeatureFlagExtraContext[];
|
|
14
|
+
};
|
|
15
|
+
};
|
|
3
16
|
type TeamCentralCardClientOptions = ProfileClientOptions & {
|
|
4
17
|
teamCentralUrl: string;
|
|
5
18
|
};
|
|
@@ -10,6 +10,18 @@ import CachingClient from './CachingClient';
|
|
|
10
10
|
* @return {object}
|
|
11
11
|
*/
|
|
12
12
|
export declare const modifyResponse: (response: ApiClientResponse) => ProfileCardClientData;
|
|
13
|
+
/**
|
|
14
|
+
* @param {string} userId
|
|
15
|
+
* @param {string} cloudId
|
|
16
|
+
* @return {string} GraphQL Query String
|
|
17
|
+
*/
|
|
18
|
+
export declare const buildUserQuery: (cloudId: string, userId: string) => {
|
|
19
|
+
query: string;
|
|
20
|
+
variables: {
|
|
21
|
+
cloudId: string;
|
|
22
|
+
userId: string;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
13
25
|
export default class UserProfileCardClient extends CachingClient<any> {
|
|
14
26
|
options: ProfileClientOptions;
|
|
15
27
|
constructor(options: ProfileClientOptions);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/profilecard",
|
|
3
|
-
"version": "19.5.
|
|
3
|
+
"version": "19.5.13",
|
|
4
4
|
"description": "A React component to display a card with user information.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -79,7 +79,7 @@
|
|
|
79
79
|
},
|
|
80
80
|
"devDependencies": {
|
|
81
81
|
"@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
|
|
82
|
-
"@atlassian/ptc-test-utils": "^0.
|
|
82
|
+
"@atlassian/ptc-test-utils": "^0.8.0",
|
|
83
83
|
"@testing-library/react": "^12.1.5",
|
|
84
84
|
"enzyme": "^3.10.0",
|
|
85
85
|
"es6-promise": "^4.0.5",
|