@atlaskit/link-datasource 3.8.7 → 3.8.8

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.8
4
+
5
+ ### Patch Changes
6
+
7
+ - [#163413](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/163413)
8
+ [`85d906a810a1d`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/85d906a810a1d) -
9
+ Fix an issue where all columns don't load from server when picker is opened with React18
10
+
3
11
  ## 3.8.7
4
12
 
5
13
  ### Patch Changes
@@ -310,10 +310,10 @@ var IssueLikeDataTableView = exports.IssueLikeDataTableView = function IssueLike
310
310
  }
311
311
  }, [containerRef]);
312
312
  (0, _react.useEffect)(function () {
313
- if (!hasFullSchema) {
313
+ if (orderedColumns.length !== columns.length) {
314
314
  setOrderedColumns(getOrderedColumns((0, _toConsumableArray2.default)(columns), (0, _toConsumableArray2.default)(visibleColumnKeys)));
315
315
  }
316
- }, [columns, visibleColumnKeys, hasFullSchema]);
316
+ }, [columns, visibleColumnKeys, orderedColumns]);
317
317
  (0, _react.useEffect)(function () {
318
318
  if (experienceId && status === 'resolved') {
319
319
  (0, _ufoExperiences.succeedUfoExperience)({
@@ -602,6 +602,8 @@ var IssueLikeDataTableView = exports.IssueLikeDataTableView = function IssueLike
602
602
  }, _callee, null, [[3, 9]]);
603
603
  })), [experienceId, extensionKey, hasFullSchema, onLoadDatasourceDetails]);
604
604
  var isEditable = onVisibleColumnKeysChange && hasData;
