@atlaskit/link-datasource 3.4.1 → 3.4.2
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 +9 -0
- package/dist/cjs/hooks/useErrorLogger.js +31 -9
- package/dist/cjs/state/actions/index.js +1 -1
- package/dist/es2019/hooks/useErrorLogger.js +31 -9
- package/dist/es2019/state/actions/index.js +1 -1
- package/dist/esm/hooks/useErrorLogger.js +31 -9
- package/dist/esm/state/actions/index.js +1 -1
- package/dist/types/analytics/generated/analytics.types.d.ts +2 -1
- package/dist/types/state/actions/index.d.ts +1 -1
- package/dist/types-ts4.5/analytics/generated/analytics.types.d.ts +2 -1
- package/dist/types-ts4.5/state/actions/index.d.ts +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# @atlaskit/link-datasource
|
|
2
2
|
|
|
3
|
+
## 3.4.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#149525](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/149525)
|
|
8
|
+
[`659d336bf2253`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/659d336bf2253) -
|
|
9
|
+
Adds new attribute `reason` to analytics event `operational.datasource.operationFailed`
|
|
10
|
+
- Updated dependencies
|
|
11
|
+
|
|
3
12
|
## 3.4.1
|
|
4
13
|
|
|
5
14
|
### 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
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
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:
|
|
26
|
+
* actionKey: 'atlassian:work-item:update:summary',
|
|
27
27
|
* type: 'string',
|
|
28
28
|
* description: 'Update issue summary',
|
|
29
29
|
* }
|
|
@@ -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
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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:
|
|
14
|
+
* actionKey: 'atlassian:work-item:update:summary',
|
|
15
15
|
* type: 'string',
|
|
16
16
|
* description: 'Update issue summary',
|
|
17
17
|
* }
|
|
@@ -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
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
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:
|
|
20
|
+
* actionKey: 'atlassian:work-item:update:summary',
|
|
21
21
|
* type: 'string',
|
|
22
22
|
* description: 'Update issue summary',
|
|
23
23
|
* }
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Generates Typescript types for analytics events from analytics.spec.yaml
|
|
5
5
|
*
|
|
6
|
-
* @codegen <<SignedSource::
|
|
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;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Generates Typescript types for analytics events from analytics.spec.yaml
|
|
5
5
|
*
|
|
6
|
-
* @codegen <<SignedSource::
|
|
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;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/link-datasource",
|
|
3
|
-
"version": "3.4.
|
|
3
|
+
"version": "3.4.2",
|
|
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.
|
|
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.
|
|
51
|
+
"@atlaskit/icon": "^22.21.0",
|
|
52
52
|
"@atlaskit/icon-object": "^6.5.0",
|
|
53
53
|
"@atlaskit/image": "^1.3.0",
|
|
54
54
|
"@atlaskit/inline-edit": "^13.7.0",
|