@atlaskit/teams-public 0.38.3 → 0.39.1
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 +20 -0
- package/dist/cjs/common/utils/get-link-domain.js +43 -0
- package/dist/cjs/services/agg-client/index.js +4 -0
- package/dist/cjs/ui/team-containers/team-link-card/index.js +37 -9
- package/dist/es2019/common/utils/get-link-domain.js +37 -0
- package/dist/es2019/services/agg-client/index.js +4 -0
- package/dist/es2019/ui/team-containers/team-link-card/index.js +35 -9
- package/dist/esm/common/utils/get-link-domain.js +37 -0
- package/dist/esm/services/agg-client/index.js +4 -0
- package/dist/esm/ui/team-containers/team-link-card/index.js +37 -9
- package/dist/types/common/utils/get-link-domain.d.ts +16 -0
- package/dist/types-ts4.5/common/utils/get-link-domain.d.ts +16 -0
- package/package.json +7 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# @atlaskit/teams-public
|
|
2
2
|
|
|
3
|
+
## 0.39.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#174090](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/174090)
|
|
8
|
+
[`e5f4693b1599f`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/e5f4693b1599f) -
|
|
9
|
+
NO-ISSUE Enable null check for containers mapping function
|
|
10
|
+
|
|
11
|
+
## 0.39.0
|
|
12
|
+
|
|
13
|
+
### Minor Changes
|
|
14
|
+
|
|
15
|
+
- [#173114](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/173114)
|
|
16
|
+
[`62a85f0b88860`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/62a85f0b88860) -
|
|
17
|
+
PTC-11556 Add analytics events for supporting all links project
|
|
18
|
+
|
|
19
|
+
### Patch Changes
|
|
20
|
+
|
|
21
|
+
- Updated dependencies
|
|
22
|
+
|
|
3
23
|
## 0.38.3
|
|
4
24
|
|
|
5
25
|
### Patch Changes
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.unsafeGetDomainFromUrl = exports.getDomainFromLinkUri = void 0;
|
|
7
|
+
/**
|
|
8
|
+
* Extract the domain from the URL. Strips "www" subdomains
|
|
9
|
+
* e.g. http://dogs.animals.com/yellow/golden-retriever becomes "dogs.animals.com"
|
|
10
|
+
* e.g. http://www.blake.com/memes becomes "blake.com"
|
|
11
|
+
*
|
|
12
|
+
* Return an empty string if a totally invalid url is somehow passed in.
|
|
13
|
+
* @param url
|
|
14
|
+
*/
|
|
15
|
+
var getDomainFromLinkUri = exports.getDomainFromLinkUri = function getDomainFromLinkUri(url) {
|
|
16
|
+
var hostname;
|
|
17
|
+
try {
|
|
18
|
+
try {
|
|
19
|
+
hostname = unsafeGetDomainFromUrl(url);
|
|
20
|
+
} catch (noProtocolError) {
|
|
21
|
+
/**
|
|
22
|
+
* Backend (Legion) validates whether the string is URI compliant. But URL expects
|
|
23
|
+
* the string to have a protocol. This is not validated by URI compliancy. So
|
|
24
|
+
* following is just a quick fix just for display purposes.
|
|
25
|
+
*/
|
|
26
|
+
hostname = unsafeGetDomainFromUrl('http://' + url);
|
|
27
|
+
}
|
|
28
|
+
} catch (error) {
|
|
29
|
+
return '';
|
|
30
|
+
}
|
|
31
|
+
return hostname.replace(/^www\./, '');
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Extract the domain from the URL.
|
|
36
|
+
* Throws if url param is not a valid URL.
|
|
37
|
+
* Marked as unsafe because the URL constructor throws Type Errors when it
|
|
38
|
+
* receives invalid URLs. Feel free to use this method with adequate care.
|
|
39
|
+
*/
|
|
40
|
+
var unsafeGetDomainFromUrl = exports.unsafeGetDomainFromUrl = function unsafeGetDomainFromUrl(url) {
|
|
41
|
+
var urlObj = new URL(url);
|
|
42
|
+
return urlObj.hostname;
|
|
43
|
+
};
|
|
@@ -12,6 +12,7 @@ var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/creat
|
|
|
12
12
|
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
13
13
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
14
14
|
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
15
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
15
16
|
var _teamIdToAri = require("../../common/utils/team-id-to-ari");
|
|
16
17
|
var _userAri = require("../../common/utils/user-ari");
|
|
17
18
|
var _constants = require("../constants");
|
|
@@ -55,6 +56,9 @@ var AGGClient = exports.AGGClient = /*#__PURE__*/function (_BaseGraphQlClient) {
|
|
|
55
56
|
case 4:
|
|
56
57
|
response = _context.sent;
|
|
57
58
|
containersResult = response.graphStore.cypherQuery.edges.reduce(function (containers, edge) {
|
|
59
|
+
if (!edge.node.to.data && (0, _platformFeatureFlags.fg)('enable_team_containers_null_check')) {
|
|
60
|
+
return containers;
|
|
61
|
+
}
|
|
58
62
|
if (edge.node.to.data.__typename === 'ConfluenceSpace') {
|
|
59
63
|
containers.push({
|
|
60
64
|
id: edge.node.to.id,
|
|
@@ -11,6 +11,7 @@ require("./index.compiled.css");
|
|
|
11
11
|
var _runtime = require("@compiled/react/runtime");
|
|
12
12
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
13
13
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
14
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
14
15
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
15
16
|
var _react = _interopRequireWildcard(require("react"));
|
|
16
17
|
var _reactIntlNext = require("react-intl-next");
|
|
@@ -26,8 +27,11 @@ var _tooltip = _interopRequireDefault(require("@atlaskit/tooltip"));
|
|
|
26
27
|
var _containerIcon = require("../../../common/ui/container-icon");
|
|
27
28
|
var _analytics = require("../../../common/utils/analytics");
|
|
28
29
|
var _getContainerProperties = require("../../../common/utils/get-container-properties");
|
|
30
|
+
var _getLinkDomain = require("../../../common/utils/get-link-domain");
|
|
29
31
|
var _excluded = ["triggerRef"];
|
|
30
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); }
|
|
33
|
+
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; }
|
|
34
|
+
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; }
|
|
31
35
|
var styles = {
|
|
32
36
|
container: "_2rkoop52 _1h6dz9xs _12y3e4h9 _12jimuej _1qu2nqa1 _ca0qutpp _u5f3utpp _n3tdutpp _19bvutpp _syaz1fxt",
|
|
33
37
|
card: "_4cvr1h6o _1bsb1osq",
|
|
@@ -90,16 +94,22 @@ var TeamLinkCard = exports.TeamLinkCard = function TeamLinkCard(_ref) {
|
|
|
90
94
|
}
|
|
91
95
|
};
|
|
92
96
|
var handleLinkClick = function handleLinkClick() {
|
|
97
|
+
var baseAttributes = {
|
|
98
|
+
container: containerType,
|
|
99
|
+
containerId: containerId
|
|
100
|
+
};
|
|
101
|
+
var attributes = containerType === 'WebLink' && link ? {
|
|
102
|
+
containerSelected: _objectSpread(_objectSpread({}, baseAttributes), {}, {
|
|
103
|
+
linkDomain: (0, _getLinkDomain.getDomainFromLinkUri)(link)
|
|
104
|
+
})
|
|
105
|
+
} : {
|
|
106
|
+
containerSelected: baseAttributes
|
|
107
|
+
};
|
|
93
108
|
fireUIEvent(createAnalyticsEvent, {
|
|
94
109
|
action: _analytics.AnalyticsAction.CLICKED,
|
|
95
110
|
actionSubject: 'container',
|
|
96
111
|
actionSubjectId: 'teamContainer',
|
|
97
|
-
attributes:
|
|
98
|
-
containerSelected: {
|
|
99
|
-
container: containerType,
|
|
100
|
-
containerId: containerId
|
|
101
|
-
}
|
|
102
|
-
}
|
|
112
|
+
attributes: attributes
|
|
103
113
|
});
|
|
104
114
|
};
|
|
105
115
|
return /*#__PURE__*/_react.default.createElement(_compiled.Box, {
|
|
@@ -163,7 +173,13 @@ var TeamLinkCard = exports.TeamLinkCard = function TeamLinkCard(_ref) {
|
|
|
163
173
|
fireUIEvent(createAnalyticsEvent, {
|
|
164
174
|
action: _analytics.AnalyticsAction.CLICKED,
|
|
165
175
|
actionSubject: 'button',
|
|
166
|
-
actionSubjectId: 'containerUnlinkButton'
|
|
176
|
+
actionSubjectId: 'containerUnlinkButton',
|
|
177
|
+
attributes: {
|
|
178
|
+
containerSelected: {
|
|
179
|
+
container: containerType,
|
|
180
|
+
containerId: containerId
|
|
181
|
+
}
|
|
182
|
+
}
|
|
167
183
|
});
|
|
168
184
|
}
|
|
169
185
|
}))), showMoreIcon && /*#__PURE__*/_react.default.createElement(_compiled.Box, {
|
|
@@ -195,7 +211,13 @@ var TeamLinkCard = exports.TeamLinkCard = function TeamLinkCard(_ref) {
|
|
|
195
211
|
fireUIEvent(createAnalyticsEvent, {
|
|
196
212
|
action: _analytics.AnalyticsAction.CLICKED,
|
|
197
213
|
actionSubject: 'button',
|
|
198
|
-
actionSubjectId: 'containerEditLinkButton'
|
|
214
|
+
actionSubjectId: 'containerEditLinkButton',
|
|
215
|
+
attributes: {
|
|
216
|
+
containerSelected: {
|
|
217
|
+
container: containerType,
|
|
218
|
+
containerId: containerId
|
|
219
|
+
}
|
|
220
|
+
}
|
|
199
221
|
});
|
|
200
222
|
}
|
|
201
223
|
}, formatMessage(messages.editLink)), /*#__PURE__*/_react.default.createElement(_dropdownMenu.DropdownItem, {
|
|
@@ -206,7 +228,13 @@ var TeamLinkCard = exports.TeamLinkCard = function TeamLinkCard(_ref) {
|
|
|
206
228
|
fireUIEvent(createAnalyticsEvent, {
|
|
207
229
|
action: _analytics.AnalyticsAction.CLICKED,
|
|
208
230
|
actionSubject: 'button',
|
|
209
|
-
actionSubjectId: 'containerUnlinkButton'
|
|
231
|
+
actionSubjectId: 'containerUnlinkButton',
|
|
232
|
+
attributes: {
|
|
233
|
+
containerSelected: {
|
|
234
|
+
container: containerType,
|
|
235
|
+
containerId: containerId
|
|
236
|
+
}
|
|
237
|
+
}
|
|
210
238
|
});
|
|
211
239
|
}
|
|
212
240
|
}, formatMessage(messages.removeLink)))))));
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Extract the domain from the URL. Strips "www" subdomains
|
|
3
|
+
* e.g. http://dogs.animals.com/yellow/golden-retriever becomes "dogs.animals.com"
|
|
4
|
+
* e.g. http://www.blake.com/memes becomes "blake.com"
|
|
5
|
+
*
|
|
6
|
+
* Return an empty string if a totally invalid url is somehow passed in.
|
|
7
|
+
* @param url
|
|
8
|
+
*/
|
|
9
|
+
export const getDomainFromLinkUri = url => {
|
|
10
|
+
let hostname;
|
|
11
|
+
try {
|
|
12
|
+
try {
|
|
13
|
+
hostname = unsafeGetDomainFromUrl(url);
|
|
14
|
+
} catch (noProtocolError) {
|
|
15
|
+
/**
|
|
16
|
+
* Backend (Legion) validates whether the string is URI compliant. But URL expects
|
|
17
|
+
* the string to have a protocol. This is not validated by URI compliancy. So
|
|
18
|
+
* following is just a quick fix just for display purposes.
|
|
19
|
+
*/
|
|
20
|
+
hostname = unsafeGetDomainFromUrl('http://' + url);
|
|
21
|
+
}
|
|
22
|
+
} catch (error) {
|
|
23
|
+
return '';
|
|
24
|
+
}
|
|
25
|
+
return hostname.replace(/^www\./, '');
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Extract the domain from the URL.
|
|
30
|
+
* Throws if url param is not a valid URL.
|
|
31
|
+
* Marked as unsafe because the URL constructor throws Type Errors when it
|
|
32
|
+
* receives invalid URLs. Feel free to use this method with adequate care.
|
|
33
|
+
*/
|
|
34
|
+
export const unsafeGetDomainFromUrl = url => {
|
|
35
|
+
const urlObj = new URL(url);
|
|
36
|
+
return urlObj.hostname;
|
|
37
|
+
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
1
2
|
import { teamIdToAri } from '../../common/utils/team-id-to-ari';
|
|
2
3
|
import { toUserId } from '../../common/utils/user-ari';
|
|
3
4
|
import { DEFAULT_CONFIG } from '../constants';
|
|
@@ -25,6 +26,9 @@ export class AGGClient extends BaseGraphQlClient {
|
|
|
25
26
|
operationName: 'TeamContainersQuery'
|
|
26
27
|
});
|
|
27
28
|
const containersResult = response.graphStore.cypherQuery.edges.reduce((containers, edge) => {
|
|
29
|
+
if (!edge.node.to.data && fg('enable_team_containers_null_check')) {
|
|
30
|
+
return containers;
|
|
31
|
+
}
|
|
28
32
|
if (edge.node.to.data.__typename === 'ConfluenceSpace') {
|
|
29
33
|
containers.push({
|
|
30
34
|
id: edge.node.to.id,
|
|
@@ -16,6 +16,7 @@ import Tooltip from '@atlaskit/tooltip';
|
|
|
16
16
|
import { ContainerIcon } from '../../../common/ui/container-icon';
|
|
17
17
|
import { AnalyticsAction, usePeopleAndTeamAnalytics } from '../../../common/utils/analytics';
|
|
18
18
|
import { getContainerProperties } from '../../../common/utils/get-container-properties';
|
|
19
|
+
import { getDomainFromLinkUri } from '../../../common/utils/get-link-domain';
|
|
19
20
|
const styles = {
|
|
20
21
|
container: "_2rkoop52 _1h6dz9xs _12y3e4h9 _12jimuej _1qu2nqa1 _ca0qutpp _u5f3utpp _n3tdutpp _19bvutpp _syaz1fxt",
|
|
21
22
|
card: "_4cvr1h6o _1bsb1osq",
|
|
@@ -74,16 +75,23 @@ export const TeamLinkCard = ({
|
|
|
74
75
|
}
|
|
75
76
|
};
|
|
76
77
|
const handleLinkClick = () => {
|
|
78
|
+
const baseAttributes = {
|
|
79
|
+
container: containerType,
|
|
80
|
+
containerId
|
|
81
|
+
};
|
|
82
|
+
const attributes = containerType === 'WebLink' && link ? {
|
|
83
|
+
containerSelected: {
|
|
84
|
+
...baseAttributes,
|
|
85
|
+
linkDomain: getDomainFromLinkUri(link)
|
|
86
|
+
}
|
|
87
|
+
} : {
|
|
88
|
+
containerSelected: baseAttributes
|
|
89
|
+
};
|
|
77
90
|
fireUIEvent(createAnalyticsEvent, {
|
|
78
91
|
action: AnalyticsAction.CLICKED,
|
|
79
92
|
actionSubject: 'container',
|
|
80
93
|
actionSubjectId: 'teamContainer',
|
|
81
|
-
attributes
|
|
82
|
-
containerSelected: {
|
|
83
|
-
container: containerType,
|
|
84
|
-
containerId
|
|
85
|
-
}
|
|
86
|
-
}
|
|
94
|
+
attributes
|
|
87
95
|
});
|
|
88
96
|
};
|
|
89
97
|
return /*#__PURE__*/React.createElement(Box, {
|
|
@@ -145,7 +153,13 @@ export const TeamLinkCard = ({
|
|
|
145
153
|
fireUIEvent(createAnalyticsEvent, {
|
|
146
154
|
action: AnalyticsAction.CLICKED,
|
|
147
155
|
actionSubject: 'button',
|
|
148
|
-
actionSubjectId: 'containerUnlinkButton'
|
|
156
|
+
actionSubjectId: 'containerUnlinkButton',
|
|
157
|
+
attributes: {
|
|
158
|
+
containerSelected: {
|
|
159
|
+
container: containerType,
|
|
160
|
+
containerId
|
|
161
|
+
}
|
|
162
|
+
}
|
|
149
163
|
});
|
|
150
164
|
}
|
|
151
165
|
}))), showMoreIcon && /*#__PURE__*/React.createElement(Box, {
|
|
@@ -174,7 +188,13 @@ export const TeamLinkCard = ({
|
|
|
174
188
|
fireUIEvent(createAnalyticsEvent, {
|
|
175
189
|
action: AnalyticsAction.CLICKED,
|
|
176
190
|
actionSubject: 'button',
|
|
177
|
-
actionSubjectId: 'containerEditLinkButton'
|
|
191
|
+
actionSubjectId: 'containerEditLinkButton',
|
|
192
|
+
attributes: {
|
|
193
|
+
containerSelected: {
|
|
194
|
+
container: containerType,
|
|
195
|
+
containerId
|
|
196
|
+
}
|
|
197
|
+
}
|
|
178
198
|
});
|
|
179
199
|
}
|
|
180
200
|
}, formatMessage(messages.editLink)), /*#__PURE__*/React.createElement(DropdownItem, {
|
|
@@ -185,7 +205,13 @@ export const TeamLinkCard = ({
|
|
|
185
205
|
fireUIEvent(createAnalyticsEvent, {
|
|
186
206
|
action: AnalyticsAction.CLICKED,
|
|
187
207
|
actionSubject: 'button',
|
|
188
|
-
actionSubjectId: 'containerUnlinkButton'
|
|
208
|
+
actionSubjectId: 'containerUnlinkButton',
|
|
209
|
+
attributes: {
|
|
210
|
+
containerSelected: {
|
|
211
|
+
container: containerType,
|
|
212
|
+
containerId
|
|
213
|
+
}
|
|
214
|
+
}
|
|
189
215
|
});
|
|
190
216
|
}
|
|
191
217
|
}, formatMessage(messages.removeLink)))))));
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Extract the domain from the URL. Strips "www" subdomains
|
|
3
|
+
* e.g. http://dogs.animals.com/yellow/golden-retriever becomes "dogs.animals.com"
|
|
4
|
+
* e.g. http://www.blake.com/memes becomes "blake.com"
|
|
5
|
+
*
|
|
6
|
+
* Return an empty string if a totally invalid url is somehow passed in.
|
|
7
|
+
* @param url
|
|
8
|
+
*/
|
|
9
|
+
export var getDomainFromLinkUri = function getDomainFromLinkUri(url) {
|
|
10
|
+
var hostname;
|
|
11
|
+
try {
|
|
12
|
+
try {
|
|
13
|
+
hostname = unsafeGetDomainFromUrl(url);
|
|
14
|
+
} catch (noProtocolError) {
|
|
15
|
+
/**
|
|
16
|
+
* Backend (Legion) validates whether the string is URI compliant. But URL expects
|
|
17
|
+
* the string to have a protocol. This is not validated by URI compliancy. So
|
|
18
|
+
* following is just a quick fix just for display purposes.
|
|
19
|
+
*/
|
|
20
|
+
hostname = unsafeGetDomainFromUrl('http://' + url);
|
|
21
|
+
}
|
|
22
|
+
} catch (error) {
|
|
23
|
+
return '';
|
|
24
|
+
}
|
|
25
|
+
return hostname.replace(/^www\./, '');
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Extract the domain from the URL.
|
|
30
|
+
* Throws if url param is not a valid URL.
|
|
31
|
+
* Marked as unsafe because the URL constructor throws Type Errors when it
|
|
32
|
+
* receives invalid URLs. Feel free to use this method with adequate care.
|
|
33
|
+
*/
|
|
34
|
+
export var unsafeGetDomainFromUrl = function unsafeGetDomainFromUrl(url) {
|
|
35
|
+
var urlObj = new URL(url);
|
|
36
|
+
return urlObj.hostname;
|
|
37
|
+
};
|
|
@@ -7,6 +7,7 @@ import _inherits from "@babel/runtime/helpers/inherits";
|
|
|
7
7
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
8
8
|
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
9
9
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
10
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
10
11
|
import { teamIdToAri } from '../../common/utils/team-id-to-ari';
|
|
11
12
|
import { toUserId } from '../../common/utils/user-ari';
|
|
12
13
|
import { DEFAULT_CONFIG } from '../constants';
|
|
@@ -48,6 +49,9 @@ export var AGGClient = /*#__PURE__*/function (_BaseGraphQlClient) {
|
|
|
48
49
|
case 4:
|
|
49
50
|
response = _context.sent;
|
|
50
51
|
containersResult = response.graphStore.cypherQuery.edges.reduce(function (containers, edge) {
|
|
52
|
+
if (!edge.node.to.data && fg('enable_team_containers_null_check')) {
|
|
53
|
+
return containers;
|
|
54
|
+
}
|
|
51
55
|
if (edge.node.to.data.__typename === 'ConfluenceSpace') {
|
|
52
56
|
containers.push({
|
|
53
57
|
id: edge.node.to.id,
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
/* index.tsx generated by @compiled/babel-plugin v0.36.1 */
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
3
|
import _extends from "@babel/runtime/helpers/extends";
|
|
4
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
4
5
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
5
6
|
var _excluded = ["triggerRef"];
|
|
6
7
|
import "./index.compiled.css";
|
|
7
8
|
import { ax, ix } from "@compiled/react/runtime";
|
|
9
|
+
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; }
|
|
10
|
+
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) { _defineProperty(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; }
|
|
8
11
|
import React, { useState } from 'react';
|
|
9
12
|
import { defineMessages, useIntl } from 'react-intl-next';
|
|
10
13
|
import { useAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
@@ -19,6 +22,7 @@ import Tooltip from '@atlaskit/tooltip';
|
|
|
19
22
|
import { ContainerIcon } from '../../../common/ui/container-icon';
|
|
20
23
|
import { AnalyticsAction, usePeopleAndTeamAnalytics } from '../../../common/utils/analytics';
|
|
21
24
|
import { getContainerProperties } from '../../../common/utils/get-container-properties';
|
|
25
|
+
import { getDomainFromLinkUri } from '../../../common/utils/get-link-domain';
|
|
22
26
|
var styles = {
|
|
23
27
|
container: "_2rkoop52 _1h6dz9xs _12y3e4h9 _12jimuej _1qu2nqa1 _ca0qutpp _u5f3utpp _n3tdutpp _19bvutpp _syaz1fxt",
|
|
24
28
|
card: "_4cvr1h6o _1bsb1osq",
|
|
@@ -81,16 +85,22 @@ export var TeamLinkCard = function TeamLinkCard(_ref) {
|
|
|
81
85
|
}
|
|
82
86
|
};
|
|
83
87
|
var handleLinkClick = function handleLinkClick() {
|
|
88
|
+
var baseAttributes = {
|
|
89
|
+
container: containerType,
|
|
90
|
+
containerId: containerId
|
|
91
|
+
};
|
|
92
|
+
var attributes = containerType === 'WebLink' && link ? {
|
|
93
|
+
containerSelected: _objectSpread(_objectSpread({}, baseAttributes), {}, {
|
|
94
|
+
linkDomain: getDomainFromLinkUri(link)
|
|
95
|
+
})
|
|
96
|
+
} : {
|
|
97
|
+
containerSelected: baseAttributes
|
|
98
|
+
};
|
|
84
99
|
fireUIEvent(createAnalyticsEvent, {
|
|
85
100
|
action: AnalyticsAction.CLICKED,
|
|
86
101
|
actionSubject: 'container',
|
|
87
102
|
actionSubjectId: 'teamContainer',
|
|
88
|
-
attributes:
|
|
89
|
-
containerSelected: {
|
|
90
|
-
container: containerType,
|
|
91
|
-
containerId: containerId
|
|
92
|
-
}
|
|
93
|
-
}
|
|
103
|
+
attributes: attributes
|
|
94
104
|
});
|
|
95
105
|
};
|
|
96
106
|
return /*#__PURE__*/React.createElement(Box, {
|
|
@@ -154,7 +164,13 @@ export var TeamLinkCard = function TeamLinkCard(_ref) {
|
|
|
154
164
|
fireUIEvent(createAnalyticsEvent, {
|
|
155
165
|
action: AnalyticsAction.CLICKED,
|
|
156
166
|
actionSubject: 'button',
|
|
157
|
-
actionSubjectId: 'containerUnlinkButton'
|
|
167
|
+
actionSubjectId: 'containerUnlinkButton',
|
|
168
|
+
attributes: {
|
|
169
|
+
containerSelected: {
|
|
170
|
+
container: containerType,
|
|
171
|
+
containerId: containerId
|
|
172
|
+
}
|
|
173
|
+
}
|
|
158
174
|
});
|
|
159
175
|
}
|
|
160
176
|
}))), showMoreIcon && /*#__PURE__*/React.createElement(Box, {
|
|
@@ -186,7 +202,13 @@ export var TeamLinkCard = function TeamLinkCard(_ref) {
|
|
|
186
202
|
fireUIEvent(createAnalyticsEvent, {
|
|
187
203
|
action: AnalyticsAction.CLICKED,
|
|
188
204
|
actionSubject: 'button',
|
|
189
|
-
actionSubjectId: 'containerEditLinkButton'
|
|
205
|
+
actionSubjectId: 'containerEditLinkButton',
|
|
206
|
+
attributes: {
|
|
207
|
+
containerSelected: {
|
|
208
|
+
container: containerType,
|
|
209
|
+
containerId: containerId
|
|
210
|
+
}
|
|
211
|
+
}
|
|
190
212
|
});
|
|
191
213
|
}
|
|
192
214
|
}, formatMessage(messages.editLink)), /*#__PURE__*/React.createElement(DropdownItem, {
|
|
@@ -197,7 +219,13 @@ export var TeamLinkCard = function TeamLinkCard(_ref) {
|
|
|
197
219
|
fireUIEvent(createAnalyticsEvent, {
|
|
198
220
|
action: AnalyticsAction.CLICKED,
|
|
199
221
|
actionSubject: 'button',
|
|
200
|
-
actionSubjectId: 'containerUnlinkButton'
|
|
222
|
+
actionSubjectId: 'containerUnlinkButton',
|
|
223
|
+
attributes: {
|
|
224
|
+
containerSelected: {
|
|
225
|
+
container: containerType,
|
|
226
|
+
containerId: containerId
|
|
227
|
+
}
|
|
228
|
+
}
|
|
201
229
|
});
|
|
202
230
|
}
|
|
203
231
|
}, formatMessage(messages.removeLink)))))));
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Extract the domain from the URL. Strips "www" subdomains
|
|
3
|
+
* e.g. http://dogs.animals.com/yellow/golden-retriever becomes "dogs.animals.com"
|
|
4
|
+
* e.g. http://www.blake.com/memes becomes "blake.com"
|
|
5
|
+
*
|
|
6
|
+
* Return an empty string if a totally invalid url is somehow passed in.
|
|
7
|
+
* @param url
|
|
8
|
+
*/
|
|
9
|
+
export declare const getDomainFromLinkUri: (url: string) => string;
|
|
10
|
+
/**
|
|
11
|
+
* Extract the domain from the URL.
|
|
12
|
+
* Throws if url param is not a valid URL.
|
|
13
|
+
* Marked as unsafe because the URL constructor throws Type Errors when it
|
|
14
|
+
* receives invalid URLs. Feel free to use this method with adequate care.
|
|
15
|
+
*/
|
|
16
|
+
export declare const unsafeGetDomainFromUrl: (url: string) => string;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Extract the domain from the URL. Strips "www" subdomains
|
|
3
|
+
* e.g. http://dogs.animals.com/yellow/golden-retriever becomes "dogs.animals.com"
|
|
4
|
+
* e.g. http://www.blake.com/memes becomes "blake.com"
|
|
5
|
+
*
|
|
6
|
+
* Return an empty string if a totally invalid url is somehow passed in.
|
|
7
|
+
* @param url
|
|
8
|
+
*/
|
|
9
|
+
export declare const getDomainFromLinkUri: (url: string) => string;
|
|
10
|
+
/**
|
|
11
|
+
* Extract the domain from the URL.
|
|
12
|
+
* Throws if url param is not a valid URL.
|
|
13
|
+
* Marked as unsafe because the URL constructor throws Type Errors when it
|
|
14
|
+
* receives invalid URLs. Feel free to use this method with adequate care.
|
|
15
|
+
*/
|
|
16
|
+
export declare const unsafeGetDomainFromUrl: (url: string) => string;
|
package/package.json
CHANGED
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"@atlaskit/analytics-next": "^11.1.0",
|
|
34
34
|
"@atlaskit/avatar": "^25.1.0",
|
|
35
35
|
"@atlaskit/button": "^23.2.0",
|
|
36
|
-
"@atlaskit/css": "^0.
|
|
36
|
+
"@atlaskit/css": "^0.11.0",
|
|
37
37
|
"@atlaskit/dropdown-menu": "^16.1.0",
|
|
38
38
|
"@atlaskit/feature-gate-js-client": "^5.3.0",
|
|
39
39
|
"@atlaskit/heading": "^5.2.0",
|
|
@@ -44,10 +44,10 @@
|
|
|
44
44
|
"@atlaskit/modal-dialog": "^14.2.0",
|
|
45
45
|
"@atlaskit/people-teams-ui-public": "^3.1.0",
|
|
46
46
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
47
|
-
"@atlaskit/primitives": "^14.
|
|
47
|
+
"@atlaskit/primitives": "^14.9.0",
|
|
48
48
|
"@atlaskit/teams-client": "^4.5.0",
|
|
49
49
|
"@atlaskit/theme": "^18.0.0",
|
|
50
|
-
"@atlaskit/tokens": "^5.
|
|
50
|
+
"@atlaskit/tokens": "^5.3.0",
|
|
51
51
|
"@atlaskit/tooltip": "^20.3.0",
|
|
52
52
|
"@babel/runtime": "^7.0.0",
|
|
53
53
|
"@compiled/react": "^0.18.3",
|
|
@@ -114,7 +114,7 @@
|
|
|
114
114
|
}
|
|
115
115
|
},
|
|
116
116
|
"name": "@atlaskit/teams-public",
|
|
117
|
-
"version": "0.
|
|
117
|
+
"version": "0.39.1",
|
|
118
118
|
"description": "Public components related to teams",
|
|
119
119
|
"author": "Atlassian Pty Ltd",
|
|
120
120
|
"license": "Apache-2.0",
|
|
@@ -136,6 +136,9 @@
|
|
|
136
136
|
},
|
|
137
137
|
"enable_web_links_in_team_containers": {
|
|
138
138
|
"type": "boolean"
|
|
139
|
+
},
|
|
140
|
+
"enable_team_containers_null_check": {
|
|
141
|
+
"type": "boolean"
|
|
139
142
|
}
|
|
140
143
|
}
|
|
141
144
|
}
|