@atlaskit/link-datasource 7.3.2 → 7.3.4

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,21 @@
1
1
  # @atlaskit/link-datasource
2
2
 
3
+ ## 7.3.4
4
+
5
+ ### Patch Changes
6
+
7
+ - [`11bc578982514`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/11bc578982514) -
8
+ Gate deduplication of datasource rows that share an ARI behind `platform_sllv_duplicated_row`.
9
+ - Updated dependencies
10
+
11
+ ## 7.3.3
12
+
13
+ ### Patch Changes
14
+
15
+ - [`481f10d4007ce`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/481f10d4007ce) -
16
+ Column header styles no longer leak into the column dropdown menu.
17
+ - Updated dependencies
18
+
3
19
  ## 7.3.2
4
20
 
5
21
  ### Patch Changes
@@ -13,6 +13,7 @@ var _react = require("react");
13
13
  var _isEqual = _interopRequireDefault(require("lodash/isEqual"));
14
14
  var _isFedramp = require("@atlaskit/atlassian-context/is-fedramp");
15
15
  var _useDataSourceClientExtension = require("@atlaskit/link-client-extension/use-data-source-client-extension");
16
+ var _fg = require("@atlaskit/platform-feature-flags/fg");
16
17
  var _analytics = require("../analytics");
17
18
  var _state = require("../state");
18
19
  var _useDiscoverActions2 = require("../state/actions/useDiscoverActions");
@@ -106,6 +107,7 @@ var useDatasourceTableState = exports.useDatasourceTableState = function useData
106
107
  providerName = _useState30[0],
107
108
  setProviderName = _useState30[1];
108
109
  var abortController = (0, _react.useRef)(new AbortController());
110
+ var responseItemAris = (0, _react.useRef)(new Set());
109
111
  var _useDatasourceClientE = (0, _useDataSourceClientExtension.useDatasourceClientExtension)(),
110
112
  getDatasourceData = _useDatasourceClientE.getDatasourceData,
111
113
  getDatasourceDetails = _useDatasourceClientE.getDatasourceDetails;
@@ -234,6 +236,8 @@ var useDatasourceTableState = exports.useDatasourceTableState = function useData
234
236
  nextPageCursor,
235
237
  _totalCount,
236
238
  schema,
239
+ isDuplicateRowDeduplicationEnabled,
240
+ itemsToAdd,
237
241
  integrationKey,
238
242
  entityType,
239
243
  newIds,
@@ -309,11 +313,27 @@ var useDatasourceTableState = exports.useDatasourceTableState = function useData
309
313
  setDestinationObjectTypes(_destinationObjectTypes);
310
314
  setTotalCount(_totalCount);
311
315
  setNextCursor(nextPageCursor);
316
+ isDuplicateRowDeduplicationEnabled = (0, _fg.fg)('platform_sllv_duplicated_row');
317
+ if (shouldRequestFirstPage && isDuplicateRowDeduplicationEnabled) {
318
+ responseItemAris.current.clear();
319
+ }
320
+ itemsToAdd = isDuplicateRowDeduplicationEnabled ? items.filter(function (item) {
321
+ var _item$ari;
322
+ var ari = (_item$ari = item.ari) === null || _item$ari === void 0 ? void 0 : _item$ari.data;
323
+ if (typeof ari !== 'string') {
324
+ return true;
325
+ }
326
+ if (responseItemAris.current.has(ari)) {
327
+ return false;
328
+ }
329
+ responseItemAris.current.add(ari);
330
+ return true;
331
+ }) : items;
312
332
  setResponseItems(function (currentResponseItems) {
313
333
  if (shouldRequestFirstPage) {
314
- return items;
334
+ return itemsToAdd;
315
335
  }
316
- return [].concat((0, _toConsumableArray2.default)(currentResponseItems), (0, _toConsumableArray2.default)(items));
336
+ return [].concat((0, _toConsumableArray2.default)(currentResponseItems), (0, _toConsumableArray2.default)(itemsToAdd));
317
337
  });
318
338
 
319
339
  /**
@@ -324,15 +344,15 @@ var useDatasourceTableState = exports.useDatasourceTableState = function useData
324
344
  * When `entityType` is undefined, we should not discover actions it prevents unnecessary requests to Actions service
325
345
  */
326
346
  entityType = objectTypesEntity;
327
- newIds = onAddItems(items, typeof integrationKey === 'string' ? integrationKey : undefined, entityType);
347
+ newIds = onAddItems(itemsToAdd, typeof integrationKey === 'string' ? integrationKey : undefined, entityType);
328
348
  setResponseItemIds(function (currentIds) {
329
- return [].concat((0, _toConsumableArray2.default)(currentIds), (0, _toConsumableArray2.default)(newIds));
349
+ return isDuplicateRowDeduplicationEnabled && shouldRequestFirstPage ? newIds : [].concat((0, _toConsumableArray2.default)(currentIds), (0, _toConsumableArray2.default)(newIds));
330
350
  });
