@atlaskit/link-datasource 1.26.3 → 1.27.1
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 +16 -0
- package/dist/cjs/ui/common/error-state/no-instances.js +1 -1
- package/dist/cjs/ui/common/modal/count-view-smart-link/index.js +40 -0
- package/dist/cjs/ui/{jira-issues-modal/modal/jira-display-view-dropdown/jira-display-view-drop-down.js → common/modal/display-view-dropdown/display-view-drop-down.js} +29 -13
- package/dist/cjs/ui/common/modal/display-view-dropdown/messages.js +58 -0
- package/dist/cjs/ui/confluence-search-modal/modal/index.js +114 -45
- package/dist/cjs/ui/confluence-search-modal/modal/messages.js +5 -0
- package/dist/cjs/ui/issue-like-table/render-type/user/index.js +1 -1
- package/dist/cjs/ui/jira-issues-modal/modal/index.js +8 -23
- package/dist/cjs/ui/jira-issues-modal/modal/messages.js +0 -20
- package/dist/es2019/ui/common/error-state/no-instances.js +1 -1
- package/dist/es2019/ui/common/modal/count-view-smart-link/index.js +30 -0
- package/dist/es2019/ui/common/modal/display-view-dropdown/display-view-drop-down.js +71 -0
- package/dist/es2019/ui/common/modal/display-view-dropdown/messages.js +52 -0
- package/dist/es2019/ui/confluence-search-modal/modal/index.js +98 -31
- package/dist/es2019/ui/confluence-search-modal/modal/messages.js +5 -0
- package/dist/es2019/ui/issue-like-table/render-type/user/index.js +1 -1
- package/dist/es2019/ui/jira-issues-modal/modal/index.js +9 -24
- package/dist/es2019/ui/jira-issues-modal/modal/messages.js +0 -20
- package/dist/esm/ui/common/error-state/no-instances.js +1 -1
- package/dist/esm/ui/common/modal/count-view-smart-link/index.js +32 -0
- package/dist/esm/ui/common/modal/display-view-dropdown/display-view-drop-down.js +73 -0
- package/dist/esm/ui/common/modal/display-view-dropdown/messages.js +52 -0
- package/dist/esm/ui/confluence-search-modal/modal/index.js +114 -45
- package/dist/esm/ui/confluence-search-modal/modal/messages.js +5 -0
- package/dist/esm/ui/issue-like-table/render-type/user/index.js +1 -1
- package/dist/esm/ui/jira-issues-modal/modal/index.js +9 -24
- package/dist/esm/ui/jira-issues-modal/modal/messages.js +0 -20
- package/dist/types/common/types.d.ts +5 -5
- package/dist/types/ui/common/modal/count-view-smart-link/index.d.ts +9 -0
- package/dist/types/ui/common/modal/display-view-dropdown/display-view-drop-down.d.ts +8 -0
- package/dist/types/ui/common/modal/display-view-dropdown/messages.d.ts +42 -0
- package/dist/types/ui/confluence-search-modal/modal/messages.d.ts +5 -0
- package/dist/types/ui/confluence-search-modal/types.d.ts +2 -2
- package/dist/types/ui/jira-issues-modal/modal/messages.d.ts +0 -20
- package/dist/types-ts4.5/common/types.d.ts +5 -5
- package/dist/types-ts4.5/ui/common/modal/count-view-smart-link/index.d.ts +9 -0
- package/dist/types-ts4.5/ui/common/modal/display-view-dropdown/display-view-drop-down.d.ts +8 -0
- package/dist/types-ts4.5/ui/common/modal/display-view-dropdown/messages.d.ts +42 -0
- package/dist/types-ts4.5/ui/confluence-search-modal/modal/messages.d.ts +5 -0
- package/dist/types-ts4.5/ui/confluence-search-modal/types.d.ts +2 -2
- package/dist/types-ts4.5/ui/jira-issues-modal/modal/messages.d.ts +0 -20
- package/examples-helpers/mockSmartLinkData.ts +49 -0
- package/examples-helpers/smartLinkCustomClient.ts +8 -3
- package/package.json +2 -2
- package/dist/es2019/ui/jira-issues-modal/modal/jira-display-view-dropdown/jira-display-view-drop-down.js +0 -55
- package/dist/esm/ui/jira-issues-modal/modal/jira-display-view-dropdown/jira-display-view-drop-down.js +0 -57
- package/dist/types/ui/jira-issues-modal/modal/jira-display-view-dropdown/jira-display-view-drop-down.d.ts +0 -8
- package/dist/types-ts4.5/ui/jira-issues-modal/modal/jira-display-view-dropdown/jira-display-view-drop-down.d.ts +0 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @atlaskit/link-datasource
|
|
2
2
|
|
|
3
|
+
## 1.27.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#89629](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/89629) [`cb82b58b4ae2`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/cb82b58b4ae2) - Update xcss usages to align to new types.
|
|
8
|
+
|
|
9
|
+
## 1.27.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- [#89218](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/89218) [`008bd3703560`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/008bd3703560) - Adds DisplayViewDropdown to Confluence Search modal as a common component.
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- [#89986](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/89986) [`73821c4958bb`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/73821c4958bb) - Add display view dropdown analytics events
|
|
18
|
+
|
|
3
19
|
## 1.26.3
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
|
@@ -19,7 +19,7 @@ var descriptionStyles = (0, _react.css)({
|
|
|
19
19
|
marginTop: "var(--ds-space-100, 8px)"
|
|
20
20
|
});
|
|
21
21
|
var containerStyles = (0, _primitives.xcss)({
|
|
22
|
-
marginTop: '
|
|
22
|
+
marginTop: 'space.800'
|
|
23
23
|
});
|
|
24
24
|
var NoInstancesView = exports.NoInstancesView = function NoInstancesView(_ref) {
|
|
25
25
|
var title = _ref.title,
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.SmartLink = exports.SmartCardPlaceholder = void 0;
|
|
8
|
+
var _react = require("@emotion/react");
|
|
9
|
+
var _reactIntlNext = require("react-intl-next");
|
|
10
|
+
var _colors = require("@atlaskit/theme/colors");
|
|
11
|
+
var _link = _interopRequireDefault(require("../../../issue-like-table/render-type/link"));
|
|
12
|
+
/** @jsx jsx */
|
|
13
|
+
|
|
14
|
+
var placeholderSmartLinkStyles = (0, _react.css)({
|
|
15
|
+
backgroundColor: "var(--ds-surface-raised, ".concat(_colors.N0, ")"),
|
|
16
|
+
borderRadius: "var(--ds-border-radius-200, 3px)",
|
|
17
|
+
boxShadow: '0px 1px 1px rgba(9, 30, 66, 0.25), 0px 0px 1px rgba(9, 30, 66, 0.31)',
|
|
18
|
+
color: "var(--ds-text-brand, ".concat(_colors.B400, ")"),
|
|
19
|
+
padding: "var(--ds-space-0, 0px)".concat(" ", "var(--ds-space-025, 2px)")
|
|
20
|
+
});
|
|
21
|
+
var smartLinkContainerStyles = (0, _react.css)({
|
|
22
|
+
paddingLeft: "var(--ds-space-025, 2px)"
|
|
23
|
+
});
|
|
24
|
+
var SmartCardPlaceholder = exports.SmartCardPlaceholder = function SmartCardPlaceholder(_ref) {
|
|
25
|
+
var placeholderText = _ref.placeholderText;
|
|
26
|
+
return (0, _react.jsx)("div", {
|
|
27
|
+
css: smartLinkContainerStyles
|
|
28
|
+
}, (0, _react.jsx)("span", {
|
|
29
|
+
"data-testid": "datasource-modal--smart-card-placeholder",
|
|
30
|
+
css: placeholderSmartLinkStyles
|
|
31
|
+
}, (0, _react.jsx)(_reactIntlNext.FormattedMessage, placeholderText)));
|
|
32
|
+
};
|
|
33
|
+
var SmartLink = exports.SmartLink = function SmartLink(_ref2) {
|
|
34
|
+
var url = _ref2.url;
|
|
35
|
+
return (0, _react.jsx)("div", {
|
|
36
|
+
css: smartLinkContainerStyles
|
|
37
|
+
}, (0, _react.jsx)(_link.default, {
|
|
38
|
+
url: url
|
|
39
|
+
}));
|
|
40
|
+
};
|
|
@@ -5,13 +5,13 @@ var _typeof = require("@babel/runtime/helpers/typeof");
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.
|
|
8
|
+
exports.DisplayViewDropDown = void 0;
|
|
9
9
|
var _react = require("@emotion/react");
|
|
10
10
|
var _reactIntlNext = require("react-intl-next");
|
|
11
11
|
var _dropdownMenu = _interopRequireWildcard(require("@atlaskit/dropdown-menu"));
|
|
12
12
|
var _table = _interopRequireDefault(require("@atlaskit/icon/glyph/table"));
|
|
13
13
|
var _primitives = require("@atlaskit/primitives");
|
|
14
|
-
var _messages = require("
|
|
14
|
+
var _messages = require("./messages");
|
|
15
15
|
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); }
|
|
16
16
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
17
17
|
/** @jsx jsx */
|
|
@@ -35,34 +35,50 @@ var InlineIcon = (0, _react.jsx)("svg", {
|
|
|
35
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
36
|
fill: 'currentColor'
|
|
37
37
|
}));
|
|
38
|
-
var
|
|
38
|
+
var DisplayViewDropDown = exports.DisplayViewDropDown = function DisplayViewDropDown(_ref) {
|
|
39
39
|
var onViewModeChange = _ref.onViewModeChange,
|
|
40
40
|
viewMode = _ref.viewMode;
|
|
41
41
|
var _useIntl = (0, _reactIntlNext.useIntl)(),
|
|
42
42
|
formatMessage = _useIntl.formatMessage;
|
|
43
|
-
|
|
43
|
+
// TODO: further refactoring in EDM-9573
|
|
44
|
+
// temporary fix. transition 'count' to 'inline', 'issue' to 'table'
|
|
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);
|
|
44
52
|
return (0, _react.jsx)(_dropdownMenu.default, {
|
|
45
53
|
trigger: triggerText,
|
|
46
|
-
testId: "
|
|
54
|
+
testId: "datasource-modal--view-drop-down"
|
|
47
55
|
}, (0, _react.jsx)(_primitives.Box, {
|
|
48
56
|
xcss: dropDownItemGroupStyles
|
|
49
57
|
}, (0, _react.jsx)(_dropdownMenu.DropdownItemGroup, null, (0, _react.jsx)(_dropdownMenu.DropdownItem, {
|
|
50
58
|
testId: "dropdown-item-table",
|
|
51
59
|
onClick: function onClick() {
|
|
52
|
-
return onViewModeChange('issue');
|
|
60
|
+
return onViewModeChange(isJira ? 'issue' : 'table');
|
|
53
61
|
},
|
|
54
|
-
isSelected:
|
|
55
|
-
description: formatMessage(
|
|
62
|
+
isSelected: isTable,
|
|
63
|
+
description: formatMessage(
|
|
64
|
+
// TODO EDM-9573, remove once EDM-9431 is merged
|
|
65
|
+
isJira ? _messages.displayViewDropDownMessages.tableViewModeDescription : _messages.displayViewDropDownMessages.tableViewModeDescriptionDuplicate),
|
|
56
66
|
elemBefore: (0, _react.jsx)(_table.default, {
|
|
57
67
|
label: "table icon"
|
|
58
68
|
})
|
|
59
|
-
}, (0, _react.jsx)(_reactIntlNext.FormattedMessage
|
|
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, {
|
|
60
72
|
testId: "dropdown-item-inline-link",
|
|
61
73
|
onClick: function onClick() {
|
|
62
|
-
return onViewModeChange('count');
|
|
74
|
+
return onViewModeChange(isJira ? 'count' : 'inline');
|
|
63
75
|
},
|
|
64
|
-
isSelected:
|
|
65
|
-
description: formatMessage(
|
|
76
|
+
isSelected: !isTable,
|
|
77
|
+
description: formatMessage(
|
|
78
|
+
// TODO EDM-9573, remove once EDM-9431 is merged
|
|
79
|
+
isJira ? _messages.displayViewDropDownMessages.inlineLinkViewModeDescription : _messages.displayViewDropDownMessages.inlineLinkViewModeDescriptionDuplicate),
|
|
66
80
|
elemBefore: InlineIcon
|
|
67
|
-
}, (0, _react.jsx)(_reactIntlNext.FormattedMessage
|
|
81
|
+
}, (0, _react.jsx)(_reactIntlNext.FormattedMessage
|
|
82
|
+
// TODO EDM-9573, remove once EDM-9431 is merged
|
|
83
|
+
, isJira ? _messages.displayViewDropDownMessages.inlineLinkViewModeLabel : _messages.displayViewDropDownMessages.inlineLinkViewModeLabelDuplicate)))));
|
|
68
84
|
};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.displayViewDropDownMessages = void 0;
|
|
7
|
+
var _reactIntlNext = require("react-intl-next");
|
|
8
|
+
var displayViewDropDownMessages = exports.displayViewDropDownMessages = (0, _reactIntlNext.defineMessages)({
|
|
9
|
+
// TODO EDM-9573
|
|
10
|
+
// remove duplicate from end of key once EDM-9431 is merged
|
|
11
|
+
tableViewModeLabelDuplicate: {
|
|
12
|
+
id: 'linkDataSource.configmodal.tableViewModeLabel',
|
|
13
|
+
description: 'Display search results as a table',
|
|
14
|
+
defaultMessage: 'Table'
|
|
15
|
+
},
|
|
16
|
+
// remove duplicate from end of key once EDM-9431 is merged
|
|
17
|
+
tableViewModeDescriptionDuplicate: {
|
|
18
|
+
id: 'linkDataSource.configmodal.tableViewModeDescription',
|
|
19
|
+
description: 'Description for table view mode',
|
|
20
|
+
defaultMessage: 'Display search results as a table'
|
|
21
|
+
},
|
|
22
|
+
// remove duplicate from end of key once EDM-9431 is merged
|
|
23
|
+
inlineLinkViewModeLabelDuplicate: {
|
|
24
|
+
id: 'linkDataSource.configmodal.inlineLinkViewModeLabel',
|
|
25
|
+
description: 'Display the number of search results as an inline smart link',
|
|
26
|
+
defaultMessage: 'Inline link'
|
|
27
|
+
},
|
|
28
|
+
// remove duplicate from end of key once EDM-9431 is merged
|
|
29
|
+
inlineLinkViewModeDescriptionDuplicate: {
|
|
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',
|
|
55
|
+
description: 'Description for inline link view mode',
|
|
56
|
+
defaultMessage: 'Display the number of search results or as an inline smart link'
|
|
57
|
+
}
|
|
58
|
+
});
|
|
@@ -39,6 +39,8 @@ var _noResults = require("../../common/error-state/no-results");
|
|
|
39
39
|
var _initialStateView = require("../../common/initial-state-view");
|
|
40
40
|
var _cancelButton = require("../../common/modal/cancel-button");
|
|
41
41
|
var _contentContainer = require("../../common/modal/content-container");
|
|
42
|
+
var _countViewSmartLink = require("../../common/modal/count-view-smart-link");
|
|
43
|
+
var _displayViewDropDown = require("../../common/modal/display-view-dropdown/display-view-drop-down");
|
|
42
44
|
var _siteSelector = require("../../common/modal/site-selector");
|
|
43
45
|
var _issueLikeTable = require("../../issue-like-table");
|
|
44
46
|
var _confluenceSearchContainer = _interopRequireDefault(require("../confluence-search-container"));
|
|
@@ -78,6 +80,8 @@ var PlainConfluenceSearchConfigModal = exports.PlainConfluenceSearchConfigModal
|
|
|
78
80
|
initialWrappedColumnKeys = props.wrappedColumnKeys,
|
|
79
81
|
onCancel = props.onCancel,
|
|
80
82
|
onInsert = props.onInsert,
|
|
83
|
+
_props$viewMode = props.viewMode,
|
|
84
|
+
viewMode = _props$viewMode === void 0 ? 'table' : _props$viewMode,
|
|
81
85
|
initialParameters = props.parameters,
|
|
82
86
|
urlBeingEdited = props.url,
|
|
83
87
|
initialVisibleColumnKeys = props.visibleColumnKeys;
|
|
@@ -85,18 +89,22 @@ var PlainConfluenceSearchConfigModal = exports.PlainConfluenceSearchConfigModal
|
|
|
85
89
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
86
90
|
availableSites = _useState2[0],
|
|
87
91
|
setAvailableSites = _useState2[1];
|
|
88
|
-
var _useState3 = (0, _react.useState)(
|
|
92
|
+
var _useState3 = (0, _react.useState)(viewMode),
|
|
89
93
|
_useState4 = (0, _slicedToArray2.default)(_useState3, 2),
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
var _useState5 = (0, _react.useState)(initialParameters === null || initialParameters === void 0 ? void 0 : initialParameters.
|
|
94
|
+
currentViewMode = _useState4[0],
|
|
95
|
+
setCurrentViewMode = _useState4[1];
|
|
96
|
+
var _useState5 = (0, _react.useState)(initialParameters === null || initialParameters === void 0 ? void 0 : initialParameters.cloudId),
|
|
93
97
|
_useState6 = (0, _slicedToArray2.default)(_useState5, 2),
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
var _useState7 = (0, _react.useState)(
|
|
98
|
+
cloudId = _useState6[0],
|
|
99
|
+
setCloudId = _useState6[1];
|
|
100
|
+
var _useState7 = (0, _react.useState)(initialParameters === null || initialParameters === void 0 ? void 0 : initialParameters.searchString),
|
|
97
101
|
_useState8 = (0, _slicedToArray2.default)(_useState7, 2),
|
|
98
|
-
|
|
99
|
-
|
|
102
|
+
searchString = _useState8[0],
|
|
103
|
+
setSearchString = _useState8[1];
|
|
104
|
+
var _useState9 = (0, _react.useState)(initialVisibleColumnKeys),
|
|
105
|
+
_useState10 = (0, _slicedToArray2.default)(_useState9, 2),
|
|
106
|
+
visibleColumnKeys = _useState10[0],
|
|
107
|
+
setVisibleColumnKeys = _useState10[1];
|
|
100
108
|
|
|
101
109
|
// analytics related parameters
|
|
102
110
|
var searchCount = (0, _react.useRef)(0);
|
|
@@ -166,6 +174,7 @@ var PlainConfluenceSearchConfigModal = exports.PlainConfluenceSearchConfigModal
|
|
|
166
174
|
// TODO: further refactoring in EDM-9573
|
|
167
175
|
// https://stash.atlassian.com/projects/ATLASSIAN/repos/atlassian-frontend-monorepo/pull-requests/82725/overview?commentId=6829171
|
|
168
176
|
var onSiteSelection = (0, _react.useCallback)(function (site) {
|
|
177
|
+
userInteractionActions.current.add(_types.DatasourceAction.INSTANCE_UPDATED);
|
|
169
178
|
setSearchString(undefined);
|
|
170
179
|
setCloudId(site.cloudId);
|
|
171
180
|
reset({
|
|
@@ -209,17 +218,17 @@ var PlainConfluenceSearchConfigModal = exports.PlainConfluenceSearchConfigModal
|
|
|
209
218
|
setVisibleColumnKeys(newVisibleColumnKeys);
|
|
210
219
|
}, [initialVisibleColumnKeys, defaultVisibleColumnKeys]);
|
|
211
220
|
var siteSelectorLabel = availableSites && availableSites.length > 1 ? _messages.confluenceSearchModalMessages.insertIssuesTitleManySites : _messages.confluenceSearchModalMessages.insertIssuesTitle;
|
|
212
|
-
var
|
|
213
|
-
|
|
214
|
-
columnCustomSizes =
|
|
215
|
-
setColumnCustomSizes =
|
|
221
|
+
var _useState11 = (0, _react.useState)(initialColumnCustomSizes),
|
|
222
|
+
_useState12 = (0, _slicedToArray2.default)(_useState11, 2),
|
|
223
|
+
columnCustomSizes = _useState12[0],
|
|
224
|
+
setColumnCustomSizes = _useState12[1];
|
|
216
225
|
var onColumnResize = (0, _react.useCallback)(function (key, width) {
|
|
217
226
|
setColumnCustomSizes(_objectSpread(_objectSpread({}, columnCustomSizes), {}, (0, _defineProperty2.default)({}, key, width)));
|
|
218
227
|
}, [columnCustomSizes]);
|
|
219
|
-
var
|
|
220
|
-
|
|
221
|
-
wrappedColumnKeys =
|
|
222
|
-
setWrappedColumnKeys =
|
|
228
|
+
var _useState13 = (0, _react.useState)(initialWrappedColumnKeys),
|
|
229
|
+
_useState14 = (0, _slicedToArray2.default)(_useState13, 2),
|
|
230
|
+
wrappedColumnKeys = _useState14[0],
|
|
231
|
+
setWrappedColumnKeys = _useState14[1];
|
|
223
232
|
var onWrappedColumnChange = (0, _react.useCallback)(function (key, isWrapped) {
|
|
224
233
|
var set = new Set(wrappedColumnKeys);
|
|
225
234
|
if (isWrapped) {
|
|
@@ -265,7 +274,7 @@ var PlainConfluenceSearchConfigModal = exports.PlainConfluenceSearchConfigModal
|
|
|
265
274
|
var resolvedWithNoResults = status === 'resolved' && !responseItems.length;
|
|
266
275
|
var hasConfluenceSearchParams = selectedConfluenceSite && searchString;
|
|
267
276
|
var selectedConfluenceSiteUrl = selectedConfluenceSite === null || selectedConfluenceSite === void 0 ? void 0 : selectedConfluenceSite.url;
|
|
268
|
-
var confluenceSearchUrl = selectedConfluenceSiteUrl && searchString !== undefined && "".concat(selectedConfluenceSiteUrl, "/wiki/search
|
|
277
|
+
var confluenceSearchUrl = selectedConfluenceSiteUrl && searchString !== undefined && "".concat(selectedConfluenceSiteUrl, "/wiki/search?text=").concat(encodeURI(searchString));
|
|
269
278
|
var analyticsPayload = (0, _react.useMemo)(function () {
|
|
270
279
|
return {
|
|
271
280
|
extensionKey: extensionKey,
|
|
@@ -274,7 +283,36 @@ var PlainConfluenceSearchConfigModal = exports.PlainConfluenceSearchConfigModal
|
|
|
274
283
|
actions: Array.from(userInteractionActions.current)
|
|
275
284
|
};
|
|
276
285
|
}, [destinationObjectTypes, extensionKey]);
|
|
277
|
-
var
|
|
286
|
+
var isDataReady = (visibleColumnKeys || []).length > 0;
|
|
287
|
+
var fireInlineViewedEvent = (0, _react.useCallback)(function () {
|
|
288
|
+
fireEvent('ui.link.viewed.count', _objectSpread(_objectSpread({}, analyticsPayload), {}, {
|
|
289
|
+
searchMethod: _types.DatasourceSearchMethod.DATASOURCE_SEARCH_QUERY,
|
|
290
|
+
totalItemCount: totalCount || 0
|
|
291
|
+
}));
|
|
292
|
+
}, [analyticsPayload, fireEvent, totalCount]);
|
|
293
|
+
var fireTableViewedEvent = (0, _react.useCallback)(function () {
|
|
294
|
+
if (isDataReady) {
|
|
295
|
+
fireEvent('ui.table.viewed.datasourceConfigModal', _objectSpread(_objectSpread({}, analyticsPayload), {}, {
|
|
296
|
+
totalItemCount: totalCount || 0,
|
|
297
|
+
searchMethod: _types.DatasourceSearchMethod.DATASOURCE_SEARCH_QUERY,
|
|
298
|
+
displayedColumnCount: visibleColumnCount.current
|
|
299
|
+
}));
|
|
300
|
+
}
|
|
301
|
+
}, [analyticsPayload, fireEvent, totalCount, isDataReady]);
|
|
302
|
+
(0, _react.useEffect)(function () {
|
|
303
|
+
var isResolved = status === 'resolved';
|
|
304
|
+
var isTableViewMode = currentViewMode === 'issue' || currentViewMode === 'table';
|
|
305
|
+
var isInlineViewMode = currentViewMode === 'count' || currentViewMode === 'inline';
|
|
306
|
+
if (!isResolved) {
|
|
307
|
+
return;
|
|
308
|
+
}
|
|
309
|
+
if (isTableViewMode) {
|
|
310
|
+
fireTableViewedEvent();
|
|
311
|
+
} else if (isInlineViewMode) {
|
|
312
|
+
fireInlineViewedEvent();
|
|
313
|
+
}
|
|
314
|
+
}, [currentViewMode, fireInlineViewedEvent, fireTableViewedEvent, status]);
|
|
315
|
+
var renderTableModalContent = (0, _react.useCallback)(function () {
|
|
278
316
|
if (status === 'rejected') {
|
|
279
317
|
return (0, _react2.jsx)(_modalLoadingError.ModalLoadingError, null);
|
|
280
318
|
} else if (status === 'unauthorized') {
|
|
@@ -298,7 +336,22 @@ var PlainConfluenceSearchConfigModal = exports.PlainConfluenceSearchConfigModal
|
|
|
298
336
|
}
|
|
299
337
|
return confluenceSearchTable;
|
|
300
338
|
}, [columns.length, selectedConfluenceSiteUrl, confluenceSearchTable, resolvedWithNoResults, status, urlBeingEdited, hasConfluenceSearchParams]);
|
|
301
|
-
var
|
|
339
|
+
var renderInlineLinkModalContent = (0, _react.useCallback)(function () {
|
|
340
|
+
if (status === 'unauthorized') {
|
|
341
|
+
return (0, _react2.jsx)(_accessRequired.AccessRequired, {
|
|
342
|
+
url: selectedConfluenceSiteUrl || urlBeingEdited
|
|
343
|
+
});
|
|
344
|
+
} else if (status === 'empty' || !selectedConfluenceSiteUrl) {
|
|
345
|
+
return (0, _react2.jsx)(_countViewSmartLink.SmartCardPlaceholder, {
|
|
346
|
+
placeholderText: _messages.confluenceSearchModalMessages.resultsCountSmartCardPlaceholderText
|
|
347
|
+
});
|
|
348
|
+
} else {
|
|
349
|
+
return confluenceSearchUrl && (0, _react2.jsx)(_countViewSmartLink.SmartLink, {
|
|
350
|
+
url: confluenceSearchUrl
|
|
351
|
+
});
|
|
352
|
+
}
|
|
353
|
+
}, [confluenceSearchUrl, selectedConfluenceSiteUrl, status, urlBeingEdited]);
|
|
354
|
+
var shouldShowResultsCount = !!totalCount && currentViewMode === 'table';
|
|
302
355
|
var onInsertPressed = (0, _react.useCallback)(function (e, analyticsEvent) {
|
|
303
356
|
var _insertButtonClickedE;
|
|
304
357
|
if (!isParametersSet || !cloudId) {
|
|
@@ -309,7 +362,7 @@ var PlainConfluenceSearchConfigModal = exports.PlainConfluenceSearchConfigModal
|
|
|
309
362
|
attributes: _objectSpread(_objectSpread({}, analyticsPayload), {}, {
|
|
310
363
|
totalItemCount: totalCount || 0,
|
|
311
364
|
displayedColumnCount: visibleColumnCount.current,
|
|
312
|
-
display: _types.DatasourceDisplay.DATASOURCE_TABLE,
|
|
365
|
+
display: currentViewMode === 'inline' ? _types.DatasourceDisplay.DATASOURCE_INLINE : _types.DatasourceDisplay.DATASOURCE_TABLE,
|
|
313
366
|
searchCount: searchCount.current,
|
|
314
367
|
searchMethod: _types.DatasourceSearchMethod.DATASOURCE_SEARCH_QUERY,
|
|
315
368
|
actions: Array.from(userInteractionActions.current)
|
|
@@ -318,29 +371,42 @@ var PlainConfluenceSearchConfigModal = exports.PlainConfluenceSearchConfigModal
|
|
|
318
371
|
});
|
|
319
372
|
var consumerEvent = (_insertButtonClickedE = insertButtonClickedEvent.clone()) !== null && _insertButtonClickedE !== void 0 ? _insertButtonClickedE : undefined;
|
|
320
373
|
insertButtonClickedEvent.fire(_analytics.EVENT_CHANNEL);
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
views: [{
|
|
327
|
-
type: 'table',
|
|
328
|
-
properties: {
|
|
329
|
-
columns: (visibleColumnKeys || []).map(function (key) {
|
|
330
|
-
var width = columnCustomSizes === null || columnCustomSizes === void 0 ? void 0 : columnCustomSizes[key];
|
|
331
|
-
var isWrapped = wrappedColumnKeys === null || wrappedColumnKeys === void 0 ? void 0 : wrappedColumnKeys.includes(key);
|
|
332
|
-
return _objectSpread(_objectSpread({
|
|
333
|
-
key: key
|
|
334
|
-
}, width ? {
|
|
335
|
-
width: width
|
|
336
|
-
} : {}), isWrapped ? {
|
|
337
|
-
isWrapped: isWrapped
|
|
338
|
-
} : {});
|
|
339
|
-
})
|
|
374
|
+
if (currentViewMode === 'inline') {
|
|
375
|
+
onInsert({
|
|
376
|
+
type: 'inlineCard',
|
|
377
|
+
attrs: {
|
|
378
|
+
url: confluenceSearchUrl
|
|
340
379
|
}
|
|
341
|
-
}
|
|
342
|
-
}
|
|
343
|
-
|
|
380
|
+
}, consumerEvent);
|
|
381
|
+
} else {
|
|
382
|
+
onInsert((0, _adf.buildDatasourceAdf)({
|
|
383
|
+
id: datasourceId,
|
|
384
|
+
parameters: _objectSpread(_objectSpread({}, parameters), {}, {
|
|
385
|
+
cloudId: cloudId
|
|
386
|
+
}),
|
|
387
|
+
views: [{
|
|
388
|
+
type: 'table',
|
|
389
|
+
properties: {
|
|
390
|
+
columns: (visibleColumnKeys || []).map(function (key) {
|
|
391
|
+
var width = columnCustomSizes === null || columnCustomSizes === void 0 ? void 0 : columnCustomSizes[key];
|
|
392
|
+
var isWrapped = wrappedColumnKeys === null || wrappedColumnKeys === void 0 ? void 0 : wrappedColumnKeys.includes(key);
|
|
393
|
+
return _objectSpread(_objectSpread({
|
|
394
|
+
key: key
|
|
395
|
+
}, width ? {
|
|
396
|
+
width: width
|
|
397
|
+
} : {}), isWrapped ? {
|
|
398
|
+
isWrapped: isWrapped
|
|
399
|
+
} : {});
|
|
400
|
+
})
|
|
401
|
+
}
|
|
402
|
+
}]
|
|
403
|
+
}), consumerEvent);
|
|
404
|
+
}
|
|
405
|
+
}, [isParametersSet, cloudId, analyticsPayload, totalCount, currentViewMode, onInsert, confluenceSearchUrl, datasourceId, parameters, visibleColumnKeys, columnCustomSizes, wrappedColumnKeys]);
|
|
406
|
+
var handleViewModeChange = function handleViewModeChange(selectedMode) {
|
|
407
|
+
userInteractionActions.current.add(_types.DatasourceAction.DISPLAY_VIEW_CHANGED);
|
|
408
|
+
setCurrentViewMode(selectedMode);
|
|
409
|
+
};
|
|
344
410
|
var onSearch = (0, _react.useCallback)(function (newSearchString) {
|
|
345
411
|
searchCount.current++;
|
|
346
412
|
userInteractionActions.current.add(_types.DatasourceAction.QUERY_UPDATED);
|
|
@@ -372,14 +438,17 @@ var PlainConfluenceSearchConfigModal = exports.PlainConfluenceSearchConfigModal
|
|
|
372
438
|
selectedSite: selectedConfluenceSite,
|
|
373
439
|
testId: "confluence-search-datasource-modal--site-selector",
|
|
374
440
|
label: siteSelectorLabel
|
|
375
|
-
}))
|
|
441
|
+
})), !hasNoConfluenceSites && (0, _react2.jsx)(_displayViewDropDown.DisplayViewDropDown, {
|
|
442
|
+
onViewModeChange: handleViewModeChange,
|
|
443
|
+
viewMode: currentViewMode
|
|
444
|
+
})), (0, _react2.jsx)(_modalDialog.ModalBody, null, !hasNoConfluenceSites ? (0, _react2.jsx)(_react.Fragment, null, (0, _react2.jsx)(_primitives.Box, {
|
|
376
445
|
xcss: inputContainerStyles
|
|
377
446
|
}, (0, _react2.jsx)(_confluenceSearchContainer.default, {
|
|
378
447
|
cloudId: cloudId,
|
|
379
448
|
isSearching: status === 'loading',
|
|
380
449
|
onSearch: onSearch,
|
|
381
450
|
initialSearchValue: initialParameters === null || initialParameters === void 0 ? void 0 : initialParameters.searchString
|
|
382
|
-
})),
|
|
451
|
+
})), currentViewMode === 'inline' ? renderInlineLinkModalContent() : renderTableModalContent()) : (0, _react2.jsx)(_noInstances.NoInstancesView, {
|
|
383
452
|
title: _messages.confluenceSearchModalMessages.noAccessToConfluenceSitesTitle,
|
|
384
453
|
description: _messages.confluenceSearchModalMessages.noAccessToConfluenceSitesDescription,
|
|
385
454
|
testId: 'no-confluence-instances-content'
|
|
@@ -50,5 +50,10 @@ var confluenceSearchModalMessages = exports.confluenceSearchModalMessages = (0,
|
|
|
50
50
|
id: 'linkDataSource.confluence-search.no.confluence.sites.access.description',
|
|
51
51
|
description: 'Description that shows in the modal when user has no access to any Confluence sites',
|
|
52
52
|
defaultMessage: 'To request access, contact your admin.'
|
|
53
|
+
},
|
|
54
|
+
resultsCountSmartCardPlaceholderText: {
|
|
55
|
+
id: 'linkDataSource.confluence-search.configmodal.placeholder.issues',
|
|
56
|
+
description: 'Placeholder text that will be placed next to a count of confluence search results',
|
|
57
|
+
defaultMessage: '### Results'
|
|
53
58
|
}
|
|
54
59
|
});
|
|
@@ -27,7 +27,7 @@ var userWrapperStyles = (0, _primitives.xcss)({
|
|
|
27
27
|
fontSize: "".concat(_styled2.fieldTextFontSize, "px")
|
|
28
28
|
});
|
|
29
29
|
var avatarWrapperStyles = (0, _primitives.xcss)({
|
|
30
|
-
marginRight: '
|
|
30
|
+
marginRight: 'space.100'
|
|
31
31
|
});
|
|
32
32
|
var widthObserverWrapperStyles = (0, _primitives.xcss)({
|
|
33
33
|
position: 'relative'
|
|
@@ -44,33 +44,23 @@ var _initialStateView = require("../../common/initial-state-view");
|
|
|
44
44
|
var _messages2 = require("../../common/initial-state-view/messages");
|
|
45
45
|
var _cancelButton = require("../../common/modal/cancel-button");
|
|
46
46
|
var _contentContainer = require("../../common/modal/content-container");
|
|
47
|
+
var _countViewSmartLink = require("../../common/modal/count-view-smart-link");
|
|
48
|
+
var _displayViewDropDown = require("../../common/modal/display-view-dropdown/display-view-drop-down");
|
|
47
49
|
var _siteSelector = require("../../common/modal/site-selector");
|
|
48
50
|
var _issueLikeTable = require("../../issue-like-table");
|
|
49
|
-
var _link = _interopRequireDefault(require("../../issue-like-table/render-type/link"));
|
|
50
51
|
var _ui = require("../basic-filters/ui");
|
|
51
52
|
var _isQueryTooComplex = require("../basic-filters/utils/isQueryTooComplex");
|
|
52
53
|
var _jiraSearchContainer = require("../jira-search-container");
|
|
53
|
-
var _jiraDisplayViewDropDown = require("./jira-display-view-dropdown/jira-display-view-drop-down");
|
|
54
54
|
var _jiraIssuesInitialStateSvg = require("./jira-issues-initial-state-svg");
|
|
55
55
|
var _messages3 = require("./messages");
|
|
56
56
|
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); }
|
|
57
57
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
58
58
|
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; }
|
|
59
59
|
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 */
|
|
60
|
-
var placeholderSmartLinkStyles = (0, _react2.css)({
|
|
61
|
-
backgroundColor: "var(--ds-surface-raised, ".concat(_colors.N0, ")"),
|
|
62
|
-
borderRadius: "var(--ds-border-radius-200, 3px)",
|
|
63
|
-
boxShadow: '0px 1px 1px rgba(9, 30, 66, 0.25), 0px 0px 1px rgba(9, 30, 66, 0.31)',
|
|
64
|
-
color: "var(--ds-text-brand, ".concat(_colors.B400, ")"),
|
|
65
|
-
padding: "var(--ds-space-0, 0px)".concat(" ", "var(--ds-space-025, 2px)")
|
|
66
|
-
});
|
|
67
60
|
var issueCountStyles = (0, _react2.css)({
|
|
68
61
|
flex: 1,
|
|
69
62
|
fontWeight: 600
|
|
70
63
|
});
|
|
71
|
-
var smartLinkContainerStyles = (0, _react2.css)({
|
|
72
|
-
paddingLeft: "var(--ds-space-025, 2px)"
|
|
73
|
-
});
|
|
74
64
|
var getDisplayValue = function getDisplayValue(currentViewMode, itemCount) {
|
|
75
65
|
if (currentViewMode === 'issue') {
|
|
76
66
|
return _types.DatasourceDisplay.DATASOURCE_TABLE;
|
|
@@ -477,12 +467,9 @@ var PlainJiraIssuesConfigModal = exports.PlainJiraIssuesConfigModal = function P
|
|
|
477
467
|
url: selectedJiraSiteUrl || urlBeingEdited
|
|
478
468
|
});
|
|
479
469
|
} else if (status === 'empty' || !jql || !selectedJiraSiteUrl) {
|
|
480
|
-
return (0, _react2.jsx)(
|
|
481
|
-
|
|
482
|
-
}
|
|
483
|
-
"data-testid": "jira-datasource-modal--smart-card-placeholder",
|
|
484
|
-
css: placeholderSmartLinkStyles
|
|
485
|
-
}, (0, _react2.jsx)(_reactIntlNext.FormattedMessage, _messages3.modalMessages.issuesCountSmartCardPlaceholderText)));
|
|
470
|
+
return (0, _react2.jsx)(_countViewSmartLink.SmartCardPlaceholder, {
|
|
471
|
+
placeholderText: _messages3.modalMessages.issuesCountSmartCardPlaceholderText
|
|
472
|
+
});
|
|
486
473
|
} else {
|
|
487
474
|
var url;
|
|
488
475
|
if (responseItems.length === 1 && retrieveUrlForSmartCardRender()) {
|
|
@@ -490,11 +477,9 @@ var PlainJiraIssuesConfigModal = exports.PlainJiraIssuesConfigModal = function P
|
|
|
490
477
|
} else {
|
|
491
478
|
url = "".concat(selectedJiraSiteUrl, "/issues/?jql=").concat((0, _platformFeatureFlags.getBooleanFF)('platform.linking-platform.datasource.enable-stricter-jql-encoding') ? encodeURIComponent(jql) : encodeURI(jql));
|
|
492
479
|
}
|
|
493
|
-
return (0, _react2.jsx)(
|
|
494
|
-
css: smartLinkContainerStyles
|
|
495
|
-
}, (0, _react2.jsx)(_link.default, {
|
|
480
|
+
return (0, _react2.jsx)(_countViewSmartLink.SmartLink, {
|
|
496
481
|
url: url
|
|
497
|
-
})
|
|
482
|
+
});
|
|
498
483
|
}
|
|
499
484
|
}, [jql, selectedJiraSite === null || selectedJiraSite === void 0 ? void 0 : selectedJiraSite.url, status, urlBeingEdited, responseItems, retrieveUrlForSmartCardRender]);
|
|
500
485
|
var renderIssuesModeContent = (0, _react.useCallback)(function () {
|
|
@@ -557,7 +542,7 @@ var PlainJiraIssuesConfigModal = exports.PlainJiraIssuesConfigModal = function P
|
|
|
557
542
|
selectedSite: selectedJiraSite,
|
|
558
543
|
testId: "jira-datasource-modal--site-selector",
|
|
559
544
|
label: siteSelectorLabel
|
|
560
|
-
})), !hasNoJiraSites && (0, _react2.jsx)(
|
|
545
|
+
})), !hasNoJiraSites && (0, _react2.jsx)(_displayViewDropDown.DisplayViewDropDown, {
|
|
561
546
|
onViewModeChange: handleViewModeChange,
|
|
562
547
|
viewMode: currentViewMode
|
|
563
548
|
})), (0, _react2.jsx)(_modalDialog.ModalBody, null, !hasNoJiraSites ? (0, _react2.jsx)(_react.Fragment, null, (0, _react2.jsx)(_jiraSearchContainer.JiraSearchContainer, {
|
|
@@ -21,26 +21,6 @@ var modalMessages = exports.modalMessages = (0, _reactIntlNext.defineMessages)({
|
|
|
21
21
|
description: 'Title for the Jira Issues modal when a user has to select a site to inserting issues from',
|
|
22
22
|
defaultMessage: 'Insert Jira issues from'
|
|
23
23
|
},
|
|
24
|
-
tableViewModeLabel: {
|
|
25
|
-
id: 'linkDataSource.jira-issues.configmodal.tableViewModeLabel',
|
|
26
|
-
description: 'Display Jira search results as a table',
|
|
27
|
-
defaultMessage: 'Table'
|
|
28
|
-
},
|
|
29
|
-
tableViewModeDescription: {
|
|
30
|
-
id: 'linkDataSource.jira-issues.configmodal.tableViewModeDescription',
|
|
31
|
-
description: 'Description for table view mode',
|
|
32
|
-
defaultMessage: 'Display Jira search results as a table'
|
|
33
|
-
},
|
|
34
|
-
inlineLinkViewModeLabel: {
|
|
35
|
-
id: 'linkDataSource.jira-issues.configmodal.inlineLinkViewModeLabel',
|
|
36
|
-
description: 'Display the number of search results as an inline smart link',
|
|
37
|
-
defaultMessage: 'Inline link'
|
|
38
|
-
},
|
|
39
|
-
inlineLinkViewModeDescription: {
|
|
40
|
-
id: 'linkDataSource.jira-issues.configmodal.inlineLinkViewModeDescription',
|
|
41
|
-
description: 'Description for inline link view mode',
|
|
42
|
-
defaultMessage: 'Display the number of search results or as an inline smart link'
|
|
43
|
-
},
|
|
44
24
|
issuesCountSmartCardPlaceholderText: {
|
|
45
25
|
id: 'linkDataSource.jira-issues.configmodal.placeholder.issues',
|
|
46
26
|
description: 'Placeholder text that will be placed next to a count of jira issues',
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import { css, jsx } from '@emotion/react';
|
|
3
|
+
import { FormattedMessage } from 'react-intl-next';
|
|
4
|
+
import { B400, N0 } from '@atlaskit/theme/colors';
|
|
5
|
+
import LinkRenderType from '../../../issue-like-table/render-type/link';
|
|
6
|
+
const placeholderSmartLinkStyles = css({
|
|
7
|
+
backgroundColor: `var(--ds-surface-raised, ${N0})`,
|
|
8
|
+
borderRadius: "var(--ds-border-radius-200, 3px)",
|
|
9
|
+
boxShadow: '0px 1px 1px rgba(9, 30, 66, 0.25), 0px 0px 1px rgba(9, 30, 66, 0.31)',
|
|
10
|
+
color: `var(--ds-text-brand, ${B400})`,
|
|
11
|
+
padding: `${"var(--ds-space-0, 0px)"} ${"var(--ds-space-025, 2px)"}`
|
|
12
|
+
});
|
|
13
|
+
const smartLinkContainerStyles = css({
|
|
14
|
+
paddingLeft: "var(--ds-space-025, 2px)"
|
|
15
|
+
});
|
|
16
|
+
export const SmartCardPlaceholder = ({
|
|
17
|
+
placeholderText
|
|
18
|
+
}) => jsx("div", {
|
|
19
|
+
css: smartLinkContainerStyles
|
|
20
|
+
}, jsx("span", {
|
|
21
|
+
"data-testid": `datasource-modal--smart-card-placeholder`,
|
|
22
|
+
css: placeholderSmartLinkStyles
|
|
23
|
+
}, jsx(FormattedMessage, placeholderText)));
|
|
24
|
+
export const SmartLink = ({
|
|
25
|
+
url
|
|
26
|
+
}) => jsx("div", {
|
|
27
|
+
css: smartLinkContainerStyles
|
|
28
|
+
}, jsx(LinkRenderType, {
|
|
29
|
+
url: url
|
|
30
|
+
}));
|