@atlaskit/link-datasource 1.7.6 → 1.9.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 (65) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/cjs/analytics/constants.js +1 -1
  3. package/dist/cjs/common/zindex.js +8 -0
  4. package/dist/cjs/hooks/useDatasourceTableState.js +0 -1
  5. package/dist/cjs/ui/assets-modal/modal/index.js +1 -1
  6. package/dist/cjs/ui/common/error-state/access-required.js +42 -8
  7. package/dist/cjs/ui/common/error-state/messages.js +4 -4
  8. package/dist/cjs/ui/datasource-table-view/datasourceTableView.js +6 -4
  9. package/dist/cjs/ui/issue-like-table/empty-state/index.js +71 -86
  10. package/dist/cjs/ui/issue-like-table/empty-state/type.js +1 -1
  11. package/dist/cjs/ui/issue-like-table/index.js +37 -11
  12. package/dist/cjs/ui/issue-like-table/styled.js +4 -4
  13. package/dist/cjs/ui/jira-issues-modal/modal/index.js +25 -27
  14. package/dist/cjs/ui/jira-issues-modal/modal/messages.js +2 -2
  15. package/dist/cjs/ui/jira-issues-modal/site-selector/index.js +59 -37
  16. package/dist/cjs/ui/jira-issues-modal/site-selector/messages.js +4 -9
  17. package/dist/es2019/analytics/constants.js +1 -1
  18. package/dist/es2019/common/zindex.js +2 -0
  19. package/dist/es2019/hooks/useDatasourceTableState.js +0 -1
  20. package/dist/es2019/ui/assets-modal/modal/index.js +1 -1
  21. package/dist/es2019/ui/common/error-state/access-required.js +41 -6
  22. package/dist/es2019/ui/common/error-state/messages.js +4 -4
  23. package/dist/es2019/ui/datasource-table-view/datasourceTableView.js +6 -4
  24. package/dist/es2019/ui/issue-like-table/empty-state/index.js +61 -75
  25. package/dist/es2019/ui/issue-like-table/empty-state/type.js +1 -1
  26. package/dist/es2019/ui/issue-like-table/index.js +45 -14
  27. package/dist/es2019/ui/issue-like-table/styled.js +1 -5
  28. package/dist/es2019/ui/jira-issues-modal/modal/index.js +26 -28
  29. package/dist/es2019/ui/jira-issues-modal/modal/messages.js +2 -2
  30. package/dist/es2019/ui/jira-issues-modal/site-selector/index.js +50 -32
  31. package/dist/es2019/ui/jira-issues-modal/site-selector/messages.js +4 -9
  32. package/dist/esm/analytics/constants.js +1 -1
  33. package/dist/esm/common/zindex.js +2 -0
  34. package/dist/esm/hooks/useDatasourceTableState.js +0 -1
  35. package/dist/esm/ui/assets-modal/modal/index.js +1 -1
  36. package/dist/esm/ui/common/error-state/access-required.js +43 -9
  37. package/dist/esm/ui/common/error-state/messages.js +4 -4
  38. package/dist/esm/ui/datasource-table-view/datasourceTableView.js +6 -4
  39. package/dist/esm/ui/issue-like-table/empty-state/index.js +72 -86
  40. package/dist/esm/ui/issue-like-table/empty-state/type.js +1 -1
  41. package/dist/esm/ui/issue-like-table/index.js +37 -11
  42. package/dist/esm/ui/issue-like-table/styled.js +3 -3
  43. package/dist/esm/ui/jira-issues-modal/modal/index.js +26 -28
  44. package/dist/esm/ui/jira-issues-modal/modal/messages.js +2 -2
  45. package/dist/esm/ui/jira-issues-modal/site-selector/index.js +59 -34
  46. package/dist/esm/ui/jira-issues-modal/site-selector/messages.js +4 -9
  47. package/dist/types/common/zindex.d.ts +2 -0
  48. package/dist/types/ui/common/error-state/access-required.d.ts +2 -2
  49. package/dist/types/ui/issue-like-table/empty-state/index.d.ts +1 -2
  50. package/dist/types/ui/issue-like-table/index.d.ts +1 -1
  51. package/dist/types/ui/issue-like-table/styled.d.ts +1 -8
  52. package/dist/types/ui/jira-issues-modal/site-selector/index.d.ts +0 -1
  53. package/dist/types/ui/jira-issues-modal/site-selector/messages.d.ts +1 -6
  54. package/dist/types/ui/jira-issues-modal/types.d.ts +2 -0
  55. package/dist/types-ts4.5/common/zindex.d.ts +2 -0
  56. package/dist/types-ts4.5/ui/common/error-state/access-required.d.ts +2 -2
  57. package/dist/types-ts4.5/ui/issue-like-table/empty-state/index.d.ts +1 -2
  58. package/dist/types-ts4.5/ui/issue-like-table/index.d.ts +1 -1
  59. package/dist/types-ts4.5/ui/issue-like-table/styled.d.ts +1 -8
  60. package/dist/types-ts4.5/ui/jira-issues-modal/site-selector/index.d.ts +0 -1
  61. package/dist/types-ts4.5/ui/jira-issues-modal/site-selector/messages.d.ts +1 -6
  62. package/dist/types-ts4.5/ui/jira-issues-modal/types.d.ts +2 -0
  63. package/package.json +2 -3
  64. package/report.api.md +1 -0
  65. package/tmp/api-report-tmp.d.ts +1 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @atlaskit/link-datasource
