@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.
Files changed (23) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/cjs/controllers/hooks/use-product-permission/index.js +1 -1
  3. package/dist/cjs/controllers/hooks/use-team-containers/index.js +81 -81
  4. package/dist/cjs/controllers/hooks/use-team-containers/multi-team.js +91 -91
  5. package/dist/cjs/controllers/hooks/use-team-links-and-containers/index.js +25 -25
  6. package/dist/cjs/controllers/hooks/use-team-web-links/index.js +65 -65
  7. package/dist/cjs/controllers/hooks/use-team-web-links/multi-team.js +73 -73
  8. package/dist/cjs/controllers/product-permission/main.js +19 -19
  9. package/dist/cjs/next/ui/team-containers/team-link-card/index.js +1 -23
  10. package/dist/cjs/ui/team-containers/disconnect-dialog/index.js +4 -4
  11. package/dist/cjs/ui/team-containers/main.js +9 -9
  12. package/dist/es2019/next/ui/team-containers/team-link-card/index.js +2 -24
  13. package/dist/esm/controllers/hooks/use-product-permission/index.js +1 -1
  14. package/dist/esm/controllers/hooks/use-team-containers/index.js +81 -81
  15. package/dist/esm/controllers/hooks/use-team-containers/multi-team.js +91 -91
  16. package/dist/esm/controllers/hooks/use-team-links-and-containers/index.js +25 -25
  17. package/dist/esm/controllers/hooks/use-team-web-links/index.js +65 -65
  18. package/dist/esm/controllers/hooks/use-team-web-links/multi-team.js +73 -73
  19. package/dist/esm/controllers/product-permission/main.js +19 -19
  20. package/dist/esm/next/ui/team-containers/team-link-card/index.js +2 -24
  21. package/dist/esm/ui/team-containers/disconnect-dialog/index.js +4 -4
  22. package/dist/esm/ui/team-containers/main.js +9 -9
  23. package/package.json +14 -16
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # @atlaskit/teams-public
2
2
 
3
+ ## 1.4.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [`b97b0f02591fc`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/b97b0f02591fc) -
8
+ Cleanup feature gate ptc-links-migrate-atlaskit-anchor-to-teams-anchor. TeamsAnchor is now the
9
+ permanent link rendering path.
10
+
11
+ ## 1.4.1
12
+
13
+ ### Patch Changes
14
+
15
+ - Updated dependencies
16
+
3
17
  ## 1.4.0
4
18
 
5
19
  ### Minor Changes
@@ -26,7 +26,7 @@ var useProductPermissions = exports.useProductPermissions = function useProductP
26
26
  state = _useProductPermission2[0],
27
27
  getPermissions = _useProductPermission2[1].getPermissions;
