@atlaskit/link-datasource 1.7.6 → 1.8.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 +6 -0
- package/dist/cjs/analytics/constants.js +1 -1
- package/dist/cjs/hooks/useDatasourceTableState.js +0 -1
- package/dist/cjs/ui/assets-modal/modal/index.js +1 -1
- package/dist/cjs/ui/datasource-table-view/datasourceTableView.js +3 -3
- package/dist/cjs/ui/issue-like-table/empty-state/index.js +71 -86
- package/dist/cjs/ui/issue-like-table/empty-state/type.js +1 -1
- package/dist/cjs/ui/issue-like-table/index.js +35 -10
- package/dist/cjs/ui/issue-like-table/styled.js +4 -4
- package/dist/cjs/ui/jira-issues-modal/modal/index.js +1 -2
- package/dist/es2019/analytics/constants.js +1 -1
- package/dist/es2019/hooks/useDatasourceTableState.js +0 -1
- package/dist/es2019/ui/assets-modal/modal/index.js +1 -1
- package/dist/es2019/ui/datasource-table-view/datasourceTableView.js +3 -3
- package/dist/es2019/ui/issue-like-table/empty-state/index.js +61 -75
- package/dist/es2019/ui/issue-like-table/empty-state/type.js +1 -1
- package/dist/es2019/ui/issue-like-table/index.js +43 -13
- package/dist/es2019/ui/issue-like-table/styled.js +1 -5
- package/dist/es2019/ui/jira-issues-modal/modal/index.js +1 -2
- package/dist/esm/analytics/constants.js +1 -1
- package/dist/esm/hooks/useDatasourceTableState.js +0 -1
- package/dist/esm/ui/assets-modal/modal/index.js +1 -1
- package/dist/esm/ui/datasource-table-view/datasourceTableView.js +3 -3
- package/dist/esm/ui/issue-like-table/empty-state/index.js +72 -86
- package/dist/esm/ui/issue-like-table/empty-state/type.js +1 -1
- package/dist/esm/ui/issue-like-table/index.js +35 -10
- package/dist/esm/ui/issue-like-table/styled.js +3 -3
- package/dist/esm/ui/jira-issues-modal/modal/index.js +1 -2
- package/dist/types/ui/issue-like-table/empty-state/index.d.ts +1 -2
- package/dist/types/ui/issue-like-table/index.d.ts +1 -1
- package/dist/types/ui/issue-like-table/styled.d.ts +1 -8
- package/dist/types-ts4.5/ui/issue-like-table/empty-state/index.d.ts +1 -2
- package/dist/types-ts4.5/ui/issue-like-table/index.d.ts +1 -1
- package/dist/types-ts4.5/ui/issue-like-table/styled.d.ts +1 -8
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @atlaskit/link-datasource
|
|
2
2
|
|
|
3
|
+
## 1.8.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#41368](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/41368) [`1daa2514bcc`](https://bitbucket.org/atlassian/atlassian-frontend/commits/1daa2514bcc) - [ux] Updates empty state and loading row skeletons to prevent visual jumps once data loads.
|
|
8
|
+
|
|
3
9
|
## 1.7.6
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
|
@@ -280,7 +280,6 @@ var useDatasourceTableState = exports.useDatasourceTableState = function useData
|
|
|
280
280
|
reset();
|
|
281
281
|
void onNextPage({
|
|
282
282
|
isSchemaFromData: false,
|
|
283
|
-
// since this is not inital load, we will already have schema
|
|
284
283
|
shouldRequestFirstPage: true
|
|
285
284
|
});
|
|
286
285
|
}
|
|
@@ -234,7 +234,7 @@ var analyticsContextAttributes = {
|
|
|
234
234
|
};
|
|
235
235
|
var analyticsContextData = {
|
|
236
236
|
packageName: "@atlaskit/link-datasource",
|
|
237
|
-
packageVersion: "1.
|
|
237
|
+
packageVersion: "1.8.0",
|
|
238
238
|
source: 'datasourceConfigModal'
|
|
239
239
|
};
|
|
240
240
|
var contextData = _objectSpread(_objectSpread({}, analyticsContextData), {}, {
|
|
@@ -15,6 +15,7 @@ var _ufoExperiences = require("../../analytics/ufoExperiences");
|
|
|
15
15
|
var _useColumnPickerRenderedFailedUfoExperience = require("../../analytics/ufoExperiences/hooks/useColumnPickerRenderedFailedUfoExperience");
|
|
16
16
|
var _useDataRenderedUfoExperience = require("../../analytics/ufoExperiences/hooks/useDataRenderedUfoExperience");
|
|
17
17
|
var _useDatasourceTableState = require("../../hooks/useDatasourceTableState");
|
|
18
|
+
var _styled = require("../../ui/issue-like-table/styled");
|
|
18
19
|
var _accessRequired = require("../common/error-state/access-required");
|
|
19
20
|
var _loadingError = require("../common/error-state/loading-error");
|
|
20
21
|
var _noResults = require("../common/error-state/no-results");
|
|
@@ -134,13 +135,12 @@ var DatasourceTableViewWithoutAnalytics = function DatasourceTableViewWithoutAna
|
|
|
134
135
|
columns: columns,
|
|
135
136
|
visibleColumnKeys: visibleColumnKeys || defaultVisibleColumnKeys,
|
|
136
137
|
onVisibleColumnKeysChange: onVisibleColumnKeysChange,
|
|
137
|
-
scrollableContainerHeight:
|
|
138
|
+
scrollableContainerHeight: _styled.ScrollableContainerHeight,
|
|
138
139
|
parentContainerRenderInstanceId: tableRenderInstanceId,
|
|
139
140
|
extensionKey: extensionKey
|
|
140
141
|
}) : (0, _react2.jsx)(_emptyState.default, {
|
|
141
142
|
testId: "datasource-table-view-skeleton",
|
|
142
|
-
isCompact: true
|
|
143
|
-
isLoading: !isDataReady || status === 'loading'
|
|
143
|
+
isCompact: true
|
|
144
144
|
}), (0, _react2.jsx)(_tableFooter.TableFooter, {
|
|
145
145
|
itemCount: isDataReady ? totalCount : undefined,
|
|
146
146
|
onRefresh: forcedReset,
|
|
@@ -1,33 +1,46 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
7
6
|
exports.default = void 0;
|
|
8
7
|
var _react = require("@emotion/react");
|
|
9
8
|
var _linkingCommon = require("@atlaskit/linking-common");
|
|
10
|
-
var _user = _interopRequireDefault(require("../render-type/user"));
|
|
11
9
|
var _styled = require("../styled");
|
|
12
|
-
var _priority = _interopRequireDefault(require("./priority"));
|
|
13
|
-
var _type = _interopRequireDefault(require("./type"));
|
|
14
10
|
/** @jsx jsx */
|
|
15
11
|
|
|
12
|
+
var SkeletonComponent = function SkeletonComponent(_ref) {
|
|
13
|
+
var width = _ref.width,
|
|
14
|
+
itemName = _ref.itemName;
|
|
15
|
+
return (0, _react.jsx)(_linkingCommon.Skeleton, {
|
|
16
|
+
borderRadius: 8,
|
|
17
|
+
testId: "".concat(itemName, "-empty-state-skeleton"),
|
|
18
|
+
height: 14,
|
|
19
|
+
width: width
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
var tableSidePadding = "var(--ds-space-200, 16px)";
|
|
16
23
|
var tableBodyStyles = (0, _react.css)({
|
|
17
24
|
borderBottom: 0
|
|
18
25
|
});
|
|
26
|
+
var cellStyles = (0, _react.css)({
|
|
27
|
+
paddingBlock: "var(--ds-space-100, 12px)",
|
|
28
|
+
'&:last-child': {
|
|
29
|
+
paddingRight: "var(--ds-space-100, 8px)"
|
|
30
|
+
}
|
|
31
|
+
});
|
|
19
32
|
var baseColumns = [{
|
|
20
33
|
key: 'type',
|
|
21
|
-
width:
|
|
34
|
+
width: 35
|
|
22
35
|
}, {
|
|
23
36
|
key: 'issue',
|
|
24
37
|
width: 50
|
|
25
38
|
}, {
|
|
26
39
|
key: 'summary',
|
|
27
|
-
width:
|
|
40
|
+
width: 100
|
|
28
41
|
}, {
|
|
29
42
|
key: 'assignee',
|
|
30
|
-
width:
|
|
43
|
+
width: 70
|
|
31
44
|
}, {
|
|
32
45
|
key: 'priority',
|
|
33
46
|
width: 60
|
|
@@ -44,91 +57,64 @@ var baseColumns = [{
|
|
|
44
57
|
key: 'due',
|
|
45
58
|
width: 50
|
|
46
59
|
}];
|
|
47
|
-
var
|
|
48
|
-
var
|
|
49
|
-
var
|
|
50
|
-
var
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
priority: priorities[index],
|
|
55
|
-
type: types[index],
|
|
56
|
-
summaryWidth: summaryColumnWidths[index],
|
|
57
|
-
statusWidth: statusColumnWidths[index]
|
|
58
|
-
};
|
|
59
|
-
});
|
|
60
|
-
var cellStyles = (0, _react.css)({
|
|
61
|
-
'&:first-child': {
|
|
62
|
-
paddingLeft: "var(--ds-space-100, 8px)"
|
|
63
|
-
},
|
|
64
|
-
'&:last-child': {
|
|
65
|
-
paddingRight: "var(--ds-space-100, 8px)"
|
|
66
|
-
}
|
|
67
|
-
});
|
|
68
|
-
var renderItem = function renderItem(_ref, _ref2, isShimmering) {
|
|
69
|
-
var key = _ref.key,
|
|
70
|
-
width = _ref.width;
|
|
71
|
-
var priority = _ref2.priority,
|
|
72
|
-
type = _ref2.type,
|
|
73
|
-
summaryWidth = _ref2.summaryWidth,
|
|
74
|
-
statusWidth = _ref2.statusWidth;
|
|
60
|
+
var longColumnWidths = [141, 208, 186, 212, 212, 151, 212, 182, 180, 163, 172, 211, 145, 190];
|
|
61
|
+
var shortColumnWidths = [75, 54, 66, 73, 52, 73, 55, 80, 67, 76, 58, 65, 56, 76];
|
|
62
|
+
var renderItem = function renderItem(_ref2, _ref3) {
|
|
63
|
+
var key = _ref2.key,
|
|
64
|
+
width = _ref2.width;
|
|
65
|
+
var longWidth = _ref3.longWidth,
|
|
66
|
+
shortWidth = _ref3.shortWidth;
|
|
75
67
|
switch (key) {
|
|
76
|
-
case '
|
|
77
|
-
return (0, _react.jsx)(
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
height: 13,
|
|
81
|
-
isShimmering: isShimmering,
|
|
82
|
-
width: width
|
|
83
|
-
}));
|
|
84
|
-
case 'priority':
|
|
85
|
-
return (0, _react.jsx)(_priority.default, {
|
|
86
|
-
priority: priority
|
|
87
|
-
});
|
|
88
|
-
case 'type':
|
|
89
|
-
return (0, _react.jsx)(_type.default, {
|
|
90
|
-
type: type
|
|
68
|
+
case 'status':
|
|
69
|
+
return (0, _react.jsx)(SkeletonComponent, {
|
|
70
|
+
width: shortWidth,
|
|
71
|
+
itemName: key
|
|
91
72
|
});
|
|
92
73
|
case 'summary':
|
|
93
|
-
return (0, _react.jsx)(
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
testId: "empty-state-skeleton",
|
|
97
|
-
height: 13,
|
|
98
|
-
isShimmering: isShimmering,
|
|
99
|
-
width: summaryWidth
|
|
100
|
-
});
|
|
101
|
-
case 'status':
|
|
102
|
-
return (0, _react.jsx)(_linkingCommon.Skeleton, {
|
|
103
|
-
appearance: "blue",
|
|
104
|
-
borderRadius: 3,
|
|
105
|
-
testId: "empty-state-skeleton",
|
|
106
|
-
height: 16,
|
|
107
|
-
isShimmering: isShimmering,
|
|
108
|
-
width: statusWidth
|
|
74
|
+
return (0, _react.jsx)(SkeletonComponent, {
|
|
75
|
+
width: longWidth,
|
|
76
|
+
itemName: key
|
|
109
77
|
});
|
|
110
78
|
default:
|
|
111
|
-
return (0, _react.jsx)(
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
height: 13,
|
|
115
|
-
isShimmering: isShimmering,
|
|
116
|
-
width: width
|
|
79
|
+
return (0, _react.jsx)(SkeletonComponent, {
|
|
80
|
+
width: width,
|
|
81
|
+
itemName: key
|
|
117
82
|
});
|
|
118
83
|
}
|
|
119
84
|
};
|
|
120
|
-
var _default = exports.default = function _default(
|
|
121
|
-
var isCompact =
|
|
122
|
-
|
|
123
|
-
isLoading = _ref3$isLoading === void 0 ? false : _ref3$isLoading,
|
|
124
|
-
testId = _ref3.testId;
|
|
85
|
+
var _default = exports.default = function _default(_ref4) {
|
|
86
|
+
var isCompact = _ref4.isCompact,
|
|
87
|
+
testId = _ref4.testId;
|
|
125
88
|
var columnsToRender = isCompact ? baseColumns.slice(0, 6) : baseColumns;
|
|
126
|
-
|
|
89
|
+
// if it is compact (non-modal), there is room for 14 rows
|
|
90
|
+
// if it is modal (not compact), there is only room for 10 rows
|
|
91
|
+
var rowsNumber = isCompact ? 14 : 10;
|
|
92
|
+
var rows = new Array(rowsNumber).fill(null).map(function (_, index) {
|
|
93
|
+
return {
|
|
94
|
+
id: index,
|
|
95
|
+
longWidth: longColumnWidths[index],
|
|
96
|
+
shortWidth: shortColumnWidths[index]
|
|
97
|
+
};
|
|
98
|
+
});
|
|
99
|
+
return (0, _react.jsx)("div", {
|
|
100
|
+
style: {
|
|
101
|
+
// the IssueLikeDataTableView wraps the table in a container with the styling below while modal doesn't
|
|
102
|
+
// the isCompact prop is applied to non-modal empty states which require additional padding
|
|
103
|
+
// this maxHeight comes from scrollableContainerHeight
|
|
104
|
+
maxHeight: _styled.ScrollableContainerHeight,
|
|
105
|
+
padding: isCompact ? "0 ".concat(tableSidePadding, " 0 ").concat(tableSidePadding) : '0',
|
|
106
|
+
boxSizing: 'border-box'
|
|
107
|
+
}
|
|
108
|
+
}, (0, _react.jsx)("table", {
|
|
127
109
|
"data-testid": testId
|
|
128
|
-
}, (0, _react.jsx)("thead",
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
110
|
+
}, (0, _react.jsx)("thead", {
|
|
111
|
+
style: {
|
|
112
|
+
borderBottom: 0
|
|
113
|
+
}
|
|
114
|
+
}, (0, _react.jsx)("tr", null, columnsToRender.map(function (_ref5) {
|
|
115
|
+
var key = _ref5.key,
|
|
116
|
+
width = _ref5.width;
|
|
117
|
+
return (0, _react.jsx)(_styled.TableHeading, {
|
|
132
118
|
key: key,
|
|
133
119
|
style: {
|
|
134
120
|
width: width
|
|
@@ -137,8 +123,7 @@ var _default = exports.default = function _default(_ref3) {
|
|
|
137
123
|
appearance: "darkGray",
|
|
138
124
|
borderRadius: 8,
|
|
139
125
|
testId: "empty-state-skeleton",
|
|
140
|
-
|
|
141
|
-
height: 13,
|
|
126
|
+
height: 12,
|
|
142
127
|
width: width
|
|
143
128
|
}));
|
|
144
129
|
}))), (0, _react.jsx)("tbody", {
|
|
@@ -150,7 +135,7 @@ var _default = exports.default = function _default(_ref3) {
|
|
|
150
135
|
return (0, _react.jsx)("td", {
|
|
151
136
|
css: cellStyles,
|
|
152
137
|
key: column.key
|
|
153
|
-
}, renderItem(column, row
|
|
138
|
+
}, renderItem(column, row));
|
|
154
139
|
}));
|
|
155
|
-
})));
|
|
140
|
+
}))));
|
|
156
141
|
};
|
|
@@ -15,7 +15,7 @@ var _4 = _interopRequireDefault(require("@atlaskit/icon-object/glyph/issue/16"))
|
|
|
15
15
|
var _5 = _interopRequireDefault(require("@atlaskit/icon-object/glyph/story/16"));
|
|
16
16
|
var _6 = _interopRequireDefault(require("@atlaskit/icon-object/glyph/task/16"));
|
|
17
17
|
var _templateObject;
|
|
18
|
-
var IconWrapper = _styled.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n align-items: center;\n justify-content:
|
|
18
|
+
var IconWrapper = _styled.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n align-items: center;\n justify-content: left;\n"])));
|
|
19
19
|
var _default = exports.default = function _default(_ref) {
|
|
20
20
|
var type = _ref.type;
|
|
21
21
|
var TypeIcon = function TypeIcon() {
|
|
@@ -93,8 +93,7 @@ function getColumnWidth(key, type) {
|
|
|
93
93
|
priority: BASE_WIDTH * 8,
|
|
94
94
|
status: BASE_WIDTH * 18,
|
|
95
95
|
summary: BASE_WIDTH * 45,
|
|
96
|
-
description: BASE_WIDTH * 31.25
|
|
97
|
-
type: BASE_WIDTH * 8
|
|
96
|
+
description: BASE_WIDTH * 31.25
|
|
98
97
|
};
|
|
99
98
|
if (keyBasedWidth[key]) {
|
|
100
99
|
return keyBasedWidth[key];
|
|
@@ -174,9 +173,10 @@ var IssueLikeDataTableView = exports.IssueLikeDataTableView = function IssueLike
|
|
|
174
173
|
cells: visibleSortedColumns.map(function (_ref3) {
|
|
175
174
|
var key = _ref3.key;
|
|
176
175
|
var content = (0, _react2.jsx)(_linkingCommon.Skeleton, {
|
|
177
|
-
borderRadius:
|
|
178
|
-
width:
|
|
179
|
-
height:
|
|
176
|
+
borderRadius: 8,
|
|
177
|
+
width: "100%",
|
|
178
|
+
height: 14,
|
|
179
|
+
testId: "issues-table-row-loading"
|
|
180
180
|
});
|
|
181
181
|
return {
|
|
182
182
|
key: key,
|
|
@@ -302,8 +302,24 @@ var IssueLikeDataTableView = exports.IssueLikeDataTableView = function IssueLike
|
|
|
302
302
|
});
|
|
303
303
|
}, [identityColumnKey, renderItem, items, visibleSortedColumns]);
|
|
304
304
|
var rows = (0, _react.useMemo)(function () {
|
|
305
|
-
|
|
306
|
-
|
|
305
|
+
if (status !== 'loading') {
|
|
306
|
+
return tableRows;
|
|
307
|
+
}
|
|
308
|
+
// if there are table rows, only add 1 loading row
|
|
309
|
+
if (tableRows.length > 0) {
|
|
310
|
+
return [].concat((0, _toConsumableArray2.default)(tableRows), [_objectSpread(_objectSpread({}, loadingRow), {}, {
|
|
311
|
+
key: "loading-".concat(tableRows.length)
|
|
312
|
+
})]);
|
|
313
|
+
}
|
|
314
|
+
// if there are no table rows add 14 rows if it is compact (has scrollableContainerHeight or non-modal)
|
|
315
|
+
// add 10 rows if it is modal (no scrollableContainerHeight)
|
|
316
|
+
var loadingRowsCount = scrollableContainerHeight ? 14 : 10;
|
|
317
|
+
return (0, _toConsumableArray2.default)(Array(loadingRowsCount)).map(function (_, index) {
|
|
318
|
+
return _objectSpread(_objectSpread({}, loadingRow), {}, {
|
|
319
|
+
key: "loading-".concat(index)
|
|
320
|
+
});
|
|
321
|
+
});
|
|
322
|
+
}, [loadingRow, status, tableRows, scrollableContainerHeight]);
|
|
307
323
|
var onSelectedColumnKeysChange = (0, _react.useCallback)(function (newSelectedColumnKeys) {
|
|
308
324
|
onVisibleColumnKeysChange === null || onVisibleColumnKeysChange === void 0 || onVisibleColumnKeysChange(newSelectedColumnKeys);
|
|
309
325
|
}, [onVisibleColumnKeysChange]);
|
|
@@ -396,6 +412,8 @@ var IssueLikeDataTableView = exports.IssueLikeDataTableView = function IssueLike
|
|
|
396
412
|
key: key,
|
|
397
413
|
"data-testid": "".concat(key, "-column-heading"),
|
|
398
414
|
style: {
|
|
415
|
+
// this keeps the column headers from collapsing horizontally during loading states
|
|
416
|
+
minWidth: maxWidth,
|
|
399
417
|
maxWidth: maxWidth
|
|
400
418
|
}
|
|
401
419
|
}, heading);
|
|
@@ -421,14 +439,21 @@ var IssueLikeDataTableView = exports.IssueLikeDataTableView = function IssueLike
|
|
|
421
439
|
var cellKey = _ref14.key,
|
|
422
440
|
content = _ref14.content,
|
|
423
441
|
maxWidth = _ref14.maxWidth;
|
|
442
|
+
var loadingRowStyle = {
|
|
443
|
+
maxWidth: maxWidth
|
|
444
|
+
};
|
|
445
|
+
// extra padding is required around skeleton loader to avoid vertical jumps when data loads
|
|
446
|
+
if (key !== null && key !== void 0 && key.includes('loading')) {
|
|
447
|
+
loadingRowStyle = _objectSpread(_objectSpread({}, loadingRowStyle), {}, {
|
|
448
|
+
paddingBlock: "var(--ds-space-100, 12px)"
|
|
449
|
+
});
|
|
450
|
+
}
|
|
424
451
|
return (0, _react2.jsx)("td", {
|
|
425
452
|
key: cellKey,
|
|
426
453
|
"data-testid": testId && "".concat(testId, "--cell-").concat(cellIndex),
|
|
427
454
|
colSpan: cellIndex + 1 === cells.length ? 2 : undefined,
|
|
428
455
|
css: truncatedCellStyles,
|
|
429
|
-
style:
|
|
430
|
-
maxWidth: maxWidth
|
|
431
|
-
}
|
|
456
|
+
style: loadingRowStyle
|
|
432
457
|
}, content);
|
|
433
458
|
}));
|
|
434
459
|
}))));
|
|
@@ -4,12 +4,12 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.TableHeading = exports.Table = exports.
|
|
7
|
+
exports.TableHeading = exports.Table = exports.ScrollableContainerHeight = exports.FieldTextFontSize = void 0;
|
|
8
8
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
9
9
|
var _styled = _interopRequireDefault(require("@emotion/styled"));
|
|
10
10
|
var _colors = require("@atlaskit/theme/colors");
|
|
11
|
-
var _templateObject, _templateObject2
|
|
11
|
+
var _templateObject, _templateObject2;
|
|
12
|
+
var ScrollableContainerHeight = exports.ScrollableContainerHeight = 590;
|
|
12
13
|
var FieldTextFontSize = exports.FieldTextFontSize = '14px';
|
|
13
14
|
var Table = exports.Table = _styled.default.table(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n width: 100%;\n"])));
|
|
14
|
-
var TableHeading = exports.TableHeading = _styled.default.th(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n position: relative;\n padding-block: ", " ", ";\n line-height: ", ";\n border-bottom: 2px solid ", ";\n & [data-testid='datasource-header-content--container'] {\n margin-top: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n"])), "var(--ds-space-300, 24px)", "var(--ds-space-100, 8px)", "var(--ds-font-lineHeight-300, 16px)", "var(--ds-background-accent-gray-subtler, ".concat(_colors.N40, ")"));
|
|
15
|
-
var EmptyStateTableHeading = exports.EmptyStateTableHeading = (0, _styled.default)(TableHeading)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n &:first-child {\n padding-left: ", ";\n }\n"])), "var(--ds-space-100, 8px)");
|
|
15
|
+
var TableHeading = exports.TableHeading = _styled.default.th(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n position: relative;\n padding-block: ", " ", ";\n line-height: ", ";\n border-bottom: 2px solid ", ";\n & [data-testid='datasource-header-content--container'] {\n margin-top: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n"])), "var(--ds-space-300, 24px)", "var(--ds-space-100, 8px)", "var(--ds-font-lineHeight-300, 16px)", "var(--ds-background-accent-gray-subtler, ".concat(_colors.N40, ")"));
|
|
@@ -454,8 +454,7 @@ var PlainJiraIssuesConfigModal = exports.PlainJiraIssuesConfigModal = function P
|
|
|
454
454
|
return (0, _react2.jsx)("div", {
|
|
455
455
|
css: contentContainerStyles
|
|
456
456
|
}, !!jql ? (0, _react2.jsx)(_issueLikeTable.EmptyState, {
|
|
457
|
-
testId: "jira-jql-datasource-modal--empty-state"
|
|
458
|
-
isLoading: true
|
|
457
|
+
testId: "jira-jql-datasource-modal--empty-state"
|
|
459
458
|
}) : (0, _react2.jsx)(_initialStateView.InitialStateView, {
|
|
460
459
|
searchMethod: currentSearchMethod
|
|
461
460
|
}));
|
|
@@ -9,6 +9,7 @@ import { startUfoExperience } from '../../analytics/ufoExperiences';
|
|
|
9
9
|
import { useColumnPickerRenderedFailedUfoExperience } from '../../analytics/ufoExperiences/hooks/useColumnPickerRenderedFailedUfoExperience';
|
|
10
10
|
import { useDataRenderedUfoExperience } from '../../analytics/ufoExperiences/hooks/useDataRenderedUfoExperience';
|
|
11
11
|
import { useDatasourceTableState } from '../../hooks/useDatasourceTableState';
|
|
12
|
+
import { ScrollableContainerHeight } from '../../ui/issue-like-table/styled';
|
|
12
13
|
import { AccessRequired } from '../common/error-state/access-required';
|
|
13
14
|
import { LoadingError } from '../common/error-state/loading-error';
|
|
14
15
|
import { NoResults } from '../common/error-state/no-results';
|
|
@@ -129,13 +130,12 @@ const DatasourceTableViewWithoutAnalytics = ({
|
|
|
129
130
|
columns: columns,
|
|
130
131
|
visibleColumnKeys: visibleColumnKeys || defaultVisibleColumnKeys,
|
|
131
132
|
onVisibleColumnKeysChange: onVisibleColumnKeysChange,
|
|
132
|
-
scrollableContainerHeight:
|
|
133
|
+
scrollableContainerHeight: ScrollableContainerHeight,
|
|
133
134
|
parentContainerRenderInstanceId: tableRenderInstanceId,
|
|
134
135
|
extensionKey: extensionKey
|
|
135
136
|
}) : jsx(EmptyState, {
|
|
136
137
|
testId: "datasource-table-view-skeleton",
|
|
137
|
-
isCompact: true
|
|
138
|
-
isLoading: !isDataReady || status === 'loading'
|
|
138
|
+
isCompact: true
|
|
139
139
|
}), jsx(TableFooter, {
|
|
140
140
|
itemCount: isDataReady ? totalCount : undefined,
|
|
141
141
|
onRefresh: forcedReset,
|
|
@@ -1,25 +1,38 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import { css, jsx } from '@emotion/react';
|
|
3
3
|
import { Skeleton } from '@atlaskit/linking-common';
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
import { ScrollableContainerHeight, TableHeading } from '../styled';
|
|
5
|
+
const SkeletonComponent = ({
|
|
6
|
+
width,
|
|
7
|
+
itemName
|
|
8
|
+
}) => jsx(Skeleton, {
|
|
9
|
+
borderRadius: 8,
|
|
10
|
+
testId: `${itemName}-empty-state-skeleton`,
|
|
11
|
+
height: 14,
|
|
12
|
+
width: width
|
|
13
|
+
});
|
|
14
|
+
const tableSidePadding = "var(--ds-space-200, 16px)";
|
|
8
15
|
const tableBodyStyles = css({
|
|
9
16
|
borderBottom: 0
|
|
10
17
|
});
|
|
18
|
+
const cellStyles = css({
|
|
19
|
+
paddingBlock: "var(--ds-space-100, 12px)",
|
|
20
|
+
'&:last-child': {
|
|
21
|
+
paddingRight: "var(--ds-space-100, 8px)"
|
|
22
|
+
}
|
|
23
|
+
});
|
|
11
24
|
const baseColumns = [{
|
|
12
25
|
key: 'type',
|
|
13
|
-
width:
|
|
26
|
+
width: 35
|
|
14
27
|
}, {
|
|
15
28
|
key: 'issue',
|
|
16
29
|
width: 50
|
|
17
30
|
}, {
|
|
18
31
|
key: 'summary',
|
|
19
|
-
width:
|
|
32
|
+
width: 100
|
|
20
33
|
}, {
|
|
21
34
|
key: 'assignee',
|
|
22
|
-
width:
|
|
35
|
+
width: 70
|
|
23
36
|
}, {
|
|
24
37
|
key: 'priority',
|
|
25
38
|
width: 60
|
|
@@ -36,91 +49,65 @@ const baseColumns = [{
|
|
|
36
49
|
key: 'due',
|
|
37
50
|
width: 50
|
|
38
51
|
}];
|
|
39
|
-
const
|
|
40
|
-
const
|
|
41
|
-
const summaryColumnWidths = [141, 208, 186, 212, 212, 151, 212, 182, 180, 147];
|
|
42
|
-
const statusColumnWidths = [75, 54, 66, 73, 52, 73, 55, 80, 66, 59];
|
|
43
|
-
const rows = new Array(10).fill(null).map((_, index) => ({
|
|
44
|
-
id: index,
|
|
45
|
-
priority: priorities[index],
|
|
46
|
-
type: types[index],
|
|
47
|
-
summaryWidth: summaryColumnWidths[index],
|
|
48
|
-
statusWidth: statusColumnWidths[index]
|
|
49
|
-
}));
|
|
50
|
-
const cellStyles = css({
|
|
51
|
-
'&:first-child': {
|
|
52
|
-
paddingLeft: "var(--ds-space-100, 8px)"
|
|
53
|
-
},
|
|
54
|
-
'&:last-child': {
|
|
55
|
-
paddingRight: "var(--ds-space-100, 8px)"
|
|
56
|
-
}
|
|
57
|
-
});
|
|
52
|
+
const longColumnWidths = [141, 208, 186, 212, 212, 151, 212, 182, 180, 163, 172, 211, 145, 190];
|
|
53
|
+
const shortColumnWidths = [75, 54, 66, 73, 52, 73, 55, 80, 67, 76, 58, 65, 56, 76];
|
|
58
54
|
const renderItem = ({
|
|
59
55
|
key,
|
|
60
56
|
width
|
|
61
57
|
}, {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
statusWidth
|
|
66
|
-
}, isShimmering) => {
|
|
58
|
+
longWidth,
|
|
59
|
+
shortWidth
|
|
60
|
+
}) => {
|
|
67
61
|
switch (key) {
|
|
68
|
-
case '
|
|
69
|
-
return jsx(
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
height: 13,
|
|
73
|
-
isShimmering: isShimmering,
|
|
74
|
-
width: width
|
|
75
|
-
}));
|
|
76
|
-
case 'priority':
|
|
77
|
-
return jsx(Priority, {
|
|
78
|
-
priority: priority
|
|
79
|
-
});
|
|
80
|
-
case 'type':
|
|
81
|
-
return jsx(Type, {
|
|
82
|
-
type: type
|
|
62
|
+
case 'status':
|
|
63
|
+
return jsx(SkeletonComponent, {
|
|
64
|
+
width: shortWidth,
|
|
65
|
+
itemName: key
|
|
83
66
|
});
|
|
84
67
|
case 'summary':
|
|
85
|
-
return jsx(
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
testId: "empty-state-skeleton",
|
|
89
|
-
height: 13,
|
|
90
|
-
isShimmering: isShimmering,
|
|
91
|
-
width: summaryWidth
|
|
92
|
-
});
|
|
93
|
-
case 'status':
|
|
94
|
-
return jsx(Skeleton, {
|
|
95
|
-
appearance: "blue",
|
|
96
|
-
borderRadius: 3,
|
|
97
|
-
testId: "empty-state-skeleton",
|
|
98
|
-
height: 16,
|
|
99
|
-
isShimmering: isShimmering,
|
|
100
|
-
width: statusWidth
|
|
68
|
+
return jsx(SkeletonComponent, {
|
|
69
|
+
width: longWidth,
|
|
70
|
+
itemName: key
|
|
101
71
|
});
|
|
102
72
|
default:
|
|
103
|
-
return jsx(
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
height: 13,
|
|
107
|
-
isShimmering: isShimmering,
|
|
108
|
-
width: width
|
|
73
|
+
return jsx(SkeletonComponent, {
|
|
74
|
+
width: width,
|
|
75
|
+
itemName: key
|
|
109
76
|
});
|
|
110
77
|
}
|
|
111
78
|
};
|
|
112
79
|
export default (({
|
|
113
80
|
isCompact,
|
|
114
|
-
isLoading = false,
|
|
115
81
|
testId
|
|
116
82
|
}) => {
|
|
117
83
|
const columnsToRender = isCompact ? baseColumns.slice(0, 6) : baseColumns;
|
|
118
|
-
|
|
84
|
+
// if it is compact (non-modal), there is room for 14 rows
|
|
85
|
+
// if it is modal (not compact), there is only room for 10 rows
|
|
86
|
+
const rowsNumber = isCompact ? 14 : 10;
|
|
87
|
+
const rows = new Array(rowsNumber).fill(null).map((_, index) => ({
|
|
88
|
+
id: index,
|
|
89
|
+
longWidth: longColumnWidths[index],
|
|
90
|
+
shortWidth: shortColumnWidths[index]
|
|
91
|
+
}));
|
|
92
|
+
return jsx("div", {
|
|
93
|
+
style: {
|
|
94
|
+
// the IssueLikeDataTableView wraps the table in a container with the styling below while modal doesn't
|
|
95
|
+
// the isCompact prop is applied to non-modal empty states which require additional padding
|
|
96
|
+
// this maxHeight comes from scrollableContainerHeight
|
|
97
|
+
maxHeight: ScrollableContainerHeight,
|
|
98
|
+
padding: isCompact ? `0 ${tableSidePadding} 0 ${tableSidePadding}` : '0',
|
|
99
|
+
boxSizing: 'border-box'
|
|
100
|
+
}
|
|
101
|
+
}, jsx("table", {
|
|
119
102
|
"data-testid": testId
|
|
120
|
-
}, jsx("thead",
|
|
103
|
+
}, jsx("thead", {
|
|
104
|
+
style: {
|
|
105
|
+
borderBottom: 0
|
|
106
|
+
}
|
|
107
|
+
}, jsx("tr", null, columnsToRender.map(({
|
|
121
108
|
key,
|
|
122
109
|
width
|
|
123
|
-
}) => jsx(
|
|
110
|
+
}) => jsx(TableHeading, {
|
|
124
111
|
key: key,
|
|
125
112
|
style: {
|
|
126
113
|
width
|
|
@@ -129,8 +116,7 @@ export default (({
|
|
|
129
116
|
appearance: "darkGray",
|
|
130
117
|
borderRadius: 8,
|
|
131
118
|
testId: "empty-state-skeleton",
|
|
132
|
-
|
|
133
|
-
height: 13,
|
|
119
|
+
height: 12,
|
|
134
120
|
width: width
|
|
135
121
|
}))))), jsx("tbody", {
|
|
136
122
|
css: tableBodyStyles
|
|
@@ -139,5 +125,5 @@ export default (({
|
|
|
139
125
|
}, columnsToRender.map(column => jsx("td", {
|
|
140
126
|
css: cellStyles,
|
|
141
127
|
key: column.key
|
|
142
|
-
}, renderItem(column, row
|
|
128
|
+
}, renderItem(column, row))))))));
|
|
143
129
|
});
|
|
@@ -90,8 +90,7 @@ function getColumnWidth(key, type) {
|
|
|
90
90
|
priority: BASE_WIDTH * 8,
|
|
91
91
|
status: BASE_WIDTH * 18,
|
|
92
92
|
summary: BASE_WIDTH * 45,
|
|
93
|
-
description: BASE_WIDTH * 31.25
|
|
94
|
-
type: BASE_WIDTH * 8
|
|
93
|
+
description: BASE_WIDTH * 31.25
|
|
95
94
|
};
|
|
96
95
|
if (keyBasedWidth[key]) {
|
|
97
96
|
return keyBasedWidth[key];
|
|
@@ -153,9 +152,10 @@ export const IssueLikeDataTableView = ({
|
|
|
153
152
|
key
|
|
154
153
|
}) => {
|
|
155
154
|
const content = jsx(Skeleton, {
|
|
156
|
-
borderRadius:
|
|
157
|
-
width:
|
|
158
|
-
height:
|
|
155
|
+
borderRadius: 8,
|
|
156
|
+
width: "100%",
|
|
157
|
+
height: 14,
|
|
158
|
+
testId: "issues-table-row-loading"
|
|
159
159
|
});
|
|
160
160
|
return {
|
|
161
161
|
key,
|
|
@@ -274,7 +274,25 @@ export const IssueLikeDataTableView = ({
|
|
|
274
274
|
}),
|
|
275
275
|
ref: rowIndex === items.length - 1 ? el => setLastRowElement(el) : undefined
|
|
276
276
|
})), [identityColumnKey, renderItem, items, visibleSortedColumns]);
|
|
277
|
-
const rows = useMemo(() =>
|
|
277
|
+
const rows = useMemo(() => {
|
|
278
|
+
if (status !== 'loading') {
|
|
279
|
+
return tableRows;
|
|
280
|
+
}
|
|
281
|
+
// if there are table rows, only add 1 loading row
|
|
282
|
+
if (tableRows.length > 0) {
|
|
283
|
+
return [...tableRows, {
|
|
284
|
+
...loadingRow,
|
|
285
|
+
key: `loading-${tableRows.length}`
|
|
286
|
+
}];
|
|
287
|
+
}
|
|
288
|
+
// if there are no table rows add 14 rows if it is compact (has scrollableContainerHeight or non-modal)
|
|
289
|
+
// add 10 rows if it is modal (no scrollableContainerHeight)
|
|
290
|
+
const loadingRowsCount = scrollableContainerHeight ? 14 : 10;
|
|
291
|
+
return [...Array(loadingRowsCount)].map((_, index) => ({
|
|
292
|
+
...loadingRow,
|
|
293
|
+
key: `loading-${index}`
|
|
294
|
+
}));
|
|
295
|
+
}, [loadingRow, status, tableRows, scrollableContainerHeight]);
|
|
278
296
|
const onSelectedColumnKeysChange = useCallback(newSelectedColumnKeys => {
|
|
279
297
|
onVisibleColumnKeysChange === null || onVisibleColumnKeysChange === void 0 ? void 0 : onVisibleColumnKeysChange(newSelectedColumnKeys);
|
|
280
298
|
}, [onVisibleColumnKeysChange]);
|
|
@@ -352,6 +370,8 @@ export const IssueLikeDataTableView = ({
|
|
|
352
370
|
key: key,
|
|
353
371
|
"data-testid": `${key}-column-heading`,
|
|
354
372
|
style: {
|
|
373
|
+
// this keeps the column headers from collapsing horizontally during loading states
|
|
374
|
+
minWidth: maxWidth,
|
|
355
375
|
maxWidth
|
|
356
376
|
}
|
|
357
377
|
}, heading);
|
|
@@ -377,14 +397,24 @@ export const IssueLikeDataTableView = ({
|
|
|
377
397
|
key: cellKey,
|
|
378
398
|
content,
|
|
379
399
|
maxWidth
|
|
380
|
-
}, cellIndex) =>
|
|
381
|
-
|
|
382
|
-
"data-testid": testId && `${testId}--cell-${cellIndex}`,
|
|
383
|
-
colSpan: cellIndex + 1 === cells.length ? 2 : undefined,
|
|
384
|
-
css: truncatedCellStyles,
|
|
385
|
-
style: {
|
|
400
|
+
}, cellIndex) => {
|
|
401
|
+
let loadingRowStyle = {
|
|
386
402
|
maxWidth
|
|
403
|
+
};
|
|
404
|
+
// extra padding is required around skeleton loader to avoid vertical jumps when data loads
|
|
405
|
+
if (key !== null && key !== void 0 && key.includes('loading')) {
|
|
406
|
+
loadingRowStyle = {
|
|
407
|
+
...loadingRowStyle,
|
|
408
|
+
paddingBlock: "var(--ds-space-100, 12px)"
|
|
409
|
+
};
|
|
387
410
|
}
|
|
388
|
-
|
|
411
|
+
return jsx("td", {
|
|
412
|
+
key: cellKey,
|
|
413
|
+
"data-testid": testId && `${testId}--cell-${cellIndex}`,
|
|
414
|
+
colSpan: cellIndex + 1 === cells.length ? 2 : undefined,
|
|
415
|
+
css: truncatedCellStyles,
|
|
416
|
+
style: loadingRowStyle
|
|
417
|
+
}, content);
|
|
418
|
+
}))))));
|
|
389
419
|
};
|
|
390
420
|
export const EmptyState = TableEmptyState;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import styled from '@emotion/styled';
|
|
2
2
|
import { N40 } from '@atlaskit/theme/colors';
|
|
3
|
+
export const ScrollableContainerHeight = 590;
|
|
3
4
|
export const FieldTextFontSize = '14px';
|
|
4
5
|
export const Table = styled.table`
|
|
5
6
|
width: 100%;
|
|
@@ -15,9 +16,4 @@ export const TableHeading = styled.th`
|
|
|
15
16
|
text-overflow: ellipsis;
|
|
16
17
|
white-space: nowrap;
|
|
17
18
|
}
|
|
18
|
-
`;
|
|
19
|
-
export const EmptyStateTableHeading = styled(TableHeading)`
|
|
20
|
-
&:first-child {
|
|
21
|
-
padding-left: ${"var(--ds-space-100, 8px)"};
|
|
22
|
-
}
|
|
23
19
|
`;
|
|
@@ -397,8 +397,7 @@ export const PlainJiraIssuesConfigModal = props => {
|
|
|
397
397
|
return jsx("div", {
|
|
398
398
|
css: contentContainerStyles
|
|
399
399
|
}, !!jql ? jsx(EmptyState, {
|
|
400
|
-
testId: `jira-jql-datasource-modal--empty-state
|
|
401
|
-
isLoading: true
|
|
400
|
+
testId: `jira-jql-datasource-modal--empty-state`
|
|
402
401
|
}) : jsx(InitialStateView, {
|
|
403
402
|
searchMethod: currentSearchMethod
|
|
404
403
|
}));
|
|
@@ -273,7 +273,6 @@ export var useDatasourceTableState = function useDatasourceTableState(_ref) {
|
|
|
273
273
|
reset();
|
|
274
274
|
void onNextPage({
|
|
275
275
|
isSchemaFromData: false,
|
|
276
|
-
// since this is not inital load, we will already have schema
|
|
277
276
|
shouldRequestFirstPage: true
|
|
278
277
|
});
|
|
279
278
|
}
|
|
@@ -225,7 +225,7 @@ var analyticsContextAttributes = {
|
|
|
225
225
|
};
|
|
226
226
|
var analyticsContextData = {
|
|
227
227
|
packageName: "@atlaskit/link-datasource",
|
|
228
|
-
packageVersion: "1.
|
|
228
|
+
packageVersion: "1.8.0",
|
|
229
229
|
source: 'datasourceConfigModal'
|
|
230
230
|
};
|
|
231
231
|
var contextData = _objectSpread(_objectSpread({}, analyticsContextData), {}, {
|
|
@@ -9,6 +9,7 @@ import { startUfoExperience } from '../../analytics/ufoExperiences';
|
|
|
9
9
|
import { useColumnPickerRenderedFailedUfoExperience } from '../../analytics/ufoExperiences/hooks/useColumnPickerRenderedFailedUfoExperience';
|
|
10
10
|
import { useDataRenderedUfoExperience } from '../../analytics/ufoExperiences/hooks/useDataRenderedUfoExperience';
|
|
11
11
|
import { useDatasourceTableState } from '../../hooks/useDatasourceTableState';
|
|
12
|
+
import { ScrollableContainerHeight } from '../../ui/issue-like-table/styled';
|
|
12
13
|
import { AccessRequired } from '../common/error-state/access-required';
|
|
13
14
|
import { LoadingError } from '../common/error-state/loading-error';
|
|
14
15
|
import { NoResults } from '../common/error-state/no-results';
|
|
@@ -126,13 +127,12 @@ var DatasourceTableViewWithoutAnalytics = function DatasourceTableViewWithoutAna
|
|
|
126
127
|
columns: columns,
|
|
127
128
|
visibleColumnKeys: visibleColumnKeys || defaultVisibleColumnKeys,
|
|
128
129
|
onVisibleColumnKeysChange: onVisibleColumnKeysChange,
|
|
129
|
-
scrollableContainerHeight:
|
|
130
|
+
scrollableContainerHeight: ScrollableContainerHeight,
|
|
130
131
|
parentContainerRenderInstanceId: tableRenderInstanceId,
|
|
131
132
|
extensionKey: extensionKey
|
|
132
133
|
}) : jsx(EmptyState, {
|
|
133
134
|
testId: "datasource-table-view-skeleton",
|
|
134
|
-
isCompact: true
|
|
135
|
-
isLoading: !isDataReady || status === 'loading'
|
|
135
|
+
isCompact: true
|
|
136
136
|
}), jsx(TableFooter, {
|
|
137
137
|
itemCount: isDataReady ? totalCount : undefined,
|
|
138
138
|
onRefresh: forcedReset,
|
|
@@ -1,25 +1,39 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import { css, jsx } from '@emotion/react';
|
|
3
3
|
import { Skeleton } from '@atlaskit/linking-common';
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
import { ScrollableContainerHeight, TableHeading } from '../styled';
|
|
5
|
+
var SkeletonComponent = function SkeletonComponent(_ref) {
|
|
6
|
+
var width = _ref.width,
|
|
7
|
+
itemName = _ref.itemName;
|
|
8
|
+
return jsx(Skeleton, {
|
|
9
|
+
borderRadius: 8,
|
|
10
|
+
testId: "".concat(itemName, "-empty-state-skeleton"),
|
|
11
|
+
height: 14,
|
|
12
|
+
width: width
|
|
13
|
+
});
|
|
14
|
+
};
|
|
15
|
+
var tableSidePadding = "var(--ds-space-200, 16px)";
|
|
8
16
|
var tableBodyStyles = css({
|
|
9
17
|
borderBottom: 0
|
|
10
18
|
});
|
|
19
|
+
var cellStyles = css({
|
|
20
|
+
paddingBlock: "var(--ds-space-100, 12px)",
|
|
21
|
+
'&:last-child': {
|
|
22
|
+
paddingRight: "var(--ds-space-100, 8px)"
|
|
23
|
+
}
|
|
24
|
+
});
|
|
11
25
|
var baseColumns = [{
|
|
12
26
|
key: 'type',
|
|
13
|
-
width:
|
|
27
|
+
width: 35
|
|
14
28
|
}, {
|
|
15
29
|
key: 'issue',
|
|
16
30
|
width: 50
|
|
17
31
|
}, {
|
|
18
32
|
key: 'summary',
|
|
19
|
-
width:
|
|
33
|
+
width: 100
|
|
20
34
|
}, {
|
|
21
35
|
key: 'assignee',
|
|
22
|
-
width:
|
|
36
|
+
width: 70
|
|
23
37
|
}, {
|
|
24
38
|
key: 'priority',
|
|
25
39
|
width: 60
|
|
@@ -36,91 +50,64 @@ var baseColumns = [{
|
|
|
36
50
|
key: 'due',
|
|
37
51
|
width: 50
|
|
38
52
|
}];
|
|
39
|
-
var
|
|
40
|
-
var
|
|
41
|
-
var
|
|
42
|
-
var
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
priority: priorities[index],
|
|
47
|
-
type: types[index],
|
|
48
|
-
summaryWidth: summaryColumnWidths[index],
|
|
49
|
-
statusWidth: statusColumnWidths[index]
|
|
50
|
-
};
|
|
51
|
-
});
|
|
52
|
-
var cellStyles = css({
|
|
53
|
-
'&:first-child': {
|
|
54
|
-
paddingLeft: "var(--ds-space-100, 8px)"
|
|
55
|
-
},
|
|
56
|
-
'&:last-child': {
|
|
57
|
-
paddingRight: "var(--ds-space-100, 8px)"
|
|
58
|
-
}
|
|
59
|
-
});
|
|
60
|
-
var renderItem = function renderItem(_ref, _ref2, isShimmering) {
|
|
61
|
-
var key = _ref.key,
|
|
62
|
-
width = _ref.width;
|
|
63
|
-
var priority = _ref2.priority,
|
|
64
|
-
type = _ref2.type,
|
|
65
|
-
summaryWidth = _ref2.summaryWidth,
|
|
66
|
-
statusWidth = _ref2.statusWidth;
|
|
53
|
+
var longColumnWidths = [141, 208, 186, 212, 212, 151, 212, 182, 180, 163, 172, 211, 145, 190];
|
|
54
|
+
var shortColumnWidths = [75, 54, 66, 73, 52, 73, 55, 80, 67, 76, 58, 65, 56, 76];
|
|
55
|
+
var renderItem = function renderItem(_ref2, _ref3) {
|
|
56
|
+
var key = _ref2.key,
|
|
57
|
+
width = _ref2.width;
|
|
58
|
+
var longWidth = _ref3.longWidth,
|
|
59
|
+
shortWidth = _ref3.shortWidth;
|
|
67
60
|
switch (key) {
|
|
68
|
-
case '
|
|
69
|
-
return jsx(
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
height: 13,
|
|
73
|
-
isShimmering: isShimmering,
|
|
74
|
-
width: width
|
|
75
|
-
}));
|
|
76
|
-
case 'priority':
|
|
77
|
-
return jsx(Priority, {
|
|
78
|
-
priority: priority
|
|
79
|
-
});
|
|
80
|
-
case 'type':
|
|
81
|
-
return jsx(Type, {
|
|
82
|
-
type: type
|
|
61
|
+
case 'status':
|
|
62
|
+
return jsx(SkeletonComponent, {
|
|
63
|
+
width: shortWidth,
|
|
64
|
+
itemName: key
|
|
83
65
|
});
|
|
84
66
|
case 'summary':
|
|
85
|
-
return jsx(
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
testId: "empty-state-skeleton",
|
|
89
|
-
height: 13,
|
|
90
|
-
isShimmering: isShimmering,
|
|
91
|
-
width: summaryWidth
|
|
92
|
-
});
|
|
93
|
-
case 'status':
|
|
94
|
-
return jsx(Skeleton, {
|
|
95
|
-
appearance: "blue",
|
|
96
|
-
borderRadius: 3,
|
|
97
|
-
testId: "empty-state-skeleton",
|
|
98
|
-
height: 16,
|
|
99
|
-
isShimmering: isShimmering,
|
|
100
|
-
width: statusWidth
|
|
67
|
+
return jsx(SkeletonComponent, {
|
|
68
|
+
width: longWidth,
|
|
69
|
+
itemName: key
|
|
101
70
|
});
|
|
102
71
|
default:
|
|
103
|
-
return jsx(
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
height: 13,
|
|
107
|
-
isShimmering: isShimmering,
|
|
108
|
-
width: width
|
|
72
|
+
return jsx(SkeletonComponent, {
|
|
73
|
+
width: width,
|
|
74
|
+
itemName: key
|
|
109
75
|
});
|
|
110
76
|
}
|
|
111
77
|
};
|
|
112
|
-
export default (function (
|
|
113
|
-
var isCompact =
|
|
114
|
-
|
|
115
|
-
isLoading = _ref3$isLoading === void 0 ? false : _ref3$isLoading,
|
|
116
|
-
testId = _ref3.testId;
|
|
78
|
+
export default (function (_ref4) {
|
|
79
|
+
var isCompact = _ref4.isCompact,
|
|
80
|
+
testId = _ref4.testId;
|
|
117
81
|
var columnsToRender = isCompact ? baseColumns.slice(0, 6) : baseColumns;
|
|
118
|
-
|
|
82
|
+
// if it is compact (non-modal), there is room for 14 rows
|
|
83
|
+
// if it is modal (not compact), there is only room for 10 rows
|
|
84
|
+
var rowsNumber = isCompact ? 14 : 10;
|
|
85
|
+
var rows = new Array(rowsNumber).fill(null).map(function (_, index) {
|
|
86
|
+
return {
|
|
87
|
+
id: index,
|
|
88
|
+
longWidth: longColumnWidths[index],
|
|
89
|
+
shortWidth: shortColumnWidths[index]
|
|
90
|
+
};
|
|
91
|
+
});
|
|
92
|
+
return jsx("div", {
|
|
93
|
+
style: {
|
|
94
|
+
// the IssueLikeDataTableView wraps the table in a container with the styling below while modal doesn't
|
|
95
|
+
// the isCompact prop is applied to non-modal empty states which require additional padding
|
|
96
|
+
// this maxHeight comes from scrollableContainerHeight
|
|
97
|
+
maxHeight: ScrollableContainerHeight,
|
|
98
|
+
padding: isCompact ? "0 ".concat(tableSidePadding, " 0 ").concat(tableSidePadding) : '0',
|
|
99
|
+
boxSizing: 'border-box'
|
|
100
|
+
}
|
|
101
|
+
}, jsx("table", {
|
|
119
102
|
"data-testid": testId
|
|
120
|
-
}, jsx("thead",
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
103
|
+
}, jsx("thead", {
|
|
104
|
+
style: {
|
|
105
|
+
borderBottom: 0
|
|
106
|
+
}
|
|
107
|
+
}, jsx("tr", null, columnsToRender.map(function (_ref5) {
|
|
108
|
+
var key = _ref5.key,
|
|
109
|
+
width = _ref5.width;
|
|
110
|
+
return jsx(TableHeading, {
|
|
124
111
|
key: key,
|
|
125
112
|
style: {
|
|
126
113
|
width: width
|
|
@@ -129,8 +116,7 @@ export default (function (_ref3) {
|
|
|
129
116
|
appearance: "darkGray",
|
|
130
117
|
borderRadius: 8,
|
|
131
118
|
testId: "empty-state-skeleton",
|
|
132
|
-
|
|
133
|
-
height: 13,
|
|
119
|
+
height: 12,
|
|
134
120
|
width: width
|
|
135
121
|
}));
|
|
136
122
|
}))), jsx("tbody", {
|
|
@@ -142,7 +128,7 @@ export default (function (_ref3) {
|
|
|
142
128
|
return jsx("td", {
|
|
143
129
|
css: cellStyles,
|
|
144
130
|
key: column.key
|
|
145
|
-
}, renderItem(column, row
|
|
131
|
+
}, renderItem(column, row));
|
|
146
132
|
}));
|
|
147
|
-
})));
|
|
133
|
+
}))));
|
|
148
134
|
});
|
|
@@ -8,7 +8,7 @@ import Epic16Icon from '@atlaskit/icon-object/glyph/epic/16';
|
|
|
8
8
|
import Issue16Icon from '@atlaskit/icon-object/glyph/issue/16';
|
|
9
9
|
import Story16Icon from '@atlaskit/icon-object/glyph/story/16';
|
|
10
10
|
import Task16Icon from '@atlaskit/icon-object/glyph/task/16';
|
|
11
|
-
var IconWrapper = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n justify-content:
|
|
11
|
+
var IconWrapper = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n justify-content: left;\n"])));
|
|
12
12
|
export default (function (_ref) {
|
|
13
13
|
var type = _ref.type;
|
|
14
14
|
var TypeIcon = function TypeIcon() {
|
|
@@ -86,8 +86,7 @@ function getColumnWidth(key, type) {
|
|
|
86
86
|
priority: BASE_WIDTH * 8,
|
|
87
87
|
status: BASE_WIDTH * 18,
|
|
88
88
|
summary: BASE_WIDTH * 45,
|
|
89
|
-
description: BASE_WIDTH * 31.25
|
|
90
|
-
type: BASE_WIDTH * 8
|
|
89
|
+
description: BASE_WIDTH * 31.25
|
|
91
90
|
};
|
|
92
91
|
if (keyBasedWidth[key]) {
|
|
93
92
|
return keyBasedWidth[key];
|
|
@@ -167,9 +166,10 @@ export var IssueLikeDataTableView = function IssueLikeDataTableView(_ref) {
|
|
|
167
166
|
cells: visibleSortedColumns.map(function (_ref3) {
|
|
168
167
|
var key = _ref3.key;
|
|
169
168
|
var content = jsx(Skeleton, {
|
|
170
|
-
borderRadius:
|
|
171
|
-
width:
|
|
172
|
-
height:
|
|
169
|
+
borderRadius: 8,
|
|
170
|
+
width: "100%",
|
|
171
|
+
height: 14,
|
|
172
|
+
testId: "issues-table-row-loading"
|
|
173
173
|
});
|
|
174
174
|
return {
|
|
175
175
|
key: key,
|
|
@@ -295,8 +295,24 @@ export var IssueLikeDataTableView = function IssueLikeDataTableView(_ref) {
|
|
|
295
295
|
});
|
|
296
296
|
}, [identityColumnKey, renderItem, items, visibleSortedColumns]);
|
|
297
297
|
var rows = useMemo(function () {
|
|
298
|
-
|
|
299
|
-
|
|
298
|
+
if (status !== 'loading') {
|
|
299
|
+
return tableRows;
|
|
300
|
+
}
|
|
301
|
+
// if there are table rows, only add 1 loading row
|
|
302
|
+
if (tableRows.length > 0) {
|
|
303
|
+
return [].concat(_toConsumableArray(tableRows), [_objectSpread(_objectSpread({}, loadingRow), {}, {
|
|
304
|
+
key: "loading-".concat(tableRows.length)
|
|
305
|
+
})]);
|
|
306
|
+
}
|
|
307
|
+
// if there are no table rows add 14 rows if it is compact (has scrollableContainerHeight or non-modal)
|
|
308
|
+
// add 10 rows if it is modal (no scrollableContainerHeight)
|
|
309
|
+
var loadingRowsCount = scrollableContainerHeight ? 14 : 10;
|
|
310
|
+
return _toConsumableArray(Array(loadingRowsCount)).map(function (_, index) {
|
|
311
|
+
return _objectSpread(_objectSpread({}, loadingRow), {}, {
|
|
312
|
+
key: "loading-".concat(index)
|
|
313
|
+
});
|
|
314
|
+
});
|
|
315
|
+
}, [loadingRow, status, tableRows, scrollableContainerHeight]);
|
|
300
316
|
var onSelectedColumnKeysChange = useCallback(function (newSelectedColumnKeys) {
|
|
301
317
|
onVisibleColumnKeysChange === null || onVisibleColumnKeysChange === void 0 || onVisibleColumnKeysChange(newSelectedColumnKeys);
|
|
302
318
|
}, [onVisibleColumnKeysChange]);
|
|
@@ -389,6 +405,8 @@ export var IssueLikeDataTableView = function IssueLikeDataTableView(_ref) {
|
|
|
389
405
|
key: key,
|
|
390
406
|
"data-testid": "".concat(key, "-column-heading"),
|
|
391
407
|
style: {
|
|
408
|
+
// this keeps the column headers from collapsing horizontally during loading states
|
|
409
|
+
minWidth: maxWidth,
|
|
392
410
|
maxWidth: maxWidth
|
|
393
411
|
}
|
|
394
412
|
}, heading);
|
|
@@ -414,14 +432,21 @@ export var IssueLikeDataTableView = function IssueLikeDataTableView(_ref) {
|
|
|
414
432
|
var cellKey = _ref14.key,
|
|
415
433
|
content = _ref14.content,
|
|
416
434
|
maxWidth = _ref14.maxWidth;
|
|
435
|
+
var loadingRowStyle = {
|
|
436
|
+
maxWidth: maxWidth
|
|
437
|
+
};
|
|
438
|
+
// extra padding is required around skeleton loader to avoid vertical jumps when data loads
|
|
439
|
+
if (key !== null && key !== void 0 && key.includes('loading')) {
|
|
440
|
+
loadingRowStyle = _objectSpread(_objectSpread({}, loadingRowStyle), {}, {
|
|
441
|
+
paddingBlock: "var(--ds-space-100, 12px)"
|
|
442
|
+
});
|
|
443
|
+
}
|
|
417
444
|
return jsx("td", {
|
|
418
445
|
key: cellKey,
|
|
419
446
|
"data-testid": testId && "".concat(testId, "--cell-").concat(cellIndex),
|
|
420
447
|
colSpan: cellIndex + 1 === cells.length ? 2 : undefined,
|
|
421
448
|
css: truncatedCellStyles,
|
|
422
|
-
style:
|
|
423
|
-
maxWidth: maxWidth
|
|
424
|
-
}
|
|
449
|
+
style: loadingRowStyle
|
|
425
450
|
}, content);
|
|
426
451
|
}));
|
|
427
452
|
}))));
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
|
-
var _templateObject, _templateObject2
|
|
2
|
+
var _templateObject, _templateObject2;
|
|
3
3
|
import styled from '@emotion/styled';
|
|
4
4
|
import { N40 } from '@atlaskit/theme/colors';
|
|
5
|
+
export var ScrollableContainerHeight = 590;
|
|
5
6
|
export var FieldTextFontSize = '14px';
|
|
6
7
|
export var Table = styled.table(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n width: 100%;\n"])));
|
|
7
|
-
export var TableHeading = styled.th(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n position: relative;\n padding-block: ", " ", ";\n line-height: ", ";\n border-bottom: 2px solid ", ";\n & [data-testid='datasource-header-content--container'] {\n margin-top: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n"])), "var(--ds-space-300, 24px)", "var(--ds-space-100, 8px)", "var(--ds-font-lineHeight-300, 16px)", "var(--ds-background-accent-gray-subtler, ".concat(N40, ")"));
|
|
8
|
-
export var EmptyStateTableHeading = styled(TableHeading)(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n &:first-child {\n padding-left: ", ";\n }\n"])), "var(--ds-space-100, 8px)");
|
|
8
|
+
export var TableHeading = styled.th(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n position: relative;\n padding-block: ", " ", ";\n line-height: ", ";\n border-bottom: 2px solid ", ";\n & [data-testid='datasource-header-content--container'] {\n margin-top: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n"])), "var(--ds-space-300, 24px)", "var(--ds-space-100, 8px)", "var(--ds-font-lineHeight-300, 16px)", "var(--ds-background-accent-gray-subtler, ".concat(N40, ")"));
|
|
@@ -445,8 +445,7 @@ export var PlainJiraIssuesConfigModal = function PlainJiraIssuesConfigModal(prop
|
|
|
445
445
|
return jsx("div", {
|
|
446
446
|
css: contentContainerStyles
|
|
447
447
|
}, !!jql ? jsx(EmptyState, {
|
|
448
|
-
testId: "jira-jql-datasource-modal--empty-state"
|
|
449
|
-
isLoading: true
|
|
448
|
+
testId: "jira-jql-datasource-modal--empty-state"
|
|
450
449
|
}) : jsx(InitialStateView, {
|
|
451
450
|
searchMethod: currentSearchMethod
|
|
452
451
|
}));
|
|
@@ -2,8 +2,7 @@
|
|
|
2
2
|
import { jsx } from '@emotion/react';
|
|
3
3
|
export interface Props {
|
|
4
4
|
isCompact?: boolean;
|
|
5
|
-
isLoading?: boolean;
|
|
6
5
|
testId?: string;
|
|
7
6
|
}
|
|
8
|
-
declare const _default: ({ isCompact,
|
|
7
|
+
declare const _default: ({ isCompact, testId }: Props) => jsx.JSX.Element;
|
|
9
8
|
export default _default;
|
|
@@ -15,4 +15,4 @@ export interface RowCellType {
|
|
|
15
15
|
}
|
|
16
16
|
export declare const orderColumns: (columns: DatasourceResponseSchemaProperty[], visibleColumnKeys: string[]) => DatasourceResponseSchemaProperty[];
|
|
17
17
|
export declare const IssueLikeDataTableView: ({ testId, onNextPage, onLoadDatasourceDetails, items, columns, renderItem, visibleColumnKeys, onVisibleColumnKeysChange, status, hasNextPage, scrollableContainerHeight, parentContainerRenderInstanceId, extensionKey, }: IssueLikeDataTableViewProps) => jsx.JSX.Element;
|
|
18
|
-
export declare const EmptyState: ({ isCompact,
|
|
18
|
+
export declare const EmptyState: ({ isCompact, testId }: import("./empty-state").Props) => jsx.JSX.Element;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
export declare const ScrollableContainerHeight = 590;
|
|
2
3
|
export declare const FieldTextFontSize = "14px";
|
|
3
4
|
export declare const Table: import("@emotion/styled").StyledComponent<{
|
|
4
5
|
theme?: import("@emotion/react").Theme | undefined;
|
|
@@ -8,11 +9,3 @@ export declare const TableHeading: import("@emotion/styled").StyledComponent<{
|
|
|
8
9
|
theme?: import("@emotion/react").Theme | undefined;
|
|
9
10
|
as?: import("react").ElementType<any> | undefined;
|
|
10
11
|
}, import("react").DetailedHTMLProps<import("react").ThHTMLAttributes<HTMLTableHeaderCellElement>, HTMLTableHeaderCellElement>, {}>;
|
|
11
|
-
export declare const EmptyStateTableHeading: import("@emotion/styled").StyledComponent<{
|
|
12
|
-
theme?: import("@emotion/react").Theme | undefined;
|
|
13
|
-
as?: import("react").ElementType<any> | undefined;
|
|
14
|
-
} & import("react").ClassAttributes<HTMLTableHeaderCellElement> & import("react").ThHTMLAttributes<HTMLTableHeaderCellElement> & {
|
|
15
|
-
children?: import("react").ReactNode;
|
|
16
|
-
} & {
|
|
17
|
-
theme?: import("@emotion/react").Theme | undefined;
|
|
18
|
-
}, {}, {}>;
|
|
@@ -2,8 +2,7 @@
|
|
|
2
2
|
import { jsx } from '@emotion/react';
|
|
3
3
|
export interface Props {
|
|
4
4
|
isCompact?: boolean;
|
|
5
|
-
isLoading?: boolean;
|
|
6
5
|
testId?: string;
|
|
7
6
|
}
|
|
8
|
-
declare const _default: ({ isCompact,
|
|
7
|
+
declare const _default: ({ isCompact, testId }: Props) => jsx.JSX.Element;
|
|
9
8
|
export default _default;
|
|
@@ -15,4 +15,4 @@ export interface RowCellType {
|
|
|
15
15
|
}
|
|
16
16
|
export declare const orderColumns: (columns: DatasourceResponseSchemaProperty[], visibleColumnKeys: string[]) => DatasourceResponseSchemaProperty[];
|
|
17
17
|
export declare const IssueLikeDataTableView: ({ testId, onNextPage, onLoadDatasourceDetails, items, columns, renderItem, visibleColumnKeys, onVisibleColumnKeysChange, status, hasNextPage, scrollableContainerHeight, parentContainerRenderInstanceId, extensionKey, }: IssueLikeDataTableViewProps) => jsx.JSX.Element;
|
|
18
|
-
export declare const EmptyState: ({ isCompact,
|
|
18
|
+
export declare const EmptyState: ({ isCompact, testId }: import("./empty-state").Props) => jsx.JSX.Element;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
export declare const ScrollableContainerHeight = 590;
|
|
2
3
|
export declare const FieldTextFontSize = "14px";
|
|
3
4
|
export declare const Table: import("@emotion/styled").StyledComponent<{
|
|
4
5
|
theme?: import("@emotion/react").Theme | undefined;
|
|
@@ -8,11 +9,3 @@ export declare const TableHeading: import("@emotion/styled").StyledComponent<{
|
|
|
8
9
|
theme?: import("@emotion/react").Theme | undefined;
|
|
9
10
|
as?: import("react").ElementType<any> | undefined;
|
|
10
11
|
}, import("react").DetailedHTMLProps<import("react").ThHTMLAttributes<HTMLTableHeaderCellElement>, HTMLTableHeaderCellElement>, {}>;
|
|
11
|
-
export declare const EmptyStateTableHeading: import("@emotion/styled").StyledComponent<{
|
|
12
|
-
theme?: import("@emotion/react").Theme | undefined;
|
|
13
|
-
as?: import("react").ElementType<any> | undefined;
|
|
14
|
-
} & import("react").ClassAttributes<HTMLTableHeaderCellElement> & import("react").ThHTMLAttributes<HTMLTableHeaderCellElement> & {
|
|
15
|
-
children?: import("react").ReactNode;
|
|
16
|
-
} & {
|
|
17
|
-
theme?: import("@emotion/react").Theme | undefined;
|
|
18
|
-
}, {}, {}>;
|