@atlaskit/teams-public 0.34.1 → 0.35.0
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 +12 -0
- package/dist/cjs/common/utils/team-web-link-converters.js +4 -1
- package/dist/cjs/controllers/hooks/use-team-links-and-containers/index.js +43 -21
- package/dist/cjs/controllers/hooks/use-team-web-links/index.js +74 -37
- package/dist/cjs/ui/team-containers/main.js +36 -8
- package/dist/cjs/ui/team-containers/team-link-card/index.compiled.css +26 -0
- package/dist/cjs/ui/team-containers/team-link-card/index.js +243 -0
- package/dist/es2019/common/utils/team-web-link-converters.js +3 -0
- package/dist/es2019/controllers/hooks/use-team-links-and-containers/index.js +24 -12
- package/dist/es2019/controllers/hooks/use-team-web-links/index.js +32 -6
- package/dist/es2019/ui/team-containers/main.js +22 -8
- package/dist/es2019/ui/team-containers/team-link-card/index.compiled.css +26 -0
- package/dist/es2019/ui/team-containers/team-link-card/index.js +222 -0
- package/dist/esm/common/utils/team-web-link-converters.js +3 -0
- package/dist/esm/controllers/hooks/use-team-links-and-containers/index.js +44 -22
- package/dist/esm/controllers/hooks/use-team-web-links/index.js +74 -37
- package/dist/esm/ui/team-containers/main.js +36 -8
- package/dist/esm/ui/team-containers/team-link-card/index.compiled.css +26 -0
- package/dist/esm/ui/team-containers/team-link-card/index.js +234 -0
- package/dist/types/common/utils/team-web-link-converters.d.ts +1 -0
- package/dist/types/controllers/hooks/use-team-links-and-containers/index.d.ts +3 -3
- package/dist/types/controllers/hooks/use-team-web-links/index.d.ts +9 -9
- package/dist/types/ui/team-containers/main.d.ts +1 -1
- package/dist/types/ui/team-containers/team-link-card/index.d.ts +16 -0
- package/dist/types/ui/team-containers/types.d.ts +5 -1
- package/dist/types-ts4.5/common/utils/team-web-link-converters.d.ts +1 -0
- package/dist/types-ts4.5/controllers/hooks/use-team-links-and-containers/index.d.ts +3 -3
- package/dist/types-ts4.5/controllers/hooks/use-team-web-links/index.d.ts +9 -9
- package/dist/types-ts4.5/ui/team-containers/main.d.ts +1 -1
- package/dist/types-ts4.5/ui/team-containers/team-link-card/index.d.ts +16 -0
- package/dist/types-ts4.5/ui/team-containers/types.d.ts +5 -1
- package/package.json +4 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @atlaskit/teams-public
|
|
2
2
|
|
|
3
|
+
## 0.35.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#163866](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/163866)
|
|
8
|
+
[`e15fce4142e99`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/e15fce4142e99) -
|
|
9
|
+
[ux] PTC-11966 Add actions of add/update/delete team link card
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Updated dependencies
|
|
14
|
+
|
|
3
15
|
## 0.34.1
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.webLinksToContainers = exports.webLinkToContainer = exports.containerToNewWebLink = void 0;
|
|
6
|
+
exports.webLinksToContainers = exports.webLinkToContainer = exports.isNewTeamWebLink = exports.containerToNewWebLink = void 0;
|
|
7
7
|
var containerToNewWebLink = exports.containerToNewWebLink = function containerToNewWebLink(container) {
|
|
8
8
|
return {
|
|
9
9
|
contentTitle: container.name,
|
|
@@ -22,4 +22,7 @@ var webLinkToContainer = exports.webLinkToContainer = function webLinkToContaine
|
|
|
22
22
|
};
|
|
23
23
|
var webLinksToContainers = exports.webLinksToContainers = function webLinksToContainers(links) {
|
|
24
24
|
return links.map(webLinkToContainer);
|
|
25
|
+
};
|
|
26
|
+
var isNewTeamWebLink = exports.isNewTeamWebLink = function isNewTeamWebLink(input) {
|
|
27
|
+
return 'contentTitle' in input && 'linkUri' in input && !('type' in input) && !('id' in input);
|
|
25
28
|
};
|
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.useTeamLinksAndContainers = void 0;
|
|
8
8
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
9
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
10
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
10
11
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
11
12
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
@@ -13,6 +14,8 @@ var _react = require("react");
|
|
|
13
14
|
var _teamWebLinkConverters = require("../../../common/utils/team-web-link-converters");
|
|
14
15
|
var _useTeamContainers2 = require("../use-team-containers");
|
|
15
16
|
var _useTeamWebLinks3 = require("../use-team-web-links");
|
|
17
|
+
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; }
|
|
18
|
+
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) { (0, _defineProperty2.default)(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; }
|
|
16
19
|
var MAX_LINKS_LIMIT = 10;
|
|
17
20
|
var useTeamLinksAndContainers = exports.useTeamLinksAndContainers = function useTeamLinksAndContainers(teamId) {
|
|
18
21
|
var enableContainers = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
@@ -48,24 +51,33 @@ var useTeamLinksAndContainers = exports.useTeamLinksAndContainers = function use
|
|
|
48
51
|
return allContainers.length <= MAX_LINKS_LIMIT;
|
|
49
52
|
}, [allContainers.length]);
|
|
50
53
|
var addTeamLink = (0, _react.useCallback)( /*#__PURE__*/function () {
|
|
51
|
-
var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(
|
|
54
|
+
var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(containerOrWebLink) {
|
|
52
55
|
var webLink;
|
|
53
56
|
return _regenerator.default.wrap(function _callee$(_context) {
|
|
54
57
|
while (1) switch (_context.prev = _context.next) {
|
|
55
58
|
case 0:
|
|
56
|
-
if (!(
|
|
57
|
-
_context.next =
|
|
59
|
+
if (!(0, _teamWebLinkConverters.isNewTeamWebLink)(containerOrWebLink)) {
|
|
60
|
+
_context.next = 6;
|
|
58
61
|
break;
|
|
59
62
|
}
|
|
60
|
-
|
|
61
|
-
|
|
63
|
+
_context.next = 3;
|
|
64
|
+
return createTeamWebLink(teamId, containerOrWebLink);
|
|
65
|
+
case 3:
|
|
66
|
+
return _context.abrupt("return", _context.sent);
|
|
67
|
+
case 6:
|
|
68
|
+
if (!(containerOrWebLink.type === 'WebLink')) {
|
|
69
|
+
_context.next = 13;
|
|
70
|
+
break;
|
|
71
|
+
}
|
|
72
|
+
webLink = (0, _teamWebLinkConverters.containerToNewWebLink)(containerOrWebLink);
|
|
73
|
+
_context.next = 10;
|
|
62
74
|
return createTeamWebLink(teamId, webLink);
|
|
63
|
-
case
|
|
75
|
+
case 10:
|
|
64
76
|
return _context.abrupt("return", _context.sent);
|
|
65
|
-
case
|
|
66
|
-
addTeamContainer(
|
|
67
|
-
return _context.abrupt("return", Promise.resolve(
|
|
68
|
-
case
|
|
77
|
+
case 13:
|
|
78
|
+
addTeamContainer(containerOrWebLink);
|
|
79
|
+
return _context.abrupt("return", Promise.resolve(containerOrWebLink));
|
|
80
|
+
case 15:
|
|
69
81
|
case "end":
|
|
70
82
|
return _context.stop();
|
|
71
83
|
}
|
|
@@ -75,22 +87,32 @@ var useTeamLinksAndContainers = exports.useTeamLinksAndContainers = function use
|
|
|
75
87
|
return _ref.apply(this, arguments);
|
|
76
88
|
};
|
|
77
89
|
}(), [teamId, createTeamWebLink, addTeamContainer]);
|
|
78
|
-
var
|
|
79
|
-
var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(
|
|
80
|
-
var
|
|
90
|
+
var updateTeamLinkById = (0, _react.useCallback)( /*#__PURE__*/function () {
|
|
91
|
+
var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(linkId, updatedFields) {
|
|
92
|
+
var container, currentWebLink, updatedWebLink;
|
|
81
93
|
return _regenerator.default.wrap(function _callee2$(_context2) {
|
|
82
94
|
while (1) switch (_context2.prev = _context2.next) {
|
|
83
95
|
case 0:
|
|
96
|
+
container = allContainers.find(function (link) {
|
|
97
|
+
return link.id === linkId;
|
|
98
|
+
});
|
|
99
|
+
if (container) {
|
|
100
|
+
_context2.next = 3;
|
|
101
|
+
break;
|
|
102
|
+
}
|
|
103
|
+
return _context2.abrupt("return");
|
|
104
|
+
case 3:
|
|
84
105
|
if (!(container.type === 'WebLink')) {
|
|
85
|
-
_context2.next =
|
|
106
|
+
_context2.next = 9;
|
|
86
107
|
break;
|
|
87
108
|
}
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
109
|
+
currentWebLink = (0, _teamWebLinkConverters.containerToNewWebLink)(container);
|
|
110
|
+
updatedWebLink = _objectSpread(_objectSpread({}, currentWebLink), updatedFields);
|
|
111
|
+
_context2.next = 8;
|
|
112
|
+
return updateTeamWebLink(teamId, linkId, updatedWebLink);
|
|
113
|
+
case 8:
|
|
92
114
|
return _context2.abrupt("return", _context2.sent);
|
|
93
|
-
case
|
|
115
|
+
case 9:
|
|
94
116
|
case "end":
|
|
95
117
|
return _context2.stop();
|
|
96
118
|
}
|
|
@@ -99,7 +121,7 @@ var useTeamLinksAndContainers = exports.useTeamLinksAndContainers = function use
|
|
|
99
121
|
return function (_x2, _x3) {
|
|
100
122
|
return _ref2.apply(this, arguments);
|
|
101
123
|
};
|
|
102
|
-
}(), [teamId, updateTeamWebLink]);
|
|
124
|
+
}(), [teamId, allContainers, updateTeamWebLink]);
|
|
103
125
|
var removeTeamLink = (0, _react.useCallback)( /*#__PURE__*/function () {
|
|
104
126
|
var _ref3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3(container) {
|
|
105
127
|
return _regenerator.default.wrap(function _callee3$(_context3) {
|
|
@@ -138,7 +160,7 @@ var useTeamLinksAndContainers = exports.useTeamLinksAndContainers = function use
|
|
|
138
160
|
teamLinks: allContainers,
|
|
139
161
|
canAddMoreLink: canAddMoreLink,
|
|
140
162
|
addTeamLink: addTeamLink,
|
|
141
|
-
|
|
163
|
+
updateTeamLinkById: updateTeamLinkById,
|
|
142
164
|
removeTeamLink: removeTeamLink
|
|
143
165
|
};
|
|
144
166
|
};
|
|
@@ -7,6 +7,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.useTeamWebLinksActions = exports.useTeamWebLinks = exports.actions = void 0;
|
|
8
8
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
9
9
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
10
|
+
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
10
11
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
11
12
|
var _reactSweetState = require("react-sweet-state");
|
|
12
13
|
var _teamsClient = require("@atlaskit/teams-client");
|
|
@@ -90,64 +91,100 @@ var actions = exports.actions = {
|
|
|
90
91
|
}();
|
|
91
92
|
},
|
|
92
93
|
createTeamWebLink: function createTeamWebLink(teamId, newLink) {
|
|
93
|
-
return /*#__PURE__*/
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
94
|
+
return /*#__PURE__*/function () {
|
|
95
|
+
var _ref4 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(_ref3) {
|
|
96
|
+
var getState, setState, result, currentState;
|
|
97
|
+
return _regenerator.default.wrap(function _callee2$(_context2) {
|
|
98
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
99
|
+
case 0:
|
|
100
|
+
getState = _ref3.getState, setState = _ref3.setState;
|
|
101
|
+
_context2.next = 3;
|
|
102
|
+
return _teamsClient.teamsClient.createTeamLink(teamId, newLink);
|
|
103
|
+
case 3:
|
|
104
|
+
result = _context2.sent;
|
|
105
|
+
currentState = getState();
|
|
106
|
+
if (currentState.teamId === teamId) {
|
|
107
|
+
setState({
|
|
108
|
+
links: [].concat((0, _toConsumableArray2.default)(currentState.links), [result])
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
return _context2.abrupt("return", result);
|
|
112
|
+
case 7:
|
|
113
|
+
case "end":
|
|
114
|
+
return _context2.stop();
|
|
115
|
+
}
|
|
116
|
+
}, _callee2);
|
|
117
|
+
}));
|
|
118
|
+
return function (_x2) {
|
|
119
|
+
return _ref4.apply(this, arguments);
|
|
120
|
+
};
|
|
121
|
+
}();
|
|
107
122
|
},
|
|
108
123
|
updateTeamWebLink: function updateTeamWebLink(teamId, linkId, newLink) {
|
|
109
|
-
return /*#__PURE__*/
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
124
|
+
return /*#__PURE__*/function () {
|
|
125
|
+
var _ref6 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3(_ref5) {
|
|
126
|
+
var getState, setState, result, currentState;
|
|
127
|
+
return _regenerator.default.wrap(function _callee3$(_context3) {
|
|
128
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
129
|
+
case 0:
|
|
130
|
+
getState = _ref5.getState, setState = _ref5.setState;
|
|
131
|
+
_context3.next = 3;
|
|
132
|
+
return _teamsClient.teamsClient.updateTeamLink(teamId, linkId, newLink);
|
|
133
|
+
case 3:
|
|
134
|
+
result = _context3.sent;
|
|
135
|
+
currentState = getState();
|
|
136
|
+
if (currentState.teamId === teamId) {
|
|
137
|
+
setState({
|
|
138
|
+
links: currentState.links.map(function (link) {
|
|
139
|
+
return link.linkId === linkId ? result : link;
|
|
140
|
+
})
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
return _context3.abrupt("return", result);
|
|
144
|
+
case 7:
|
|
145
|
+
case "end":
|
|
146
|
+
return _context3.stop();
|
|
147
|
+
}
|
|
148
|
+
}, _callee3);
|
|
149
|
+
}));
|
|
150
|
+
return function (_x3) {
|
|
151
|
+
return _ref6.apply(this, arguments);
|
|
152
|
+
};
|
|
153
|
+
}();
|
|
123
154
|
},
|
|
124
155
|
removeWebLink: function removeWebLink(teamId, linkId) {
|
|
125
156
|
return /*#__PURE__*/function () {
|
|
126
|
-
var
|
|
127
|
-
var
|
|
157
|
+
var _ref8 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4(_ref7) {
|
|
158
|
+
var getState, setState, currentState;
|
|
128
159
|
return _regenerator.default.wrap(function _callee4$(_context4) {
|
|
129
160
|
while (1) switch (_context4.prev = _context4.next) {
|
|
130
161
|
case 0:
|
|
131
|
-
|
|
162
|
+
getState = _ref7.getState, setState = _ref7.setState;
|
|
132
163
|
_context4.next = 3;
|
|
133
164
|
return _teamsClient.teamsClient.deleteTeamLink(teamId, linkId);
|
|
134
165
|
case 3:
|
|
135
|
-
|
|
136
|
-
|
|
166
|
+
currentState = getState();
|
|
167
|
+
if (currentState.teamId === teamId) {
|
|
168
|
+
setState({
|
|
169
|
+
links: currentState.links.filter(function (link) {
|
|
170
|
+
return link.linkId !== linkId;
|
|
171
|
+
})
|
|
172
|
+
});
|
|
173
|
+
}
|
|
137
174
|
case 5:
|
|
138
175
|
case "end":
|
|
139
176
|
return _context4.stop();
|
|
140
177
|
}
|
|
141
178
|
}, _callee4);
|
|
142
179
|
}));
|
|
143
|
-
return function (
|
|
144
|
-
return
|
|
180
|
+
return function (_x4) {
|
|
181
|
+
return _ref8.apply(this, arguments);
|
|
145
182
|
};
|
|
146
183
|
}();
|
|
147
184
|
},
|
|
148
185
|
initialState: function initialState(state) {
|
|
149
|
-
return function (
|
|
150
|
-
var setState =
|
|
186
|
+
return function (_ref9) {
|
|
187
|
+
var setState = _ref9.setState;
|
|
151
188
|
setState(_objectSpread(_objectSpread({}, _initialState), state));
|
|
152
189
|
};
|
|
153
190
|
}
|
|
@@ -28,6 +28,7 @@ var _async = require("./disconnect-dialog/async");
|
|
|
28
28
|
var _linkedContainerCard = require("./linked-container-card");
|
|
29
29
|
var _noProductAccessEmptyState = require("./no-product-access-empty-state");
|
|
30
30
|
var _teamContainersSkeleton = require("./team-containers-skeleton");
|
|
31
|
+
var _teamLinkCard = require("./team-link-card");
|
|
31
32
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
32
33
|
var ICON_BACKGROUND = exports.ICON_BACKGROUND = "var(--ds-icon-inverse, ".concat(_colors.N0, ")");
|
|
33
34
|
var ICON_COLOR = exports.ICON_COLOR = "var(--ds-icon-subtle, ".concat(_colors.N90, ")");
|
|
@@ -35,6 +36,7 @@ var MAX_NUMBER_OF_CONTAINERS_TO_SHOW = exports.MAX_NUMBER_OF_CONTAINERS_TO_SHOW
|
|
|
35
36
|
var TeamContainers = exports.TeamContainers = function TeamContainers(_ref) {
|
|
36
37
|
var teamId = _ref.teamId,
|
|
37
38
|
_onAddAContainerClick = _ref.onAddAContainerClick,
|
|
39
|
+
onEditContainerClick = _ref.onEditContainerClick,
|
|
38
40
|
components = _ref.components,
|
|
39
41
|
userId = _ref.userId,
|
|
40
42
|
cloudId = _ref.cloudId,
|
|
@@ -50,7 +52,8 @@ var TeamContainers = exports.TeamContainers = function TeamContainers(_ref) {
|
|
|
50
52
|
loading = _useTeamContainers.loading,
|
|
51
53
|
unlinkError = _useTeamContainers.unlinkError;
|
|
52
54
|
var _useTeamLinksAndConta = (0, _useTeamLinksAndContainers.useTeamLinksAndContainers)(teamId, true),
|
|
53
|
-
teamLinks = _useTeamLinksAndConta.teamLinks
|
|
55
|
+
teamLinks = _useTeamLinksAndConta.teamLinks,
|
|
56
|
+
removeTeamLink = _useTeamLinksAndConta.removeTeamLink;
|
|
54
57
|
var _useTeamContainersHoo = (0, _useTeamContainers2.useTeamContainersHook)(),
|
|
55
58
|
_useTeamContainersHoo2 = (0, _slicedToArray2.default)(_useTeamContainersHoo, 2),
|
|
56
59
|
_ = _useTeamContainersHoo2[0],
|
|
@@ -156,19 +159,36 @@ var TeamContainers = exports.TeamContainers = function TeamContainers(_ref) {
|
|
|
156
159
|
}
|
|
157
160
|
});
|
|
158
161
|
}, [createAnalyticsEvent, fireTrackEvent, teamId]);
|
|
159
|
-
var
|
|
162
|
+
var handleEditContainerClick = (0, _react.useCallback)(function (container) {
|
|
163
|
+
if (container.type === 'WebLink' && onEditContainerClick) {
|
|
164
|
+
onEditContainerClick(container.id, container.link || '', container.name);
|
|
165
|
+
}
|
|
166
|
+
}, [onEditContainerClick]);
|
|
167
|
+
var LinkedContainerCardComponent = (components === null || components === void 0 ? void 0 : components.ContainerCard) || (isSupportingAddWebLink ? _teamLinkCard.TeamLinkCard : _linkedContainerCard.LinkedContainerCard);
|
|
160
168
|
var handleDisconnect = (0, _react.useCallback)( /*#__PURE__*/function () {
|
|
161
169
|
var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(containerId) {
|
|
162
170
|
var removedContainer;
|
|
163
171
|
return _regenerator.default.wrap(function _callee$(_context) {
|
|
164
172
|
while (1) switch (_context.prev = _context.next) {
|
|
165
173
|
case 0:
|
|
166
|
-
removedContainer =
|
|
174
|
+
removedContainer = isSupportingAddWebLink ? filteredTeamLinks.find(function (container) {
|
|
175
|
+
return container.id === containerId;
|
|
176
|
+
}) : filteredTeamContainers.find(function (container) {
|
|
167
177
|
return container.id === containerId;
|
|
168
178
|
});
|
|
169
|
-
|
|
179
|
+
if (!(isSupportingAddWebLink && removedContainer)) {
|
|
180
|
+
_context.next = 6;
|
|
181
|
+
break;
|
|
182
|
+
}
|
|
183
|
+
_context.next = 4;
|
|
184
|
+
return removeTeamLink(removedContainer);
|
|
185
|
+
case 4:
|
|
186
|
+
_context.next = 8;
|
|
187
|
+
break;
|
|
188
|
+
case 6:
|
|
189
|
+
_context.next = 8;
|
|
170
190
|
return actions.unlinkTeamContainers(teamId, containerId);
|
|
171
|
-
case
|
|
191
|
+
case 8:
|
|
172
192
|
setIsDisconnectDialogOpen(false);
|
|
173
193
|
if (unlinkError) {
|
|
174
194
|
fireOperationalEvent(createAnalyticsEvent, {
|
|
@@ -188,7 +208,7 @@ var TeamContainers = exports.TeamContainers = function TeamContainers(_ref) {
|
|
|
188
208
|
}
|
|
189
209
|
});
|
|
190
210
|
}
|
|
191
|
-
case
|
|
211
|
+
case 10:
|
|
192
212
|
case "end":
|
|
193
213
|
return _context.stop();
|
|
194
214
|
}
|
|
@@ -197,7 +217,7 @@ var TeamContainers = exports.TeamContainers = function TeamContainers(_ref) {
|
|
|
197
217
|
return function (_x) {
|
|
198
218
|
return _ref2.apply(this, arguments);
|
|
199
219
|
};
|
|
200
|
-
}(), [actions, createAnalyticsEvent, fireOperationalEvent, filteredTeamContainers, teamId, unlinkError]);
|
|
220
|
+
}(), [actions, createAnalyticsEvent, fireOperationalEvent, filteredTeamContainers, filteredTeamLinks, isSupportingAddWebLink, removeTeamLink, teamId, unlinkError]);
|
|
201
221
|
var TeamContainersSkeletonComponent = (components === null || components === void 0 ? void 0 : components.TeamContainersSkeleton) || _teamContainersSkeleton.TeamContainersSkeleton;
|
|
202
222
|
if (loading || productPermissionIsLoading) {
|
|
203
223
|
return /*#__PURE__*/_react.default.createElement(TeamContainersSkeletonComponent, {
|
|
@@ -227,6 +247,9 @@ var TeamContainers = exports.TeamContainers = function TeamContainers(_ref) {
|
|
|
227
247
|
containerType: container.type,
|
|
228
248
|
containerName: container.name
|
|
229
249
|
});
|
|
250
|
+
},
|
|
251
|
+
onEditLinkClick: function onEditLinkClick() {
|
|
252
|
+
return handleEditContainerClick(container);
|
|
230
253
|
}
|
|
231
254
|
});
|
|
232
255
|
}) : filteredTeamContainers.slice(0, maxNumberOfContainersToShow).map(function (container) {
|
|
@@ -262,7 +285,9 @@ var TeamContainers = exports.TeamContainers = function TeamContainers(_ref) {
|
|
|
262
285
|
},
|
|
263
286
|
containerType: "LoomSpace"
|
|
264
287
|
}), isSupportingAddWebLink && showAddContainer.WebLink && /*#__PURE__*/_react.default.createElement(_addContainerCard.AddContainerCard, {
|
|
265
|
-
onAddAContainerClick: function onAddAContainerClick() {
|
|
288
|
+
onAddAContainerClick: function onAddAContainerClick(e) {
|
|
289
|
+
return _onAddAContainerClick(e, 'WebLink');
|
|
290
|
+
},
|
|
266
291
|
containerType: "WebLink"
|
|
267
292
|
}), showMore && isSupportingAddWebLink ? filteredTeamLinks.slice(maxNumberOfContainersToShow).map(function (container) {
|
|
268
293
|
return /*#__PURE__*/_react.default.createElement(LinkedContainerCardComponent, {
|
|
@@ -279,6 +304,9 @@ var TeamContainers = exports.TeamContainers = function TeamContainers(_ref) {
|
|
|
279
304
|
containerType: container.type,
|
|
280
305
|
containerName: container.name
|
|
281
306
|
});
|
|
307
|
+
},
|
|
308
|
+
onEditLinkClick: function onEditLinkClick() {
|
|
309
|
+
return handleEditContainerClick(container);
|
|
282
310
|
}
|
|
283
311
|
});
|
|
284
312
|
}) : showMore && filteredTeamContainers.slice(maxNumberOfContainersToShow).map(function (container) {
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
|
|
2
|
+
._2rkoop52{border-radius:var(--ds-border-radius-100,8px)}
|
|
3
|
+
._1h6dz9xs{border-color:var(--ds-border-accent-gray,#758195)}._12jimuej{outline-color:var(--ds-border,#091e4224)}
|
|
4
|
+
._12y3e4h9{outline-width:var(--ds-border-width,1px)}
|
|
5
|
+
._16jlkb7n{flex-grow:1}
|
|
6
|
+
._18u01wug{margin-left:auto}
|
|
7
|
+
._19bvutpp{padding-left:var(--ds-space-150,9pt)}
|
|
8
|
+
._1bah1h6o{justify-content:center}
|
|
9
|
+
._1bahesu3{justify-content:flex-end}
|
|
10
|
+
._1bsb1osq{width:100%}
|
|
11
|
+
._1bsb1u1b{width:34px}
|
|
12
|
+
._1bsbzwfg{width:2pc}
|
|
13
|
+
._1e0c1txw{display:flex}
|
|
14
|
+
._1o9zkb7n{flex-shrink:1}
|
|
15
|
+
._1qu2nqa1{outline-style:solid}
|
|
16
|
+
._1tkezwfg{min-height:2pc}
|
|
17
|
+
._1ul9zwfg{min-width:2pc}
|
|
18
|
+
._4cvr1h6o{align-items:center}
|
|
19
|
+
._4t3i1u1b{height:34px}
|
|
20
|
+
._4t3izwfg{height:2pc}
|
|
21
|
+
._bfhkqbzx{background-color:var(--ds-surface-sunken,#f7f8f9)}
|
|
22
|
+
._ca0qutpp{padding-top:var(--ds-space-150,9pt)}
|
|
23
|
+
._i0dlf1ug{flex-basis:0%}
|
|
24
|
+
._n3tdutpp{padding-bottom:var(--ds-space-150,9pt)}
|
|
25
|
+
._syaz1fxt{color:var(--ds-text,#172b4d)}
|
|
26
|
+
._u5f3utpp{padding-right:var(--ds-space-150,9pt)}
|