@atlaskit/profilecard 15.6.2 → 15.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +27 -0
- package/dist/cjs/components/Error/ErrorIllustration.js +4 -1
- package/dist/cjs/components/User/ProfileCard.js +3 -1
- package/dist/cjs/i18n/en_ZZ.js +43 -0
- package/dist/cjs/i18n/index.js +8 -0
- package/dist/cjs/index.js +10 -0
- package/dist/cjs/mocks/index.js +51 -0
- package/dist/cjs/mocks/mock-profile-client.js +100 -0
- package/dist/cjs/mocks/mock-team-client.js +65 -0
- package/dist/cjs/mocks/profile-data.js +152 -0
- package/dist/cjs/mocks/simple-mock-clients.js +106 -0
- package/dist/cjs/mocks/team-data.js +59 -0
- package/dist/cjs/mocks/util.js +36 -0
- package/dist/cjs/styled/Card.js +1 -3
- package/dist/cjs/styled/Error.js +3 -1
- package/dist/cjs/styled/TeamCard.js +5 -3
- package/dist/cjs/styled/constants.js +35 -28
- package/dist/cjs/util/analytics.js +1 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/components/Error/ErrorIllustration.js +3 -1
- package/dist/es2019/components/User/ProfileCard.js +2 -1
- package/dist/es2019/i18n/en_ZZ.js +35 -0
- package/dist/es2019/i18n/index.js +1 -0
- package/dist/es2019/index.js +3 -0
- package/dist/es2019/mocks/index.js +4 -0
- package/{mock-helpers/mock-profile-client.ts → dist/es2019/mocks/mock-profile-client.js} +17 -19
- package/{mock-helpers/mock-team-client.ts → dist/es2019/mocks/mock-team-client.js} +11 -13
- package/dist/es2019/mocks/profile-data.js +138 -0
- package/dist/es2019/mocks/simple-mock-clients.js +45 -0
- package/dist/es2019/mocks/team-data.js +41 -0
- package/{mock-helpers/util.ts → dist/es2019/mocks/util.js} +6 -11
- package/dist/es2019/styled/Card.js +2 -3
- package/dist/es2019/styled/Error.js +2 -1
- package/dist/es2019/styled/TeamCard.js +4 -3
- package/dist/es2019/styled/constants.js +31 -26
- package/dist/es2019/util/analytics.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/components/Error/ErrorIllustration.js +3 -1
- package/dist/esm/components/User/ProfileCard.js +2 -1
- package/dist/esm/i18n/en_ZZ.js +35 -0
- package/dist/esm/i18n/index.js +1 -0
- package/dist/esm/index.js +3 -0
- package/dist/esm/mocks/index.js +4 -0
- package/dist/esm/mocks/mock-profile-client.js +87 -0
- package/dist/esm/mocks/mock-team-client.js +53 -0
- package/dist/esm/mocks/profile-data.js +140 -0
- package/dist/esm/mocks/simple-mock-clients.js +88 -0
- package/dist/esm/mocks/team-data.js +48 -0
- package/dist/esm/mocks/util.js +21 -0
- package/dist/esm/styled/Card.js +2 -3
- package/dist/esm/styled/Error.js +2 -1
- package/dist/esm/styled/TeamCard.js +4 -3
- package/dist/esm/styled/constants.js +31 -26
- package/dist/esm/util/analytics.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/i18n/en_ZZ.d.ts +35 -0
- package/dist/types/i18n/index.d.ts +1 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/mocks/index.d.ts +4 -0
- package/dist/types/mocks/mock-profile-client.d.ts +1 -0
- package/dist/types/mocks/mock-team-client.d.ts +7 -0
- package/dist/types/mocks/profile-data.d.ts +41 -0
- package/dist/types/mocks/simple-mock-clients.d.ts +14 -0
- package/dist/types/mocks/team-data.d.ts +7 -0
- package/dist/types/mocks/util.d.ts +6 -0
- package/dist/types/styled/constants.d.ts +14 -13
- package/mocks/package.json +7 -0
- package/package.json +9 -4
- package/mock-helpers/profile-data.ts +0 -160
- package/mock-helpers/team-data.ts +0 -88
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = teamData;
|
|
9
|
+
|
|
10
|
+
var _sample = _interopRequireDefault(require("lodash/sample"));
|
|
11
|
+
|
|
12
|
+
var avatarImages = ['data:image/gif;base64,R0lGODdhgACAAPIHAABRzMHT8l6O3o2w6env+zh22P///xRe0CwAAAAAgACAAAAD/wi63P4wykmrvTjrzbv/YCiOZGmeaKqubOu+cCzPdG3feK7vfO//wKBwSCwaj8ikcslsOp/QqHRKrVqv2Kx2y+16v+CweEwum8/otHrNbrvf8Lh8Tq83CwGDgTA4RA4DBHoBAnADeoh7BQ8HgokGA24Cj4gED3mUBoVsmJmbC5OZe22iepEMh6V+a6UGAQ2poouspacLsZmrap2UswsFpa9sjZnCsLJuBY6IAbrHiQSfbQcCAQED0g8FA9YCznbg4eLj5OVO2zMDvlXKrt8qB3kE61LEg/Qo8ZX4TvrQ2SbaQXvHxB+lPicAiWomBdejaCUEFiPIxOGjAPw04GnFkIiKxYveOFRrBQlLKJKEKDagFohkySwSSRK4NgBbAQE1uS2TCdCKQZdAUaq0ImBn0KN6IIppiTQon6FbqBlt+hBhmm1Tj/LpebVaVkoz1YUrQDZnTbIZzaldy7at27dw48qdS7eu3bt48+rdy7ev37+AAwseTLiw4cOIEytezLix48eQI0uenDcBADs=', 'data:image/gif;base64,R0lGODdhgACAAPIHAACjv2fE1sXp70S2zR+qxJbV4////+r3+SwAAAAAgACAAAAD/wi63P4wykmrvTjrzbv/YCiOZGmeaKqubOu+cCzPdG3feK7vfO//wKBwSCwaj8ikcslsOp/QqHRKrVqv2Kx2y+16v+CweEwum8/otHrNbrvf8Lh8Tq83BwKD4VAgRAgFB3oCAXAFeoh7Aw8EgokGBW4Bj4gHD3mUBoVsmJmbC5OZe22iepEMh6V+a6UGAg2poouspacLsZmrap2UswsDpa9sjZnCsLJuA46IArrHiQefbQQBAgIF0g8DBdYBznbg4eLj5OVO2zMFvlXKrt8qBHkH61LEg/Qo8ZX4TvrQ2SbaQXvHxB+lPicAiWomBdejaCUEFiPIxOEjAfw04GnFkIiKxYveOFRrBQlLKJKEKDagFohkySwSSR64VgDbgAA1uS2TCdCKQZdAUaq0EmBn0KN6IIppiTQon6FbqBlt+hBhmm1Tj/LpebVaVkoz1YUbQDZnTbIZzaldy7at27dw48qdS7eu3bt48+rdy7ev37+AAwseTLiw4cOIEytezLix48eQI0uenDcBADs=', 'data:image/gif;base64,R0lGODdhgACAAPIHAACHWur18arVxYjDrlarjMnk2v///yeUbSwAAAAAgACAAAAD/wi63P4wykmrvTjrzbv/YCiOZGmeaKqubOu+cCzPdG3feK7vfO//wKBwSCwaj8ikcslsOp/QqHRKrVqv2Kx2y+16v+CweEwum8/otHrNbrvf8Lh8Tq83CQKDISA4RA4DAXoFBHADeoh7fg4HgokGAm4Ej4gBDwWUeoVsmJkGmwuTnpZsnnqRDIemi2qmBgUNqp6gaa4Dsa6saXmzDQemsGyNmai4mbpqw4kFyAu8lbTCAwUFAtEOeNQDzXbd3t/g4eJMgDPbWMPMLwd5AdxPyq/vJQedilT1jwHXJQSOlfOS5Mt0zgQgT+qiPKO0r98/SgkVuiIUgoC9TBGlLMRIIIagBIuuIGERFdKaRwUH8Dz0dCuLv5CVqg0YQKDmzGkrTTXcwg6mz58Zt7z8SVQfPy6BihINUHAMoJxKEzE96UVl1ErW4AASAJWhgKZ1UhK4ObMm1XFo06pdy7at27dw48qdS7eu3bt48+rdy7ev37+AAwseTLiw4cOIEytezLix48eQI8tNAAA7', 'data:image/gif;base64,R0lGODdhgACAAPIHAFJCqfDu+LGp2XlqvJGFyGBRsP///9TQ6iwAAAAAgACAAAAD/wi63P4wykmrvTjrzbv/YCiOZGmeaKqubOu+cCzPdG3feK7vfO//wKBwSCwaj8ikcslsOp/QqHRKrVqv2Kx2y+16v+CweEwum8/otHrNbrvf8Lh8Tq83BweDISAoRAoCAXoHBHACeoh7Aw8FgokGAm4Ej4gBD3mUBoVsmJmbC5OZe22iepEMh6V+a6UGBw2poouspacLsZmrap2UswsDpa9sjZnCsLJuA46IB7rHiQGfbQUEBwcC0g8DAtYEznbg4eLj5OVO2zMCvlXKrt8qBXkB61LEg/Qo8ZX4TvrQ2SbaQXvHxB+lPicAiWomBdejaCUEFiPIxOGjA/w04GnFkIiKxYveOFRrBQlLKJKEKDagFohkySwSSQa4JgDbAAI1uS2TCdCKQZdAUaq0QmBn0KN6IIppiTQon6FbqBlt+hBhmm1Tj/LpebVaVkoz1YUbQDZnTbIZzaldy7at27dw48qdS7eu3bt48+rdy7ev37+AAwseTLiw4cOIEytezLix48eQI0uenDcBADs=', 'data:image/gif;base64,R0lGODdhgACAAPIHAN41Cvzs6vfMxPGgkeRTNeBAG////+lvVywAAAAAgACAAEAD/wi63P4wykmrvTjrzbv/YCiOZGmeaKqubOu+62DMdEA8REDTA+x7uZ1BUIDIdoHDbzkh9H6DG5N1EFpngoO0eRjorrvndOwgHLqD9OC8Jbvf8Lh8Tq/b7/i8fs/v+/+AgYKDhIUrYFgNR2BKho6GBQJgA0UmBYtCRI8RXoienwYBlJukpaanqKmqq6ytrq+wsbKztLW2t7i5uru8vRySjA1VYAG9wFeNCwSIAr7OzzAFX0NtKQTHNqWYVlkhB8dXmqeRoOXmAtWwXdPmSGvQ8PHy8/T19vf4+fr7/P3+/wADChxIsKDBgwgTKlzIsKHDhxAjSpxI4tsMUZUeXPrSzYfXMCvFHIDbkUyXJzEKtglJZ+ukIk8ZcwXh9kDlDJa4LgkQ8E5Cl51RKAodGieIuBbkspEih6TkiQPsQsUsZPOiUxBQmU2l+inLVgsWXaLKWi4AzzRn0AwQEBVREldk28m1SmvjXE8YezlhW5YnTqKAAwseTLiw4cOIEytezLix48eQI0smkQAAOw==', 'data:image/gif;base64,R0lGODdhgACAAPIHAP+ZH/+vUv/Rnf+gMv+9cf/26//////mySwAAAAAgACAAAAD/wi63P4wykmrvTjrzbv/YCiOZGmeaKqubOu+cCzPdG3feK7vfO//wKBwSCwaj8ikcslsOp/QqHRKrVqv2Kx2y+16v+CweEwum8/otHrNbrvf8Lh8Tq83AweDoSAYRAYCBXoHBHACeoh7AQ8DgokGAm4Ej4gFD3mUBoVsmJmbC5OZe22iepEMh6V+a6UGBw2poouspacLsZmrap2UswsBpa9sjZnCsLJuAY6IB7rHiQWfbQMEBwcC0g8BAtYEznbg4eLj5OVO2zMCvlXKrt8qA3kF61LEg/Qo8ZX4TvrQ2SbaQXvHxB+lPicAiWomBdejaCUEFiPIxOGjA/w04GnFkIiKxYveOFRrBQlLKJKEKDagFohkySwSSRa4JgBbAAI1uS2TCdCKQZdAUaq0QmBn0KN6IIppiTQon6FbqBlt+hBhmm1Tj/LpebVaVkoz1YULQDZnTbIZzaldy7at27dw48qdS7eu3bt48+rdy7ev37+AAwseTLiw4cOIEytezLix48eQI0uenDcBADs=', '' // to test invalid img src
|
|
13
|
+
];
|
|
14
|
+
|
|
15
|
+
var getAvatar = function getAvatar() {
|
|
16
|
+
return (0, _sample.default)(avatarImages);
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
var memberNames = ['Kramer Hatfield', 'Schwartz Mclaughlin', 'Nichole Walter', 'Cleveland Rodriquez', 'Hess Stone', 'Lewis Cervantes', 'Abbott Lamb', 'Conner Duncan', 'Bauer Burch', 'Mcbride Haynes', 'Maddy Estes', 'Nikki Villanueva', 'Adam Burks', 'Milly Walters', 'Phoebe Clarkson', 'Samuel Dunlap', 'Naomi Boyer', 'Silas Gomez', 'Josie Lancaster', 'Fred Kirkpatrick', 'Beck Rutledge', 'Rebecca Woods'];
|
|
20
|
+
var members = memberNames.map(function (name, index) {
|
|
21
|
+
return {
|
|
22
|
+
id: index.toString(),
|
|
23
|
+
avatarUrl: getAvatar(),
|
|
24
|
+
fullName: name
|
|
25
|
+
};
|
|
26
|
+
});
|
|
27
|
+
var sampleImage = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKAAAABACAMAAACqVYydAAAAAXNSR0IB2cksfwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAGBQTFRF/zX7+DP73i77uyb8kR78ZhX9PQz+GwX+/jT78jL71Sz7ryT8hRv8WhL9Mwr+EwT+/TT76jD7yyr7pCL8eRn9ThD9KQj+DAL/+jT74i/7wCj8lx/8bBb9Qw3+IAb+BgH/HFKiKQAAAIBJREFUeJztzjkOggAAAEEEORTkFOQS/v9L+u1INDQ7L5ggOOkGIURwhxgSSOHsz6BBgwYNGjRo0OBvgxk84Ak5FPCCEiowaNCgQYMGDRo0eG2whgZa6OANPQzwAYMGDRo0aNCgQYPXBkeYYIYFVvjCBjsYNGjQoEGDBg0a/GvwADIe8BAKQVCtAAAAAElFTkSuQmCC';
|
|
28
|
+
var names = {
|
|
29
|
+
Short: 'Lemon',
|
|
30
|
+
Medium: 'The Fat Cats',
|
|
31
|
+
Long: 'People and Teams Collective Developers',
|
|
32
|
+
Overlong: "Teamwork Platform's People and Teams Collective Frontend Developer Group"
|
|
33
|
+
};
|
|
34
|
+
var longDescription = 'This is information about the team. They are responsible for all the cool stuff that happens at Acme.';
|
|
35
|
+
var descriptions = {
|
|
36
|
+
None: '',
|
|
37
|
+
Short: 'A very cool team!',
|
|
38
|
+
Medium: 'This is a pretty cool team, that does a lot of work here.',
|
|
39
|
+
Long: longDescription,
|
|
40
|
+
Overlong: [longDescription, longDescription].join(' ')
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
function teamData(_ref) {
|
|
44
|
+
var _ref$headerImage = _ref.headerImage,
|
|
45
|
+
headerImage = _ref$headerImage === void 0 ? 'None' : _ref$headerImage,
|
|
46
|
+
_ref$displayName = _ref.displayName,
|
|
47
|
+
displayName = _ref$displayName === void 0 ? 'Short' : _ref$displayName,
|
|
48
|
+
_ref$members = _ref.members,
|
|
49
|
+
memberCount = _ref$members === void 0 ? 1 : _ref$members,
|
|
50
|
+
_ref$description = _ref.description,
|
|
51
|
+
description = _ref$description === void 0 ? 'Long' : _ref$description;
|
|
52
|
+
return {
|
|
53
|
+
id: 'team-id',
|
|
54
|
+
largeHeaderImageUrl: headerImage === 'Picture' ? sampleImage : undefined,
|
|
55
|
+
displayName: names[displayName] || names.Short,
|
|
56
|
+
members: members.slice(0, memberCount),
|
|
57
|
+
description: description ? descriptions[description] : descriptions.Long
|
|
58
|
+
};
|
|
59
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getTimeString = exports.getWeekday = exports.random = void 0;
|
|
7
|
+
|
|
8
|
+
function padMinutes(minutes) {
|
|
9
|
+
return minutes < 10 ? "0".concat(minutes) : String(minutes);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
var random = function random(int) {
|
|
13
|
+
return Math.floor(Math.random() * (int + 1));
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
exports.random = random;
|
|
17
|
+
|
|
18
|
+
var getWeekday = function getWeekday() {
|
|
19
|
+
var array = ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'];
|
|
20
|
+
var index = random(6);
|
|
21
|
+
return {
|
|
22
|
+
index: index,
|
|
23
|
+
string: array[index]
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
exports.getWeekday = getWeekday;
|
|
28
|
+
|
|
29
|
+
var getTimeString = function getTimeString() {
|
|
30
|
+
var hours = random(23);
|
|
31
|
+
var minutes = random(59);
|
|
32
|
+
var meridiem = ['am', 'pm'][Math.floor(hours / 12)];
|
|
33
|
+
return "".concat(hours === 0 ? 12 : hours % 12, ":").concat(padMinutes(minutes)).concat(meridiem);
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
exports.getTimeString = getTimeString;
|
package/dist/cjs/styled/Card.js
CHANGED
|
@@ -15,8 +15,6 @@ var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
|
15
15
|
|
|
16
16
|
var _constants = require("@atlaskit/theme/constants");
|
|
17
17
|
|
|
18
|
-
var _elevation = require("@atlaskit/theme/elevation");
|
|
19
|
-
|
|
20
18
|
var _constants2 = require("../styled/constants");
|
|
21
19
|
|
|
22
20
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13, _templateObject14, _templateObject15, _templateObject16, _templateObject17, _templateObject18, _templateObject19;
|
|
@@ -96,7 +94,7 @@ var CardContainer = _styledComponents.default.div(_templateObject15 || (_templat
|
|
|
96
94
|
return '';
|
|
97
95
|
}
|
|
98
96
|
|
|
99
|
-
return (0, _styledComponents.css)(_templateObject16 || (_templateObject16 = (0, _taggedTemplateLiteral2.default)(["\n ", "
|
|
97
|
+
return (0, _styledComponents.css)(_templateObject16 || (_templateObject16 = (0, _taggedTemplateLiteral2.default)(["\n box-shadow: ", ";\n border-radius: ", "px;\n "])), _constants2.boxShadow, _constants.borderRadius);
|
|
100
98
|
});
|
|
101
99
|
|
|
102
100
|
exports.CardContainer = CardContainer;
|
package/dist/cjs/styled/Error.js
CHANGED
|
@@ -17,6 +17,8 @@ var _constants = require("@atlaskit/theme/constants");
|
|
|
17
17
|
|
|
18
18
|
var _typography = require("@atlaskit/theme/typography");
|
|
19
19
|
|
|
20
|
+
var _tokens = require("@atlaskit/tokens");
|
|
21
|
+
|
|
20
22
|
var _constants2 = require("../styled/constants");
|
|
21
23
|
|
|
22
24
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5;
|
|
@@ -37,6 +39,6 @@ var TeamErrorTitle = _styledComponents.default.p(_templateObject4 || (_templateO
|
|
|
37
39
|
|
|
38
40
|
exports.TeamErrorTitle = TeamErrorTitle;
|
|
39
41
|
|
|
40
|
-
var TeamErrorText = _styledComponents.default.p(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2.default)(["\n color: ", ";\n margin-top: ", "px;\n"])), _colors.N200, (0, _constants.gridSize)() * 1);
|
|
42
|
+
var TeamErrorText = _styledComponents.default.p(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2.default)(["\n color: ", ";\n margin-top: ", "px;\n"])), (0, _tokens.token)('color.text.lowEmphasis', _colors.N200), (0, _constants.gridSize)() * 1);
|
|
41
43
|
|
|
42
44
|
exports.TeamErrorText = TeamErrorText;
|
|
@@ -19,6 +19,8 @@ var _constants = require("@atlaskit/theme/constants");
|
|
|
19
19
|
|
|
20
20
|
var _typography = require("@atlaskit/theme/typography");
|
|
21
21
|
|
|
22
|
+
var _tokens = require("@atlaskit/tokens");
|
|
23
|
+
|
|
22
24
|
var _constants2 = require("../styled/constants");
|
|
23
25
|
|
|
24
26
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13, _templateObject14, _templateObject15, _templateObject16;
|
|
@@ -34,7 +36,7 @@ exports.CardTriggerWrapper = CardTriggerWrapper;
|
|
|
34
36
|
var CardWrapper = _styledComponents.default.div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n background-color: ", ";\n border-radius: ", "px;\n width: ", "px;\n position: relative;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n"])), _constants2.bgColor, _constants.borderRadius, (0, _constants.gridSize)() * 40);
|
|
35
37
|
|
|
36
38
|
exports.CardWrapper = CardWrapper;
|
|
37
|
-
var loadingImage = (0, _styledComponents.css)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n background-color: ", ";\n"])), _colors.N20);
|
|
39
|
+
var loadingImage = (0, _styledComponents.css)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n background-color: ", ";\n"])), (0, _tokens.token)('color.background.subtleNeutral.resting', _colors.N20));
|
|
38
40
|
var defaultImage = (0, _styledComponents.css)(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n background-color: ", ";\n"])), _constants2.teamHeaderBgColor);
|
|
39
41
|
|
|
40
42
|
var CardHeader = _styledComponents.default.div(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2.default)(["\n ", ";\n background-repeat: no-repeat;\n background-size: cover;\n box-sizing: content-box;\n height: ", "px;\n"])), function (props) {
|
|
@@ -59,7 +61,7 @@ var TeamName = _styledComponents.default.h6(_templateObject8 || (_templateObject
|
|
|
59
61
|
|
|
60
62
|
exports.TeamName = TeamName;
|
|
61
63
|
|
|
62
|
-
var MemberCount = _styledComponents.default.div(_templateObject9 || (_templateObject9 = (0, _taggedTemplateLiteral2.default)(["\n color: ", ";\n margin-top: ", "px;\n"])), _colors.N200, (0, _constants.gridSize)() * 0.5);
|
|
64
|
+
var MemberCount = _styledComponents.default.div(_templateObject9 || (_templateObject9 = (0, _taggedTemplateLiteral2.default)(["\n color: ", ";\n margin-top: ", "px;\n"])), (0, _tokens.token)('color.text.lowEmphasis', _colors.N200), (0, _constants.gridSize)() * 0.5);
|
|
63
65
|
|
|
64
66
|
exports.MemberCount = MemberCount;
|
|
65
67
|
|
|
@@ -75,7 +77,7 @@ var Description = _styledComponents.default.span(_templateObject12 || (_template
|
|
|
75
77
|
|
|
76
78
|
exports.Description = Description;
|
|
77
79
|
|
|
78
|
-
var ActionButtons = _styledComponents.default.div(_templateObject13 || (_templateObject13 = (0, _taggedTemplateLiteral2.default)(["\n width: calc(100% + 8px);\n display: flex;\n justify-content: space-between;\n margin: ", "px -", "px 0 -", "px;\n background-color:
|
|
80
|
+
var ActionButtons = _styledComponents.default.div(_templateObject13 || (_templateObject13 = (0, _taggedTemplateLiteral2.default)(["\n width: calc(100% + 8px);\n display: flex;\n justify-content: space-between;\n margin: ", "px -", "px 0 -", "px;\n background-color: ", ";\n"])), (0, _constants.gridSize)() * 3, (0, _constants.gridSize)() * 3, (0, _constants.gridSize)(), (0, _tokens.token)('color.background.overlay', 'hsla(0, 100%, 100%, 0.2)'));
|
|
79
81
|
|
|
80
82
|
exports.ActionButtons = ActionButtons;
|
|
81
83
|
|
|
@@ -5,78 +5,85 @@ var _typeof = require("@babel/runtime/helpers/typeof");
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.errorTextColor = exports.errorTitleColor = exports.errorIconColor = exports.labelIconColor = exports.labelTextColor = exports.appLabelTextColor = exports.appLabelBgColor = exports.headerTextColorInactive = exports.headerTextColor = exports.headerBgColorDisabledUser = exports.teamHeaderBgColor = exports.headerBgColor = exports.bgColor = void 0;
|
|
8
|
+
exports.boxShadow = exports.errorTextColor = exports.errorTitleColor = exports.errorIconColor = exports.labelIconColor = exports.labelTextColor = exports.appLabelTextColor = exports.appLabelBgColor = exports.headerTextColorInactive = exports.headerTextColor = exports.headerBgColorDisabledUser = exports.teamHeaderBgColor = exports.headerBgColor = exports.bgColor = void 0;
|
|
9
9
|
|
|
10
10
|
var colors = _interopRequireWildcard(require("@atlaskit/theme/colors"));
|
|
11
11
|
|
|
12
12
|
var _components = require("@atlaskit/theme/components");
|
|
13
13
|
|
|
14
|
+
var _tokens = require("@atlaskit/tokens");
|
|
15
|
+
|
|
14
16
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
15
17
|
|
|
16
18
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
17
19
|
|
|
18
20
|
var bgColor = (0, _components.themed)({
|
|
19
|
-
light: colors.N0,
|
|
20
|
-
dark: colors.DN50
|
|
21
|
+
light: (0, _tokens.token)('color.background.overlay', colors.N0),
|
|
22
|
+
dark: (0, _tokens.token)('color.background.overlay', colors.DN50)
|
|
21
23
|
});
|
|
22
24
|
exports.bgColor = bgColor;
|
|
23
25
|
var headerBgColor = (0, _components.themed)({
|
|
24
|
-
light: colors.B500,
|
|
25
|
-
dark: colors.B100
|
|
26
|
+
light: (0, _tokens.token)('color.background.boldBrand.resting', colors.B500),
|
|
27
|
+
dark: (0, _tokens.token)('color.background.boldBrand.resting', colors.B100)
|
|
26
28
|
});
|
|
27
29
|
exports.headerBgColor = headerBgColor;
|
|
28
30
|
var teamHeaderBgColor = (0, _components.themed)({
|
|
29
|
-
light: colors.N50,
|
|
30
|
-
dark: colors.N50
|
|
31
|
+
light: (0, _tokens.token)('color.background.subtleNeutral.resting', colors.N50),
|
|
32
|
+
dark: (0, _tokens.token)('color.background.subtleNeutral.resting', colors.N50)
|
|
31
33
|
});
|
|
32
34
|
exports.teamHeaderBgColor = teamHeaderBgColor;
|
|
33
35
|
var headerBgColorDisabledUser = (0, _components.themed)({
|
|
34
|
-
light: colors.N30,
|
|
35
|
-
dark: colors.B100
|
|
36
|
+
light: (0, _tokens.token)('color.background.disabled', colors.N30),
|
|
37
|
+
dark: (0, _tokens.token)('color.background.disabled', colors.B100)
|
|
36
38
|
});
|
|
37
39
|
exports.headerBgColorDisabledUser = headerBgColorDisabledUser;
|
|
38
40
|
var headerTextColor = (0, _components.themed)({
|
|
39
|
-
light: colors.N0,
|
|
40
|
-
dark: colors.N0
|
|
41
|
+
light: (0, _tokens.token)('color.text.onBold', colors.N0),
|
|
42
|
+
dark: (0, _tokens.token)('color.text.onBold', colors.N0)
|
|
41
43
|
});
|
|
42
44
|
exports.headerTextColor = headerTextColor;
|
|
43
45
|
var headerTextColorInactive = (0, _components.themed)({
|
|
44
|
-
light: colors.N800,
|
|
45
|
-
dark: colors.N0
|
|
46
|
+
light: (0, _tokens.token)('color.text.highEmphasis', colors.N800),
|
|
47
|
+
dark: (0, _tokens.token)('color.text.highEmphasis', colors.N0)
|
|
46
48
|
});
|
|
47
49
|
exports.headerTextColorInactive = headerTextColorInactive;
|
|
48
50
|
var appLabelBgColor = (0, _components.themed)({
|
|
49
|
-
light: colors.N20,
|
|
50
|
-
dark: colors.N20
|
|
51
|
+
light: (0, _tokens.token)('color.background.subtleNeutral.resting', colors.N20),
|
|
52
|
+
dark: (0, _tokens.token)('color.background.subtleNeutral.resting', colors.N20)
|
|
51
53
|
});
|
|
52
54
|
exports.appLabelBgColor = appLabelBgColor;
|
|
53
55
|
var appLabelTextColor = (0, _components.themed)({
|
|
54
|
-
light: colors.N500,
|
|
55
|
-
dark: colors.N500
|
|
56
|
+
light: (0, _tokens.token)('color.text.highEmphasis', colors.N500),
|
|
57
|
+
dark: (0, _tokens.token)('color.text.highEmphasis', colors.N500)
|
|
56
58
|
});
|
|
57
59
|
exports.appLabelTextColor = appLabelTextColor;
|
|
58
60
|
var labelTextColor = (0, _components.themed)({
|
|
59
|
-
light: colors.N800,
|
|
60
|
-
dark: colors.DN900
|
|
61
|
+
light: (0, _tokens.token)('color.text.highEmphasis', colors.N800),
|
|
62
|
+
dark: (0, _tokens.token)('color.text.highEmphasis', colors.DN900)
|
|
61
63
|
});
|
|
62
64
|
exports.labelTextColor = labelTextColor;
|
|
63
65
|
var labelIconColor = (0, _components.themed)({
|
|
64
|
-
light: colors.N60,
|
|
65
|
-
dark: colors.DN100
|
|
66
|
+
light: (0, _tokens.token)('color.text.lowEmphasis', colors.N60),
|
|
67
|
+
dark: (0, _tokens.token)('color.text.lowEmphasis', colors.DN100)
|
|
66
68
|
});
|
|
67
69
|
exports.labelIconColor = labelIconColor;
|
|
68
70
|
var errorIconColor = (0, _components.themed)({
|
|
69
|
-
light: colors.N90,
|
|
70
|
-
dark: colors.DN90
|
|
71
|
+
light: (0, _tokens.token)('color.text.disabled', colors.N90),
|
|
72
|
+
dark: (0, _tokens.token)('color.text.disabled', colors.DN90)
|
|
71
73
|
});
|
|
72
74
|
exports.errorIconColor = errorIconColor;
|
|
73
75
|
var errorTitleColor = (0, _components.themed)({
|
|
74
|
-
light: colors.N800,
|
|
75
|
-
dark: colors.DN800
|
|
76
|
+
light: (0, _tokens.token)('color.text.highEmphasis', colors.N800),
|
|
77
|
+
dark: (0, _tokens.token)('color.text.highEmphasis', colors.DN800)
|
|
76
78
|
});
|
|
77
79
|
exports.errorTitleColor = errorTitleColor;
|
|
78
80
|
var errorTextColor = (0, _components.themed)({
|
|
79
|
-
light: colors.N90,
|
|
80
|
-
dark: colors.DN90
|
|
81
|
+
light: (0, _tokens.token)('color.text.lowEmphasis', colors.N90),
|
|
82
|
+
dark: (0, _tokens.token)('color.text.lowEmphasis', colors.DN90)
|
|
83
|
+
});
|
|
84
|
+
exports.errorTextColor = errorTextColor;
|
|
85
|
+
var boxShadow = (0, _components.themed)({
|
|
86
|
+
light: (0, _tokens.token)('shadow.overlay', "0 4px 8px -2px ".concat(colors.N50A, ", 0 0 1px ").concat(colors.N60A)),
|
|
87
|
+
dark: (0, _tokens.token)('shadow.overlay', "0 4px 8px -2px ".concat(colors.DN50A, ", 0 0 1px ").concat(colors.DN60A))
|
|
81
88
|
});
|
|
82
|
-
exports.
|
|
89
|
+
exports.boxShadow = boxShadow;
|
|
@@ -31,7 +31,7 @@ var createEvent = function createEvent(eventType, action, actionSubject, actionS
|
|
|
31
31
|
actionSubjectId: actionSubjectId,
|
|
32
32
|
attributes: _objectSpread(_objectSpread({
|
|
33
33
|
packageName: "@atlaskit/profilecard",
|
|
34
|
-
packageVersion: "15.
|
|
34
|
+
packageVersion: "15.8.1"
|
|
35
35
|
}, attributes), {}, {
|
|
36
36
|
firedAt: (0, _performance.getPageTime)()
|
|
37
37
|
})
|
package/dist/cjs/version.json
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
/* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
|
|
1
2
|
import React from 'react';
|
|
3
|
+
import { token } from '@atlaskit/tokens';
|
|
2
4
|
export const ErrorIllustration = () => {
|
|
3
5
|
return /*#__PURE__*/React.createElement("svg", {
|
|
4
6
|
width: "42",
|
|
@@ -10,7 +12,7 @@ export const ErrorIllustration = () => {
|
|
|
10
12
|
clipPath: "url(#clip0)"
|
|
11
13
|
}, /*#__PURE__*/React.createElement("path", {
|
|
12
14
|
d: "M0.649902 0H163.93V212H0.649902V0Z",
|
|
13
|
-
fill:
|
|
15
|
+
fill: token('color.background.overlay', 'white'),
|
|
14
16
|
fillOpacity: "0.01"
|
|
15
17
|
}), /*#__PURE__*/React.createElement("path", {
|
|
16
18
|
d: "M95.4299 74.1603L161.87 189.24C167.71 199.36 160.41 212 148.73 212H15.8499C4.16994 212 -3.13006 199.35 2.70994 189.24L69.1499 74.1603C74.9899 64.0403 89.5899 64.0403 95.4299 74.1603ZM87.8699 157.71L90.7499 113.36C91.0899 108.07 86.8899 103.58 81.5899 103.58C76.2799 103.58 72.0799 108.06 72.4299 113.36L75.3099 157.71C75.5299 161.02 78.2699 163.6 81.5899 163.6C84.8999 163.6 87.6499 161.02 87.8699 157.71ZM72.0299 181.25C72.0299 186.91 76.7899 191.35 82.4199 190.83C87.2699 190.38 91.1499 186.33 91.2499 181.46C91.3599 176.01 86.9399 171.52 81.5199 171.52C76.2899 171.51 72.0299 175.89 72.0299 181.25Z",
|
|
@@ -7,6 +7,7 @@ import Button from '@atlaskit/button/custom-theme-button';
|
|
|
7
7
|
import Lozenge from '@atlaskit/lozenge';
|
|
8
8
|
import Spinner from '@atlaskit/spinner';
|
|
9
9
|
import { N0 } from '@atlaskit/theme/colors';
|
|
10
|
+
import { token } from '@atlaskit/tokens';
|
|
10
11
|
import { AnalyticsName } from '../../internal/analytics';
|
|
11
12
|
import relativeDate from '../../internal/relative-date';
|
|
12
13
|
import messages from '../../messages';
|
|
@@ -234,7 +235,7 @@ export default class Profilecard extends React.PureComponent {
|
|
|
234
235
|
}, /*#__PURE__*/React.createElement(ProfileImage, null, /*#__PURE__*/React.createElement(Avatar, {
|
|
235
236
|
size: "xlarge",
|
|
236
237
|
src: this.props.status !== 'closed' ? this.props.avatarUrl : undefined,
|
|
237
|
-
borderColor: N0
|
|
238
|
+
borderColor: token('color.background.overlay', N0)
|
|
238
239
|
})), /*#__PURE__*/React.createElement(CardContent, null, this.renderCardDetails(), actions ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ActionsFlexSpacer, null), actions) : null));
|
|
239
240
|
}
|
|
240
241
|
|
|
@@ -0,0 +1,35 @@
|
|
|
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
|
+
'pt.profile-card.closed.account': 'Account deleted',
|
|
10
|
+
'pt.profile-card.closed.account.has.date.a.few.months': 'Their account has been deleted for a few months.',
|
|
11
|
+
'pt.profile-card.closed.account.has.date.last.month': 'Their account was deleted last month.',
|
|
12
|
+
'pt.profile-card.closed.account.has.date.more.than.a.year': 'Their account has been deleted for more than a year.',
|
|
13
|
+
'pt.profile-card.closed.account.has.date.several.months': 'Their account has been deleted for several months.',
|
|
14
|
+
'pt.profile-card.closed.account.has.date.this.month': 'Their account was deleted this month.',
|
|
15
|
+
'pt.profile-card.closed.account.has.date.this.week': 'Their account was deleted this week.',
|
|
16
|
+
'pt.profile-card.closed.account.no.date': 'Their account has been deleted.',
|
|
17
|
+
'pt.profile-card.disabled.account.default.name': 'Former user',
|
|
18
|
+
'pt.profile-card.general.msg.disabled.user': 'You can no longer collaborate with this person.',
|
|
19
|
+
'pt.profile-card.inactive.account': 'Account deactivated',
|
|
20
|
+
'pt.profile-card.inactive.account.has.date.a.few.months': 'Their account has been deactivated for a few months.',
|
|
21
|
+
'pt.profile-card.inactive.account.has.date.last.month': 'Their account was deactivated last month.',
|
|
22
|
+
'pt.profile-card.inactive.account.has.date.more.than.a.year': 'Their account has been deactivated for more than a year.',
|
|
23
|
+
'pt.profile-card.inactive.account.has.date.several.months': 'Their account has been deactivated for several months.',
|
|
24
|
+
'pt.profile-card.inactive.account.has.date.this.month': 'Their account was deactivated this month.',
|
|
25
|
+
'pt.profile-card.inactive.account.has.date.this.week': 'Their account was deactivated this week.',
|
|
26
|
+
'pt.profile-card.inactive.account.no.date': 'Their account has been deactivated.',
|
|
27
|
+
'pt.team-profile-card.error.refresh-button': 'Try again',
|
|
28
|
+
'pt.team-profile-card.error.suggestion': 'Wait a few moments, then try again.',
|
|
29
|
+
'pt.team-profile-card.error.title': 'We’re having trouble retrieving this teams information',
|
|
30
|
+
'pt.team-profile-card.team.action.view-profile': 'View profile',
|
|
31
|
+
'pt.team-profile-card.team.member.count': '{count, plural, one {Team • {count} member} other {Team • {count} members}}',
|
|
32
|
+
'pt.team-profile-card.team.member.count-including-you': '{count, plural, one {Team • {count} member, including you} other {Team • {count} members, including you}}',
|
|
33
|
+
'pt.team-profile-card.team.member.many': 'Team • 50+ members',
|
|
34
|
+
'pt.team-profile-card.team.member.many-including-you': 'Team • 50+ members, including you'
|
|
35
|
+
};
|
|
@@ -29,6 +29,7 @@ export { default as th } from './th';
|
|
|
29
29
|
export { default as tr } from './tr';
|
|
30
30
|
export { default as uk } from './uk';
|
|
31
31
|
export { default as vi } from './vi';
|
|
32
|
+
export { default as en_ZZ } from './en_ZZ';
|
|
32
33
|
export { default as en } from './en';
|
|
33
34
|
export { default as en_GB } from './en_GB';
|
|
34
35
|
export { default as is } from './is';
|
package/dist/es2019/index.js
CHANGED
|
@@ -13,6 +13,9 @@ import ProfileCardTrigger from './components/User/ProfileCardTrigger'; // Do not
|
|
|
13
13
|
import { DELAY_MS_HIDE, DELAY_MS_SHOW } from './util/config'; // Legacy Profile Card in Jira still needs to use `withOuterListeners`
|
|
14
14
|
|
|
15
15
|
export { default as withOuterListeners } from './util/withOuterListeners';
|
|
16
|
+
// We cannot export this component inside `./components/Team/index.ts` because it breaks the lazyload
|
|
17
|
+
// so we have to export this here. `TeamProfileCard` helps to build legacy team profile card inside Jira FE.
|
|
18
|
+
export { default as TeamProfileCard } from './components/Team/TeamProfileCard';
|
|
16
19
|
export { ProfileCard };
|
|
17
20
|
export { ProfileCardTrigger };
|
|
18
21
|
export { TeamProfileCardTrigger };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { default as getMockProfileClient } from './mock-profile-client';
|
|
2
|
+
export { default as getMockTeamClient } from './mock-team-client';
|
|
3
|
+
export { default as profiles } from './profile-data';
|
|
4
|
+
export { simpleMockTeamClient, simpleMockUserClient, simpleProfileClient } from './simple-mock-clients';
|
|
@@ -1,51 +1,49 @@
|
|
|
1
|
-
import UserProfileCardClient from '../
|
|
2
|
-
import { ClientOverrides, ProfileClientOptions } from '../src/types';
|
|
3
|
-
|
|
1
|
+
import UserProfileCardClient from '../client/UserProfileCardClient';
|
|
4
2
|
import profiles from './profile-data';
|
|
5
3
|
import { getTimeString, getWeekday, random } from './util';
|
|
6
|
-
|
|
7
|
-
export default function getMockProfileClient(
|
|
8
|
-
BaseProfileClient: any,
|
|
9
|
-
modifyResponse: any,
|
|
10
|
-
): any {
|
|
4
|
+
export default function getMockProfileClient(BaseProfileClient, modifyResponse) {
|
|
11
5
|
class MockUserClient extends UserProfileCardClient {
|
|
12
|
-
makeRequest(cloudId
|
|
6
|
+
makeRequest(cloudId, userId) {
|
|
13
7
|
const timeout = random(1500) + 500;
|
|
14
8
|
const matchError = userId.match(/^error:([0-9a-zA-Z\-]+)$/);
|
|
15
9
|
const error = matchError && matchError[1];
|
|
16
|
-
|
|
17
|
-
return new Promise<any>((resolve, reject) => {
|
|
10
|
+
return new Promise((resolve, reject) => {
|
|
18
11
|
setTimeout(() => {
|
|
19
12
|
if (error) {
|
|
20
|
-
return reject({
|
|
13
|
+
return reject({
|
|
14
|
+
reason: error
|
|
15
|
+
});
|
|
21
16
|
}
|
|
22
17
|
|
|
23
18
|
const userIdAsIndex = parseInt(userId, 10);
|
|
24
19
|
const profile = profiles[userIdAsIndex] || profiles[0];
|
|
25
20
|
|
|
26
21
|
if (!profile) {
|
|
27
|
-
return reject({
|
|
22
|
+
return reject({
|
|
23
|
+
reason: 'default'
|
|
24
|
+
});
|
|
28
25
|
}
|
|
29
26
|
|
|
30
27
|
const weekday = getWeekday();
|
|
31
|
-
const data
|
|
32
|
-
|
|
28
|
+
const data = { ...profile
|
|
29
|
+
};
|
|
33
30
|
data.remoteTimeString = getTimeString();
|
|
34
31
|
data.remoteWeekdayIndex = weekday.index;
|
|
35
32
|
data.remoteWeekdayString = weekday.string;
|
|
36
|
-
|
|
37
33
|
return resolve(modifyResponse(data));
|
|
38
34
|
}, timeout);
|
|
39
35
|
});
|
|
40
36
|
}
|
|
37
|
+
|
|
41
38
|
}
|
|
42
39
|
|
|
43
40
|
return class MockProfileClient extends BaseProfileClient {
|
|
44
|
-
constructor(options
|
|
41
|
+
constructor(options, clients = {}) {
|
|
45
42
|
super(options, {
|
|
46
43
|
userClient: new MockUserClient(options),
|
|
47
|
-
...clients
|
|
44
|
+
...clients
|
|
48
45
|
});
|
|
49
46
|
}
|
|
47
|
+
|
|
50
48
|
};
|
|
51
|
-
}
|
|
49
|
+
}
|
|
@@ -1,17 +1,12 @@
|
|
|
1
|
-
import TeamProfileCardClient from '../
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export default function getMockTeamClient(data: {
|
|
5
|
-
team: Team;
|
|
6
|
-
timeout: number;
|
|
7
|
-
error: any;
|
|
8
|
-
errorRate: number;
|
|
9
|
-
}) {
|
|
1
|
+
import TeamProfileCardClient from '../client/TeamProfileCardClient';
|
|
2
|
+
export default function getMockTeamClient(data) {
|
|
10
3
|
return class MockTeamClient extends TeamProfileCardClient {
|
|
11
|
-
makeRequest(teamId
|
|
4
|
+
makeRequest(teamId) {
|
|
12
5
|
if (!data.timeout) {
|
|
13
6
|
if (data.error && Math.random() < data.errorRate) {
|
|
14
|
-
return Promise.reject({
|
|
7
|
+
return Promise.reject({
|
|
8
|
+
reason: data.error
|
|
9
|
+
});
|
|
15
10
|
}
|
|
16
11
|
|
|
17
12
|
return Promise.resolve(data.team);
|
|
@@ -20,12 +15,15 @@ export default function getMockTeamClient(data: {
|
|
|
20
15
|
return new Promise((resolve, reject) => {
|
|
21
16
|
setTimeout(() => {
|
|
22
17
|
if (data.error && Math.random() < data.errorRate) {
|
|
23
|
-
reject({
|
|
18
|
+
reject({
|
|
19
|
+
reason: data.error
|
|
20
|
+
});
|
|
24
21
|
}
|
|
25
22
|
|
|
26
23
|
return resolve(data.team);
|
|
27
24
|
}, data.timeout);
|
|
28
25
|
});
|
|
29
26
|
}
|
|
27
|
+
|
|
30
28
|
};
|
|
31
|
-
}
|
|
29
|
+
}
|