@atlaskit/link-datasource 3.8.0 → 3.8.1

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,13 @@
1
1
  # @atlaskit/link-datasource
2
2
 
3
+ ## 3.8.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#159211](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/159211)
8
+ [`9e940f7c89d05`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/9e940f7c89d05) -
9
+ Adding analytics for `executeFetch` and updating test delays for loading state
10
+
3
11
  ## 3.8.0
4
12
 
5
13
  ### Minor Changes
@@ -256,13 +256,17 @@ var useExecuteAtomicAction = exports.useExecuteAtomicAction = function useExecut
256
256
  }
257
257
  }
258
258
  }).then(function (resp) {
259
+ fireEvent('operational.fetchActionExecution.success', {
260
+ integrationKey: integrationKey,
261
+ experience: 'datasource'
262
+ });
259
263
  return resp;
260
264
  }).catch(function (error) {
261
- captureError('actionExecution', error); // fetchActionExecution
265
+ captureError('fetchActionExecution', error);
262
266
  // Rethrow up to component for flags and other handling
263
267
  throw error;
264
268
  });
265
- }, [fetchSchema, executeAction, integrationKey, ari, captureError]);
269
+ }, [fetchSchema, executeAction, integrationKey, ari, fireEvent, captureError]);
266
270
  return _objectSpread(_objectSpread({}, schema && {
267
271
  execute: execute
268
272
  }), fetchSchema && {
@@ -105,16 +105,12 @@ var loadOptions = /*#__PURE__*/function () {
105
105
  _context.next = 7;
106
106
  break;
107
107
  }
108
- return _context.abrupt("return", new Promise(function (resolve) {
109
- setTimeout(function () {
110
- return resolve(entities.map(function (entity) {
111
- return {
112
- id: entity.id,
113
- text: entity.text,
114
- style: entity.style
115
- };
116
- }));
117
- }, 1000);
108
+ return _context.abrupt("return", entities.map(function (entity) {
109
+ return {
110
+ id: entity.id,
111
+ text: entity.text,
112
+ style: entity.style
113
+ };
118
114
  }));
119
115
  case 7:
120
116
  return _context.abrupt("return", []);
@@ -243,13 +243,17 @@ export const useExecuteAtomicAction = ({
243
243
  }
244
244
  }
245
245
  }).then(resp => {
246
+ fireEvent('operational.fetchActionExecution.success', {
247
+ integrationKey: integrationKey,
248
+ experience: 'datasource'
249
+ });
246
250
  return resp;
247
251
  }).catch(error => {
248
- captureError('actionExecution', error); // fetchActionExecution
252
+ captureError('fetchActionExecution', error);
249
253
  // Rethrow up to component for flags and other handling
250
254
  throw error;
251
255
  });
252
- }, [fetchSchema, executeAction, integrationKey, ari, captureError]);
256
+ }, [fetchSchema, executeAction, integrationKey, ari, fireEvent, captureError]);
253
257
  return {
254
258
  ...(schema && {
255
259
  execute
@@ -75,13 +75,11 @@ const loadOptions = async (currentValue, executeFetch) => {
75
75
  entities
76
76
  } = result;
77
77
  if (operationStatus === ActionOperationStatus.SUCCESS && entities) {
78
- return new Promise(resolve => {
79
- setTimeout(() => resolve(entities.map(entity => ({
80
- id: entity.id,
81
- text: entity.text,
82
- style: entity.style
83
- }))), 1000);
84
- });
78
+ return entities.map(entity => ({
79
+ id: entity.id,
80
+ text: entity.text,
81
+ style: entity.style
82
+ }));
85
83
  }
86
84
  }
87
85
  return [];
@@ -250,13 +250,17 @@ export var useExecuteAtomicAction = function useExecuteAtomicAction(_ref5) {
250
250
  }
251
251
  }
252
252
  }).then(function (resp) {
253
+ fireEvent('operational.fetchActionExecution.success', {
254
+ integrationKey: integrationKey,
255
+ experience: 'datasource'
256
+ });
253
257
  return resp;
254
258
  }).catch(function (error) {
255
- captureError('actionExecution', error); // fetchActionExecution
259
+ captureError('fetchActionExecution', error);
256
260
  // Rethrow up to component for flags and other handling
257
261
  throw error;
258
262
  });