28
28
  var fetchData = (0, _react.useCallback)( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
29
- return _regenerator.default.wrap(function _callee$(_context) {
29
+ return _regenerator.default.wrap(function (_context) {
30
30
  while (1) switch (_context.prev = _context.next) {
31
31
  case 0:
32
32
  getPermissions({
@@ -45,18 +45,18 @@ var actions = {
45
45
  fetchTeamContainers: function fetchTeamContainers(teamId, fireAnalytics) {
46
46
  return /*#__PURE__*/function () {
47
47
  var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(_ref) {
48
- var setState, getState, _getState, currentTeamId, containers;
49
- return _regenerator.default.wrap(function _callee$(_context) {
48
+ var setState, getState, _getState, currentTeamId, containers, _t;
49
+ return _regenerator.default.wrap(function (_context) {
50
50
  while (1) switch (_context.prev = _context.next) {
51
51
  case 0:
52
52
  setState = _ref.setState, getState = _ref.getState;
53
53
  _getState = getState(), currentTeamId = _getState.teamId;
54
54
  if (!(currentTeamId === teamId)) {
55
- _context.next = 4;
55
+ _context.next = 1;
56
56
  break;
57
57
  }
58
58
  return _context.abrupt("return");
59
- case 4:
59
+ case 1:
60
60
  setState({
61
61
  loading: true,
62
62
  error: null,
@@ -64,10 +64,10 @@ var actions = {
64
64
  teamId: teamId,
65
65
  hasLoaded: false
66
66
  });
67
- _context.prev = 5;
68
- _context.next = 8;
67
+ _context.prev = 2;
68
+ _context.next = 3;
69
69
  return _teamsClient.teamsClient.getTeamContainers(teamId);
70
- case 8:
70
+ case 3:
71
71
  containers = _context.sent;
72
72
  fireAnalytics('operational.fetchTeamContainers.succeeded', {
73
73
  teamId: teamId
@@ -78,29 +78,29 @@ var actions = {
78
78
  error: null,
79
79
  hasLoaded: true
80
80
  });
81
- _context.next = 17;
81
+ _context.next = 5;
82
82
  break;
83
- case 13:
84
- _context.prev = 13;
85
- _context.t0 = _context["catch"](5);
83
+ case 4:
84
+ _context.prev = 4;
85
+ _t = _context["catch"](2);
86
86
  fireAnalytics('operational.fetchTeamContainers.failed', {
87
87
  teamId: teamId,
88
88
  error: {
89
- message: _context.t0.message || JSON.stringify(_context.t0),
90
- stack: _context.t0.stack
89
+ message: _t.message || JSON.stringify(_t),
90
+ stack: _t.stack
91
91
  }
92
92
  });
93
93
  setState({
94
94
  teamContainers: [],
95
- error: _context.t0,
95
+ error: _t,
96
96
  loading: false,
97
97
  hasLoaded: true
98
98
  });
99
- case 17:
99
+ case 5:
100
100
  case "end":
101
101
  return _context.stop();
102
102
  }
103
- }, _callee, null, [[5, 13]]);
103
+ }, _callee, null, [[2, 4]]);
104
104
  }));
105
105
  return function (_x) {
106
106
  return _ref2.apply(this, arguments);
@@ -110,22 +110,22 @@ var actions = {
110
110
  refetchTeamContainers: function refetchTeamContainers(fireAnalytics) {
111
111
  return /*#__PURE__*/function () {
112
112
  var _ref4 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(_ref3) {
113
- var setState, getState, _getState2, teamId, containers;
114
- return _regenerator.default.wrap(function _callee2$(_context2) {
113
+ var setState, getState, _getState2, teamId, containers, _t2;
114
+ return _regenerator.default.wrap(function (_context2) {
115
115
  while (1) switch (_context2.prev = _context2.next) {
116
116
  case 0:
117
117
  setState = _ref3.setState, getState = _ref3.getState;
118
118
  _getState2 = getState(), teamId = _getState2.teamId;
119
119
  if (teamId) {
120
- _context2.next = 4;
120
+ _context2.next = 1;
121
121
  break;
122
122
  }
123
123
  return _context2.abrupt("return");
124
- case 4:
125
- _context2.prev = 4;
126
- _context2.next = 7;
124
+ case 1:
125
+ _context2.prev = 1;
126
+ _context2.next = 2;
127
127
  return _teamsClient.teamsClient.getTeamContainers(teamId);
128
- case 7:
128
+ case 2:
129
129
  containers = _context2.sent;
130
130
  fireAnalytics('operational.refetchTeamContainers.succeeded', {
131
131
  teamId: teamId
@@ -139,29 +139,29 @@ var actions = {
139
139
  hasLoaded: true
140
140
  });
141
141
  }
142
- _context2.next = 16;
142
+ _context2.next = 4;
143
143
  break;
144
- case 12:
145
- _context2.prev = 12;
146
- _context2.t0 = _context2["catch"](4);
144
+ case 3:
145
+ _context2.prev = 3;
146
+ _t2 = _context2["catch"](1);
147
147
  fireAnalytics('operational.refetchTeamContainers.failed', {
148
148
  teamId: teamId,
149
149
  error: {
150
- message: _context2.t0.message || JSON.stringify(_context2.t0),
151
- stack: _context2.t0.stack
150
+ message: _t2.message || JSON.stringify(_t2),
151
+ stack: _t2.stack
152
152
  }
153
153
  });
154
154
  setState({
155
155
  teamContainers: getState().teamContainers,
156
- error: _context2.t0,
156
+ error: _t2,
157
157
  loading: false,
158
158
  hasLoaded: true
159
159
  });
160
- case 16:
160
+ case 4:
161
161
  case "end":
162
162
  return _context2.stop();
163
163
  }
164
- }, _callee2, null, [[4, 12]]);
164
+ }, _callee2, null, [[1, 3]]);
165
165
  }));
166
166
  return function (_x2) {
167
167
  return _ref4.apply(this, arguments);
@@ -171,28 +171,28 @@ var actions = {
171
171
  fetchNumberOfConnectedTeams: function fetchNumberOfConnectedTeams(containerId, fireAnalytics) {
172
172
  return /*#__PURE__*/function () {
173
173
  var _ref6 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3(_ref5) {
174
- var setState, getState, _getState3, currentContainerId, numberOfTeams;
175
- return _regenerator.default.wrap(function _callee3$(_context3) {
174
+ var setState, getState, _getState3, currentContainerId, numberOfTeams, _t3;
175
+ return _regenerator.default.wrap(function (_context3) {
176
176
  while (1) switch (_context3.prev = _context3.next) {
177
177
  case 0:
178
178
  setState = _ref5.setState, getState = _ref5.getState;
179
179
  _getState3 = getState(), currentContainerId = _getState3.connectedTeams.containerId;
180
180
  if (!(currentContainerId === containerId)) {
181
- _context3.next = 4;
181
+ _context3.next = 1;
182
182
  break;
183
183
  }
184
184
  return _context3.abrupt("return");
185
- case 4:
185
+ case 1:
186
186
  setState({
187
187
  connectedTeams: _objectSpread(_objectSpread({}, initialConnectedTeamsState), {}, {
188
188
  containerId: containerId,
189
189
  numberOfTeams: undefined
190
190
  })
191
191
  });
192
- _context3.prev = 5;
193
- _context3.next = 8;
192
+ _context3.prev = 2;
193
+ _context3.next = 3;
194
194
  return _teamsClient.teamsClient.getNumberOfConnectedTeams(containerId);
195
- case 8:
195
+ case 3:
196
196
  numberOfTeams = _context3.sent;
197
197
  fireAnalytics('operational.fetchNumberOfConnectedTeams.succeeded', {
198
198
  numberOfTeams: numberOfTeams,
@@ -204,30 +204,30 @@ var actions = {
204
204
  numberOfTeams: numberOfTeams
205
205
  })
206
206
  });
207
- _context3.next = 17;
207
+ _context3.next = 5;
208
208
  break;
209
- case 13:
210
- _context3.prev = 13;
211
- _context3.t0 = _context3["catch"](5);
209
+ case 4:
210
+ _context3.prev = 4;
211
+ _t3 = _context3["catch"](2);
212
212
  fireAnalytics('operational.fetchNumberOfConnectedTeams.failed', {
213
213
  numberOfTeams: initialConnectedTeamsState.numberOfTeams || null,
214
214
  containerId: containerId,
215
215
  error: {
216
- message: _context3.t0.message || JSON.stringify(_context3.t0),
217
- stack: _context3.t0.stack
216
+ message: _t3.message || JSON.stringify(_t3),
217
+ stack: _t3.stack
218
218
  }
219
219
  });
220
220
  setState({
221
221
  connectedTeams: _objectSpread(_objectSpread({}, initialConnectedTeamsState), {}, {
222
222
  containerId: containerId,
223
- error: _context3.t0
223
+ error: _t3
224
224
  })
225
225
  });
226
- case 17:
226
+ case 5:
227
227
  case "end":
228
228
  return _context3.stop();
229
229
  }
230
- }, _callee3, null, [[5, 13]]);
230
+ }, _callee3, null, [[2, 4]]);
231
231
  }));
232
232
  return function (_x3) {
233
233
  return _ref6.apply(this, arguments);
@@ -237,18 +237,18 @@ var actions = {
237
237
  fetchConnectedTeams: function fetchConnectedTeams(containerId, fireAnalytics) {
238
238
  return /*#__PURE__*/function () {
239
239
  var _ref8 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4(_ref7) {
240
- var setState, getState, _getState4, _getState4$connectedT, currentContainerId, numberOfTeams, hasLoaded, teams;
241
- return _regenerator.default.wrap(function _callee4$(_context4) {
240
+ var setState, getState, _getState4, _getState4$connectedT, currentContainerId, numberOfTeams, hasLoaded, teams, _t4;
241
+ return _regenerator.default.wrap(function (_context4) {
242
242
  while (1) switch (_context4.prev = _context4.next) {
243
243
  case 0:
244
244
  setState = _ref7.setState, getState = _ref7.getState;
245
245
  _getState4 = getState(), _getState4$connectedT = _getState4.connectedTeams, currentContainerId = _getState4$connectedT.containerId, numberOfTeams = _getState4$connectedT.numberOfTeams, hasLoaded = _getState4$connectedT.hasLoaded;
246
246
  if (!(currentContainerId === containerId && hasLoaded)) {
247
- _context4.next = 4;
247
+ _context4.next = 1;
248
248
  break;
249
249
  }
250
250
  return _context4.abrupt("return");
251
- case 4:
251
+ case 1:
252
252
  setState({
253
253
  connectedTeams: {
254
254
  containerId: containerId,
@@ -259,10 +259,10 @@ var actions = {
259
259
  numberOfTeams: numberOfTeams
260
260
  }
261
261
  });
262
- _context4.prev = 5;
263
- _context4.next = 8;
262
+ _context4.prev = 2;
263
+ _context4.next = 3;
264
264
  return _teamsClient.teamsClient.getConnectedTeams(containerId);
265
- case 8:
265
+ case 3:
266
266
  teams = _context4.sent;
267
267
  fireAnalytics('operational.fetchConnectedTeams.succeeded', {
268
268
  numberOfTeams: numberOfTeams || null,
@@ -278,17 +278,17 @@ var actions = {
278
278
  numberOfTeams: numberOfTeams
279
279
  }
280
280
  });
281
- _context4.next = 17;
281
+ _context4.next = 5;
282
282
  break;
283
- case 13:
284
- _context4.prev = 13;
285
- _context4.t0 = _context4["catch"](5);
283
+ case 4:
284
+ _context4.prev = 4;
285
+ _t4 = _context4["catch"](2);
286
286
  fireAnalytics('operational.fetchConnectedTeams.failed', {
287
287
  numberOfTeams: numberOfTeams || null,
288
288
  containerId: containerId,
289
289
  error: {
290
- message: _context4.t0.message || JSON.stringify(_context4.t0),
291
- stack: _context4.t0.stack
290
+ message: _t4.message || JSON.stringify(_t4),
291
+ stack: _t4.stack
292
292
  }
293
293
  });
294
294
  setState({
@@ -297,15 +297,15 @@ var actions = {
297
297
  isLoading: false,
298
298
  hasLoaded: false,
299
299
  teams: [],
300
- error: _context4.t0,
300
+ error: _t4,
301
301
  numberOfTeams: numberOfTeams
302
302
  }
303
303
  });
304
- case 17:
304
+ case 5:
305
305
  case "end":
306
306
  return _context4.stop();
307
307
  }
308
- }, _callee4, null, [[5, 13]]);
308
+ }, _callee4, null, [[2, 4]]);
309
309
  }));
310
310
  return function (_x4) {
311
311
  return _ref8.apply(this, arguments);
@@ -315,18 +315,18 @@ var actions = {
315
315
  unlinkTeamContainers: function unlinkTeamContainers(teamId, containerId) {
316
316
  return /*#__PURE__*/function () {
317
317
  var _ref0 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5(_ref9) {
318
- var setState, getState, mutationResult, _getState5, teamContainers, connectedTeams, newContainers;
319
- return _regenerator.default.wrap(function _callee5$(_context5) {
318
+ var setState, getState, mutationResult, _getState5, teamContainers, connectedTeams, newContainers, _t5;
319
+ return _regenerator.default.wrap(function (_context5) {
320
320
  while (1) switch (_context5.prev = _context5.next) {
321
321
  case 0:
322
322
  setState = _ref9.setState, getState = _ref9.getState;
323
323
  setState({
324
324
  unlinkError: null
325
325
  });
326
- _context5.prev = 2;
327
- _context5.next = 5;
326
+ _context5.prev = 1;
327
+ _context5.next = 2;
328
328
  return _teamsClient.teamsClient.unlinkTeamContainer(teamId, containerId);
329
- case 5:
329
+ case 2:
330
330
  mutationResult = _context5.sent;
331
331
  if (mutationResult.deleteTeamConnectedToContainer.errors.length) {
332
332
  // Just handle 1 error at a time should be suffcient as we disconenct only 1 container at a time
@@ -349,19 +349,19 @@ var actions = {
349
349
  });
350
350
  }
351
351
  }
352
- _context5.next = 12;
352
+ _context5.next = 4;
353
353
  break;
354
- case 9:
355
- _context5.prev = 9;
356
- _context5.t0 = _context5["catch"](2);
354
+ case 3:
355
+ _context5.prev = 3;
356
+ _t5 = _context5["catch"](1);
357
357
  setState({
358
- unlinkError: _context5.t0
358
+ unlinkError: _t5
359
359
  });
360
- case 12:
360
+ case 4:
361
361
  case "end":
362
362
  return _context5.stop();
363
363
  }
364
- }, _callee5, null, [[2, 9]]);
364
+ }, _callee5, null, [[1, 3]]);
365
365
  }));
366
366
  return function (_x5) {
367
367
  return _ref0.apply(this, arguments);
@@ -372,7 +372,7 @@ var actions = {
372
372
  return /*#__PURE__*/function () {
373
373
  var _ref10 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6(_ref1) {
374
374
  var setState, getState, _getState6, teamContainers, connectedTeams, containerExists;
375
- return _regenerator.default.wrap(function _callee6$(_context6) {
375
+ return _regenerator.default.wrap(function (_context6) {
376
376
  while (1) switch (_context6.prev = _context6.next) {
377
377
  case 0:
378
378
  setState = _ref1.setState, getState = _ref1.getState;
@@ -381,11 +381,11 @@ var actions = {
381
381
  return container.id === teamContainer.id;
382
382
  });
383
383
  if (!containerExists) {
384
- _context6.next = 5;
384
+ _context6.next = 1;
385
385
  break;
386
386
  }
387
387
  return _context6.abrupt("return");
388
- case 5:
388
+ case 1:
389
389
  if (connectedTeams.containerId === teamContainer.id) {
390
390
  setState({
391
391
  teamContainers: [].concat((0, _toConsumableArray2.default)(teamContainers), [teamContainer]),
@@ -396,7 +396,7 @@ var actions = {
396
396
  teamContainers: [].concat((0, _toConsumableArray2.default)(teamContainers), [teamContainer])
397
397
  });
398
398
  }
399
- case 6:
399
+ case 2:
400
400
  case "end":
401
401
  return _context6.stop();
402
402
  }
@@ -430,7 +430,7 @@ var useTeamContainers = exports.useTeamContainers = function useTeamContainers(t
430
430
  }
431
431
  }, [teamId, actions, enable, fireEvent, useMultiTeam]);
432
432
  var refetchTeamContainers = (0, _react.useCallback)( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee7() {
433
- return _regenerator.default.wrap(function _callee7$(_context7) {
433
+ return _regenerator.default.wrap(function (_context7) {
434
434
  while (1) switch (_context7.prev = _context7.next) {
435
435
  case 0:
436
436
  return _context7.abrupt("return", actions.refetchTeamContainers(fireEvent));