@atlaskit/teams-public 0.38.2 → 0.39.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 +21 -0
- package/dist/cjs/common/utils/get-container-properties.js +12 -12
- package/dist/cjs/common/utils/get-link-domain.js +43 -0
- package/dist/cjs/ui/team-containers/disconnect-dialog/index.js +12 -7
- package/dist/cjs/ui/team-containers/main.js +2 -2
- package/dist/cjs/ui/team-containers/team-link-card/index.js +37 -9
- package/dist/es2019/common/utils/get-container-properties.js +12 -12
- package/dist/es2019/common/utils/get-link-domain.js +37 -0
- package/dist/es2019/ui/team-containers/disconnect-dialog/index.js +12 -7
- package/dist/es2019/ui/team-containers/main.js +2 -2
- package/dist/es2019/ui/team-containers/team-link-card/index.js +35 -9
- package/dist/esm/common/utils/get-container-properties.js +12 -12
- package/dist/esm/common/utils/get-link-domain.js +37 -0
- package/dist/esm/ui/team-containers/disconnect-dialog/index.js +12 -7
- package/dist/esm/ui/team-containers/main.js +2 -2
- 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/ui/team-containers/disconnect-dialog/index.d.ts +5 -0
- package/dist/types-ts4.5/common/utils/get-link-domain.d.ts +16 -0
- package/dist/types-ts4.5/ui/team-containers/disconnect-dialog/index.d.ts +5 -0
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,26 @@
|
|
|
1
1
|
# @atlaskit/teams-public
|
|
2
2
|
|
|
3
|
+
## 0.39.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#173114](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/173114)
|
|
8
|
+
[`62a85f0b88860`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/62a85f0b88860) -
|
|
9
|
+
PTC-11556 Add analytics events for supporting all links project
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Updated dependencies
|
|
14
|
+
|
|
15
|
+
## 0.38.3
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- [#173038](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/173038)
|
|
20
|
+
[`4e0b09ea564a5`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/4e0b09ea564a5) -
|
|
21
|
+
[ux] NO-ISSUE Fix keywords missing issue in disconnect dialog and remove non-finals in message
|
|
22
|
+
- Updated dependencies
|
|
23
|
+
|
|
3
24
|
## 0.38.2
|
|
4
25
|
|
|
5
26
|
### Patch Changes
|
|
@@ -29,62 +29,62 @@ var styles = {
|
|
|
29
29
|
};
|
|
30
30
|
var messages = exports.messages = (0, _reactIntlNext.defineMessages)({
|
|
31
31
|
addConfluenceContainerTitle: {
|
|
32
|
-
id: 'ptc-directory.team-profile-page.team-containers.add-confluence-space-title
|
|
32
|
+
id: 'ptc-directory.team-profile-page.team-containers.add-confluence-space-title',
|
|
33
33
|
defaultMessage: 'Add space',
|
|
34
34
|
description: 'Title of the card to add a Confluence space to a team'
|
|
35
35
|
},
|
|
36
36
|
confluenceContainerDescription: {
|
|
37
|
-
id: 'ptc-directory.team-profile-page.team-containers.add-confluence-space-description
|
|
37
|
+
id: 'ptc-directory.team-profile-page.team-containers.add-confluence-space-description',
|
|
38
38
|
defaultMessage: 'Confluence',
|
|
39
39
|
description: 'Description of the card to add a Confluence space to a team'
|
|
40
40
|
},
|
|
41
41
|
addLoomContainerTitle: {
|
|
42
|
-
id: 'ptc-directory.team-profile-page.team-containers.add-loom-space-title
|
|
42
|
+
id: 'ptc-directory.team-profile-page.team-containers.add-loom-space-title',
|
|
43
43
|
defaultMessage: 'Add space',
|
|
44
44
|
description: 'Title of the card to add a Loom space to a team'
|
|
45
45
|
},
|
|
46
46
|
confluenceLoomDescription: {
|
|
47
|
-
id: 'ptc-directory.team-profile-page.team-containers.add-loom-space-description
|
|
47
|
+
id: 'ptc-directory.team-profile-page.team-containers.add-loom-space-description',
|
|
48
48
|
defaultMessage: 'Loom',
|
|
49
49
|
description: 'Description of the card to add a Loom space to a team'
|
|
50
50
|
},
|
|
51
51
|
addJiraProjectTitle: {
|
|
52
|
-
id: 'ptc-directory.team-profile-page.team-containers.add-jira-project-title
|
|
52
|
+
id: 'ptc-directory.team-profile-page.team-containers.add-jira-project-title',
|
|
53
53
|
defaultMessage: 'Add project',
|
|
54
54
|
description: 'Title of the card to add a Jira project to a team'
|
|
55
55
|
},
|
|
56
56
|
jiraProjectDescription: {
|
|
57
|
-
id: 'ptc-directory.team-profile-page.team-containers.add-jira-project-description
|
|
57
|
+
id: 'ptc-directory.team-profile-page.team-containers.add-jira-project-description',
|
|
58
58
|
defaultMessage: 'Jira',
|
|
59
59
|
description: 'Description of the card to add a Jira project to a team'
|
|
60
60
|
},
|
|
61
61
|
addLoomSpaceTitle: {
|
|
62
|
-
id: 'ptc-directory.team-profile-page.team-containers.add-loom-space-title
|
|
62
|
+
id: 'ptc-directory.team-profile-page.team-containers.add-loom-space-title',
|
|
63
63
|
defaultMessage: 'Add space',
|
|
64
64
|
description: 'Title of the card to add a Loom space to a team'
|
|
65
65
|
},
|
|
66
66
|
loomSpaceDescription: {
|
|
67
|
-
id: 'ptc-directory.team-profile-page.team-containers.add-loom-space-description
|
|
67
|
+
id: 'ptc-directory.team-profile-page.team-containers.add-loom-space-description',
|
|
68
68
|
defaultMessage: 'Loom',
|
|
69
69
|
description: 'Description of the card to add a Loom space to a team'
|
|
70
70
|
},
|
|
71
71
|
projectContainerText: {
|
|
72
|
-
id: 'ptc-directory.team-profile-page.team-containers.project-container-text
|
|
72
|
+
id: 'ptc-directory.team-profile-page.team-containers.project-container-text',
|
|
73
73
|
defaultMessage: 'project',
|
|
74
74
|
description: 'Text for project type containers'
|
|
75
75
|
},
|
|
76
76
|
spaceContainerText: {
|
|
77
|
-
id: 'ptc-directory.team-profile-page.team-containers.space-container-text
|
|
77
|
+
id: 'ptc-directory.team-profile-page.team-containers.space-container-text',
|
|
78
78
|
defaultMessage: 'space',
|
|
79
79
|
description: 'Text for space type containers'
|
|
80
80
|
},
|
|
81
81
|
emptyWebLinkContainerDescription: {
|
|
82
|
-
id: 'platform.teams.containers.empty-web-link-description
|
|
82
|
+
id: 'platform.teams.containers.empty-web-link-description',
|
|
83
83
|
defaultMessage: 'Add any web link',
|
|
84
84
|
description: 'Description displayed on the empty card for adding a web link to a team'
|
|
85
85
|
},
|
|
86
86
|
webLinkContainerDescription: {
|
|
87
|
-
id: 'platform.teams.containers.web-link-title-description
|
|
87
|
+
id: 'platform.teams.containers.web-link-title-description',
|
|
88
88
|
defaultMessage: 'Web link',
|
|
89
89
|
description: 'Description displayed for web link containers in team profile'
|
|
90
90
|
}
|
|
@@ -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
|
+
};
|
|
@@ -19,27 +19,32 @@ var _getContainerProperties = require("../../../common/utils/get-container-prope
|
|
|
19
19
|
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); }
|
|
20
20
|
var messages = exports.messages = (0, _reactIntlNext.defineMessages)({
|
|
21
21
|
disconnectDialogTitle: {
|
|
22
|
-
id: 'ptc-directory.team-profile-page.team-containers.disconnect-dialog.title
|
|
22
|
+
id: 'ptc-directory.team-profile-page.team-containers.disconnect-dialog.title',
|
|
23
23
|
defaultMessage: 'Disconnect place',
|
|
24
24
|
description: 'Title of the disconnect dialog for team containers'
|
|
25
25
|
},
|
|
26
26
|
disconnectDialogDescription: {
|
|
27
|
-
id: 'ptc-directory.team-profile-page.team-containers.disconnect-dialog.description
|
|
27
|
+
id: 'ptc-directory.team-profile-page.team-containers.disconnect-dialog.description',
|
|
28
28
|
defaultMessage: 'This team will no longer be connected to the {containerName} {containerType}.',
|
|
29
29
|
description: 'Description of the disconnect dialog for team containers'
|
|
30
30
|
},
|
|
31
31
|
disconnectDialogDisclaimer: {
|
|
32
|
-
id: 'ptc-directory.team-profile-page.team-containers.disconnect-dialog.disclaimer
|
|
32
|
+
id: 'ptc-directory.team-profile-page.team-containers.disconnect-dialog.disclaimer',
|
|
33
33
|
defaultMessage: 'Disconnecting the team from the {containerType} will not affect any work connected to the team within the {containerType}.',
|
|
34
34
|
description: 'Disclaimer of the disconnect dialog for team containers'
|
|
35
35
|
},
|
|
36
|
+
disconnectDialogDisclaimerFallback: {
|
|
37
|
+
id: 'ptc-directory.team-profile-page.team-containers.disconnect-dialog.disclaimer-fallback',
|
|
38
|
+
defaultMessage: 'Disconnecting the team from the link will not affect any work connected to the team.',
|
|
39
|
+
description: 'Disclaimer shown for web links when disconnecting team containers'
|
|
40
|
+
},
|
|
36
41
|
disconnectDialogCancelButton: {
|
|
37
|
-
id: 'ptc-directory.team-profile-page.team-containers.disconnect-dialog.cancel-button
|
|
42
|
+
id: 'ptc-directory.team-profile-page.team-containers.disconnect-dialog.cancel-button',
|
|
38
43
|
defaultMessage: 'Cancel',
|
|
39
44
|
description: 'Button to cancel the dialog'
|
|
40
45
|
},
|
|
41
46
|
disconnectDialogRemoveButton: {
|
|
42
|
-
id: 'ptc-directory.team-profile-page.team-containers.disconnect-dialog.remove-button
|
|
47
|
+
id: 'ptc-directory.team-profile-page.team-containers.disconnect-dialog.remove-button',
|
|
43
48
|
defaultMessage: 'Remove',
|
|
44
49
|
description: 'Button to disconnect the team from the container'
|
|
45
50
|
}
|
|
@@ -92,11 +97,11 @@ var DisconnectDialog = exports.DisconnectDialog = function DisconnectDialog(_ref
|
|
|
92
97
|
containerName: /*#__PURE__*/_react.default.createElement("b", null, containerName),
|
|
93
98
|
containerType: /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, description, " ", containerTypeText)
|
|
94
99
|
}
|
|
95
|
-
}))), /*#__PURE__*/_react.default.createElement(_reactIntlNext.FormattedMessage, (0, _extends2.default)({}, messages.disconnectDialogDisclaimer, {
|
|
100
|
+
}))), containerTypeText ? /*#__PURE__*/_react.default.createElement(_reactIntlNext.FormattedMessage, (0, _extends2.default)({}, messages.disconnectDialogDisclaimer, {
|
|
96
101
|
values: {
|
|
97
102
|
containerType: containerTypeText
|
|
98
103
|
}
|
|
99
|
-
})))), /*#__PURE__*/_react.default.createElement(_modalDialog.ModalFooter, null, /*#__PURE__*/_react.default.createElement(_new.default, {
|
|
104
|
+
})) : /*#__PURE__*/_react.default.createElement(_reactIntlNext.FormattedMessage, messages.disconnectDialogDisclaimerFallback))), /*#__PURE__*/_react.default.createElement(_modalDialog.ModalFooter, null, /*#__PURE__*/_react.default.createElement(_new.default, {
|
|
100
105
|
appearance: "subtle",
|
|
101
106
|
onClick: onClose
|
|
102
107
|
}, /*#__PURE__*/_react.default.createElement(_reactIntlNext.FormattedMessage, messages.disconnectDialogCancelButton)), /*#__PURE__*/_react.default.createElement(_new.default, {
|
|
@@ -346,12 +346,12 @@ var TeamContainers = exports.TeamContainers = function TeamContainers(_ref) {
|
|
|
346
346
|
};
|
|
347
347
|
var messages = (0, _reactIntlNext.defineMessages)({
|
|
348
348
|
showMore: {
|
|
349
|
-
id: 'ptc-directory.team-profile-page.team-containers.show-more
|
|
349
|
+
id: 'ptc-directory.team-profile-page.team-containers.show-more',
|
|
350
350
|
defaultMessage: 'Show more',
|
|
351
351
|
description: 'Button to show more containers'
|
|
352
352
|
},
|
|
353
353
|
showLess: {
|
|
354
|
-
id: 'ptc-directory.team-profile-page.team-containers.show-less
|
|
354
|
+
id: 'ptc-directory.team-profile-page.team-containers.show-less',
|
|
355
355
|
defaultMessage: 'Show less',
|
|
356
356
|
description: 'Button to show less containers'
|
|
357
357
|
}
|
|
@@ -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)))))));
|
|
@@ -19,62 +19,62 @@ const styles = {
|
|
|
19
19
|
};
|
|
20
20
|
export const messages = defineMessages({
|
|
21
21
|
addConfluenceContainerTitle: {
|
|
22
|
-
id: 'ptc-directory.team-profile-page.team-containers.add-confluence-space-title
|
|
22
|
+
id: 'ptc-directory.team-profile-page.team-containers.add-confluence-space-title',
|
|
23
23
|
defaultMessage: 'Add space',
|
|
24
24
|
description: 'Title of the card to add a Confluence space to a team'
|
|
25
25
|
},
|
|
26
26
|
confluenceContainerDescription: {
|
|
27
|
-
id: 'ptc-directory.team-profile-page.team-containers.add-confluence-space-description
|
|
27
|
+
id: 'ptc-directory.team-profile-page.team-containers.add-confluence-space-description',
|
|
28
28
|
defaultMessage: 'Confluence',
|
|
29
29
|
description: 'Description of the card to add a Confluence space to a team'
|
|
30
30
|
},
|
|
31
31
|
addLoomContainerTitle: {
|
|
32
|
-
id: 'ptc-directory.team-profile-page.team-containers.add-loom-space-title
|
|
32
|
+
id: 'ptc-directory.team-profile-page.team-containers.add-loom-space-title',
|
|
33
33
|
defaultMessage: 'Add space',
|
|
34
34
|
description: 'Title of the card to add a Loom space to a team'
|
|
35
35
|
},
|
|
36
36
|
confluenceLoomDescription: {
|
|
37
|
-
id: 'ptc-directory.team-profile-page.team-containers.add-loom-space-description
|
|
37
|
+
id: 'ptc-directory.team-profile-page.team-containers.add-loom-space-description',
|
|
38
38
|
defaultMessage: 'Loom',
|
|
39
39
|
description: 'Description of the card to add a Loom space to a team'
|
|
40
40
|
},
|
|
41
41
|
addJiraProjectTitle: {
|
|
42
|
-
id: 'ptc-directory.team-profile-page.team-containers.add-jira-project-title
|
|
42
|
+
id: 'ptc-directory.team-profile-page.team-containers.add-jira-project-title',
|
|
43
43
|
defaultMessage: 'Add project',
|
|
44
44
|
description: 'Title of the card to add a Jira project to a team'
|
|
45
45
|
},
|
|
46
46
|
jiraProjectDescription: {
|
|
47
|
-
id: 'ptc-directory.team-profile-page.team-containers.add-jira-project-description
|
|
47
|
+
id: 'ptc-directory.team-profile-page.team-containers.add-jira-project-description',
|
|
48
48
|
defaultMessage: 'Jira',
|
|
49
49
|
description: 'Description of the card to add a Jira project to a team'
|
|
50
50
|
},
|
|
51
51
|
addLoomSpaceTitle: {
|
|
52
|
-
id: 'ptc-directory.team-profile-page.team-containers.add-loom-space-title
|
|
52
|
+
id: 'ptc-directory.team-profile-page.team-containers.add-loom-space-title',
|
|
53
53
|
defaultMessage: 'Add space',
|
|
54
54
|
description: 'Title of the card to add a Loom space to a team'
|
|
55
55
|
},
|
|
56
56
|
loomSpaceDescription: {
|
|
57
|
-
id: 'ptc-directory.team-profile-page.team-containers.add-loom-space-description
|
|
57
|
+
id: 'ptc-directory.team-profile-page.team-containers.add-loom-space-description',
|
|
58
58
|
defaultMessage: 'Loom',
|
|
59
59
|
description: 'Description of the card to add a Loom space to a team'
|
|
60
60
|
},
|
|
61
61
|
projectContainerText: {
|
|
62
|
-
id: 'ptc-directory.team-profile-page.team-containers.project-container-text
|
|
62
|
+
id: 'ptc-directory.team-profile-page.team-containers.project-container-text',
|
|
63
63
|
defaultMessage: 'project',
|
|
64
64
|
description: 'Text for project type containers'
|
|
65
65
|
},
|
|
66
66
|
spaceContainerText: {
|
|
67
|
-
id: 'ptc-directory.team-profile-page.team-containers.space-container-text
|
|
67
|
+
id: 'ptc-directory.team-profile-page.team-containers.space-container-text',
|
|
68
68
|
defaultMessage: 'space',
|
|
69
69
|
description: 'Text for space type containers'
|
|
70
70
|
},
|
|
71
71
|
emptyWebLinkContainerDescription: {
|
|
72
|
-
id: 'platform.teams.containers.empty-web-link-description
|
|
72
|
+
id: 'platform.teams.containers.empty-web-link-description',
|
|
73
73
|
defaultMessage: 'Add any web link',
|
|
74
74
|
description: 'Description displayed on the empty card for adding a web link to a team'
|
|
75
75
|
},
|
|
76
76
|
webLinkContainerDescription: {
|
|
77
|
-
id: 'platform.teams.containers.web-link-title-description
|
|
77
|
+
id: 'platform.teams.containers.web-link-title-description',
|
|
78
78
|
defaultMessage: 'Web link',
|
|
79
79
|
description: 'Description displayed for web link containers in team profile'
|
|
80
80
|
}
|
|
@@ -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
|
+
};
|
|
@@ -7,27 +7,32 @@ import { Box, Stack } from '@atlaskit/primitives/compiled';
|
|
|
7
7
|
import { getContainerProperties } from '../../../common/utils/get-container-properties';
|
|
8
8
|
export const messages = defineMessages({
|
|
9
9
|
disconnectDialogTitle: {
|
|
10
|
-
id: 'ptc-directory.team-profile-page.team-containers.disconnect-dialog.title
|
|
10
|
+
id: 'ptc-directory.team-profile-page.team-containers.disconnect-dialog.title',
|
|
11
11
|
defaultMessage: 'Disconnect place',
|
|
12
12
|
description: 'Title of the disconnect dialog for team containers'
|
|
13
13
|
},
|
|
14
14
|
disconnectDialogDescription: {
|
|
15
|
-
id: 'ptc-directory.team-profile-page.team-containers.disconnect-dialog.description
|
|
15
|
+
id: 'ptc-directory.team-profile-page.team-containers.disconnect-dialog.description',
|
|
16
16
|
defaultMessage: 'This team will no longer be connected to the {containerName} {containerType}.',
|
|
17
17
|
description: 'Description of the disconnect dialog for team containers'
|
|
18
18
|
},
|
|
19
19
|
disconnectDialogDisclaimer: {
|
|
20
|
-
id: 'ptc-directory.team-profile-page.team-containers.disconnect-dialog.disclaimer
|
|
20
|
+
id: 'ptc-directory.team-profile-page.team-containers.disconnect-dialog.disclaimer',
|
|
21
21
|
defaultMessage: 'Disconnecting the team from the {containerType} will not affect any work connected to the team within the {containerType}.',
|
|
22
22
|
description: 'Disclaimer of the disconnect dialog for team containers'
|
|
23
23
|
},
|
|
24
|
+
disconnectDialogDisclaimerFallback: {
|
|
25
|
+
id: 'ptc-directory.team-profile-page.team-containers.disconnect-dialog.disclaimer-fallback',
|
|
26
|
+
defaultMessage: 'Disconnecting the team from the link will not affect any work connected to the team.',
|
|
27
|
+
description: 'Disclaimer shown for web links when disconnecting team containers'
|
|
28
|
+
},
|
|
24
29
|
disconnectDialogCancelButton: {
|
|
25
|
-
id: 'ptc-directory.team-profile-page.team-containers.disconnect-dialog.cancel-button
|
|
30
|
+
id: 'ptc-directory.team-profile-page.team-containers.disconnect-dialog.cancel-button',
|
|
26
31
|
defaultMessage: 'Cancel',
|
|
27
32
|
description: 'Button to cancel the dialog'
|
|
28
33
|
},
|
|
29
34
|
disconnectDialogRemoveButton: {
|
|
30
|
-
id: 'ptc-directory.team-profile-page.team-containers.disconnect-dialog.remove-button
|
|
35
|
+
id: 'ptc-directory.team-profile-page.team-containers.disconnect-dialog.remove-button',
|
|
31
36
|
defaultMessage: 'Remove',
|
|
32
37
|
description: 'Button to disconnect the team from the container'
|
|
33
38
|
}
|
|
@@ -64,11 +69,11 @@ export const DisconnectDialog = ({
|
|
|
64
69
|
containerName: /*#__PURE__*/React.createElement("b", null, containerName),
|
|
65
70
|
containerType: /*#__PURE__*/React.createElement(React.Fragment, null, description, " ", containerTypeText)
|
|
66
71
|
}
|
|
67
|
-
}))), /*#__PURE__*/React.createElement(FormattedMessage, _extends({}, messages.disconnectDialogDisclaimer, {
|
|
72
|
+
}))), containerTypeText ? /*#__PURE__*/React.createElement(FormattedMessage, _extends({}, messages.disconnectDialogDisclaimer, {
|
|
68
73
|
values: {
|
|
69
74
|
containerType: containerTypeText
|
|
70
75
|
}
|
|
71
|
-
})))), /*#__PURE__*/React.createElement(ModalFooter, null, /*#__PURE__*/React.createElement(Button, {
|
|
76
|
+
})) : /*#__PURE__*/React.createElement(FormattedMessage, messages.disconnectDialogDisclaimerFallback))), /*#__PURE__*/React.createElement(ModalFooter, null, /*#__PURE__*/React.createElement(Button, {
|
|
72
77
|
appearance: "subtle",
|
|
73
78
|
onClick: onClose
|
|
74
79
|
}, /*#__PURE__*/React.createElement(FormattedMessage, messages.disconnectDialogCancelButton)), /*#__PURE__*/React.createElement(Button, {
|
|
@@ -256,12 +256,12 @@ export const TeamContainers = ({
|
|
|
256
256
|
};
|
|
257
257
|
const messages = defineMessages({
|
|
258
258
|
showMore: {
|
|
259
|
-
id: 'ptc-directory.team-profile-page.team-containers.show-more
|
|
259
|
+
id: 'ptc-directory.team-profile-page.team-containers.show-more',
|
|
260
260
|
defaultMessage: 'Show more',
|
|
261
261
|
description: 'Button to show more containers'
|
|
262
262
|
},
|
|
263
263
|
showLess: {
|
|
264
|
-
id: 'ptc-directory.team-profile-page.team-containers.show-less
|
|
264
|
+
id: 'ptc-directory.team-profile-page.team-containers.show-less',
|
|
265
265
|
defaultMessage: 'Show less',
|
|
266
266
|
description: 'Button to show less containers'
|
|
267
267
|
}
|
|
@@ -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)))))));
|
|
@@ -22,62 +22,62 @@ var styles = {
|
|
|
22
22
|
};
|
|
23
23
|
export var messages = defineMessages({
|
|
24
24
|
addConfluenceContainerTitle: {
|
|
25
|
-
id: 'ptc-directory.team-profile-page.team-containers.add-confluence-space-title
|
|
25
|
+
id: 'ptc-directory.team-profile-page.team-containers.add-confluence-space-title',
|
|
26
26
|
defaultMessage: 'Add space',
|
|
27
27
|
description: 'Title of the card to add a Confluence space to a team'
|
|
28
28
|
},
|
|
29
29
|
confluenceContainerDescription: {
|
|
30
|
-
id: 'ptc-directory.team-profile-page.team-containers.add-confluence-space-description
|
|
30
|
+
id: 'ptc-directory.team-profile-page.team-containers.add-confluence-space-description',
|
|
31
31
|
defaultMessage: 'Confluence',
|
|
32
32
|
description: 'Description of the card to add a Confluence space to a team'
|
|
33
33
|
},
|
|
34
34
|
addLoomContainerTitle: {
|
|
35
|
-
id: 'ptc-directory.team-profile-page.team-containers.add-loom-space-title
|
|
35
|
+
id: 'ptc-directory.team-profile-page.team-containers.add-loom-space-title',
|
|
36
36
|
defaultMessage: 'Add space',
|
|
37
37
|
description: 'Title of the card to add a Loom space to a team'
|
|
38
38
|
},
|
|
39
39
|
confluenceLoomDescription: {
|
|
40
|
-
id: 'ptc-directory.team-profile-page.team-containers.add-loom-space-description
|
|
40
|
+
id: 'ptc-directory.team-profile-page.team-containers.add-loom-space-description',
|
|
41
41
|
defaultMessage: 'Loom',
|
|
42
42
|
description: 'Description of the card to add a Loom space to a team'
|
|
43
43
|
},
|
|
44
44
|
addJiraProjectTitle: {
|
|
45
|
-
id: 'ptc-directory.team-profile-page.team-containers.add-jira-project-title
|
|
45
|
+
id: 'ptc-directory.team-profile-page.team-containers.add-jira-project-title',
|
|
46
46
|
defaultMessage: 'Add project',
|
|
47
47
|
description: 'Title of the card to add a Jira project to a team'
|
|
48
48
|
},
|
|
49
49
|
jiraProjectDescription: {
|
|
50
|
-
id: 'ptc-directory.team-profile-page.team-containers.add-jira-project-description
|
|
50
|
+
id: 'ptc-directory.team-profile-page.team-containers.add-jira-project-description',
|
|
51
51
|
defaultMessage: 'Jira',
|
|
52
52
|
description: 'Description of the card to add a Jira project to a team'
|
|
53
53
|
},
|
|
54
54
|
addLoomSpaceTitle: {
|
|
55
|
-
id: 'ptc-directory.team-profile-page.team-containers.add-loom-space-title
|
|
55
|
+
id: 'ptc-directory.team-profile-page.team-containers.add-loom-space-title',
|
|
56
56
|
defaultMessage: 'Add space',
|
|
57
57
|
description: 'Title of the card to add a Loom space to a team'
|
|
58
58
|
},
|
|
59
59
|
loomSpaceDescription: {
|
|
60
|
-
id: 'ptc-directory.team-profile-page.team-containers.add-loom-space-description
|
|
60
|
+
id: 'ptc-directory.team-profile-page.team-containers.add-loom-space-description',
|
|
61
61
|
defaultMessage: 'Loom',
|
|
62
62
|
description: 'Description of the card to add a Loom space to a team'
|
|
63
63
|
},
|
|
64
64
|
projectContainerText: {
|
|
65
|
-
id: 'ptc-directory.team-profile-page.team-containers.project-container-text
|
|
65
|
+
id: 'ptc-directory.team-profile-page.team-containers.project-container-text',
|
|
66
66
|
defaultMessage: 'project',
|
|
67
67
|
description: 'Text for project type containers'
|
|
68
68
|
},
|
|
69
69
|
spaceContainerText: {
|
|
70
|
-
id: 'ptc-directory.team-profile-page.team-containers.space-container-text
|
|
70
|
+
id: 'ptc-directory.team-profile-page.team-containers.space-container-text',
|
|
71
71
|
defaultMessage: 'space',
|
|
72
72
|
description: 'Text for space type containers'
|
|
73
73
|
},
|
|
74
74
|
emptyWebLinkContainerDescription: {
|
|
75
|
-
id: 'platform.teams.containers.empty-web-link-description
|
|
75
|
+
id: 'platform.teams.containers.empty-web-link-description',
|
|
76
76
|
defaultMessage: 'Add any web link',
|
|
77
77
|
description: 'Description displayed on the empty card for adding a web link to a team'
|
|
78
78
|
},
|
|
79
79
|
webLinkContainerDescription: {
|
|
80
|
-
id: 'platform.teams.containers.web-link-title-description
|
|
80
|
+
id: 'platform.teams.containers.web-link-title-description',
|
|
81
81
|
defaultMessage: 'Web link',
|
|
82
82
|
description: 'Description displayed for web link containers in team profile'
|
|
83
83
|
}
|
|
@@ -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
|
+
};
|
|
@@ -10,27 +10,32 @@ import { Box, Stack } from '@atlaskit/primitives/compiled';
|
|
|
10
10
|
import { getContainerProperties } from '../../../common/utils/get-container-properties';
|
|
11
11
|
export var messages = defineMessages({
|
|
12
12
|
disconnectDialogTitle: {
|
|
13
|
-
id: 'ptc-directory.team-profile-page.team-containers.disconnect-dialog.title
|
|
13
|
+
id: 'ptc-directory.team-profile-page.team-containers.disconnect-dialog.title',
|
|
14
14
|
defaultMessage: 'Disconnect place',
|
|
15
15
|
description: 'Title of the disconnect dialog for team containers'
|
|
16
16
|
},
|
|
17
17
|
disconnectDialogDescription: {
|
|
18
|
-
id: 'ptc-directory.team-profile-page.team-containers.disconnect-dialog.description
|
|
18
|
+
id: 'ptc-directory.team-profile-page.team-containers.disconnect-dialog.description',
|
|
19
19
|
defaultMessage: 'This team will no longer be connected to the {containerName} {containerType}.',
|
|
20
20
|
description: 'Description of the disconnect dialog for team containers'
|
|
21
21
|
},
|
|
22
22
|
disconnectDialogDisclaimer: {
|
|
23
|
-
id: 'ptc-directory.team-profile-page.team-containers.disconnect-dialog.disclaimer
|
|
23
|
+
id: 'ptc-directory.team-profile-page.team-containers.disconnect-dialog.disclaimer',
|
|
24
24
|
defaultMessage: 'Disconnecting the team from the {containerType} will not affect any work connected to the team within the {containerType}.',
|
|
25
25
|
description: 'Disclaimer of the disconnect dialog for team containers'
|
|
26
26
|
},
|
|
27
|
+
disconnectDialogDisclaimerFallback: {
|
|
28
|
+
id: 'ptc-directory.team-profile-page.team-containers.disconnect-dialog.disclaimer-fallback',
|
|
29
|
+
defaultMessage: 'Disconnecting the team from the link will not affect any work connected to the team.',
|
|
30
|
+
description: 'Disclaimer shown for web links when disconnecting team containers'
|
|
31
|
+
},
|
|
27
32
|
disconnectDialogCancelButton: {
|
|
28
|
-
id: 'ptc-directory.team-profile-page.team-containers.disconnect-dialog.cancel-button
|
|
33
|
+
id: 'ptc-directory.team-profile-page.team-containers.disconnect-dialog.cancel-button',
|
|
29
34
|
defaultMessage: 'Cancel',
|
|
30
35
|
description: 'Button to cancel the dialog'
|
|
31
36
|
},
|
|
32
37
|
disconnectDialogRemoveButton: {
|
|
33
|
-
id: 'ptc-directory.team-profile-page.team-containers.disconnect-dialog.remove-button
|
|
38
|
+
id: 'ptc-directory.team-profile-page.team-containers.disconnect-dialog.remove-button',
|
|
34
39
|
defaultMessage: 'Remove',
|
|
35
40
|
description: 'Button to disconnect the team from the container'
|
|
36
41
|
}
|
|
@@ -83,11 +88,11 @@ export var DisconnectDialog = function DisconnectDialog(_ref) {
|
|
|
83
88
|
containerName: /*#__PURE__*/React.createElement("b", null, containerName),
|
|
84
89
|
containerType: /*#__PURE__*/React.createElement(React.Fragment, null, description, " ", containerTypeText)
|
|
85
90
|
}
|
|
86
|
-
}))), /*#__PURE__*/React.createElement(FormattedMessage, _extends({}, messages.disconnectDialogDisclaimer, {
|
|
91
|
+
}))), containerTypeText ? /*#__PURE__*/React.createElement(FormattedMessage, _extends({}, messages.disconnectDialogDisclaimer, {
|
|
87
92
|
values: {
|
|
88
93
|
containerType: containerTypeText
|
|
89
94
|
}
|
|
90
|
-
})))), /*#__PURE__*/React.createElement(ModalFooter, null, /*#__PURE__*/React.createElement(Button, {
|
|
95
|
+
})) : /*#__PURE__*/React.createElement(FormattedMessage, messages.disconnectDialogDisclaimerFallback))), /*#__PURE__*/React.createElement(ModalFooter, null, /*#__PURE__*/React.createElement(Button, {
|
|
91
96
|
appearance: "subtle",
|
|
92
97
|
onClick: onClose
|
|
93
98
|
}, /*#__PURE__*/React.createElement(FormattedMessage, messages.disconnectDialogCancelButton)), /*#__PURE__*/React.createElement(Button, {
|
|
@@ -337,12 +337,12 @@ export var TeamContainers = function TeamContainers(_ref) {
|
|
|
337
337
|
};
|
|
338
338
|
var messages = defineMessages({
|
|
339
339
|
showMore: {
|
|
340
|
-
id: 'ptc-directory.team-profile-page.team-containers.show-more
|
|
340
|
+
id: 'ptc-directory.team-profile-page.team-containers.show-more',
|
|
341
341
|
defaultMessage: 'Show more',
|
|
342
342
|
description: 'Button to show more containers'
|
|
343
343
|
},
|
|
344
344
|
showLess: {
|
|
345
|
-
id: 'ptc-directory.team-profile-page.team-containers.show-less
|
|
345
|
+
id: 'ptc-directory.team-profile-page.team-containers.show-less',
|
|
346
346
|
defaultMessage: 'Show less',
|
|
347
347
|
description: 'Button to show less containers'
|
|
348
348
|
}
|
|
@@ -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;
|
|
@@ -16,6 +16,11 @@ export declare const messages: {
|
|
|
16
16
|
defaultMessage: string;
|
|
17
17
|
description: string;
|
|
18
18
|
};
|
|
19
|
+
disconnectDialogDisclaimerFallback: {
|
|
20
|
+
id: string;
|
|
21
|
+
defaultMessage: string;
|
|
22
|
+
description: string;
|
|
23
|
+
};
|
|
19
24
|
disconnectDialogCancelButton: {
|
|
20
25
|
id: string;
|
|
21
26
|
defaultMessage: 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;
|
|
@@ -16,6 +16,11 @@ export declare const messages: {
|
|
|
16
16
|
defaultMessage: string;
|
|
17
17
|
description: string;
|
|
18
18
|
};
|
|
19
|
+
disconnectDialogDisclaimerFallback: {
|
|
20
|
+
id: string;
|
|
21
|
+
defaultMessage: string;
|
|
22
|
+
description: string;
|
|
23
|
+
};
|
|
19
24
|
disconnectDialogCancelButton: {
|
|
20
25
|
id: string;
|
|
21
26
|
defaultMessage: string;
|
package/package.json
CHANGED
|
@@ -33,8 +33,8 @@
|
|
|
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.
|
|
37
|
-
"@atlaskit/dropdown-menu": "^16.
|
|
36
|
+
"@atlaskit/css": "^0.11.0",
|
|
37
|
+
"@atlaskit/dropdown-menu": "^16.1.0",
|
|
38
38
|
"@atlaskit/feature-gate-js-client": "^5.3.0",
|
|
39
39
|
"@atlaskit/heading": "^5.2.0",
|
|
40
40
|
"@atlaskit/icon": "^27.0.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.0",
|
|
118
118
|
"description": "Public components related to teams",
|
|
119
119
|
"author": "Atlassian Pty Ltd",
|
|
120
120
|
"license": "Apache-2.0",
|