@atlaskit/link-datasource 2.11.10 → 2.11.12

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
+ ## 2.11.12
4
+
5
+ ### Patch Changes
6
+
7
+ - [#134926](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/134926)
8
+ [`891fc0be667d7`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/891fc0be667d7) -
9
+ Adds an operational analytic event fired when an atomic execute action request succeeds, and moves
10
+ the error logging from the InlineEdit component into the action itself.
11
+
12
+ ## 2.11.11
13
+
14
+ ### Patch Changes
15
+
16
+ - [#134213](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/134213)
17
+ [`93bd7032842ec`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/93bd7032842ec) -
18
+ [ux] [ED-24636] Bump ADF Schema package
19
+
3
20
  ## 2.11.10
4
21
 
5
22
  ### Patch Changes
@@ -12,6 +12,8 @@ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/
12
12
  var _react = require("react");
13
13
  var _reactSweetState = require("react-sweet-state");
14
14
  var _linkClientExtension = require("@atlaskit/link-client-extension");
15
+ var _analytics = require("../../analytics");
16
+ var _useErrorLogger2 = _interopRequireDefault(require("../../hooks/useErrorLogger"));
15
17
  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; }
16
18
  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; }
17
19
  /**
@@ -177,6 +179,12 @@ var useExecuteAtomicAction = exports.useExecuteAtomicAction = function useExecut
177
179
  schema = _useAtomicUpdateActio2[0];
178
180
  var _useDatasourceClientE2 = (0, _linkClientExtension.useDatasourceClientExtension)(),
179
181
  executeAction = _useDatasourceClientE2.executeAtomicAction;
182
+ var _useDatasourceAnalyti = (0, _analytics.useDatasourceAnalyticsEvents)(),
183
+ fireEvent = _useDatasourceAnalyti.fireEvent;
184
+ var _useErrorLogger = (0, _useErrorLogger2.default)({
185
+ integrationKey: integrationKey
186
+ }),
187
+ captureError = _useErrorLogger.captureError;
180
188
  var execute = (0, _react.useCallback)(function (value) {
181
189
  if (!schema) {
182
190
  throw new Error('No action schema found.');
@@ -190,8 +198,18 @@ var useExecuteAtomicAction = exports.useExecuteAtomicAction = function useExecut
190
198
  ari: ari
191
199
  }
192
200
  }
201
+ }).then(function (resp) {
202
+ fireEvent('operational.actionExecution.success', {
203
+ integrationKey: integrationKey,
204
+ experience: 'datasource'
205
+ });
206
+ return resp;
207
+ }).catch(function (error) {
208
+ captureError('actionExecution', error);
209
+ // Rethrow up to component for flags and other handling
210
+ throw error;
193
211
  });
194
- }, [schema, executeAction, integrationKey, fieldKey, ari]);
212
+ }, [schema, executeAction, integrationKey, fieldKey, ari, fireEvent, captureError]);
195
213
  if (!schema) {
196
214
  return {};
197
215
  }
@@ -111,7 +111,6 @@ var InlineEditableCell = function InlineEditableCell(_ref3) {
111
111
  execute: execute,
112
112
  readView: readView,
113
113
  columnKey: columnKey,
114
- integrationKey: integrationKey,
115
114
  datasourceTypeWithValues: values
116
115
  });
117
116
  };
@@ -14,7 +14,6 @@ var _react = _interopRequireWildcard(require("react"));
14
14
  var _inlineEdit = _interopRequireDefault(require("@atlaskit/inline-edit"));
15
15
  var _primitives = require("@atlaskit/primitives");
16
16
  var _useDatasourceTableFlag = require("../../../hooks/useDatasourceTableFlag");
17
- var _useErrorLogger2 = _interopRequireDefault(require("../../../hooks/useErrorLogger"));
18
17
  var _state = require("../../../state");
19
18
  var _editType = require("../edit-type");
20
19
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
@@ -42,7 +41,6 @@ var InlineEdit = exports.InlineEdit = function InlineEdit(_ref) {
42
41
  execute = _ref.execute,
43
42
  _readView = _ref.readView,
44
43
  columnKey = _ref.columnKey,
45
- integrationKey = _ref.integrationKey,
46
44
  datasourceTypeWithValues = _ref.datasourceTypeWithValues;
47
45
  var _useState = (0, _react.useState)(false),
48
46
  _useState2 = (0, _slicedToArray2.default)(_useState, 2),
@@ -55,10 +53,6 @@ var InlineEdit = exports.InlineEdit = function InlineEdit(_ref) {
55
53
  showErrorFlag = _useDatasourceTableFl.showErrorFlag;
56
54
  var _useDatasourceActions = (0, _state.useDatasourceActions)(),
57
55
  onUpdateItem = _useDatasourceActions.onUpdateItem;
58
- var _useErrorLogger = (0, _useErrorLogger2.default)({
59
- integrationKey: integrationKey
60
- }),
61
- captureError = _useErrorLogger.captureError;
62
56
  var onCommitUpdate = (0, _react.useCallback)(function (value) {
63
57
  if (!item) {
64
58
  setIsEditing(false);
@@ -77,10 +71,9 @@ var InlineEdit = exports.InlineEdit = function InlineEdit(_ref) {
77
71
  status: status
78
72
  });
79
73
  onUpdateItem(ari, existingData);
80
- captureError('actionExecution', error);
81
74
  });
82
75
  setIsEditing(false);
83
- }, [item, datasourceTypeWithValues.type, columnKey, onUpdateItem, ari, execute, showErrorFlag, captureError]);
76
+ }, [ari, item, datasourceTypeWithValues.type, columnKey, onUpdateItem, execute, showErrorFlag]);
84
77
  return /*#__PURE__*/_react.default.createElement(_primitives.Box, {
85
78
  xcss: editContainerStyles
86
79
  }, /*#__PURE__*/_react.default.createElement(_inlineEdit.default, (0, _extends2.default)({}, (0, _editType.editType)(datasourceTypeWithValues), {
@@ -1,6 +1,8 @@
1
1
  import { useCallback, useMemo } from 'react';
2
2
  import { createActionsHook, createHook, createStore } from 'react-sweet-state';
3
3
  import { useDatasourceClientExtension } from '@atlaskit/link-client-extension';
4
+ import { useDatasourceAnalyticsEvents } from '../../analytics';
5
+ import useErrorLogger from '../../hooks/useErrorLogger';
4
6
 
5
7
  /**
6
8
  * Atomic actions available for an integration (by field)
@@ -156,6 +158,14 @@ export const useExecuteAtomicAction = ({
156
158
  const {
157
159
  executeAtomicAction: executeAction
158
160
  } = useDatasourceClientExtension();
161
+ const {
162
+ fireEvent
163
+ } = useDatasourceAnalyticsEvents();
164
+ const {
165
+ captureError
166
+ } = useErrorLogger({
167
+ integrationKey
168
+ });
159
169
  const execute = useCallback(value => {
160
170
  if (!schema) {
161
171
  throw new Error('No action schema found.');
@@ -171,8 +181,18 @@ export const useExecuteAtomicAction = ({
171
181
  ari
172
182
  }
173
183
  }
184
+ }).then(resp => {
185
+ fireEvent('operational.actionExecution.success', {
186
+ integrationKey: integrationKey,
187
+ experience: 'datasource'
188
+ });
189
+ return resp;
190
+ }).catch(error => {
191
+ captureError('actionExecution', error);
192
+ // Rethrow up to component for flags and other handling
193
+ throw error;
174
194
  });
175
- }, [schema, executeAction, integrationKey, fieldKey, ari]);
195
+ }, [schema, executeAction, integrationKey, fieldKey, ari, fireEvent, captureError]);
176
196
  if (!schema) {
177
197
  return {};
178
198
  }
@@ -104,7 +104,6 @@ const InlineEditableCell = ({
104
104
  execute: execute,
105
105
  readView: readView,
106
106
  columnKey: columnKey,
107
- integrationKey: integrationKey,
108
107
  datasourceTypeWithValues: values
109
108
  });
110
109
  };
@@ -3,7 +3,6 @@ import React, { useCallback, useState } from 'react';
3
3
  import AKInlineEdit from '@atlaskit/inline-edit';
4
4
  import { Box, xcss } from '@atlaskit/primitives';
5
5
  import { useDatasourceTableFlag } from '../../../hooks/useDatasourceTableFlag';
6
- import useErrorLogger from '../../../hooks/useErrorLogger';
7
6
  import { useDatasourceActions, useDatasourceItem } from '../../../state';
8
7
  import { editType } from '../edit-type';
9
8
  const editContainerStyles = xcss({
@@ -30,7 +29,6 @@ export const InlineEdit = ({
30
29
  execute,
31
30
  readView,
32
31
  columnKey,
33
- integrationKey,
34
32
  datasourceTypeWithValues
35
33
  }) => {
36
34
  const [isEditing, setIsEditing] = useState(false);
@@ -43,11 +41,6 @@ export const InlineEdit = ({
43
41
  const {
44
42
  onUpdateItem
45
43
  } = useDatasourceActions();
46
- const {
47
- captureError
48
- } = useErrorLogger({
49
- integrationKey
50
- });
51
44
  const onCommitUpdate = useCallback(value => {
52
45
  if (!item) {
53
46
  setIsEditing(false);
@@ -66,10 +59,9 @@ export const InlineEdit = ({
66
59
  status
67
60
  });
68
61
  onUpdateItem(ari, existingData);
69
- captureError('actionExecution', error);
70
62
  });
71
63
  setIsEditing(false);
72
- }, [item, datasourceTypeWithValues.type, columnKey, onUpdateItem, ari, execute, showErrorFlag, captureError]);
64
+ }, [ari, item, datasourceTypeWithValues.type, columnKey, onUpdateItem, execute, showErrorFlag]);
73
65
  return /*#__PURE__*/React.createElement(Box, {
74
66
  xcss: editContainerStyles
75
67
  }, /*#__PURE__*/React.createElement(AKInlineEdit, _extends({}, editType(datasourceTypeWithValues), {
@@ -7,6 +7,8 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
7
7
  import { useCallback, useMemo } from 'react';
8
8
  import { createActionsHook, createHook, createStore } from 'react-sweet-state';
9
9
  import { useDatasourceClientExtension } from '@atlaskit/link-client-extension';
10
+ import { useDatasourceAnalyticsEvents } from '../../analytics';
11
+ import useErrorLogger from '../../hooks/useErrorLogger';
10
12
 
11
13
  /**
12
14
  * Atomic actions available for an integration (by field)
@@ -171,6 +173,12 @@ export var useExecuteAtomicAction = function useExecuteAtomicAction(_ref5) {
171
173
  schema = _useAtomicUpdateActio2[0];
172
174
  var _useDatasourceClientE2 = useDatasourceClientExtension(),
173
175
  executeAction = _useDatasourceClientE2.executeAtomicAction;
176
+ var _useDatasourceAnalyti = useDatasourceAnalyticsEvents(),
177
+ fireEvent = _useDatasourceAnalyti.fireEvent;
178
+ var _useErrorLogger = useErrorLogger({
179
+ integrationKey: integrationKey
180
+ }),
181
+ captureError = _useErrorLogger.captureError;
174
182
  var execute = useCallback(function (value) {
175
183
  if (!schema) {
176
184
  throw new Error('No action schema found.');
@@ -184,8 +192,18 @@ export var useExecuteAtomicAction = function useExecuteAtomicAction(_ref5) {
184
192
  ari: ari
185
193
  }
186
194
  }
195
+ }).then(function (resp) {
196
+ fireEvent('operational.actionExecution.success', {
197
+ integrationKey: integrationKey,
198
+ experience: 'datasource'
199
+ });
200
+ return resp;
201
+ }).catch(function (error) {
202
+ captureError('actionExecution', error);
203
+ // Rethrow up to component for flags and other handling
204
+ throw error;
187
205
  });
188
- }, [schema, executeAction, integrationKey, fieldKey, ari]);
206
+ }, [schema, executeAction, integrationKey, fieldKey, ari, fireEvent, captureError]);
189
207
  if (!schema) {
190
208
  return {};
191
209
  }
@@ -104,7 +104,6 @@ var InlineEditableCell = function InlineEditableCell(_ref3) {
104
104
  execute: execute,
105
105
  readView: readView,
106
106
  columnKey: columnKey,
107
- integrationKey: integrationKey,
108
107
  datasourceTypeWithValues: values
109
108
  });
110
109
  };
@@ -8,7 +8,6 @@ import React, { useCallback, useState } from 'react';
8
8
  import AKInlineEdit from '@atlaskit/inline-edit';
9
9
  import { Box, xcss } from '@atlaskit/primitives';
10
10
  import { useDatasourceTableFlag } from '../../../hooks/useDatasourceTableFlag';
11
- import useErrorLogger from '../../../hooks/useErrorLogger';
12
11
  import { useDatasourceActions, useDatasourceItem } from '../../../state';
13
12
  import { editType } from '../edit-type';
14
13
  var editContainerStyles = xcss({
@@ -32,7 +31,6 @@ export var InlineEdit = function InlineEdit(_ref) {
32
31
  execute = _ref.execute,
33
32
  _readView = _ref.readView,
34
33
  columnKey = _ref.columnKey,
35
- integrationKey = _ref.integrationKey,
36
34
  datasourceTypeWithValues = _ref.datasourceTypeWithValues;
37
35
  var _useState = useState(false),
38
36
  _useState2 = _slicedToArray(_useState, 2),
@@ -45,10 +43,6 @@ export var InlineEdit = function InlineEdit(_ref) {
45
43
  showErrorFlag = _useDatasourceTableFl.showErrorFlag;
46
44
  var _useDatasourceActions = useDatasourceActions(),
47
45
  onUpdateItem = _useDatasourceActions.onUpdateItem;
48
- var _useErrorLogger = useErrorLogger({
49
- integrationKey: integrationKey
50
- }),
51
- captureError = _useErrorLogger.captureError;
52
46
  var onCommitUpdate = useCallback(function (value) {
53
47
  if (!item) {
54
48
  setIsEditing(false);
@@ -67,10 +61,9 @@ export var InlineEdit = function InlineEdit(_ref) {
67
61
  status: status
68
62
  });
69
63
  onUpdateItem(ari, existingData);
70
- captureError('actionExecution', error);
71
64
  });
72
65
  setIsEditing(false);
73
- }, [item, datasourceTypeWithValues.type, columnKey, onUpdateItem, ari, execute, showErrorFlag, captureError]);
66
+ }, [ari, item, datasourceTypeWithValues.type, columnKey, onUpdateItem, execute, showErrorFlag]);
74
67
  return /*#__PURE__*/React.createElement(Box, {
75
68
  xcss: editContainerStyles
76
69
  }, /*#__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::26fd2d06084d185e97be01b2070484ff>>
6
+ * @codegen <<SignedSource::a773c6cad8ff2e59bb7020ea85e35bc5>>
7
7
  * @codegenCommand yarn workspace @atlassian/analytics-tooling run analytics:codegen link-datasource
8
8
  */
9
9
  export type ComponentMetaDataType = {
@@ -141,6 +141,10 @@ export type ObjectSchemasSuccessAttributesType = {};
141
141
  export type ObjectSchemasFailedAttributesType = {
142
142
  statusCodeGroup: '1xx' | '3xx' | '4xx' | '5xx' | 'unknown';
143
143
  };
144
+ export type ActionExecutionSuccessAttributesType = {
145
+ integrationKey: string;
146
+ experience: 'datasource';
147
+ };
144
148
  export type ActionDiscoverySuccessAttributesType = {
145
149
  experience: 'datasource';
146
150
  entityType: string;
@@ -256,6 +260,9 @@ export type AnalyticsEventAttributes = {
256
260
  /**
257
261
  * Fired when fetching object schemas fails. */
258
262
  'operational.objectSchemas.failed': ObjectSchemasFailedAttributesType;
263
+ /**
264
+ * Fired when an atomic action execution is successful */
265
+ 'operational.actionExecution.success': ActionExecutionSuccessAttributesType;
259
266
  /**
260
267
  * Fired when the action discovery and permissions request is successful. */
261
268
  'operational.actionDiscovery.success': ActionDiscoverySuccessAttributesType;
@@ -4,10 +4,9 @@ import type { DatasourceTypeWithOnlyValues } from '../types';
4
4
  interface InlineEditProps {
5
5
  ari: string;
6
6
  columnKey: string;
7
- integrationKey: string;
8
7
  readView: React.ReactNode;
9
8
  datasourceTypeWithValues: DatasourceTypeWithOnlyValues;
10
9
  execute: (value: string | number) => Promise<AtomicActionExecuteResponse>;
11
10
  }
12
- export declare const InlineEdit: ({ ari, execute, readView, columnKey, integrationKey, datasourceTypeWithValues, }: InlineEditProps) => JSX.Element;
11
+ export declare const InlineEdit: ({ ari, execute, readView, columnKey, datasourceTypeWithValues, }: InlineEditProps) => JSX.Element;
13
12
  export {};
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * Generates Typescript types for analytics events from analytics.spec.yaml
5
5
  *
6
- * @codegen <<SignedSource::26fd2d06084d185e97be01b2070484ff>>
6
+ * @codegen <<SignedSource::a773c6cad8ff2e59bb7020ea85e35bc5>>
7
7
  * @codegenCommand yarn workspace @atlassian/analytics-tooling run analytics:codegen link-datasource
8
8
  */
9
9
  export type ComponentMetaDataType = {
@@ -141,6 +141,10 @@ export type ObjectSchemasSuccessAttributesType = {};
141
141
  export type ObjectSchemasFailedAttributesType = {
142
142
  statusCodeGroup: '1xx' | '3xx' | '4xx' | '5xx' | 'unknown';
143
143
  };
144
+ export type ActionExecutionSuccessAttributesType = {
145
+ integrationKey: string;
146
+ experience: 'datasource';
147
+ };
144
148
  export type ActionDiscoverySuccessAttributesType = {
145
149
  experience: 'datasource';
146
150
  entityType: string;
@@ -256,6 +260,9 @@ export type AnalyticsEventAttributes = {
256
260
  /**
257
261
  * Fired when fetching object schemas fails. */
258
262
  'operational.objectSchemas.failed': ObjectSchemasFailedAttributesType;
263
+ /**
264
+ * Fired when an atomic action execution is successful */
265
+ 'operational.actionExecution.success': ActionExecutionSuccessAttributesType;
259
266
  /**
260
267
  * Fired when the action discovery and permissions request is successful. */
261
268
  'operational.actionDiscovery.success': ActionDiscoverySuccessAttributesType;
@@ -4,10 +4,9 @@ import type { DatasourceTypeWithOnlyValues } from '../types';
4
4
  interface InlineEditProps {
5
5
  ari: string;
6
6
  columnKey: string;
7
- integrationKey: string;
8
7
  readView: React.ReactNode;
9
8
  datasourceTypeWithValues: DatasourceTypeWithOnlyValues;
10
9
  execute: (value: string | number) => Promise<AtomicActionExecuteResponse>;
11
10
  }
12
- export declare const InlineEdit: ({ ari, execute, readView, columnKey, integrationKey, datasourceTypeWithValues, }: InlineEditProps) => JSX.Element;
11
+ export declare const InlineEdit: ({ ari, execute, readView, columnKey, datasourceTypeWithValues, }: InlineEditProps) => JSX.Element;
13
12
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/link-datasource",
3
- "version": "2.11.10",
3
+ "version": "2.11.12",
4
4
  "description": "UI Components to support linking platform dataset feature",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -36,14 +36,14 @@
36
36
  "analytics:codegen": "yarn workspace @atlassian/analytics-tooling run analytics:codegen link-datasource --output ./src/analytics/generated"
37
37
  },
38
38
  "dependencies": {
39
- "@atlaskit/adf-schema": "^40.8.1",
39
+ "@atlaskit/adf-schema": "^40.9.0",
40
40
  "@atlaskit/analytics-next": "^10.1.0",
41
41
  "@atlaskit/avatar": "^21.15.0",
42
42
  "@atlaskit/avatar-group": "^9.11.0",
43
43
  "@atlaskit/badge": "^16.4.0",
44
44
  "@atlaskit/button": "^20.1.0",
45
45
  "@atlaskit/datetime-picker": "^14.0.0",
46
- "@atlaskit/dropdown-menu": "^12.17.0",
46
+ "@atlaskit/dropdown-menu": "^12.18.0",
47
47
  "@atlaskit/editor-prosemirror": "5.0.1",
48
48
  "@atlaskit/empty-state": "^7.11.0",
49
49
  "@atlaskit/flag": "^15.8.0",
@@ -73,7 +73,7 @@
73
73
  "@atlaskit/pragmatic-drag-and-drop-react-drop-indicator": "^1.1.0",
74
74
  "@atlaskit/primitives": "^12.0.0",
75
75
  "@atlaskit/select": "^17.15.0",
76
- "@atlaskit/smart-card": "^27.18.0",
76
+ "@atlaskit/smart-card": "^27.19.0",
77
77
  "@atlaskit/smart-user-picker": "6.10.2",
78
78
  "@atlaskit/spinner": "^16.3.0",
79
79
  "@atlaskit/tag": "^12.5.0",