@atlaskit/teams-public 0.68.1 → 0.69.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,23 @@
1
1
  # @atlaskit/teams-public
2
2
 
3
+ ## 0.69.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [`057762a8dac32`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/057762a8dac32) -
8
+ Remove prevent_parallel_team_web_links_fetch feature gate
9
+
10
+ ## 0.69.0
11
+
12
+ ### Minor Changes
13
+
14
+ - [`2f0921abc9f22`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/2f0921abc9f22) -
15
+ Migrated requested containers analytics events to teams-app-internal-analytics package
16
+
17
+ ### Patch Changes
18
+
19
+ - Updated dependencies
20
+
3
21
  ## 0.68.1
4
22
 
5
23
  ### Patch Changes
@@ -9,12 +9,13 @@ exports.ContainerIcon = void 0;
9
9
  require("./index.compiled.css");
10
10
  var _runtime = require("@compiled/react/runtime");
11
11
  var _react = _interopRequireDefault(require("react"));
12
+ var _atlassianContext = require("@atlaskit/atlassian-context");
12
13
  var _avatar = _interopRequireDefault(require("@atlaskit/avatar"));
13
14
  var _new = require("@atlaskit/button/new");
14
15
  var _css = require("@atlaskit/css");
15
- var _featureGateJsClient = _interopRequireDefault(require("@atlaskit/feature-gate-js-client"));
16
16
  var _globe = _interopRequireDefault(require("@atlaskit/icon/core/globe"));
17
17
  var _link = _interopRequireDefault(require("@atlaskit/icon/core/link"));
18
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
18
19
  var _compiled = require("@atlaskit/primitives/compiled");
19
20
  var _loomAvatar = require("../loom-avatar");
