@atlaskit/teams-public 1.4.1 → 1.4.3
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 +15 -0
- package/dist/cjs/common/utils/get-container-properties.js +5 -5
- 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/add-container-card/add-container-card-button/index.js +4 -4
- package/dist/cjs/ui/team-containers/disconnect-dialog/index.js +7 -7
- package/dist/cjs/ui/team-containers/main.js +9 -9
- package/dist/cjs/ui/team-containers/no-product-access-empty-state/index.js +1 -1
- package/dist/es2019/common/utils/get-container-properties.js +5 -5
- package/dist/es2019/next/ui/team-containers/team-link-card/index.js +2 -24
- package/dist/es2019/ui/team-containers/add-container-card/add-container-card-button/index.js +4 -4
- package/dist/es2019/ui/team-containers/disconnect-dialog/index.js +4 -4
- package/dist/es2019/ui/team-containers/no-product-access-empty-state/index.js +1 -1
- package/dist/esm/common/utils/get-container-properties.js +5 -5
- 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/add-container-card/add-container-card-button/index.js +4 -4
- package/dist/esm/ui/team-containers/disconnect-dialog/index.js +7 -7
- package/dist/esm/ui/team-containers/main.js +9 -9
- package/dist/esm/ui/team-containers/no-product-access-empty-state/index.js +1 -1
- package/package.json +12 -14
|
@@ -36,8 +36,8 @@ var actions = exports.actions = {
|
|
|
36
36
|
getTeamWebLinks: function getTeamWebLinks(teamId) {
|
|
37
37
|
return /*#__PURE__*/function () {
|
|
38
38
|
var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(_ref) {
|
|
39
|
-
var getState, setState, dispatch, _getState, teams, currentTeamState, currentLinks, _yield$teamsClient$ge, entities, currentState, _currentState;
|
|
40
|
-
return _regenerator.default.wrap(function
|
|
39
|
+
var getState, setState, dispatch, _getState, teams, currentTeamState, currentLinks, _yield$teamsClient$ge, entities, currentState, _currentState, _t;
|
|
40
|
+
return _regenerator.default.wrap(function (_context) {
|
|
41
41
|
while (1) switch (_context.prev = _context.next) {
|
|
42
42
|
case 0:
|
|
43
43
|
getState = _ref.getState, setState = _ref.setState, dispatch = _ref.dispatch;
|
|
@@ -45,17 +45,17 @@ var actions = exports.actions = {
|
|
|
45
45
|
currentTeamState = teams[teamId];
|
|
46
46
|
currentLinks = (currentTeamState === null || currentTeamState === void 0 ? void 0 : currentTeamState.links) || []; // Only skip if already loaded and not currently loading (prevents duplicate fetches)
|
|
47
47
|
if (!(currentTeamState !== null && currentTeamState !== void 0 && currentTeamState.hasLoaded && !currentTeamState.isLoading && currentLinks.length > 0)) {
|
|
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
|
if (!(currentTeamState !== null && currentTeamState !== void 0 && currentTeamState.isLoading)) {
|
|
54
|
-
_context.next =
|
|
54
|
+
_context.next = 2;
|
|
55
55
|
break;
|
|
56
56
|
}
|
|
57
57
|
return _context.abrupt("return");
|
|
58
|
-
case
|
|
58
|
+
case 2:
|
|
59
59
|
setState({
|
|
60
60
|
teams: _objectSpread(_objectSpread({}, teams), {}, (0, _defineProperty2.default)({}, teamId, _objectSpread(_objectSpread({}, getInitialTeamState()), {}, {
|
|
61
61
|
links: currentLinks,
|
|
@@ -63,20 +63,20 @@ var actions = exports.actions = {
|
|
|
63
63
|
}))),
|
|
64
64
|
currentTeamId: teamId
|
|
65
65
|
});
|
|
66
|
-
_context.prev =
|
|
67
|
-
_context.next =
|
|
66
|
+
_context.prev = 3;
|
|
67
|
+
_context.next = 4;
|
|
68
68
|
return _teamsClient.teamsClient.getTeamLinksByTeamId(teamId);
|
|
69
|
-
case
|
|
69
|
+
case 4:
|
|
70
70
|
_yield$teamsClient$ge = _context.sent;
|
|
71
71
|
entities = _yield$teamsClient$ge.entities;
|
|
72
72
|
// Get fresh state after async operation
|
|
73
73
|
currentState = getState();
|
|
74
74
|
if (!(!currentState.teams[teamId] || currentState.teams[teamId].isLoading === false)) {
|
|
75
|
-
_context.next =
|
|
75
|
+
_context.next = 5;
|
|
76
76
|
break;
|
|
77
77
|
}
|
|
78
78
|
return _context.abrupt("return");
|
|
79
|
-
case
|
|
79
|
+
case 5:
|
|
80
80
|
setState({
|
|
81
81
|
teams: _objectSpread(_objectSpread({}, currentState.teams), {}, (0, _defineProperty2.default)({}, teamId, _objectSpread(_objectSpread({}, currentState.teams[teamId]), {}, {
|
|
82
82
|
isLoading: false,
|
|
@@ -94,35 +94,35 @@ var actions = exports.actions = {
|
|
|
94
94
|
if (entities.length > 0) {
|
|
95
95
|
dispatch(actions.getTeamWebLinkIcons(teamId));
|
|
96
96
|
}
|
|
97
|
-
_context.next =
|
|
97
|
+
_context.next = 8;
|
|
98
98
|
break;
|
|
99
|
-
case
|
|
100
|
-
_context.prev =
|
|
101
|
-
|
|
99
|
+
case 6:
|
|
100
|
+
_context.prev = 6;
|
|
101
|
+
_t = _context["catch"](3);
|
|
102
102
|
// Get fresh state after async operation
|
|
103
103
|
_currentState = getState();
|
|
104
104
|
if (_currentState.teams[teamId]) {
|
|
105
|
-
_context.next =
|
|
105
|
+
_context.next = 7;
|
|
106
106
|
break;
|
|
107
107
|
}
|
|
108
108
|
return _context.abrupt("return");
|
|
109
|
-
case
|
|
109
|
+
case 7:
|
|
110
110
|
setState({
|
|
111
111
|
teams: _objectSpread(_objectSpread({}, _currentState.teams), {}, (0, _defineProperty2.default)({}, teamId, _objectSpread(_objectSpread({}, _currentState.teams[teamId]), {}, {
|
|
112
112
|
isLoading: false,
|
|
113
113
|
hasLoaded: true,
|
|
114
114
|
hasError: true,
|
|
115
|
-
errorType:
|
|
115
|
+
errorType: _t instanceof Error ? _t : null,
|
|
116
116
|
shouldReload: false,
|
|
117
117
|
links: []
|
|
118
118
|
}))),
|
|
119
119
|
currentTeamId: teamId
|
|
120
120
|
});
|
|
121
|
-
case
|
|
121
|
+
case 8:
|
|
122
122
|
case "end":
|
|
123
123
|
return _context.stop();
|
|
124
124
|
}
|
|
125
|
-
}, _callee, null, [[
|
|
125
|
+
}, _callee, null, [[3, 6]]);
|
|
126
126
|
}));
|
|
127
127
|
return function (_x) {
|
|
128
128
|
return _ref2.apply(this, arguments);
|
|
@@ -132,26 +132,26 @@ var actions = exports.actions = {
|
|
|
132
132
|
getTeamWebLinkIcons: function getTeamWebLinkIcons(teamId) {
|
|
133
133
|
return /*#__PURE__*/function () {
|
|
134
134
|
var _ref4 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(_ref3) {
|
|
135
|
-
var getState, setState, _getState2, teams, currentTeamState, links, currentIcons, linkUrls, uncachedUrls, newIconData, currentState, updatedTeamState, freshIcons, _currentState2, _updatedTeamState;
|
|
136
|
-
return _regenerator.default.wrap(function
|
|
135
|
+
var getState, setState, _getState2, teams, currentTeamState, links, currentIcons, linkUrls, uncachedUrls, newIconData, currentState, updatedTeamState, freshIcons, _currentState2, _updatedTeamState, _t2;
|
|
136
|
+
return _regenerator.default.wrap(function (_context2) {
|
|
137
137
|
while (1) switch (_context2.prev = _context2.next) {
|
|
138
138
|
case 0:
|
|
139
139
|
getState = _ref3.getState, setState = _ref3.setState;
|
|
140
140
|
_getState2 = getState(), teams = _getState2.teams;
|
|
141
141
|
currentTeamState = teams[teamId];
|
|
142
142
|
if (currentTeamState) {
|
|
143
|
-
_context2.next =
|
|
143
|
+
_context2.next = 1;
|
|
144
144
|
break;
|
|
145
145
|
}
|
|
146
146
|
return _context2.abrupt("return");
|
|
147
|
-
case
|
|
147
|
+
case 1:
|
|
148
148
|
links = currentTeamState.links, currentIcons = currentTeamState.linkIcons;
|
|
149
149
|
if (!(links.length === 0)) {
|
|
150
|
-
_context2.next =
|
|
150
|
+
_context2.next = 2;
|
|
151
151
|
break;
|
|
152
152
|
}
|
|
153
153
|
return _context2.abrupt("return");
|
|
154
|
-
case
|
|
154
|
+
case 2:
|
|
155
155
|
linkUrls = links.map(function (link) {
|
|
156
156
|
return link.linkUri;
|
|
157
157
|
});
|
|
@@ -161,19 +161,19 @@ var actions = exports.actions = {
|
|
|
161
161
|
});
|
|
162
162
|
});
|
|
163
163
|
if (!(uncachedUrls.length > 0)) {
|
|
164
|
-
_context2.next =
|
|
164
|
+
_context2.next = 7;
|
|
165
165
|
break;
|
|
166
166
|
}
|
|
167
|
-
_context2.prev =
|
|
167
|
+
_context2.prev = 3;
|
|
168
168
|
setState({
|
|
169
169
|
teams: _objectSpread(_objectSpread({}, teams), {}, (0, _defineProperty2.default)({}, teamId, _objectSpread(_objectSpread({}, currentTeamState), {}, {
|
|
170
170
|
iconsLoading: true,
|
|
171
171
|
iconsError: false
|
|
172
172
|
})))
|
|
173
173
|
});
|
|
174
|
-
_context2.next =
|
|
174
|
+
_context2.next = 4;
|
|
175
175
|
return _teamsClient.teamsClient.getTeamLinkIcons(uncachedUrls);
|
|
176
|
-
case
|
|
176
|
+
case 4:
|
|
177
177
|
newIconData = _context2.sent;
|
|
178
178
|
currentState = getState();
|
|
179
179
|
updatedTeamState = currentState.teams[teamId];
|
|
@@ -189,11 +189,11 @@ var actions = exports.actions = {
|
|
|
189
189
|
})))
|
|
190
190
|
});
|
|
191
191
|
}
|
|
192
|
-
_context2.next =
|
|
192
|
+
_context2.next = 6;
|
|
193
193
|
break;
|
|
194
|
-
case
|
|
195
|
-
_context2.prev =
|
|
196
|
-
|
|
194
|
+
case 5:
|
|
195
|
+
_context2.prev = 5;
|
|
196
|
+
_t2 = _context2["catch"](3);
|
|
197
197
|
_currentState2 = getState();
|
|
198
198
|
_updatedTeamState = _currentState2.teams[teamId];
|
|
199
199
|
if (_updatedTeamState) {
|
|
@@ -205,10 +205,10 @@ var actions = exports.actions = {
|
|
|
205
205
|
})))
|
|
206
206
|
});
|
|
207
207
|
}
|
|
208
|
-
case
|
|
209
|
-
_context2.next =
|
|
208
|
+
case 6:
|
|
209
|
+
_context2.next = 8;
|
|
210
210
|
break;
|
|
211
|
-
case
|
|
211
|
+
case 7:
|
|
212
212
|
setState({
|
|
213
213
|
teams: _objectSpread(_objectSpread({}, teams), {}, (0, _defineProperty2.default)({}, teamId, _objectSpread(_objectSpread({}, currentTeamState), {}, {
|
|
214
214
|
iconsLoading: false,
|
|
@@ -216,11 +216,11 @@ var actions = exports.actions = {
|
|
|
216
216
|
iconHasLoaded: true
|
|
217
217
|
})))
|
|
218
218
|
});
|
|
219
|
-
case
|
|
219
|
+
case 8:
|
|
220
220
|
case "end":
|
|
221
221
|
return _context2.stop();
|
|
222
222
|
}
|
|
223
|
-
}, _callee2, null, [[
|
|
223
|
+
}, _callee2, null, [[3, 5]]);
|
|
224
224
|
}));
|
|
225
225
|
return function (_x2) {
|
|
226
226
|
return _ref4.apply(this, arguments);
|
|
@@ -231,22 +231,22 @@ var actions = exports.actions = {
|
|
|
231
231
|
return /*#__PURE__*/function () {
|
|
232
232
|
var _ref6 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3(_ref5) {
|
|
233
233
|
var getState, setState, dispatch, result, currentState, currentTeamState;
|
|
234
|
-
return _regenerator.default.wrap(function
|
|
234
|
+
return _regenerator.default.wrap(function (_context3) {
|
|
235
235
|
while (1) switch (_context3.prev = _context3.next) {
|
|
236
236
|
case 0:
|
|
237
237
|
getState = _ref5.getState, setState = _ref5.setState, dispatch = _ref5.dispatch;
|
|
238
|
-
_context3.next =
|
|
238
|
+
_context3.next = 1;
|
|
239
239
|
return _teamsClient.teamsClient.createTeamLink(teamId, newLink);
|
|
240
|
-
case
|
|
240
|
+
case 1:
|
|
241
241
|
result = _context3.sent;
|
|
242
242
|
currentState = getState();
|
|
243
243
|
currentTeamState = currentState.teams[teamId];
|
|
244
244
|
if (currentTeamState) {
|
|
245
|
-
_context3.next =
|
|
245
|
+
_context3.next = 2;
|
|
246
246
|
break;
|
|
247
247
|
}
|
|
248
248
|
return _context3.abrupt("return", result);
|
|
249
|
-
case
|
|
249
|
+
case 2:
|
|
250
250
|
setState({
|
|
251
251
|
teams: _objectSpread(_objectSpread({}, currentState.teams), {}, (0, _defineProperty2.default)({}, teamId, _objectSpread(_objectSpread({}, currentTeamState), {}, {
|
|
252
252
|
links: [].concat((0, _toConsumableArray2.default)(currentTeamState.links), [result])
|
|
@@ -254,7 +254,7 @@ var actions = exports.actions = {
|
|
|
254
254
|
});
|
|
255
255
|
dispatch(actions.getTeamWebLinkIcons(teamId));
|
|
256
256
|
return _context3.abrupt("return", result);
|
|
257
|
-
case
|
|
257
|
+
case 3:
|
|
258
258
|
case "end":
|
|
259
259
|
return _context3.stop();
|
|
260
260
|
}
|
|
@@ -269,22 +269,22 @@ var actions = exports.actions = {
|
|
|
269
269
|
return /*#__PURE__*/function () {
|
|
270
270
|
var _ref8 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4(_ref7) {
|
|
271
271
|
var getState, setState, dispatch, result, _getState3, teams, currentTeamState, oldLink, urlChanged, freshState, freshTeamState, updatedIcons;
|
|
272
|
-
return _regenerator.default.wrap(function
|
|
272
|
+
return _regenerator.default.wrap(function (_context4) {
|
|
273
273
|
while (1) switch (_context4.prev = _context4.next) {
|
|
274
274
|
case 0:
|
|
275
275
|
getState = _ref7.getState, setState = _ref7.setState, dispatch = _ref7.dispatch;
|
|
276
|
-
_context4.next =
|
|
276
|
+
_context4.next = 1;
|
|
277
277
|
return _teamsClient.teamsClient.updateTeamLink(teamId, linkId, newLink);
|
|
278
|
-
case
|
|
278
|
+
case 1:
|
|
279
279
|
result = _context4.sent;
|
|
280
280
|
_getState3 = getState(), teams = _getState3.teams;
|
|
281
281
|
currentTeamState = teams[teamId];
|
|
282
282
|
if (currentTeamState) {
|
|
283
|
-
_context4.next =
|
|
283
|
+
_context4.next = 2;
|
|
284
284
|
break;
|
|
285
285
|
}
|
|
286
286
|
return _context4.abrupt("return", result);
|
|
287
|
-
case
|
|
287
|
+
case 2:
|
|
288
288
|
oldLink = currentTeamState.links.find(function (link) {
|
|
289
289
|
return link.linkId === linkId;
|
|
290
290
|
});
|
|
@@ -297,18 +297,18 @@ var actions = exports.actions = {
|
|
|
297
297
|
})))
|
|
298
298
|
});
|
|
299
299
|
if (!(urlChanged && oldLink)) {
|
|
300
|
-
_context4.next =
|
|
300
|
+
_context4.next = 4;
|
|
301
301
|
break;
|
|
302
302
|
}
|
|
303
303
|
// Get fresh state to ensure we have the updated links
|
|
304
304
|
freshState = getState();
|
|
305
305
|
freshTeamState = freshState.teams[teamId];
|
|
306
306
|
if (freshTeamState) {
|
|
307
|
-
_context4.next =
|
|
307
|
+
_context4.next = 3;
|
|
308
308
|
break;
|
|
309
309
|
}
|
|
310
310
|
return _context4.abrupt("return", result);
|
|
311
|
-
case
|
|
311
|
+
case 3:
|
|
312
312
|
updatedIcons = freshTeamState.linkIcons.filter(function (icon) {
|
|
313
313
|
return icon.linkUrl !== oldLink.linkUri;
|
|
314
314
|
});
|
|
@@ -318,9 +318,9 @@ var actions = exports.actions = {
|
|
|
318
318
|
})))
|
|
319
319
|
});
|
|
320
320
|
dispatch(actions.getTeamWebLinkIcons(teamId));
|
|
321
|
-
case
|
|
321
|
+
case 4:
|
|
322
322
|
return _context4.abrupt("return", result);
|
|
323
|
-
case
|
|
323
|
+
case 5:
|
|
324
324
|
case "end":
|
|
325
325
|
return _context4.stop();
|
|
326
326
|
}
|
|
@@ -335,22 +335,22 @@ var actions = exports.actions = {
|
|
|
335
335
|
return /*#__PURE__*/function () {
|
|
336
336
|
var _ref0 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5(_ref9) {
|
|
337
337
|
var getState, setState, currentState, currentTeamState;
|
|
338
|
-
return _regenerator.default.wrap(function
|
|
338
|
+
return _regenerator.default.wrap(function (_context5) {
|
|
339
339
|
while (1) switch (_context5.prev = _context5.next) {
|
|
340
340
|
case 0:
|
|
341
341
|
getState = _ref9.getState, setState = _ref9.setState;
|
|
342
|
-
_context5.next =
|
|
342
|
+
_context5.next = 1;
|
|
343
343
|
return _teamsClient.teamsClient.deleteTeamLink(teamId, linkId);
|
|
344
|
-
case
|
|
344
|
+
case 1:
|
|
345
345
|
// Get fresh state after async operation
|
|
346
346
|
currentState = getState();
|
|
347
347
|
currentTeamState = currentState.teams[teamId];
|
|
348
348
|
if (currentTeamState) {
|
|
349
|
-
_context5.next =
|
|
349
|
+
_context5.next = 2;
|
|
350
350
|
break;
|
|
351
351
|
}
|
|
352
352
|
return _context5.abrupt("return");
|
|
353
|
-
case
|
|
353
|
+
case 2:
|
|
354
354
|
setState({
|
|
355
355
|
teams: _objectSpread(_objectSpread({}, currentState.teams), {}, (0, _defineProperty2.default)({}, teamId, _objectSpread(_objectSpread({}, currentTeamState), {}, {
|
|
356
356
|
links: currentTeamState.links.filter(function (link) {
|
|
@@ -358,7 +358,7 @@ var actions = exports.actions = {
|
|
|
358
358
|
})
|
|
359
359
|
})))
|
|
360
360
|
});
|
|
361
|
-
case
|
|
361
|
+
case 3:
|
|
362
362
|
case "end":
|
|
363
363
|
return _context5.stop();
|
|
364
364
|
}
|
|
@@ -372,32 +372,32 @@ var actions = exports.actions = {
|
|
|
372
372
|
fetchWebLinkTitle: function fetchWebLinkTitle(url) {
|
|
373
373
|
return /*#__PURE__*/function () {
|
|
374
374
|
var _ref10 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6(_ref1) {
|
|
375
|
-
var setState, title;
|
|
376
|
-
return _regenerator.default.wrap(function
|
|
375
|
+
var setState, title, _t3;
|
|
376
|
+
return _regenerator.default.wrap(function (_context6) {
|
|
377
377
|
while (1) switch (_context6.prev = _context6.next) {
|
|
378
378
|
case 0:
|
|
379
379
|
setState = _ref1.setState;
|
|
380
380
|
if (url) {
|
|
381
|
-
_context6.next =
|
|
381
|
+
_context6.next = 1;
|
|
382
382
|
break;
|
|
383
383
|
}
|
|
384
384
|
return _context6.abrupt("return", undefined);
|
|
385
|
-
case
|
|
386
|
-
_context6.prev =
|
|
387
|
-
_context6.next =
|
|
385
|
+
case 1:
|
|
386
|
+
_context6.prev = 1;
|
|
387
|
+
_context6.next = 2;
|
|
388
388
|
return _teamsClient.teamsClient.getWebLinkTitle(url);
|
|
389
|
-
case
|
|
389
|
+
case 2:
|
|
390
390
|
title = _context6.sent;
|
|
391
391
|
return _context6.abrupt("return", title);
|
|
392
|
-
case
|
|
393
|
-
_context6.prev =
|
|
394
|
-
|
|
392
|
+
case 3:
|
|
393
|
+
_context6.prev = 3;
|
|
394
|
+
_t3 = _context6["catch"](1);
|
|
395
395
|
return _context6.abrupt("return", undefined);
|
|
396
|
-
case
|
|
396
|
+
case 4:
|
|
397
397
|
case "end":
|
|
398
398
|
return _context6.stop();
|
|
399
399
|
}
|
|
400
|
-
}, _callee6, null, [[
|
|
400
|
+
}, _callee6, null, [[1, 3]]);
|
|
401
401
|
}));
|
|
402
402
|
return function (_x6) {
|
|
403
403
|
return _ref10.apply(this, arguments);
|
|
@@ -18,33 +18,33 @@ var actions = {
|
|
|
18
18
|
permissionIds = _ref$permissionIds === void 0 ? ['manage', 'write'] : _ref$permissionIds;
|
|
19
19
|
return /*#__PURE__*/function () {
|
|
20
20
|
var _ref3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(_ref2) {
|
|
21
|
-
var setState, getState, dispatch, _getState, hasLoaded, isLoading, permissions, shouldFetch, response, _permissions;
|
|
22
|
-
return _regenerator.default.wrap(function
|
|
21
|
+
var setState, getState, dispatch, _getState, hasLoaded, isLoading, permissions, shouldFetch, response, _permissions, _t;
|
|
22
|
+
return _regenerator.default.wrap(function (_context) {
|
|
23
23
|
while (1) switch (_context.prev = _context.next) {
|
|
24
24
|
case 0:
|
|
25
25
|
setState = _ref2.setState, getState = _ref2.getState, dispatch = _ref2.dispatch;
|
|
26
26
|
_getState = getState(), hasLoaded = _getState.hasLoaded, isLoading = _getState.isLoading, permissions = _getState.permissions;
|
|
27
27
|
if (!(isLoading || !userId || !cloudId || !enabled)) {
|
|
28
|
-
_context.next =
|
|
28
|
+
_context.next = 1;
|
|
29
29
|
break;
|
|
30
30
|
}
|
|
31
31
|
return _context.abrupt("return");
|
|
32
|
-
case
|
|
32
|
+
case 1:
|
|
33
33
|
shouldFetch = !hasLoaded || permissionIds.some(function (permissionId) {
|
|
34
34
|
var _permissions$confluen, _permissions$jira, _permissions$loom;
|
|
35
35
|
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;
|
|
36
36
|
});
|
|
37
37
|
if (shouldFetch) {
|
|
38
|
-
_context.next =
|
|
38
|
+
_context.next = 2;
|
|
39
39
|
break;
|
|
40
40
|
}
|
|
41
41
|
return _context.abrupt("return");
|
|
42
|
-
case
|
|
43
|
-
_context.prev =
|
|
42
|
+
case 2:
|
|
43
|
+
_context.prev = 2;
|
|
44
44
|
setState({
|
|
45
45
|
isLoading: true
|
|
46
46
|
});
|
|
47
|
-
_context.next =
|
|
47
|
+
_context.next = 3;
|
|
48
48
|
return fetch('/gateway/api/permissions/bulk/permitted', {
|
|
49
49
|
headers: {
|
|
50
50
|
'Content-Type': 'application/json'
|
|
@@ -53,30 +53,30 @@ var actions = {
|
|
|
53
53
|
credentials: 'include',
|
|
54
54
|
body: (0, _utils.getProductPermissionRequestBody)(cloudId, userId, permissionIds)
|
|
55
55
|
});
|
|
56
|
-
case
|
|
56
|
+
case 3:
|
|
57
57
|
response = _context.sent;
|
|
58
58
|
if (response.ok) {
|
|
59
|
-
_context.next =
|
|
59
|
+
_context.next = 4;
|
|
60
60
|
break;
|
|
61
61
|
}
|
|
62
62
|
throw new Error('Failed to fetch product permissions');
|
|
63
|
-
case
|
|
64
|
-
_context.next =
|
|
63
|
+
case 4:
|
|
64
|
+
_context.next = 5;
|
|
65
65
|
return response.json();
|
|
66
|
-
case
|
|
66
|
+
case 5:
|
|
67
67
|
_permissions = _context.sent;
|
|
68
68
|
dispatch(actions.setPermissions(_permissions));
|
|
69
|
-
_context.next =
|
|
69
|
+
_context.next = 7;
|
|
70
70
|
break;
|
|
71
|
-
case
|
|
72
|
-
_context.prev =
|
|
73
|
-
|
|
71
|
+
case 6:
|
|
72
|
+
_context.prev = 6;
|
|
73
|
+
_t = _context["catch"](2);
|
|
74
74
|
dispatch(actions.setError(new Error('Failed to fetch product permissions')));
|
|
75
|
-
case
|
|
75
|
+
case 7:
|
|
76
76
|
case "end":
|
|
77
77
|
return _context.stop();
|
|
78
78
|
}
|
|
79
|
-
}, _callee, null, [[
|
|
79
|
+
}, _callee, null, [[2, 6]]);
|
|
80
80
|
}));
|
|
81
81
|
return function (_x) {
|
|
82
82
|
return _ref3.apply(this, arguments);
|
|
@@ -12,7 +12,6 @@ var _runtime = require("@compiled/react/runtime");
|
|
|
12
12
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
13
13
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
14
14
|
var _react = _interopRequireWildcard(require("react"));
|
|
15
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
16
15
|
var _compiled = require("@atlaskit/primitives/compiled");
|
|
17
16
|
var _teamsAppInternalAnalytics = require("@atlaskit/teams-app-internal-analytics");
|
|
18
17
|
var _teamsAppInternalNavigation = require("@atlaskit/teams-app-internal-navigation");
|
|
@@ -120,7 +119,7 @@ var TeamLinkCard = exports.TeamLinkCard = function TeamLinkCard(_ref) {
|
|
|
120
119
|
title: title,
|
|
121
120
|
containerIcon: containerIcon,
|
|
122
121
|
size: "small"
|
|
123
|
-
}),
|
|
122
|
+
}), /*#__PURE__*/_react.default.createElement(_teamsAppInternalNavigation.TeamsAnchor, {
|
|
124
123
|
xcss: styles.anchor,
|
|
125
124
|
href: link || '#',
|
|
126
125
|
onClick: handleLinkClick,
|
|
@@ -142,27 +141,6 @@ var TeamLinkCard = exports.TeamLinkCard = function TeamLinkCard(_ref) {
|
|
|
142
141
|
}, containerTypeText), containerTypeText && description && /*#__PURE__*/_react.default.createElement(_separator.Separator, null), description && /*#__PURE__*/_react.default.createElement(_compiled.Text, {
|
|
143
142
|
size: "small",
|
|
144
143
|
color: "color.text.subtle"
|
|
145
|
-
}, description))))) : /*#__PURE__*/_react.default.createElement(_compiled.Anchor, {
|
|
146
|
-
xcss: styles.anchor,
|
|
147
|
-
href: link || '#',
|
|
148
|
-
onClick: handleLinkClick,
|
|
149
|
-
testId: "team-link-card-linkable-content"
|
|
150
|
-
}, /*#__PURE__*/_react.default.createElement(_compiled.Stack, {
|
|
151
|
-
space: "space.025"
|
|
152
|
-
}, /*#__PURE__*/_react.default.createElement(_compiled.Text, {
|
|
153
|
-
maxLines: 1,
|
|
154
|
-
color: "color.text"
|
|
155
|
-
}, title), /*#__PURE__*/_react.default.createElement(_compiled.Flex, {
|
|
156
|
-
gap: "space.050",
|
|
157
|
-
alignItems: "center"
|
|
158
|
-
}, /*#__PURE__*/_react.default.createElement(_compiled.Inline, {
|
|
159
|
-
space: "space.050"
|
|
160
|
-
}, containerTypeText && /*#__PURE__*/_react.default.createElement(_compiled.Text, {
|
|
161
|
-
size: "small",
|
|
162
|
-
color: "color.text.subtle"
|
|
163
|
-
}, containerTypeText), containerTypeText && description && /*#__PURE__*/_react.default.createElement(_separator.Separator, null), description && /*#__PURE__*/_react.default.createElement(_compiled.Text, {
|
|
164
|
-
size: "small",
|
|
165
|
-
color: "color.text.subtle"
|
|
166
144
|
}, description))))), !isReadOnly && /*#__PURE__*/_react.default.createElement(_teamLinkCardActions.TeamLinkCardActions, {
|
|
167
145
|
containerType: containerType,
|
|
168
146
|
title: title,
|
|
@@ -77,13 +77,13 @@ var messages = (0, _reactIntl.defineMessages)({
|
|
|
77
77
|
},
|
|
78
78
|
addJiraProjectTitle: {
|
|
79
79
|
id: 'ptc-directory.team-profile-page.team-containers.create.add-jira-project-title',
|
|
80
|
-
defaultMessage: 'Jira
|
|
81
|
-
description: 'Title of the card to add a Jira
|
|
80
|
+
defaultMessage: 'Jira space',
|
|
81
|
+
description: 'Title of the card to add a Jira space to a team'
|
|
82
82
|
},
|
|
83
83
|
jiraProjectDescription: {
|
|
84
84
|
id: 'ptc-directory.team-profile-page.team-containers.create.add-jira-project-description',
|
|
85
|
-
defaultMessage: 'Plan out
|
|
86
|
-
description: 'Description of the card to add a Jira
|
|
85
|
+
defaultMessage: 'Plan out tasks',
|
|
86
|
+
description: 'Description of the card to add a Jira space to a team'
|
|
87
87
|
},
|
|
88
88
|
addWebLinkTitle: {
|
|
89
89
|
id: 'ptc-directory.team-profile-page.team-containers.create.add-web-link-title',
|
|
@@ -25,18 +25,18 @@ var messages = exports.messages = (0, _reactIntl.defineMessages)({
|
|
|
25
25
|
},
|
|
26
26
|
disconnectDialogDescription: {
|
|
27
27
|
id: 'ptc-directory.team-profile-page.team-containers.disconnect-dialog.description',
|
|
28
|
-
defaultMessage: "This team will no longer be connected to the {containerName} {containerType, select,\n\t\t\tJiraProject {Jira
|
|
28
|
+
defaultMessage: "This team will no longer be connected to the {containerName} {containerType, select,\n\t\t\tJiraProject {Jira space}\n\t\t\tConfluenceSpace {Confluence space}\n\t\t\tLoomSpace {Loom space}\n\t\t\tother {link}\n\t\t}.",
|
|
29
29
|
description: 'Description of the disconnect dialog for team containers'
|
|
30
30
|
},
|
|
31
31
|
disconnectDialogDisclaimer: {
|
|
32
32
|
id: 'ptc-directory.team-profile-page.team-containers.disconnect-dialog.disclaimer',
|
|
33
|
-
defaultMessage: "Disconnecting the team from the {containerType, select,\n\t\t\tJiraProject {
|
|
33
|
+
defaultMessage: "Disconnecting the team from the {containerType, select,\n\t\t\tJiraProject {space}\n\t\t\tConfluenceSpace {space}\n\t\t\tLoomSpace {space}\n\t\t\tother {link}\n\t\t} will not affect any work connected to the team within the {containerType, select,\n\t\t\tJiraProject {space}\n\t\t\tConfluenceSpace {space}\n\t\t\tLoomSpace {space}\n\t\t\tother {link}\n\t\t}.",
|
|
34
34
|
description: 'Disclaimer of the disconnect dialog for team containers'
|
|
35
35
|
},
|
|
36
36
|
disconnectDialogDisclaimerNew: {
|
|
37
37
|
id: 'ptc-directory.team-profile-page.team-containers.disconnect-dialog.disclaimer',
|
|
38
38
|
// eslint-disable-next-line @atlassian/i18n/no-complex-selectors
|
|
39
|
-
defaultMessage: "{containerType, select,\n\t\t\tJiraProject {Disconnecting the team from the
|
|
39
|
+
defaultMessage: "{containerType, select,\n\t\t\tJiraProject {Disconnecting the team from the space might affect work connected to the team within the space.}\n\t\t\tConfluenceSpace {Disconnecting the team from the space will not affect any work connected to the team within the space.}\n\t\t\tLoomSpace {Disconnecting the team from the space will not affect any work connected to the team within the space.}\n\t\t\tother {Disconnecting the team from the link will not affect any work connected to the team within the link.}\n\t\t}",
|
|
40
40
|
description: 'Disclaimer of the disconnect dialog for team containers'
|
|
41
41
|
},
|
|
42
42
|
disconnectDialogDisclaimerFallback: {
|
|
@@ -66,15 +66,15 @@ var DisconnectDialog = exports.DisconnectDialog = function DisconnectDialog(_ref
|
|
|
66
66
|
setIsDisconnecting = _React$useState2[1];
|
|
67
67
|
var handleDisconnect = /*#__PURE__*/function () {
|
|
68
68
|
var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
69
|
-
return _regenerator.default.wrap(function
|
|
69
|
+
return _regenerator.default.wrap(function (_context) {
|
|
70
70
|
while (1) switch (_context.prev = _context.next) {
|
|
71
71
|
case 0:
|
|
72
72
|
setIsDisconnecting(true);
|
|
73
|
-
_context.next =
|
|
73
|
+
_context.next = 1;
|
|
74
74
|
return onDisconnect();
|
|
75
|
-
case
|
|
75
|
+
case 1:
|
|
76
76
|
setIsDisconnecting(false);
|
|
77
|
-
case
|
|
77
|
+
case 2:
|
|
78
78
|
case "end":
|
|
79
79
|
return _context.stop();
|
|
80
80
|
}
|
|
@@ -193,25 +193,25 @@ var TeamContainers = exports.TeamContainers = function TeamContainers(_ref) {
|
|
|
193
193
|
var handleDisconnect = (0, _react.useCallback)( /*#__PURE__*/function () {
|
|
194
194
|
var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(containerId) {
|
|
195
195
|
var removedContainer, wasCancelled;
|
|
196
|
-
return _regenerator.default.wrap(function
|
|
196
|
+
return _regenerator.default.wrap(function (_context) {
|
|
197
197
|
while (1) switch (_context.prev = _context.next) {
|
|
198
198
|
case 0:
|
|
199
199
|
removedContainer = filteredTeamLinks.find(function (container) {
|
|
200
200
|
return container.id === containerId;
|
|
201
201
|
});
|
|
202
202
|
if (!removedContainer) {
|
|
203
|
-
_context.next =
|
|
203
|
+
_context.next = 2;
|
|
204
204
|
break;
|
|
205
205
|
}
|
|
206
|
-
_context.next =
|
|
206
|
+
_context.next = 1;
|
|
207
207
|
return removeTeamLink(removedContainer);
|
|
208
|
-
case
|
|
209
|
-
_context.next =
|
|
208
|
+
case 1:
|
|
209
|
+
_context.next = 3;
|
|
210
210
|
break;
|
|
211
|
-
case
|
|
212
|
-
_context.next =
|
|
211
|
+
case 2:
|
|
212
|
+
_context.next = 3;
|
|
213
213
|
return actions.unlinkTeamContainers(teamId, containerId);
|
|
214
|
-
case
|
|
214
|
+
case 3:
|
|
215
215
|
setIsDisconnectDialogOpen(false);
|
|
216
216
|
if (unlinkError) {
|
|
217
217
|
fireEvent('track.teamContainerUnlinked.failed', {});
|
|
@@ -233,7 +233,7 @@ var TeamContainers = exports.TeamContainers = function TeamContainers(_ref) {
|
|
|
233
233
|
teamId: teamId
|
|
234
234
|
});
|
|
235
235
|
}
|
|
236
|
-
case
|
|
236
|
+
case 4:
|
|
237
237
|
case "end":
|
|
238
238
|
return _context.stop();
|
|
239
239
|
}
|
|
@@ -38,7 +38,7 @@ var messages = (0, _reactIntl.defineMessages)({
|
|
|
38
38
|
},
|
|
39
39
|
teamContainerEmptyStateDescription: {
|
|
40
40
|
id: 'ptc.team-profile-page.team-containers.empty-state.description',
|
|
41
|
-
defaultMessage: 'Your team can link their Jira
|
|
41
|
+
defaultMessage: 'Your team can link their Jira spaces, Confluence spaces here to show where they work',
|
|
42
42
|
description: 'Empty state description when user has no product access'
|
|
43
43
|
}
|
|
44
44
|
});
|