@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
|
@@ -32,18 +32,18 @@ var actions = exports.actions = {
|
|
|
32
32
|
getTeamWebLinks: function getTeamWebLinks(teamId) {
|
|
33
33
|
return /*#__PURE__*/function () {
|
|
34
34
|
var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(_ref) {
|
|
35
|
-
var getState, setState, dispatch, _getState, links, currentTeamId, hasLoaded, isLoading, initialLinks, _yield$teamsClient$ge, entities;
|
|
36
|
-
return _regenerator.default.wrap(function
|
|
35
|
+
var getState, setState, dispatch, _getState, links, currentTeamId, hasLoaded, isLoading, initialLinks, _yield$teamsClient$ge, entities, _t;
|
|
36
|
+
return _regenerator.default.wrap(function (_context) {
|
|
37
37
|
while (1) switch (_context.prev = _context.next) {
|
|
38
38
|
case 0:
|
|
39
39
|
getState = _ref.getState, setState = _ref.setState, dispatch = _ref.dispatch;
|
|
40
40
|
_getState = getState(), links = _getState.links, currentTeamId = _getState.teamId, hasLoaded = _getState.hasLoaded, isLoading = _getState.isLoading;
|
|
41
41
|
if (!(isLoading || teamId === currentTeamId && hasLoaded && links.length > 0)) {
|
|
42
|
-
_context.next =
|
|
42
|
+
_context.next = 1;
|
|
43
43
|
break;
|
|
44
44
|
}
|
|
45
45
|
return _context.abrupt("return");
|
|
46
|
-
case
|
|
46
|
+
case 1:
|
|
47
47
|
initialLinks = teamId === currentTeamId ? links : [];
|
|
48
48
|
setState({
|
|
49
49
|
teamId: teamId,
|
|
@@ -53,18 +53,18 @@ var actions = exports.actions = {
|
|
|
53
53
|
shouldReload: false,
|
|
54
54
|
links: initialLinks
|
|
55
55
|
});
|
|
56
|
-
_context.prev =
|
|
57
|
-
_context.next =
|
|
56
|
+
_context.prev = 2;
|
|
57
|
+
_context.next = 3;
|
|
58
58
|
return _teamsClient.teamsClient.getTeamLinksByTeamId(teamId);
|
|
59
|
-
case
|
|
59
|
+
case 3:
|
|
60
60
|
_yield$teamsClient$ge = _context.sent;
|
|
61
61
|
entities = _yield$teamsClient$ge.entities;
|
|
62
62
|
if (!(getState().teamId !== teamId)) {
|
|
63
|
-
_context.next =
|
|
63
|
+
_context.next = 4;
|
|
64
64
|
break;
|
|
65
65
|
}
|
|
66
66
|
return _context.abrupt("return");
|
|
67
|
-
case
|
|
67
|
+
case 4:
|
|
68
68
|
setState({
|
|
69
69
|
isLoading: false,
|
|
70
70
|
hasLoaded: true,
|
|
@@ -75,30 +75,30 @@ var actions = exports.actions = {
|
|
|
75
75
|
if (entities.length > 0) {
|
|
76
76
|
dispatch(actions.getTeamWebLinkIcons(teamId));
|
|
77
77
|
}
|
|
78
|
-
_context.next =
|
|
78
|
+
_context.next = 7;
|
|
79
79
|
break;
|
|
80
|
-
case
|
|
81
|
-
_context.prev =
|
|
82
|
-
|
|
80
|
+
case 5:
|
|
81
|
+
_context.prev = 5;
|
|
82
|
+
_t = _context["catch"](2);
|
|
83
83
|
if (!(getState().teamId !== teamId)) {
|
|
84
|
-
_context.next =
|
|
84
|
+
_context.next = 6;
|
|
85
85
|
break;
|
|
86
86
|
}
|
|
87
87
|
return _context.abrupt("return");
|
|
88
|
-
case
|
|
88
|
+
case 6:
|
|
89
89
|
setState({
|
|
90
90
|
isLoading: false,
|
|
91
91
|
hasLoaded: true,
|
|
92
92
|
hasError: true,
|
|
93
|
-
errorType:
|
|
93
|
+
errorType: _t instanceof Error ? _t : undefined,
|
|
94
94
|
shouldReload: false,
|
|
95
95
|
links: []
|
|
96
96
|
});
|
|
97
|
-
case
|
|
97
|
+
case 7:
|
|
98
98
|
case "end":
|
|
99
99
|
return _context.stop();
|
|
100
100
|
}
|
|
101
|
-
}, _callee, null, [[
|
|
101
|
+
}, _callee, null, [[2, 5]]);
|
|
102
102
|
}));
|
|
103
103
|
return function (_x) {
|
|
104
104
|
return _ref2.apply(this, arguments);
|
|
@@ -108,18 +108,18 @@ var actions = exports.actions = {
|
|
|
108
108
|
getTeamWebLinkIcons: function getTeamWebLinkIcons(teamId) {
|
|
109
109
|
return /*#__PURE__*/function () {
|
|
110
110
|
var _ref4 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(_ref3) {
|
|
111
|
-
var getState, setState, _getState2, links, currentIcons, linkUrls, uncachedUrls, newIconData;
|
|
112
|
-
return _regenerator.default.wrap(function
|
|
111
|
+
var getState, setState, _getState2, links, currentIcons, linkUrls, uncachedUrls, newIconData, _t2;
|
|
112
|
+
return _regenerator.default.wrap(function (_context2) {
|
|
113
113
|
while (1) switch (_context2.prev = _context2.next) {
|
|
114
114
|
case 0:
|
|
115
115
|
getState = _ref3.getState, setState = _ref3.setState;
|
|
116
116
|
_getState2 = getState(), links = _getState2.links, currentIcons = _getState2.linkIcons;
|
|
117
117
|
if (!(links.length === 0)) {
|
|
118
|
-
_context2.next =
|
|
118
|
+
_context2.next = 1;
|
|
119
119
|
break;
|
|
120
120
|
}
|
|
121
121
|
return _context2.abrupt("return");
|
|
122
|
-
case
|
|
122
|
+
case 1:
|
|
123
123
|
linkUrls = links.map(function (link) {
|
|
124
124
|
return link.linkUri;
|
|
125
125
|
});
|
|
@@ -129,17 +129,17 @@ var actions = exports.actions = {
|
|
|
129
129
|
});
|
|
130
130
|
});
|
|
131
131
|
if (!(uncachedUrls.length > 0)) {
|
|
132
|
-
_context2.next =
|
|
132
|
+
_context2.next = 6;
|
|
133
133
|
break;
|
|
134
134
|
}
|
|
135
|
-
_context2.prev =
|
|
135
|
+
_context2.prev = 2;
|
|
136
136
|
setState({
|
|
137
137
|
iconsLoading: true,
|
|
138
138
|
iconsError: false
|
|
139
139
|
});
|
|
140
|
-
_context2.next =
|
|
140
|
+
_context2.next = 3;
|
|
141
141
|
return _teamsClient.teamsClient.getTeamLinkIcons(uncachedUrls);
|
|
142
|
-
case
|
|
142
|
+
case 3:
|
|
143
143
|
newIconData = _context2.sent;
|
|
144
144
|
if (getState().teamId === teamId) {
|
|
145
145
|
setState({
|
|
@@ -149,11 +149,11 @@ var actions = exports.actions = {
|
|
|
149
149
|
iconHasLoaded: true
|
|
150
150
|
});
|
|
151
151
|
}
|
|
152
|
-
_context2.next =
|
|
152
|
+
_context2.next = 5;
|
|
153
153
|
break;
|
|
154
|
-
case
|
|
155
|
-
_context2.prev =
|
|
156
|
-
|
|
154
|
+
case 4:
|
|
155
|
+
_context2.prev = 4;
|
|
156
|
+
_t2 = _context2["catch"](2);
|
|
157
157
|
if (getState().teamId === teamId) {
|
|
158
158
|
setState({
|
|
159
159
|
iconsLoading: false,
|
|
@@ -161,20 +161,20 @@ var actions = exports.actions = {
|
|
|
161
161
|
iconHasLoaded: true
|
|
162
162
|
});
|
|
163
163
|
}
|
|
164
|
-
case
|
|
165
|
-
_context2.next =
|
|
164
|
+
case 5:
|
|
165
|
+
_context2.next = 7;
|
|
166
166
|
break;
|
|
167
|
-
case
|
|
167
|
+
case 6:
|
|
168
168
|
setState({
|
|
169
169
|
iconsLoading: false,
|
|
170
170
|
iconsError: false,
|
|
171
171
|
iconHasLoaded: true
|
|
172
172
|
});
|
|
173
|
-
case
|
|
173
|
+
case 7:
|
|
174
174
|
case "end":
|
|
175
175
|
return _context2.stop();
|
|
176
176
|
}
|
|
177
|
-
}, _callee2, null, [[
|
|
177
|
+
}, _callee2, null, [[2, 4]]);
|
|
178
178
|
}));
|
|
179
179
|
return function (_x2) {
|
|
180
180
|
return _ref4.apply(this, arguments);
|
|
@@ -185,27 +185,27 @@ var actions = exports.actions = {
|
|
|
185
185
|
return /*#__PURE__*/function () {
|
|
186
186
|
var _ref6 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3(_ref5) {
|
|
187
187
|
var getState, setState, dispatch, result, currentState;
|
|
188
|
-
return _regenerator.default.wrap(function
|
|
188
|
+
return _regenerator.default.wrap(function (_context3) {
|
|
189
189
|
while (1) switch (_context3.prev = _context3.next) {
|
|
190
190
|
case 0:
|
|
191
191
|
getState = _ref5.getState, setState = _ref5.setState, dispatch = _ref5.dispatch;
|
|
192
|
-
_context3.next =
|
|
192
|
+
_context3.next = 1;
|
|
193
193
|
return _teamsClient.teamsClient.createTeamLink(teamId, newLink);
|
|
194
|
-
case
|
|
194
|
+
case 1:
|
|
195
195
|
result = _context3.sent;
|
|
196
196
|
currentState = getState();
|
|
197
197
|
if (!(currentState.teamId !== teamId)) {
|
|
198
|
-
_context3.next =
|
|
198
|
+
_context3.next = 2;
|
|
199
199
|
break;
|
|
200
200
|
}
|
|
201
201
|
return _context3.abrupt("return", result);
|
|
202
|
-
case
|
|
202
|
+
case 2:
|
|
203
203
|
setState({
|
|
204
204
|
links: [].concat((0, _toConsumableArray2.default)(currentState.links), [result])
|
|
205
205
|
});
|
|
206
206
|
dispatch(actions.getTeamWebLinkIcons(teamId));
|
|
207
207
|
return _context3.abrupt("return", result);
|
|
208
|
-
case
|
|
208
|
+
case 3:
|
|
209
209
|
case "end":
|
|
210
210
|
return _context3.stop();
|
|
211
211
|
}
|
|
@@ -220,21 +220,21 @@ var actions = exports.actions = {
|
|
|
220
220
|
return /*#__PURE__*/function () {
|
|
221
221
|
var _ref8 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4(_ref7) {
|
|
222
222
|
var getState, setState, dispatch, result, currentState, oldLink, urlChanged, updatedIcons;
|
|
223
|
-
return _regenerator.default.wrap(function
|
|
223
|
+
return _regenerator.default.wrap(function (_context4) {
|
|
224
224
|
while (1) switch (_context4.prev = _context4.next) {
|
|
225
225
|
case 0:
|
|
226
226
|
getState = _ref7.getState, setState = _ref7.setState, dispatch = _ref7.dispatch;
|
|
227
|
-
_context4.next =
|
|
227
|
+
_context4.next = 1;
|
|
228
228
|
return _teamsClient.teamsClient.updateTeamLink(teamId, linkId, newLink);
|
|
229
|
-
case
|
|
229
|
+
case 1:
|
|
230
230
|
result = _context4.sent;
|
|
231
231
|
currentState = getState();
|
|
232
232
|
if (!(currentState.teamId !== teamId)) {
|
|
233
|
-
_context4.next =
|
|
233
|
+
_context4.next = 2;
|
|
234
234
|
break;
|
|
235
235
|
}
|
|
236
236
|
return _context4.abrupt("return", result);
|
|
237
|
-
case
|
|
237
|
+
case 2:
|
|
238
238
|
oldLink = currentState.links.find(function (link) {
|
|
239
239
|
return link.linkId === linkId;
|
|
240
240
|
});
|
|
@@ -254,7 +254,7 @@ var actions = exports.actions = {
|
|
|
254
254
|
dispatch(actions.getTeamWebLinkIcons(teamId));
|
|
255
255
|
}
|
|
256
256
|
return _context4.abrupt("return", result);
|
|
257
|
-
case
|
|
257
|
+
case 3:
|
|
258
258
|
case "end":
|
|
259
259
|
return _context4.stop();
|
|
260
260
|
}
|
|
@@ -269,26 +269,26 @@ var actions = exports.actions = {
|
|
|
269
269
|
return /*#__PURE__*/function () {
|
|
270
270
|
var _ref0 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5(_ref9) {
|
|
271
271
|
var getState, setState, currentState;
|
|
272
|
-
return _regenerator.default.wrap(function
|
|
272
|
+
return _regenerator.default.wrap(function (_context5) {
|
|
273
273
|
while (1) switch (_context5.prev = _context5.next) {
|
|
274
274
|
case 0:
|
|
275
275
|
getState = _ref9.getState, setState = _ref9.setState;
|
|
276
276
|
currentState = getState();
|
|
277
277
|
if (!(currentState.teamId !== teamId)) {
|
|
278
|
-
_context5.next =
|
|
278
|
+
_context5.next = 1;
|
|
279
279
|
break;
|
|
280
280
|
}
|
|
281
281
|
return _context5.abrupt("return");
|
|
282
|
-
case
|
|
283
|
-
_context5.next =
|
|
282
|
+
case 1:
|
|
283
|
+
_context5.next = 2;
|
|
284
284
|
return _teamsClient.teamsClient.deleteTeamLink(teamId, linkId);
|
|
285
|
-
case
|
|
285
|
+
case 2:
|
|
286
286
|
setState({
|
|
287
287
|
links: currentState.links.filter(function (link) {
|
|
288
288
|
return link.linkId !== linkId;
|
|
289
289
|
})
|
|
290
290
|
});
|
|
291
|
-
case
|
|
291
|
+
case 3:
|
|
292
292
|
case "end":
|
|
293
293
|
return _context5.stop();
|
|
294
294
|
}
|
|
@@ -302,32 +302,32 @@ var actions = exports.actions = {
|
|
|
302
302
|
fetchWebLinkTitle: function fetchWebLinkTitle(url) {
|
|
303
303
|
return /*#__PURE__*/function () {
|
|
304
304
|
var _ref10 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6(_ref1) {
|
|
305
|
-
var setState, title;
|
|
306
|
-
return _regenerator.default.wrap(function
|
|
305
|
+
var setState, title, _t3;
|
|
306
|
+
return _regenerator.default.wrap(function (_context6) {
|
|
307
307
|
while (1) switch (_context6.prev = _context6.next) {
|
|
308
308
|
case 0:
|
|
309
309
|
setState = _ref1.setState;
|
|
310
310
|
if (url) {
|
|
311
|
-
_context6.next =
|
|
311
|
+
_context6.next = 1;
|
|
312
312
|
break;
|
|
313
313
|
}
|
|
314
314
|
return _context6.abrupt("return", undefined);
|
|
315
|
-
case
|
|
316
|
-
_context6.prev =
|
|
317
|
-
_context6.next =
|
|
315
|
+
case 1:
|
|
316
|
+
_context6.prev = 1;
|
|
317
|
+
_context6.next = 2;
|
|
318
318
|
return _teamsClient.teamsClient.getWebLinkTitle(url);
|
|
319
|
-
case
|
|
319
|
+
case 2:
|
|
320
320
|
title = _context6.sent;
|
|
321
321
|
return _context6.abrupt("return", title);
|
|
322
|
-
case
|
|
323
|
-
_context6.prev =
|
|
324
|
-
|
|
322
|
+
case 3:
|
|
323
|
+
_context6.prev = 3;
|
|
324
|
+
_t3 = _context6["catch"](1);
|
|
325
325
|
return _context6.abrupt("return", undefined);
|
|
326
|
-
case
|
|
326
|
+
case 4:
|
|
327
327
|
case "end":
|
|
328
328
|
return _context6.stop();
|
|
329
329
|
}
|
|
330
|
-
}, _callee6, null, [[
|
|
330
|
+
}, _callee6, null, [[1, 3]]);
|
|
331
331
|
}));
|
|
332
332
|
return function (_x6) {
|
|
333
333
|
return _ref10.apply(this, arguments);
|