@atlaskit/profilecard 16.0.1 → 16.2.1
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/client/CachingClient.js +2 -2
- package/dist/cjs/client/ProfileCardClient.js +33 -0
- package/dist/cjs/client/TeamCentralCardClient.js +162 -0
- package/dist/cjs/client/UserProfileCardClient.js +2 -2
- package/dist/cjs/components/Team/TeamProfileCard.js +2 -2
- package/dist/cjs/components/Team/lazyTeamProfileCard.js +3 -5
- package/dist/cjs/components/User/ProfileCard.js +23 -4
- package/dist/cjs/components/User/ProfileCardResourced.js +18 -10
- package/dist/cjs/components/User/ProfileCardTrigger.js +30 -14
- package/dist/cjs/components/User/ReportingLinesDetails.js +90 -0
- package/dist/cjs/components/User/index.js +3 -17
- package/dist/cjs/components/User/lazyProfileCard.js +23 -0
- package/dist/cjs/index.js +0 -1
- package/dist/cjs/messages.js +10 -0
- package/dist/cjs/mocks/mock-profile-client.js +45 -6
- package/dist/cjs/mocks/reporting-lines-data.js +28 -0
- package/dist/cjs/mocks/simple-mock-clients.js +2 -2
- package/dist/cjs/styled/ReportingLines.js +38 -0
- package/dist/cjs/util/analytics.js +3 -3
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/client/ProfileCardClient.js +25 -0
- package/dist/es2019/client/TeamCentralCardClient.js +109 -0
- package/dist/es2019/components/Team/lazyTeamProfileCard.js +2 -3
- package/dist/es2019/components/User/ProfileCard.js +15 -3
- package/dist/es2019/components/User/ProfileCardResourced.js +13 -6
- package/dist/es2019/components/User/ProfileCardTrigger.js +16 -9
- package/dist/es2019/components/User/ReportingLinesDetails.js +71 -0
- package/dist/es2019/components/User/index.js +2 -4
- package/dist/es2019/components/User/lazyProfileCard.js +4 -0
- package/dist/es2019/index.js +1 -2
- package/dist/es2019/messages.js +10 -0
- package/dist/es2019/mocks/mock-profile-client.js +25 -0
- package/dist/es2019/mocks/reporting-lines-data.js +14 -0
- package/dist/es2019/styled/ReportingLines.js +28 -0
- package/dist/es2019/util/analytics.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/client/CachingClient.js +2 -2
- package/dist/esm/client/ProfileCardClient.js +32 -0
- package/dist/esm/client/TeamCentralCardClient.js +147 -0
- package/dist/esm/client/UserProfileCardClient.js +2 -2
- package/dist/esm/components/Team/TeamProfileCard.js +2 -2
- package/dist/esm/components/Team/lazyTeamProfileCard.js +3 -5
- package/dist/esm/components/User/ProfileCard.js +21 -4
- package/dist/esm/components/User/ProfileCardResourced.js +18 -10
- package/dist/esm/components/User/ProfileCardTrigger.js +23 -14
- package/dist/esm/components/User/ReportingLinesDetails.js +73 -0
- package/dist/esm/components/User/index.js +2 -4
- package/dist/esm/components/User/lazyProfileCard.js +6 -0
- package/dist/esm/index.js +1 -2
- package/dist/esm/messages.js +10 -0
- package/dist/esm/mocks/mock-profile-client.js +45 -6
- package/dist/esm/mocks/reporting-lines-data.js +16 -0
- package/dist/esm/mocks/simple-mock-clients.js +2 -2
- package/dist/esm/styled/ReportingLines.js +12 -0
- package/dist/esm/util/analytics.js +3 -3
- package/dist/esm/version.json +1 -1
- package/dist/types/client/ProfileCardClient.d.ts +4 -1
- package/dist/types/client/TeamCentralCardClient.d.ts +22 -0
- package/dist/types/components/User/ProfileCardResourced.d.ts +2 -2
- package/dist/types/components/User/ProfileCardTrigger.d.ts +2 -2
- package/dist/types/components/User/ReportingLinesDetails.d.ts +7 -0
- package/dist/types/components/User/index.d.ts +2 -4
- package/dist/types/components/User/lazyProfileCard.d.ts +2 -0
- package/dist/types/messages.d.ts +10 -0
- package/dist/types/mocks/reporting-lines-data.d.ts +2 -0
- package/dist/types/styled/ReportingLines.d.ts +6 -0
- package/dist/types/types.d.ts +30 -0
- package/package.json +7 -7
package/dist/types/types.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { IntlShape } from 'react-intl-next';
|
|
3
|
+
import TeamCentralCardClient from './client/TeamCentralCardClient';
|
|
3
4
|
import TeamProfileCardClient from './client/TeamProfileCardClient';
|
|
4
5
|
import UserProfileCardClient from './client/UserProfileCardClient';
|
|
5
6
|
export interface ApiClientResponse {
|
|
@@ -53,11 +54,26 @@ export interface ProfileCardClientData {
|
|
|
53
54
|
statusModifiedDate?: number | null;
|
|
54
55
|
customLozenges?: LozengeProps[];
|
|
55
56
|
}
|
|
57
|
+
export interface ReportingLinesUserPII {
|
|
58
|
+
name: string;
|
|
59
|
+
picture?: string;
|
|
60
|
+
}
|
|
61
|
+
export interface ReportingLinesUser {
|
|
62
|
+
accountIdentifier: string;
|
|
63
|
+
identifierType: 'ATLASSIAN_ID' | 'BASE64_HASH' | 'UNKNOWN';
|
|
64
|
+
pii?: ReportingLinesUserPII;
|
|
65
|
+
}
|
|
66
|
+
export interface TeamCentralReportingLinesData {
|
|
67
|
+
managers?: ReportingLinesUser[];
|
|
68
|
+
reports?: ReportingLinesUser[];
|
|
69
|
+
}
|
|
56
70
|
export interface ProfileCardResourcedProps {
|
|
57
71
|
userId: string;
|
|
58
72
|
cloudId: string;
|
|
59
73
|
resourceClient: ProfileClient;
|
|
60
74
|
actions?: ProfileCardAction[];
|
|
75
|
+
reportingLinesProfileUrl?: string;
|
|
76
|
+
onReportingLinesClick?: (user: ReportingLinesUser) => void;
|
|
61
77
|
analytics?: any;
|
|
62
78
|
position?: ProfilecardTriggerPosition;
|
|
63
79
|
trigger?: TriggerType;
|
|
@@ -69,6 +85,7 @@ export interface ProfileCardResourcedState {
|
|
|
69
85
|
hasError: boolean;
|
|
70
86
|
error?: ProfileCardErrorType;
|
|
71
87
|
data: ProfileCardClientData | null;
|
|
88
|
+
reportingLinesData?: TeamCentralReportingLinesData;
|
|
72
89
|
}
|
|
73
90
|
export interface ProfileCardTriggerProps {
|
|
74
91
|
userId: string;
|
|
@@ -86,6 +103,8 @@ export interface ProfileCardTriggerProps {
|
|
|
86
103
|
cloudId?: string;
|
|
87
104
|
resourceClient: ProfileClient;
|
|
88
105
|
actions?: ProfileCardAction[];
|
|
106
|
+
reportingLinesProfileUrl?: string;
|
|
107
|
+
onReportingLinesClick?: (user: ReportingLinesUser) => void;
|
|
89
108
|
analytics?: any;
|
|
90
109
|
position?: ProfilecardTriggerPosition;
|
|
91
110
|
trigger?: TriggerType;
|
|
@@ -98,6 +117,7 @@ export interface ProfileCardTriggerState {
|
|
|
98
117
|
hasError: boolean;
|
|
99
118
|
error?: ProfileCardErrorType;
|
|
100
119
|
data: ProfileCardClientData | null;
|
|
120
|
+
reportingLinesData?: TeamCentralReportingLinesData;
|
|
101
121
|
}
|
|
102
122
|
export interface TeamProfileCardTriggerState {
|
|
103
123
|
visible?: boolean;
|
|
@@ -246,6 +266,12 @@ export interface ProfilecardProps {
|
|
|
246
266
|
analytics?: any;
|
|
247
267
|
statusModifiedDate?: number | null;
|
|
248
268
|
withoutElevation?: boolean;
|
|
269
|
+
/** Show manager and direct reports section on profile hover card, if available */
|
|
270
|
+
reportingLines?: TeamCentralReportingLinesData;
|
|
271
|
+
/** Base URL to populate href value for manager's and direct reports' user avatar */
|
|
272
|
+
reportingLinesProfileUrl?: string;
|
|
273
|
+
/** Click handler when user clicks on manager's and direct reports' user avatar, un-clickable otherwise */
|
|
274
|
+
onReportingLinesClick?: (user: ReportingLinesUser) => void;
|
|
249
275
|
disabledAccountMessage?: React.ReactNode;
|
|
250
276
|
hasDisabledAccountLozenge?: boolean;
|
|
251
277
|
customLozenges?: LozengeProps[];
|
|
@@ -275,6 +301,7 @@ export interface ProfileClient {
|
|
|
275
301
|
flushCache: () => void;
|
|
276
302
|
getProfile: (cloudId: string, userId: string) => Promise<ProfileCardClientData>;
|
|
277
303
|
getTeamProfile: (teamId: string, orgId?: string, fireAnalytics?: (event: Record<string, any>) => void) => Promise<Team>;
|
|
304
|
+
getReportingLines: (userId: string) => Promise<TeamCentralReportingLinesData>;
|
|
278
305
|
}
|
|
279
306
|
export declare type ProfilecardTriggerPosition = 'bottom-start' | 'bottom' | 'bottom-end' | 'left-start' | 'left' | 'left-end' | 'top-end' | 'top' | 'top-start' | 'right-end' | 'right' | 'right-start';
|
|
280
307
|
export declare type ProfileCardErrorType = {
|
|
@@ -284,8 +311,11 @@ export interface ProfileClientOptions {
|
|
|
284
311
|
url: string;
|
|
285
312
|
cacheSize?: number;
|
|
286
313
|
cacheMaxAge?: number;
|
|
314
|
+
/** Enables Team Central functionality if enabled */
|
|
315
|
+
teamCentralUrl?: string;
|
|
287
316
|
}
|
|
288
317
|
export interface ClientOverrides {
|
|
289
318
|
userClient?: UserProfileCardClient;
|
|
290
319
|
teamClient?: TeamProfileCardClient;
|
|
320
|
+
teamCentralClient?: TeamCentralCardClient;
|
|
291
321
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/profilecard",
|
|
3
|
-
"version": "16.
|
|
3
|
+
"version": "16.2.1",
|
|
4
4
|
"description": "A React component to display a card with user information.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -42,16 +42,16 @@
|
|
|
42
42
|
"@atlaskit/avatar": "^20.5.0",
|
|
43
43
|
"@atlaskit/avatar-group": "^8.3.0",
|
|
44
44
|
"@atlaskit/button": "^16.0.0",
|
|
45
|
-
"@atlaskit/icon": "^21.
|
|
45
|
+
"@atlaskit/icon": "^21.10.0",
|
|
46
46
|
"@atlaskit/lozenge": "^11.0.0",
|
|
47
47
|
"@atlaskit/menu": "^1.2.0",
|
|
48
|
-
"@atlaskit/popup": "^1.
|
|
48
|
+
"@atlaskit/popup": "^1.3.0",
|
|
49
49
|
"@atlaskit/spinner": "^15.0.0",
|
|
50
|
-
"@atlaskit/theme": "^12.
|
|
51
|
-
"@atlaskit/tokens": "^0.
|
|
50
|
+
"@atlaskit/theme": "^12.1.0",
|
|
51
|
+
"@atlaskit/tokens": "^0.5.0",
|
|
52
52
|
"@babel/runtime": "^7.0.0",
|
|
53
53
|
"date-fns": "^2.17.0",
|
|
54
|
-
"lodash": "^4.17.
|
|
54
|
+
"lodash": "^4.17.21",
|
|
55
55
|
"lru-fast": "^0.2.2",
|
|
56
56
|
"react-intl-next": "npm:react-intl@^5.18.1"
|
|
57
57
|
},
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
"@atlaskit/dynamic-table": "^14.4.0",
|
|
66
66
|
"@atlaskit/inline-edit": "^12.0.0",
|
|
67
67
|
"@atlaskit/select": "^15.0.0",
|
|
68
|
-
"@atlaskit/util-data-test": "^17.
|
|
68
|
+
"@atlaskit/util-data-test": "^17.1.0",
|
|
69
69
|
"@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
|
|
70
70
|
"@testing-library/react": "^8.0.1",
|
|
71
71
|
"enzyme": "^3.10.0",
|