@atlaskit/media-picker 70.1.4 → 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,20 @@
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
+
10
+ ## 70.1.5
11
+
12
+ ### Patch Changes
13
+
14
+ - [`7b2a6c98563cb`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/7b2a6c98563cb) -
15
+ Icon entry point migration update
16
+ - Updated dependencies
17
+
3
18
  ## 70.1.4
4
19
 
5
20
  ### Patch Changes
@@ -8,7 +8,7 @@ exports.default = void 0;
8
8
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
9
9
  var _react = _interopRequireDefault(require("react"));
10
10
  var _flag = require("@atlaskit/flag");
11
- var _crossCircle = _interopRequireDefault(require("@atlaskit/icon/core/migration/cross-circle"));
11
+ var _crossCircle = _interopRequireDefault(require("@atlaskit/icon/core/cross-circle"));
12
12
  var _colors = require("@atlaskit/theme/colors");
13
13
  var _messages = require("./messages");
14
14
  var _reactIntlNext = require("react-intl-next");
@@ -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
  }
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { AutoDismissFlag, FlagGroup } from '@atlaskit/flag';
3
- import FailIcon from '@atlaskit/icon/core/migration/cross-circle';
3
+ import FailIcon from '@atlaskit/icon/core/cross-circle';
4
4
  import { R300 } from '@atlaskit/theme/colors';
5
5
  import { errorFlagMessages } from './messages';
6
6
  import { injectIntl, IntlProvider, useIntl } from 'react-intl-next';
@@ -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',
@@ -3,7 +3,7 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
3
3
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
4
4
  import React from 'react';
5
5
  import { AutoDismissFlag, FlagGroup } from '@atlaskit/flag';
6
- import FailIcon from '@atlaskit/icon/core/migration/cross-circle';
6
+ import FailIcon from '@atlaskit/icon/core/cross-circle';
7
7
  import { R300 } from '@atlaskit/theme/colors';
8
8
  import { errorFlagMessages } from './messages';
9
9
  import { injectIntl, IntlProvider, useIntl } from 'react-intl-next';
@@ -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
  }
@@ -22,22 +22,22 @@ import {
22
22
  uploadPreviewsFlexRowStyles,
23
23
  } from './styles';
24
24
 
