@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
|
@@ -38,18 +38,18 @@ var actions = {
|
|
|
38
38
|
fetchTeamContainers: function fetchTeamContainers(teamId, fireAnalytics) {
|
|
39
39
|
return /*#__PURE__*/function () {
|
|
40
40
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref) {
|
|
41
|
-
var setState, getState, _getState, currentTeamId, containers;
|
|
42
|
-
return _regeneratorRuntime.wrap(function
|
|
41
|
+
var setState, getState, _getState, currentTeamId, containers, _t;
|
|
42
|
+
return _regeneratorRuntime.wrap(function (_context) {
|
|
43
43
|
while (1) switch (_context.prev = _context.next) {
|
|
44
44
|
case 0:
|
|
45
45
|
setState = _ref.setState, getState = _ref.getState;
|
|
46
46
|
_getState = getState(), currentTeamId = _getState.teamId;
|
|
47
47
|
if (!(currentTeamId === teamId)) {
|
|
48
|
-
_context.next =
|
|
48
|
+
_context.next = 1;
|
|
49
49
|
break;
|
|
50
50
|
}
|
|
51
51
|
return _context.abrupt("return");
|
|
52
|
-
case
|
|
52
|
+
case 1:
|
|
53
53
|
setState({
|
|
54
54
|
loading: true,
|
|
55
55
|
error: null,
|
|
@@ -57,10 +57,10 @@ var actions = {
|
|
|
57
57
|
teamId: teamId,
|
|
58
58
|
hasLoaded: false
|
|
59
59
|
});
|
|
60
|
-
_context.prev =
|
|
61
|
-
_context.next =
|
|
60
|
+
_context.prev = 2;
|
|
61
|
+
_context.next = 3;
|
|
62
62
|
return teamsClient.getTeamContainers(teamId);
|
|
63
|
-
case
|
|
63
|
+
case 3:
|
|
64
64
|
containers = _context.sent;
|
|
65
65
|
fireAnalytics('operational.fetchTeamContainers.succeeded', {
|
|
66
66
|
teamId: teamId
|
|
@@ -71,29 +71,29 @@ var actions = {
|
|
|
71
71
|
error: null,
|
|
72
72
|
hasLoaded: true
|
|
73
73
|
});
|
|
74
|
-
_context.next =
|
|
74
|
+
_context.next = 5;
|
|
75
75
|
break;
|
|
76
|
-
case
|
|
77
|
-
_context.prev =
|
|
78
|
-
|
|
76
|
+
case 4:
|
|
77
|
+
_context.prev = 4;
|
|
78
|
+
_t = _context["catch"](2);
|
|
79
79
|
fireAnalytics('operational.fetchTeamContainers.failed', {
|
|
80
80
|
teamId: teamId,
|
|
81
81
|
error: {
|
|
82
|
-
message:
|
|
83
|
-
stack:
|
|
82
|
+
message: _t.message || JSON.stringify(_t),
|
|
83
|
+
stack: _t.stack
|
|
84
84
|
}
|
|
85
85
|
});
|
|
86
86
|
setState({
|
|
87
87
|
teamContainers: [],
|
|
88
|
-
error:
|
|
88
|
+
error: _t,
|
|
89
89
|
loading: false,
|
|
90
90
|
hasLoaded: true
|
|
91
91
|
});
|
|
92
|
-
case
|
|
92
|
+
case 5:
|
|
93
93
|
case "end":
|
|
94
94
|
return _context.stop();
|
|
95
95
|
}
|
|
96
|
-
}, _callee, null, [[
|
|
96
|
+
}, _callee, null, [[2, 4]]);
|
|
97
97
|
}));
|
|
98
98
|
return function (_x) {
|
|
99
99
|
return _ref2.apply(this, arguments);
|
|
@@ -103,22 +103,22 @@ var actions = {
|
|
|
103
103
|
refetchTeamContainers: function refetchTeamContainers(fireAnalytics) {
|
|
104
104
|
return /*#__PURE__*/function () {
|
|
105
105
|
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(_ref3) {
|
|
106
|
-
var setState, getState, _getState2, teamId, containers;
|
|
107
|
-
return _regeneratorRuntime.wrap(function
|
|
106
|
+
var setState, getState, _getState2, teamId, containers, _t2;
|
|
107
|
+
return _regeneratorRuntime.wrap(function (_context2) {
|
|
108
108
|
while (1) switch (_context2.prev = _context2.next) {
|
|
109
109
|
case 0:
|
|
110
110
|
setState = _ref3.setState, getState = _ref3.getState;
|
|
111
111
|
_getState2 = getState(), teamId = _getState2.teamId;
|
|
112
112
|
if (teamId) {
|
|
113
|
-
_context2.next =
|
|
113
|
+
_context2.next = 1;
|
|
114
114
|
break;
|
|
115
115
|
}
|
|
116
116
|
return _context2.abrupt("return");
|
|
117
|
-
case
|
|
118
|
-
_context2.prev =
|
|
119
|
-
_context2.next =
|
|
117
|
+
case 1:
|
|
118
|
+
_context2.prev = 1;
|
|
119
|
+
_context2.next = 2;
|
|
120
120
|
return teamsClient.getTeamContainers(teamId);
|
|
121
|
-
case
|
|
121
|
+
case 2:
|
|
122
122
|
containers = _context2.sent;
|
|
123
123
|
fireAnalytics('operational.refetchTeamContainers.succeeded', {
|
|
124
124
|
teamId: teamId
|
|
@@ -132,29 +132,29 @@ var actions = {
|
|
|
132
132
|
hasLoaded: true
|
|
133
133
|
});
|
|
134
134
|
}
|
|
135
|
-
_context2.next =
|
|
135
|
+
_context2.next = 4;
|
|
136
136
|
break;
|
|
137
|
-
case
|
|
138
|
-
_context2.prev =
|
|
139
|
-
|
|
137
|
+
case 3:
|
|
138
|
+
_context2.prev = 3;
|
|
139
|
+
_t2 = _context2["catch"](1);
|
|
140
140
|
fireAnalytics('operational.refetchTeamContainers.failed', {
|
|
141
141
|
teamId: teamId,
|
|
142
142
|
error: {
|
|
143
|
-
message:
|
|
144
|
-
stack:
|
|
143
|
+
message: _t2.message || JSON.stringify(_t2),
|
|
144
|
+
stack: _t2.stack
|
|
145
145
|
}
|
|
146
146
|
});
|
|
147
147
|
setState({
|
|
148
148
|
teamContainers: getState().teamContainers,
|
|
149
|
-
error:
|
|
149
|
+
error: _t2,
|
|
150
150
|
loading: false,
|
|
151
151
|
hasLoaded: true
|
|
152
152
|
});
|
|
153
|
-
case
|
|
153
|
+
case 4:
|
|
154
154
|
case "end":
|
|
155
155
|
return _context2.stop();
|
|
156
156
|
}
|
|
157
|
-
}, _callee2, null, [[
|
|
157
|
+
}, _callee2, null, [[1, 3]]);
|
|
158
158
|
}));
|
|
159
159
|
return function (_x2) {
|
|
160
160
|
return _ref4.apply(this, arguments);
|
|
@@ -164,28 +164,28 @@ var actions = {
|
|
|
164
164
|
fetchNumberOfConnectedTeams: function fetchNumberOfConnectedTeams(containerId, fireAnalytics) {
|
|
165
165
|
return /*#__PURE__*/function () {
|
|
166
166
|
var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(_ref5) {
|
|
167
|
-
var setState, getState, _getState3, currentContainerId, numberOfTeams;
|
|
168
|
-
return _regeneratorRuntime.wrap(function
|
|
167
|
+
var setState, getState, _getState3, currentContainerId, numberOfTeams, _t3;
|
|
168
|
+
return _regeneratorRuntime.wrap(function (_context3) {
|
|
169
169
|
while (1) switch (_context3.prev = _context3.next) {
|
|
170
170
|
case 0:
|
|
171
171
|
setState = _ref5.setState, getState = _ref5.getState;
|
|
172
172
|
_getState3 = getState(), currentContainerId = _getState3.connectedTeams.containerId;
|
|
173
173
|
if (!(currentContainerId === containerId)) {
|
|
174
|
-
_context3.next =
|
|
174
|
+
_context3.next = 1;
|
|
175
175
|
break;
|
|
176
176
|
}
|
|
177
177
|
return _context3.abrupt("return");
|
|
178
|
-
case
|
|
178
|
+
case 1:
|
|
179
179
|
setState({
|
|
180
180
|
connectedTeams: _objectSpread(_objectSpread({}, initialConnectedTeamsState), {}, {
|
|
181
181
|
containerId: containerId,
|
|
182
182
|
numberOfTeams: undefined
|
|
183
183
|
})
|
|
184
184
|
});
|
|
185
|
-
_context3.prev =
|
|
186
|
-
_context3.next =
|
|
185
|
+
_context3.prev = 2;
|
|
186
|
+
_context3.next = 3;
|
|
187
187
|
return teamsClient.getNumberOfConnectedTeams(containerId);
|
|
188
|
-
case
|
|
188
|
+
case 3:
|
|
189
189
|
numberOfTeams = _context3.sent;
|
|
190
190
|
fireAnalytics('operational.fetchNumberOfConnectedTeams.succeeded', {
|
|
191
191
|
numberOfTeams: numberOfTeams,
|
|
@@ -197,30 +197,30 @@ var actions = {
|
|
|
197
197
|
numberOfTeams: numberOfTeams
|
|
198
198
|
})
|
|
199
199
|
});
|
|
200
|
-
_context3.next =
|
|
200
|
+
_context3.next = 5;
|
|
201
201
|
break;
|
|
202
|
-
case
|
|
203
|
-
_context3.prev =
|
|
204
|
-
|
|
202
|
+
case 4:
|
|
203
|
+
_context3.prev = 4;
|
|
204
|
+
_t3 = _context3["catch"](2);
|
|
205
205
|
fireAnalytics('operational.fetchNumberOfConnectedTeams.failed', {
|
|
206
206
|
numberOfTeams: initialConnectedTeamsState.numberOfTeams || null,
|
|
207
207
|
containerId: containerId,
|
|
208
208
|
error: {
|
|
209
|
-
message:
|
|
210
|
-
stack:
|
|
209
|
+
message: _t3.message || JSON.stringify(_t3),
|
|
210
|
+
stack: _t3.stack
|
|
211
211
|
}
|
|
212
212
|
});
|
|
213
213
|
setState({
|
|
214
214
|
connectedTeams: _objectSpread(_objectSpread({}, initialConnectedTeamsState), {}, {
|
|
215
215
|
containerId: containerId,
|
|
216
|
-
error:
|
|
216
|
+
error: _t3
|
|
217
217
|
})
|
|
218
218
|
});
|
|
219
|
-
case
|
|
219
|
+
case 5:
|
|
220
220
|
case "end":
|
|
221
221
|
return _context3.stop();
|
|
222
222
|
}
|
|
223
|
-
}, _callee3, null, [[
|
|
223
|
+
}, _callee3, null, [[2, 4]]);
|
|
224
224
|
}));
|
|
225
225
|
return function (_x3) {
|
|
226
226
|
return _ref6.apply(this, arguments);
|
|
@@ -230,18 +230,18 @@ var actions = {
|
|
|
230
230
|
fetchConnectedTeams: function fetchConnectedTeams(containerId, fireAnalytics) {
|
|
231
231
|
return /*#__PURE__*/function () {
|
|
232
232
|
var _ref8 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(_ref7) {
|
|
233
|
-
var setState, getState, _getState4, _getState4$connectedT, currentContainerId, numberOfTeams, hasLoaded, teams;
|
|
234
|
-
return _regeneratorRuntime.wrap(function
|
|
233
|
+
var setState, getState, _getState4, _getState4$connectedT, currentContainerId, numberOfTeams, hasLoaded, teams, _t4;
|
|
234
|
+
return _regeneratorRuntime.wrap(function (_context4) {
|
|
235
235
|
while (1) switch (_context4.prev = _context4.next) {
|
|
236
236
|
case 0:
|
|
237
237
|
setState = _ref7.setState, getState = _ref7.getState;
|
|
238
238
|
_getState4 = getState(), _getState4$connectedT = _getState4.connectedTeams, currentContainerId = _getState4$connectedT.containerId, numberOfTeams = _getState4$connectedT.numberOfTeams, hasLoaded = _getState4$connectedT.hasLoaded;
|
|
239
239
|
if (!(currentContainerId === containerId && hasLoaded)) {
|
|
240
|
-
_context4.next =
|
|
240
|
+
_context4.next = 1;
|
|
241
241
|
break;
|
|
242
242
|
}
|
|
243
243
|
return _context4.abrupt("return");
|
|
244
|
-
case
|
|
244
|
+
case 1:
|
|
245
245
|
setState({
|
|
246
246
|
connectedTeams: {
|
|
247
247
|
containerId: containerId,
|
|
@@ -252,10 +252,10 @@ var actions = {
|
|
|
252
252
|
numberOfTeams: numberOfTeams
|
|
253
253
|
}
|
|
254
254
|
});
|
|
255
|
-
_context4.prev =
|
|
256
|
-
_context4.next =
|
|
255
|
+
_context4.prev = 2;
|
|
256
|
+
_context4.next = 3;
|
|
257
257
|
return teamsClient.getConnectedTeams(containerId);
|
|
258
|
-
case
|
|
258
|
+
case 3:
|
|
259
259
|
teams = _context4.sent;
|
|
260
260
|
fireAnalytics('operational.fetchConnectedTeams.succeeded', {
|
|
261
261
|
numberOfTeams: numberOfTeams || null,
|
|
@@ -271,17 +271,17 @@ var actions = {
|
|
|
271
271
|
numberOfTeams: numberOfTeams
|
|
272
272
|
}
|
|
273
273
|
});
|
|
274
|
-
_context4.next =
|
|
274
|
+
_context4.next = 5;
|
|
275
275
|
break;
|
|
276
|
-
case
|
|
277
|
-
_context4.prev =
|
|
278
|
-
|
|
276
|
+
case 4:
|
|
277
|
+
_context4.prev = 4;
|
|
278
|
+
_t4 = _context4["catch"](2);
|
|
279
279
|
fireAnalytics('operational.fetchConnectedTeams.failed', {
|
|
280
280
|
numberOfTeams: numberOfTeams || null,
|
|
281
281
|
containerId: containerId,
|
|
282
282
|
error: {
|
|
283
|
-
message:
|
|
284
|
-
stack:
|
|
283
|
+
message: _t4.message || JSON.stringify(_t4),
|
|
284
|
+
stack: _t4.stack
|
|
285
285
|
}
|
|
286
286
|
});
|
|
287
287
|
setState({
|
|
@@ -290,15 +290,15 @@ var actions = {
|
|
|
290
290
|
isLoading: false,
|
|
291
291
|
hasLoaded: false,
|
|
292
292
|
teams: [],
|
|
293
|
-
error:
|
|
293
|
+
error: _t4,
|
|
294
294
|
numberOfTeams: numberOfTeams
|
|
295
295
|
}
|
|
296
296
|
});
|
|
297
|
-
case
|
|
297
|
+
case 5:
|
|
298
298
|
case "end":
|
|
299
299
|
return _context4.stop();
|
|
300
300
|
}
|
|
301
|
-
}, _callee4, null, [[
|
|
301
|
+
}, _callee4, null, [[2, 4]]);
|
|
302
302
|
}));
|
|
303
303
|
return function (_x4) {
|
|
304
304
|
return _ref8.apply(this, arguments);
|
|
@@ -308,18 +308,18 @@ var actions = {
|
|
|
308
308
|
unlinkTeamContainers: function unlinkTeamContainers(teamId, containerId) {
|
|
309
309
|
return /*#__PURE__*/function () {
|
|
310
310
|
var _ref0 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5(_ref9) {
|
|
311
|
-
var setState, getState, mutationResult, _getState5, teamContainers, connectedTeams, newContainers;
|
|
312
|
-
return _regeneratorRuntime.wrap(function
|
|
311
|
+
var setState, getState, mutationResult, _getState5, teamContainers, connectedTeams, newContainers, _t5;
|
|
312
|
+
return _regeneratorRuntime.wrap(function (_context5) {
|
|
313
313
|
while (1) switch (_context5.prev = _context5.next) {
|
|
314
314
|
case 0:
|
|
315
315
|
setState = _ref9.setState, getState = _ref9.getState;
|
|
316
316
|
setState({
|
|
317
317
|
unlinkError: null
|
|
318
318
|
});
|
|
319
|
-
_context5.prev =
|
|
320
|
-
_context5.next =
|
|
319
|
+
_context5.prev = 1;
|
|
320
|
+
_context5.next = 2;
|
|
321
321
|
return teamsClient.unlinkTeamContainer(teamId, containerId);
|
|
322
|
-
case
|
|
322
|
+
case 2:
|
|
323
323
|
mutationResult = _context5.sent;
|
|
324
324
|
if (mutationResult.deleteTeamConnectedToContainer.errors.length) {
|
|
325
325
|
// Just handle 1 error at a time should be suffcient as we disconenct only 1 container at a time
|
|
@@ -342,19 +342,19 @@ var actions = {
|
|
|
342
342
|
});
|
|
343
343
|
}
|
|
344
344
|
}
|
|
345
|
-
_context5.next =
|
|
345
|
+
_context5.next = 4;
|
|
346
346
|
break;
|
|
347
|
-
case
|
|
348
|
-
_context5.prev =
|
|
349
|
-
|
|
347
|
+
case 3:
|
|
348
|
+
_context5.prev = 3;
|
|
349
|
+
_t5 = _context5["catch"](1);
|
|
350
350
|
setState({
|
|
351
|
-
unlinkError:
|
|
351
|
+
unlinkError: _t5
|
|
352
352
|
});
|
|
353
|
-
case
|
|
353
|
+
case 4:
|
|
354
354
|
case "end":
|
|
355
355
|
return _context5.stop();
|
|
356
356
|
}
|
|
357
|
-
}, _callee5, null, [[
|
|
357
|
+
}, _callee5, null, [[1, 3]]);
|
|
358
358
|
}));
|
|
359
359
|
return function (_x5) {
|
|
360
360
|
return _ref0.apply(this, arguments);
|
|
@@ -365,7 +365,7 @@ var actions = {
|
|
|
365
365
|
return /*#__PURE__*/function () {
|
|
366
366
|
var _ref10 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6(_ref1) {
|
|
367
367
|
var setState, getState, _getState6, teamContainers, connectedTeams, containerExists;
|
|
368
|
-
return _regeneratorRuntime.wrap(function
|
|
368
|
+
return _regeneratorRuntime.wrap(function (_context6) {
|
|
369
369
|
while (1) switch (_context6.prev = _context6.next) {
|
|
370
370
|
case 0:
|
|
371
371
|
setState = _ref1.setState, getState = _ref1.getState;
|
|
@@ -374,11 +374,11 @@ var actions = {
|
|
|
374
374
|
return container.id === teamContainer.id;
|
|
375
375
|
});
|
|
376
376
|
if (!containerExists) {
|
|
377
|
-
_context6.next =
|
|
377
|
+
_context6.next = 1;
|
|
378
378
|
break;
|
|
379
379
|
}
|
|
380
380
|
return _context6.abrupt("return");
|
|
381
|
-
case
|
|
381
|
+
case 1:
|
|
382
382
|
if (connectedTeams.containerId === teamContainer.id) {
|
|
383
383
|
setState({
|
|
384
384
|
teamContainers: [].concat(_toConsumableArray(teamContainers), [teamContainer]),
|
|
@@ -389,7 +389,7 @@ var actions = {
|
|
|
389
389
|
teamContainers: [].concat(_toConsumableArray(teamContainers), [teamContainer])
|
|
390
390
|
});
|
|
391
391
|
}
|
|
392
|
-
case
|
|
392
|
+
case 2:
|
|
393
393
|
case "end":
|
|
394
394
|
return _context6.stop();
|
|
395
395
|
}
|
|
@@ -423,7 +423,7 @@ export var useTeamContainers = function useTeamContainers(teamId) {
|
|
|
423
423
|
}
|
|
424
424
|
}, [teamId, actions, enable, fireEvent, useMultiTeam]);
|
|
425
425
|
var refetchTeamContainers = useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee7() {
|
|
426
|
-
return _regeneratorRuntime.wrap(function
|
|
426
|
+
return _regeneratorRuntime.wrap(function (_context7) {
|
|
427
427
|
while (1) switch (_context7.prev = _context7.next) {
|
|
428
428
|
case 0:
|
|
429
429
|
return _context7.abrupt("return", actions.refetchTeamContainers(fireEvent));
|