@atlaskit/link-datasource 7.12.0 → 7.12.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,14 @@
1
1
  # @atlaskit/link-datasource
2
2
 
3
+ ## 7.12.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [`4d0e8142c81f3`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/4d0e8142c81f3) -
8
+ Request 100 items per page for Assets datasource tables behind
9
+ `astral_assets_default_page_size_100`.
10
+ - Updated dependencies
11
+
3
12
  ## 7.12.0
4
13
 
5
14
  ### Minor Changes
@@ -17,6 +17,7 @@ var _fg = require("@atlaskit/platform-feature-flags/fg");
17
17
  var _analytics = require("../analytics");
18
18
  var _state = require("../state");
19
19
  var _useDiscoverActions2 = require("../state/actions/useDiscoverActions");
20
+ var _assetsModal = require("../ui/assets-modal");
20
21
  var _useErrorLogger2 = _interopRequireDefault(require("./useErrorLogger"));
21
22
  var _useIsInPDFRender = require("./useIsInPDFRender");
22
23
  var INCREASED_DATASOURCE_DATA_PAGE_SIZE = exports.INCREASED_DATASOURCE_DATA_PAGE_SIZE = 100;
@@ -220,6 +221,7 @@ var useDatasourceTableState = exports.useDatasourceTableState = function useData
220
221
  _requestInfo$shouldFo,
221
222
  shouldForceRequest,
222
223
  isFullSchemaLoaded,
224
+ pageSize,
223
225
  datasourceDataRequest,
224
226
  _currentAbortControll,
225
227
  _yield$getDatasourceD3,
@@ -268,9 +270,18 @@ var useDatasourceTableState = exports.useDatasourceTableState = function useData
268
270
  case 1:
269
271
  _requestInfo$isSchema = requestInfo.isSchemaFromData, isSchemaFromData = _requestInfo$isSchema === void 0 ? true : _requestInfo$isSchema, shouldRequestFirstPage = requestInfo.shouldRequestFirstPage, _requestInfo$shouldFo = requestInfo.shouldForceRequest, shouldForceRequest = _requestInfo$shouldFo === void 0 ? false : _requestInfo$shouldFo;
270
272
  isFullSchemaLoaded = fullSchema.properties.length > 0;
