@atlaskit/profilecard 16.4.3 → 16.4.6

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 CHANGED
@@ -1,5 +1,23 @@
1
1
  # @atlaskit/profilecard
2
2
 
3
+ ## 16.4.6
4
+
5
+ ### Patch Changes
6
+
7
+ - [`386249e4be4`](https://bitbucket.org/atlassian/atlassian-frontend/commits/386249e4be4) - [ux] Fix hide handler when the profile card is triggered via click
8
+
9
+ ## 16.4.5
10
+
11
+ ### Patch Changes
12
+
13
+ - [`18ab5ef3325`](https://bitbucket.org/atlassian/atlassian-frontend/commits/18ab5ef3325) - Filter out certain types of failures for team profilecard data fetch
14
+
15
+ ## 16.4.4
16
+
17
+ ### Patch Changes
18
+
19
+ - [`b876346271a`](https://bitbucket.org/atlassian/atlassian-frontend/commits/b876346271a) - Ensure that component wrapping a ProfileCardTrigger is not clicked when clicking the trigger
20
+
3
21
  ## 16.4.3
4
22
 
5
23
  ### Patch Changes
@@ -43,6 +43,12 @@ var buildTeamQuery = function buildTeamQuery(teamId, orgId) {
43
43
  };
44
44
  };
45
45
 
46
+ var IGNORED_ERRORS = ['NotPermitted', 'Gone'];
47
+
48
+ function isRealError(error) {
49
+ return !IGNORED_ERRORS.includes(error.reason);
50
+ }
51
+
46
52
  var TeamProfileCardClient = /*#__PURE__*/function (_CachingClient) {
47
53
  (0, _inherits2.default)(TeamProfileCardClient, _CachingClient);
48
54
 
@@ -116,7 +122,7 @@ var TeamProfileCardClient = /*#__PURE__*/function (_CachingClient) {
116
122
 
117
123
  resolve(data);
118
124
  }).catch(function (error) {
119
- if (analytics) {
125
+ if (analytics && isRealError(error)) {
120
126
  analytics((0, _analytics.teamRequestAnalytics)('failed', {
121
127
  duration: (0, _performance.getPageTime)() - startTime,
122
128
  errorStatus: error.code,
@@ -99,11 +99,19 @@ var ProfilecardTrigger = /*#__PURE__*/function (_React$PureComponent) {
99
99
  }
100
100
  }, _this.showDelay);
101
101
  });
102
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "onClick", function (event) {
103
+ // If the user clicks on the trigger then we don't want that click event to
104
+ // propagate out to parent containers. For example when clicking a mention
105
+ // lozenge in an inline-edit.
106
+ event.stopPropagation();
107
+
108
+ _this.showProfilecard();
109
+ });
102
110
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "containerListeners", _this.props.trigger === 'hover' ? {
103
111
  onMouseEnter: _this.showProfilecard,
104
112
  onMouseLeave: _this.hideProfilecard
105
113
  } : {
106
- onClick: _this.showProfilecard
114
+ onClick: _this.onClick
107
115
  });
108
116
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "layerListeners", {
109
117
  handleClickOutside: _this.hideProfilecard,
@@ -256,7 +264,8 @@ var ProfilecardTrigger = /*#__PURE__*/function (_React$PureComponent) {
256
264
  "data-testid": _this2.props.testId
257
265
  }), _this2.props.children);
258
266
  },
259
- zIndex: _constants.layers.modal()
267
+ zIndex: _constants.layers.modal(),
268
+ shouldUseCaptureOnOutsideClick: true
260
269
  });
261
270
  }
262
271
  }, {
@@ -56,7 +56,7 @@ var createEvent = function createEvent(eventType, action, actionSubject, actionS
56
56
  actionSubjectId: actionSubjectId,
57
57
  attributes: _objectSpread(_objectSpread({
58
58
  packageName: "@atlaskit/profilecard",
59
- packageVersion: "16.4.3"
59
+ packageVersion: "16.4.6"
60
60
  }, attributes), {}, {
61
61
  firedAt: (0, _performance.getPageTime)()
62
62
  })
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "name": "@atlaskit/profilecard",
3
- "version": "16.4.3"
3
+ "version": "16.4.6"
4
4
  }
@@ -28,6 +28,12 @@ const buildTeamQuery = (teamId, orgId) => ({
28
28
  }
29
29
  });
30
30
 
