@atlaskit/link-datasource 2.11.14 → 2.11.16
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 +17 -0
- package/dist/cjs/ui/issue-like-table/table-cell-content/inline-edit.js +5 -1
- package/dist/es2019/ui/issue-like-table/table-cell-content/inline-edit.js +6 -1
- package/dist/esm/ui/issue-like-table/table-cell-content/inline-edit.js +5 -1
- package/dist/types/analytics/generated/analytics.types.d.ts +6 -2
- package/dist/types/hooks/useErrorLogger.d.ts +2 -1
- package/dist/types/state/actions/index.d.ts +2 -2
- package/dist/types-ts4.5/analytics/generated/analytics.types.d.ts +6 -2
- package/dist/types-ts4.5/hooks/useErrorLogger.d.ts +2 -1
- package/dist/types-ts4.5/state/actions/index.d.ts +2 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @atlaskit/link-datasource
|
|
2
2
|
|
|
3
|
+
## 2.11.16
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#136744](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/136744)
|
|
8
|
+
[`04df6a1d732b5`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/04df6a1d732b5) -
|
|
9
|
+
Fix errorLocation analytic attribute typing
|
|
10
|
+
|
|
11
|
+
## 2.11.15
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- [#136349](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/136349)
|
|
16
|
+
[`a1c9a8ac45907`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/a1c9a8ac45907) -
|
|
17
|
+
Adds the ui.form.submitted.inlineEdit analytic event to be fired on when users attempts to update
|
|
18
|
+
via inline edit.
|
|
19
|
+
|
|
3
20
|
## 2.11.14
|
|
4
21
|
|
|
5
22
|
### Patch Changes
|
|
@@ -13,6 +13,7 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
|
|
|
13
13
|
var _react = _interopRequireWildcard(require("react"));
|
|
14
14
|
var _inlineEdit = _interopRequireDefault(require("@atlaskit/inline-edit"));
|
|
15
15
|
var _primitives = require("@atlaskit/primitives");
|
|
16
|
+
var _analytics = require("../../../analytics");
|
|
16
17
|
var _useDatasourceTableFlag = require("../../../hooks/useDatasourceTableFlag");
|
|
17
18
|
var _state = require("../../../state");
|
|
18
19
|
var _editType = require("../edit-type");
|
|
@@ -53,6 +54,8 @@ var InlineEdit = exports.InlineEdit = function InlineEdit(_ref) {
|
|
|
53
54
|
showErrorFlag = _useDatasourceTableFl.showErrorFlag;
|
|
54
55
|
var _useDatasourceActions = (0, _state.useDatasourceActions)(),
|
|
55
56
|
onUpdateItem = _useDatasourceActions.onUpdateItem;
|
|
57
|
+
var _useDatasourceAnalyti = (0, _analytics.useDatasourceAnalyticsEvents)(),
|
|
58
|
+
fireEvent = _useDatasourceAnalyti.fireEvent;
|
|
56
59
|
var onCommitUpdate = (0, _react.useCallback)(function (value) {
|
|
57
60
|
if (!item) {
|
|
58
61
|
setIsEditing(false);
|
|
@@ -65,6 +68,7 @@ var InlineEdit = exports.InlineEdit = function InlineEdit(_ref) {
|
|
|
65
68
|
return;
|
|
66
69
|
}
|
|
67
70
|
onUpdateItem(ari, newItem);
|
|
71
|
+
fireEvent('ui.form.submitted.inlineEdit', {});
|
|
68
72
|
execute(value).catch(function (error) {
|
|
69
73
|
var status = error && (0, _typeof2.default)(error) === 'object' ? error.status : undefined;
|
|
70
74
|
showErrorFlag({
|
|
@@ -73,7 +77,7 @@ var InlineEdit = exports.InlineEdit = function InlineEdit(_ref) {
|
|
|
73
77
|
onUpdateItem(ari, existingData);
|
|
74
78
|
});
|
|
75
79
|
setIsEditing(false);
|
|
76
|
-
}, [
|
|
80
|
+
}, [item, datasourceTypeWithValues.type, columnKey, onUpdateItem, ari, execute, fireEvent, showErrorFlag]);
|
|
77
81
|
return /*#__PURE__*/_react.default.createElement(_primitives.Box, {
|
|
78
82
|
xcss: editContainerStyles
|
|
79
83
|
}, /*#__PURE__*/_react.default.createElement(_inlineEdit.default, (0, _extends2.default)({}, (0, _editType.editType)(datasourceTypeWithValues), {
|
|
@@ -2,6 +2,7 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
2
2
|
import React, { useCallback, useState } from 'react';
|
|
3
3
|
import AKInlineEdit from '@atlaskit/inline-edit';
|
|
4
4
|
import { Box, xcss } from '@atlaskit/primitives';
|
|
5
|
+
import { useDatasourceAnalyticsEvents } from '../../../analytics';
|
|
5
6
|
import { useDatasourceTableFlag } from '../../../hooks/useDatasourceTableFlag';
|
|
6
7
|
import { useDatasourceActions, useDatasourceItem } from '../../../state';
|
|
7
8
|
import { editType } from '../edit-type';
|
|
@@ -41,6 +42,9 @@ export const InlineEdit = ({
|
|
|
41
42
|
const {
|
|
42
43
|
onUpdateItem
|
|
43
44
|
} = useDatasourceActions();
|
|
45
|
+
const {
|
|
46
|
+
fireEvent
|
|
47
|
+
} = useDatasourceAnalyticsEvents();
|
|
44
48
|
const onCommitUpdate = useCallback(value => {
|
|
45
49
|
if (!item) {
|
|
46
50
|
setIsEditing(false);
|
|
@@ -53,6 +57,7 @@ export const InlineEdit = ({
|
|
|
53
57
|
return;
|
|
54
58
|
}
|
|
55
59
|
onUpdateItem(ari, newItem);
|
|
60
|
+
fireEvent('ui.form.submitted.inlineEdit', {});
|
|
56
61
|
execute(value).catch(error => {
|
|
57
62
|
const status = error && typeof error === 'object' ? error.status : undefined;
|
|
58
63
|
showErrorFlag({
|
|
@@ -61,7 +66,7 @@ export const InlineEdit = ({
|
|
|
61
66
|
onUpdateItem(ari, existingData);
|
|
62
67
|
});
|
|
63
68
|
setIsEditing(false);
|
|
64
|
-
}, [
|
|
69
|
+
}, [item, datasourceTypeWithValues.type, columnKey, onUpdateItem, ari, execute, fireEvent, showErrorFlag]);
|
|
65
70
|
return /*#__PURE__*/React.createElement(Box, {
|
|
66
71
|
xcss: editContainerStyles
|
|
67
72
|
}, /*#__PURE__*/React.createElement(AKInlineEdit, _extends({}, editType(datasourceTypeWithValues), {
|
|
@@ -7,6 +7,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
7
7
|
import React, { useCallback, useState } from 'react';
|
|
8
8
|
import AKInlineEdit from '@atlaskit/inline-edit';
|
|
9
9
|
import { Box, xcss } from '@atlaskit/primitives';
|
|
10
|
+
import { useDatasourceAnalyticsEvents } from '../../../analytics';
|
|
10
11
|
import { useDatasourceTableFlag } from '../../../hooks/useDatasourceTableFlag';
|
|
11
12
|
import { useDatasourceActions, useDatasourceItem } from '../../../state';
|
|
12
13
|
import { editType } from '../edit-type';
|
|
@@ -43,6 +44,8 @@ export var InlineEdit = function InlineEdit(_ref) {
|
|
|
43
44
|
showErrorFlag = _useDatasourceTableFl.showErrorFlag;
|
|
44
45
|
var _useDatasourceActions = useDatasourceActions(),
|
|
45
46
|
onUpdateItem = _useDatasourceActions.onUpdateItem;
|
|
47
|
+
var _useDatasourceAnalyti = useDatasourceAnalyticsEvents(),
|
|
48
|
+
fireEvent = _useDatasourceAnalyti.fireEvent;
|
|
46
49
|
var onCommitUpdate = useCallback(function (value) {
|
|
47
50
|
if (!item) {
|
|
48
51
|
setIsEditing(false);
|
|
@@ -55,6 +58,7 @@ export var InlineEdit = function InlineEdit(_ref) {
|
|
|
55
58
|
return;
|
|
56
59
|
}
|
|
57
60
|
onUpdateItem(ari, newItem);
|
|
61
|
+
fireEvent('ui.form.submitted.inlineEdit', {});
|
|
58
62
|
execute(value).catch(function (error) {
|
|
59
63
|
var status = error && _typeof(error) === 'object' ? error.status : undefined;
|
|
60
64
|
showErrorFlag({
|
|
@@ -63,7 +67,7 @@ export var InlineEdit = function InlineEdit(_ref) {
|
|
|
63
67
|
onUpdateItem(ari, existingData);
|
|
64
68
|
});
|
|
65
69
|
setIsEditing(false);
|
|
66
|
-
}, [
|
|
70
|
+
}, [item, datasourceTypeWithValues.type, columnKey, onUpdateItem, ari, execute, fireEvent, showErrorFlag]);
|
|
67
71
|
return /*#__PURE__*/React.createElement(Box, {
|
|
68
72
|
xcss: editContainerStyles
|
|
69
73
|
}, /*#__PURE__*/React.createElement(AKInlineEdit, _extends({}, editType(datasourceTypeWithValues), {
|
|
@@ -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::0d4e0c024f984c4facf077d6a3f6ccda>>
|
|
7
7
|
* @codegenCommand yarn workspace @atlassian/analytics-tooling run analytics:codegen link-datasource
|
|
8
8
|
*/
|
|
9
9
|
export type ComponentMetaDataType = {
|
|
@@ -68,7 +68,7 @@ export type DatasourceRenderSuccessAttributesType = {
|
|
|
68
68
|
};
|
|
69
69
|
export type DatasourceRenderFailureAttributesType = {};
|
|
70
70
|
export type DatasourceOperationFailedAttributesType = {
|
|
71
|
-
errorLocation:
|
|
71
|
+
errorLocation: 'ProviderOnAuthRequest' | 'loadDatasourceDetails' | 'onNextPage' | 'actionDiscovery' | 'actionExecution' | null;
|
|
72
72
|
traceId: string | null;
|
|
73
73
|
status: number | null;
|
|
74
74
|
};
|
|
@@ -151,6 +151,7 @@ export type ActionDiscoverySuccessAttributesType = {
|
|
|
151
151
|
integrationKey: string | null;
|
|
152
152
|
datasourceId: string | null;
|
|
153
153
|
};
|
|
154
|
+
export type FormSubmittedInlineEditAttributesType = {};
|
|
154
155
|
export type AnalyticsEventAttributes = {
|
|
155
156
|
/**
|
|
156
157
|
* Fires when user sees modal dialog. */
|
|
@@ -266,5 +267,8 @@ export type AnalyticsEventAttributes = {
|
|
|
266
267
|
/**
|
|
267
268
|
* Fired when the action discovery and permissions request is successful. */
|
|
268
269
|
'operational.actionDiscovery.success': ActionDiscoverySuccessAttributesType;
|
|
270
|
+
/**
|
|
271
|
+
* Fired when the user initiates an update via inline edit through enter key press or submit */
|
|
272
|
+
'ui.form.submitted.inlineEdit': FormSubmittedInlineEditAttributesType;
|
|
269
273
|
};
|
|
270
274
|
export type EventKey = keyof AnalyticsEventAttributes;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type DatasourceOperationFailedAttributesType } from '../analytics/generated/analytics.types';
|
|
1
2
|
/**
|
|
2
3
|
* This function is just a wrapper around captureException that checks if the enable-sentry-client FF is enabled
|
|
3
4
|
* and error is instanceof Error. We have to override the type of error from captureException to unknown so we use
|
|
@@ -14,6 +15,6 @@ interface UseErrorLoggerPropsActions {
|
|
|
14
15
|
}
|
|
15
16
|
export type UseErrorLoggerProps = UseErrorLoggerPropsDatasource | UseErrorLoggerPropsActions;
|
|
16
17
|
declare const useErrorLogger: (loggerProps: UseErrorLoggerProps) => {
|
|
17
|
-
captureError: (errorLocation:
|
|
18
|
+
captureError: (errorLocation: DatasourceOperationFailedAttributesType['errorLocation'], error: unknown) => void;
|
|
18
19
|
};
|
|
19
20
|
export default useErrorLogger;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type Action } from 'react-sweet-state';
|
|
2
2
|
import { useDatasourceClientExtension } from '@atlaskit/link-client-extension';
|
|
3
3
|
import type { ActionsDiscoveryRequest, AtomicActionInterface } from '@atlaskit/linking-types';
|
|
4
|
-
import { type EventKey } from '../../../src/analytics/generated/analytics.types';
|
|
4
|
+
import { type DatasourceOperationFailedAttributesType, type EventKey } from '../../../src/analytics/generated/analytics.types';
|
|
5
5
|
import type createEventPayload from '../../../src/analytics/generated/create-event-payload';
|
|
6
6
|
type IntegrationKey = string;
|
|
7
7
|
type FieldKey = string;
|
|
@@ -49,7 +49,7 @@ export interface ActionsStoreState {
|
|
|
49
49
|
interface Client {
|
|
50
50
|
getDatasourceActionsAndPermissions: ReturnType<typeof useDatasourceClientExtension>['getDatasourceActionsAndPermissions'];
|
|
51
51
|
}
|
|
52
|
-
type AnalyticsCaptureError = (errorLocation:
|
|
52
|
+
type AnalyticsCaptureError = (errorLocation: DatasourceOperationFailedAttributesType['errorLocation'], error: unknown) => void;
|
|
53
53
|
type AnalyticsFireEvent = <K extends EventKey>(...params: Parameters<typeof createEventPayload<K>>) => void;
|
|
54
54
|
interface UseDiscoverActionsProps {
|
|
55
55
|
captureError: AnalyticsCaptureError;
|
|
@@ -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::0d4e0c024f984c4facf077d6a3f6ccda>>
|
|
7
7
|
* @codegenCommand yarn workspace @atlassian/analytics-tooling run analytics:codegen link-datasource
|
|
8
8
|
*/
|
|
9
9
|
export type ComponentMetaDataType = {
|
|
@@ -68,7 +68,7 @@ export type DatasourceRenderSuccessAttributesType = {
|
|
|
68
68
|
};
|
|
69
69
|
export type DatasourceRenderFailureAttributesType = {};
|
|
70
70
|
export type DatasourceOperationFailedAttributesType = {
|
|
71
|
-
errorLocation:
|
|
71
|
+
errorLocation: 'ProviderOnAuthRequest' | 'loadDatasourceDetails' | 'onNextPage' | 'actionDiscovery' | 'actionExecution' | null;
|
|
72
72
|
traceId: string | null;
|
|
73
73
|
status: number | null;
|
|
74
74
|
};
|
|
@@ -151,6 +151,7 @@ export type ActionDiscoverySuccessAttributesType = {
|
|
|
151
151
|
integrationKey: string | null;
|
|
152
152
|
datasourceId: string | null;
|
|
153
153
|
};
|
|
154
|
+
export type FormSubmittedInlineEditAttributesType = {};
|
|
154
155
|
export type AnalyticsEventAttributes = {
|
|
155
156
|
/**
|
|
156
157
|
* Fires when user sees modal dialog. */
|
|
@@ -266,5 +267,8 @@ export type AnalyticsEventAttributes = {
|
|
|
266
267
|
/**
|
|
267
268
|
* Fired when the action discovery and permissions request is successful. */
|
|
268
269
|
'operational.actionDiscovery.success': ActionDiscoverySuccessAttributesType;
|
|
270
|
+
/**
|
|
271
|
+
* Fired when the user initiates an update via inline edit through enter key press or submit */
|
|
272
|
+
'ui.form.submitted.inlineEdit': FormSubmittedInlineEditAttributesType;
|
|
269
273
|
};
|
|
270
274
|
export type EventKey = keyof AnalyticsEventAttributes;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type DatasourceOperationFailedAttributesType } from '../analytics/generated/analytics.types';
|
|
1
2
|
/**
|
|
2
3
|
* This function is just a wrapper around captureException that checks if the enable-sentry-client FF is enabled
|
|
3
4
|
* and error is instanceof Error. We have to override the type of error from captureException to unknown so we use
|
|
@@ -14,6 +15,6 @@ interface UseErrorLoggerPropsActions {
|
|
|
14
15
|
}
|
|
15
16
|
export type UseErrorLoggerProps = UseErrorLoggerPropsDatasource | UseErrorLoggerPropsActions;
|
|
16
17
|
declare const useErrorLogger: (loggerProps: UseErrorLoggerProps) => {
|
|
17
|
-
captureError: (errorLocation:
|
|
18
|
+
captureError: (errorLocation: DatasourceOperationFailedAttributesType['errorLocation'], error: unknown) => void;
|
|
18
19
|
};
|
|
19
20
|
export default useErrorLogger;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type Action } from 'react-sweet-state';
|
|
2
2
|
import { useDatasourceClientExtension } from '@atlaskit/link-client-extension';
|
|
3
3
|
import type { ActionsDiscoveryRequest, AtomicActionInterface } from '@atlaskit/linking-types';
|
|
4
|
-
import { type EventKey } from '../../../src/analytics/generated/analytics.types';
|
|
4
|
+
import { type DatasourceOperationFailedAttributesType, type EventKey } from '../../../src/analytics/generated/analytics.types';
|
|
5
5
|
import type createEventPayload from '../../../src/analytics/generated/create-event-payload';
|
|
6
6
|
type IntegrationKey = string;
|
|
7
7
|
type FieldKey = string;
|
|
@@ -49,7 +49,7 @@ export interface ActionsStoreState {
|
|
|
49
49
|
interface Client {
|
|
50
50
|
getDatasourceActionsAndPermissions: ReturnType<typeof useDatasourceClientExtension>['getDatasourceActionsAndPermissions'];
|
|
51
51
|
}
|
|
52
|
-
type AnalyticsCaptureError = (errorLocation:
|
|
52
|
+
type AnalyticsCaptureError = (errorLocation: DatasourceOperationFailedAttributesType['errorLocation'], error: unknown) => void;
|
|
53
53
|
type AnalyticsFireEvent = <K extends EventKey>(...params: Parameters<typeof createEventPayload<K>>) => void;
|
|
54
54
|
interface UseDiscoverActionsProps {
|
|
55
55
|
captureError: AnalyticsCaptureError;
|