@atlaskit/link-datasource 4.27.4 → 4.29.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 +19 -0
- package/dist/cjs/ui/issue-like-table/edit-type/index.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/cjs/ui/issue-like-table/render-type/user/index.js +1 -8
- package/dist/es2019/ui/issue-like-table/edit-type/index.js +1 -2
- 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/es2019/ui/issue-like-table/render-type/user/index.js +1 -8
- package/dist/esm/ui/issue-like-table/edit-type/index.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/esm/ui/issue-like-table/render-type/user/index.js +1 -8
- 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 +19 -13
- package/examples-helpers/useCommonTableProps.tsx +2 -2
- package/package.json +12 -10
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# @atlaskit/link-datasource
|
|
2
2
|
|
|
3
|
+
## 4.29.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`28247d8ce71cc`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/28247d8ce71cc) -
|
|
8
|
+
[ux] Clean up feature gate to enable assignee picker on link datasource
|
|
9
|
+
|
|
10
|
+
## 4.28.0
|
|
11
|
+
|
|
12
|
+
### Minor Changes
|
|
13
|
+
|
|
14
|
+
- [`6cb21d13010a3`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/6cb21d13010a3) -
|
|
15
|
+
[ux] Description field of a Jira SLLV now supports rich text when backend sends `html` property in
|
|
16
|
+
the data.
|
|
17
|
+
|
|
18
|
+
### Patch Changes
|
|
19
|
+
|
|
20
|
+
- Updated dependencies
|
|
21
|
+
|
|
3
22
|
## 4.27.4
|
|
4
23
|
|
|
5
24
|
### Patch Changes
|
|
@@ -5,12 +5,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.toValueType = exports.isEditTypeSupported = exports.isEditTypeSelectable = exports.editType = void 0;
|
|
8
|
-
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
9
8
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
10
9
|
var _objectDestructuringEmpty2 = _interopRequireDefault(require("@babel/runtime/helpers/objectDestructuringEmpty"));
|
|
11
10
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
12
11
|
var _react = _interopRequireDefault(require("react"));
|
|
13
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
14
12
|
var _icon = _interopRequireDefault(require("./icon"));
|
|
15
13
|
var _status = _interopRequireDefault(require("./status"));
|
|
16
14
|
var _text = _interopRequireDefault(require("./text"));
|
|
@@ -92,7 +90,7 @@ var editType = exports.editType = function editType(_ref) {
|
|
|
92
90
|
};
|
|
93
91
|
};
|
|
94
92
|
var isEditTypeSupported = exports.isEditTypeSupported = function isEditTypeSupported(type) {
|
|
95
|
-
var supportedEditType = ['string', 'status', 'icon'
|
|
93
|
+
var supportedEditType = ['string', 'status', 'icon', 'user'];
|
|
96
94
|
return supportedEditType.includes(type);
|
|
97
95
|
};
|
|
98
96
|
var isEditTypeSelectable = exports.isEditTypeSelectable = function isEditTypeSelectable(type) {
|
|
@@ -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", {
|
|
@@ -16,7 +16,6 @@ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/h
|
|
|
16
16
|
var _reactIntlNext = require("react-intl-next");
|
|
17
17
|
var _avatar = _interopRequireDefault(require("@atlaskit/avatar"));
|
|
18
18
|
var _avatarGroup = _interopRequireDefault(require("@atlaskit/avatar-group"));
|
|
19
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
20
19
|
var _compiled = require("@atlaskit/primitives/compiled");
|
|
21
20
|
var _widthDetector = require("@atlaskit/width-detector");
|
|
22
21
|
var _messages = require("./messages");
|
|
@@ -60,13 +59,7 @@ var UserType = function UserType(_ref2) {
|
|
|
60
59
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
61
60
|
width = _useState2[0],
|
|
62
61
|
setWidth = _useState2[1];
|
|
63
|
-
|
|
64
|
-
if ((0, _platformFeatureFlags.fg)('platform-datasources-enable-two-way-sync-assignee')) {
|
|
65
|
-
multipleUsers = users.length === 1;
|
|
66
|
-
} else {
|
|
67
|
-
multipleUsers = users.length <= 1;
|
|
68
|
-
}
|
|
69
|
-
if (multipleUsers) {
|
|
62
|
+
if (users.length === 1) {
|
|
70
63
|
var _ref3 = users[0] || {},
|
|
71
64
|
avatarSource = _ref3.avatarSource,
|
|
72
65
|
_ref3$avatarSize = _ref3.avatarSize,
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
4
3
|
import IconEditType from './icon';
|
|
5
4
|
import StatusEditType from './status';
|
|
6
5
|
import TextEditType from './text';
|
|
@@ -77,7 +76,7 @@ export const editType = ({
|
|
|
77
76
|
};
|
|
78
77
|
};
|
|
79
78
|
export const isEditTypeSupported = type => {
|
|
80
|
-
const supportedEditType = ['string', 'status', 'icon',
|
|
79
|
+
const supportedEditType = ['string', 'status', 'icon', 'user'];
|
|
81
80
|
return supportedEditType.includes(type);
|
|
82
81
|
};
|
|
83
82
|
export const isEditTypeSelectable = type => {
|
|
@@ -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", {
|
|
@@ -7,7 +7,6 @@ import React, { useState } from 'react';
|
|
|
7
7
|
import { FormattedMessage } from 'react-intl-next';
|
|
8
8
|
import Avatar from '@atlaskit/avatar';
|
|
9
9
|
import AvatarGroup from '@atlaskit/avatar-group';
|
|
10
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
11
10
|
import { Box } from '@atlaskit/primitives/compiled';
|
|
12
11
|
import { WidthObserver } from '@atlaskit/width-detector';
|
|
13
12
|
import { userTypeMessages } from './messages';
|
|
@@ -47,13 +46,7 @@ const UserType = ({
|
|
|
47
46
|
users
|
|
48
47
|
}) => {
|
|
49
48
|
const [width, setWidth] = useState(null);
|
|
50
|
-
|
|
51
|
-
if (fg('platform-datasources-enable-two-way-sync-assignee')) {
|
|
52
|
-
multipleUsers = users.length === 1;
|
|
53
|
-
} else {
|
|
54
|
-
multipleUsers = users.length <= 1;
|
|
55
|
-
}
|
|
56
|
-
if (multipleUsers) {
|
|
49
|
+
if (users.length === 1) {
|
|
57
50
|
const {
|
|
58
51
|
avatarSource,
|
|
59
52
|
avatarSize = 'small',
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
2
1
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
2
|
import _objectDestructuringEmpty from "@babel/runtime/helpers/objectDestructuringEmpty";
|
|
4
3
|
import _extends from "@babel/runtime/helpers/extends";
|
|
5
4
|
var _excluded = ["value"];
|
|
6
5
|
import React from 'react';
|
|
7
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
8
6
|
import IconEditType from './icon';
|
|
9
7
|
import StatusEditType from './status';
|
|
10
8
|
import TextEditType from './text';
|
|
@@ -86,7 +84,7 @@ export var editType = function editType(_ref) {
|
|
|
86
84
|
};
|
|
87
85
|
};
|
|
88
86
|
export var isEditTypeSupported = function isEditTypeSupported(type) {
|
|
89
|
-
var supportedEditType = ['string', 'status', 'icon'
|
|
87
|
+
var supportedEditType = ['string', 'status', 'icon', 'user'];
|
|
90
88
|
return supportedEditType.includes(type);
|
|
91
89
|
};
|
|
92
90
|
export var isEditTypeSelectable = function isEditTypeSelectable(type) {
|
|
@@ -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", {
|
|
@@ -10,7 +10,6 @@ import React, { useState } from 'react';
|
|
|
10
10
|
import { FormattedMessage } from 'react-intl-next';
|
|
11
11
|
import Avatar from '@atlaskit/avatar';
|
|
12
12
|
import AvatarGroup from '@atlaskit/avatar-group';
|
|
13
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
14
13
|
import { Box } from '@atlaskit/primitives/compiled';
|
|
15
14
|
import { WidthObserver } from '@atlaskit/width-detector';
|
|
16
15
|
import { userTypeMessages } from './messages';
|
|
@@ -52,13 +51,7 @@ var UserType = function UserType(_ref2) {
|
|
|
52
51
|
_useState2 = _slicedToArray(_useState, 2),
|
|
53
52
|
width = _useState2[0],
|
|
54
53
|
setWidth = _useState2[1];
|
|
55
|
-
|
|
56
|
-
if (fg('platform-datasources-enable-two-way-sync-assignee')) {
|
|
57
|
-
multipleUsers = users.length === 1;
|
|
58
|
-
} else {
|
|
59
|
-
multipleUsers = users.length <= 1;
|
|
60
|
-
}
|
|
61
|
-
if (multipleUsers) {
|
|
54
|
+
if (users.length === 1) {
|
|
62
55
|
var _ref3 = users[0] || {},
|
|
63
56
|
avatarSource = _ref3.avatarSource,
|
|
64
57
|
_ref3$avatarSize = _ref3.avatarSize,
|
|
@@ -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,21 +19,26 @@ type JiraIssuesTableViewProps = {
|
|
|
20
19
|
*/
|
|
21
20
|
DatasourceTable?: typeof DataSourceTableViewNoSuspense | typeof DatasourceTableView;
|
|
22
21
|
mockDatasourceFetchRequest?: boolean;
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
} & Partial<
|
|
23
|
+
Pick<DatasourceTableViewProps, 'parameters' | 'scrollableContainerHeight' | 'visibleColumnKeys'>
|
|
24
|
+
>;
|
|
25
25
|
|
|
26
26
|
const JiraIssuesTableView = ({
|
|
27
|
-
parameters,
|
|
28
27
|
DatasourceTable = DataSourceTableViewNoSuspense,
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
...props
|
|
29
|
+
}: Omit<JiraIssuesTableViewProps, 'mockDatasourceFetchRequest'>) => {
|
|
30
|
+
const {
|
|
31
|
+
parameters: { cloudId = 'some-cloud-id', jql = 'some-jql' } = {},
|
|
32
|
+
scrollableContainerHeight,
|
|
33
|
+
visibleColumnKeys: initialVisibleColumnKeys,
|
|
34
|
+
} = props;
|
|
31
35
|
|
|
32
|
-
const
|
|
36
|
+
const parameters = useMemo(
|
|
33
37
|
() => ({
|
|
34
38
|
cloudId,
|
|
35
|
-
jql
|
|
39
|
+
jql,
|
|
36
40
|
}),
|
|
37
|
-
[cloudId],
|
|
41
|
+
[cloudId, jql],
|
|
38
42
|
);
|
|
39
43
|
|
|
40
44
|
const {
|
|
@@ -51,25 +55,27 @@ const JiraIssuesTableView = ({
|
|
|
51
55
|
link: 350,
|
|
52
56
|
labels: 100,
|
|
53
57
|
priority: 200,
|
|
58
|
+
description: 650,
|
|
54
59
|
},
|
|
60
|
+
visibleColumnKeys: initialVisibleColumnKeys,
|
|
55
61
|
});
|
|
56
62
|
|
|
57
63
|
return (
|
|
58
64
|
<DatasourceTable
|
|
59
65
|
datasourceId={'some-datasource-id'}
|
|
60
|
-
parameters={
|
|
66
|
+
parameters={parameters}
|
|
61
67
|
visibleColumnKeys={visibleColumnKeys}
|
|
62
68
|
onVisibleColumnKeysChange={onVisibleColumnKeysChange}
|
|
63
69
|
columnCustomSizes={columnCustomSizes}
|
|
64
70
|
onColumnResize={onColumnResize}
|
|
65
71
|
onWrappedColumnChange={onWrappedColumnChange}
|
|
66
72
|
wrappedColumnKeys={wrappedColumnKeys}
|
|
73
|
+
scrollableContainerHeight={scrollableContainerHeight}
|
|
67
74
|
/>
|
|
68
75
|
);
|
|
69
76
|
};
|
|
70
77
|
|
|
71
78
|
export const ExampleJiraIssuesTableView = ({
|
|
72
|
-
parameters,
|
|
73
79
|
mockDatasourceFetchRequest = true,
|
|
74
80
|
...props
|
|
75
81
|
}: JiraIssuesTableViewProps) => {
|
|
@@ -81,7 +87,7 @@ export const ExampleJiraIssuesTableView = ({
|
|
|
81
87
|
<DatasourceExperienceIdProvider>
|
|
82
88
|
<IntlMessagesProvider loaderFn={fetchMessagesForLocale}>
|
|
83
89
|
<SmartCardProvider client={new SmartLinkClient()}>
|
|
84
|
-
<JiraIssuesTableView
|
|
90
|
+
<JiraIssuesTableView {...props} />
|
|
85
91
|
</SmartCardProvider>
|
|
86
92
|
</IntlMessagesProvider>
|
|
87
93
|
</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.29.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",
|
|
@@ -158,9 +160,6 @@
|
|
|
158
160
|
"add-disablesiteselector": {
|
|
159
161
|
"type": "boolean"
|
|
160
162
|
},
|
|
161
|
-
"platform-datasources-enable-two-way-sync-assignee": {
|
|
162
|
-
"type": "boolean"
|
|
163
|
-
},
|
|
164
163
|
"confluence-issue-terminology-refresh": {
|
|
165
164
|
"type": "boolean"
|
|
166
165
|
},
|
|
@@ -190,6 +189,9 @@
|
|
|
190
189
|
},
|
|
191
190
|
"navx-1845-sllv-autofocus-first-interactive-element": {
|
|
192
191
|
"type": "boolean"
|
|
192
|
+
},
|
|
193
|
+
"platform_navx_jira_sllv_rich_text_gate": {
|
|
194
|
+
"type": "boolean"
|
|
193
195
|
}
|
|
194
196
|
},
|
|
195
197
|
"compassUnitTestMetricSourceId": "ari:cloud:compass:a436116f-02ce-4520-8fbb-7301462a1674:metric-source/c5751cc6-3513-4070-9deb-af31e86aed34/9c893299-a527-4457-9b46-f3bc4c828766"
|