@atlaskit/link-datasource 1.19.40 → 1.19.42
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 +13 -0
- package/dist/cjs/ui/assets-modal/modal/index.js +2 -1
- package/dist/cjs/ui/assets-modal/modal/messages.js +5 -0
- package/dist/cjs/ui/issue-like-table/draggable-table-heading.js +9 -12
- package/dist/cjs/ui/issue-like-table/index.js +30 -44
- package/dist/cjs/ui/issue-like-table/styled.js +15 -2
- package/dist/cjs/ui/issue-like-table/utils.js +26 -0
- package/dist/cjs/ui/jira-issues-modal/modal/display-view-dropdown/display-view-drop-down.js +68 -0
- package/dist/cjs/ui/jira-issues-modal/modal/index.js +19 -39
- package/dist/cjs/ui/jira-issues-modal/modal/messages.js +19 -9
- package/dist/es2019/ui/assets-modal/modal/index.js +2 -1
- package/dist/es2019/ui/assets-modal/modal/messages.js +5 -0
- package/dist/es2019/ui/issue-like-table/draggable-table-heading.js +8 -11
- package/dist/es2019/ui/issue-like-table/index.js +72 -56
- package/dist/es2019/ui/issue-like-table/styled.js +41 -11
- package/dist/es2019/ui/issue-like-table/utils.js +19 -0
- package/dist/es2019/ui/jira-issues-modal/modal/display-view-dropdown/display-view-drop-down.js +55 -0
- package/dist/es2019/ui/jira-issues-modal/modal/index.js +20 -41
- package/dist/es2019/ui/jira-issues-modal/modal/messages.js +19 -9
- package/dist/esm/ui/assets-modal/modal/index.js +2 -1
- package/dist/esm/ui/assets-modal/modal/messages.js +5 -0
- package/dist/esm/ui/issue-like-table/draggable-table-heading.js +9 -12
- package/dist/esm/ui/issue-like-table/index.js +30 -44
- package/dist/esm/ui/issue-like-table/styled.js +14 -1
- package/dist/esm/ui/issue-like-table/utils.js +20 -0
- package/dist/esm/ui/jira-issues-modal/modal/display-view-dropdown/display-view-drop-down.js +57 -0
- package/dist/esm/ui/jira-issues-modal/modal/index.js +20 -40
- package/dist/esm/ui/jira-issues-modal/modal/messages.js +19 -9
- package/dist/types/ui/assets-modal/modal/messages.d.ts +5 -0
- package/dist/types/ui/issue-like-table/index.d.ts +0 -1
- package/dist/types/ui/issue-like-table/styled.d.ts +9 -0
- package/dist/types/ui/issue-like-table/utils.d.ts +17 -0
- package/dist/types/ui/jira-issues-modal/modal/display-view-dropdown/display-view-drop-down.d.ts +8 -0
- package/dist/types/ui/jira-issues-modal/modal/messages.d.ts +12 -2
- package/dist/types-ts4.5/ui/assets-modal/modal/messages.d.ts +5 -0
- package/dist/types-ts4.5/ui/issue-like-table/index.d.ts +0 -1
- package/dist/types-ts4.5/ui/issue-like-table/styled.d.ts +9 -0
- package/dist/types-ts4.5/ui/issue-like-table/utils.d.ts +17 -0
- package/dist/types-ts4.5/ui/jira-issues-modal/modal/display-view-dropdown/display-view-drop-down.d.ts +8 -0
- package/dist/types-ts4.5/ui/jira-issues-modal/modal/messages.d.ts +12 -2
- package/package.json +5 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @atlaskit/link-datasource
|
|
2
2
|
|
|
3
|
+
## 1.19.42
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#67168](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/67168) [`aa400684d082`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/aa400684d082) - [ux] Updating modal insert button to show 'Update table' when editing existing table
|
|
8
|
+
- [#63918](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/63918) [`ab7df781854a`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/ab7df781854a) - Updating mode switcher toggle with drop down for issue/count view
|
|
9
|
+
|
|
10
|
+
## 1.19.41
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- [#65779](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/65779) [`a68623048896`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/a68623048896) - Improve handling of column resizing and remove standard table css styles bleeding to datasource table when it is inside table
|
|
15
|
+
|
|
3
16
|
## 1.19.40
|
|
4
17
|
|
|
5
18
|
### Patch Changes
|
|
@@ -213,6 +213,7 @@ var PlainAssetsConfigModal = function PlainAssetsConfigModal(props) {
|
|
|
213
213
|
}
|
|
214
214
|
}, [defaultVisibleColumnKeys, isNewSearch]);
|
|
215
215
|
var isDisabled = !!errorState || status !== 'resolved' || assetsClientLoading || !aql || !schemaId;
|
|
216
|
+
var isEditingExistingTable = !!(initialParameters !== null && initialParameters !== void 0 && initialParameters.aql && initialParameters !== null && initialParameters !== void 0 && initialParameters.schemaId && initialParameters !== null && initialParameters !== void 0 && initialParameters.workspaceId);
|
|
216
217
|
var retrieveUrlForSmartCardRender = (0, _react.useCallback)(function () {
|
|
217
218
|
var _data$key;
|
|
218
219
|
var _responseItems = (0, _slicedToArray2.default)(responseItems, 1),
|
|
@@ -371,7 +372,7 @@ var PlainAssetsConfigModal = function PlainAssetsConfigModal(props) {
|
|
|
371
372
|
onClick: onInsertPressed,
|
|
372
373
|
isDisabled: isDisabled,
|
|
373
374
|
testId: 'assets-datasource-modal--insert-button'
|
|
374
|
-
}, (0, _react2.jsx)(_reactIntlNext.FormattedMessage, (0, _extends2.default)({}, _messages.modalMessages.insertIssuesButtonText, {
|
|
375
|
+
}, (0, _react2.jsx)(_reactIntlNext.FormattedMessage, (0, _extends2.default)({}, isEditingExistingTable ? _messages.modalMessages.updateObjectsButtonText : _messages.modalMessages.insertIssuesButtonText, {
|
|
375
376
|
values: {
|
|
376
377
|
objectsCount: responseItems.length
|
|
377
378
|
}
|
|
@@ -11,6 +11,11 @@ var modalMessages = exports.modalMessages = (0, _reactIntlNext.defineMessages)({
|
|
|
11
11
|
description: 'Button text to close the modal with no changes being made',
|
|
12
12
|
defaultMessage: 'Cancel'
|
|
13
13
|
},
|
|
14
|
+
updateObjectsButtonText: {
|
|
15
|
+
id: 'linkDataSource.assets.configmodal.updateObjectsButtonText',
|
|
16
|
+
description: 'Button text to update the displayed content',
|
|
17
|
+
defaultMessage: 'Update table'
|
|
18
|
+
},
|
|
14
19
|
insertIssuesButtonText: {
|
|
15
20
|
id: 'linkDataSource.assets.configmodal.insertIssuesButtonText',
|
|
16
21
|
description: 'Button text to insert the displayed content',
|
|
@@ -20,7 +20,7 @@ var _disableNativeDragPreview = require("@atlaskit/pragmatic-drag-and-drop/util/
|
|
|
20
20
|
var _offsetFromPointer = require("@atlaskit/pragmatic-drag-and-drop/util/offset-from-pointer");
|
|
21
21
|
var _setCustomNativeDragPreview = require("@atlaskit/pragmatic-drag-and-drop/util/set-custom-native-drag-preview");
|
|
22
22
|
var _styled = require("./styled");
|
|
23
|
-
var
|
|
23
|
+
var _utils = require("./utils");
|
|
24
24
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
25
25
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } /** @jsx jsx */
|
|
26
26
|
var verticallyAlignedStyles = (0, _react2.css)({
|
|
@@ -248,9 +248,6 @@ var DraggableTableHeading = exports.DraggableTableHeading = function DraggableTa
|
|
|
248
248
|
|
|
249
249
|
// Set the width of our header being resized
|
|
250
250
|
var proposedWidth = initialWidth + relativeDistanceX;
|
|
251
|
-
if (initialWidth >= _index.COLUMN_MIN_WIDTH && proposedWidth < _index.COLUMN_MIN_WIDTH) {
|
|
252
|
-
proposedWidth = _index.COLUMN_MIN_WIDTH;
|
|
253
|
-
}
|
|
254
251
|
|
|
255
252
|
// We update width css directly live
|
|
256
253
|
mainHeaderCell.style.setProperty('width', "".concat(proposedWidth, "px"));
|
|
@@ -259,24 +256,24 @@ var DraggableTableHeading = exports.DraggableTableHeading = function DraggableTa
|
|
|
259
256
|
_cancelUnhandled.cancelUnhandled.stop();
|
|
260
257
|
setState(idleState);
|
|
261
258
|
if (onWidthChange) {
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
259
|
+
var cssWidth = +mainHeaderCell.style.getPropertyValue('width').slice(0, -2);
|
|
260
|
+
if (cssWidth < _utils.COLUMN_MIN_WIDTH) {
|
|
261
|
+
cssWidth = _utils.COLUMN_MIN_WIDTH;
|
|
262
|
+
}
|
|
263
|
+
onWidthChange(cssWidth);
|
|
265
264
|
}
|
|
266
265
|
}
|
|
267
266
|
});
|
|
268
267
|
}, [id, index, onWidthChange, state, tableId, width]);
|
|
269
268
|
return (0, _react2.jsx)(_styled.TableHeading, {
|
|
270
269
|
ref: mainHeaderCellRef,
|
|
271
|
-
className: "has-column-picker",
|
|
272
270
|
"data-testid": "".concat(id, "-column-heading"),
|
|
273
271
|
style: _objectSpread({
|
|
274
272
|
cursor: 'grab'
|
|
275
|
-
},
|
|
273
|
+
}, (0, _utils.getWidthCss)({
|
|
274
|
+
shouldUseWidth: !!onWidthChange,
|
|
276
275
|
width: width
|
|
277
|
-
}
|
|
278
|
-
maxWidth: width
|
|
279
|
-
})
|
|
276
|
+
}))
|
|
280
277
|
}, onWidthChange ? (0, _react2.jsx)("div", {
|
|
281
278
|
ref: columnResizeHandleRef,
|
|
282
279
|
css: [resizerStyles, state.type === 'resizing' && resizingStyles],
|
|
@@ -4,7 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.scrollableContainerShadowsCssComponents = exports.getOrderedColumns = exports.IssueLikeDataTableView = exports.EmptyState =
|
|
7
|
+
exports.scrollableContainerShadowsCssComponents = exports.getOrderedColumns = exports.IssueLikeDataTableView = exports.EmptyState = void 0;
|
|
8
8
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
9
9
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
10
10
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
@@ -24,6 +24,7 @@ var _reorderWithEdge = require("@atlaskit/pragmatic-drag-and-drop-hitbox/util/re
|
|
|
24
24
|
var _pragmaticDragAndDropReactBeautifulDndAutoscroll = require("@atlaskit/pragmatic-drag-and-drop-react-beautiful-dnd-autoscroll");
|
|
25
25
|
var _element = require("@atlaskit/pragmatic-drag-and-drop/adapter/element");
|
|
26
26
|
var _combine = require("@atlaskit/pragmatic-drag-and-drop/util/combine");
|
|
27
|
+
var _primitives = require("@atlaskit/primitives");
|
|
27
28
|
var _colors = require("@atlaskit/theme/colors");
|
|
28
29
|
var _tooltip = _interopRequireDefault(require("@atlaskit/tooltip"));
|
|
29
30
|
var _ufoExperiences = require("../../analytics/ufoExperiences");
|
|
@@ -35,7 +36,8 @@ var _emptyState = _interopRequireDefault(require("./empty-state"));
|
|
|
35
36
|
var _renderType = require("./render-type");
|
|
36
37
|
var _styled2 = require("./styled");
|
|
37
38
|
var _useIsOnScreen = require("./useIsOnScreen");
|
|
38
|
-
var
|
|
39
|
+
var _utils = require("./utils");
|
|
40
|
+
var _templateObject, _templateObject2;
|
|
39
41
|
/** @jsx jsx */
|
|
40
42
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
41
43
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
@@ -51,21 +53,8 @@ var truncateTextStyles = (0, _react2.css)({
|
|
|
51
53
|
textOverflow: 'ellipsis',
|
|
52
54
|
whiteSpace: 'nowrap'
|
|
53
55
|
});
|
|
54
|
-
var ColumnPickerHeader = _styled.default.th(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n width: 56px;\n
|
|
55
|
-
var
|
|
56
|
-
overflow: 'hidden',
|
|
57
|
-
textOverflow: 'ellipsis',
|
|
58
|
-
whiteSpace: 'nowrap',
|
|
59
|
-
borderRight: "0.5px solid ".concat("var(--ds-border, ".concat(_colors.N40, ")")),
|
|
60
|
-
borderBottom: "0.5px solid ".concat("var(--ds-border, ".concat(_colors.N40, ")")),
|
|
61
|
-
'&:first-child': {
|
|
62
|
-
paddingLeft: "var(--ds-space-100, 8px)"
|
|
63
|
-
},
|
|
64
|
-
'&:last-child': {
|
|
65
|
-
borderRight: 0,
|
|
66
|
-
paddingRight: "var(--ds-space-100, 8px)"
|
|
67
|
-
}
|
|
68
|
-
});
|
|
56
|
+
var ColumnPickerHeader = _styled.default.th(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n ", " {\n box-sizing: content-box;\n border: 0;\n\n width: 56px;\n z-index: 10;\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 below */\n\n padding-right: ", ";\n\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 text-align: right; /* In case when TH itself is bigger we want to keep picker at the right side */\n }\n\n ", " {\n padding-right: ", ";\n }\n"])), (0, _styled2.withTablePluginHeaderPrefix)(), tableSidePadding, "var(--ds-elevation-surface-current, #FFF)", "var(--ds-border, ".concat(_colors.N40, ")"), "var(--ds-space-100, 4px)", "var(--ds-elevation-surface-current, #FFF)", (0, _styled2.withTablePluginHeaderPrefix)('&:last-of-type'), tableSidePadding);
|
|
57
|
+
var TableCell = _styled.default.td(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n ", " {\n /* First section here is to override things editor table plugin css defines */\n padding: ", " ", ";\n border: 0;\n min-width: auto;\n vertical-align: inherit;\n box-sizing: border-box;\n\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n border-right: 0.5px solid ", ";\n border-bottom: 0.5px solid ", ";\n }\n\n ", " {\n padding-left: ", ";\n }\n\n ", " {\n border-right: 0;\n padding-right: ", ";\n }\n"])), (0, _styled2.withTablePluginBodyPrefix)(), "var(--ds-space-050, 4px)", "var(--ds-space-100, 8px)", "var(--ds-border, ".concat(_colors.N40, ")"), "var(--ds-border, ".concat(_colors.N40, ")"), (0, _styled2.withTablePluginBodyPrefix)('&:first-child'), "var(--ds-space-100, 8px)", (0, _styled2.withTablePluginBodyPrefix)('&:last-child'), "var(--ds-space-100, 8px)");
|
|
69
58
|
var tableContainerStyles = (0, _react2.css)({
|
|
70
59
|
borderRadius: 'inherit',
|
|
71
60
|
borderBottomLeftRadius: 0,
|
|
@@ -195,16 +184,14 @@ var getOrderedColumns = exports.getOrderedColumns = function getOrderedColumns(c
|
|
|
195
184
|
}).sort(sortColumns);
|
|
196
185
|
return [].concat((0, _toConsumableArray2.default)(visibleColumns), (0, _toConsumableArray2.default)(alphabeticallySortedInvisibleColumns));
|
|
197
186
|
};
|
|
198
|
-
var
|
|
199
|
-
var DEFAULT_WIDTH = BASE_WIDTH * 22;
|
|
200
|
-
var COLUMN_MIN_WIDTH = exports.COLUMN_MIN_WIDTH = BASE_WIDTH * 3;
|
|
187
|
+
var DEFAULT_WIDTH = _utils.COLUMN_BASE_WIDTH * 22;
|
|
201
188
|
var keyBasedWidthMap = {
|
|
202
|
-
priority:
|
|
203
|
-
status:
|
|
204
|
-
summary:
|
|
205
|
-
description:
|
|
206
|
-
type:
|
|
207
|
-
key:
|
|
189
|
+
priority: _utils.COLUMN_BASE_WIDTH * 5,
|
|
190
|
+
status: _utils.COLUMN_BASE_WIDTH * 18,
|
|
191
|
+
summary: _utils.COLUMN_BASE_WIDTH * 45,
|
|
192
|
+
description: _utils.COLUMN_BASE_WIDTH * 31,
|
|
193
|
+
type: _utils.COLUMN_BASE_WIDTH * 6,
|
|
194
|
+
key: _utils.COLUMN_BASE_WIDTH * 15
|
|
208
195
|
};
|
|
209
196
|
function getDefaultColumnWidth(key, type) {
|
|
210
197
|
var keyBasedWidth = keyBasedWidthMap[key];
|
|
@@ -213,9 +200,9 @@ function getDefaultColumnWidth(key, type) {
|
|
|
213
200
|
}
|
|
214
201
|
switch (type) {
|
|
215
202
|
case 'date':
|
|
216
|
-
return
|
|
203
|
+
return _utils.COLUMN_BASE_WIDTH * 16;
|
|
217
204
|
case 'icon':
|
|
218
|
-
return
|
|
205
|
+
return _utils.COLUMN_BASE_WIDTH * 7;
|
|
219
206
|
default:
|
|
220
207
|
return DEFAULT_WIDTH;
|
|
221
208
|
}
|
|
@@ -502,7 +489,8 @@ var IssueLikeDataTableView = exports.IssueLikeDataTableView = function IssueLike
|
|
|
502
489
|
}
|
|
503
490
|
}, _callee, null, [[3, 9]]);
|
|
504
491
|
})), [parentContainerRenderInstanceId, extensionKey, hasFullSchema, onLoadDatasourceDetails]);
|
|
505
|
-
var shouldUseWidth = onColumnResize || columnCustomSizes;
|
|
492
|
+
var shouldUseWidth = !!(onColumnResize || columnCustomSizes);
|
|
493
|
+
var isEditable = onVisibleColumnKeysChange && hasData;
|
|
506
494
|
return (0, _react2.jsx)("div", {
|
|
507
495
|
/* There is required contentEditable={true} in editor-card-plugin
|
|
508
496
|
* But this brakes how DND works. We set contentEditable={false} to allow DND to work
|
|
@@ -522,7 +510,8 @@ var IssueLikeDataTableView = exports.IssueLikeDataTableView = function IssueLike
|
|
|
522
510
|
} : {}
|
|
523
511
|
}, (0, _react2.jsx)("thead", {
|
|
524
512
|
"data-testid": testId && "".concat(testId, "--head"),
|
|
525
|
-
css: [noDefaultBorderStyles, tableHeadStyles]
|
|
513
|
+
css: [noDefaultBorderStyles, tableHeadStyles],
|
|
514
|
+
className: !!onVisibleColumnKeysChange ? 'has-column-picker' : ''
|
|
526
515
|
}, (0, _react2.jsx)("tr", {
|
|
527
516
|
ref: tableHeaderRowRef
|
|
528
517
|
}, headerColumns.map(function (_ref13, cellIndex) {
|
|
@@ -537,7 +526,7 @@ var IssueLikeDataTableView = exports.IssueLikeDataTableView = function IssueLike
|
|
|
537
526
|
level: "h200",
|
|
538
527
|
as: 'span'
|
|
539
528
|
}, content));
|
|
540
|
-
if (
|
|
529
|
+
if (isEditable) {
|
|
541
530
|
var _containerRef$current3;
|
|
542
531
|
var previewRows = tableRows.map(function (_ref14) {
|
|
543
532
|
var cells = _ref14.cells;
|
|
@@ -566,14 +555,12 @@ var IssueLikeDataTableView = exports.IssueLikeDataTableView = function IssueLike
|
|
|
566
555
|
} else {
|
|
567
556
|
return (0, _react2.jsx)(_styled2.TableHeading, {
|
|
568
557
|
key: key,
|
|
569
|
-
className: !!onVisibleColumnKeysChange ? 'has-column-picker' : '',
|
|
570
558
|
"data-testid": "".concat(key, "-column-heading"),
|
|
571
|
-
style:
|
|
559
|
+
style: (0, _utils.getWidthCss)({
|
|
560
|
+
shouldUseWidth: shouldUseWidth,
|
|
572
561
|
width: width
|
|
573
|
-
}
|
|
574
|
-
|
|
575
|
-
}
|
|
576
|
-
}, heading);
|
|
562
|
+
})
|
|
563
|
+
}, (0, _react2.jsx)(_primitives.Flex, null, heading));
|
|
577
564
|
}
|
|
578
565
|
}), onVisibleColumnKeysChange && (0, _react2.jsx)(ColumnPickerHeader, null, (0, _react2.jsx)(_columnPicker.ColumnPicker, {
|
|
579
566
|
columns: hasFullSchema ? orderedColumns : [],
|
|
@@ -596,22 +583,21 @@ var IssueLikeDataTableView = exports.IssueLikeDataTableView = function IssueLike
|
|
|
596
583
|
var cellKey = _ref17.key,
|
|
597
584
|
content = _ref17.content,
|
|
598
585
|
width = _ref17.width;
|
|
599
|
-
var
|
|
586
|
+
var isLastCell = cellIndex === cells.length - 1;
|
|
587
|
+
var loadingRowStyle = (0, _utils.getWidthCss)({
|
|
588
|
+
shouldUseWidth: shouldUseWidth,
|
|
600
589
|
width: width
|
|
601
|
-
}
|
|
602
|
-
maxWidth: width
|
|
603
|
-
};
|
|
590
|
+
});
|
|
604
591
|
// extra padding is required around skeleton loader to avoid vertical jumps when data loads
|
|
605
592
|
if (key !== null && key !== void 0 && key.includes('loading')) {
|
|
606
593
|
loadingRowStyle = _objectSpread(_objectSpread({}, loadingRowStyle), {}, {
|
|
607
594
|
paddingBlock: "var(--ds-space-100, 8px)"
|
|
608
595
|
});
|
|
609
596
|
}
|
|
610
|
-
return (0, _react2.jsx)(
|
|
597
|
+
return (0, _react2.jsx)(TableCell, {
|
|
611
598
|
key: cellKey,
|
|
612
599
|
"data-testid": testId && "".concat(testId, "--cell-").concat(cellIndex),
|
|
613
|
-
colSpan:
|
|
614
|
-
css: truncatedCellStyles,
|
|
600
|
+
colSpan: isEditable && isLastCell ? 2 : undefined,
|
|
615
601
|
style: loadingRowStyle
|
|
616
602
|
}, content);
|
|
617
603
|
}));
|
|
@@ -4,7 +4,7 @@ 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.ScrollableContainerHeight = exports.FieldTextFontSize = void 0;
|
|
7
|
+
exports.withTablePluginPrefix = exports.withTablePluginHeaderPrefix = exports.withTablePluginBodyPrefix = 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");
|
|
@@ -14,4 +14,17 @@ var FieldTextFontSize = exports.FieldTextFontSize = '14px';
|
|
|
14
14
|
var Table = exports.Table = _styled.default.table(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n width: 100%;\n"])));
|
|
15
15
|
var lineHeight = "var(--ds-font-lineHeight-300, 24px)";
|
|
16
16
|
var verticalPadding = "var(--ds-space-025, 2px)";
|
|
17
|
-
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* This is a hack used to override styles that are leaking to our table html element
|
|
20
|
+
* from editor table plugin.
|
|
21
|
+
* This css prefix can be used in front of our main css rule to make its weight bigger
|
|
22
|
+
* and force make browser use it first and editor plugin css second.
|
|
23
|
+
*/
|
|
24
|
+
var withTablePluginPrefix = exports.withTablePluginPrefix = function withTablePluginPrefix(tableSection) {
|
|
25
|
+
var mainRule = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '&';
|
|
26
|
+
return "\n .pm-table-wrapper > table ".concat(tableSection, " ").concat(mainRule, ",\n .ProseMirror .pm-table-wrapper > table ").concat(tableSection, " ").concat(mainRule, ",\n ").concat(mainRule, "\n");
|
|
27
|
+
};
|
|
28
|
+
var withTablePluginHeaderPrefix = exports.withTablePluginHeaderPrefix = withTablePluginPrefix.bind(null, 'thead');
|
|
29
|
+
var withTablePluginBodyPrefix = exports.withTablePluginBodyPrefix = withTablePluginPrefix.bind(null, 'tbody');
|
|
30
|
+
var TableHeading = exports.TableHeading = _styled.default.th(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n ", " {\n border: 0;\n position: relative;\n\n /* This makes resizing work with out jumping due to padding + changes overall width for same default values. */\n box-sizing: border-box;\n\n line-height: ", ";\n padding: ", " ", ";\n border-right: 0.5px solid ", ";\n border-bottom: 2px solid ", ";\n\n /*\n lineHeight * 2 -> Max height of two lined header\n verticalPadding * 2 -> padding for this component itself\n verticalPadding * 2 -> padding inside span (--container)\n 2px -> Bottom border\n Last two terms are needed because of border-box box sizing.\n */\n height: calc(", " * 2 + ", " * 4 + 2px);\n vertical-align: bottom;\n background-color: ", ";\n }\n\n ", " {\n border-right: 0;\n }\n\n ", " {\n padding-left: ", ";\n }\n\n ", " {\n border-right: 0;\n }\n\n & [data-testid='datasource-header-content--container'] {\n width: 100%;\n padding: ", " ", ";\n display: -webkit-box;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n white-space: normal;\n overflow: hidden;\n word-wrap: break-word;\n\n &:hover {\n background: ", ";\n border-radius: 3px;\n }\n }\n"])), withTablePluginHeaderPrefix(), lineHeight, verticalPadding, "var(--ds-space-050, 4px)", "var(--ds-border, ".concat(_colors.N40, ")"), "var(--ds-border, ".concat(_colors.N40, ")"), lineHeight, verticalPadding, "var(--ds-elevation-surface-current, #FFF)", withTablePluginPrefix('', 'thead.has-column-picker &:nth-last-of-type(2)'), withTablePluginHeaderPrefix('&:first-child'), "var(--ds-space-050, 4px)", withTablePluginHeaderPrefix('&:last-child'), verticalPadding, "var(--ds-space-050, 4px)", "var(--ds-background-input-hovered, #F7F8F9)");
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getWidthCss = exports.COLUMN_MIN_WIDTH = exports.COLUMN_BASE_WIDTH = void 0;
|
|
7
|
+
var COLUMN_BASE_WIDTH = exports.COLUMN_BASE_WIDTH = 8;
|
|
8
|
+
var COLUMN_MIN_WIDTH = exports.COLUMN_MIN_WIDTH = COLUMN_BASE_WIDTH * 3;
|
|
9
|
+
/**
|
|
10
|
+
* Generate width related portion of css for table cell.
|
|
11
|
+
*
|
|
12
|
+
* @param shouldUseWidth boolean argument defines if a given width is user defined / baked in value
|
|
13
|
+
* or rather default width that should be treated as a maximum width. When table inserted initially
|
|
14
|
+
* and no user custom width defined we set this value to `false`. As soon as user changes any of the
|
|
15
|
+
* column widths we treat all width as custom hardcoded widths.
|
|
16
|
+
* @param width
|
|
17
|
+
*/
|
|
18
|
+
var getWidthCss = exports.getWidthCss = function getWidthCss(_ref) {
|
|
19
|
+
var shouldUseWidth = _ref.shouldUseWidth,
|
|
20
|
+
width = _ref.width;
|
|
21
|
+
return shouldUseWidth ? {
|
|
22
|
+
width: width
|
|
23
|
+
} : {
|
|
24
|
+
maxWidth: width
|
|
25
|
+
};
|
|
26
|
+
};
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.DisplayViewDropDown = void 0;
|
|
9
|
+
var _react = require("@emotion/react");
|
|
10
|
+
var _reactIntlNext = require("react-intl-next");
|
|
11
|
+
var _dropdownMenu = _interopRequireWildcard(require("@atlaskit/dropdown-menu"));
|
|
12
|
+
var _table = _interopRequireDefault(require("@atlaskit/icon/glyph/table"));
|
|
13
|
+
var _primitives = require("@atlaskit/primitives");
|
|
14
|
+
var _messages = require("../messages");
|
|
15
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
16
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
17
|
+
/** @jsx jsx */
|
|
18
|
+
|
|
19
|
+
var dropDownItemGroupStyles = (0, _primitives.xcss)({
|
|
20
|
+
width: '320px',
|
|
21
|
+
height: '140px',
|
|
22
|
+
paddingTop: "var(--ds-space-050, 4px)",
|
|
23
|
+
paddingBottom: "var(--ds-space-050, 4px)",
|
|
24
|
+
borderRadius: 'border.radius'
|
|
25
|
+
});
|
|
26
|
+
var InlineIcon = (0, _react.jsx)("svg", {
|
|
27
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
28
|
+
width: "24",
|
|
29
|
+
height: "24",
|
|
30
|
+
viewBox: "0 0 24 24",
|
|
31
|
+
fill: "none"
|
|
32
|
+
}, (0, _react.jsx)("path", {
|
|
33
|
+
fillRule: "evenodd",
|
|
34
|
+
clipRule: "evenodd",
|
|
35
|
+
d: "M4 9C2.89543 9 2 9.67155 2 10.5V13.5C2 14.3285 2.89543 15 4 15H20C21.1046 15 22 14.3285 22 13.5V10.5C22 9.67155 21.1046 9 20 9H4ZM4.22222 11.25C4.22222 10.5 4.22222 10.5 5 10.5H7C7.55556 10.5 7.55556 10.5 7.55556 11.25V13C7.55556 13.5 7.55556 13.5 7 13.5H5C4.22222 13.5 4.22222 13.5 4.22222 13V11.25ZM9 12C9 11.7929 9.2239 11.625 9.5 11.625H19.5C19.7761 11.625 20 11.7929 20 12C20 12.2071 19.7761 12.375 19.5 12.375H9.5C9.2239 12.375 9 12.2071 9 12Z",
|
|
36
|
+
fill: 'currentColor'
|
|
37
|
+
}));
|
|
38
|
+
var DisplayViewDropDown = exports.DisplayViewDropDown = function DisplayViewDropDown(_ref) {
|
|
39
|
+
var onViewModeChange = _ref.onViewModeChange,
|
|
40
|
+
viewMode = _ref.viewMode;
|
|
41
|
+
var _useIntl = (0, _reactIntlNext.useIntl)(),
|
|
42
|
+
formatMessage = _useIntl.formatMessage;
|
|
43
|
+
var triggerText = viewMode === 'issue' ? formatMessage(_messages.modalMessages.tableViewModeLabel) : formatMessage(_messages.modalMessages.inlineLinkViewModeLabel);
|
|
44
|
+
return (0, _react.jsx)(_dropdownMenu.default, {
|
|
45
|
+
trigger: triggerText,
|
|
46
|
+
testId: "jira-jql-datasource-modal--view-drop-down"
|
|
47
|
+
}, (0, _react.jsx)(_primitives.Box, {
|
|
48
|
+
xcss: dropDownItemGroupStyles
|
|
49
|
+
}, (0, _react.jsx)(_dropdownMenu.DropdownItemGroup, null, (0, _react.jsx)(_dropdownMenu.DropdownItem, {
|
|
50
|
+
testId: "dropdown-item-table",
|
|
51
|
+
onClick: function onClick() {
|
|
52
|
+
return onViewModeChange('issue');
|
|
53
|
+
},
|
|
54
|
+
isSelected: viewMode === 'issue',
|
|
55
|
+
description: formatMessage(_messages.modalMessages.tableViewModeDescription),
|
|
56
|
+
elemBefore: (0, _react.jsx)(_table.default, {
|
|
57
|
+
label: "table icon"
|
|
58
|
+
})
|
|
59
|
+
}, (0, _react.jsx)(_reactIntlNext.FormattedMessage, _messages.modalMessages.tableViewModeLabel)), (0, _react.jsx)(_dropdownMenu.DropdownItem, {
|
|
60
|
+
testId: "dropdown-item-inline-link",
|
|
61
|
+
onClick: function onClick() {
|
|
62
|
+
return onViewModeChange('count');
|
|
63
|
+
},
|
|
64
|
+
isSelected: viewMode === 'count',
|
|
65
|
+
description: formatMessage(_messages.modalMessages.inlineLinkViewModeDescription),
|
|
66
|
+
elemBefore: InlineIcon
|
|
67
|
+
}, (0, _react.jsx)(_reactIntlNext.FormattedMessage, _messages.modalMessages.inlineLinkViewModeLabel)))));
|
|
68
|
+
};
|
|
@@ -44,8 +44,8 @@ var _ui = require("../basic-filters/ui");
|
|
|
44
44
|
var _isQueryTooComplex = require("../basic-filters/utils/isQueryTooComplex");
|
|
45
45
|
var _initialStateView = require("../initial-state-view");
|
|
46
46
|
var _jiraSearchContainer = require("../jira-search-container");
|
|
47
|
-
var _modeSwitcher = require("../mode-switcher");
|
|
48
47
|
var _siteSelector = require("../site-selector");
|
|
48
|
+
var _displayViewDropDown = require("./display-view-dropdown/display-view-drop-down");
|
|
49
49
|
var _messages = require("./messages");
|
|
50
50
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
51
51
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
@@ -89,10 +89,10 @@ var smartLinkContainerStyles = (0, _react2.css)({
|
|
|
89
89
|
paddingLeft: '1px'
|
|
90
90
|
});
|
|
91
91
|
var getDisplayValue = function getDisplayValue(currentViewMode, itemCount) {
|
|
92
|
-
if (currentViewMode === '
|
|
93
|
-
return _types.DatasourceDisplay.
|
|
92
|
+
if (currentViewMode === 'issue') {
|
|
93
|
+
return _types.DatasourceDisplay.DATASOURCE_TABLE;
|
|
94
94
|
}
|
|
95
|
-
return itemCount
|
|
95
|
+
return itemCount === 1 ? _types.DatasourceDisplay.INLINE : _types.DatasourceDisplay.DATASOURCE_INLINE;
|
|
96
96
|
};
|
|
97
97
|
|
|
98
98
|
/**
|
|
@@ -188,8 +188,6 @@ var PlainJiraIssuesConfigModal = exports.PlainJiraIssuesConfigModal = function P
|
|
|
188
188
|
_useDatasourceTableSt2 = _useDatasourceTableSt.extensionKey,
|
|
189
189
|
extensionKey = _useDatasourceTableSt2 === void 0 ? null : _useDatasourceTableSt2,
|
|
190
190
|
destinationObjectTypes = _useDatasourceTableSt.destinationObjectTypes;
|
|
191
|
-
var _useIntl = (0, _reactIntlNext.useIntl)(),
|
|
192
|
-
formatMessage = _useIntl.formatMessage;
|
|
193
191
|
var _useDatasourceAnalyti = (0, _analytics.useDatasourceAnalyticsEvents)(),
|
|
194
192
|
fireEvent = _useDatasourceAnalyti.fireEvent;
|
|
195
193
|
var _useRef = (0, _react.useRef)((0, _uuid.v4)()),
|
|
@@ -412,18 +410,11 @@ var PlainJiraIssuesConfigModal = exports.PlainJiraIssuesConfigModal = function P
|
|
|
412
410
|
var firstIssueUrl = retrieveUrlForSmartCardRender();
|
|
413
411
|
if (currentViewMode === 'count') {
|
|
414
412
|
macroInsertedEvent === null || macroInsertedEvent === void 0 || macroInsertedEvent.fire(_analytics.EVENT_CHANNEL);
|
|
413
|
+
var url = responseItems.length === 1 ? firstIssueUrl : upToDateJqlUrl;
|
|
415
414
|
onInsert({
|
|
416
415
|
type: 'inlineCard',
|
|
417
416
|
attrs: {
|
|
418
|
-
url:
|
|
419
|
-
}
|
|
420
|
-
}, consumerEvent);
|
|
421
|
-
} else if (responseItems.length === 1 && firstIssueUrl) {
|
|
422
|
-
macroInsertedEvent === null || macroInsertedEvent === void 0 || macroInsertedEvent.fire(_analytics.EVENT_CHANNEL);
|
|
423
|
-
onInsert({
|
|
424
|
-
type: 'inlineCard',
|
|
425
|
-
attrs: {
|
|
426
|
-
url: firstIssueUrl
|
|
417
|
+
url: url
|
|
427
418
|
}
|
|
428
419
|
}, consumerEvent);
|
|
429
420
|
} else {
|
|
@@ -453,7 +444,7 @@ var PlainJiraIssuesConfigModal = exports.PlainJiraIssuesConfigModal = function P
|
|
|
453
444
|
}
|
|
454
445
|
}, consumerEvent);
|
|
455
446
|
}
|
|
456
|
-
}, [isParametersSet, jql, selectedJiraSite, analyticsPayload, totalCount, visibleColumnKeys, currentViewMode, retrieveUrlForSmartCardRender,
|
|
447
|
+
}, [isParametersSet, jql, selectedJiraSite, analyticsPayload, totalCount, visibleColumnKeys, currentViewMode, retrieveUrlForSmartCardRender, onInsert, datasourceId, cloudId, columnCustomSizes, searchBarJql, responseItems]);
|
|
457
448
|
var handleViewModeChange = function handleViewModeChange(selectedMode) {
|
|
458
449
|
userInteractionActions.current.add(_types.DatasourceAction.DISPLAY_VIEW_CHANGED);
|
|
459
450
|
setCurrentViewMode(selectedMode);
|
|
@@ -503,14 +494,19 @@ var PlainJiraIssuesConfigModal = exports.PlainJiraIssuesConfigModal = function P
|
|
|
503
494
|
css: placeholderSmartLinkStyles
|
|
504
495
|
}, (0, _react2.jsx)(_reactIntlNext.FormattedMessage, _messages.modalMessages.issuesCountSmartCardPlaceholderText)));
|
|
505
496
|
} else {
|
|
506
|
-
var
|
|
497
|
+
var url;
|
|
498
|
+
if (responseItems.length === 1 && retrieveUrlForSmartCardRender()) {
|
|
499
|
+
url = retrieveUrlForSmartCardRender();
|
|
500
|
+
} else {
|
|
501
|
+
url = "".concat(selectedJiraSiteUrl, "/issues/?jql=").concat(encodeURI(jql));
|
|
502
|
+
}
|
|
507
503
|
return (0, _react2.jsx)("div", {
|
|
508
504
|
css: smartLinkContainerStyles
|
|
509
505
|
}, (0, _react2.jsx)(_link.default, {
|
|
510
|
-
url:
|
|
506
|
+
url: url
|
|
511
507
|
}));
|
|
512
508
|
}
|
|
513
|
-
}, [jql, selectedJiraSite === null || selectedJiraSite === void 0 ? void 0 : selectedJiraSite.url, status, urlBeingEdited]);
|
|
509
|
+
}, [jql, selectedJiraSite === null || selectedJiraSite === void 0 ? void 0 : selectedJiraSite.url, status, urlBeingEdited, responseItems, retrieveUrlForSmartCardRender]);
|
|
514
510
|
var renderIssuesModeContent = (0, _react.useCallback)(function () {
|
|
515
511
|
var selectedJiraSiteUrl = selectedJiraSite === null || selectedJiraSite === void 0 ? void 0 : selectedJiraSite.url;
|
|
516
512
|
if (status === 'rejected' && jqlUrl) {
|
|
@@ -533,16 +529,8 @@ var PlainJiraIssuesConfigModal = exports.PlainJiraIssuesConfigModal = function P
|
|
|
533
529
|
searchMethod: currentSearchMethod
|
|
534
530
|
}));
|
|
535
531
|
}
|
|
536
|
-
var firstIssueUrl = retrieveUrlForSmartCardRender();
|
|
537
|
-
if (responseItems.length === 1 && firstIssueUrl) {
|
|
538
|
-
return (0, _react2.jsx)("div", {
|
|
539
|
-
css: smartLinkContainerStyles
|
|
540
|
-
}, (0, _react2.jsx)(_link.default, {
|
|
541
|
-
url: firstIssueUrl
|
|
542
|
-
}));
|
|
543
|
-
}
|
|
544
532
|
return issueLikeDataTableView;
|
|
545
|
-
}, [columns.length, currentSearchMethod, issueLikeDataTableView, jql, jqlUrl, resolvedWithNoResults,
|
|
533
|
+
}, [columns.length, currentSearchMethod, issueLikeDataTableView, jql, jqlUrl, resolvedWithNoResults, selectedJiraSite === null || selectedJiraSite === void 0 ? void 0 : selectedJiraSite.url, status, urlBeingEdited]);
|
|
546
534
|
return (0, _react2.jsx)(_intlMessagesProvider.IntlMessagesProvider, {
|
|
547
535
|
defaultMessages: _en.default,
|
|
548
536
|
loaderFn: _fetchMessagesForLocale.fetchMessagesForLocale
|
|
@@ -558,17 +546,9 @@ var PlainJiraIssuesConfigModal = exports.PlainJiraIssuesConfigModal = function P
|
|
|
558
546
|
onSiteSelection: onSiteSelection,
|
|
559
547
|
selectedJiraSite: selectedJiraSite,
|
|
560
548
|
testId: "jira-jql-datasource-modal--site-selector"
|
|
561
|
-
})) : (0, _react2.jsx)(_reactIntlNext.FormattedMessage, _messages.modalMessages.insertIssuesTitle))), !hasNoJiraSites && (0, _react2.jsx)(
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
label: formatMessage(_messages.modalMessages.issueViewModeLabel),
|
|
565
|
-
value: 'issue'
|
|
566
|
-
}, {
|
|
567
|
-
label: formatMessage(_messages.modalMessages.countViewModeLabel),
|
|
568
|
-
value: 'count'
|
|
569
|
-
}],
|
|
570
|
-
onOptionValueChange: handleViewModeChange,
|
|
571
|
-
selectedOptionValue: currentViewMode
|
|
549
|
+
})) : (0, _react2.jsx)(_reactIntlNext.FormattedMessage, _messages.modalMessages.insertIssuesTitle))), !hasNoJiraSites && (0, _react2.jsx)(_displayViewDropDown.DisplayViewDropDown, {
|
|
550
|
+
onViewModeChange: handleViewModeChange,
|
|
551
|
+
viewMode: currentViewMode
|
|
572
552
|
})), (0, _react2.jsx)(_modalDialog.ModalBody, null, !hasNoJiraSites ? (0, _react2.jsx)(_react.Fragment, null, (0, _react2.jsx)(_jiraSearchContainer.JiraSearchContainer, {
|
|
573
553
|
setSearchBarJql: setSearchBarJql,
|
|
574
554
|
searchBarJql: searchBarJql,
|
|
@@ -26,15 +26,25 @@ var modalMessages = exports.modalMessages = (0, _reactIntlNext.defineMessages)({
|
|
|
26
26
|
description: 'Title for the Jira Issues modal when a user has to select a site to inserting issues from',
|
|
27
27
|
defaultMessage: 'Insert Jira issues from'
|
|
28
28
|
},
|
|
29
|
-
|
|
30
|
-
id: 'linkDataSource.jira-issues.configmodal.
|
|
31
|
-
description: '
|
|
32
|
-
defaultMessage: '
|
|
33
|
-
},
|
|
34
|
-
|
|
35
|
-
id: 'linkDataSource.jira-issues.configmodal.
|
|
36
|
-
description: '
|
|
37
|
-
defaultMessage: '
|
|
29
|
+
tableViewModeLabel: {
|
|
30
|
+
id: 'linkDataSource.jira-issues.configmodal.tableViewModeLabel',
|
|
31
|
+
description: 'Display Jira search results as a table',
|
|
32
|
+
defaultMessage: 'Table'
|
|
33
|
+
},
|
|
34
|
+
tableViewModeDescription: {
|
|
35
|
+
id: 'linkDataSource.jira-issues.configmodal.tableViewModeDescription',
|
|
36
|
+
description: 'Description for table view mode',
|
|
37
|
+
defaultMessage: 'Display Jira search results as a table'
|
|
38
|
+
},
|
|
39
|
+
inlineLinkViewModeLabel: {
|
|
40
|
+
id: 'linkDataSource.jira-issues.configmodal.inlineLinkViewModeLabel',
|
|
41
|
+
description: 'Display the number of search results as an inline smart link',
|
|
42
|
+
defaultMessage: 'Inline link'
|
|
43
|
+
},
|
|
44
|
+
inlineLinkViewModeDescription: {
|
|
45
|
+
id: 'linkDataSource.jira-issues.configmodal.inlineLinkViewModeDescription',
|
|
46
|
+
description: 'Description for inline link view mode',
|
|
47
|
+
defaultMessage: 'Display the number of search results or as an inline smart link'
|
|
38
48
|
},
|
|
39
49
|
issuesCountSmartCardPlaceholderText: {
|
|
40
50
|
id: 'linkDataSource.jira-issues.configmodal.placeholder.issues',
|
|
@@ -189,6 +189,7 @@ const PlainAssetsConfigModal = props => {
|
|
|
189
189
|
}
|
|
190
190
|
}, [defaultVisibleColumnKeys, isNewSearch]);
|
|
191
191
|
const isDisabled = !!errorState || status !== 'resolved' || assetsClientLoading || !aql || !schemaId;
|
|
192
|
+
const isEditingExistingTable = !!(initialParameters !== null && initialParameters !== void 0 && initialParameters.aql && initialParameters !== null && initialParameters !== void 0 && initialParameters.schemaId && initialParameters !== null && initialParameters !== void 0 && initialParameters.workspaceId);
|
|
192
193
|
const retrieveUrlForSmartCardRender = useCallback(() => {
|
|
193
194
|
var _data$key, _data$key$data;
|
|
194
195
|
const [data] = responseItems;
|
|
@@ -346,7 +347,7 @@ const PlainAssetsConfigModal = props => {
|
|
|
346
347
|
onClick: onInsertPressed,
|
|
347
348
|
isDisabled: isDisabled,
|
|
348
349
|
testId: 'assets-datasource-modal--insert-button'
|
|
349
|
-
}, jsx(FormattedMessage, _extends({}, modalMessages.insertIssuesButtonText, {
|
|
350
|
+
}, jsx(FormattedMessage, _extends({}, isEditingExistingTable ? modalMessages.updateObjectsButtonText : modalMessages.insertIssuesButtonText, {
|
|
350
351
|
values: {
|
|
351
352
|
objectsCount: responseItems.length
|
|
352
353
|
}
|
|
@@ -5,6 +5,11 @@ export const modalMessages = defineMessages({
|
|
|
5
5
|
description: 'Button text to close the modal with no changes being made',
|
|
6
6
|
defaultMessage: 'Cancel'
|
|
7
7
|
},
|
|
8
|
+
updateObjectsButtonText: {
|
|
9
|
+
id: 'linkDataSource.assets.configmodal.updateObjectsButtonText',
|
|
10
|
+
description: 'Button text to update the displayed content',
|
|
11
|
+
defaultMessage: 'Update table'
|
|
12
|
+
},
|
|
8
13
|
insertIssuesButtonText: {
|
|
9
14
|
id: 'linkDataSource.assets.configmodal.insertIssuesButtonText',
|
|
10
15
|
description: 'Button text to insert the displayed content',
|