@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
|
@@ -29,8 +29,8 @@ export var actions = {
|
|
|
29
29
|
getTeamWebLinks: function getTeamWebLinks(teamId) {
|
|
30
30
|
return /*#__PURE__*/function () {
|
|
31
31
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref) {
|
|
32
|
-
var getState, setState, dispatch, _getState, teams, currentTeamState, currentLinks, _yield$teamsClient$ge, entities, currentState, _currentState;
|
|
33
|
-
return _regeneratorRuntime.wrap(function
|
|
32
|
+
var getState, setState, dispatch, _getState, teams, currentTeamState, currentLinks, _yield$teamsClient$ge, entities, currentState, _currentState, _t;
|
|
33
|
+
return _regeneratorRuntime.wrap(function (_context) {
|
|
34
34
|
while (1) switch (_context.prev = _context.next) {
|
|
35
35
|
case 0:
|
|
36
36
|
getState = _ref.getState, setState = _ref.setState, dispatch = _ref.dispatch;
|
|
@@ -38,17 +38,17 @@ export var actions = {
|
|
|
38
38
|
currentTeamState = teams[teamId];
|
|
39
39
|
currentLinks = (currentTeamState === null || currentTeamState === void 0 ? void 0 : currentTeamState.links) || []; // Only skip if already loaded and not currently loading (prevents duplicate fetches)
|
|
40
40
|
if (!(currentTeamState !== null && currentTeamState !== void 0 && currentTeamState.hasLoaded && !currentTeamState.isLoading && currentLinks.length > 0)) {
|
|
41
|
-
_context.next =
|
|
41
|
+
_context.next = 1;
|
|
42
42
|
break;
|
|
43
43
|
}
|
|
44
44
|
return _context.abrupt("return");
|
|
45
|
-
case
|
|
45
|
+
case 1:
|
|
46
46
|
if (!(currentTeamState !== null && currentTeamState !== void 0 && currentTeamState.isLoading)) {
|
|
47
|
-
_context.next =
|
|
47
|
+
_context.next = 2;
|
|
48
48
|
break;
|
|
49
49
|
}
|
|
50
50
|
return _context.abrupt("return");
|
|
51
|
-
case
|
|
51
|
+
case 2:
|
|
52
52
|
setState({
|
|
53
53
|
teams: _objectSpread(_objectSpread({}, teams), {}, _defineProperty({}, teamId, _objectSpread(_objectSpread({}, getInitialTeamState()), {}, {
|
|
54
54
|
links: currentLinks,
|
|
@@ -56,20 +56,20 @@ export var actions = {
|
|
|
56
56
|
}))),
|
|
57
57
|
currentTeamId: teamId
|
|
58
58
|
});
|
|
59
|
-
_context.prev =
|
|
60
|
-
_context.next =
|
|
59
|
+
_context.prev = 3;
|
|
60
|
+
_context.next = 4;
|
|
61
61
|
return teamsClient.getTeamLinksByTeamId(teamId);
|
|
62
|
-
case
|
|
62
|
+
case 4:
|
|
63
63
|
_yield$teamsClient$ge = _context.sent;
|
|
64
64
|
entities = _yield$teamsClient$ge.entities;
|
|
65
65
|
// Get fresh state after async operation
|
|
66
66
|
currentState = getState();
|
|
67
67
|
if (!(!currentState.teams[teamId] || currentState.teams[teamId].isLoading === false)) {
|
|
68
|
-
_context.next =
|
|
68
|
+
_context.next = 5;
|
|
69
69
|
break;
|
|
70
70
|
}
|
|
71
71
|
return _context.abrupt("return");
|
|
72
|
-
case
|
|
72
|
+
case 5:
|
|
73
73
|
setState({
|
|
74
74
|
teams: _objectSpread(_objectSpread({}, currentState.teams), {}, _defineProperty({}, teamId, _objectSpread(_objectSpread({}, currentState.teams[teamId]), {}, {
|
|
75
75
|
isLoading: false,
|
|
@@ -87,35 +87,35 @@ export var actions = {
|
|
|
87
87
|
if (entities.length > 0) {
|
|
88
88
|
dispatch(actions.getTeamWebLinkIcons(teamId));
|
|
89
89
|
}
|
|
90
|
-
_context.next =
|
|
90
|
+
_context.next = 8;
|
|
91
91
|
break;
|
|
92
|
-
case
|
|
93
|
-
_context.prev =
|
|
94
|
-
|
|
92
|
+
case 6:
|
|
93
|
+
_context.prev = 6;
|
|
94
|
+
_t = _context["catch"](3);
|
|
95
95
|
// Get fresh state after async operation
|
|
96
96
|
_currentState = getState();
|
|
97
97
|
if (_currentState.teams[teamId]) {
|
|
98
|
-
_context.next =
|
|
98
|
+
_context.next = 7;
|
|
99
99
|
break;
|
|
100
100
|
}
|
|
101
101
|
return _context.abrupt("return");
|
|
102
|
-
case
|
|
102
|
+
case 7:
|
|
103
103
|
setState({
|
|
104
104
|
teams: _objectSpread(_objectSpread({}, _currentState.teams), {}, _defineProperty({}, teamId, _objectSpread(_objectSpread({}, _currentState.teams[teamId]), {}, {
|
|
105
105
|
isLoading: false,
|
|
106
106
|
hasLoaded: true,
|
|
107
107
|
hasError: true,
|
|
108
|
-
errorType:
|
|
108
|
+
errorType: _t instanceof Error ? _t : null,
|
|
109
109
|
shouldReload: false,
|
|
110
110
|
links: []
|
|
111
111
|
}))),
|
|
112
112
|
currentTeamId: teamId
|
|
113
113
|
});
|
|
114
|
-
case
|
|
114
|
+
case 8:
|
|
115
115
|
case "end":
|
|
116
116
|
return _context.stop();
|
|
117
117
|
}
|
|
118
|
-
}, _callee, null, [[
|
|
118
|
+
}, _callee, null, [[3, 6]]);
|
|
119
119
|
}));
|
|
120
120
|
return function (_x) {
|
|
121
121
|
return _ref2.apply(this, arguments);
|
|
@@ -125,26 +125,26 @@ export var actions = {
|
|
|
125
125
|
getTeamWebLinkIcons: function getTeamWebLinkIcons(teamId) {
|
|
126
126
|
return /*#__PURE__*/function () {
|
|
127
127
|
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(_ref3) {
|
|
128
|
-
var getState, setState, _getState2, teams, currentTeamState, links, currentIcons, linkUrls, uncachedUrls, newIconData, currentState, updatedTeamState, freshIcons, _currentState2, _updatedTeamState;
|
|
129
|
-
return _regeneratorRuntime.wrap(function
|
|
128
|
+
var getState, setState, _getState2, teams, currentTeamState, links, currentIcons, linkUrls, uncachedUrls, newIconData, currentState, updatedTeamState, freshIcons, _currentState2, _updatedTeamState, _t2;
|
|
129
|
+
return _regeneratorRuntime.wrap(function (_context2) {
|
|
130
130
|
while (1) switch (_context2.prev = _context2.next) {
|
|
131
131
|
case 0:
|
|
132
132
|
getState = _ref3.getState, setState = _ref3.setState;
|
|
133
133
|
_getState2 = getState(), teams = _getState2.teams;
|
|
134
134
|
currentTeamState = teams[teamId];
|
|
135
135
|
if (currentTeamState) {
|
|
136
|
-
_context2.next =
|
|
136
|
+
_context2.next = 1;
|
|
137
137
|
break;
|
|
138
138
|
}
|
|
139
139
|
return _context2.abrupt("return");
|
|
140
|
-
case
|
|
140
|
+
case 1:
|
|
141
141
|
links = currentTeamState.links, currentIcons = currentTeamState.linkIcons;
|
|
142
142
|
if (!(links.length === 0)) {
|
|
143
|
-
_context2.next =
|
|
143
|
+
_context2.next = 2;
|
|
144
144
|
break;
|
|
145
145
|
}
|
|
146
146
|
return _context2.abrupt("return");
|
|
147
|
-
case
|
|
147
|
+
case 2:
|
|
148
148
|
linkUrls = links.map(function (link) {
|
|
149
149
|
return link.linkUri;
|
|
150
150
|
});
|
|
@@ -154,19 +154,19 @@ export var actions = {
|
|
|
154
154
|
});
|
|
155
155
|
});
|
|
156
156
|
if (!(uncachedUrls.length > 0)) {
|
|
157
|
-
_context2.next =
|
|
157
|
+
_context2.next = 7;
|
|
158
158
|
break;
|
|
159
159
|
}
|
|
160
|
-
_context2.prev =
|
|
160
|
+
_context2.prev = 3;
|
|
161
161
|
setState({
|
|
162
162
|
teams: _objectSpread(_objectSpread({}, teams), {}, _defineProperty({}, teamId, _objectSpread(_objectSpread({}, currentTeamState), {}, {
|
|
163
163
|
iconsLoading: true,
|
|
164
164
|
iconsError: false
|
|
165
165
|
})))
|
|
166
166
|
});
|
|
167
|
-
_context2.next =
|
|
167
|
+
_context2.next = 4;
|
|
168
168
|
return teamsClient.getTeamLinkIcons(uncachedUrls);
|
|
169
|
-
case
|
|
169
|
+
case 4:
|
|
170
170
|
newIconData = _context2.sent;
|
|
171
171
|
currentState = getState();
|
|
172
172
|
updatedTeamState = currentState.teams[teamId];
|
|
@@ -182,11 +182,11 @@ export var actions = {
|
|
|
182
182
|
})))
|
|
183
183
|
});
|
|
184
184
|
}
|
|
185
|
-
_context2.next =
|
|
185
|
+
_context2.next = 6;
|
|
186
186
|
break;
|
|
187
|
-
case
|
|
188
|
-
_context2.prev =
|
|
189
|
-
|
|
187
|
+
case 5:
|
|
188
|
+
_context2.prev = 5;
|
|
189
|
+
_t2 = _context2["catch"](3);
|
|
190
190
|
_currentState2 = getState();
|
|
191
191
|
_updatedTeamState = _currentState2.teams[teamId];
|
|
192
192
|
if (_updatedTeamState) {
|
|
@@ -198,10 +198,10 @@ export var actions = {
|
|
|
198
198
|
})))
|
|
199
199
|
});
|
|
200
200
|
}
|
|
201
|
-
case
|
|
202
|
-
_context2.next =
|
|
201
|
+
case 6:
|
|
202
|
+
_context2.next = 8;
|
|
203
203
|
break;
|
|
204
|
-
case
|
|
204
|
+
case 7:
|
|
205
205
|
setState({
|
|
206
206
|
teams: _objectSpread(_objectSpread({}, teams), {}, _defineProperty({}, teamId, _objectSpread(_objectSpread({}, currentTeamState), {}, {
|
|
207
207
|
iconsLoading: false,
|
|
@@ -209,11 +209,11 @@ export var actions = {
|
|
|
209
209
|
iconHasLoaded: true
|
|
210
210
|
})))
|
|
211
211
|
});
|
|
212
|
-
case
|
|
212
|
+
case 8:
|
|
213
213
|
case "end":
|
|
214
214
|
return _context2.stop();
|
|
215
215
|
}
|
|
216
|
-
}, _callee2, null, [[
|
|
216
|
+
}, _callee2, null, [[3, 5]]);
|
|
217
217
|
}));
|
|
218
218
|
return function (_x2) {
|
|
219
219
|
return _ref4.apply(this, arguments);
|
|
@@ -224,22 +224,22 @@ export var actions = {
|
|
|
224
224
|
return /*#__PURE__*/function () {
|
|
225
225
|
var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(_ref5) {
|
|
226
226
|
var getState, setState, dispatch, result, currentState, currentTeamState;
|
|
227
|
-
return _regeneratorRuntime.wrap(function
|
|
227
|
+
return _regeneratorRuntime.wrap(function (_context3) {
|
|
228
228
|
while (1) switch (_context3.prev = _context3.next) {
|
|
229
229
|
case 0:
|
|
230
230
|
getState = _ref5.getState, setState = _ref5.setState, dispatch = _ref5.dispatch;
|
|
231
|
-
_context3.next =
|
|
231
|
+
_context3.next = 1;
|
|
232
232
|
return teamsClient.createTeamLink(teamId, newLink);
|
|
233
|
-
case
|
|
233
|
+
case 1:
|
|
234
234
|
result = _context3.sent;
|
|
235
235
|
currentState = getState();
|
|
236
236
|
currentTeamState = currentState.teams[teamId];
|
|
237
237
|
if (currentTeamState) {
|
|
238
|
-
_context3.next =
|
|
238
|
+
_context3.next = 2;
|
|
239
239
|
break;
|
|
240
240
|
}
|
|
241
241
|
return _context3.abrupt("return", result);
|
|
242
|
-
case
|
|
242
|
+
case 2:
|
|
243
243
|
setState({
|
|
244
244
|
teams: _objectSpread(_objectSpread({}, currentState.teams), {}, _defineProperty({}, teamId, _objectSpread(_objectSpread({}, currentTeamState), {}, {
|
|
245
245
|
links: [].concat(_toConsumableArray(currentTeamState.links), [result])
|
|
@@ -247,7 +247,7 @@ export var actions = {
|
|
|
247
247
|
});
|
|
248
248
|
dispatch(actions.getTeamWebLinkIcons(teamId));
|
|
249
249
|
return _context3.abrupt("return", result);
|
|
250
|
-
case
|
|
250
|
+
case 3:
|
|
251
251
|
case "end":
|
|
252
252
|
return _context3.stop();
|
|
253
253
|
}
|
|
@@ -262,22 +262,22 @@ export var actions = {
|
|
|
262
262
|
return /*#__PURE__*/function () {
|
|
263
263
|
var _ref8 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(_ref7) {
|
|
264
264
|
var getState, setState, dispatch, result, _getState3, teams, currentTeamState, oldLink, urlChanged, freshState, freshTeamState, updatedIcons;
|
|
265
|
-
return _regeneratorRuntime.wrap(function
|
|
265
|
+
return _regeneratorRuntime.wrap(function (_context4) {
|
|
266
266
|
while (1) switch (_context4.prev = _context4.next) {
|
|
267
267
|
case 0:
|
|
268
268
|
getState = _ref7.getState, setState = _ref7.setState, dispatch = _ref7.dispatch;
|
|
269
|
-
_context4.next =
|
|
269
|
+
_context4.next = 1;
|
|
270
270
|
return teamsClient.updateTeamLink(teamId, linkId, newLink);
|
|
271
|
-
case
|
|
271
|
+
case 1:
|
|
272
272
|
result = _context4.sent;
|
|
273
273
|
_getState3 = getState(), teams = _getState3.teams;
|
|
274
274
|
currentTeamState = teams[teamId];
|
|
275
275
|
if (currentTeamState) {
|
|
276
|
-
_context4.next =
|
|
276
|
+
_context4.next = 2;
|
|
277
277
|
break;
|
|
278
278
|
}
|
|
279
279
|
return _context4.abrupt("return", result);
|
|
280
|
-
case
|
|
280
|
+
case 2:
|
|
281
281
|
oldLink = currentTeamState.links.find(function (link) {
|
|
282
282
|
return link.linkId === linkId;
|
|
283
283
|
});
|
|
@@ -290,18 +290,18 @@ export var actions = {
|
|
|
290
290
|
})))
|
|
291
291
|
});
|
|
292
292
|
if (!(urlChanged && oldLink)) {
|
|
293
|
-
_context4.next =
|
|
293
|
+
_context4.next = 4;
|
|
294
294
|
break;
|
|
295
295
|
}
|
|
296
296
|
// Get fresh state to ensure we have the updated links
|
|
297
297
|
freshState = getState();
|
|
298
298
|
freshTeamState = freshState.teams[teamId];
|
|
299
299
|
if (freshTeamState) {
|
|
300
|
-
_context4.next =
|
|
300
|
+
_context4.next = 3;
|
|
301
301
|
break;
|
|
302
302
|
}
|
|
303
303
|
return _context4.abrupt("return", result);
|
|
304
|
-
case
|
|
304
|
+
case 3:
|
|
305
305
|
updatedIcons = freshTeamState.linkIcons.filter(function (icon) {
|
|
306
306
|
return icon.linkUrl !== oldLink.linkUri;
|
|
307
307
|
});
|
|
@@ -311,9 +311,9 @@ export var actions = {
|
|
|
311
311
|
})))
|
|
312
312
|
});
|
|
313
313
|
dispatch(actions.getTeamWebLinkIcons(teamId));
|
|
314
|
-
case
|
|
314
|
+
case 4:
|
|
315
315
|
return _context4.abrupt("return", result);
|
|
316
|
-
case
|
|
316
|
+
case 5:
|
|
317
317
|
case "end":
|
|
318
318
|
return _context4.stop();
|
|
319
319
|
}
|
|
@@ -328,22 +328,22 @@ export var actions = {
|
|
|
328
328
|
return /*#__PURE__*/function () {
|
|
329
329
|
var _ref0 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5(_ref9) {
|
|
330
330
|
var getState, setState, currentState, currentTeamState;
|
|
331
|
-
return _regeneratorRuntime.wrap(function
|
|
331
|
+
return _regeneratorRuntime.wrap(function (_context5) {
|
|
332
332
|
while (1) switch (_context5.prev = _context5.next) {
|
|
333
333
|
case 0:
|
|
334
334
|
getState = _ref9.getState, setState = _ref9.setState;
|
|
335
|
-
_context5.next =
|
|
335
|
+
_context5.next = 1;
|
|
336
336
|
return teamsClient.deleteTeamLink(teamId, linkId);
|
|
337
|
-
case
|
|
337
|
+
case 1:
|
|
338
338
|
// Get fresh state after async operation
|
|
339
339
|
currentState = getState();
|
|
340
340
|
currentTeamState = currentState.teams[teamId];
|
|
341
341
|
if (currentTeamState) {
|
|
342
|
-
_context5.next =
|
|
342
|
+
_context5.next = 2;
|
|
343
343
|
break;
|
|
344
344
|
}
|
|
345
345
|
return _context5.abrupt("return");
|
|
346
|
-
case
|
|
346
|
+
case 2:
|
|
347
347
|
setState({
|
|
348
348
|
teams: _objectSpread(_objectSpread({}, currentState.teams), {}, _defineProperty({}, teamId, _objectSpread(_objectSpread({}, currentTeamState), {}, {
|
|
349
349
|
links: currentTeamState.links.filter(function (link) {
|
|
@@ -351,7 +351,7 @@ export var actions = {
|
|
|
351
351
|
})
|
|
352
352
|
})))
|
|
353
353
|
});
|
|
354
|
-
case
|
|
354
|
+
case 3:
|
|
355
355
|
case "end":
|
|
356
356
|
return _context5.stop();
|
|
357
357
|
}
|
|
@@ -365,32 +365,32 @@ export var actions = {
|
|
|
365
365
|
fetchWebLinkTitle: function fetchWebLinkTitle(url) {
|
|
366
366
|
return /*#__PURE__*/function () {
|
|
367
367
|
var _ref10 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6(_ref1) {
|
|
368
|
-
var setState, title;
|
|
369
|
-
return _regeneratorRuntime.wrap(function
|
|
368
|
+
var setState, title, _t3;
|
|
369
|
+
return _regeneratorRuntime.wrap(function (_context6) {
|
|
370
370
|
while (1) switch (_context6.prev = _context6.next) {
|
|
371
371
|
case 0:
|
|
372
372
|
setState = _ref1.setState;
|
|
373
373
|
if (url) {
|
|
374
|
-
_context6.next =
|
|
374
|
+
_context6.next = 1;
|
|
375
375
|
break;
|
|
376
376
|
}
|
|
377
377
|
return _context6.abrupt("return", undefined);
|
|
378
|
-
case
|
|
379
|
-
_context6.prev =
|
|
380
|
-
_context6.next =
|
|
378
|
+
case 1:
|
|
379
|
+
_context6.prev = 1;
|
|
380
|
+
_context6.next = 2;
|
|
381
381
|
return teamsClient.getWebLinkTitle(url);
|
|
382
|
-
case
|
|
382
|
+
case 2:
|
|
383
383
|
title = _context6.sent;
|
|
384
384
|
return _context6.abrupt("return", title);
|
|
385
|
-
case
|
|
386
|
-
_context6.prev =
|
|
387
|
-
|
|
385
|
+
case 3:
|
|
386
|
+
_context6.prev = 3;
|
|
387
|
+
_t3 = _context6["catch"](1);
|
|
388
388
|
return _context6.abrupt("return", undefined);
|
|
389
|
-
case
|
|
389
|
+
case 4:
|
|
390
390
|
case "end":
|
|
391
391
|
return _context6.stop();
|
|
392
392
|
}
|
|
393
|
-
}, _callee6, null, [[
|
|
393
|
+
}, _callee6, null, [[1, 3]]);
|
|
394
394
|
}));
|
|
395
395
|
return function (_x6) {
|
|
396
396
|
return _ref10.apply(this, arguments);
|
|
@@ -11,33 +11,33 @@ var actions = {
|
|
|
11
11
|
permissionIds = _ref$permissionIds === void 0 ? ['manage', 'write'] : _ref$permissionIds;
|
|
12
12
|
return /*#__PURE__*/function () {
|
|
13
13
|
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref2) {
|
|
14
|
-
var setState, getState, dispatch, _getState, hasLoaded, isLoading, permissions, shouldFetch, response, _permissions;
|
|
15
|
-
return _regeneratorRuntime.wrap(function
|
|
14
|
+
var setState, getState, dispatch, _getState, hasLoaded, isLoading, permissions, shouldFetch, response, _permissions, _t;
|
|
15
|
+
return _regeneratorRuntime.wrap(function (_context) {
|
|
16
16
|
while (1) switch (_context.prev = _context.next) {
|
|
17
17
|
case 0:
|
|
18
18
|
setState = _ref2.setState, getState = _ref2.getState, dispatch = _ref2.dispatch;
|
|
19
19
|
_getState = getState(), hasLoaded = _getState.hasLoaded, isLoading = _getState.isLoading, permissions = _getState.permissions;
|
|
20
20
|
if (!(isLoading || !userId || !cloudId || !enabled)) {
|
|
21
|
-
_context.next =
|
|
21
|
+
_context.next = 1;
|
|
22
22
|
break;
|
|
23
23
|
}
|
|
24
24
|
return _context.abrupt("return");
|
|
25
|
-
case
|
|
25
|
+
case 1:
|
|
26
26
|
shouldFetch = !hasLoaded || permissionIds.some(function (permissionId) {
|
|
27
27
|
var _permissions$confluen, _permissions$jira, _permissions$loom;
|
|
28
28
|
return ((_permissions$confluen = permissions.confluence) === null || _permissions$confluen === void 0 ? void 0 : _permissions$confluen[permissionId]) === undefined || ((_permissions$jira = permissions.jira) === null || _permissions$jira === void 0 ? void 0 : _permissions$jira[permissionId]) === undefined || ((_permissions$loom = permissions.loom) === null || _permissions$loom === void 0 ? void 0 : _permissions$loom[permissionId]) === undefined;
|
|
29
29
|
});
|
|
30
30
|
if (shouldFetch) {
|
|
31
|
-
_context.next =
|
|
31
|
+
_context.next = 2;
|
|
32
32
|
break;
|
|
33
33
|
}
|
|
34
34
|
return _context.abrupt("return");
|
|
35
|
-
case
|
|
36
|
-
_context.prev =
|
|
35
|
+
case 2:
|
|
36
|
+
_context.prev = 2;
|
|
37
37
|
setState({
|
|
38
38
|
isLoading: true
|
|
39
39
|
});
|
|
40
|
-
_context.next =
|
|
40
|
+
_context.next = 3;
|
|
41
41
|
return fetch('/gateway/api/permissions/bulk/permitted', {
|
|
42
42
|
headers: {
|
|
43
43
|
'Content-Type': 'application/json'
|
|
@@ -46,30 +46,30 @@ var actions = {
|
|
|
46
46
|
credentials: 'include',
|
|
47
47
|
body: getProductPermissionRequestBody(cloudId, userId, permissionIds)
|
|
48
48
|
});
|
|
49
|
-
case
|
|
49
|
+
case 3:
|
|
50
50
|
response = _context.sent;
|
|
51
51
|
if (response.ok) {
|
|
52
|
-
_context.next =
|
|
52
|
+
_context.next = 4;
|
|
53
53
|
break;
|
|
54
54
|
}
|
|
55
55
|
throw new Error('Failed to fetch product permissions');
|
|
56
|
-
case
|
|
57
|
-
_context.next =
|
|
56
|
+
case 4:
|
|
57
|
+
_context.next = 5;
|
|
58
58
|
return response.json();
|
|
59
|
-
case
|
|
59
|
+
case 5:
|
|
60
60
|
_permissions = _context.sent;
|
|
61
61
|
dispatch(actions.setPermissions(_permissions));
|
|
62
|
-
_context.next =
|
|
62
|
+
_context.next = 7;
|
|
63
63
|
break;
|
|
64
|
-
case
|
|
65
|
-
_context.prev =
|
|
66
|
-
|
|
64
|
+
case 6:
|
|
65
|
+
_context.prev = 6;
|
|
66
|
+
_t = _context["catch"](2);
|
|
67
67
|
dispatch(actions.setError(new Error('Failed to fetch product permissions')));
|
|
68
|
-
case
|
|
68
|
+
case 7:
|
|
69
69
|
case "end":
|
|
70
70
|
return _context.stop();
|
|
71
71
|
}
|
|
72
|
-
}, _callee, null, [[
|
|
72
|
+
}, _callee, null, [[2, 6]]);
|
|
73
73
|
}));
|
|
74
74
|
return function (_x) {
|
|
75
75
|
return _ref3.apply(this, arguments);
|
|
@@ -6,8 +6,7 @@ import { ax, ix } from "@compiled/react/runtime";
|
|
|
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 React, { useState } from 'react';
|
|
9
|
-
import {
|
|
10
|
-
import { Anchor, Box, Flex, Inline, Stack, Text } from '@atlaskit/primitives/compiled';
|
|
9
|
+
import { Box, Flex, Inline, Stack, Text } from '@atlaskit/primitives/compiled';
|
|
11
10
|
import { useAnalyticsEvents } from '@atlaskit/teams-app-internal-analytics';
|
|
12
11
|
import { TeamsAnchor } from '@atlaskit/teams-app-internal-navigation';
|
|
13
12
|
import { ContainerIcon } from '../../../../common/ui/container-icon';
|
|
@@ -111,7 +110,7 @@ export var TeamLinkCard = function TeamLinkCard(_ref) {
|
|
|
111
110
|
title: title,
|
|
112
111
|
containerIcon: containerIcon,
|
|
113
112
|
size: "small"
|
|
114
|
-
}),
|
|
113
|
+
}), /*#__PURE__*/React.createElement(TeamsAnchor, {
|
|
115
114
|
xcss: styles.anchor,
|
|
116
115
|
href: link || '#',
|
|
117
116
|
onClick: handleLinkClick,
|
|
@@ -133,27 +132,6 @@ export var TeamLinkCard = function TeamLinkCard(_ref) {
|
|
|
133
132
|
}, containerTypeText), containerTypeText && description && /*#__PURE__*/React.createElement(Separator, null), description && /*#__PURE__*/React.createElement(Text, {
|
|
134
133
|
size: "small",
|
|
135
134
|
color: "color.text.subtle"
|
|
136
|
-
}, description))))) : /*#__PURE__*/React.createElement(Anchor, {
|
|
137
|
-
xcss: styles.anchor,
|
|
138
|
-
href: link || '#',
|
|
139
|
-
onClick: handleLinkClick,
|
|
140
|
-
testId: "team-link-card-linkable-content"
|
|
141
|
-
}, /*#__PURE__*/React.createElement(Stack, {
|
|
142
|
-
space: "space.025"
|
|
143
|
-
}, /*#__PURE__*/React.createElement(Text, {
|
|
144
|
-
maxLines: 1,
|
|
145
|
-
color: "color.text"
|
|
146
|
-
}, title), /*#__PURE__*/React.createElement(Flex, {
|
|
147
|
-
gap: "space.050",
|
|
148
|
-
alignItems: "center"
|
|
149
|
-
}, /*#__PURE__*/React.createElement(Inline, {
|
|
150
|
-
space: "space.050"
|
|
151
|
-
}, containerTypeText && /*#__PURE__*/React.createElement(Text, {
|
|
152
|
-
size: "small",
|
|
153
|
-
color: "color.text.subtle"
|
|
154
|
-
}, containerTypeText), containerTypeText && description && /*#__PURE__*/React.createElement(Separator, null), description && /*#__PURE__*/React.createElement(Text, {
|
|
155
|
-
size: "small",
|
|
156
|
-
color: "color.text.subtle"
|
|
157
135
|
}, description))))), !isReadOnly && /*#__PURE__*/React.createElement(TeamLinkCardActions, {
|
|
158
136
|
containerType: containerType,
|
|
159
137
|
title: title,
|
|
@@ -57,15 +57,15 @@ export var DisconnectDialog = function DisconnectDialog(_ref) {
|
|
|
57
57
|
setIsDisconnecting = _React$useState2[1];
|
|
58
58
|
var handleDisconnect = /*#__PURE__*/function () {
|
|
59
59
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
60
|
-
return _regeneratorRuntime.wrap(function
|
|
60
|
+
return _regeneratorRuntime.wrap(function (_context) {
|
|
61
61
|
while (1) switch (_context.prev = _context.next) {
|
|
62
62
|
case 0:
|
|
63
63
|
setIsDisconnecting(true);
|
|
64
|
-
_context.next =
|
|
64
|
+
_context.next = 1;
|
|
65
65
|
return onDisconnect();
|
|
66
|
-
case
|
|
66
|
+
case 1:
|
|
67
67
|
setIsDisconnecting(false);
|
|
68
|
-
case
|
|
68
|
+
case 2:
|
|
69
69
|
case "end":
|
|
70
70
|
return _context.stop();
|
|
71
71
|
}
|
|
@@ -183,25 +183,25 @@ export var TeamContainers = function TeamContainers(_ref) {
|
|
|
183
183
|
var handleDisconnect = useCallback( /*#__PURE__*/function () {
|
|
184
184
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(containerId) {
|
|
185
185
|
var removedContainer, wasCancelled;
|
|
186
|
-
return _regeneratorRuntime.wrap(function
|
|
186
|
+
return _regeneratorRuntime.wrap(function (_context) {
|
|
187
187
|
while (1) switch (_context.prev = _context.next) {
|
|
188
188
|
case 0:
|
|
189
189
|
removedContainer = filteredTeamLinks.find(function (container) {
|
|
190
190
|
return container.id === containerId;
|
|
191
191
|
});
|
|
192
192
|
if (!removedContainer) {
|
|
193
|
-
_context.next =
|
|
193
|
+
_context.next = 2;
|
|
194
194
|
break;
|
|
195
195
|
}
|
|
196
|
-
_context.next =
|
|
196
|
+
_context.next = 1;
|
|
197
197
|
return removeTeamLink(removedContainer);
|
|
198
|
-
case
|
|
199
|
-
_context.next =
|
|
198
|
+
case 1:
|
|
199
|
+
_context.next = 3;
|
|
200
200
|
break;
|
|
201
|
-
case
|
|
202
|
-
_context.next =
|
|
201
|
+
case 2:
|
|
202
|
+
_context.next = 3;
|
|
203
203
|
return actions.unlinkTeamContainers(teamId, containerId);
|
|
204
|
-
case
|
|
204
|
+
case 3:
|
|
205
205
|
setIsDisconnectDialogOpen(false);
|
|
206
206
|
if (unlinkError) {
|
|
207
207
|
fireEvent('track.teamContainerUnlinked.failed', {});
|
|
@@ -223,7 +223,7 @@ export var TeamContainers = function TeamContainers(_ref) {
|
|
|
223
223
|
teamId: teamId
|
|
224
224
|
});
|
|
225
225
|
}
|
|
226
|
-
case
|
|
226
|
+
case 4:
|
|
227
227
|
case "end":
|
|
228
228
|
return _context.stop();
|
|
229
229
|
}
|
package/package.json
CHANGED
|
@@ -32,28 +32,28 @@
|
|
|
32
32
|
"atlaskit:src": "src/index.ts",
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@atlaskit/afm-i18n-platform-people-and-teams-teams-public": "2.39.0",
|
|
35
|
-
"@atlaskit/analytics-next": "^11.
|
|
36
|
-
"@atlaskit/avatar": "^25.
|
|
35
|
+
"@atlaskit/analytics-next": "^11.3.0",
|
|
36
|
+
"@atlaskit/avatar": "^25.15.0",
|
|
37
37
|
"@atlaskit/button": "^23.11.0",
|
|
38
38
|
"@atlaskit/css": "^0.19.0",
|
|
39
|
-
"@atlaskit/dropdown-menu": "^16.
|
|
40
|
-
"@atlaskit/feature-gate-js-client": "^5.
|
|
39
|
+
"@atlaskit/dropdown-menu": "^16.10.0",
|
|
40
|
+
"@atlaskit/feature-gate-js-client": "^5.7.0",
|
|
41
41
|
"@atlaskit/heading": "^5.4.0",
|
|
42
|
-
"@atlaskit/icon": "^
|
|
42
|
+
"@atlaskit/icon": "^35.4.0",
|
|
43
43
|
"@atlaskit/image": "^3.0.0",
|
|
44
44
|
"@atlaskit/link": "^3.4.0",
|
|
45
|
-
"@atlaskit/modal-dialog": "^15.
|
|
46
|
-
"@atlaskit/people-teams-ui-public": "^4.
|
|
45
|
+
"@atlaskit/modal-dialog": "^15.2.0",
|
|
46
|
+
"@atlaskit/people-teams-ui-public": "^4.1.0",
|
|
47
47
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
48
48
|
"@atlaskit/primitives": "^19.0.0",
|
|
49
49
|
"@atlaskit/skeleton": "^2.1.0",
|
|
50
|
-
"@atlaskit/teams-app-internal-analytics": "^1.
|
|
50
|
+
"@atlaskit/teams-app-internal-analytics": "^1.32.0",
|
|
51
51
|
"@atlaskit/teams-app-internal-navigation": "^1.9.0",
|
|
52
52
|
"@atlaskit/teams-app-internal-product-permissions": "^1.4.0",
|
|
53
|
-
"@atlaskit/teams-client": "^4.
|
|
53
|
+
"@atlaskit/teams-client": "^4.33.0",
|
|
54
54
|
"@atlaskit/tile": "^1.1.0",
|
|
55
|
-
"@atlaskit/tokens": "^13.
|
|
56
|
-
"@atlaskit/tooltip": "^22.
|
|
55
|
+
"@atlaskit/tokens": "^13.1.0",
|
|
56
|
+
"@atlaskit/tooltip": "^22.6.0",
|
|
57
57
|
"@babel/runtime": "^7.0.0",
|
|
58
58
|
"@compiled/react": "^0.20.0",
|
|
59
59
|
"@types/string-hash": "^1.1.3",
|
|
@@ -77,9 +77,10 @@
|
|
|
77
77
|
"@atlassian/ptc-test-utils": "^0.13.0",
|
|
78
78
|
"@atlassian/react-compiler-gating": "workspace:^",
|
|
79
79
|
"@atlassian/teams-app-internal-playground": "^2.6.0",
|
|
80
|
-
"@atlassian/testing-library": "^0.
|
|
80
|
+
"@atlassian/testing-library": "^0.6.0",
|
|
81
81
|
"@testing-library/react": "^16.3.0",
|
|
82
82
|
"@testing-library/user-event": "^14.4.3",
|
|
83
|
+
"react": "^18.2.0",
|
|
83
84
|
"react-dom": "^18.2.0",
|
|
84
85
|
"react-intl": "^6.6.2"
|
|
85
86
|
},
|
|
@@ -118,7 +119,7 @@
|
|
|
118
119
|
}
|
|
119
120
|
},
|
|
120
121
|
"name": "@atlaskit/teams-public",
|
|
121
|
-
"version": "1.4.
|
|
122
|
+
"version": "1.4.2",
|
|
122
123
|
"description": "Public components related to teams",
|
|
123
124
|
"author": "Atlassian Pty Ltd",
|
|
124
125
|
"license": "Apache-2.0",
|
|
@@ -148,9 +149,6 @@
|
|
|
148
149
|
"workforce_optimization_team_modal_update": {
|
|
149
150
|
"type": "boolean"
|
|
150
151
|
},
|
|
151
|
-
"ptc-links-migrate-atlaskit-anchor-to-teams-anchor": {
|
|
152
|
-
"type": "boolean"
|
|
153
|
-
},
|
|
154
152
|
"enable_teams_t26_design_drop_core_experiences": {
|
|
155
153
|
"type": "boolean"
|
|
156
154
|
}
|