20
21
  var styles = {
@@ -42,7 +43,7 @@ var ContainerIcon = exports.ContainerIcon = function ContainerIcon(_ref2) {
42
43
  _ref2$iconHasLoaded = _ref2.iconHasLoaded,
43
44
  iconHasLoaded = _ref2$iconHasLoaded === void 0 ? true : _ref2$iconHasLoaded;
44
45
  var isMedium = size === 'medium';
45
- var isNewTeamProfilePageEnabled = _featureGateJsClient.default.getExperimentValue('new_team_profile', 'isEnabled', false);
46
+ var isNewTeamProfilePageEnabled = !(0, _atlassianContext.isFedRamp)() || (0, _platformFeatureFlags.fg)('new_team_profile_fedramp');
46
47
  if (containerType === 'LoomSpace') {
47
48
  return /*#__PURE__*/_react.default.createElement(_loomAvatar.LoomSpaceAvatar, {
48
49
  spaceName: title,
@@ -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) {
@@ -38,7 +38,7 @@ var actions = exports.actions = {
38
38
  case 0:
39
39
  getState = _ref.getState, setState = _ref.setState, dispatch = _ref.dispatch;
40
40
  _getState = getState(), links = _getState.links, currentTeamId = _getState.teamId, hasLoaded = _getState.hasLoaded, isLoading = _getState.isLoading;
41
- if (!((isLoading || teamId === currentTeamId && hasLoaded && links.length > 0) && (0, _platformFeatureFlags.fg)('prevent_parallel_team_web_links_fetch'))) {
41
+ if (!(isLoading || teamId === currentTeamId && hasLoaded && links.length > 0)) {
42
42
  _context.next = 4;
43
43
  break;
44
44
  }
@@ -11,7 +11,6 @@ var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers
11
11
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
12
12
  var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
13
13
  var _reactSweetState = require("react-sweet-state");
14
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
15
14
  var _teamsClient = require("@atlaskit/teams-client");
16
15
  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; }
17
16
  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; }
@@ -45,8 +44,7 @@ var actions = exports.actions = {
45
44
  _getState = getState(), teams = _getState.teams;
46
45
  currentTeamState = teams[teamId];
47
46
  currentLinks = (currentTeamState === null || currentTeamState === void 0 ? void 0 : currentTeamState.links) || []; // Only skip if already loaded and not currently loading (prevents duplicate fetches)
48
- // Feature flag check: if enabled, also skip if hasLoaded and has links
49
- if (!(currentTeamState !== null && currentTeamState !== void 0 && currentTeamState.hasLoaded && !currentTeamState.isLoading && (!(0, _platformFeatureFlags.fg)('prevent_parallel_team_web_links_fetch') || currentLinks.length > 0))) {
47
+ if (!(currentTeamState !== null && currentTeamState !== void 0 && currentTeamState.hasLoaded && !currentTeamState.isLoading && currentLinks.length > 0)) {
50
48
  _context.next = 6;
51
49
  break;
52
50
  }
@@ -15,10 +15,10 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
15
15
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
16
16
  var _react = _interopRequireWildcard(require("react"));
17
17
  var _reactIntlNext = require("react-intl-next");
18
+ var _atlassianContext = require("@atlaskit/atlassian-context");
18
19
  var _new = require("@atlaskit/button/new");
19
20
  var _css = require("@atlaskit/css");
20
21
  var _dropdownMenu = _interopRequireWildcard(require("@atlaskit/dropdown-menu"));
21
- var _featureGateJsClient = _interopRequireDefault(require("@atlaskit/feature-gate-js-client"));
22
22
  var _cross = _interopRequireDefault(require("@atlaskit/icon/core/cross"));
23
23
  var _linkExternal = _interopRequireDefault(require("@atlaskit/icon/core/link-external"));
24
24
  var _showMoreHorizontal = _interopRequireDefault(require("@atlaskit/icon/core/show-more-horizontal"));
@@ -104,7 +104,7 @@ var TeamLinkCard = exports.TeamLinkCard = function TeamLinkCard(_ref) {
104
104
  formatMessage = _useIntl.formatMessage;
105
105
  var _useAnalyticsEvents = (0, _teamsAppInternalAnalytics.useAnalyticsEvents)(),
106
106
  fireEvent = _useAnalyticsEvents.fireEvent;
107
- var isNewTeamProfilePageEnabled = _featureGateJsClient.default.getExperimentValue('new_team_profile', 'isEnabled', false);
107
+ var isNewTeamProfilePageEnabled = !(0, _atlassianContext.isFedRamp)() || (0, _platformFeatureFlags.fg)('new_team_profile_fedramp');
108
108
  var isOpenWebLinkInNewTabEnabled = containerType === 'WebLink' && isNewTeamProfilePageEnabled;
109
109
  var handleMouseEnter = function handleMouseEnter() {
110
110
  if (isReadOnly) {
@@ -2,12 +2,13 @@
2
2
  import "./index.compiled.css";
3
3
  import { ax, ix } from "@compiled/react/runtime";
4
4
  import React from 'react';
5
+ import { isFedRamp } from '@atlaskit/atlassian-context';
5
6
  import Avatar from '@atlaskit/avatar';
6
7
  import { IconButton } from '@atlaskit/button/new';
7
8
  import { cx } from '@atlaskit/css';
8
- 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
+ import { fg } from '@atlaskit/platform-feature-flags';
11
12
  import { Box } from '@atlaskit/primitives/compiled';
12
13
  import { LoomSpaceAvatar } from '../loom-avatar';
13
14
  const styles = {
@@ -34,7 +35,7 @@ export const ContainerIcon = ({
34
35
  iconHasLoaded = true
35
36
  }) => {
36
37
  const isMedium = size === 'medium';
37
- const isNewTeamProfilePageEnabled = FeatureGates.getExperimentValue('new_team_profile', 'isEnabled', false);
38
+ const isNewTeamProfilePageEnabled = !isFedRamp() || fg('new_team_profile_fedramp');
38
39
  if (containerType === 'LoomSpace') {
39
40
  return /*#__PURE__*/React.createElement(LoomSpaceAvatar, {
40
41
  spaceName: title,
@@ -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)) {
@@ -27,7 +27,7 @@ export const actions = {
27
27
  hasLoaded,
28
28
  isLoading
29
29
  } = getState();
30
- if ((isLoading || teamId === currentTeamId && hasLoaded && links.length > 0) && fg('prevent_parallel_team_web_links_fetch')) {
30
+ if (isLoading || teamId === currentTeamId && hasLoaded && links.length > 0) {
31
31
  return;
32
32
  }
33
33
  const initialLinks = teamId === currentTeamId ? links : [];
@@ -1,5 +1,4 @@
1
1
  import { createHook, createStore } from 'react-sweet-state';
2
- import { fg } from '@atlaskit/platform-feature-flags';
3
2
  import { teamsClient } from '@atlaskit/teams-client';
4
3
  const getInitialTeamState = () => ({
5
4
  isLoading: false,
@@ -30,8 +29,7 @@ export const actions = {
30
29
  const currentLinks = (currentTeamState === null || currentTeamState === void 0 ? void 0 : currentTeamState.links) || [];
31
30
 
32
31
  // Only skip if already loaded and not currently loading (prevents duplicate fetches)
33
- // Feature flag check: if enabled, also skip if hasLoaded and has links
34
- if (currentTeamState !== null && currentTeamState !== void 0 && currentTeamState.hasLoaded && !currentTeamState.isLoading && (!fg('prevent_parallel_team_web_links_fetch') || currentLinks.length > 0)) {
32
+ if (currentTeamState !== null && currentTeamState !== void 0 && currentTeamState.hasLoaded && !currentTeamState.isLoading && currentLinks.length > 0) {
35
33
  return;
36
34
  }
37
35
  // Skip if currently loading to prevent concurrent fetches
@@ -4,10 +4,10 @@ import "./index.compiled.css";
4
4
  import { ax, ix } from "@compiled/react/runtime";
5
5
  import React, { useState } from 'react';
6
6
  import { defineMessages, useIntl } from 'react-intl-next';
7
+ import { isFedRamp } from '@atlaskit/atlassian-context';
7
8
  import { IconButton } from '@atlaskit/button/new';
8
9
  import { cx } from '@atlaskit/css';
9
10
  import DropdownMenu, { DropdownItem, DropdownItemGroup } from '@atlaskit/dropdown-menu';
10
- import FeatureGates from '@atlaskit/feature-gate-js-client';
11
11
  import CrossIcon from '@atlaskit/icon/core/cross';
12
12
  import LinkExternalIcon from '@atlaskit/icon/core/link-external';
13
13
  import ShowMoreHorizontalIcon from '@atlaskit/icon/core/show-more-horizontal';
@@ -78,7 +78,7 @@ export const TeamLinkCard = ({
78
78
  const {
79
79
  fireEvent
80
80
  } = useAnalyticsEvents();
81
- const isNewTeamProfilePageEnabled = FeatureGates.getExperimentValue('new_team_profile', 'isEnabled', false);
81
+ const isNewTeamProfilePageEnabled = !isFedRamp() || fg('new_team_profile_fedramp');
82
82
  const isOpenWebLinkInNewTabEnabled = containerType === 'WebLink' && isNewTeamProfilePageEnabled;
83
83
  const handleMouseEnter = () => {
84
84
  if (isReadOnly) {
@@ -2,12 +2,13 @@
2
2
  import "./index.compiled.css";
3
3
  import { ax, ix } from "@compiled/react/runtime";
4
4
  import React from 'react';
5
+ import { isFedRamp } from '@atlaskit/atlassian-context';
5
6
  import Avatar from '@atlaskit/avatar';
6
7
  import { IconButton } from '@atlaskit/button/new';
7
8
  import { cx } from '@atlaskit/css';
8
- 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
+ import { fg } from '@atlaskit/platform-feature-flags';
11
12
  import { Box } from '@atlaskit/primitives/compiled';
12
13
  import { LoomSpaceAvatar } from '../loom-avatar';
13
14
  var styles = {
@@ -35,7 +36,7 @@ export var ContainerIcon = function ContainerIcon(_ref2) {
35
36
  _ref2$iconHasLoaded = _ref2.iconHasLoaded,
36
37
  iconHasLoaded = _ref2$iconHasLoaded === void 0 ? true : _ref2$iconHasLoaded;
37
38
  var isMedium = size === 'medium';
38
- var isNewTeamProfilePageEnabled = FeatureGates.getExperimentValue('new_team_profile', 'isEnabled', false);
39
+ var isNewTeamProfilePageEnabled = !isFedRamp() || fg('new_team_profile_fedramp');
39
40
  if (containerType === 'LoomSpace') {
40
41
  return /*#__PURE__*/React.createElement(LoomSpaceAvatar, {
41
42
  spaceName: title,
@@ -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) {
@@ -31,7 +31,7 @@ export var actions = {
31
31
  case 0:
32
32
  getState = _ref.getState, setState = _ref.setState, dispatch = _ref.dispatch;
33
33
  _getState = getState(), links = _getState.links, currentTeamId = _getState.teamId, hasLoaded = _getState.hasLoaded, isLoading = _getState.isLoading;
34
- if (!((isLoading || teamId === currentTeamId && hasLoaded && links.length > 0) && fg('prevent_parallel_team_web_links_fetch'))) {
34
+ if (!(isLoading || teamId === currentTeamId && hasLoaded && links.length > 0)) {
35
35
  _context.next = 4;
36
36
  break;
37
37
  }
@@ -6,7 +6,6 @@ import _regeneratorRuntime from "@babel/runtime/regenerator";
6
6
  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; }
7
7
  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; }
8
8
  import { createHook, createStore } from 'react-sweet-state';
9
- import { fg } from '@atlaskit/platform-feature-flags';
10
9
  import { teamsClient } from '@atlaskit/teams-client';
11
10
  var getInitialTeamState = function getInitialTeamState() {
12
11
  return {
@@ -38,8 +37,7 @@ export var actions = {
38
37
  _getState = getState(), teams = _getState.teams;
39
38
  currentTeamState = teams[teamId];
40
39
  currentLinks = (currentTeamState === null || currentTeamState === void 0 ? void 0 : currentTeamState.links) || []; // Only skip if already loaded and not currently loading (prevents duplicate fetches)
41
- // Feature flag check: if enabled, also skip if hasLoaded and has links
42
- if (!(currentTeamState !== null && currentTeamState !== void 0 && currentTeamState.hasLoaded && !currentTeamState.isLoading && (!fg('prevent_parallel_team_web_links_fetch') || currentLinks.length > 0))) {
40
+ if (!(currentTeamState !== null && currentTeamState !== void 0 && currentTeamState.hasLoaded && !currentTeamState.isLoading && currentLinks.length > 0)) {
43
41
  _context.next = 6;
44
42
  break;
45
43
  }
@@ -10,10 +10,10 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
10
10
  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; }
11
11
  import React, { useState } from 'react';
12
12
  import { defineMessages, useIntl } from 'react-intl-next';
13
+ import { isFedRamp } from '@atlaskit/atlassian-context';
13
14
  import { IconButton } from '@atlaskit/button/new';
14
15
  import { cx } from '@atlaskit/css';
15
16
  import DropdownMenu, { DropdownItem, DropdownItemGroup } from '@atlaskit/dropdown-menu';
16
- import FeatureGates from '@atlaskit/feature-gate-js-client';
17
17
  import CrossIcon from '@atlaskit/icon/core/cross';
18
18
  import LinkExternalIcon from '@atlaskit/icon/core/link-external';
19
19
  import ShowMoreHorizontalIcon from '@atlaskit/icon/core/show-more-horizontal';
@@ -95,7 +95,7 @@ export var TeamLinkCard = function TeamLinkCard(_ref) {
95
95
  formatMessage = _useIntl.formatMessage;
96
96
  var _useAnalyticsEvents = useAnalyticsEvents(),
97
97
  fireEvent = _useAnalyticsEvents.fireEvent;
98
- var isNewTeamProfilePageEnabled = FeatureGates.getExperimentValue('new_team_profile', 'isEnabled', false);
98
+ var isNewTeamProfilePageEnabled = !isFedRamp() || fg('new_team_profile_fedramp');
99
99
  var isOpenWebLinkInNewTabEnabled = containerType === 'WebLink' && isNewTeamProfilePageEnabled;
100
100
  var handleMouseEnter = function handleMouseEnter() {
101
101
  if (isReadOnly) {
package/package.json CHANGED
@@ -26,6 +26,7 @@
26
26
  "dependencies": {
27
27
  "@atlaskit/afm-i18n-platform-people-and-teams-teams-public": "2.7.0",
28
28
  "@atlaskit/analytics-next": "^11.1.0",
29
+ "@atlaskit/atlassian-context": "^0.6.0",
29
30
  "@atlaskit/avatar": "^25.7.0",
30
31
  "@atlaskit/button": "^23.9.0",
31
32
  "@atlaskit/css": "^0.19.0",
@@ -33,7 +34,7 @@
33
34
  "@atlaskit/feature-gate-js-client": "^5.5.0",
34
35
  "@atlaskit/flag": "^17.8.0",
35
36
  "@atlaskit/frontend-utilities": "^3.2.0",
36
- "@atlaskit/heading": "^5.2.0",
37
+ "@atlaskit/heading": "^5.3.0",
37
38
  "@atlaskit/icon": "^30.0.0",
38
39
  "@atlaskit/image": "^3.0.0",
39
40
  "@atlaskit/link": "^3.3.0",
@@ -42,7 +43,7 @@
42
43
  "@atlaskit/platform-feature-flags": "^1.1.0",
43
44
  "@atlaskit/primitives": "^18.0.0",
44
45
  "@atlaskit/skeleton": "^2.1.0",
45
- "@atlaskit/teams-app-internal-analytics": "^1.23.0",
46
+ "@atlaskit/teams-app-internal-analytics": "^1.24.0",
46
47
  "@atlaskit/teams-app-internal-product-permissions": "^1.2.0",
47
48
  "@atlaskit/teams-client": "^4.30.0",
48
49
  "@atlaskit/theme": "^21.0.0",
@@ -109,7 +110,7 @@
109
110
  }
110
111
  },
111
112
  "name": "@atlaskit/teams-public",
112
- "version": "0.68.1",
113
+ "version": "0.69.1",
113
114
  "description": "Public components related to teams",
114
115
  "author": "Atlassian Pty Ltd",
115
116
  "license": "Apache-2.0",
@@ -130,9 +131,6 @@
130
131
  "migrate-product-permissions": {
131
132
  "type": "boolean"
132
133
  },
133
- "prevent_parallel_team_web_links_fetch": {
134
- "type": "boolean"
135
- },
136
134
  "enable_multi_team_containers_state": {
137
135
  "type": "boolean"
138
136
  },
@@ -141,6 +139,12 @@
141
139
  },
142
140
  "ptc-fix-containers-after-icon-size": {
143
141
  "type": "boolean"
142
+ },
143
+ "ptc-missed-analytics-migration-events": {
144
+ "type": "boolean"
145
+ },
146
+ "new_team_profile_fedramp": {
147
+ "type": "boolean"
144
148
  }
145
149
  }
146
150
  }