@atlaskit/profilecard 18.2.2 → 18.2.3

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.
Files changed (161) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/cjs/client/CachingClient.js +8 -22
  3. package/dist/cjs/client/ProfileCardClient.js +0 -18
  4. package/dist/cjs/client/TeamCentralCardClient.js +2 -55
  5. package/dist/cjs/client/TeamProfileCardClient.js +0 -36
  6. package/dist/cjs/client/UserProfileCardClient.js +1 -46
  7. package/dist/cjs/client/errorUtils.js +4 -6
  8. package/dist/cjs/client/getTeamFromAGG.js +0 -23
  9. package/dist/cjs/client/graphqlUtils.js +1 -7
  10. package/dist/cjs/client/index.js +0 -9
  11. package/dist/cjs/components/Error/ErrorBoundary.js +0 -14
  12. package/dist/cjs/components/Error/ErrorIllustration.js +1 -4
  13. package/dist/cjs/components/Error/ErrorMessage.js +1 -15
  14. package/dist/cjs/components/Error/index.js +0 -4
  15. package/dist/cjs/components/Icon/IconLabel.js +2 -23
  16. package/dist/cjs/components/Icon/index.js +0 -2
  17. package/dist/cjs/components/Team/TeamLoadingState.js +0 -10
  18. package/dist/cjs/components/Team/TeamProfileCard.js +29 -87
  19. package/dist/cjs/components/Team/TeamProfileCardTrigger.js +19 -85
  20. package/dist/cjs/components/Team/index.js +0 -4
  21. package/dist/cjs/components/Team/lazyTeamProfileCard.js +0 -6
  22. package/dist/cjs/components/User/OverflowProfileCardButtons.js +7 -30
  23. package/dist/cjs/components/User/ProfileCard.js +11 -57
  24. package/dist/cjs/components/User/ProfileCardDetails.js +11 -40
  25. package/dist/cjs/components/User/ProfileCardResourced.js +15 -61
  26. package/dist/cjs/components/User/ProfileCardTrigger.js +8 -63
  27. package/dist/cjs/components/User/ReportingLinesDetails.js +7 -23
  28. package/dist/cjs/components/User/UserLoadingState.js +0 -10
  29. package/dist/cjs/components/User/index.js +0 -5
  30. package/dist/cjs/components/User/lazyProfileCard.js +0 -6
  31. package/dist/cjs/i18n/cs.js +0 -1
  32. package/dist/cjs/i18n/da.js +0 -1
  33. package/dist/cjs/i18n/de.js +0 -1
  34. package/dist/cjs/i18n/en.js +0 -1
  35. package/dist/cjs/i18n/en_GB.js +0 -1
  36. package/dist/cjs/i18n/en_ZZ.js +0 -1
  37. package/dist/cjs/i18n/es.js +0 -1
  38. package/dist/cjs/i18n/et.js +0 -1
  39. package/dist/cjs/i18n/fi.js +0 -1
  40. package/dist/cjs/i18n/fr.js +0 -1
  41. package/dist/cjs/i18n/hu.js +0 -1
  42. package/dist/cjs/i18n/index.js +0 -31
  43. package/dist/cjs/i18n/is.js +0 -1
  44. package/dist/cjs/i18n/it.js +0 -1
  45. package/dist/cjs/i18n/ja.js +0 -1
  46. package/dist/cjs/i18n/ko.js +0 -1
  47. package/dist/cjs/i18n/languages.js +0 -1
  48. package/dist/cjs/i18n/nb.js +0 -1
  49. package/dist/cjs/i18n/nl.js +0 -1
  50. package/dist/cjs/i18n/pl.js +0 -1
  51. package/dist/cjs/i18n/pt_BR.js +0 -1
  52. package/dist/cjs/i18n/pt_PT.js +0 -1
  53. package/dist/cjs/i18n/ro.js +0 -1
  54. package/dist/cjs/i18n/ru.js +0 -1
  55. package/dist/cjs/i18n/sk.js +0 -1
  56. package/dist/cjs/i18n/sv.js +0 -1
  57. package/dist/cjs/i18n/th.js +0 -1
  58. package/dist/cjs/i18n/tr.js +0 -1
  59. package/dist/cjs/i18n/uk.js +0 -1
  60. package/dist/cjs/i18n/vi.js +0 -1
  61. package/dist/cjs/i18n/zh.js +0 -1
  62. package/dist/cjs/i18n/zh_TW.js +0 -1
  63. package/dist/cjs/index.js +0 -15
  64. package/dist/cjs/internal/filterActions.js +0 -3
  65. package/dist/cjs/internal/relative-date.js +0 -15
  66. package/dist/cjs/messages.js +0 -2
  67. package/dist/cjs/mocks/index.js +0 -5
  68. package/dist/cjs/mocks/mock-profile-client.js +0 -34
  69. package/dist/cjs/mocks/mock-team-client.js +0 -16
  70. package/dist/cjs/mocks/profile-data.js +0 -5
  71. package/dist/cjs/mocks/reporting-lines-data.js +0 -4
  72. package/dist/cjs/mocks/simple-mock-clients.js +0 -28
  73. package/dist/cjs/mocks/team-data.js +7 -12
  74. package/dist/cjs/mocks/util.js +0 -7
  75. package/dist/cjs/styled/Card.js +0 -53
  76. package/dist/cjs/styled/Error.js +0 -18
  77. package/dist/cjs/styled/ReportingLines.js +0 -16
  78. package/dist/cjs/styled/TeamCard.js +3 -35
  79. package/dist/cjs/styled/constants.js +0 -2
  80. package/dist/cjs/util/analytics.js +1 -36
  81. package/dist/cjs/util/click.js +0 -2
  82. package/dist/cjs/util/performance.js +0 -5
  83. package/dist/cjs/util/withOuterListeners.js +0 -24
  84. package/dist/cjs/version.json +1 -1
  85. package/dist/es2019/client/CachingClient.js +10 -17
  86. package/dist/es2019/client/ProfileCardClient.js +2 -16
  87. package/dist/es2019/client/TeamCentralCardClient.js +2 -34
  88. package/dist/es2019/client/TeamProfileCardClient.js +0 -16
  89. package/dist/es2019/client/UserProfileCardClient.js +4 -18
  90. package/dist/es2019/client/errorUtils.js +4 -5
  91. package/dist/es2019/client/getTeamFromAGG.js +2 -2
  92. package/dist/es2019/client/graphqlUtils.js +1 -6
  93. package/dist/es2019/components/Error/ErrorBoundary.js +0 -2
  94. package/dist/es2019/components/Error/ErrorMessage.js +0 -5
  95. package/dist/es2019/components/Icon/IconLabel.js +2 -4
  96. package/dist/es2019/components/Team/TeamProfileCard.js +5 -29
  97. package/dist/es2019/components/Team/TeamProfileCardTrigger.js +2 -54
  98. package/dist/es2019/components/Team/lazyTeamProfileCard.js +1 -2
  99. package/dist/es2019/components/User/OverflowProfileCardButtons.js +0 -1
  100. package/dist/es2019/components/User/ProfileCard.js +0 -16
  101. package/dist/es2019/components/User/ProfileCardDetails.js +0 -12
  102. package/dist/es2019/components/User/ProfileCardResourced.js +0 -25
  103. package/dist/es2019/components/User/ProfileCardTrigger.js +2 -40
  104. package/dist/es2019/components/User/ReportingLinesDetails.js +0 -7
  105. package/dist/es2019/components/User/UserLoadingState.js +0 -2
  106. package/dist/es2019/components/User/lazyProfileCard.js +1 -2
  107. package/dist/es2019/index.js +6 -5
  108. package/dist/es2019/internal/filterActions.js +0 -2
  109. package/dist/es2019/internal/relative-date.js +0 -7
  110. package/dist/es2019/mocks/mock-profile-client.js +4 -13
  111. package/dist/es2019/mocks/mock-team-client.js +0 -5
  112. package/dist/es2019/mocks/profile-data.js +0 -1
  113. package/dist/es2019/mocks/simple-mock-clients.js +2 -6
  114. package/dist/es2019/mocks/team-data.js +0 -1
  115. package/dist/es2019/mocks/util.js +0 -1
  116. package/dist/es2019/styled/Card.js +0 -2
  117. package/dist/es2019/styled/TeamCard.js +4 -1
  118. package/dist/es2019/util/analytics.js +2 -10
  119. package/dist/es2019/util/performance.js +0 -2
  120. package/dist/es2019/util/withOuterListeners.js +0 -10
  121. package/dist/es2019/version.json +1 -1
  122. package/dist/esm/client/CachingClient.js +8 -20
  123. package/dist/esm/client/ProfileCardClient.js +0 -14
  124. package/dist/esm/client/TeamCentralCardClient.js +2 -48
  125. package/dist/esm/client/TeamProfileCardClient.js +0 -25
  126. package/dist/esm/client/UserProfileCardClient.js +2 -33
  127. package/dist/esm/client/errorUtils.js +4 -5
  128. package/dist/esm/client/getTeamFromAGG.js +0 -8
  129. package/dist/esm/client/graphqlUtils.js +1 -6
  130. package/dist/esm/components/Error/ErrorBoundary.js +0 -8
  131. package/dist/esm/components/Error/ErrorMessage.js +1 -6
  132. package/dist/esm/components/Icon/IconLabel.js +2 -13
  133. package/dist/esm/components/Team/TeamProfileCard.js +29 -61
  134. package/dist/esm/components/Team/TeamProfileCardTrigger.js +19 -83
  135. package/dist/esm/components/Team/lazyTeamProfileCard.js +1 -2
  136. package/dist/esm/components/User/OverflowProfileCardButtons.js +7 -12
  137. package/dist/esm/components/User/ProfileCard.js +11 -31
  138. package/dist/esm/components/User/ProfileCardDetails.js +11 -26
  139. package/dist/esm/components/User/ProfileCardResourced.js +15 -48
  140. package/dist/esm/components/User/ProfileCardTrigger.js +8 -57
  141. package/dist/esm/components/User/ReportingLinesDetails.js +7 -14
  142. package/dist/esm/components/User/UserLoadingState.js +0 -2
  143. package/dist/esm/components/User/lazyProfileCard.js +1 -2
  144. package/dist/esm/index.js +6 -5
  145. package/dist/esm/internal/filterActions.js +0 -2
  146. package/dist/esm/internal/relative-date.js +0 -8
  147. package/dist/esm/mocks/mock-profile-client.js +0 -28
  148. package/dist/esm/mocks/mock-team-client.js +0 -11
  149. package/dist/esm/mocks/profile-data.js +0 -1
  150. package/dist/esm/mocks/simple-mock-clients.js +0 -20
  151. package/dist/esm/mocks/team-data.js +7 -8
  152. package/dist/esm/mocks/util.js +0 -1
  153. package/dist/esm/styled/Card.js +0 -4
  154. package/dist/esm/styled/Error.js +0 -2
  155. package/dist/esm/styled/ReportingLines.js +0 -2
  156. package/dist/esm/styled/TeamCard.js +4 -3
  157. package/dist/esm/util/analytics.js +2 -13
  158. package/dist/esm/util/performance.js +0 -2
  159. package/dist/esm/util/withOuterListeners.js +0 -17
  160. package/dist/esm/version.json +1 -1
  161. package/package.json +2 -2
