@atlaskit/teams-public 0.11.0 → 0.12.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 +12 -0
- package/dist/cjs/common/utils/analytics.js +27 -15
- package/dist/cjs/ui/team-containers/linked-container-card/index.js +3 -1
- package/dist/cjs/ui/team-containers/main.js +28 -11
- package/dist/es2019/common/utils/analytics.js +27 -14
- package/dist/es2019/ui/team-containers/linked-container-card/index.js +4 -1
- package/dist/es2019/ui/team-containers/main.js +21 -6
- package/dist/esm/common/utils/analytics.js +26 -14
- package/dist/esm/ui/team-containers/linked-container-card/index.js +3 -1
- package/dist/esm/ui/team-containers/main.js +26 -9
- package/dist/types/common/utils/analytics.d.ts +6 -4
- package/dist/types-ts4.5/common/utils/analytics.d.ts +6 -4
- package/package.json +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @atlaskit/teams-public
|
|
2
2
|
|
|
3
|
+
## 0.12.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#127475](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/127475)
|
|
8
|
+
[`53fb0fe410388`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/53fb0fe410388) -
|
|
9
|
+
Send analytics for Teams and Containers
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Updated dependencies
|
|
14
|
+
|
|
3
15
|
## 0.11.0
|
|
4
16
|
|
|
5
17
|
### Minor Changes
|
|
@@ -4,8 +4,10 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.
|
|
7
|
+
exports.usePeopleAndTeamAnalytics = exports.AnalyticsAction = void 0;
|
|
8
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
10
|
+
var _analytics = require("@atlaskit/people-teams-ui-public/analytics");
|
|
9
11
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
10
12
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
11
13
|
var ANALYTICS_CHANNEL = 'peopleTeams';
|
|
@@ -20,22 +22,32 @@ var runItLater = function runItLater(cb) {
|
|
|
20
22
|
return setTimeout(cb);
|
|
21
23
|
};
|
|
22
24
|
};
|
|
23
|
-
var
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
createAnalyticsEvent
|
|
30
|
-
|
|
31
|
-
}
|
|
32
|
-
|
|
25
|
+
var usePeopleAndTeamAnalytics = exports.usePeopleAndTeamAnalytics = function usePeopleAndTeamAnalytics() {
|
|
26
|
+
var _usePeopleTeamsAnalyt = (0, _analytics.usePeopleTeamsAnalyticsSubcontext)(),
|
|
27
|
+
_usePeopleTeamsAnalyt2 = (0, _slicedToArray2.default)(_usePeopleTeamsAnalyt, 1),
|
|
28
|
+
injectedEventAttributes = _usePeopleTeamsAnalyt2[0].eventAttributes;
|
|
29
|
+
var fireEvent = function fireEvent(kind) {
|
|
30
|
+
return function (createAnalyticsEvent, body) {
|
|
31
|
+
if (!createAnalyticsEvent) {
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
runItLater(function () {
|
|
35
|
+
var eventWithSubcontextAttributes = _objectSpread(_objectSpread({}, body.attributes), injectedEventAttributes);
|
|
36
|
+
createAnalyticsEvent(_objectSpread(_objectSpread({
|
|
37
|
+
eventType: kind
|
|
38
|
+
}, body), {}, {
|
|
39
|
+
attributes: eventWithSubcontextAttributes
|
|
40
|
+
})).fire(ANALYTICS_CHANNEL);
|
|
41
|
+
});
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
return {
|
|
45
|
+
fireOperationalEvent: fireEvent('operational'),
|
|
46
|
+
fireScreenEvent: fireEvent('screen'),
|
|
47
|
+
fireTrackEvent: fireEvent('track'),
|
|
48
|
+
fireUIEvent: fireEvent('ui')
|
|
33
49
|
};
|
|
34
50
|
};
|
|
35
|
-
var fireOperationalEvent = exports.fireOperationalEvent = fireEvent('operational');
|
|
36
|
-
var fireScreenEvent = exports.fireScreenEvent = fireEvent('screen');
|
|
37
|
-
var fireTrackEvent = exports.fireTrackEvent = fireEvent('track');
|
|
38
|
-
var fireUIEvent = exports.fireUIEvent = fireEvent('ui');
|
|
39
51
|
var AnalyticsAction = exports.AnalyticsAction = /*#__PURE__*/function (AnalyticsAction) {
|
|
40
52
|
AnalyticsAction["RENDERED"] = "rendered";
|
|
41
53
|
AnalyticsAction["CLICKED"] = "clicked";
|
|
@@ -75,6 +75,8 @@ var LinkedContainerCard = exports.LinkedContainerCard = function LinkedContainer
|
|
|
75
75
|
setShowCloseIcon = _useState4[1];
|
|
76
76
|
var _useIntl = (0, _reactIntlNext.useIntl)(),
|
|
77
77
|
formatMessage = _useIntl.formatMessage;
|
|
78
|
+
var _usePeopleAndTeamAnal = (0, _analytics.usePeopleAndTeamAnalytics)(),
|
|
79
|
+
fireUIEvent = _usePeopleAndTeamAnal.fireUIEvent;
|
|
78
80
|
return /*#__PURE__*/_react.default.createElement(LinkedCardWrapper, {
|
|
79
81
|
href: link || '#',
|
|
80
82
|
handleMouseEnter: function handleMouseEnter() {
|
|
@@ -118,7 +120,7 @@ var LinkedContainerCard = exports.LinkedContainerCard = function LinkedContainer
|
|
|
118
120
|
onClick: function onClick(e) {
|
|
119
121
|
e.preventDefault();
|
|
120
122
|
onDisconnectButtonClick();
|
|
121
|
-
|
|
123
|
+
fireUIEvent(createAnalyticsEvent, {
|
|
122
124
|
action: _analytics.AnalyticsAction.CLICKED,
|
|
123
125
|
actionSubject: 'button',
|
|
124
126
|
actionSubjectId: 'containerUnlinkButton'
|
|
@@ -66,6 +66,9 @@ var TeamContainers = exports.TeamContainers = function TeamContainers(_ref) {
|
|
|
66
66
|
_useState10 = (0, _slicedToArray2.default)(_useState9, 2),
|
|
67
67
|
selectedContainerDetails = _useState10[0],
|
|
68
68
|
setSelectedContainerDetails = _useState10[1];
|
|
69
|
+
var _usePeopleAndTeamAnal = (0, _analytics.usePeopleAndTeamAnalytics)(),
|
|
70
|
+
fireOperationalEvent = _usePeopleAndTeamAnal.fireOperationalEvent,
|
|
71
|
+
fireTrackEvent = _usePeopleAndTeamAnal.fireTrackEvent;
|
|
69
72
|
var _useProductPermission = (0, _useProductPermission2.useProductPermissions)({
|
|
70
73
|
userId: userId,
|
|
71
74
|
cloudId: cloudId
|
|
@@ -93,33 +96,47 @@ var TeamContainers = exports.TeamContainers = function TeamContainers(_ref) {
|
|
|
93
96
|
var handleOpenDisconnectDialog = (0, _react.useCallback)(function (containerDetails) {
|
|
94
97
|
setSelectedContainerDetails(containerDetails);
|
|
95
98
|
setIsDisconnectDialogOpen(true);
|
|
96
|
-
|
|
99
|
+
fireTrackEvent(createAnalyticsEvent, {
|
|
97
100
|
action: _analytics.AnalyticsAction.OPENED,
|
|
98
|
-
actionSubject: 'unlinkContainerDialog'
|
|
101
|
+
actionSubject: 'unlinkContainerDialog',
|
|
102
|
+
attributes: {
|
|
103
|
+
teamId: teamId
|
|
104
|
+
}
|
|
99
105
|
});
|
|
100
|
-
}, [createAnalyticsEvent]);
|
|
106
|
+
}, [createAnalyticsEvent, fireTrackEvent, teamId]);
|
|
101
107
|
var LinkedContainerCardComponent = (components === null || components === void 0 ? void 0 : components.ContainerCard) || _linkedContainerCard.LinkedContainerCard;
|
|
102
108
|
var handleDisconnect = (0, _react.useCallback)( /*#__PURE__*/function () {
|
|
103
109
|
var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(containerId) {
|
|
110
|
+
var removedContainer;
|
|
104
111
|
return _regenerator.default.wrap(function _callee$(_context) {
|
|
105
112
|
while (1) switch (_context.prev = _context.next) {
|
|
106
113
|
case 0:
|
|
107
|
-
|
|
114
|
+
removedContainer = teamContainers.find(function (container) {
|
|
115
|
+
return container.id === containerId;
|
|
116
|
+
});
|
|
117
|
+
_context.next = 3;
|
|
108
118
|
return actions.unlinkTeamContainers(teamId, containerId);
|
|
109
|
-
case
|
|
119
|
+
case 3:
|
|
110
120
|
setIsDisconnectDialogOpen(false);
|
|
111
121
|
if (unlinkError) {
|
|
112
|
-
|
|
122
|
+
fireOperationalEvent(createAnalyticsEvent, {
|
|
113
123
|
action: _analytics.AnalyticsAction.FAILED,
|
|
114
|
-
actionSubject: '
|
|
124
|
+
actionSubject: 'teamContainerUnlinked'
|
|
115
125
|
});
|
|
116
126
|
} else {
|
|
117
|
-
|
|
127
|
+
fireOperationalEvent(createAnalyticsEvent, {
|
|
118
128
|
action: _analytics.AnalyticsAction.SUCCEEDED,
|
|
119
|
-
actionSubject: '
|
|
129
|
+
actionSubject: 'teamContainerUnlinked',
|
|
130
|
+
attributes: {
|
|
131
|
+
containerRemoved: {
|
|
132
|
+
containerId: removedContainer === null || removedContainer === void 0 ? void 0 : removedContainer.id,
|
|
133
|
+
container: removedContainer === null || removedContainer === void 0 ? void 0 : removedContainer.type
|
|
134
|
+
},
|
|
135
|
+
teamId: teamId
|
|
136
|
+
}
|
|
120
137
|
});
|
|
121
138
|
}
|
|
122
|
-
case
|
|
139
|
+
case 5:
|
|
123
140
|
case "end":
|
|
124
141
|
return _context.stop();
|
|
125
142
|
}
|
|
@@ -128,7 +145,7 @@ var TeamContainers = exports.TeamContainers = function TeamContainers(_ref) {
|
|
|
128
145
|
return function (_x) {
|
|
129
146
|
return _ref2.apply(this, arguments);
|
|
130
147
|
};
|
|
131
|
-
}(), [actions, createAnalyticsEvent, teamId, unlinkError]);
|
|
148
|
+
}(), [actions, createAnalyticsEvent, fireOperationalEvent, teamContainers, teamId, unlinkError]);
|
|
132
149
|
if (loading || productPermissionIsLoading) {
|
|
133
150
|
return /*#__PURE__*/_react.default.createElement(_teamContainersSkeleton.TeamContainersSkeleton, {
|
|
134
151
|
numberOfContainers: MAX_NUMBER_OF_CONTAINERS_TO_SHOW
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { usePeopleTeamsAnalyticsSubcontext } from '@atlaskit/people-teams-ui-public/analytics';
|
|
1
2
|
const ANALYTICS_CHANNEL = 'peopleTeams';
|
|
2
3
|
const runItLater = cb => {
|
|
3
4
|
if (window.requestIdleCallback === 'function') {
|
|
@@ -8,21 +9,33 @@ const runItLater = cb => {
|
|
|
8
9
|
}
|
|
9
10
|
return () => setTimeout(cb);
|
|
10
11
|
};
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
createAnalyticsEvent
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
12
|
+
export const usePeopleAndTeamAnalytics = () => {
|
|
13
|
+
const [{
|
|
14
|
+
eventAttributes: injectedEventAttributes
|
|
15
|
+
}] = usePeopleTeamsAnalyticsSubcontext();
|
|
16
|
+
const fireEvent = kind => (createAnalyticsEvent, body) => {
|
|
17
|
+
if (!createAnalyticsEvent) {
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
runItLater(() => {
|
|
21
|
+
const eventWithSubcontextAttributes = {
|
|
22
|
+
...body.attributes,
|
|
23
|
+
...injectedEventAttributes
|
|
24
|
+
};
|
|
25
|
+
createAnalyticsEvent({
|
|
26
|
+
eventType: kind,
|
|
27
|
+
...body,
|
|
28
|
+
attributes: eventWithSubcontextAttributes
|
|
29
|
+
}).fire(ANALYTICS_CHANNEL);
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
return {
|
|
33
|
+
fireOperationalEvent: fireEvent('operational'),
|
|
34
|
+
fireScreenEvent: fireEvent('screen'),
|
|
35
|
+
fireTrackEvent: fireEvent('track'),
|
|
36
|
+
fireUIEvent: fireEvent('ui')
|
|
37
|
+
};
|
|
21
38
|
};
|
|
22
|
-
export const fireOperationalEvent = fireEvent('operational');
|
|
23
|
-
export const fireScreenEvent = fireEvent('screen');
|
|
24
|
-
export const fireTrackEvent = fireEvent('track');
|
|
25
|
-
export const fireUIEvent = fireEvent('ui');
|
|
26
39
|
export let AnalyticsAction = /*#__PURE__*/function (AnalyticsAction) {
|
|
27
40
|
AnalyticsAction["RENDERED"] = "rendered";
|
|
28
41
|
AnalyticsAction["CLICKED"] = "clicked";
|
|
@@ -10,7 +10,7 @@ import CrossIcon from '@atlaskit/icon/utility/cross';
|
|
|
10
10
|
import Link from '@atlaskit/link';
|
|
11
11
|
import { Box, Flex, Inline, Stack, Text } from '@atlaskit/primitives/compiled';
|
|
12
12
|
import Tooltip from '@atlaskit/tooltip';
|
|
13
|
-
import { AnalyticsAction,
|
|
13
|
+
import { AnalyticsAction, usePeopleAndTeamAnalytics } from '../../../common/utils/analytics';
|
|
14
14
|
import { getContainerProperties } from '../../../common/utils/get-container-properties';
|
|
15
15
|
const styles = {
|
|
16
16
|
container: "_2rkoop52 _1h6dz9xs _12y3e4h9 _12jimuej _1qu2nqa1 _ca0qutpp _u5f3utpp _n3tdutpp _19bvutpp _syaz1fxt",
|
|
@@ -63,6 +63,9 @@ export const LinkedContainerCard = ({
|
|
|
63
63
|
const {
|
|
64
64
|
formatMessage
|
|
65
65
|
} = useIntl();
|
|
66
|
+
const {
|
|
67
|
+
fireUIEvent
|
|
68
|
+
} = usePeopleAndTeamAnalytics();
|
|
66
69
|
return /*#__PURE__*/React.createElement(LinkedCardWrapper, {
|
|
67
70
|
href: link || '#',
|
|
68
71
|
handleMouseEnter: () => setShowCloseIcon(true),
|
|
@@ -5,7 +5,7 @@ import Button from '@atlaskit/button/new';
|
|
|
5
5
|
import ModalTransition from '@atlaskit/modal-dialog/modal-transition';
|
|
6
6
|
import { Grid, Inline, Stack } from '@atlaskit/primitives';
|
|
7
7
|
import { N0, N90 } from '@atlaskit/theme/colors';
|
|
8
|
-
import { AnalyticsAction,
|
|
8
|
+
import { AnalyticsAction, usePeopleAndTeamAnalytics } from '../../common/utils/analytics';
|
|
9
9
|
import { hasProductPermission } from '../../controllers';
|
|
10
10
|
import { useProductPermissions } from '../../controllers/hooks/use-product-permission';
|
|
11
11
|
import { useTeamContainers, useTeamContainersHook } from '../../controllers/hooks/use-team-containers';
|
|
@@ -38,6 +38,10 @@ export const TeamContainers = ({
|
|
|
38
38
|
const [showMore, setShowMore] = useState(false);
|
|
39
39
|
const [isDisconnectDialogOpen, setIsDisconnectDialogOpen] = useState(false);
|
|
40
40
|
const [selectedContainerDetails, setSelectedContainerDetails] = useState();
|
|
41
|
+
const {
|
|
42
|
+
fireOperationalEvent,
|
|
43
|
+
fireTrackEvent
|
|
44
|
+
} = usePeopleAndTeamAnalytics();
|
|
41
45
|
const {
|
|
42
46
|
data: productPermissions,
|
|
43
47
|
loading: productPermissionIsLoading
|
|
@@ -64,25 +68,36 @@ export const TeamContainers = ({
|
|
|
64
68
|
setIsDisconnectDialogOpen(true);
|
|
65
69
|
fireTrackEvent(createAnalyticsEvent, {
|
|
66
70
|
action: AnalyticsAction.OPENED,
|
|
67
|
-
actionSubject: 'unlinkContainerDialog'
|
|
71
|
+
actionSubject: 'unlinkContainerDialog',
|
|
72
|
+
attributes: {
|
|
73
|
+
teamId
|
|
74
|
+
}
|
|
68
75
|
});
|
|
69
|
-
}, [createAnalyticsEvent]);
|
|
76
|
+
}, [createAnalyticsEvent, fireTrackEvent, teamId]);
|
|
70
77
|
const LinkedContainerCardComponent = (components === null || components === void 0 ? void 0 : components.ContainerCard) || LinkedContainerCard;
|
|
71
78
|
const handleDisconnect = useCallback(async containerId => {
|
|
79
|
+
const removedContainer = teamContainers.find(container => container.id === containerId);
|
|
72
80
|
await actions.unlinkTeamContainers(teamId, containerId);
|
|
73
81
|
setIsDisconnectDialogOpen(false);
|
|
74
82
|
if (unlinkError) {
|
|
75
83
|
fireOperationalEvent(createAnalyticsEvent, {
|
|
76
84
|
action: AnalyticsAction.FAILED,
|
|
77
|
-
actionSubject: '
|
|
85
|
+
actionSubject: 'teamContainerUnlinked'
|
|
78
86
|
});
|
|
79
87
|
} else {
|
|
80
88
|
fireOperationalEvent(createAnalyticsEvent, {
|
|
81
89
|
action: AnalyticsAction.SUCCEEDED,
|
|
82
|
-
actionSubject: '
|
|
90
|
+
actionSubject: 'teamContainerUnlinked',
|
|
91
|
+
attributes: {
|
|
92
|
+
containerRemoved: {
|
|
93
|
+
containerId: removedContainer === null || removedContainer === void 0 ? void 0 : removedContainer.id,
|
|
94
|
+
container: removedContainer === null || removedContainer === void 0 ? void 0 : removedContainer.type
|
|
95
|
+
},
|
|
96
|
+
teamId
|
|
97
|
+
}
|
|
83
98
|
});
|
|
84
99
|
}
|
|
85
|
-
}, [actions, createAnalyticsEvent, teamId, unlinkError]);
|
|
100
|
+
}, [actions, createAnalyticsEvent, fireOperationalEvent, teamContainers, teamId, unlinkError]);
|
|
86
101
|
if (loading || productPermissionIsLoading) {
|
|
87
102
|
return /*#__PURE__*/React.createElement(TeamContainersSkeleton, {
|
|
88
103
|
numberOfContainers: MAX_NUMBER_OF_CONTAINERS_TO_SHOW
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
3
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
4
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
5
|
+
import { usePeopleTeamsAnalyticsSubcontext } from '@atlaskit/people-teams-ui-public/analytics';
|
|
4
6
|
var ANALYTICS_CHANNEL = 'peopleTeams';
|
|
5
7
|
var runItLater = function runItLater(cb) {
|
|
6
8
|
if (window.requestIdleCallback === 'function') {
|
|
@@ -13,22 +15,32 @@ var runItLater = function runItLater(cb) {
|
|
|
13
15
|
return setTimeout(cb);
|
|
14
16
|
};
|
|
15
17
|
};
|
|
16
|
-
var
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
createAnalyticsEvent
|
|
23
|
-
|
|
24
|
-
}
|
|
25
|
-
|
|
18
|
+
export var usePeopleAndTeamAnalytics = function usePeopleAndTeamAnalytics() {
|
|
19
|
+
var _usePeopleTeamsAnalyt = usePeopleTeamsAnalyticsSubcontext(),
|
|
20
|
+
_usePeopleTeamsAnalyt2 = _slicedToArray(_usePeopleTeamsAnalyt, 1),
|
|
21
|
+
injectedEventAttributes = _usePeopleTeamsAnalyt2[0].eventAttributes;
|
|
22
|
+
var fireEvent = function fireEvent(kind) {
|
|
23
|
+
return function (createAnalyticsEvent, body) {
|
|
24
|
+
if (!createAnalyticsEvent) {
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
runItLater(function () {
|
|
28
|
+
var eventWithSubcontextAttributes = _objectSpread(_objectSpread({}, body.attributes), injectedEventAttributes);
|
|
29
|
+
createAnalyticsEvent(_objectSpread(_objectSpread({
|
|
30
|
+
eventType: kind
|
|
31
|
+
}, body), {}, {
|
|
32
|
+
attributes: eventWithSubcontextAttributes
|
|
33
|
+
})).fire(ANALYTICS_CHANNEL);
|
|
34
|
+
});
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
return {
|
|
38
|
+
fireOperationalEvent: fireEvent('operational'),
|
|
39
|
+
fireScreenEvent: fireEvent('screen'),
|
|
40
|
+
fireTrackEvent: fireEvent('track'),
|
|
41
|
+
fireUIEvent: fireEvent('ui')
|
|
26
42
|
};
|
|
27
43
|
};
|
|
28
|
-
export var fireOperationalEvent = fireEvent('operational');
|
|
29
|
-
export var fireScreenEvent = fireEvent('screen');
|
|
30
|
-
export var fireTrackEvent = fireEvent('track');
|
|
31
|
-
export var fireUIEvent = fireEvent('ui');
|
|
32
44
|
export var AnalyticsAction = /*#__PURE__*/function (AnalyticsAction) {
|
|
33
45
|
AnalyticsAction["RENDERED"] = "rendered";
|
|
34
46
|
AnalyticsAction["CLICKED"] = "clicked";
|
|
@@ -11,7 +11,7 @@ import CrossIcon from '@atlaskit/icon/utility/cross';
|
|
|
11
11
|
import Link from '@atlaskit/link';
|
|
12
12
|
import { Box, Flex, Inline, Stack, Text } from '@atlaskit/primitives/compiled';
|
|
13
13
|
import Tooltip from '@atlaskit/tooltip';
|
|
14
|
-
import { AnalyticsAction,
|
|
14
|
+
import { AnalyticsAction, usePeopleAndTeamAnalytics } from '../../../common/utils/analytics';
|
|
15
15
|
import { getContainerProperties } from '../../../common/utils/get-container-properties';
|
|
16
16
|
var styles = {
|
|
17
17
|
container: "_2rkoop52 _1h6dz9xs _12y3e4h9 _12jimuej _1qu2nqa1 _ca0qutpp _u5f3utpp _n3tdutpp _19bvutpp _syaz1fxt",
|
|
@@ -65,6 +65,8 @@ export var LinkedContainerCard = function LinkedContainerCard(_ref2) {
|
|
|
65
65
|
setShowCloseIcon = _useState4[1];
|
|
66
66
|
var _useIntl = useIntl(),
|
|
67
67
|
formatMessage = _useIntl.formatMessage;
|
|
68
|
+
var _usePeopleAndTeamAnal = usePeopleAndTeamAnalytics(),
|
|
69
|
+
fireUIEvent = _usePeopleAndTeamAnal.fireUIEvent;
|
|
68
70
|
return /*#__PURE__*/React.createElement(LinkedCardWrapper, {
|
|
69
71
|
href: link || '#',
|
|
70
72
|
handleMouseEnter: function handleMouseEnter() {
|
|
@@ -8,7 +8,7 @@ import Button from '@atlaskit/button/new';
|
|
|
8
8
|
import ModalTransition from '@atlaskit/modal-dialog/modal-transition';
|
|
9
9
|
import { Grid, Inline, Stack } from '@atlaskit/primitives';
|
|
10
10
|
import { N0, N90 } from '@atlaskit/theme/colors';
|
|
11
|
-
import { AnalyticsAction,
|
|
11
|
+
import { AnalyticsAction, usePeopleAndTeamAnalytics } from '../../common/utils/analytics';
|
|
12
12
|
import { hasProductPermission } from '../../controllers';
|
|
13
13
|
import { useProductPermissions } from '../../controllers/hooks/use-product-permission';
|
|
14
14
|
import { useTeamContainers, useTeamContainersHook } from '../../controllers/hooks/use-team-containers';
|
|
@@ -56,6 +56,9 @@ export var TeamContainers = function TeamContainers(_ref) {
|
|
|
56
56
|
_useState10 = _slicedToArray(_useState9, 2),
|
|
57
57
|
selectedContainerDetails = _useState10[0],
|
|
58
58
|
setSelectedContainerDetails = _useState10[1];
|
|
59
|
+
var _usePeopleAndTeamAnal = usePeopleAndTeamAnalytics(),
|
|
60
|
+
fireOperationalEvent = _usePeopleAndTeamAnal.fireOperationalEvent,
|
|
61
|
+
fireTrackEvent = _usePeopleAndTeamAnal.fireTrackEvent;
|
|
59
62
|
var _useProductPermission = useProductPermissions({
|
|
60
63
|
userId: userId,
|
|
61
64
|
cloudId: cloudId
|
|
@@ -85,31 +88,45 @@ export var TeamContainers = function TeamContainers(_ref) {
|
|
|
85
88
|
setIsDisconnectDialogOpen(true);
|
|
86
89
|
fireTrackEvent(createAnalyticsEvent, {
|
|
87
90
|
action: AnalyticsAction.OPENED,
|
|
88
|
-
actionSubject: 'unlinkContainerDialog'
|
|
91
|
+
actionSubject: 'unlinkContainerDialog',
|
|
92
|
+
attributes: {
|
|
93
|
+
teamId: teamId
|
|
94
|
+
}
|
|
89
95
|
});
|
|
90
|
-
}, [createAnalyticsEvent]);
|
|
96
|
+
}, [createAnalyticsEvent, fireTrackEvent, teamId]);
|
|
91
97
|
var LinkedContainerCardComponent = (components === null || components === void 0 ? void 0 : components.ContainerCard) || LinkedContainerCard;
|
|
92
98
|
var handleDisconnect = useCallback( /*#__PURE__*/function () {
|
|
93
99
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(containerId) {
|
|
100
|
+
var removedContainer;
|
|
94
101
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
95
102
|
while (1) switch (_context.prev = _context.next) {
|
|
96
103
|
case 0:
|
|
97
|
-
|
|
104
|
+
removedContainer = teamContainers.find(function (container) {
|
|
105
|
+
return container.id === containerId;
|
|
106
|
+
});
|
|
107
|
+
_context.next = 3;
|
|
98
108
|
return actions.unlinkTeamContainers(teamId, containerId);
|
|
99
|
-
case
|
|
109
|
+
case 3:
|
|
100
110
|
setIsDisconnectDialogOpen(false);
|
|
101
111
|
if (unlinkError) {
|
|
102
112
|
fireOperationalEvent(createAnalyticsEvent, {
|
|
103
113
|
action: AnalyticsAction.FAILED,
|
|
104
|
-
actionSubject: '
|
|
114
|
+
actionSubject: 'teamContainerUnlinked'
|
|
105
115
|
});
|
|
106
116
|
} else {
|
|
107
117
|
fireOperationalEvent(createAnalyticsEvent, {
|
|
108
118
|
action: AnalyticsAction.SUCCEEDED,
|
|
109
|
-
actionSubject: '
|
|
119
|
+
actionSubject: 'teamContainerUnlinked',
|
|
120
|
+
attributes: {
|
|
121
|
+
containerRemoved: {
|
|
122
|
+
containerId: removedContainer === null || removedContainer === void 0 ? void 0 : removedContainer.id,
|
|
123
|
+
container: removedContainer === null || removedContainer === void 0 ? void 0 : removedContainer.type
|
|
124
|
+
},
|
|
125
|
+
teamId: teamId
|
|
126
|
+
}
|
|
110
127
|
});
|
|
111
128
|
}
|
|
112
|
-
case
|
|
129
|
+
case 5:
|
|
113
130
|
case "end":
|
|
114
131
|
return _context.stop();
|
|
115
132
|
}
|
|
@@ -118,7 +135,7 @@ export var TeamContainers = function TeamContainers(_ref) {
|
|
|
118
135
|
return function (_x) {
|
|
119
136
|
return _ref2.apply(this, arguments);
|
|
120
137
|
};
|
|
121
|
-
}(), [actions, createAnalyticsEvent, teamId, unlinkError]);
|
|
138
|
+
}(), [actions, createAnalyticsEvent, fireOperationalEvent, teamContainers, teamId, unlinkError]);
|
|
122
139
|
if (loading || productPermissionIsLoading) {
|
|
123
140
|
return /*#__PURE__*/React.createElement(TeamContainersSkeleton, {
|
|
124
141
|
numberOfContainers: MAX_NUMBER_OF_CONTAINERS_TO_SHOW
|
|
@@ -8,10 +8,12 @@ interface AnalyticsEvent {
|
|
|
8
8
|
name?: string;
|
|
9
9
|
source?: string;
|
|
10
10
|
}
|
|
11
|
-
export declare const
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
export declare const usePeopleAndTeamAnalytics: () => {
|
|
12
|
+
fireOperationalEvent: (createAnalyticsEvent: CreateUIAnalyticsEvent | undefined, body: AnalyticsEvent) => void;
|
|
13
|
+
fireScreenEvent: (createAnalyticsEvent: CreateUIAnalyticsEvent | undefined, body: AnalyticsEvent) => void;
|
|
14
|
+
fireTrackEvent: (createAnalyticsEvent: CreateUIAnalyticsEvent | undefined, body: AnalyticsEvent) => void;
|
|
15
|
+
fireUIEvent: (createAnalyticsEvent: CreateUIAnalyticsEvent | undefined, body: AnalyticsEvent) => void;
|
|
16
|
+
};
|
|
15
17
|
export declare enum AnalyticsAction {
|
|
16
18
|
RENDERED = "rendered",
|
|
17
19
|
CLICKED = "clicked",
|
|
@@ -8,10 +8,12 @@ interface AnalyticsEvent {
|
|
|
8
8
|
name?: string;
|
|
9
9
|
source?: string;
|
|
10
10
|
}
|
|
11
|
-
export declare const
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
export declare const usePeopleAndTeamAnalytics: () => {
|
|
12
|
+
fireOperationalEvent: (createAnalyticsEvent: CreateUIAnalyticsEvent | undefined, body: AnalyticsEvent) => void;
|
|
13
|
+
fireScreenEvent: (createAnalyticsEvent: CreateUIAnalyticsEvent | undefined, body: AnalyticsEvent) => void;
|
|
14
|
+
fireTrackEvent: (createAnalyticsEvent: CreateUIAnalyticsEvent | undefined, body: AnalyticsEvent) => void;
|
|
15
|
+
fireUIEvent: (createAnalyticsEvent: CreateUIAnalyticsEvent | undefined, body: AnalyticsEvent) => void;
|
|
16
|
+
};
|
|
15
17
|
export declare enum AnalyticsAction {
|
|
16
18
|
RENDERED = "rendered",
|
|
17
19
|
CLICKED = "clicked",
|
package/package.json
CHANGED
|
@@ -39,6 +39,7 @@
|
|
|
39
39
|
"@atlaskit/link": "^3.0.0",
|
|
40
40
|
"@atlaskit/logo": "^16.0.0",
|
|
41
41
|
"@atlaskit/modal-dialog": "^13.1.0",
|
|
42
|
+
"@atlaskit/people-teams-ui-public": "^3.1.0",
|
|
42
43
|
"@atlaskit/primitives": "^14.1.0",
|
|
43
44
|
"@atlaskit/theme": "^18.0.0",
|
|
44
45
|
"@atlaskit/tokens": "^4.5.0",
|
|
@@ -105,7 +106,7 @@
|
|
|
105
106
|
}
|
|
106
107
|
},
|
|
107
108
|
"name": "@atlaskit/teams-public",
|
|
108
|
-
"version": "0.
|
|
109
|
+
"version": "0.12.0",
|
|
109
110
|
"description": "Public components related to teams",
|
|
110
111
|
"author": "Atlassian Pty Ltd",
|
|
111
112
|
"license": "Apache-2.0",
|