@atlaskit/user-picker 8.7.2 → 8.8.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 +18 -0
- package/dist/cjs/analytics.js +12 -9
- package/dist/cjs/components/ExternalUserOption/SourcesTooltipContent.js +103 -0
- package/dist/cjs/components/ExternalUserOption/main.js +7 -81
- package/dist/cjs/components/i18n.js +1 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/analytics.js +19 -14
- package/dist/es2019/components/ExternalUserOption/SourcesTooltipContent.js +72 -0
- package/dist/es2019/components/ExternalUserOption/main.js +2 -66
- package/dist/es2019/components/i18n.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/analytics.js +12 -9
- package/dist/esm/components/ExternalUserOption/SourcesTooltipContent.js +73 -0
- package/dist/esm/components/ExternalUserOption/main.js +5 -66
- package/dist/esm/components/i18n.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/components/ExternalUserOption/SourcesTooltipContent.d.ts +5 -0
- package/dist/types/components/ExternalUserOption/main.d.ts +0 -2
- package/dist/types/components/ExternalUserSourcesContainer.d.ts +3 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @atlaskit/user-picker
|
|
2
2
|
|
|
3
|
+
## 8.8.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`091da1d5f88`](https://bitbucket.org/atlassian/atlassian-frontend/commits/091da1d5f88) - [ux] Ensure items in the User Sources tooltip are unique and ordered correctly
|
|
8
|
+
|
|
9
|
+
## 8.7.4
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`35be12dee47`](https://bitbucket.org/atlassian/atlassian-frontend/commits/35be12dee47) - updated content copies for Org People Picker in user-picker and invite-people
|
|
14
|
+
|
|
15
|
+
## 8.7.3
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- [`7f37f923832`](https://bitbucket.org/atlassian/atlassian-frontend/commits/7f37f923832) - updated analytics event for org people picker in core invites
|
|
20
|
+
|
|
3
21
|
## 8.7.2
|
|
4
22
|
|
|
5
23
|
### Patch Changes
|
package/dist/cjs/analytics.js
CHANGED
|
@@ -59,20 +59,21 @@ var checkValidId = function checkValidId(id) {
|
|
|
59
59
|
|
|
60
60
|
var optionData2Analytics = function optionData2Analytics(option) {
|
|
61
61
|
var id = option.id,
|
|
62
|
-
type = option.type;
|
|
62
|
+
type = option.type; // id's of email types are emails which is PII
|
|
63
|
+
|
|
64
|
+
var validatedData = {
|
|
65
|
+
id: checkValidId(id) ? id : null,
|
|
66
|
+
type: type || null
|
|
67
|
+
};
|
|
63
68
|
|
|
64
69
|
if ((0, _utils.isExternalUser)(option)) {
|
|
65
|
-
return {
|
|
70
|
+
return _objectSpread(_objectSpread({}, validatedData), {}, {
|
|
66
71
|
type: 'external_user',
|
|
67
72
|
sources: option.sources,
|
|
68
73
|
externalUserType: option.externalUserType
|
|
69
|
-
};
|
|
74
|
+
});
|
|
70
75
|
} else {
|
|
71
|
-
|
|
72
|
-
return {
|
|
73
|
-
id: checkValidId(id) ? id : null,
|
|
74
|
-
type: type || null
|
|
75
|
-
};
|
|
76
|
+
return validatedData;
|
|
76
77
|
}
|
|
77
78
|
};
|
|
78
79
|
|
|
@@ -153,12 +154,14 @@ var selectEvent = function selectEvent(props, state, session, journeyId) {
|
|
|
153
154
|
exports.selectEvent = selectEvent;
|
|
154
155
|
|
|
155
156
|
var searchedEvent = function searchedEvent(props, state, session, journeyId) {
|
|
157
|
+
var searchResults = results(state);
|
|
156
158
|
return createEvent('operational', 'searched', 'userPicker', _objectSpread(_objectSpread({}, createDefaultPickerAttributes(props, session, journeyId)), {}, {
|
|
157
159
|
sessionDuration: sessionDuration(session),
|
|
158
160
|
durationSinceInputChange: durationSinceInputChange(session),
|
|
159
161
|
queryLength: queryLength(state),
|
|
160
162
|
isLoading: isLoading(props, state),
|
|
161
|
-
results:
|
|
163
|
+
results: searchResults,
|
|
164
|
+
numberOfResults: searchResults.length
|
|
162
165
|
}));
|
|
163
166
|
};
|
|
164
167
|
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.SourcesTooltipContent = exports.SourcesTooltipContainer = exports.SourceWrapper = void 0;
|
|
9
|
+
|
|
10
|
+
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
11
|
+
|
|
12
|
+
var _react = _interopRequireDefault(require("react"));
|
|
13
|
+
|
|
14
|
+
var _reactIntlNext = require("react-intl-next");
|
|
15
|
+
|
|
16
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
17
|
+
|
|
18
|
+
var _logo = require("@atlaskit/logo");
|
|
19
|
+
|
|
20
|
+
var _spinner = _interopRequireDefault(require("@atlaskit/spinner/spinner"));
|
|
21
|
+
|
|
22
|
+
var _slack = require("../assets/slack");
|
|
23
|
+
|
|
24
|
+
var _google = require("../assets/google");
|
|
25
|
+
|
|
26
|
+
var _microsoft = require("../assets/microsoft");
|
|
27
|
+
|
|
28
|
+
var _github = require("../assets/github");
|
|
29
|
+
|
|
30
|
+
var _i18n = require("../i18n");
|
|
31
|
+
|
|
32
|
+
var _main = require("./main");
|
|
33
|
+
|
|
34
|
+
var _templateObject, _templateObject2;
|
|
35
|
+
|
|
36
|
+
var SourcesTooltipContainer = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n padding-bottom: 4px;\n padding-right: 4px;\n"])));
|
|
37
|
+
|
|
38
|
+
exports.SourcesTooltipContainer = SourcesTooltipContainer;
|
|
39
|
+
|
|
40
|
+
var SourceWrapper = _styledComponents.default.div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n padding-top: 4px;\n display: flex;\n align-items: center;\n"])));
|
|
41
|
+
|
|
42
|
+
exports.SourceWrapper = SourceWrapper;
|
|
43
|
+
var SUPPORTED_SOURCES = [{
|
|
44
|
+
sourceType: 'jira',
|
|
45
|
+
icon: /*#__PURE__*/_react.default.createElement(_logo.JiraIcon, {
|
|
46
|
+
size: 'xsmall'
|
|
47
|
+
}),
|
|
48
|
+
label: _i18n.messages.jiraSource
|
|
49
|
+
}, {
|
|
50
|
+
sourceType: 'confluence',
|
|
51
|
+
icon: /*#__PURE__*/_react.default.createElement(_logo.ConfluenceIcon, {
|
|
52
|
+
size: 'xsmall'
|
|
53
|
+
}),
|
|
54
|
+
label: _i18n.messages.confluenceSource
|
|
55
|
+
}, {
|
|
56
|
+
sourceType: 'other-atlassian',
|
|
57
|
+
icon: /*#__PURE__*/_react.default.createElement(_logo.AtlassianIcon, {
|
|
58
|
+
size: 'xsmall'
|
|
59
|
+
}),
|
|
60
|
+
label: _i18n.messages.otherAtlassianSource
|
|
61
|
+
}, {
|
|
62
|
+
sourceType: 'slack',
|
|
63
|
+
icon: /*#__PURE__*/_react.default.createElement(_slack.SlackIcon, null),
|
|
64
|
+
label: _i18n.messages.slackProvider
|
|
65
|
+
}, {
|
|
66
|
+
sourceType: 'google',
|
|
67
|
+
icon: /*#__PURE__*/_react.default.createElement(_google.GoogleIcon, null),
|
|
68
|
+
label: _i18n.messages.googleProvider
|
|
69
|
+
}, {
|
|
70
|
+
sourceType: 'microsoft',
|
|
71
|
+
icon: /*#__PURE__*/_react.default.createElement(_microsoft.MicrosoftIcon, null),
|
|
72
|
+
label: _i18n.messages.microsoftProvider
|
|
73
|
+
}, {
|
|
74
|
+
sourceType: 'github',
|
|
75
|
+
icon: /*#__PURE__*/_react.default.createElement(_github.GitHubIcon, null),
|
|
76
|
+
label: _i18n.messages.gitHubProvider
|
|
77
|
+
}];
|
|
78
|
+
|
|
79
|
+
var SourcesTooltipContent = function SourcesTooltipContent(_ref) {
|
|
80
|
+
var sources = _ref.sources,
|
|
81
|
+
sourcesLoading = _ref.sourcesLoading,
|
|
82
|
+
sourcesError = _ref.sourcesError;
|
|
83
|
+
|
|
84
|
+
var sourcesToRender = _react.default.useMemo(function () {
|
|
85
|
+
return SUPPORTED_SOURCES.filter(function (supportedSource) {
|
|
86
|
+
return sources.includes(supportedSource.sourceType);
|
|
87
|
+
});
|
|
88
|
+
}, [sources]);
|
|
89
|
+
|
|
90
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, sourcesError !== null && sources.length === 0 ? /*#__PURE__*/_react.default.createElement("span", null, /*#__PURE__*/_react.default.createElement(_reactIntlNext.FormattedMessage, _i18n.messages.externalUserSourcesError)) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("span", null, /*#__PURE__*/_react.default.createElement(_reactIntlNext.FormattedMessage, _i18n.messages.externalUserSourcesHeading)), /*#__PURE__*/_react.default.createElement(SourcesTooltipContainer, null, sourcesLoading && /*#__PURE__*/_react.default.createElement(_spinner.default, {
|
|
91
|
+
size: "small",
|
|
92
|
+
appearance: "invert"
|
|
93
|
+
}), !sourcesLoading && sourcesToRender.map(function (_ref2) {
|
|
94
|
+
var sourceType = _ref2.sourceType,
|
|
95
|
+
icon = _ref2.icon,
|
|
96
|
+
label = _ref2.label;
|
|
97
|
+
return /*#__PURE__*/_react.default.createElement(SourceWrapper, {
|
|
98
|
+
key: sourceType
|
|
99
|
+
}, /*#__PURE__*/_react.default.createElement(_main.ImageContainer, null, icon), /*#__PURE__*/_react.default.createElement("span", null, /*#__PURE__*/_react.default.createElement(_reactIntlNext.FormattedMessage, label)));
|
|
100
|
+
}))));
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
exports.SourcesTooltipContent = SourcesTooltipContent;
|
|
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.
|
|
8
|
+
exports.ImageContainer = exports.ExternalUserOption = exports.EmailDomainWrapper = void 0;
|
|
9
9
|
|
|
10
10
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
11
11
|
|
|
@@ -27,14 +27,8 @@ var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/hel
|
|
|
27
27
|
|
|
28
28
|
var _react = _interopRequireDefault(require("react"));
|
|
29
29
|
|
|
30
|
-
var _reactIntlNext = require("react-intl-next");
|
|
31
|
-
|
|
32
30
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
33
31
|
|
|
34
|
-
var _logo = require("@atlaskit/logo");
|
|
35
|
-
|
|
36
|
-
var _spinner = _interopRequireDefault(require("@atlaskit/spinner"));
|
|
37
|
-
|
|
38
32
|
var _colors = require("@atlaskit/theme/colors");
|
|
39
33
|
|
|
40
34
|
var _tokens = require("@atlaskit/tokens");
|
|
@@ -45,23 +39,15 @@ var _AvatarItemOption = require("../AvatarItemOption");
|
|
|
45
39
|
|
|
46
40
|
var _SizeableAvatar = require("../SizeableAvatar");
|
|
47
41
|
|
|
48
|
-
var _slack = require("../assets/slack");
|
|
49
|
-
|
|
50
|
-
var _google = require("../assets/google");
|
|
51
|
-
|
|
52
|
-
var _microsoft = require("../assets/microsoft");
|
|
53
|
-
|
|
54
|
-
var _github = require("../assets/github");
|
|
55
|
-
|
|
56
|
-
var _i18n = require("../i18n");
|
|
57
|
-
|
|
58
42
|
var _ExternalUserSourcesContainer = require("../ExternalUserSourcesContainer");
|
|
59
43
|
|
|
60
44
|
var _InfoIcon = _interopRequireDefault(require("./InfoIcon"));
|
|
61
45
|
|
|
62
46
|
var _ExternalAvatarItemOption = require("./ExternalAvatarItemOption");
|
|
63
47
|
|
|
64
|
-
var
|
|
48
|
+
var _SourcesTooltipContent = require("./SourcesTooltipContent");
|
|
49
|
+
|
|
50
|
+
var _templateObject, _templateObject2;
|
|
65
51
|
|
|
66
52
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
67
53
|
|
|
@@ -71,52 +57,9 @@ var ImageContainer = _styledComponents.default.span(_templateObject || (_templat
|
|
|
71
57
|
|
|
72
58
|
exports.ImageContainer = ImageContainer;
|
|
73
59
|
|
|
74
|
-
var
|
|
75
|
-
|
|
76
|
-
exports.SourcesTooltipContainer = SourcesTooltipContainer;
|
|
77
|
-
|
|
78
|
-
var SourceWrapper = _styledComponents.default.div(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n padding-top: 4px;\n display: flex;\n align-items: center;\n"])));
|
|
79
|
-
|
|
80
|
-
exports.SourceWrapper = SourceWrapper;
|
|
81
|
-
|
|
82
|
-
var EmailDomainWrapper = _styledComponents.default.span(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n font-weight: bold;\n"])));
|
|
60
|
+
var EmailDomainWrapper = _styledComponents.default.span(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n font-weight: bold;\n"])));
|
|
83
61
|
|
|
84
62
|
exports.EmailDomainWrapper = EmailDomainWrapper;
|
|
85
|
-
var SourcesInfoMap = new Map([['slack', {
|
|
86
|
-
key: 'slack',
|
|
87
|
-
icon: /*#__PURE__*/_react.default.createElement(_slack.SlackIcon, null),
|
|
88
|
-
label: _i18n.messages.slackProvider
|
|
89
|
-
}], ['google', {
|
|
90
|
-
key: 'google',
|
|
91
|
-
icon: /*#__PURE__*/_react.default.createElement(_google.GoogleIcon, null),
|
|
92
|
-
label: _i18n.messages.googleProvider
|
|
93
|
-
}], ['microsoft', {
|
|
94
|
-
key: 'microsoft',
|
|
95
|
-
icon: /*#__PURE__*/_react.default.createElement(_microsoft.MicrosoftIcon, null),
|
|
96
|
-
label: _i18n.messages.microsoftProvider
|
|
97
|
-
}], ['github', {
|
|
98
|
-
key: 'github',
|
|
99
|
-
icon: /*#__PURE__*/_react.default.createElement(_github.GitHubIcon, null),
|
|
100
|
-
label: _i18n.messages.gitHubProvider
|
|
101
|
-
}], ['jira', {
|
|
102
|
-
key: 'jira',
|
|
103
|
-
icon: /*#__PURE__*/_react.default.createElement(_logo.JiraIcon, {
|
|
104
|
-
size: 'xsmall'
|
|
105
|
-
}),
|
|
106
|
-
label: _i18n.messages.jiraSource
|
|
107
|
-
}], ['confluence', {
|
|
108
|
-
key: 'confluence',
|
|
109
|
-
icon: /*#__PURE__*/_react.default.createElement(_logo.ConfluenceIcon, {
|
|
110
|
-
size: 'xsmall'
|
|
111
|
-
}),
|
|
112
|
-
label: _i18n.messages.confluenceSource
|
|
113
|
-
}], ['other-atlassian', {
|
|
114
|
-
key: 'other-atlassian',
|
|
115
|
-
icon: /*#__PURE__*/_react.default.createElement(_logo.AtlassianIcon, {
|
|
116
|
-
size: 'xsmall'
|
|
117
|
-
}),
|
|
118
|
-
label: _i18n.messages.otherAtlassianSource
|
|
119
|
-
}]]);
|
|
120
63
|
|
|
121
64
|
var ExternalUserOption = /*#__PURE__*/function (_React$PureComponent) {
|
|
122
65
|
(0, _inherits2.default)(ExternalUserOption, _React$PureComponent);
|
|
@@ -200,25 +143,8 @@ var ExternalUserOption = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
200
143
|
accountId: id,
|
|
201
144
|
shouldFetchSources: Boolean(requiresSourceHydration),
|
|
202
145
|
initialSources: sources
|
|
203
|
-
}, function (
|
|
204
|
-
|
|
205
|
-
sourcesLoading = _ref.sourcesLoading,
|
|
206
|
-
sourcesError = _ref.sourcesError;
|
|
207
|
-
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, sourcesError !== null && sources.length === 0 ? /*#__PURE__*/_react.default.createElement("span", null, /*#__PURE__*/_react.default.createElement(_reactIntlNext.FormattedMessage, _i18n.messages.externalUserSourcesError)) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("span", null, /*#__PURE__*/_react.default.createElement(_reactIntlNext.FormattedMessage, _i18n.messages.externalUserSourcesHeading)), /*#__PURE__*/_react.default.createElement(SourcesTooltipContainer, null, sourcesLoading && /*#__PURE__*/_react.default.createElement(_spinner.default, {
|
|
208
|
-
size: "small",
|
|
209
|
-
appearance: "invert"
|
|
210
|
-
}), !sourcesLoading && sources.map(function (s) {
|
|
211
|
-
return SourcesInfoMap.get(s);
|
|
212
|
-
}).filter(function (s) {
|
|
213
|
-
return s;
|
|
214
|
-
}).map(function (_ref2) {
|
|
215
|
-
var key = _ref2.key,
|
|
216
|
-
icon = _ref2.icon,
|
|
217
|
-
label = _ref2.label;
|
|
218
|
-
return /*#__PURE__*/_react.default.createElement(SourceWrapper, {
|
|
219
|
-
key: key
|
|
220
|
-
}, /*#__PURE__*/_react.default.createElement(ImageContainer, null, icon), /*#__PURE__*/_react.default.createElement("span", null, /*#__PURE__*/_react.default.createElement(_reactIntlNext.FormattedMessage, label)));
|
|
221
|
-
}))));
|
|
146
|
+
}, function (sourceData) {
|
|
147
|
+
return /*#__PURE__*/_react.default.createElement(_SourcesTooltipContent.SourcesTooltipContent, sourceData);
|
|
222
148
|
});
|
|
223
149
|
}
|
|
224
150
|
}]);
|
|
@@ -55,7 +55,7 @@ var messages = (0, _reactIntlNext.defineMessages)({
|
|
|
55
55
|
},
|
|
56
56
|
selectToAddEmail: {
|
|
57
57
|
id: 'fabric.elements.user-picker.email.select.to.add',
|
|
58
|
-
defaultMessage: 'Select
|
|
58
|
+
defaultMessage: 'Select then Invite',
|
|
59
59
|
description: 'Byline for valid email option.'
|
|
60
60
|
},
|
|
61
61
|
continueToAddEmail: {
|
package/dist/cjs/version.json
CHANGED
package/dist/es2019/analytics.js
CHANGED
|
@@ -34,20 +34,21 @@ const optionData2Analytics = option => {
|
|
|
34
34
|
const {
|
|
35
35
|
id,
|
|
36
36
|
type
|
|
37
|
-
} = option;
|
|
37
|
+
} = option; // id's of email types are emails which is PII
|
|
38
|
+
|
|
39
|
+
const validatedData = {
|
|
40
|
+
id: checkValidId(id) ? id : null,
|
|
41
|
+
type: type || null
|
|
42
|
+
};
|
|
38
43
|
|
|
39
44
|
if (isExternalUser(option)) {
|
|
40
|
-
return {
|
|
45
|
+
return { ...validatedData,
|
|
41
46
|
type: 'external_user',
|
|
42
47
|
sources: option.sources,
|
|
43
48
|
externalUserType: option.externalUserType
|
|
44
49
|
};
|
|
45
50
|
} else {
|
|
46
|
-
|
|
47
|
-
return {
|
|
48
|
-
id: checkValidId(id) ? id : null,
|
|
49
|
-
type: type || null
|
|
50
|
-
};
|
|
51
|
+
return validatedData;
|
|
51
52
|
}
|
|
52
53
|
};
|
|
53
54
|
|
|
@@ -101,13 +102,17 @@ export const selectEvent = (props, state, session, journeyId, ...args) => {
|
|
|
101
102
|
result: result(args[0])
|
|
102
103
|
});
|
|
103
104
|
};
|
|
104
|
-
export const searchedEvent = (props, state, session, journeyId) =>
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
105
|
+
export const searchedEvent = (props, state, session, journeyId) => {
|
|
106
|
+
const searchResults = results(state);
|
|
107
|
+
return createEvent('operational', 'searched', 'userPicker', { ...createDefaultPickerAttributes(props, session, journeyId),
|
|
108
|
+
sessionDuration: sessionDuration(session),
|
|
109
|
+
durationSinceInputChange: durationSinceInputChange(session),
|
|
110
|
+
queryLength: queryLength(state),
|
|
111
|
+
isLoading: isLoading(props, state),
|
|
112
|
+
results: searchResults,
|
|
113
|
+
numberOfResults: searchResults.length
|
|
114
|
+
});
|
|
115
|
+
};
|
|
111
116
|
export const failedEvent = (props, _, session, journeyId) => createEvent('operational', 'failed', 'userPicker', { ...createDefaultPickerAttributes(props, session, journeyId)
|
|
112
117
|
});
|
|
113
118
|
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { FormattedMessage } from 'react-intl-next';
|
|
3
|
+
import styled from 'styled-components';
|
|
4
|
+
import { AtlassianIcon, ConfluenceIcon, JiraIcon } from '@atlaskit/logo';
|
|
5
|
+
import Spinner from '@atlaskit/spinner/spinner';
|
|
6
|
+
import { SlackIcon } from '../assets/slack';
|
|
7
|
+
import { GoogleIcon } from '../assets/google';
|
|
8
|
+
import { MicrosoftIcon } from '../assets/microsoft';
|
|
9
|
+
import { GitHubIcon } from '../assets/github';
|
|
10
|
+
import { messages } from '../i18n';
|
|
11
|
+
import { ImageContainer } from './main';
|
|
12
|
+
export const SourcesTooltipContainer = styled.div`
|
|
13
|
+
padding-bottom: 4px;
|
|
14
|
+
padding-right: 4px;
|
|
15
|
+
`;
|
|
16
|
+
export const SourceWrapper = styled.div`
|
|
17
|
+
padding-top: 4px;
|
|
18
|
+
display: flex;
|
|
19
|
+
align-items: center;
|
|
20
|
+
`;
|
|
21
|
+
const SUPPORTED_SOURCES = [{
|
|
22
|
+
sourceType: 'jira',
|
|
23
|
+
icon: /*#__PURE__*/React.createElement(JiraIcon, {
|
|
24
|
+
size: 'xsmall'
|
|
25
|
+
}),
|
|
26
|
+
label: messages.jiraSource
|
|
27
|
+
}, {
|
|
28
|
+
sourceType: 'confluence',
|
|
29
|
+
icon: /*#__PURE__*/React.createElement(ConfluenceIcon, {
|
|
30
|
+
size: 'xsmall'
|
|
31
|
+
}),
|
|
32
|
+
label: messages.confluenceSource
|
|
33
|
+
}, {
|
|
34
|
+
sourceType: 'other-atlassian',
|
|
35
|
+
icon: /*#__PURE__*/React.createElement(AtlassianIcon, {
|
|
36
|
+
size: 'xsmall'
|
|
37
|
+
}),
|
|
38
|
+
label: messages.otherAtlassianSource
|
|
39
|
+
}, {
|
|
40
|
+
sourceType: 'slack',
|
|
41
|
+
icon: /*#__PURE__*/React.createElement(SlackIcon, null),
|
|
42
|
+
label: messages.slackProvider
|
|
43
|
+
}, {
|
|
44
|
+
sourceType: 'google',
|
|
45
|
+
icon: /*#__PURE__*/React.createElement(GoogleIcon, null),
|
|
46
|
+
label: messages.googleProvider
|
|
47
|
+
}, {
|
|
48
|
+
sourceType: 'microsoft',
|
|
49
|
+
icon: /*#__PURE__*/React.createElement(MicrosoftIcon, null),
|
|
50
|
+
label: messages.microsoftProvider
|
|
51
|
+
}, {
|
|
52
|
+
sourceType: 'github',
|
|
53
|
+
icon: /*#__PURE__*/React.createElement(GitHubIcon, null),
|
|
54
|
+
label: messages.gitHubProvider
|
|
55
|
+
}];
|
|
56
|
+
export const SourcesTooltipContent = ({
|
|
57
|
+
sources,
|
|
58
|
+
sourcesLoading,
|
|
59
|
+
sourcesError
|
|
60
|
+
}) => {
|
|
61
|
+
const sourcesToRender = React.useMemo(() => SUPPORTED_SOURCES.filter(supportedSource => sources.includes(supportedSource.sourceType)), [sources]);
|
|
62
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, sourcesError !== null && sources.length === 0 ? /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(FormattedMessage, messages.externalUserSourcesError)) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(FormattedMessage, messages.externalUserSourcesHeading)), /*#__PURE__*/React.createElement(SourcesTooltipContainer, null, sourcesLoading && /*#__PURE__*/React.createElement(Spinner, {
|
|
63
|
+
size: "small",
|
|
64
|
+
appearance: "invert"
|
|
65
|
+
}), !sourcesLoading && sourcesToRender.map(({
|
|
66
|
+
sourceType,
|
|
67
|
+
icon,
|
|
68
|
+
label
|
|
69
|
+
}) => /*#__PURE__*/React.createElement(SourceWrapper, {
|
|
70
|
+
key: sourceType
|
|
71
|
+
}, /*#__PURE__*/React.createElement(ImageContainer, null, icon), /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(FormattedMessage, label)))))));
|
|
72
|
+
};
|
|
@@ -1,22 +1,15 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import { FormattedMessage } from 'react-intl-next';
|
|
4
3
|
import styled from 'styled-components';
|
|
5
|
-
import { ConfluenceIcon, JiraIcon, AtlassianIcon } from '@atlaskit/logo';
|
|
6
|
-
import Spinner from '@atlaskit/spinner';
|
|
7
4
|
import { B400, N200, N800 } from '@atlaskit/theme/colors';
|
|
8
5
|
import { token } from '@atlaskit/tokens';
|
|
9
6
|
import Tooltip from '@atlaskit/tooltip';
|
|
10
7
|
import { TextWrapper } from '../AvatarItemOption';
|
|
11
8
|
import { SizeableAvatar } from '../SizeableAvatar';
|
|
12
|
-
import { SlackIcon } from '../assets/slack';
|
|
13
|
-
import { GoogleIcon } from '../assets/google';
|
|
14
|
-
import { MicrosoftIcon } from '../assets/microsoft';
|
|
15
|
-
import { GitHubIcon } from '../assets/github';
|
|
16
|
-
import { messages } from '../i18n';
|
|
17
9
|
import { ExternalUserSourcesContainer } from '../ExternalUserSourcesContainer';
|
|
18
10
|
import InfoIcon from './InfoIcon';
|
|
19
11
|
import { ExternalAvatarItemOption } from './ExternalAvatarItemOption';
|
|
12
|
+
import { SourcesTooltipContent } from './SourcesTooltipContent';
|
|
20
13
|
export const ImageContainer = styled.span`
|
|
21
14
|
height: 16px;
|
|
22
15
|
width: 16px;
|
|
@@ -25,53 +18,9 @@ export const ImageContainer = styled.span`
|
|
|
25
18
|
align-items: center;
|
|
26
19
|
justify-content: center;
|
|
27
20
|
`;
|
|
28
|
-
export const SourcesTooltipContainer = styled.div`
|
|
29
|
-
padding-bottom: 4px;
|
|
30
|
-
padding-right: 4px;
|
|
31
|
-
`;
|
|
32
|
-
export const SourceWrapper = styled.div`
|
|
33
|
-
padding-top: 4px;
|
|
34
|
-
display: flex;
|
|
35
|
-
align-items: center;
|
|
36
|
-
`;
|
|
37
21
|
export const EmailDomainWrapper = styled.span`
|
|
38
22
|
font-weight: bold;
|
|
39
23
|
`;
|
|
40
|
-
const SourcesInfoMap = new Map([['slack', {
|
|
41
|
-
key: 'slack',
|
|
42
|
-
icon: /*#__PURE__*/React.createElement(SlackIcon, null),
|
|
43
|
-
label: messages.slackProvider
|
|
44
|
-
}], ['google', {
|
|
45
|
-
key: 'google',
|
|
46
|
-
icon: /*#__PURE__*/React.createElement(GoogleIcon, null),
|
|
47
|
-
label: messages.googleProvider
|
|
48
|
-
}], ['microsoft', {
|
|
49
|
-
key: 'microsoft',
|
|
50
|
-
icon: /*#__PURE__*/React.createElement(MicrosoftIcon, null),
|
|
51
|
-
label: messages.microsoftProvider
|
|
52
|
-
}], ['github', {
|
|
53
|
-
key: 'github',
|
|
54
|
-
icon: /*#__PURE__*/React.createElement(GitHubIcon, null),
|
|
55
|
-
label: messages.gitHubProvider
|
|
56
|
-
}], ['jira', {
|
|
57
|
-
key: 'jira',
|
|
58
|
-
icon: /*#__PURE__*/React.createElement(JiraIcon, {
|
|
59
|
-
size: 'xsmall'
|
|
60
|
-
}),
|
|
61
|
-
label: messages.jiraSource
|
|
62
|
-
}], ['confluence', {
|
|
63
|
-
key: 'confluence',
|
|
64
|
-
icon: /*#__PURE__*/React.createElement(ConfluenceIcon, {
|
|
65
|
-
size: 'xsmall'
|
|
66
|
-
}),
|
|
67
|
-
label: messages.confluenceSource
|
|
68
|
-
}], ['other-atlassian', {
|
|
69
|
-
key: 'other-atlassian',
|
|
70
|
-
icon: /*#__PURE__*/React.createElement(AtlassianIcon, {
|
|
71
|
-
size: 'xsmall'
|
|
72
|
-
}),
|
|
73
|
-
label: messages.otherAtlassianSource
|
|
74
|
-
}]]);
|
|
75
24
|
export class ExternalUserOption extends React.PureComponent {
|
|
76
25
|
constructor(...args) {
|
|
77
26
|
super(...args);
|
|
@@ -147,20 +96,7 @@ export class ExternalUserOption extends React.PureComponent {
|
|
|
147
96
|
accountId: id,
|
|
148
97
|
shouldFetchSources: Boolean(requiresSourceHydration),
|
|
149
98
|
initialSources: sources
|
|
150
|
-
}, (
|
|
151
|
-
sources,
|
|
152
|
-
sourcesLoading,
|
|
153
|
-
sourcesError
|
|
154
|
-
}) => /*#__PURE__*/React.createElement(React.Fragment, null, sourcesError !== null && sources.length === 0 ? /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(FormattedMessage, messages.externalUserSourcesError)) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(FormattedMessage, messages.externalUserSourcesHeading)), /*#__PURE__*/React.createElement(SourcesTooltipContainer, null, sourcesLoading && /*#__PURE__*/React.createElement(Spinner, {
|
|
155
|
-
size: "small",
|
|
156
|
-
appearance: "invert"
|
|
157
|
-
}), !sourcesLoading && sources.map(s => SourcesInfoMap.get(s)).filter(s => s).map(({
|
|
158
|
-
key,
|
|
159
|
-
icon,
|
|
160
|
-
label
|
|
161
|
-
}) => /*#__PURE__*/React.createElement(SourceWrapper, {
|
|
162
|
-
key: key
|
|
163
|
-
}, /*#__PURE__*/React.createElement(ImageContainer, null, icon), /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(FormattedMessage, label))))))));
|
|
99
|
+
}, sourceData => /*#__PURE__*/React.createElement(SourcesTooltipContent, sourceData));
|
|
164
100
|
}
|
|
165
101
|
|
|
166
102
|
}
|
|
@@ -47,7 +47,7 @@ export const messages = defineMessages({
|
|
|
47
47
|
},
|
|
48
48
|
selectToAddEmail: {
|
|
49
49
|
id: 'fabric.elements.user-picker.email.select.to.add',
|
|
50
|
-
defaultMessage: 'Select
|
|
50
|
+
defaultMessage: 'Select then Invite',
|
|
51
51
|
description: 'Byline for valid email option.'
|
|
52
52
|
},
|
|
53
53
|
continueToAddEmail: {
|
package/dist/es2019/version.json
CHANGED
package/dist/esm/analytics.js
CHANGED
|
@@ -42,20 +42,21 @@ var checkValidId = function checkValidId(id) {
|
|
|
42
42
|
|
|
43
43
|
var optionData2Analytics = function optionData2Analytics(option) {
|
|
44
44
|
var id = option.id,
|
|
45
|
-
type = option.type;
|
|
45
|
+
type = option.type; // id's of email types are emails which is PII
|
|
46
|
+
|
|
47
|
+
var validatedData = {
|
|
48
|
+
id: checkValidId(id) ? id : null,
|
|
49
|
+
type: type || null
|
|
50
|
+
};
|
|
46
51
|
|
|
47
52
|
if (isExternalUser(option)) {
|
|
48
|
-
return {
|
|
53
|
+
return _objectSpread(_objectSpread({}, validatedData), {}, {
|
|
49
54
|
type: 'external_user',
|
|
50
55
|
sources: option.sources,
|
|
51
56
|
externalUserType: option.externalUserType
|
|
52
|
-
};
|
|
57
|
+
});
|
|
53
58
|
} else {
|
|
54
|
-
|
|
55
|
-
return {
|
|
56
|
-
id: checkValidId(id) ? id : null,
|
|
57
|
-
type: type || null
|
|
58
|
-
};
|
|
59
|
+
return validatedData;
|
|
59
60
|
}
|
|
60
61
|
};
|
|
61
62
|
|
|
@@ -121,12 +122,14 @@ export var selectEvent = function selectEvent(props, state, session, journeyId)
|
|
|
121
122
|
}));
|
|
122
123
|
};
|
|
123
124
|
export var searchedEvent = function searchedEvent(props, state, session, journeyId) {
|
|
125
|
+
var searchResults = results(state);
|
|
124
126
|
return createEvent('operational', 'searched', 'userPicker', _objectSpread(_objectSpread({}, createDefaultPickerAttributes(props, session, journeyId)), {}, {
|
|
125
127
|
sessionDuration: sessionDuration(session),
|
|
126
128
|
durationSinceInputChange: durationSinceInputChange(session),
|
|
127
129
|
queryLength: queryLength(state),
|
|
128
130
|
isLoading: isLoading(props, state),
|
|
129
|
-
results:
|
|
131
|
+
results: searchResults,
|
|
132
|
+
numberOfResults: searchResults.length
|
|
130
133
|
}));
|
|
131
134
|
};
|
|
132
135
|
export var failedEvent = function failedEvent(props, _, session, journeyId) {
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
|
+
|
|
3
|
+
var _templateObject, _templateObject2;
|
|
4
|
+
|
|
5
|
+
import React from 'react';
|
|
6
|
+
import { FormattedMessage } from 'react-intl-next';
|
|
7
|
+
import styled from 'styled-components';
|
|
8
|
+
import { AtlassianIcon, ConfluenceIcon, JiraIcon } from '@atlaskit/logo';
|
|
9
|
+
import Spinner from '@atlaskit/spinner/spinner';
|
|
10
|
+
import { SlackIcon } from '../assets/slack';
|
|
11
|
+
import { GoogleIcon } from '../assets/google';
|
|
12
|
+
import { MicrosoftIcon } from '../assets/microsoft';
|
|
13
|
+
import { GitHubIcon } from '../assets/github';
|
|
14
|
+
import { messages } from '../i18n';
|
|
15
|
+
import { ImageContainer } from './main';
|
|
16
|
+
export var SourcesTooltipContainer = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n padding-bottom: 4px;\n padding-right: 4px;\n"])));
|
|
17
|
+
export var SourceWrapper = styled.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n padding-top: 4px;\n display: flex;\n align-items: center;\n"])));
|
|
18
|
+
var SUPPORTED_SOURCES = [{
|
|
19
|
+
sourceType: 'jira',
|
|
20
|
+
icon: /*#__PURE__*/React.createElement(JiraIcon, {
|
|
21
|
+
size: 'xsmall'
|
|
22
|
+
}),
|
|
23
|
+
label: messages.jiraSource
|
|
24
|
+
}, {
|
|
25
|
+
sourceType: 'confluence',
|
|
26
|
+
icon: /*#__PURE__*/React.createElement(ConfluenceIcon, {
|
|
27
|
+
size: 'xsmall'
|
|
28
|
+
}),
|
|
29
|
+
label: messages.confluenceSource
|
|
30
|
+
}, {
|
|
31
|
+
sourceType: 'other-atlassian',
|
|
32
|
+
icon: /*#__PURE__*/React.createElement(AtlassianIcon, {
|
|
33
|
+
size: 'xsmall'
|
|
34
|
+
}),
|
|
35
|
+
label: messages.otherAtlassianSource
|
|
36
|
+
}, {
|
|
37
|
+
sourceType: 'slack',
|
|
38
|
+
icon: /*#__PURE__*/React.createElement(SlackIcon, null),
|
|
39
|
+
label: messages.slackProvider
|
|
40
|
+
}, {
|
|
41
|
+
sourceType: 'google',
|
|
42
|
+
icon: /*#__PURE__*/React.createElement(GoogleIcon, null),
|
|
43
|
+
label: messages.googleProvider
|
|
44
|
+
}, {
|
|
45
|
+
sourceType: 'microsoft',
|
|
46
|
+
icon: /*#__PURE__*/React.createElement(MicrosoftIcon, null),
|
|
47
|
+
label: messages.microsoftProvider
|
|
48
|
+
}, {
|
|
49
|
+
sourceType: 'github',
|
|
50
|
+
icon: /*#__PURE__*/React.createElement(GitHubIcon, null),
|
|
51
|
+
label: messages.gitHubProvider
|
|
52
|
+
}];
|
|
53
|
+
export var SourcesTooltipContent = function SourcesTooltipContent(_ref) {
|
|
54
|
+
var sources = _ref.sources,
|
|
55
|
+
sourcesLoading = _ref.sourcesLoading,
|
|
56
|
+
sourcesError = _ref.sourcesError;
|
|
57
|
+
var sourcesToRender = React.useMemo(function () {
|
|
58
|
+
return SUPPORTED_SOURCES.filter(function (supportedSource) {
|
|
59
|
+
return sources.includes(supportedSource.sourceType);
|
|
60
|
+
});
|
|
61
|
+
}, [sources]);
|
|
62
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, sourcesError !== null && sources.length === 0 ? /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(FormattedMessage, messages.externalUserSourcesError)) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(FormattedMessage, messages.externalUserSourcesHeading)), /*#__PURE__*/React.createElement(SourcesTooltipContainer, null, sourcesLoading && /*#__PURE__*/React.createElement(Spinner, {
|
|
63
|
+
size: "small",
|
|
64
|
+
appearance: "invert"
|
|
65
|
+
}), !sourcesLoading && sourcesToRender.map(function (_ref2) {
|
|
66
|
+
var sourceType = _ref2.sourceType,
|
|
67
|
+
icon = _ref2.icon,
|
|
68
|
+
label = _ref2.label;
|
|
69
|
+
return /*#__PURE__*/React.createElement(SourceWrapper, {
|
|
70
|
+
key: sourceType
|
|
71
|
+
}, /*#__PURE__*/React.createElement(ImageContainer, null, icon), /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(FormattedMessage, label)));
|
|
72
|
+
}))));
|
|
73
|
+
};
|
|
@@ -8,69 +8,25 @@ import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
|
8
8
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
9
9
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
10
10
|
|
|
11
|
-
var _templateObject, _templateObject2
|
|
11
|
+
var _templateObject, _templateObject2;
|
|
12
12
|
|
|
13
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); }; }
|
|
14
14
|
|
|
15
15
|
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; } }
|
|
16
16
|
|
|
17
17
|
import React from 'react';
|
|
18
|
-
import { FormattedMessage } from 'react-intl-next';
|
|
19
18
|
import styled from 'styled-components';
|
|
20
|
-
import { ConfluenceIcon, JiraIcon, AtlassianIcon } from '@atlaskit/logo';
|
|
21
|
-
import Spinner from '@atlaskit/spinner';
|
|
22
19
|
import { B400, N200, N800 } from '@atlaskit/theme/colors';
|
|
23
20
|
import { token } from '@atlaskit/tokens';
|
|
24
21
|
import Tooltip from '@atlaskit/tooltip';
|
|
25
22
|
import { TextWrapper } from '../AvatarItemOption';
|
|
26
23
|
import { SizeableAvatar } from '../SizeableAvatar';
|
|
27
|
-
import { SlackIcon } from '../assets/slack';
|
|
28
|
-
import { GoogleIcon } from '../assets/google';
|
|
29
|
-
import { MicrosoftIcon } from '../assets/microsoft';
|
|
30
|
-
import { GitHubIcon } from '../assets/github';
|
|
31
|
-
import { messages } from '../i18n';
|
|
32
24
|
import { ExternalUserSourcesContainer } from '../ExternalUserSourcesContainer';
|
|
33
25
|
import InfoIcon from './InfoIcon';
|
|
34
26
|
import { ExternalAvatarItemOption } from './ExternalAvatarItemOption';
|
|
27
|
+
import { SourcesTooltipContent } from './SourcesTooltipContent';
|
|
35
28
|
export var ImageContainer = styled.span(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n height: 16px;\n width: 16px;\n padding-right: 4px;\n display: flex;\n align-items: center;\n justify-content: center;\n"])));
|
|
36
|
-
export var
|
|
37
|
-
export var SourceWrapper = styled.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n padding-top: 4px;\n display: flex;\n align-items: center;\n"])));
|
|
38
|
-
export var EmailDomainWrapper = styled.span(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n font-weight: bold;\n"])));
|
|
39
|
-
var SourcesInfoMap = new Map([['slack', {
|
|
40
|
-
key: 'slack',
|
|
41
|
-
icon: /*#__PURE__*/React.createElement(SlackIcon, null),
|
|
42
|
-
label: messages.slackProvider
|
|
43
|
-
}], ['google', {
|
|
44
|
-
key: 'google',
|
|
45
|
-
icon: /*#__PURE__*/React.createElement(GoogleIcon, null),
|
|
46
|
-
label: messages.googleProvider
|
|
47
|
-
}], ['microsoft', {
|
|
48
|
-
key: 'microsoft',
|
|
49
|
-
icon: /*#__PURE__*/React.createElement(MicrosoftIcon, null),
|
|
50
|
-
label: messages.microsoftProvider
|
|
51
|
-
}], ['github', {
|
|
52
|
-
key: 'github',
|
|
53
|
-
icon: /*#__PURE__*/React.createElement(GitHubIcon, null),
|
|
54
|
-
label: messages.gitHubProvider
|
|
55
|
-
}], ['jira', {
|
|
56
|
-
key: 'jira',
|
|
57
|
-
icon: /*#__PURE__*/React.createElement(JiraIcon, {
|
|
58
|
-
size: 'xsmall'
|
|
59
|
-
}),
|
|
60
|
-
label: messages.jiraSource
|
|
61
|
-
}], ['confluence', {
|
|
62
|
-
key: 'confluence',
|
|
63
|
-
icon: /*#__PURE__*/React.createElement(ConfluenceIcon, {
|
|
64
|
-
size: 'xsmall'
|
|
65
|
-
}),
|
|
66
|
-
label: messages.confluenceSource
|
|
67
|
-
}], ['other-atlassian', {
|
|
68
|
-
key: 'other-atlassian',
|
|
69
|
-
icon: /*#__PURE__*/React.createElement(AtlassianIcon, {
|
|
70
|
-
size: 'xsmall'
|
|
71
|
-
}),
|
|
72
|
-
label: messages.otherAtlassianSource
|
|
73
|
-
}]]);
|
|
29
|
+
export var EmailDomainWrapper = styled.span(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n font-weight: bold;\n"])));
|
|
74
30
|
export var ExternalUserOption = /*#__PURE__*/function (_React$PureComponent) {
|
|
75
31
|
_inherits(ExternalUserOption, _React$PureComponent);
|
|
76
32
|
|
|
@@ -158,25 +114,8 @@ export var ExternalUserOption = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
158
114
|
accountId: id,
|
|
159
115
|
shouldFetchSources: Boolean(requiresSourceHydration),
|
|
160
116
|
initialSources: sources
|
|
161
|
-
}, function (
|
|
162
|
-
|
|
163
|
-
sourcesLoading = _ref.sourcesLoading,
|
|
164
|
-
sourcesError = _ref.sourcesError;
|
|
165
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, sourcesError !== null && sources.length === 0 ? /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(FormattedMessage, messages.externalUserSourcesError)) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(FormattedMessage, messages.externalUserSourcesHeading)), /*#__PURE__*/React.createElement(SourcesTooltipContainer, null, sourcesLoading && /*#__PURE__*/React.createElement(Spinner, {
|
|
166
|
-
size: "small",
|
|
167
|
-
appearance: "invert"
|
|
168
|
-
}), !sourcesLoading && sources.map(function (s) {
|
|
169
|
-
return SourcesInfoMap.get(s);
|
|
170
|
-
}).filter(function (s) {
|
|
171
|
-
return s;
|
|
172
|
-
}).map(function (_ref2) {
|
|
173
|
-
var key = _ref2.key,
|
|
174
|
-
icon = _ref2.icon,
|
|
175
|
-
label = _ref2.label;
|
|
176
|
-
return /*#__PURE__*/React.createElement(SourceWrapper, {
|
|
177
|
-
key: key
|
|
178
|
-
}, /*#__PURE__*/React.createElement(ImageContainer, null, icon), /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(FormattedMessage, label)));
|
|
179
|
-
}))));
|
|
117
|
+
}, function (sourceData) {
|
|
118
|
+
return /*#__PURE__*/React.createElement(SourcesTooltipContent, sourceData);
|
|
180
119
|
});
|
|
181
120
|
}
|
|
182
121
|
}]);
|
|
@@ -47,7 +47,7 @@ export var messages = defineMessages({
|
|
|
47
47
|
},
|
|
48
48
|
selectToAddEmail: {
|
|
49
49
|
id: 'fabric.elements.user-picker.email.select.to.add',
|
|
50
|
-
defaultMessage: 'Select
|
|
50
|
+
defaultMessage: 'Select then Invite',
|
|
51
51
|
description: 'Byline for valid email option.'
|
|
52
52
|
},
|
|
53
53
|
continueToAddEmail: {
|
package/dist/esm/version.json
CHANGED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ExternalUserSourcesData } from '../ExternalUserSourcesContainer';
|
|
3
|
+
export declare const SourcesTooltipContainer: import("styled-components").StyledComponentClass<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, any, React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>>;
|
|
4
|
+
export declare const SourceWrapper: import("styled-components").StyledComponentClass<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, any, React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>>;
|
|
5
|
+
export declare const SourcesTooltipContent: React.FC<ExternalUserSourcesData>;
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { ExternalUser } from '../../types';
|
|
3
3
|
export declare const ImageContainer: import("styled-components").StyledComponentClass<React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, any, React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>>;
|
|
4
|
-
export declare const SourcesTooltipContainer: import("styled-components").StyledComponentClass<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, any, React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>>;
|
|
5
|
-
export declare const SourceWrapper: import("styled-components").StyledComponentClass<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, any, React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>>;
|
|
6
4
|
export declare const EmailDomainWrapper: import("styled-components").StyledComponentClass<React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, any, React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>>;
|
|
7
5
|
export declare type ExternalUserOptionProps = {
|
|
8
6
|
user: ExternalUser;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import React, { ReactNode } from 'react';
|
|
2
2
|
import { UserSource } from '../types';
|
|
3
|
-
|
|
3
|
+
export interface ExternalUserSourcesData {
|
|
4
4
|
sources: UserSource[];
|
|
5
5
|
sourcesLoading: boolean;
|
|
6
6
|
sourcesError: string | null;
|
|
7
|
-
}
|
|
7
|
+
}
|
|
8
|
+
declare type SourcesChildrenFunc = (sourcesData: ExternalUserSourcesData) => ReactNode;
|
|
8
9
|
interface SourcesContainerProps {
|
|
9
10
|
accountId: string;
|
|
10
11
|
shouldFetchSources: boolean;
|