@atlaskit/media-picker 70.1.5 → 70.1.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,12 @@
1
1
  # @atlaskit/media-picker
2
2
 
3
+ ## 70.1.6
4
+
5
+ ### Patch Changes
6
+
7
+ - [`fa42797c7c89f`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/fa42797c7c89f) -
8
+ Remove feature gate add_media_picker_error_detail - always include error detail in analytics
9
+
3
10
  ## 70.1.5
4
11
 
5
12
  ### Patch Changes
@@ -18,7 +18,6 @@ var _react = require("react");
18
18
  var _perfMarks = require("perf-marks");
19
19
  var _mediaClient = require("@atlaskit/media-client");
20
20
  var _mediaCommon = require("@atlaskit/media-common");
21
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
22
21
  var _component = require("./component");
23
22
  var _uploadServiceImpl = require("../service/uploadServiceImpl");
24
23
  var _analytics = require("../util/analytics");
@@ -106,16 +105,14 @@ var LocalUploadComponentReact = exports.LocalUploadComponentReact = /*#__PURE__*
106
105
  });
107
106
  (0, _defineProperty2.default)(_this, "fireUploadFailed", /*#__PURE__*/function () {
108
107
  var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(payload) {
109
- var fileId, _payload$error, errorName, rawError, traceContext, _end2, _end2$duration, uploadDurationMsec, errorDetail, _rawError$innerError, _rawError$innerError2, requestMetadata;
108
+ var _rawError$innerError, _rawError$innerError2;
109
+ var fileId, _payload$error, errorName, rawError, traceContext, _end2, _end2$duration, uploadDurationMsec, errorDetail, requestMetadata;
110
110
  return _regenerator.default.wrap(function _callee$(_context) {
111
111
  while (1) switch (_context.prev = _context.next) {
112
112
  case 0:
113
113
  fileId = payload.fileId, _payload$error = payload.error, errorName = _payload$error.name, rawError = _payload$error.rawError, traceContext = payload.traceContext;
114
114
  _end2 = (0, _perfMarks.end)("MediaPicker.fireUpload.".concat(fileId)), _end2$duration = _end2.duration, uploadDurationMsec = _end2$duration === void 0 ? -1 : _end2$duration;
115
- errorDetail = 'unknown';
116
- if ((0, _platformFeatureFlags.fg)('add_media_picker_error_detail')) {
117
- errorDetail = rawError && (0, _mediaClient.isCommonMediaClientError)(rawError) && (_rawError$innerError = rawError.innerError) !== null && _rawError$innerError !== void 0 && _rawError$innerError.message ? (_rawError$innerError2 = rawError.innerError) === null || _rawError$innerError2 === void 0 ? void 0 : _rawError$innerError2.message : rawError instanceof Error ? rawError.message : payload.error.description;
118
- }
115
+ errorDetail = rawError && (0, _mediaClient.isCommonMediaClientError)(rawError) && (_rawError$innerError = rawError.innerError) !== null && _rawError$innerError !== void 0 && _rawError$innerError.message ? (_rawError$innerError2 = rawError.innerError) === null || _rawError$innerError2 === void 0 ? void 0 : _rawError$innerError2.message : rawError instanceof Error ? rawError.message : payload.error.description;
119
116
  requestMetadata = !!rawError ? (0, _analytics.getRequestMetadata)(rawError) : undefined;
120
117
  _this.createAndFireAnalyticsEvent({
121
118
  eventType: 'operational',
@@ -149,7 +146,7 @@ var LocalUploadComponentReact = exports.LocalUploadComponentReact = /*#__PURE__*
149
146
  },
150
147
  uploadDurationMsec: uploadDurationMsec
151
148
  });
152
- case 7:
149
+ case 6:
153
150
  case "end":
154
151
  return _context.stop();
155
152
  }
@@ -3,7 +3,6 @@ import { Component } from 'react';
3
3
  import { start, end } from 'perf-marks';
4
4
  import { getMediaClientErrorReason, isCommonMediaClientError } from '@atlaskit/media-client';
5
5
  import { ANALYTICS_MEDIA_CHANNEL } from '@atlaskit/media-common';
6
- import { fg } from '@atlaskit/platform-feature-flags';
7
6
  import { UploadComponent } from './component';
8
7
  import { UploadServiceImpl } from '../service/uploadServiceImpl';
9
8
  import { getRequestMetadata } from '../util/analytics';
@@ -92,6 +91,7 @@ export class LocalUploadComponentReact extends Component {
92
91
  });
93
92
  });
94
93
  _defineProperty(this, "fireUploadFailed", async payload => {
94
+ var _rawError$innerError, _rawError$innerError2;
95
95
  const {
96
96
  fileId,
97
97
  error: {
@@ -103,11 +103,7 @@ export class LocalUploadComponentReact extends Component {
103
103
  const {
104
104
  duration: uploadDurationMsec = -1
105
105
  } = end(`MediaPicker.fireUpload.${fileId}`);
106
- let errorDetail = 'unknown';
107
- if (fg('add_media_picker_error_detail')) {
108
- var _rawError$innerError, _rawError$innerError2;
109
- errorDetail = rawError && isCommonMediaClientError(rawError) && (_rawError$innerError = rawError.innerError) !== null && _rawError$innerError !== void 0 && _rawError$innerError.message ? (_rawError$innerError2 = rawError.innerError) === null || _rawError$innerError2 === void 0 ? void 0 : _rawError$innerError2.message : rawError instanceof Error ? rawError.message : payload.error.description;
110
- }
106
+ const errorDetail = rawError && isCommonMediaClientError(rawError) && (_rawError$innerError = rawError.innerError) !== null && _rawError$innerError !== void 0 && _rawError$innerError.message ? (_rawError$innerError2 = rawError.innerError) === null || _rawError$innerError2 === void 0 ? void 0 : _rawError$innerError2.message : rawError instanceof Error ? rawError.message : payload.error.description;
111
107
  const requestMetadata = !!rawError ? getRequestMetadata(rawError) : undefined;
112
108
  this.createAndFireAnalyticsEvent({
113
109
  eventType: 'operational',
@@ -13,7 +13,6 @@ import { Component } from 'react';
13
13
  import { start, end } from 'perf-marks';
14
14
  import { getMediaClientErrorReason, isCommonMediaClientError } from '@atlaskit/media-client';
15
15
  import { ANALYTICS_MEDIA_CHANNEL } from '@atlaskit/media-common';
16
- import { fg } from '@atlaskit/platform-feature-flags';
17
16
  import { UploadComponent } from './component';
18
17
  import { UploadServiceImpl } from '../service/uploadServiceImpl';
19
18
  import { getRequestMetadata } from '../util/analytics';
@@ -99,16 +98,14 @@ export var LocalUploadComponentReact = /*#__PURE__*/function (_Component) {
99
98
  });
100
99
  _defineProperty(_this, "fireUploadFailed", /*#__PURE__*/function () {
101
100
  var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(payload) {
102
- var fileId, _payload$error, errorName, rawError, traceContext, _end2, _end2$duration, uploadDurationMsec, errorDetail, _rawError$innerError, _rawError$innerError2, requestMetadata;
101
+ var _rawError$innerError, _rawError$innerError2;
102
+ var fileId, _payload$error, errorName, rawError, traceContext, _end2, _end2$duration, uploadDurationMsec, errorDetail, requestMetadata;
103
103
  return _regeneratorRuntime.wrap(function _callee$(_context) {
104
104
  while (1) switch (_context.prev = _context.next) {
105
105
  case 0:
106
106
  fileId = payload.fileId, _payload$error = payload.error, errorName = _payload$error.name, rawError = _payload$error.rawError, traceContext = payload.traceContext;
107
107
  _end2 = end("MediaPicker.fireUpload.".concat(fileId)), _end2$duration = _end2.duration, uploadDurationMsec = _end2$duration === void 0 ? -1 : _end2$duration;
108
- errorDetail = 'unknown';
109
- if (fg('add_media_picker_error_detail')) {
110
- errorDetail = rawError && isCommonMediaClientError(rawError) && (_rawError$innerError = rawError.innerError) !== null && _rawError$innerError !== void 0 && _rawError$innerError.message ? (_rawError$innerError2 = rawError.innerError) === null || _rawError$innerError2 === void 0 ? void 0 : _rawError$innerError2.message : rawError instanceof Error ? rawError.message : payload.error.description;
111
- }
108
+ errorDetail = rawError && isCommonMediaClientError(rawError) && (_rawError$innerError = rawError.innerError) !== null && _rawError$innerError !== void 0 && _rawError$innerError.message ? (_rawError$innerError2 = rawError.innerError) === null || _rawError$innerError2 === void 0 ? void 0 : _rawError$innerError2.message : rawError instanceof Error ? rawError.message : payload.error.description;
112
109
  requestMetadata = !!rawError ? getRequestMetadata(rawError) : undefined;
113
110
  _this.createAndFireAnalyticsEvent({
114
111
  eventType: 'operational',
@@ -142,7 +139,7 @@ export var LocalUploadComponentReact = /*#__PURE__*/function (_Component) {
142
139
  },
143
140
  uploadDurationMsec: uploadDurationMsec
144
141
  });
145
- case 7:
142
+ case 6:
146
143
  case "end":
147
144
  return _context.stop();
148
145
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/media-picker",
3
- "version": "70.1.5",
3
+ "version": "70.1.6",
4
4
  "description": "Library for handling file uploads",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -38,7 +38,7 @@
38
38
  "@atlaskit/media-ui": "^28.7.0",
39
39
  "@atlaskit/platform-feature-flags": "^1.1.0",
40
40
  "@atlaskit/theme": "^21.0.0",
41
- "@atlaskit/tokens": "^9.0.0",
41
+ "@atlaskit/tokens": "^9.1.0",
42
42
  "@atlaskit/ufo": "^0.4.0",
43
43
  "@babel/runtime": "^7.0.0",
44
44
  "eventemitter2": "^4.1.0",
@@ -54,7 +54,7 @@
54
54
  "react-intl-next": "npm:react-intl@^5.18.1"
55
55
  },
56
56
  "devDependencies": {
57
- "@atlaskit/analytics-listeners": "^9.1.0",
57
+ "@atlaskit/analytics-listeners": "^9.2.0",
58
58
  "@atlaskit/analytics-namespaced-context": "^7.2.0",
59
59
  "@atlaskit/button": "^23.9.0",
60
60
  "@atlaskit/media-core": "^37.0.0",
@@ -90,9 +90,6 @@
90
90
  "should-render-to-parent-should-be-true-media-exif": {
91
91
  "type": "boolean"
92
92
  },
93
- "add_media_picker_error_detail": {
94
- "type": "boolean"
95
- },
96
93
  "jfp-magma-media-clipboard-init-after-mount": {
97
94
  "type": "boolean"
98
95
  }