@atlaskit/teams-public 0.60.1 → 0.60.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +9 -0
- package/dist/cjs/common/ui/container-icon/index.compiled.css +1 -0
- package/dist/cjs/common/ui/container-icon/index.js +1 -1
- package/dist/cjs/common/ui/loom-avatar/main.compiled.css +7 -3
- package/dist/cjs/common/ui/loom-avatar/main.js +1 -1
- package/dist/cjs/common/utils/get-container-properties.js +4 -4
- package/dist/cjs/controllers/hooks/use-requested-container/index.js +81 -43
- package/dist/cjs/controllers/hooks/use-requested-container/utils.js +1 -10
- package/dist/cjs/ui/team-containers/main.js +8 -11
- package/dist/es2019/common/ui/container-icon/index.compiled.css +1 -0
- package/dist/es2019/common/ui/container-icon/index.js +1 -1
- package/dist/es2019/common/ui/loom-avatar/main.compiled.css +7 -3
- package/dist/es2019/common/ui/loom-avatar/main.js +1 -1
- package/dist/es2019/common/utils/get-container-properties.js +4 -4
- package/dist/es2019/controllers/hooks/use-requested-container/index.js +63 -22
- package/dist/es2019/controllers/hooks/use-requested-container/utils.js +2 -10
- package/dist/es2019/ui/team-containers/main.js +8 -9
- package/dist/esm/common/ui/container-icon/index.compiled.css +1 -0
- package/dist/esm/common/ui/container-icon/index.js +1 -1
- package/dist/esm/common/ui/loom-avatar/main.compiled.css +7 -3
- package/dist/esm/common/ui/loom-avatar/main.js +1 -1
- package/dist/esm/common/utils/get-container-properties.js +4 -4
- package/dist/esm/controllers/hooks/use-requested-container/index.js +82 -44
- package/dist/esm/controllers/hooks/use-requested-container/utils.js +2 -10
- package/dist/esm/ui/team-containers/main.js +8 -11
- package/dist/types/controllers/hooks/use-requested-container/index.d.ts +2 -1
- package/dist/types/controllers/hooks/use-requested-container/utils.d.ts +1 -2
- package/dist/types-ts4.5/controllers/hooks/use-requested-container/index.d.ts +2 -1
- package/dist/types-ts4.5/controllers/hooks/use-requested-container/utils.d.ts +1 -2
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# @atlaskit/teams-public
|
|
2
2
|
|
|
3
|
+
## 0.60.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`5a90d813d811b`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/5a90d813d811b) -
|
|
8
|
+
Update onCreateTeam to pass requested teams
|
|
9
|
+
- [`5a90d813d811b`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/5a90d813d811b) -
|
|
10
|
+
Tweak requested containers logic to work with changes to UC experiment
|
|
11
|
+
|
|
3
12
|
## 0.60.1
|
|
4
13
|
|
|
5
14
|
### Patch Changes
|
|
@@ -15,7 +15,7 @@ var _compiled = require("@atlaskit/primitives/compiled");
|
|
|
15
15
|
var _loomAvatar = require("../loom-avatar");
|
|
16
16
|
var styles = {
|
|
17
17
|
globeIconWrapperMedium: "_2rko1mok _1bsb1u1b _4t3i1u1b _1e0c1txw _4cvr1h6o _1bah1h6o _12jimuej _1qu2nqa1 _bfhkqbzx",
|
|
18
|
-
globeIconWrapperSmall: "_2rkolb4i
|
|
18
|
+
globeIconWrapperSmall: "_2rkolb4i _1ul91tcg _4t3i1tcg _1e0c1txw _4cvr1h6o _1bah1h6o _19pkv77o _2hwxv77o _otyrv77o _18u0v77o _12jimuej _1qu2nqa1 _bfhkqbzx",
|
|
19
19
|
skeletonMedium: "_2rko1mok _bfhkn82g _1bsb1u1b _4t3i1u1b",
|
|
20
20
|
skeletonSmall: "_2rkolb4i _bfhkn82g _1bsb1tcg _4t3i1tcg"
|
|
21
21
|
};
|
|
@@ -4,10 +4,14 @@
|
|
|
4
4
|
._189ee4h9{border-width:var(--ds-border-width,1px)}
|
|
5
5
|
._1dqonqa1{border-style:solid}
|
|
6
6
|
._1h6dmuej{border-color:var(--ds-border,#091e4224)}
|
|
7
|
+
._18u0v77o{margin-left:var(--ds-space-025,2px)}
|
|
8
|
+
._19pkv77o{margin-top:var(--ds-space-025,2px)}
|
|
7
9
|
._1bah1h6o{justify-content:center}
|
|
8
|
-
._1bsb1tcg{width:24px}
|
|
9
10
|
._1bsbzwfg{width:2pc}
|
|
10
11
|
._1e0c1txw{display:flex}
|
|
12
|
+
._1ul9qslr{min-width:22px}
|
|
13
|
+
._2hwxv77o{margin-right:var(--ds-space-025,2px)}
|
|
11
14
|
._4cvr1h6o{align-items:center}
|
|
12
|
-
.
|
|
13
|
-
._4t3izwfg{height:2pc}
|
|
15
|
+
._4t3iqslr{height:22px}
|
|
16
|
+
._4t3izwfg{height:2pc}
|
|
17
|
+
._otyrv77o{margin-bottom:var(--ds-space-025,2px)}
|
|
@@ -30,6 +30,6 @@ function LoomSpaceAvatar(_ref) {
|
|
|
30
30
|
color: textColor
|
|
31
31
|
},
|
|
32
32
|
"data-testid": testId,
|
|
33
|
-
className: (0, _runtime.ax)(["_2rko12b0 _189ee4h9 _1dqonqa1 _1h6dmuej _1e0c1txw _4cvr1h6o _1bah1h6o", size === 'small' ? "_11c8140y
|
|
33
|
+
className: (0, _runtime.ax)(["_2rko12b0 _189ee4h9 _1dqonqa1 _1h6dmuej _1e0c1txw _4cvr1h6o _1bah1h6o", size === 'small' ? "_11c8140y _4t3iqslr _1ul9qslr _19pkv77o _2hwxv77o _otyrv77o _18u0v77o" : "_11c8lodh _4t3izwfg _1bsbzwfg"])
|
|
34
34
|
}, avatarText);
|
|
35
35
|
}
|
|
@@ -11,10 +11,10 @@ var _runtime = require("@compiled/react/runtime");
|
|
|
11
11
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
12
12
|
var _react = _interopRequireDefault(require("react"));
|
|
13
13
|
var _reactIntlNext = require("react-intl-next");
|
|
14
|
+
var _featureGateJsClient = _interopRequireDefault(require("@atlaskit/feature-gate-js-client"));
|
|
14
15
|
var _link = _interopRequireDefault(require("@atlaskit/icon/core/link"));
|
|
15
16
|
var _linkExternal = _interopRequireDefault(require("@atlaskit/icon/core/link-external"));
|
|
16
17
|
var _image = _interopRequireDefault(require("@atlaskit/image"));
|
|
17
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
18
18
|
var _compiled = require("@atlaskit/primitives/compiled");
|
|
19
19
|
var _ConfluenceIcon = _interopRequireDefault(require("../assets/ConfluenceIcon.svg"));
|
|
20
20
|
var _JiraIcon = _interopRequireDefault(require("../assets/JiraIcon.svg"));
|
|
@@ -126,7 +126,7 @@ var getJiraContainerProperties = function getJiraContainerProperties(_ref) {
|
|
|
126
126
|
var containerTypeProperties = _ref.containerTypeProperties,
|
|
127
127
|
_ref$iconSize = _ref.iconSize,
|
|
128
128
|
iconSize = _ref$iconSize === void 0 ? 'small' : _ref$iconSize;
|
|
129
|
-
var newTeamProfilePage = (
|
|
129
|
+
var newTeamProfilePage = _featureGateJsClient.default.getExperimentValue('new_team_profile', 'isEnabled', false);
|
|
130
130
|
var _ref2 = containerTypeProperties || {},
|
|
131
131
|
subType = _ref2.subType,
|
|
132
132
|
name = _ref2.name;
|
|
@@ -162,7 +162,7 @@ var getJiraContainerProperties = function getJiraContainerProperties(_ref) {
|
|
|
162
162
|
var getWebLinkContainerProperties = function getWebLinkContainerProperties(_ref3) {
|
|
163
163
|
var isEmptyContainer = _ref3.isEmptyContainer,
|
|
164
164
|
isDisplayedOnProfileCard = _ref3.isDisplayedOnProfileCard;
|
|
165
|
-
var newTeamProfilePage = (
|
|
165
|
+
var newTeamProfilePage = _featureGateJsClient.default.getExperimentValue('new_team_profile', 'isEnabled', false);
|
|
166
166
|
return {
|
|
167
167
|
description: isEmptyContainer ? /*#__PURE__*/_react.default.createElement(_compiled.Text, {
|
|
168
168
|
size: "medium",
|
|
@@ -196,7 +196,7 @@ var getContainerProperties = exports.getContainerProperties = function getContai
|
|
|
196
196
|
containerTypeProperties = _ref4.containerTypeProperties,
|
|
197
197
|
isEmptyContainer = _ref4.isEmptyContainer,
|
|
198
198
|
isDisplayedOnProfileCard = _ref4.isDisplayedOnProfileCard;
|
|
199
|
-
var newTeamProfilePage = (
|
|
199
|
+
var newTeamProfilePage = _featureGateJsClient.default.getExperimentValue('new_team_profile', 'isEnabled', false);
|
|
200
200
|
switch (containerType) {
|
|
201
201
|
case 'ConfluenceSpace':
|
|
202
202
|
return {
|
|
@@ -11,9 +11,11 @@ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/
|
|
|
11
11
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
12
12
|
var _react = _interopRequireWildcard(require("react"));
|
|
13
13
|
var _reactIntlNext = require("react-intl-next");
|
|
14
|
+
var _analyticsNext = require("@atlaskit/analytics-next");
|
|
14
15
|
var _linkExternal = _interopRequireDefault(require("@atlaskit/icon/core/link-external"));
|
|
15
16
|
var _compiled = require("@atlaskit/primitives/compiled");
|
|
16
17
|
var _teamsClient = require("@atlaskit/teams-client");
|
|
18
|
+
var _analytics = require("../../../common/utils/analytics");
|
|
17
19
|
var _useTeamContainers2 = require("../use-team-containers");
|
|
18
20
|
var _utils = require("./utils");
|
|
19
21
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
@@ -47,12 +49,15 @@ function useRequestedContainers(_ref) {
|
|
|
47
49
|
_useState4 = (0, _slicedToArray2.default)(_useState3, 2),
|
|
48
50
|
refetchErrorCount = _useState4[0],
|
|
49
51
|
setRefetchErrorCount = _useState4[1];
|
|
50
|
-
var
|
|
51
|
-
|
|
52
|
-
|
|
52
|
+
var _usePeopleAndTeamAnal = (0, _analytics.usePeopleAndTeamAnalytics)(),
|
|
53
|
+
fireTrackEvent = _usePeopleAndTeamAnal.fireTrackEvent;
|
|
54
|
+
var _useAnalyticsEvents = (0, _analyticsNext.useAnalyticsEvents)(),
|
|
55
|
+
createAnalyticsEvent = _useAnalyticsEvents.createAnalyticsEvent;
|
|
56
|
+
var _useState5 = (0, _react.useState)([]),
|
|
53
57
|
_useState6 = (0, _slicedToArray2.default)(_useState5, 2),
|
|
54
58
|
requestedContainers = _useState6[0],
|
|
55
59
|
setRequestedContainers = _useState6[1];
|
|
60
|
+
var requestedContainersRef = (0, _react.useRef)([]);
|
|
56
61
|
var checkContainers = (0, _react.useCallback)( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
57
62
|
return _regenerator.default.wrap(function _callee$(_context) {
|
|
58
63
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -81,15 +86,18 @@ function useRequestedContainers(_ref) {
|
|
|
81
86
|
if (!onRequestedContainerTimeout) {
|
|
82
87
|
return;
|
|
83
88
|
}
|
|
84
|
-
var
|
|
89
|
+
var reqContainers = requestedContainersRef.current;
|
|
90
|
+
var flagId = "requested-container-timeout-".concat(reqContainers.join('-'), "-").concat(tryAgainCountRef.current);
|
|
85
91
|
var createTryAgainFlag = function createTryAgainFlag(_ref4) {
|
|
86
92
|
var onAction = _ref4.onAction;
|
|
87
93
|
return {
|
|
88
94
|
id: flagId,
|
|
89
|
-
title:
|
|
90
|
-
container: (0, _utils.containerDisplayName)(
|
|
95
|
+
title: reqContainers.length === 1 ? formatMessage(messages.timeoutTitle, {
|
|
96
|
+
container: (0, _utils.containerDisplayName)(reqContainers[0])
|
|
91
97
|
}) : formatMessage(messages.timeoutTitleMultiple),
|
|
92
98
|
description: formatMessage(messages.timeoutDescription),
|
|
99
|
+
appearance: 'error',
|
|
100
|
+
type: 'error',
|
|
93
101
|
actions: [{
|
|
94
102
|
content: formatMessage(messages.timeoutAction),
|
|
95
103
|
onClick: function onClick() {
|
|
@@ -105,6 +113,8 @@ function useRequestedContainers(_ref) {
|
|
|
105
113
|
id: flagId,
|
|
106
114
|
title: formatMessage(messages.noConnectionTitle),
|
|
107
115
|
description: formatMessage(messages.noConnectionDescription),
|
|
116
|
+
appearance: 'error',
|
|
117
|
+
type: 'error',
|
|
108
118
|
actions: [{
|
|
109
119
|
content: /*#__PURE__*/_react.default.createElement(_compiled.Flex, {
|
|
110
120
|
alignItems: "center",
|
|
@@ -127,9 +137,7 @@ function useRequestedContainers(_ref) {
|
|
|
127
137
|
case 0:
|
|
128
138
|
setIsTryingAgain(true);
|
|
129
139
|
tryAgainCountRef.current = tryAgainCountRef.current + 1;
|
|
130
|
-
|
|
131
|
-
//todo: add analytics event here
|
|
132
|
-
containers = requestedContainers.map(function (container) {
|
|
140
|
+
containers = reqContainers.map(function (container) {
|
|
133
141
|
return {
|
|
134
142
|
type: (0, _utils.convertContainerToType)(container),
|
|
135
143
|
containerSiteId: cloudId
|
|
@@ -138,73 +146,92 @@ function useRequestedContainers(_ref) {
|
|
|
138
146
|
var type = _ref7.type;
|
|
139
147
|
return Boolean(type);
|
|
140
148
|
});
|
|
141
|
-
|
|
142
|
-
|
|
149
|
+
fireTrackEvent(createAnalyticsEvent, {
|
|
150
|
+
action: 'tryAgain',
|
|
151
|
+
actionSubject: 'requestedContainers',
|
|
152
|
+
// @ts-ignore
|
|
153
|
+
attributes: {
|
|
154
|
+
containers: reqContainers,
|
|
155
|
+
teamId: teamId
|
|
156
|
+
}
|
|
157
|
+
});
|
|
158
|
+
_context2.prev = 4;
|
|
159
|
+
_context2.next = 7;
|
|
143
160
|
return _teamsClient.teamsClient.createTeamContainers({
|
|
144
161
|
teamId: teamId,
|
|
145
162
|
containers: containers
|
|
146
163
|
});
|
|
147
|
-
case
|
|
164
|
+
case 7:
|
|
148
165
|
response = _context2.sent;
|
|
149
|
-
containersNotCreated =
|
|
166
|
+
containersNotCreated = reqContainers.filter(function (containerType) {
|
|
150
167
|
var _response$containersC;
|
|
151
168
|
return !((_response$containersC = response.containersCreated) !== null && _response$containersC !== void 0 && _response$containersC.some(function (container) {
|
|
152
169
|
return container.containerType === (0, _utils.convertContainerToType)(containerType);
|
|
153
170
|
}));
|
|
154
171
|
}); //containers are still being created
|
|
155
172
|
if (!(containersNotCreated.length > 0)) {
|
|
156
|
-
_context2.next =
|
|
173
|
+
_context2.next = 13;
|
|
157
174
|
break;
|
|
158
175
|
}
|
|
159
176
|
startPolling();
|
|
160
|
-
_context2.next =
|
|
177
|
+
_context2.next = 16;
|
|
161
178
|
break;
|
|
162
|
-
case
|
|
179
|
+
case 13:
|
|
163
180
|
//all containers created so reset and update state
|
|
164
181
|
reset();
|
|
165
|
-
_context2.next =
|
|
182
|
+
_context2.next = 16;
|
|
166
183
|
return refetchTeamContainers();
|
|
167
|
-
case
|
|
168
|
-
_context2.next =
|
|
184
|
+
case 16:
|
|
185
|
+
_context2.next = 25;
|
|
169
186
|
break;
|
|
170
|
-
case
|
|
171
|
-
_context2.prev =
|
|
172
|
-
_context2.t0 = _context2["catch"](
|
|
187
|
+
case 18:
|
|
188
|
+
_context2.prev = 18;
|
|
189
|
+
_context2.t0 = _context2["catch"](4);
|
|
173
190
|
if (!(_context2.t0 instanceof _teamsClient.HttpError)) {
|
|
174
|
-
_context2.next =
|
|
191
|
+
_context2.next = 24;
|
|
175
192
|
break;
|
|
176
193
|
}
|
|
177
194
|
if (!(_context2.t0.status === 500)) {
|
|
178
|
-
_context2.next =
|
|
195
|
+
_context2.next = 24;
|
|
179
196
|
break;
|
|
180
197
|
}
|
|
181
|
-
if (!(tryAgainCountRef.current
|
|
182
|
-
_context2.next =
|
|
198
|
+
if (!(tryAgainCountRef.current <= 2)) {
|
|
199
|
+
_context2.next = 24;
|
|
183
200
|
break;
|
|
184
201
|
}
|
|
185
202
|
return _context2.abrupt("return", setTimeout(function () {
|
|
186
203
|
//bug: this can cause two flags to be shown
|
|
187
204
|
_tryAgainAction();
|
|
188
205
|
}, _utils.POLLING_INTERVAL));
|
|
189
|
-
case 23:
|
|
190
|
-
onRequestedContainerTimeout(createContactSupportFlag);
|
|
191
206
|
case 24:
|
|
192
|
-
|
|
207
|
+
onRequestedContainerTimeout(createContactSupportFlag);
|
|
208
|
+
case 25:
|
|
209
|
+
_context2.prev = 25;
|
|
193
210
|
setIsTryingAgain(false);
|
|
194
|
-
return _context2.finish(
|
|
195
|
-
case
|
|
211
|
+
return _context2.finish(25);
|
|
212
|
+
case 28:
|
|
196
213
|
case "end":
|
|
197
214
|
return _context2.stop();
|
|
198
215
|
}
|
|
199
|
-
}, _callee2, null, [[
|
|
216
|
+
}, _callee2, null, [[4, 18, 25, 28]]);
|
|
200
217
|
}));
|
|
201
218
|
return function tryAgainAction() {
|
|
202
219
|
return _ref6.apply(this, arguments);
|
|
203
220
|
};
|
|
204
221
|
}();
|
|
222
|
+
fireTrackEvent(createAnalyticsEvent, {
|
|
223
|
+
action: 'failed',
|
|
224
|
+
actionSubject: 'requestedContainers',
|
|
225
|
+
attributes: {
|
|
226
|
+
// @ts-ignore
|
|
227
|
+
containers: reqContainers,
|
|
228
|
+
teamId: teamId,
|
|
229
|
+
tryAgainCount: tryAgainCountRef.current
|
|
230
|
+
}
|
|
231
|
+
});
|
|
205
232
|
(0, _utils.removeRequestedContainersFromUrl)();
|
|
206
233
|
onRequestedContainerTimeout(tryAgainCountRef.current === 0 ? createTryAgainFlag : createContactSupportFlag);
|
|
207
|
-
}, [cloudId, formatMessage, onRequestedContainerTimeout, refetchTeamContainers,
|
|
234
|
+
}, [cloudId, formatMessage, onRequestedContainerTimeout, refetchTeamContainers, teamId, createAnalyticsEvent, fireTrackEvent]);
|
|
208
235
|
var _useAsyncPolling = (0, _utils.useAsyncPolling)(checkContainers, {
|
|
209
236
|
onTimeout: onTimeout
|
|
210
237
|
}),
|
|
@@ -213,14 +240,29 @@ function useRequestedContainers(_ref) {
|
|
|
213
240
|
isPolling = _useAsyncPolling.isPolling,
|
|
214
241
|
hasTimedOut = _useAsyncPolling.hasTimedOut;
|
|
215
242
|
(0, _react.useEffect)(function () {
|
|
216
|
-
|
|
217
|
-
|
|
243
|
+
var containers = (0, _utils.getRequestedContainersFromUrl)();
|
|
244
|
+
if (containers.length > 0 && isPolling === false) {
|
|
245
|
+
setRequestedContainers(containers);
|
|
246
|
+
startPolling();
|
|
218
247
|
}
|
|
219
|
-
|
|
248
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
249
|
+
}, []);
|
|
250
|
+
(0, _react.useEffect)(function () {
|
|
251
|
+
requestedContainersRef.current = requestedContainers;
|
|
252
|
+
}, [requestedContainers]);
|
|
253
|
+
(0, _react.useEffect)(function () {
|
|
220
254
|
//stop gap to prevent sending too many failed errors
|
|
221
255
|
if (refetchErrorCount > 3) {
|
|
222
256
|
stopPolling();
|
|
223
|
-
|
|
257
|
+
fireTrackEvent(createAnalyticsEvent, {
|
|
258
|
+
action: 'failed',
|
|
259
|
+
actionSubject: 'requestedContainers',
|
|
260
|
+
attributes: {
|
|
261
|
+
// @ts-ignore
|
|
262
|
+
containers: requestedContainers,
|
|
263
|
+
teamId: teamId
|
|
264
|
+
}
|
|
265
|
+
});
|
|
224
266
|
return;
|
|
225
267
|
}
|
|
226
268
|
if (hasTimedOut || isTryingAgain) {
|
|
@@ -232,11 +274,7 @@ function useRequestedContainers(_ref) {
|
|
|
232
274
|
stopPolling();
|
|
233
275
|
return;
|
|
234
276
|
}
|
|
235
|
-
|
|
236
|
-
setIsTryingAgain(false);
|
|
237
|
-
startPolling();
|
|
238
|
-
}
|
|
239
|
-
}, [isPolling, refetchErrorCount, requestedContainers.length, hasTimedOut, startPolling, stopPolling, isTryingAgain]);
|
|
277
|
+
}, [isPolling, refetchErrorCount, requestedContainers, hasTimedOut, startPolling, stopPolling, isTryingAgain, teamId, createAnalyticsEvent, fireTrackEvent]);
|
|
240
278
|
(0, _react.useEffect)(function () {
|
|
241
279
|
var containersNotFound = requestedContainers.filter(function (containerType) {
|
|
242
280
|
return !teamContainers.some(function (teamContainer) {
|
|
@@ -246,7 +284,7 @@ function useRequestedContainers(_ref) {
|
|
|
246
284
|
if (!(0, _utils.containersEqual)(containersNotFound, requestedContainers)) {
|
|
247
285
|
setRequestedContainers(containersNotFound);
|
|
248
286
|
}
|
|
249
|
-
}, [requestedContainers, checkContainers, teamContainers]);
|
|
287
|
+
}, [requestedContainers, checkContainers, teamContainers, isPolling]);
|
|
250
288
|
var containersLoading = (0, _react.useMemo)(function () {
|
|
251
289
|
return hasTimedOut && !isTryingAgain || refetchErrorCount > 3 ? [] : requestedContainers;
|
|
252
290
|
}, [hasTimedOut, requestedContainers, isTryingAgain, refetchErrorCount]);
|
|
@@ -11,14 +11,12 @@ exports.convertContainerToType = convertContainerToType;
|
|
|
11
11
|
exports.getRequestedContainersFromUrl = getRequestedContainersFromUrl;
|
|
12
12
|
exports.removeRequestedContainersFromUrl = removeRequestedContainersFromUrl;
|
|
13
13
|
exports.useAsyncPolling = useAsyncPolling;
|
|
14
|
-
exports.userCanAccessFeature = userCanAccessFeature;
|
|
15
14
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
16
15
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
17
16
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
18
17
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
19
18
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
20
19
|
var _react = require("react");
|
|
21
|
-
var _featureGateJsClient = _interopRequireDefault(require("@atlaskit/feature-gate-js-client"));
|
|
22
20
|
var _frontendUtilities = require("@atlaskit/frontend-utilities");
|
|
23
21
|
var _types = require("@atlaskit/teams-client/types");
|
|
24
22
|
var CONTAINER_MAP = exports.CONTAINER_MAP = (0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)({}, _types.ContainerType.CONFLUENCE_SPACE, 'ConfluenceSpace'), _types.ContainerType.JIRA_PROJECT, 'JiraProject'), _types.ContainerType.LOOM_SPACE, 'LoomSpace');
|
|
@@ -43,7 +41,7 @@ function getRequestedContainersFromUrl() {
|
|
|
43
41
|
if (containers.length === 0) {
|
|
44
42
|
return [];
|
|
45
43
|
}
|
|
46
|
-
return
|
|
44
|
+
return containers || [];
|
|
47
45
|
}
|
|
48
46
|
function removeRequestedContainersFromUrl() {
|
|
49
47
|
var searchParams = new URLSearchParams(window.location.search);
|
|
@@ -65,13 +63,6 @@ function convertContainerToType(container) {
|
|
|
65
63
|
return null;
|
|
66
64
|
}
|
|
67
65
|
}
|
|
68
|
-
function userCanAccessFeature() {
|
|
69
|
-
if (_featureGateJsClient.default.initializeCalled()) {
|
|
70
|
-
var value = _featureGateJsClient.default.getExperimentValue('teams_app_auto_container_creation', 'cohort', 'control');
|
|
71
|
-
return value === 'universal_create' || value === 'profile_page';
|
|
72
|
-
}
|
|
73
|
-
return false;
|
|
74
|
-
}
|
|
75
66
|
var POLLING_INTERVAL = exports.POLLING_INTERVAL = 1000;
|
|
76
67
|
var POLLING_DURATION = exports.POLLING_DURATION = 15000;
|
|
77
68
|
|
|
@@ -144,12 +144,12 @@ var TeamContainers = exports.TeamContainers = function TeamContainers(_ref) {
|
|
|
144
144
|
(0, _react.useEffect)(function () {
|
|
145
145
|
if (isDisplayedOnProfileCard && filterContainerId) {
|
|
146
146
|
setFilteredTeamLinks(teamLinks.filter(function (container) {
|
|
147
|
-
return container.id !== filterContainerId
|
|
147
|
+
return container.id !== filterContainerId;
|
|
148
148
|
}));
|
|
149
149
|
} else {
|
|
150
150
|
setFilteredTeamLinks(teamLinks);
|
|
151
151
|
}
|
|
152
|
-
}, [teamLinks, isDisplayedOnProfileCard, filterContainerId
|
|
152
|
+
}, [teamLinks, isDisplayedOnProfileCard, filterContainerId]);
|
|
153
153
|
(0, _react.useEffect)(function () {
|
|
154
154
|
var containersToCheck = filteredTeamLinks;
|
|
155
155
|
if (containersToCheck.length > maxNumberOfContainersToShow || isDisplayedOnProfileCard || isReadOnly) {
|
|
@@ -165,11 +165,8 @@ var TeamContainers = exports.TeamContainers = function TeamContainers(_ref) {
|
|
|
165
165
|
return container.type === type;
|
|
166
166
|
});
|
|
167
167
|
};
|
|
168
|
-
var
|
|
169
|
-
|
|
170
|
-
};
|
|
171
|
-
var showContainer = function showContainer(containerExists, isRequesting, product) {
|
|
172
|
-
if (containerExists || isRequesting) {
|
|
168
|
+
var showContainer = function showContainer(containerExists, product) {
|
|
169
|
+
if (containerExists) {
|
|
173
170
|
return false;
|
|
174
171
|
}
|
|
175
172
|
if ((0, _platformFeatureFlags.fg)('migrate-product-permissions')) {
|
|
@@ -178,13 +175,13 @@ var TeamContainers = exports.TeamContainers = function TeamContainers(_ref) {
|
|
|
178
175
|
return productPermissionsOld && (0, _controllers.hasProductPermission)(productPermissionsOld, product, []) || false;
|
|
179
176
|
};
|
|
180
177
|
setCanAddContainer({
|
|
181
|
-
Jira: showContainer(containerExists('JiraProject'),
|
|
182
|
-
Confluence: showContainer(containerExists('ConfluenceSpace'),
|
|
183
|
-
Loom: showContainer(containerExists('LoomSpace'),
|
|
178
|
+
Jira: showContainer(containerExists('JiraProject'), 'jira'),
|
|
179
|
+
Confluence: showContainer(containerExists('ConfluenceSpace'), 'confluence'),
|
|
180
|
+
Loom: showContainer(containerExists('LoomSpace'), 'loom'),
|
|
184
181
|
WebLink: !containerExists('WebLink')
|
|
185
182
|
});
|
|
186
183
|
}
|
|
187
|
-
}, [isDisplayedOnProfileCard, productPermissions, productPermissionsOld, filteredTeamLinks, maxNumberOfContainersToShow,
|
|
184
|
+
}, [isDisplayedOnProfileCard, productPermissions, productPermissionsOld, filteredTeamLinks, maxNumberOfContainersToShow, isReadOnly]);
|
|
188
185
|
(0, _react.useEffect)(function () {
|
|
189
186
|
if (onError) {
|
|
190
187
|
if (hasError) {
|
|
@@ -8,7 +8,7 @@ import { Box } from '@atlaskit/primitives/compiled';
|
|
|
8
8
|
import { LoomSpaceAvatar } from '../loom-avatar';
|
|
9
9
|
const styles = {
|
|
10
10
|
globeIconWrapperMedium: "_2rko1mok _1bsb1u1b _4t3i1u1b _1e0c1txw _4cvr1h6o _1bah1h6o _12jimuej _1qu2nqa1 _bfhkqbzx",
|
|
11
|
-
globeIconWrapperSmall: "_2rkolb4i
|
|
11
|
+
globeIconWrapperSmall: "_2rkolb4i _1ul91tcg _4t3i1tcg _1e0c1txw _4cvr1h6o _1bah1h6o _19pkv77o _2hwxv77o _otyrv77o _18u0v77o _12jimuej _1qu2nqa1 _bfhkqbzx",
|
|
12
12
|
skeletonMedium: "_2rko1mok _bfhkn82g _1bsb1u1b _4t3i1u1b",
|
|
13
13
|
skeletonSmall: "_2rkolb4i _bfhkn82g _1bsb1tcg _4t3i1tcg"
|
|
14
14
|
};
|
|
@@ -4,10 +4,14 @@
|
|
|
4
4
|
._189ee4h9{border-width:var(--ds-border-width,1px)}
|
|
5
5
|
._1dqonqa1{border-style:solid}
|
|
6
6
|
._1h6dmuej{border-color:var(--ds-border,#091e4224)}
|
|
7
|
+
._18u0v77o{margin-left:var(--ds-space-025,2px)}
|
|
8
|
+
._19pkv77o{margin-top:var(--ds-space-025,2px)}
|
|
7
9
|
._1bah1h6o{justify-content:center}
|
|
8
|
-
._1bsb1tcg{width:24px}
|
|
9
10
|
._1bsbzwfg{width:2pc}
|
|
10
11
|
._1e0c1txw{display:flex}
|
|
12
|
+
._1ul9qslr{min-width:22px}
|
|
13
|
+
._2hwxv77o{margin-right:var(--ds-space-025,2px)}
|
|
11
14
|
._4cvr1h6o{align-items:center}
|
|
12
|
-
.
|
|
13
|
-
._4t3izwfg{height:2pc}
|
|
15
|
+
._4t3iqslr{height:22px}
|
|
16
|
+
._4t3izwfg{height:2pc}
|
|
17
|
+
._otyrv77o{margin-bottom:var(--ds-space-025,2px)}
|
|
@@ -20,6 +20,6 @@ export function LoomSpaceAvatar({
|
|
|
20
20
|
color: textColor
|
|
21
21
|
},
|
|
22
22
|
"data-testid": testId,
|
|
23
|
-
className: ax(["_2rko12b0 _189ee4h9 _1dqonqa1 _1h6dmuej _1e0c1txw _4cvr1h6o _1bah1h6o", size === 'small' ? "_11c8140y
|
|
23
|
+
className: ax(["_2rko12b0 _189ee4h9 _1dqonqa1 _1h6dmuej _1e0c1txw _4cvr1h6o _1bah1h6o", size === 'small' ? "_11c8140y _4t3iqslr _1ul9qslr _19pkv77o _2hwxv77o _otyrv77o _18u0v77o" : "_11c8lodh _4t3izwfg _1bsbzwfg"])
|
|
24
24
|
}, avatarText);
|
|
25
25
|
}
|
|
@@ -3,10 +3,10 @@ import "./get-container-properties.compiled.css";
|
|
|
3
3
|
import { ax, ix } from "@compiled/react/runtime";
|
|
4
4
|
import React from 'react';
|
|
5
5
|
import { defineMessages, FormattedMessage } from 'react-intl-next';
|
|
6
|
+
import FeatureGates from '@atlaskit/feature-gate-js-client';
|
|
6
7
|
import LinkIcon from '@atlaskit/icon/core/link';
|
|
7
8
|
import LinkExternalIcon from '@atlaskit/icon/core/link-external';
|
|
8
9
|
import Image from '@atlaskit/image';
|
|
9
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
10
10
|
import { Box, Flex, Text } from '@atlaskit/primitives/compiled';
|
|
11
11
|
import ConfluenceIcon from '../assets/ConfluenceIcon.svg';
|
|
12
12
|
import JiraIcon from '../assets/JiraIcon.svg';
|
|
@@ -116,7 +116,7 @@ const getJiraContainerProperties = ({
|
|
|
116
116
|
containerTypeProperties,
|
|
117
117
|
iconSize = 'small'
|
|
118
118
|
}) => {
|
|
119
|
-
const newTeamProfilePage =
|
|
119
|
+
const newTeamProfilePage = FeatureGates.getExperimentValue('new_team_profile', 'isEnabled', false);
|
|
120
120
|
const {
|
|
121
121
|
subType,
|
|
122
122
|
name
|
|
@@ -155,7 +155,7 @@ const getWebLinkContainerProperties = ({
|
|
|
155
155
|
isEmptyContainer,
|
|
156
156
|
isDisplayedOnProfileCard
|
|
157
157
|
}) => {
|
|
158
|
-
const newTeamProfilePage =
|
|
158
|
+
const newTeamProfilePage = FeatureGates.getExperimentValue('new_team_profile', 'isEnabled', false);
|
|
159
159
|
return {
|
|
160
160
|
description: isEmptyContainer ? /*#__PURE__*/React.createElement(Text, {
|
|
161
161
|
size: "medium",
|
|
@@ -189,7 +189,7 @@ export const getContainerProperties = ({
|
|
|
189
189
|
isEmptyContainer,
|
|
190
190
|
isDisplayedOnProfileCard
|
|
191
191
|
}) => {
|
|
192
|
-
const newTeamProfilePage =
|
|
192
|
+
const newTeamProfilePage = FeatureGates.getExperimentValue('new_team_profile', 'isEnabled', false);
|
|
193
193
|
switch (containerType) {
|
|
194
194
|
case 'ConfluenceSpace':
|
|
195
195
|
return {
|