@atlaskit/link-datasource 3.8.6 → 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,21 @@
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
+
11
+ ## 3.8.7
12
+
13
+ ### Patch Changes
14
+
15
+ - [`f72c22d3b02b0`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/f72c22d3b02b0) -
16
+ The changes here updates the default width, and adds a min-width to the Priority column in Jira
17
+ SLLV.
18
+
3
19
  ## 3.8.6
4
20
 
5
21
  ### Patch Changes
@@ -16,9 +16,6 @@ var _lozenge = _interopRequireDefault(require("@atlaskit/lozenge"));
16
16
  var _select = _interopRequireDefault(require("@atlaskit/select"));
17
17
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
18
18
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
19
- // FilterOptionOption is used in the filterOption function which is part of the public API, but the type itself is not exported
20
- // eslint-disable-next-line import/no-extraneous-dependencies,no-restricted-imports
21
-
22
19
  var StatusEditType = function StatusEditType(props) {
23
20
  var _currentValue$values;
24
21
  var currentValue = props.currentValue,
@@ -233,7 +233,8 @@ var getOrderedColumns = exports.getOrderedColumns = function getOrderedColumns(c
233
233
  };
234
234
  var DEFAULT_WIDTH = _utils.COLUMN_BASE_WIDTH * 22;
235
235
  var keyBasedWidthMap = {
236
- priority: _utils.COLUMN_BASE_WIDTH * 8,
236
+ priority: _utils.COLUMN_BASE_WIDTH * 13.75,
237
+ // 110px
237
238
  status: _utils.COLUMN_BASE_WIDTH * 15,
238
239
  summary: _utils.COLUMN_BASE_WIDTH * 45,
239
240
  description: _utils.COLUMN_BASE_WIDTH * 31,
@@ -309,10 +310,10 @@ var IssueLikeDataTableView = exports.IssueLikeDataTableView = function IssueLike
309
310
  }
310
311
  }, [containerRef]);
311
312
  (0, _react.useEffect)(function () {
312
- if (!hasFullSchema) {
313
+ if (orderedColumns.length !== columns.length) {
313
314
  setOrderedColumns(getOrderedColumns((0, _toConsumableArray2.default)(columns), (0, _toConsumableArray2.default)(visibleColumnKeys)));
314
315
  }
315
- }, [columns, visibleColumnKeys, hasFullSchema]);
316
+ }, [columns, visibleColumnKeys, orderedColumns]);
316
317
  (0, _react.useEffect)(function () {
317
318
  if (experienceId && status === 'resolved') {
318
319
  (0, _ufoExperiences.succeedUfoExperience)({
@@ -601,6 +602,8 @@ var IssueLikeDataTableView = exports.IssueLikeDataTableView = function IssueLike
601
602
  }, _callee, null, [[3, 9]]);
602
603
  })), [experienceId, extensionKey, hasFullSchema, onLoadDatasourceDetails]);
603
604
  var isEditable = onVisibleColumnKeysChange && hasData;
