@atlaskit/link-datasource 1.7.5 → 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 +12 -0
- package/dist/cjs/analytics/constants.js +1 -1
- package/dist/cjs/hooks/useDatasourceTableState.js +12 -16
- 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 +3 -3
- package/dist/es2019/analytics/constants.js +1 -1
- package/dist/es2019/hooks/useDatasourceTableState.js +1 -5
- 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 +3 -4
- package/dist/esm/analytics/constants.js +1 -1
- package/dist/esm/hooks/useDatasourceTableState.js +12 -16
- 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 +3 -3
- 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,17 @@
|
|
|
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
|
+
|
|
9
|
+
## 1.7.6
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [#41377](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/41377) [`6191c789222`](https://bitbucket.org/atlassian/atlassian-frontend/commits/6191c789222) - Fix bug where on next page load sorts the column in alphabetical order.
|
|
14
|
+
|
|
3
15
|
## 1.7.5
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
|
@@ -138,7 +138,6 @@ var useDatasourceTableState = exports.useDatasourceTableState = function useData
|
|
|
138
138
|
shouldRequestFirstPage,
|
|
139
139
|
_requestInfo$shouldFo,
|
|
140
140
|
shouldForceRequest,
|
|
141
|
-
sortedFieldKeys,
|
|
142
141
|
datasourceDataRequest,
|
|
143
142
|
_yield$getDatasourceD2,
|
|
144
143
|
_yield$getDatasourceD3,
|
|
@@ -165,20 +164,18 @@ var useDatasourceTableState = exports.useDatasourceTableState = function useData
|
|
|
165
164
|
return _context2.abrupt("return");
|
|
166
165
|
case 3:
|
|
167
166
|
_requestInfo$isSchema = requestInfo.isSchemaFromData, isSchemaFromData = _requestInfo$isSchema === void 0 ? true : _requestInfo$isSchema, shouldRequestFirstPage = requestInfo.shouldRequestFirstPage, _requestInfo$shouldFo = requestInfo.shouldForceRequest, shouldForceRequest = _requestInfo$shouldFo === void 0 ? false : _requestInfo$shouldFo;
|
|
168
|
-
sortedFieldKeys = (0, _toConsumableArray2.default)(fieldKeys); // Sort keys to use cached version of response regardless of the order
|
|
169
|
-
sortedFieldKeys.sort();
|
|
170
167
|
datasourceDataRequest = {
|
|
171
168
|
parameters: parameters,
|
|
172
169
|
pageSize: _linkClientExtension.DEFAULT_GET_DATASOURCE_DATA_PAGE_SIZE,
|
|
173
170
|
pageCursor: shouldRequestFirstPage ? undefined : nextCursor,
|
|
174
|
-
fields:
|
|
171
|
+
fields: fieldKeys,
|
|
175
172
|
includeSchema: isSchemaFromData
|
|
176
173
|
};
|
|
177
174
|
setStatus('loading');
|
|
178
|
-
_context2.prev =
|
|
179
|
-
_context2.next =
|
|
175
|
+
_context2.prev = 6;
|
|
176
|
+
_context2.next = 9;
|
|
180
177
|
return getDatasourceData(datasourceId, datasourceDataRequest, shouldForceRequest);
|
|
181
|
-
case
|
|
178
|
+
case 9:
|
|
182
179
|
_yield$getDatasourceD2 = _context2.sent;
|
|
183
180
|
_yield$getDatasourceD3 = _yield$getDatasourceD2.meta;
|
|
184
181
|
access = _yield$getDatasourceD3.access;
|
|
@@ -190,12 +187,12 @@ var useDatasourceTableState = exports.useDatasourceTableState = function useData
|
|
|
190
187
|
_totalCount = _yield$getDatasourceD4.totalCount;
|
|
191
188
|
schema = _yield$getDatasourceD4.schema;
|
|
192
189
|
if (!(access === 'forbidden' || access === 'unauthorized')) {
|
|
193
|
-
_context2.next =
|
|
190
|
+
_context2.next = 22;
|
|
194
191
|
break;
|
|
195
192
|
}
|
|
196
193
|
setStatus('unauthorized');
|
|
197
194
|
return _context2.abrupt("return");
|
|
198
|
-
case
|
|
195
|
+
case 22:
|
|
199
196
|
setExtensionKey(_extensionKey);
|
|
200
197
|
setDestinationObjectTypes(_destinationObjectTypes);
|
|
201
198
|
setTotalCount(_totalCount);
|
|
@@ -224,17 +221,17 @@ var useDatasourceTableState = exports.useDatasourceTableState = function useData
|
|
|
224
221
|
});
|
|
225
222
|
}
|
|
226
223
|
setStatus('resolved');
|
|
227
|
-
_context2.next =
|
|
224
|
+
_context2.next = 38;
|
|
228
225
|
break;
|
|
229
|
-
case
|
|
230
|
-
_context2.prev =
|
|
231
|
-
_context2.t0 = _context2["catch"](
|
|
226
|
+
case 35:
|
|
227
|
+
_context2.prev = 35;
|
|
228
|
+
_context2.t0 = _context2["catch"](6);
|
|
232
229
|
setStatus('rejected');
|
|
233
|
-
case
|
|
230
|
+
case 38:
|
|
234
231
|
case "end":
|
|
235
232
|
return _context2.stop();
|
|
236
233
|
}
|
|
237
|
-
}, _callee2, null, [[
|
|
234
|
+
}, _callee2, null, [[6, 35]]);
|
|
238
235
|
})), [parameters, fieldKeys, nextCursor, getDatasourceData, datasourceId, responseItems === null || responseItems === void 0 ? void 0 : responseItems.length, applySchemaProperties, fireEvent]);
|
|
239
236
|
var reset = (0, _react.useCallback)(function (options) {
|
|
240
237
|
setStatus('empty');
|
|
@@ -283,7 +280,6 @@ var useDatasourceTableState = exports.useDatasourceTableState = function useData
|
|
|
283
280
|
reset();
|
|
284
281
|
void onNextPage({
|
|
285
282
|
isSchemaFromData: false,
|
|
286
|
-
// since this is not inital load, we will already have schema
|
|
287
283
|
shouldRequestFirstPage: true
|
|
288
284
|
});
|
|
289
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, ")"));
|
|
@@ -388,8 +388,9 @@ var PlainJiraIssuesConfigModal = exports.PlainJiraIssuesConfigModal = function P
|
|
|
388
388
|
setCurrentViewMode(selectedMode);
|
|
389
389
|
};
|
|
390
390
|
var handleOnNextPage = (0, _react.useCallback)(function () {
|
|
391
|
+
var onNextPageProps = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
391
392
|
userInteractionActions.current.add(_types.DatasourceAction.NEXT_PAGE_SCROLLED);
|
|
392
|
-
onNextPage();
|
|
393
|
+
onNextPage(onNextPageProps);
|
|
393
394
|
}, [onNextPage]);
|
|
394
395
|
var handleVisibleColumnKeysChange = (0, _react.useCallback)(function () {
|
|
395
396
|
var newVisibleColumnKeys = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
@@ -453,8 +454,7 @@ var PlainJiraIssuesConfigModal = exports.PlainJiraIssuesConfigModal = function P
|
|
|
453
454
|
return (0, _react2.jsx)("div", {
|
|
454
455
|
css: contentContainerStyles
|
|
455
456
|
}, !!jql ? (0, _react2.jsx)(_issueLikeTable.EmptyState, {
|
|
456
|
-
testId: "jira-jql-datasource-modal--empty-state"
|
|
457
|
-
isLoading: true
|
|
457
|
+
testId: "jira-jql-datasource-modal--empty-state"
|
|
458
458
|
}) : (0, _react2.jsx)(_initialStateView.InitialStateView, {
|
|
459
459
|
searchMethod: currentSearchMethod
|
|
460
460
|
}));
|
|
@@ -76,14 +76,11 @@ export const useDatasourceTableState = ({
|
|
|
76
76
|
shouldRequestFirstPage,
|
|
77
77
|
shouldForceRequest = false
|
|
78
78
|
} = requestInfo;
|
|
79
|
-
const sortedFieldKeys = [...fieldKeys];
|
|
80
|
-
// Sort keys to use cached version of response regardless of the order
|
|
81
|
-
sortedFieldKeys.sort();
|
|
82
79
|
const datasourceDataRequest = {
|
|
83
80
|
parameters,
|
|
84
81
|
pageSize: DEFAULT_GET_DATASOURCE_DATA_PAGE_SIZE,
|
|
85
82
|
pageCursor: shouldRequestFirstPage ? undefined : nextCursor,
|
|
86
|
-
fields:
|
|
83
|
+
fields: fieldKeys,
|
|
87
84
|
includeSchema: isSchemaFromData
|
|
88
85
|
};
|
|
89
86
|
setStatus('loading');
|
|
@@ -180,7 +177,6 @@ export const useDatasourceTableState = ({
|
|
|
180
177
|
reset();
|
|
181
178
|
void onNextPage({
|
|
182
179
|
isSchemaFromData: false,
|
|
183
|
-
// since this is not inital load, we will already have schema
|
|
184
180
|
shouldRequestFirstPage: true
|
|
185
181
|
});
|
|
186
182
|
}
|
|
@@ -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,
|