259
- }, [fetchSchema, executeAction, integrationKey, ari, captureError]);
263
+ }, [fetchSchema, executeAction, integrationKey, ari, fireEvent, captureError]);
260
264
  return _objectSpread(_objectSpread({}, schema && {
261
265
  execute: execute
262
266
  }), fetchSchema && {
@@ -95,16 +95,12 @@ var loadOptions = /*#__PURE__*/function () {
95
95
  _context.next = 7;
96
96
  break;
97
97
  }
98
- return _context.abrupt("return", new Promise(function (resolve) {
99
- setTimeout(function () {
100
- return resolve(entities.map(function (entity) {
101
- return {
102
- id: entity.id,
103
- text: entity.text,
104
- style: entity.style
105
- };
106
- }));
107
- }, 1000);
98
+ return _context.abrupt("return", entities.map(function (entity) {
99
+ return {
100
+ id: entity.id,
101
+ text: entity.text,
102
+ style: entity.style
103
+ };
108
104
  }));
109
105
  case 7:
110
106
  return _context.abrupt("return", []);
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * Generates Typescript types for analytics events from analytics.spec.yaml
5
5
  *
6
- * @codegen <<SignedSource::b6f8bb0286018a13a19546bc9fd67e2e>>
6
+ * @codegen <<SignedSource::6b271484f56c37f6170c6468edcab44c>>
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: 'ProviderOnAuthRequest' | 'loadDatasourceDetails' | 'onNextPage' | 'actionDiscovery' | 'actionExecution' | null;
71
+ errorLocation: 'ProviderOnAuthRequest' | 'loadDatasourceDetails' | 'onNextPage' | 'actionDiscovery' | 'actionExecution' | 'fetchActionExecution' | null;
72
72
  traceId: string | null;
73
73
  status: number | null;
74
74
  reason: 'response' | 'network' | 'internal' | 'unknown' | null;
@@ -146,6 +146,10 @@ export type ActionExecutionSuccessAttributesType = {
146
146
  integrationKey: string;
147
147
  experience: 'datasource';
148
148
  };
149
+ export type FetchActionExecutionSuccessAttributesType = {
150
+ integrationKey: string;
151
+ experience: 'datasource';
152
+ };
149
153
  export type ActionDiscoverySuccessAttributesType = {
150
154
  experience: 'datasource';
151
155
  entityType: string;
@@ -278,6 +282,9 @@ export type AnalyticsEventAttributes = {
278
282
  /**
279
283
  * Fired when an atomic action execution is successful */
280
284
  'operational.actionExecution.success': ActionExecutionSuccessAttributesType;
285
+ /**
286
+ * Fired when a fetch atomic action execution is successful */
287
+ 'operational.fetchActionExecution.success': FetchActionExecutionSuccessAttributesType;
281
288
  /**
282
289
  * Fired when the action discovery and permissions request is successful. */
283
290
  'operational.actionDiscovery.success': ActionDiscoverySuccessAttributesType;
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * Generates Typescript types for analytics events from analytics.spec.yaml
5
5
  *
6
- * @codegen <<SignedSource::b6f8bb0286018a13a19546bc9fd67e2e>>
6
+ * @codegen <<SignedSource::6b271484f56c37f6170c6468edcab44c>>
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: 'ProviderOnAuthRequest' | 'loadDatasourceDetails' | 'onNextPage' | 'actionDiscovery' | 'actionExecution' | null;
71
+ errorLocation: 'ProviderOnAuthRequest' | 'loadDatasourceDetails' | 'onNextPage' | 'actionDiscovery' | 'actionExecution' | 'fetchActionExecution' | null;
72
72
  traceId: string | null;
73
73
  status: number | null;
74
74
  reason: 'response' | 'network' | 'internal' | 'unknown' | null;
@@ -146,6 +146,10 @@ export type ActionExecutionSuccessAttributesType = {
146
146
  integrationKey: string;
147
147
  experience: 'datasource';
148
148
  };
149
+ export type FetchActionExecutionSuccessAttributesType = {
150
+ integrationKey: string;
151
+ experience: 'datasource';
152
+ };
149
153
  export type ActionDiscoverySuccessAttributesType = {
150
154
  experience: 'datasource';
151
155
  entityType: string;
@@ -278,6 +282,9 @@ export type AnalyticsEventAttributes = {
278
282
  /**
279
283
  * Fired when an atomic action execution is successful */
280
284
  'operational.actionExecution.success': ActionExecutionSuccessAttributesType;
285
+ /**
286
+ * Fired when a fetch atomic action execution is successful */
287
+ 'operational.fetchActionExecution.success': FetchActionExecutionSuccessAttributesType;
281
288
  /**
282
289
  * Fired when the action discovery and permissions request is successful. */
283
290
  'operational.actionDiscovery.success': ActionDiscoverySuccessAttributesType;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/link-datasource",
3
- "version": "3.8.0",
3
+ "version": "3.8.1",
4
4
  "description": "UI Components to support linking platform dataset feature",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",