2
2
 
3
+ ## 1.9.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#41407](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/41407) [`2e336273b6e`](https://bitbucket.org/atlassian/atlassian-frontend/commits/2e336273b6e) - [ux] Added an optional url prop for JiraConfigModal
8
+
9
+ ## 1.8.0
10
+
11
+ ### Minor Changes
12
+
13
+ - [#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.
14
+
3
15
  ## 1.7.6
4
16
 
5
17
  ### Patch Changes
@@ -7,5 +7,5 @@ exports.packageMetaData = exports.EVENT_CHANNEL = void 0;
7
7
  var EVENT_CHANNEL = exports.EVENT_CHANNEL = 'media';
8
8
  var packageMetaData = exports.packageMetaData = {
9
9
  packageName: "@atlaskit/link-datasource",
10
- packageVersion: "1.7.6"
10
+ packageVersion: "1.9.0"
11
11
  };
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.stickyTableHeadersIndex = exports.siteSelectorIndex = void 0;
7
+ var stickyTableHeadersIndex = exports.stickyTableHeadersIndex = 10;
8
+ var siteSelectorIndex = exports.siteSelectorIndex = stickyTableHeadersIndex + 1;
@@ -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.7.6",
237
+ packageVersion: "1.9.0",
238
238
  source: 'datasourceConfigModal'
239
239
  };
240
240
  var contextData = _objectSpread(_objectSpread({}, analyticsContextData), {}, {
@@ -9,13 +9,41 @@ var _react = require("react");
9
9
  var _react2 = require("@emotion/react");
10
10
  var _reactIntlNext = require("react-intl-next");
11
11
  var _emptyState = _interopRequireDefault(require("@atlaskit/empty-state"));
12
+ var _colors = require("@atlaskit/theme/colors");
12
13
  var _analytics = require("../../../analytics");
13
14
  var _accessRequiredSvg = require("./access-required-svg");
14
15
  var _messages = require("./messages");
15
16
  /** @jsx jsx */
16
17
 
17
- var AccessRequired = exports.AccessRequired = function AccessRequired(_ref) {
18
- var siteName = _ref.siteName;
18
+ var urlStyles = (0, _react2.css)({
19
+ color: "var(--ds-text-subtlest, ".concat(_colors.N400, ")"),
20
+ fontSize: "var(--ds-font-size-100, 14px)",
21
+ lineHeight: "var(--ds-font-lineHeight-200, 20px)"
22
+ });
23
+ var descriptionMessageStyles = (0, _react2.css)({
24
+ display: 'flex',
25
+ flexDirection: 'column',
26
+ gap: "var(--ds-space-200, 16px)"
27
+ });
28
+ var iconContainerStyles = (0, _react2.css)({
29
+ marginBottom: "var(--ds-space-200, 16px)"
30
+ });
31
+ var Description = function Description(_ref) {
32
+ var message = _ref.message,
33
+ url = _ref.url;
34
+ return (0, _react2.jsx)("div", {
35
+ css: descriptionMessageStyles
36
+ }, (0, _react2.jsx)("span", {
37
+ css: urlStyles
38
+ }, url), (0, _react2.jsx)("span", null, message));
39
+ };
40
+ var IconContainer = function IconContainer() {
41
+ return (0, _react2.jsx)("div", {
42
+ css: iconContainerStyles
43
+ }, (0, _react2.jsx)(_accessRequiredSvg.AccessRequiredSVG, null));
44
+ };
45
+ var AccessRequired = exports.AccessRequired = function AccessRequired(_ref2) {
46
+ var url = _ref2.url;
19
47
  var _useIntl = (0, _reactIntlNext.useIntl)(),
20
48
  formatMessage = _useIntl.formatMessage;
21
49
  var _useDatasourceAnalyti = (0, _analytics.useDatasourceAnalyticsEvents)(),
@@ -25,13 +53,19 @@ var AccessRequired = exports.AccessRequired = function AccessRequired(_ref) {
25
53
  reason: 'access'
26
54
  });
27
55
  }, [fireEvent]);
56
+ if (url) {
57
+ return (0, _react2.jsx)(_emptyState.default, {
58
+ header: formatMessage(_messages.loadingErrorMessages.accessRequiredWithSite),
59
+ description: (0, _react2.jsx)(Description, {
60
+ message: formatMessage(_messages.loadingErrorMessages.accessInstructions),
61
+ url: url
62
+ }),
63
+ renderImage: IconContainer
64
+ });
65
+ }
28
66
  return (0, _react2.jsx)(_emptyState.default, {
29
- header: siteName ? formatMessage(_messages.loadingErrorMessages.accessRequiredWithSite, {
30
- siteName: siteName
31
- }) : formatMessage(_messages.loadingErrorMessages.accessRequired),
67
+ header: formatMessage(_messages.loadingErrorMessages.accessRequired),
32
68
  description: formatMessage(_messages.loadingErrorMessages.accessInstructions),
33
- renderImage: function renderImage() {
34
- return (0, _react2.jsx)(_accessRequiredSvg.AccessRequiredSVG, null);
35
- }
69
+ renderImage: IconContainer
36
70
  });
37
71
  };
