@atlaskit/link-datasource 1.19.35 → 1.19.37
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 +12 -0
- package/dist/cjs/hooks/useDatasourceTableState.js +8 -17
- package/dist/es2019/hooks/useDatasourceTableState.js +8 -14
- package/dist/esm/hooks/useDatasourceTableState.js +8 -17
- package/dist/types/hooks/useDatasourceTableState.d.ts +0 -2
- package/dist/types-ts4.5/hooks/useDatasourceTableState.d.ts +0 -2
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @atlaskit/link-datasource
|
|
2
2
|
|
|
3
|
+
## 1.19.37
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#64237](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/64237) [`60749f37a107`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/60749f37a107) - [ux] Revert issue duplication in list of links due to infinite loop bug
|
|
8
|
+
|
|
9
|
+
## 1.19.36
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Updated dependencies
|
|
14
|
+
|
|
3
15
|
## 1.19.35
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
|
@@ -308,26 +308,18 @@ var useDatasourceTableState = exports.useDatasourceTableState = function useData
|
|
|
308
308
|
}
|
|
309
309
|
}, _callee2, null, [[7, 39]]);
|
|
310
310
|
})), [captureError, parameters, fieldKeys, nextCursor, getDatasourceData, datasourceId, responseItems === null || responseItems === void 0 ? void 0 : responseItems.length, applySchemaProperties, fireEvent, fullSchema]);
|
|
311
|
-
var reset = (0, _react.useCallback)(function () {
|
|
312
|
-
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
313
|
-
var _ref4 = options,
|
|
314
|
-
_ref4$shouldResetFull = _ref4.shouldResetFullSchema,
|
|
315
|
-
shouldResetFullSchema = _ref4$shouldResetFull === void 0 ? true : _ref4$shouldResetFull,
|
|
316
|
-
_ref4$shouldForceRequ = _ref4.shouldForceRequest,
|
|
317
|
-
shouldForceRequest = _ref4$shouldForceRequ === void 0 ? false : _ref4$shouldForceRequ,
|
|
318
|
-
_ref4$shouldResetColu = _ref4.shouldResetColumns,
|
|
319
|
-
shouldResetColumns = _ref4$shouldResetColu === void 0 ? false : _ref4$shouldResetColu;
|
|
311
|
+
var reset = (0, _react.useCallback)(function (options) {
|
|
320
312
|
setStatus('empty');
|
|
321
313
|
setResponseItems([]);
|
|
322
314
|
setHasNextPage(true);
|
|
323
315
|
setNextCursor(undefined);
|
|
324
316
|
setTotalCount(undefined);
|
|
325
317
|
setLastRequestedFieldKeys([]);
|
|
326
|
-
|
|
318
|
+
setFullSchema({
|
|
327
319
|
properties: []
|
|
328
320
|
});
|
|
329
|
-
setShouldForceRequest(shouldForceRequest);
|
|
330
|
-
if (shouldResetColumns) {
|
|
321
|
+
setShouldForceRequest((options === null || options === void 0 ? void 0 : options.shouldForceRequest) || false);
|
|
322
|
+
if (options !== null && options !== void 0 && options.shouldResetColumns) {
|
|
331
323
|
setColumns([]);
|
|
332
324
|
setDefaultVisibleColumnKeys([]);
|
|
333
325
|
}
|
|
@@ -362,12 +354,11 @@ var useDatasourceTableState = exports.useDatasourceTableState = function useData
|
|
|
362
354
|
return responseItemKeys.includes(key);
|
|
363
355
|
});
|
|
364
356
|
});
|
|
365
|
-
|
|
366
|
-
// if there is no data for the new columns, resetting the state triggers the request of new data (onNextPage)
|
|
367
|
-
// but the schema should not be reset as it is already loaded
|
|
368
357
|
if (!hasDataForColumns) {
|
|
369
|
-
reset(
|
|
370
|
-
|
|
358
|
+
reset();
|
|
359
|
+
void onNextPage({
|
|
360
|
+
isSchemaFromData: false,
|
|
361
|
+
shouldRequestFirstPage: true
|
|
371
362
|
});
|
|
372
363
|
}
|
|
373
364
|
}
|
|
@@ -189,23 +189,18 @@ export const useDatasourceTableState = ({
|
|
|
189
189
|
setStatus('rejected');
|
|
190
190
|
}
|
|
191
191
|
}, [captureError, parameters, fieldKeys, nextCursor, getDatasourceData, datasourceId, responseItems === null || responseItems === void 0 ? void 0 : responseItems.length, applySchemaProperties, fireEvent, fullSchema]);
|
|
192
|
-
const reset = useCallback(
|
|
193
|
-
const {
|
|
194
|
-
shouldResetFullSchema = true,
|
|
195
|
-
shouldForceRequest = false,
|
|
196
|
-
shouldResetColumns = false
|
|
197
|
-
} = options;
|
|
192
|
+
const reset = useCallback(options => {
|
|
198
193
|
setStatus('empty');
|
|
199
194
|
setResponseItems([]);
|
|
200
195
|
setHasNextPage(true);
|
|
201
196
|
setNextCursor(undefined);
|
|
202
197
|
setTotalCount(undefined);
|
|
203
198
|
setLastRequestedFieldKeys([]);
|
|
204
|
-
|
|
199
|
+
setFullSchema({
|
|
205
200
|
properties: []
|
|
206
201
|
});
|
|
207
|
-
setShouldForceRequest(shouldForceRequest);
|
|
208
|
-
if (shouldResetColumns) {
|
|
202
|
+
setShouldForceRequest((options === null || options === void 0 ? void 0 : options.shouldForceRequest) || false);
|
|
203
|
+
if (options !== null && options !== void 0 && options.shouldResetColumns) {
|
|
209
204
|
setColumns([]);
|
|
210
205
|
setDefaultVisibleColumnKeys([]);
|
|
211
206
|
}
|
|
@@ -236,12 +231,11 @@ export const useDatasourceTableState = ({
|
|
|
236
231
|
const responseItemKeys = Object.keys(responseItem);
|
|
237
232
|
return fieldKeys.every(key => responseItemKeys.includes(key));
|
|
238
233
|
});
|
|
239
|
-
|
|
240
|
-
// if there is no data for the new columns, resetting the state triggers the request of new data (onNextPage)
|
|
241
|
-
// but the schema should not be reset as it is already loaded
|
|
242
234
|
if (!hasDataForColumns) {
|
|
243
|
-
reset(
|
|
244
|
-
|
|
235
|
+
reset();
|
|
236
|
+
void onNextPage({
|
|
237
|
+
isSchemaFromData: false,
|
|
238
|
+
shouldRequestFirstPage: true
|
|
245
239
|
});
|
|
246
240
|
}
|
|
247
241
|
}
|
|
@@ -301,26 +301,18 @@ export var useDatasourceTableState = function useDatasourceTableState(_ref) {
|
|
|
301
301
|
}
|
|
302
302
|
}, _callee2, null, [[7, 39]]);
|
|
303
303
|
})), [captureError, parameters, fieldKeys, nextCursor, getDatasourceData, datasourceId, responseItems === null || responseItems === void 0 ? void 0 : responseItems.length, applySchemaProperties, fireEvent, fullSchema]);
|
|
304
|
-
var reset = useCallback(function () {
|
|
305
|
-
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
306
|
-
var _ref4 = options,
|
|
307
|
-
_ref4$shouldResetFull = _ref4.shouldResetFullSchema,
|
|
308
|
-
shouldResetFullSchema = _ref4$shouldResetFull === void 0 ? true : _ref4$shouldResetFull,
|
|
309
|
-
_ref4$shouldForceRequ = _ref4.shouldForceRequest,
|
|
310
|
-
shouldForceRequest = _ref4$shouldForceRequ === void 0 ? false : _ref4$shouldForceRequ,
|
|
311
|
-
_ref4$shouldResetColu = _ref4.shouldResetColumns,
|
|
312
|
-
shouldResetColumns = _ref4$shouldResetColu === void 0 ? false : _ref4$shouldResetColu;
|
|
304
|
+
var reset = useCallback(function (options) {
|
|
313
305
|
setStatus('empty');
|
|
314
306
|
setResponseItems([]);
|
|
315
307
|
setHasNextPage(true);
|
|
316
308
|
setNextCursor(undefined);
|
|
317
309
|
setTotalCount(undefined);
|
|
318
310
|
setLastRequestedFieldKeys([]);
|
|
319
|
-
|
|
311
|
+
setFullSchema({
|
|
320
312
|
properties: []
|
|
321
313
|
});
|
|
322
|
-
setShouldForceRequest(shouldForceRequest);
|
|
323
|
-
if (shouldResetColumns) {
|
|
314
|
+
setShouldForceRequest((options === null || options === void 0 ? void 0 : options.shouldForceRequest) || false);
|
|
315
|
+
if (options !== null && options !== void 0 && options.shouldResetColumns) {
|
|
324
316
|
setColumns([]);
|
|
325
317
|
setDefaultVisibleColumnKeys([]);
|
|
326
318
|
}
|
|
@@ -355,12 +347,11 @@ export var useDatasourceTableState = function useDatasourceTableState(_ref) {
|
|
|
355
347
|
return responseItemKeys.includes(key);
|
|
356
348
|
});
|
|
357
349
|
});
|
|
358
|
-
|
|
359
|
-
// if there is no data for the new columns, resetting the state triggers the request of new data (onNextPage)
|
|
360
|
-
// but the schema should not be reset as it is already loaded
|
|
361
350
|
if (!hasDataForColumns) {
|
|
362
|
-
reset(
|
|
363
|
-
|
|
351
|
+
reset();
|
|
352
|
+
void onNextPage({
|
|
353
|
+
isSchemaFromData: false,
|
|
354
|
+
shouldRequestFirstPage: true
|
|
364
355
|
});
|
|
365
356
|
}
|
|
366
357
|
}
|
|
@@ -10,8 +10,6 @@ interface ResetOptions {
|
|
|
10
10
|
shouldForceRequest?: boolean;
|
|
11
11
|
/** Resets current column data from a datasource table when issuing the new request */
|
|
12
12
|
shouldResetColumns?: boolean;
|
|
13
|
-
/** Resets current schema data from a datasource table when issuing the new request */
|
|
14
|
-
shouldResetFullSchema?: boolean;
|
|
15
13
|
}
|
|
16
14
|
export interface DatasourceTableState {
|
|
17
15
|
/** The current status of the table for rendering of the different UI states (e.g.: loading, error, etc). */
|
|
@@ -10,8 +10,6 @@ interface ResetOptions {
|
|
|
10
10
|
shouldForceRequest?: boolean;
|
|
11
11
|
/** Resets current column data from a datasource table when issuing the new request */
|
|
12
12
|
shouldResetColumns?: boolean;
|
|
13
|
-
/** Resets current schema data from a datasource table when issuing the new request */
|
|
14
|
-
shouldResetFullSchema?: boolean;
|
|
15
13
|
}
|
|
16
14
|
export interface DatasourceTableState {
|
|
17
15
|
/** The current status of the table for rendering of the different UI states (e.g.: loading, error, etc). */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/link-datasource",
|
|
3
|
-
"version": "1.19.
|
|
3
|
+
"version": "1.19.37",
|
|
4
4
|
"description": "UI Components to support linking platform dataset feature",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"@atlaskit/jql-ast": "^3.0.0",
|
|
47
47
|
"@atlaskit/jql-editor-autocomplete-rest": "^2.0.0",
|
|
48
48
|
"@atlaskit/link-client-extension": "^1.8.0",
|
|
49
|
-
"@atlaskit/linking-common": "^
|
|
49
|
+
"@atlaskit/linking-common": "^5.1.0",
|
|
50
50
|
"@atlaskit/linking-types": "^8.5.0",
|
|
51
51
|
"@atlaskit/lozenge": "^11.5.0",
|
|
52
52
|
"@atlaskit/modal-dialog": "^12.10.0",
|