@@ -7,11 +7,8 @@ import _inherits from "@babel/runtime/helpers/inherits";
7
7
  import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
8
8
  import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
9
9
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
10
-
11
10
  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); }; }
12
-
13
11
  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; } }
14
-
15
12
  import React, { Suspense } from 'react';
16
13
  import { FormattedMessage } from 'react-intl-next';
17
14
  import { withAnalyticsEvents } from '@atlaskit/analytics-next';
@@ -29,47 +26,32 @@ import { TeamProfileCardLazy } from './lazyTeamProfileCard';
29
26
  import TeamLoadingState from './TeamLoadingState';
30
27
  export var TeamProfileCardTriggerInternal = /*#__PURE__*/function (_React$PureComponent) {
31
28
  _inherits(TeamProfileCardTriggerInternal, _React$PureComponent);
32
-
33
29
  var _super = _createSuper(TeamProfileCardTriggerInternal);
34
-
35
30
  function TeamProfileCardTriggerInternal() {
36
31
  var _this;
37
-
38
32
  _classCallCheck(this, TeamProfileCardTriggerInternal);
39
-
40
33
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
41
34
  args[_key] = arguments[_key];
42
35
  }
43
-
44
36
  _this = _super.call.apply(_super, [this].concat(args));
45
-
46
37
  _defineProperty(_assertThisInitialized(_this), "_isMounted", false);
47
-
48
38
  _defineProperty(_assertThisInitialized(_this), "showTimer", 0);
49
-
50
39
  _defineProperty(_assertThisInitialized(_this), "hideTimer", 0);
51
-
52
40
  _defineProperty(_assertThisInitialized(_this), "openedByHover", false);
53
-
54
41
  _defineProperty(_assertThisInitialized(_this), "openTime", 0);
55
-
56
42
  _defineProperty(_assertThisInitialized(_this), "fireAnalytics", function (payload) {
57
43
  // Don't fire any analytics if the component is unmounted
58
44
  if (!_this._isMounted) {
59
45
  return;
60
46
  }
61
-
62
47
  if (_this.props.createAnalyticsEvent) {
63
48
  fireEvent(_this.props.createAnalyticsEvent, payload);
64
49
  }
65
50
  });
66
-
67
51
  _defineProperty(_assertThisInitialized(_this), "fireAnalyticsWithDuration", function (generator) {
68
52
  var event = generator(getPageTime() - _this.openTime);
69
-
70
53
  _this.fireAnalytics(event);
71
54
  });
72
-
73
55
  _defineProperty(_assertThisInitialized(_this), "hideProfilecard", function () {
74
56
  var delay = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
75
57
  clearTimeout(_this.showTimer);
@@ -80,7 +62,6 @@ export var TeamProfileCardTriggerInternal = /*#__PURE__*/function (_React$PureCo
80
62
  });
81
63
  }, delay);