605
+ var orderedColumnsAreUpToDate = orderedColumns.length === columns.length;
606
+ var shouldDisplayColumnsInPicker = hasFullSchema && orderedColumnsAreUpToDate;
604
607
  var view = (0, _react2.jsx)("div", {
605
608
  /* There is required contentEditable={true} in editor-card-plugin
606
609
  * But this brakes how DND works. We set contentEditable={false} to allow DND to work
@@ -692,8 +695,8 @@ var IssueLikeDataTableView = exports.IssueLikeDataTableView = function IssueLike
692
695
  }, heading);
693
696
  }
694
697
  }), onVisibleColumnKeysChange && (0, _react2.jsx)(ColumnPickerHeader, null, (0, _react2.jsx)(_columnPicker.ColumnPicker, {
695
- columns: hasFullSchema ? orderedColumns : [],
696
- selectedColumnKeys: hasFullSchema ? visibleColumnKeys : [],
698
+ columns: shouldDisplayColumnsInPicker ? orderedColumns : [],
699
+ selectedColumnKeys: shouldDisplayColumnsInPicker ? visibleColumnKeys : [],
697
700
  onSelectedColumnKeysChange: onSelectedColumnKeysChange,
698
701
  onOpen: handlePickerOpen
699
702
  })))), (0, _react2.jsx)("tbody", {
@@ -9,7 +9,8 @@ var COLUMN_BASE_WIDTH = exports.COLUMN_BASE_WIDTH = 8;
9
9
  var COLUMN_MIN_WIDTH = COLUMN_BASE_WIDTH * 4;
10
10
  var keyBasedMinWidthMap = {
11
11
  summary: COLUMN_BASE_WIDTH * 26,
12
- status: COLUMN_BASE_WIDTH * 15
12
+ status: COLUMN_BASE_WIDTH * 15,
13
+ priority: COLUMN_BASE_WIDTH * 12.5 // 100px
13
14
  };
14
15
  var getColumnMinWidth = exports.getColumnMinWidth = function getColumnMinWidth(key) {
15
16
  return keyBasedMinWidthMap[key] || COLUMN_MIN_WIDTH;
@@ -2,9 +2,6 @@ import _extends from "@babel/runtime/helpers/extends";
2
2
  import React, { useEffect, useState } from 'react';
3
3
  import { ActionOperationStatus } from '@atlaskit/linking-types';
4
4
  import Lozenge from '@atlaskit/lozenge';
5
- // FilterOptionOption is used in the filterOption function which is part of the public API, but the type itself is not exported
6
- // eslint-disable-next-line import/no-extraneous-dependencies,no-restricted-imports
7
-
8
5
  import Select from '@atlaskit/select';
9
6
  const StatusEditType = props => {
10
7
  var _currentValue$values;
@@ -259,7 +259,8 @@ export const getOrderedColumns = (columns, visibleColumnKeys) => {
259
259
  };
260
260
  const DEFAULT_WIDTH = COLUMN_BASE_WIDTH * 22;
261
261
  const keyBasedWidthMap = {
262
- priority: COLUMN_BASE_WIDTH * 8,
262
+ priority: COLUMN_BASE_WIDTH * 13.75,
263
+ // 110px
263
264
  status: COLUMN_BASE_WIDTH * 15,
264
265
  summary: COLUMN_BASE_WIDTH * 45,
265
266
  description: COLUMN_BASE_WIDTH * 31,
@@ -321,10 +322,10 @@ export const IssueLikeDataTableView = ({
321
322
  }
322
323
  }, [containerRef]);
323
324
  useEffect(() => {
324
- if (!hasFullSchema) {
325
+ if (orderedColumns.length !== columns.length) {
325
326
  setOrderedColumns(getOrderedColumns([...columns], [...visibleColumnKeys]));
326
327
  }
327
- }, [columns, visibleColumnKeys, hasFullSchema]);
328
+ }, [columns, visibleColumnKeys, orderedColumns]);
328
329
  useEffect(() => {
329
330
  if (experienceId && status === 'resolved') {
330
331
  succeedUfoExperience({
@@ -572,6 +573,8 @@ export const IssueLikeDataTableView = ({
572
573
  }
573
574
  }, [experienceId, extensionKey, hasFullSchema, onLoadDatasourceDetails]);
574
575
  const isEditable = onVisibleColumnKeysChange && hasData;
576
+ const orderedColumnsAreUpToDate = orderedColumns.length === columns.length;
577
+ const shouldDisplayColumnsInPicker = hasFullSchema && orderedColumnsAreUpToDate;
575
578
  const view = jsx("div", {
576
579
  /* There is required contentEditable={true} in editor-card-plugin
577
580
  * But this brakes how DND works. We set contentEditable={false} to allow DND to work
@@ -664,8 +667,8 @@ export const IssueLikeDataTableView = ({
664
667
  }, heading);
665
668
  }
666
669
  }), onVisibleColumnKeysChange && jsx(ColumnPickerHeader, null, jsx(ColumnPicker, {
667
- columns: hasFullSchema ? orderedColumns : [],
668
- selectedColumnKeys: hasFullSchema ? visibleColumnKeys : [],
670
+ columns: shouldDisplayColumnsInPicker ? orderedColumns : [],
671
+ selectedColumnKeys: shouldDisplayColumnsInPicker ? visibleColumnKeys : [],
669
672
  onSelectedColumnKeysChange: onSelectedColumnKeysChange,
670
673
  onOpen: handlePickerOpen
671
674
  })))), jsx("tbody", {
@@ -3,7 +3,8 @@ export const COLUMN_BASE_WIDTH = 8;
3
3
  const COLUMN_MIN_WIDTH = COLUMN_BASE_WIDTH * 4;
4
4
  const keyBasedMinWidthMap = {
5
5
  summary: COLUMN_BASE_WIDTH * 26,
6
- status: COLUMN_BASE_WIDTH * 15
6
+ status: COLUMN_BASE_WIDTH * 15,
7
+ priority: COLUMN_BASE_WIDTH * 12.5 // 100px
7
8
  };
8
9
  export const getColumnMinWidth = key => {
9
10
  return keyBasedMinWidthMap[key] || COLUMN_MIN_WIDTH;
@@ -5,9 +5,6 @@ import _regeneratorRuntime from "@babel/runtime/regenerator";
5
5
  import React, { useEffect, useState } from 'react';
6
6
  import { ActionOperationStatus } from '@atlaskit/linking-types';
7
7
  import Lozenge from '@atlaskit/lozenge';
8
- // FilterOptionOption is used in the filterOption function which is part of the public API, but the type itself is not exported
9
- // eslint-disable-next-line import/no-extraneous-dependencies,no-restricted-imports
10
-
11
8
  import Select from '@atlaskit/select';
12
9
  var StatusEditType = function StatusEditType(props) {
13
10
  var _currentValue$values;
@@ -229,7 +229,8 @@ export var getOrderedColumns = function getOrderedColumns(columns, visibleColumn
229
229
  };
230
230
  var DEFAULT_WIDTH = COLUMN_BASE_WIDTH * 22;
231
231
  var keyBasedWidthMap = {
232
- priority: COLUMN_BASE_WIDTH * 8,
232
+ priority: COLUMN_BASE_WIDTH * 13.75,
233
+ // 110px
233
234
  status: COLUMN_BASE_WIDTH * 15,
234
235
  summary: COLUMN_BASE_WIDTH * 45,
235
236
  description: COLUMN_BASE_WIDTH * 31,
@@ -305,10 +306,10 @@ export var IssueLikeDataTableView = function IssueLikeDataTableView(_ref5) {
305
306
  }
306
307
  }, [containerRef]);
307
308
  useEffect(function () {
308
- if (!hasFullSchema) {
309
+ if (orderedColumns.length !== columns.length) {
309
310
  setOrderedColumns(getOrderedColumns(_toConsumableArray(columns), _toConsumableArray(visibleColumnKeys)));
310
311
  }
311
- }, [columns, visibleColumnKeys, hasFullSchema]);
312
+ }, [columns, visibleColumnKeys, orderedColumns]);
312
313
  useEffect(function () {
313
314
  if (experienceId && status === 'resolved') {
314
315
  succeedUfoExperience({
@@ -597,6 +598,8 @@ export var IssueLikeDataTableView = function IssueLikeDataTableView(_ref5) {
597
598
  }, _callee, null, [[3, 9]]);
598
599
  })), [experienceId, extensionKey, hasFullSchema, onLoadDatasourceDetails]);
599
600
  var isEditable = onVisibleColumnKeysChange && hasData;
601
+ var orderedColumnsAreUpToDate = orderedColumns.length === columns.length;
602
+ var shouldDisplayColumnsInPicker = hasFullSchema && orderedColumnsAreUpToDate;
600
603
  var view = jsx("div", {
601
604
  /* There is required contentEditable={true} in editor-card-plugin
602
605
  * But this brakes how DND works. We set contentEditable={false} to allow DND to work
@@ -688,8 +691,8 @@ export var IssueLikeDataTableView = function IssueLikeDataTableView(_ref5) {
688
691
  }, heading);
689
692
  }
690
693
  }), onVisibleColumnKeysChange && jsx(ColumnPickerHeader, null, jsx(ColumnPicker, {
691
- columns: hasFullSchema ? orderedColumns : [],
692
- selectedColumnKeys: hasFullSchema ? visibleColumnKeys : [],
694
+ columns: shouldDisplayColumnsInPicker ? orderedColumns : [],
695
+ selectedColumnKeys: shouldDisplayColumnsInPicker ? visibleColumnKeys : [],
693
696
  onSelectedColumnKeysChange: onSelectedColumnKeysChange,
694
697
  onOpen: handlePickerOpen
695
698
  })))), jsx("tbody", {
@@ -3,7 +3,8 @@ export var COLUMN_BASE_WIDTH = 8;
3
3
  var COLUMN_MIN_WIDTH = COLUMN_BASE_WIDTH * 4;
4
4
  var keyBasedMinWidthMap = {
5
5
  summary: COLUMN_BASE_WIDTH * 26,
6
- status: COLUMN_BASE_WIDTH * 15
6
+ status: COLUMN_BASE_WIDTH * 15,
7
+ priority: COLUMN_BASE_WIDTH * 12.5 // 100px
7
8
  };
8
9
  export var getColumnMinWidth = function getColumnMinWidth(key) {
9
10
  return keyBasedMinWidthMap[key] || COLUMN_MIN_WIDTH;
@@ -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.6",
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",
@@ -71,6 +71,7 @@
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": "^13.1.0",
74
+ "@atlaskit/react-select": "^1.3.0",
74
75
  "@atlaskit/select": "^18.5.0",
75
76
  "@atlaskit/smart-card": "^30.2.0",
76
77
  "@atlaskit/smart-user-picker": "6.11.1",
@@ -79,7 +80,7 @@
79
80
  "@atlaskit/textfield": "6.5.4",
80
81
  "@atlaskit/theme": "^14.0.0",
81
82
  "@atlaskit/tokens": "^2.2.0",
82
- "@atlaskit/tooltip": "^18.8.0",
83
+ "@atlaskit/tooltip": "^18.9.0",
83
84
  "@atlaskit/ufo": "^0.3.0",
84
85
  "@atlaskit/width-detector": "^4.3.0",
85
86
  "@babel/runtime": "^7.0.0",