605
+ var orderedColumnsAreUpToDate = orderedColumns.length === columns.length;
606
+ var shouldDisplayColumnsInPicker = hasFullSchema && orderedColumnsAreUpToDate;
605
607
  var view = (0, _react2.jsx)("div", {
606
608
  /* There is required contentEditable={true} in editor-card-plugin
607
609
  * But this brakes how DND works. We set contentEditable={false} to allow DND to work
@@ -693,8 +695,8 @@ var IssueLikeDataTableView = exports.IssueLikeDataTableView = function IssueLike
693
695
  }, heading);
694
696
  }
695
697
  }), onVisibleColumnKeysChange && (0, _react2.jsx)(ColumnPickerHeader, null, (0, _react2.jsx)(_columnPicker.ColumnPicker, {
696
- columns: hasFullSchema ? orderedColumns : [],
697
- selectedColumnKeys: hasFullSchema ? visibleColumnKeys : [],
698
+ columns: shouldDisplayColumnsInPicker ? orderedColumns : [],
699
+ selectedColumnKeys: shouldDisplayColumnsInPicker ? visibleColumnKeys : [],
698
700
  onSelectedColumnKeysChange: onSelectedColumnKeysChange,
699
701
  onOpen: handlePickerOpen
700
702
  })))), (0, _react2.jsx)("tbody", {
@@ -322,10 +322,10 @@ export const IssueLikeDataTableView = ({
322
322
  }
323
323
  }, [containerRef]);
324
324
  useEffect(() => {
325
- if (!hasFullSchema) {
325
+ if (orderedColumns.length !== columns.length) {
326
326
  setOrderedColumns(getOrderedColumns([...columns], [...visibleColumnKeys]));
327
327
  }
328
- }, [columns, visibleColumnKeys, hasFullSchema]);
328
+ }, [columns, visibleColumnKeys, orderedColumns]);
329
329
  useEffect(() => {
330
330
  if (experienceId && status === 'resolved') {
331
331
  succeedUfoExperience({
@@ -573,6 +573,8 @@ export const IssueLikeDataTableView = ({
573
573
  }
574
574
  }, [experienceId, extensionKey, hasFullSchema, onLoadDatasourceDetails]);
575
575
  const isEditable = onVisibleColumnKeysChange && hasData;
576
+ const orderedColumnsAreUpToDate = orderedColumns.length === columns.length;
577
+ const shouldDisplayColumnsInPicker = hasFullSchema && orderedColumnsAreUpToDate;
576
578
  const view = jsx("div", {
577
579
  /* There is required contentEditable={true} in editor-card-plugin
578
580
  * But this brakes how DND works. We set contentEditable={false} to allow DND to work
@@ -665,8 +667,8 @@ export const IssueLikeDataTableView = ({
665
667
  }, heading);
666
668
  }
667
669
  }), onVisibleColumnKeysChange && jsx(ColumnPickerHeader, null, jsx(ColumnPicker, {
668
- columns: hasFullSchema ? orderedColumns : [],
669
- selectedColumnKeys: hasFullSchema ? visibleColumnKeys : [],
670
+ columns: shouldDisplayColumnsInPicker ? orderedColumns : [],
671
+ selectedColumnKeys: shouldDisplayColumnsInPicker ? visibleColumnKeys : [],
670
672
  onSelectedColumnKeysChange: onSelectedColumnKeysChange,
671
673
  onOpen: handlePickerOpen
672
674
  })))), jsx("tbody", {
@@ -306,10 +306,10 @@ export var IssueLikeDataTableView = function IssueLikeDataTableView(_ref5) {
306
306
  }
307
307
  }, [containerRef]);
308
308
  useEffect(function () {
309
- if (!hasFullSchema) {
309
+ if (orderedColumns.length !== columns.length) {
310
310
  setOrderedColumns(getOrderedColumns(_toConsumableArray(columns), _toConsumableArray(visibleColumnKeys)));
311
311
  }
312
- }, [columns, visibleColumnKeys, hasFullSchema]);
312
+ }, [columns, visibleColumnKeys, orderedColumns]);
313
313
  useEffect(function () {
314
314
  if (experienceId && status === 'resolved') {
315
315
  succeedUfoExperience({
@@ -598,6 +598,8 @@ export var IssueLikeDataTableView = function IssueLikeDataTableView(_ref5) {
598
598
  }, _callee, null, [[3, 9]]);
599
599
  })), [experienceId, extensionKey, hasFullSchema, onLoadDatasourceDetails]);
600
600
  var isEditable = onVisibleColumnKeysChange && hasData;
601
+ var orderedColumnsAreUpToDate = orderedColumns.length === columns.length;
602
+ var shouldDisplayColumnsInPicker = hasFullSchema && orderedColumnsAreUpToDate;
601
603
  var view = jsx("div", {
602
604
  /* There is required contentEditable={true} in editor-card-plugin
603
605
  * But this brakes how DND works. We set contentEditable={false} to allow DND to work
@@ -689,8 +691,8 @@ export var IssueLikeDataTableView = function IssueLikeDataTableView(_ref5) {
689
691
  }, heading);
690
692
  }
691
693
  }), onVisibleColumnKeysChange && jsx(ColumnPickerHeader, null, jsx(ColumnPicker, {
692
- columns: hasFullSchema ? orderedColumns : [],
693
- selectedColumnKeys: hasFullSchema ? visibleColumnKeys : [],
694
+ columns: shouldDisplayColumnsInPicker ? orderedColumns : [],
695
+ selectedColumnKeys: shouldDisplayColumnsInPicker ? visibleColumnKeys : [],
694
696
  onSelectedColumnKeysChange: onSelectedColumnKeysChange,
695
697
  onOpen: handlePickerOpen
696
698
  })))), jsx("tbody", {
@@ -19,7 +19,7 @@ export interface DatasourceTableState {
19
19
  /** Resets state of the hook to be as if it is a first time it is being called. */
20
20
  reset: (options?: ResetOptions) => void;
21
21
  /** Requests the available column schemas that can be displayed within the table */
22
- loadDatasourceDetails: () => void;
22
+ loadDatasourceDetails: () => Promise<void>;
23
23
  /** Item ids to be hydrated from a store by consumers [NOTE: They must be in the same order as responseItems] */
24
24
  responseItemIds: string[];
25
25
  /** Items to be rendered within the table */
@@ -11,7 +11,7 @@ export interface RenderAssetsContentProps {
11
11
  schemaId?: string;
12
12
  onNextPage: () => void;
13
13
  hasNextPage: boolean;
14
- loadDatasourceDetails: () => void;
14
+ loadDatasourceDetails: () => Promise<void>;
15
15
  columns: DatasourceResponseSchemaProperty[];
16
16
  defaultVisibleColumnKeys: string[];
17
17
  onVisibleColumnKeysChange: (visibleColumnKeys: string[]) => void;
@@ -34,7 +34,7 @@ export interface IssueLikeDataTableViewProps {
34
34
  items: DatasourceDataResponseItem[];
35
35
  itemIds: string[];
36
36
  onNextPage: NextPageType;
37
- onLoadDatasourceDetails: () => void;
37
+ onLoadDatasourceDetails: () => Promise<void>;
38
38
  /**
39
39
  * A function to define new or override existing render components.
40
40
  * eg:
@@ -19,7 +19,7 @@ export interface DatasourceTableState {
19
19
  /** Resets state of the hook to be as if it is a first time it is being called. */
20
20
  reset: (options?: ResetOptions) => void;
21
21
  /** Requests the available column schemas that can be displayed within the table */
22
- loadDatasourceDetails: () => void;
22
+ loadDatasourceDetails: () => Promise<void>;
23
23
  /** Item ids to be hydrated from a store by consumers [NOTE: They must be in the same order as responseItems] */
24
24
  responseItemIds: string[];
25
25
  /** Items to be rendered within the table */
@@ -11,7 +11,7 @@ export interface RenderAssetsContentProps {
11
11
  schemaId?: string;
12
12
  onNextPage: () => void;
13
13
  hasNextPage: boolean;
14
- loadDatasourceDetails: () => void;
14
+ loadDatasourceDetails: () => Promise<void>;
15
15
  columns: DatasourceResponseSchemaProperty[];
16
16
  defaultVisibleColumnKeys: string[];
17
17
  onVisibleColumnKeysChange: (visibleColumnKeys: string[]) => void;
@@ -34,7 +34,7 @@ export interface IssueLikeDataTableViewProps {
34
34
  items: DatasourceDataResponseItem[];
35
35
  itemIds: string[];
36
36
  onNextPage: NextPageType;
37
- onLoadDatasourceDetails: () => void;
37
+ onLoadDatasourceDetails: () => Promise<void>;
38
38
  /**
39
39
  * A function to define new or override existing render components.
40
40
  * eg:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/link-datasource",
3
- "version": "3.8.7",
3
+ "version": "3.8.8",
4
4
  "description": "UI Components to support linking platform dataset feature",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",