82
64
  });
83
-
84
65
  _defineProperty(_assertThisInitialized(_this), "showProfilecard", function () {
85
66
  var delay = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
86
67
  clearTimeout(_this.hideTimer);
@@ -88,16 +69,13 @@ export var TeamProfileCardTriggerInternal = /*#__PURE__*/function (_React$PureCo
88
69
  _this.showTimer = window.setTimeout(function () {
89
70
  if (!_this.state.visible) {
90
71
  _this.clientFetchProfile();
91
-
92
72
  _this.openTime = getPageTime();
93
-
94
73
  _this.setState({
95
74
  visible: true
96
75
  });
97
76
  }
98
77
  }, delay);
99
78
  });
100
-
101
79
  _defineProperty(_assertThisInitialized(_this), "onClick", function (event) {
102
80
  if (_this.props.triggerLinkType === 'link') {
103
81
  // We want to prevent navigation occurring on basic click, but it's important that
@@ -106,90 +84,71 @@ export var TeamProfileCardTriggerInternal = /*#__PURE__*/function (_React$PureCo
106
84
  event.preventDefault();
107
85
  }
108
86
  }
109
-
110
87
  if (_this.props.triggerLinkType === 'clickable-link') {
111
88
  if (_this.props.viewProfileOnClick) {
112
89
  _this.props.viewProfileOnClick(event);
113
90
  }
114
91
  }
115
-
116
92
  if (_this.props.trigger !== 'hover') {
117
93
  _this.openedByHover = false;
118
-
119
94
  _this.showProfilecard(0);
120
-
121
95
  if (!_this.state.visible) {
122
96
  _this.fireAnalytics(cardTriggered('team', 'click'));
123
97
  }
124
98
  }
125
99
  });
126
-
127
100
  _defineProperty(_assertThisInitialized(_this), "onMouseEnter", function () {
128
101
  if (_this.props.trigger === 'click') {
129
102
  return;
130
103
  }
131
-
132
104
  if (!_this.state.visible) {
133
105
  _this.openedByHover = true;
134
-
135
106
  _this.fireAnalytics(cardTriggered('team', 'hover'));
136
107
  }
137
-
138
108
  _this.showProfilecard(DELAY_MS_SHOW);
139
109
  });
140
-
141
110
  _defineProperty(_assertThisInitialized(_this), "onMouseLeave", function () {
142
111
  if (_this.props.trigger === 'click') {
143
112
  return;
144
113
  }
145
-
146
114
  if (_this.openedByHover) {
147
115
  _this.hideProfilecard(DELAY_MS_HIDE);
148
116
  }
149
117
  });
150
-
151
118
  _defineProperty(_assertThisInitialized(_this), "onClose", function () {
152
119
  _this.hideProfilecard();
153
120
  });
154
-
155
121
  _defineProperty(_assertThisInitialized(_this), "openKudosDrawer", function () {
156
122
  _this.hideProfilecard(DELAY_MS_HIDE);
157
-
158
123
  _this.setState({
159
124
  kudosDrawerOpen: true
160
125
  });
161
126
  });
162
-
163
127
  _defineProperty(_assertThisInitialized(_this), "closeKudosDrawer", function () {
164
128
  _this.setState({
165
129
  kudosDrawerOpen: false
166
130
  });
167
131
  });
168
-
169
132
  _defineProperty(_assertThisInitialized(_this), "kudosUrl", function () {
170
133
  var recipientId = _this.props.teamId && "&recipientId=".concat(_this.props.teamId) || '';
171
134
  var cloudId = _this.props.cloudId && "&cloudId=".concat(_this.props.cloudId) || '';
172
135
  return "".concat(_this.state.teamCentralBaseUrl, "/kudos/give?type=team").concat(recipientId).concat(cloudId);
173
136
  });
174
-
175
137
  _defineProperty(_assertThisInitialized(_this), "stopPropagation", function (event) {
176
138
  // We need to stop propagation when users click on the card, so that it
177
139
  // doesn't trigger any special effects that occur when clicking the trigger.
178
140
  event.stopPropagation();
179
141
  });
180
-
181
142
  _defineProperty(_assertThisInitialized(_this), "triggerListeners", {
182
143
  onClick: _this.onClick,
183
144
  onMouseEnter: _this.onMouseEnter,
184
145
  onMouseLeave: _this.onMouseLeave
185
146
  });
186
-
187
147
  _defineProperty(_assertThisInitialized(_this), "cardListeners", {
188
148
  onClick: _this.stopPropagation,
189
149
  onMouseEnter: _this.onMouseEnter,
190
150
  onMouseLeave: _this.onMouseLeave
191
151
  });
192
-
193
152
  _defineProperty(_assertThisInitialized(_this), "state", {
194
153
  visible: false,
195
154
  isLoading: undefined,
@@ -200,18 +159,15 @@ export var TeamProfileCardTriggerInternal = /*#__PURE__*/function (_React$PureCo
200
159
  teamCentralBaseUrl: undefined,
201
160
  kudosDrawerOpen: false
202
161
  });
203
-
204
162
  _defineProperty(_assertThisInitialized(_this), "clientFetchProfile", function () {
205
163
  var _this$props = _this.props,
206
- orgId = _this$props.orgId,
207
- teamId = _this$props.teamId;
164
+ orgId = _this$props.orgId,
165
+ teamId = _this$props.teamId;
208
166
  var isLoading = _this.state.isLoading;
209
-
210
167
  if (isLoading === true) {
211
168
  // don't fetch data when fetching is in process
212
169
  return;
213
170
  }
214
-
215
171
  _this.setState({
216
172
  isLoading: true,
217
173
  data: null
@@ -219,11 +175,9 @@ export var TeamProfileCardTriggerInternal = /*#__PURE__*/function (_React$PureCo
219
175
  var fireEvent = function fireEvent(event) {
220
176
  _this.fireAnalytics(event);
221
177
  };
222
-
223
178
  var requests = Promise.all([_this.props.resourceClient.getTeamProfile(teamId, orgId, fireEvent), _this.props.resourceClient.shouldShowGiveKudos()]);
224
179
  requests.then(function (res) {
225
180
  var _this2;
226
-
227
181
  return (_this2 = _this).handleClientSuccess.apply(_this2, _toConsumableArray(res));
228
182
  }, function (err) {
229
183
  return _this.handleClientError(err);
@@ -232,29 +186,26 @@ export var TeamProfileCardTriggerInternal = /*#__PURE__*/function (_React$PureCo
232
186
  });
233
187
  });
234
188
  });
235
-
236
189
  _defineProperty(_assertThisInitialized(_this), "onErrorBoundary", function () {
237
190
  _this.fireAnalytics(profileCardRendered('team', 'errorBoundary', {
238
191
  duration: 0
239
192
  }));
240
-
241
193
  _this.setState({
242
194
  renderError: true
243
195
  });
244
196
  });
245
-
246
197
  _defineProperty(_assertThisInitialized(_this), "renderProfileCard", function () {
247
198
  var _this$props2 = _this.props,
248
- generateUserLink = _this$props2.generateUserLink,
249
- onUserClick = _this$props2.onUserClick,
250
- viewingUserId = _this$props2.viewingUserId,
251
- viewProfileLink = _this$props2.viewProfileLink,
252
- viewProfileOnClick = _this$props2.viewProfileOnClick;
199
+ generateUserLink = _this$props2.generateUserLink,
200
+ onUserClick = _this$props2.onUserClick,
201
+ viewingUserId = _this$props2.viewingUserId,
202
+ viewProfileLink = _this$props2.viewProfileLink,
203
+ viewProfileOnClick = _this$props2.viewProfileOnClick;
253
204
  var _this$state = _this.state,
254
- data = _this$state.data,
255
- error = _this$state.error,
256
- hasError = _this$state.hasError,
257
- isLoading = _this$state.isLoading;
205
+ data = _this$state.data,
206
+ error = _this$state.error,
207
+ hasError = _this$state.hasError,
208
+ isLoading = _this$state.isLoading;
258
209
  var newProps = {
259
210
  clientFetchProfile: _this.clientFetchProfile,
260
211
  actions: _this.filterActions(),
@@ -276,7 +227,6 @@ export var TeamProfileCardTriggerInternal = /*#__PURE__*/function (_React$PureCo
276
227
  errorType: error
277
228
  }))));
278
229
  });
279
-
280
230
  _defineProperty(_assertThisInitialized(_this), "renderKudosLauncher", function () {
281
231
  return _this.state.shouldShowGiveKudos && /*#__PURE__*/React.createElement(Suspense, {
282
232
  fallback: null
@@ -293,19 +243,16 @@ export var TeamProfileCardTriggerInternal = /*#__PURE__*/function (_React$PureCo
293
243
  onClose: _this.closeKudosDrawer
294
244
  }));
295
245
  });
296
-
297
246
  _defineProperty(_assertThisInitialized(_this), "renderTrigger", function (triggerProps) {
298
247
  var _this$props3 = _this.props,
299
- children = _this$props3.children,
300
- triggerLinkType = _this$props3.triggerLinkType,
301
- viewProfileLink = _this$props3.viewProfileLink;
302
-
248
+ children = _this$props3.children,
249
+ triggerLinkType = _this$props3.triggerLinkType,
250
+ viewProfileLink = _this$props3.viewProfileLink;
303
251
  if (triggerLinkType === 'none') {
304
252
  return /*#__PURE__*/React.createElement(React.Fragment, null, _this.renderKudosLauncher(), /*#__PURE__*/React.createElement("span", _extends({
305
253
  "data-testid": "team-profilecard-trigger-wrapper"
306
254
  }, triggerProps, _this.triggerListeners), children));
307
255
  }
308
-
309
256
  return /*#__PURE__*/React.createElement(React.Fragment, null, _this.renderKudosLauncher(), /*#__PURE__*/React.createElement("a", _extends({
310
257
  "data-testid": "team-profilecard-trigger-wrapper",
311
258
  style: {
@@ -317,10 +264,8 @@ export var TeamProfileCardTriggerInternal = /*#__PURE__*/function (_React$PureCo
317
264
  ref: triggerProps.ref
318
265
  }, _this.triggerListeners), children));
319
266
  });
320
-
321
267
  return _this;
322
268
  }
323
-
324
269
  _createClass(TeamProfileCardTriggerInternal, [{
325
270
  key: "componentDidMount",
326
271
  value: function componentDidMount() {
@@ -330,11 +275,12 @@ export var TeamProfileCardTriggerInternal = /*#__PURE__*/function (_React$PureCo
330
275
  key: "componentDidUpdate",
331
276
  value: function componentDidUpdate(prevProps) {
332
277
  var _this$props4 = this.props,
333
- orgId = _this$props4.orgId,
334
- teamId = _this$props4.teamId,
335
- resourceClient = _this$props4.resourceClient;
336
- var visible = this.state.visible; // just re-fetching data when the card opens
278
+ orgId = _this$props4.orgId,
279
+ teamId = _this$props4.teamId,
280
+ resourceClient = _this$props4.resourceClient;
281
+ var visible = this.state.visible;
337
282
 
283
+ // just re-fetching data when the card opens
338
284
  if (visible && (teamId !== prevProps.teamId || orgId !== prevProps.orgId || resourceClient !== prevProps.resourceClient)) {
339
285
  this.setState({
340
286
  isLoading: undefined
@@ -354,7 +300,6 @@ export var TeamProfileCardTriggerInternal = /*#__PURE__*/function (_React$PureCo
354
300
  if (!this._isMounted) {
355
301
  return;
356
302
  }
357
-
358
303
  this.setState({
359
304
  isLoading: false,
360
305
  hasError: false,
@@ -369,7 +314,6 @@ export var TeamProfileCardTriggerInternal = /*#__PURE__*/function (_React$PureCo
369
314
  if (!this._isMounted) {
370
315
  return;
371
316
  }
372
-
373
317
  this.setState({
374
318
  isLoading: false,
375
319
  hasError: true,
@@ -380,9 +324,7 @@ export var TeamProfileCardTriggerInternal = /*#__PURE__*/function (_React$PureCo
380
324
  key: "filterActions",
381
325
  value: function filterActions() {
382
326
  var _this3 = this;
383
-
384
327
  var actions = _filterActions(this.props.actions, this.state.data);
385
-
386
328
  if (this.state.shouldShowGiveKudos) {
387
329
  var kudosAction = {
388
330
  label: /*#__PURE__*/React.createElement(FormattedMessage, messages.giveKudosButton),
@@ -394,18 +336,15 @@ export var TeamProfileCardTriggerInternal = /*#__PURE__*/function (_React$PureCo
394
336
  };
395
337
  return actions.concat([kudosAction]);
396
338
  }
397
-
398
339
  return actions;
399
340
  }
400
341
  }, {
401
342
  key: "renderPopup",
402
343
  value: function renderPopup() {
403
344
  var _this4 = this;
404
-
405
345
  if (this.state.renderError) {
406
346
  return this.props.children;
407
347
  }
408
-
409
348
  return /*#__PURE__*/React.createElement(ErrorBoundary, {
410
349
  onError: this.onErrorBoundary
411
350
  }, /*#__PURE__*/React.createElement(Popup, {
@@ -431,15 +370,12 @@ export var TeamProfileCardTriggerInternal = /*#__PURE__*/function (_React$PureCo
431
370
  }
432
371
  }
433
372
  }]);
434
-
435
373
  return TeamProfileCardTriggerInternal;
436
374
  }(React.PureComponent);
437
-
438
375
  _defineProperty(TeamProfileCardTriggerInternal, "defaultProps", {
439
376
  actions: [],
440
377
  trigger: 'hover',
441
378
  position: 'bottom-start',
442
379
  triggerLinkType: 'link'
443
380
  });
444
-
445
381
  export default withAnalyticsEvents()(TeamProfileCardTriggerInternal);
@@ -1,6 +1,5 @@
1
1
  import { lazy } from 'react';
2
2
  export var TeamProfileCardLazy = /*#__PURE__*/lazy(function () {
3
- return import(
4
- /* webpackChunkName: "@atlaskit-internal_lazy-team-profilecard" */
3
+ return import( /* webpackChunkName: "@atlaskit-internal_lazy-team-profilecard" */
5
4
  './TeamProfileCard');
6
5
  });
@@ -13,14 +13,12 @@ import { moreActionsClicked } from '../../util/analytics';
13
13
  export var ACTION_OVERFLOW_THRESHOLD = 2;
14
14
  export var OverflowProfileCardButtons = function OverflowProfileCardButtons(props) {
15
15
  var intl = useIntl();
16
-
17
16
  var _useState = useState(false),
18
- _useState2 = _slicedToArray(_useState, 2),
19
- setOpen = _useState2[1];
20
-
17
+ _useState2 = _slicedToArray(_useState, 2),
18
+ setOpen = _useState2[1];
21
19
  var actions = props.actions,
22
- onItemClick = props.onItemClick,
23
- fireAnalyticsWithDuration = props.fireAnalyticsWithDuration;
20
+ onItemClick = props.onItemClick,
21
+ fireAnalyticsWithDuration = props.fireAnalyticsWithDuration;
24
22
  var numActions = actions.length + ACTION_OVERFLOW_THRESHOLD;
25
23
  var onOpenChange = useCallback(function (_ref) {
26
24
  var nextOpen = _ref.isOpen;
@@ -33,7 +31,6 @@ export var OverflowProfileCardButtons = function OverflowProfileCardButtons(prop
33
31
  });
34
32
  });
35
33
  }
36
-
37
34
  return nextOpen;
38
35
  });
39
36
  }, [numActions, fireAnalyticsWithDuration]);
@@ -44,10 +41,9 @@ export var OverflowProfileCardButtons = function OverflowProfileCardButtons(prop
44
41
  placement: 'bottom-end',
45
42
  trigger: function trigger(_ref2) {
46
43
  var triggerRef = _ref2.triggerRef,
47
- isSelected = _ref2.isSelected,
48
- testId = _ref2.testId,
49
- providedProps = _objectWithoutProperties(_ref2, _excluded);
50
-
44
+ isSelected = _ref2.isSelected,
45
+ testId = _ref2.testId,
46
+ providedProps = _objectWithoutProperties(_ref2, _excluded);
51
47
  return /*#__PURE__*/React.createElement(Button, _extends({
52
48
  type: "button"
53
49
  }, providedProps, {
@@ -64,7 +60,6 @@ export var OverflowProfileCardButtons = function OverflowProfileCardButtons(prop
64
60
  for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
65
61
  args[_key - 1] = arguments[_key];
66
62
  }
67
-
68
63
  onItemClick(action, args, event, index);
69
64
  },
70
65
  href: action.link
@@ -17,7 +17,6 @@ import { ErrorMessage } from '../Error';
17
17
  import { ACTION_OVERFLOW_THRESHOLD, OverflowProfileCardButtons } from './OverflowProfileCardButtons';
18
18
  import { ProfileCardDetails } from './ProfileCardDetails';
19
19
  var GIVE_KUDOS_ACTION_ID = 'give-kudos';
20
-
21
20
  var useKudos = function useKudos(cloudId, userId, teamCentralBaseUrl, openKudosDrawer) {
22
21
  var kudosUrl = useMemo(function () {
23
22
  var recipientId = userId ? "&recipientId=".concat(userId) : '';
@@ -45,18 +44,15 @@ var useKudos = function useKudos(cloudId, userId, teamCentralBaseUrl, openKudosD
45
44
  kudosUrl: kudosUrl
46
45
  };
47
46
  };
48
-
49
47
  var Wrapper = function Wrapper(props) {
50
48
  return /*#__PURE__*/React.createElement(CardWrapper, {
51
49
  "data-testid": "profilecard"
52
50
  }, props.children);
53
51
  };
54
-
55
52
  export var ProfilecardInternal = function ProfilecardInternal(props) {
56
53
  var _useState = useState(getPageTime()),
57
- _useState2 = _slicedToArray(_useState, 1),
58
- openTime = _useState2[0];
59
-
54
+ _useState2 = _slicedToArray(_useState, 1),
55
+ openTime = _useState2[0];
60
56
  var createAnalyticsEvent = props.createAnalyticsEvent;
61
57
  var fireAnalytics = useCallback(function (payload) {
62
58
  if (createAnalyticsEvent) {
@@ -68,26 +64,23 @@ export var ProfilecardInternal = function ProfilecardInternal(props) {
68
64
  var event = generator(elapsed);
69
65
  fireAnalytics(event);
70
66
  }, [fireAnalytics, openTime]);
71
-
72
67
  var _useKudos = useKudos(props.cloudId, props.userId, props.teamCentralBaseUrl, props.openKudosDrawer),
73
- kudosAction = _useKudos.kudosAction;
74
-
68
+ kudosAction = _useKudos.kudosAction;
75
69
  var _props$actions = props.actions,
76
- actions = _props$actions === void 0 ? [] : _props$actions,
77
- isCurrentUser = props.isCurrentUser,
78
- isKudosEnabled = props.isKudosEnabled,
79
- _props$status = props.status,
80
- status = _props$status === void 0 ? 'active' : _props$status;
70
+ actions = _props$actions === void 0 ? [] : _props$actions,
71
+ isCurrentUser = props.isCurrentUser,
72
+ isKudosEnabled = props.isKudosEnabled,
73
+ _props$status = props.status,
74
+ status = _props$status === void 0 ? 'active' : _props$status;
81
75
  var realActions = useMemo(function () {
82
76
  if (isCurrentUser || !isKudosEnabled || status !== 'active') {
83
77
  return actions;
84
78
  }
85
-
86
79
  return actions.concat([kudosAction]);
87
80
  }, [actions, isCurrentUser, isKudosEnabled, kudosAction, status]);
88
81
  var isLoading = props.isLoading,
89
- fullName = props.fullName,
90
- hasError = props.hasError;
82
+ fullName = props.fullName,
83
+ hasError = props.hasError;
91
84
  var canRender = !hasError && !isLoading && !!(fullName || status === 'closed');
92
85
  useEffect(function () {
93
86
  if (canRender) {
@@ -99,7 +92,6 @@ export var ProfilecardInternal = function ProfilecardInternal(props) {
99
92
  });
100
93
  }
101
94
  }, [canRender, fireAnalyticsWithDuration, realActions]);
102
-
103
95
  if (hasError) {
104
96
  return /*#__PURE__*/React.createElement(Wrapper, null, /*#__PURE__*/React.createElement(ErrorMessage, {
105
97
  reload: props.clientFetchProfile,
@@ -107,17 +99,14 @@ export var ProfilecardInternal = function ProfilecardInternal(props) {
107
99
  fireAnalytics: fireAnalytics
108
100
  }));
109
101
  }
110
-
111
102
  if (isLoading) {
112
103
  return /*#__PURE__*/React.createElement(Wrapper, null, /*#__PURE__*/React.createElement(LoadingView, {
113
104
  fireAnalyticsWithDuration: fireAnalyticsWithDuration
114
105
  }));
115
106
  }
116
-
117
107
  if (!canRender) {
118
108
  return null;
119
109
  }
120
-
121
110
  var isDisabledUser = status === 'inactive' || status === 'closed';
122
111
  return /*#__PURE__*/React.createElement(Wrapper, null, /*#__PURE__*/React.createElement(CardContainer, {
123
112
  isDisabledUser: isDisabledUser,
@@ -134,10 +123,9 @@ export var ProfilecardInternal = function ProfilecardInternal(props) {
134
123
  fireAnalyticsWithDuration: fireAnalyticsWithDuration
135
124
  })))));
136
125
  };
137
-
138
126
  var Actions = function Actions(_ref) {
139
127
  var actions = _ref.actions,
140
- fireAnalyticsWithDuration = _ref.fireAnalyticsWithDuration;
128
+ fireAnalyticsWithDuration = _ref.fireAnalyticsWithDuration;
141
129
  var onActionClick = useCallback(function (action, args, event, index) {
142
130
  fireAnalyticsWithDuration(function (duration) {
143
131
  return actionClicked('user', {
@@ -148,17 +136,14 @@ var Actions = function Actions(_ref) {
148
136
  actionId: action.id || 'no-id-specified'
149
137
  });
150
138
  });
151
-
152
139
  if (action.callback && isBasicClick(event)) {
153
140
  event.preventDefault();
154
141
  action.callback.apply(action, [event].concat(_toConsumableArray(args)));
155
142
  }
156
143
  }, [fireAnalyticsWithDuration]);
157
-
158
144
  if (!actions || actions.length === 0) {
159
145
  return null;
160
146
  }
161
-
162
147
  var regularActions = actions.slice(0, ACTION_OVERFLOW_THRESHOLD);
163
148
  var overflowActions = actions.length > ACTION_OVERFLOW_THRESHOLD ? actions.slice(ACTION_OVERFLOW_THRESHOLD) : undefined;
164
149
  return /*#__PURE__*/React.createElement(ActionButtonGroup, {
@@ -172,16 +157,13 @@ var Actions = function Actions(_ref) {
172
157
  for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
173
158
  args[_key - 1] = arguments[_key];
174
159
  }
175
-
176
160
  return onActionClick(action, args, event, index);
177
161
  },
178
162
  href: action.link
179
163
  }, action.label, isKudos && /*#__PURE__*/React.createElement(KudosBlobAnimation, null));
180
-
181
164
  if (isKudos) {
182
165
  return /*#__PURE__*/React.createElement(AnimatedKudosButton, null, button);
183
166
  }
184
-
185
167
  return button;
186
168
  }), overflowActions && /*#__PURE__*/React.createElement(OverflowProfileCardButtons, {
187
169
  actions: overflowActions,
@@ -191,7 +173,6 @@ var Actions = function Actions(_ref) {
191
173
  }
192
174
  }));
193
175
  };
194
-
195
176
  var LoadingView = function LoadingView(_ref2) {
196
177
  var fireAnalyticsWithDuration = _ref2.fireAnalyticsWithDuration;
197
178
  useEffect(function () {
@@ -205,5 +186,4 @@ var LoadingView = function LoadingView(_ref2) {
205
186
  "data-testid": "profilecard-spinner-container"
206
187
  }, /*#__PURE__*/React.createElement(Spinner, null));
207
188
  };
208
-
209
189
  export default withAnalyticsEvents()(ProfilecardInternal);
@@ -9,12 +9,10 @@ import messages from '../../messages';
9
9
  import { AppTitleLabel, CustomLozengeContainer, DetailsGroup, DisabledInfo, FullNameLabel, JobTitleLabel, LozengeWrapper } from '../../styled/Card';
10
10
  import { IconLabel } from '../Icon';
11
11
  import ReportingLinesDetails from './ReportingLinesDetails';
12
-
13
12
  var renderName = function renderName(nickname, fullName, meta) {
14
13
  if (!fullName && !nickname) {
15
14
  return null;
16
15
  }
17
-
18
16
  var isNicknameRedundant = !nickname || nickname === fullName;
19
17
  var shownNickname = " (".concat(nickname, ") ");
20
18
  var displayName = isNicknameRedundant ? fullName : "".concat(fullName).concat(shownNickname);
@@ -23,15 +21,12 @@ var renderName = function renderName(nickname, fullName, meta) {
23
21
  "data-testid": "profilecard-name"
24
22
  }, displayName);
25
23
  };
26
-
27
24
  var disabledAccountDesc = function disabledAccountDesc(statusModifiedDate, disabledAccountMessage) {
28
25
  var status = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'closed';
29
-
30
26
  // consumer does not want to use built-in message
31
27
  if (disabledAccountMessage) {
32
28
  return disabledAccountMessage;
33
29
  }
34
-
35
30
  var date = statusModifiedDate ? new Date(statusModifiedDate * 1000) : null;
36
31
  var relativeDateKey = relativeDate(date);
37
32
  var msgKey = relativeDateKey ? "".concat(status, "AccountDescMsgHasDate").concat(relativeDateKey) : "".concat(status, "AccountDescMsgNoDate");
@@ -40,40 +35,34 @@ var disabledAccountDesc = function disabledAccountDesc(statusModifiedDate, disab
40
35
  "data-testid": "profilecard-disabled-account"
41
36
  }, /*#__PURE__*/React.createElement(FormattedMessage, messages.generalDescMsgForDisabledUser), ' ', secondSentence);
42
37
  };
43
-
44
38
  var CustomLozenges = function CustomLozenges(_ref) {
45
39
  var _ref$lozenges = _ref.lozenges,
46
- lozenges = _ref$lozenges === void 0 ? [] : _ref$lozenges;
47
-
40
+ lozenges = _ref$lozenges === void 0 ? [] : _ref$lozenges;
48
41
  if (lozenges.length === 0) {
49
42
  return null;
50
43
  }
51
-
52
44
  return /*#__PURE__*/React.createElement(CustomLozengeContainer, null, lozenges.map(function (_ref2, index) {
53
45
  var text = _ref2.text,
54
- otherProps = _objectWithoutProperties(_ref2, _excluded);
55
-
46
+ otherProps = _objectWithoutProperties(_ref2, _excluded);
56
47
  return /*#__PURE__*/React.createElement(Lozenge, _extends({}, otherProps, {
57
48
  key: index
58
49
  }), text);
59
50
  }));
60
51
  };
61
-
62
52
  var BotProfileCardDetails = function BotProfileCardDetails(props) {
63
53
  var fullName = props.fullName,
64
- nickname = props.nickname;
54
+ nickname = props.nickname;
65
55
  return /*#__PURE__*/React.createElement(DetailsGroup, null, renderName(nickname, fullName), /*#__PURE__*/React.createElement(AppTitleLabel, null, "App"));
66
56
  };
67
-
68
57
  var DisabledProfileCardDetails = function DisabledProfileCardDetails(props) {
69
58
  var companyName = props.companyName,
70
- disabledAccountMessage = props.disabledAccountMessage,
71
- fullName = props.fullName,
72
- _props$hasDisabledAcc = props.hasDisabledAccountLozenge,
73
- hasDisabledAccountLozenge = _props$hasDisabledAcc === void 0 ? true : _props$hasDisabledAcc,
74
- nickname = props.nickname,
75
- status = props.status,
76
- statusModifiedDate = props.statusModifiedDate;
59
+ disabledAccountMessage = props.disabledAccountMessage,
60
+ fullName = props.fullName,
61
+ _props$hasDisabledAcc = props.hasDisabledAccountLozenge,
62
+ hasDisabledAccountLozenge = _props$hasDisabledAcc === void 0 ? true : _props$hasDisabledAcc,
63
+ nickname = props.nickname,
64
+ status = props.status,
65
+ statusModifiedDate = props.statusModifiedDate;
77
66
  var name = status === 'inactive' ? fullName || nickname : nickname || /*#__PURE__*/React.createElement(FormattedMessage, messages.disabledAccountDefaultName);
78
67
  return /*#__PURE__*/React.createElement(DetailsGroup, null, /*#__PURE__*/React.createElement(FullNameLabel, {
79
68
  noMeta: true,
@@ -86,21 +75,17 @@ var DisabledProfileCardDetails = function DisabledProfileCardDetails(props) {
86
75
  icon: "companyName"
87
76
  }, companyName));
88
77
  };
89
-
90
78
  export var ProfileCardDetails = function ProfileCardDetails(props) {
91
79
  var meta = props.meta,
92
- status = props.status;
93
-
80
+ status = props.status;
94
81
  if (props.isBot) {
95
82
  return /*#__PURE__*/React.createElement(BotProfileCardDetails, props);
96
83
  }
97
-
98
84
  if (status === 'inactive' || status === 'closed') {
99
85
  return /*#__PURE__*/React.createElement(DisabledProfileCardDetails, _extends({}, props, {
100
86
  status: status
101
87
  }));
102
88
  }
103
-
104
89
  return /*#__PURE__*/React.createElement(DetailsGroup, null, renderName(props.nickname, props.fullName, meta), meta && /*#__PURE__*/React.createElement(JobTitleLabel, null, meta), /*#__PURE__*/React.createElement(CustomLozenges, {
105
90
  lozenges: props.customLozenges
106
91
  }), /*#__PURE__*/React.createElement(IconLabel, {