@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.
Files changed (35) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/cjs/analytics/constants.js +1 -1
  3. package/dist/cjs/hooks/useDatasourceTableState.js +12 -16
  4. package/dist/cjs/ui/assets-modal/modal/index.js +1 -1
  5. package/dist/cjs/ui/datasource-table-view/datasourceTableView.js +3 -3
  6. package/dist/cjs/ui/issue-like-table/empty-state/index.js +71 -86
  7. package/dist/cjs/ui/issue-like-table/empty-state/type.js +1 -1
  8. package/dist/cjs/ui/issue-like-table/index.js +35 -10
  9. package/dist/cjs/ui/issue-like-table/styled.js +4 -4
  10. package/dist/cjs/ui/jira-issues-modal/modal/index.js +3 -3
  11. package/dist/es2019/analytics/constants.js +1 -1
  12. package/dist/es2019/hooks/useDatasourceTableState.js +1 -5
  13. package/dist/es2019/ui/assets-modal/modal/index.js +1 -1
  14. package/dist/es2019/ui/datasource-table-view/datasourceTableView.js +3 -3
  15. package/dist/es2019/ui/issue-like-table/empty-state/index.js +61 -75
  16. package/dist/es2019/ui/issue-like-table/empty-state/type.js +1 -1
  17. package/dist/es2019/ui/issue-like-table/index.js +43 -13
  18. package/dist/es2019/ui/issue-like-table/styled.js +1 -5
  19. package/dist/es2019/ui/jira-issues-modal/modal/index.js +3 -4
  20. package/dist/esm/analytics/constants.js +1 -1
  21. package/dist/esm/hooks/useDatasourceTableState.js +12 -16
  22. package/dist/esm/ui/assets-modal/modal/index.js +1 -1
  23. package/dist/esm/ui/datasource-table-view/datasourceTableView.js +3 -3
  24. package/dist/esm/ui/issue-like-table/empty-state/index.js +72 -86
  25. package/dist/esm/ui/issue-like-table/empty-state/type.js +1 -1
  26. package/dist/esm/ui/issue-like-table/index.js +35 -10
  27. package/dist/esm/ui/issue-like-table/styled.js +3 -3
  28. package/dist/esm/ui/jira-issues-modal/modal/index.js +3 -3
  29. package/dist/types/ui/issue-like-table/empty-state/index.d.ts +1 -2
  30. package/dist/types/ui/issue-like-table/index.d.ts +1 -1
  31. package/dist/types/ui/issue-like-table/styled.d.ts +1 -8
  32. package/dist/types-ts4.5/ui/issue-like-table/empty-state/index.d.ts +1 -2
  33. package/dist/types-ts4.5/ui/issue-like-table/index.d.ts +1 -1
  34. package/dist/types-ts4.5/ui/issue-like-table/styled.d.ts +1 -8
  35. package/package.json +1 -1
@@ -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 UserType from '../render-type/user';
5
- import { EmptyStateTableHeading } from '../styled';
6
- import Priority from './priority';
7
- import Type from './type';
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: 50
26
+ width: 35
14
27
  }, {
15
28
  key: 'issue',
16
29
  width: 50
17
30
  }, {
18
31
  key: 'summary',
19
- width: 70
32
+ width: 100
20
33
  }, {
21
34
  key: 'assignee',
22
- width: 100
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 priorities = ['low', 'medium', 'high', 'medium', 'low', 'blocker', 'medium', 'blocker', 'high', 'low'];
40
- const types = ['task', 'story', 'commit', 'epic', 'bug', 'task', 'story', 'commit', 'issue', 'epic'];
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
- priority,
63
- type,
64
- summaryWidth,
65
- statusWidth
66
- }, isShimmering) => {
58
+ longWidth,
59
+ shortWidth
60
+ }) => {
67
61
  switch (key) {
68
- case 'assignee':
69
- return jsx(UserType, null, jsx(Skeleton, {
70
- borderRadius: 8,
71
- testId: "empty-state-skeleton",
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(Skeleton, {
86
- appearance: "blue",
87
- borderRadius: 10,
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(Skeleton, {
104
- borderRadius: 8,
105
- testId: "empty-state-skeleton",
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
- return jsx("table", {
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", null, jsx("tr", null, columnsToRender.map(({
103
+ }, jsx("thead", {
104
+ style: {
105
+ borderBottom: 0
106
+ }
107
+ }, jsx("tr", null, columnsToRender.map(({
121
108
  key,
122
109
  width
123
- }) => jsx(EmptyStateTableHeading, {
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
- isShimmering: isLoading,
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, isLoading)))))));
128
+ }, renderItem(column, row))))))));
143
129
  });
