@atlaskit/teams-public 0.27.0 → 0.28.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 +15 -0
- package/dist/cjs/common/assets/index.js +27 -0
- package/dist/cjs/common/utils/get-container-properties.js +3 -2
- package/dist/cjs/index.js +20 -1
- package/dist/cjs/ui/team-containers/main.js +9 -7
- package/dist/es2019/common/assets/index.js +3 -0
- package/dist/es2019/common/utils/get-container-properties.js +3 -3
- package/dist/es2019/index.js +2 -1
- package/dist/es2019/ui/team-containers/main.js +8 -7
- package/dist/esm/common/assets/index.js +3 -0
- package/dist/esm/common/utils/get-container-properties.js +3 -2
- package/dist/esm/index.js +2 -1
- package/dist/esm/ui/team-containers/main.js +9 -7
- package/dist/types/common/assets/index.d.ts +3 -0
- package/dist/types/controllers/hooks/use-team-containers/index.d.ts +1 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/services/agg-client/index.d.ts +1 -1
- package/dist/types/services/agg-client/utils/queries/team-connected-to-container-query.d.ts +1 -1
- package/dist/types/services/main.d.ts +1 -1
- package/dist/types/ui/team-containers/main.d.ts +1 -1
- package/dist/types/ui/team-containers/types.d.ts +4 -0
- package/dist/types-ts4.5/common/assets/index.d.ts +3 -0
- package/dist/types-ts4.5/controllers/hooks/use-team-containers/index.d.ts +1 -1
- package/dist/types-ts4.5/index.d.ts +1 -0
- package/dist/types-ts4.5/services/agg-client/index.d.ts +1 -1
- package/dist/types-ts4.5/services/agg-client/utils/queries/team-connected-to-container-query.d.ts +1 -1
- package/dist/types-ts4.5/services/main.d.ts +1 -1
- package/dist/types-ts4.5/ui/team-containers/main.d.ts +1 -1
- package/dist/types-ts4.5/ui/team-containers/types.d.ts +4 -0
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# @atlaskit/teams-public
|
|
2
2
|
|
|
3
|
+
## 0.28.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#153501](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/153501)
|
|
8
|
+
[`daab8878af268`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/daab8878af268) -
|
|
9
|
+
[ux] PTC-11529 Build teams conatiners dropdown list & modify team web link modal; Classfied icons
|
|
10
|
+
by size.
|
|
11
|
+
|
|
12
|
+
## 0.27.1
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- Updated dependencies
|
|
17
|
+
|
|
3
18
|
## 0.27.0
|
|
4
19
|
|
|
5
20
|
### Minor Changes
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
Object.defineProperty(exports, "ConfluenceIcon", {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
get: function get() {
|
|
10
|
+
return _ConfluenceIcon.default;
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
Object.defineProperty(exports, "JiraIcon", {
|
|
14
|
+
enumerable: true,
|
|
15
|
+
get: function get() {
|
|
16
|
+
return _JiraIcon.default;
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
Object.defineProperty(exports, "LoomIcon", {
|
|
20
|
+
enumerable: true,
|
|
21
|
+
get: function get() {
|
|
22
|
+
return _LoomIcon.default;
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
var _ConfluenceIcon = _interopRequireDefault(require("./ConfluenceIcon.svg"));
|
|
26
|
+
var _JiraIcon = _interopRequireDefault(require("./JiraIcon.svg"));
|
|
27
|
+
var _LoomIcon = _interopRequireDefault(require("./LoomIcon.svg"));
|
|
@@ -93,6 +93,7 @@ var getJiraIcon = function getJiraIcon(containerSubTypes) {
|
|
|
93
93
|
}
|
|
94
94
|
};
|
|
95
95
|
var getJiraContainerProperties = function getJiraContainerProperties(containerTypeProperties) {
|
|
96
|
+
var iconSize = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'small';
|
|
96
97
|
var _ref = containerTypeProperties || {},
|
|
97
98
|
subType = _ref.subType,
|
|
98
99
|
name = _ref.name;
|
|
@@ -100,7 +101,7 @@ var getJiraContainerProperties = function getJiraContainerProperties(containerTy
|
|
|
100
101
|
var baseProperties = {
|
|
101
102
|
description: /*#__PURE__*/_react.default.createElement(_reactIntlNext.FormattedMessage, messages.jiraProjectDescription),
|
|
102
103
|
icon: /*#__PURE__*/_react.default.createElement(Comp, {
|
|
103
|
-
xcss: styles.iconWrapper
|
|
104
|
+
xcss: iconSize === 'medium' ? styles.mediumIconWrapper : styles.iconWrapper
|
|
104
105
|
}, /*#__PURE__*/_react.default.createElement(_image.default, {
|
|
105
106
|
src: getJiraIcon(subType),
|
|
106
107
|
alt: "",
|
|
@@ -152,7 +153,7 @@ var getContainerProperties = exports.getContainerProperties = function getContai
|
|
|
152
153
|
containerTypeText: /*#__PURE__*/_react.default.createElement(_reactIntlNext.FormattedMessage, messages.spaceContainerText)
|
|
153
154
|
};
|
|
154
155
|
case 'JiraProject':
|
|
155
|
-
return getJiraContainerProperties(containerTypeProperties);
|
|
156
|
+
return getJiraContainerProperties(containerTypeProperties, iconSize);
|
|
156
157
|
case 'WebLink':
|
|
157
158
|
return {
|
|
158
159
|
description: /*#__PURE__*/_react.default.createElement(_compiled.Text, {
|
package/dist/cjs/index.js
CHANGED
|
@@ -3,6 +3,24 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
+
Object.defineProperty(exports, "ConfluenceIcon", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function get() {
|
|
9
|
+
return _assets.ConfluenceIcon;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "JiraIcon", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function get() {
|
|
15
|
+
return _assets.JiraIcon;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
Object.defineProperty(exports, "LoomIcon", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function get() {
|
|
21
|
+
return _assets.LoomIcon;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
6
24
|
Object.defineProperty(exports, "TeamContainers", {
|
|
7
25
|
enumerable: true,
|
|
8
26
|
get: function get() {
|
|
@@ -43,4 +61,5 @@ var _teamContainers = require("./ui/team-containers");
|
|
|
43
61
|
var _useTeamContainers = require("./controllers/hooks/use-team-containers");
|
|
44
62
|
var _useProductPermission = require("./controllers/hooks/use-product-permission");
|
|
45
63
|
var _utils = require("./controllers/product-permission/utils");
|
|
46
|
-
var _getContainerProperties = require("./common/utils/get-container-properties");
|
|
64
|
+
var _getContainerProperties = require("./common/utils/get-container-properties");
|
|
65
|
+
var _assets = require("./common/assets");
|
|
@@ -38,7 +38,9 @@ var TeamContainers = exports.TeamContainers = function TeamContainers(_ref) {
|
|
|
38
38
|
userId = _ref.userId,
|
|
39
39
|
cloudId = _ref.cloudId,
|
|
40
40
|
filterContainerId = _ref.filterContainerId,
|
|
41
|
-
isDisplayedOnProfileCard = _ref.isDisplayedOnProfileCard
|
|
41
|
+
isDisplayedOnProfileCard = _ref.isDisplayedOnProfileCard,
|
|
42
|
+
_ref$maxNumberOfConta = _ref.maxNumberOfContainersToShow,
|
|
43
|
+
maxNumberOfContainersToShow = _ref$maxNumberOfConta === void 0 ? MAX_NUMBER_OF_CONTAINERS_TO_SHOW : _ref$maxNumberOfConta;
|
|
42
44
|
var _useAnalyticsEvents = (0, _analyticsNext.useAnalyticsEvents)(),
|
|
43
45
|
createAnalyticsEvent = _useAnalyticsEvents.createAnalyticsEvent;
|
|
44
46
|
var _useTeamContainers = (0, _useTeamContainers2.useTeamContainers)(teamId),
|
|
@@ -92,7 +94,7 @@ var TeamContainers = exports.TeamContainers = function TeamContainers(_ref) {
|
|
|
92
94
|
}
|
|
93
95
|
}, [isDisplayedOnProfileCard, filterContainerId, teamContainers]);
|
|
94
96
|
(0, _react.useEffect)(function () {
|
|
95
|
-
if (filteredTeamContainers.length >
|
|
97
|
+
if (filteredTeamContainers.length > maxNumberOfContainersToShow || isDisplayedOnProfileCard) {
|
|
96
98
|
setShowAddContainer({
|
|
97
99
|
Jira: false,
|
|
98
100
|
Confluence: false,
|
|
@@ -114,7 +116,7 @@ var TeamContainers = exports.TeamContainers = function TeamContainers(_ref) {
|
|
|
114
116
|
Loom: !hasLoomSpace && !!productPermissions && !!(0, _controllers.hasProductPermission)(productPermissions, 'loom')
|
|
115
117
|
});
|
|
116
118
|
}
|
|
117
|
-
}, [isDisplayedOnProfileCard, productPermissions, filteredTeamContainers]);
|
|
119
|
+
}, [isDisplayedOnProfileCard, productPermissions, filteredTeamContainers, maxNumberOfContainersToShow]);
|
|
118
120
|
var handleShowMore = function handleShowMore() {
|
|
119
121
|
setShowMore(!showMore);
|
|
120
122
|
};
|
|
@@ -174,7 +176,7 @@ var TeamContainers = exports.TeamContainers = function TeamContainers(_ref) {
|
|
|
174
176
|
var TeamContainersSkeletonComponent = (components === null || components === void 0 ? void 0 : components.TeamContainersSkeleton) || _teamContainersSkeleton.TeamContainersSkeleton;
|
|
175
177
|
if (loading || productPermissionIsLoading) {
|
|
176
178
|
return /*#__PURE__*/_react.default.createElement(TeamContainersSkeletonComponent, {
|
|
177
|
-
numberOfContainers:
|
|
179
|
+
numberOfContainers: maxNumberOfContainersToShow
|
|
178
180
|
});
|
|
179
181
|
}
|
|
180
182
|
if (filteredTeamContainers.length === 0 && !isDisplayedOnProfileCard && (!productPermissions || !(productPermissions && ((0, _controllers.hasProductPermission)(productPermissions, 'jira') || (0, _controllers.hasProductPermission)(productPermissions, 'confluence') || (0, _controllers.hasProductPermission)(productPermissions, 'loom'))))) {
|
|
@@ -185,7 +187,7 @@ var TeamContainers = exports.TeamContainers = function TeamContainers(_ref) {
|
|
|
185
187
|
}, /*#__PURE__*/_react.default.createElement(_primitives.Grid, {
|
|
186
188
|
templateColumns: "repeat(auto-fill, minmax(300px, 1fr))",
|
|
187
189
|
gap: isDisplayedOnProfileCard ? 'space.0' : 'space.100'
|
|
188
|
-
}, filteredTeamContainers.slice(0,
|
|
190
|
+
}, filteredTeamContainers.slice(0, maxNumberOfContainersToShow).map(function (container) {
|
|
189
191
|
return /*#__PURE__*/_react.default.createElement(LinkedContainerCardComponent, {
|
|
190
192
|
key: container.id,
|
|
191
193
|
containerType: container.type,
|
|
@@ -217,7 +219,7 @@ var TeamContainers = exports.TeamContainers = function TeamContainers(_ref) {
|
|
|
217
219
|
return _onAddAContainerClick(e, 'Loom');
|
|
218
220
|
},
|
|
219
221
|
containerType: "LoomSpace"
|
|
220
|
-
}), showMore && filteredTeamContainers.slice(
|
|
222
|
+
}), showMore && filteredTeamContainers.slice(maxNumberOfContainersToShow).map(function (container) {
|
|
221
223
|
return /*#__PURE__*/_react.default.createElement(LinkedContainerCardComponent, {
|
|
222
224
|
key: container.id,
|
|
223
225
|
containerType: container.type,
|
|
@@ -234,7 +236,7 @@ var TeamContainers = exports.TeamContainers = function TeamContainers(_ref) {
|
|
|
234
236
|
});
|
|
235
237
|
}
|
|
236
238
|
});
|
|
237
|
-
})), filteredTeamContainers.length >
|
|
239
|
+
})), filteredTeamContainers.length > maxNumberOfContainersToShow && /*#__PURE__*/_react.default.createElement(_primitives.Inline, null, /*#__PURE__*/_react.default.createElement(_new.default, {
|
|
238
240
|
appearance: "subtle",
|
|
239
241
|
onClick: handleShowMore
|
|
240
242
|
}, 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, {
|
|
@@ -82,7 +82,7 @@ const getJiraIcon = containerSubTypes => {
|
|
|
82
82
|
return JiraIcon;
|
|
83
83
|
}
|
|
84
84
|
};
|
|
85
|
-
const getJiraContainerProperties = containerTypeProperties => {
|
|
85
|
+
const getJiraContainerProperties = (containerTypeProperties, iconSize = 'small') => {
|
|
86
86
|
const {
|
|
87
87
|
subType,
|
|
88
88
|
name
|
|
@@ -91,7 +91,7 @@ const getJiraContainerProperties = containerTypeProperties => {
|
|
|
91
91
|
const baseProperties = {
|
|
92
92
|
description: /*#__PURE__*/React.createElement(FormattedMessage, messages.jiraProjectDescription),
|
|
93
93
|
icon: /*#__PURE__*/React.createElement(Comp, {
|
|
94
|
-
xcss: styles.iconWrapper
|
|
94
|
+
xcss: iconSize === 'medium' ? styles.mediumIconWrapper : styles.iconWrapper
|
|
95
95
|
}, /*#__PURE__*/React.createElement(Image, {
|
|
96
96
|
src: getJiraIcon(subType),
|
|
97
97
|
alt: "",
|
|
@@ -142,7 +142,7 @@ export const getContainerProperties = (containerType, iconSize = 'small', contai
|
|
|
142
142
|
containerTypeText: /*#__PURE__*/React.createElement(FormattedMessage, messages.spaceContainerText)
|
|
143
143
|
};
|
|
144
144
|
case 'JiraProject':
|
|
145
|
-
return getJiraContainerProperties(containerTypeProperties);
|
|
145
|
+
return getJiraContainerProperties(containerTypeProperties, iconSize);
|
|
146
146
|
case 'WebLink':
|
|
147
147
|
return {
|
|
148
148
|
description: /*#__PURE__*/React.createElement(Text, {
|
package/dist/es2019/index.js
CHANGED
|
@@ -2,4 +2,5 @@ export { TeamContainers } from './ui/team-containers';
|
|
|
2
2
|
export { useTeamContainers, useConnectedTeams } from './controllers/hooks/use-team-containers';
|
|
3
3
|
export { useProductPermissions } from './controllers/hooks/use-product-permission';
|
|
4
4
|
export { hasProductPermission } from './controllers/product-permission/utils';
|
|
5
|
-
export { getContainerProperties } from './common/utils/get-container-properties';
|
|
5
|
+
export { getContainerProperties } from './common/utils/get-container-properties';
|
|
6
|
+
export { ConfluenceIcon, JiraIcon, LoomIcon } from './common/assets';
|
|
@@ -25,7 +25,8 @@ export const TeamContainers = ({
|
|
|
25
25
|
userId,
|
|
26
26
|
cloudId,
|
|
27
27
|
filterContainerId,
|
|
28
|
-
isDisplayedOnProfileCard
|
|
28
|
+
isDisplayedOnProfileCard,
|
|
29
|
+
maxNumberOfContainersToShow = MAX_NUMBER_OF_CONTAINERS_TO_SHOW
|
|
29
30
|
}) => {
|
|
30
31
|
const {
|
|
31
32
|
createAnalyticsEvent
|
|
@@ -64,7 +65,7 @@ export const TeamContainers = ({
|
|
|
64
65
|
}
|
|
65
66
|
}, [isDisplayedOnProfileCard, filterContainerId, teamContainers]);
|
|
66
67
|
useEffect(() => {
|
|
67
|
-
if (filteredTeamContainers.length >
|
|
68
|
+
if (filteredTeamContainers.length > maxNumberOfContainersToShow || isDisplayedOnProfileCard) {
|
|
68
69
|
setShowAddContainer({
|
|
69
70
|
Jira: false,
|
|
70
71
|
Confluence: false,
|
|
@@ -80,7 +81,7 @@ export const TeamContainers = ({
|
|
|
80
81
|
Loom: !hasLoomSpace && !!productPermissions && !!hasProductPermission(productPermissions, 'loom')
|
|
81
82
|
});
|
|
82
83
|
}
|
|
83
|
-
}, [isDisplayedOnProfileCard, productPermissions, filteredTeamContainers]);
|
|
84
|
+
}, [isDisplayedOnProfileCard, productPermissions, filteredTeamContainers, maxNumberOfContainersToShow]);
|
|
84
85
|
const handleShowMore = () => {
|
|
85
86
|
setShowMore(!showMore);
|
|
86
87
|
};
|
|
@@ -122,7 +123,7 @@ export const TeamContainers = ({
|
|
|
122
123
|
const TeamContainersSkeletonComponent = (components === null || components === void 0 ? void 0 : components.TeamContainersSkeleton) || TeamContainersSkeleton;
|
|
123
124
|
if (loading || productPermissionIsLoading) {
|
|
124
125
|
return /*#__PURE__*/React.createElement(TeamContainersSkeletonComponent, {
|
|
125
|
-
numberOfContainers:
|
|
126
|
+
numberOfContainers: maxNumberOfContainersToShow
|
|
126
127
|
});
|
|
127
128
|
}
|
|
128
129
|
if (filteredTeamContainers.length === 0 && !isDisplayedOnProfileCard && (!productPermissions || !(productPermissions && (hasProductPermission(productPermissions, 'jira') || hasProductPermission(productPermissions, 'confluence') || hasProductPermission(productPermissions, 'loom'))))) {
|
|
@@ -133,7 +134,7 @@ export const TeamContainers = ({
|
|
|
133
134
|
}, /*#__PURE__*/React.createElement(Grid, {
|
|
134
135
|
templateColumns: "repeat(auto-fill, minmax(300px, 1fr))",
|
|
135
136
|
gap: isDisplayedOnProfileCard ? 'space.0' : 'space.100'
|
|
136
|
-
}, filteredTeamContainers.slice(0,
|
|
137
|
+
}, filteredTeamContainers.slice(0, maxNumberOfContainersToShow).map(container => {
|
|
137
138
|
return /*#__PURE__*/React.createElement(LinkedContainerCardComponent, {
|
|
138
139
|
key: container.id,
|
|
139
140
|
containerType: container.type,
|
|
@@ -157,7 +158,7 @@ export const TeamContainers = ({
|
|
|
157
158
|
}), showAddContainer.Loom && fg('loom_tab_in_container_linker_team_profile_page') && /*#__PURE__*/React.createElement(AddContainerCard, {
|
|
158
159
|
onAddAContainerClick: e => onAddAContainerClick(e, 'Loom'),
|
|
159
160
|
containerType: "LoomSpace"
|
|
160
|
-
}), showMore && filteredTeamContainers.slice(
|
|
161
|
+
}), showMore && filteredTeamContainers.slice(maxNumberOfContainersToShow).map(container => {
|
|
161
162
|
return /*#__PURE__*/React.createElement(LinkedContainerCardComponent, {
|
|
162
163
|
key: container.id,
|
|
163
164
|
containerType: container.type,
|
|
@@ -172,7 +173,7 @@ export const TeamContainers = ({
|
|
|
172
173
|
containerName: container.name
|
|
173
174
|
})
|
|
174
175
|
});
|
|
175
|
-
})), filteredTeamContainers.length >
|
|
176
|
+
})), filteredTeamContainers.length > maxNumberOfContainersToShow && /*#__PURE__*/React.createElement(Inline, null, /*#__PURE__*/React.createElement(Button, {
|
|
176
177
|
appearance: "subtle",
|
|
177
178
|
onClick: handleShowMore
|
|
178
179
|
}, showMore ? /*#__PURE__*/React.createElement(FormattedMessage, messages.showLess) : /*#__PURE__*/React.createElement(FormattedMessage, messages.showMore)))), /*#__PURE__*/React.createElement(ModalTransition, null, isDisconnectDialogOpen && selectedContainerDetails && /*#__PURE__*/React.createElement(DisconnectDialogLazy, {
|
|
@@ -86,6 +86,7 @@ var getJiraIcon = function getJiraIcon(containerSubTypes) {
|
|
|
86
86
|
}
|
|
87
87
|
};
|
|
88
88
|
var getJiraContainerProperties = function getJiraContainerProperties(containerTypeProperties) {
|
|
89
|
+
var iconSize = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'small';
|
|
89
90
|
var _ref = containerTypeProperties || {},
|
|
90
91
|
subType = _ref.subType,
|
|
91
92
|
name = _ref.name;
|
|
@@ -93,7 +94,7 @@ var getJiraContainerProperties = function getJiraContainerProperties(containerTy
|
|
|
93
94
|
var baseProperties = {
|
|
94
95
|
description: /*#__PURE__*/React.createElement(FormattedMessage, messages.jiraProjectDescription),
|
|
95
96
|
icon: /*#__PURE__*/React.createElement(Comp, {
|
|
96
|
-
xcss: styles.iconWrapper
|
|
97
|
+
xcss: iconSize === 'medium' ? styles.mediumIconWrapper : styles.iconWrapper
|
|
97
98
|
}, /*#__PURE__*/React.createElement(Image, {
|
|
98
99
|
src: getJiraIcon(subType),
|
|
99
100
|
alt: "",
|
|
@@ -145,7 +146,7 @@ export var getContainerProperties = function getContainerProperties(containerTyp
|
|
|
145
146
|
containerTypeText: /*#__PURE__*/React.createElement(FormattedMessage, messages.spaceContainerText)
|
|
146
147
|
};
|
|
147
148
|
case 'JiraProject':
|
|
148
|
-
return getJiraContainerProperties(containerTypeProperties);
|
|
149
|
+
return getJiraContainerProperties(containerTypeProperties, iconSize);
|
|
149
150
|
case 'WebLink':
|
|
150
151
|
return {
|
|
151
152
|
description: /*#__PURE__*/React.createElement(Text, {
|
package/dist/esm/index.js
CHANGED
|
@@ -2,4 +2,5 @@ export { TeamContainers } from './ui/team-containers';
|
|
|
2
2
|
export { useTeamContainers, useConnectedTeams } from './controllers/hooks/use-team-containers';
|
|
3
3
|
export { useProductPermissions } from './controllers/hooks/use-product-permission';
|
|
4
4
|
export { hasProductPermission } from './controllers/product-permission/utils';
|
|
5
|
-
export { getContainerProperties } from './common/utils/get-container-properties';
|
|
5
|
+
export { getContainerProperties } from './common/utils/get-container-properties';
|
|
6
|
+
export { ConfluenceIcon, JiraIcon, LoomIcon } from './common/assets';
|
|
@@ -28,7 +28,9 @@ export var TeamContainers = function TeamContainers(_ref) {
|
|
|
28
28
|
userId = _ref.userId,
|
|
29
29
|
cloudId = _ref.cloudId,
|
|
30
30
|
filterContainerId = _ref.filterContainerId,
|
|
31
|
-
isDisplayedOnProfileCard = _ref.isDisplayedOnProfileCard
|
|
31
|
+
isDisplayedOnProfileCard = _ref.isDisplayedOnProfileCard,
|
|
32
|
+
_ref$maxNumberOfConta = _ref.maxNumberOfContainersToShow,
|
|
33
|
+
maxNumberOfContainersToShow = _ref$maxNumberOfConta === void 0 ? MAX_NUMBER_OF_CONTAINERS_TO_SHOW : _ref$maxNumberOfConta;
|
|
32
34
|
var _useAnalyticsEvents = useAnalyticsEvents(),
|
|
33
35
|
createAnalyticsEvent = _useAnalyticsEvents.createAnalyticsEvent;
|
|
34
36
|
var _useTeamContainers = useTeamContainers(teamId),
|
|
@@ -82,7 +84,7 @@ export var TeamContainers = function TeamContainers(_ref) {
|
|
|
82
84
|
}
|
|
83
85
|
}, [isDisplayedOnProfileCard, filterContainerId, teamContainers]);
|
|
84
86
|
useEffect(function () {
|
|
85
|
-
if (filteredTeamContainers.length >
|
|
87
|
+
if (filteredTeamContainers.length > maxNumberOfContainersToShow || isDisplayedOnProfileCard) {
|
|
86
88
|
setShowAddContainer({
|
|
87
89
|
Jira: false,
|
|
88
90
|
Confluence: false,
|
|
@@ -104,7 +106,7 @@ export var TeamContainers = function TeamContainers(_ref) {
|
|
|
104
106
|
Loom: !hasLoomSpace && !!productPermissions && !!hasProductPermission(productPermissions, 'loom')
|
|
105
107
|
});
|
|
106
108
|
}
|
|
107
|
-
}, [isDisplayedOnProfileCard, productPermissions, filteredTeamContainers]);
|
|
109
|
+
}, [isDisplayedOnProfileCard, productPermissions, filteredTeamContainers, maxNumberOfContainersToShow]);
|
|
108
110
|
var handleShowMore = function handleShowMore() {
|
|
109
111
|
setShowMore(!showMore);
|
|
110
112
|
};
|
|
@@ -164,7 +166,7 @@ export var TeamContainers = function TeamContainers(_ref) {
|
|
|
164
166
|
var TeamContainersSkeletonComponent = (components === null || components === void 0 ? void 0 : components.TeamContainersSkeleton) || TeamContainersSkeleton;
|
|
165
167
|
if (loading || productPermissionIsLoading) {
|
|
166
168
|
return /*#__PURE__*/React.createElement(TeamContainersSkeletonComponent, {
|
|
167
|
-
numberOfContainers:
|
|
169
|
+
numberOfContainers: maxNumberOfContainersToShow
|
|
168
170
|
});
|
|
169
171
|
}
|
|
170
172
|
if (filteredTeamContainers.length === 0 && !isDisplayedOnProfileCard && (!productPermissions || !(productPermissions && (hasProductPermission(productPermissions, 'jira') || hasProductPermission(productPermissions, 'confluence') || hasProductPermission(productPermissions, 'loom'))))) {
|
|
@@ -175,7 +177,7 @@ export var TeamContainers = function TeamContainers(_ref) {
|
|
|
175
177
|
}, /*#__PURE__*/React.createElement(Grid, {
|
|
176
178
|
templateColumns: "repeat(auto-fill, minmax(300px, 1fr))",
|
|
177
179
|
gap: isDisplayedOnProfileCard ? 'space.0' : 'space.100'
|
|
178
|
-
}, filteredTeamContainers.slice(0,
|
|
180
|
+
}, filteredTeamContainers.slice(0, maxNumberOfContainersToShow).map(function (container) {
|
|
179
181
|
return /*#__PURE__*/React.createElement(LinkedContainerCardComponent, {
|
|
180
182
|
key: container.id,
|
|
181
183
|
containerType: container.type,
|
|
@@ -207,7 +209,7 @@ export var TeamContainers = function TeamContainers(_ref) {
|
|
|
207
209
|
return _onAddAContainerClick(e, 'Loom');
|
|
208
210
|
},
|
|
209
211
|
containerType: "LoomSpace"
|
|
210
|
-
}), showMore && filteredTeamContainers.slice(
|
|
212
|
+
}), showMore && filteredTeamContainers.slice(maxNumberOfContainersToShow).map(function (container) {
|
|
211
213
|
return /*#__PURE__*/React.createElement(LinkedContainerCardComponent, {
|
|
212
214
|
key: container.id,
|
|
213
215
|
containerType: container.type,
|
|
@@ -224,7 +226,7 @@ export var TeamContainers = function TeamContainers(_ref) {
|
|
|
224
226
|
});
|
|
225
227
|
}
|
|
226
228
|
});
|
|
227
|
-
})), filteredTeamContainers.length >
|
|
229
|
+
})), filteredTeamContainers.length > maxNumberOfContainersToShow && /*#__PURE__*/React.createElement(Inline, null, /*#__PURE__*/React.createElement(Button, {
|
|
228
230
|
appearance: "subtle",
|
|
229
231
|
onClick: handleShowMore
|
|
230
232
|
}, showMore ? /*#__PURE__*/React.createElement(FormattedMessage, messages.showLess) : /*#__PURE__*/React.createElement(FormattedMessage, messages.showMore)))), /*#__PURE__*/React.createElement(ModalTransition, null, isDisconnectDialogOpen && selectedContainerDetails && /*#__PURE__*/React.createElement(DisconnectDialogLazy, {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type Action } from 'react-sweet-state';
|
|
2
2
|
import { type TeamContainer } from '../../../common/types';
|
|
3
|
-
import { type TeamContainers, TeamWithMemberships, type UnlinkContainerMutationError } from '../../../services/types';
|
|
3
|
+
import { type TeamContainers, type TeamWithMemberships, type UnlinkContainerMutationError } from '../../../services/types';
|
|
4
4
|
type ConnectedTeams = {
|
|
5
5
|
containerId: string | undefined;
|
|
6
6
|
isLoading: boolean;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -7,3 +7,4 @@ export type { TeamContainer, ContainerSubTypes } from './common/types';
|
|
|
7
7
|
export { useProductPermissions } from './controllers/hooks/use-product-permission';
|
|
8
8
|
export { hasProductPermission } from './controllers/product-permission/utils';
|
|
9
9
|
export { getContainerProperties } from './common/utils/get-container-properties';
|
|
10
|
+
export { ConfluenceIcon, JiraIcon, LoomIcon } from './common/assets';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type ClientConfig } from '../base-client';
|
|
2
2
|
import { BaseGraphQlClient } from '../graphql-client';
|
|
3
|
-
import { TeamWithMemberships } from '../types';
|
|
3
|
+
import type { TeamWithMemberships } from '../types';
|
|
4
4
|
import { type UnlinkContainerMutationResponse } from './utils/mutations/unlink-container-mutation';
|
|
5
5
|
export declare class AGGClient extends BaseGraphQlClient {
|
|
6
6
|
constructor(baseUrl: string, config: ClientConfig);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { MembershipRole, MembershipState, TeamMembershipSettings, TeamState, UserARI } from '../../../../common/types';
|
|
2
|
-
import { AGGPageInfo } from '../../types';
|
|
2
|
+
import type { AGGPageInfo } from '../../types';
|
|
3
3
|
export declare const TeamConnectedToContainerQuery: string;
|
|
4
4
|
export type TeamConnectedToContainerQueryVariables = {
|
|
5
5
|
containerId: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type ClientContextProps, type TeamContainers, TeamWithMemberships } from './types';
|
|
1
|
+
import { type ClientContextProps, type TeamContainers, type TeamWithMemberships } from './types';
|
|
2
2
|
type AwaitedReturn<T extends (...args: any) => any> = Awaited<ReturnType<T>>;
|
|
3
3
|
export declare class TeamsClient {
|
|
4
4
|
private readonly _aggClient;
|
|
@@ -3,4 +3,4 @@ import { type TeamContainerProps } from './types';
|
|
|
3
3
|
export declare const ICON_BACKGROUND: "var(--ds-icon-inverse)";
|
|
4
4
|
export declare const ICON_COLOR: "var(--ds-icon-subtle)";
|
|
5
5
|
export declare const MAX_NUMBER_OF_CONTAINERS_TO_SHOW = 4;
|
|
6
|
-
export declare const TeamContainers: ({ teamId, onAddAContainerClick, components, userId, cloudId, filterContainerId, isDisplayedOnProfileCard, }: TeamContainerProps) => React.JSX.Element;
|
|
6
|
+
export declare const TeamContainers: ({ teamId, onAddAContainerClick, components, userId, cloudId, filterContainerId, isDisplayedOnProfileCard, maxNumberOfContainersToShow, }: TeamContainerProps) => React.JSX.Element;
|
|
@@ -30,6 +30,10 @@ export interface TeamContainerProps {
|
|
|
30
30
|
* The container id to filter out from the list
|
|
31
31
|
*/
|
|
32
32
|
isDisplayedOnProfileCard?: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* The maximum number of containers to show
|
|
35
|
+
*/
|
|
36
|
+
maxNumberOfContainersToShow?: number;
|
|
33
37
|
}
|
|
34
38
|
export interface TeamContainersComponent {
|
|
35
39
|
ContainerCard: ComponentType<LinkedContainerCardProps>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type Action } from 'react-sweet-state';
|
|
2
2
|
import { type TeamContainer } from '../../../common/types';
|
|
3
|
-
import { type TeamContainers, TeamWithMemberships, type UnlinkContainerMutationError } from '../../../services/types';
|
|
3
|
+
import { type TeamContainers, type TeamWithMemberships, type UnlinkContainerMutationError } from '../../../services/types';
|
|
4
4
|
type ConnectedTeams = {
|
|
5
5
|
containerId: string | undefined;
|
|
6
6
|
isLoading: boolean;
|
|
@@ -7,3 +7,4 @@ export type { TeamContainer, ContainerSubTypes } from './common/types';
|
|
|
7
7
|
export { useProductPermissions } from './controllers/hooks/use-product-permission';
|
|
8
8
|
export { hasProductPermission } from './controllers/product-permission/utils';
|
|
9
9
|
export { getContainerProperties } from './common/utils/get-container-properties';
|
|
10
|
+
export { ConfluenceIcon, JiraIcon, LoomIcon } from './common/assets';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type ClientConfig } from '../base-client';
|
|
2
2
|
import { BaseGraphQlClient } from '../graphql-client';
|
|
3
|
-
import { TeamWithMemberships } from '../types';
|
|
3
|
+
import type { TeamWithMemberships } from '../types';
|
|
4
4
|
import { type UnlinkContainerMutationResponse } from './utils/mutations/unlink-container-mutation';
|
|
5
5
|
export declare class AGGClient extends BaseGraphQlClient {
|
|
6
6
|
constructor(baseUrl: string, config: ClientConfig);
|
package/dist/types-ts4.5/services/agg-client/utils/queries/team-connected-to-container-query.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { MembershipRole, MembershipState, TeamMembershipSettings, TeamState, UserARI } from '../../../../common/types';
|
|
2
|
-
import { AGGPageInfo } from '../../types';
|
|
2
|
+
import type { AGGPageInfo } from '../../types';
|
|
3
3
|
export declare const TeamConnectedToContainerQuery: string;
|
|
4
4
|
export type TeamConnectedToContainerQueryVariables = {
|
|
5
5
|
containerId: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type ClientContextProps, type TeamContainers, TeamWithMemberships } from './types';
|
|
1
|
+
import { type ClientContextProps, type TeamContainers, type TeamWithMemberships } from './types';
|
|
2
2
|
type AwaitedReturn<T extends (...args: any) => any> = Awaited<ReturnType<T>>;
|
|
3
3
|
export declare class TeamsClient {
|
|
4
4
|
private readonly _aggClient;
|
|
@@ -3,4 +3,4 @@ import { type TeamContainerProps } from './types';
|
|
|
3
3
|
export declare const ICON_BACKGROUND: "var(--ds-icon-inverse)";
|
|
4
4
|
export declare const ICON_COLOR: "var(--ds-icon-subtle)";
|
|
5
5
|
export declare const MAX_NUMBER_OF_CONTAINERS_TO_SHOW = 4;
|
|
6
|
-
export declare const TeamContainers: ({ teamId, onAddAContainerClick, components, userId, cloudId, filterContainerId, isDisplayedOnProfileCard, }: TeamContainerProps) => React.JSX.Element;
|
|
6
|
+
export declare const TeamContainers: ({ teamId, onAddAContainerClick, components, userId, cloudId, filterContainerId, isDisplayedOnProfileCard, maxNumberOfContainersToShow, }: TeamContainerProps) => React.JSX.Element;
|
|
@@ -30,6 +30,10 @@ export interface TeamContainerProps {
|
|
|
30
30
|
* The container id to filter out from the list
|
|
31
31
|
*/
|
|
32
32
|
isDisplayedOnProfileCard?: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* The maximum number of containers to show
|
|
35
|
+
*/
|
|
36
|
+
maxNumberOfContainersToShow?: number;
|
|
33
37
|
}
|
|
34
38
|
export interface TeamContainersComponent {
|
|
35
39
|
ContainerCard: ComponentType<LinkedContainerCardProps>;
|
package/package.json
CHANGED
|
@@ -30,15 +30,15 @@
|
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"@atlaskit/analytics-next": "^11.0.0",
|
|
33
|
-
"@atlaskit/avatar": "^25.
|
|
33
|
+
"@atlaskit/avatar": "^25.1.0",
|
|
34
34
|
"@atlaskit/button": "^23.0.0",
|
|
35
35
|
"@atlaskit/css": "^0.10.0",
|
|
36
36
|
"@atlaskit/heading": "^5.2.0",
|
|
37
|
-
"@atlaskit/icon": "^
|
|
37
|
+
"@atlaskit/icon": "^26.0.0",
|
|
38
38
|
"@atlaskit/image": "^3.0.0",
|
|
39
39
|
"@atlaskit/link": "^3.1.0",
|
|
40
40
|
"@atlaskit/logo": "^18.0.0",
|
|
41
|
-
"@atlaskit/modal-dialog": "^14.
|
|
41
|
+
"@atlaskit/modal-dialog": "^14.2.0",
|
|
42
42
|
"@atlaskit/people-teams-ui-public": "^3.1.0",
|
|
43
43
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
44
44
|
"@atlaskit/primitives": "^14.7.0",
|
|
@@ -107,7 +107,7 @@
|
|
|
107
107
|
}
|
|
108
108
|
},
|
|
109
109
|
"name": "@atlaskit/teams-public",
|
|
110
|
-
"version": "0.
|
|
110
|
+
"version": "0.28.0",
|
|
111
111
|
"description": "Public components related to teams",
|
|
112
112
|
"author": "Atlassian Pty Ltd",
|
|
113
113
|
"license": "Apache-2.0",
|