@atlaskit/teams-public 0.68.0 → 0.69.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 CHANGED
@@ -1,5 +1,22 @@
1
1
  # @atlaskit/teams-public
2
2
 
3
+ ## 0.69.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`2f0921abc9f22`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/2f0921abc9f22) -
8
+ Migrated requested containers analytics events to teams-app-internal-analytics package
9
+
10
+ ### Patch Changes
11
+
12
+ - Updated dependencies
13
+
14
+ ## 0.68.1
15
+
16
+ ### Patch Changes
17
+
18
+ - Updated dependencies
19
+
3
20
  ## 0.68.0
4
21
 
5
22
  ### Minor Changes
@@ -16,7 +16,6 @@ var _featureGateJsClient = _interopRequireDefault(require("@atlaskit/feature-gat
16
16
  var _globe = _interopRequireDefault(require("@atlaskit/icon/core/globe"));
17
17
  var _link = _interopRequireDefault(require("@atlaskit/icon/core/link"));
18
18
  var _compiled = require("@atlaskit/primitives/compiled");
19
- var _getIsExperimentEnabled = require("../../utils/get-is-experiment-enabled");
20
19
  var _loomAvatar = require("../loom-avatar");
21
20
  var styles = {
22
21
  globeIconWrapperMedium: "_2rko1mok _1bsb1u1b _4t3i1u1b _1e0c1txw _4cvr1h6o _1bah1h6o _12ji1l7x _1qu2nqa1 _bfhkhfxm",
@@ -43,7 +42,6 @@ var ContainerIcon = exports.ContainerIcon = function ContainerIcon(_ref2) {
43
42
  _ref2$iconHasLoaded = _ref2.iconHasLoaded,
44
43
  iconHasLoaded = _ref2$iconHasLoaded === void 0 ? true : _ref2$iconHasLoaded;
45
44
  var isMedium = size === 'medium';
46
- var isTeamLensInHomeEnabled = (0, _getIsExperimentEnabled.getIsExperimentEnabled)('team_lens_in_atlassian_home');
47
45
  var isNewTeamProfilePageEnabled = _featureGateJsClient.default.getExperimentValue('new_team_profile', 'isEnabled', false);
48
46
  if (containerType === 'LoomSpace') {
49
47
  return /*#__PURE__*/_react.default.createElement(_loomAvatar.LoomSpaceAvatar, {
@@ -55,7 +53,7 @@ var ContainerIcon = exports.ContainerIcon = function ContainerIcon(_ref2) {
55
53
 
56
54
  // This is a fallback icon for WebLink if the containerIcon is not present
57
55
  if (containerType === 'WebLink' && !containerIcon) {
58
- if (isTeamLensInHomeEnabled || isNewTeamProfilePageEnabled) {
56
+ if (isNewTeamProfilePageEnabled) {
59
57
  return /*#__PURE__*/_react.default.createElement(_compiled.Box, {
60
58
  xcss: (0, _css.cx)(!isMedium && styles.linkIconWrapperSmall)
61
59
  }, /*#__PURE__*/_react.default.createElement(_new.IconButton, {
@@ -13,7 +13,9 @@ var _react = _interopRequireWildcard(require("react"));
13
13
  var _reactIntlNext = require("react-intl-next");
14
14
  var _analyticsNext = require("@atlaskit/analytics-next");
15
15
  var _linkExternal = _interopRequireDefault(require("@atlaskit/icon/core/link-external"));
16
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
16
17
  var _compiled = require("@atlaskit/primitives/compiled");
18
+ var _teamsAppInternalAnalytics = require("@atlaskit/teams-app-internal-analytics");
17
19
  var _teamsClient = require("@atlaskit/teams-client");
18
20
  var _analytics = require("../../../common/utils/analytics");
19
21
  var _useTeamContainers2 = require("../use-team-containers");
@@ -51,8 +53,10 @@ function useRequestedContainers(_ref) {
51
53
  setRefetchErrorCount = _useState4[1];
52
54
  var _usePeopleAndTeamAnal = (0, _analytics.usePeopleAndTeamAnalytics)(),
53
55
  fireTrackEvent = _usePeopleAndTeamAnal.fireTrackEvent;
54
- var _useAnalyticsEvents = (0, _analyticsNext.useAnalyticsEvents)(),
55
- createAnalyticsEvent = _useAnalyticsEvents.createAnalyticsEvent;
56
+ var _useAnalyticsEventsDE = (0, _analyticsNext.useAnalyticsEvents)(),
57
+ createAnalyticsEvent = _useAnalyticsEventsDE.createAnalyticsEvent;
58
+ var _useAnalyticsEvents = (0, _teamsAppInternalAnalytics.useAnalyticsEvents)(),
59
+ fireEvent = _useAnalyticsEvents.fireEvent;
56
60
  var _useState5 = (0, _react.useState)([]),
57
61
  _useState6 = (0, _slicedToArray2.default)(_useState5, 2),
58
62
  requestedContainers = _useState6[0],
@@ -146,15 +150,22 @@ function useRequestedContainers(_ref) {
146
150
  var type = _ref7.type;
147
151
  return Boolean(type);
148
152
  });
149
- fireTrackEvent(createAnalyticsEvent, {
150
- action: 'tryAgain',
151
- actionSubject: 'requestedContainers',
152
- // @ts-ignore
153
- attributes: {
153
+ if ((0, _platformFeatureFlags.fg)('ptc-missed-analytics-migration-events')) {
154
+ fireEvent('track.requestedContainers.tryAgain', {
154
155
  containers: reqContainers,
155
156
  teamId: teamId
156
- }
157
- });
157
+ });
158
+ } else {
159
+ fireTrackEvent(createAnalyticsEvent, {
160
+ action: 'tryAgain',
161
+ actionSubject: 'requestedContainers',
162
+ // @ts-ignore
163
+ attributes: {
164
+ containers: reqContainers,
165
+ teamId: teamId
166
+ }
167
+ });
168
+ }
158
169
  _context2.prev = 4;
159
170
  _context2.next = 7;
160
171
  return _teamsClient.teamsClient.createTeamContainers({
@@ -219,19 +230,27 @@ function useRequestedContainers(_ref) {
219
230
  return _ref6.apply(this, arguments);
220
231
  };
221
232
  }();
222
- fireTrackEvent(createAnalyticsEvent, {
223
- action: 'failed',
224
- actionSubject: 'requestedContainers',
225
- attributes: {
226
- // @ts-ignore
233
+ if ((0, _platformFeatureFlags.fg)('ptc-missed-analytics-migration-events')) {
234
+ fireEvent('track.requestedContainers.failed', {
227
235
  containers: reqContainers,
228
236
  teamId: teamId,
229
237
  tryAgainCount: tryAgainCountRef.current
230
- }
231
- });
238
+ });
239
+ } else {
240
+ fireTrackEvent(createAnalyticsEvent, {
241
+ action: 'failed',
242
+ actionSubject: 'requestedContainers',
243
+ attributes: {
244
+ // @ts-ignore
245
+ containers: reqContainers,
246
+ teamId: teamId,
247
+ tryAgainCount: tryAgainCountRef.current
248
+ }
249
+ });
250
+ }
232
251
  (0, _utils.removeRequestedContainersFromUrl)();
233
252
  onRequestedContainerTimeout(tryAgainCountRef.current === 0 ? createTryAgainFlag : createContactSupportFlag);
234
- }, [cloudId, formatMessage, onRequestedContainerTimeout, refetchTeamContainers, teamId, createAnalyticsEvent, fireTrackEvent]);
253
+ }, [cloudId, formatMessage, onRequestedContainerTimeout, refetchTeamContainers, teamId, createAnalyticsEvent, fireTrackEvent, fireEvent]);
235
254
  var _useAsyncPolling = (0, _utils.useAsyncPolling)(checkContainers, {
236
255
  onTimeout: onTimeout
237
256
  }),
@@ -254,15 +273,23 @@ function useRequestedContainers(_ref) {
254
273
  //stop gap to prevent sending too many failed errors
255
274
  if (refetchErrorCount > 3) {
256
275
  stopPolling();
257
- fireTrackEvent(createAnalyticsEvent, {
258
- action: 'failed',
259
- actionSubject: 'requestedContainers',
260
- attributes: {
261
- // @ts-ignore
276
+ if ((0, _platformFeatureFlags.fg)('ptc-missed-analytics-migration-events')) {
277
+ fireEvent('track.requestedContainers.failed', {
262
278
  containers: requestedContainers,
263
- teamId: teamId
264
- }
265
- });
279
+ teamId: teamId,
280
+ tryAgainCount: null
281
+ });
282
+ } else {
283
+ fireTrackEvent(createAnalyticsEvent, {
284
+ action: 'failed',
285
+ actionSubject: 'requestedContainers',
286
+ attributes: {
287
+ // @ts-ignore
288
+ containers: requestedContainers,
289
+ teamId: teamId
290
+ }
291
+ });
292
+ }
266
293
  return;
267
294
  }
268
295
  if (hasTimedOut || isTryingAgain) {
@@ -274,7 +301,7 @@ function useRequestedContainers(_ref) {
274
301
  stopPolling();
275
302
  return;
276
303
  }
277
- }, [isPolling, refetchErrorCount, requestedContainers, hasTimedOut, startPolling, stopPolling, isTryingAgain, teamId, createAnalyticsEvent, fireTrackEvent]);
304
+ }, [isPolling, refetchErrorCount, requestedContainers, hasTimedOut, startPolling, stopPolling, isTryingAgain, teamId, createAnalyticsEvent, fireTrackEvent, fireEvent]);
278
305
  (0, _react.useEffect)(function () {
279
306
  var containersNotFound = requestedContainers.filter(function (containerType) {
280
307
  return !teamContainers.some(function (teamContainer) {
@@ -31,7 +31,6 @@ var _containerIcon = require("../../../common/ui/container-icon");
31
31
  var _separator = require("../../../common/ui/separator");
32
32
  var _teamLinkCardActions = require("../../../common/ui/team-link-card-actions");
33
33
  var _getContainerProperties = require("../../../common/utils/get-container-properties");
34
- var _getIsExperimentEnabled = require("../../../common/utils/get-is-experiment-enabled");
35
34
  var _getLinkDomain = require("../../../common/utils/get-link-domain");
36
35
  var _teamLinkCardTitle = require("./team-link-card-title");
37
36
  var _excluded = ["triggerRef"];
@@ -105,9 +104,8 @@ var TeamLinkCard = exports.TeamLinkCard = function TeamLinkCard(_ref) {
105
104
  formatMessage = _useIntl.formatMessage;
106
105
  var _useAnalyticsEvents = (0, _teamsAppInternalAnalytics.useAnalyticsEvents)(),
107
106
  fireEvent = _useAnalyticsEvents.fireEvent;
108
- var isTeamLensInHomeEnabled = (0, _getIsExperimentEnabled.getIsExperimentEnabled)('team_lens_in_atlassian_home');
109
107
  var isNewTeamProfilePageEnabled = _featureGateJsClient.default.getExperimentValue('new_team_profile', 'isEnabled', false);
110
- var isOpenWebLinkInNewTabEnabled = containerType === 'WebLink' && (isNewTeamProfilePageEnabled || isTeamLensInHomeEnabled);
108
+ var isOpenWebLinkInNewTabEnabled = containerType === 'WebLink' && isNewTeamProfilePageEnabled;
111
109
  var handleMouseEnter = function handleMouseEnter() {
112
110
  if (isReadOnly) {
113
111
  return;
@@ -186,13 +184,13 @@ var TeamLinkCard = exports.TeamLinkCard = function TeamLinkCard(_ref) {
186
184
  iconsLoading: iconsLoading,
187
185
  iconHasLoaded: iconHasLoaded
188
186
  }), (0, _platformFeatureFlags.fg)('fix_team_link_card_a11y') ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_compiled.Anchor, {
189
- xcss: (0, _css.cx)(styles.anchor, isTeamLensInHomeEnabled && styles.anchorNoUnderline, isOpenWebLinkInNewTabEnabled && styles.anchorWithExternalLinkIcon),
187
+ xcss: (0, _css.cx)(styles.anchor, styles.anchorNoUnderline, isOpenWebLinkInNewTabEnabled && styles.anchorWithExternalLinkIcon),
190
188
  href: link || '#',
191
189
  onClick: handleLinkClick,
192
190
  testId: "team-link-card-linkable-content",
193
191
  target: isOpenWebLinkInNewTabEnabled ? '_blank' : '_self'
194
192
  }, /*#__PURE__*/_react.default.createElement(_compiled.Stack, null, /*#__PURE__*/_react.default.createElement(_teamLinkCardTitle.TeamLinkCardTitle, {
195
- isTeamLensInHomeEnabled: isTeamLensInHomeEnabled,
193
+ isTeamLensInHomeEnabled: true,
196
194
  isOpenWebLinkInNewTabEnabled: isOpenWebLinkInNewTabEnabled,
197
195
  link: link || '#',
198
196
  handleLinkClick: handleLinkClick,
@@ -203,7 +201,7 @@ var TeamLinkCard = exports.TeamLinkCard = function TeamLinkCard(_ref) {
203
201
  }, !hideSubTextIcon ? icon : null, /*#__PURE__*/_react.default.createElement(_compiled.Inline, {
204
202
  space: "space.050",
205
203
  alignBlock: "center"
206
- }, isNewTeamProfilePageEnabled || isTeamLensInHomeEnabled ? renderContainerTypeTextWithSeparator(containerTypeText, description) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_compiled.Text, {
204
+ }, isNewTeamProfilePageEnabled ? renderContainerTypeTextWithSeparator(containerTypeText, description) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_compiled.Text, {
207
205
  size: "small",
208
206
  color: "color.text.subtle"
209
207
  }, description), /*#__PURE__*/_react.default.createElement(_compiled.Text, {
@@ -240,7 +238,7 @@ var TeamLinkCard = exports.TeamLinkCard = function TeamLinkCard(_ref) {
240
238
  appearance: "subtle",
241
239
  onClick: handleLinkClick
242
240
  }, /*#__PURE__*/_react.default.createElement(_compiled.Stack, null, /*#__PURE__*/_react.default.createElement(_teamLinkCardTitle.TeamLinkCardTitle, {
243
- isTeamLensInHomeEnabled: isTeamLensInHomeEnabled,
241
+ isTeamLensInHomeEnabled: true,
244
242
  isOpenWebLinkInNewTabEnabled: isOpenWebLinkInNewTabEnabled,
245
243
  link: link || '#',
246
244
  handleLinkClick: handleLinkClick,
@@ -251,7 +249,7 @@ var TeamLinkCard = exports.TeamLinkCard = function TeamLinkCard(_ref) {
251
249
  }, !hideSubTextIcon ? icon : null, /*#__PURE__*/_react.default.createElement(_compiled.Inline, {
252
250
  space: "space.050",
253
251
  alignBlock: "center"
254
- }, isNewTeamProfilePageEnabled || isTeamLensInHomeEnabled ? renderContainerTypeTextWithSeparator(containerTypeText, description) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_compiled.Text, {
252
+ }, isNewTeamProfilePageEnabled ? renderContainerTypeTextWithSeparator(containerTypeText, description) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_compiled.Text, {
255
253
  size: "small",
256
254
  color: "color.text.subtle"
257
255
  }, description), /*#__PURE__*/_react.default.createElement(_compiled.Text, {
@@ -9,7 +9,6 @@ import FeatureGates from '@atlaskit/feature-gate-js-client';
9
9
  import GlobeIcon from '@atlaskit/icon/core/globe';
10
10
  import LinkIcon from '@atlaskit/icon/core/link';
11
11
  import { Box } from '@atlaskit/primitives/compiled';
12
- import { getIsExperimentEnabled } from '../../utils/get-is-experiment-enabled';
13
12
  import { LoomSpaceAvatar } from '../loom-avatar';
14
13
  const styles = {
15
14
  globeIconWrapperMedium: "_2rko1mok _1bsb1u1b _4t3i1u1b _1e0c1txw _4cvr1h6o _1bah1h6o _12ji1l7x _1qu2nqa1 _bfhkhfxm",
@@ -35,7 +34,6 @@ export const ContainerIcon = ({
35
34
  iconHasLoaded = true
36
35
  }) => {
37
36
  const isMedium = size === 'medium';
38
- const isTeamLensInHomeEnabled = getIsExperimentEnabled('team_lens_in_atlassian_home');
39
37
  const isNewTeamProfilePageEnabled = FeatureGates.getExperimentValue('new_team_profile', 'isEnabled', false);
40
38
  if (containerType === 'LoomSpace') {
41
39
  return /*#__PURE__*/React.createElement(LoomSpaceAvatar, {
@@ -47,7 +45,7 @@ export const ContainerIcon = ({
47
45
 
48
46
  // This is a fallback icon for WebLink if the containerIcon is not present
49
47
  if (containerType === 'WebLink' && !containerIcon) {
50
- if (isTeamLensInHomeEnabled || isNewTeamProfilePageEnabled) {
48
+ if (isNewTeamProfilePageEnabled) {
51
49
  return /*#__PURE__*/React.createElement(Box, {
52
50
  xcss: cx(!isMedium && styles.linkIconWrapperSmall)
53
51
  }, /*#__PURE__*/React.createElement(IconButton, {
@@ -1,8 +1,10 @@
1
1
  import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
2
2
  import { defineMessages, useIntl } from 'react-intl-next';
3
- import { useAnalyticsEvents } from '@atlaskit/analytics-next';
3
+ import { useAnalyticsEvents as useAnalyticsEventsDEPRECATED } from '@atlaskit/analytics-next';
4
4
  import LinkExternalIcon from '@atlaskit/icon/core/link-external';
5
+ import { fg } from '@atlaskit/platform-feature-flags';
5
6
  import { Flex } from '@atlaskit/primitives/compiled';
7
+ import { useAnalyticsEvents } from '@atlaskit/teams-app-internal-analytics';
6
8
  import { HttpError, teamsClient } from '@atlaskit/teams-client';
7
9
  import { usePeopleAndTeamAnalytics } from '../../../common/utils/analytics';
8
10
  import { useTeamContainers } from '../use-team-containers';
@@ -39,6 +41,9 @@ function useRequestedContainers({
39
41
  } = usePeopleAndTeamAnalytics();
40
42
  const {
41
43
  createAnalyticsEvent
44
+ } = useAnalyticsEventsDEPRECATED();
45
+ const {
46
+ fireEvent
42
47
  } = useAnalyticsEvents();
43
48
  const [requestedContainers, setRequestedContainers] = useState([]);
44
49
  const requestedContainersRef = useRef([]);
@@ -108,15 +113,22 @@ function useRequestedContainers({
108
113
  }).filter(({
109
114
  type
110
115
  }) => Boolean(type));
111
- fireTrackEvent(createAnalyticsEvent, {
112
- action: 'tryAgain',
113
- actionSubject: 'requestedContainers',
114
- // @ts-ignore
115
- attributes: {
116
+ if (fg('ptc-missed-analytics-migration-events')) {
117
+ fireEvent('track.requestedContainers.tryAgain', {
116
118
  containers: reqContainers,
117
119
  teamId
118
- }
119
- });
120
+ });
121
+ } else {
122
+ fireTrackEvent(createAnalyticsEvent, {
123
+ action: 'tryAgain',
124
+ actionSubject: 'requestedContainers',
125
+ // @ts-ignore
126
+ attributes: {
127
+ containers: reqContainers,
128
+ teamId
129
+ }
130
+ });
131
+ }
120
132
  try {
121
133
  const response = await teamsClient.createTeamContainers({
122
134
  teamId,
@@ -152,19 +164,27 @@ function useRequestedContainers({
152
164
  setIsTryingAgain(false);
153
165
  }
154
166
  };
155
- fireTrackEvent(createAnalyticsEvent, {
156
- action: 'failed',
157
- actionSubject: 'requestedContainers',
158
- attributes: {
159
- // @ts-ignore
167
+ if (fg('ptc-missed-analytics-migration-events')) {
168
+ fireEvent('track.requestedContainers.failed', {
160
169
  containers: reqContainers,
161
170
  teamId,
162
171
  tryAgainCount: tryAgainCountRef.current
163
- }
164
- });
172
+ });
173
+ } else {
174
+ fireTrackEvent(createAnalyticsEvent, {
175
+ action: 'failed',
176
+ actionSubject: 'requestedContainers',
177
+ attributes: {
178
+ // @ts-ignore
179
+ containers: reqContainers,
180
+ teamId,
181
+ tryAgainCount: tryAgainCountRef.current
182
+ }
183
+ });
184
+ }
165
185
  removeRequestedContainersFromUrl();
166
186
  onRequestedContainerTimeout(tryAgainCountRef.current === 0 ? createTryAgainFlag : createContactSupportFlag);
167
- }, [cloudId, formatMessage, onRequestedContainerTimeout, refetchTeamContainers, teamId, createAnalyticsEvent, fireTrackEvent]);
187
+ }, [cloudId, formatMessage, onRequestedContainerTimeout, refetchTeamContainers, teamId, createAnalyticsEvent, fireTrackEvent, fireEvent]);
168
188
  const {
169
189
  startPolling,
170
190
  stopPolling,
@@ -188,15 +208,23 @@ function useRequestedContainers({
188
208
  //stop gap to prevent sending too many failed errors
189
209
  if (refetchErrorCount > 3) {
190
210
  stopPolling();
191
- fireTrackEvent(createAnalyticsEvent, {
192
- action: 'failed',
193
- actionSubject: 'requestedContainers',
194
- attributes: {
195
- // @ts-ignore
211
+ if (fg('ptc-missed-analytics-migration-events')) {
212
+ fireEvent('track.requestedContainers.failed', {
196
213
  containers: requestedContainers,
197
- teamId
198
- }
199
- });
214
+ teamId,
215
+ tryAgainCount: null
216
+ });
217
+ } else {
218
+ fireTrackEvent(createAnalyticsEvent, {
219
+ action: 'failed',
220
+ actionSubject: 'requestedContainers',
221
+ attributes: {
222
+ // @ts-ignore
223
+ containers: requestedContainers,
224
+ teamId
225
+ }
226
+ });
227
+ }
200
228
  return;
201
229
  }
202
230
  if (hasTimedOut || isTryingAgain) {
@@ -208,7 +236,7 @@ function useRequestedContainers({
208
236
  stopPolling();
209
237
  return;
210
238
  }
211
- }, [isPolling, refetchErrorCount, requestedContainers, hasTimedOut, startPolling, stopPolling, isTryingAgain, teamId, createAnalyticsEvent, fireTrackEvent]);
239
+ }, [isPolling, refetchErrorCount, requestedContainers, hasTimedOut, startPolling, stopPolling, isTryingAgain, teamId, createAnalyticsEvent, fireTrackEvent, fireEvent]);
212
240
  useEffect(() => {
213
241
  const containersNotFound = requestedContainers.filter(containerType => !teamContainers.some(teamContainer => teamContainer.type === containerType));
214
242
  if (!containersEqual(containersNotFound, requestedContainers)) {
@@ -20,7 +20,6 @@ import { ContainerIcon } from '../../../common/ui/container-icon';
20
20
  import { Separator } from '../../../common/ui/separator';
21
21
  import { TeamLinkCardActions } from '../../../common/ui/team-link-card-actions';
22
22
  import { getContainerProperties } from '../../../common/utils/get-container-properties';
23
- import { getIsExperimentEnabled } from '../../../common/utils/get-is-experiment-enabled';
24
23
  import { getDomainFromLinkUri } from '../../../common/utils/get-link-domain';
25
24
  import { TeamLinkCardTitle } from './team-link-card-title';
26
25
  const styles = {
@@ -79,9 +78,8 @@ export const TeamLinkCard = ({
79
78
  const {
80
79
  fireEvent
81
80
  } = useAnalyticsEvents();
82
- const isTeamLensInHomeEnabled = getIsExperimentEnabled('team_lens_in_atlassian_home');
83
81
  const isNewTeamProfilePageEnabled = FeatureGates.getExperimentValue('new_team_profile', 'isEnabled', false);
84
- const isOpenWebLinkInNewTabEnabled = containerType === 'WebLink' && (isNewTeamProfilePageEnabled || isTeamLensInHomeEnabled);
82
+ const isOpenWebLinkInNewTabEnabled = containerType === 'WebLink' && isNewTeamProfilePageEnabled;
85
83
  const handleMouseEnter = () => {
86
84
  if (isReadOnly) {
87
85
  return;
@@ -161,13 +159,13 @@ export const TeamLinkCard = ({
161
159
  iconsLoading: iconsLoading,
162
160
  iconHasLoaded: iconHasLoaded
163
161
  }), fg('fix_team_link_card_a11y') ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Anchor, {
164
- xcss: cx(styles.anchor, isTeamLensInHomeEnabled && styles.anchorNoUnderline, isOpenWebLinkInNewTabEnabled && styles.anchorWithExternalLinkIcon),
162
+ xcss: cx(styles.anchor, styles.anchorNoUnderline, isOpenWebLinkInNewTabEnabled && styles.anchorWithExternalLinkIcon),
165
163
  href: link || '#',
166
164
  onClick: handleLinkClick,
167
165
  testId: "team-link-card-linkable-content",
168
166
  target: isOpenWebLinkInNewTabEnabled ? '_blank' : '_self'
169
167
  }, /*#__PURE__*/React.createElement(Stack, null, /*#__PURE__*/React.createElement(TeamLinkCardTitle, {
170
- isTeamLensInHomeEnabled: isTeamLensInHomeEnabled,
168
+ isTeamLensInHomeEnabled: true,
171
169
  isOpenWebLinkInNewTabEnabled: isOpenWebLinkInNewTabEnabled,
172
170
  link: link || '#',
173
171
  handleLinkClick: handleLinkClick,
@@ -178,7 +176,7 @@ export const TeamLinkCard = ({
178
176
  }, !hideSubTextIcon ? icon : null, /*#__PURE__*/React.createElement(Inline, {
179
177
  space: "space.050",
180
178
  alignBlock: "center"
181
- }, isNewTeamProfilePageEnabled || isTeamLensInHomeEnabled ? renderContainerTypeTextWithSeparator(containerTypeText, description) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Text, {
179
+ }, isNewTeamProfilePageEnabled ? renderContainerTypeTextWithSeparator(containerTypeText, description) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Text, {
182
180
  size: "small",
183
181
  color: "color.text.subtle"
184
182
  }, description), /*#__PURE__*/React.createElement(Text, {
@@ -215,7 +213,7 @@ export const TeamLinkCard = ({
215
213
  appearance: "subtle",
216
214
  onClick: handleLinkClick
217
215
  }, /*#__PURE__*/React.createElement(Stack, null, /*#__PURE__*/React.createElement(TeamLinkCardTitle, {
218
- isTeamLensInHomeEnabled: isTeamLensInHomeEnabled,
216
+ isTeamLensInHomeEnabled: true,
219
217
  isOpenWebLinkInNewTabEnabled: isOpenWebLinkInNewTabEnabled,
220
218
  link: link || '#',
221
219
  handleLinkClick: handleLinkClick,
@@ -226,7 +224,7 @@ export const TeamLinkCard = ({
226
224
  }, !hideSubTextIcon ? icon : null, /*#__PURE__*/React.createElement(Inline, {
227
225
  space: "space.050",
228
226
  alignBlock: "center"
229
- }, isNewTeamProfilePageEnabled || isTeamLensInHomeEnabled ? renderContainerTypeTextWithSeparator(containerTypeText, description) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Text, {
227
+ }, isNewTeamProfilePageEnabled ? renderContainerTypeTextWithSeparator(containerTypeText, description) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Text, {
230
228
  size: "small",
231
229
  color: "color.text.subtle"
232
230
  }, description), /*#__PURE__*/React.createElement(Text, {
@@ -9,7 +9,6 @@ import FeatureGates from '@atlaskit/feature-gate-js-client';
9
9
  import GlobeIcon from '@atlaskit/icon/core/globe';
10
10
  import LinkIcon from '@atlaskit/icon/core/link';
11
11
  import { Box } from '@atlaskit/primitives/compiled';
12
- import { getIsExperimentEnabled } from '../../utils/get-is-experiment-enabled';
13
12
  import { LoomSpaceAvatar } from '../loom-avatar';
14
13
  var styles = {
15
14
  globeIconWrapperMedium: "_2rko1mok _1bsb1u1b _4t3i1u1b _1e0c1txw _4cvr1h6o _1bah1h6o _12ji1l7x _1qu2nqa1 _bfhkhfxm",
@@ -36,7 +35,6 @@ export var ContainerIcon = function ContainerIcon(_ref2) {
36
35
  _ref2$iconHasLoaded = _ref2.iconHasLoaded,
37
36
  iconHasLoaded = _ref2$iconHasLoaded === void 0 ? true : _ref2$iconHasLoaded;
38
37
  var isMedium = size === 'medium';
39
- var isTeamLensInHomeEnabled = getIsExperimentEnabled('team_lens_in_atlassian_home');
40
38
  var isNewTeamProfilePageEnabled = FeatureGates.getExperimentValue('new_team_profile', 'isEnabled', false);
41
39
  if (containerType === 'LoomSpace') {
42
40
  return /*#__PURE__*/React.createElement(LoomSpaceAvatar, {
@@ -48,7 +46,7 @@ export var ContainerIcon = function ContainerIcon(_ref2) {
48
46
 
49
47
  // This is a fallback icon for WebLink if the containerIcon is not present
50
48
  if (containerType === 'WebLink' && !containerIcon) {
51
- if (isTeamLensInHomeEnabled || isNewTeamProfilePageEnabled) {
49
+ if (isNewTeamProfilePageEnabled) {
52
50
  return /*#__PURE__*/React.createElement(Box, {
53
51
  xcss: cx(!isMedium && styles.linkIconWrapperSmall)
54
52
  }, /*#__PURE__*/React.createElement(IconButton, {
@@ -3,9 +3,11 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
3
3
  import _regeneratorRuntime from "@babel/runtime/regenerator";
4
4
  import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
5
5
  import { defineMessages, useIntl } from 'react-intl-next';
6
- import { useAnalyticsEvents } from '@atlaskit/analytics-next';
6
+ import { useAnalyticsEvents as useAnalyticsEventsDEPRECATED } from '@atlaskit/analytics-next';
7
7
  import LinkExternalIcon from '@atlaskit/icon/core/link-external';
8
+ import { fg } from '@atlaskit/platform-feature-flags';
8
9
  import { Flex } from '@atlaskit/primitives/compiled';
10
+ import { useAnalyticsEvents } from '@atlaskit/teams-app-internal-analytics';
9
11
  import { HttpError, teamsClient } from '@atlaskit/teams-client';
10
12
  import { usePeopleAndTeamAnalytics } from '../../../common/utils/analytics';
11
13
  import { useTeamContainers } from '../use-team-containers';
@@ -42,8 +44,10 @@ function useRequestedContainers(_ref) {
42
44
  setRefetchErrorCount = _useState4[1];
43
45
  var _usePeopleAndTeamAnal = usePeopleAndTeamAnalytics(),
44
46
  fireTrackEvent = _usePeopleAndTeamAnal.fireTrackEvent;
47
+ var _useAnalyticsEventsDE = useAnalyticsEventsDEPRECATED(),
48
+ createAnalyticsEvent = _useAnalyticsEventsDE.createAnalyticsEvent;
45
49
  var _useAnalyticsEvents = useAnalyticsEvents(),
46
- createAnalyticsEvent = _useAnalyticsEvents.createAnalyticsEvent;
50
+ fireEvent = _useAnalyticsEvents.fireEvent;
47
51
  var _useState5 = useState([]),
48
52
  _useState6 = _slicedToArray(_useState5, 2),
49
53
  requestedContainers = _useState6[0],
@@ -137,15 +141,22 @@ function useRequestedContainers(_ref) {
137
141
  var type = _ref7.type;
138
142
  return Boolean(type);
139
143
  });
140
- fireTrackEvent(createAnalyticsEvent, {
141
- action: 'tryAgain',
142
- actionSubject: 'requestedContainers',
143
- // @ts-ignore
144
- attributes: {
144
+ if (fg('ptc-missed-analytics-migration-events')) {
145
+ fireEvent('track.requestedContainers.tryAgain', {
145
146
  containers: reqContainers,
146
147
  teamId: teamId
147
- }
148
- });
148
+ });
149
+ } else {
150
+ fireTrackEvent(createAnalyticsEvent, {
151
+ action: 'tryAgain',
152
+ actionSubject: 'requestedContainers',
153
+ // @ts-ignore
154
+ attributes: {
155
+ containers: reqContainers,
156
+ teamId: teamId
157
+ }
158
+ });
159
+ }
149
160
  _context2.prev = 4;
150
161
  _context2.next = 7;
151
162
  return teamsClient.createTeamContainers({
@@ -210,19 +221,27 @@ function useRequestedContainers(_ref) {
210
221
  return _ref6.apply(this, arguments);
211
222
  };
212
223
  }();
213
- fireTrackEvent(createAnalyticsEvent, {
214
- action: 'failed',
215
- actionSubject: 'requestedContainers',
216
- attributes: {
217
- // @ts-ignore
224
+ if (fg('ptc-missed-analytics-migration-events')) {
225
+ fireEvent('track.requestedContainers.failed', {
218
226
  containers: reqContainers,
219
227
  teamId: teamId,
220
228
  tryAgainCount: tryAgainCountRef.current
221
- }
222
- });
229
+ });
230
+ } else {
231
+ fireTrackEvent(createAnalyticsEvent, {
232
+ action: 'failed',
233
+ actionSubject: 'requestedContainers',
234
+ attributes: {
235
+ // @ts-ignore
236
+ containers: reqContainers,
237
+ teamId: teamId,
238
+ tryAgainCount: tryAgainCountRef.current
239
+ }
240
+ });
241
+ }
223
242
  removeRequestedContainersFromUrl();
224
243
  onRequestedContainerTimeout(tryAgainCountRef.current === 0 ? createTryAgainFlag : createContactSupportFlag);
225
- }, [cloudId, formatMessage, onRequestedContainerTimeout, refetchTeamContainers, teamId, createAnalyticsEvent, fireTrackEvent]);
244
+ }, [cloudId, formatMessage, onRequestedContainerTimeout, refetchTeamContainers, teamId, createAnalyticsEvent, fireTrackEvent, fireEvent]);
226
245
  var _useAsyncPolling = useAsyncPolling(checkContainers, {
227
246
  onTimeout: onTimeout
228
247
  }),
@@ -245,15 +264,23 @@ function useRequestedContainers(_ref) {
245
264
  //stop gap to prevent sending too many failed errors
246
265
  if (refetchErrorCount > 3) {
247
266
  stopPolling();
248
- fireTrackEvent(createAnalyticsEvent, {
249
- action: 'failed',
250
- actionSubject: 'requestedContainers',
251
- attributes: {
252
- // @ts-ignore
267
+ if (fg('ptc-missed-analytics-migration-events')) {
268
+ fireEvent('track.requestedContainers.failed', {
253
269
  containers: requestedContainers,
254
- teamId: teamId
255
- }
256
- });
270
+ teamId: teamId,
271
+ tryAgainCount: null
272
+ });
273
+ } else {
274
+ fireTrackEvent(createAnalyticsEvent, {
275
+ action: 'failed',
276
+ actionSubject: 'requestedContainers',
277
+ attributes: {
278
+ // @ts-ignore
279
+ containers: requestedContainers,
280
+ teamId: teamId
281
+ }
282
+ });
283
+ }
257
284
  return;
258
285
  }
259
286
  if (hasTimedOut || isTryingAgain) {
@@ -265,7 +292,7 @@ function useRequestedContainers(_ref) {
265
292
  stopPolling();
266
293
  return;
267
294
  }
268
- }, [isPolling, refetchErrorCount, requestedContainers, hasTimedOut, startPolling, stopPolling, isTryingAgain, teamId, createAnalyticsEvent, fireTrackEvent]);
295
+ }, [isPolling, refetchErrorCount, requestedContainers, hasTimedOut, startPolling, stopPolling, isTryingAgain, teamId, createAnalyticsEvent, fireTrackEvent, fireEvent]);
269
296
  useEffect(function () {
270
297
  var containersNotFound = requestedContainers.filter(function (containerType) {
271
298
  return !teamContainers.some(function (teamContainer) {
@@ -26,7 +26,6 @@ import { ContainerIcon } from '../../../common/ui/container-icon';
26
26
  import { Separator } from '../../../common/ui/separator';
27
27
  import { TeamLinkCardActions } from '../../../common/ui/team-link-card-actions';
28
28
  import { getContainerProperties } from '../../../common/utils/get-container-properties';
29
- import { getIsExperimentEnabled } from '../../../common/utils/get-is-experiment-enabled';
30
29
  import { getDomainFromLinkUri } from '../../../common/utils/get-link-domain';
31
30
  import { TeamLinkCardTitle } from './team-link-card-title';
32
31
  var styles = {
@@ -96,9 +95,8 @@ export var TeamLinkCard = function TeamLinkCard(_ref) {
96
95
  formatMessage = _useIntl.formatMessage;
97
96
  var _useAnalyticsEvents = useAnalyticsEvents(),
98
97
  fireEvent = _useAnalyticsEvents.fireEvent;
99
- var isTeamLensInHomeEnabled = getIsExperimentEnabled('team_lens_in_atlassian_home');
100
98
  var isNewTeamProfilePageEnabled = FeatureGates.getExperimentValue('new_team_profile', 'isEnabled', false);
101
- var isOpenWebLinkInNewTabEnabled = containerType === 'WebLink' && (isNewTeamProfilePageEnabled || isTeamLensInHomeEnabled);
99
+ var isOpenWebLinkInNewTabEnabled = containerType === 'WebLink' && isNewTeamProfilePageEnabled;
102
100
  var handleMouseEnter = function handleMouseEnter() {
103
101
  if (isReadOnly) {
104
102
  return;
@@ -177,13 +175,13 @@ export var TeamLinkCard = function TeamLinkCard(_ref) {
177
175
  iconsLoading: iconsLoading,
178
176
  iconHasLoaded: iconHasLoaded
179
177
  }), fg('fix_team_link_card_a11y') ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Anchor, {
180
- xcss: cx(styles.anchor, isTeamLensInHomeEnabled && styles.anchorNoUnderline, isOpenWebLinkInNewTabEnabled && styles.anchorWithExternalLinkIcon),
178
+ xcss: cx(styles.anchor, styles.anchorNoUnderline, isOpenWebLinkInNewTabEnabled && styles.anchorWithExternalLinkIcon),
181
179
  href: link || '#',
182
180
  onClick: handleLinkClick,
183
181
  testId: "team-link-card-linkable-content",
184
182
  target: isOpenWebLinkInNewTabEnabled ? '_blank' : '_self'
185
183
  }, /*#__PURE__*/React.createElement(Stack, null, /*#__PURE__*/React.createElement(TeamLinkCardTitle, {
186
- isTeamLensInHomeEnabled: isTeamLensInHomeEnabled,
184
+ isTeamLensInHomeEnabled: true,
187
185
  isOpenWebLinkInNewTabEnabled: isOpenWebLinkInNewTabEnabled,
188
186
  link: link || '#',
189
187
  handleLinkClick: handleLinkClick,
@@ -194,7 +192,7 @@ export var TeamLinkCard = function TeamLinkCard(_ref) {
194
192
  }, !hideSubTextIcon ? icon : null, /*#__PURE__*/React.createElement(Inline, {
195
193
  space: "space.050",
196
194
  alignBlock: "center"
197
- }, isNewTeamProfilePageEnabled || isTeamLensInHomeEnabled ? renderContainerTypeTextWithSeparator(containerTypeText, description) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Text, {
195
+ }, isNewTeamProfilePageEnabled ? renderContainerTypeTextWithSeparator(containerTypeText, description) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Text, {
198
196
  size: "small",
199
197
  color: "color.text.subtle"
200
198
  }, description), /*#__PURE__*/React.createElement(Text, {
@@ -231,7 +229,7 @@ export var TeamLinkCard = function TeamLinkCard(_ref) {
231
229
  appearance: "subtle",
232
230
  onClick: handleLinkClick
233
231
  }, /*#__PURE__*/React.createElement(Stack, null, /*#__PURE__*/React.createElement(TeamLinkCardTitle, {
234
- isTeamLensInHomeEnabled: isTeamLensInHomeEnabled,
232
+ isTeamLensInHomeEnabled: true,
235
233
  isOpenWebLinkInNewTabEnabled: isOpenWebLinkInNewTabEnabled,
236
234
  link: link || '#',
237
235
  handleLinkClick: handleLinkClick,
@@ -242,7 +240,7 @@ export var TeamLinkCard = function TeamLinkCard(_ref) {
242
240
  }, !hideSubTextIcon ? icon : null, /*#__PURE__*/React.createElement(Inline, {
243
241
  space: "space.050",
244
242
  alignBlock: "center"
245
- }, isNewTeamProfilePageEnabled || isTeamLensInHomeEnabled ? renderContainerTypeTextWithSeparator(containerTypeText, description) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Text, {
243
+ }, isNewTeamProfilePageEnabled ? renderContainerTypeTextWithSeparator(containerTypeText, description) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Text, {
246
244
  size: "small",
247
245
  color: "color.text.subtle"
248
246
  }, description), /*#__PURE__*/React.createElement(Text, {
package/package.json CHANGED
@@ -40,13 +40,13 @@
40
40
  "@atlaskit/modal-dialog": "^14.10.0",
41
41
  "@atlaskit/people-teams-ui-public": "^3.7.0",
42
42
  "@atlaskit/platform-feature-flags": "^1.1.0",
43
- "@atlaskit/primitives": "^17.1.0",
43
+ "@atlaskit/primitives": "^18.0.0",
44
44
  "@atlaskit/skeleton": "^2.1.0",
45
- "@atlaskit/teams-app-internal-analytics": "^1.23.0",
45
+ "@atlaskit/teams-app-internal-analytics": "^1.24.0",
46
46
  "@atlaskit/teams-app-internal-product-permissions": "^1.2.0",
47
47
  "@atlaskit/teams-client": "^4.30.0",
48
48
  "@atlaskit/theme": "^21.0.0",
49
- "@atlaskit/tokens": "^10.1.0",
49
+ "@atlaskit/tokens": "^11.0.0",
50
50
  "@atlaskit/tooltip": "^20.14.0",
51
51
  "@babel/runtime": "^7.0.0",
52
52
  "@compiled/react": "^0.18.6",
@@ -109,7 +109,7 @@
109
109
  }
110
110
  },
111
111
  "name": "@atlaskit/teams-public",
112
- "version": "0.68.0",
112
+ "version": "0.69.0",
113
113
  "description": "Public components related to teams",
114
114
  "author": "Atlassian Pty Ltd",
115
115
  "license": "Apache-2.0",
@@ -141,6 +141,9 @@
141
141
  },
142
142
  "ptc-fix-containers-after-icon-size": {
143
143
  "type": "boolean"
144
+ },
145
+ "ptc-missed-analytics-migration-events": {
146
+ "type": "boolean"
144
147
  }
145
148
  }
146
149
  }