@atlaskit/link-datasource 1.19.16 → 1.19.18
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 +46 -18
- package/dist/cjs/ui/assets-modal/modal/render-assets-content/index.js +1 -1
- package/dist/cjs/ui/datasource-table-view/datasourceTableView.js +1 -1
- package/dist/cjs/ui/issue-like-table/empty-state/index.js +4 -0
- package/dist/cjs/ui/issue-like-table/index.js +81 -67
- package/dist/cjs/ui/jira-issues-modal/jira-search-container/index.js +34 -36
- package/dist/cjs/ui/jira-issues-modal/modal/index.js +29 -17
- package/dist/es2019/analytics/constants.js +1 -1
- package/dist/es2019/hooks/useDatasourceTableState.js +20 -4
- package/dist/es2019/ui/assets-modal/modal/render-assets-content/index.js +1 -1
- package/dist/es2019/ui/datasource-table-view/datasourceTableView.js +1 -1
- package/dist/es2019/ui/issue-like-table/empty-state/index.js +4 -0
- package/dist/es2019/ui/issue-like-table/index.js +33 -20
- package/dist/es2019/ui/jira-issues-modal/jira-search-container/index.js +19 -19
- package/dist/es2019/ui/jira-issues-modal/modal/index.js +15 -6
- package/dist/esm/analytics/constants.js +1 -1
- package/dist/esm/hooks/useDatasourceTableState.js +46 -18
- package/dist/esm/ui/assets-modal/modal/render-assets-content/index.js +1 -1
- package/dist/esm/ui/datasource-table-view/datasourceTableView.js +1 -1
- package/dist/esm/ui/issue-like-table/empty-state/index.js +4 -0
- package/dist/esm/ui/issue-like-table/index.js +81 -67
- package/dist/esm/ui/jira-issues-modal/jira-search-container/index.js +34 -36
- package/dist/esm/ui/jira-issues-modal/modal/index.js +29 -17
- package/dist/types/ui/issue-like-table/index.d.ts +2 -1
- package/dist/types/ui/jira-issues-modal/jira-search-container/index.d.ts +2 -0
- package/dist/types-ts4.5/ui/issue-like-table/index.d.ts +2 -1
- package/dist/types-ts4.5/ui/jira-issues-modal/jira-search-container/index.d.ts +2 -0
- package/examples-helpers/hoverableContainer.tsx +26 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @atlaskit/link-datasource
|
|
2
2
|
|
|
3
|
+
## 1.19.18
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#57736](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/57736) [`d8193e501bcc`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/d8193e501bcc) - [ux] Changes behavior of datasource modal to persist query changes on insert without needing to click search.
|
|
8
|
+
|
|
9
|
+
## 1.19.17
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [#58033](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/58033) [`e833dd7a4e2f`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/e833dd7a4e2f) - [ux] Updated datasource tables to always have a background.
|
|
14
|
+
|
|
3
15
|
## 1.19.16
|
|
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.19.
|
|
10
|
+
packageVersion: "1.19.18"
|
|
11
11
|
};
|
|
@@ -98,13 +98,20 @@ var useDatasourceTableState = exports.useDatasourceTableState = function useData
|
|
|
98
98
|
_yield$getDatasourceD = _context.sent;
|
|
99
99
|
access = _yield$getDatasourceD.meta.access;
|
|
100
100
|
schema = _yield$getDatasourceD.data.schema;
|
|
101
|
-
if (!(access === '
|
|
101
|
+
if (!(access === 'unauthorized')) {
|
|
102
102
|
_context.next = 11;
|
|
103
103
|
break;
|
|
104
104
|
}
|
|
105
105
|
setStatus('unauthorized');
|
|
106
106
|
return _context.abrupt("return");
|
|
107
107
|
case 11:
|
|
108
|
+
if (!(access === 'forbidden')) {
|
|
109
|
+
_context.next = 14;
|
|
110
|
+
break;
|
|
111
|
+
}
|
|
112
|
+
setStatus('forbidden');
|
|
113
|
+
return _context.abrupt("return");
|
|
114
|
+
case 14:
|
|
108
115
|
isColumnNotPresentInCurrentColumnsList = function isColumnNotPresentInCurrentColumnsList(col) {
|
|
109
116
|
return !columns.find(function (column) {
|
|
110
117
|
return column.key === col.key;
|
|
@@ -113,25 +120,32 @@ var useDatasourceTableState = exports.useDatasourceTableState = function useData
|
|
|
113
120
|
allColumns = schema.properties;
|
|
114
121
|
newColumns = allColumns.filter(isColumnNotPresentInCurrentColumnsList);
|
|
115
122
|
newColumns.length > 0 && setColumns([].concat((0, _toConsumableArray2.default)(columns), (0, _toConsumableArray2.default)(newColumns)));
|
|
116
|
-
_context.next =
|
|
123
|
+
_context.next = 30;
|
|
117
124
|
break;
|
|
118
|
-
case
|
|
119
|
-
_context.prev =
|
|
125
|
+
case 20:
|
|
126
|
+
_context.prev = 20;
|
|
120
127
|
_context.t0 = _context["catch"](2);
|
|
121
128
|
captureError('loadDatasourceDetails', _context.t0);
|
|
122
|
-
if (!(_context.t0 instanceof Response &&
|
|
123
|
-
_context.next =
|
|
129
|
+
if (!(_context.t0 instanceof Response && _context.t0.status === 401)) {
|
|
130
|
+
_context.next = 26;
|
|
124
131
|
break;
|
|
125
132
|
}
|
|
126
133
|
setStatus('unauthorized');
|
|
127
134
|
return _context.abrupt("return");
|
|
128
|
-
case
|
|
135
|
+
case 26:
|
|
136
|
+
if (!(_context.t0 instanceof Response && _context.t0.status === 403)) {
|
|
137
|
+
_context.next = 29;
|
|
138
|
+
break;
|
|
139
|
+
}
|
|
140
|
+
setStatus('forbidden');
|
|
141
|
+
return _context.abrupt("return");
|
|
142
|
+
case 29:
|
|
129
143
|
setStatus('rejected');
|
|
130
|
-
case
|
|
144
|
+
case 30:
|
|
131
145
|
case "end":
|
|
132
146
|
return _context.stop();
|
|
133
147
|
}
|
|
134
|
-
}, _callee, null, [[2,
|
|
148
|
+
}, _callee, null, [[2, 20]]);
|
|
135
149
|
})), [captureError, columns, datasourceId, getDatasourceDetails, parameters]);
|
|
136
150
|
var applySchemaProperties = (0, _react.useCallback)(function (schema, fieldKeys) {
|
|
137
151
|
var properties = schema.properties,
|
|
@@ -225,13 +239,20 @@ var useDatasourceTableState = exports.useDatasourceTableState = function useData
|
|
|
225
239
|
nextPageCursor = _yield$getDatasourceD4.nextPageCursor;
|
|
226
240
|
_totalCount = _yield$getDatasourceD4.totalCount;
|
|
227
241
|
schema = _yield$getDatasourceD4.schema;
|
|
228
|
-
if (!(access === '
|
|
242
|
+
if (!(access === 'unauthorized')) {
|
|
229
243
|
_context2.next = 23;
|
|
230
244
|
break;
|
|
231
245
|
}
|
|
232
246
|
setStatus('unauthorized');
|
|
233
247
|
return _context2.abrupt("return");
|
|
234
248
|
case 23:
|
|
249
|
+
if (!(access === 'forbidden')) {
|
|
250
|
+
_context2.next = 26;
|
|
251
|
+
break;
|
|
252
|
+
}
|
|
253
|
+
setStatus('forbidden');
|
|
254
|
+
return _context2.abrupt("return");
|
|
255
|
+
case 26:
|
|
235
256
|
setExtensionKey(_extensionKey);
|
|
236
257
|
setDestinationObjectTypes(_destinationObjectTypes);
|
|
237
258
|
setTotalCount(_totalCount);
|
|
@@ -260,25 +281,32 @@ var useDatasourceTableState = exports.useDatasourceTableState = function useData
|
|
|
260
281
|
});
|
|
261
282
|
}
|
|
262
283
|
setStatus('resolved');
|
|
263
|
-
_context2.next =
|
|
284
|
+
_context2.next = 49;
|
|
264
285
|
break;
|
|
265
|
-
case
|
|
266
|
-
_context2.prev =
|
|
286
|
+
case 39:
|
|
287
|
+
_context2.prev = 39;
|
|
267
288
|
_context2.t0 = _context2["catch"](7);
|
|
268
289
|
captureError('onNextPage', _context2.t0);
|
|
269
|
-
if (!(_context2.t0 instanceof Response &&
|
|
270
|
-
_context2.next =
|
|
290
|
+
if (!(_context2.t0 instanceof Response && _context2.t0.status === 401)) {
|
|
291
|
+
_context2.next = 45;
|
|
271
292
|
break;
|
|
272
293
|
}
|
|
273
294
|
setStatus('unauthorized');
|
|
274
295
|
return _context2.abrupt("return");
|
|
275
|
-
case
|
|
296
|
+
case 45:
|
|
297
|
+
if (!(_context2.t0 instanceof Response && _context2.t0.status === 403)) {
|
|
298
|
+
_context2.next = 48;
|
|
299
|
+
break;
|
|
300
|
+
}
|
|
301
|
+
setStatus('forbidden');
|
|
302
|
+
return _context2.abrupt("return");
|
|
303
|
+
case 48:
|
|
276
304
|
setStatus('rejected');
|
|
277
|
-
case
|
|
305
|
+
case 49:
|
|
278
306
|
case "end":
|
|
279
307
|
return _context2.stop();
|
|
280
308
|
}
|
|
281
|
-
}, _callee2, null, [[7,
|
|
309
|
+
}, _callee2, null, [[7, 39]]);
|
|
282
310
|
})), [captureError, parameters, fieldKeys, nextCursor, getDatasourceData, datasourceId, responseItems === null || responseItems === void 0 ? void 0 : responseItems.length, applySchemaProperties, fireEvent, fullSchema]);
|
|
283
311
|
var reset = (0, _react.useCallback)(function (options) {
|
|
284
312
|
setStatus('empty');
|
|
@@ -30,7 +30,7 @@ var tableBordersStyles = (0, _react2.css)({
|
|
|
30
30
|
borderTopLeftRadius: "var(--ds-border-radius-200, 8px)",
|
|
31
31
|
borderTopRightRadius: "var(--ds-border-radius-200, 8px)",
|
|
32
32
|
borderBottom: "2px solid ".concat("var(--ds-background-accent-gray-subtler, ".concat(_colors.N40, ")")),
|
|
33
|
-
|
|
33
|
+
backgroundImage: _issueLikeTable.scrollableContainerShadowsCssComponents.backgroundImage,
|
|
34
34
|
backgroundRepeat: _issueLikeTable.scrollableContainerShadowsCssComponents.backgroundRepeat,
|
|
35
35
|
backgroundSize: _issueLikeTable.scrollableContainerShadowsCssComponents.backgroundSize,
|
|
36
36
|
backgroundAttachment: _issueLikeTable.scrollableContainerShadowsCssComponents.backgroundAttachment
|
|
@@ -113,7 +113,7 @@ var DatasourceTableViewWithoutAnalytics = function DatasourceTableViewWithoutAna
|
|
|
113
113
|
shouldForceRequest: true
|
|
114
114
|
});
|
|
115
115
|
}, [destinationObjectTypes, extensionKey, fireEvent, reset]);
|
|
116
|
-
if (status === 'resolved' && !responseItems.length) {
|
|
116
|
+
if (status === 'resolved' && !responseItems.length || status === 'forbidden') {
|
|
117
117
|
return (0, _react2.jsx)(_noResults.NoResults, {
|
|
118
118
|
onRefresh: reset
|
|
119
119
|
});
|
|
@@ -23,6 +23,9 @@ var SkeletonComponent = function SkeletonComponent(_ref) {
|
|
|
23
23
|
var tableBodyStyles = (0, _react.css)({
|
|
24
24
|
borderBottom: 0
|
|
25
25
|
});
|
|
26
|
+
var tableStyles = (0, _react.css)({
|
|
27
|
+
background: "var(--ds-elevation-surface-current, #FFF)"
|
|
28
|
+
});
|
|
26
29
|
var padding = "var(--ds-space-100, 8px)".concat(" ", "var(--ds-space-100, 8px)");
|
|
27
30
|
var cellStyles = (0, _react.css)({
|
|
28
31
|
padding: padding,
|
|
@@ -112,6 +115,7 @@ var _default = exports.default = function _default(_ref4) {
|
|
|
112
115
|
boxSizing: 'border-box'
|
|
113
116
|
}
|
|
114
117
|
}, (0, _react.jsx)("table", {
|
|
118
|
+
css: tableStyles,
|
|
115
119
|
"data-testid": testId
|
|
116
120
|
}, (0, _react.jsx)("thead", {
|
|
117
121
|
style: {
|
|
@@ -78,65 +78,79 @@ var tableContainerStyles = (0, _react2.css)({
|
|
|
78
78
|
var shadowColor = "var(--ds-shadow-overflow-perimeter, rgba(0, 0, 0, 0.1))";
|
|
79
79
|
var shadowColorLight = "var(--ds-shadow-overflow-perimeter, rgba(0, 0, 0, 0.05))";
|
|
80
80
|
var leftWhiteOverrideGradient = {
|
|
81
|
-
|
|
81
|
+
backgroundImage: "\n linear-gradient(\n 90deg,\n ".concat("var(--ds-elevation-surface-current, #FFF)", " 30%,\n rgba(255, 255, 255, 0)\n )"),
|
|
82
|
+
backgroundPosition: 'left center',
|
|
82
83
|
size: "40px 100%",
|
|
83
84
|
attachment: "local"
|
|
84
85
|
};
|
|
85
86
|
var topWhiteOverrideGradient = {
|
|
86
|
-
|
|
87
|
+
backgroundImage: "\n linear-gradient(\n 0deg,\n rgba(255, 255, 255, 0),\n ".concat("var(--ds-elevation-surface-current, #FFF)", " 30%\n )"),
|
|
88
|
+
backgroundPosition: 'top center',
|
|
87
89
|
size: "100% 100px",
|
|
88
90
|
attachment: "local"
|
|
89
91
|
};
|
|
90
92
|
var rightWhiteOverrideGradient = {
|
|
91
|
-
|
|
93
|
+
backgroundImage: "\n linear-gradient(\n 90deg,\n rgba(255, 255, 255, 0),\n ".concat("var(--ds-elevation-surface-current, #FFF)", " 70%\n )"),
|
|
94
|
+
backgroundPosition: 'right center',
|
|
92
95
|
size: "40px 100%",
|
|
93
96
|
attachment: "local"
|
|
94
97
|
};
|
|
95
98
|
var bottomWhiteOverride = {
|
|
96
|
-
|
|
99
|
+
backgroundImage: "\n linear-gradient(\n 0deg,\n ".concat("var(--ds-elevation-surface-current, #FFF)", " 30%,\n rgba(255, 255, 255, 0)\n )"),
|
|
100
|
+
backgroundPosition: 'bottom center',
|
|
97
101
|
size: "100% 40px",
|
|
98
102
|
attachment: "local"
|
|
99
103
|
};
|
|
100
104
|
var leftShadowGradient = {
|
|
101
|
-
|
|
105
|
+
backgroundImage: "\n linear-gradient(\n 90deg,\n ".concat(shadowColor, ",\n rgba(0, 0, 0, 0)\n )"),
|
|
106
|
+
backgroundPosition: 'left center',
|
|
102
107
|
size: "14px 100%",
|
|
103
108
|
attachment: "scroll"
|
|
104
109
|
};
|
|
105
110
|
var topShadowGradient = {
|
|
106
|
-
|
|
111
|
+
backgroundImage: "\n linear-gradient(\n 0deg,\n rgba(0, 0, 0, 0),\n ".concat(shadowColorLight, "\n )"),
|
|
112
|
+
backgroundPosition: '0 52px',
|
|
107
113
|
size: "100% 14px",
|
|
108
114
|
attachment: "scroll"
|
|
109
115
|
};
|
|
110
116
|
var rightShadowGradient = {
|
|
111
|
-
|
|
117
|
+
backgroundImage: "\n linear-gradient(\n 90deg,\n rgba(0, 0, 0, 0),\n ".concat(shadowColor, "\n )"),
|
|
118
|
+
backgroundPosition: 'right center',
|
|
112
119
|
size: "14px 100%",
|
|
113
120
|
attachment: "scroll"
|
|
114
121
|
};
|
|
115
122
|
var bottomShadowGradient = {
|
|
116
|
-
|
|
123
|
+
backgroundImage: "\n linear-gradient(\n 0deg,\n ".concat(shadowColorLight, ",\n rgba(0, 0, 0, 0)\n )"),
|
|
124
|
+
backgroundPosition: 'bottom center',
|
|
117
125
|
size: "100% 10px",
|
|
118
126
|
attachment: "scroll"
|
|
119
127
|
};
|
|
120
128
|
var shadows = [leftWhiteOverrideGradient, leftShadowGradient, rightWhiteOverrideGradient, rightShadowGradient, topWhiteOverrideGradient, topShadowGradient, bottomWhiteOverride, bottomShadowGradient];
|
|
121
129
|
var scrollableContainerShadowsCssComponents = exports.scrollableContainerShadowsCssComponents = {
|
|
122
|
-
|
|
123
|
-
var
|
|
124
|
-
return
|
|
130
|
+
backgroundImage: shadows.map(function (_ref) {
|
|
131
|
+
var backgroundImage = _ref.backgroundImage;
|
|
132
|
+
return backgroundImage;
|
|
133
|
+
}).join(','),
|
|
134
|
+
backgroundPosition: shadows.map(function (_ref2) {
|
|
135
|
+
var backgroundPosition = _ref2.backgroundPosition;
|
|
136
|
+
return backgroundPosition;
|
|
125
137
|
}).join(','),
|
|
126
138
|
backgroundRepeat: 'no-repeat',
|
|
127
|
-
backgroundSize: shadows.map(function (
|
|
128
|
-
var size =
|
|
139
|
+
backgroundSize: shadows.map(function (_ref3) {
|
|
140
|
+
var size = _ref3.size;
|
|
129
141
|
return size;
|
|
130
142
|
}).join(','),
|
|
131
|
-
backgroundAttachment: shadows.map(function (
|
|
132
|
-
var attachment =
|
|
143
|
+
backgroundAttachment: shadows.map(function (_ref4) {
|
|
144
|
+
var attachment = _ref4.attachment;
|
|
133
145
|
return attachment;
|
|
134
146
|
}).join(',')
|
|
135
147
|
};
|
|
136
148
|
var scrollableContainerStyles = (0, _react2.css)({
|
|
137
149
|
overflow: 'auto',
|
|
138
150
|
boxSizing: 'border-box',
|
|
139
|
-
|
|
151
|
+
backgroundColor: "var(--ds-elevation-surface-current, #FFF)",
|
|
152
|
+
backgroundImage: scrollableContainerShadowsCssComponents.backgroundImage,
|
|
153
|
+
backgroundPosition: scrollableContainerShadowsCssComponents.backgroundPosition,
|
|
140
154
|
backgroundRepeat: scrollableContainerShadowsCssComponents.backgroundRepeat,
|
|
141
155
|
backgroundSize: scrollableContainerShadowsCssComponents.backgroundSize,
|
|
142
156
|
backgroundAttachment: scrollableContainerShadowsCssComponents.backgroundAttachment
|
|
@@ -196,23 +210,23 @@ function getDefaultColumnWidth(key, type) {
|
|
|
196
210
|
return DEFAULT_WIDTH;
|
|
197
211
|
}
|
|
198
212
|
}
|
|
199
|
-
var IssueLikeDataTableView = exports.IssueLikeDataTableView = function IssueLikeDataTableView(
|
|
200
|
-
var testId =
|
|
201
|
-
onNextPage =
|
|
202
|
-
onLoadDatasourceDetails =
|
|
203
|
-
items =
|
|
204
|
-
columns =
|
|
205
|
-
|
|
206
|
-
renderItem =
|
|
207
|
-
visibleColumnKeys =
|
|
208
|
-
onVisibleColumnKeysChange =
|
|
209
|
-
columnCustomSizes =
|
|
210
|
-
onColumnResize =
|
|
211
|
-
status =
|
|
212
|
-
hasNextPage =
|
|
213
|
-
scrollableContainerHeight =
|
|
214
|
-
parentContainerRenderInstanceId =
|
|
215
|
-
extensionKey =
|
|
213
|
+
var IssueLikeDataTableView = exports.IssueLikeDataTableView = function IssueLikeDataTableView(_ref5) {
|
|
214
|
+
var testId = _ref5.testId,
|
|
215
|
+
onNextPage = _ref5.onNextPage,
|
|
216
|
+
onLoadDatasourceDetails = _ref5.onLoadDatasourceDetails,
|
|
217
|
+
items = _ref5.items,
|
|
218
|
+
columns = _ref5.columns,
|
|
219
|
+
_ref5$renderItem = _ref5.renderItem,
|
|
220
|
+
renderItem = _ref5$renderItem === void 0 ? _renderType.fallbackRenderType : _ref5$renderItem,
|
|
221
|
+
visibleColumnKeys = _ref5.visibleColumnKeys,
|
|
222
|
+
onVisibleColumnKeysChange = _ref5.onVisibleColumnKeysChange,
|
|
223
|
+
columnCustomSizes = _ref5.columnCustomSizes,
|
|
224
|
+
onColumnResize = _ref5.onColumnResize,
|
|
225
|
+
status = _ref5.status,
|
|
226
|
+
hasNextPage = _ref5.hasNextPage,
|
|
227
|
+
scrollableContainerHeight = _ref5.scrollableContainerHeight,
|
|
228
|
+
parentContainerRenderInstanceId = _ref5.parentContainerRenderInstanceId,
|
|
229
|
+
extensionKey = _ref5.extensionKey;
|
|
216
230
|
var tableId = (0, _react.useMemo)(function () {
|
|
217
231
|
return Symbol('unique-id');
|
|
218
232
|
}, []);
|
|
@@ -247,8 +261,8 @@ var IssueLikeDataTableView = exports.IssueLikeDataTableView = function IssueLike
|
|
|
247
261
|
}, [parentContainerRenderInstanceId, status]);
|
|
248
262
|
var visibleSortedColumns = (0, _react.useMemo)(function () {
|
|
249
263
|
return visibleColumnKeys.map(function (visibleKey) {
|
|
250
|
-
return orderedColumns.find(function (
|
|
251
|
-
var key =
|
|
264
|
+
return orderedColumns.find(function (_ref6) {
|
|
265
|
+
var key = _ref6.key;
|
|
252
266
|
return visibleKey === key;
|
|
253
267
|
});
|
|
254
268
|
}).filter(Boolean);
|
|
@@ -263,10 +277,10 @@ var IssueLikeDataTableView = exports.IssueLikeDataTableView = function IssueLike
|
|
|
263
277
|
return (columnCustomSizes === null || columnCustomSizes === void 0 ? void 0 : columnCustomSizes[key]) || getDefaultColumnWidth(key, type);
|
|
264
278
|
}, [columnCustomSizes]);
|
|
265
279
|
var headerColumns = (0, _react.useMemo)(function () {
|
|
266
|
-
return visibleSortedColumns.map(function (
|
|
267
|
-
var key =
|
|
268
|
-
title =
|
|
269
|
-
type =
|
|
280
|
+
return visibleSortedColumns.map(function (_ref7) {
|
|
281
|
+
var key = _ref7.key,
|
|
282
|
+
title = _ref7.title,
|
|
283
|
+
type = _ref7.type;
|
|
270
284
|
return {
|
|
271
285
|
key: key,
|
|
272
286
|
content: title,
|
|
@@ -308,9 +322,9 @@ var IssueLikeDataTableView = exports.IssueLikeDataTableView = function IssueLike
|
|
|
308
322
|
return;
|
|
309
323
|
}
|
|
310
324
|
return (0, _combine.combine)((0, _element.monitorForElements)({
|
|
311
|
-
onDragStart: function onDragStart(
|
|
312
|
-
var location =
|
|
313
|
-
source =
|
|
325
|
+
onDragStart: function onDragStart(_ref8) {
|
|
326
|
+
var location = _ref8.location,
|
|
327
|
+
source = _ref8.source;
|
|
314
328
|
initialAutoScrollerClientY.current = location.current.input.clientY;
|
|
315
329
|
if (source.data.type === 'table-header') {
|
|
316
330
|
var _containerRef$current;
|
|
@@ -326,9 +340,9 @@ var IssueLikeDataTableView = exports.IssueLikeDataTableView = function IssueLike
|
|
|
326
340
|
});
|
|
327
341
|
}
|
|
328
342
|
},
|
|
329
|
-
onDrag: function onDrag(
|
|
330
|
-
var location =
|
|
331
|
-
source =
|
|
343
|
+
onDrag: function onDrag(_ref9) {
|
|
344
|
+
var location = _ref9.location,
|
|
345
|
+
source = _ref9.source;
|
|
332
346
|
if (source.data.type === 'table-header') {
|
|
333
347
|
var _containerRef$current2;
|
|
334
348
|
_pragmaticDragAndDropReactBeautifulDndAutoscroll.autoScroller.updateInput({
|
|
@@ -338,9 +352,9 @@ var IssueLikeDataTableView = exports.IssueLikeDataTableView = function IssueLike
|
|
|
338
352
|
});
|
|
339
353
|
}
|
|
340
354
|
},
|
|
341
|
-
onDrop: function onDrop(
|
|
342
|
-
var source =
|
|
343
|
-
location =
|
|
355
|
+
onDrop: function onDrop(_ref10) {
|
|
356
|
+
var source = _ref10.source,
|
|
357
|
+
location = _ref10.location;
|
|
344
358
|
_pragmaticDragAndDropReactBeautifulDndAutoscroll.autoScroller.stop();
|
|
345
359
|
if (location.current.dropTargets.length === 0) {
|
|
346
360
|
return;
|
|
@@ -375,10 +389,10 @@ var IssueLikeDataTableView = exports.IssueLikeDataTableView = function IssueLike
|
|
|
375
389
|
return items.map(function (newRowData, rowIndex) {
|
|
376
390
|
return {
|
|
377
391
|
key: "".concat(identityColumnKey && newRowData[identityColumnKey] && newRowData[identityColumnKey].data || rowIndex),
|
|
378
|
-
cells: visibleSortedColumns.map(function (
|
|
392
|
+
cells: visibleSortedColumns.map(function (_ref11) {
|
|
379
393
|
var _newRowData$key;
|
|
380
|
-
var key =
|
|
381
|
-
type =
|
|
394
|
+
var key = _ref11.key,
|
|
395
|
+
type = _ref11.type;
|
|
382
396
|
var value = ((_newRowData$key = newRowData[key]) === null || _newRowData$key === void 0 ? void 0 : _newRowData$key.data) || newRowData[key];
|
|
383
397
|
var values = Array.isArray(value) ? value : [value];
|
|
384
398
|
var content = values.map(function (value) {
|
|
@@ -479,10 +493,10 @@ var IssueLikeDataTableView = exports.IssueLikeDataTableView = function IssueLike
|
|
|
479
493
|
css: [noDefaultBorderStyles, tableHeadStyles]
|
|
480
494
|
}, (0, _react2.jsx)("tr", {
|
|
481
495
|
ref: tableHeaderRowRef
|
|
482
|
-
}, headerColumns.map(function (
|
|
483
|
-
var key =
|
|
484
|
-
content =
|
|
485
|
-
width =
|
|
496
|
+
}, headerColumns.map(function (_ref13, cellIndex) {
|
|
497
|
+
var key = _ref13.key,
|
|
498
|
+
content = _ref13.content,
|
|
499
|
+
width = _ref13.width;
|
|
486
500
|
var heading = (0, _react2.jsx)(_tooltip.default, {
|
|
487
501
|
content: content,
|
|
488
502
|
tag: "span",
|
|
@@ -493,10 +507,10 @@ var IssueLikeDataTableView = exports.IssueLikeDataTableView = function IssueLike
|
|
|
493
507
|
}, content));
|
|
494
508
|
if (onVisibleColumnKeysChange && hasData) {
|
|
495
509
|
var _containerRef$current3;
|
|
496
|
-
var previewRows = tableRows.map(function (
|
|
497
|
-
var cells =
|
|
498
|
-
var cell = cells.find(function (
|
|
499
|
-
var cellKey =
|
|
510
|
+
var previewRows = tableRows.map(function (_ref14) {
|
|
511
|
+
var cells = _ref14.cells;
|
|
512
|
+
var cell = cells.find(function (_ref15) {
|
|
513
|
+
var cellKey = _ref15.key;
|
|
500
514
|
return cellKey === key;
|
|
501
515
|
});
|
|
502
516
|
if (cell) {
|
|
@@ -538,18 +552,18 @@ var IssueLikeDataTableView = exports.IssueLikeDataTableView = function IssueLike
|
|
|
538
552
|
})))), (0, _react2.jsx)("tbody", {
|
|
539
553
|
css: noDefaultBorderStyles,
|
|
540
554
|
"data-testid": testId && "".concat(testId, "--body")
|
|
541
|
-
}, rows.map(function (
|
|
542
|
-
var key =
|
|
543
|
-
cells =
|
|
544
|
-
ref =
|
|
555
|
+
}, rows.map(function (_ref16) {
|
|
556
|
+
var key = _ref16.key,
|
|
557
|
+
cells = _ref16.cells,
|
|
558
|
+
ref = _ref16.ref;
|
|
545
559
|
return (0, _react2.jsx)("tr", {
|
|
546
560
|
key: key,
|
|
547
561
|
"data-testid": testId && "".concat(testId, "--row-").concat(key),
|
|
548
562
|
ref: ref
|
|
549
|
-
}, cells.map(function (
|
|
550
|
-
var cellKey =
|
|
551
|
-
content =
|
|
552
|
-
width =
|
|
563
|
+
}, cells.map(function (_ref17, cellIndex) {
|
|
564
|
+
var cellKey = _ref17.key,
|
|
565
|
+
content = _ref17.content,
|
|
566
|
+
width = _ref17.width;
|
|
553
567
|
var loadingRowStyle = shouldUseWidth ? {
|
|
554
568
|
width: width
|
|
555
569
|
} : {
|
|
@@ -45,10 +45,12 @@ var JiraSearchContainer = exports.JiraSearchContainer = function JiraSearchConta
|
|
|
45
45
|
parameters = props.parameters,
|
|
46
46
|
onSearch = props.onSearch,
|
|
47
47
|
onSearchMethodChangeCallback = props.onSearchMethodChange,
|
|
48
|
-
initialSearchMethod = props.initialSearchMethod
|
|
48
|
+
initialSearchMethod = props.initialSearchMethod,
|
|
49
|
+
setSearchBarJql = props.setSearchBarJql,
|
|
50
|
+
_props$searchBarJql = props.searchBarJql,
|
|
51
|
+
searchBarJql = _props$searchBarJql === void 0 ? DEFAULT_JQL_QUERY : _props$searchBarJql;
|
|
49
52
|
var _ref = parameters || {},
|
|
50
|
-
currentCloudId = _ref.cloudId
|
|
51
|
-
initialJql = _ref.jql;
|
|
53
|
+
currentCloudId = _ref.cloudId;
|
|
52
54
|
var _useIntl = (0, _reactIntlNext.useIntl)(),
|
|
53
55
|
formatMessage = _useIntl.formatMessage;
|
|
54
56
|
var _useDatasourceAnalyti = (0, _analytics.useDatasourceAnalyticsEvents)(),
|
|
@@ -61,37 +63,33 @@ var JiraSearchContainer = exports.JiraSearchContainer = function JiraSearchConta
|
|
|
61
63
|
_useState4 = (0, _slicedToArray2.default)(_useState3, 2),
|
|
62
64
|
currentSearchMethod = _useState4[0],
|
|
63
65
|
setCurrentSearchMethod = _useState4[1];
|
|
64
|
-
var _useState5 = (0, _react.useState)(
|
|
66
|
+
var _useState5 = (0, _react.useState)(currentCloudId),
|
|
65
67
|
_useState6 = (0, _slicedToArray2.default)(_useState5, 2),
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
var _useState7 = (0, _react.useState)(
|
|
68
|
+
cloudId = _useState6[0],
|
|
69
|
+
setCloudId = _useState6[1];
|
|
70
|
+
var _useState7 = (0, _react.useState)(false),
|
|
69
71
|
_useState8 = (0, _slicedToArray2.default)(_useState7, 2),
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
var _useState9 = (0, _react.useState)(
|
|
72
|
+
isComplexQuery = _useState8[0],
|
|
73
|
+
setIsComplexQuery = _useState8[1];
|
|
74
|
+
var _useState9 = (0, _react.useState)(),
|
|
73
75
|
_useState10 = (0, _slicedToArray2.default)(_useState9, 2),
|
|
74
|
-
|
|
75
|
-
|
|
76
|
+
orderKey = _useState10[0],
|
|
77
|
+
setOrderKey = _useState10[1];
|
|
76
78
|
var _useState11 = (0, _react.useState)(),
|
|
77
79
|
_useState12 = (0, _slicedToArray2.default)(_useState11, 2),
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
var _useState13 = (0, _react.useState)(),
|
|
80
|
+
orderDirection = _useState12[0],
|
|
81
|
+
setOrderDirection = _useState12[1];
|
|
82
|
+
var _useState13 = (0, _react.useState)({}),
|
|
81
83
|
_useState14 = (0, _slicedToArray2.default)(_useState13, 2),
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
var _useState15 = (0, _react.useState)({}),
|
|
85
|
-
_useState16 = (0, _slicedToArray2.default)(_useState15, 2),
|
|
86
|
-
filterSelections = _useState16[0],
|
|
87
|
-
setFilterSelections = _useState16[1];
|
|
84
|
+
filterSelections = _useState14[0],
|
|
85
|
+
setFilterSelections = _useState14[1];
|
|
88
86
|
var showBasicFilters = (0, _react.useMemo)(function () {
|
|
89
87
|
if ((0, _platformFeatureFlags.getBooleanFF)('platform.linking-platform.datasource.show-jlol-basic-filters')) {
|
|
90
88
|
return true;
|
|
91
89
|
}
|
|
92
90
|
return false;
|
|
93
91
|
}, []);
|
|
94
|
-
var _useHydrateJqlQuery = (0, _useHydrateJqlQuery2.useHydrateJqlQuery)(cloudId || '',
|
|
92
|
+
var _useHydrateJqlQuery = (0, _useHydrateJqlQuery2.useHydrateJqlQuery)(cloudId || '', searchBarJql),
|
|
95
93
|
hydratedOptions = _useHydrateJqlQuery.hydratedOptions,
|
|
96
94
|
fetchHydratedJqlOptions = _useHydrateJqlQuery.fetchHydratedJqlOptions,
|
|
97
95
|
basicFilterHydrationStatus = _useHydrateJqlQuery.status;
|
|
@@ -102,13 +100,13 @@ var JiraSearchContainer = exports.JiraSearchContainer = function JiraSearchConta
|
|
|
102
100
|
var handleBasicSearchChange = (0, _react.useCallback)(function (e) {
|
|
103
101
|
var rawSearch = e.currentTarget.value;
|
|
104
102
|
setBasicSearchTerm(rawSearch);
|
|
105
|
-
|
|
103
|
+
setSearchBarJql((0, _buildJQL.buildJQL)({
|
|
106
104
|
rawSearch: rawSearch,
|
|
107
105
|
filterValues: filterSelections,
|
|
108
106
|
orderDirection: orderDirection,
|
|
109
107
|
orderKey: orderKey
|
|
110
108
|
}));
|
|
111
|
-
}, [filterSelections, orderDirection, orderKey]);
|
|
109
|
+
}, [setSearchBarJql, filterSelections, orderDirection, orderKey]);
|
|
112
110
|
var onQueryChange = (0, _react.useCallback)(function (query) {
|
|
113
111
|
var _query$split$map$filt, _fragments$at, _fragments$at2, _fragments$at3;
|
|
114
112
|
// determine if order keys have been set so they can be saved and persisted when changes occur in basic search
|
|
@@ -124,12 +122,12 @@ var JiraSearchContainer = exports.JiraSearchContainer = function JiraSearchConta
|
|
|
124
122
|
setOrderKey(key);
|
|
125
123
|
setOrderDirection(order);
|
|
126
124
|
}
|
|
127
|
-
|
|
128
|
-
}, []);
|
|
125
|
+
setSearchBarJql(query);
|
|
126
|
+
}, [setSearchBarJql]);
|
|
129
127
|
var handleSearch = (0, _react.useCallback)(function () {
|
|
130
|
-
var isCurrentQueryComplex = (0, _isQueryTooComplex.isQueryTooComplex)(
|
|
128
|
+
var isCurrentQueryComplex = (0, _isQueryTooComplex.isQueryTooComplex)(searchBarJql);
|
|
131
129
|
onSearch({
|
|
132
|
-
jql:
|
|
130
|
+
jql: searchBarJql
|
|
133
131
|
}, {
|
|
134
132
|
searchMethod: currentSearchMethod,
|
|
135
133
|
basicFilterSelections: filterSelections,
|
|
@@ -146,7 +144,7 @@ var JiraSearchContainer = exports.JiraSearchContainer = function JiraSearchConta
|
|
|
146
144
|
fetchHydratedJqlOptions();
|
|
147
145
|
}
|
|
148
146
|
}
|
|
149
|
-
}, [currentSearchMethod, fetchHydratedJqlOptions, filterSelections, fireEvent,
|
|
147
|
+
}, [currentSearchMethod, fetchHydratedJqlOptions, filterSelections, fireEvent, searchBarJql, onSearch, showBasicFilters]);
|
|
150
148
|
var _useDebouncedCallback = (0, _useDebounce.useDebouncedCallback)(function (filterValues) {
|
|
151
149
|
var jqlWithFilterValues = (0, _buildJQL.buildJQL)({
|
|
152
150
|
rawSearch: basicSearchTerm,
|
|
@@ -154,7 +152,7 @@ var JiraSearchContainer = exports.JiraSearchContainer = function JiraSearchConta
|
|
|
154
152
|
orderDirection: orderDirection,
|
|
155
153
|
orderKey: orderKey
|
|
156
154
|
});
|
|
157
|
-
|
|
155
|
+
setSearchBarJql(jqlWithFilterValues);
|
|
158
156
|
var isCurrentQueryComplex = (0, _isQueryTooComplex.isQueryTooComplex)(jqlWithFilterValues);
|
|
159
157
|
onSearch({
|
|
160
158
|
jql: jqlWithFilterValues
|
|
@@ -172,9 +170,9 @@ var JiraSearchContainer = exports.JiraSearchContainer = function JiraSearchConta
|
|
|
172
170
|
debouncedBasicFilterSelectionChange(updatedSelection);
|
|
173
171
|
}, [debouncedBasicFilterSelectionChange, filterSelections]);
|
|
174
172
|
(0, _react.useEffect)(function () {
|
|
175
|
-
var isCurrentQueryComplex = (0, _isQueryTooComplex.isQueryTooComplex)(
|
|
173
|
+
var isCurrentQueryComplex = (0, _isQueryTooComplex.isQueryTooComplex)(searchBarJql);
|
|
176
174
|
setIsComplexQuery(isCurrentQueryComplex);
|
|
177
|
-
if (showBasicFilters && !isCurrentQueryComplex &&
|
|
175
|
+
if (showBasicFilters && !isCurrentQueryComplex && searchBarJql !== DEFAULT_JQL_QUERY) {
|
|
178
176
|
fetchHydratedJqlOptions();
|
|
179
177
|
}
|
|
180
178
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
@@ -192,14 +190,14 @@ var JiraSearchContainer = exports.JiraSearchContainer = function JiraSearchConta
|
|
|
192
190
|
(0, _react.useEffect)(function () {
|
|
193
191
|
if (currentCloudId !== cloudId) {
|
|
194
192
|
setBasicSearchTerm('');
|
|
195
|
-
|
|
193
|
+
setSearchBarJql(DEFAULT_JQL_QUERY);
|
|
196
194
|
setIsComplexQuery(false);
|
|
197
195
|
setOrderKey(undefined);
|
|
198
196
|
setOrderDirection(undefined);
|
|
199
197
|
setFilterSelections({});
|
|
200
198
|
setCloudId(currentCloudId);
|
|
201
199
|
}
|
|
202
|
-
}, [currentCloudId, cloudId]);
|
|
200
|
+
}, [currentCloudId, cloudId, setSearchBarJql]);
|
|
203
201
|
return (0, _react2.jsx)("div", {
|
|
204
202
|
css: inputContainerStyles,
|
|
205
203
|
"data-testid": "jira-search-container"
|
|
@@ -212,7 +210,7 @@ var JiraSearchContainer = exports.JiraSearchContainer = function JiraSearchConta
|
|
|
212
210
|
onSearch: handleSearch,
|
|
213
211
|
searchTerm: basicSearchTerm
|
|
214
212
|
}), showBasicFilters && (0, _react2.jsx)(_basicFilters.BasicFilters, {
|
|
215
|
-
jql:
|
|
213
|
+
jql: searchBarJql,
|
|
216
214
|
cloudId: cloudId || '',
|
|
217
215
|
onChange: handleBasicFilterSelectionChange,
|
|
218
216
|
selections: filterSelections,
|
|
@@ -222,7 +220,7 @@ var JiraSearchContainer = exports.JiraSearchContainer = function JiraSearchConta
|
|
|
222
220
|
isSearching: isSearching,
|
|
223
221
|
onChange: onQueryChange,
|
|
224
222
|
onSearch: handleSearch,
|
|
225
|
-
query:
|
|
223
|
+
query: searchBarJql
|
|
226
224
|
}), (0, _react2.jsx)(_modeSwitcher.ModeSwitcher, {
|
|
227
225
|
onOptionValueChange: onSearchMethodChange,
|
|
228
226
|
selectedOptionValue: currentSearchMethod,
|