@atlaskit/profilecard 24.0.2 → 24.1.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 CHANGED
@@ -1,5 +1,19 @@
1
1
  # @atlaskit/profilecard
2
2
 
3
+ ## 24.1.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 24.1.0
10
+
11
+ ### Minor Changes
12
+
13
+ - [#195460](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/195460)
14
+ [`994834b767ffc`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/994834b767ffc) -
15
+ Allow blocking of reportinglines default behaviour
16
+
3
17
  ## 24.0.2
4
18
 
5
19
  ### Patch Changes
@@ -0,0 +1,117 @@
1
+ {
2
+ "extends": "../../../../tsconfig.entry-points.dev-agents.json",
3
+ "compilerOptions": {
4
+ "declaration": true,
5
+ "target": "es5",
6
+ "outDir": "../../../../../dev-agents/tsDist/@atlaskit__profilecard/app",
7
+ "rootDir": "../",
8
+ "composite": true
9
+ },
10
+ "include": [
11
+ "../src/**/*.ts",
12
+ "../src/**/*.tsx"
13
+ ],
14
+ "exclude": [
15
+ "../src/**/__tests__/*",
16
+ "../src/**/*.test.*",
17
+ "../src/**/test.*",
18
+ "../src/**/examples.*",
19
+ "../src/**/examples/*",
20
+ "../src/**/examples/**/*",
21
+ "../src/**/*.stories.*",
22
+ "../src/**/stories/*",
23
+ "../src/**/stories/**/*"
24
+ ],
25
+ "references": [
26
+ {
27
+ "path": "../../../analytics/analytics-next/afm-dev-agents/tsconfig.json"
28
+ },
29
+ {
30
+ "path": "../../../uip/atlassian-context/afm-dev-agents/tsconfig.json"
31
+ },
32
+ {
33
+ "path": "../../../design-system/avatar/afm-dev-agents/tsconfig.json"
34
+ },
35
+ {
36
+ "path": "../../../design-system/avatar-group/afm-dev-agents/tsconfig.json"
37
+ },
38
+ {
39
+ "path": "../../../design-system/button/afm-dev-agents/tsconfig.json"
40
+ },
41
+ {
42
+ "path": "../../../design-system/css/afm-dev-agents/tsconfig.json"
43
+ },
44
+ {
45
+ "path": "../../../design-system/dropdown-menu/afm-dev-agents/tsconfig.json"
46
+ },
47
+ {
48
+ "path": "../../../design-system/empty-state/afm-dev-agents/tsconfig.json"
49
+ },
50
+ {
51
+ "path": "../../../measurement/feature-gate-js-client/afm-dev-agents/tsconfig.json"
52
+ },
53
+ {
54
+ "path": "../../../team-central/give-kudos/afm-dev-agents/tsconfig.json"
55
+ },
56
+ {
57
+ "path": "../../../design-system/heading/afm-dev-agents/tsconfig.json"
58
+ },
59
+ {
60
+ "path": "../../../design-system/icon/afm-dev-agents/tsconfig.json"
61
+ },
62
+ {
63
+ "path": "../../../design-system/link/afm-dev-agents/tsconfig.json"
64
+ },
65
+ {
66
+ "path": "../../../design-system/logo/afm-dev-agents/tsconfig.json"
67
+ },
68
+ {
69
+ "path": "../../../design-system/lozenge/afm-dev-agents/tsconfig.json"
70
+ },
71
+ {
72
+ "path": "../../../design-system/menu/afm-dev-agents/tsconfig.json"
73
+ },
74
+ {
75
+ "path": "../../../design-system/modal-dialog/afm-dev-agents/tsconfig.json"
76
+ },
77
+ {
78
+ "path": "../../people-teams-ui-public/afm-dev-agents/tsconfig.json"
79
+ },
80
+ {
81
+ "path": "../../../platform/feature-flags/afm-dev-agents/tsconfig.json"
82
+ },
83
+ {
84
+ "path": "../../../design-system/popup/afm-dev-agents/tsconfig.json"
85
+ },
86
+ {
87
+ "path": "../../../design-system/primitives/afm-dev-agents/tsconfig.json"
88
+ },
89
+ {
90
+ "path": "../../../ai-mate/rovo-agent-components/afm-dev-agents/tsconfig.json"
91
+ },
92
+ {
93
+ "path": "../../../ai-mate/rovo-triggers/afm-dev-agents/tsconfig.json"
94
+ },
95
+ {
96
+ "path": "../../../design-system/spinner/afm-dev-agents/tsconfig.json"
97
+ },
98
+ {
99
+ "path": "../../teams-app-config/afm-dev-agents/tsconfig.json"
100
+ },
101
+ {
102
+ "path": "../../teams-avatar/afm-dev-agents/tsconfig.json"
103
+ },
104
+ {
105
+ "path": "../../teams-public/afm-dev-agents/tsconfig.json"
106
+ },
107
+ {
108
+ "path": "../../../design-system/theme/afm-dev-agents/tsconfig.json"
109
+ },
110
+ {
111
+ "path": "../../../design-system/tokens/afm-dev-agents/tsconfig.json"
112
+ },
113
+ {
114
+ "path": "../../../design-system/tooltip/afm-dev-agents/tsconfig.json"
115
+ }
116
+ ]
117
+ }
@@ -11,7 +11,7 @@ var _graphqlUtils = require("./graphqlUtils");
11
11
  var ORG_ID_FROM_CLOUD_ID_QUERY = "query OrgIdFromCloudId($cloudId: ID!) {\n\ttenantContexts(cloudIds: [$cloudId]) {\n\t\torgId\n\t}\n}";
12
12
  var addHeaders = function addHeaders(headers) {
13
13
  headers.append('atl-client-name', "@atlaskit/profilecard");
14
- headers.append('atl-client-version', "24.0.1");
14
+ headers.append('atl-client-version', "24.1.0");
15
15
  return headers;
16
16
  };
17
17
  function getOrgIdForCloudIdFromAGG(_x, _x2) {
@@ -65,7 +65,7 @@ var addHeaders = exports.addHeaders = function addHeaders(headers) {
65
65
  headers.append('X-ExperimentalApi', 'teams-beta');
66
66
  headers.append('X-ExperimentalApi', 'team-members-beta');
67
67
  headers.append('atl-client-name', "@atlaskit/profilecard");
68
- headers.append('atl-client-version', "24.0.1");
68
+ headers.append('atl-client-version', "24.1.0");
69
69
  return headers;
70
70
  };
71
71
  function getTeamFromAGG(_x, _x2, _x3) {
@@ -61,11 +61,9 @@ var ReportingLinesDetails = function ReportingLinesDetails(props) {
61
61
  } : undefined;
62
62
  };
63
63
  var onReportingLinksClick = function onReportingLinksClick(user, userType, href) {
64
- if (href) {
65
- window.location.href = href;
66
- }
64
+ var shouldPreventDefault = false;
67
65
  if (onReportingLinesClick) {
68
- onReportingLinesClick(user);
66
+ shouldPreventDefault = onReportingLinesClick(user) === false;
69
67
  }
70
68
  fireAnalyticsWithDuration(function (duration) {
71
69
  return (0, _analytics.reportingLinesClicked)({
@@ -73,6 +71,12 @@ var ReportingLinesDetails = function ReportingLinesDetails(props) {
73
71
  userType: userType
74
72
  });
75
73
  });
74
+ if (shouldPreventDefault) {
75
+ return;
76
+ }
77
+ if (href) {
78
+ window.location.href = href;
79
+ }
76
80
  };
77
81
  var showMoreButtonProps = {
78
82
  'aria-label': formatMessage(_messages.default.profileCardMoreReportingLinesLabel, {
@@ -45,7 +45,7 @@ var createEvent = function createEvent(eventType, action, actionSubject, actionS
45
45
  actionSubjectId: actionSubjectId,
46
46
  attributes: _objectSpread(_objectSpread({
47
47
  packageName: "@atlaskit/profilecard",
48
- packageVersion: "24.0.1"
48
+ packageVersion: "24.1.0"
49
49
  }, attributes), {}, {
50
50
  firedAt: Math.round((0, _performance.getPageTime)())
51
51
  })
@@ -6,7 +6,7 @@ const ORG_ID_FROM_CLOUD_ID_QUERY = `query OrgIdFromCloudId($cloudId: ID!) {
6
6
  }`;
7
7
  const addHeaders = headers => {
8
8
  headers.append('atl-client-name', "@atlaskit/profilecard");
9
- headers.append('atl-client-version', "24.0.1");
9
+ headers.append('atl-client-version', "24.1.0");
10
10
  return headers;
11
11
  };
12
12
  export async function getOrgIdForCloudIdFromAGG(url, cloudId) {
@@ -74,7 +74,7 @@ export const addHeaders = headers => {
74
74
  headers.append('X-ExperimentalApi', 'teams-beta');
75
75
  headers.append('X-ExperimentalApi', 'team-members-beta');
76
76
  headers.append('atl-client-name', "@atlaskit/profilecard");
77
- headers.append('atl-client-version', "24.0.1");
77
+ headers.append('atl-client-version', "24.1.0");
78
78
  return headers;
79
79
  };
80
80
  export async function getTeamFromAGG(url, teamId, siteId) {
@@ -52,16 +52,20 @@ const ReportingLinesDetails = props => {
52
52
  onReportingLinesClick(user);
53
53
  } : undefined;
54
54
  const onReportingLinksClick = (user, userType, href) => {
55
- if (href) {
56
- window.location.href = href;
57
- }
55
+ let shouldPreventDefault = false;
58
56
  if (onReportingLinesClick) {
59
- onReportingLinesClick(user);
57
+ shouldPreventDefault = onReportingLinesClick(user) === false;
60
58
  }
61
59
  fireAnalyticsWithDuration(duration => reportingLinesClicked({
62
60
  duration,
63
61
  userType
64
62
  }));
63
+ if (shouldPreventDefault) {
64
+ return;
65
+ }
66
+ if (href) {
67
+ window.location.href = href;
68
+ }
65
69
  };
66
70
  const showMoreButtonProps = {
67
71
  'aria-label': formatMessage(messages.profileCardMoreReportingLinesLabel, {
@@ -32,7 +32,7 @@ const createEvent = (eventType, action, actionSubject, actionSubjectId, attribut
32
32
  actionSubjectId,
33
33
  attributes: {
34
34
  packageName: "@atlaskit/profilecard",
35
- packageVersion: "24.0.1",
35
+ packageVersion: "24.1.0",
36
36
  ...attributes,
37
37
  firedAt: Math.round(getPageTime())
38
38
  }
@@ -4,7 +4,7 @@ import { AGGQuery } from './graphqlUtils';
4
4
  var ORG_ID_FROM_CLOUD_ID_QUERY = "query OrgIdFromCloudId($cloudId: ID!) {\n\ttenantContexts(cloudIds: [$cloudId]) {\n\t\torgId\n\t}\n}";
5
5
  var addHeaders = function addHeaders(headers) {
6
6
  headers.append('atl-client-name', "@atlaskit/profilecard");
7
- headers.append('atl-client-version', "24.0.1");
7
+ headers.append('atl-client-version', "24.1.0");
8
8
  return headers;
9
9
  };
10
10
  export function getOrgIdForCloudIdFromAGG(_x, _x2) {
@@ -56,7 +56,7 @@ export var addHeaders = function addHeaders(headers) {
56
56
  headers.append('X-ExperimentalApi', 'teams-beta');
57
57
  headers.append('X-ExperimentalApi', 'team-members-beta');
58
58
  headers.append('atl-client-name', "@atlaskit/profilecard");
59
- headers.append('atl-client-version', "24.0.1");
59
+ headers.append('atl-client-version', "24.1.0");
60
60
  return headers;
61
61
  };
62
62
  export function getTeamFromAGG(_x, _x2, _x3) {
@@ -54,11 +54,9 @@ var ReportingLinesDetails = function ReportingLinesDetails(props) {
54
54
  } : undefined;
55
55
  };
56
56
  var onReportingLinksClick = function onReportingLinksClick(user, userType, href) {
57
- if (href) {
58
- window.location.href = href;
59
- }
57
+ var shouldPreventDefault = false;
60
58
  if (onReportingLinesClick) {
61
- onReportingLinesClick(user);
59
+ shouldPreventDefault = onReportingLinesClick(user) === false;
62
60
  }
63
61
  fireAnalyticsWithDuration(function (duration) {
64
62
  return reportingLinesClicked({
@@ -66,6 +64,12 @@ var ReportingLinesDetails = function ReportingLinesDetails(props) {
66
64
  userType: userType
67
65
  });
68
66
  });
67
+ if (shouldPreventDefault) {
68
+ return;
69
+ }
70
+ if (href) {
71
+ window.location.href = href;
72
+ }
69
73
  };
70
74
  var showMoreButtonProps = {
71
75
  'aria-label': formatMessage(messages.profileCardMoreReportingLinesLabel, {
@@ -39,7 +39,7 @@ var createEvent = function createEvent(eventType, action, actionSubject, actionS
39
39
  actionSubjectId: actionSubjectId,
40
40
  attributes: _objectSpread(_objectSpread({
41
41
  packageName: "@atlaskit/profilecard",
42
- packageVersion: "24.0.1"
42
+ packageVersion: "24.1.0"
43
43
  }, attributes), {}, {
44
44
  firedAt: Math.round(getPageTime())
45
45
  })
@@ -403,8 +403,9 @@ export interface ProfilecardProps {
403
403
  reportingLines?: TeamCentralReportingLinesData;
404
404
  /** Base URL to populate href value for manager's and direct reports' user avatar */
405
405
  reportingLinesProfileUrl?: string;
406
- /** Click handler when user clicks on manager's and direct reports' user avatar, un-clickable otherwise */
407
- onReportingLinesClick?: (user: ReportingLinesUser) => void;
406
+ /** Click handler when user clicks on manager's and direct reports' user avatar, un-clickable otherwise.
407
+ * Returning false will prevent the default behavior of opening the reporting lines page. */
408
+ onReportingLinesClick?: (user: ReportingLinesUser) => void | false;
408
409
  isKudosEnabled?: boolean;
409
410
  teamCentralBaseUrl?: string;
410
411
  addFlag?: (flag: any) => void;
@@ -409,8 +409,9 @@ export interface ProfilecardProps {
409
409
  reportingLines?: TeamCentralReportingLinesData;
410
410
  /** Base URL to populate href value for manager's and direct reports' user avatar */
411
411
  reportingLinesProfileUrl?: string;
412
- /** Click handler when user clicks on manager's and direct reports' user avatar, un-clickable otherwise */
413
- onReportingLinesClick?: (user: ReportingLinesUser) => void;
412
+ /** Click handler when user clicks on manager's and direct reports' user avatar, un-clickable otherwise.
413
+ * Returning false will prevent the default behavior of opening the reporting lines page. */
414
+ onReportingLinesClick?: (user: ReportingLinesUser) => void | false;
414
415
  isKudosEnabled?: boolean;
415
416
  teamCentralBaseUrl?: string;
416
417
  addFlag?: (flag: any) => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/profilecard",
3
- "version": "24.0.2",
3
+ "version": "24.1.1",
4
4
  "description": "A React component to display a card with user information.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -76,7 +76,7 @@
76
76
  "@atlaskit/spinner": "^19.0.0",
77
77
  "@atlaskit/teams-app-config": "^1.11.0",
78
78
  "@atlaskit/teams-avatar": "^2.3.0",
79
- "@atlaskit/teams-public": "^0.51.0",
79
+ "@atlaskit/teams-public": "^0.52.0",
80
80
  "@atlaskit/theme": "^19.0.0",
81
81
  "@atlaskit/tokens": "^6.0.0",
82
82
  "@atlaskit/tooltip": "^20.4.0",