@atlaskit/link-datasource 2.9.1 → 2.9.3
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/analytics/generated/use-analytics-events.js +1 -1
- package/dist/cjs/hooks/useDatasourceTableState.js +2 -0
- package/dist/cjs/ui/assets-modal/modal/index.js +2 -0
- package/dist/cjs/ui/assets-modal/modal/render-assets-content/index.js +3 -1
- package/dist/cjs/ui/common/modal/datasources-table-in-modal-preview/index.js +2 -0
- package/dist/cjs/ui/confluence-search-modal/modal/ModalOld.js +3 -1
- package/dist/cjs/ui/datasource-table-view/datasourceTableView.js +2 -0
- package/dist/cjs/ui/issue-like-table/draggable-table-heading.js +14 -2
- package/dist/cjs/ui/issue-like-table/index.js +56 -66
- package/dist/cjs/ui/issue-like-table/styled.js +25 -3
- package/dist/cjs/ui/issue-like-table/table-cell-content/index.js +54 -0
- package/dist/cjs/ui/issue-like-table/truncate-text-tag/index.js +32 -0
- package/dist/cjs/ui/jira-issues-modal/modal/ModalOld.js +3 -1
- package/dist/es2019/analytics/generated/use-analytics-events.js +1 -1
- package/dist/es2019/hooks/useDatasourceTableState.js +2 -1
- package/dist/es2019/ui/assets-modal/modal/index.js +2 -0
- package/dist/es2019/ui/assets-modal/modal/render-assets-content/index.js +3 -1
- package/dist/es2019/ui/common/modal/datasources-table-in-modal-preview/index.js +2 -0
- package/dist/es2019/ui/confluence-search-modal/modal/ModalOld.js +3 -1
- package/dist/es2019/ui/datasource-table-view/datasourceTableView.js +2 -0
- package/dist/es2019/ui/issue-like-table/draggable-table-heading.js +16 -1
- package/dist/es2019/ui/issue-like-table/index.js +32 -52
- package/dist/es2019/ui/issue-like-table/styled.js +33 -0
- package/dist/es2019/ui/issue-like-table/table-cell-content/index.js +44 -0
- package/dist/es2019/ui/issue-like-table/truncate-text-tag/index.js +21 -0
- package/dist/es2019/ui/jira-issues-modal/modal/ModalOld.js +3 -1
- package/dist/esm/analytics/generated/use-analytics-events.js +1 -1
- package/dist/esm/hooks/useDatasourceTableState.js +2 -0
- package/dist/esm/ui/assets-modal/modal/index.js +2 -0
- package/dist/esm/ui/assets-modal/modal/render-assets-content/index.js +3 -1
- package/dist/esm/ui/common/modal/datasources-table-in-modal-preview/index.js +2 -0
- package/dist/esm/ui/confluence-search-modal/modal/ModalOld.js +3 -1
- package/dist/esm/ui/datasource-table-view/datasourceTableView.js +2 -0
- package/dist/esm/ui/issue-like-table/draggable-table-heading.js +14 -2
- package/dist/esm/ui/issue-like-table/index.js +53 -61
- package/dist/esm/ui/issue-like-table/styled.js +24 -2
- package/dist/esm/ui/issue-like-table/table-cell-content/index.js +47 -0
- package/dist/esm/ui/issue-like-table/truncate-text-tag/index.js +21 -0
- package/dist/esm/ui/jira-issues-modal/modal/ModalOld.js +3 -1
- package/dist/types/analytics/generated/analytics.types.d.ts +13 -8
- package/dist/types/hooks/useDatasourceTableState.d.ts +2 -0
- package/dist/types/ui/assets-modal/modal/render-assets-content/index.d.ts +1 -0
- package/dist/types/ui/issue-like-table/index.d.ts +1 -17
- 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 +12 -0
- package/dist/types/ui/issue-like-table/truncate-text-tag/index.d.ts +6 -0
- package/dist/types/ui/issue-like-table/types.d.ts +20 -1
- package/dist/types-ts4.5/analytics/generated/analytics.types.d.ts +13 -8
- package/dist/types-ts4.5/hooks/useDatasourceTableState.d.ts +2 -0
- package/dist/types-ts4.5/ui/assets-modal/modal/render-assets-content/index.d.ts +1 -0
- package/dist/types-ts4.5/ui/issue-like-table/index.d.ts +1 -17
- 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 +12 -0
- package/dist/types-ts4.5/ui/issue-like-table/truncate-text-tag/index.d.ts +6 -0
- package/dist/types-ts4.5/ui/issue-like-table/types.d.ts +20 -1
- package/examples-helpers/buildIssueLikeTable.tsx +2 -0
- package/package.json +9 -9
|
@@ -58,6 +58,7 @@ export const RenderAssetsContent = props => {
|
|
|
58
58
|
const {
|
|
59
59
|
status,
|
|
60
60
|
responseItems,
|
|
61
|
+
responseItemIds,
|
|
61
62
|
visibleColumnKeys,
|
|
62
63
|
onNextPage,
|
|
63
64
|
hasNextPage,
|
|
@@ -75,12 +76,13 @@ export const RenderAssetsContent = props => {
|
|
|
75
76
|
status: status,
|
|
76
77
|
columns: columns,
|
|
77
78
|
items: responseItems,
|
|
79
|
+
itemIds: responseItemIds,
|
|
78
80
|
hasNextPage: hasNextPage,
|
|
79
81
|
visibleColumnKeys: visibleColumnKeys || defaultVisibleColumnKeys,
|
|
80
82
|
onNextPage: onNextPage,
|
|
81
83
|
onLoadDatasourceDetails: loadDatasourceDetails,
|
|
82
84
|
onVisibleColumnKeysChange: onVisibleColumnKeysChange
|
|
83
|
-
})), [columns, defaultVisibleColumnKeys, hasNextPage, loadDatasourceDetails, onNextPage, onVisibleColumnKeysChange, responseItems, status, visibleColumnKeys]);
|
|
85
|
+
})), [columns, defaultVisibleColumnKeys, hasNextPage, loadDatasourceDetails, onNextPage, onVisibleColumnKeysChange, responseItems, responseItemIds, status, visibleColumnKeys]);
|
|
84
86
|
const renderAssetsContentView = useCallback(() => {
|
|
85
87
|
if (isFetchingInitialData) {
|
|
86
88
|
// Placing this check first as it's a priority before all others
|
|
@@ -17,6 +17,7 @@ const Table = props => {
|
|
|
17
17
|
status,
|
|
18
18
|
onNextPage,
|
|
19
19
|
responseItems,
|
|
20
|
+
responseItemIds,
|
|
20
21
|
hasNextPage,
|
|
21
22
|
columns,
|
|
22
23
|
defaultVisibleColumnKeys,
|
|
@@ -33,6 +34,7 @@ const Table = props => {
|
|
|
33
34
|
status: status,
|
|
34
35
|
columns: columns,
|
|
35
36
|
items: responseItems,
|
|
37
|
+
itemIds: responseItemIds,
|
|
36
38
|
hasNextPage: hasNextPage,
|
|
37
39
|
visibleColumnKeys: visibleColumnKeys || defaultVisibleColumnKeys,
|
|
38
40
|
onNextPage: handleOnNextPage,
|
|
@@ -101,6 +101,7 @@ export const PlainConfluenceSearchConfigModal = props => {
|
|
|
101
101
|
status,
|
|
102
102
|
onNextPage,
|
|
103
103
|
responseItems,
|
|
104
|
+
responseItemIds,
|
|
104
105
|
hasNextPage,
|
|
105
106
|
columns,
|
|
106
107
|
defaultVisibleColumnKeys,
|
|
@@ -178,6 +179,7 @@ export const PlainConfluenceSearchConfigModal = props => {
|
|
|
178
179
|
status: status,
|
|
179
180
|
columns: columns,
|
|
180
181
|
items: responseItems,
|
|
182
|
+
itemIds: responseItemIds,
|
|
181
183
|
hasNextPage: hasNextPage,
|
|
182
184
|
visibleColumnKeys: visibleColumnKeys || defaultVisibleColumnKeys,
|
|
183
185
|
onNextPage: onNextPage,
|
|
@@ -188,7 +190,7 @@ export const PlainConfluenceSearchConfigModal = props => {
|
|
|
188
190
|
onColumnResize: onColumnResize,
|
|
189
191
|
wrappedColumnKeys: wrappedColumnKeys,
|
|
190
192
|
onWrappedColumnChange: fg('platform.linking-platform.datasource-word_wrap') ? onWrappedColumnChange : undefined
|
|
191
|
-
})), [status, columns, responseItems, hasNextPage, visibleColumnKeys, defaultVisibleColumnKeys, onNextPage, loadDatasourceDetails, handleVisibleColumnKeysChange, extensionKey, columnCustomSizes, onColumnResize, wrappedColumnKeys, onWrappedColumnChange]);
|
|
193
|
+
})), [status, columns, responseItems, responseItemIds, hasNextPage, visibleColumnKeys, defaultVisibleColumnKeys, onNextPage, loadDatasourceDetails, handleVisibleColumnKeysChange, extensionKey, columnCustomSizes, onColumnResize, wrappedColumnKeys, onWrappedColumnChange]);
|
|
192
194
|
const resolvedWithNoResults = status === 'resolved' && !responseItems.length;
|
|
193
195
|
const hasConfluenceSearchParams = selectedConfluenceSite && searchString;
|
|
194
196
|
const selectedConfluenceSiteUrl = selectedConfluenceSite === null || selectedConfluenceSite === void 0 ? void 0 : selectedConfluenceSite.url;
|
|
@@ -47,6 +47,7 @@ const DatasourceTableViewWithoutAnalytics = ({
|
|
|
47
47
|
status,
|
|
48
48
|
onNextPage,
|
|
49
49
|
responseItems,
|
|
50
|
+
responseItemIds,
|
|
50
51
|
hasNextPage,
|
|
51
52
|
columns,
|
|
52
53
|
defaultVisibleColumnKeys,
|
|
@@ -163,6 +164,7 @@ const DatasourceTableViewWithoutAnalytics = ({
|
|
|
163
164
|
testId: 'datasource-table-view',
|
|
164
165
|
hasNextPage: hasNextPage,
|
|
165
166
|
items: responseItems,
|
|
167
|
+
itemIds: responseItemIds,
|
|
166
168
|
onNextPage: onNextPage,
|
|
167
169
|
onLoadDatasourceDetails: loadDatasourceDetails,
|
|
168
170
|
status: status,
|
|
@@ -24,6 +24,7 @@ import { disableNativeDragPreview } from '@atlaskit/pragmatic-drag-and-drop/elem
|
|
|
24
24
|
import { pointerOutsideOfPreview } from '@atlaskit/pragmatic-drag-and-drop/element/pointer-outside-of-preview';
|
|
25
25
|
import { setCustomNativeDragPreview } from '@atlaskit/pragmatic-drag-and-drop/element/set-custom-native-drag-preview';
|
|
26
26
|
import { preventUnhandled } from '@atlaskit/pragmatic-drag-and-drop/prevent-unhandled';
|
|
27
|
+
import { useDatasourceAnalyticsEvents } from '../../analytics';
|
|
27
28
|
import { GlyphPlaceholder, UnwrapTextIcon, WrapTextIcon } from './custom-icons';
|
|
28
29
|
import { issueLikeTableMessages } from './messages';
|
|
29
30
|
import { TableHeading } from './styled';
|
|
@@ -105,6 +106,9 @@ export const DraggableTableHeading = ({
|
|
|
105
106
|
isWrapped,
|
|
106
107
|
onIsWrappedChange
|
|
107
108
|
}) => {
|
|
109
|
+
const {
|
|
110
|
+
fireEvent
|
|
111
|
+
} = useDatasourceAnalyticsEvents();
|
|
108
112
|
const mainHeaderCellRef = useRef(null);
|
|
109
113
|
const columnResizeHandleRef = useRef(null);
|
|
110
114
|
const [state, setState] = useState(idleState);
|
|
@@ -311,7 +315,18 @@ export const DraggableTableHeading = ({
|
|
|
311
315
|
const onDropdownOpenChange = useCallback(({
|
|
312
316
|
isOpen
|
|
313
317
|
}) => setIsDropdownOpen(isOpen), []);
|
|
314
|
-
const toggleWrap = useCallback(() =>
|
|
318
|
+
const toggleWrap = useCallback(() => {
|
|
319
|
+
if (!onIsWrappedChange) {
|
|
320
|
+
return;
|
|
321
|
+
}
|
|
322
|
+
const nextIsWrap = !(isWrapped || false);
|
|
323
|
+
if (nextIsWrap) {
|
|
324
|
+
fireEvent('ui.button.clicked.wrap', {});
|
|
325
|
+
} else {
|
|
326
|
+
fireEvent('ui.button.clicked.unwrap', {});
|
|
327
|
+
}
|
|
328
|
+
onIsWrappedChange(nextIsWrap);
|
|
329
|
+
}, [fireEvent, isWrapped, onIsWrappedChange]);
|
|
315
330
|
return jsx(TableHeading, {
|
|
316
331
|
ref: mainHeaderCellRef,
|
|
317
332
|
"data-testid": `${id}-column-heading`,
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/extends";
|
|
2
1
|
/**
|
|
3
2
|
* @jsxRuntime classic
|
|
4
3
|
* @jsx jsx
|
|
5
4
|
*/
|
|
6
|
-
import {
|
|
5
|
+
import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
7
6
|
|
|
8
7
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
9
8
|
import { css, jsx } from '@emotion/react';
|
|
@@ -13,6 +12,7 @@ import debounce from 'lodash/debounce';
|
|
|
13
12
|
import { useIntl } from 'react-intl-next';
|
|
14
13
|
import invariant from 'tiny-invariant';
|
|
15
14
|
import { Skeleton } from '@atlaskit/linking-common';
|
|
15
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
16
16
|
import { extractClosestEdge } from '@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge';
|
|
17
17
|
import { reorderWithEdge } from '@atlaskit/pragmatic-drag-and-drop-hitbox/util/reorder-with-edge';
|
|
18
18
|
import { autoScroller } from '@atlaskit/pragmatic-drag-and-drop-react-beautiful-dnd-autoscroll';
|
|
@@ -30,7 +30,9 @@ import { DragColumnPreview } from './drag-column-preview';
|
|
|
30
30
|
import { DraggableTableHeading } from './draggable-table-heading';
|
|
31
31
|
import TableEmptyState from './empty-state';
|
|
32
32
|
import { renderType, stringifyType } from './render-type';
|
|
33
|
-
import {
|
|
33
|
+
import { Table, TableCell, TableHeading, withTablePluginHeaderPrefix } from './styled';
|
|
34
|
+
import { TableCellContent } from './table-cell-content';
|
|
35
|
+
import { TruncateTextTag } from './truncate-text-tag';
|
|
34
36
|
import { useIsOnScreen } from './useIsOnScreen';
|
|
35
37
|
import { COLUMN_BASE_WIDTH, getWidthCss } from './utils';
|
|
36
38
|
const tableSidePadding = "var(--ds-space-200, 16px)";
|
|
@@ -41,11 +43,6 @@ const tableHeadStyles = css({
|
|
|
41
43
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
42
44
|
zIndex: stickyTableHeadersIndex
|
|
43
45
|
});
|
|
44
|
-
const truncateTextStyles = css({
|
|
45
|
-
overflow: 'hidden',
|
|
46
|
-
textOverflow: 'ellipsis',
|
|
47
|
-
whiteSpace: 'nowrap'
|
|
48
|
-
});
|
|
49
46
|
const columnPickerWidth = 80;
|
|
50
47
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled -- To migrate as part of go/ui-styling-standard
|
|
51
48
|
const ColumnPickerHeader = styled.th({
|
|
@@ -72,39 +69,6 @@ const truncateStyles = css({
|
|
|
72
69
|
textOverflow: 'ellipsis',
|
|
73
70
|
whiteSpace: 'nowrap'
|
|
74
71
|
});
|
|
75
|
-
|
|
76
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled -- To migrate as part of go/ui-styling-standard
|
|
77
|
-
const TableCell = styled.td({
|
|
78
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
79
|
-
[`${withTablePluginBodyPrefix()}`]: {
|
|
80
|
-
/* First section here is to override things editor table plugin css defines */
|
|
81
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
82
|
-
font: fieldTextFontSize,
|
|
83
|
-
padding: `${"var(--ds-space-050, 4px)"} ${"var(--ds-space-100, 8px)"}`,
|
|
84
|
-
border: 0,
|
|
85
|
-
minWidth: 'auto',
|
|
86
|
-
verticalAlign: 'inherit',
|
|
87
|
-
boxSizing: 'border-box',
|
|
88
|
-
borderRight: `0.5px solid ${`var(--ds-border, ${N40})`}`,
|
|
89
|
-
borderBottom: `0.5px solid ${`var(--ds-border, ${N40})`}`,
|
|
90
|
-
overflow: 'hidden'
|
|
91
|
-
},
|
|
92
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
93
|
-
[`${withTablePluginBodyPrefix('&:first-child')}`]: {
|
|
94
|
-
paddingLeft: "var(--ds-space-100, 8px)"
|
|
95
|
-
},
|
|
96
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
97
|
-
[`${withTablePluginBodyPrefix('&:last-child')}`]: {
|
|
98
|
-
borderRight: 0,
|
|
99
|
-
paddingRight: "var(--ds-space-100, 8px)"
|
|
100
|
-
},
|
|
101
|
-
// Inline smart links are pretty opinionated about word-wrapping.
|
|
102
|
-
// We want it to be controlled by user, so we make it overflow and truncate by default.
|
|
103
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
104
|
-
["& [data-testid='inline-card-icon-and-title'], " + "& [data-testid='button-connect-account'] > span"]: {
|
|
105
|
-
whiteSpace: 'unset'
|
|
106
|
-
}
|
|
107
|
-
});
|
|
108
72
|
const tableContainerStyles = css({
|
|
109
73
|
borderRadius: 'inherit',
|
|
110
74
|
borderBottomLeftRadius: 0,
|
|
@@ -314,18 +278,12 @@ function getDefaultColumnWidth(key, type) {
|
|
|
314
278
|
return DEFAULT_WIDTH;
|
|
315
279
|
}
|
|
316
280
|
}
|
|
317
|
-
const TruncateTextTag = /*#__PURE__*/forwardRef((props, ref) => {
|
|
318
|
-
return jsx("span", _extends({
|
|
319
|
-
css: truncateTextStyles
|
|
320
|
-
}, props, {
|
|
321
|
-
ref: ref
|
|
322
|
-
}), props.children);
|
|
323
|
-
});
|
|
324
281
|
export const IssueLikeDataTableView = ({
|
|
325
282
|
testId,
|
|
326
283
|
onNextPage,
|
|
327
284
|
onLoadDatasourceDetails,
|
|
328
285
|
items,
|
|
286
|
+
itemIds,
|
|
329
287
|
columns,
|
|
330
288
|
renderItem = renderType,
|
|
331
289
|
visibleColumnKeys,
|
|
@@ -406,13 +364,13 @@ export const IssueLikeDataTableView = ({
|
|
|
406
364
|
const loadingRow = useMemo(() => ({
|
|
407
365
|
key: 'loading',
|
|
408
366
|
cells: headerColumns.map(column => ({
|
|
409
|
-
...column,
|
|
410
367
|
content: jsx(Skeleton, {
|
|
411
368
|
borderRadius: 8,
|
|
412
369
|
width: "100%",
|
|
413
370
|
height: 14,
|
|
414
371
|
testId: "issues-table-row-loading"
|
|
415
|
-
})
|
|
372
|
+
}),
|
|
373
|
+
key: column.key
|
|
416
374
|
}))
|
|
417
375
|
}), [headerColumns]);
|
|
418
376
|
useEffect(() => {
|
|
@@ -499,7 +457,29 @@ export const IssueLikeDataTableView = ({
|
|
|
499
457
|
}
|
|
500
458
|
}));
|
|
501
459
|
}, [visibleColumnKeys, onVisibleColumnKeysChange, tableId, hasData]);
|
|
502
|
-
const tableRows = useMemo(() =>
|
|
460
|
+
const tableRows = useMemo(() => fg('enable_datasource_react_sweet_state') ? itemIds.map((id, rowIndex) => {
|
|
461
|
+
return {
|
|
462
|
+
key: id,
|
|
463
|
+
cells: visibleSortedColumns.map(({
|
|
464
|
+
key,
|
|
465
|
+
type
|
|
466
|
+
}, cellIndex) => {
|
|
467
|
+
return {
|
|
468
|
+
key,
|
|
469
|
+
columnKey: key,
|
|
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 ? el => setLastRowElement(el) : undefined
|
|
481
|
+
};
|
|
482
|
+
}) : items.map((newRowData, rowIndex) => ({
|
|
503
483
|
key: `${identityColumnKey && newRowData[identityColumnKey] && newRowData[identityColumnKey].data || rowIndex}`,
|
|
504
484
|
cells: visibleSortedColumns.map(({
|
|
505
485
|
key,
|
|
@@ -531,7 +511,7 @@ export const IssueLikeDataTableView = ({
|
|
|
531
511
|
};
|
|
532
512
|
}),
|
|
533
513
|
ref: rowIndex === items.length - 1 ? el => setLastRowElement(el) : undefined
|
|
534
|
-
})), [items,
|
|
514
|
+
})), [items, itemIds, renderItem, wrappedColumnKeys, visibleSortedColumns, getColumnWidth, intl.formatMessage, intl.formatDate]);
|
|
535
515
|
const rows = useMemo(() => {
|
|
536
516
|
if (status !== 'loading') {
|
|
537
517
|
return tableRows;
|
|
@@ -75,4 +75,37 @@ export const TableHeading = styled.th({
|
|
|
75
75
|
overflow: 'hidden',
|
|
76
76
|
wordWrap: 'break-word'
|
|
77
77
|
}
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/ui-styling-standard/no-styled -- To migrate as part of go/ui-styling-standard
|
|
81
|
+
export const TableCell = styled.td({
|
|
82
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
83
|
+
[`${withTablePluginBodyPrefix()}`]: {
|
|
84
|
+
/* First section here is to override things editor table plugin css defines */
|
|
85
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
86
|
+
font: fieldTextFontSize,
|
|
87
|
+
padding: `${"var(--ds-space-050, 4px)"} ${"var(--ds-space-100, 8px)"}`,
|
|
88
|
+
border: 0,
|
|
89
|
+
minWidth: 'auto',
|
|
90
|
+
verticalAlign: 'inherit',
|
|
91
|
+
boxSizing: 'border-box',
|
|
92
|
+
borderRight: `0.5px solid ${`var(--ds-border, ${N40})`}`,
|
|
93
|
+
borderBottom: `0.5px solid ${`var(--ds-border, ${N40})`}`,
|
|
94
|
+
overflow: 'hidden'
|
|
95
|
+
},
|
|
96
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
97
|
+
[`${withTablePluginBodyPrefix('&:first-child')}`]: {
|
|
98
|
+
paddingLeft: "var(--ds-space-100, 8px)"
|
|
99
|
+
},
|
|
100
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
101
|
+
[`${withTablePluginBodyPrefix('&:last-child')}`]: {
|
|
102
|
+
borderRight: 0,
|
|
103
|
+
paddingRight: "var(--ds-space-100, 8px)"
|
|
104
|
+
},
|
|
105
|
+
// Inline smart links are pretty opinionated about word-wrapping.
|
|
106
|
+
// We want it to be controlled by user, so we make it overflow and truncate by default.
|
|
107
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
108
|
+
["& [data-testid='inline-card-icon-and-title'], " + "& [data-testid='button-connect-account'] > span"]: {
|
|
109
|
+
whiteSpace: 'unset'
|
|
110
|
+
}
|
|
78
111
|
});
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { useIntl } from 'react-intl-next';
|
|
3
|
+
import Tooltip from '@atlaskit/tooltip';
|
|
4
|
+
import { useDatasourceItem } from '../../../state';
|
|
5
|
+
import { stringifyType } from '../render-type';
|
|
6
|
+
import { TruncateTextTag } from '../truncate-text-tag';
|
|
7
|
+
export const TableCellContent = ({
|
|
8
|
+
columnKey,
|
|
9
|
+
columnType,
|
|
10
|
+
id,
|
|
11
|
+
renderItem,
|
|
12
|
+
wrappedColumnKeys
|
|
13
|
+
}) => {
|
|
14
|
+
var _rowData$columnKey;
|
|
15
|
+
const intl = useIntl();
|
|
16
|
+
const rowData = useDatasourceItem({
|
|
17
|
+
id
|
|
18
|
+
});
|
|
19
|
+
if (!rowData || !columnKey || !rowData[columnKey]) {
|
|
20
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
// Need to make sure we keep falsy values like 0 and '', as well as the boolean false.
|
|
24
|
+
const value = (_rowData$columnKey = rowData[columnKey]) === null || _rowData$columnKey === void 0 ? void 0 : _rowData$columnKey.data;
|
|
25
|
+
const values = Array.isArray(value) ? value : [value];
|
|
26
|
+
const renderedValues = renderItem({
|
|
27
|
+
type: columnType,
|
|
28
|
+
values
|
|
29
|
+
});
|
|
30
|
+
const stringifiedContent = values.map(value => stringifyType({
|
|
31
|
+
type: columnType,
|
|
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);
|
|
42
|
+
}
|
|
43
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, renderedValues);
|
|
44
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
/**
|
|
3
|
+
* @jsxRuntime classic
|
|
4
|
+
* @jsx jsx
|
|
5
|
+
*/
|
|
6
|
+
import React, { forwardRef } from 'react';
|
|
7
|
+
|
|
8
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled
|
|
9
|
+
import { css, jsx } from '@emotion/react';
|
|
10
|
+
const truncateTextStyles = css({
|
|
11
|
+
overflow: 'hidden',
|
|
12
|
+
textOverflow: 'ellipsis',
|
|
13
|
+
whiteSpace: 'nowrap'
|
|
14
|
+
});
|
|
15
|
+
export const TruncateTextTag = /*#__PURE__*/forwardRef((props, ref) => {
|
|
16
|
+
return jsx("span", _extends({
|
|
17
|
+
css: truncateTextStyles
|
|
18
|
+
}, props, {
|
|
19
|
+
ref: ref
|
|
20
|
+
}), props.children);
|
|
21
|
+
});
|
|
@@ -105,6 +105,7 @@ export const PlainJiraIssuesConfigModalOld = props => {
|
|
|
105
105
|
status,
|
|
106
106
|
onNextPage,
|
|
107
107
|
responseItems,
|
|
108
|
+
responseItemIds,
|
|
108
109
|
hasNextPage,
|
|
109
110
|
columns,
|
|
110
111
|
defaultVisibleColumnKeys,
|
|
@@ -355,6 +356,7 @@ export const PlainJiraIssuesConfigModalOld = props => {
|
|
|
355
356
|
status: status,
|
|
356
357
|
columns: columns,
|
|
357
358
|
items: responseItems,
|
|
359
|
+
itemIds: responseItemIds,
|
|
358
360
|
hasNextPage: hasNextPage,
|
|
359
361
|
visibleColumnKeys: visibleColumnKeys || defaultVisibleColumnKeys,
|
|
360
362
|
onNextPage: handleOnNextPage,
|
|
@@ -365,7 +367,7 @@ export const PlainJiraIssuesConfigModalOld = props => {
|
|
|
365
367
|
onColumnResize: onColumnResize,
|
|
366
368
|
wrappedColumnKeys: wrappedColumnKeys,
|
|
367
369
|
onWrappedColumnChange: fg('platform.linking-platform.datasource-word_wrap') ? onWrappedColumnChange : undefined
|
|
368
|
-
})), [status, columns, responseItems, hasNextPage, visibleColumnKeys, defaultVisibleColumnKeys, handleOnNextPage, loadDatasourceDetails, handleVisibleColumnKeysChange, extensionKey, columnCustomSizes, onColumnResize, wrappedColumnKeys, onWrappedColumnChange]);
|
|
370
|
+
})), [status, columns, responseItems, responseItemIds, hasNextPage, visibleColumnKeys, defaultVisibleColumnKeys, handleOnNextPage, loadDatasourceDetails, handleVisibleColumnKeysChange, extensionKey, columnCustomSizes, onColumnResize, wrappedColumnKeys, onWrappedColumnChange]);
|
|
369
371
|
const renderCountModeContent = useCallback(() => {
|
|
370
372
|
const selectedJiraSiteUrl = selectedJiraSite === null || selectedJiraSite === void 0 ? void 0 : selectedJiraSite.url;
|
|
371
373
|
if (status === 'unauthorized') {
|
|
@@ -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';
|
|
@@ -55,6 +55,7 @@ export var useDatasourceTableState = function useDatasourceTableState(_ref) {
|
|
|
55
55
|
setResponseItems = _useState14[1];
|
|
56
56
|
var _useState15 = useState(initialEmptyArray),
|
|
57
57
|
_useState16 = _slicedToArray(_useState15, 2),
|
|
58
|
+
responseItemIds = _useState16[0],
|
|
58
59
|
setResponseItemIds = _useState16[1];
|
|
59
60
|
var _useState17 = useState(true),
|
|
60
61
|
_useState18 = _slicedToArray(_useState17, 2),
|
|
@@ -415,6 +416,7 @@ export var useDatasourceTableState = function useDatasourceTableState(_ref) {
|
|
|
415
416
|
status: status,
|
|
416
417
|
onNextPage: onNextPage,
|
|
417
418
|
responseItems: responseItems,
|
|
419
|
+
responseItemIds: responseItemIds,
|
|
418
420
|
reset: reset,
|
|
419
421
|
loadDatasourceDetails: loadDatasourceDetails,
|
|
420
422
|
hasNextPage: hasNextPage,
|
|
@@ -137,6 +137,7 @@ var PlainAssetsConfigModal = function PlainAssetsConfigModal(props) {
|
|
|
137
137
|
status = _useDatasourceTableSt.status,
|
|
138
138
|
onNextPage = _useDatasourceTableSt.onNextPage,
|
|
139
139
|
responseItems = _useDatasourceTableSt.responseItems,
|
|
140
|
+
responseItemIds = _useDatasourceTableSt.responseItemIds,
|
|
140
141
|
reset = _useDatasourceTableSt.reset,
|
|
141
142
|
loadDatasourceDetails = _useDatasourceTableSt.loadDatasourceDetails,
|
|
142
143
|
hasNextPage = _useDatasourceTableSt.hasNextPage,
|
|
@@ -354,6 +355,7 @@ var PlainAssetsConfigModal = function PlainAssetsConfigModal(props) {
|
|
|
354
355
|
isFetchingInitialData: assetsClientLoading,
|
|
355
356
|
status: status,
|
|
356
357
|
responseItems: responseItems,
|
|
358
|
+
responseItemIds: responseItemIds,
|
|
357
359
|
visibleColumnKeys: visibleColumnKeys,
|
|
358
360
|
onVisibleColumnKeysChange: onVisibleColumnKeysChange,
|
|
359
361
|
datasourceId: datasourceId,
|
|
@@ -67,6 +67,7 @@ var LoadingView = function LoadingView() {
|
|
|
67
67
|
export var RenderAssetsContent = function RenderAssetsContent(props) {
|
|
68
68
|
var status = props.status,
|
|
69
69
|
responseItems = props.responseItems,
|
|
70
|
+
responseItemIds = props.responseItemIds,
|
|
70
71
|
visibleColumnKeys = props.visibleColumnKeys,
|
|
71
72
|
onNextPage = props.onNextPage,
|
|
72
73
|
hasNextPage = props.hasNextPage,
|
|
@@ -84,13 +85,14 @@ export var RenderAssetsContent = function RenderAssetsContent(props) {
|
|
|
84
85
|
status: status,
|
|
85
86
|
columns: columns,
|
|
86
87
|
items: responseItems,
|
|
88
|
+
itemIds: responseItemIds,
|
|
87
89
|
hasNextPage: hasNextPage,
|
|
88
90
|
visibleColumnKeys: visibleColumnKeys || defaultVisibleColumnKeys,
|
|
89
91
|
onNextPage: onNextPage,
|
|
90
92
|
onLoadDatasourceDetails: loadDatasourceDetails,
|
|
91
93
|
onVisibleColumnKeysChange: onVisibleColumnKeysChange
|
|
92
94
|
}));
|
|
93
|
-
}, [columns, defaultVisibleColumnKeys, hasNextPage, loadDatasourceDetails, onNextPage, onVisibleColumnKeysChange, responseItems, status, visibleColumnKeys]);
|
|
95
|
+
}, [columns, defaultVisibleColumnKeys, hasNextPage, loadDatasourceDetails, onNextPage, onVisibleColumnKeysChange, responseItems, responseItemIds, status, visibleColumnKeys]);
|
|
94
96
|
var renderAssetsContentView = useCallback(function () {
|
|
95
97
|
if (isFetchingInitialData) {
|
|
96
98
|
// Placing this check first as it's a priority before all others
|
|
@@ -17,6 +17,7 @@ var Table = function Table(props) {
|
|
|
17
17
|
status = _useDatasourceContext2.status,
|
|
18
18
|
onNextPage = _useDatasourceContext2.onNextPage,
|
|
19
19
|
responseItems = _useDatasourceContext2.responseItems,
|
|
20
|
+
responseItemIds = _useDatasourceContext2.responseItemIds,
|
|
20
21
|
hasNextPage = _useDatasourceContext2.hasNextPage,
|
|
21
22
|
columns = _useDatasourceContext2.columns,
|
|
22
23
|
defaultVisibleColumnKeys = _useDatasourceContext2.defaultVisibleColumnKeys,
|
|
@@ -33,6 +34,7 @@ var Table = function Table(props) {
|
|
|
33
34
|
status: status,
|
|
34
35
|
columns: columns,
|
|
35
36
|
items: responseItems,
|
|
37
|
+
itemIds: responseItemIds,
|
|
36
38
|
hasNextPage: hasNextPage,
|
|
37
39
|
visibleColumnKeys: visibleColumnKeys || defaultVisibleColumnKeys,
|
|
38
40
|
onNextPage: handleOnNextPage,
|
|
@@ -128,6 +128,7 @@ export var PlainConfluenceSearchConfigModal = function PlainConfluenceSearchConf
|
|
|
128
128
|
status = _useDatasourceTableSt.status,
|
|
129
129
|
onNextPage = _useDatasourceTableSt.onNextPage,
|
|
130
130
|
responseItems = _useDatasourceTableSt.responseItems,
|
|
131
|
+
responseItemIds = _useDatasourceTableSt.responseItemIds,
|
|
131
132
|
hasNextPage = _useDatasourceTableSt.hasNextPage,
|
|
132
133
|
columns = _useDatasourceTableSt.columns,
|
|
133
134
|
defaultVisibleColumnKeys = _useDatasourceTableSt.defaultVisibleColumnKeys,
|
|
@@ -200,6 +201,7 @@ export var PlainConfluenceSearchConfigModal = function PlainConfluenceSearchConf
|
|
|
200
201
|
status: status,
|
|
201
202
|
columns: columns,
|
|
202
203
|
items: responseItems,
|
|
204
|
+
itemIds: responseItemIds,
|
|
203
205
|
hasNextPage: hasNextPage,
|
|
204
206
|
visibleColumnKeys: visibleColumnKeys || defaultVisibleColumnKeys,
|
|
205
207
|
onNextPage: onNextPage,
|
|
@@ -211,7 +213,7 @@ export var PlainConfluenceSearchConfigModal = function PlainConfluenceSearchConf
|
|
|
211
213
|
wrappedColumnKeys: wrappedColumnKeys,
|
|
212
214
|
onWrappedColumnChange: fg('platform.linking-platform.datasource-word_wrap') ? onWrappedColumnChange : undefined
|
|
213
215
|
}));
|
|
214
|
-
}, [status, columns, responseItems, hasNextPage, visibleColumnKeys, defaultVisibleColumnKeys, onNextPage, loadDatasourceDetails, handleVisibleColumnKeysChange, extensionKey, columnCustomSizes, onColumnResize, wrappedColumnKeys, onWrappedColumnChange]);
|
|
216
|
+
}, [status, columns, responseItems, responseItemIds, hasNextPage, visibleColumnKeys, defaultVisibleColumnKeys, onNextPage, loadDatasourceDetails, handleVisibleColumnKeysChange, extensionKey, columnCustomSizes, onColumnResize, wrappedColumnKeys, onWrappedColumnChange]);
|
|
215
217
|
var resolvedWithNoResults = status === 'resolved' && !responseItems.length;
|
|
216
218
|
var hasConfluenceSearchParams = selectedConfluenceSite && searchString;
|
|
217
219
|
var selectedConfluenceSiteUrl = selectedConfluenceSite === null || selectedConfluenceSite === void 0 ? void 0 : selectedConfluenceSite.url;
|
|
@@ -50,6 +50,7 @@ var DatasourceTableViewWithoutAnalytics = function DatasourceTableViewWithoutAna
|
|
|
50
50
|
status = _useDatasourceTableSt.status,
|
|
51
51
|
onNextPage = _useDatasourceTableSt.onNextPage,
|
|
52
52
|
responseItems = _useDatasourceTableSt.responseItems,
|
|
53
|
+
responseItemIds = _useDatasourceTableSt.responseItemIds,
|
|
53
54
|
hasNextPage = _useDatasourceTableSt.hasNextPage,
|
|
54
55
|
columns = _useDatasourceTableSt.columns,
|
|
55
56
|
defaultVisibleColumnKeys = _useDatasourceTableSt.defaultVisibleColumnKeys,
|
|
@@ -161,6 +162,7 @@ var DatasourceTableViewWithoutAnalytics = function DatasourceTableViewWithoutAna
|
|
|
161
162
|
testId: 'datasource-table-view',
|
|
162
163
|
hasNextPage: hasNextPage,
|
|
163
164
|
items: responseItems,
|
|
165
|
+
itemIds: responseItemIds,
|
|
164
166
|
onNextPage: onNextPage,
|
|
165
167
|
onLoadDatasourceDetails: loadDatasourceDetails,
|
|
166
168
|
status: status,
|
|
@@ -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"),
|