@atlaskit/teams-public 1.4.0 → 1.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/dist/cjs/controllers/hooks/use-product-permission/index.js +1 -1
- package/dist/cjs/controllers/hooks/use-team-containers/index.js +81 -81
- package/dist/cjs/controllers/hooks/use-team-containers/multi-team.js +91 -91
- package/dist/cjs/controllers/hooks/use-team-links-and-containers/index.js +25 -25
- package/dist/cjs/controllers/hooks/use-team-web-links/index.js +65 -65
- package/dist/cjs/controllers/hooks/use-team-web-links/multi-team.js +73 -73
- package/dist/cjs/controllers/product-permission/main.js +19 -19
- package/dist/cjs/next/ui/team-containers/team-link-card/index.js +1 -23
- package/dist/cjs/ui/team-containers/disconnect-dialog/index.js +4 -4
- package/dist/cjs/ui/team-containers/main.js +9 -9
- package/dist/es2019/next/ui/team-containers/team-link-card/index.js +2 -24
- package/dist/esm/controllers/hooks/use-product-permission/index.js +1 -1
- package/dist/esm/controllers/hooks/use-team-containers/index.js +81 -81
- package/dist/esm/controllers/hooks/use-team-containers/multi-team.js +91 -91
- package/dist/esm/controllers/hooks/use-team-links-and-containers/index.js +25 -25
- package/dist/esm/controllers/hooks/use-team-web-links/index.js +65 -65
- package/dist/esm/controllers/hooks/use-team-web-links/multi-team.js +73 -73
- package/dist/esm/controllers/product-permission/main.js +19 -19
- package/dist/esm/next/ui/team-containers/team-link-card/index.js +2 -24
- package/dist/esm/ui/team-containers/disconnect-dialog/index.js +4 -4
- package/dist/esm/ui/team-containers/main.js +9 -9
- package/package.json +14 -16
|
@@ -64,25 +64,25 @@ var actions = {
|
|
|
64
64
|
fetchTeamContainers: function fetchTeamContainers(teamId, fireAnalytics, fireAnalyticsNext) {
|
|
65
65
|
return /*#__PURE__*/function () {
|
|
66
66
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref) {
|
|
67
|
-
var setState, getState, _getState, teams, currentTeamState, containers, currentState, _currentTeamState, _currentState;
|
|
68
|
-
return _regeneratorRuntime.wrap(function
|
|
67
|
+
var setState, getState, _getState, teams, currentTeamState, containers, currentState, _currentTeamState, _currentState, _t;
|
|
68
|
+
return _regeneratorRuntime.wrap(function (_context) {
|
|
69
69
|
while (1) switch (_context.prev = _context.next) {
|
|
70
70
|
case 0:
|
|
71
71
|
setState = _ref.setState, getState = _ref.getState;
|
|
72
72
|
_getState = getState(), teams = _getState.teams;
|
|
73
73
|
currentTeamState = teams[teamId]; // Only skip if already loaded and not currently loading (prevents duplicate fetches)
|
|
74
74
|
if (!(currentTeamState !== null && currentTeamState !== void 0 && currentTeamState.hasLoaded && !currentTeamState.loading)) {
|
|
75
|
-
_context.next =
|
|
75
|
+
_context.next = 1;
|
|
76
76
|
break;
|
|
77
77
|
}
|
|
78
78
|
return _context.abrupt("return");
|
|
79
|
-
case
|
|
79
|
+
case 1:
|
|
80
80
|
if (!(currentTeamState !== null && currentTeamState !== void 0 && currentTeamState.loading)) {
|
|
81
|
-
_context.next =
|
|
81
|
+
_context.next = 2;
|
|
82
82
|
break;
|
|
83
83
|
}
|
|
84
84
|
return _context.abrupt("return");
|
|
85
|
-
case
|
|
85
|
+
case 2:
|
|
86
86
|
setState({
|
|
87
87
|
teams: _objectSpread(_objectSpread({}, teams), {}, _defineProperty({}, teamId, _objectSpread(_objectSpread({}, getInitialTeamState()), {}, {
|
|
88
88
|
teamContainers: [],
|
|
@@ -91,10 +91,10 @@ var actions = {
|
|
|
91
91
|
hasLoaded: false
|
|
92
92
|
})))
|
|
93
93
|
});
|
|
94
|
-
_context.prev =
|
|
95
|
-
_context.next =
|
|
94
|
+
_context.prev = 3;
|
|
95
|
+
_context.next = 4;
|
|
96
96
|
return teamsClient.getTeamContainers(teamId);
|
|
97
|
-
case
|
|
97
|
+
case 4:
|
|
98
98
|
containers = _context.sent;
|
|
99
99
|
fireAnalyticsNext('operational.fetchTeamContainers.succeeded', {
|
|
100
100
|
teamId: teamId
|
|
@@ -104,11 +104,11 @@ var actions = {
|
|
|
104
104
|
currentState = getState();
|
|
105
105
|
_currentTeamState = currentState.teams[teamId];
|
|
106
106
|
if (!(!_currentTeamState || _currentTeamState.loading === false)) {
|
|
107
|
-
_context.next =
|
|
107
|
+
_context.next = 5;
|
|
108
108
|
break;
|
|
109
109
|
}
|
|
110
110
|
return _context.abrupt("return");
|
|
111
|
-
case
|
|
111
|
+
case 5:
|
|
112
112
|
// Only update if we're still loading (prevents race conditions when teamId changes)
|
|
113
113
|
if (_currentTeamState.loading) {
|
|
114
114
|
setState({
|
|
@@ -121,38 +121,38 @@ var actions = {
|
|
|
121
121
|
})))
|
|
122
122
|
});
|
|
123
123
|
}
|
|
124
|
-
_context.next =
|
|
124
|
+
_context.next = 8;
|
|
125
125
|
break;
|
|
126
|
-
case
|
|
127
|
-
_context.prev =
|
|
128
|
-
|
|
126
|
+
case 6:
|
|
127
|
+
_context.prev = 6;
|
|
128
|
+
_t = _context["catch"](3);
|
|
129
129
|
fireAnalyticsNext('operational.fetchTeamContainers.failed', {
|
|
130
130
|
teamId: teamId,
|
|
131
|
-
error: getErrorDetails(
|
|
131
|
+
error: getErrorDetails(_t)
|
|
132
132
|
});
|
|
133
133
|
|
|
134
134
|
// Get fresh state after async operation
|
|
135
135
|
_currentState = getState();
|
|
136
136
|
if (_currentState.teams[teamId]) {
|
|
137
|
-
_context.next =
|
|
137
|
+
_context.next = 7;
|
|
138
138
|
break;
|
|
139
139
|
}
|
|
140
140
|
return _context.abrupt("return");
|
|
141
|
-
case
|
|
141
|
+
case 7:
|
|
142
142
|
setState({
|
|
143
143
|
teams: _objectSpread(_objectSpread({}, _currentState.teams), {}, _defineProperty({}, teamId, _objectSpread(_objectSpread({}, _currentState.teams[teamId]), {}, {
|
|
144
144
|
teamContainers: [],
|
|
145
|
-
error: normalizeError(
|
|
145
|
+
error: normalizeError(_t),
|
|
146
146
|
loading: false,
|
|
147
147
|
hasLoaded: true,
|
|
148
148
|
teamId: teamId
|
|
149
149
|
})))
|
|
150
150
|
});
|
|
151
|
-
case
|
|
151
|
+
case 8:
|
|
152
152
|
case "end":
|
|
153
153
|
return _context.stop();
|
|
154
154
|
}
|
|
155
|
-
}, _callee, null, [[
|
|
155
|
+
}, _callee, null, [[3, 6]]);
|
|
156
156
|
}));
|
|
157
157
|
return function (_x) {
|
|
158
158
|
return _ref2.apply(this, arguments);
|
|
@@ -162,23 +162,23 @@ var actions = {
|
|
|
162
162
|
refetchTeamContainers: function refetchTeamContainers(teamId, fireAnalytics, fireAnalyticsNext) {
|
|
163
163
|
return /*#__PURE__*/function () {
|
|
164
164
|
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(_ref3) {
|
|
165
|
-
var setState, getState, _getState2, teams, currentTeamState, containers;
|
|
166
|
-
return _regeneratorRuntime.wrap(function
|
|
165
|
+
var setState, getState, _getState2, teams, currentTeamState, containers, _t2;
|
|
166
|
+
return _regeneratorRuntime.wrap(function (_context2) {
|
|
167
167
|
while (1) switch (_context2.prev = _context2.next) {
|
|
168
168
|
case 0:
|
|
169
169
|
setState = _ref3.setState, getState = _ref3.getState;
|
|
170
170
|
_getState2 = getState(), teams = _getState2.teams;
|
|
171
171
|
currentTeamState = teams[teamId];
|
|
172
172
|
if (currentTeamState) {
|
|
173
|
-
_context2.next =
|
|
173
|
+
_context2.next = 1;
|
|
174
174
|
break;
|
|
175
175
|
}
|
|
176
176
|
return _context2.abrupt("return");
|
|
177
|
-
case
|
|
178
|
-
_context2.prev =
|
|
179
|
-
_context2.next =
|
|
177
|
+
case 1:
|
|
178
|
+
_context2.prev = 1;
|
|
179
|
+
_context2.next = 2;
|
|
180
180
|
return teamsClient.getTeamContainers(teamId);
|
|
181
|
-
case
|
|
181
|
+
case 2:
|
|
182
182
|
containers = _context2.sent;
|
|
183
183
|
fireAnalyticsNext('operational.refetchTeamContainers.succeeded', {
|
|
184
184
|
teamId: teamId
|
|
@@ -194,28 +194,28 @@ var actions = {
|
|
|
194
194
|
})))
|
|
195
195
|
});
|
|
196
196
|
}
|
|
197
|
-
_context2.next =
|
|
197
|
+
_context2.next = 4;
|
|
198
198
|
break;
|
|
199
|
-
case
|
|
200
|
-
_context2.prev =
|
|
201
|
-
|
|
199
|
+
case 3:
|
|
200
|
+
_context2.prev = 3;
|
|
201
|
+
_t2 = _context2["catch"](1);
|
|
202
202
|
fireAnalyticsNext('operational.refetchTeamContainers.failed', {
|
|
203
203
|
teamId: teamId,
|
|
204
|
-
error: getErrorDetails(
|
|
204
|
+
error: getErrorDetails(_t2)
|
|
205
205
|
});
|
|
206
206
|
setState({
|
|
207
207
|
teams: _objectSpread(_objectSpread({}, teams), {}, _defineProperty({}, teamId, _objectSpread(_objectSpread({}, currentTeamState), {}, {
|
|
208
|
-
error: normalizeError(
|
|
208
|
+
error: normalizeError(_t2),
|
|
209
209
|
loading: false,
|
|
210
210
|
hasLoaded: true,
|
|
211
211
|
teamId: teamId
|
|
212
212
|
})))
|
|
213
213
|
});
|
|
214
|
-
case
|
|
214
|
+
case 4:
|
|
215
215
|
case "end":
|
|
216
216
|
return _context2.stop();
|
|
217
217
|
}
|
|
218
|
-
}, _callee2, null, [[
|
|
218
|
+
}, _callee2, null, [[1, 3]]);
|
|
219
219
|
}));
|
|
220
220
|
return function (_x2) {
|
|
221
221
|
return _ref4.apply(this, arguments);
|
|
@@ -225,26 +225,26 @@ var actions = {
|
|
|
225
225
|
fetchNumberOfConnectedTeams: function fetchNumberOfConnectedTeams(teamId, containerId, fireAnalytics, fireAnalyticsNext) {
|
|
226
226
|
return /*#__PURE__*/function () {
|
|
227
227
|
var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(_ref5) {
|
|
228
|
-
var setState, getState, _getState3, teams, currentTeamState, currentContainerId, numberOfTeams, currentState, updatedTeamState, _currentState2, _updatedTeamState;
|
|
229
|
-
return _regeneratorRuntime.wrap(function
|
|
228
|
+
var setState, getState, _getState3, teams, currentTeamState, currentContainerId, numberOfTeams, currentState, updatedTeamState, _currentState2, _updatedTeamState, _t3;
|
|
229
|
+
return _regeneratorRuntime.wrap(function (_context3) {
|
|
230
230
|
while (1) switch (_context3.prev = _context3.next) {
|
|
231
231
|
case 0:
|
|
232
232
|
setState = _ref5.setState, getState = _ref5.getState;
|
|
233
233
|
_getState3 = getState(), teams = _getState3.teams;
|
|
234
234
|
currentTeamState = teams[teamId];
|
|
235
235
|
if (currentTeamState) {
|
|
236
|
-
_context3.next =
|
|
236
|
+
_context3.next = 1;
|
|
237
237
|
break;
|
|
238
238
|
}
|
|
239
239
|
return _context3.abrupt("return");
|
|
240
|
-
case
|
|
240
|
+
case 1:
|
|
241
241
|
currentContainerId = currentTeamState.connectedTeams.containerId;
|
|
242
242
|
if (!(currentContainerId === containerId)) {
|
|
243
|
-
_context3.next =
|
|
243
|
+
_context3.next = 2;
|
|
244
244
|
break;
|
|
245
245
|
}
|
|
246
246
|
return _context3.abrupt("return");
|
|
247
|
-
case
|
|
247
|
+
case 2:
|
|
248
248
|
setState({
|
|
249
249
|
teams: _objectSpread(_objectSpread({}, teams), {}, _defineProperty({}, teamId, _objectSpread(_objectSpread({}, currentTeamState), {}, {
|
|
250
250
|
connectedTeams: _objectSpread(_objectSpread({}, initialConnectedTeamsState), {}, {
|
|
@@ -253,10 +253,10 @@ var actions = {
|
|
|
253
253
|
})
|
|
254
254
|
})))
|
|
255
255
|
});
|
|
256
|
-
_context3.prev =
|
|
257
|
-
_context3.next =
|
|
256
|
+
_context3.prev = 3;
|
|
257
|
+
_context3.next = 4;
|
|
258
258
|
return teamsClient.getNumberOfConnectedTeams(containerId);
|
|
259
|
-
case
|
|
259
|
+
case 4:
|
|
260
260
|
numberOfTeams = _context3.sent;
|
|
261
261
|
fireAnalyticsNext('operational.fetchNumberOfConnectedTeams.succeeded', {
|
|
262
262
|
numberOfTeams: numberOfTeams,
|
|
@@ -275,15 +275,15 @@ var actions = {
|
|
|
275
275
|
})))
|
|
276
276
|
});
|
|
277
277
|
}
|
|
278
|
-
_context3.next =
|
|
278
|
+
_context3.next = 6;
|
|
279
279
|
break;
|
|
280
|
-
case
|
|
281
|
-
_context3.prev =
|
|
282
|
-
|
|
280
|
+
case 5:
|
|
281
|
+
_context3.prev = 5;
|
|
282
|
+
_t3 = _context3["catch"](3);
|
|
283
283
|
fireAnalyticsNext('operational.fetchNumberOfConnectedTeams.failed', {
|
|
284
284
|
numberOfTeams: initialConnectedTeamsState.numberOfTeams || null,
|
|
285
285
|
containerId: containerId,
|
|
286
|
-
error: getErrorDetails(
|
|
286
|
+
error: getErrorDetails(_t3)
|
|
287
287
|
});
|
|
288
288
|
_currentState2 = getState();
|
|
289
289
|
_updatedTeamState = _currentState2.teams[teamId];
|
|
@@ -292,16 +292,16 @@ var actions = {
|
|
|
292
292
|
teams: _objectSpread(_objectSpread({}, _currentState2.teams), {}, _defineProperty({}, teamId, _objectSpread(_objectSpread({}, _updatedTeamState), {}, {
|
|
293
293
|
connectedTeams: _objectSpread(_objectSpread({}, initialConnectedTeamsState), {}, {
|
|
294
294
|
containerId: containerId,
|
|
295
|
-
error: normalizeError(
|
|
295
|
+
error: normalizeError(_t3)
|
|
296
296
|
})
|
|
297
297
|
})))
|
|
298
298
|
});
|
|
299
299
|
}
|
|
300
|
-
case
|
|
300
|
+
case 6:
|
|
301
301
|
case "end":
|
|
302
302
|
return _context3.stop();
|
|
303
303
|
}
|
|
304
|
-
}, _callee3, null, [[
|
|
304
|
+
}, _callee3, null, [[3, 5]]);
|
|
305
305
|
}));
|
|
306
306
|
return function (_x3) {
|
|
307
307
|
return _ref6.apply(this, arguments);
|
|
@@ -311,26 +311,26 @@ var actions = {
|
|
|
311
311
|
fetchConnectedTeams: function fetchConnectedTeams(teamId, containerId, fireAnalytics, fireAnalyticsNext) {
|
|
312
312
|
return /*#__PURE__*/function () {
|
|
313
313
|
var _ref8 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(_ref7) {
|
|
314
|
-
var setState, getState, _getState4, teams, currentTeamState, _currentTeamState$con, currentContainerId, numberOfTeams, hasLoaded, teamsResult, currentState, updatedTeamState, _currentState3, _updatedTeamState2;
|
|
315
|
-
return _regeneratorRuntime.wrap(function
|
|
314
|
+
var setState, getState, _getState4, teams, currentTeamState, _currentTeamState$con, currentContainerId, numberOfTeams, hasLoaded, teamsResult, currentState, updatedTeamState, _currentState3, _updatedTeamState2, _t4;
|
|
315
|
+
return _regeneratorRuntime.wrap(function (_context4) {
|
|
316
316
|
while (1) switch (_context4.prev = _context4.next) {
|
|
317
317
|
case 0:
|
|
318
318
|
setState = _ref7.setState, getState = _ref7.getState;
|
|
319
319
|
_getState4 = getState(), teams = _getState4.teams;
|
|
320
320
|
currentTeamState = teams[teamId];
|
|
321
321
|
if (currentTeamState) {
|
|
322
|
-
_context4.next =
|
|
322
|
+
_context4.next = 1;
|
|
323
323
|
break;
|
|
324
324
|
}
|
|
325
325
|
return _context4.abrupt("return");
|
|
326
|
-
case
|
|
326
|
+
case 1:
|
|
327
327
|
_currentTeamState$con = currentTeamState.connectedTeams, currentContainerId = _currentTeamState$con.containerId, numberOfTeams = _currentTeamState$con.numberOfTeams, hasLoaded = _currentTeamState$con.hasLoaded;
|
|
328
328
|
if (!(currentContainerId === containerId && hasLoaded)) {
|
|
329
|
-
_context4.next =
|
|
329
|
+
_context4.next = 2;
|
|
330
330
|
break;
|
|
331
331
|
}
|
|
332
332
|
return _context4.abrupt("return");
|
|
333
|
-
case
|
|
333
|
+
case 2:
|
|
334
334
|
setState({
|
|
335
335
|
teams: _objectSpread(_objectSpread({}, teams), {}, _defineProperty({}, teamId, _objectSpread(_objectSpread({}, currentTeamState), {}, {
|
|
336
336
|
connectedTeams: {
|
|
@@ -343,10 +343,10 @@ var actions = {
|
|
|
343
343
|
}
|
|
344
344
|
})))
|
|
345
345
|
});
|
|
346
|
-
_context4.prev =
|
|
347
|
-
_context4.next =
|
|
346
|
+
_context4.prev = 3;
|
|
347
|
+
_context4.next = 4;
|
|
348
348
|
return teamsClient.getConnectedTeams(containerId);
|
|
349
|
-
case
|
|
349
|
+
case 4:
|
|
350
350
|
teamsResult = _context4.sent;
|
|
351
351
|
fireAnalyticsNext('operational.fetchConnectedTeams.succeeded', {
|
|
352
352
|
numberOfTeams: numberOfTeams || null,
|
|
@@ -368,15 +368,15 @@ var actions = {
|
|
|
368
368
|
})))
|
|
369
369
|
});
|
|
370
370
|
}
|
|
371
|
-
_context4.next =
|
|
371
|
+
_context4.next = 6;
|
|
372
372
|
break;
|
|
373
|
-
case
|
|
374
|
-
_context4.prev =
|
|
375
|
-
|
|
373
|
+
case 5:
|
|
374
|
+
_context4.prev = 5;
|
|
375
|
+
_t4 = _context4["catch"](3);
|
|
376
376
|
fireAnalyticsNext('operational.fetchConnectedTeams.failed', {
|
|
377
377
|
numberOfTeams: numberOfTeams || null,
|
|
378
378
|
containerId: containerId,
|
|
379
|
-
error: getErrorDetails(
|
|
379
|
+
error: getErrorDetails(_t4)
|
|
380
380
|
});
|
|
381
381
|
_currentState3 = getState();
|
|
382
382
|
_updatedTeamState2 = _currentState3.teams[teamId];
|
|
@@ -388,17 +388,17 @@ var actions = {
|
|
|
388
388
|
isLoading: false,
|
|
389
389
|
hasLoaded: false,
|
|
390
390
|
teams: [],
|
|
391
|
-
error: normalizeError(
|
|
391
|
+
error: normalizeError(_t4),
|
|
392
392
|
numberOfTeams: numberOfTeams
|
|
393
393
|
}
|
|
394
394
|
})))
|
|
395
395
|
});
|
|
396
396
|
}
|
|
397
|
-
case
|
|
397
|
+
case 6:
|
|
398
398
|
case "end":
|
|
399
399
|
return _context4.stop();
|
|
400
400
|
}
|
|
401
|
-
}, _callee4, null, [[
|
|
401
|
+
}, _callee4, null, [[3, 5]]);
|
|
402
402
|
}));
|
|
403
403
|
return function (_x4) {
|
|
404
404
|
return _ref8.apply(this, arguments);
|
|
@@ -408,8 +408,8 @@ var actions = {
|
|
|
408
408
|
unlinkTeamContainers: function unlinkTeamContainers(teamId, containerId) {
|
|
409
409
|
return /*#__PURE__*/function () {
|
|
410
410
|
var _ref0 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5(_ref9) {
|
|
411
|
-
var setState, getState, _getState5, teams, currentTeamState, mutationResult, currentState, updatedTeamState, newContainers, shouldResetConnectedTeams, _currentState4, _updatedTeamState3;
|
|
412
|
-
return _regeneratorRuntime.wrap(function
|
|
411
|
+
var setState, getState, _getState5, teams, currentTeamState, mutationResult, currentState, updatedTeamState, newContainers, shouldResetConnectedTeams, _currentState4, _updatedTeamState3, _t5;
|
|
412
|
+
return _regeneratorRuntime.wrap(function (_context5) {
|
|
413
413
|
while (1) switch (_context5.prev = _context5.next) {
|
|
414
414
|
case 0:
|
|
415
415
|
setState = _ref9.setState, getState = _ref9.getState;
|
|
@@ -422,19 +422,19 @@ var actions = {
|
|
|
422
422
|
})))
|
|
423
423
|
});
|
|
424
424
|
}
|
|
425
|
-
_context5.prev =
|
|
426
|
-
_context5.next =
|
|
425
|
+
_context5.prev = 1;
|
|
426
|
+
_context5.next = 2;
|
|
427
427
|
return teamsClient.unlinkTeamContainer(teamId, containerId);
|
|
428
|
-
case
|
|
428
|
+
case 2:
|
|
429
429
|
mutationResult = _context5.sent;
|
|
430
430
|
currentState = getState();
|
|
431
431
|
updatedTeamState = currentState.teams[teamId];
|
|
432
432
|
if (updatedTeamState) {
|
|
433
|
-
_context5.next =
|
|
433
|
+
_context5.next = 3;
|
|
434
434
|
break;
|
|
435
435
|
}
|
|
436
436
|
return _context5.abrupt("return");
|
|
437
|
-
case
|
|
437
|
+
case 3:
|
|
438
438
|
if (mutationResult.deleteTeamConnectedToContainer.errors.length) {
|
|
439
439
|
// Just handle 1 error at a time should be sufficient as we disconnect only 1 container at a time
|
|
440
440
|
setState({
|
|
@@ -457,25 +457,25 @@ var actions = {
|
|
|
457
457
|
})))
|
|
458
458
|
});
|
|
459
459
|
}
|
|
460
|
-
_context5.next =
|
|
460
|
+
_context5.next = 5;
|
|
461
461
|
break;
|
|
462
|
-
case
|
|
463
|
-
_context5.prev =
|
|
464
|
-
|
|
462
|
+
case 4:
|
|
463
|
+
_context5.prev = 4;
|
|
464
|
+
_t5 = _context5["catch"](1);
|
|
465
465
|
_currentState4 = getState();
|
|
466
466
|
_updatedTeamState3 = _currentState4.teams[teamId];
|
|
467
467
|
if (_updatedTeamState3) {
|
|
468
468
|
setState({
|
|
469
469
|
teams: _objectSpread(_objectSpread({}, _currentState4.teams), {}, _defineProperty({}, teamId, _objectSpread(_objectSpread({}, _updatedTeamState3), {}, {
|
|
470
|
-
unlinkError: normalizeError(
|
|
470
|
+
unlinkError: normalizeError(_t5)
|
|
471
471
|
})))
|
|
472
472
|
});
|
|
473
473
|
}
|
|
474
|
-
case
|
|
474
|
+
case 5:
|
|
475
475
|
case "end":
|
|
476
476
|
return _context5.stop();
|
|
477
477
|
}
|
|
478
|
-
}, _callee5, null, [[
|
|
478
|
+
}, _callee5, null, [[1, 4]]);
|
|
479
479
|
}));
|
|
480
480
|
return function (_x5) {
|
|
481
481
|
return _ref0.apply(this, arguments);
|
|
@@ -486,27 +486,27 @@ var actions = {
|
|
|
486
486
|
return /*#__PURE__*/function () {
|
|
487
487
|
var _ref10 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6(_ref1) {
|
|
488
488
|
var setState, getState, _getState6, teams, currentTeamState, containerExists, shouldResetConnectedTeams;
|
|
489
|
-
return _regeneratorRuntime.wrap(function
|
|
489
|
+
return _regeneratorRuntime.wrap(function (_context6) {
|
|
490
490
|
while (1) switch (_context6.prev = _context6.next) {
|
|
491
491
|
case 0:
|
|
492
492
|
setState = _ref1.setState, getState = _ref1.getState;
|
|
493
493
|
_getState6 = getState(), teams = _getState6.teams;
|
|
494
494
|
currentTeamState = teams[teamId];
|
|
495
495
|
if (currentTeamState) {
|
|
496
|
-
_context6.next =
|
|
496
|
+
_context6.next = 1;
|
|
497
497
|
break;
|
|
498
498
|
}
|
|
499
499
|
return _context6.abrupt("return");
|
|
500
|
-
case
|
|
500
|
+
case 1:
|
|
501
501
|
containerExists = currentTeamState.teamContainers.some(function (container) {
|
|
502
502
|
return container.id === teamContainer.id;
|
|
503
503
|
});
|
|
504
504
|
if (!containerExists) {
|
|
505
|
-
_context6.next =
|
|
505
|
+
_context6.next = 2;
|
|
506
506
|
break;
|
|
507
507
|
}
|
|
508
508
|
return _context6.abrupt("return");
|
|
509
|
-
case
|
|
509
|
+
case 2:
|
|
510
510
|
shouldResetConnectedTeams = currentTeamState.connectedTeams.containerId === teamContainer.id;
|
|
511
511
|
setState({
|
|
512
512
|
teams: _objectSpread(_objectSpread({}, teams), {}, _defineProperty({}, teamId, _objectSpread(_objectSpread(_objectSpread({}, currentTeamState), {}, {
|
|
@@ -517,7 +517,7 @@ var actions = {
|
|
|
517
517
|
teamId: teamId
|
|
518
518
|
})))
|
|
519
519
|
});
|
|
520
|
-
case
|
|
520
|
+
case 3:
|
|
521
521
|
case "end":
|
|
522
522
|
return _context6.stop();
|
|
523
523
|
}
|
|
@@ -571,7 +571,7 @@ export var useTeamContainers = function useTeamContainers(teamId) {
|
|
|
571
571
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
572
572
|
}, [teamId, enable]);
|
|
573
573
|
var refetchTeamContainers = useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee7() {
|
|
574
|
-
return _regeneratorRuntime.wrap(function
|
|
574
|
+
return _regeneratorRuntime.wrap(function (_context7) {
|
|
575
575
|
while (1) switch (_context7.prev = _context7.next) {
|
|
576
576
|
case 0:
|
|
577
577
|
return _context7.abrupt("return", actions.refetchTeamContainers(teamId, fireOperationalAnalytics, fireEvent));
|
|
@@ -49,31 +49,31 @@ export var useTeamLinksAndContainers = function useTeamLinksAndContainers(teamId
|
|
|
49
49
|
var addTeamLink = useCallback( /*#__PURE__*/function () {
|
|
50
50
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(containerOrWebLink) {
|
|
51
51
|
var webLink;
|
|
52
|
-
return _regeneratorRuntime.wrap(function
|
|
52
|
+
return _regeneratorRuntime.wrap(function (_context) {
|
|
53
53
|
while (1) switch (_context.prev = _context.next) {
|
|
54
54
|
case 0:
|
|
55
55
|
if (!isNewTeamWebLink(containerOrWebLink)) {
|
|
56
|
-
_context.next =
|
|
56
|
+
_context.next = 2;
|
|
57
57
|
break;
|
|
58
58
|
}
|
|
59
|
-
_context.next =
|
|
59
|
+
_context.next = 1;
|
|
60
60
|
return createTeamWebLink(teamId, containerOrWebLink);
|
|
61
|
-
case
|
|
61
|
+
case 1:
|
|
62
62
|
return _context.abrupt("return", _context.sent);
|
|
63
|
-
case
|
|
63
|
+
case 2:
|
|
64
64
|
if (!(containerOrWebLink.type === 'WebLink')) {
|
|
65
|
-
_context.next =
|
|
65
|
+
_context.next = 4;
|
|
66
66
|
break;
|
|
67
67
|
}
|
|
68
68
|
webLink = containerToNewWebLink(containerOrWebLink);
|
|
69
|
-
_context.next =
|
|
69
|
+
_context.next = 3;
|
|
70
70
|
return createTeamWebLink(teamId, webLink);
|
|
71
|
-
case
|
|
71
|
+
case 3:
|
|
72
72
|
return _context.abrupt("return", _context.sent);
|
|
73
|
-
case
|
|
73
|
+
case 4:
|
|
74
74
|
addTeamContainer(containerOrWebLink);
|
|
75
75
|
return _context.abrupt("return", Promise.resolve(containerOrWebLink));
|
|
76
|
-
case
|
|
76
|
+
case 5:
|
|
77
77
|
case "end":
|
|
78
78
|
return _context.stop();
|
|
79
79
|
}
|
|
@@ -86,29 +86,29 @@ export var useTeamLinksAndContainers = function useTeamLinksAndContainers(teamId
|
|
|
86
86
|
var updateTeamLinkById = useCallback( /*#__PURE__*/function () {
|
|
87
87
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(linkId, updatedFields) {
|
|
88
88
|
var container, currentWebLink, updatedWebLink;
|
|
89
|
-
return _regeneratorRuntime.wrap(function
|
|
89
|
+
return _regeneratorRuntime.wrap(function (_context2) {
|
|
90
90
|
while (1) switch (_context2.prev = _context2.next) {
|
|
91
91
|
case 0:
|
|
92
92
|
container = allContainers.find(function (link) {
|
|
93
93
|
return link.id === linkId;
|
|
94
94
|
});
|
|
95
95
|
if (container) {
|
|
96
|
-
_context2.next =
|
|
96
|
+
_context2.next = 1;
|
|
97
97
|
break;
|
|
98
98
|
}
|
|
99
99
|
return _context2.abrupt("return");
|
|
100
|
-
case
|
|
100
|
+
case 1:
|
|
101
101
|
if (!(container.type === 'WebLink')) {
|
|
102
|
-
_context2.next =
|
|
102
|
+
_context2.next = 3;
|
|
103
103
|
break;
|
|
104
104
|
}
|
|
105
105
|
currentWebLink = containerToNewWebLink(container);
|
|
106
106
|
updatedWebLink = _objectSpread(_objectSpread({}, currentWebLink), updatedFields);
|
|
107
|
-
_context2.next =
|
|
107
|
+
_context2.next = 2;
|
|
108
108
|
return updateTeamWebLink(teamId, linkId, updatedWebLink);
|
|
109
|
-
case
|
|
109
|
+
case 2:
|
|
110
110
|
return _context2.abrupt("return", _context2.sent);
|
|
111
|
-
case
|
|
111
|
+
case 3:
|
|
112
112
|
case "end":
|
|
113
113
|
return _context2.stop();
|
|
114
114
|
}
|
|
@@ -120,22 +120,22 @@ export var useTeamLinksAndContainers = function useTeamLinksAndContainers(teamId
|
|
|
120
120
|
}(), [teamId, allContainers, updateTeamWebLink]);
|
|
121
121
|
var removeTeamLink = useCallback( /*#__PURE__*/function () {
|
|
122
122
|
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(container) {
|
|
123
|
-
return _regeneratorRuntime.wrap(function
|
|
123
|
+
return _regeneratorRuntime.wrap(function (_context3) {
|
|
124
124
|
while (1) switch (_context3.prev = _context3.next) {
|
|
125
125
|
case 0:
|
|
126
126
|
if (!(container.type === 'WebLink')) {
|
|
127
|
-
_context3.next =
|
|
127
|
+
_context3.next = 2;
|
|
128
128
|
break;
|
|
129
129
|
}
|
|
130
|
-
_context3.next =
|
|
130
|
+
_context3.next = 1;
|
|
131
131
|
return removeWebLink(teamId, container.id);
|
|
132
|
-
case
|
|
133
|
-
_context3.next =
|
|
132
|
+
case 1:
|
|
133
|
+
_context3.next = 3;
|
|
134
134
|
break;
|
|
135
|
-
case
|
|
136
|
-
_context3.next =
|
|
135
|
+
case 2:
|
|
136
|
+
_context3.next = 3;
|
|
137
137
|
return unlinkTeamContainers(container.id);
|
|
138
|
-
case
|
|
138
|
+
case 3:
|
|
139
139
|
case "end":
|
|
140
140
|
return _context3.stop();
|
|
141
141
|
}
|