@atlaskit/share 0.28.0 → 0.31.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 +25 -0
- package/dist/cjs/clients/ShareServiceClient.js +0 -23
- package/dist/cjs/components/CopyLinkButton.js +24 -13
- package/dist/cjs/components/ShareDialogContainer.js +10 -44
- package/dist/cjs/components/ShareDialogWithTrigger.js +28 -41
- package/dist/cjs/components/ShareForm.js +6 -12
- package/dist/cjs/components/ShareHeader.js +1 -3
- package/dist/cjs/components/UserPickerField.js +18 -52
- package/dist/cjs/components/analytics.js +4 -4
- package/dist/cjs/components/styles.js +2 -4
- package/dist/cjs/components/utils.js +4 -136
- package/dist/cjs/i18n/en_ZZ.js +45 -0
- package/dist/cjs/i18n/index.js +58 -50
- package/dist/cjs/i18n.js +2 -22
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/clients/ShareServiceClient.js +0 -22
- package/dist/es2019/components/CopyLinkButton.js +25 -11
- package/dist/es2019/components/ShareDialogContainer.js +8 -43
- package/dist/es2019/components/ShareDialogWithTrigger.js +27 -39
- package/dist/es2019/components/ShareForm.js +6 -11
- package/dist/es2019/components/ShareHeader.js +3 -4
- package/dist/es2019/components/UserPickerField.js +18 -51
- package/dist/es2019/components/analytics.js +3 -3
- package/dist/es2019/components/styles.js +2 -3
- package/dist/es2019/components/utils.js +2 -95
- package/dist/es2019/i18n/en_ZZ.js +37 -0
- package/dist/es2019/i18n/index.js +10 -9
- package/dist/es2019/i18n.js +2 -22
- package/dist/es2019/version.json +1 -1
- package/dist/esm/clients/ShareServiceClient.js +0 -23
- package/dist/esm/components/CopyLinkButton.js +24 -13
- package/dist/esm/components/ShareDialogContainer.js +9 -43
- package/dist/esm/components/ShareDialogWithTrigger.js +30 -43
- package/dist/esm/components/ShareForm.js +6 -11
- package/dist/esm/components/ShareHeader.js +1 -2
- package/dist/esm/components/UserPickerField.js +19 -53
- package/dist/esm/components/analytics.js +4 -4
- package/dist/esm/components/styles.js +2 -3
- package/dist/esm/components/utils.js +3 -125
- package/dist/esm/i18n/en_ZZ.js +37 -0
- package/dist/esm/i18n/index.js +10 -9
- package/dist/esm/i18n.js +2 -22
- package/dist/esm/version.json +1 -1
- package/dist/types/clients/ShareServiceClient.d.ts +1 -13
- package/dist/types/components/CopyLinkButton.d.ts +3 -0
- package/dist/types/components/ShareDialogContainer.d.ts +4 -12
- package/dist/types/components/ShareDialogWithTrigger.d.ts +4 -5
- package/dist/types/components/ShareForm.d.ts +3 -5
- package/dist/types/components/UserPickerField.d.ts +1 -5
- package/dist/types/components/analytics.d.ts +2 -2
- package/dist/types/components/styles.d.ts +1 -1
- package/dist/types/components/utils.d.ts +2 -23
- package/dist/types/i18n/en_ZZ.d.ts +37 -0
- package/dist/types/i18n/index.d.ts +10 -9
- package/dist/types/i18n.d.ts +2 -22
- package/dist/types/index.d.ts +1 -1
- package/dist/types/types/Products.d.ts +1 -1
- package/dist/types/types/index.d.ts +1 -1
- package/package.json +6 -6
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* NOTE:
|
|
3
|
+
*
|
|
4
|
+
* This file is automatically generated by i18n-tools.
|
|
5
|
+
* DO NOT CHANGE IT BY HAND or your changes will be lost.
|
|
6
|
+
*/
|
|
7
|
+
// English (Instrumented)
|
|
8
|
+
export default {
|
|
9
|
+
'fabric.elements.share.copied.to.clipboard.icon.label': 'Copy link success icon',
|
|
10
|
+
'fabric.elements.share.copied.to.clipboard.message': 'Link copied to clipboard',
|
|
11
|
+
'fabric.elements.share.copylink.button.icon.label': 'Copy link icon',
|
|
12
|
+
'fabric.elements.share.copylink.button.text': 'Copy link',
|
|
13
|
+
'fabric.elements.share.copypubliclink.button.text': 'Copy public link',
|
|
14
|
+
'fabric.elements.share.failure.icon.label': 'Error icon',
|
|
15
|
+
'fabric.elements.share.failure.message': 'Unable to share',
|
|
16
|
+
'fabric.elements.share.form.comment.placeholder': 'Add a message',
|
|
17
|
+
'fabric.elements.share.form.info.message.no.invite.confluence': 'Recipients will see the name of the page and your message',
|
|
18
|
+
'fabric.elements.share.form.info.message.no.invite.jira': 'Recipients will see the name of the issue and your message',
|
|
19
|
+
'fabric.elements.share.form.public.send': 'Send public link',
|
|
20
|
+
'fabric.elements.share.form.retry': 'Retry',
|
|
21
|
+
'fabric.elements.share.form.send': 'Send',
|
|
22
|
+
'fabric.elements.share.form.title': 'Share',
|
|
23
|
+
'fabric.elements.share.form.user-picker.add-more': 'Enter more',
|
|
24
|
+
'fabric.elements.share.form.user-picker.no-options.existingUserOnly': 'We couldn’t find any results for "{inputValue}".',
|
|
25
|
+
'fabric.elements.share.form.user-picker.no-options.generic': 'We couldn’t find any results for "{inputValue}". Invite people by using an email address.',
|
|
26
|
+
'fabric.elements.share.form.user-picker.placeholder.existingUserOnly': 'Enter name or team',
|
|
27
|
+
'fabric.elements.share.form.user-picker.placeholder.generic': 'Enter name, group, team or email',
|
|
28
|
+
'fabric.elements.share.form.user-picker.placeholder.jira': 'Enter name, team or email',
|
|
29
|
+
'fabric.elements.share.form.user-picker.validation.required': 'Select at least one user, group, team or email.',
|
|
30
|
+
'fabric.elements.share.form.user-picker.validation.required.jira': 'Select at least one user, team or email.',
|
|
31
|
+
'fabric.elements.share.success.message': '{object, select, blogpost {Blog post shared} board {Board shared} calendar {Calendar shared} draft {Draft shared} filter {Filter shared} issue {Issue shared} media {Media shared} page {Page shared} project {Project shared} pullrequest {Pull Request shared} question {Question shared} report {Report shared} repository {Repository shared} request {Request shared} roadmap {Roadmap shared} site {Site shared} space {Space shared} other {Link Shared}}',
|
|
32
|
+
'fabric.elements.share.to.integration.button': 'Share to {integrationName}',
|
|
33
|
+
'fabric.elements.share.trigger.button.icon.label': 'Share icon',
|
|
34
|
+
'fabric.elements.share.trigger.button.invite.text': 'Invite',
|
|
35
|
+
'fabric.elements.share.trigger.button.text': 'Share',
|
|
36
|
+
'fabric.elements.share.trigger.button.tooltip.text': 'Share'
|
|
37
|
+
};
|
|
@@ -4,32 +4,33 @@
|
|
|
4
4
|
* This file is automatically generated by i18n-tools.
|
|
5
5
|
* DO NOT CHANGE IT BY HAND or your changes will be lost.
|
|
6
6
|
*/
|
|
7
|
-
export { default as
|
|
8
|
-
export { default as zh_TW } from './zh_TW';
|
|
7
|
+
export { default as en_ZZ } from './en_ZZ';
|
|
9
8
|
export { default as cs } from './cs';
|
|
10
9
|
export { default as da } from './da';
|
|
11
|
-
export { default as
|
|
10
|
+
export { default as de } from './de';
|
|
11
|
+
export { default as en } from './en';
|
|
12
|
+
export { default as en_GB } from './en_GB';
|
|
13
|
+
export { default as es } from './es';
|
|
12
14
|
export { default as et } from './et';
|
|
13
15
|
export { default as fi } from './fi';
|
|
14
16
|
export { default as fr } from './fr';
|
|
15
|
-
export { default as de } from './de';
|
|
16
17
|
export { default as hu } from './hu';
|
|
18
|
+
export { default as is } from './is';
|
|
17
19
|
export { default as it } from './it';
|
|
18
20
|
export { default as ja } from './ja';
|
|
19
21
|
export { default as ko } from './ko';
|
|
20
22
|
export { default as nb } from './nb';
|
|
23
|
+
export { default as nl } from './nl';
|
|
21
24
|
export { default as pl } from './pl';
|
|
22
25
|
export { default as pt_BR } from './pt_BR';
|
|
23
26
|
export { default as pt_PT } from './pt_PT';
|
|
27
|
+
export { default as ro } from './ro';
|
|
24
28
|
export { default as ru } from './ru';
|
|
25
29
|
export { default as sk } from './sk';
|
|
26
|
-
export { default as es } from './es';
|
|
27
30
|
export { default as sv } from './sv';
|
|
28
31
|
export { default as th } from './th';
|
|
29
32
|
export { default as tr } from './tr';
|
|
30
33
|
export { default as uk } from './uk';
|
|
31
34
|
export { default as vi } from './vi';
|
|
32
|
-
export { default as
|
|
33
|
-
export { default as
|
|
34
|
-
export { default as is } from './is';
|
|
35
|
-
export { default as ro } from './ro';
|
|
35
|
+
export { default as zh } from './zh';
|
|
36
|
+
export { default as zh_TW } from './zh_TW';
|
package/dist/es2019/i18n.js
CHANGED
|
@@ -55,11 +55,6 @@ export const messages = defineMessages({
|
|
|
55
55
|
defaultMessage: 'Select at least one user, team or email.',
|
|
56
56
|
description: 'Required error message for the user picker field in Share form. ' + 'This message is used only for Jira product because Jira does not have Group concept.'
|
|
57
57
|
},
|
|
58
|
-
userPickerDomainBasedUserOnlyNoOptionsMessage: {
|
|
59
|
-
id: 'fabric.elements.share.form.user-picker.no-options.domainBasedUserOnly',
|
|
60
|
-
defaultMessage: `You can only invite people with {domains} email addresses. Contact your site admin to invite other people.`,
|
|
61
|
-
description: 'Domain based user only no options message displayed when the search for users returns empty.'
|
|
62
|
-
},
|
|
63
58
|
userPickerExistingUserOnlyNoOptionsMessage: {
|
|
64
59
|
id: 'fabric.elements.share.form.user-picker.no-options.existingUserOnly',
|
|
65
60
|
defaultMessage: `We couldn’t find any results for "{inputValue}".`,
|
|
@@ -115,22 +110,12 @@ export const messages = defineMessages({
|
|
|
115
110
|
defaultMessage: 'Link copied to clipboard',
|
|
116
111
|
description: 'Default text for the copied link message'
|
|
117
112
|
},
|
|
118
|
-
|
|
119
|
-
id: 'fabric.elements.share.form.info.message.pending.invite',
|
|
120
|
-
defaultMessage: 'Your invite will be sent to an admin for approval',
|
|
121
|
-
description: 'Info text when at least one invite will be sent to an admin for approval'
|
|
122
|
-
},
|
|
123
|
-
infoMessageDirectInvite: {
|
|
124
|
-
id: 'fabric.elements.share.form.info.message.direct.invite',
|
|
125
|
-
defaultMessage: 'People without access will be sent an invitation to join',
|
|
126
|
-
description: 'Info text when invitees will invited directly'
|
|
127
|
-
},
|
|
128
|
-
infoMessageNoInviteConfluence: {
|
|
113
|
+
infoMessageDefaultConfluence: {
|
|
129
114
|
id: 'fabric.elements.share.form.info.message.no.invite.confluence',
|
|
130
115
|
defaultMessage: 'Recipients will see the name of the page and your message',
|
|
131
116
|
description: 'Message indicating the recipients of the email share will be able to see the Confluence page title and the included message'
|
|
132
117
|
},
|
|
133
|
-
|
|
118
|
+
infoMessageDefaultJira: {
|
|
134
119
|
id: 'fabric.elements.share.form.info.message.no.invite.jira',
|
|
135
120
|
defaultMessage: 'Recipients will see the name of the issue and your message',
|
|
136
121
|
description: 'Message indicating the recipients of the email share will be able to see the Jira issue title and the included message'
|
|
@@ -151,11 +136,6 @@ export const messages = defineMessages({
|
|
|
151
136
|
'filter {Filter shared}' + 'issue {Issue shared}' + 'media {Media shared}' + 'page {Page shared}' + 'project {Project shared}' + 'pullrequest {Pull Request shared}' + 'question {Question shared}' + 'report {Report shared}' + 'repository {Repository shared}' + 'request {Request shared}' + 'roadmap {Roadmap shared}' + 'site {Site shared}' + 'space {Space shared}' + 'other {Link Shared}' + '}',
|
|
152
137
|
description: 'Default text for share success message displayed in a flag'
|
|
153
138
|
},
|
|
154
|
-
adminNotifiedMessage: {
|
|
155
|
-
id: 'fabric.elements.share.admin.notified.message',
|
|
156
|
-
defaultMessage: 'Your admin has been notified',
|
|
157
|
-
description: 'Default text for admin notified message displayed in a flag when a share action is successful'
|
|
158
|
-
},
|
|
159
139
|
shareToIntegrationButtonText: {
|
|
160
140
|
id: 'fabric.elements.share.to.integration.button',
|
|
161
141
|
defaultMessage: 'Share to {integrationName}',
|
package/dist/es2019/version.json
CHANGED
|
@@ -7,7 +7,6 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
7
7
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
8
8
|
|
|
9
9
|
import { utils } from '@atlaskit/util-service-support';
|
|
10
|
-
// show direct invite info message if email options
|
|
11
10
|
export var DEFAULT_SHARE_PATH = 'share';
|
|
12
11
|
export var SHARE_CONFIG_PATH = 'share/config';
|
|
13
12
|
export var DEFAULT_SHARE_SERVICE_URL = '/gateway/api';
|
|
@@ -44,28 +43,6 @@ export var ShareServiceClient = /*#__PURE__*/function () {
|
|
|
44
43
|
};
|
|
45
44
|
return utils.requestService(this.serviceConfig, options);
|
|
46
45
|
}
|
|
47
|
-
}, {
|
|
48
|
-
key: "getConfig",
|
|
49
|
-
value: function getConfig(product, cloudId) {
|
|
50
|
-
if (this.serviceConfig.disableInviteCapabilities) {
|
|
51
|
-
return Promise.resolve({
|
|
52
|
-
mode: 'ANYONE',
|
|
53
|
-
allowComment: true
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
var options = {
|
|
58
|
-
path: SHARE_CONFIG_PATH,
|
|
59
|
-
queryParams: {
|
|
60
|
-
product: product,
|
|
61
|
-
cloudId: cloudId
|
|
62
|
-
},
|
|
63
|
-
requestInit: {
|
|
64
|
-
method: 'get'
|
|
65
|
-
}
|
|
66
|
-
};
|
|
67
|
-
return utils.requestService(this.serviceConfig, options);
|
|
68
|
-
}
|
|
69
46
|
}]);
|
|
70
47
|
|
|
71
48
|
return ShareServiceClient;
|
|
@@ -19,6 +19,7 @@ import LinkFilledIcon from '@atlaskit/icon/glyph/link-filled';
|
|
|
19
19
|
import Popup from '@atlaskit/popup';
|
|
20
20
|
import { G300 } from '@atlaskit/theme/colors';
|
|
21
21
|
import { layers } from '@atlaskit/theme/constants';
|
|
22
|
+
import Tooltip from '@atlaskit/tooltip';
|
|
22
23
|
import React from 'react';
|
|
23
24
|
import { FormattedMessage, injectIntl } from 'react-intl';
|
|
24
25
|
import styled from 'styled-components';
|
|
@@ -100,6 +101,22 @@ export var CopyLinkButton = /*#__PURE__*/function (_React$Component) {
|
|
|
100
101
|
});
|
|
101
102
|
});
|
|
102
103
|
|
|
104
|
+
_defineProperty(_assertThisInitialized(_this), "renderTriggerButton", function (triggerProps) {
|
|
105
|
+
var _this$props = _this.props,
|
|
106
|
+
formatMessage = _this$props.intl.formatMessage,
|
|
107
|
+
isDisabled = _this$props.isDisabled,
|
|
108
|
+
isPublicLink = _this$props.isPublicLink;
|
|
109
|
+
return /*#__PURE__*/React.createElement(Button, _extends({
|
|
110
|
+
isDisabled: isDisabled,
|
|
111
|
+
appearance: "subtle-link",
|
|
112
|
+
iconBefore: /*#__PURE__*/React.createElement(LinkFilledIcon, {
|
|
113
|
+
label: formatMessage(messages.copyLinkButtonIconLabel),
|
|
114
|
+
size: "medium"
|
|
115
|
+
}),
|
|
116
|
+
onClick: _this.handleClick
|
|
117
|
+
}, triggerProps), /*#__PURE__*/React.createElement(FormattedMessage, isPublicLink ? messages.copyPublicLinkButtonText : messages.copyLinkButtonText));
|
|
118
|
+
});
|
|
119
|
+
|
|
103
120
|
return _this;
|
|
104
121
|
}
|
|
105
122
|
|
|
@@ -114,10 +131,9 @@ export var CopyLinkButton = /*#__PURE__*/function (_React$Component) {
|
|
|
114
131
|
var _this2 = this;
|
|
115
132
|
|
|
116
133
|
var shouldShowCopiedMessage = this.state.shouldShowCopiedMessage;
|
|
117
|
-
var _this$
|
|
118
|
-
formatMessage = _this$
|
|
119
|
-
|
|
120
|
-
isPublicLink = _this$props.isPublicLink;
|
|
134
|
+
var _this$props2 = this.props,
|
|
135
|
+
formatMessage = _this$props2.intl.formatMessage,
|
|
136
|
+
copyTooltipText = _this$props2.copyTooltipText;
|
|
121
137
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(HiddenInput, {
|
|
122
138
|
ref: this.inputRef,
|
|
123
139
|
text: this.props.link
|
|
@@ -133,15 +149,10 @@ export var CopyLinkButton = /*#__PURE__*/function (_React$Component) {
|
|
|
133
149
|
onClose: this.handleDismissCopiedMessage,
|
|
134
150
|
placement: "top-start",
|
|
135
151
|
trigger: function trigger(triggerProps) {
|
|
136
|
-
return /*#__PURE__*/React.createElement(
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
label: formatMessage(messages.copyLinkButtonIconLabel),
|
|
141
|
-
size: "medium"
|
|
142
|
-
}),
|
|
143
|
-
onClick: _this2.handleClick
|
|
144
|
-
}, triggerProps), /*#__PURE__*/React.createElement(FormattedMessage, isPublicLink ? messages.copyPublicLinkButtonText : messages.copyLinkButtonText));
|
|
152
|
+
return copyTooltipText ? /*#__PURE__*/React.createElement(Tooltip, {
|
|
153
|
+
content: copyTooltipText,
|
|
154
|
+
position: "bottom-start"
|
|
155
|
+
}, _this2.renderTriggerButton(triggerProps)) : _this2.renderTriggerButton(triggerProps);
|
|
145
156
|
}
|
|
146
157
|
}));
|
|
147
158
|
}
|
|
@@ -31,10 +31,6 @@ import { optionDataToUsers } from './utils';
|
|
|
31
31
|
import ErrorBoundary from './ErrorBoundary';
|
|
32
32
|
import deepEqual from 'fast-deep-equal';
|
|
33
33
|
var COPY_LINK_EVENT = copyLinkButtonClicked(0);
|
|
34
|
-
export var defaultConfig = {
|
|
35
|
-
mode: 'EXISTING_USERS_ONLY',
|
|
36
|
-
allowComment: false
|
|
37
|
-
};
|
|
38
34
|
var memoizedFormatCopyLink = memoizeOne(function (origin, link) {
|
|
39
35
|
return origin.addToUrl(link);
|
|
40
36
|
});
|
|
@@ -74,28 +70,6 @@ export var ShareDialogContainerInternal = /*#__PURE__*/function (_React$Componen
|
|
|
74
70
|
}
|
|
75
71
|
});
|
|
76
72
|
|
|
77
|
-
_defineProperty(_assertThisInitialized(_this), "fetchConfig", function () {
|
|
78
|
-
_this.setState({
|
|
79
|
-
isFetchingConfig: true
|
|
80
|
-
}, function () {
|
|
81
|
-
_this.shareClient.getConfig(_this.props.productId, _this.props.cloudId).then(function (config) {
|
|
82
|
-
if (_this._isMounted) {
|
|
83
|
-
_this.setState({
|
|
84
|
-
config: config,
|
|
85
|
-
isFetchingConfig: false
|
|
86
|
-
});
|
|
87
|
-
}
|
|
88
|
-
}).catch(function () {
|
|
89
|
-
if (_this._isMounted) {
|
|
90
|
-
_this.setState({
|
|
91
|
-
config: defaultConfig,
|
|
92
|
-
isFetchingConfig: false
|
|
93
|
-
});
|
|
94
|
-
}
|
|
95
|
-
});
|
|
96
|
-
});
|
|
97
|
-
});
|
|
98
|
-
|
|
99
73
|
_defineProperty(_assertThisInitialized(_this), "handleSubmitShare", function (_ref) {
|
|
100
74
|
var users = _ref.users,
|
|
101
75
|
comment = _ref.comment;
|
|
@@ -146,12 +120,9 @@ export var ShareDialogContainerInternal = /*#__PURE__*/function (_React$Componen
|
|
|
146
120
|
currentPageUrl: getCurrentPageUrl()
|
|
147
121
|
}, function () {
|
|
148
122
|
_this.updateShortCopyLink();
|
|
149
|
-
});
|
|
150
|
-
|
|
123
|
+
});
|
|
151
124
|
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
case 3:
|
|
125
|
+
case 2:
|
|
155
126
|
case "end":
|
|
156
127
|
return _context.stop();
|
|
157
128
|
}
|
|
@@ -208,14 +179,10 @@ export var ShareDialogContainerInternal = /*#__PURE__*/function (_React$Componen
|
|
|
208
179
|
});
|
|
209
180
|
|
|
210
181
|
assert(!props.client, 'elements/share: Breaking change, please update your props!');
|
|
211
|
-
_this.shareClient = props.shareClient || new ShareServiceClient(
|
|
212
|
-
disableInviteCapabilities: !!props.disableInviteCapabilities
|
|
213
|
-
});
|
|
182
|
+
_this.shareClient = props.shareClient || new ShareServiceClient();
|
|
214
183
|
_this.urlShortenerClient = props.urlShortenerClient || new AtlassianUrlShortenerClient();
|
|
215
184
|
_this.state = {
|
|
216
185
|
shareActionCount: 0,
|
|
217
|
-
config: defaultConfig,
|
|
218
|
-
isFetchingConfig: false,
|
|
219
186
|
currentPageUrl: getCurrentPageUrl(),
|
|
220
187
|
shortenedCopyLink: null
|
|
221
188
|
};
|
|
@@ -366,7 +333,6 @@ export var ShareDialogContainerInternal = /*#__PURE__*/function (_React$Componen
|
|
|
366
333
|
shouldCloseOnEscapePress = _this$props2.shouldCloseOnEscapePress,
|
|
367
334
|
showFlags = _this$props2.showFlags,
|
|
368
335
|
enableSmartUserPicker = _this$props2.enableSmartUserPicker,
|
|
369
|
-
disableInviteCapabilities = _this$props2.disableInviteCapabilities,
|
|
370
336
|
loggedInAccountId = _this$props2.loggedInAccountId,
|
|
371
337
|
triggerButtonAppearance = _this$props2.triggerButtonAppearance,
|
|
372
338
|
triggerButtonIcon = _this$props2.triggerButtonIcon,
|
|
@@ -384,16 +350,15 @@ export var ShareDialogContainerInternal = /*#__PURE__*/function (_React$Componen
|
|
|
384
350
|
isPublicLink = _this$props2.isPublicLink,
|
|
385
351
|
shareIntegrations = _this$props2.shareIntegrations,
|
|
386
352
|
shareAri = _this$props2.shareAri,
|
|
387
|
-
tabIndex = _this$props2.tabIndex
|
|
388
|
-
|
|
353
|
+
tabIndex = _this$props2.tabIndex,
|
|
354
|
+
copyTooltipText = _this$props2.copyTooltipText,
|
|
355
|
+
onDialogClose = _this$props2.onDialogClose;
|
|
389
356
|
return /*#__PURE__*/React.createElement(ErrorBoundary, null, /*#__PURE__*/React.createElement(MessagesIntlProvider, null, /*#__PURE__*/React.createElement(ShareDialogWithTrigger, {
|
|
390
357
|
onTriggerButtonClick: onTriggerButtonClick,
|
|
391
358
|
isAutoOpenDialog: isAutoOpenDialog,
|
|
392
|
-
config: this.state.config,
|
|
393
359
|
copyLink: this.getCopyLink(),
|
|
394
360
|
analyticsDecorator: this.decorateAnalytics,
|
|
395
361
|
dialogPlacement: dialogPlacement,
|
|
396
|
-
isFetchingConfig: isFetchingConfig,
|
|
397
362
|
loadUserOptions: loadUserOptions,
|
|
398
363
|
onDialogOpen: this.handleDialogOpen,
|
|
399
364
|
onShareSubmit: this.handleSubmitShare,
|
|
@@ -406,7 +371,6 @@ export var ShareDialogContainerInternal = /*#__PURE__*/function (_React$Componen
|
|
|
406
371
|
shouldCloseOnEscapePress: shouldCloseOnEscapePress,
|
|
407
372
|
showFlags: showFlags,
|
|
408
373
|
enableSmartUserPicker: enableSmartUserPicker,
|
|
409
|
-
disableInviteCapabilities: disableInviteCapabilities,
|
|
410
374
|
loggedInAccountId: loggedInAccountId,
|
|
411
375
|
cloudId: cloudId,
|
|
412
376
|
triggerButtonAppearance: triggerButtonAppearance,
|
|
@@ -424,7 +388,9 @@ export var ShareDialogContainerInternal = /*#__PURE__*/function (_React$Componen
|
|
|
424
388
|
isPublicLink: isPublicLink,
|
|
425
389
|
shareIntegrations: shareIntegrations,
|
|
426
390
|
shareAri: shareAri,
|
|
427
|
-
tabIndex: tabIndex
|
|
391
|
+
tabIndex: tabIndex,
|
|
392
|
+
copyTooltipText: copyTooltipText,
|
|
393
|
+
onDialogClose: onDialogClose
|
|
428
394
|
})));
|
|
429
395
|
}
|
|
430
396
|
}]);
|
|
@@ -29,11 +29,11 @@ import React from 'react';
|
|
|
29
29
|
import { FormattedMessage, injectIntl } from 'react-intl';
|
|
30
30
|
import styled from 'styled-components';
|
|
31
31
|
import { messages } from '../i18n';
|
|
32
|
-
import {
|
|
32
|
+
import { OBJECT_SHARED } from '../types';
|
|
33
33
|
import { cancelShare, CHANNEL_ID, copyLinkButtonClicked, formShareSubmitted, screenEvent, shareTriggerButtonClicked, shareSplitButtonEvent, ANALYTICS_SOURCE } from './analytics';
|
|
34
34
|
import ShareButton from './ShareButton';
|
|
35
35
|
import { ShareForm } from './ShareForm';
|
|
36
|
-
import {
|
|
36
|
+
import { generateSelectZIndex } from './utils';
|
|
37
37
|
import { InlineDialogContentWrapper } from './styles';
|
|
38
38
|
import { IntegrationForm } from './IntegrationForm';
|
|
39
39
|
var ShareButtonWrapper = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: inline-flex;\n outline: none;\n"])));
|
|
@@ -89,17 +89,23 @@ export var ShareDialogWithTriggerInternal = /*#__PURE__*/function (_React$PureCo
|
|
|
89
89
|
selectedIntegration: null
|
|
90
90
|
});
|
|
91
91
|
|
|
92
|
-
var
|
|
92
|
+
var _this$props = _this.props,
|
|
93
|
+
onUserSelectionChange = _this$props.onUserSelectionChange,
|
|
94
|
+
onDialogClose = _this$props.onDialogClose;
|
|
93
95
|
|
|
94
96
|
if (onUserSelectionChange) {
|
|
95
97
|
onUserSelectionChange(defaultShareContentState.users);
|
|
96
98
|
}
|
|
99
|
+
|
|
100
|
+
if (onDialogClose) {
|
|
101
|
+
onDialogClose();
|
|
102
|
+
}
|
|
97
103
|
});
|
|
98
104
|
|
|
99
105
|
_defineProperty(_assertThisInitialized(_this), "createAndFireEvent", function (payload) {
|
|
100
|
-
var _this$
|
|
101
|
-
createAnalyticsEvent = _this$
|
|
102
|
-
analyticsDecorator = _this$
|
|
106
|
+
var _this$props2 = _this.props,
|
|
107
|
+
createAnalyticsEvent = _this$props2.createAnalyticsEvent,
|
|
108
|
+
analyticsDecorator = _this$props2.analyticsDecorator;
|
|
103
109
|
|
|
104
110
|
if (analyticsDecorator) {
|
|
105
111
|
payload = analyticsDecorator(payload);
|
|
@@ -110,26 +116,14 @@ export var ShareDialogWithTriggerInternal = /*#__PURE__*/function (_React$PureCo
|
|
|
110
116
|
}
|
|
111
117
|
});
|
|
112
118
|
|
|
113
|
-
_defineProperty(_assertThisInitialized(_this), "getFlags", function (
|
|
114
|
-
var
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
var flags = [];
|
|
120
|
-
var shouldShowAdminNotifiedFlag = showAdminNotifiedFlag(config, data.users, isPublicLink, disableInviteCapabilities);
|
|
121
|
-
|
|
122
|
-
if (shouldShowAdminNotifiedFlag) {
|
|
123
|
-
flags.push({
|
|
124
|
-
appearance: 'success',
|
|
125
|
-
title: _objectSpread(_objectSpread({}, messages.adminNotifiedMessage), {}, {
|
|
126
|
-
defaultMessage: formatMessage(messages.adminNotifiedMessage)
|
|
127
|
-
}),
|
|
128
|
-
type: ADMIN_NOTIFIED
|
|
129
|
-
});
|
|
130
|
-
}
|
|
119
|
+
_defineProperty(_assertThisInitialized(_this), "getFlags", function () {
|
|
120
|
+
var formatMessage = _this.props.intl.formatMessage; // The reason for providing message property is that in jira,
|
|
121
|
+
// the Flag system takes only Message Descriptor as payload
|
|
122
|
+
// and formatMessage is called for every flag
|
|
123
|
+
// if the translation data is not provided, a translated default message
|
|
124
|
+
// will be displayed
|
|
131
125
|
|
|
132
|
-
|
|
126
|
+
return [{
|
|
133
127
|
appearance: 'success',
|
|
134
128
|
title: _objectSpread(_objectSpread({}, messages.shareSuccessMessage), {}, {
|
|
135
129
|
defaultMessage: formatMessage(messages.shareSuccessMessage, {
|
|
@@ -137,13 +131,7 @@ export var ShareDialogWithTriggerInternal = /*#__PURE__*/function (_React$PureCo
|
|
|
137
131
|
})
|
|
138
132
|
}),
|
|
139
133
|
type: OBJECT_SHARED
|
|
140
|
-
}
|
|
141
|
-
// the Flag system takes only Message Descriptor as payload
|
|
142
|
-
// and formatMessage is called for every flag
|
|
143
|
-
// if the translation data is not provided, a translated default message
|
|
144
|
-
// will be displayed
|
|
145
|
-
|
|
146
|
-
return flags;
|
|
134
|
+
}];
|
|
147
135
|
});
|
|
148
136
|
|
|
149
137
|
_defineProperty(_assertThisInitialized(_this), "handleKeyDown", function (event) {
|
|
@@ -225,6 +213,10 @@ export var ShareDialogWithTriggerInternal = /*#__PURE__*/function (_React$PureCo
|
|
|
225
213
|
});
|
|
226
214
|
|
|
227
215
|
_defineProperty(_assertThisInitialized(_this), "handleCloseDialog", function () {
|
|
216
|
+
if (_this.props.onDialogClose) {
|
|
217
|
+
_this.props.onDialogClose();
|
|
218
|
+
}
|
|
219
|
+
|
|
228
220
|
_this.setState({
|
|
229
221
|
isDialogOpen: false,
|
|
230
222
|
showIntegrationForm: false,
|
|
@@ -238,7 +230,6 @@ export var ShareDialogWithTriggerInternal = /*#__PURE__*/function (_React$PureCo
|
|
|
238
230
|
shareContentType = _this$props4.shareContentType,
|
|
239
231
|
formShareOrigin = _this$props4.formShareOrigin,
|
|
240
232
|
showFlags = _this$props4.showFlags,
|
|
241
|
-
config = _this$props4.config,
|
|
242
233
|
isPublicLink = _this$props4.isPublicLink;
|
|
243
234
|
|
|
244
235
|
if (!onShareSubmit) {
|
|
@@ -249,7 +240,7 @@ export var ShareDialogWithTriggerInternal = /*#__PURE__*/function (_React$PureCo
|
|
|
249
240
|
isSharing: true
|
|
250
241
|
});
|
|
251
242
|
|
|
252
|
-
_this.createAndFireEvent(formShareSubmitted(_this.start, data, shareContentType, formShareOrigin,
|
|
243
|
+
_this.createAndFireEvent(formShareSubmitted(_this.start, data, shareContentType, formShareOrigin, isPublicLink));
|
|
253
244
|
|
|
254
245
|
onShareSubmit(data).then(function () {
|
|
255
246
|
_this.closeAndResetDialog();
|
|
@@ -258,7 +249,7 @@ export var ShareDialogWithTriggerInternal = /*#__PURE__*/function (_React$PureCo
|
|
|
258
249
|
isSharing: false
|
|
259
250
|
});
|
|
260
251
|
|
|
261
|
-
showFlags(_this.getFlags(
|
|
252
|
+
showFlags(_this.getFlags());
|
|
262
253
|
}).catch(function (err) {
|
|
263
254
|
_this.setState({
|
|
264
255
|
isSharing: false,
|
|
@@ -412,24 +403,22 @@ export var ShareDialogWithTriggerInternal = /*#__PURE__*/function (_React$PureCo
|
|
|
412
403
|
var _this$props7 = this.props,
|
|
413
404
|
copyLink = _this$props7.copyLink,
|
|
414
405
|
dialogPlacement = _this$props7.dialogPlacement,
|
|
415
|
-
isFetchingConfig = _this$props7.isFetchingConfig,
|
|
416
406
|
loadUserOptions = _this$props7.loadUserOptions,
|
|
417
407
|
shareFormTitle = _this$props7.shareFormTitle,
|
|
418
408
|
contentPermissions = _this$props7.contentPermissions,
|
|
419
|
-
config = _this$props7.config,
|
|
420
409
|
bottomMessage = _this$props7.bottomMessage,
|
|
421
410
|
submitButtonLabel = _this$props7.submitButtonLabel,
|
|
422
411
|
product = _this$props7.product,
|
|
423
412
|
customFooter = _this$props7.customFooter,
|
|
424
413
|
enableSmartUserPicker = _this$props7.enableSmartUserPicker,
|
|
425
|
-
disableInviteCapabilities = _this$props7.disableInviteCapabilities,
|
|
426
414
|
loggedInAccountId = _this$props7.loggedInAccountId,
|
|
427
415
|
cloudId = _this$props7.cloudId,
|
|
428
416
|
shareFieldsFooter = _this$props7.shareFieldsFooter,
|
|
429
417
|
onUserSelectionChange = _this$props7.onUserSelectionChange,
|
|
430
418
|
dialogZIndex = _this$props7.dialogZIndex,
|
|
431
419
|
isPublicLink = _this$props7.isPublicLink,
|
|
432
|
-
tabIndex = _this$props7.tabIndex
|
|
420
|
+
tabIndex = _this$props7.tabIndex,
|
|
421
|
+
copyTooltipText = _this$props7.copyTooltipText;
|
|
433
422
|
var style = typeof tabIndex !== 'undefined' && tabIndex >= 0 ? {
|
|
434
423
|
outline: 'none'
|
|
435
424
|
} : undefined; // for performance purposes, we may want to have a loadable content i.e. ShareForm
|
|
@@ -459,19 +448,17 @@ export var ShareDialogWithTriggerInternal = /*#__PURE__*/function (_React$PureCo
|
|
|
459
448
|
shareError: shareError,
|
|
460
449
|
onDismiss: _this2.handleFormDismiss,
|
|
461
450
|
defaultValue: defaultValue,
|
|
462
|
-
config: config,
|
|
463
451
|
onLinkCopy: _this2.handleCopyLink,
|
|
464
|
-
isFetchingConfig: isFetchingConfig,
|
|
465
452
|
submitButtonLabel: submitButtonLabel,
|
|
466
453
|
product: product,
|
|
467
454
|
enableSmartUserPicker: enableSmartUserPicker,
|
|
468
|
-
disableInviteCapabilities: disableInviteCapabilities,
|
|
469
455
|
loggedInAccountId: loggedInAccountId,
|
|
470
456
|
cloudId: cloudId,
|
|
471
457
|
onUserSelectionChange: onUserSelectionChange,
|
|
472
458
|
fieldsFooter: shareFieldsFooter,
|
|
473
459
|
selectPortalRef: _this2.selectPortalRef,
|
|
474
|
-
isPublicLink: isPublicLink
|
|
460
|
+
isPublicLink: isPublicLink,
|
|
461
|
+
copyTooltipText: copyTooltipText
|
|
475
462
|
})), bottomMessage ? /*#__PURE__*/React.createElement(BottomMessageWrapper, null, bottomMessage) : null, customFooter && /*#__PURE__*/React.createElement(CustomFooterWrapper, null, customFooter)));
|
|
476
463
|
},
|
|
477
464
|
isOpen: isDialogOpen,
|
|
@@ -19,7 +19,6 @@ import Form from '@atlaskit/form';
|
|
|
19
19
|
import ErrorIcon from '@atlaskit/icon/glyph/error';
|
|
20
20
|
import { R400 } from '@atlaskit/theme/colors';
|
|
21
21
|
import { gridSize } from '@atlaskit/theme/constants';
|
|
22
|
-
import { multiply } from '@atlaskit/theme/math';
|
|
23
22
|
import Tooltip from '@atlaskit/tooltip';
|
|
24
23
|
import React from 'react';
|
|
25
24
|
import { FormattedMessage, injectIntl } from 'react-intl';
|
|
@@ -32,7 +31,7 @@ import { UserPickerField } from './UserPickerField';
|
|
|
32
31
|
var SubmitButtonWrapper = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n margin-left: auto;\n"])));
|
|
33
32
|
var CenterAlignedIconWrapper = styled.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n display: flex;\n align-self: center;\n padding: 0 10px;\n\n > div {\n line-height: 1;\n }\n"])));
|
|
34
33
|
export var FormWrapper = styled.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n /* jira has a class override font settings on h1 in gh-custom-field-pickers.css */\n #ghx-modes-tools #ghx-share & h1:first-child {\n margin-top: 0;\n }\n"])));
|
|
35
|
-
export var FormFooter = styled.div(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n margin-bottom: ", "px;\n display: flex;\n justify-content: flex-start;\n"])),
|
|
34
|
+
export var FormFooter = styled.div(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n margin-bottom: ", "px;\n display: flex;\n justify-content: flex-start;\n"])), gridSize);
|
|
36
35
|
var FormField = styled.div(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n margin-bottom: 12px;\n"])));
|
|
37
36
|
|
|
38
37
|
var InternalForm = /*#__PURE__*/function (_React$PureComponent) {
|
|
@@ -103,19 +102,17 @@ var InternalForm = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
103
102
|
onLinkCopy = _this$props3.onLinkCopy,
|
|
104
103
|
copyLink = _this$props3.copyLink,
|
|
105
104
|
defaultValue = _this$props3.defaultValue,
|
|
106
|
-
config = _this$props3.config,
|
|
107
|
-
isFetchingConfig = _this$props3.isFetchingConfig,
|
|
108
105
|
product = _this$props3.product,
|
|
109
106
|
onUserInputChange = _this$props3.onUserInputChange,
|
|
110
107
|
enableSmartUserPicker = _this$props3.enableSmartUserPicker,
|
|
111
|
-
disableInviteCapabilities = _this$props3.disableInviteCapabilities,
|
|
112
108
|
loggedInAccountId = _this$props3.loggedInAccountId,
|
|
113
109
|
cloudId = _this$props3.cloudId,
|
|
114
110
|
onUserSelectionChange = _this$props3.onUserSelectionChange,
|
|
115
111
|
fieldsFooter = _this$props3.fieldsFooter,
|
|
116
112
|
selectPortalRef = _this$props3.selectPortalRef,
|
|
117
113
|
isDisabled = _this$props3.isDisabled,
|
|
118
|
-
isPublicLink = _this$props3.isPublicLink
|
|
114
|
+
isPublicLink = _this$props3.isPublicLink,
|
|
115
|
+
copyTooltipText = _this$props3.copyTooltipText;
|
|
119
116
|
return /*#__PURE__*/React.createElement(FormWrapper, null, /*#__PURE__*/React.createElement("form", formProps, /*#__PURE__*/React.createElement(ShareHeader, {
|
|
120
117
|
title: title,
|
|
121
118
|
contentPermissions: contentPermissions
|
|
@@ -124,22 +121,20 @@ var InternalForm = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
124
121
|
onChange: onUserSelectionChange,
|
|
125
122
|
loadOptions: loadOptions,
|
|
126
123
|
defaultValue: defaultValue && defaultValue.users,
|
|
127
|
-
config: config,
|
|
128
|
-
isLoading: isFetchingConfig,
|
|
129
124
|
product: product,
|
|
130
125
|
enableSmartUserPicker: enableSmartUserPicker,
|
|
131
|
-
disableInviteCapabilities: disableInviteCapabilities,
|
|
132
126
|
loggedInAccountId: loggedInAccountId,
|
|
133
127
|
cloudId: cloudId,
|
|
134
128
|
selectPortalRef: selectPortalRef,
|
|
135
129
|
isPublicLink: isPublicLink
|
|
136
|
-
})),
|
|
130
|
+
})), /*#__PURE__*/React.createElement(FormField, null, /*#__PURE__*/React.createElement(CommentField, {
|
|
137
131
|
defaultValue: defaultValue && defaultValue.comment
|
|
138
132
|
})), fieldsFooter, /*#__PURE__*/React.createElement(FormFooter, null, /*#__PURE__*/React.createElement(CopyLinkButton, {
|
|
139
133
|
isDisabled: isDisabled,
|
|
140
134
|
onLinkCopy: onLinkCopy,
|
|
141
135
|
link: copyLink,
|
|
142
|
-
isPublicLink: isPublicLink
|
|
136
|
+
isPublicLink: isPublicLink,
|
|
137
|
+
copyTooltipText: copyTooltipText
|
|
143
138
|
}), this.renderSubmitButton())));
|
|
144
139
|
}
|
|
145
140
|
}]);
|
|
@@ -6,11 +6,10 @@ import React from 'react';
|
|
|
6
6
|
import { FormattedMessage } from 'react-intl';
|
|
7
7
|
import styled from 'styled-components';
|
|
8
8
|
import { gridSize } from '@atlaskit/theme/constants';
|
|
9
|
-
import { multiply } from '@atlaskit/theme/math';
|
|
10
9
|
import { h500 } from '@atlaskit/theme/typography';
|
|
11
10
|
import { messages } from '../i18n';
|
|
12
11
|
var HeaderWrapper = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n justify-content: space-between;\n"])));
|
|
13
|
-
export var FormHeaderTitle = styled.h1(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n ", ";\n line-height: ", "px;\n margin-right: ", "px;\n margin-top: ", "px;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n\n > span {\n font-size: initial;\n }\n"])), h500,
|
|
12
|
+
export var FormHeaderTitle = styled.h1(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n ", ";\n line-height: ", "px;\n margin-right: ", "px;\n margin-top: ", "px;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n\n > span {\n font-size: initial;\n }\n"])), h500, gridSize() * 4, gridSize() * 4, gridSize() * 4);
|
|
14
13
|
export var ShareHeader = function ShareHeader(_ref) {
|
|
15
14
|
var title = _ref.title,
|
|
16
15
|
contentPermissions = _ref.contentPermissions;
|