331
351
  if (!(0, _isFedramp.isFedRamp)()) {
332
352
  if (typeof integrationKey === 'string') {
333
- aris = items.reduce(function (acc, item) {
334
- var _item$ari;
335
- return typeof ((_item$ari = item.ari) === null || _item$ari === void 0 ? void 0 : _item$ari.data) === 'string' ? [].concat((0, _toConsumableArray2.default)(acc), [item.ari.data]) : acc;
353
+ aris = itemsToAdd.reduce(function (acc, item) {
354
+ var _item$ari2;
355
+ return typeof ((_item$ari2 = item.ari) === null || _item$ari2 === void 0 ? void 0 : _item$ari2.data) === 'string' ? [].concat((0, _toConsumableArray2.default)(acc), [item.ari.data]) : acc;
336
356
  }, []);
337
357
  if (aris.length && entityType) {
338
358
  discoverActions({
@@ -357,7 +377,7 @@ var useDatasourceTableState = exports.useDatasourceTableState = function useData
357
377
  isUserLoadingNextPage = responseItems.length !== 0 && !shouldRequestFirstPage;
358
378
  if (isUserLoadingNextPage) {
359
379
  currentLoadedItemCount = responseItems.length;
360
- newlyLoadedItemCount = (items === null || items === void 0 ? void 0 : items.length) || 0;
380
+ newlyLoadedItemCount = itemsToAdd.length;
361
381
  fireEvent('track.nextItem.loaded', {
362
382
  extensionKey: _extensionKey,
363
383
  destinationObjectTypes: _destinationObjectTypes,
@@ -399,6 +419,7 @@ var useDatasourceTableState = exports.useDatasourceTableState = function useData
399
419
  }, _callee2, null, [[2, 6]]);
400
420
  })), [captureError, parameters, fieldKeys, nextCursor, responseItems, setResponseItemIds, onAddItems, getDatasourceData, datasourceId, applySchemaProperties, fireEvent, fullSchema, initialEmptyArray, discoverActions, isInPDFRender]);
401
421
  var reset = (0, _react.useCallback)(function (options) {
422
+ responseItemAris.current.clear();
402
423
  setResponseItems(initialEmptyArray);
403
424
  setResponseItemIds(initialEmptyArray);
404
425
  setHasNextPage(true);
@@ -3,7 +3,7 @@
3
3
  ._1tesidpf:before{inset:0}
4
4
  ._pdyk1hrg:before{transition:opacity .2s ease}
5
5
  .pm-table-wrapper>table thead ._1u3bidpf{border:0}
6
- ._1wtnze3t button{padding-block:var(--ds-space-0,0)}.ProseMirror .pm-table-wrapper>table thead ._1fqk1uh4{border-bottom:var(--ds-border-width-selected,2px) solid var(--ds-border,#0b120e24)}
6
+ ._lkcqze3t button:not(:where([popover],dialog,._lkcqze3t :is([popover],dialog) *)){padding-block:var(--ds-space-0,0)}.ProseMirror .pm-table-wrapper>table thead ._1fqk1uh4{border-bottom:var(--ds-border-width-selected,2px) solid var(--ds-border,#0b120e24)}
7
7
  .ProseMirror .pm-table-wrapper>table thead ._1o9m1gk9{border-right:.5px solid var(--ds-border,#0b120e24)}
8
8
  .ProseMirror .pm-table-wrapper>table thead ._ocbzidpf:last-of-type{border-right:0}
9
9
  .ProseMirror .pm-table-wrapper>table thead.has-column-picker ._1hkzidpf:nth-last-of-type(2){border-right:0}
@@ -26,9 +26,9 @@ thead.has-column-picker ._10i2idpf:nth-last-of-type(2){border-right:0}
26
26
  .ProseMirror .pm-table-wrapper>table thead ._qccgqagn{height:calc(50px + var(--ds-space-025, 2px)*4)}
27
27
  .ProseMirror .pm-table-wrapper>table thead ._rc4eh2mm{position:relative}
28
28
  .ProseMirror .pm-table-wrapper>table thead ._s99e1tcg{line-height:24px}
29
+ ._10bx1wug button:not(:where([popover],dialog,._10bx1wug :is([popover],dialog) *)){height:auto}
29
30
  ._11681tcg [data-testid=datasource-header-content--container]{line-height:24px}
30
31
  ._11j11b66 [data-testid=datasource-header-content--container]{padding-right:var(--ds-space-050,4px)}
31
- ._11lvze3t button{padding-left:var(--ds-space-0,0)}
32
32
  ._12pn15vq [data-testid=datasource-header-content--container]{overflow-x:hidden}
33
33
  ._154iidpf{top:0}
34
34
  ._154pidpf:before{opacity:0}
@@ -42,11 +42,13 @@ thead.has-column-picker ._10i2idpf:nth-last-of-type(2){border-right:0}
42
42
  ._1ct3kb7n:hover._1ct3kb7n:before{opacity:1}
43
43
  ._1e0c1txw{display:flex}
44
44
  ._1eqz4jg8 [data-testid=datasource-header-content--container]{white-space:normal}
45
+ ._1igz1e5h button:not(:where([popover],dialog,._1igz1e5h :is([popover],dialog) *)){text-align:left}
45
46
  ._1kt9b3bt:before{content:""}
46
47
  ._1lhc1b66:first-of-type{padding-left:var(--ds-space-050,4px)}
47
48
  ._1ltvidpf{left:0}
48
49
  ._1mp4atg7:before{width:var(--local-line-width)}
49
50
  ._1nd0cs5v [data-testid=datasource-header-content--container]{-webkit-line-clamp:2}
51
+ ._1ohpze3t button:not(:where([popover],dialog,._1ohpze3t :is([popover],dialog) *)){padding-left:var(--ds-space-0,0)}
50
52
  ._1pbykb7n{z-index:1}
51
53
  ._1rusa755:before{background-color:var(--ds-border-brand,#1868db)}
52
54
  ._1t0u1e54 [data-testid=datasource-header-content--container]{-webkit-box-orient:vertical}
@@ -59,13 +61,12 @@ thead.has-column-picker ._10i2idpf:nth-last-of-type(2){border-right:0}
59
61
  ._80omn7od{cursor:unset}
60
62
  ._8lvj1b66 [data-testid=datasource-header-content--container]{padding-left:var(--ds-space-050,4px)}
61
63
  ._95ex1hna [data-testid=datasource-header-content--container]{word-wrap:break-word}
64
+ ._a5ewze3t button:not(:where([popover],dialog,._a5ewze3t :is([popover],dialog) *)){padding-right:var(--ds-space-0,0)}
62
65
  ._ab8av77o [data-testid=datasource-header-content--container]{padding-top:var(--ds-space-025,2px)}
63
66
  ._bfhkchd4{background-color:var(--ds-elevation-surface-current,#fff)}
64
67
  ._ca0qv77o{padding-top:var(--ds-space-025,2px)}
65
68
  ._dydke4h9:before{--local-line-width:var(--ds-border-width,1px)}
66
- ._ficf1e5h button{text-align:left}
67
69
  ._iscccj1k [data-testid=datasource-header-content--container]{display:-webkit-box}
68
- ._jq8g1wug button{height:auto}
69
70
  ._kqswh2mm{position:relative}
70
71
  ._kqswstnw{position:absolute}
71
72
  ._lcxvglyw{pointer-events:none}
@@ -77,7 +78,6 @@ thead.has-column-picker ._10i2idpf:nth-last-of-type(2){border-right:0}
77
78
  ._u5f31b66{padding-right:var(--ds-space-050,4px)}
78
79
  ._vchhusvi{box-sizing:border-box}
79
80
  ._vwz41tcg{line-height:24px}
80
- ._yhjmze3t button{padding-right:var(--ds-space-0,0)}
81
81
  .pm-table-wrapper>table thead ._11ep1b66{padding-right:var(--ds-space-050,4px)}
82
82
  .pm-table-wrapper>table thead ._15hu1b66{padding-left:var(--ds-space-050,4px)}
83
83
  .pm-table-wrapper>table thead ._191qv77o{padding-bottom:var(--ds-space-025,2px)}
@@ -70,7 +70,7 @@ var DropdownParent = (0, _react.forwardRef)(function (_ref2, __cmplr) {
70
70
  return /*#__PURE__*/React.createElement(C, (0, _extends2.default)({}, __cmplp, {
71
71
  style: __cmpls,
72
72
  ref: __cmplr,
73
- className: (0, _runtime.ax)(["_1e0c1txw _4cvr1h6o _o5721q9c _1wtnze3t _ficf1e5h _jq8g1wug _11lvze3t _yhjmze3t", __cmplp.className])
73
+ className: (0, _runtime.ax)(["_1e0c1txw _4cvr1h6o _o5721q9c _lkcqze3t _1igz1e5h _10bx1wug _1ohpze3t _a5ewze3t", __cmplp.className])
74
74
  }));
75
75
  });
76
76
  if (process.env.NODE_ENV !== 'production') {
@@ -2,6 +2,7 @@ import { useCallback, useEffect, useRef, useState } from 'react';
2
2
  import isEqual from 'lodash/isEqual';
3
3
  import { isFedRamp } from '@atlaskit/atlassian-context/is-fedramp';
4
4
  import { DEFAULT_GET_DATASOURCE_DATA_PAGE_SIZE, useDatasourceClientExtension } from '@atlaskit/link-client-extension/use-data-source-client-extension';
5
+ import { fg } from '@atlaskit/platform-feature-flags/fg';
5
6
  import { useDatasourceAnalyticsEvents } from '../analytics';
6
7
  import { useDatasourceActions } from '../state';
7
8
  import { useDiscoverActions } from '../state/actions/useDiscoverActions';
@@ -52,6 +53,7 @@ export const useDatasourceTableState = ({
52
53
  const [extensionKey, setExtensionKey] = useState();
53
54
  const [providerName, setProviderName] = useState(undefined);
54
55
  const abortController = useRef(new AbortController());
56
+ const responseItemAris = useRef(new Set());
55
57
  const {
56
58
  getDatasourceData,
57
59
  getDatasourceDetails
@@ -192,11 +194,27 @@ export const useDatasourceTableState = ({
192
194
  setDestinationObjectTypes(destinationObjectTypes);
193
195
  setTotalCount(totalCount);
194
196
  setNextCursor(nextPageCursor);
197
+ const isDuplicateRowDeduplicationEnabled = fg('platform_sllv_duplicated_row');
198
+ if (shouldRequestFirstPage && isDuplicateRowDeduplicationEnabled) {
199
+ responseItemAris.current.clear();
200
+ }
201
+ const itemsToAdd = isDuplicateRowDeduplicationEnabled ? items.filter(item => {
202
+ var _item$ari;
203
+ const ari = (_item$ari = item.ari) === null || _item$ari === void 0 ? void 0 : _item$ari.data;
204
+ if (typeof ari !== 'string') {
205
+ return true;
206
+ }
207
+ if (responseItemAris.current.has(ari)) {
208
+ return false;
209
+ }
210
+ responseItemAris.current.add(ari);
211
+ return true;
212
+ }) : items;
195
213
  setResponseItems(currentResponseItems => {
196
214
  if (shouldRequestFirstPage) {
197
- return items;
215
+ return itemsToAdd;
198
216
  }
199
- return [...currentResponseItems, ...items];
217
+ return [...currentResponseItems, ...itemsToAdd];
200
218
  });
201
219
 
202
220
  /**
@@ -208,13 +226,13 @@ export const useDatasourceTableState = ({
208
226
  * When `entityType` is undefined, we should not discover actions it prevents unnecessary requests to Actions service
209
227
  */
210
228
  const entityType = objectTypesEntity;
211
- const newIds = onAddItems(items, typeof integrationKey === 'string' ? integrationKey : undefined, entityType);
212
- setResponseItemIds(currentIds => [...currentIds, ...newIds]);
229
+ const newIds = onAddItems(itemsToAdd, typeof integrationKey === 'string' ? integrationKey : undefined, entityType);
230
+ setResponseItemIds(currentIds => isDuplicateRowDeduplicationEnabled && shouldRequestFirstPage ? newIds : [...currentIds, ...newIds]);
213
231
  if (!isFedRamp()) {
214
232
  if (typeof integrationKey === 'string') {
215
- const aris = items.reduce((acc, item) => {
216
- var _item$ari;
217
- return typeof ((_item$ari = item.ari) === null || _item$ari === void 0 ? void 0 : _item$ari.data) === 'string' ? [...acc, item.ari.data] : acc;
233
+ const aris = itemsToAdd.reduce((acc, item) => {
234
+ var _item$ari2;
235
+ return typeof ((_item$ari2 = item.ari) === null || _item$ari2 === void 0 ? void 0 : _item$ari2.data) === 'string' ? [...acc, item.ari.data] : acc;
218
236
  }, []);
219
237
  if (aris.length && entityType) {
220
238
  discoverActions({
@@ -239,7 +257,7 @@ export const useDatasourceTableState = ({
239
257
  const isUserLoadingNextPage = responseItems.length !== 0 && !shouldRequestFirstPage;
240
258
  if (isUserLoadingNextPage) {
241
259
  const currentLoadedItemCount = responseItems.length;
242
- const newlyLoadedItemCount = (items === null || items === void 0 ? void 0 : items.length) || 0;
260
+ const newlyLoadedItemCount = itemsToAdd.length;
243
261
  fireEvent('track.nextItem.loaded', {
244
262
  extensionKey,
245
263
  destinationObjectTypes,
@@ -270,6 +288,7 @@ export const useDatasourceTableState = ({
270
288
  }
271
289
  }, [captureError, parameters, fieldKeys, nextCursor, responseItems, setResponseItemIds, onAddItems, getDatasourceData, datasourceId, applySchemaProperties, fireEvent, fullSchema, initialEmptyArray, discoverActions, isInPDFRender]);
272
290
  const reset = useCallback(options => {
291
+ responseItemAris.current.clear();
273
292
  setResponseItems(initialEmptyArray);
274
293
  setResponseItemIds(initialEmptyArray);
275
294
  setHasNextPage(true);
@@ -3,7 +3,7 @@
3
3
  ._1tesidpf:before{inset:0}
4
4
  ._pdyk1hrg:before{transition:opacity .2s ease}
5
5
  .pm-table-wrapper>table thead ._1u3bidpf{border:0}
6
- ._1wtnze3t button{padding-block:var(--ds-space-0,0)}.ProseMirror .pm-table-wrapper>table thead ._1fqk1uh4{border-bottom:var(--ds-border-width-selected,2px) solid var(--ds-border,#0b120e24)}
6
+ ._lkcqze3t button:not(:where([popover],dialog,._lkcqze3t :is([popover],dialog) *)){padding-block:var(--ds-space-0,0)}.ProseMirror .pm-table-wrapper>table thead ._1fqk1uh4{border-bottom:var(--ds-border-width-selected,2px) solid var(--ds-border,#0b120e24)}
7
7
  .ProseMirror .pm-table-wrapper>table thead ._1o9m1gk9{border-right:.5px solid var(--ds-border,#0b120e24)}
8
8
  .ProseMirror .pm-table-wrapper>table thead ._ocbzidpf:last-of-type{border-right:0}
9
9
  .ProseMirror .pm-table-wrapper>table thead.has-column-picker ._1hkzidpf:nth-last-of-type(2){border-right:0}
@@ -26,9 +26,9 @@ thead.has-column-picker ._10i2idpf:nth-last-of-type(2){border-right:0}
26
26
  .ProseMirror .pm-table-wrapper>table thead ._qccgqagn{height:calc(50px + var(--ds-space-025, 2px)*4)}
27
27
  .ProseMirror .pm-table-wrapper>table thead ._rc4eh2mm{position:relative}
28
28
  .ProseMirror .pm-table-wrapper>table thead ._s99e1tcg{line-height:24px}
29
+ ._10bx1wug button:not(:where([popover],dialog,._10bx1wug :is([popover],dialog) *)){height:auto}
29
30
  ._11681tcg [data-testid=datasource-header-content--container]{line-height:24px}
30
31
  ._11j11b66 [data-testid=datasource-header-content--container]{padding-right:var(--ds-space-050,4px)}
31
- ._11lvze3t button{padding-left:var(--ds-space-0,0)}
32
32
  ._12pn15vq [data-testid=datasource-header-content--container]{overflow-x:hidden}
33
33
  ._154iidpf{top:0}
34
34
  ._154pidpf:before{opacity:0}
@@ -42,11 +42,13 @@ thead.has-column-picker ._10i2idpf:nth-last-of-type(2){border-right:0}
42
42
  ._1ct3kb7n:hover._1ct3kb7n:before{opacity:1}
43
43
  ._1e0c1txw{display:flex}
44
44
  ._1eqz4jg8 [data-testid=datasource-header-content--container]{white-space:normal}
45
+ ._1igz1e5h button:not(:where([popover],dialog,._1igz1e5h :is([popover],dialog) *)){text-align:left}
45
46
  ._1kt9b3bt:before{content:""}
46
47
  ._1lhc1b66:first-of-type{padding-left:var(--ds-space-050,4px)}
47
48
  ._1ltvidpf{left:0}
48
49
  ._1mp4atg7:before{width:var(--local-line-width)}
49
50
  ._1nd0cs5v [data-testid=datasource-header-content--container]{-webkit-line-clamp:2}
51
+ ._1ohpze3t button:not(:where([popover],dialog,._1ohpze3t :is([popover],dialog) *)){padding-left:var(--ds-space-0,0)}
50
52
  ._1pbykb7n{z-index:1}
51
53
  ._1rusa755:before{background-color:var(--ds-border-brand,#1868db)}
52
54
  ._1t0u1e54 [data-testid=datasource-header-content--container]{-webkit-box-orient:vertical}
@@ -59,13 +61,12 @@ thead.has-column-picker ._10i2idpf:nth-last-of-type(2){border-right:0}
59
61
  ._80omn7od{cursor:unset}
60
62
  ._8lvj1b66 [data-testid=datasource-header-content--container]{padding-left:var(--ds-space-050,4px)}
61
63
  ._95ex1hna [data-testid=datasource-header-content--container]{word-wrap:break-word}
64
+ ._a5ewze3t button:not(:where([popover],dialog,._a5ewze3t :is([popover],dialog) *)){padding-right:var(--ds-space-0,0)}
62
65
  ._ab8av77o [data-testid=datasource-header-content--container]{padding-top:var(--ds-space-025,2px)}
63
66
  ._bfhkchd4{background-color:var(--ds-elevation-surface-current,#fff)}
64
67
  ._ca0qv77o{padding-top:var(--ds-space-025,2px)}
65
68
  ._dydke4h9:before{--local-line-width:var(--ds-border-width,1px)}
66
- ._ficf1e5h button{text-align:left}
67
69
  ._iscccj1k [data-testid=datasource-header-content--container]{display:-webkit-box}
68
- ._jq8g1wug button{height:auto}
69
70
  ._kqswh2mm{position:relative}
70
71
  ._kqswstnw{position:absolute}
71
72
  ._lcxvglyw{pointer-events:none}
@@ -77,7 +78,6 @@ thead.has-column-picker ._10i2idpf:nth-last-of-type(2){border-right:0}
77
78
  ._u5f31b66{padding-right:var(--ds-space-050,4px)}
78
79
  ._vchhusvi{box-sizing:border-box}
79
80
  ._vwz41tcg{line-height:24px}
80
- ._yhjmze3t button{padding-right:var(--ds-space-0,0)}
81
81
  .pm-table-wrapper>table thead ._11ep1b66{padding-right:var(--ds-space-050,4px)}
82
82
  .pm-table-wrapper>table thead ._15hu1b66{padding-left:var(--ds-space-050,4px)}
83
83
  .pm-table-wrapper>table thead ._191qv77o{padding-bottom:var(--ds-space-025,2px)}
@@ -56,7 +56,7 @@ const DropdownParent = forwardRef(({
56
56
  return /*#__PURE__*/React.createElement(C, _extends({}, __cmplp, {
57
57
  style: __cmpls,
58
58
  ref: __cmplr,
59
- className: ax(["_1e0c1txw _4cvr1h6o _o5721q9c _1wtnze3t _ficf1e5h _jq8g1wug _11lvze3t _yhjmze3t", __cmplp.className])
59
+ className: ax(["_1e0c1txw _4cvr1h6o _o5721q9c _lkcqze3t _1igz1e5h _10bx1wug _1ohpze3t _a5ewze3t", __cmplp.className])
60
60
  }));
61
61
  });
62
62
  if (process.env.NODE_ENV !== 'production') {
@@ -6,6 +6,7 @@ import { useCallback, useEffect, useRef, useState } from 'react';
6
6
  import isEqual from 'lodash/isEqual';
7
7
  import { isFedRamp } from '@atlaskit/atlassian-context/is-fedramp';
8
8
  import { DEFAULT_GET_DATASOURCE_DATA_PAGE_SIZE, useDatasourceClientExtension } from '@atlaskit/link-client-extension/use-data-source-client-extension';
9
+ import { fg } from '@atlaskit/platform-feature-flags/fg';
9
10
  import { useDatasourceAnalyticsEvents } from '../analytics';
10
11
  import { useDatasourceActions } from '../state';
11
12
  import { useDiscoverActions } from '../state/actions/useDiscoverActions';
@@ -99,6 +100,7 @@ export var useDatasourceTableState = function useDatasourceTableState(_ref) {
99
100
  providerName = _useState30[0],
100
101
  setProviderName = _useState30[1];
101
102
  var abortController = useRef(new AbortController());
103
+ var responseItemAris = useRef(new Set());
102
104
  var _useDatasourceClientE = useDatasourceClientExtension(),
103
105
  getDatasourceData = _useDatasourceClientE.getDatasourceData,
104
106
  getDatasourceDetails = _useDatasourceClientE.getDatasourceDetails;
@@ -227,6 +229,8 @@ export var useDatasourceTableState = function useDatasourceTableState(_ref) {
227
229
  nextPageCursor,
228
230
  _totalCount,
229
231
  schema,
232
+ isDuplicateRowDeduplicationEnabled,
233
+ itemsToAdd,
230
234
  integrationKey,
231
235
  entityType,
232
236
  newIds,
@@ -302,11 +306,27 @@ export var useDatasourceTableState = function useDatasourceTableState(_ref) {
302
306
  setDestinationObjectTypes(_destinationObjectTypes);
303
307
  setTotalCount(_totalCount);
304
308
  setNextCursor(nextPageCursor);
309
+ isDuplicateRowDeduplicationEnabled = fg('platform_sllv_duplicated_row');
310
+ if (shouldRequestFirstPage && isDuplicateRowDeduplicationEnabled) {
311
+ responseItemAris.current.clear();
312
+ }
313
+ itemsToAdd = isDuplicateRowDeduplicationEnabled ? items.filter(function (item) {
314
+ var _item$ari;
315
+ var ari = (_item$ari = item.ari) === null || _item$ari === void 0 ? void 0 : _item$ari.data;
316
+ if (typeof ari !== 'string') {
317
+ return true;
318
+ }
319
+ if (responseItemAris.current.has(ari)) {
320
+ return false;
321
+ }
322
+ responseItemAris.current.add(ari);
323
+ return true;
324
+ }) : items;
305
325
  setResponseItems(function (currentResponseItems) {
306
326
  if (shouldRequestFirstPage) {
307
- return items;
327
+ return itemsToAdd;
308
328
  }
309
- return [].concat(_toConsumableArray(currentResponseItems), _toConsumableArray(items));
329
+ return [].concat(_toConsumableArray(currentResponseItems), _toConsumableArray(itemsToAdd));
310
330
  });
311
331
 
312
332
  /**
@@ -317,15 +337,15 @@ export var useDatasourceTableState = function useDatasourceTableState(_ref) {
317
337
  * When `entityType` is undefined, we should not discover actions it prevents unnecessary requests to Actions service
318
338
  */
319
339
  entityType = objectTypesEntity;
320
- newIds = onAddItems(items, typeof integrationKey === 'string' ? integrationKey : undefined, entityType);
340
+ newIds = onAddItems(itemsToAdd, typeof integrationKey === 'string' ? integrationKey : undefined, entityType);
321
341
  setResponseItemIds(function (currentIds) {
322
- return [].concat(_toConsumableArray(currentIds), _toConsumableArray(newIds));
342
+ return isDuplicateRowDeduplicationEnabled && shouldRequestFirstPage ? newIds : [].concat(_toConsumableArray(currentIds), _toConsumableArray(newIds));
323
343
  });
324
344
  if (!isFedRamp()) {
325
345
  if (typeof integrationKey === 'string') {
326
- aris = items.reduce(function (acc, item) {
327
- var _item$ari;
328
- return typeof ((_item$ari = item.ari) === null || _item$ari === void 0 ? void 0 : _item$ari.data) === 'string' ? [].concat(_toConsumableArray(acc), [item.ari.data]) : acc;
346
+ aris = itemsToAdd.reduce(function (acc, item) {
347
+ var _item$ari2;
348
+ return typeof ((_item$ari2 = item.ari) === null || _item$ari2 === void 0 ? void 0 : _item$ari2.data) === 'string' ? [].concat(_toConsumableArray(acc), [item.ari.data]) : acc;
329
349
  }, []);
330
350
  if (aris.length && entityType) {
331
351
  discoverActions({
@@ -350,7 +370,7 @@ export var useDatasourceTableState = function useDatasourceTableState(_ref) {
350
370
  isUserLoadingNextPage = responseItems.length !== 0 && !shouldRequestFirstPage;
351
371
  if (isUserLoadingNextPage) {
352
372
  currentLoadedItemCount = responseItems.length;
353
- newlyLoadedItemCount = (items === null || items === void 0 ? void 0 : items.length) || 0;
373
+ newlyLoadedItemCount = itemsToAdd.length;
354
374
  fireEvent('track.nextItem.loaded', {
355
375
  extensionKey: _extensionKey,
356
376
  destinationObjectTypes: _destinationObjectTypes,
@@ -392,6 +412,7 @@ export var useDatasourceTableState = function useDatasourceTableState(_ref) {
392
412
  }, _callee2, null, [[2, 6]]);
393
413
  })), [captureError, parameters, fieldKeys, nextCursor, responseItems, setResponseItemIds, onAddItems, getDatasourceData, datasourceId, applySchemaProperties, fireEvent, fullSchema, initialEmptyArray, discoverActions, isInPDFRender]);
394
414
  var reset = useCallback(function (options) {
415
+ responseItemAris.current.clear();
395
416
  setResponseItems(initialEmptyArray);
396
417
  setResponseItemIds(initialEmptyArray);
397
418
  setHasNextPage(true);
@@ -3,7 +3,7 @@
3
3
  ._1tesidpf:before{inset:0}
4
4
  ._pdyk1hrg:before{transition:opacity .2s ease}
5
5
  .pm-table-wrapper>table thead ._1u3bidpf{border:0}
6
- ._1wtnze3t button{padding-block:var(--ds-space-0,0)}.ProseMirror .pm-table-wrapper>table thead ._1fqk1uh4{border-bottom:var(--ds-border-width-selected,2px) solid var(--ds-border,#0b120e24)}
6
+ ._lkcqze3t button:not(:where([popover],dialog,._lkcqze3t :is([popover],dialog) *)){padding-block:var(--ds-space-0,0)}.ProseMirror .pm-table-wrapper>table thead ._1fqk1uh4{border-bottom:var(--ds-border-width-selected,2px) solid var(--ds-border,#0b120e24)}
7
7
  .ProseMirror .pm-table-wrapper>table thead ._1o9m1gk9{border-right:.5px solid var(--ds-border,#0b120e24)}
8
8
  .ProseMirror .pm-table-wrapper>table thead ._ocbzidpf:last-of-type{border-right:0}
9
9
  .ProseMirror .pm-table-wrapper>table thead.has-column-picker ._1hkzidpf:nth-last-of-type(2){border-right:0}
@@ -26,9 +26,9 @@ thead.has-column-picker ._10i2idpf:nth-last-of-type(2){border-right:0}
26
26
  .ProseMirror .pm-table-wrapper>table thead ._qccgqagn{height:calc(50px + var(--ds-space-025, 2px)*4)}
27
27
  .ProseMirror .pm-table-wrapper>table thead ._rc4eh2mm{position:relative}
28
28
  .ProseMirror .pm-table-wrapper>table thead ._s99e1tcg{line-height:24px}
29
+ ._10bx1wug button:not(:where([popover],dialog,._10bx1wug :is([popover],dialog) *)){height:auto}
29
30
  ._11681tcg [data-testid=datasource-header-content--container]{line-height:24px}
30
31
  ._11j11b66 [data-testid=datasource-header-content--container]{padding-right:var(--ds-space-050,4px)}
31
- ._11lvze3t button{padding-left:var(--ds-space-0,0)}
32
32
  ._12pn15vq [data-testid=datasource-header-content--container]{overflow-x:hidden}
33
33
  ._154iidpf{top:0}
34
34
  ._154pidpf:before{opacity:0}
@@ -42,11 +42,13 @@ thead.has-column-picker ._10i2idpf:nth-last-of-type(2){border-right:0}
42
42
  ._1ct3kb7n:hover._1ct3kb7n:before{opacity:1}
43
43
  ._1e0c1txw{display:flex}
44
44
  ._1eqz4jg8 [data-testid=datasource-header-content--container]{white-space:normal}
45
+ ._1igz1e5h button:not(:where([popover],dialog,._1igz1e5h :is([popover],dialog) *)){text-align:left}
45
46
  ._1kt9b3bt:before{content:""}
46
47
  ._1lhc1b66:first-of-type{padding-left:var(--ds-space-050,4px)}
47
48
  ._1ltvidpf{left:0}
48
49
  ._1mp4atg7:before{width:var(--local-line-width)}
49
50
  ._1nd0cs5v [data-testid=datasource-header-content--container]{-webkit-line-clamp:2}
51
+ ._1ohpze3t button:not(:where([popover],dialog,._1ohpze3t :is([popover],dialog) *)){padding-left:var(--ds-space-0,0)}
50
52
  ._1pbykb7n{z-index:1}
51
53
  ._1rusa755:before{background-color:var(--ds-border-brand,#1868db)}
52
54
  ._1t0u1e54 [data-testid=datasource-header-content--container]{-webkit-box-orient:vertical}
@@ -59,13 +61,12 @@ thead.has-column-picker ._10i2idpf:nth-last-of-type(2){border-right:0}
59
61
  ._80omn7od{cursor:unset}
60
62
  ._8lvj1b66 [data-testid=datasource-header-content--container]{padding-left:var(--ds-space-050,4px)}
61
63
  ._95ex1hna [data-testid=datasource-header-content--container]{word-wrap:break-word}
64
+ ._a5ewze3t button:not(:where([popover],dialog,._a5ewze3t :is([popover],dialog) *)){padding-right:var(--ds-space-0,0)}
62
65
  ._ab8av77o [data-testid=datasource-header-content--container]{padding-top:var(--ds-space-025,2px)}
63
66
  ._bfhkchd4{background-color:var(--ds-elevation-surface-current,#fff)}
64
67
  ._ca0qv77o{padding-top:var(--ds-space-025,2px)}
65
68
  ._dydke4h9:before{--local-line-width:var(--ds-border-width,1px)}
66
- ._ficf1e5h button{text-align:left}
67
69
  ._iscccj1k [data-testid=datasource-header-content--container]{display:-webkit-box}
68
- ._jq8g1wug button{height:auto}
69
70
  ._kqswh2mm{position:relative}
70
71
  ._kqswstnw{position:absolute}
71
72
  ._lcxvglyw{pointer-events:none}
@@ -77,7 +78,6 @@ thead.has-column-picker ._10i2idpf:nth-last-of-type(2){border-right:0}
77
78
  ._u5f31b66{padding-right:var(--ds-space-050,4px)}
78
79
  ._vchhusvi{box-sizing:border-box}
79
80
  ._vwz41tcg{line-height:24px}
80
- ._yhjmze3t button{padding-right:var(--ds-space-0,0)}
81
81
  .pm-table-wrapper>table thead ._11ep1b66{padding-right:var(--ds-space-050,4px)}
82
82
  .pm-table-wrapper>table thead ._15hu1b66{padding-left:var(--ds-space-050,4px)}
83
83
  .pm-table-wrapper>table thead ._191qv77o{padding-bottom:var(--ds-space-025,2px)}
@@ -64,7 +64,7 @@ var DropdownParent = forwardRef(function (_ref2, __cmplr) {
64
64
  return /*#__PURE__*/React.createElement(C, _extends({}, __cmplp, {
65
65
  style: __cmpls,
66
66
  ref: __cmplr,
67
- className: ax(["_1e0c1txw _4cvr1h6o _o5721q9c _1wtnze3t _ficf1e5h _jq8g1wug _11lvze3t _yhjmze3t", __cmplp.className])
67
+ className: ax(["_1e0c1txw _4cvr1h6o _o5721q9c _lkcqze3t _1igz1e5h _10bx1wug _1ohpze3t _a5ewze3t", __cmplp.className])
68
68
  }));
69
69
  });
70
70
  if (process.env.NODE_ENV !== 'production') {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/link-datasource",
3
- "version": "7.3.2",
3
+ "version": "7.3.4",
4
4
  "description": "UI Components to support linking platform dataset feature",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -41,20 +41,20 @@
41
41
  "@atlaskit/adf-schema": "^57.7.0",
42
42
  "@atlaskit/afm-i18n-platform-linking-platform-link-datasource": "2.271.0",
43
43
  "@atlaskit/analytics-cross-product": "^2.2.0",
44
- "@atlaskit/analytics-next": "^12.5.0",
44
+ "@atlaskit/analytics-next": "^12.6.0",
45
45
  "@atlaskit/atlassian-context": "^2.0.0",
46
46
  "@atlaskit/avatar": "^30.0.0",
47
47
  "@atlaskit/avatar-group": "^14.4.0",
48
48
  "@atlaskit/badge": "^22.0.0",
49
49
  "@atlaskit/button": "^25.4.0",
50
50
  "@atlaskit/css": "^1.1.0",
51
- "@atlaskit/datetime-picker": "^19.1.0",
51
+ "@atlaskit/datetime-picker": "^19.3.0",
52
52
  "@atlaskit/dropdown-menu": "^21.0.0",
53
53
  "@atlaskit/editor-prosemirror": "^9.0.0",
54
54
  "@atlaskit/empty-state": "^12.2.0",
55
55
  "@atlaskit/feature-gate-js-client": "^7.0.0",
56
56
  "@atlaskit/flag": "^19.0.0",
57
- "@atlaskit/form": "^18.1.0",
57
+ "@atlaskit/form": "^18.2.0",
58
58
  "@atlaskit/heading": "^8.0.0",
59
59
  "@atlaskit/icon": "^38.0.0",
60
60
  "@atlaskit/image": "^5.2.0",
@@ -174,6 +174,9 @@
174
174
  "platform_lp_sllv_table_settings_menu": {
175
175
  "type": "boolean"
176
176
  },
177
+ "platform_sllv_duplicated_row": {
178
+ "type": "boolean"
179
+ },
177
180
  "astral_units_workspace_host_resolver": {
178
181
  "type": "boolean"
179
182
  },