25
- export const PopupContainer = ({ children }: { children: ReactNode }) => {
25
+ export const PopupContainer = ({ children }: { children: ReactNode }): React.JSX.Element => {
26
26
  // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
27
27
  return <div css={popupContainerStyles}>{children}</div>;
28
28
  };
29
29
 
30
- export const PopupHeader = ({ children }: { children: ReactNode }) => {
30
+ export const PopupHeader = ({ children }: { children: ReactNode }): React.JSX.Element => {
31
31
  // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
32
32
  return <div css={popupHeaderStyles}>{children}</div>;
33
33
  };
34
34
 
35
- export const PreviewImageWrapper = ({ children }: { children: ReactNode }) => {
35
+ export const PreviewImageWrapper = ({ children }: { children: ReactNode }): React.JSX.Element => {
36
36
  // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
37
37
  return <div css={previewImageWrapperStyles}>{children}</div>;
38
38
  };
39
39
 
40
- export const InfoWrapper = ({ children }: { children: ReactNode }) => {
40
+ export const InfoWrapper = ({ children }: { children: ReactNode }): React.JSX.Element => {
41
41
  // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
42
42
  return <pre css={infoWrapperStyles}>{children}</pre>;
43
43
  };
@@ -49,27 +49,27 @@ export const DropzoneContainer = forwardRef(({ isActive }: { isActive: boolean }
49
49
  );
50
50
  });
51
51
 
52
- export const DropzoneContentWrapper = ({ children }: { children: ReactNode }) => {
52
+ export const DropzoneContentWrapper = ({ children }: { children: ReactNode }): React.JSX.Element => {
53
53
  // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
54
54
  return <div css={dropzoneContentWrapperStyles}>{children}</div>;
55
55
  };
56
56
 
57
- export const PreviewsWrapper = ({ children }: { children: ReactNode }) => {
57
+ export const PreviewsWrapper = ({ children }: { children: ReactNode }): React.JSX.Element => {
58
58
  // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
59
59
  return <div css={previewsWrapperStyles}>{children}</div>;
60
60
  };
61
61
 
62
- export const PreviewsTitle = ({ children }: { children: ReactNode }) => {
62
+ export const PreviewsTitle = ({ children }: { children: ReactNode }): React.JSX.Element => {
63
63
  // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/use-heading -- Ignored via go/DSP-18766
64
64
  return <h1 css={previewsTitleStyles}>{children}</h1>;
65
65
  };
66
66
 
67
- export const UploadPreviewsFlexRow = ({ children }: { children: ReactNode }) => {
67
+ export const UploadPreviewsFlexRow = ({ children }: { children: ReactNode }): React.JSX.Element => {
68
68
  // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
69
69
  return <div css={uploadPreviewsFlexRowStyles}>{children}</div>;
70
70
  };
71
71
 
72
- export const DropzoneItemsInfo = ({ children }: { children: ReactNode }) => {
72
+ export const DropzoneItemsInfo = ({ children }: { children: ReactNode }): React.JSX.Element => {
73
73
  // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
74
74
  return <div css={dropzoneItemsInfoStyles}>{children}</div>;
75
75
  };
@@ -80,12 +80,12 @@ export const ClipboardContainer = ({
80
80
  }: {
81
81
  isWindowFocused: boolean;
82
82
  children: ReactNode;
83
- }) => {
83
+ }): React.JSX.Element => {
84
84
  // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
85
85
  return <div css={clipboardContainerStyles({ isWindowFocused })}>{children}</div>;
86
86
  };
87
87
 
88
- export const InfoContainer = ({ children }: { children: ReactNode }) => {
88
+ export const InfoContainer = ({ children }: { children: ReactNode }): React.JSX.Element => {
89
89
  // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
90
90
  return <div css={infoContainerStyles}>{children}</div>;
91
91
  };
@@ -101,7 +101,7 @@ type PastedImageProps = {
101
101
  style: PastedImageStyleType;
102
102
  };
103
103
 
104
- export const PastedImage = ({ src, style, title }: PastedImageProps) => {
104
+ export const PastedImage = ({ src, style, title }: PastedImageProps): React.JSX.Element => {
105
105
  // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values, @atlassian/a11y/alt-text -- Ignored via go/DSP-18766
106
106
  return <img src={src} title={title} css={pastedImageStyles(style)} />;
107
107
  };
@@ -27,7 +27,7 @@ export class UploadPreviews extends React.Component<PreviewsDataProps, PreviewsD
27
27
  previewsData: [],
28
28
  };
29
29
 
30
- onUploadsStart = (event: UploadsStartEventPayload) => {
30
+ onUploadsStart = (event: UploadsStartEventPayload): void => {
31
31
  const { previewsData } = this.state;
32
32
  const { files } = event;
33
33
 
@@ -44,7 +44,7 @@ export class UploadPreviews extends React.Component<PreviewsDataProps, PreviewsD
44
44
  });
45
45
  };
46
46
 
47
- onPreviewUpdate = (data: UploadPreviewUpdateEventPayload) => {
47
+ onPreviewUpdate = (data: UploadPreviewUpdateEventPayload): void => {
48
48
  const { previewsData } = this.state;
49
49
  const currentItem = previewsData[previewsData.length - 1];
50
50
  currentItem.preview = data.preview;
@@ -53,7 +53,7 @@ export class UploadPreviews extends React.Component<PreviewsDataProps, PreviewsD
53
53
  });
54
54
  };
55
55
 
56
- onError = (data: UploadErrorEventPayload) => {
56
+ onError = (data: UploadErrorEventPayload): void => {
57
57
  console.log('upload error:', data);
58
58
  };
59
59
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/media-picker",
3
- "version": "70.1.4",
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
  }