@@ -9,7 +9,7 @@ import Task16Icon from '@atlaskit/icon-object/glyph/task/16';
9
9
  const IconWrapper = styled.div`
10
10
  display: flex;
11
11
  align-items: center;
12
- justify-content: center;
12
+ justify-content: left;
13
13
  `;
14
14
  export default (({
15
15
  type
@@ -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: "var(--ds-border-radius-100, 3px)",
157
- width: '100%',
158
- height: '20px'
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(() => [...tableRows, ...(status === 'loading' ? [loadingRow] : [])], [loadingRow, status, tableRows]);
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) => jsx("td", {
381
- key: cellKey,
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
- }, content)))))));
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
  `;
@@ -334,9 +334,9 @@ export const PlainJiraIssuesConfigModal = props => {
334
334
  userInteractionActions.current.add(DatasourceAction.DISPLAY_VIEW_CHANGED);
335
335
  setCurrentViewMode(selectedMode);
336
336
  };
337
- const handleOnNextPage = useCallback(() => {
337
+ const handleOnNextPage = useCallback((onNextPageProps = {}) => {
338
338
  userInteractionActions.current.add(DatasourceAction.NEXT_PAGE_SCROLLED);
339
- onNextPage();
339
+ onNextPage(onNextPageProps);
340
340
  }, [onNextPage]);
341
341
  const handleVisibleColumnKeysChange = useCallback((newVisibleColumnKeys = []) => {
342
342
  const columnAction = getColumnAction(visibleColumnKeys || [], newVisibleColumnKeys);
@@ -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
  }));
@@ -1,5 +1,5 @@
1
1
  export var EVENT_CHANNEL = 'media';
2
2
  export var packageMetaData = {
3
3
  packageName: "@atlaskit/link-datasource",
4
- packageVersion: "1.7.5"
4
+ packageVersion: "1.8.0"
5
5
  };
@@ -131,7 +131,6 @@ export var useDatasourceTableState = function useDatasourceTableState(_ref) {
131
131
  shouldRequestFirstPage,
132
132
  _requestInfo$shouldFo,
133
133
  shouldForceRequest,
134
- sortedFieldKeys,
135
134
  datasourceDataRequest,
136
135
  _yield$getDatasourceD2,
137
136
  _yield$getDatasourceD3,
@@ -158,20 +157,18 @@ export var useDatasourceTableState = function useDatasourceTableState(_ref) {
158
157
  return _context2.abrupt("return");
159
158
  case 3:
160
159
  _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;
161
- sortedFieldKeys = _toConsumableArray(fieldKeys); // Sort keys to use cached version of response regardless of the order
162
- sortedFieldKeys.sort();
163
160
  datasourceDataRequest = {
164
161
  parameters: parameters,
165
162
  pageSize: DEFAULT_GET_DATASOURCE_DATA_PAGE_SIZE,
166
163
  pageCursor: shouldRequestFirstPage ? undefined : nextCursor,
167
- fields: sortedFieldKeys,
164
+ fields: fieldKeys,
168
165
  includeSchema: isSchemaFromData
169
166
  };
170
167
  setStatus('loading');
171
- _context2.prev = 8;
172
- _context2.next = 11;
168
+ _context2.prev = 6;
169
+ _context2.next = 9;
173
170
  return getDatasourceData(datasourceId, datasourceDataRequest, shouldForceRequest);
174
- case 11:
171
+ case 9:
175
172
  _yield$getDatasourceD2 = _context2.sent;
176
173
  _yield$getDatasourceD3 = _yield$getDatasourceD2.meta;
177
174
  access = _yield$getDatasourceD3.access;
@@ -183,12 +180,12 @@ export var useDatasourceTableState = function useDatasourceTableState(_ref) {
183
180
  _totalCount = _yield$getDatasourceD4.totalCount;
184
181
  schema = _yield$getDatasourceD4.schema;
185
182
  if (!(access === 'forbidden' || access === 'unauthorized')) {
186
- _context2.next = 24;
183
+ _context2.next = 22;
187
184
  break;
188
185
  }
189
186
  setStatus('unauthorized');
190
187
  return _context2.abrupt("return");
191
- case 24:
188
+ case 22:
192
189
  setExtensionKey(_extensionKey);
193
190
  setDestinationObjectTypes(_destinationObjectTypes);
194
191
  setTotalCount(_totalCount);
@@ -217,17 +214,17 @@ export var useDatasourceTableState = function useDatasourceTableState(_ref) {
217
214
  });
218
215
  }
219
216
  setStatus('resolved');
220
- _context2.next = 40;
217
+ _context2.next = 38;
221
218
  break;
222
- case 37:
223
- _context2.prev = 37;
224
- _context2.t0 = _context2["catch"](8);
219
+ case 35:
220
+ _context2.prev = 35;
221
+ _context2.t0 = _context2["catch"](6);
225
222
  setStatus('rejected');
226
- case 40:
223
+ case 38:
227
224
  case "end":
228
225
  return _context2.stop();
229
226
  }
230
- }, _callee2, null, [[8, 37]]);
227
+ }, _callee2, null, [[6, 35]]);
231
228
  })), [parameters, fieldKeys, nextCursor, getDatasourceData, datasourceId, responseItems === null || responseItems === void 0 ? void 0 : responseItems.length, applySchemaProperties, fireEvent]);
232
229
  var reset = useCallback(function (options) {
233
230
  setStatus('empty');
@@ -276,7 +273,6 @@ export var useDatasourceTableState = function useDatasourceTableState(_ref) {
276
273
  reset();
277
274
  void onNextPage({
278
275
  isSchemaFromData: false,
279
- // since this is not inital load, we will already have schema
280
276
  shouldRequestFirstPage: true
281
277
  });
282
278
  }
@@ -225,7 +225,7 @@ var analyticsContextAttributes = {
225
225
  };
226
226
  var analyticsContextData = {
227
227
  packageName: "@atlaskit/link-datasource",
228
- packageVersion: "1.7.5",
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: 590,
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 UserType from '../render-type/user';
5
- import { EmptyStateTableHeading } from '../styled';
6
- import Priority from './priority';
7
- import Type from './type';
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: 50
27
+ width: 35
14
28
  }, {
15
29
  key: 'issue',
16
30
  width: 50
17
31
  }, {
18
32
  key: 'summary',
19
- width: 70
33
+ width: 100
20
34
  }, {
21
35
  key: 'assignee',
22
- width: 100
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 priorities = ['low', 'medium', 'high', 'medium', 'low', 'blocker', 'medium', 'blocker', 'high', 'low'];
40
- var types = ['task', 'story', 'commit', 'epic', 'bug', 'task', 'story', 'commit', 'issue', 'epic'];
41
- var summaryColumnWidths = [141, 208, 186, 212, 212, 151, 212, 182, 180, 147];
42
- var statusColumnWidths = [75, 54, 66, 73, 52, 73, 55, 80, 66, 59];
43
- var rows = new Array(10).fill(null).map(function (_, index) {
44
- return {
45
- id: index,
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 'assignee':
69
- return jsx(UserType, null, jsx(Skeleton, {
70
- borderRadius: 8,
71
- testId: "empty-state-skeleton",
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(Skeleton, {
86
- appearance: "blue",
87
- borderRadius: 10,
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(Skeleton, {
104
- borderRadius: 8,
105
- testId: "empty-state-skeleton",
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 (_ref3) {
113
- var isCompact = _ref3.isCompact,
114
- _ref3$isLoading = _ref3.isLoading,
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
- return jsx("table", {
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", null, jsx("tr", null, columnsToRender.map(function (_ref4) {
121
- var key = _ref4.key,
122
- width = _ref4.width;
123
- return jsx(EmptyStateTableHeading, {
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
- isShimmering: isLoading,
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, isLoading));
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: center;\n"])));
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() {