@atlaskit/link-datasource 1.31.3 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +9 -0
- package/dist/cjs/ui/common/modal/display-view-dropdown/display-view-drop-down.js +21 -28
- package/dist/cjs/ui/common/modal/display-view-dropdown/messages.js +13 -42
- package/dist/cjs/ui/confluence-search-modal/modal/index.js +2 -2
- package/dist/cjs/ui/jira-issues-modal/modal/index.js +8 -8
- package/dist/es2019/ui/common/modal/display-view-dropdown/display-view-drop-down.js +21 -27
- package/dist/es2019/ui/common/modal/display-view-dropdown/messages.js +13 -42
- package/dist/es2019/ui/confluence-search-modal/modal/index.js +2 -2
- package/dist/es2019/ui/jira-issues-modal/modal/index.js +8 -8
- package/dist/esm/ui/common/modal/display-view-dropdown/display-view-drop-down.js +21 -27
- package/dist/esm/ui/common/modal/display-view-dropdown/messages.js +13 -42
- package/dist/esm/ui/confluence-search-modal/modal/index.js +2 -2
- package/dist/esm/ui/jira-issues-modal/modal/index.js +8 -8
- package/dist/types/common/types.d.ts +4 -5
- package/dist/types/ui/common/modal/display-view-dropdown/display-view-drop-down.d.ts +1 -1
- package/dist/types/ui/common/modal/display-view-dropdown/messages.d.ts +4 -24
- package/dist/types/ui/confluence-search-modal/basic-filters/filters/date-range-picker/PopupComponent.d.ts +1 -1
- package/dist/types-ts4.5/common/types.d.ts +4 -5
- package/dist/types-ts4.5/ui/common/modal/display-view-dropdown/display-view-drop-down.d.ts +1 -1
- package/dist/types-ts4.5/ui/common/modal/display-view-dropdown/messages.d.ts +4 -24
- package/dist/types-ts4.5/ui/confluence-search-modal/basic-filters/filters/date-range-picker/PopupComponent.d.ts +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# @atlaskit/link-datasource
|
|
2
2
|
|
|
3
|
+
## 2.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- [#93932](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/93932)
|
|
8
|
+
[`b42c3ca8a015`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/b42c3ca8a015) -
|
|
9
|
+
Removed Jira specific view modes "issue" and "count" from config modal. They are replaced with
|
|
10
|
+
generic view mode "table" and "inline" respectively.
|
|
11
|
+
|
|
3
12
|
## 1.31.3
|
|
4
13
|
|
|
5
14
|
### Patch Changes
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
3
|
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
@@ -9,7 +8,6 @@ exports.DisplayViewDropDown = void 0;
|
|
|
9
8
|
var _react = require("@emotion/react");
|
|
10
9
|
var _reactIntlNext = require("react-intl-next");
|
|
11
10
|
var _dropdownMenu = _interopRequireWildcard(require("@atlaskit/dropdown-menu"));
|
|
12
|
-
var _table = _interopRequireDefault(require("@atlaskit/icon/glyph/table"));
|
|
13
11
|
var _primitives = require("@atlaskit/primitives");
|
|
14
12
|
var _messages = require("./messages");
|
|
15
13
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
@@ -35,20 +33,25 @@ var InlineIcon = (0, _react.jsx)("svg", {
|
|
|
35
33
|
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
34
|
fill: 'currentColor'
|
|
37
35
|
}));
|
|
36
|
+
var ListIcon = (0, _react.jsx)("svg", {
|
|
37
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
38
|
+
width: "24",
|
|
39
|
+
height: "24",
|
|
40
|
+
viewBox: "0 0 15 15",
|
|
41
|
+
fill: "none"
|
|
42
|
+
}, (0, _react.jsx)("path", {
|
|
43
|
+
fillRule: "evenodd",
|
|
44
|
+
clipRule: "evenodd",
|
|
45
|
+
d: "M0 2C0 0.89543 0.895431 0 2 0H13C14.1046 0 15 0.895431 15 2V13C15 14.1046 14.1046 15 13 15H2C0.89543 15 0 14.1046 0 13V2ZM5 6C5 5.44772 5.44772 5 6 5L12 5C12.5523 5 13 5.44772 13 6C13 6.55229 12.5523 7 12 7L6 7C5.44772 7 5 6.55228 5 6ZM6 8C5.44772 8 5 8.44771 5 9C5 9.55228 5.44772 10 6 10L12 10C12.5523 10 13 9.55229 13 9C13 8.44772 12.5523 8 12 8L6 8ZM5 12C5 11.4477 5.44772 11 6 11L12 11C12.5523 11 13 11.4477 13 12C13 12.5523 12.5523 13 12 13L6 13C5.44772 13 5 12.5523 5 12ZM3 7C3.55228 7 4 6.55228 4 6C4 5.44772 3.55228 5 3 5C2.44772 5 2 5.44772 2 6C2 6.55228 2.44772 7 3 7ZM5 3C5 2.44772 5.44772 2 6 2L12 2C12.5523 2 13 2.44772 13 3C13 3.55229 12.5523 4 12 4L6 4C5.44772 4 5 3.55228 5 3ZM3 4C3.55228 4 4 3.55228 4 3C4 2.44772 3.55228 2 3 2C2.44772 2 2 2.44772 2 3C2 3.55228 2.44772 4 3 4ZM4 9C4 9.55229 3.55228 10 3 10C2.44772 10 2 9.55229 2 9C2 8.44771 2.44772 8 3 8C3.55228 8 4 8.44771 4 9ZM3 13C3.55228 13 4 12.5523 4 12C4 11.4477 3.55228 11 3 11C2.44772 11 2 11.4477 2 12C2 12.5523 2.44772 13 3 13Z",
|
|
46
|
+
fill: 'currentColor'
|
|
47
|
+
}));
|
|
38
48
|
var DisplayViewDropDown = exports.DisplayViewDropDown = function DisplayViewDropDown(_ref) {
|
|
39
49
|
var onViewModeChange = _ref.onViewModeChange,
|
|
40
50
|
viewMode = _ref.viewMode;
|
|
41
51
|
var _useIntl = (0, _reactIntlNext.useIntl)(),
|
|
42
52
|
formatMessage = _useIntl.formatMessage;
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
var isJira = viewMode === 'issue' || viewMode === 'count';
|
|
46
|
-
var isTable = viewMode === 'table' || viewMode === 'issue';
|
|
47
|
-
var triggerText = isTable ? formatMessage(
|
|
48
|
-
// TODO EDM-9573, remove once EDM-9431 is merged
|
|
49
|
-
isJira ? _messages.displayViewDropDownMessages.tableViewModeLabel : _messages.displayViewDropDownMessages.tableViewModeLabelDuplicate) : formatMessage(
|
|
50
|
-
// TODO EDM-9573, remove once EDM-9431 is merged
|
|
51
|
-
isJira ? _messages.displayViewDropDownMessages.inlineLinkViewModeLabel : _messages.displayViewDropDownMessages.inlineLinkViewModeLabelDuplicate);
|
|
53
|
+
var isTable = viewMode === 'table';
|
|
54
|
+
var triggerText = isTable ? formatMessage(_messages.displayViewDropDownMessages.viewModeListLabel) : formatMessage(_messages.displayViewDropDownMessages.viewModeInlineLinkLabel);
|
|
52
55
|
return (0, _react.jsx)(_dropdownMenu.default, {
|
|
53
56
|
trigger: triggerText,
|
|
54
57
|
testId: "datasource-modal--view-drop-down"
|
|
@@ -57,28 +60,18 @@ var DisplayViewDropDown = exports.DisplayViewDropDown = function DisplayViewDrop
|
|
|
57
60
|
}, (0, _react.jsx)(_dropdownMenu.DropdownItemGroup, null, (0, _react.jsx)(_dropdownMenu.DropdownItem, {
|
|
58
61
|
testId: "dropdown-item-table",
|
|
59
62
|
onClick: function onClick() {
|
|
60
|
-
return onViewModeChange(
|
|
63
|
+
return onViewModeChange('table');
|
|
61
64
|
},
|
|
62
65
|
isSelected: isTable,
|
|
63
|
-
description: formatMessage(
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
elemBefore: (0, _react.jsx)(_table.default, {
|
|
67
|
-
label: "table icon"
|
|
68
|
-
})
|
|
69
|
-
}, (0, _react.jsx)(_reactIntlNext.FormattedMessage
|
|
70
|
-
// TODO EDM-9573, remove once EDM-9431 is merged
|
|
71
|
-
, isJira ? _messages.displayViewDropDownMessages.tableViewModeLabel : _messages.displayViewDropDownMessages.tableViewModeLabelDuplicate)), (0, _react.jsx)(_dropdownMenu.DropdownItem, {
|
|
66
|
+
description: formatMessage(_messages.displayViewDropDownMessages.viewModeListDescription),
|
|
67
|
+
elemBefore: ListIcon
|
|
68
|
+
}, (0, _react.jsx)(_reactIntlNext.FormattedMessage, _messages.displayViewDropDownMessages.viewModeListLabel)), (0, _react.jsx)(_dropdownMenu.DropdownItem, {
|
|
72
69
|
testId: "dropdown-item-inline-link",
|
|
73
70
|
onClick: function onClick() {
|
|
74
|
-
return onViewModeChange(
|
|
71
|
+
return onViewModeChange('inline');
|
|
75
72
|
},
|
|
76
73
|
isSelected: !isTable,
|
|
77
|
-
description: formatMessage(
|
|
78
|
-
// TODO EDM-9573, remove once EDM-9431 is merged
|
|
79
|
-
isJira ? _messages.displayViewDropDownMessages.inlineLinkViewModeDescription : _messages.displayViewDropDownMessages.inlineLinkViewModeDescriptionDuplicate),
|
|
74
|
+
description: formatMessage(_messages.displayViewDropDownMessages.viewModeInlineLinkDescription),
|
|
80
75
|
elemBefore: InlineIcon
|
|
81
|
-
}, (0, _react.jsx)(_reactIntlNext.FormattedMessage
|
|
82
|
-
// TODO EDM-9573, remove once EDM-9431 is merged
|
|
83
|
-
, isJira ? _messages.displayViewDropDownMessages.inlineLinkViewModeLabel : _messages.displayViewDropDownMessages.inlineLinkViewModeLabelDuplicate)))));
|
|
76
|
+
}, (0, _react.jsx)(_reactIntlNext.FormattedMessage, _messages.displayViewDropDownMessages.viewModeInlineLinkLabel)))));
|
|
84
77
|
};
|
|
@@ -6,53 +6,24 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.displayViewDropDownMessages = void 0;
|
|
7
7
|
var _reactIntlNext = require("react-intl-next");
|
|
8
8
|
var displayViewDropDownMessages = exports.displayViewDropDownMessages = (0, _reactIntlNext.defineMessages)({
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
description: 'Display search results as a table',
|
|
14
|
-
defaultMessage: 'Table'
|
|
9
|
+
viewModeListLabel: {
|
|
10
|
+
id: 'linkDataSource.jira-issues.configmodal.viewModeListLabel',
|
|
11
|
+
description: 'Display search results as a list',
|
|
12
|
+
defaultMessage: 'List'
|
|
15
13
|
},
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
defaultMessage: 'Display search results as a table'
|
|
14
|
+
viewModeListDescription: {
|
|
15
|
+
id: 'linkDataSource.jira-issues.configmodal.viewModeListDescription',
|
|
16
|
+
description: 'Description for list view mode',
|
|
17
|
+
defaultMessage: 'Display search results as a list'
|
|
21
18
|
},
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
id: 'linkDataSource.configmodal.inlineLinkViewModeLabel',
|
|
19
|
+
viewModeInlineLinkLabel: {
|
|
20
|
+
id: 'linkDataSource.jira-issues.configmodal.viewModeInlineLinkLabel',
|
|
25
21
|
description: 'Display the number of search results as an inline smart link',
|
|
26
22
|
defaultMessage: 'Inline link'
|
|
27
23
|
},
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
id: 'linkDataSource.configmodal.inlineLinkViewModeDescription',
|
|
31
|
-
description: 'Description for inline view mode',
|
|
32
|
-
defaultMessage: 'Display the number of search results or as an inline smart link'
|
|
33
|
-
},
|
|
34
|
-
// delete once EDM-9431 is merged
|
|
35
|
-
tableViewModeLabel: {
|
|
36
|
-
id: 'linkDataSource.jira-issues.configmodal.tableViewModeLabel',
|
|
37
|
-
description: 'Display Jira search results as a table',
|
|
38
|
-
defaultMessage: 'Table'
|
|
39
|
-
},
|
|
40
|
-
// delete once EDM-9431 is merged
|
|
41
|
-
tableViewModeDescription: {
|
|
42
|
-
id: 'linkDataSource.jira-issues.configmodal.tableViewModeDescription',
|
|
43
|
-
description: 'Description for table view mode',
|
|
44
|
-
defaultMessage: 'Display Jira search results as a table'
|
|
45
|
-
},
|
|
46
|
-
// delete once EDM-9431 is merged
|
|
47
|
-
inlineLinkViewModeLabel: {
|
|
48
|
-
id: 'linkDataSource.jira-issues.configmodal.inlineLinkViewModeLabel',
|
|
49
|
-
description: 'Display the number of search results as an inline smart link',
|
|
50
|
-
defaultMessage: 'Inline link'
|
|
51
|
-
},
|
|
52
|
-
// delete once EDM-9431 is merged
|
|
53
|
-
inlineLinkViewModeDescription: {
|
|
54
|
-
id: 'linkDataSource.jira-issues.configmodal.inlineLinkViewModeDescription',
|
|
24
|
+
viewModeInlineLinkDescription: {
|
|
25
|
+
id: 'linkDataSource.jira-issues.configmodal.viewModeInlineLinkDescription',
|
|
55
26
|
description: 'Description for inline link view mode',
|
|
56
|
-
defaultMessage: 'Display the number of search results
|
|
27
|
+
defaultMessage: 'Display the number of search results as an inline Smart Link'
|
|
57
28
|
}
|
|
58
29
|
});
|
|
@@ -357,8 +357,8 @@ var PlainConfluenceSearchConfigModal = exports.PlainConfluenceSearchConfigModal
|
|
|
357
357
|
}, [analyticsPayload, fireEvent, totalCount, isDataReady]);
|
|
358
358
|
(0, _react.useEffect)(function () {
|
|
359
359
|
var isResolved = status === 'resolved';
|
|
360
|
-
var isTableViewMode = currentViewMode === '
|
|
361
|
-
var isInlineViewMode = currentViewMode === '
|
|
360
|
+
var isTableViewMode = currentViewMode === 'table';
|
|
361
|
+
var isInlineViewMode = currentViewMode === 'inline';
|
|
362
362
|
if (!isResolved) {
|
|
363
363
|
return;
|
|
364
364
|
}
|
|
@@ -62,7 +62,7 @@ var issueCountStyles = (0, _react2.css)({
|
|
|
62
62
|
fontWeight: 600
|
|
63
63
|
});
|
|
64
64
|
var getDisplayValue = function getDisplayValue(currentViewMode, itemCount) {
|
|
65
|
-
if (currentViewMode === '
|
|
65
|
+
if (currentViewMode === 'table') {
|
|
66
66
|
return _types.DatasourceDisplay.DATASOURCE_TABLE;
|
|
67
67
|
}
|
|
68
68
|
return itemCount === 1 ? _types.DatasourceDisplay.INLINE : _types.DatasourceDisplay.DATASOURCE_INLINE;
|
|
@@ -91,7 +91,7 @@ var PlainJiraIssuesConfigModal = exports.PlainJiraIssuesConfigModal = function P
|
|
|
91
91
|
onCancel = props.onCancel,
|
|
92
92
|
onInsert = props.onInsert,
|
|
93
93
|
_props$viewMode = props.viewMode,
|
|
94
|
-
viewMode = _props$viewMode === void 0 ? '
|
|
94
|
+
viewMode = _props$viewMode === void 0 ? 'table' : _props$viewMode,
|
|
95
95
|
initialParameters = props.parameters,
|
|
96
96
|
urlBeingEdited = props.url,
|
|
97
97
|
initialVisibleColumnKeys = props.visibleColumnKeys;
|
|
@@ -204,7 +204,7 @@ var PlainJiraIssuesConfigModal = exports.PlainJiraIssuesConfigModal = function P
|
|
|
204
204
|
var resolvedWithNoResults = status === 'resolved' && !responseItems.length;
|
|
205
205
|
var jqlUrl = selectedJiraSite && jql && "".concat(selectedJiraSite.url, "/issues/?jql=").concat(encodeURI(jql));
|
|
206
206
|
var isInsertDisabled = !isParametersSet || status === 'rejected' || status === 'unauthorized' || status === 'loading';
|
|
207
|
-
var shouldShowIssueCount = !!totalCount && totalCount !== 1 && currentViewMode === '
|
|
207
|
+
var shouldShowIssueCount = !!totalCount && totalCount !== 1 && currentViewMode === 'table';
|
|
208
208
|
var isDataReady = (visibleColumnKeys || []).length > 0;
|
|
209
209
|
var hasNoJiraSites = availableSites && availableSites.length === 0;
|
|
210
210
|
(0, _react.useEffect)(function () {
|
|
@@ -219,7 +219,7 @@ var PlainJiraIssuesConfigModal = exports.PlainJiraIssuesConfigModal = function P
|
|
|
219
219
|
status: status,
|
|
220
220
|
experienceId: modalRenderInstanceId,
|
|
221
221
|
itemCount: responseItems.length,
|
|
222
|
-
canBeLink: currentViewMode === '
|
|
222
|
+
canBeLink: currentViewMode === 'inline',
|
|
223
223
|
extensionKey: extensionKey
|
|
224
224
|
});
|
|
225
225
|
(0, _react.useEffect)(function () {
|
|
@@ -298,8 +298,8 @@ var PlainJiraIssuesConfigModal = exports.PlainJiraIssuesConfigModal = function P
|
|
|
298
298
|
}, [fireSingleItemViewedEvent, fireTableViewedEvent, totalCount]);
|
|
299
299
|
(0, _react.useEffect)(function () {
|
|
300
300
|
var isResolved = status === 'resolved';
|
|
301
|
-
var isIssueViewMode = currentViewMode === '
|
|
302
|
-
var isCountViewMode = currentViewMode === '
|
|
301
|
+
var isIssueViewMode = currentViewMode === 'table';
|
|
302
|
+
var isCountViewMode = currentViewMode === 'inline';
|
|
303
303
|
if (!isResolved) {
|
|
304
304
|
return;
|
|
305
305
|
}
|
|
@@ -388,7 +388,7 @@ var PlainJiraIssuesConfigModal = exports.PlainJiraIssuesConfigModal = function P
|
|
|
388
388
|
var consumerEvent = (_insertButtonClickedE = insertButtonClickedEvent.clone()) !== null && _insertButtonClickedE !== void 0 ? _insertButtonClickedE : undefined;
|
|
389
389
|
insertButtonClickedEvent.fire(_analytics.EVENT_CHANNEL);
|
|
390
390
|
var firstIssueUrl = retrieveUrlForSmartCardRender();
|
|
391
|
-
if (currentViewMode === '
|
|
391
|
+
if (currentViewMode === 'inline') {
|
|
392
392
|
macroInsertedEvent === null || macroInsertedEvent === void 0 || macroInsertedEvent.fire(_analytics.EVENT_CHANNEL);
|
|
393
393
|
var url = responseItems.length === 1 ? firstIssueUrl : upToDateJqlUrl;
|
|
394
394
|
onInsert({
|
|
@@ -554,7 +554,7 @@ var PlainJiraIssuesConfigModal = exports.PlainJiraIssuesConfigModal = function P
|
|
|
554
554
|
initialSearchMethod: initialSearchMethod,
|
|
555
555
|
onSearchMethodChange: setCurrentSearchMethod,
|
|
556
556
|
site: selectedJiraSite
|
|
557
|
-
}), currentViewMode === '
|
|
557
|
+
}), currentViewMode === 'inline' ? renderCountModeContent() : renderIssuesModeContent()) : (0, _react2.jsx)(_noInstances.NoInstancesView, {
|
|
558
558
|
title: _messages.loadingErrorMessages.noAccessToJiraSitesTitle,
|
|
559
559
|
description: _messages.loadingErrorMessages.noAccessToJiraSitesDescription,
|
|
560
560
|
testId: "no-jira-instances-content"
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
import { jsx } from '@emotion/react';
|
|
3
3
|
import { FormattedMessage, useIntl } from 'react-intl-next';
|
|
4
4
|
import DropdownMenu, { DropdownItem, DropdownItemGroup } from '@atlaskit/dropdown-menu';
|
|
5
|
-
import TableIcon from '@atlaskit/icon/glyph/table';
|
|
6
5
|
import { Box, xcss } from '@atlaskit/primitives';
|
|
7
6
|
import { displayViewDropDownMessages } from './messages';
|
|
8
7
|
const dropDownItemGroupStyles = xcss({
|
|
@@ -24,6 +23,18 @@ const InlineIcon = jsx("svg", {
|
|
|
24
23
|
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",
|
|
25
24
|
fill: 'currentColor'
|
|
26
25
|
}));
|
|
26
|
+
const ListIcon = jsx("svg", {
|
|
27
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
28
|
+
width: "24",
|
|
29
|
+
height: "24",
|
|
30
|
+
viewBox: "0 0 15 15",
|
|
31
|
+
fill: "none"
|
|
32
|
+
}, jsx("path", {
|
|
33
|
+
fillRule: "evenodd",
|
|
34
|
+
clipRule: "evenodd",
|
|
35
|
+
d: "M0 2C0 0.89543 0.895431 0 2 0H13C14.1046 0 15 0.895431 15 2V13C15 14.1046 14.1046 15 13 15H2C0.89543 15 0 14.1046 0 13V2ZM5 6C5 5.44772 5.44772 5 6 5L12 5C12.5523 5 13 5.44772 13 6C13 6.55229 12.5523 7 12 7L6 7C5.44772 7 5 6.55228 5 6ZM6 8C5.44772 8 5 8.44771 5 9C5 9.55228 5.44772 10 6 10L12 10C12.5523 10 13 9.55229 13 9C13 8.44772 12.5523 8 12 8L6 8ZM5 12C5 11.4477 5.44772 11 6 11L12 11C12.5523 11 13 11.4477 13 12C13 12.5523 12.5523 13 12 13L6 13C5.44772 13 5 12.5523 5 12ZM3 7C3.55228 7 4 6.55228 4 6C4 5.44772 3.55228 5 3 5C2.44772 5 2 5.44772 2 6C2 6.55228 2.44772 7 3 7ZM5 3C5 2.44772 5.44772 2 6 2L12 2C12.5523 2 13 2.44772 13 3C13 3.55229 12.5523 4 12 4L6 4C5.44772 4 5 3.55228 5 3ZM3 4C3.55228 4 4 3.55228 4 3C4 2.44772 3.55228 2 3 2C2.44772 2 2 2.44772 2 3C2 3.55228 2.44772 4 3 4ZM4 9C4 9.55229 3.55228 10 3 10C2.44772 10 2 9.55229 2 9C2 8.44771 2.44772 8 3 8C3.55228 8 4 8.44771 4 9ZM3 13C3.55228 13 4 12.5523 4 12C4 11.4477 3.55228 11 3 11C2.44772 11 2 11.4477 2 12C2 12.5523 2.44772 13 3 13Z",
|
|
36
|
+
fill: 'currentColor'
|
|
37
|
+
}));
|
|
27
38
|
export const DisplayViewDropDown = ({
|
|
28
39
|
onViewModeChange,
|
|
29
40
|
viewMode
|
|
@@ -31,15 +42,8 @@ export const DisplayViewDropDown = ({
|
|
|
31
42
|
const {
|
|
32
43
|
formatMessage
|
|
33
44
|
} = useIntl();
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
const isJira = viewMode === 'issue' || viewMode === 'count';
|
|
37
|
-
const isTable = viewMode === 'table' || viewMode === 'issue';
|
|
38
|
-
const triggerText = isTable ? formatMessage(
|
|
39
|
-
// TODO EDM-9573, remove once EDM-9431 is merged
|
|
40
|
-
isJira ? displayViewDropDownMessages.tableViewModeLabel : displayViewDropDownMessages.tableViewModeLabelDuplicate) : formatMessage(
|
|
41
|
-
// TODO EDM-9573, remove once EDM-9431 is merged
|
|
42
|
-
isJira ? displayViewDropDownMessages.inlineLinkViewModeLabel : displayViewDropDownMessages.inlineLinkViewModeLabelDuplicate);
|
|
45
|
+
const isTable = viewMode === 'table';
|
|
46
|
+
const triggerText = isTable ? formatMessage(displayViewDropDownMessages.viewModeListLabel) : formatMessage(displayViewDropDownMessages.viewModeInlineLinkLabel);
|
|
43
47
|
return jsx(DropdownMenu, {
|
|
44
48
|
trigger: triggerText,
|
|
45
49
|
testId: "datasource-modal--view-drop-down"
|
|
@@ -47,25 +51,15 @@ export const DisplayViewDropDown = ({
|
|
|
47
51
|
xcss: dropDownItemGroupStyles
|
|
48
52
|
}, jsx(DropdownItemGroup, null, jsx(DropdownItem, {
|
|
49
53
|
testId: "dropdown-item-table",
|
|
50
|
-
onClick: () => onViewModeChange(
|
|
54
|
+
onClick: () => onViewModeChange('table'),
|
|
51
55
|
isSelected: isTable,
|
|
52
|
-
description: formatMessage(
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
elemBefore: jsx(TableIcon, {
|
|
56
|
-
label: "table icon"
|
|
57
|
-
})
|
|
58
|
-
}, jsx(FormattedMessage
|
|
59
|
-
// TODO EDM-9573, remove once EDM-9431 is merged
|
|
60
|
-
, isJira ? displayViewDropDownMessages.tableViewModeLabel : displayViewDropDownMessages.tableViewModeLabelDuplicate)), jsx(DropdownItem, {
|
|
56
|
+
description: formatMessage(displayViewDropDownMessages.viewModeListDescription),
|
|
57
|
+
elemBefore: ListIcon
|
|
58
|
+
}, jsx(FormattedMessage, displayViewDropDownMessages.viewModeListLabel)), jsx(DropdownItem, {
|
|
61
59
|
testId: "dropdown-item-inline-link",
|
|
62
|
-
onClick: () => onViewModeChange(
|
|
60
|
+
onClick: () => onViewModeChange('inline'),
|
|
63
61
|
isSelected: !isTable,
|
|
64
|
-
description: formatMessage(
|
|
65
|
-
// TODO EDM-9573, remove once EDM-9431 is merged
|
|
66
|
-
isJira ? displayViewDropDownMessages.inlineLinkViewModeDescription : displayViewDropDownMessages.inlineLinkViewModeDescriptionDuplicate),
|
|
62
|
+
description: formatMessage(displayViewDropDownMessages.viewModeInlineLinkDescription),
|
|
67
63
|
elemBefore: InlineIcon
|
|
68
|
-
}, jsx(FormattedMessage
|
|
69
|
-
// TODO EDM-9573, remove once EDM-9431 is merged
|
|
70
|
-
, isJira ? displayViewDropDownMessages.inlineLinkViewModeLabel : displayViewDropDownMessages.inlineLinkViewModeLabelDuplicate)))));
|
|
64
|
+
}, jsx(FormattedMessage, displayViewDropDownMessages.viewModeInlineLinkLabel)))));
|
|
71
65
|
};
|
|
@@ -1,52 +1,23 @@
|
|
|
1
1
|
import { defineMessages } from 'react-intl-next';
|
|
2
2
|
export const displayViewDropDownMessages = defineMessages({
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
description: 'Display search results as a table',
|
|
8
|
-
defaultMessage: 'Table'
|
|
3
|
+
viewModeListLabel: {
|
|
4
|
+
id: 'linkDataSource.jira-issues.configmodal.viewModeListLabel',
|
|
5
|
+
description: 'Display search results as a list',
|
|
6
|
+
defaultMessage: 'List'
|
|
9
7
|
},
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
defaultMessage: 'Display search results as a table'
|
|
8
|
+
viewModeListDescription: {
|
|
9
|
+
id: 'linkDataSource.jira-issues.configmodal.viewModeListDescription',
|
|
10
|
+
description: 'Description for list view mode',
|
|
11
|
+
defaultMessage: 'Display search results as a list'
|
|
15
12
|
},
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
id: 'linkDataSource.configmodal.inlineLinkViewModeLabel',
|
|
13
|
+
viewModeInlineLinkLabel: {
|
|
14
|
+
id: 'linkDataSource.jira-issues.configmodal.viewModeInlineLinkLabel',
|
|
19
15
|
description: 'Display the number of search results as an inline smart link',
|
|
20
16
|
defaultMessage: 'Inline link'
|
|
21
17
|
},
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
id: 'linkDataSource.configmodal.inlineLinkViewModeDescription',
|
|
25
|
-
description: 'Description for inline view mode',
|
|
26
|
-
defaultMessage: 'Display the number of search results or as an inline smart link'
|
|
27
|
-
},
|
|
28
|
-
// delete once EDM-9431 is merged
|
|
29
|
-
tableViewModeLabel: {
|
|
30
|
-
id: 'linkDataSource.jira-issues.configmodal.tableViewModeLabel',
|
|
31
|
-
description: 'Display Jira search results as a table',
|
|
32
|
-
defaultMessage: 'Table'
|
|
33
|
-
},
|
|
34
|
-
// delete once EDM-9431 is merged
|
|
35
|
-
tableViewModeDescription: {
|
|
36
|
-
id: 'linkDataSource.jira-issues.configmodal.tableViewModeDescription',
|
|
37
|
-
description: 'Description for table view mode',
|
|
38
|
-
defaultMessage: 'Display Jira search results as a table'
|
|
39
|
-
},
|
|
40
|
-
// delete once EDM-9431 is merged
|
|
41
|
-
inlineLinkViewModeLabel: {
|
|
42
|
-
id: 'linkDataSource.jira-issues.configmodal.inlineLinkViewModeLabel',
|
|
43
|
-
description: 'Display the number of search results as an inline smart link',
|
|
44
|
-
defaultMessage: 'Inline link'
|
|
45
|
-
},
|
|
46
|
-
// delete once EDM-9431 is merged
|
|
47
|
-
inlineLinkViewModeDescription: {
|
|
48
|
-
id: 'linkDataSource.jira-issues.configmodal.inlineLinkViewModeDescription',
|
|
18
|
+
viewModeInlineLinkDescription: {
|
|
19
|
+
id: 'linkDataSource.jira-issues.configmodal.viewModeInlineLinkDescription',
|
|
49
20
|
description: 'Description for inline link view mode',
|
|
50
|
-
defaultMessage: 'Display the number of search results
|
|
21
|
+
defaultMessage: 'Display the number of search results as an inline Smart Link'
|
|
51
22
|
}
|
|
52
23
|
});
|
|
@@ -293,8 +293,8 @@ export const PlainConfluenceSearchConfigModal = props => {
|
|
|
293
293
|
}, [analyticsPayload, fireEvent, totalCount, isDataReady]);
|
|
294
294
|
useEffect(() => {
|
|
295
295
|
const isResolved = status === 'resolved';
|
|
296
|
-
const isTableViewMode = currentViewMode === '
|
|
297
|
-
const isInlineViewMode = currentViewMode === '
|
|
296
|
+
const isTableViewMode = currentViewMode === 'table';
|
|
297
|
+
const isInlineViewMode = currentViewMode === 'inline';
|
|
298
298
|
if (!isResolved) {
|
|
299
299
|
return;
|
|
300
300
|
}
|
|
@@ -46,7 +46,7 @@ const issueCountStyles = css({
|
|
|
46
46
|
fontWeight: 600
|
|
47
47
|
});
|
|
48
48
|
const getDisplayValue = (currentViewMode, itemCount) => {
|
|
49
|
-
if (currentViewMode === '
|
|
49
|
+
if (currentViewMode === 'table') {
|
|
50
50
|
return DatasourceDisplay.DATASOURCE_TABLE;
|
|
51
51
|
}
|
|
52
52
|
return itemCount === 1 ? DatasourceDisplay.INLINE : DatasourceDisplay.DATASOURCE_INLINE;
|
|
@@ -75,7 +75,7 @@ export const PlainJiraIssuesConfigModal = props => {
|
|
|
75
75
|
wrappedColumnKeys: initialWrappedColumnKeys,
|
|
76
76
|
onCancel,
|
|
77
77
|
onInsert,
|
|
78
|
-
viewMode = '
|
|
78
|
+
viewMode = 'table',
|
|
79
79
|
parameters: initialParameters,
|
|
80
80
|
url: urlBeingEdited,
|
|
81
81
|
visibleColumnKeys: initialVisibleColumnKeys
|
|
@@ -159,7 +159,7 @@ export const PlainJiraIssuesConfigModal = props => {
|
|
|
159
159
|
const resolvedWithNoResults = status === 'resolved' && !responseItems.length;
|
|
160
160
|
const jqlUrl = selectedJiraSite && jql && `${selectedJiraSite.url}/issues/?jql=${encodeURI(jql)}`;
|
|
161
161
|
const isInsertDisabled = !isParametersSet || status === 'rejected' || status === 'unauthorized' || status === 'loading';
|
|
162
|
-
const shouldShowIssueCount = !!totalCount && totalCount !== 1 && currentViewMode === '
|
|
162
|
+
const shouldShowIssueCount = !!totalCount && totalCount !== 1 && currentViewMode === 'table';
|
|
163
163
|
const isDataReady = (visibleColumnKeys || []).length > 0;
|
|
164
164
|
const hasNoJiraSites = availableSites && availableSites.length === 0;
|
|
165
165
|
useEffect(() => {
|
|
@@ -174,7 +174,7 @@ export const PlainJiraIssuesConfigModal = props => {
|
|
|
174
174
|
status,
|
|
175
175
|
experienceId: modalRenderInstanceId,
|
|
176
176
|
itemCount: responseItems.length,
|
|
177
|
-
canBeLink: currentViewMode === '
|
|
177
|
+
canBeLink: currentViewMode === 'inline',
|
|
178
178
|
extensionKey
|
|
179
179
|
});
|
|
180
180
|
useEffect(() => {
|
|
@@ -237,8 +237,8 @@ export const PlainJiraIssuesConfigModal = props => {
|
|
|
237
237
|
}, [fireSingleItemViewedEvent, fireTableViewedEvent, totalCount]);
|
|
238
238
|
useEffect(() => {
|
|
239
239
|
const isResolved = status === 'resolved';
|
|
240
|
-
const isIssueViewMode = currentViewMode === '
|
|
241
|
-
const isCountViewMode = currentViewMode === '
|
|
240
|
+
const isIssueViewMode = currentViewMode === 'table';
|
|
241
|
+
const isCountViewMode = currentViewMode === 'inline';
|
|
242
242
|
if (!isResolved) {
|
|
243
243
|
return;
|
|
244
244
|
}
|
|
@@ -335,7 +335,7 @@ export const PlainJiraIssuesConfigModal = props => {
|
|
|
335
335
|
const consumerEvent = (_insertButtonClickedE = insertButtonClickedEvent.clone()) !== null && _insertButtonClickedE !== void 0 ? _insertButtonClickedE : undefined;
|
|
336
336
|
insertButtonClickedEvent.fire(EVENT_CHANNEL);
|
|
337
337
|
const firstIssueUrl = retrieveUrlForSmartCardRender();
|
|
338
|
-
if (currentViewMode === '
|
|
338
|
+
if (currentViewMode === 'inline') {
|
|
339
339
|
macroInsertedEvent === null || macroInsertedEvent === void 0 ? void 0 : macroInsertedEvent.fire(EVENT_CHANNEL);
|
|
340
340
|
const url = responseItems.length === 1 ? firstIssueUrl : upToDateJqlUrl;
|
|
341
341
|
onInsert({
|
|
@@ -498,7 +498,7 @@ export const PlainJiraIssuesConfigModal = props => {
|
|
|
498
498
|
initialSearchMethod: initialSearchMethod,
|
|
499
499
|
onSearchMethodChange: setCurrentSearchMethod,
|
|
500
500
|
site: selectedJiraSite
|
|
501
|
-
}), currentViewMode === '
|
|
501
|
+
}), currentViewMode === 'inline' ? renderCountModeContent() : renderIssuesModeContent()) : jsx(NoInstancesView, {
|
|
502
502
|
title: loadingErrorMessages.noAccessToJiraSitesTitle,
|
|
503
503
|
description: loadingErrorMessages.noAccessToJiraSitesDescription,
|
|
504
504
|
testId: `no-jira-instances-content`
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
import { jsx } from '@emotion/react';
|
|
3
3
|
import { FormattedMessage, useIntl } from 'react-intl-next';
|
|
4
4
|
import DropdownMenu, { DropdownItem, DropdownItemGroup } from '@atlaskit/dropdown-menu';
|
|
5
|
-
import TableIcon from '@atlaskit/icon/glyph/table';
|
|
6
5
|
import { Box, xcss } from '@atlaskit/primitives';
|
|
7
6
|
import { displayViewDropDownMessages } from './messages';
|
|
8
7
|
var dropDownItemGroupStyles = xcss({
|
|
@@ -24,20 +23,25 @@ var InlineIcon = jsx("svg", {
|
|
|
24
23
|
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",
|
|
25
24
|
fill: 'currentColor'
|
|
26
25
|
}));
|
|
26
|
+
var ListIcon = jsx("svg", {
|
|
27
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
28
|
+
width: "24",
|
|
29
|
+
height: "24",
|
|
30
|
+
viewBox: "0 0 15 15",
|
|
31
|
+
fill: "none"
|
|
32
|
+
}, jsx("path", {
|
|
33
|
+
fillRule: "evenodd",
|
|
34
|
+
clipRule: "evenodd",
|
|
35
|
+
d: "M0 2C0 0.89543 0.895431 0 2 0H13C14.1046 0 15 0.895431 15 2V13C15 14.1046 14.1046 15 13 15H2C0.89543 15 0 14.1046 0 13V2ZM5 6C5 5.44772 5.44772 5 6 5L12 5C12.5523 5 13 5.44772 13 6C13 6.55229 12.5523 7 12 7L6 7C5.44772 7 5 6.55228 5 6ZM6 8C5.44772 8 5 8.44771 5 9C5 9.55228 5.44772 10 6 10L12 10C12.5523 10 13 9.55229 13 9C13 8.44772 12.5523 8 12 8L6 8ZM5 12C5 11.4477 5.44772 11 6 11L12 11C12.5523 11 13 11.4477 13 12C13 12.5523 12.5523 13 12 13L6 13C5.44772 13 5 12.5523 5 12ZM3 7C3.55228 7 4 6.55228 4 6C4 5.44772 3.55228 5 3 5C2.44772 5 2 5.44772 2 6C2 6.55228 2.44772 7 3 7ZM5 3C5 2.44772 5.44772 2 6 2L12 2C12.5523 2 13 2.44772 13 3C13 3.55229 12.5523 4 12 4L6 4C5.44772 4 5 3.55228 5 3ZM3 4C3.55228 4 4 3.55228 4 3C4 2.44772 3.55228 2 3 2C2.44772 2 2 2.44772 2 3C2 3.55228 2.44772 4 3 4ZM4 9C4 9.55229 3.55228 10 3 10C2.44772 10 2 9.55229 2 9C2 8.44771 2.44772 8 3 8C3.55228 8 4 8.44771 4 9ZM3 13C3.55228 13 4 12.5523 4 12C4 11.4477 3.55228 11 3 11C2.44772 11 2 11.4477 2 12C2 12.5523 2.44772 13 3 13Z",
|
|
36
|
+
fill: 'currentColor'
|
|
37
|
+
}));
|
|
27
38
|
export var DisplayViewDropDown = function DisplayViewDropDown(_ref) {
|
|
28
39
|
var onViewModeChange = _ref.onViewModeChange,
|
|
29
40
|
viewMode = _ref.viewMode;
|
|
30
41
|
var _useIntl = useIntl(),
|
|
31
42
|
formatMessage = _useIntl.formatMessage;
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
var isJira = viewMode === 'issue' || viewMode === 'count';
|
|
35
|
-
var isTable = viewMode === 'table' || viewMode === 'issue';
|
|
36
|
-
var triggerText = isTable ? formatMessage(
|
|
37
|
-
// TODO EDM-9573, remove once EDM-9431 is merged
|
|
38
|
-
isJira ? displayViewDropDownMessages.tableViewModeLabel : displayViewDropDownMessages.tableViewModeLabelDuplicate) : formatMessage(
|
|
39
|
-
// TODO EDM-9573, remove once EDM-9431 is merged
|
|
40
|
-
isJira ? displayViewDropDownMessages.inlineLinkViewModeLabel : displayViewDropDownMessages.inlineLinkViewModeLabelDuplicate);
|
|
43
|
+
var isTable = viewMode === 'table';
|
|
44
|
+
var triggerText = isTable ? formatMessage(displayViewDropDownMessages.viewModeListLabel) : formatMessage(displayViewDropDownMessages.viewModeInlineLinkLabel);
|
|
41
45
|
return jsx(DropdownMenu, {
|
|
42
46
|
trigger: triggerText,
|
|
43
47
|
testId: "datasource-modal--view-drop-down"
|
|
@@ -46,28 +50,18 @@ export var DisplayViewDropDown = function DisplayViewDropDown(_ref) {
|
|
|
46
50
|
}, jsx(DropdownItemGroup, null, jsx(DropdownItem, {
|
|
47
51
|
testId: "dropdown-item-table",
|
|
48
52
|
onClick: function onClick() {
|
|
49
|
-
return onViewModeChange(
|
|
53
|
+
return onViewModeChange('table');
|
|
50
54
|
},
|
|
51
55
|
isSelected: isTable,
|
|
52
|
-
description: formatMessage(
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
elemBefore: jsx(TableIcon, {
|
|
56
|
-
label: "table icon"
|
|
57
|
-
})
|
|
58
|
-
}, jsx(FormattedMessage
|
|
59
|
-
// TODO EDM-9573, remove once EDM-9431 is merged
|
|
60
|
-
, isJira ? displayViewDropDownMessages.tableViewModeLabel : displayViewDropDownMessages.tableViewModeLabelDuplicate)), jsx(DropdownItem, {
|
|
56
|
+
description: formatMessage(displayViewDropDownMessages.viewModeListDescription),
|
|
57
|
+
elemBefore: ListIcon
|
|
58
|
+
}, jsx(FormattedMessage, displayViewDropDownMessages.viewModeListLabel)), jsx(DropdownItem, {
|
|
61
59
|
testId: "dropdown-item-inline-link",
|
|
62
60
|
onClick: function onClick() {
|
|
63
|
-
return onViewModeChange(
|
|
61
|
+
return onViewModeChange('inline');
|
|
64
62
|
},
|
|
65
63
|
isSelected: !isTable,
|
|
66
|
-
description: formatMessage(
|
|
67
|
-
// TODO EDM-9573, remove once EDM-9431 is merged
|
|
68
|
-
isJira ? displayViewDropDownMessages.inlineLinkViewModeDescription : displayViewDropDownMessages.inlineLinkViewModeDescriptionDuplicate),
|
|
64
|
+
description: formatMessage(displayViewDropDownMessages.viewModeInlineLinkDescription),
|
|
69
65
|
elemBefore: InlineIcon
|
|
70
|
-
}, jsx(FormattedMessage
|
|
71
|
-
// TODO EDM-9573, remove once EDM-9431 is merged
|
|
72
|
-
, isJira ? displayViewDropDownMessages.inlineLinkViewModeLabel : displayViewDropDownMessages.inlineLinkViewModeLabelDuplicate)))));
|
|
66
|
+
}, jsx(FormattedMessage, displayViewDropDownMessages.viewModeInlineLinkLabel)))));
|
|
73
67
|
};
|
|
@@ -1,52 +1,23 @@
|
|
|
1
1
|
import { defineMessages } from 'react-intl-next';
|
|
2
2
|
export var displayViewDropDownMessages = defineMessages({
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
description: 'Display search results as a table',
|
|
8
|
-
defaultMessage: 'Table'
|
|
3
|
+
viewModeListLabel: {
|
|
4
|
+
id: 'linkDataSource.jira-issues.configmodal.viewModeListLabel',
|
|
5
|
+
description: 'Display search results as a list',
|
|
6
|
+
defaultMessage: 'List'
|
|
9
7
|
},
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
defaultMessage: 'Display search results as a table'
|
|
8
|
+
viewModeListDescription: {
|
|
9
|
+
id: 'linkDataSource.jira-issues.configmodal.viewModeListDescription',
|
|
10
|
+
description: 'Description for list view mode',
|
|
11
|
+
defaultMessage: 'Display search results as a list'
|
|
15
12
|
},
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
id: 'linkDataSource.configmodal.inlineLinkViewModeLabel',
|
|
13
|
+
viewModeInlineLinkLabel: {
|
|
14
|
+
id: 'linkDataSource.jira-issues.configmodal.viewModeInlineLinkLabel',
|
|
19
15
|
description: 'Display the number of search results as an inline smart link',
|
|
20
16
|
defaultMessage: 'Inline link'
|
|
21
17
|
},
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
id: 'linkDataSource.configmodal.inlineLinkViewModeDescription',
|
|
25
|
-
description: 'Description for inline view mode',
|
|
26
|
-
defaultMessage: 'Display the number of search results or as an inline smart link'
|
|
27
|
-
},
|
|
28
|
-
// delete once EDM-9431 is merged
|
|
29
|
-
tableViewModeLabel: {
|
|
30
|
-
id: 'linkDataSource.jira-issues.configmodal.tableViewModeLabel',
|
|
31
|
-
description: 'Display Jira search results as a table',
|
|
32
|
-
defaultMessage: 'Table'
|
|
33
|
-
},
|
|
34
|
-
// delete once EDM-9431 is merged
|
|
35
|
-
tableViewModeDescription: {
|
|
36
|
-
id: 'linkDataSource.jira-issues.configmodal.tableViewModeDescription',
|
|
37
|
-
description: 'Description for table view mode',
|
|
38
|
-
defaultMessage: 'Display Jira search results as a table'
|
|
39
|
-
},
|
|
40
|
-
// delete once EDM-9431 is merged
|
|
41
|
-
inlineLinkViewModeLabel: {
|
|
42
|
-
id: 'linkDataSource.jira-issues.configmodal.inlineLinkViewModeLabel',
|
|
43
|
-
description: 'Display the number of search results as an inline smart link',
|
|
44
|
-
defaultMessage: 'Inline link'
|
|
45
|
-
},
|
|
46
|
-
// delete once EDM-9431 is merged
|
|
47
|
-
inlineLinkViewModeDescription: {
|
|
48
|
-
id: 'linkDataSource.jira-issues.configmodal.inlineLinkViewModeDescription',
|
|
18
|
+
viewModeInlineLinkDescription: {
|
|
19
|
+
id: 'linkDataSource.jira-issues.configmodal.viewModeInlineLinkDescription',
|
|
49
20
|
description: 'Description for inline link view mode',
|
|
50
|
-
defaultMessage: 'Display the number of search results
|
|
21
|
+
defaultMessage: 'Display the number of search results as an inline Smart Link'
|
|
51
22
|
}
|
|
52
23
|
});
|
|
@@ -348,8 +348,8 @@ export var PlainConfluenceSearchConfigModal = function PlainConfluenceSearchConf
|
|
|
348
348
|
}, [analyticsPayload, fireEvent, totalCount, isDataReady]);
|
|
349
349
|
useEffect(function () {
|
|
350
350
|
var isResolved = status === 'resolved';
|
|
351
|
-
var isTableViewMode = currentViewMode === '
|
|
352
|
-
var isInlineViewMode = currentViewMode === '
|
|
351
|
+
var isTableViewMode = currentViewMode === 'table';
|
|
352
|
+
var isInlineViewMode = currentViewMode === 'inline';
|
|
353
353
|
if (!isResolved) {
|
|
354
354
|
return;
|
|
355
355
|
}
|
|
@@ -53,7 +53,7 @@ var issueCountStyles = css({
|
|
|
53
53
|
fontWeight: 600
|
|
54
54
|
});
|
|
55
55
|
var getDisplayValue = function getDisplayValue(currentViewMode, itemCount) {
|
|
56
|
-
if (currentViewMode === '
|
|
56
|
+
if (currentViewMode === 'table') {
|
|
57
57
|
return DatasourceDisplay.DATASOURCE_TABLE;
|
|
58
58
|
}
|
|
59
59
|
return itemCount === 1 ? DatasourceDisplay.INLINE : DatasourceDisplay.DATASOURCE_INLINE;
|
|
@@ -82,7 +82,7 @@ export var PlainJiraIssuesConfigModal = function PlainJiraIssuesConfigModal(prop
|
|
|
82
82
|
onCancel = props.onCancel,
|
|
83
83
|
onInsert = props.onInsert,
|
|
84
84
|
_props$viewMode = props.viewMode,
|
|
85
|
-
viewMode = _props$viewMode === void 0 ? '
|
|
85
|
+
viewMode = _props$viewMode === void 0 ? 'table' : _props$viewMode,
|
|
86
86
|
initialParameters = props.parameters,
|
|
87
87
|
urlBeingEdited = props.url,
|
|
88
88
|
initialVisibleColumnKeys = props.visibleColumnKeys;
|
|
@@ -195,7 +195,7 @@ export var PlainJiraIssuesConfigModal = function PlainJiraIssuesConfigModal(prop
|
|
|
195
195
|
var resolvedWithNoResults = status === 'resolved' && !responseItems.length;
|
|
196
196
|
var jqlUrl = selectedJiraSite && jql && "".concat(selectedJiraSite.url, "/issues/?jql=").concat(encodeURI(jql));
|
|
197
197
|
var isInsertDisabled = !isParametersSet || status === 'rejected' || status === 'unauthorized' || status === 'loading';
|
|
198
|
-
var shouldShowIssueCount = !!totalCount && totalCount !== 1 && currentViewMode === '
|
|
198
|
+
var shouldShowIssueCount = !!totalCount && totalCount !== 1 && currentViewMode === 'table';
|
|
199
199
|
var isDataReady = (visibleColumnKeys || []).length > 0;
|
|
200
200
|
var hasNoJiraSites = availableSites && availableSites.length === 0;
|
|
201
201
|
useEffect(function () {
|
|
@@ -210,7 +210,7 @@ export var PlainJiraIssuesConfigModal = function PlainJiraIssuesConfigModal(prop
|
|
|
210
210
|
status: status,
|
|
211
211
|
experienceId: modalRenderInstanceId,
|
|
212
212
|
itemCount: responseItems.length,
|
|
213
|
-
canBeLink: currentViewMode === '
|
|
213
|
+
canBeLink: currentViewMode === 'inline',
|
|
214
214
|
extensionKey: extensionKey
|
|
215
215
|
});
|
|
216
216
|
useEffect(function () {
|
|
@@ -289,8 +289,8 @@ export var PlainJiraIssuesConfigModal = function PlainJiraIssuesConfigModal(prop
|
|
|
289
289
|
}, [fireSingleItemViewedEvent, fireTableViewedEvent, totalCount]);
|
|
290
290
|
useEffect(function () {
|
|
291
291
|
var isResolved = status === 'resolved';
|
|
292
|
-
var isIssueViewMode = currentViewMode === '
|
|
293
|
-
var isCountViewMode = currentViewMode === '
|
|
292
|
+
var isIssueViewMode = currentViewMode === 'table';
|
|
293
|
+
var isCountViewMode = currentViewMode === 'inline';
|
|
294
294
|
if (!isResolved) {
|
|
295
295
|
return;
|
|
296
296
|
}
|
|
@@ -379,7 +379,7 @@ export var PlainJiraIssuesConfigModal = function PlainJiraIssuesConfigModal(prop
|
|
|
379
379
|
var consumerEvent = (_insertButtonClickedE = insertButtonClickedEvent.clone()) !== null && _insertButtonClickedE !== void 0 ? _insertButtonClickedE : undefined;
|
|
380
380
|
insertButtonClickedEvent.fire(EVENT_CHANNEL);
|
|
381
381
|
var firstIssueUrl = retrieveUrlForSmartCardRender();
|
|
382
|
-
if (currentViewMode === '
|
|
382
|
+
if (currentViewMode === 'inline') {
|
|
383
383
|
macroInsertedEvent === null || macroInsertedEvent === void 0 || macroInsertedEvent.fire(EVENT_CHANNEL);
|
|
384
384
|
var url = responseItems.length === 1 ? firstIssueUrl : upToDateJqlUrl;
|
|
385
385
|
onInsert({
|
|
@@ -545,7 +545,7 @@ export var PlainJiraIssuesConfigModal = function PlainJiraIssuesConfigModal(prop
|
|
|
545
545
|
initialSearchMethod: initialSearchMethod,
|
|
546
546
|
onSearchMethodChange: setCurrentSearchMethod,
|
|
547
547
|
site: selectedJiraSite
|
|
548
|
-
}), currentViewMode === '
|
|
548
|
+
}), currentViewMode === 'inline' ? renderCountModeContent() : renderIssuesModeContent()) : jsx(NoInstancesView, {
|
|
549
549
|
title: loadingErrorMessages.noAccessToJiraSitesTitle,
|
|
550
550
|
description: loadingErrorMessages.noAccessToJiraSitesDescription,
|
|
551
551
|
testId: "no-jira-instances-content"
|
|
@@ -6,9 +6,7 @@ export interface Site {
|
|
|
6
6
|
displayName: string;
|
|
7
7
|
url: string;
|
|
8
8
|
}
|
|
9
|
-
export type
|
|
10
|
-
export type ViewModes = 'table' | 'inline';
|
|
11
|
-
export type DisplayViewModes = IssueViewModes | ViewModes;
|
|
9
|
+
export type DisplayViewModes = 'table' | 'inline';
|
|
12
10
|
export type ConfigModalProps<ADF, Parameters> = {
|
|
13
11
|
/** Unique identifier for which type of datasource is being rendered and for making its requests */
|
|
14
12
|
datasourceId: string;
|
|
@@ -20,9 +18,10 @@ export type ConfigModalProps<ADF, Parameters> = {
|
|
|
20
18
|
onCancel: () => void;
|
|
21
19
|
/** Callback function to be invoked when the insert issues button is clicked */
|
|
22
20
|
onInsert: (adf: ADF, analyticsEvent?: UIAnalyticsEvent) => void;
|
|
23
|
-
/**
|
|
21
|
+
/**
|
|
22
|
+
* The view mode that the modal will show on open:
|
|
24
23
|
* - Table = Displays a list of links in table format
|
|
25
24
|
* - Inline = Presents a smart link that shows the count of query results. However, if there's only one result, it converts to an inline smart link of that issue.
|
|
26
|
-
|
|
25
|
+
*/
|
|
27
26
|
viewMode?: DisplayViewModes;
|
|
28
27
|
} & Partial<Pick<IssueLikeDataTableViewProps, 'visibleColumnKeys' | 'wrappedColumnKeys' | 'columnCustomSizes'>>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import { jsx } from '@emotion/react';
|
|
3
|
-
import { DisplayViewModes } from '../../../../common/types';
|
|
3
|
+
import { type DisplayViewModes } from '../../../../common/types';
|
|
4
4
|
export type DisplayViewDropDownProps = {
|
|
5
5
|
onViewModeChange: (value: DisplayViewModes) => void;
|
|
6
6
|
viewMode: DisplayViewModes;
|
|
@@ -1,40 +1,20 @@
|
|
|
1
1
|
export declare const displayViewDropDownMessages: {
|
|
2
|
-
|
|
2
|
+
viewModeListLabel: {
|
|
3
3
|
id: string;
|
|
4
4
|
description: string;
|
|
5
5
|
defaultMessage: string;
|
|
6
6
|
};
|
|
7
|
-
|
|
7
|
+
viewModeListDescription: {
|
|
8
8
|
id: string;
|
|
9
9
|
description: string;
|
|
10
10
|
defaultMessage: string;
|
|
11
11
|
};
|
|
12
|
-
|
|
12
|
+
viewModeInlineLinkLabel: {
|
|
13
13
|
id: string;
|
|
14
14
|
description: string;
|
|
15
15
|
defaultMessage: string;
|
|
16
16
|
};
|
|
17
|
-
|
|
18
|
-
id: string;
|
|
19
|
-
description: string;
|
|
20
|
-
defaultMessage: string;
|
|
21
|
-
};
|
|
22
|
-
tableViewModeLabel: {
|
|
23
|
-
id: string;
|
|
24
|
-
description: string;
|
|
25
|
-
defaultMessage: string;
|
|
26
|
-
};
|
|
27
|
-
tableViewModeDescription: {
|
|
28
|
-
id: string;
|
|
29
|
-
description: string;
|
|
30
|
-
defaultMessage: string;
|
|
31
|
-
};
|
|
32
|
-
inlineLinkViewModeLabel: {
|
|
33
|
-
id: string;
|
|
34
|
-
description: string;
|
|
35
|
-
defaultMessage: string;
|
|
36
|
-
};
|
|
37
|
-
inlineLinkViewModeDescription: {
|
|
17
|
+
viewModeInlineLinkDescription: {
|
|
38
18
|
id: string;
|
|
39
19
|
description: string;
|
|
40
20
|
defaultMessage: string;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { PopupComponentProps } from '@atlaskit/popup';
|
|
3
|
-
export declare const PopupComponent: React.ForwardRefExoticComponent<Pick<PopupComponentProps, "style" | "data-testid" | "children" | "id" | "tabIndex" | "shouldRenderToParent" | "data-placement"> & React.RefAttributes<HTMLDivElement>>;
|
|
3
|
+
export declare const PopupComponent: React.ForwardRefExoticComponent<Pick<PopupComponentProps, "style" | "data-testid" | "children" | "id" | "tabIndex" | "role" | "shouldRenderToParent" | "data-placement"> & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -6,9 +6,7 @@ export interface Site {
|
|
|
6
6
|
displayName: string;
|
|
7
7
|
url: string;
|
|
8
8
|
}
|
|
9
|
-
export type
|
|
10
|
-
export type ViewModes = 'table' | 'inline';
|
|
11
|
-
export type DisplayViewModes = IssueViewModes | ViewModes;
|
|
9
|
+
export type DisplayViewModes = 'table' | 'inline';
|
|
12
10
|
export type ConfigModalProps<ADF, Parameters> = {
|
|
13
11
|
/** Unique identifier for which type of datasource is being rendered and for making its requests */
|
|
14
12
|
datasourceId: string;
|
|
@@ -20,9 +18,10 @@ export type ConfigModalProps<ADF, Parameters> = {
|
|
|
20
18
|
onCancel: () => void;
|
|
21
19
|
/** Callback function to be invoked when the insert issues button is clicked */
|
|
22
20
|
onInsert: (adf: ADF, analyticsEvent?: UIAnalyticsEvent) => void;
|
|
23
|
-
/**
|
|
21
|
+
/**
|
|
22
|
+
* The view mode that the modal will show on open:
|
|
24
23
|
* - Table = Displays a list of links in table format
|
|
25
24
|
* - Inline = Presents a smart link that shows the count of query results. However, if there's only one result, it converts to an inline smart link of that issue.
|
|
26
|
-
|
|
25
|
+
*/
|
|
27
26
|
viewMode?: DisplayViewModes;
|
|
28
27
|
} & Partial<Pick<IssueLikeDataTableViewProps, 'visibleColumnKeys' | 'wrappedColumnKeys' | 'columnCustomSizes'>>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import { jsx } from '@emotion/react';
|
|
3
|
-
import { DisplayViewModes } from '../../../../common/types';
|
|
3
|
+
import { type DisplayViewModes } from '../../../../common/types';
|
|
4
4
|
export type DisplayViewDropDownProps = {
|
|
5
5
|
onViewModeChange: (value: DisplayViewModes) => void;
|
|
6
6
|
viewMode: DisplayViewModes;
|
|
@@ -1,40 +1,20 @@
|
|
|
1
1
|
export declare const displayViewDropDownMessages: {
|
|
2
|
-
|
|
2
|
+
viewModeListLabel: {
|
|
3
3
|
id: string;
|
|
4
4
|
description: string;
|
|
5
5
|
defaultMessage: string;
|
|
6
6
|
};
|
|
7
|
-
|
|
7
|
+
viewModeListDescription: {
|
|
8
8
|
id: string;
|
|
9
9
|
description: string;
|
|
10
10
|
defaultMessage: string;
|
|
11
11
|
};
|
|
12
|
-
|
|
12
|
+
viewModeInlineLinkLabel: {
|
|
13
13
|
id: string;
|
|
14
14
|
description: string;
|
|
15
15
|
defaultMessage: string;
|
|
16
16
|
};
|
|
17
|
-
|
|
18
|
-
id: string;
|
|
19
|
-
description: string;
|
|
20
|
-
defaultMessage: string;
|
|
21
|
-
};
|
|
22
|
-
tableViewModeLabel: {
|
|
23
|
-
id: string;
|
|
24
|
-
description: string;
|
|
25
|
-
defaultMessage: string;
|
|
26
|
-
};
|
|
27
|
-
tableViewModeDescription: {
|
|
28
|
-
id: string;
|
|
29
|
-
description: string;
|
|
30
|
-
defaultMessage: string;
|
|
31
|
-
};
|
|
32
|
-
inlineLinkViewModeLabel: {
|
|
33
|
-
id: string;
|
|
34
|
-
description: string;
|
|
35
|
-
defaultMessage: string;
|
|
36
|
-
};
|
|
37
|
-
inlineLinkViewModeDescription: {
|
|
17
|
+
viewModeInlineLinkDescription: {
|
|
38
18
|
id: string;
|
|
39
19
|
description: string;
|
|
40
20
|
defaultMessage: string;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { PopupComponentProps } from '@atlaskit/popup';
|
|
3
|
-
export declare const PopupComponent: React.ForwardRefExoticComponent<Pick<PopupComponentProps, "style" | "data-testid" | "children" | "id" | "tabIndex" | "shouldRenderToParent" | "data-placement"> & React.RefAttributes<HTMLDivElement>>;
|
|
3
|
+
export declare const PopupComponent: React.ForwardRefExoticComponent<Pick<PopupComponentProps, "style" | "data-testid" | "children" | "id" | "tabIndex" | "role" | "shouldRenderToParent" | "data-placement"> & React.RefAttributes<HTMLDivElement>>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/link-datasource",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "UI Components to support linking platform dataset feature",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"@atlaskit/avatar-group": "^9.5.0",
|
|
39
39
|
"@atlaskit/badge": "^16.1.0",
|
|
40
40
|
"@atlaskit/button": "^17.14.0",
|
|
41
|
-
"@atlaskit/datetime-picker": "^13.
|
|
41
|
+
"@atlaskit/datetime-picker": "^13.5.0",
|
|
42
42
|
"@atlaskit/dropdown-menu": "^12.10.0",
|
|
43
43
|
"@atlaskit/editor-prosemirror": "4.0.0",
|
|
44
44
|
"@atlaskit/empty-state": "^7.8.0",
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"@atlaskit/modal-dialog": "^12.13.0",
|
|
60
60
|
"@atlaskit/outbound-auth-flow-client": "^3.4.5",
|
|
61
61
|
"@atlaskit/platform-feature-flags": "^0.2.4",
|
|
62
|
-
"@atlaskit/popup": "^1.
|
|
62
|
+
"@atlaskit/popup": "^1.17.0",
|
|
63
63
|
"@atlaskit/pragmatic-drag-and-drop": "^1.1.0",
|
|
64
64
|
"@atlaskit/pragmatic-drag-and-drop-hitbox": "^1.0.0",
|
|
65
65
|
"@atlaskit/pragmatic-drag-and-drop-react-beautiful-dnd-autoscroll": "^1.1.0",
|