@atlaskit/link-datasource 3.0.1 → 3.0.3
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 +18 -0
- package/dist/cjs/hooks/useDatasourceTableState.js +21 -16
- package/dist/cjs/hooks/useErrorLogger.js +1 -2
- package/dist/es2019/hooks/useDatasourceTableState.js +7 -2
- package/dist/es2019/hooks/useErrorLogger.js +1 -2
- package/dist/esm/hooks/useDatasourceTableState.js +21 -16
- package/dist/esm/hooks/useErrorLogger.js +1 -2
- package/package.json +6 -9
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @atlaskit/link-datasource
|
|
2
2
|
|
|
3
|
+
## 3.0.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#142171](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/142171)
|
|
8
|
+
[`e76645cc58176`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/e76645cc58176) -
|
|
9
|
+
Cleanup platform.linking-platform.datasources.enable-sentry-client FF
|
|
10
|
+
|
|
11
|
+
## 3.0.2
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- [#141472](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/141472)
|
|
16
|
+
[`fa7d87963ed8a`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/fa7d87963ed8a) -
|
|
17
|
+
Uses `objectTypesEntity` when available in DS data response as the Actions `entityType`. When
|
|
18
|
+
`entityType` is undefined it will not make request to `discoverActions`.
|
|
19
|
+
- Updated dependencies
|
|
20
|
+
|
|
3
21
|
## 3.0.1
|
|
4
22
|
|
|
5
23
|
### Patch Changes
|
|
@@ -226,6 +226,7 @@ var useDatasourceTableState = exports.useDatasourceTableState = function useData
|
|
|
226
226
|
_extensionKey,
|
|
227
227
|
auth,
|
|
228
228
|
_providerName,
|
|
229
|
+
objectTypesEntity,
|
|
229
230
|
_yield$getDatasourceD5,
|
|
230
231
|
items,
|
|
231
232
|
nextPageCursor,
|
|
@@ -280,27 +281,28 @@ var useDatasourceTableState = exports.useDatasourceTableState = function useData
|
|
|
280
281
|
_extensionKey = _yield$getDatasourceD4.extensionKey;
|
|
281
282
|
auth = _yield$getDatasourceD4.auth;
|
|
282
283
|
_providerName = _yield$getDatasourceD4.providerName;
|
|
284
|
+
objectTypesEntity = _yield$getDatasourceD4.objectTypesEntity;
|
|
283
285
|
_yield$getDatasourceD5 = _yield$getDatasourceD3.data;
|
|
284
286
|
items = _yield$getDatasourceD5.items;
|
|
285
287
|
nextPageCursor = _yield$getDatasourceD5.nextPageCursor;
|
|
286
288
|
_totalCount = _yield$getDatasourceD5.totalCount;
|
|
287
289
|
schema = _yield$getDatasourceD5.schema;
|
|
288
290
|
if (!((_currentAbortControll = currentAbortController) !== null && _currentAbortControll !== void 0 && _currentAbortControll.signal.aborted)) {
|
|
289
|
-
_context2.next =
|
|
291
|
+
_context2.next = 29;
|
|
290
292
|
break;
|
|
291
293
|
}
|
|
292
294
|
throw new Error('Aborted');
|
|
293
|
-
case
|
|
295
|
+
case 29:
|
|
294
296
|
setExtensionKey(_extensionKey);
|
|
295
297
|
setProviderName(_providerName);
|
|
296
298
|
if (!(access === 'unauthorized' || access === 'forbidden')) {
|
|
297
|
-
_context2.next =
|
|
299
|
+
_context2.next = 35;
|
|
298
300
|
break;
|
|
299
301
|
}
|
|
300
302
|
setStatus(access);
|
|
301
303
|
setAuthDetails(auth || initialEmptyArray);
|
|
302
304
|
return _context2.abrupt("return");
|
|
303
|
-
case
|
|
305
|
+
case 35:
|
|
304
306
|
setDestinationObjectTypes(_destinationObjectTypes);
|
|
305
307
|
setTotalCount(_totalCount);
|
|
306
308
|
setNextCursor(nextPageCursor);
|
|
@@ -315,7 +317,10 @@ var useDatasourceTableState = exports.useDatasourceTableState = function useData
|
|
|
315
317
|
* Product is typed as any.
|
|
316
318
|
*/
|
|
317
319
|
integrationKey = product;
|
|
318
|
-
|
|
320
|
+
/**
|
|
321
|
+
* When `entityType` is undefined, we should not discover actions it prevents unnecessary requests to Actions service
|
|
322
|
+
*/
|
|
323
|
+
entityType = objectTypesEntity;
|
|
319
324
|
newIds = onAddItems(items, typeof integrationKey === 'string' ? integrationKey : undefined, entityType);
|
|
320
325
|
setResponseItemIds(function (currentIds) {
|
|
321
326
|
return [].concat((0, _toConsumableArray2.default)(currentIds), (0, _toConsumableArray2.default)(newIds));
|
|
@@ -357,38 +362,38 @@ var useDatasourceTableState = exports.useDatasourceTableState = function useData
|
|
|
357
362
|
});
|
|
358
363
|
}
|
|
359
364
|
setStatus('resolved');
|
|
360
|
-
_context2.next =
|
|
365
|
+
_context2.next = 60;
|
|
361
366
|
break;
|
|
362
|
-
case
|
|
363
|
-
_context2.prev =
|
|
367
|
+
case 48:
|
|
368
|
+
_context2.prev = 48;
|
|
364
369
|
_context2.t0 = _context2["catch"](10);
|
|
365
370
|
if (!(_context2.t0.message === 'Aborted')) {
|
|
366
|
-
_context2.next =
|
|
371
|
+
_context2.next = 52;
|
|
367
372
|
break;
|
|
368
373
|
}
|
|
369
374
|
return _context2.abrupt("return");
|
|
370
|
-
case
|
|
375
|
+
case 52:
|
|
371
376
|
captureError('onNextPage', _context2.t0);
|
|
372
377
|
if (!(_context2.t0 instanceof Response && _context2.t0.status === 401)) {
|
|
373
|
-
_context2.next =
|
|
378
|
+
_context2.next = 56;
|
|
374
379
|
break;
|
|
375
380
|
}
|
|
376
381
|
setStatus('unauthorized');
|
|
377
382
|
return _context2.abrupt("return");
|
|
378
|
-
case
|
|
383
|
+
case 56:
|
|
379
384
|
if (!(_context2.t0 instanceof Response && _context2.t0.status === 403)) {
|
|
380
|
-
_context2.next =
|
|
385
|
+
_context2.next = 59;
|
|
381
386
|
break;
|
|
382
387
|
}
|
|
383
388
|
setStatus('forbidden');
|
|
384
389
|
return _context2.abrupt("return");
|
|
385
|
-
case 58:
|
|
386
|
-
setStatus('rejected');
|
|
387
390
|
case 59:
|
|
391
|
+
setStatus('rejected');
|
|
392
|
+
case 60:
|
|
388
393
|
case "end":
|
|
389
394
|
return _context2.stop();
|
|
390
395
|
}
|
|
391
|
-
}, _callee2, null, [[10,
|
|
396
|
+
}, _callee2, null, [[10, 48]]);
|
|
392
397
|
})), [captureError, parameters, fieldKeys, nextCursor, responseItems, setResponseItemIds, onAddItems, getDatasourceData, datasourceId, applySchemaProperties, fireEvent, fullSchema, initialEmptyArray, discoverActions]);
|
|
393
398
|
var reset = (0, _react.useCallback)(function (options) {
|
|
394
399
|
setResponseItems(initialEmptyArray);
|
|
@@ -9,7 +9,6 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
|
|
|
9
9
|
var _react = require("react");
|
|
10
10
|
var _sentry = require("@atlaskit/linking-common/sentry");
|
|
11
11
|
var _utils = require("@atlaskit/linking-common/utils");
|
|
12
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
13
12
|
var _analytics = require("../analytics");
|
|
14
13
|
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; }
|
|
15
14
|
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; }
|
|
@@ -28,7 +27,7 @@ var getNetworkFields = function getNetworkFields(error) {
|
|
|
28
27
|
* a helper Tail type which removes the first element of the tuple
|
|
29
28
|
*/
|
|
30
29
|
var logToSentry = exports.logToSentry = function logToSentry(error) {
|
|
31
|
-
if (error instanceof Error
|
|
30
|
+
if (error instanceof Error) {
|
|
32
31
|
for (var _len = arguments.length, captureExceptionParams = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
33
32
|
captureExceptionParams[_key - 1] = arguments[_key];
|
|
34
33
|
}
|
|
@@ -163,7 +163,8 @@ export const useDatasourceTableState = ({
|
|
|
163
163
|
product,
|
|
164
164
|
extensionKey,
|
|
165
165
|
auth,
|
|
166
|
-
providerName
|
|
166
|
+
providerName,
|
|
167
|
+
objectTypesEntity
|
|
167
168
|
},
|
|
168
169
|
data: {
|
|
169
170
|
items,
|
|
@@ -199,7 +200,11 @@ export const useDatasourceTableState = ({
|
|
|
199
200
|
* Product is typed as any.
|
|
200
201
|
*/
|
|
201
202
|
const integrationKey = product;
|
|
202
|
-
|
|
203
|
+
|
|
204
|
+
/**
|
|
205
|
+
* When `entityType` is undefined, we should not discover actions it prevents unnecessary requests to Actions service
|
|
206
|
+
*/
|
|
207
|
+
const entityType = objectTypesEntity;
|
|
203
208
|
const newIds = onAddItems(items, typeof integrationKey === 'string' ? integrationKey : undefined, entityType);
|
|
204
209
|
setResponseItemIds(currentIds => [...currentIds, ...newIds]);
|
|
205
210
|
if (fg('platform-datasources-enable-two-way-sync')) {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { useCallback } from 'react';
|
|
2
2
|
import { captureException } from '@atlaskit/linking-common/sentry';
|
|
3
3
|
import { getTraceId } from '@atlaskit/linking-common/utils';
|
|
4
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
5
4
|
import { useDatasourceAnalyticsEvents } from '../analytics';
|
|
6
5
|
const getNetworkFields = error => {
|
|
7
6
|
return error instanceof Response ? {
|
|
@@ -18,7 +17,7 @@ const getNetworkFields = error => {
|
|
|
18
17
|
* a helper Tail type which removes the first element of the tuple
|
|
19
18
|
*/
|
|
20
19
|
export const logToSentry = (error, ...captureExceptionParams) => {
|
|
21
|
-
if (error instanceof Error
|
|
20
|
+
if (error instanceof Error) {
|
|
22
21
|
captureException(error, ...captureExceptionParams);
|
|
23
22
|
}
|
|
24
23
|
};
|
|
@@ -219,6 +219,7 @@ export var useDatasourceTableState = function useDatasourceTableState(_ref) {
|
|
|
219
219
|
_extensionKey,
|
|
220
220
|
auth,
|
|
221
221
|
_providerName,
|
|
222
|
+
objectTypesEntity,
|
|
222
223
|
_yield$getDatasourceD5,
|
|
223
224
|
items,
|
|
224
225
|
nextPageCursor,
|
|
@@ -273,27 +274,28 @@ export var useDatasourceTableState = function useDatasourceTableState(_ref) {
|
|
|
273
274
|
_extensionKey = _yield$getDatasourceD4.extensionKey;
|
|
274
275
|
auth = _yield$getDatasourceD4.auth;
|
|
275
276
|
_providerName = _yield$getDatasourceD4.providerName;
|
|
277
|
+
objectTypesEntity = _yield$getDatasourceD4.objectTypesEntity;
|
|
276
278
|
_yield$getDatasourceD5 = _yield$getDatasourceD3.data;
|
|
277
279
|
items = _yield$getDatasourceD5.items;
|
|
278
280
|
nextPageCursor = _yield$getDatasourceD5.nextPageCursor;
|
|
279
281
|
_totalCount = _yield$getDatasourceD5.totalCount;
|
|
280
282
|
schema = _yield$getDatasourceD5.schema;
|
|
281
283
|
if (!((_currentAbortControll = currentAbortController) !== null && _currentAbortControll !== void 0 && _currentAbortControll.signal.aborted)) {
|
|
282
|
-
_context2.next =
|
|
284
|
+
_context2.next = 29;
|
|
283
285
|
break;
|
|
284
286
|
}
|
|
285
287
|
throw new Error('Aborted');
|
|
286
|
-
case
|
|
288
|
+
case 29:
|
|
287
289
|
setExtensionKey(_extensionKey);
|
|
288
290
|
setProviderName(_providerName);
|
|
289
291
|
if (!(access === 'unauthorized' || access === 'forbidden')) {
|
|
290
|
-
_context2.next =
|
|
292
|
+
_context2.next = 35;
|
|
291
293
|
break;
|
|
292
294
|
}
|
|
293
295
|
setStatus(access);
|
|
294
296
|
setAuthDetails(auth || initialEmptyArray);
|
|
295
297
|
return _context2.abrupt("return");
|
|
296
|
-
case
|
|
298
|
+
case 35:
|
|
297
299
|
setDestinationObjectTypes(_destinationObjectTypes);
|
|
298
300
|
setTotalCount(_totalCount);
|
|
299
301
|
setNextCursor(nextPageCursor);
|
|
@@ -308,7 +310,10 @@ export var useDatasourceTableState = function useDatasourceTableState(_ref) {
|
|
|
308
310
|
* Product is typed as any.
|
|
309
311
|
*/
|
|
310
312
|
integrationKey = product;
|
|
311
|
-
|
|
313
|
+
/**
|
|
314
|
+
* When `entityType` is undefined, we should not discover actions it prevents unnecessary requests to Actions service
|
|
315
|
+
*/
|
|
316
|
+
entityType = objectTypesEntity;
|
|
312
317
|
newIds = onAddItems(items, typeof integrationKey === 'string' ? integrationKey : undefined, entityType);
|
|
313
318
|
setResponseItemIds(function (currentIds) {
|
|
314
319
|
return [].concat(_toConsumableArray(currentIds), _toConsumableArray(newIds));
|
|
@@ -350,38 +355,38 @@ export var useDatasourceTableState = function useDatasourceTableState(_ref) {
|
|
|
350
355
|
});
|
|
351
356
|
}
|
|
352
357
|
setStatus('resolved');
|
|
353
|
-
_context2.next =
|
|
358
|
+
_context2.next = 60;
|
|
354
359
|
break;
|
|
355
|
-
case
|
|
356
|
-
_context2.prev =
|
|
360
|
+
case 48:
|
|
361
|
+
_context2.prev = 48;
|
|
357
362
|
_context2.t0 = _context2["catch"](10);
|
|
358
363
|
if (!(_context2.t0.message === 'Aborted')) {
|
|
359
|
-
_context2.next =
|
|
364
|
+
_context2.next = 52;
|
|
360
365
|
break;
|
|
361
366
|
}
|
|
362
367
|
return _context2.abrupt("return");
|
|
363
|
-
case
|
|
368
|
+
case 52:
|
|
364
369
|
captureError('onNextPage', _context2.t0);
|
|
365
370
|
if (!(_context2.t0 instanceof Response && _context2.t0.status === 401)) {
|
|
366
|
-
_context2.next =
|
|
371
|
+
_context2.next = 56;
|
|
367
372
|
break;
|
|
368
373
|
}
|
|
369
374
|
setStatus('unauthorized');
|
|
370
375
|
return _context2.abrupt("return");
|
|
371
|
-
case
|
|
376
|
+
case 56:
|
|
372
377
|
if (!(_context2.t0 instanceof Response && _context2.t0.status === 403)) {
|
|
373
|
-
_context2.next =
|
|
378
|
+
_context2.next = 59;
|
|
374
379
|
break;
|
|
375
380
|
}
|
|
376
381
|
setStatus('forbidden');
|
|
377
382
|
return _context2.abrupt("return");
|
|
378
|
-
case 58:
|
|
379
|
-
setStatus('rejected');
|
|
380
383
|
case 59:
|
|
384
|
+
setStatus('rejected');
|
|
385
|
+
case 60:
|
|
381
386
|
case "end":
|
|
382
387
|
return _context2.stop();
|
|
383
388
|
}
|
|
384
|
-
}, _callee2, null, [[10,
|
|
389
|
+
}, _callee2, null, [[10, 48]]);
|
|
385
390
|
})), [captureError, parameters, fieldKeys, nextCursor, responseItems, setResponseItemIds, onAddItems, getDatasourceData, datasourceId, applySchemaProperties, fireEvent, fullSchema, initialEmptyArray, discoverActions]);
|
|
386
391
|
var reset = useCallback(function (options) {
|
|
387
392
|
setResponseItems(initialEmptyArray);
|
|
@@ -4,7 +4,6 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
4
4
|
import { useCallback } from 'react';
|
|
5
5
|
import { captureException } from '@atlaskit/linking-common/sentry';
|
|
6
6
|
import { getTraceId } from '@atlaskit/linking-common/utils';
|
|
7
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
8
7
|
import { useDatasourceAnalyticsEvents } from '../analytics';
|
|
9
8
|
var getNetworkFields = function getNetworkFields(error) {
|
|
10
9
|
return error instanceof Response ? {
|
|
@@ -21,7 +20,7 @@ var getNetworkFields = function getNetworkFields(error) {
|
|
|
21
20
|
* a helper Tail type which removes the first element of the tuple
|
|
22
21
|
*/
|
|
23
22
|
export var logToSentry = function logToSentry(error) {
|
|
24
|
-
if (error instanceof Error
|
|
23
|
+
if (error instanceof Error) {
|
|
25
24
|
for (var _len = arguments.length, captureExceptionParams = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
26
25
|
captureExceptionParams[_key - 1] = arguments[_key];
|
|
27
26
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/link-datasource",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.3",
|
|
4
4
|
"description": "UI Components to support linking platform dataset feature",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -48,7 +48,7 @@
|
|
|
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.18.0",
|
|
52
52
|
"@atlaskit/icon-object": "^6.5.0",
|
|
53
53
|
"@atlaskit/image": "^1.3.0",
|
|
54
54
|
"@atlaskit/inline-edit": "^13.7.0",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"@atlaskit/jql-editor": "^4.7.0",
|
|
58
58
|
"@atlaskit/jql-editor-autocomplete-rest": "^2.1.0",
|
|
59
59
|
"@atlaskit/layering": "^0.4.0",
|
|
60
|
-
"@atlaskit/link-client-extension": "^2.
|
|
60
|
+
"@atlaskit/link-client-extension": "^2.4.0",
|
|
61
61
|
"@atlaskit/linking-common": "^5.11.0",
|
|
62
62
|
"@atlaskit/linking-types": "^9.0.0",
|
|
63
63
|
"@atlaskit/logo": "^14.2.0",
|
|
@@ -71,14 +71,14 @@
|
|
|
71
71
|
"@atlaskit/pragmatic-drag-and-drop-react-beautiful-dnd-autoscroll": "^1.2.0",
|
|
72
72
|
"@atlaskit/pragmatic-drag-and-drop-react-drop-indicator": "^1.1.0",
|
|
73
73
|
"@atlaskit/primitives": "^12.1.0",
|
|
74
|
-
"@atlaskit/select": "^17.
|
|
74
|
+
"@atlaskit/select": "^17.19.0",
|
|
75
75
|
"@atlaskit/smart-card": "^28.1.0",
|
|
76
76
|
"@atlaskit/smart-user-picker": "6.10.2",
|
|
77
77
|
"@atlaskit/spinner": "^16.3.0",
|
|
78
78
|
"@atlaskit/tag": "^12.6.0",
|
|
79
79
|
"@atlaskit/textfield": "6.5.1",
|
|
80
80
|
"@atlaskit/theme": "^13.0.0",
|
|
81
|
-
"@atlaskit/tokens": "^1.
|
|
81
|
+
"@atlaskit/tokens": "^1.60.0",
|
|
82
82
|
"@atlaskit/tooltip": "^18.7.0",
|
|
83
83
|
"@atlaskit/ufo": "^0.3.0",
|
|
84
84
|
"@atlaskit/width-detector": "^4.3.0",
|
|
@@ -100,7 +100,7 @@
|
|
|
100
100
|
"devDependencies": {
|
|
101
101
|
"@af/integration-testing": "*",
|
|
102
102
|
"@af/visual-regression": "*",
|
|
103
|
-
"@atlaskit/link-provider": "^1.
|
|
103
|
+
"@atlaskit/link-provider": "^1.16.0",
|
|
104
104
|
"@atlaskit/link-test-helpers": "^7.5.0",
|
|
105
105
|
"@atlaskit/ssr": "*",
|
|
106
106
|
"@atlaskit/visual-regression": "*",
|
|
@@ -180,9 +180,6 @@
|
|
|
180
180
|
"platform.linking-platform.datasource-word_wrap": {
|
|
181
181
|
"type": "boolean"
|
|
182
182
|
},
|
|
183
|
-
"platform.linking-platform.datasources.enable-sentry-client": {
|
|
184
|
-
"type": "boolean"
|
|
185
|
-
},
|
|
186
183
|
"platform.linking-platform.datasource.limit-total-results_8wqcd": {
|
|
187
184
|
"type": "boolean"
|
|
188
185
|
},
|