@atlaskit/link-datasource 3.4.1 → 3.5.0

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,22 @@
1
1
  # @atlaskit/link-datasource
2
2
 
3
+ ## 3.5.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#150064](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/150064)
8
+ [`591b4e842471b`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/591b4e842471b) -
9
+ [ux] Enable new icons behind a feature flag.
10
+
11
+ ## 3.4.2
12
+
13
+ ### Patch Changes
14
+
15
+ - [#149525](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/149525)
16
+ [`659d336bf2253`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/659d336bf2253) -
17
+ Adds new attribute `reason` to analytics event `operational.datasource.operationFailed`
18
+ - Updated dependencies
19
+
3
20
  ## 3.4.1
4
21
 
5
22
  ### Patch Changes
@@ -7,19 +7,39 @@ Object.defineProperty(exports, "__esModule", {
7
7
  exports.logToSentry = exports.default = void 0;
8
8
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
9
9
  var _react = require("react");
10
+ var _linkingCommon = require("@atlaskit/linking-common");
10
11
  var _sentry = require("@atlaskit/linking-common/sentry");
11
12
  var _utils = require("@atlaskit/linking-common/utils");
12
13
  var _analytics = require("../analytics");
13
14
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
14
15
  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) { (0, _defineProperty2.default)(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; }
15
16
  var getNetworkFields = function getNetworkFields(error) {
16
- return error instanceof Response ? {
17
- traceId: (0, _utils.getTraceId)(error),
18
- status: error.status
19
- } : {
20
- traceId: null,
21
- status: null
22
- };
17
+ switch (true) {
18
+ case error instanceof Response:
19
+ return {
20
+ traceId: (0, _utils.getTraceId)(error),
21
+ status: error.status,
22
+ reason: 'response'
23
+ };
24
+ case error instanceof _linkingCommon.NetworkError:
25
+ return {
26
+ traceId: null,
27
+ status: null,
28
+ reason: 'network'
29
+ };
30
+ case error instanceof Error:
31
+ return {
32
+ traceId: null,
33
+ status: null,
34
+ reason: 'internal'
35
+ };
36
+ default:
37
+ return {
38
+ traceId: null,
39
+ status: null,
40
+ reason: 'unknown'
41
+ };
42
+ }
23
43
  };
24
44
  /**
25
45
  * This function is just a wrapper around captureException that checks if the enable-sentry-client FF is enabled
@@ -47,11 +67,13 @@ var useErrorLogger = function useErrorLogger(loggerProps) {
47
67
  var captureError = (0, _react.useCallback)(function (errorLocation, error) {
48
68
  var _getNetworkFields = getNetworkFields(error),
49
69
  traceId = _getNetworkFields.traceId,
50
- status = _getNetworkFields.status;
70
+ status = _getNetworkFields.status,
71
+ reason = _getNetworkFields.reason;
51
72
  fireEvent('operational.datasource.operationFailed', {
52
73
  errorLocation: errorLocation,
53
74
  traceId: traceId,
54
- status: status
75
+ status: status,
76
+ reason: reason
55
77
  });
56
78
  logToSentry(error, 'link-datasource', _objectSpread({}, loggerProps));
57
79
  }, [fireEvent, loggerProps]);
@@ -23,7 +23,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
23
23
  * {
24
24
  * jira: {
25
25
  * summary: {
26
- * actionKey: 'atlassian:issue:update:summary',
26
+ * actionKey: 'atlassian:work-item:update:summary',
27
27
  * type: 'string',
28
28
  * description: 'Update issue summary',
29
29
  * }
@@ -7,7 +7,7 @@ Object.defineProperty(exports, "__esModule", {
7
7
  exports.default = void 0;
8
8
  var _react = _interopRequireDefault(require("react"));
9
9
  var _avatar = _interopRequireDefault(require("@atlaskit/avatar"));
10
- var _peopleGroup = _interopRequireDefault(require("@atlaskit/icon/glyph/people-group"));
10
+ var _peopleGroup = _interopRequireDefault(require("@atlaskit/icon/core/migration/people-group"));
11
11
  var _lozenge = _interopRequireDefault(require("@atlaskit/lozenge"));
12
12
  var _primitives = require("@atlaskit/primitives");
13
13
  var commonLabelStyles = (0, _primitives.xcss)({
@@ -59,7 +59,8 @@ var AvatarOptionLabel = function AvatarOptionLabel(_ref3) {
59
59
  justifyContent: "center",
60
60
  xcss: groupWrapperStyles
61
61
  }, /*#__PURE__*/_react.default.createElement(_peopleGroup.default, {
62
- size: "small",
62
+ color: "currentColor",
63
+ LEGACY_size: "small",
63
64
  label: ""
64
65
  })) : /*#__PURE__*/_react.default.createElement(_avatar.default, {
65
66
  appearance: data.isSquare ? 'square' : 'circle',
@@ -1,15 +1,35 @@
1
1
  import { useCallback } from 'react';
2
+ import { NetworkError } from '@atlaskit/linking-common';
2
3
  import { captureException } from '@atlaskit/linking-common/sentry';
3
4
  import { getTraceId } from '@atlaskit/linking-common/utils';
4
5
  import { useDatasourceAnalyticsEvents } from '../analytics';
5
6
  const getNetworkFields = error => {
6
- return error instanceof Response ? {
7
- traceId: getTraceId(error),
8
- status: error.status
9
- } : {
10
- traceId: null,
11
- status: null
12
- };
7
+ switch (true) {
8
+ case error instanceof Response:
9
+ return {
10
+ traceId: getTraceId(error),
11
+ status: error.status,
12
+ reason: 'response'
13
+ };
14
+ case error instanceof NetworkError:
15
+ return {
16
+ traceId: null,
17
+ status: null,
18
+ reason: 'network'
19
+ };
20
+ case error instanceof Error:
21
+ return {
22
+ traceId: null,
23
+ status: null,
24
+ reason: 'internal'
25
+ };
26
+ default:
27
+ return {
28
+ traceId: null,
29
+ status: null,
30
+ reason: 'unknown'
31
+ };
32
+ }
13
33
  };
14
34
  /**
15
35
  * This function is just a wrapper around captureException that checks if the enable-sentry-client FF is enabled
@@ -35,12 +55,14 @@ const useErrorLogger = loggerProps => {
35
55
  const captureError = useCallback((errorLocation, error) => {
36
56
  const {
37
57
  traceId,
38
- status
58
+ status,
59
+ reason
39
60
  } = getNetworkFields(error);
40
61
  fireEvent('operational.datasource.operationFailed', {
41
62
  errorLocation,
42
63
  traceId,
43
- status
64
+ status,
65
+ reason
44
66
  });
45
67
  logToSentry(error, 'link-datasource', {
46
68
  ...loggerProps
@@ -11,7 +11,7 @@ import useErrorLogger from '../../hooks/useErrorLogger';
11
11
  * {
12
12
  * jira: {
13
13
  * summary: {
14
- * actionKey: 'atlassian:issue:update:summary',
14
+ * actionKey: 'atlassian:work-item:update:summary',
15
15
  * type: 'string',
16
16
  * description: 'Update issue summary',
17
17
  * }
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import Avatar from '@atlaskit/avatar';
3
- import PeopleGroupIcon from '@atlaskit/icon/glyph/people-group';
3
+ import PeopleGroupIcon from '@atlaskit/icon/core/migration/people-group';
4
4
  import Lozenge from '@atlaskit/lozenge';
5
5
  import { Box, Flex, xcss } from '@atlaskit/primitives';
6
6
  const commonLabelStyles = xcss({
@@ -57,7 +57,8 @@ const AvatarOptionLabel = ({
57
57
  justifyContent: "center",
58
58
  xcss: groupWrapperStyles
59
59
  }, /*#__PURE__*/React.createElement(PeopleGroupIcon, {
60
- size: "small",
60
+ color: "currentColor",
61
+ LEGACY_size: "small",
61
62
  label: ""
62
63
  })) : /*#__PURE__*/React.createElement(Avatar, {
63
64
  appearance: data.isSquare ? 'square' : 'circle',
@@ -2,17 +2,37 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
2
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
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 { useCallback } from 'react';
5
+ import { NetworkError } from '@atlaskit/linking-common';
5
6
  import { captureException } from '@atlaskit/linking-common/sentry';
6
7
  import { getTraceId } from '@atlaskit/linking-common/utils';
7
8
  import { useDatasourceAnalyticsEvents } from '../analytics';
8
9
  var getNetworkFields = function getNetworkFields(error) {
9
- return error instanceof Response ? {
10
- traceId: getTraceId(error),
11
- status: error.status
12
- } : {
13
- traceId: null,
14
- status: null
15
- };
10
+ switch (true) {
11
+ case error instanceof Response:
12
+ return {
13
+ traceId: getTraceId(error),
14
+ status: error.status,
15
+ reason: 'response'
16
+ };
17
+ case error instanceof NetworkError:
18
+ return {
19
+ traceId: null,
20
+ status: null,
21
+ reason: 'network'
22
+ };
23
+ case error instanceof Error:
24
+ return {
25
+ traceId: null,
26
+ status: null,
27
+ reason: 'internal'
28
+ };
29
+ default:
30
+ return {
31
+ traceId: null,
32
+ status: null,
33
+ reason: 'unknown'
34
+ };
35
+ }
16
36
  };
17
37
  /**
18
38
  * This function is just a wrapper around captureException that checks if the enable-sentry-client FF is enabled
@@ -40,11 +60,13 @@ var useErrorLogger = function useErrorLogger(loggerProps) {
40
60
  var captureError = useCallback(function (errorLocation, error) {
41
61
  var _getNetworkFields = getNetworkFields(error),
42
62
  traceId = _getNetworkFields.traceId,
43
- status = _getNetworkFields.status;
63
+ status = _getNetworkFields.status,
64
+ reason = _getNetworkFields.reason;
44
65
  fireEvent('operational.datasource.operationFailed', {
45
66
  errorLocation: errorLocation,
46
67
  traceId: traceId,
47
- status: status
68
+ status: status,
69
+ reason: reason
48
70
  });
49
71
  logToSentry(error, 'link-datasource', _objectSpread({}, loggerProps));
50
72
  }, [fireEvent, loggerProps]);
@@ -17,7 +17,7 @@ import useErrorLogger from '../../hooks/useErrorLogger';
17
17
  * {
18
18
  * jira: {
19
19
  * summary: {
20
- * actionKey: 'atlassian:issue:update:summary',
20
+ * actionKey: 'atlassian:work-item:update:summary',
21
21
  * type: 'string',
22
22
  * description: 'Update issue summary',
23
23
  * }
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import Avatar from '@atlaskit/avatar';
3
- import PeopleGroupIcon from '@atlaskit/icon/glyph/people-group';
3
+ import PeopleGroupIcon from '@atlaskit/icon/core/migration/people-group';
4
4
  import Lozenge from '@atlaskit/lozenge';
5
5
  import { Box, Flex, xcss } from '@atlaskit/primitives';
6
6
  var commonLabelStyles = xcss({
@@ -52,7 +52,8 @@ var AvatarOptionLabel = function AvatarOptionLabel(_ref3) {
52
52
  justifyContent: "center",
53
53
  xcss: groupWrapperStyles
54
54
  }, /*#__PURE__*/React.createElement(PeopleGroupIcon, {
55
- size: "small",
55
+ color: "currentColor",
56
+ LEGACY_size: "small",
56
57
  label: ""
57
58
  })) : /*#__PURE__*/React.createElement(Avatar, {
58
59
  appearance: data.isSquare ? 'square' : 'circle',
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * Generates Typescript types for analytics events from analytics.spec.yaml
5
5
  *
6
- * @codegen <<SignedSource::6d4fa1aa0b65b5fb6e0cbed65f66d66e>>
6
+ * @codegen <<SignedSource::b6f8bb0286018a13a19546bc9fd67e2e>>
7
7
  * @codegenCommand yarn workspace @atlassian/analytics-tooling run analytics:codegen link-datasource
8
8
  */
9
9
  export type ComponentMetaDataType = {
@@ -71,6 +71,7 @@ export type DatasourceOperationFailedAttributesType = {
71
71
  errorLocation: 'ProviderOnAuthRequest' | 'loadDatasourceDetails' | 'onNextPage' | 'actionDiscovery' | 'actionExecution' | null;
72
72
  traceId: string | null;
73
73
  status: number | null;
74
+ reason: 'response' | 'network' | 'internal' | 'unknown' | null;
74
75
  };
75
76
  export type ProviderAuthSuccessAttributesType = {
76
77
  extensionKey: string | null;
@@ -12,7 +12,7 @@ type FieldKey = string;
12
12
  * {
13
13
  * jira: {
14
14
  * summary: {
15
- * actionKey: 'atlassian:issue:update:summary',
15
+ * actionKey: 'atlassian:work-item:update:summary',
16
16
  * type: 'string',
17
17
  * description: 'Update issue summary',
18
18
  * }
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * Generates Typescript types for analytics events from analytics.spec.yaml
5
5
  *
6
- * @codegen <<SignedSource::6d4fa1aa0b65b5fb6e0cbed65f66d66e>>
6
+ * @codegen <<SignedSource::b6f8bb0286018a13a19546bc9fd67e2e>>
7
7
  * @codegenCommand yarn workspace @atlassian/analytics-tooling run analytics:codegen link-datasource
8
8
  */
9
9
  export type ComponentMetaDataType = {
@@ -71,6 +71,7 @@ export type DatasourceOperationFailedAttributesType = {
71
71
  errorLocation: 'ProviderOnAuthRequest' | 'loadDatasourceDetails' | 'onNextPage' | 'actionDiscovery' | 'actionExecution' | null;
72
72
  traceId: string | null;
73
73
  status: number | null;
74
+ reason: 'response' | 'network' | 'internal' | 'unknown' | null;
74
75
  };
75
76
  export type ProviderAuthSuccessAttributesType = {
76
77
  extensionKey: string | null;
@@ -12,7 +12,7 @@ type FieldKey = string;
12
12
  * {
13
13
  * jira: {
14
14
  * summary: {
15
- * actionKey: 'atlassian:issue:update:summary',
15
+ * actionKey: 'atlassian:work-item:update:summary',
16
16
  * type: 'string',
17
17
  * description: 'Update issue summary',
18
18
  * }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/link-datasource",
3
- "version": "3.4.1",
3
+ "version": "3.5.0",
4
4
  "description": "UI Components to support linking platform dataset feature",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -42,13 +42,13 @@
42
42
  "@atlaskit/badge": "^16.4.0",
43
43
  "@atlaskit/button": "^20.2.0",
44
44
  "@atlaskit/datetime-picker": "^15.1.0",
45
- "@atlaskit/dropdown-menu": "^12.18.0",
45
+ "@atlaskit/dropdown-menu": "^12.19.0",
46
46
  "@atlaskit/editor-prosemirror": "6.0.0",
47
47
  "@atlaskit/empty-state": "^7.11.0",
48
48
  "@atlaskit/flag": "^15.8.0",
49
49
  "@atlaskit/form": "^10.5.0",
50
50
  "@atlaskit/heading": "^2.4.0",
51
- "@atlaskit/icon": "^22.20.0",
51
+ "@atlaskit/icon": "^22.22.0",
52
52
  "@atlaskit/icon-object": "^6.5.0",
53
53
  "@atlaskit/image": "^1.3.0",
54
54
  "@atlaskit/inline-edit": "^13.7.0",
@@ -72,7 +72,7 @@
72
72
  "@atlaskit/pragmatic-drag-and-drop-react-drop-indicator": "^1.1.0",
73
73
  "@atlaskit/primitives": "^12.2.0",
74
74
  "@atlaskit/select": "^18.0.0",
75
- "@atlaskit/smart-card": "^29.0.0",
75
+ "@atlaskit/smart-card": "^29.1.0",
76
76
  "@atlaskit/smart-user-picker": "6.10.3",
77
77
  "@atlaskit/spinner": "^16.3.0",
78
78
  "@atlaskit/tag": "^12.6.0",