@atlaskit/teams-public 0.50.2 → 0.50.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
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# @atlaskit/teams-public
|
|
2
2
|
|
|
3
|
+
## 0.50.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`49ad6b3374d93`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/49ad6b3374d93) -
|
|
8
|
+
Clean up enable_web_links_in_team_containers feature gate
|
|
9
|
+
|
|
3
10
|
## 0.50.2
|
|
4
11
|
|
|
5
12
|
### Patch Changes
|
|
@@ -26,7 +26,6 @@ var _useTeamContainers2 = require("../../controllers/hooks/use-team-containers")
|
|
|
26
26
|
var _useTeamLinksAndContainers = require("../../controllers/hooks/use-team-links-and-containers");
|
|
27
27
|
var _addContainerCard = require("./add-container-card");
|
|
28
28
|
var _async = require("./disconnect-dialog/async");
|
|
29
|
-
var _linkedContainerCard = require("./linked-container-card");
|
|
30
29
|
var _noProductAccessEmptyState = require("./no-product-access-empty-state");
|
|
31
30
|
var _teamContainersSkeleton = require("./team-containers-skeleton");
|
|
32
31
|
var _linkedContainerCardSkeleton = require("./team-containers-skeleton/linked-container-card-skeleton");
|
|
@@ -53,14 +52,13 @@ var TeamContainers = exports.TeamContainers = function TeamContainers(_ref) {
|
|
|
53
52
|
var _useAnalyticsEvents = (0, _analyticsNext.useAnalyticsEvents)(),
|
|
54
53
|
createAnalyticsEvent = _useAnalyticsEvents.createAnalyticsEvent;
|
|
55
54
|
var _useTeamContainers = (0, _useTeamContainers2.useTeamContainers)(teamId),
|
|
56
|
-
teamContainers = _useTeamContainers.teamContainers,
|
|
57
|
-
loading = _useTeamContainers.loading,
|
|
58
55
|
unlinkError = _useTeamContainers.unlinkError;
|
|
59
56
|
var _useTeamLinksAndConta = (0, _useTeamLinksAndContainers.useTeamLinksAndContainers)(teamId, true),
|
|
60
57
|
teamLinks = _useTeamLinksAndConta.teamLinks,
|
|
61
58
|
removeTeamLink = _useTeamLinksAndConta.removeTeamLink,
|
|
62
59
|
iconsLoading = _useTeamLinksAndConta.iconsLoading,
|
|
63
|
-
iconHasLoaded = _useTeamLinksAndConta.iconHasLoaded
|
|
60
|
+
iconHasLoaded = _useTeamLinksAndConta.iconHasLoaded,
|
|
61
|
+
linksLoading = _useTeamLinksAndConta.isLoading;
|
|
64
62
|
var _useRequestedContaine = (0, _useRequestedContainer.useRequestedContainers)({
|
|
65
63
|
teamId: teamId,
|
|
66
64
|
cloudId: cloudId,
|
|
@@ -83,23 +81,19 @@ var TeamContainers = exports.TeamContainers = function TeamContainers(_ref) {
|
|
|
83
81
|
_useState6 = (0, _slicedToArray2.default)(_useState5, 2),
|
|
84
82
|
selectedContainerDetails = _useState6[0],
|
|
85
83
|
setSelectedContainerDetails = _useState6[1];
|
|
86
|
-
var _useState7 = (0, _react.useState)(
|
|
84
|
+
var _useState7 = (0, _react.useState)(teamLinks),
|
|
87
85
|
_useState8 = (0, _slicedToArray2.default)(_useState7, 2),
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
var _useState9 = (0, _react.useState)(
|
|
91
|
-
_useState0 = (0, _slicedToArray2.default)(_useState9, 2),
|
|
92
|
-
filteredTeamLinks = _useState0[0],
|
|
93
|
-
setFilteredTeamLinks = _useState0[1];
|
|
94
|
-
var _useState1 = (0, _react.useState)({
|
|
86
|
+
filteredTeamLinks = _useState8[0],
|
|
87
|
+
setFilteredTeamLinks = _useState8[1];
|
|
88
|
+
var _useState9 = (0, _react.useState)({
|
|
95
89
|
Jira: false,
|
|
96
90
|
Confluence: false,
|
|
97
91
|
Loom: false,
|
|
98
92
|
WebLink: false
|
|
99
93
|
}),
|
|
100
|
-
|
|
101
|
-
showAddContainer =
|
|
102
|
-
setShowAddContainer =
|
|
94
|
+
_useState0 = (0, _slicedToArray2.default)(_useState9, 2),
|
|
95
|
+
showAddContainer = _useState0[0],
|
|
96
|
+
setShowAddContainer = _useState0[1];
|
|
103
97
|
var _usePeopleAndTeamAnal = (0, _analytics.usePeopleAndTeamAnalytics)(),
|
|
104
98
|
fireOperationalEvent = _usePeopleAndTeamAnal.fireOperationalEvent,
|
|
105
99
|
fireTrackEvent = _usePeopleAndTeamAnal.fireTrackEvent;
|
|
@@ -121,26 +115,16 @@ var TeamContainers = exports.TeamContainers = function TeamContainers(_ref) {
|
|
|
121
115
|
productPermissionsOld = _useProductPermission2.data,
|
|
122
116
|
productPermissionIsLoadingOld = _useProductPermission2.loading;
|
|
123
117
|
(0, _react.useEffect)(function () {
|
|
124
|
-
if (
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
}));
|
|
129
|
-
} else {
|
|
130
|
-
setFilteredTeamLinks(teamLinks);
|
|
131
|
-
}
|
|
118
|
+
if (isDisplayedOnProfileCard && filterContainerId) {
|
|
119
|
+
setFilteredTeamLinks(teamLinks.filter(function (container) {
|
|
120
|
+
return container.id !== filterContainerId && !requestedContainers.includes(container.type);
|
|
121
|
+
}));
|
|
132
122
|
} else {
|
|
133
|
-
|
|
134
|
-
setFilteredTeamContainers(teamContainers.filter(function (container) {
|
|
135
|
-
return container.id !== filterContainerId;
|
|
136
|
-
}));
|
|
137
|
-
} else {
|
|
138
|
-
setFilteredTeamContainers(teamContainers);
|
|
139
|
-
}
|
|
123
|
+
setFilteredTeamLinks(teamLinks);
|
|
140
124
|
}
|
|
141
|
-
}, [teamLinks,
|
|
125
|
+
}, [teamLinks, isDisplayedOnProfileCard, filterContainerId, requestedContainers]);
|
|
142
126
|
(0, _react.useEffect)(function () {
|
|
143
|
-
var containersToCheck =
|
|
127
|
+
var containersToCheck = filteredTeamLinks;
|
|
144
128
|
if (containersToCheck.length > maxNumberOfContainersToShow || isDisplayedOnProfileCard) {
|
|
145
129
|
setShowAddContainer({
|
|
146
130
|
Jira: false,
|
|
@@ -173,7 +157,7 @@ var TeamContainers = exports.TeamContainers = function TeamContainers(_ref) {
|
|
|
173
157
|
WebLink: !containerExists('WebLink')
|
|
174
158
|
});
|
|
175
159
|
}
|
|
176
|
-
}, [isDisplayedOnProfileCard, productPermissions, productPermissionsOld,
|
|
160
|
+
}, [isDisplayedOnProfileCard, productPermissions, productPermissionsOld, filteredTeamLinks, maxNumberOfContainersToShow, requestedContainers]);
|
|
177
161
|
var handleShowMore = function handleShowMore() {
|
|
178
162
|
setShowMore(!showMore);
|
|
179
163
|
};
|
|
@@ -193,19 +177,17 @@ var TeamContainers = exports.TeamContainers = function TeamContainers(_ref) {
|
|
|
193
177
|
onEditContainerClick(container.id, container.link || '', container.name);
|
|
194
178
|
}
|
|
195
179
|
}, [onEditContainerClick]);
|
|
196
|
-
var LinkedContainerCardComponent = (components === null || components === void 0 ? void 0 : components.ContainerCard) ||
|
|
180
|
+
var LinkedContainerCardComponent = (components === null || components === void 0 ? void 0 : components.ContainerCard) || _teamLinkCard.TeamLinkCard;
|
|
197
181
|
var handleDisconnect = (0, _react.useCallback)( /*#__PURE__*/function () {
|
|
198
182
|
var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(containerId) {
|
|
199
183
|
var removedContainer;
|
|
200
184
|
return _regenerator.default.wrap(function _callee$(_context) {
|
|
201
185
|
while (1) switch (_context.prev = _context.next) {
|
|
202
186
|
case 0:
|
|
203
|
-
removedContainer =
|
|
204
|
-
return container.id === containerId;
|
|
205
|
-
}) : filteredTeamContainers.find(function (container) {
|
|
187
|
+
removedContainer = filteredTeamLinks.find(function (container) {
|
|
206
188
|
return container.id === containerId;
|
|
207
189
|
});
|
|
208
|
-
if (!
|
|
190
|
+
if (!removedContainer) {
|
|
209
191
|
_context.next = 6;
|
|
210
192
|
break;
|
|
211
193
|
}
|
|
@@ -246,7 +228,7 @@ var TeamContainers = exports.TeamContainers = function TeamContainers(_ref) {
|
|
|
246
228
|
return function (_x) {
|
|
247
229
|
return _ref2.apply(this, arguments);
|
|
248
230
|
};
|
|
249
|
-
}(), [actions, createAnalyticsEvent, fireOperationalEvent,
|
|
231
|
+
}(), [actions, createAnalyticsEvent, fireOperationalEvent, filteredTeamLinks, removeTeamLink, teamId, unlinkError]);
|
|
250
232
|
var TeamContainersSkeletonComponent = (components === null || components === void 0 ? void 0 : components.TeamContainersSkeleton) || _teamContainersSkeleton.TeamContainersSkeleton;
|
|
251
233
|
var hasNoPermissions = (0, _react.useMemo)(function () {
|
|
252
234
|
if ((0, _platformFeatureFlags.fg)('migrate-product-permissions')) {
|
|
@@ -255,20 +237,17 @@ var TeamContainers = exports.TeamContainers = function TeamContainers(_ref) {
|
|
|
255
237
|
return productPermissionsOld && !(0, _controllers.hasProductPermission)(productPermissionsOld, 'jira') && !(0, _controllers.hasProductPermission)(productPermissionsOld, 'confluence') && !(0, _controllers.hasProductPermission)(productPermissionsOld, 'loom');
|
|
256
238
|
}, [productPermissions, productPermissionsOld]);
|
|
257
239
|
var hasNoContainers = (0, _react.useMemo)(function () {
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
}
|
|
261
|
-
return filteredTeamContainers.length === 0;
|
|
262
|
-
}, [filteredTeamLinks, filteredTeamContainers]);
|
|
240
|
+
return filteredTeamLinks.length === 0;
|
|
241
|
+
}, [filteredTeamLinks]);
|
|
263
242
|
var isLoading = (0, _react.useMemo)(function () {
|
|
264
|
-
if (
|
|
243
|
+
if (linksLoading) {
|
|
265
244
|
return true;
|
|
266
245
|
}
|
|
267
246
|
if ((0, _platformFeatureFlags.fg)('migrate-product-permissions')) {
|
|
268
247
|
return productPermissionIsLoading;
|
|
269
248
|
}
|
|
270
249
|
return productPermissionIsLoadingOld;
|
|
271
|
-
}, [
|
|
250
|
+
}, [linksLoading, productPermissionIsLoading, productPermissionIsLoadingOld]);
|
|
272
251
|
if (isLoading) {
|
|
273
252
|
return /*#__PURE__*/_react.default.createElement(TeamContainersSkeletonComponent, {
|
|
274
253
|
numberOfContainers: maxNumberOfContainersToShow
|
|
@@ -287,7 +266,7 @@ var TeamContainers = exports.TeamContainers = function TeamContainers(_ref) {
|
|
|
287
266
|
key: containerType,
|
|
288
267
|
containerType: containerType
|
|
289
268
|
});
|
|
290
|
-
}),
|
|
269
|
+
}), filteredTeamLinks.slice(0, maxNumberOfContainersToShow).map(function (container) {
|
|
291
270
|
return /*#__PURE__*/_react.default.createElement(LinkedContainerCardComponent, {
|
|
292
271
|
key: container.id,
|
|
293
272
|
containerType: container.type,
|
|
@@ -309,23 +288,6 @@ var TeamContainers = exports.TeamContainers = function TeamContainers(_ref) {
|
|
|
309
288
|
return handleEditContainerClick(container);
|
|
310
289
|
}
|
|
311
290
|
});
|
|
312
|
-
}) : filteredTeamContainers.slice(0, maxNumberOfContainersToShow).map(function (container) {
|
|
313
|
-
return /*#__PURE__*/_react.default.createElement(LinkedContainerCardComponent, {
|
|
314
|
-
key: container.id,
|
|
315
|
-
containerType: container.type,
|
|
316
|
-
containerTypeProperties: container.containerTypeProperties,
|
|
317
|
-
title: container.name,
|
|
318
|
-
containerIcon: container.icon || undefined,
|
|
319
|
-
link: container.link || undefined,
|
|
320
|
-
containerId: container.id,
|
|
321
|
-
onDisconnectButtonClick: function onDisconnectButtonClick() {
|
|
322
|
-
return handleOpenDisconnectDialog({
|
|
323
|
-
containerId: container.id,
|
|
324
|
-
containerType: container.type,
|
|
325
|
-
containerName: container.name
|
|
326
|
-
});
|
|
327
|
-
}
|
|
328
|
-
});
|
|
329
291
|
}), showAddContainer.Jira && /*#__PURE__*/_react.default.createElement(_addContainerCard.AddContainerCard, {
|
|
330
292
|
onAddAContainerClick: function onAddAContainerClick(e) {
|
|
331
293
|
return _onAddAContainerClick(e, 'Jira');
|
|
@@ -341,12 +303,12 @@ var TeamContainers = exports.TeamContainers = function TeamContainers(_ref) {
|
|
|
341
303
|
return _onAddAContainerClick(e, 'Loom');
|
|
342
304
|
},
|
|
343
305
|
containerType: "LoomSpace"
|
|
344
|
-
}), showAddContainer.WebLink &&
|
|
306
|
+
}), showAddContainer.WebLink && /*#__PURE__*/_react.default.createElement(_addContainerCard.AddContainerCard, {
|
|
345
307
|
onAddAContainerClick: function onAddAContainerClick(e) {
|
|
346
308
|
return _onAddAContainerClick(e, 'WebLink');
|
|
347
309
|
},
|
|
348
310
|
containerType: "WebLink"
|
|
349
|
-
}), showMore &&
|
|
311
|
+
}), showMore && filteredTeamLinks.slice(maxNumberOfContainersToShow).map(function (container) {
|
|
350
312
|
return /*#__PURE__*/_react.default.createElement(LinkedContainerCardComponent, {
|
|
351
313
|
key: container.id,
|
|
352
314
|
containerType: container.type,
|
|
@@ -368,24 +330,7 @@ var TeamContainers = exports.TeamContainers = function TeamContainers(_ref) {
|
|
|
368
330
|
return handleEditContainerClick(container);
|
|
369
331
|
}
|
|
370
332
|
});
|
|
371
|
-
})
|
|
372
|
-
return /*#__PURE__*/_react.default.createElement(LinkedContainerCardComponent, {
|
|
373
|
-
key: container.id,
|
|
374
|
-
containerType: container.type,
|
|
375
|
-
containerTypeProperties: container.containerTypeProperties,
|
|
376
|
-
title: container.name,
|
|
377
|
-
containerId: container.id,
|
|
378
|
-
containerIcon: container.icon || undefined,
|
|
379
|
-
link: container.link || undefined,
|
|
380
|
-
onDisconnectButtonClick: function onDisconnectButtonClick() {
|
|
381
|
-
return handleOpenDisconnectDialog({
|
|
382
|
-
containerId: container.id,
|
|
383
|
-
containerType: container.type,
|
|
384
|
-
containerName: container.name
|
|
385
|
-
});
|
|
386
|
-
}
|
|
387
|
-
});
|
|
388
|
-
})), ((0, _platformFeatureFlags.fg)('enable_web_links_in_team_containers') ? filteredTeamLinks.length : filteredTeamContainers.length) > maxNumberOfContainersToShow && /*#__PURE__*/_react.default.createElement(_primitives.Inline, null, /*#__PURE__*/_react.default.createElement(_new.default, {
|
|
333
|
+
})), filteredTeamLinks.length > maxNumberOfContainersToShow && /*#__PURE__*/_react.default.createElement(_primitives.Inline, null, /*#__PURE__*/_react.default.createElement(_new.default, {
|
|
389
334
|
appearance: "subtle",
|
|
390
335
|
onClick: handleShowMore
|
|
391
336
|
}, showMore ? /*#__PURE__*/_react.default.createElement(_reactIntlNext.FormattedMessage, messages.showLess) : /*#__PURE__*/_react.default.createElement(_reactIntlNext.FormattedMessage, messages.showMore)))), /*#__PURE__*/_react.default.createElement(_modalTransition.default, null, isDisconnectDialogOpen && selectedContainerDetails && /*#__PURE__*/_react.default.createElement(_async.DisconnectDialogLazy, {
|
|
@@ -16,7 +16,6 @@ import { useTeamContainers, useTeamContainersHook } from '../../controllers/hook
|
|
|
16
16
|
import { useTeamLinksAndContainers } from '../../controllers/hooks/use-team-links-and-containers';
|
|
17
17
|
import { AddContainerCard } from './add-container-card';
|
|
18
18
|
import { DisconnectDialogLazy } from './disconnect-dialog/async';
|
|
19
|
-
import { LinkedContainerCard } from './linked-container-card';
|
|
20
19
|
import { NoProductAccessState } from './no-product-access-empty-state';
|
|
21
20
|
import { TeamContainersSkeleton } from './team-containers-skeleton';
|
|
22
21
|
import { LinkedContainerCardSkeleton } from './team-containers-skeleton/linked-container-card-skeleton';
|
|
@@ -40,15 +39,14 @@ export const TeamContainers = ({
|
|
|
40
39
|
createAnalyticsEvent
|
|
41
40
|
} = useAnalyticsEvents();
|
|
42
41
|
const {
|
|
43
|
-
teamContainers,
|
|
44
|
-
loading,
|
|
45
42
|
unlinkError
|
|
46
43
|
} = useTeamContainers(teamId);
|
|
47
44
|
const {
|
|
48
45
|
teamLinks,
|
|
49
46
|
removeTeamLink,
|
|
50
47
|
iconsLoading,
|
|
51
|
-
iconHasLoaded
|
|
48
|
+
iconHasLoaded,
|
|
49
|
+
isLoading: linksLoading
|
|
52
50
|
} = useTeamLinksAndContainers(teamId, true);
|
|
53
51
|
const {
|
|
54
52
|
requestedContainers
|
|
@@ -61,7 +59,6 @@ export const TeamContainers = ({
|
|
|
61
59
|
const [showMore, setShowMore] = useState(false);
|
|
62
60
|
const [isDisconnectDialogOpen, setIsDisconnectDialogOpen] = useState(false);
|
|
63
61
|
const [selectedContainerDetails, setSelectedContainerDetails] = useState();
|
|
64
|
-
const [filteredTeamContainers, setFilteredTeamContainers] = useState(teamContainers);
|
|
65
62
|
const [filteredTeamLinks, setFilteredTeamLinks] = useState(teamLinks);
|
|
66
63
|
const [showAddContainer, setShowAddContainer] = useState({
|
|
67
64
|
Jira: false,
|
|
@@ -93,22 +90,14 @@ export const TeamContainers = ({
|
|
|
93
90
|
enabled: !fg('migrate-product-permissions')
|
|
94
91
|
});
|
|
95
92
|
useEffect(() => {
|
|
96
|
-
if (
|
|
97
|
-
|
|
98
|
-
setFilteredTeamLinks(teamLinks.filter(container => container.id !== filterContainerId && !requestedContainers.includes(container.type)));
|
|
99
|
-
} else {
|
|
100
|
-
setFilteredTeamLinks(teamLinks);
|
|
101
|
-
}
|
|
93
|
+
if (isDisplayedOnProfileCard && filterContainerId) {
|
|
94
|
+
setFilteredTeamLinks(teamLinks.filter(container => container.id !== filterContainerId && !requestedContainers.includes(container.type)));
|
|
102
95
|
} else {
|
|
103
|
-
|
|
104
|
-
setFilteredTeamContainers(teamContainers.filter(container => container.id !== filterContainerId));
|
|
105
|
-
} else {
|
|
106
|
-
setFilteredTeamContainers(teamContainers);
|
|
107
|
-
}
|
|
96
|
+
setFilteredTeamLinks(teamLinks);
|
|
108
97
|
}
|
|
109
|
-
}, [teamLinks,
|
|
98
|
+
}, [teamLinks, isDisplayedOnProfileCard, filterContainerId, requestedContainers]);
|
|
110
99
|
useEffect(() => {
|
|
111
|
-
const containersToCheck =
|
|
100
|
+
const containersToCheck = filteredTeamLinks;
|
|
112
101
|
if (containersToCheck.length > maxNumberOfContainersToShow || isDisplayedOnProfileCard) {
|
|
113
102
|
setShowAddContainer({
|
|
114
103
|
Jira: false,
|
|
@@ -135,7 +124,7 @@ export const TeamContainers = ({
|
|
|
135
124
|
WebLink: !containerExists('WebLink')
|
|
136
125
|
});
|
|
137
126
|
}
|
|
138
|
-
}, [isDisplayedOnProfileCard, productPermissions, productPermissionsOld,
|
|
127
|
+
}, [isDisplayedOnProfileCard, productPermissions, productPermissionsOld, filteredTeamLinks, maxNumberOfContainersToShow, requestedContainers]);
|
|
139
128
|
const handleShowMore = () => {
|
|
140
129
|
setShowMore(!showMore);
|
|
141
130
|
};
|
|
@@ -155,10 +144,10 @@ export const TeamContainers = ({
|
|
|
155
144
|
onEditContainerClick(container.id, container.link || '', container.name);
|
|
156
145
|
}
|
|
157
146
|
}, [onEditContainerClick]);
|
|
158
|
-
const LinkedContainerCardComponent = (components === null || components === void 0 ? void 0 : components.ContainerCard) ||
|
|
147
|
+
const LinkedContainerCardComponent = (components === null || components === void 0 ? void 0 : components.ContainerCard) || TeamLinkCard;
|
|
159
148
|
const handleDisconnect = useCallback(async containerId => {
|
|
160
|
-
const removedContainer =
|
|
161
|
-
if (removedContainer
|
|
149
|
+
const removedContainer = filteredTeamLinks.find(container => container.id === containerId);
|
|
150
|
+
if (removedContainer) {
|
|
162
151
|
await removeTeamLink(removedContainer);
|
|
163
152
|
} else {
|
|
164
153
|
await actions.unlinkTeamContainers(teamId, containerId);
|
|
@@ -182,7 +171,7 @@ export const TeamContainers = ({
|
|
|
182
171
|
}
|
|
183
172
|
});
|
|
184
173
|
}
|
|
185
|
-
}, [actions, createAnalyticsEvent, fireOperationalEvent,
|
|
174
|
+
}, [actions, createAnalyticsEvent, fireOperationalEvent, filteredTeamLinks, removeTeamLink, teamId, unlinkError]);
|
|
186
175
|
const TeamContainersSkeletonComponent = (components === null || components === void 0 ? void 0 : components.TeamContainersSkeleton) || TeamContainersSkeleton;
|
|
187
176
|
const hasNoPermissions = useMemo(() => {
|
|
188
177
|
if (fg('migrate-product-permissions')) {
|
|
@@ -191,20 +180,17 @@ export const TeamContainers = ({
|
|
|
191
180
|
return productPermissionsOld && !hasProductPermissionOld(productPermissionsOld, 'jira') && !hasProductPermissionOld(productPermissionsOld, 'confluence') && !hasProductPermissionOld(productPermissionsOld, 'loom');
|
|
192
181
|
}, [productPermissions, productPermissionsOld]);
|
|
193
182
|
const hasNoContainers = useMemo(() => {
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
}
|
|
197
|
-
return filteredTeamContainers.length === 0;
|
|
198
|
-
}, [filteredTeamLinks, filteredTeamContainers]);
|
|
183
|
+
return filteredTeamLinks.length === 0;
|
|
184
|
+
}, [filteredTeamLinks]);
|
|
199
185
|
const isLoading = useMemo(() => {
|
|
200
|
-
if (
|
|
186
|
+
if (linksLoading) {
|
|
201
187
|
return true;
|
|
202
188
|
}
|
|
203
189
|
if (fg('migrate-product-permissions')) {
|
|
204
190
|
return productPermissionIsLoading;
|
|
205
191
|
}
|
|
206
192
|
return productPermissionIsLoadingOld;
|
|
207
|
-
}, [
|
|
193
|
+
}, [linksLoading, productPermissionIsLoading, productPermissionIsLoadingOld]);
|
|
208
194
|
if (isLoading) {
|
|
209
195
|
return /*#__PURE__*/React.createElement(TeamContainersSkeletonComponent, {
|
|
210
196
|
numberOfContainers: maxNumberOfContainersToShow
|
|
@@ -221,7 +207,7 @@ export const TeamContainers = ({
|
|
|
221
207
|
}, requestedContainers.map(containerType => /*#__PURE__*/React.createElement(LinkedContainerCardSkeleton, {
|
|
222
208
|
key: containerType,
|
|
223
209
|
containerType: containerType
|
|
224
|
-
})),
|
|
210
|
+
})), filteredTeamLinks.slice(0, maxNumberOfContainersToShow).map(container => {
|
|
225
211
|
return /*#__PURE__*/React.createElement(LinkedContainerCardComponent, {
|
|
226
212
|
key: container.id,
|
|
227
213
|
containerType: container.type,
|
|
@@ -239,21 +225,6 @@ export const TeamContainers = ({
|
|
|
239
225
|
}),
|
|
240
226
|
onEditLinkClick: () => handleEditContainerClick(container)
|
|
241
227
|
});
|
|
242
|
-
}) : filteredTeamContainers.slice(0, maxNumberOfContainersToShow).map(container => {
|
|
243
|
-
return /*#__PURE__*/React.createElement(LinkedContainerCardComponent, {
|
|
244
|
-
key: container.id,
|
|
245
|
-
containerType: container.type,
|
|
246
|
-
containerTypeProperties: container.containerTypeProperties,
|
|
247
|
-
title: container.name,
|
|
248
|
-
containerIcon: container.icon || undefined,
|
|
249
|
-
link: container.link || undefined,
|
|
250
|
-
containerId: container.id,
|
|
251
|
-
onDisconnectButtonClick: () => handleOpenDisconnectDialog({
|
|
252
|
-
containerId: container.id,
|
|
253
|
-
containerType: container.type,
|
|
254
|
-
containerName: container.name
|
|
255
|
-
})
|
|
256
|
-
});
|
|
257
228
|
}), showAddContainer.Jira && /*#__PURE__*/React.createElement(AddContainerCard, {
|
|
258
229
|
onAddAContainerClick: e => onAddAContainerClick(e, 'Jira'),
|
|
259
230
|
containerType: "JiraProject"
|
|
@@ -263,10 +234,10 @@ export const TeamContainers = ({
|
|
|
263
234
|
}), showAddContainer.Loom && fg('loom_tab_in_container_linker_team_profile_page') && /*#__PURE__*/React.createElement(AddContainerCard, {
|
|
264
235
|
onAddAContainerClick: e => onAddAContainerClick(e, 'Loom'),
|
|
265
236
|
containerType: "LoomSpace"
|
|
266
|
-
}), showAddContainer.WebLink &&
|
|
237
|
+
}), showAddContainer.WebLink && /*#__PURE__*/React.createElement(AddContainerCard, {
|
|
267
238
|
onAddAContainerClick: e => onAddAContainerClick(e, 'WebLink'),
|
|
268
239
|
containerType: "WebLink"
|
|
269
|
-
}), showMore &&
|
|
240
|
+
}), showMore && filteredTeamLinks.slice(maxNumberOfContainersToShow).map(container => {
|
|
270
241
|
return /*#__PURE__*/React.createElement(LinkedContainerCardComponent, {
|
|
271
242
|
key: container.id,
|
|
272
243
|
containerType: container.type,
|
|
@@ -284,22 +255,7 @@ export const TeamContainers = ({
|
|
|
284
255
|
}),
|
|
285
256
|
onEditLinkClick: () => handleEditContainerClick(container)
|
|
286
257
|
});
|
|
287
|
-
})
|
|
288
|
-
return /*#__PURE__*/React.createElement(LinkedContainerCardComponent, {
|
|
289
|
-
key: container.id,
|
|
290
|
-
containerType: container.type,
|
|
291
|
-
containerTypeProperties: container.containerTypeProperties,
|
|
292
|
-
title: container.name,
|
|
293
|
-
containerId: container.id,
|
|
294
|
-
containerIcon: container.icon || undefined,
|
|
295
|
-
link: container.link || undefined,
|
|
296
|
-
onDisconnectButtonClick: () => handleOpenDisconnectDialog({
|
|
297
|
-
containerId: container.id,
|
|
298
|
-
containerType: container.type,
|
|
299
|
-
containerName: container.name
|
|
300
|
-
})
|
|
301
|
-
});
|
|
302
|
-
})), (fg('enable_web_links_in_team_containers') ? filteredTeamLinks.length : filteredTeamContainers.length) > maxNumberOfContainersToShow && /*#__PURE__*/React.createElement(Inline, null, /*#__PURE__*/React.createElement(Button, {
|
|
258
|
+
})), filteredTeamLinks.length > maxNumberOfContainersToShow && /*#__PURE__*/React.createElement(Inline, null, /*#__PURE__*/React.createElement(Button, {
|
|
303
259
|
appearance: "subtle",
|
|
304
260
|
onClick: handleShowMore
|
|
305
261
|
}, showMore ? /*#__PURE__*/React.createElement(FormattedMessage, messages.showLess) : /*#__PURE__*/React.createElement(FormattedMessage, messages.showMore)))), /*#__PURE__*/React.createElement(ModalTransition, null, isDisconnectDialogOpen && selectedContainerDetails && /*#__PURE__*/React.createElement(DisconnectDialogLazy, {
|
|
@@ -19,7 +19,6 @@ import { useTeamContainers, useTeamContainersHook } from '../../controllers/hook
|
|
|
19
19
|
import { useTeamLinksAndContainers } from '../../controllers/hooks/use-team-links-and-containers';
|
|
20
20
|
import { AddContainerCard } from './add-container-card';
|
|
21
21
|
import { DisconnectDialogLazy } from './disconnect-dialog/async';
|
|
22
|
-
import { LinkedContainerCard } from './linked-container-card';
|
|
23
22
|
import { NoProductAccessState } from './no-product-access-empty-state';
|
|
24
23
|
import { TeamContainersSkeleton } from './team-containers-skeleton';
|
|
25
24
|
import { LinkedContainerCardSkeleton } from './team-containers-skeleton/linked-container-card-skeleton';
|
|
@@ -43,14 +42,13 @@ export var TeamContainers = function TeamContainers(_ref) {
|
|
|
43
42
|
var _useAnalyticsEvents = useAnalyticsEvents(),
|
|
44
43
|
createAnalyticsEvent = _useAnalyticsEvents.createAnalyticsEvent;
|
|
45
44
|
var _useTeamContainers = useTeamContainers(teamId),
|
|
46
|
-
teamContainers = _useTeamContainers.teamContainers,
|
|
47
|
-
loading = _useTeamContainers.loading,
|
|
48
45
|
unlinkError = _useTeamContainers.unlinkError;
|
|
49
46
|
var _useTeamLinksAndConta = useTeamLinksAndContainers(teamId, true),
|
|
50
47
|
teamLinks = _useTeamLinksAndConta.teamLinks,
|
|
51
48
|
removeTeamLink = _useTeamLinksAndConta.removeTeamLink,
|
|
52
49
|
iconsLoading = _useTeamLinksAndConta.iconsLoading,
|
|
53
|
-
iconHasLoaded = _useTeamLinksAndConta.iconHasLoaded
|
|
50
|
+
iconHasLoaded = _useTeamLinksAndConta.iconHasLoaded,
|
|
51
|
+
linksLoading = _useTeamLinksAndConta.isLoading;
|
|
54
52
|
var _useRequestedContaine = useRequestedContainers({
|
|
55
53
|
teamId: teamId,
|
|
56
54
|
cloudId: cloudId,
|
|
@@ -73,23 +71,19 @@ export var TeamContainers = function TeamContainers(_ref) {
|
|
|
73
71
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
74
72
|
selectedContainerDetails = _useState6[0],
|
|
75
73
|
setSelectedContainerDetails = _useState6[1];
|
|
76
|
-
var _useState7 = useState(
|
|
74
|
+
var _useState7 = useState(teamLinks),
|
|
77
75
|
_useState8 = _slicedToArray(_useState7, 2),
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
var _useState9 = useState(
|
|
81
|
-
_useState0 = _slicedToArray(_useState9, 2),
|
|
82
|
-
filteredTeamLinks = _useState0[0],
|
|
83
|
-
setFilteredTeamLinks = _useState0[1];
|
|
84
|
-
var _useState1 = useState({
|
|
76
|
+
filteredTeamLinks = _useState8[0],
|
|
77
|
+
setFilteredTeamLinks = _useState8[1];
|
|
78
|
+
var _useState9 = useState({
|
|
85
79
|
Jira: false,
|
|
86
80
|
Confluence: false,
|
|
87
81
|
Loom: false,
|
|
88
82
|
WebLink: false
|
|
89
83
|
}),
|
|
90
|
-
|
|
91
|
-
showAddContainer =
|
|
92
|
-
setShowAddContainer =
|
|
84
|
+
_useState0 = _slicedToArray(_useState9, 2),
|
|
85
|
+
showAddContainer = _useState0[0],
|
|
86
|
+
setShowAddContainer = _useState0[1];
|
|
93
87
|
var _usePeopleAndTeamAnal = usePeopleAndTeamAnalytics(),
|
|
94
88
|
fireOperationalEvent = _usePeopleAndTeamAnal.fireOperationalEvent,
|
|
95
89
|
fireTrackEvent = _usePeopleAndTeamAnal.fireTrackEvent;
|
|
@@ -111,26 +105,16 @@ export var TeamContainers = function TeamContainers(_ref) {
|
|
|
111
105
|
productPermissionsOld = _useProductPermission2.data,
|
|
112
106
|
productPermissionIsLoadingOld = _useProductPermission2.loading;
|
|
113
107
|
useEffect(function () {
|
|
114
|
-
if (
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
}));
|
|
119
|
-
} else {
|
|
120
|
-
setFilteredTeamLinks(teamLinks);
|
|
121
|
-
}
|
|
108
|
+
if (isDisplayedOnProfileCard && filterContainerId) {
|
|
109
|
+
setFilteredTeamLinks(teamLinks.filter(function (container) {
|
|
110
|
+
return container.id !== filterContainerId && !requestedContainers.includes(container.type);
|
|
111
|
+
}));
|
|
122
112
|
} else {
|
|
123
|
-
|
|
124
|
-
setFilteredTeamContainers(teamContainers.filter(function (container) {
|
|
125
|
-
return container.id !== filterContainerId;
|
|
126
|
-
}));
|
|
127
|
-
} else {
|
|
128
|
-
setFilteredTeamContainers(teamContainers);
|
|
129
|
-
}
|
|
113
|
+
setFilteredTeamLinks(teamLinks);
|
|
130
114
|
}
|
|
131
|
-
}, [teamLinks,
|
|
115
|
+
}, [teamLinks, isDisplayedOnProfileCard, filterContainerId, requestedContainers]);
|
|
132
116
|
useEffect(function () {
|
|
133
|
-
var containersToCheck =
|
|
117
|
+
var containersToCheck = filteredTeamLinks;
|
|
134
118
|
if (containersToCheck.length > maxNumberOfContainersToShow || isDisplayedOnProfileCard) {
|
|
135
119
|
setShowAddContainer({
|
|
136
120
|
Jira: false,
|
|
@@ -163,7 +147,7 @@ export var TeamContainers = function TeamContainers(_ref) {
|
|
|
163
147
|
WebLink: !containerExists('WebLink')
|
|
164
148
|
});
|
|
165
149
|
}
|
|
166
|
-
}, [isDisplayedOnProfileCard, productPermissions, productPermissionsOld,
|
|
150
|
+
}, [isDisplayedOnProfileCard, productPermissions, productPermissionsOld, filteredTeamLinks, maxNumberOfContainersToShow, requestedContainers]);
|
|
167
151
|
var handleShowMore = function handleShowMore() {
|
|
168
152
|
setShowMore(!showMore);
|
|
169
153
|
};
|
|
@@ -183,19 +167,17 @@ export var TeamContainers = function TeamContainers(_ref) {
|
|
|
183
167
|
onEditContainerClick(container.id, container.link || '', container.name);
|
|
184
168
|
}
|
|
185
169
|
}, [onEditContainerClick]);
|
|
186
|
-
var LinkedContainerCardComponent = (components === null || components === void 0 ? void 0 : components.ContainerCard) ||
|
|
170
|
+
var LinkedContainerCardComponent = (components === null || components === void 0 ? void 0 : components.ContainerCard) || TeamLinkCard;
|
|
187
171
|
var handleDisconnect = useCallback( /*#__PURE__*/function () {
|
|
188
172
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(containerId) {
|
|
189
173
|
var removedContainer;
|
|
190
174
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
191
175
|
while (1) switch (_context.prev = _context.next) {
|
|
192
176
|
case 0:
|
|
193
|
-
removedContainer =
|
|
194
|
-
return container.id === containerId;
|
|
195
|
-
}) : filteredTeamContainers.find(function (container) {
|
|
177
|
+
removedContainer = filteredTeamLinks.find(function (container) {
|
|
196
178
|
return container.id === containerId;
|
|
197
179
|
});
|
|
198
|
-
if (!
|
|
180
|
+
if (!removedContainer) {
|
|
199
181
|
_context.next = 6;
|
|
200
182
|
break;
|
|
201
183
|
}
|
|
@@ -236,7 +218,7 @@ export var TeamContainers = function TeamContainers(_ref) {
|
|
|
236
218
|
return function (_x) {
|
|
237
219
|
return _ref2.apply(this, arguments);
|
|
238
220
|
};
|
|
239
|
-
}(), [actions, createAnalyticsEvent, fireOperationalEvent,
|
|
221
|
+
}(), [actions, createAnalyticsEvent, fireOperationalEvent, filteredTeamLinks, removeTeamLink, teamId, unlinkError]);
|
|
240
222
|
var TeamContainersSkeletonComponent = (components === null || components === void 0 ? void 0 : components.TeamContainersSkeleton) || TeamContainersSkeleton;
|
|
241
223
|
var hasNoPermissions = useMemo(function () {
|
|
242
224
|
if (fg('migrate-product-permissions')) {
|
|
@@ -245,20 +227,17 @@ export var TeamContainers = function TeamContainers(_ref) {
|
|
|
245
227
|
return productPermissionsOld && !hasProductPermissionOld(productPermissionsOld, 'jira') && !hasProductPermissionOld(productPermissionsOld, 'confluence') && !hasProductPermissionOld(productPermissionsOld, 'loom');
|
|
246
228
|
}, [productPermissions, productPermissionsOld]);
|
|
247
229
|
var hasNoContainers = useMemo(function () {
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
}
|
|
251
|
-
return filteredTeamContainers.length === 0;
|
|
252
|
-
}, [filteredTeamLinks, filteredTeamContainers]);
|
|
230
|
+
return filteredTeamLinks.length === 0;
|
|
231
|
+
}, [filteredTeamLinks]);
|
|
253
232
|
var isLoading = useMemo(function () {
|
|
254
|
-
if (
|
|
233
|
+
if (linksLoading) {
|
|
255
234
|
return true;
|
|
256
235
|
}
|
|
257
236
|
if (fg('migrate-product-permissions')) {
|
|
258
237
|
return productPermissionIsLoading;
|
|
259
238
|
}
|
|
260
239
|
return productPermissionIsLoadingOld;
|
|
261
|
-
}, [
|
|
240
|
+
}, [linksLoading, productPermissionIsLoading, productPermissionIsLoadingOld]);
|
|
262
241
|
if (isLoading) {
|
|
263
242
|
return /*#__PURE__*/React.createElement(TeamContainersSkeletonComponent, {
|
|
264
243
|
numberOfContainers: maxNumberOfContainersToShow
|
|
@@ -277,7 +256,7 @@ export var TeamContainers = function TeamContainers(_ref) {
|
|
|
277
256
|
key: containerType,
|
|
278
257
|
containerType: containerType
|
|
279
258
|
});
|
|
280
|
-
}),
|
|
259
|
+
}), filteredTeamLinks.slice(0, maxNumberOfContainersToShow).map(function (container) {
|
|
281
260
|
return /*#__PURE__*/React.createElement(LinkedContainerCardComponent, {
|
|
282
261
|
key: container.id,
|
|
283
262
|
containerType: container.type,
|
|
@@ -299,23 +278,6 @@ export var TeamContainers = function TeamContainers(_ref) {
|
|
|
299
278
|
return handleEditContainerClick(container);
|
|
300
279
|
}
|
|
301
280
|
});
|
|
302
|
-
}) : filteredTeamContainers.slice(0, maxNumberOfContainersToShow).map(function (container) {
|
|
303
|
-
return /*#__PURE__*/React.createElement(LinkedContainerCardComponent, {
|
|
304
|
-
key: container.id,
|
|
305
|
-
containerType: container.type,
|
|
306
|
-
containerTypeProperties: container.containerTypeProperties,
|
|
307
|
-
title: container.name,
|
|
308
|
-
containerIcon: container.icon || undefined,
|
|
309
|
-
link: container.link || undefined,
|
|
310
|
-
containerId: container.id,
|
|
311
|
-
onDisconnectButtonClick: function onDisconnectButtonClick() {
|
|
312
|
-
return handleOpenDisconnectDialog({
|
|
313
|
-
containerId: container.id,
|
|
314
|
-
containerType: container.type,
|
|
315
|
-
containerName: container.name
|
|
316
|
-
});
|
|
317
|
-
}
|
|
318
|
-
});
|
|
319
281
|
}), showAddContainer.Jira && /*#__PURE__*/React.createElement(AddContainerCard, {
|
|
320
282
|
onAddAContainerClick: function onAddAContainerClick(e) {
|
|
321
283
|
return _onAddAContainerClick(e, 'Jira');
|
|
@@ -331,12 +293,12 @@ export var TeamContainers = function TeamContainers(_ref) {
|
|
|
331
293
|
return _onAddAContainerClick(e, 'Loom');
|
|
332
294
|
},
|
|
333
295
|
containerType: "LoomSpace"
|
|
334
|
-
}), showAddContainer.WebLink &&
|
|
296
|
+
}), showAddContainer.WebLink && /*#__PURE__*/React.createElement(AddContainerCard, {
|
|
335
297
|
onAddAContainerClick: function onAddAContainerClick(e) {
|
|
336
298
|
return _onAddAContainerClick(e, 'WebLink');
|
|
337
299
|
},
|
|
338
300
|
containerType: "WebLink"
|
|
339
|
-
}), showMore &&
|
|
301
|
+
}), showMore && filteredTeamLinks.slice(maxNumberOfContainersToShow).map(function (container) {
|
|
340
302
|
return /*#__PURE__*/React.createElement(LinkedContainerCardComponent, {
|
|
341
303
|
key: container.id,
|
|
342
304
|
containerType: container.type,
|
|
@@ -358,24 +320,7 @@ export var TeamContainers = function TeamContainers(_ref) {
|
|
|
358
320
|
return handleEditContainerClick(container);
|
|
359
321
|
}
|
|
360
322
|
});
|
|
361
|
-
})
|
|
362
|
-
return /*#__PURE__*/React.createElement(LinkedContainerCardComponent, {
|
|
363
|
-
key: container.id,
|
|
364
|
-
containerType: container.type,
|
|
365
|
-
containerTypeProperties: container.containerTypeProperties,
|
|
366
|
-
title: container.name,
|
|
367
|
-
containerId: container.id,
|
|
368
|
-
containerIcon: container.icon || undefined,
|
|
369
|
-
link: container.link || undefined,
|
|
370
|
-
onDisconnectButtonClick: function onDisconnectButtonClick() {
|
|
371
|
-
return handleOpenDisconnectDialog({
|
|
372
|
-
containerId: container.id,
|
|
373
|
-
containerType: container.type,
|
|
374
|
-
containerName: container.name
|
|
375
|
-
});
|
|
376
|
-
}
|
|
377
|
-
});
|
|
378
|
-
})), (fg('enable_web_links_in_team_containers') ? filteredTeamLinks.length : filteredTeamContainers.length) > maxNumberOfContainersToShow && /*#__PURE__*/React.createElement(Inline, null, /*#__PURE__*/React.createElement(Button, {
|
|
323
|
+
})), filteredTeamLinks.length > maxNumberOfContainersToShow && /*#__PURE__*/React.createElement(Inline, null, /*#__PURE__*/React.createElement(Button, {
|
|
379
324
|
appearance: "subtle",
|
|
380
325
|
onClick: handleShowMore
|
|
381
326
|
}, showMore ? /*#__PURE__*/React.createElement(FormattedMessage, messages.showLess) : /*#__PURE__*/React.createElement(FormattedMessage, messages.showMore)))), /*#__PURE__*/React.createElement(ModalTransition, null, isDisconnectDialogOpen && selectedContainerDetails && /*#__PURE__*/React.createElement(DisconnectDialogLazy, {
|
package/package.json
CHANGED
|
@@ -117,7 +117,7 @@
|
|
|
117
117
|
}
|
|
118
118
|
},
|
|
119
119
|
"name": "@atlaskit/teams-public",
|
|
120
|
-
"version": "0.50.
|
|
120
|
+
"version": "0.50.3",
|
|
121
121
|
"description": "Public components related to teams",
|
|
122
122
|
"author": "Atlassian Pty Ltd",
|
|
123
123
|
"license": "Apache-2.0",
|
|
@@ -138,9 +138,6 @@
|
|
|
138
138
|
"should-render-to-parent-should-be-true-people-and-": {
|
|
139
139
|
"type": "boolean"
|
|
140
140
|
},
|
|
141
|
-
"enable_web_links_in_team_containers": {
|
|
142
|
-
"type": "boolean"
|
|
143
|
-
},
|
|
144
141
|
"enable_team_containers_null_check": {
|
|
145
142
|
"type": "boolean"
|
|
146
143
|
},
|