@atlaskit/link-datasource 2.9.2 → 2.9.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 +18 -0
- package/dist/cjs/analytics/generated/use-analytics-events.js +1 -1
- package/dist/cjs/ui/issue-like-table/draggable-table-heading.js +14 -2
- package/dist/cjs/ui/issue-like-table/index.js +87 -70
- package/dist/cjs/ui/issue-like-table/styled.js +22 -3
- package/dist/cjs/ui/issue-like-table/table-cell-content/index.js +98 -23
- package/dist/es2019/analytics/generated/use-analytics-events.js +1 -1
- package/dist/es2019/ui/issue-like-table/draggable-table-heading.js +16 -1
- package/dist/es2019/ui/issue-like-table/index.js +27 -11
- package/dist/es2019/ui/issue-like-table/styled.js +28 -0
- package/dist/es2019/ui/issue-like-table/table-cell-content/index.js +96 -18
- package/dist/esm/analytics/generated/use-analytics-events.js +1 -1
- package/dist/esm/ui/issue-like-table/draggable-table-heading.js +14 -2
- package/dist/esm/ui/issue-like-table/index.js +88 -71
- package/dist/esm/ui/issue-like-table/styled.js +21 -2
- package/dist/esm/ui/issue-like-table/table-cell-content/index.js +98 -23
- package/dist/types/analytics/generated/analytics.types.d.ts +13 -8
- package/dist/types/ui/issue-like-table/styled.d.ts +4 -0
- package/dist/types/ui/issue-like-table/table-cell-content/index.d.ts +3 -2
- package/dist/types-ts4.5/analytics/generated/analytics.types.d.ts +13 -8
- package/dist/types-ts4.5/ui/issue-like-table/styled.d.ts +4 -0
- package/dist/types-ts4.5/ui/issue-like-table/table-cell-content/index.d.ts +3 -2
- package/package.json +6 -3
|
@@ -1,18 +1,49 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { useIntl } from 'react-intl-next';
|
|
3
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
4
|
+
import { Box, xcss } from '@atlaskit/primitives';
|
|
3
5
|
import Tooltip from '@atlaskit/tooltip';
|
|
4
6
|
import { useDatasourceItem } from '../../../state';
|
|
5
7
|
import { stringifyType } from '../render-type';
|
|
6
8
|
import { TruncateTextTag } from '../truncate-text-tag';
|
|
7
|
-
|
|
9
|
+
const truncateTextStyles = xcss({
|
|
10
|
+
textOverflow: 'ellipsis',
|
|
11
|
+
overflow: 'hidden',
|
|
12
|
+
width: '100%'
|
|
13
|
+
});
|
|
14
|
+
const TooltipWrapper = ({
|
|
8
15
|
columnKey,
|
|
9
|
-
|
|
16
|
+
datasourceTypeWithValues: {
|
|
17
|
+
type,
|
|
18
|
+
values
|
|
19
|
+
},
|
|
20
|
+
wrappedColumnKeys,
|
|
21
|
+
children
|
|
22
|
+
}) => {
|
|
23
|
+
const intl = useIntl();
|
|
24
|
+
const stringifiedContent = values.map(value => stringifyType({
|
|
25
|
+
type,
|
|
26
|
+
value
|
|
27
|
+
}, intl.formatMessage, intl.formatDate)).filter(value => value !== '').join(', ');
|
|
28
|
+
if (stringifiedContent && !(wrappedColumnKeys !== null && wrappedColumnKeys !== void 0 && wrappedColumnKeys.includes(columnKey))) {
|
|
29
|
+
return /*#__PURE__*/React.createElement(Tooltip
|
|
30
|
+
// @ts-ignore: [PIT-1685] Fails in post-office due to backwards incompatibility issue with React 18
|
|
31
|
+
, {
|
|
32
|
+
tag: TruncateTextTag,
|
|
33
|
+
content: stringifiedContent,
|
|
34
|
+
testId: "issues-table-cell-tooltip"
|
|
35
|
+
}, children);
|
|
36
|
+
}
|
|
37
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, children);
|
|
38
|
+
};
|
|
39
|
+
const ReadOnlyCell = ({
|
|
10
40
|
id,
|
|
41
|
+
columnType,
|
|
42
|
+
wrappedColumnKeys = [],
|
|
11
43
|
renderItem,
|
|
12
|
-
|
|
44
|
+
columnKey
|
|
13
45
|
}) => {
|
|
14
46
|
var _rowData$columnKey;
|
|
15
|
-
const intl = useIntl();
|
|
16
47
|
const rowData = useDatasourceItem({
|
|
17
48
|
id
|
|
18
49
|
});
|
|
@@ -23,22 +54,69 @@ export const TableCellContent = ({
|
|
|
23
54
|
// Need to make sure we keep falsy values like 0 and '', as well as the boolean false.
|
|
24
55
|
const value = (_rowData$columnKey = rowData[columnKey]) === null || _rowData$columnKey === void 0 ? void 0 : _rowData$columnKey.data;
|
|
25
56
|
const values = Array.isArray(value) ? value : [value];
|
|
26
|
-
const
|
|
57
|
+
const datasourceTypeWithValues = {
|
|
27
58
|
type: columnType,
|
|
28
59
|
values
|
|
60
|
+
};
|
|
61
|
+
return /*#__PURE__*/React.createElement(TooltipWrapper, {
|
|
62
|
+
columnKey: columnKey,
|
|
63
|
+
datasourceTypeWithValues: datasourceTypeWithValues,
|
|
64
|
+
wrappedColumnKeys: wrappedColumnKeys
|
|
65
|
+
}, renderItem(datasourceTypeWithValues));
|
|
66
|
+
};
|
|
67
|
+
const InlineEditableCell = ({
|
|
68
|
+
id,
|
|
69
|
+
columnKey,
|
|
70
|
+
columnType,
|
|
71
|
+
renderItem,
|
|
72
|
+
wrappedColumnKeys
|
|
73
|
+
}) => {
|
|
74
|
+
var _rowData$columnKey2;
|
|
75
|
+
const rowData = useDatasourceItem({
|
|
76
|
+
id
|
|
29
77
|
});
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
value
|
|
33
|
-
}, intl.formatMessage, intl.formatDate)).filter(value => value !== '').join(', ');
|
|
34
|
-
if (stringifiedContent && !(wrappedColumnKeys !== null && wrappedColumnKeys !== void 0 && wrappedColumnKeys.includes(columnKey))) {
|
|
35
|
-
return /*#__PURE__*/React.createElement(Tooltip
|
|
36
|
-
// @ts-ignore: [PIT-1685] Fails in post-office due to backwards incompatibility issue with React 18
|
|
37
|
-
, {
|
|
38
|
-
tag: TruncateTextTag,
|
|
39
|
-
content: stringifiedContent,
|
|
40
|
-
testId: "issues-table-cell-tooltip"
|
|
41
|
-
}, renderedValues);
|
|
78
|
+
if (!rowData || !columnKey || !rowData[columnKey]) {
|
|
79
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null);
|
|
42
80
|
}
|
|
43
|
-
|
|
81
|
+
|
|
82
|
+
// Need to make sure we keep falsy values like 0 and '', as well as the boolean false.
|
|
83
|
+
const value = (_rowData$columnKey2 = rowData[columnKey]) === null || _rowData$columnKey2 === void 0 ? void 0 : _rowData$columnKey2.data;
|
|
84
|
+
const values = Array.isArray(value) ? value : [value];
|
|
85
|
+
const datasourceTypeWithValues = {
|
|
86
|
+
type: columnType,
|
|
87
|
+
values
|
|
88
|
+
};
|
|
89
|
+
return /*#__PURE__*/React.createElement(TooltipWrapper, {
|
|
90
|
+
columnKey: columnKey,
|
|
91
|
+
datasourceTypeWithValues: datasourceTypeWithValues,
|
|
92
|
+
wrappedColumnKeys: wrappedColumnKeys
|
|
93
|
+
}, /*#__PURE__*/React.createElement(Box, {
|
|
94
|
+
testId: 'inline-edit-read-view',
|
|
95
|
+
paddingInline: 'space.100',
|
|
96
|
+
paddingBlock: 'space.050',
|
|
97
|
+
xcss: truncateTextStyles
|
|
98
|
+
}, renderItem(datasourceTypeWithValues)));
|
|
99
|
+
};
|
|
100
|
+
export const TableCellContent = ({
|
|
101
|
+
columnKey,
|
|
102
|
+
columnType,
|
|
103
|
+
id,
|
|
104
|
+
renderItem,
|
|
105
|
+
wrappedColumnKeys
|
|
106
|
+
}) => {
|
|
107
|
+
// eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
|
|
108
|
+
const renderedContent = fg('platform-datasources-enable-two-way-sync') ? /*#__PURE__*/React.createElement(InlineEditableCell, {
|
|
109
|
+
id: id,
|
|
110
|
+
columnKey: columnKey,
|
|
111
|
+
columnType: columnType,
|
|
112
|
+
renderItem: renderItem,
|
|
113
|
+
wrappedColumnKeys: wrappedColumnKeys
|
|
114
|
+
}) : /*#__PURE__*/React.createElement(ReadOnlyCell, {
|
|
115
|
+
id: id,
|
|
116
|
+
columnKey: columnKey,
|
|
117
|
+
columnType: columnType,
|
|
118
|
+
wrappedColumnKeys: wrappedColumnKeys,
|
|
119
|
+
renderItem: renderItem
|
|
120
|
+
});
|
|
121
|
+
return renderedContent;
|
|
44
122
|
};
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Generates Typescript types for analytics events from analytics.spec.yaml
|
|
5
5
|
*
|
|
6
|
-
* @codegen <<SignedSource::
|
|
6
|
+
* @codegen <<SignedSource::21ae373abad7c370a8682ddcd3a7ed21>>
|
|
7
7
|
* @codegenCommand yarn workspace @atlassian/analytics-tooling run analytics:codegen link-datasource
|
|
8
8
|
*/
|
|
9
9
|
import { useCallback } from 'react';
|
|
@@ -30,6 +30,7 @@ import { disableNativeDragPreview } from '@atlaskit/pragmatic-drag-and-drop/elem
|
|
|
30
30
|
import { pointerOutsideOfPreview } from '@atlaskit/pragmatic-drag-and-drop/element/pointer-outside-of-preview';
|
|
31
31
|
import { setCustomNativeDragPreview } from '@atlaskit/pragmatic-drag-and-drop/element/set-custom-native-drag-preview';
|
|
32
32
|
import { preventUnhandled } from '@atlaskit/pragmatic-drag-and-drop/prevent-unhandled';
|
|
33
|
+
import { useDatasourceAnalyticsEvents } from '../../analytics';
|
|
33
34
|
import { GlyphPlaceholder, UnwrapTextIcon, WrapTextIcon } from './custom-icons';
|
|
34
35
|
import { issueLikeTableMessages } from './messages';
|
|
35
36
|
import { TableHeading } from './styled';
|
|
@@ -110,6 +111,8 @@ export var DraggableTableHeading = function DraggableTableHeading(_ref) {
|
|
|
110
111
|
onWidthChange = _ref.onWidthChange,
|
|
111
112
|
isWrapped = _ref.isWrapped,
|
|
112
113
|
onIsWrappedChange = _ref.onIsWrappedChange;
|
|
114
|
+
var _useDatasourceAnalyti = useDatasourceAnalyticsEvents(),
|
|
115
|
+
fireEvent = _useDatasourceAnalyti.fireEvent;
|
|
113
116
|
var mainHeaderCellRef = useRef(null);
|
|
114
117
|
var columnResizeHandleRef = useRef(null);
|
|
115
118
|
var _useState = useState(idleState),
|
|
@@ -332,8 +335,17 @@ export var DraggableTableHeading = function DraggableTableHeading(_ref) {
|
|
|
332
335
|
return setIsDropdownOpen(isOpen);
|
|
333
336
|
}, []);
|
|
334
337
|
var toggleWrap = useCallback(function () {
|
|
335
|
-
|
|
336
|
-
|
|
338
|
+
if (!onIsWrappedChange) {
|
|
339
|
+
return;
|
|
340
|
+
}
|
|
341
|
+
var nextIsWrap = !(isWrapped || false);
|
|
342
|
+
if (nextIsWrap) {
|
|
343
|
+
fireEvent('ui.button.clicked.wrap', {});
|
|
344
|
+
} else {
|
|
345
|
+
fireEvent('ui.button.clicked.unwrap', {});
|
|
346
|
+
}
|
|
347
|
+
onIsWrappedChange(nextIsWrap);
|
|
348
|
+
}, [fireEvent, isWrapped, onIsWrappedChange]);
|
|
337
349
|
return jsx(TableHeading, {
|
|
338
350
|
ref: mainHeaderCellRef,
|
|
339
351
|
"data-testid": "".concat(id, "-column-heading"),
|
|
@@ -37,7 +37,7 @@ import { DragColumnPreview } from './drag-column-preview';
|
|
|
37
37
|
import { DraggableTableHeading } from './draggable-table-heading';
|
|
38
38
|
import TableEmptyState from './empty-state';
|
|
39
39
|
import { renderType, stringifyType } from './render-type';
|
|
40
|
-
import { Table, TableCell, TableHeading, withTablePluginHeaderPrefix } from './styled';
|
|
40
|
+
import { InlineEditableTableCell, Table, TableCell, TableHeading, withTablePluginHeaderPrefix } from './styled';
|
|
41
41
|
import { TableCellContent } from './table-cell-content';
|
|
42
42
|
import { TruncateTextTag } from './truncate-text-tag';
|
|
43
43
|
import { useIsOnScreen } from './useIsOnScreen';
|
|
@@ -456,69 +456,72 @@ export var IssueLikeDataTableView = function IssueLikeDataTableView(_ref5) {
|
|
|
456
456
|
}));
|
|
457
457
|
}, [visibleColumnKeys, onVisibleColumnKeysChange, tableId, hasData]);
|
|
458
458
|
var tableRows = useMemo(function () {
|
|
459
|
-
return
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
id: id,
|
|
459
|
+
return (
|
|
460
|
+
// eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
|
|
461
|
+
fg('enable_datasource_react_sweet_state') ? itemIds.map(function (id, rowIndex) {
|
|
462
|
+
return {
|
|
463
|
+
key: id,
|
|
464
|
+
cells: visibleSortedColumns.map(function (_ref12, cellIndex) {
|
|
465
|
+
var key = _ref12.key,
|
|
466
|
+
type = _ref12.type;
|
|
467
|
+
return {
|
|
468
|
+
key: key,
|
|
470
469
|
columnKey: key,
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
values:
|
|
495
|
-
|
|
496
|
-
var stringifiedContent = values.map(function (value) {
|
|
497
|
-
return stringifyType({
|
|
470
|
+
content: jsx(TableCellContent, {
|
|
471
|
+
id: id,
|
|
472
|
+
columnKey: key,
|
|
473
|
+
columnType: type,
|
|
474
|
+
wrappedColumnKeys: wrappedColumnKeys,
|
|
475
|
+
renderItem: renderItem
|
|
476
|
+
}),
|
|
477
|
+
width: getColumnWidth(key, type, cellIndex === visibleSortedColumns.length - 1)
|
|
478
|
+
};
|
|
479
|
+
}),
|
|
480
|
+
ref: rowIndex === items.length - 1 ? function (el) {
|
|
481
|
+
return setLastRowElement(el);
|
|
482
|
+
} : undefined
|
|
483
|
+
};
|
|
484
|
+
}) : items.map(function (newRowData, rowIndex) {
|
|
485
|
+
return {
|
|
486
|
+
key: "".concat(identityColumnKey && newRowData[identityColumnKey] && newRowData[identityColumnKey].data || rowIndex),
|
|
487
|
+
cells: visibleSortedColumns.map(function (_ref13, cellIndex) {
|
|
488
|
+
var _newRowData$key;
|
|
489
|
+
var key = _ref13.key,
|
|
490
|
+
type = _ref13.type;
|
|
491
|
+
// Need to make sure we keep falsy values like 0 and '', as well as the boolean false.
|
|
492
|
+
var value = (_newRowData$key = newRowData[key]) === null || _newRowData$key === void 0 ? void 0 : _newRowData$key.data;
|
|
493
|
+
var values = Array.isArray(value) ? value : [value];
|
|
494
|
+
var renderedValues = renderItem({
|
|
498
495
|
type: type,
|
|
499
|
-
|
|
500
|
-
}
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
496
|
+
values: values
|
|
497
|
+
});
|
|
498
|
+
var stringifiedContent = values.map(function (value) {
|
|
499
|
+
return stringifyType({
|
|
500
|
+
type: type,
|
|
501
|
+
value: value
|
|
502
|
+
}, intl.formatMessage, intl.formatDate);
|
|
503
|
+
}).filter(function (value) {
|
|
504
|
+
return value !== '';
|
|
505
|
+
}).join(', ');
|
|
506
|
+
var contentComponent = stringifiedContent && !(wrappedColumnKeys !== null && wrappedColumnKeys !== void 0 && wrappedColumnKeys.includes(key)) ? jsx(Tooltip
|
|
507
|
+
// @ts-ignore: [PIT-1685] Fails in post-office due to backwards incompatibility issue with React 18
|
|
508
|
+
, {
|
|
509
|
+
tag: TruncateTextTag,
|
|
510
|
+
content: stringifiedContent,
|
|
511
|
+
testId: "issues-table-cell-tooltip"
|
|
512
|
+
}, renderedValues) : renderedValues;
|
|
513
|
+
return {
|
|
514
|
+
key: key,
|
|
515
|
+
content: contentComponent,
|
|
516
|
+
width: getColumnWidth(key, type, cellIndex === visibleSortedColumns.length - 1)
|
|
517
|
+
};
|
|
518
|
+
}),
|
|
519
|
+
ref: rowIndex === items.length - 1 ? function (el) {
|
|
520
|
+
return setLastRowElement(el);
|
|
521
|
+
} : undefined
|
|
522
|
+
};
|
|
523
|
+
})
|
|
524
|
+
);
|
|
522
525
|
}, [items, itemIds, renderItem, wrappedColumnKeys, visibleSortedColumns, getColumnWidth, intl.formatMessage, intl.formatDate]);
|
|
523
526
|
var rows = useMemo(function () {
|
|
524
527
|
if (status !== 'loading') {
|
|
@@ -699,15 +702,29 @@ export var IssueLikeDataTableView = function IssueLikeDataTableView(_ref5) {
|
|
|
699
702
|
paddingBlock: "var(--ds-space-100, 8px)"
|
|
700
703
|
});
|
|
701
704
|
}
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
705
|
+
|
|
706
|
+
// eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
|
|
707
|
+
if (fg('platform-datasources-enable-two-way-sync')) {
|
|
708
|
+
return jsx(InlineEditableTableCell, {
|
|
709
|
+
key: cellKey,
|
|
710
|
+
"data-testid": testId && "".concat(testId, "--cell-").concat(cellIndex),
|
|
711
|
+
colSpan: isEditable && isLastCell ? 2 : undefined
|
|
712
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
713
|
+
,
|
|
714
|
+
style: loadingRowStyle,
|
|
715
|
+
css: [wrappedColumnKeys !== null && wrappedColumnKeys !== void 0 && wrappedColumnKeys.includes(cellKey) ? null : truncateStyles]
|
|
716
|
+
}, content);
|
|
717
|
+
} else {
|
|
718
|
+
return jsx(TableCell, {
|
|
719
|
+
key: cellKey,
|
|
720
|
+
"data-testid": testId && "".concat(testId, "--cell-").concat(cellIndex),
|
|
721
|
+
colSpan: isEditable && isLastCell ? 2 : undefined
|
|
722
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
723
|
+
,
|
|
724
|
+
style: loadingRowStyle,
|
|
725
|
+
css: [wrappedColumnKeys !== null && wrappedColumnKeys !== void 0 && wrappedColumnKeys.includes(cellKey) ? null : truncateStyles]
|
|
726
|
+
}, content);
|
|
727
|
+
}
|
|
711
728
|
}));
|
|
712
729
|
}))));
|
|
713
730
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
var _styled$th, _styled$td;
|
|
2
|
+
var _styled$th, _styled$td, _styled$td2;
|
|
3
3
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
4
4
|
import styled from '@emotion/styled';
|
|
5
5
|
import { N40 } from '@atlaskit/theme/colors';
|
|
@@ -87,4 +87,23 @@ export var TableCell = styled.td((_styled$td = {}, _defineProperty(_styled$td, "
|
|
|
87
87
|
paddingRight: "var(--ds-space-100, 8px)"
|
|
88
88
|
}), _defineProperty(_styled$td, "& [data-testid='inline-card-icon-and-title'], " + "& [data-testid='button-connect-account'] > span", {
|
|
89
89
|
whiteSpace: 'unset'
|
|
90
|
-
}), _styled$td));
|
|
90
|
+
}), _styled$td));
|
|
91
|
+
|
|
92
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled, @atlaskit/ui-styling-standard/no-exported-styles -- To migrate as part of go/ui-styling-standard
|
|
93
|
+
export var InlineEditableTableCell = styled.td((_styled$td2 = {}, _defineProperty(_styled$td2, "".concat(withTablePluginBodyPrefix()), {
|
|
94
|
+
/* First section here is to override things editor table plugin css defines */
|
|
95
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
96
|
+
font: fieldTextFontSize,
|
|
97
|
+
padding: "var(--ds-space-0, 0)".concat(" ", "var(--ds-space-0, 0)"),
|
|
98
|
+
border: 0,
|
|
99
|
+
minWidth: 'auto',
|
|
100
|
+
verticalAlign: 'inherit',
|
|
101
|
+
boxSizing: 'border-box',
|
|
102
|
+
borderRight: "0.5px solid ".concat("var(--ds-border, ".concat(N40, ")")),
|
|
103
|
+
borderBottom: "0.5px solid ".concat("var(--ds-border, ".concat(N40, ")")),
|
|
104
|
+
overflow: 'hidden'
|
|
105
|
+
}), _defineProperty(_styled$td2, "".concat(withTablePluginBodyPrefix('&:last-child')), {
|
|
106
|
+
borderRight: 0
|
|
107
|
+
}), _defineProperty(_styled$td2, "& [data-testid='inline-card-icon-and-title'], " + "& [data-testid='button-connect-account'] > span", {
|
|
108
|
+
whiteSpace: 'unset'
|
|
109
|
+
}), _styled$td2));
|
|
@@ -1,34 +1,27 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { useIntl } from 'react-intl-next';
|
|
3
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
4
|
+
import { Box, xcss } from '@atlaskit/primitives';
|
|
3
5
|
import Tooltip from '@atlaskit/tooltip';
|
|
4
6
|
import { useDatasourceItem } from '../../../state';
|
|
5
7
|
import { stringifyType } from '../render-type';
|
|
6
8
|
import { TruncateTextTag } from '../truncate-text-tag';
|
|
7
|
-
|
|
8
|
-
|
|
9
|
+
var truncateTextStyles = xcss({
|
|
10
|
+
textOverflow: 'ellipsis',
|
|
11
|
+
overflow: 'hidden',
|
|
12
|
+
width: '100%'
|
|
13
|
+
});
|
|
14
|
+
var TooltipWrapper = function TooltipWrapper(_ref) {
|
|
9
15
|
var columnKey = _ref.columnKey,
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
wrappedColumnKeys = _ref.wrappedColumnKeys
|
|
16
|
+
_ref$datasourceTypeWi = _ref.datasourceTypeWithValues,
|
|
17
|
+
type = _ref$datasourceTypeWi.type,
|
|
18
|
+
values = _ref$datasourceTypeWi.values,
|
|
19
|
+
wrappedColumnKeys = _ref.wrappedColumnKeys,
|
|
20
|
+
children = _ref.children;
|
|
14
21
|
var intl = useIntl();
|
|
15
|
-
var rowData = useDatasourceItem({
|
|
16
|
-
id: id
|
|
17
|
-
});
|
|
18
|
-
if (!rowData || !columnKey || !rowData[columnKey]) {
|
|
19
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
// Need to make sure we keep falsy values like 0 and '', as well as the boolean false.
|
|
23
|
-
var value = (_rowData$columnKey = rowData[columnKey]) === null || _rowData$columnKey === void 0 ? void 0 : _rowData$columnKey.data;
|
|
24
|
-
var values = Array.isArray(value) ? value : [value];
|
|
25
|
-
var renderedValues = renderItem({
|
|
26
|
-
type: columnType,
|
|
27
|
-
values: values
|
|
28
|
-
});
|
|
29
22
|
var stringifiedContent = values.map(function (value) {
|
|
30
23
|
return stringifyType({
|
|
31
|
-
type:
|
|
24
|
+
type: type,
|
|
32
25
|
value: value
|
|
33
26
|
}, intl.formatMessage, intl.formatDate);
|
|
34
27
|
}).filter(function (value) {
|
|
@@ -41,7 +34,89 @@ export var TableCellContent = function TableCellContent(_ref) {
|
|
|
41
34
|
tag: TruncateTextTag,
|
|
42
35
|
content: stringifiedContent,
|
|
43
36
|
testId: "issues-table-cell-tooltip"
|
|
44
|
-
},
|
|
37
|
+
}, children);
|
|
45
38
|
}
|
|
46
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null,
|
|
39
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, children);
|
|
40
|
+
};
|
|
41
|
+
var ReadOnlyCell = function ReadOnlyCell(_ref2) {
|
|
42
|
+
var _rowData$columnKey;
|
|
43
|
+
var id = _ref2.id,
|
|
44
|
+
columnType = _ref2.columnType,
|
|
45
|
+
_ref2$wrappedColumnKe = _ref2.wrappedColumnKeys,
|
|
46
|
+
wrappedColumnKeys = _ref2$wrappedColumnKe === void 0 ? [] : _ref2$wrappedColumnKe,
|
|
47
|
+
renderItem = _ref2.renderItem,
|
|
48
|
+
columnKey = _ref2.columnKey;
|
|
49
|
+
var rowData = useDatasourceItem({
|
|
50
|
+
id: id
|
|
51
|
+
});
|
|
52
|
+
if (!rowData || !columnKey || !rowData[columnKey]) {
|
|
53
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// Need to make sure we keep falsy values like 0 and '', as well as the boolean false.
|
|
57
|
+
var value = (_rowData$columnKey = rowData[columnKey]) === null || _rowData$columnKey === void 0 ? void 0 : _rowData$columnKey.data;
|
|
58
|
+
var values = Array.isArray(value) ? value : [value];
|
|
59
|
+
var datasourceTypeWithValues = {
|
|
60
|
+
type: columnType,
|
|
61
|
+
values: values
|
|
62
|
+
};
|
|
63
|
+
return /*#__PURE__*/React.createElement(TooltipWrapper, {
|
|
64
|
+
columnKey: columnKey,
|
|
65
|
+
datasourceTypeWithValues: datasourceTypeWithValues,
|
|
66
|
+
wrappedColumnKeys: wrappedColumnKeys
|
|
67
|
+
}, renderItem(datasourceTypeWithValues));
|
|
68
|
+
};
|
|
69
|
+
var InlineEditableCell = function InlineEditableCell(_ref3) {
|
|
70
|
+
var _rowData$columnKey2;
|
|
71
|
+
var id = _ref3.id,
|
|
72
|
+
columnKey = _ref3.columnKey,
|
|
73
|
+
columnType = _ref3.columnType,
|
|
74
|
+
renderItem = _ref3.renderItem,
|
|
75
|
+
wrappedColumnKeys = _ref3.wrappedColumnKeys;
|
|
76
|
+
var rowData = useDatasourceItem({
|
|
77
|
+
id: id
|
|
78
|
+
});
|
|
79
|
+
if (!rowData || !columnKey || !rowData[columnKey]) {
|
|
80
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
// Need to make sure we keep falsy values like 0 and '', as well as the boolean false.
|
|
84
|
+
var value = (_rowData$columnKey2 = rowData[columnKey]) === null || _rowData$columnKey2 === void 0 ? void 0 : _rowData$columnKey2.data;
|
|
85
|
+
var values = Array.isArray(value) ? value : [value];
|
|
86
|
+
var datasourceTypeWithValues = {
|
|
87
|
+
type: columnType,
|
|
88
|
+
values: values
|
|
89
|
+
};
|
|
90
|
+
return /*#__PURE__*/React.createElement(TooltipWrapper, {
|
|
91
|
+
columnKey: columnKey,
|
|
92
|
+
datasourceTypeWithValues: datasourceTypeWithValues,
|
|
93
|
+
wrappedColumnKeys: wrappedColumnKeys
|
|
94
|
+
}, /*#__PURE__*/React.createElement(Box, {
|
|
95
|
+
testId: 'inline-edit-read-view',
|
|
96
|
+
paddingInline: 'space.100',
|
|
97
|
+
paddingBlock: 'space.050',
|
|
98
|
+
xcss: truncateTextStyles
|
|
99
|
+
}, renderItem(datasourceTypeWithValues)));
|
|
100
|
+
};
|
|
101
|
+
export var TableCellContent = function TableCellContent(_ref4) {
|
|
102
|
+
var columnKey = _ref4.columnKey,
|
|
103
|
+
columnType = _ref4.columnType,
|
|
104
|
+
id = _ref4.id,
|
|
105
|
+
renderItem = _ref4.renderItem,
|
|
106
|
+
wrappedColumnKeys = _ref4.wrappedColumnKeys;
|
|
107
|
+
// eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
|
|
108
|
+
var renderedContent = fg('platform-datasources-enable-two-way-sync') ? /*#__PURE__*/React.createElement(InlineEditableCell, {
|
|
109
|
+
id: id,
|
|
110
|
+
columnKey: columnKey,
|
|
111
|
+
columnType: columnType,
|
|
112
|
+
renderItem: renderItem,
|
|
113
|
+
wrappedColumnKeys: wrappedColumnKeys
|
|
114
|
+
}) : /*#__PURE__*/React.createElement(ReadOnlyCell, {
|
|
115
|
+
id: id,
|
|
116
|
+
columnKey: columnKey,
|
|
117
|
+
columnType: columnType,
|
|
118
|
+
wrappedColumnKeys: wrappedColumnKeys,
|
|
119
|
+
renderItem: renderItem
|
|
120
|
+
});
|
|
121
|
+
return renderedContent;
|
|
47
122
|
};
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Generates Typescript types for analytics events from analytics.spec.yaml
|
|
5
5
|
*
|
|
6
|
-
* @codegen <<SignedSource::
|
|
6
|
+
* @codegen <<SignedSource::a526398bbb8839b31c26c69ef2845c19>>
|
|
7
7
|
* @codegenCommand yarn workspace @atlassian/analytics-tooling run analytics:codegen link-datasource
|
|
8
8
|
*/
|
|
9
9
|
export type ComponentMetaDataType = {
|
|
@@ -16,10 +16,6 @@ export type AnalyticsContextAttributesType = {
|
|
|
16
16
|
dataProvider: 'jira-issues' | 'jsm-assets' | 'confluence-search';
|
|
17
17
|
};
|
|
18
18
|
export type DatasourceModalDialogViewedAttributesType = {};
|
|
19
|
-
export type LinkClickedPoweredByAttributesType = {
|
|
20
|
-
extensionKey: string;
|
|
21
|
-
componentHierarchy: string;
|
|
22
|
-
};
|
|
23
19
|
export type ModalReadyDatasourceAttributesType = {
|
|
24
20
|
instancesCount: number | null;
|
|
25
21
|
schemasCount: number | null;
|
|
@@ -57,6 +53,8 @@ export type ButtonClickedCancelAttributesType = {
|
|
|
57
53
|
extensionKey: string | null;
|
|
58
54
|
actions: unknown[];
|
|
59
55
|
};
|
|
56
|
+
export type ButtonClickedWrapAttributesType = {};
|
|
57
|
+
export type ButtonClickedUnwrapAttributesType = {};
|
|
60
58
|
export type LinkClickedSingleItemAttributesType = {
|
|
61
59
|
extensionKey: string | null;
|
|
62
60
|
destinationObjectTypes: unknown[];
|
|
@@ -126,6 +124,7 @@ export type ButtonClickedBasicSearchDropdownAttributesType = {
|
|
|
126
124
|
type: 'showMore';
|
|
127
125
|
};
|
|
128
126
|
export type AqlEditorSearchedAttributesType = {};
|
|
127
|
+
export type LinkClickedPoweredByAttributesType = {};
|
|
129
128
|
export type GetWorkspaceIdSuccessAttributesType = {};
|
|
130
129
|
export type GetWorkspaceIdFailedAttributesType = {
|
|
131
130
|
statusCodeGroup: '1xx' | '3xx' | '4xx' | '5xx' | 'unknown';
|
|
@@ -170,6 +169,12 @@ export type AnalyticsEventAttributes = {
|
|
|
170
169
|
/**
|
|
171
170
|
* Fired on cancel button click */
|
|
172
171
|
'ui.button.clicked.cancel': ButtonClickedCancelAttributesType;
|
|
172
|
+
/**
|
|
173
|
+
* Fired on wrap button click */
|
|
174
|
+
'ui.button.clicked.wrap': ButtonClickedWrapAttributesType;
|
|
175
|
+
/**
|
|
176
|
+
* Fired on unwrap button click */
|
|
177
|
+
'ui.button.clicked.unwrap': ButtonClickedUnwrapAttributesType;
|
|
173
178
|
/**
|
|
174
179
|
* Fired when user clicks on datasource items */
|
|
175
180
|
'ui.link.clicked.singleItem': LinkClickedSingleItemAttributesType;
|
|
@@ -215,12 +220,12 @@ export type AnalyticsEventAttributes = {
|
|
|
215
220
|
/**
|
|
216
221
|
* Fired when the “show more” button inside the dropdown menu is clicked */
|
|
217
222
|
'ui.button.clicked.basicSearchDropdown': ButtonClickedBasicSearchDropdownAttributesType;
|
|
218
|
-
/**
|
|
219
|
-
* Fired when the “show more” button inside the dropdown menu is clicked */
|
|
220
|
-
'ui.link.clicked.poweredBy': LinkClickedPoweredByAttributesType;
|
|
221
223
|
/**
|
|
222
224
|
* Fired when search is initiated via the search icon or enter key press for aql editor input field. */
|
|
223
225
|
'ui.aqlEditor.searched': AqlEditorSearchedAttributesType;
|
|
226
|
+
/**
|
|
227
|
+
* Fired when the power by link on the issue like table footer is clicked. */
|
|
228
|
+
'ui.link.clicked.poweredBy': LinkClickedPoweredByAttributesType;
|
|
224
229
|
/**
|
|
225
230
|
* Fired when fetching a workspace Id is successful. */
|
|
226
231
|
'operational.getWorkspaceId.success': GetWorkspaceIdSuccessAttributesType;
|
|
@@ -22,3 +22,7 @@ export declare const TableCell: import("@emotion/styled").StyledComponent<{
|
|
|
22
22
|
theme?: import("@emotion/react").Theme | undefined;
|
|
23
23
|
as?: import("react").ElementType<any> | undefined;
|
|
24
24
|
}, import("react").DetailedHTMLProps<import("react").TdHTMLAttributes<HTMLTableDataCellElement>, HTMLTableDataCellElement>, {}>;
|
|
25
|
+
export declare const InlineEditableTableCell: import("@emotion/styled").StyledComponent<{
|
|
26
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
27
|
+
as?: import("react").ElementType<any> | undefined;
|
|
28
|
+
}, import("react").DetailedHTMLProps<import("react").TdHTMLAttributes<HTMLTableDataCellElement>, HTMLTableDataCellElement>, {}>;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
import { type DatasourceType } from '@atlaskit/linking-types';
|
|
2
3
|
import { type TableViewPropsRenderType } from '../types';
|
|
3
4
|
interface TableCellContentProps {
|
|
4
5
|
id: string;
|
|
5
|
-
columnKey: string
|
|
6
|
-
columnType:
|
|
6
|
+
columnKey: string;
|
|
7
|
+
columnType: DatasourceType['type'];
|
|
7
8
|
/** Used to retrieve cell content from the store */
|
|
8
9
|
renderItem: TableViewPropsRenderType;
|
|
9
10
|
wrappedColumnKeys: string[] | undefined;
|