@@ -8,8 +8,8 @@ var _reactIntlNext = require("react-intl-next");
8
8
  var loadingErrorMessages = exports.loadingErrorMessages = (0, _reactIntlNext.defineMessages)({
9
9
  accessInstructions: {
10
10
  id: 'linkDataSource.jira-issues.accessInstructions',
11
- description: "Instructions to let the user know they must contact an administrator in order to access this site's content",
12
- defaultMessage: 'To request access, contact your admin.'
11
+ description: "Instructions to let the user know they must contact their site administrator in order to access this site's content",
12
+ defaultMessage: 'To request access, contact your site administrator.'
13
13
  },
14
14
  accessRequired: {
15
15
  id: 'linkDataSource.jira-issues.accessRequired',
@@ -18,8 +18,8 @@ var loadingErrorMessages = exports.loadingErrorMessages = (0, _reactIntlNext.def
18
18
  },
19
19
  accessRequiredWithSite: {
20
20
  id: 'linkDataSource.jira-issues.accessRequiredWithSite',
21
- description: 'Message letting user know that they do not have access to the site by name',
22
- defaultMessage: "You don't have access to {siteName}"
21
+ description: 'Message letting user know that they do not have access to the site that will be listed below this message',
22
+ defaultMessage: "You don't have access to the following site:"
23
23
  },
24
24
  checkConnection: {
25
25
  id: 'linkDataSource.jira-issues.checkConnection',
@@ -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");
@@ -113,7 +114,9 @@ var DatasourceTableViewWithoutAnalytics = function DatasourceTableViewWithoutAna
113
114
  });
114
115
  }
115
116
  if (status === 'unauthorized') {
116
- return (0, _react2.jsx)(_accessRequired.AccessRequired, null);
117
+ return (0, _react2.jsx)(_accessRequired.AccessRequired, {
118
+ url: url
119
+ });
117
120
  }
118
121
  if (status === 'rejected') {
119
122
  return (0, _react2.jsx)(_loadingError.LoadingError, {
@@ -134,13 +137,12 @@ var DatasourceTableViewWithoutAnalytics = function DatasourceTableViewWithoutAna
134
137
  columns: columns,
135
138
  visibleColumnKeys: visibleColumnKeys || defaultVisibleColumnKeys,
136
139
  onVisibleColumnKeysChange: onVisibleColumnKeysChange,
137
- scrollableContainerHeight: 590,
140
+ scrollableContainerHeight: _styled.ScrollableContainerHeight,
138
141
  parentContainerRenderInstanceId: tableRenderInstanceId,
139
142
  extensionKey: extensionKey
140
143
  }) : (0, _react2.jsx)(_emptyState.default, {
141
144
  testId: "datasource-table-view-skeleton",
142
- isCompact: true,
143
- isLoading: !isDataReady || status === 'loading'
145
+ isCompact: true
144
146
  }), (0, _react2.jsx)(_tableFooter.TableFooter, {
145
147
  itemCount: isDataReady ? totalCount : undefined,
146
148
  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: 50
34
+ width: 35
22
35
  }, {
23
36
  key: 'issue',
24
37
  width: 50
25
38
  }, {
26
39
  key: 'summary',
27
- width: 70
40
+ width: 100
28
41
  }, {
29
42
  key: 'assignee',
30
- width: 100
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 priorities = ['low', 'medium', 'high', 'medium', 'low', 'blocker', 'medium', 'blocker', 'high', 'low'];
48
- var types = ['task', 'story', 'commit', 'epic', 'bug', 'task', 'story', 'commit', 'issue', 'epic'];
49
- var summaryColumnWidths = [141, 208, 186, 212, 212, 151, 212, 182, 180, 147];
50
- var statusColumnWidths = [75, 54, 66, 73, 52, 73, 55, 80, 66, 59];
51
- var rows = new Array(10).fill(null).map(function (_, index) {
52
- return {
53
- id: index,
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 'assignee':
77
- return (0, _react.jsx)(_user.default, null, (0, _react.jsx)(_linkingCommon.Skeleton, {
78
- borderRadius: 8,
79
- testId: "empty-state-skeleton",
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)(_linkingCommon.Skeleton, {
94
- appearance: "blue",
95
- borderRadius: 10,
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)(_linkingCommon.Skeleton, {
112
- borderRadius: 8,
113
- testId: "empty-state-skeleton",
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(_ref3) {
121
- var isCompact = _ref3.isCompact,
122
- _ref3$isLoading = _ref3.isLoading,
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
- return (0, _react.jsx)("table", {
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", null, (0, _react.jsx)("tr", null, columnsToRender.map(function (_ref4) {
129
- var key = _ref4.key,
130
- width = _ref4.width;
131
- return (0, _react.jsx)(_styled.EmptyStateTableHeading, {
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
- isShimmering: isLoading,
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, isLoading));
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: center;\n"])));
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() {
@@ -25,6 +25,7 @@ var _combine = require("@atlaskit/pragmatic-drag-and-drop/util/combine");
25
25
  var _colors = require("@atlaskit/theme/colors");
26
26
  var _tooltip = _interopRequireDefault(require("@atlaskit/tooltip"));
27
27
  var _ufoExperiences = require("../../analytics/ufoExperiences");
28
+ var _zindex = require("../../common/zindex");
28
29
  var _columnPicker = require("./column-picker");
29
30
  var _dragColumnPreview = require("./drag-column-preview");
30
31
  var _draggableTableHeading = require("./draggable-table-heading");
@@ -41,7 +42,7 @@ var tableHeadStyles = (0, _react2.css)({
41
42
  background: "var(--ds-surface, #FFF)",
42
43
  position: 'sticky',
43
44
  top: 0,
44
- zIndex: 10
45
+ zIndex: _zindex.stickyTableHeadersIndex
45
46
  });
46
47
  var ColumnPickerHeader = _styled.default.th(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n width: 40px;\n position: sticky;\n right: calc(-1 * ", ");\n background-color: ", ";\n border-bottom: 2px solid ", "; /* It is required to have solid (not half-transparent) color because of this gradient business bellow */\n background: linear-gradient(\n 90deg,\n rgba(255, 255, 255, 0) 0%,\n ", " 10%\n );\n vertical-align: middle; /* Keeps dropdown button in the middle */\n &:last-of-type {\n padding-right: ", ";\n }\n"])), tableSidePadding, "var(--ds-surface, #FFF)", "var(--ds-background-accent-gray-subtler, ".concat(_colors.N40, ")"), "var(--ds-surface, #FFF)", tableSidePadding);
47
48
  var truncatedCellStyles = (0, _react2.css)({
@@ -93,8 +94,7 @@ function getColumnWidth(key, type) {
93
94
  priority: BASE_WIDTH * 8,
94
95
  status: BASE_WIDTH * 18,
95
96
  summary: BASE_WIDTH * 45,
96
- description: BASE_WIDTH * 31.25,
97
- type: BASE_WIDTH * 8
97
+ description: BASE_WIDTH * 31.25
98
98
  };
99
99
  if (keyBasedWidth[key]) {
100
100
  return keyBasedWidth[key];
@@ -174,9 +174,10 @@ var IssueLikeDataTableView = exports.IssueLikeDataTableView = function IssueLike
174
174
  cells: visibleSortedColumns.map(function (_ref3) {
175
175
  var key = _ref3.key;
176
176
  var content = (0, _react2.jsx)(_linkingCommon.Skeleton, {
177
- borderRadius: "var(--ds-border-radius-100, 3px)",
178
- width: '100%',
179
- height: '20px'
177
+ borderRadius: 8,
178
+ width: "100%",
179
+ height: 14,
180
+ testId: "issues-table-row-loading"
180
181
  });
181
182
  return {
182
183
  key: key,
@@ -302,8 +303,24 @@ var IssueLikeDataTableView = exports.IssueLikeDataTableView = function IssueLike
302
303
  });
303
304
  }, [identityColumnKey, renderItem, items, visibleSortedColumns]);
304
305
  var rows = (0, _react.useMemo)(function () {
305
- return [].concat((0, _toConsumableArray2.default)(tableRows), (0, _toConsumableArray2.default)(status === 'loading' ? [loadingRow] : []));
306
- }, [loadingRow, status, tableRows]);
306
+ if (status !== 'loading') {
307
+ return tableRows;
308
+ }
309
+ // if there are table rows, only add 1 loading row
310
+ if (tableRows.length > 0) {
311
+ return [].concat((0, _toConsumableArray2.default)(tableRows), [_objectSpread(_objectSpread({}, loadingRow), {}, {
312
+ key: "loading-".concat(tableRows.length)
313
+ })]);
314
+ }
315
+ // if there are no table rows add 14 rows if it is compact (has scrollableContainerHeight or non-modal)
316
+ // add 10 rows if it is modal (no scrollableContainerHeight)
317
+ var loadingRowsCount = scrollableContainerHeight ? 14 : 10;
318
+ return (0, _toConsumableArray2.default)(Array(loadingRowsCount)).map(function (_, index) {
319
+ return _objectSpread(_objectSpread({}, loadingRow), {}, {
320
+ key: "loading-".concat(index)
321
+ });
322
+ });
323
+ }, [loadingRow, status, tableRows, scrollableContainerHeight]);
307
324
  var onSelectedColumnKeysChange = (0, _react.useCallback)(function (newSelectedColumnKeys) {
308
325
  onVisibleColumnKeysChange === null || onVisibleColumnKeysChange === void 0 || onVisibleColumnKeysChange(newSelectedColumnKeys);
309
326
  }, [onVisibleColumnKeysChange]);
@@ -396,6 +413,8 @@ var IssueLikeDataTableView = exports.IssueLikeDataTableView = function IssueLike
396
413
  key: key,
397
414
  "data-testid": "".concat(key, "-column-heading"),
398
415
  style: {
416
+ // this keeps the column headers from collapsing horizontally during loading states
417
+ minWidth: maxWidth,
399
418
  maxWidth: maxWidth
400
419
  }
401
420
  }, heading);
@@ -421,14 +440,21 @@ var IssueLikeDataTableView = exports.IssueLikeDataTableView = function IssueLike
421
440
  var cellKey = _ref14.key,
422
441
  content = _ref14.content,
423
442
  maxWidth = _ref14.maxWidth;
443
+ var loadingRowStyle = {
444
+ maxWidth: maxWidth
445
+ };
446
+ // extra padding is required around skeleton loader to avoid vertical jumps when data loads
447
+ if (key !== null && key !== void 0 && key.includes('loading')) {
448
+ loadingRowStyle = _objectSpread(_objectSpread({}, loadingRowStyle), {}, {
449
+ paddingBlock: "var(--ds-space-100, 12px)"
450
+ });
451
+ }
424
452
  return (0, _react2.jsx)("td", {
425
453
  key: cellKey,
426
454
  "data-testid": testId && "".concat(testId, "--cell-").concat(cellIndex),
427
455
  colSpan: cellIndex + 1 === cells.length ? 2 : undefined,
428
456
  css: truncatedCellStyles,
429
- style: {
430
- maxWidth: maxWidth
431
- }
457
+ style: loadingRowStyle
432
458
  }, content);
433
459
  }));
434
460
  }))));
@@ -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.FieldTextFontSize = exports.EmptyStateTableHeading = void 0;
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, _templateObject3;
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, ")"));