@atlaskit/profilecard 23.7.0 → 23.7.2
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 +14 -0
- package/dist/cjs/client/getOrgIdForCloudIdFromAGG.js +1 -1
- package/dist/cjs/client/getTeamFromAGG.js +1 -1
- package/dist/cjs/components/team-profile-card/main.js +16 -3
- package/dist/cjs/util/analytics.js +1 -1
- package/dist/es2019/client/getOrgIdForCloudIdFromAGG.js +1 -1
- package/dist/es2019/client/getTeamFromAGG.js +1 -1
- package/dist/es2019/components/team-profile-card/main.js +18 -2
- package/dist/es2019/util/analytics.js +1 -1
- package/dist/esm/client/getOrgIdForCloudIdFromAGG.js +1 -1
- package/dist/esm/client/getTeamFromAGG.js +1 -1
- package/dist/esm/components/team-profile-card/main.js +17 -4
- package/dist/esm/util/analytics.js +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @atlaskit/profilecard
|
|
2
2
|
|
|
3
|
+
## 23.7.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#132098](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/132098)
|
|
8
|
+
[`80f62470e832d`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/80f62470e832d) -
|
|
9
|
+
Addi analytics to Team button, team selector and team card.
|
|
10
|
+
|
|
11
|
+
## 23.7.1
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- Updated dependencies
|
|
16
|
+
|
|
3
17
|
## 23.7.0
|
|
4
18
|
|
|
5
19
|
### Minor Changes
|
|
@@ -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', "23.7.
|
|
14
|
+
headers.append('atl-client-version', "23.7.2");
|
|
15
15
|
return headers;
|
|
16
16
|
};
|
|
17
17
|
function getOrgIdForCloudIdFromAGG(_x, _x2) {
|
|
@@ -66,7 +66,7 @@ var addHeaders = exports.addHeaders = function addHeaders(headers) {
|
|
|
66
66
|
headers.append('X-ExperimentalApi', 'teams-beta');
|
|
67
67
|
headers.append('X-ExperimentalApi', 'team-members-beta');
|
|
68
68
|
headers.append('atl-client-name', "@atlaskit/profilecard");
|
|
69
|
-
headers.append('atl-client-version', "23.7.
|
|
69
|
+
headers.append('atl-client-version', "23.7.2");
|
|
70
70
|
return headers;
|
|
71
71
|
};
|
|
72
72
|
function getTeamFromAGG(_x, _x2, _x3) {
|
|
@@ -11,12 +11,14 @@ require("./main.compiled.css");
|
|
|
11
11
|
var _runtime = require("@compiled/react/runtime");
|
|
12
12
|
var _react = _interopRequireWildcard(require("react"));
|
|
13
13
|
var _reactIntlNext = require("react-intl-next");
|
|
14
|
+
var _analyticsNext = require("@atlaskit/analytics-next");
|
|
14
15
|
var _avatarGroup = _interopRequireDefault(require("@atlaskit/avatar-group"));
|
|
15
16
|
var _heading = _interopRequireDefault(require("@atlaskit/heading"));
|
|
16
17
|
var _verifiedTeamIcon = require("@atlaskit/people-teams-ui-public/verified-team-icon");
|
|
17
18
|
var _compiled = require("@atlaskit/primitives/compiled");
|
|
18
19
|
var _teamsAvatar = _interopRequireDefault(require("@atlaskit/teams-avatar"));
|
|
19
20
|
var _teamsPublic = require("@atlaskit/teams-public");
|
|
21
|
+
var _analytics = require("../../util/analytics");
|
|
20
22
|
var _main = require("./team-connections/main");
|
|
21
23
|
var _teamContainersSkeleton = require("./team-containers-skeleton");
|
|
22
24
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
@@ -67,12 +69,25 @@ var TeamProfileCard = exports.TeamProfileCard = function TeamProfileCard(_ref3)
|
|
|
67
69
|
var _useTeamContainers = (0, _teamsPublic.useTeamContainers)(teamId),
|
|
68
70
|
teamContainers = _useTeamContainers.teamContainers,
|
|
69
71
|
loading = _useTeamContainers.loading;
|
|
72
|
+
var _useAnalyticsEvents = (0, _analyticsNext.useAnalyticsEvents)(),
|
|
73
|
+
createAnalyticsEvent = _useAnalyticsEvents.createAnalyticsEvent;
|
|
70
74
|
// Ensure that the current container is not the only connection for this team before showing the "Where we work" section
|
|
71
75
|
var hasOtherTeamConnections = (0, _react.useMemo)(function () {
|
|
72
76
|
return teamContainers.filter(function (tc) {
|
|
73
77
|
return tc.id === containerId;
|
|
74
78
|
}).length < teamContainers.length;
|
|
75
79
|
}, [containerId, teamContainers]);
|
|
80
|
+
var onClick = (0, _react.useCallback)(function () {
|
|
81
|
+
if (createAnalyticsEvent) {
|
|
82
|
+
(0, _analytics.fireEvent)(createAnalyticsEvent, {
|
|
83
|
+
action: 'clicked',
|
|
84
|
+
actionSubject: 'button',
|
|
85
|
+
actionSubjectId: 'viewTeamProfileButton',
|
|
86
|
+
attributes: {}
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
window.open(teamProfileUrl, '_blank');
|
|
90
|
+
}, [createAnalyticsEvent, teamProfileUrl]);
|
|
76
91
|
return /*#__PURE__*/_react.default.createElement(TeamCardWrapper, {
|
|
77
92
|
id: teamId
|
|
78
93
|
}, /*#__PURE__*/_react.default.createElement(HeaderImage, {
|
|
@@ -135,9 +150,7 @@ var TeamProfileCard = exports.TeamProfileCard = function TeamProfileCard(_ref3)
|
|
|
135
150
|
})), teamProfileUrl && /*#__PURE__*/_react.default.createElement(_compiled.Stack, {
|
|
136
151
|
xcss: styles.viewProfileContainerStyles
|
|
137
152
|
}, /*#__PURE__*/_react.default.createElement(_compiled.Pressable, {
|
|
138
|
-
onClick:
|
|
139
|
-
return window.open(teamProfileUrl, '_blank');
|
|
140
|
-
},
|
|
153
|
+
onClick: onClick,
|
|
141
154
|
xcss: styles.viewProfileButtonStyles,
|
|
142
155
|
testId: "view-profile-button"
|
|
143
156
|
}, /*#__PURE__*/_react.default.createElement(_reactIntlNext.FormattedMessage, {
|
|
@@ -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: "23.7.
|
|
48
|
+
packageVersion: "23.7.2"
|
|
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', "23.7.
|
|
9
|
+
headers.append('atl-client-version', "23.7.2");
|
|
10
10
|
return headers;
|
|
11
11
|
};
|
|
12
12
|
export async function getOrgIdForCloudIdFromAGG(url, cloudId) {
|
|
@@ -75,7 +75,7 @@ export const addHeaders = headers => {
|
|
|
75
75
|
headers.append('X-ExperimentalApi', 'teams-beta');
|
|
76
76
|
headers.append('X-ExperimentalApi', 'team-members-beta');
|
|
77
77
|
headers.append('atl-client-name', "@atlaskit/profilecard");
|
|
78
|
-
headers.append('atl-client-version', "23.7.
|
|
78
|
+
headers.append('atl-client-version', "23.7.2");
|
|
79
79
|
return headers;
|
|
80
80
|
};
|
|
81
81
|
export async function getTeamFromAGG(url, teamId, siteId) {
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
/* main.tsx generated by @compiled/babel-plugin v0.36.1 */
|
|
2
2
|
import "./main.compiled.css";
|
|
3
3
|
import { ax, ix } from "@compiled/react/runtime";
|
|
4
|
-
import React, { useMemo } from 'react';
|
|
4
|
+
import React, { useCallback, useMemo } from 'react';
|
|
5
5
|
import { FormattedMessage } from 'react-intl-next';
|
|
6
|
+
import { useAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
6
7
|
import AvatarGroup from '@atlaskit/avatar-group';
|
|
7
8
|
import Heading from '@atlaskit/heading';
|
|
8
9
|
import { VerifiedTeamIcon } from '@atlaskit/people-teams-ui-public/verified-team-icon';
|
|
9
10
|
import { Box, Inline, Pressable, Stack, Text } from '@atlaskit/primitives/compiled';
|
|
10
11
|
import TeamAvatar from '@atlaskit/teams-avatar';
|
|
11
12
|
import { TeamContainers, useTeamContainers } from '@atlaskit/teams-public';
|
|
13
|
+
import { fireEvent } from '../../util/analytics';
|
|
12
14
|
import { TeamConnections } from './team-connections/main';
|
|
13
15
|
import { TeamContainersSkeleton } from './team-containers-skeleton';
|
|
14
16
|
const noop = () => {};
|
|
@@ -57,8 +59,22 @@ export const TeamProfileCard = ({
|
|
|
57
59
|
teamContainers,
|
|
58
60
|
loading
|
|
59
61
|
} = useTeamContainers(teamId);
|
|
62
|
+
const {
|
|
63
|
+
createAnalyticsEvent
|
|
64
|
+
} = useAnalyticsEvents();
|
|
60
65
|
// Ensure that the current container is not the only connection for this team before showing the "Where we work" section
|
|
61
66
|
const hasOtherTeamConnections = useMemo(() => teamContainers.filter(tc => tc.id === containerId).length < teamContainers.length, [containerId, teamContainers]);
|
|
67
|
+
const onClick = useCallback(() => {
|
|
68
|
+
if (createAnalyticsEvent) {
|
|
69
|
+
fireEvent(createAnalyticsEvent, {
|
|
70
|
+
action: 'clicked',
|
|
71
|
+
actionSubject: 'button',
|
|
72
|
+
actionSubjectId: 'viewTeamProfileButton',
|
|
73
|
+
attributes: {}
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
window.open(teamProfileUrl, '_blank');
|
|
77
|
+
}, [createAnalyticsEvent, teamProfileUrl]);
|
|
62
78
|
return /*#__PURE__*/React.createElement(TeamCardWrapper, {
|
|
63
79
|
id: teamId
|
|
64
80
|
}, /*#__PURE__*/React.createElement(HeaderImage, {
|
|
@@ -121,7 +137,7 @@ export const TeamProfileCard = ({
|
|
|
121
137
|
})), teamProfileUrl && /*#__PURE__*/React.createElement(Stack, {
|
|
122
138
|
xcss: styles.viewProfileContainerStyles
|
|
123
139
|
}, /*#__PURE__*/React.createElement(Pressable, {
|
|
124
|
-
onClick:
|
|
140
|
+
onClick: onClick,
|
|
125
141
|
xcss: styles.viewProfileButtonStyles,
|
|
126
142
|
testId: "view-profile-button"
|
|
127
143
|
}, /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
@@ -32,7 +32,7 @@ const createEvent = (eventType, action, actionSubject, actionSubjectId, attribut
|
|
|
32
32
|
actionSubjectId,
|
|
33
33
|
attributes: {
|
|
34
34
|
packageName: "@atlaskit/profilecard",
|
|
35
|
-
packageVersion: "23.7.
|
|
35
|
+
packageVersion: "23.7.2",
|
|
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', "23.7.
|
|
7
|
+
headers.append('atl-client-version', "23.7.2");
|
|
8
8
|
return headers;
|
|
9
9
|
};
|
|
10
10
|
export function getOrgIdForCloudIdFromAGG(_x, _x2) {
|
|
@@ -57,7 +57,7 @@ export var addHeaders = function addHeaders(headers) {
|
|
|
57
57
|
headers.append('X-ExperimentalApi', 'teams-beta');
|
|
58
58
|
headers.append('X-ExperimentalApi', 'team-members-beta');
|
|
59
59
|
headers.append('atl-client-name', "@atlaskit/profilecard");
|
|
60
|
-
headers.append('atl-client-version', "23.7.
|
|
60
|
+
headers.append('atl-client-version', "23.7.2");
|
|
61
61
|
return headers;
|
|
62
62
|
};
|
|
63
63
|
export function getTeamFromAGG(_x, _x2, _x3) {
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
/* main.tsx generated by @compiled/babel-plugin v0.36.1 */
|
|
2
2
|
import "./main.compiled.css";
|
|
3
3
|
import { ax, ix } from "@compiled/react/runtime";
|
|
4
|
-
import React, { useMemo } from 'react';
|
|
4
|
+
import React, { useCallback, useMemo } from 'react';
|
|
5
5
|
import { FormattedMessage } from 'react-intl-next';
|
|
6
|
+
import { useAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
6
7
|
import AvatarGroup from '@atlaskit/avatar-group';
|
|
7
8
|
import Heading from '@atlaskit/heading';
|
|
8
9
|
import { VerifiedTeamIcon } from '@atlaskit/people-teams-ui-public/verified-team-icon';
|
|
9
10
|
import { Box, Inline, Pressable, Stack, Text } from '@atlaskit/primitives/compiled';
|
|
10
11
|
import TeamAvatar from '@atlaskit/teams-avatar';
|
|
11
12
|
import { TeamContainers, useTeamContainers } from '@atlaskit/teams-public';
|
|
13
|
+
import { fireEvent } from '../../util/analytics';
|
|
12
14
|
import { TeamConnections } from './team-connections/main';
|
|
13
15
|
import { TeamContainersSkeleton } from './team-containers-skeleton';
|
|
14
16
|
var noop = function noop() {};
|
|
@@ -57,12 +59,25 @@ export var TeamProfileCard = function TeamProfileCard(_ref3) {
|
|
|
57
59
|
var _useTeamContainers = useTeamContainers(teamId),
|
|
58
60
|
teamContainers = _useTeamContainers.teamContainers,
|
|
59
61
|
loading = _useTeamContainers.loading;
|
|
62
|
+
var _useAnalyticsEvents = useAnalyticsEvents(),
|
|
63
|
+
createAnalyticsEvent = _useAnalyticsEvents.createAnalyticsEvent;
|
|
60
64
|
// Ensure that the current container is not the only connection for this team before showing the "Where we work" section
|
|
61
65
|
var hasOtherTeamConnections = useMemo(function () {
|
|
62
66
|
return teamContainers.filter(function (tc) {
|
|
63
67
|
return tc.id === containerId;
|
|
64
68
|
}).length < teamContainers.length;
|
|
65
69
|
}, [containerId, teamContainers]);
|
|
70
|
+
var onClick = useCallback(function () {
|
|
71
|
+
if (createAnalyticsEvent) {
|
|
72
|
+
fireEvent(createAnalyticsEvent, {
|
|
73
|
+
action: 'clicked',
|
|
74
|
+
actionSubject: 'button',
|
|
75
|
+
actionSubjectId: 'viewTeamProfileButton',
|
|
76
|
+
attributes: {}
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
window.open(teamProfileUrl, '_blank');
|
|
80
|
+
}, [createAnalyticsEvent, teamProfileUrl]);
|
|
66
81
|
return /*#__PURE__*/React.createElement(TeamCardWrapper, {
|
|
67
82
|
id: teamId
|
|
68
83
|
}, /*#__PURE__*/React.createElement(HeaderImage, {
|
|
@@ -125,9 +140,7 @@ export var TeamProfileCard = function TeamProfileCard(_ref3) {
|
|
|
125
140
|
})), teamProfileUrl && /*#__PURE__*/React.createElement(Stack, {
|
|
126
141
|
xcss: styles.viewProfileContainerStyles
|
|
127
142
|
}, /*#__PURE__*/React.createElement(Pressable, {
|
|
128
|
-
onClick:
|
|
129
|
-
return window.open(teamProfileUrl, '_blank');
|
|
130
|
-
},
|
|
143
|
+
onClick: onClick,
|
|
131
144
|
xcss: styles.viewProfileButtonStyles,
|
|
132
145
|
testId: "view-profile-button"
|
|
133
146
|
}, /*#__PURE__*/React.createElement(FormattedMessage, {
|
|
@@ -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: "23.7.
|
|
42
|
+
packageVersion: "23.7.2"
|
|
43
43
|
}, attributes), {}, {
|
|
44
44
|
firedAt: Math.round(getPageTime())
|
|
45
45
|
})
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/profilecard",
|
|
3
|
-
"version": "23.7.
|
|
3
|
+
"version": "23.7.2",
|
|
4
4
|
"description": "A React component to display a card with user information.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
"@atlaskit/rovo-triggers": "^2.7.0",
|
|
75
75
|
"@atlaskit/spinner": "^18.0.0",
|
|
76
76
|
"@atlaskit/teams-avatar": "^2.3.0",
|
|
77
|
-
"@atlaskit/teams-public": "^0.
|
|
77
|
+
"@atlaskit/teams-public": "^0.23.0",
|
|
78
78
|
"@atlaskit/theme": "^18.0.0",
|
|
79
79
|
"@atlaskit/tokens": "^4.5.0",
|
|
80
80
|
"@atlaskit/tooltip": "^20.0.0",
|