273
+ /*
274
+ Note: The Assets backend currently ignores `pageSize` and always returns 100 items, so we request
275
+ always returns 100 items, so we request 100 explicitly to keep the same behaviour once the backend starts honouring it.
276
+ */
277
+ if ((0, _fg.fg)('astral_assets_default_page_size_100')) {
278
+ pageSize = isInPDFRender || datasourceId === _assetsModal.ASSETS_LIST_OF_LINKS_DATASOURCE_ID ? INCREASED_DATASOURCE_DATA_PAGE_SIZE : _useDataSourceClientExtension.DEFAULT_GET_DATASOURCE_DATA_PAGE_SIZE;
279
+ } else {
280
+ pageSize = isInPDFRender ? INCREASED_DATASOURCE_DATA_PAGE_SIZE : _useDataSourceClientExtension.DEFAULT_GET_DATASOURCE_DATA_PAGE_SIZE;
281
+ }
271
282
  datasourceDataRequest = {
272
283
  parameters: parameters,
273
- pageSize: isInPDFRender ? INCREASED_DATASOURCE_DATA_PAGE_SIZE : _useDataSourceClientExtension.DEFAULT_GET_DATASOURCE_DATA_PAGE_SIZE,
284
+ pageSize: pageSize,
274
285
  pageCursor: shouldRequestFirstPage ? undefined : nextCursor,
275
286
  fields: fieldKeys,
276
287
  includeSchema: isFullSchemaLoaded ? false : isSchemaFromData
@@ -6,6 +6,7 @@ import { fg } from '@atlaskit/platform-feature-flags/fg';
6
6
  import { useDatasourceAnalyticsEvents } from '../analytics';
7
7
  import { useDatasourceActions } from '../state';
8
8
  import { useDiscoverActions } from '../state/actions/useDiscoverActions';
9
+ import { ASSETS_LIST_OF_LINKS_DATASOURCE_ID } from '../ui/assets-modal';
9
10
  import useErrorLogger from './useErrorLogger';
10
11
  import { useIsInPDFRender } from './useIsInPDFRender';
11
12
  export const INCREASED_DATASOURCE_DATA_PAGE_SIZE = 100;
@@ -150,9 +151,19 @@ export const useDatasourceTableState = ({
150
151
  shouldForceRequest = false
151
152
  } = requestInfo;
152
153
  const isFullSchemaLoaded = fullSchema.properties.length > 0;
154
+ let pageSize;
155
+ /*
156
+ Note: The Assets backend currently ignores `pageSize` and always returns 100 items, so we request
157
+ always returns 100 items, so we request 100 explicitly to keep the same behaviour once the backend starts honouring it.
158
+ */
159
+ if (fg('astral_assets_default_page_size_100')) {
160
+ pageSize = isInPDFRender || datasourceId === ASSETS_LIST_OF_LINKS_DATASOURCE_ID ? INCREASED_DATASOURCE_DATA_PAGE_SIZE : DEFAULT_GET_DATASOURCE_DATA_PAGE_SIZE;
161
+ } else {
162
+ pageSize = isInPDFRender ? INCREASED_DATASOURCE_DATA_PAGE_SIZE : DEFAULT_GET_DATASOURCE_DATA_PAGE_SIZE;
163
+ }
153
164
  const datasourceDataRequest = {
154
165
  parameters,
155
- pageSize: isInPDFRender ? INCREASED_DATASOURCE_DATA_PAGE_SIZE : DEFAULT_GET_DATASOURCE_DATA_PAGE_SIZE,
166
+ pageSize,
156
167
  pageCursor: shouldRequestFirstPage ? undefined : nextCursor,
157
168
  fields: fieldKeys,
158
169
  includeSchema: isFullSchemaLoaded ? false : isSchemaFromData
@@ -10,6 +10,7 @@ import { fg } from '@atlaskit/platform-feature-flags/fg';
10
10
  import { useDatasourceAnalyticsEvents } from '../analytics';
11
11
  import { useDatasourceActions } from '../state';
12
12
  import { useDiscoverActions } from '../state/actions/useDiscoverActions';
13
+ import { ASSETS_LIST_OF_LINKS_DATASOURCE_ID } from '../ui/assets-modal';
13
14
  import useErrorLogger from './useErrorLogger';
14
15
  import { useIsInPDFRender } from './useIsInPDFRender';
15
16
  export var INCREASED_DATASOURCE_DATA_PAGE_SIZE = 100;
@@ -213,6 +214,7 @@ export var useDatasourceTableState = function useDatasourceTableState(_ref) {
213
214
  _requestInfo$shouldFo,
214
215
  shouldForceRequest,
215
216
  isFullSchemaLoaded,
217
+ pageSize,
216
218
  datasourceDataRequest,
217
219
  _currentAbortControll,
218
220
  _yield$getDatasourceD3,
@@ -261,9 +263,18 @@ export var useDatasourceTableState = function useDatasourceTableState(_ref) {
261
263
  case 1:
262
264
  _requestInfo$isSchema = requestInfo.isSchemaFromData, isSchemaFromData = _requestInfo$isSchema === void 0 ? true : _requestInfo$isSchema, shouldRequestFirstPage = requestInfo.shouldRequestFirstPage, _requestInfo$shouldFo = requestInfo.shouldForceRequest, shouldForceRequest = _requestInfo$shouldFo === void 0 ? false : _requestInfo$shouldFo;
263
265
  isFullSchemaLoaded = fullSchema.properties.length > 0;
266
+ /*
267
+ Note: The Assets backend currently ignores `pageSize` and always returns 100 items, so we request
268
+ always returns 100 items, so we request 100 explicitly to keep the same behaviour once the backend starts honouring it.
269
+ */
270
+ if (fg('astral_assets_default_page_size_100')) {
271
+ pageSize = isInPDFRender || datasourceId === ASSETS_LIST_OF_LINKS_DATASOURCE_ID ? INCREASED_DATASOURCE_DATA_PAGE_SIZE : DEFAULT_GET_DATASOURCE_DATA_PAGE_SIZE;
272
+ } else {
273
+ pageSize = isInPDFRender ? INCREASED_DATASOURCE_DATA_PAGE_SIZE : DEFAULT_GET_DATASOURCE_DATA_PAGE_SIZE;
274
+ }
264
275
  datasourceDataRequest = {
265
276
  parameters: parameters,
266
- pageSize: isInPDFRender ? INCREASED_DATASOURCE_DATA_PAGE_SIZE : DEFAULT_GET_DATASOURCE_DATA_PAGE_SIZE,
277
+ pageSize: pageSize,
267
278
  pageCursor: shouldRequestFirstPage ? undefined : nextCursor,
268
279
  fields: fieldKeys,
269
280
  includeSchema: isFullSchemaLoaded ? false : isSchemaFromData
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/link-datasource",
3
- "version": "7.12.0",
3
+ "version": "7.12.1",
4
4
  "description": "UI Components to support linking platform dataset feature",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -43,7 +43,7 @@
43
43
  "@atlaskit/analytics-cross-product": "^2.3.0",
44
44
  "@atlaskit/analytics-next": "^12.6.0",
45
45
  "@atlaskit/atlassian-context": "^2.0.0",
46
- "@atlaskit/avatar": "^30.0.0",
46
+ "@atlaskit/avatar": "^30.1.0",
47
47
  "@atlaskit/avatar-group": "^14.4.0",
48
48
  "@atlaskit/badge": "^22.0.0",
49
49
  "@atlaskit/button": "^25.7.0",
@@ -59,7 +59,7 @@
59
59
  "@atlaskit/heading": "^8.0.0",
60
60
  "@atlaskit/icon": "^38.0.0",
61
61
  "@atlaskit/image": "^5.2.0",
62
- "@atlaskit/inline-edit": "^16.4.0",
62
+ "@atlaskit/inline-edit": "^16.5.0",
63
63
  "@atlaskit/intl-messages-provider": "^5.0.0",
64
64
  "@atlaskit/jql-ast": "^4.2.0",
65
65
  "@atlaskit/jql-editor": "^8.5.0",
@@ -67,7 +67,7 @@
67
67
  "@atlaskit/layering": "^6.1.0",
68
68
  "@atlaskit/link": "^5.1.0",
69
69
  "@atlaskit/link-client-extension": "^8.0.0",
70
- "@atlaskit/link-provider": "^6.0.0",
70
+ "@atlaskit/link-provider": "^6.1.0",
71
71
  "@atlaskit/linking-common": "^13.0.0",
72
72
  "@atlaskit/linking-types": "^16.1.0",
73
73
  "@atlaskit/logo": "^23.3.0",
@@ -179,6 +179,9 @@
179
179
  "platform_lp_sllv_assets_default_schema_aql": {
180
180
  "type": "boolean"
181
181
  },
182
+ "astral_assets_default_page_size_100": {
183
+ "type": "boolean"
184
+ },
182
185
  "astral_assets_macro_table_ui_uplift": {
183
186
  "type": "boolean"
184
187
  },