31
+ const IGNORED_ERRORS = ['NotPermitted', 'Gone'];
32
+
33
+ function isRealError(error) {
34
+ return !IGNORED_ERRORS.includes(error.reason);
35
+ }
36
+
31
37
  export default class TeamProfileCardClient extends CachingClient {
32
38
  constructor(options) {
33
39
  super(options);
@@ -85,7 +91,7 @@ export default class TeamProfileCardClient extends CachingClient {
85
91
 
86
92
  resolve(data);
87
93
  }).catch(error => {
88
- if (analytics) {
94
+ if (analytics && isRealError(error)) {
89
95
  analytics(teamRequestAnalytics('failed', {
90
96
  duration: getPageTime() - startTime,
91
97
  errorStatus: error.code,
@@ -46,11 +46,19 @@ class ProfilecardTrigger extends React.PureComponent {
46
46
  }, this.showDelay);
47
47
  });
48
48
 
49
+ _defineProperty(this, "onClick", event => {
50
+ // If the user clicks on the trigger then we don't want that click event to
51
+ // propagate out to parent containers. For example when clicking a mention
52
+ // lozenge in an inline-edit.
53
+ event.stopPropagation();
54
+ this.showProfilecard();
55
+ });
56
+
49
57
  _defineProperty(this, "containerListeners", this.props.trigger === 'hover' ? {
50
58
  onMouseEnter: this.showProfilecard,
51
59
  onMouseLeave: this.hideProfilecard
52
60
  } : {
53
- onClick: this.showProfilecard
61
+ onClick: this.onClick
54
62
  });
55
63
 
56
64
  _defineProperty(this, "layerListeners", {
@@ -198,7 +206,8 @@ class ProfilecardTrigger extends React.PureComponent {
198
206
  "data-testid": this.props.testId
199
207
  }), this.props.children);
200
208
  },
201
- zIndex: layers.modal()
209
+ zIndex: layers.modal(),
210
+ shouldUseCaptureOnOutsideClick: true
202
211
  });
203
212
  }
204
213
 
@@ -35,7 +35,7 @@ const createEvent = (eventType, action, actionSubject, actionSubjectId, attribut
35
35
  actionSubjectId,
36
36
  attributes: {
37
37
  packageName: "@atlaskit/profilecard",
38
- packageVersion: "16.4.3",
38
+ packageVersion: "16.4.6",
39
39
  ...attributes,
40
40
  firedAt: getPageTime()
41
41
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "name": "@atlaskit/profilecard",
3
- "version": "16.4.3"
3
+ "version": "16.4.6"
4
4
  }
@@ -25,6 +25,12 @@ var buildTeamQuery = function buildTeamQuery(teamId, orgId) {
25
25
  };
26
26
  };
27
27
 
28
+ var IGNORED_ERRORS = ['NotPermitted', 'Gone'];
29
+
30
+ function isRealError(error) {
31
+ return !IGNORED_ERRORS.includes(error.reason);
32
+ }
33
+
28
34
  var TeamProfileCardClient = /*#__PURE__*/function (_CachingClient) {
29
35
  _inherits(TeamProfileCardClient, _CachingClient);
30
36
 
@@ -99,7 +105,7 @@ var TeamProfileCardClient = /*#__PURE__*/function (_CachingClient) {
99
105
 
100
106
  resolve(data);
101
107
  }).catch(function (error) {
102
- if (analytics) {
108
+ if (analytics && isRealError(error)) {
103
109
  analytics(teamRequestAnalytics('failed', {
104
110
  duration: getPageTime() - startTime,
105
111
  errorStatus: error.code,
@@ -76,11 +76,20 @@ var ProfilecardTrigger = /*#__PURE__*/function (_React$PureComponent) {
76
76
  }, _this.showDelay);
77
77
  });
78
78
 
79
+ _defineProperty(_assertThisInitialized(_this), "onClick", function (event) {
80
+ // If the user clicks on the trigger then we don't want that click event to
81
+ // propagate out to parent containers. For example when clicking a mention
82
+ // lozenge in an inline-edit.
83
+ event.stopPropagation();
84
+
85
+ _this.showProfilecard();
86
+ });
87
+
79
88
  _defineProperty(_assertThisInitialized(_this), "containerListeners", _this.props.trigger === 'hover' ? {
80
89
  onMouseEnter: _this.showProfilecard,
81
90
  onMouseLeave: _this.hideProfilecard
82
91
  } : {
83
- onClick: _this.showProfilecard
92
+ onClick: _this.onClick
84
93
  });
85
94
 
86
95
  _defineProperty(_assertThisInitialized(_this), "layerListeners", {
@@ -239,7 +248,8 @@ var ProfilecardTrigger = /*#__PURE__*/function (_React$PureComponent) {
239
248
  "data-testid": _this2.props.testId
240
249
  }), _this2.props.children);
241
250
  },
242
- zIndex: layers.modal()
251
+ zIndex: layers.modal(),
252
+ shouldUseCaptureOnOutsideClick: true
243
253
  });
244
254
  }
245
255
  }, {
@@ -45,7 +45,7 @@ var createEvent = function createEvent(eventType, action, actionSubject, actionS
45
45
  actionSubjectId: actionSubjectId,
46
46
  attributes: _objectSpread(_objectSpread({
47
47
  packageName: "@atlaskit/profilecard",
48
- packageVersion: "16.4.3"
48
+ packageVersion: "16.4.6"
49
49
  }, attributes), {}, {
50
50
  firedAt: getPageTime()
51
51
  })
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "name": "@atlaskit/profilecard",
3
- "version": "16.4.3"
3
+ "version": "16.4.6"
4
4
  }
@@ -9,12 +9,13 @@ declare class ProfilecardTrigger extends React.PureComponent<ProfileCardTriggerP
9
9
  hideTimer: number;
10
10
  hideProfilecard: () => void;
11
11
  showProfilecard: () => void;
12
+ onClick: (event: React.MouseEvent) => void;
12
13
  containerListeners: {
13
14
  onMouseEnter: () => void;
14
15
  onMouseLeave: () => void;
15
16
  onClick?: undefined;
16
17
  } | {
17
- onClick: () => void;
18
+ onClick: (event: React.MouseEvent) => void;
18
19
  onMouseEnter?: undefined;
19
20
  onMouseLeave?: undefined;
20
21
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/profilecard",
3
- "version": "16.4.3",
3
+ "version": "16.4.6",
4
4
  "description": "A React component to display a card with user information.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"