@atlaskit/share 3.7.0 → 3.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/dist/cjs/clients/AtlassianUrlShortenerClient.js +0 -22
- package/dist/cjs/clients/ShareServiceClient.js +1 -12
- package/dist/cjs/clients/index.js +0 -1
- package/dist/cjs/components/CommentField.js +0 -9
- package/dist/cjs/components/CopyLinkButton.js +8 -48
- package/dist/cjs/components/ErrorBoundary.js +0 -26
- package/dist/cjs/components/IntegrationButton.js +3 -15
- package/dist/cjs/components/IntegrationForm.js +8 -17
- package/dist/cjs/components/LazyShareForm/LazyShareForm.js +38 -61
- package/dist/cjs/components/LazyShareForm/index.js +0 -2
- package/dist/cjs/components/LazyShareForm/lazy.js +4 -18
- package/dist/cjs/components/MessagesIntlProvider.js +1 -14
- package/dist/cjs/components/ShareButton.js +1 -9
- package/dist/cjs/components/ShareDialogContainer.js +56 -123
- package/dist/cjs/components/ShareDialogWithTrigger.js +85 -161
- package/dist/cjs/components/ShareForm.js +41 -100
- package/dist/cjs/components/ShareFormWrapper/ShareFormWrapper.js +5 -11
- package/dist/cjs/components/ShareFormWrapper/index.js +0 -2
- package/dist/cjs/components/ShareFormWrapper/styled.js +2 -9
- package/dist/cjs/components/ShareHeader.js +0 -14
- package/dist/cjs/components/SlackIcon.js +0 -4
- package/dist/cjs/components/SplitButton.js +18 -43
- package/dist/cjs/components/UserPickerField.js +20 -70
- package/dist/cjs/components/analytics/analytics.js +6 -39
- package/dist/cjs/components/analytics/ufoExperienceHelper.js +0 -4
- package/dist/cjs/components/analytics/ufoExperiences.js +0 -2
- package/dist/cjs/components/colorSlackIcon.js +0 -4
- package/dist/cjs/components/localStorageUtils.js +0 -11
- package/dist/cjs/components/monochromeSlackIcon.js +2 -4
- package/dist/cjs/components/styles.js +2 -16
- package/dist/cjs/components/utils.js +4 -19
- package/dist/cjs/i18n/cs.js +0 -1
- package/dist/cjs/i18n/da.js +1 -2
- package/dist/cjs/i18n/de.js +0 -1
- package/dist/cjs/i18n/en.js +29 -22
- package/dist/cjs/i18n/en_GB.js +29 -22
- package/dist/cjs/i18n/en_ZZ.js +0 -1
- package/dist/cjs/i18n/es.js +0 -1
- package/dist/cjs/i18n/et.js +0 -1
- package/dist/cjs/i18n/fi.js +0 -1
- package/dist/cjs/i18n/fr.js +0 -1
- package/dist/cjs/i18n/hu.js +0 -1
- package/dist/cjs/i18n/index.js +0 -31
- package/dist/cjs/i18n/is.js +0 -1
- package/dist/cjs/i18n/it.js +0 -1
- package/dist/cjs/i18n/ja.js +0 -1
- package/dist/cjs/i18n/ko.js +0 -1
- package/dist/cjs/i18n/languages.js +0 -1
- package/dist/cjs/i18n/nb.js +0 -1
- package/dist/cjs/i18n/nl.js +0 -1
- package/dist/cjs/i18n/pl.js +0 -1
- package/dist/cjs/i18n/pt_BR.js +0 -1
- package/dist/cjs/i18n/pt_PT.js +0 -1
- package/dist/cjs/i18n/ro.js +0 -1
- package/dist/cjs/i18n/ru.js +0 -1
- package/dist/cjs/i18n/sk.js +0 -1
- package/dist/cjs/i18n/sv.js +0 -1
- package/dist/cjs/i18n/th.js +0 -1
- package/dist/cjs/i18n/tr.js +0 -1
- package/dist/cjs/i18n/uk.js +0 -1
- package/dist/cjs/i18n/vi.js +0 -1
- package/dist/cjs/i18n/zh.js +0 -1
- package/dist/cjs/i18n/zh_TW.js +0 -1
- package/dist/cjs/i18n.js +2 -3
- package/dist/cjs/index.js +0 -3
- package/dist/cjs/types/ShareEntities.js +0 -1
- package/dist/cjs/types/index.js +0 -2
- package/dist/cjs/util/i18n-util.js +2 -8
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/clients/AtlassianUrlShortenerClient.js +0 -6
- package/dist/es2019/clients/ShareServiceClient.js +1 -4
- package/dist/es2019/components/CopyLinkButton.js +2 -13
- package/dist/es2019/components/ErrorBoundary.js +0 -10
- package/dist/es2019/components/IntegrationButton.js +0 -2
- package/dist/es2019/components/LazyShareForm/LazyShareForm.js +5 -14
- package/dist/es2019/components/LazyShareForm/lazy.js +3 -5
- package/dist/es2019/components/MessagesIntlProvider.js +2 -3
- package/dist/es2019/components/ShareDialogContainer.js +21 -59
- package/dist/es2019/components/ShareDialogWithTrigger.js +29 -68
- package/dist/es2019/components/ShareForm.js +4 -24
- package/dist/es2019/components/ShareFormWrapper/ShareFormWrapper.js +0 -2
- package/dist/es2019/components/ShareFormWrapper/styled.js +2 -1
- package/dist/es2019/components/SlackIcon.js +0 -2
- package/dist/es2019/components/SplitButton.js +2 -5
- package/dist/es2019/components/UserPickerField.js +2 -23
- package/dist/es2019/components/analytics/analytics.js +9 -13
- package/dist/es2019/components/analytics/ufoExperienceHelper.js +0 -2
- package/dist/es2019/components/colorSlackIcon.js +0 -2
- package/dist/es2019/components/localStorageUtils.js +0 -3
- package/dist/es2019/components/monochromeSlackIcon.js +2 -2
- package/dist/es2019/components/styles.js +3 -2
- package/dist/es2019/components/utils.js +7 -8
- package/dist/es2019/i18n/da.js +1 -1
- package/dist/es2019/i18n/en.js +29 -21
- package/dist/es2019/i18n/en_GB.js +29 -21
- package/dist/es2019/i18n.js +2 -1
- package/dist/es2019/index.js +2 -1
- package/dist/es2019/types/ShareEntities.js +1 -1
- package/dist/es2019/util/i18n-util.js +1 -5
- package/dist/es2019/version.json +1 -1
- package/dist/esm/clients/AtlassianUrlShortenerClient.js +0 -16
- package/dist/esm/clients/ShareServiceClient.js +1 -7
- package/dist/esm/components/CopyLinkButton.js +8 -31
- package/dist/esm/components/ErrorBoundary.js +0 -18
- package/dist/esm/components/IntegrationButton.js +3 -8
- package/dist/esm/components/IntegrationForm.js +8 -10
- package/dist/esm/components/LazyShareForm/LazyShareForm.js +38 -47
- package/dist/esm/components/LazyShareForm/lazy.js +5 -7
- package/dist/esm/components/MessagesIntlProvider.js +1 -6
- package/dist/esm/components/ShareButton.js +1 -2
- package/dist/esm/components/ShareDialogContainer.js +56 -108
- package/dist/esm/components/ShareDialogWithTrigger.js +89 -157
- package/dist/esm/components/ShareForm.js +41 -74
- package/dist/esm/components/ShareFormWrapper/ShareFormWrapper.js +5 -7
- package/dist/esm/components/ShareFormWrapper/styled.js +2 -1
- package/dist/esm/components/ShareHeader.js +0 -2
- package/dist/esm/components/SlackIcon.js +0 -2
- package/dist/esm/components/SplitButton.js +18 -24
- package/dist/esm/components/UserPickerField.js +20 -54
- package/dist/esm/components/analytics/analytics.js +6 -15
- package/dist/esm/components/analytics/ufoExperienceHelper.js +0 -2
- package/dist/esm/components/colorSlackIcon.js +0 -2
- package/dist/esm/components/localStorageUtils.js +0 -3
- package/dist/esm/components/monochromeSlackIcon.js +2 -2
- package/dist/esm/components/styles.js +2 -7
- package/dist/esm/components/utils.js +7 -8
- package/dist/esm/i18n/da.js +1 -1
- package/dist/esm/i18n/en.js +29 -21
- package/dist/esm/i18n/en_GB.js +29 -21
- package/dist/esm/i18n.js +2 -1
- package/dist/esm/index.js +2 -1
- package/dist/esm/types/ShareEntities.js +1 -1
- package/dist/esm/util/i18n-util.js +1 -5
- package/dist/esm/version.json +1 -1
- package/dist/types/components/LazyShareForm/LazyShareForm.d.ts +1 -1
- package/dist/types/i18n/en.d.ts +27 -19
- package/dist/types/i18n/en_GB.d.ts +27 -19
- package/dist/types/types/ShareForm.d.ts +0 -1
- package/package.json +2 -2
|
@@ -7,17 +7,11 @@ import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
|
7
7
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
8
8
|
import _extends from "@babel/runtime/helpers/extends";
|
|
9
9
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
10
|
-
|
|
11
10
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7;
|
|
12
|
-
|
|
13
11
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
14
|
-
|
|
15
12
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
16
|
-
|
|
17
13
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
18
|
-
|
|
19
14
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
20
|
-
|
|
21
15
|
/** @jsx jsx */
|
|
22
16
|
import React from 'react';
|
|
23
17
|
import { css, jsx } from '@emotion/react';
|
|
@@ -45,7 +39,6 @@ export var formFooterStyles = css(_templateObject4 || (_templateObject4 = _tagge
|
|
|
45
39
|
var formFieldStyles = css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n margin-bottom: 12px;\n"])));
|
|
46
40
|
var integrationWrapperStyles = css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n"])));
|
|
47
41
|
var integrationIconWrapperStyles = css(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n margin-bottom: -6px;\n margin-right: 5px;\n"])));
|
|
48
|
-
|
|
49
42
|
var integrationTabText = function integrationTabText(integrationName) {
|
|
50
43
|
return jsx(FormattedMessage, _extends({}, messages.shareInIntegrationButtonText, {
|
|
51
44
|
values: {
|
|
@@ -53,55 +46,47 @@ var integrationTabText = function integrationTabText(integrationName) {
|
|
|
53
46
|
}
|
|
54
47
|
}));
|
|
55
48
|
};
|
|
56
|
-
|
|
57
49
|
// eslint-disable-next-line @repo/internal/react/no-class-components
|
|
58
50
|
var InternalForm = /*#__PURE__*/function (_React$PureComponent) {
|
|
59
51
|
_inherits(InternalForm, _React$PureComponent);
|
|
60
|
-
|
|
61
52
|
var _super = _createSuper(InternalForm);
|
|
62
|
-
|
|
63
53
|
function InternalForm() {
|
|
64
54
|
var _this;
|
|
65
|
-
|
|
66
55
|
_classCallCheck(this, InternalForm);
|
|
67
|
-
|
|
68
56
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
69
57
|
args[_key] = arguments[_key];
|
|
70
58
|
}
|
|
71
|
-
|
|
72
59
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
73
|
-
|
|
74
60
|
_defineProperty(_assertThisInitialized(_this), "state", {
|
|
75
61
|
selectedTab: TabType.default
|
|
76
62
|
});
|
|
77
|
-
|
|
78
63
|
_defineProperty(_assertThisInitialized(_this), "renderShareForm", function () {
|
|
79
64
|
var _this$props = _this.props,
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
65
|
+
formProps = _this$props.formProps,
|
|
66
|
+
title = _this$props.title,
|
|
67
|
+
_this$props$showTitle = _this$props.showTitle,
|
|
68
|
+
showTitle = _this$props$showTitle === void 0 ? true : _this$props$showTitle,
|
|
69
|
+
loadOptions = _this$props.loadOptions,
|
|
70
|
+
onLinkCopy = _this$props.onLinkCopy,
|
|
71
|
+
copyLink = _this$props.copyLink,
|
|
72
|
+
defaultValue = _this$props.defaultValue,
|
|
73
|
+
config = _this$props.config,
|
|
74
|
+
isFetchingConfig = _this$props.isFetchingConfig,
|
|
75
|
+
product = _this$props.product,
|
|
76
|
+
onUserInputChange = _this$props.onUserInputChange,
|
|
77
|
+
enableSmartUserPicker = _this$props.enableSmartUserPicker,
|
|
78
|
+
loggedInAccountId = _this$props.loggedInAccountId,
|
|
79
|
+
cloudId = _this$props.cloudId,
|
|
80
|
+
onUserSelectionChange = _this$props.onUserSelectionChange,
|
|
81
|
+
fieldsFooter = _this$props.fieldsFooter,
|
|
82
|
+
selectPortalRef = _this$props.selectPortalRef,
|
|
83
|
+
isDisabled = _this$props.isDisabled,
|
|
84
|
+
isPublicLink = _this$props.isPublicLink,
|
|
85
|
+
copyTooltipText = _this$props.copyTooltipText,
|
|
86
|
+
helperMessage = _this$props.helperMessage,
|
|
87
|
+
orgId = _this$props.orgId,
|
|
88
|
+
isBrowseUsersDisabled = _this$props.isBrowseUsersDisabled,
|
|
89
|
+
formatMessage = _this$props.intl.formatMessage;
|
|
105
90
|
return jsx(AnalyticsContext, {
|
|
106
91
|
data: {
|
|
107
92
|
source: ANALYTICS_SOURCE
|
|
@@ -142,16 +127,15 @@ var InternalForm = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
142
127
|
copiedToClipboardText: formatMessage(messages.copiedToClipboardMessage)
|
|
143
128
|
}), _this.renderSubmitButton())));
|
|
144
129
|
});
|
|
145
|
-
|
|
146
130
|
_defineProperty(_assertThisInitialized(_this), "renderSubmitButton", function () {
|
|
147
131
|
var _this$props2 = _this.props,
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
132
|
+
formatMessage = _this$props2.intl.formatMessage,
|
|
133
|
+
isSharing = _this$props2.isSharing,
|
|
134
|
+
shareError = _this$props2.shareError,
|
|
135
|
+
submitButtonLabel = _this$props2.submitButtonLabel,
|
|
136
|
+
isDisabled = _this$props2.isDisabled,
|
|
137
|
+
isPublicLink = _this$props2.isPublicLink,
|
|
138
|
+
integrationMode = _this$props2.integrationMode;
|
|
155
139
|
var shouldShowWarning = shareError && !isSharing;
|
|
156
140
|
var buttonAppearance = !shouldShowWarning ? 'primary' : 'warning';
|
|
157
141
|
var tabMode = integrationMode === 'tabs';
|
|
@@ -177,44 +161,34 @@ var InternalForm = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
177
161
|
isDisabled: isDisabled
|
|
178
162
|
}, jsx(ButtonLabelWrapper, null, submitButtonLabel || jsx(FormattedMessage, buttonLabel))));
|
|
179
163
|
});
|
|
180
|
-
|
|
181
164
|
_defineProperty(_assertThisInitialized(_this), "renderMainTabTitle", function () {
|
|
182
165
|
var _this$props3 = _this.props,
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
166
|
+
title = _this$props3.title,
|
|
167
|
+
product = _this$props3.product;
|
|
186
168
|
if (title) {
|
|
187
169
|
return title;
|
|
188
170
|
}
|
|
189
|
-
|
|
190
171
|
if (!product) {
|
|
191
172
|
return jsx(FormattedMessage, messages.formTitle);
|
|
192
173
|
}
|
|
193
|
-
|
|
194
174
|
var productShareType = product === 'jira' ? _objectSpread({}, messages.shareMainTabTextJira) : _objectSpread({}, messages.shareMainTabTextConfluence);
|
|
195
175
|
return jsx(FormattedMessage, productShareType);
|
|
196
176
|
});
|
|
197
|
-
|
|
198
177
|
_defineProperty(_assertThisInitialized(_this), "changeTab", function (tab) {
|
|
199
178
|
var _this$props$onTabChan, _this$props4;
|
|
200
|
-
|
|
201
179
|
_this.setState({
|
|
202
180
|
selectedTab: tab
|
|
203
181
|
});
|
|
204
|
-
|
|
205
182
|
(_this$props$onTabChan = (_this$props4 = _this.props).onTabChange) === null || _this$props$onTabChan === void 0 ? void 0 : _this$props$onTabChan.call(_this$props4, tab);
|
|
206
183
|
});
|
|
207
|
-
|
|
208
184
|
return _this;
|
|
209
185
|
}
|
|
210
|
-
|
|
211
186
|
_createClass(InternalForm, [{
|
|
212
187
|
key: "componentWillUnmount",
|
|
213
188
|
value: function componentWillUnmount() {
|
|
214
189
|
var _this$props5 = this.props,
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
190
|
+
onDismiss = _this$props5.onDismiss,
|
|
191
|
+
getValues = _this$props5.getValues;
|
|
218
192
|
if (onDismiss) {
|
|
219
193
|
onDismiss(getValues());
|
|
220
194
|
}
|
|
@@ -223,17 +197,14 @@ var InternalForm = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
223
197
|
key: "render",
|
|
224
198
|
value: function render() {
|
|
225
199
|
var _this$props6 = this.props,
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
200
|
+
_this$props6$integrat = _this$props6.integrationMode,
|
|
201
|
+
integrationMode = _this$props6$integrat === void 0 ? 'off' : _this$props6$integrat,
|
|
202
|
+
shareIntegrations = _this$props6.shareIntegrations,
|
|
203
|
+
handleCloseDialog = _this$props6.handleCloseDialog;
|
|
231
204
|
if (integrationMode === 'off' || !shareIntegrations || !shareIntegrations.length) {
|
|
232
205
|
return this.renderShareForm();
|
|
233
206
|
}
|
|
234
|
-
|
|
235
207
|
var firstIntegration = shareIntegrations[0];
|
|
236
|
-
|
|
237
208
|
if (integrationMode === 'tabs') {
|
|
238
209
|
return jsx(Tabs, {
|
|
239
210
|
id: "ShareForm-Tabs-Integrations",
|
|
@@ -267,25 +238,21 @@ var InternalForm = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
267
238
|
changeTab: this.changeTab
|
|
268
239
|
})))));
|
|
269
240
|
}
|
|
270
|
-
|
|
271
241
|
return this.renderShareForm();
|
|
272
242
|
}
|
|
273
243
|
}]);
|
|
274
|
-
|
|
275
244
|
return InternalForm;
|
|
276
245
|
}(React.PureComponent);
|
|
277
|
-
|
|
278
246
|
_defineProperty(InternalForm, "defaultProps", {
|
|
279
247
|
onSubmit: function onSubmit() {}
|
|
280
248
|
});
|
|
281
|
-
|
|
282
249
|
var InternalFormWithIntl = injectIntl(InternalForm);
|
|
283
250
|
export var ShareForm = function ShareForm(props) {
|
|
284
251
|
return jsx(Form, {
|
|
285
252
|
onSubmit: props.onSubmit
|
|
286
253
|
}, function (_ref) {
|
|
287
254
|
var formProps = _ref.formProps,
|
|
288
|
-
|
|
255
|
+
getValues = _ref.getValues;
|
|
289
256
|
return jsx(InternalFormWithIntl, _extends({}, props, {
|
|
290
257
|
formProps: formProps,
|
|
291
258
|
getValues: getValues
|
|
@@ -1,17 +1,15 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { ShareHeader } from '../ShareHeader';
|
|
3
3
|
import { InlineDialogContentWrapper, InlineDialogFormWrapper } from './styled';
|
|
4
|
-
|
|
5
4
|
var ShareFormWrapper = function ShareFormWrapper(_ref) {
|
|
6
5
|
var shareFormTitle = _ref.shareFormTitle,
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
6
|
+
shouldShowTitle = _ref.shouldShowTitle,
|
|
7
|
+
_ref$children = _ref.children,
|
|
8
|
+
children = _ref$children === void 0 ? null : _ref$children,
|
|
9
|
+
_ref$footer = _ref.footer,
|
|
10
|
+
footer = _ref$footer === void 0 ? null : _ref$footer;
|
|
12
11
|
return /*#__PURE__*/React.createElement(InlineDialogContentWrapper, null, /*#__PURE__*/React.createElement(InlineDialogFormWrapper, null, shouldShowTitle && /*#__PURE__*/React.createElement(ShareHeader, {
|
|
13
12
|
title: shareFormTitle
|
|
14
13
|
}), children), footer);
|
|
15
14
|
};
|
|
16
|
-
|
|
17
15
|
export default ShareFormWrapper;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
|
+
|
|
2
3
|
import React from 'react';
|
|
3
4
|
import { jsx } from '@emotion/react';
|
|
4
5
|
import { gridSize } from '@atlaskit/theme/constants';
|
|
@@ -10,13 +11,13 @@ export var InlineDialogFormWrapper = function InlineDialogFormWrapper(_ref) {
|
|
|
10
11
|
}
|
|
11
12
|
}, children);
|
|
12
13
|
};
|
|
14
|
+
|
|
13
15
|
/**
|
|
14
16
|
* Apply the same styling, as previous @atlaskit/inline-dialog had,
|
|
15
17
|
* compared to the @atlaskit/popup we are now using.
|
|
16
18
|
*
|
|
17
19
|
* packages/design-system/inline-dialog/src/InlineDialog/styled.ts:20:3
|
|
18
20
|
*/
|
|
19
|
-
|
|
20
21
|
export var InlineDialogContentWrapper = function InlineDialogContentWrapper(_ref2) {
|
|
21
22
|
var children = _ref2.children;
|
|
22
23
|
return jsx("div", {
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
|
|
3
2
|
var SlackIcon = function SlackIcon() {
|
|
4
3
|
return /*#__PURE__*/React.createElement("svg", {
|
|
5
4
|
width: "24",
|
|
@@ -53,5 +52,4 @@ var SlackIcon = function SlackIcon() {
|
|
|
53
52
|
className: "prefix__st3"
|
|
54
53
|
})))));
|
|
55
54
|
};
|
|
56
|
-
|
|
57
55
|
export default SlackIcon;
|
|
@@ -2,9 +2,7 @@ import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProper
|
|
|
2
2
|
import _extends from "@babel/runtime/helpers/extends";
|
|
3
3
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
4
4
|
var _excluded = ["triggerRef"];
|
|
5
|
-
|
|
6
5
|
var _templateObject, _templateObject2, _templateObject3;
|
|
7
|
-
|
|
8
6
|
/** @jsx jsx */
|
|
9
7
|
import React, { useCallback } from 'react';
|
|
10
8
|
import { css, jsx } from '@emotion/react';
|
|
@@ -18,10 +16,10 @@ import { messages } from '../i18n';
|
|
|
18
16
|
import { shareIntegrationButtonEvent } from './analytics/analytics';
|
|
19
17
|
import IntegrationButton from './IntegrationButton';
|
|
20
18
|
var splitButtonWrapperStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n button {\n border-radius: ", "px 0 0 ", "px;\n }\n button:hover {\n border-radius: ", "px 0 0 ", "px;\n }\n"])), borderRadius(), borderRadius(), borderRadius(), borderRadius());
|
|
21
|
-
var dropdownMenuWrapperStyles = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n margin-left: 1px;\n button {\n border-radius: 0 ", "px ", "px 0;\n }\n button:hover {\n border-radius: 0 ", "px ", "px 0;\n }\n"])), borderRadius(), borderRadius(), borderRadius(), borderRadius());
|
|
19
|
+
var dropdownMenuWrapperStyles = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n margin-left: 1px;\n button {\n border-radius: 0 ", "px ", "px 0;\n }\n button:hover {\n border-radius: 0 ", "px ", "px 0;\n }\n"])), borderRadius(), borderRadius(), borderRadius(), borderRadius());
|
|
22
20
|
|
|
21
|
+
// span
|
|
23
22
|
var dropDownIntegrationButtonWrapperStyles = css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n button:hover {\n background: transparent;\n }\n"])));
|
|
24
|
-
|
|
25
23
|
var integrationButtonText = function integrationButtonText(integrationName) {
|
|
26
24
|
return jsx(FormattedMessage, _extends({}, messages.shareToIntegrationButtonText, {
|
|
27
25
|
values: {
|
|
@@ -29,18 +27,16 @@ var integrationButtonText = function integrationButtonText(integrationName) {
|
|
|
29
27
|
}
|
|
30
28
|
}));
|
|
31
29
|
};
|
|
32
|
-
|
|
33
30
|
var SplitButtonDropdown = function SplitButtonDropdown(props) {
|
|
34
31
|
var triggerButtonAppearance = props.triggerButtonAppearance,
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
32
|
+
isUsingSplitButton = props.isUsingSplitButton,
|
|
33
|
+
handleOpenSplitButton = props.handleOpenSplitButton,
|
|
34
|
+
handleCloseSplitButton = props.handleCloseSplitButton,
|
|
35
|
+
shareIntegrations = props.shareIntegrations,
|
|
36
|
+
onIntegrationClick = props.onIntegrationClick,
|
|
37
|
+
createAndFireEvent = props.createAndFireEvent;
|
|
41
38
|
var onOpenChange = useCallback(function (_ref) {
|
|
42
39
|
var isOpen = _ref.isOpen;
|
|
43
|
-
|
|
44
40
|
if (isOpen) {
|
|
45
41
|
handleOpenSplitButton();
|
|
46
42
|
} else {
|
|
@@ -57,8 +53,7 @@ var SplitButtonDropdown = function SplitButtonDropdown(props) {
|
|
|
57
53
|
testId: "split-button-dropdown",
|
|
58
54
|
trigger: function trigger(_ref2) {
|
|
59
55
|
var triggerRef = _ref2.triggerRef,
|
|
60
|
-
|
|
61
|
-
|
|
56
|
+
providedProps = _objectWithoutProperties(_ref2, _excluded);
|
|
62
57
|
return jsx(Button, _extends({}, providedProps, {
|
|
63
58
|
ref: triggerRef,
|
|
64
59
|
iconBefore: jsx(ChevronDownIcon, {
|
|
@@ -88,19 +83,18 @@ var SplitButtonDropdown = function SplitButtonDropdown(props) {
|
|
|
88
83
|
})));
|
|
89
84
|
}))));
|
|
90
85
|
};
|
|
91
|
-
|
|
92
86
|
SplitButtonDropdown.displayName = 'SplitButtonDropdown';
|
|
93
87
|
export default function SplitButton(_ref3) {
|
|
94
88
|
var shareButton = _ref3.shareButton,
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
89
|
+
handleOpenSplitButton = _ref3.handleOpenSplitButton,
|
|
90
|
+
handleCloseSplitButton = _ref3.handleCloseSplitButton,
|
|
91
|
+
isUsingSplitButton = _ref3.isUsingSplitButton,
|
|
92
|
+
shareIntegrations = _ref3.shareIntegrations,
|
|
93
|
+
onIntegrationClick = _ref3.onIntegrationClick,
|
|
94
|
+
triggerButtonAppearance = _ref3.triggerButtonAppearance,
|
|
95
|
+
dialogZIndex = _ref3.dialogZIndex,
|
|
96
|
+
dialogPlacement = _ref3.dialogPlacement,
|
|
97
|
+
createAndFireEvent = _ref3.createAndFireEvent;
|
|
104
98
|
return jsx("div", {
|
|
105
99
|
css: splitButtonWrapperStyles,
|
|
106
100
|
"data-testid": "split-button"
|
|
@@ -6,11 +6,8 @@ import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstruct
|
|
|
6
6
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
7
7
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
8
8
|
import _extends from "@babel/runtime/helpers/extends";
|
|
9
|
-
|
|
10
9
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
11
|
-
|
|
12
10
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
13
|
-
|
|
14
11
|
import React from 'react';
|
|
15
12
|
import { FormattedMessage, injectIntl } from 'react-intl-next';
|
|
16
13
|
import { ErrorMessage, Field, HelperMessage } from '@atlaskit/form';
|
|
@@ -21,19 +18,15 @@ import { MAX_PICKER_HEIGHT } from './styles';
|
|
|
21
18
|
import { allowEmails, getMenuPortalTargetCurrentHTML } from './utils';
|
|
22
19
|
export var REQUIRED = 'REQUIRED';
|
|
23
20
|
var DEBOUNCE_MS = 150;
|
|
24
|
-
|
|
25
21
|
var validate = function validate(value) {
|
|
26
22
|
return value && value instanceof Array && value.length > 0 ? undefined : REQUIRED;
|
|
27
23
|
};
|
|
28
|
-
|
|
29
24
|
var getNoOptionsMessageDescriptor = function getNoOptionsMessageDescriptor(emailValidity, isPublicLink, allowEmail) {
|
|
30
25
|
if (isPublicLink || !allowEmail) {
|
|
31
26
|
return messages.userPickerExistingUserOnlyNoOptionsMessage;
|
|
32
27
|
}
|
|
33
|
-
|
|
34
28
|
return messages.userPickerGenericNoOptionsMessage;
|
|
35
29
|
};
|
|
36
|
-
|
|
37
30
|
var getNoOptionsMessage = function getNoOptionsMessage(isPublicLink, allowEmail) {
|
|
38
31
|
return function (_ref) {
|
|
39
32
|
var inputValue = _ref.inputValue;
|
|
@@ -44,12 +37,10 @@ var getNoOptionsMessage = function getNoOptionsMessage(isPublicLink, allowEmail)
|
|
|
44
37
|
})) : null;
|
|
45
38
|
};
|
|
46
39
|
};
|
|
47
|
-
|
|
48
40
|
var getPlaceHolderMessageDescriptor = function getPlaceHolderMessageDescriptor() {
|
|
49
41
|
var product = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'confluence';
|
|
50
42
|
var allowEmail = arguments.length > 1 ? arguments[1] : undefined;
|
|
51
43
|
var isBrowseUsersDisabled = arguments.length > 2 ? arguments[2] : undefined;
|
|
52
|
-
|
|
53
44
|
if (!allowEmail) {
|
|
54
45
|
var _placeholderMessage = {
|
|
55
46
|
jira: messages.userPickerExistingUserOnlyPlaceholder,
|
|
@@ -57,18 +48,15 @@ var getPlaceHolderMessageDescriptor = function getPlaceHolderMessageDescriptor()
|
|
|
57
48
|
};
|
|
58
49
|
return _placeholderMessage[product];
|
|
59
50
|
}
|
|
60
|
-
|
|
61
51
|
if (isBrowseUsersDisabled) {
|
|
62
52
|
return messages.userPickerGenericEmailOnlyPlaceholder;
|
|
63
53
|
}
|
|
64
|
-
|
|
65
54
|
var placeholderMessage = {
|
|
66
55
|
jira: messages.userPickerGenericPlaceholderJira,
|
|
67
56
|
confluence: messages.userPickerGenericPlaceholder
|
|
68
57
|
};
|
|
69
58
|
return placeholderMessage[product];
|
|
70
59
|
};
|
|
71
|
-
|
|
72
60
|
var requiredMessagesWithEmail = {
|
|
73
61
|
confluence: messages.userPickerRequiredMessage,
|
|
74
62
|
jira: messages.userPickerRequiredMessageJira
|
|
@@ -77,92 +65,73 @@ var requiredMessagesWithoutEmail = {
|
|
|
77
65
|
confluence: messages.userPickerRequiredExistingUserOnlyMessage,
|
|
78
66
|
jira: messages.userPickerRequiredExistingUserOnlyMessageJira
|
|
79
67
|
};
|
|
80
|
-
|
|
81
68
|
var getRequiredMessage = function getRequiredMessage(product, allowEmail, isBrowseUsersDisabled) {
|
|
82
69
|
if (isBrowseUsersDisabled) {
|
|
83
70
|
return messages.userPickerRequiredMessageEmailOnly;
|
|
84
71
|
}
|
|
85
|
-
|
|
86
72
|
var emailMessages = allowEmail ? requiredMessagesWithEmail : requiredMessagesWithoutEmail;
|
|
87
73
|
return emailMessages[product];
|
|
88
|
-
};
|
|
89
|
-
|
|
74
|
+
};
|
|
90
75
|
|
|
76
|
+
// eslint-disable-next-line @repo/internal/react/no-class-components
|
|
91
77
|
export var UserPickerFieldComponent = /*#__PURE__*/function (_React$Component) {
|
|
92
78
|
_inherits(UserPickerFieldComponent, _React$Component);
|
|
93
|
-
|
|
94
79
|
var _super = _createSuper(UserPickerFieldComponent);
|
|
95
|
-
|
|
96
80
|
function UserPickerFieldComponent() {
|
|
97
81
|
var _this;
|
|
98
|
-
|
|
99
82
|
_classCallCheck(this, UserPickerFieldComponent);
|
|
100
|
-
|
|
101
83
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
102
84
|
args[_key] = arguments[_key];
|
|
103
85
|
}
|
|
104
|
-
|
|
105
86
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
106
|
-
|
|
107
87
|
_defineProperty(_assertThisInitialized(_this), "loadOptions", function (search) {
|
|
108
88
|
var loadOptions = _this.props.loadOptions;
|
|
109
|
-
|
|
110
89
|
if (loadOptions && search && search.length > 0) {
|
|
111
90
|
return loadOptions(search);
|
|
112
91
|
} else {
|
|
113
92
|
return [];
|
|
114
93
|
}
|
|
115
94
|
});
|
|
116
|
-
|
|
117
95
|
_defineProperty(_assertThisInitialized(_this), "getInviteWarningMessage", function () {
|
|
118
96
|
var _this$props = _this.props,
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
97
|
+
product = _this$props.product,
|
|
98
|
+
isPublicLink = _this$props.isPublicLink,
|
|
99
|
+
helperMessage = _this$props.helperMessage;
|
|
123
100
|
if (isPublicLink) {
|
|
124
101
|
return null;
|
|
125
102
|
}
|
|
126
|
-
|
|
127
103
|
if (helperMessage) {
|
|
128
104
|
return helperMessage;
|
|
129
105
|
}
|
|
130
|
-
|
|
131
106
|
return product === 'jira' ? /*#__PURE__*/React.createElement(FormattedMessage, messages.infoMessageDefaultJira) : /*#__PURE__*/React.createElement(FormattedMessage, messages.infoMessageDefaultConfluence);
|
|
132
107
|
});
|
|
133
|
-
|
|
134
108
|
_defineProperty(_assertThisInitialized(_this), "handleUserPickerTransform", function (event, current) {
|
|
135
109
|
var onChange = _this.props.onChange;
|
|
136
|
-
|
|
137
110
|
if (onChange) {
|
|
138
111
|
onChange(event);
|
|
139
112
|
}
|
|
140
|
-
|
|
141
113
|
return event;
|
|
142
114
|
});
|
|
143
|
-
|
|
144
115
|
return _this;
|
|
145
116
|
}
|
|
146
|
-
|
|
147
117
|
_createClass(UserPickerFieldComponent, [{
|
|
148
118
|
key: "render",
|
|
149
119
|
value: function render() {
|
|
150
120
|
var _this2 = this;
|
|
151
|
-
|
|
152
121
|
var _this$props2 = this.props,
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
122
|
+
defaultValue = _this$props2.defaultValue,
|
|
123
|
+
enableSmartUserPicker = _this$props2.enableSmartUserPicker,
|
|
124
|
+
config = _this$props2.config,
|
|
125
|
+
intl = _this$props2.intl,
|
|
126
|
+
isLoading = _this$props2.isLoading,
|
|
127
|
+
product = _this$props2.product,
|
|
128
|
+
onInputChange = _this$props2.onInputChange,
|
|
129
|
+
loggedInAccountId = _this$props2.loggedInAccountId,
|
|
130
|
+
cloudId = _this$props2.cloudId,
|
|
131
|
+
selectPortalRef = _this$props2.selectPortalRef,
|
|
132
|
+
isPublicLink = _this$props2.isPublicLink,
|
|
133
|
+
orgId = _this$props2.orgId,
|
|
134
|
+
isBrowseUsersDisabled = _this$props2.isBrowseUsersDisabled;
|
|
166
135
|
var smartUserPickerProps = enableSmartUserPicker && !isBrowseUsersDisabled ? {
|
|
167
136
|
productKey: product,
|
|
168
137
|
principalId: loggedInAccountId,
|
|
@@ -196,11 +165,9 @@ export var UserPickerFieldComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
196
165
|
transform: this.handleUserPickerTransform
|
|
197
166
|
}, function (_ref2) {
|
|
198
167
|
var fieldProps = _ref2.fieldProps,
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
168
|
+
error = _ref2.error,
|
|
169
|
+
valid = _ref2.meta.valid;
|
|
202
170
|
var inviteWarningMessage = _this2.getInviteWarningMessage();
|
|
203
|
-
|
|
204
171
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(UserPickerComponent, _extends({}, fieldProps, commonPickerProps, smartUserPickerProps, {
|
|
205
172
|
addMoreMessage: intl.formatMessage(messages.userPickerAddMoreMessage),
|
|
206
173
|
menuPortalTarget: menuPortalTarget
|
|
@@ -208,7 +175,6 @@ export var UserPickerFieldComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
208
175
|
});
|
|
209
176
|
}
|
|
210
177
|
}]);
|
|
211
|
-
|
|
212
178
|
return UserPickerFieldComponent;
|
|
213
179
|
}(React.Component);
|
|
214
180
|
export var UserPickerField = injectIntl(UserPickerFieldComponent);
|
|
@@ -1,19 +1,14 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
|
|
3
2
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
4
|
-
|
|
5
3
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
6
|
-
|
|
7
4
|
import { isEmail, isTeam, isUser } from '@atlaskit/smart-user-picker';
|
|
8
|
-
|
|
9
5
|
var buildAttributes = function buildAttributes() {
|
|
10
6
|
var attributes = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
11
7
|
return _objectSpread({
|
|
12
8
|
packageName: "@atlaskit/share",
|
|
13
|
-
packageVersion: "3.7.
|
|
9
|
+
packageVersion: "3.7.2"
|
|
14
10
|
}, attributes);
|
|
15
11
|
};
|
|
16
|
-
|
|
17
12
|
var createEvent = function createEvent(eventType, source, action, actionSubject, actionSubjectId) {
|
|
18
13
|
var attributes = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : {};
|
|
19
14
|
return {
|
|
@@ -25,7 +20,6 @@ var createEvent = function createEvent(eventType, source, action, actionSubject,
|
|
|
25
20
|
attributes: buildAttributes(attributes)
|
|
26
21
|
};
|
|
27
22
|
};
|
|
28
|
-
|
|
29
23
|
var createScreenEvent = function createScreenEvent(name) {
|
|
30
24
|
var attributes = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
31
25
|
return {
|
|
@@ -34,13 +28,12 @@ var createScreenEvent = function createScreenEvent(name) {
|
|
|
34
28
|
attributes: buildAttributes(attributes)
|
|
35
29
|
};
|
|
36
30
|
};
|
|
37
|
-
|
|
38
31
|
export var CHANNEL_ID = 'fabric-elements';
|
|
39
32
|
export var ANALYTICS_SOURCE = 'shareModal';
|
|
40
33
|
export var INTEGRATION_MODAL_SOURCE = 'integrationShareDialog';
|
|
41
34
|
export var screenEvent = function screenEvent(_ref) {
|
|
42
35
|
var _ref$isPublicLink = _ref.isPublicLink,
|
|
43
|
-
|
|
36
|
+
isPublicLink = _ref$isPublicLink === void 0 ? false : _ref$isPublicLink;
|
|
44
37
|
return createScreenEvent(ANALYTICS_SOURCE, {
|
|
45
38
|
isPublicLink: isPublicLink
|
|
46
39
|
});
|
|
@@ -59,8 +52,9 @@ export var errorEncountered = function errorEncountered(actionSubjectId) {
|
|
|
59
52
|
return createEvent('operational', ANALYTICS_SOURCE, 'encountered', 'error', actionSubjectId, _objectSpread(_objectSpread({}, attributes), {}, {
|
|
60
53
|
source: ANALYTICS_SOURCE
|
|
61
54
|
}));
|
|
62
|
-
};
|
|
55
|
+
};
|
|
63
56
|
|
|
57
|
+
// = share dialog invoked. Not to be confused with "share submitted"
|
|
64
58
|
export var shareTriggerButtonClicked = function shareTriggerButtonClicked() {
|
|
65
59
|
return createEvent('ui', ANALYTICS_SOURCE, 'clicked', 'button', 'share');
|
|
66
60
|
};
|
|
@@ -120,25 +114,22 @@ export var formShareSubmitted = function formShareSubmitted(start, data, shareCo
|
|
|
120
114
|
isPublicLink: isPublicLink
|
|
121
115
|
}));
|
|
122
116
|
};
|
|
123
|
-
|
|
124
117
|
var duration = function duration(start) {
|
|
125
118
|
return Date.now() - start;
|
|
126
119
|
};
|
|
127
|
-
|
|
128
120
|
var getOriginTracingAttributes = function getOriginTracingAttributes(origin) {
|
|
129
121
|
return origin ? origin.toAnalyticsAttributes({
|
|
130
122
|
hasGeneratedId: true
|
|
131
123
|
}) : {};
|
|
132
124
|
};
|
|
133
|
-
|
|
134
125
|
var extractIdsByType = function extractIdsByType(data, checker) {
|
|
135
126
|
return data.users.filter(checker).map(function (option) {
|
|
136
127
|
return option.id;
|
|
137
128
|
});
|
|
138
129
|
};
|
|
139
|
-
|
|
140
130
|
var extractMemberCountsFromTeams = function extractMemberCountsFromTeams(data, checker) {
|
|
141
|
-
return (
|
|
131
|
+
return (
|
|
132
|
+
// teams with zero memberships cannot exist in share, so we use that
|
|
142
133
|
// as the default value for undefined team member counts
|
|
143
134
|
data.users.filter(checker).map(function (option) {
|
|
144
135
|
return option.memberCount || 0;
|