@atlaskit/link-datasource 4.27.3 → 4.28.0
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 +20 -0
- package/dist/cjs/ui/issue-like-table/draggable-table-heading.js +1 -3
- package/dist/cjs/ui/issue-like-table/render-type/index.js +7 -2
- package/dist/cjs/ui/issue-like-table/render-type/richtext/index.compiled.css +1 -0
- package/dist/cjs/ui/issue-like-table/render-type/richtext/index.js +13 -1
- package/dist/es2019/ui/issue-like-table/draggable-table-heading.js +1 -3
- package/dist/es2019/ui/issue-like-table/render-type/index.js +7 -2
- package/dist/es2019/ui/issue-like-table/render-type/richtext/index.compiled.css +1 -0
- package/dist/es2019/ui/issue-like-table/render-type/richtext/index.js +13 -1
- package/dist/esm/ui/issue-like-table/draggable-table-heading.js +1 -3
- package/dist/esm/ui/issue-like-table/render-type/index.js +7 -2
- package/dist/esm/ui/issue-like-table/render-type/richtext/index.compiled.css +1 -0
- package/dist/esm/ui/issue-like-table/render-type/richtext/index.js +13 -1
- package/dist/types/ui/datasource-table-view/datasourceTableView.d.ts +2 -2
- package/dist/types/ui/datasource-table-view/types.d.ts +2 -1
- package/dist/types-ts4.5/ui/datasource-table-view/datasourceTableView.d.ts +2 -2
- package/dist/types-ts4.5/ui/datasource-table-view/types.d.ts +2 -1
- package/examples-helpers/buildJiraIssuesTable.tsx +23 -19
- package/examples-helpers/useCommonTableProps.tsx +2 -2
- package/package.json +12 -10
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# @atlaskit/link-datasource
|
|
2
2
|
|
|
3
|
+
## 4.28.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`6cb21d13010a3`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/6cb21d13010a3) -
|
|
8
|
+
[ux] Description field of a Jira SLLV now supports rich text when backend sends `html` property in
|
|
9
|
+
the data.
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Updated dependencies
|
|
14
|
+
|
|
15
|
+
## 4.27.4
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- [`72222bda541f2`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/72222bda541f2) -
|
|
20
|
+
Clean up feature flags.
|
|
21
|
+
- Updated dependencies
|
|
22
|
+
|
|
3
23
|
## 4.27.3
|
|
4
24
|
|
|
5
25
|
### Patch Changes
|
|
@@ -22,7 +22,6 @@ var _new = _interopRequireDefault(require("@atlaskit/button/new"));
|
|
|
22
22
|
var _dropdownMenu = _interopRequireWildcard(require("@atlaskit/dropdown-menu"));
|
|
23
23
|
var _chevronDown = _interopRequireDefault(require("@atlaskit/icon/core/migration/chevron-down"));
|
|
24
24
|
var _chevronUp = _interopRequireDefault(require("@atlaskit/icon/core/migration/chevron-up"));
|
|
25
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
26
25
|
var _closestEdge = require("@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge");
|
|
27
26
|
var _box = require("@atlaskit/pragmatic-drag-and-drop-react-drop-indicator/box");
|
|
28
27
|
var _combine = require("@atlaskit/pragmatic-drag-and-drop/combine");
|
|
@@ -353,8 +352,7 @@ var DraggableTableHeading = exports.DraggableTableHeading = function DraggableTa
|
|
|
353
352
|
}) : null, onIsWrappedChange ? /*#__PURE__*/React.createElement(DropdownParent, null, /*#__PURE__*/React.createElement(_dropdownMenu.default, {
|
|
354
353
|
trigger: getTriggerButton,
|
|
355
354
|
onOpenChange: onDropdownOpenChange,
|
|
356
|
-
placement: 'bottom'
|
|
357
|
-
shouldRenderToParent: (0, _platformFeatureFlags.fg)('should-render-to-parent-should-be-true-linking-pla')
|
|
355
|
+
placement: 'bottom'
|
|
358
356
|
}, /*#__PURE__*/React.createElement(_dropdownMenu.DropdownItem, {
|
|
359
357
|
elemBefore: isWrapped ? /*#__PURE__*/React.createElement(_customIcons.UnwrapTextIcon, null) : /*#__PURE__*/React.createElement(_customIcons.WrapTextIcon, null),
|
|
360
358
|
testId: "".concat(id, "-column-dropdown-item-toggle-wrapping"),
|
|
@@ -8,6 +8,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
8
8
|
exports.stringifyType = exports.renderType = void 0;
|
|
9
9
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
10
|
var _react = _interopRequireDefault(require("react"));
|
|
11
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
11
12
|
var _boolean = _interopRequireDefault(require("./boolean"));
|
|
12
13
|
var _dateTime = _interopRequireWildcard(require("./date-time"));
|
|
13
14
|
var _icon = _interopRequireDefault(require("./icon"));
|
|
@@ -44,8 +45,12 @@ var stringifyType = exports.stringifyType = function stringifyType(_ref, formatM
|
|
|
44
45
|
case 'user':
|
|
45
46
|
return (value === null || value === void 0 ? void 0 : value.displayName) || formatMessage(_messages.userTypeMessages.userDefaultdisplayNameValue);
|
|
46
47
|
case 'richtext':
|
|
47
|
-
|
|
48
|
-
|
|
48
|
+
if (value.html && value.html.trim() !== '' && (0, _platformFeatureFlags.fg)('platform_navx_jira_sllv_rich_text_gate')) {
|
|
49
|
+
return '';
|
|
50
|
+
} else {
|
|
51
|
+
var adfPlainText = (0, _richtext.parseRichText)(value);
|
|
52
|
+
return adfPlainText || '';
|
|
53
|
+
}
|
|
49
54
|
case 'link':
|
|
50
55
|
default:
|
|
51
56
|
return '';
|
|
@@ -13,8 +13,10 @@ var React = _react;
|
|
|
13
13
|
var _runtime = require("@compiled/react/runtime");
|
|
14
14
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
15
15
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
16
|
+
var _dompurify = _interopRequireDefault(require("dompurify"));
|
|
16
17
|
var _schemaDefault = require("@atlaskit/adf-schema/schema-default");
|
|
17
18
|
var _model = require("@atlaskit/editor-prosemirror/model");
|
|
19
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
18
20
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
19
21
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
20
22
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
@@ -53,10 +55,20 @@ var RichTextType = function RichTextType(_ref) {
|
|
|
53
55
|
var adfPlainText = (0, _react.useMemo)(function () {
|
|
54
56
|
return parseRichText(value);
|
|
55
57
|
}, [value]);
|
|
58
|
+
if (value.html && value.html.trim() !== '' && (0, _platformFeatureFlags.fg)('platform_navx_jira_sllv_rich_text_gate')) {
|
|
59
|
+
// eslint-disable-next-line react/no-danger
|
|
60
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
61
|
+
"data-testid": "datasource-richtext-html-content",
|
|
62
|
+
dangerouslySetInnerHTML: {
|
|
63
|
+
__html: _dompurify.default.sanitize(value.html)
|
|
64
|
+
},
|
|
65
|
+
className: (0, _runtime.ax)(["_kqswh2mm _80om73ad"])
|
|
66
|
+
});
|
|
67
|
+
}
|
|
56
68
|
if (adfPlainText) {
|
|
57
69
|
return /*#__PURE__*/React.createElement("span", {
|
|
58
70
|
"data-testid": "richtext-plaintext",
|
|
59
|
-
className: (0, _runtime.ax)(["_kqswh2mm"])
|
|
71
|
+
className: (0, _runtime.ax)(["_kqswh2mm _80om73ad"])
|
|
60
72
|
}, adfPlainText);
|
|
61
73
|
} else {
|
|
62
74
|
return /*#__PURE__*/React.createElement("span", {
|
|
@@ -14,7 +14,6 @@ import Button from '@atlaskit/button/new';
|
|
|
14
14
|
import DropdownMenu, { DropdownItem } from '@atlaskit/dropdown-menu';
|
|
15
15
|
import ChevronDown from '@atlaskit/icon/core/migration/chevron-down';
|
|
16
16
|
import ChevronUp from '@atlaskit/icon/core/migration/chevron-up';
|
|
17
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
18
17
|
import { attachClosestEdge, extractClosestEdge } from '@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge';
|
|
19
18
|
import { DropIndicator } from '@atlaskit/pragmatic-drag-and-drop-react-drop-indicator/box';
|
|
20
19
|
import { combine } from '@atlaskit/pragmatic-drag-and-drop/combine';
|
|
@@ -326,8 +325,7 @@ export const DraggableTableHeading = ({
|
|
|
326
325
|
}) : null, onIsWrappedChange ? /*#__PURE__*/React.createElement(DropdownParent, null, /*#__PURE__*/React.createElement(DropdownMenu, {
|
|
327
326
|
trigger: getTriggerButton,
|
|
328
327
|
onOpenChange: onDropdownOpenChange,
|
|
329
|
-
placement: 'bottom'
|
|
330
|
-
shouldRenderToParent: fg('should-render-to-parent-should-be-true-linking-pla')
|
|
328
|
+
placement: 'bottom'
|
|
331
329
|
}, /*#__PURE__*/React.createElement(DropdownItem, {
|
|
332
330
|
elemBefore: isWrapped ? /*#__PURE__*/React.createElement(UnwrapTextIcon, null) : /*#__PURE__*/React.createElement(WrapTextIcon, null),
|
|
333
331
|
testId: `${id}-column-dropdown-item-toggle-wrapping`,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import React from 'react';
|
|
3
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
3
4
|
import BooleanRenderType from './boolean';
|
|
4
5
|
import DateTimeRenderType, { getFormattedDate } from './date-time';
|
|
5
6
|
import IconRenderType from './icon';
|
|
@@ -36,8 +37,12 @@ export const stringifyType = ({
|
|
|
36
37
|
case 'user':
|
|
37
38
|
return (value === null || value === void 0 ? void 0 : value.displayName) || formatMessage(userTypeMessages.userDefaultdisplayNameValue);
|
|
38
39
|
case 'richtext':
|
|
39
|
-
|
|
40
|
-
|
|
40
|
+
if (value.html && value.html.trim() !== '' && fg('platform_navx_jira_sllv_rich_text_gate')) {
|
|
41
|
+
return '';
|
|
42
|
+
} else {
|
|
43
|
+
const adfPlainText = parseRichText(value);
|
|
44
|
+
return adfPlainText || '';
|
|
45
|
+
}
|
|
41
46
|
case 'link':
|
|
42
47
|
default:
|
|
43
48
|
return '';
|
|
@@ -3,8 +3,10 @@ import "./index.compiled.css";
|
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import { ax, ix } from "@compiled/react/runtime";
|
|
5
5
|
import { useMemo } from 'react';
|
|
6
|
+
import dompurify from 'dompurify';
|
|
6
7
|
import { defaultSchema } from '@atlaskit/adf-schema/schema-default';
|
|
7
8
|
import { Node as PMNode, Schema } from '@atlaskit/editor-prosemirror/model';
|
|
9
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
8
10
|
const rootStyles = null;
|
|
9
11
|
const smartLinkNodeToUrl = node => {
|
|
10
12
|
var _node$attrs$url;
|
|
@@ -43,10 +45,20 @@ const RichTextType = ({
|
|
|
43
45
|
value
|
|
44
46
|
}) => {
|
|
45
47
|
const adfPlainText = useMemo(() => parseRichText(value), [value]);
|
|
48
|
+
if (value.html && value.html.trim() !== '' && fg('platform_navx_jira_sllv_rich_text_gate')) {
|
|
49
|
+
// eslint-disable-next-line react/no-danger
|
|
50
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
51
|
+
"data-testid": "datasource-richtext-html-content",
|
|
52
|
+
dangerouslySetInnerHTML: {
|
|
53
|
+
__html: dompurify.sanitize(value.html)
|
|
54
|
+
},
|
|
55
|
+
className: ax(["_kqswh2mm _80om73ad"])
|
|
56
|
+
});
|
|
57
|
+
}
|
|
46
58
|
if (adfPlainText) {
|
|
47
59
|
return /*#__PURE__*/React.createElement("span", {
|
|
48
60
|
"data-testid": "richtext-plaintext",
|
|
49
|
-
className: ax(["_kqswh2mm"])
|
|
61
|
+
className: ax(["_kqswh2mm _80om73ad"])
|
|
50
62
|
}, adfPlainText);
|
|
51
63
|
} else {
|
|
52
64
|
return /*#__PURE__*/React.createElement("span", {
|
|
@@ -22,7 +22,6 @@ import Button from '@atlaskit/button/new';
|
|
|
22
22
|
import DropdownMenu, { DropdownItem } from '@atlaskit/dropdown-menu';
|
|
23
23
|
import ChevronDown from '@atlaskit/icon/core/migration/chevron-down';
|
|
24
24
|
import ChevronUp from '@atlaskit/icon/core/migration/chevron-up';
|
|
25
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
26
25
|
import { attachClosestEdge, extractClosestEdge } from '@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge';
|
|
27
26
|
import { DropIndicator } from '@atlaskit/pragmatic-drag-and-drop-react-drop-indicator/box';
|
|
28
27
|
import { combine } from '@atlaskit/pragmatic-drag-and-drop/combine';
|
|
@@ -347,8 +346,7 @@ export var DraggableTableHeading = function DraggableTableHeading(_ref3) {
|
|
|
347
346
|
}) : null, onIsWrappedChange ? /*#__PURE__*/React.createElement(DropdownParent, null, /*#__PURE__*/React.createElement(DropdownMenu, {
|
|
348
347
|
trigger: getTriggerButton,
|
|
349
348
|
onOpenChange: onDropdownOpenChange,
|
|
350
|
-
placement: 'bottom'
|
|
351
|
-
shouldRenderToParent: fg('should-render-to-parent-should-be-true-linking-pla')
|
|
349
|
+
placement: 'bottom'
|
|
352
350
|
}, /*#__PURE__*/React.createElement(DropdownItem, {
|
|
353
351
|
elemBefore: isWrapped ? /*#__PURE__*/React.createElement(UnwrapTextIcon, null) : /*#__PURE__*/React.createElement(WrapTextIcon, null),
|
|
354
352
|
testId: "".concat(id, "-column-dropdown-item-toggle-wrapping"),
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import React from 'react';
|
|
3
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
3
4
|
import BooleanRenderType from './boolean';
|
|
4
5
|
import DateTimeRenderType, { getFormattedDate } from './date-time';
|
|
5
6
|
import IconRenderType from './icon';
|
|
@@ -35,8 +36,12 @@ export var stringifyType = function stringifyType(_ref, formatMessage, formatDat
|
|
|
35
36
|
case 'user':
|
|
36
37
|
return (value === null || value === void 0 ? void 0 : value.displayName) || formatMessage(userTypeMessages.userDefaultdisplayNameValue);
|
|
37
38
|
case 'richtext':
|
|
38
|
-
|
|
39
|
-
|
|
39
|
+
if (value.html && value.html.trim() !== '' && fg('platform_navx_jira_sllv_rich_text_gate')) {
|
|
40
|
+
return '';
|
|
41
|
+
} else {
|
|
42
|
+
var adfPlainText = parseRichText(value);
|
|
43
|
+
return adfPlainText || '';
|
|
44
|
+
}
|
|
40
45
|
case 'link':
|
|
41
46
|
default:
|
|
42
47
|
return '';
|
|
@@ -7,8 +7,10 @@ import { ax, ix } from "@compiled/react/runtime";
|
|
|
7
7
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
8
8
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
9
9
|
import { useMemo } from 'react';
|
|
10
|
+
import dompurify from 'dompurify';
|
|
10
11
|
import { defaultSchema } from '@atlaskit/adf-schema/schema-default';
|
|
11
12
|
import { Node as PMNode, Schema } from '@atlaskit/editor-prosemirror/model';
|
|
13
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
12
14
|
var rootStyles = null;
|
|
13
15
|
var smartLinkNodeToUrl = function smartLinkNodeToUrl(node) {
|
|
14
16
|
var _node$attrs$url;
|
|
@@ -44,10 +46,20 @@ var RichTextType = function RichTextType(_ref) {
|
|
|
44
46
|
var adfPlainText = useMemo(function () {
|
|
45
47
|
return parseRichText(value);
|
|
46
48
|
}, [value]);
|
|
49
|
+
if (value.html && value.html.trim() !== '' && fg('platform_navx_jira_sllv_rich_text_gate')) {
|
|
50
|
+
// eslint-disable-next-line react/no-danger
|
|
51
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
52
|
+
"data-testid": "datasource-richtext-html-content",
|
|
53
|
+
dangerouslySetInnerHTML: {
|
|
54
|
+
__html: dompurify.sanitize(value.html)
|
|
55
|
+
},
|
|
56
|
+
className: ax(["_kqswh2mm _80om73ad"])
|
|
57
|
+
});
|
|
58
|
+
}
|
|
47
59
|
if (adfPlainText) {
|
|
48
60
|
return /*#__PURE__*/React.createElement("span", {
|
|
49
61
|
"data-testid": "richtext-plaintext",
|
|
50
|
-
className: ax(["_kqswh2mm"])
|
|
62
|
+
className: ax(["_kqswh2mm _80om73ad"])
|
|
51
63
|
}, adfPlainText);
|
|
52
64
|
} else {
|
|
53
65
|
return /*#__PURE__*/React.createElement("span", {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export declare const DatasourceTableView: import("react").ForwardRefExoticComponent<{
|
|
2
2
|
datasourceId: string;
|
|
3
|
-
parameters:
|
|
3
|
+
parameters: import("@atlaskit/linking-types").DatasourceParameters;
|
|
4
4
|
url?: string;
|
|
5
5
|
} & Partial<Pick<import("../issue-like-table/types").IssueLikeDataTableViewProps, "visibleColumnKeys" | "wrappedColumnKeys" | "columnCustomSizes" | "onColumnResize" | "onVisibleColumnKeysChange" | "onWrappedColumnChange" | "scrollableContainerHeight">> & import("@atlaskit/analytics-next").WithContextProps & import("react").RefAttributes<any>>;
|
|
6
6
|
export declare const DataSourceTableViewNoSuspense: import("react").ForwardRefExoticComponent<{
|
|
7
7
|
datasourceId: string;
|
|
8
|
-
parameters:
|
|
8
|
+
parameters: import("@atlaskit/linking-types").DatasourceParameters;
|
|
9
9
|
url?: string;
|
|
10
10
|
} & Partial<Pick<import("../issue-like-table/types").IssueLikeDataTableViewProps, "visibleColumnKeys" | "wrappedColumnKeys" | "columnCustomSizes" | "onColumnResize" | "onVisibleColumnKeysChange" | "onWrappedColumnChange" | "scrollableContainerHeight">> & import("@atlaskit/analytics-next").WithContextProps & import("react").RefAttributes<any>>;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import type { DatasourceParameters } from '@atlaskit/linking-types';
|
|
1
2
|
import { type IssueLikeDataTableViewProps } from '../issue-like-table/types';
|
|
2
3
|
export type DatasourceTableViewProps = {
|
|
3
4
|
/** Unique identifier for which type of datasource is being rendered and for making its requests */
|
|
4
5
|
datasourceId: string;
|
|
5
6
|
/** Parameters for making the data requests necessary to render data within the table */
|
|
6
|
-
parameters:
|
|
7
|
+
parameters: DatasourceParameters;
|
|
7
8
|
/** Url for an existing datasource, initially used for displaying to a user unauthorized to query that site */
|
|
8
9
|
url?: string;
|
|
9
10
|
} & Partial<Pick<IssueLikeDataTableViewProps, 'visibleColumnKeys' | 'onVisibleColumnKeysChange' | 'wrappedColumnKeys' | 'onWrappedColumnChange' | 'onColumnResize' | 'columnCustomSizes' | 'scrollableContainerHeight'>>;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export declare const DatasourceTableView: import("react").ForwardRefExoticComponent<{
|
|
2
2
|
datasourceId: string;
|
|
3
|
-
parameters:
|
|
3
|
+
parameters: import("@atlaskit/linking-types").DatasourceParameters;
|
|
4
4
|
url?: string;
|
|
5
5
|
} & Partial<Pick<import("../issue-like-table/types").IssueLikeDataTableViewProps, "visibleColumnKeys" | "wrappedColumnKeys" | "columnCustomSizes" | "onColumnResize" | "onVisibleColumnKeysChange" | "onWrappedColumnChange" | "scrollableContainerHeight">> & import("@atlaskit/analytics-next").WithContextProps & import("react").RefAttributes<any>>;
|
|
6
6
|
export declare const DataSourceTableViewNoSuspense: import("react").ForwardRefExoticComponent<{
|
|
7
7
|
datasourceId: string;
|
|
8
|
-
parameters:
|
|
8
|
+
parameters: import("@atlaskit/linking-types").DatasourceParameters;
|
|
9
9
|
url?: string;
|
|
10
10
|
} & Partial<Pick<import("../issue-like-table/types").IssueLikeDataTableViewProps, "visibleColumnKeys" | "wrappedColumnKeys" | "columnCustomSizes" | "onColumnResize" | "onVisibleColumnKeysChange" | "onWrappedColumnChange" | "scrollableContainerHeight">> & import("@atlaskit/analytics-next").WithContextProps & import("react").RefAttributes<any>>;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import type { DatasourceParameters } from '@atlaskit/linking-types';
|
|
1
2
|
import { type IssueLikeDataTableViewProps } from '../issue-like-table/types';
|
|
2
3
|
export type DatasourceTableViewProps = {
|
|
3
4
|
/** Unique identifier for which type of datasource is being rendered and for making its requests */
|
|
4
5
|
datasourceId: string;
|
|
5
6
|
/** Parameters for making the data requests necessary to render data within the table */
|
|
6
|
-
parameters:
|
|
7
|
+
parameters: DatasourceParameters;
|
|
7
8
|
/** Url for an existing datasource, initially used for displaying to a user unauthorized to query that site */
|
|
8
9
|
url?: string;
|
|
9
10
|
} & Partial<Pick<IssueLikeDataTableViewProps, 'visibleColumnKeys' | 'onVisibleColumnKeysChange' | 'wrappedColumnKeys' | 'onWrappedColumnChange' | 'onColumnResize' | 'columnCustomSizes' | 'scrollableContainerHeight'>>;
|
|
@@ -3,13 +3,12 @@ import React, { useMemo } from 'react';
|
|
|
3
3
|
import { IntlMessagesProvider } from '@atlaskit/intl-messages-provider';
|
|
4
4
|
import { SmartCardProvider } from '@atlaskit/link-provider';
|
|
5
5
|
import { mockDatasourceFetchRequests } from '@atlaskit/link-test-helpers/datasource';
|
|
6
|
-
import { type DatasourceParameters } from '@atlaskit/linking-types';
|
|
7
6
|
|
|
8
7
|
import { type DatasourceTableView } from '../src';
|
|
9
8
|
import { fetchMessagesForLocale } from '../src/common/utils/locale/fetch-messages-for-locale';
|
|
10
9
|
import { DatasourceExperienceIdProvider } from '../src/contexts/datasource-experience-id';
|
|
11
10
|
import { DataSourceTableViewNoSuspense } from '../src/ui/datasource-table-view/datasourceTableView';
|
|
12
|
-
import {
|
|
11
|
+
import type { DatasourceTableViewProps } from '../src/ui/datasource-table-view/types';
|
|
13
12
|
|
|
14
13
|
import SmartLinkClient from './smartLinkCustomClient';
|
|
15
14
|
import { useCommonTableProps } from './useCommonTableProps';
|
|
@@ -20,23 +19,26 @@ type JiraIssuesTableViewProps = {
|
|
|
20
19
|
*/
|
|
21
20
|
DatasourceTable?: typeof DataSourceTableViewNoSuspense | typeof DatasourceTableView;
|
|
22
21
|
mockDatasourceFetchRequest?: boolean;
|
|
23
|
-
|
|
24
|
-
};
|
|
22
|
+
} & Partial<Pick<DatasourceTableViewProps, 'parameters' | 'scrollableContainerHeight' | 'visibleColumnKeys'>>;
|
|
25
23
|
|
|
26
24
|
const JiraIssuesTableView = ({
|
|
27
|
-
parameters,
|
|
28
25
|
DatasourceTable = DataSourceTableViewNoSuspense,
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
26
|
+
...props
|
|
27
|
+
}: Omit<JiraIssuesTableViewProps, 'mockDatasourceFetchRequest'>) => {
|
|
28
|
+
const {
|
|
29
|
+
parameters: {
|
|
30
|
+
cloudId = 'some-cloud-id',
|
|
31
|
+
jql = 'some-jql',
|
|
32
|
+
} = {},
|
|
33
|
+
scrollableContainerHeight,
|
|
34
|
+
visibleColumnKeys: initialVisibleColumnKeys,
|
|
35
|
+
} = props
|
|
36
|
+
|
|
37
|
+
const parameters = useMemo(() => ({
|
|
38
|
+
cloudId,
|
|
39
|
+
jql,
|
|
40
|
+
}), [cloudId, jql]);
|
|
41
|
+
|
|
40
42
|
const {
|
|
41
43
|
visibleColumnKeys,
|
|
42
44
|
onVisibleColumnKeysChange,
|
|
@@ -51,25 +53,27 @@ const JiraIssuesTableView = ({
|
|
|
51
53
|
link: 350,
|
|
52
54
|
labels: 100,
|
|
53
55
|
priority: 200,
|
|
56
|
+
description: 650,
|
|
54
57
|
},
|
|
58
|
+
visibleColumnKeys: initialVisibleColumnKeys,
|
|
55
59
|
});
|
|
56
60
|
|
|
57
61
|
return (
|
|
58
62
|
<DatasourceTable
|
|
59
63
|
datasourceId={'some-datasource-id'}
|
|
60
|
-
parameters={
|
|
64
|
+
parameters={parameters}
|
|
61
65
|
visibleColumnKeys={visibleColumnKeys}
|
|
62
66
|
onVisibleColumnKeysChange={onVisibleColumnKeysChange}
|
|
63
67
|
columnCustomSizes={columnCustomSizes}
|
|
64
68
|
onColumnResize={onColumnResize}
|
|
65
69
|
onWrappedColumnChange={onWrappedColumnChange}
|
|
66
70
|
wrappedColumnKeys={wrappedColumnKeys}
|
|
71
|
+
scrollableContainerHeight={scrollableContainerHeight}
|
|
67
72
|
/>
|
|
68
73
|
);
|
|
69
74
|
};
|
|
70
75
|
|
|
71
76
|
export const ExampleJiraIssuesTableView = ({
|
|
72
|
-
parameters,
|
|
73
77
|
mockDatasourceFetchRequest = true,
|
|
74
78
|
...props
|
|
75
79
|
}: JiraIssuesTableViewProps) => {
|
|
@@ -81,7 +85,7 @@ export const ExampleJiraIssuesTableView = ({
|
|
|
81
85
|
<DatasourceExperienceIdProvider>
|
|
82
86
|
<IntlMessagesProvider loaderFn={fetchMessagesForLocale}>
|
|
83
87
|
<SmartCardProvider client={new SmartLinkClient()}>
|
|
84
|
-
<JiraIssuesTableView
|
|
88
|
+
<JiraIssuesTableView {...props} />
|
|
85
89
|
</SmartCardProvider>
|
|
86
90
|
</IntlMessagesProvider>
|
|
87
91
|
</DatasourceExperienceIdProvider>
|
|
@@ -8,7 +8,7 @@ import type { DatasourceTableViewProps } from '../src/ui/datasource-table-view/t
|
|
|
8
8
|
import type { ColumnSizesMap } from '../src/ui/issue-like-table/types';
|
|
9
9
|
|
|
10
10
|
export const useCommonTableProps = (
|
|
11
|
-
props: { defaultColumnCustomSizes?: ColumnSizesMap } = {},
|
|
11
|
+
props: { defaultColumnCustomSizes?: ColumnSizesMap, visibleColumnKeys?: string[] } = {},
|
|
12
12
|
): Required<
|
|
13
13
|
Pick<
|
|
14
14
|
DatasourceTableViewProps,
|
|
@@ -21,7 +21,7 @@ export const useCommonTableProps = (
|
|
|
21
21
|
> &
|
|
22
22
|
Pick<DatasourceTableViewProps, 'columnCustomSizes'> => {
|
|
23
23
|
const [visibleColumnKeys, onVisibleColumnKeysChange] = useState<string[]>(
|
|
24
|
-
defaultInitialVisibleJiraColumnKeys,
|
|
24
|
+
props.visibleColumnKeys ?? defaultInitialVisibleJiraColumnKeys,
|
|
25
25
|
);
|
|
26
26
|
|
|
27
27
|
const { columnCustomSizes, onColumnResize } = useColumnResize(props.defaultColumnCustomSizes);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/link-datasource",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.28.0",
|
|
4
4
|
"description": "UI Components to support linking platform dataset feature",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"@atlaskit/inline-edit": "^15.3.0",
|
|
60
60
|
"@atlaskit/intl-messages-provider": "^2.0.0",
|
|
61
61
|
"@atlaskit/jql-ast": "^3.3.0",
|
|
62
|
-
"@atlaskit/jql-editor": "^5.
|
|
62
|
+
"@atlaskit/jql-editor": "^5.8.0",
|
|
63
63
|
"@atlaskit/jql-editor-autocomplete-rest": "^3.0.0",
|
|
64
64
|
"@atlaskit/layering": "^3.2.0",
|
|
65
65
|
"@atlaskit/link": "^3.2.0",
|
|
@@ -71,27 +71,29 @@
|
|
|
71
71
|
"@atlaskit/modal-dialog": "^14.6.0",
|
|
72
72
|
"@atlaskit/outbound-auth-flow-client": "^3.4.0",
|
|
73
73
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
74
|
-
"@atlaskit/popup": "^4.
|
|
74
|
+
"@atlaskit/popup": "^4.6.0",
|
|
75
75
|
"@atlaskit/pragmatic-drag-and-drop": "^1.7.0",
|
|
76
76
|
"@atlaskit/pragmatic-drag-and-drop-hitbox": "^1.1.0",
|
|
77
77
|
"@atlaskit/pragmatic-drag-and-drop-react-beautiful-dnd-autoscroll": "^2.0.0",
|
|
78
78
|
"@atlaskit/pragmatic-drag-and-drop-react-drop-indicator": "^3.2.0",
|
|
79
|
-
"@atlaskit/primitives": "^16.
|
|
79
|
+
"@atlaskit/primitives": "^16.1.0",
|
|
80
80
|
"@atlaskit/react-select": "^3.8.0",
|
|
81
81
|
"@atlaskit/select": "^21.3.0",
|
|
82
|
-
"@atlaskit/smart-card": "^43.
|
|
82
|
+
"@atlaskit/smart-card": "^43.5.0",
|
|
83
83
|
"@atlaskit/smart-user-picker": "^8.4.0",
|
|
84
84
|
"@atlaskit/spinner": "^19.0.0",
|
|
85
85
|
"@atlaskit/tag": "^14.1.0",
|
|
86
86
|
"@atlaskit/textfield": "^8.0.0",
|
|
87
87
|
"@atlaskit/theme": "^21.0.0",
|
|
88
|
-
"@atlaskit/tokens": "^7.
|
|
89
|
-
"@atlaskit/tooltip": "^20.
|
|
88
|
+
"@atlaskit/tokens": "^7.1.0",
|
|
89
|
+
"@atlaskit/tooltip": "^20.7.0",
|
|
90
90
|
"@atlaskit/ufo": "^0.4.0",
|
|
91
91
|
"@atlaskit/width-detector": "^5.0.0",
|
|
92
92
|
"@babel/runtime": "^7.0.0",
|
|
93
93
|
"@compiled/react": "^0.18.6",
|
|
94
|
+
"@types/dompurify": "^2.2.3",
|
|
94
95
|
"debounce-promise": "^3.1.2",
|
|
96
|
+
"dompurify": "^2.5.6",
|
|
95
97
|
"lodash": "^4.17.21",
|
|
96
98
|
"react-sweet-state": "^2.6.5",
|
|
97
99
|
"tiny-invariant": "^1.2.0",
|
|
@@ -176,9 +178,6 @@
|
|
|
176
178
|
"dst-a11y__replace-anchor-with-link__linking-platfo": {
|
|
177
179
|
"type": "boolean"
|
|
178
180
|
},
|
|
179
|
-
"should-render-to-parent-should-be-true-linking-pla": {
|
|
180
|
-
"type": "boolean"
|
|
181
|
-
},
|
|
182
181
|
"lp_enable_datasource-table-view_height_override": {
|
|
183
182
|
"type": "boolean"
|
|
184
183
|
},
|
|
@@ -193,6 +192,9 @@
|
|
|
193
192
|
},
|
|
194
193
|
"navx-1845-sllv-autofocus-first-interactive-element": {
|
|
195
194
|
"type": "boolean"
|
|
195
|
+
},
|
|
196
|
+
"platform_navx_jira_sllv_rich_text_gate": {
|
|
197
|
+
"type": "boolean"
|
|
196
198
|
}
|
|
197
199
|
},
|
|
198
200
|
"compassUnitTestMetricSourceId": "ari:cloud:compass:a436116f-02ce-4520-8fbb-7301462a1674:metric-source/c5751cc6-3513-4070-9deb-af31e86aed34/9c893299-a527-4457-9b46-f3bc4c828766"
|