@atlaskit/link-datasource 2.5.2 → 2.5.3
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 +8 -0
- package/dist/cjs/ui/common/modal/search-count/index.js +66 -0
- package/dist/cjs/ui/common/modal/search-count/messages.js +24 -0
- package/dist/cjs/ui/confluence-search-modal/modal/index.js +7 -26
- package/dist/cjs/ui/jira-issues-modal/modal/index.js +7 -25
- package/dist/cjs/ui/table-footer/index.js +8 -30
- package/dist/es2019/ui/common/modal/search-count/index.js +58 -0
- package/dist/es2019/ui/common/modal/search-count/messages.js +18 -0
- package/dist/es2019/ui/confluence-search-modal/modal/index.js +8 -27
- package/dist/es2019/ui/jira-issues-modal/modal/index.js +9 -27
- package/dist/es2019/ui/table-footer/index.js +10 -32
- package/dist/esm/ui/common/modal/search-count/index.js +59 -0
- package/dist/esm/ui/common/modal/search-count/messages.js +18 -0
- package/dist/esm/ui/confluence-search-modal/modal/index.js +8 -27
- package/dist/esm/ui/jira-issues-modal/modal/index.js +9 -27
- package/dist/esm/ui/table-footer/index.js +10 -32
- package/dist/types/ui/common/modal/search-count/index.d.ts +9 -0
- package/dist/types/ui/common/modal/search-count/messages.d.ts +17 -0
- package/dist/types-ts4.5/ui/common/modal/search-count/index.d.ts +9 -0
- package/dist/types-ts4.5/ui/common/modal/search-count/messages.d.ts +17 -0
- package/package.json +4 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @atlaskit/link-datasource
|
|
2
2
|
|
|
3
|
+
## 2.5.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#113477](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/113477)
|
|
8
|
+
[`2c509c4c06447`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/2c509c4c06447) -
|
|
9
|
+
Updated search count to be displayed from a common component with single i18n message string.
|
|
10
|
+
|
|
3
11
|
## 2.5.2
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = void 0;
|
|
8
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
|
+
var _react = _interopRequireDefault(require("react"));
|
|
10
|
+
var _reactIntlNext = require("react-intl-next");
|
|
11
|
+
var _heading = _interopRequireDefault(require("@atlaskit/heading"));
|
|
12
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
13
|
+
var _primitives = require("@atlaskit/primitives");
|
|
14
|
+
var _linkUrl = _interopRequireDefault(require("@atlaskit/smart-card/link-url"));
|
|
15
|
+
var _colors = require("@atlaskit/theme/colors");
|
|
16
|
+
var _messages = require("../../../confluence-search-modal/modal/messages");
|
|
17
|
+
var _messages2 = require("../../../jira-issues-modal/modal/messages");
|
|
18
|
+
var _messages3 = require("../../../table-footer/messages");
|
|
19
|
+
var _messages4 = require("./messages");
|
|
20
|
+
var searchCountStyles = (0, _primitives.xcss)({
|
|
21
|
+
flex: 1
|
|
22
|
+
});
|
|
23
|
+
var TableSearchCount = function TableSearchCount(_ref) {
|
|
24
|
+
var url = _ref.url,
|
|
25
|
+
searchCount = _ref.searchCount,
|
|
26
|
+
_ref$testId = _ref.testId,
|
|
27
|
+
testId = _ref$testId === void 0 ? 'datasource-table-total-results-count' : _ref$testId,
|
|
28
|
+
_ref$prefixTextType = _ref.prefixTextType,
|
|
29
|
+
prefixTextType = _ref$prefixTextType === void 0 ? 'issue' : _ref$prefixTextType;
|
|
30
|
+
return /*#__PURE__*/_react.default.createElement(_primitives.Flex, {
|
|
31
|
+
testId: testId,
|
|
32
|
+
xcss: searchCountStyles,
|
|
33
|
+
alignItems: "center"
|
|
34
|
+
}, /*#__PURE__*/_react.default.createElement(_linkUrl.default, {
|
|
35
|
+
href: url,
|
|
36
|
+
target: "_blank",
|
|
37
|
+
testId: "item-count-url"
|
|
38
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
39
|
+
,
|
|
40
|
+
style: {
|
|
41
|
+
color: "var(--ds-text-accent-gray, ".concat(_colors.N800, ")"),
|
|
42
|
+
textDecoration: !url ? 'none' : ''
|
|
43
|
+
}
|
|
44
|
+
}, /*#__PURE__*/_react.default.createElement(_heading.default, {
|
|
45
|
+
level: "h200"
|
|
46
|
+
}, (0, _platformFeatureFlags.getBooleanFF)('platform.linking-platform.datasource.total-count-i18n-single-key') ? /*#__PURE__*/_react.default.createElement(_reactIntlNext.FormattedMessage, (0, _extends2.default)({}, _messages4.searchCountMessages["".concat(prefixTextType, "CountText")], {
|
|
47
|
+
values: {
|
|
48
|
+
searchCount: searchCount
|
|
49
|
+
}
|
|
50
|
+
})) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_reactIntlNext.FormattedNumber, {
|
|
51
|
+
value: searchCount
|
|
52
|
+
}), ' ', prefixTextType === 'issue' && /*#__PURE__*/_react.default.createElement(_reactIntlNext.FormattedMessage, (0, _extends2.default)({}, _messages2.modalMessages.issueText, {
|
|
53
|
+
values: {
|
|
54
|
+
totalCount: searchCount
|
|
55
|
+
}
|
|
56
|
+
})), prefixTextType === 'result' && /*#__PURE__*/_react.default.createElement(_reactIntlNext.FormattedMessage, (0, _extends2.default)({}, _messages.confluenceSearchModalMessages.searchCountText, {
|
|
57
|
+
values: {
|
|
58
|
+
totalCount: searchCount
|
|
59
|
+
}
|
|
60
|
+
})), prefixTextType === 'item' && /*#__PURE__*/_react.default.createElement(_reactIntlNext.FormattedMessage, (0, _extends2.default)({}, _messages3.footerMessages.itemText, {
|
|
61
|
+
values: {
|
|
62
|
+
itemCount: searchCount
|
|
63
|
+
}
|
|
64
|
+
}))))));
|
|
65
|
+
};
|
|
66
|
+
var _default = exports.default = TableSearchCount;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.searchCountMessages = void 0;
|
|
7
|
+
var _reactIntlNext = require("react-intl-next");
|
|
8
|
+
var searchCountMessages = exports.searchCountMessages = (0, _reactIntlNext.defineMessages)({
|
|
9
|
+
resultCountText: {
|
|
10
|
+
id: 'linkDataSource.search.configmodal.resultCountText',
|
|
11
|
+
description: 'Text that indicates the number of search results.',
|
|
12
|
+
defaultMessage: '{searchCount, plural, one {# result} other {# results}}'
|
|
13
|
+
},
|
|
14
|
+
issueCountText: {
|
|
15
|
+
id: 'linkDataSource.search.configmodal.issueCountText',
|
|
16
|
+
description: 'Text that indicates the number of jira issues in the search result.',
|
|
17
|
+
defaultMessage: '{searchCount, plural, one {# issue} other {# issues}}'
|
|
18
|
+
},
|
|
19
|
+
itemCountText: {
|
|
20
|
+
id: 'linkDataSource.search.configmodal.itemCountText',
|
|
21
|
+
description: 'Text that indicates the number of items in the search result.',
|
|
22
|
+
defaultMessage: '{searchCount, plural, one {# item} other {# items}}'
|
|
23
|
+
}
|
|
24
|
+
});
|
|
@@ -5,7 +5,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.PlainConfluenceSearchConfigModal = exports.ConfluenceSearchConfigModal = void 0;
|
|
8
|
-
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
10
9
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
11
10
|
var _react = require("react");
|
|
@@ -17,8 +16,6 @@ var _intlMessagesProvider = require("@atlaskit/intl-messages-provider");
|
|
|
17
16
|
var _modalDialog = require("@atlaskit/modal-dialog");
|
|
18
17
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
19
18
|
var _primitives = require("@atlaskit/primitives");
|
|
20
|
-
var _linkUrl = _interopRequireDefault(require("@atlaskit/smart-card/link-url"));
|
|
21
|
-
var _colors = require("@atlaskit/theme/colors");
|
|
22
19
|
var _analytics = require("../../../analytics");
|
|
23
20
|
var _constants = require("../../../analytics/constants");
|
|
24
21
|
var _types = require("../../../analytics/types");
|
|
@@ -39,6 +36,7 @@ var _contentContainer = require("../../common/modal/content-container");
|
|
|
39
36
|
var _countViewSmartLink = require("../../common/modal/count-view-smart-link");
|
|
40
37
|
var _datasourceModal = require("../../common/modal/datasource-modal");
|
|
41
38
|
var _displayViewDropDown = require("../../common/modal/display-view-dropdown/display-view-drop-down");
|
|
39
|
+
var _searchCount = _interopRequireDefault(require("../../common/modal/search-count"));
|
|
42
40
|
var _siteSelector = require("../../common/modal/site-selector");
|
|
43
41
|
var _issueLikeTable = require("../../issue-like-table");
|
|
44
42
|
var _useColumnResize2 = require("../../issue-like-table/use-column-resize");
|
|
@@ -54,10 +52,6 @@ var inputContainerStyles = (0, _primitives.xcss)({
|
|
|
54
52
|
display: 'flex',
|
|
55
53
|
minHeight: '72px'
|
|
56
54
|
});
|
|
57
|
-
var searchCountStyles = (0, _primitives.xcss)({
|
|
58
|
-
flex: 1,
|
|
59
|
-
fontWeight: 600
|
|
60
|
-
});
|
|
61
55
|
var PlainConfluenceSearchConfigModal = exports.PlainConfluenceSearchConfigModal = function PlainConfluenceSearchConfigModal(props) {
|
|
62
56
|
var datasourceId = props.datasourceId,
|
|
63
57
|
initialColumnCustomSizes = props.columnCustomSizes,
|
|
@@ -442,25 +436,12 @@ var PlainConfluenceSearchConfigModal = exports.PlainConfluenceSearchConfigModal
|
|
|
442
436
|
title: _messages.confluenceSearchModalMessages.noAccessToConfluenceSitesTitle,
|
|
443
437
|
description: _messages.confluenceSearchModalMessages.noAccessToConfluenceSitesDescription,
|
|
444
438
|
testId: 'no-confluence-instances-content'
|
|
445
|
-
})), (0, _react2.jsx)(_modalDialog.ModalFooter, null, shouldShowResultsCount && confluenceSearchUrl && (0, _react2.jsx)(
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
testId: "item-count-url"
|
|
452
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
453
|
-
,
|
|
454
|
-
style: {
|
|
455
|
-
color: "var(--ds-text-accent-gray, ".concat(_colors.N800, ")")
|
|
456
|
-
}
|
|
457
|
-
}, (0, _react2.jsx)(_reactIntlNext.FormattedNumber, {
|
|
458
|
-
value: totalCount
|
|
459
|
-
}), ' ', (0, _react2.jsx)(_reactIntlNext.FormattedMessage, (0, _extends2.default)({}, _messages.confluenceSearchModalMessages.searchCountText, {
|
|
460
|
-
values: {
|
|
461
|
-
totalCount: totalCount
|
|
462
|
-
}
|
|
463
|
-
})))), (0, _react2.jsx)(_cancelButton.CancelButton, {
|
|
439
|
+
})), (0, _react2.jsx)(_modalDialog.ModalFooter, null, shouldShowResultsCount && confluenceSearchUrl && (0, _react2.jsx)(_searchCount.default, {
|
|
440
|
+
searchCount: totalCount,
|
|
441
|
+
url: confluenceSearchUrl,
|
|
442
|
+
prefixTextType: "result",
|
|
443
|
+
testId: "confluence-search-datasource-modal-total-results-count"
|
|
444
|
+
}), (0, _react2.jsx)(_cancelButton.CancelButton, {
|
|
464
445
|
onCancel: onCancel,
|
|
465
446
|
getAnalyticsPayload: getCancelButtonAnalyticsPayload,
|
|
466
447
|
testId: "confluence-search-modal--cancel-button"
|
|
@@ -16,8 +16,6 @@ var _standardButton = _interopRequireDefault(require("@atlaskit/button/standard-
|
|
|
16
16
|
var _intlMessagesProvider = require("@atlaskit/intl-messages-provider");
|
|
17
17
|
var _modalDialog = require("@atlaskit/modal-dialog");
|
|
18
18
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
19
|
-
var _linkUrl = _interopRequireDefault(require("@atlaskit/smart-card/link-url"));
|
|
20
|
-
var _colors = require("@atlaskit/theme/colors");
|
|
21
19
|
var _analytics = require("../../../analytics");
|
|
22
20
|
var _constants = require("../../../analytics/constants");
|
|
23
21
|
var _types = require("../../../analytics/types");
|
|
@@ -44,6 +42,7 @@ var _contentContainer = require("../../common/modal/content-container");
|
|
|
44
42
|
var _countViewSmartLink = require("../../common/modal/count-view-smart-link");
|
|
45
43
|
var _datasourceModal = require("../../common/modal/datasource-modal");
|
|
46
44
|
var _displayViewDropDown = require("../../common/modal/display-view-dropdown/display-view-drop-down");
|
|
45
|
+
var _searchCount = _interopRequireDefault(require("../../common/modal/search-count"));
|
|
47
46
|
var _siteSelector = require("../../common/modal/site-selector");
|
|
48
47
|
var _issueLikeTable = require("../../issue-like-table");
|
|
49
48
|
var _useColumnResize2 = require("../../issue-like-table/use-column-resize");
|
|
@@ -56,10 +55,6 @@ var _jiraIssuesInitialStateSvg = require("./jira-issues-initial-state-svg");
|
|
|
56
55
|
var _messages3 = require("./messages");
|
|
57
56
|
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; }
|
|
58
57
|
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 */ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
59
|
-
var issueCountStyles = (0, _react2.css)({
|
|
60
|
-
flex: 1,
|
|
61
|
-
fontWeight: 600
|
|
62
|
-
});
|
|
63
58
|
var getDisplayValue = function getDisplayValue(currentViewMode, itemCount) {
|
|
64
59
|
if (currentViewMode === 'table') {
|
|
65
60
|
return _types.DatasourceDisplay.DATASOURCE_TABLE;
|
|
@@ -481,25 +476,12 @@ var PlainJiraIssuesConfigModal = function PlainJiraIssuesConfigModal(props) {
|
|
|
481
476
|
title: _messages.loadingErrorMessages.noAccessToJiraSitesTitle,
|
|
482
477
|
description: _messages.loadingErrorMessages.noAccessToJiraSitesDescription,
|
|
483
478
|
testId: "no-jira-instances-content"
|
|
484
|
-
})), (0, _react2.jsx)(_modalDialog.ModalFooter, null, shouldShowIssueCount && (0, _react2.jsx)(
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
testId: "item-count-url"
|
|
491
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
492
|
-
,
|
|
493
|
-
style: {
|
|
494
|
-
color: "var(--ds-text-accent-gray, ".concat(_colors.N800, ")")
|
|
495
|
-
}
|
|
496
|
-
}, (0, _react2.jsx)(_reactIntlNext.FormattedNumber, {
|
|
497
|
-
value: totalCount
|
|
498
|
-
}), ' ', (0, _react2.jsx)(_reactIntlNext.FormattedMessage, (0, _extends2.default)({}, _messages3.modalMessages.issueText, {
|
|
499
|
-
values: {
|
|
500
|
-
totalCount: totalCount
|
|
501
|
-
}
|
|
502
|
-
})))), (0, _react2.jsx)(_cancelButton.CancelButton, {
|
|
479
|
+
})), (0, _react2.jsx)(_modalDialog.ModalFooter, null, shouldShowIssueCount && (0, _react2.jsx)(_searchCount.default, {
|
|
480
|
+
searchCount: totalCount,
|
|
481
|
+
url: jqlUrl,
|
|
482
|
+
prefixTextType: "issue",
|
|
483
|
+
testId: "jira-datasource-modal-total-issues-count"
|
|
484
|
+
}), (0, _react2.jsx)(_cancelButton.CancelButton, {
|
|
503
485
|
onCancel: onCancel,
|
|
504
486
|
getAnalyticsPayload: getCancelButtonAnalyticsPayload,
|
|
505
487
|
testId: "jira-datasource-modal--cancel-button"
|
|
@@ -5,18 +5,17 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.TableFooter = void 0;
|
|
8
|
-
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
8
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
10
9
|
var _react = require("react");
|
|
11
10
|
var _react2 = require("@emotion/react");
|
|
12
11
|
var _styled = _interopRequireDefault(require("@emotion/styled"));
|
|
13
12
|
var _reactIntlNext = require("react-intl-next");
|
|
14
13
|
var _button = _interopRequireDefault(require("@atlaskit/button"));
|
|
15
|
-
var _heading = _interopRequireDefault(require("@atlaskit/heading"));
|
|
16
14
|
var _refresh = _interopRequireDefault(require("@atlaskit/icon/glyph/refresh"));
|
|
17
|
-
var
|
|
15
|
+
var _primitives = require("@atlaskit/primitives");
|
|
18
16
|
var _colors = require("@atlaskit/theme/colors");
|
|
19
17
|
var _assetsModal = require("../assets-modal");
|
|
18
|
+
var _searchCount = _interopRequireDefault(require("../common/modal/search-count"));
|
|
20
19
|
var _messages = require("./messages");
|
|
21
20
|
var _poweredByJsmAssets = require("./powered-by-jsm-assets");
|
|
22
21
|
var _syncInfo = require("./sync-info");
|
|
@@ -45,12 +44,6 @@ var TopBorderWrapper = _styled.default.div({
|
|
|
45
44
|
padding: "var(--ds-space-250, 20px)".concat(" ", "var(--ds-space-0, 0px)")
|
|
46
45
|
});
|
|
47
46
|
|
|
48
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled -- To migrate as part of go/ui-styling-standard
|
|
49
|
-
var ItemCounterWrapper = _styled.default.div({
|
|
50
|
-
display: 'flex',
|
|
51
|
-
alignSelf: 'center'
|
|
52
|
-
});
|
|
53
|
-
|
|
54
47
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled -- To migrate as part of go/ui-styling-standard
|
|
55
48
|
var SyncWrapper = _styled.default.div({
|
|
56
49
|
display: 'flex',
|
|
@@ -85,27 +78,12 @@ var TableFooter = exports.TableFooter = function TableFooter(_ref) {
|
|
|
85
78
|
// ensure correct positioning since 'justify-content: space-between' is used).
|
|
86
79
|
return onRefresh || showItemCount ? (0, _react2.jsx)(FooterWrapper, {
|
|
87
80
|
"data-testid": "table-footer"
|
|
88
|
-
}, (0, _react2.jsx)(TopBorderWrapper, null, (0, _react2.jsx)(
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
style: {
|
|
95
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
96
|
-
color: "var(--ds-text-accent-gray, ".concat(_colors.N800, ")"),
|
|
97
|
-
textDecoration: !url ? 'none' : ''
|
|
98
|
-
}
|
|
99
|
-
}, (0, _react2.jsx)(_heading.default, {
|
|
100
|
-
testId: "item-count",
|
|
101
|
-
level: "h200"
|
|
102
|
-
}, (0, _react2.jsx)(_reactIntlNext.FormattedNumber, {
|
|
103
|
-
value: itemCount
|
|
104
|
-
}), ' ', (0, _react2.jsx)(_reactIntlNext.FormattedMessage, (0, _extends2.default)({}, _messages.footerMessages.itemText, {
|
|
105
|
-
values: {
|
|
106
|
-
itemCount: itemCount
|
|
107
|
-
}
|
|
108
|
-
}))))), datasourceId === _assetsModal.ASSETS_LIST_OF_LINKS_DATASOURCE_ID ? (0, _react2.jsx)(_poweredByJsmAssets.PoweredByJSMAssets, {
|
|
81
|
+
}, (0, _react2.jsx)(TopBorderWrapper, null, showItemCount && (0, _react2.jsx)(_primitives.Flex, null, (0, _react2.jsx)(_searchCount.default, {
|
|
82
|
+
searchCount: itemCount,
|
|
83
|
+
url: url,
|
|
84
|
+
prefixTextType: "item",
|
|
85
|
+
testId: "item-count"
|
|
86
|
+
})), datasourceId === _assetsModal.ASSETS_LIST_OF_LINKS_DATASOURCE_ID ? (0, _react2.jsx)(_poweredByJsmAssets.PoweredByJSMAssets, {
|
|
109
87
|
text: intl.formatMessage(_messages.footerMessages.powerByJSM)
|
|
110
88
|
}) : null, (0, _react2.jsx)(SyncWrapper, null, onRefresh && (0, _react2.jsx)(_react.Fragment, null, (0, _react2.jsx)(SyncTextWrapper, {
|
|
111
89
|
"data-testid": "sync-text"
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { FormattedMessage, FormattedNumber } from 'react-intl-next';
|
|
4
|
+
import Heading from '@atlaskit/heading';
|
|
5
|
+
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
6
|
+
import { Flex, xcss } from '@atlaskit/primitives';
|
|
7
|
+
import LinkUrl from '@atlaskit/smart-card/link-url';
|
|
8
|
+
import { N800 } from '@atlaskit/theme/colors';
|
|
9
|
+
import { confluenceSearchModalMessages } from '../../../confluence-search-modal/modal/messages';
|
|
10
|
+
import { modalMessages } from '../../../jira-issues-modal/modal/messages';
|
|
11
|
+
import { footerMessages } from '../../../table-footer/messages';
|
|
12
|
+
import { searchCountMessages } from './messages';
|
|
13
|
+
const searchCountStyles = xcss({
|
|
14
|
+
flex: 1
|
|
15
|
+
});
|
|
16
|
+
const TableSearchCount = ({
|
|
17
|
+
url,
|
|
18
|
+
searchCount,
|
|
19
|
+
testId = 'datasource-table-total-results-count',
|
|
20
|
+
prefixTextType = 'issue'
|
|
21
|
+
}) => {
|
|
22
|
+
return /*#__PURE__*/React.createElement(Flex, {
|
|
23
|
+
testId: testId,
|
|
24
|
+
xcss: searchCountStyles,
|
|
25
|
+
alignItems: "center"
|
|
26
|
+
}, /*#__PURE__*/React.createElement(LinkUrl, {
|
|
27
|
+
href: url,
|
|
28
|
+
target: "_blank",
|
|
29
|
+
testId: "item-count-url"
|
|
30
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
31
|
+
,
|
|
32
|
+
style: {
|
|
33
|
+
color: `var(--ds-text-accent-gray, ${N800})`,
|
|
34
|
+
textDecoration: !url ? 'none' : ''
|
|
35
|
+
}
|
|
36
|
+
}, /*#__PURE__*/React.createElement(Heading, {
|
|
37
|
+
level: "h200"
|
|
38
|
+
}, getBooleanFF('platform.linking-platform.datasource.total-count-i18n-single-key') ? /*#__PURE__*/React.createElement(FormattedMessage, _extends({}, searchCountMessages[`${prefixTextType}CountText`], {
|
|
39
|
+
values: {
|
|
40
|
+
searchCount
|
|
41
|
+
}
|
|
42
|
+
})) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(FormattedNumber, {
|
|
43
|
+
value: searchCount
|
|
44
|
+
}), ' ', prefixTextType === 'issue' && /*#__PURE__*/React.createElement(FormattedMessage, _extends({}, modalMessages.issueText, {
|
|
45
|
+
values: {
|
|
46
|
+
totalCount: searchCount
|
|
47
|
+
}
|
|
48
|
+
})), prefixTextType === 'result' && /*#__PURE__*/React.createElement(FormattedMessage, _extends({}, confluenceSearchModalMessages.searchCountText, {
|
|
49
|
+
values: {
|
|
50
|
+
totalCount: searchCount
|
|
51
|
+
}
|
|
52
|
+
})), prefixTextType === 'item' && /*#__PURE__*/React.createElement(FormattedMessage, _extends({}, footerMessages.itemText, {
|
|
53
|
+
values: {
|
|
54
|
+
itemCount: searchCount
|
|
55
|
+
}
|
|
56
|
+
}))))));
|
|
57
|
+
};
|
|
58
|
+
export default TableSearchCount;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { defineMessages } from 'react-intl-next';
|
|
2
|
+
export const searchCountMessages = defineMessages({
|
|
3
|
+
resultCountText: {
|
|
4
|
+
id: 'linkDataSource.search.configmodal.resultCountText',
|
|
5
|
+
description: 'Text that indicates the number of search results.',
|
|
6
|
+
defaultMessage: '{searchCount, plural, one {# result} other {# results}}'
|
|
7
|
+
},
|
|
8
|
+
issueCountText: {
|
|
9
|
+
id: 'linkDataSource.search.configmodal.issueCountText',
|
|
10
|
+
description: 'Text that indicates the number of jira issues in the search result.',
|
|
11
|
+
defaultMessage: '{searchCount, plural, one {# issue} other {# issues}}'
|
|
12
|
+
},
|
|
13
|
+
itemCountText: {
|
|
14
|
+
id: 'linkDataSource.search.configmodal.itemCountText',
|
|
15
|
+
description: 'Text that indicates the number of items in the search result.',
|
|
16
|
+
defaultMessage: '{searchCount, plural, one {# item} other {# items}}'
|
|
17
|
+
}
|
|
18
|
+
});
|
|
@@ -1,18 +1,15 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/extends";
|
|
2
1
|
/** @jsx jsx */
|
|
3
2
|
import { Fragment, useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
4
3
|
|
|
5
4
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
6
5
|
import { jsx } from '@emotion/react';
|
|
7
|
-
import { FormattedMessage
|
|
6
|
+
import { FormattedMessage } from 'react-intl-next';
|
|
8
7
|
import { withAnalyticsContext } from '@atlaskit/analytics-next';
|
|
9
8
|
import Button from '@atlaskit/button/standard-button';
|
|
10
9
|
import { IntlMessagesProvider } from '@atlaskit/intl-messages-provider';
|
|
11
10
|
import { ModalBody, ModalFooter, ModalHeader, ModalTitle } from '@atlaskit/modal-dialog';
|
|
12
11
|
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
13
12
|
import { Box, xcss } from '@atlaskit/primitives';
|
|
14
|
-
import LinkUrl from '@atlaskit/smart-card/link-url';
|
|
15
|
-
import { N800 } from '@atlaskit/theme/colors';
|
|
16
13
|
import { EVENT_CHANNEL, useDatasourceAnalyticsEvents } from '../../../analytics';
|
|
17
14
|
import { componentMetadata } from '../../../analytics/constants';
|
|
18
15
|
import { DatasourceAction, DatasourceDisplay, DatasourceSearchMethod } from '../../../analytics/types';
|
|
@@ -33,6 +30,7 @@ import { ContentContainer } from '../../common/modal/content-container';
|
|
|
33
30
|
import { SmartCardPlaceholder, SmartLink } from '../../common/modal/count-view-smart-link';
|
|
34
31
|
import { DatasourceModal } from '../../common/modal/datasource-modal';
|
|
35
32
|
import { DisplayViewDropDown } from '../../common/modal/display-view-dropdown/display-view-drop-down';
|
|
33
|
+
import TableSearchCount from '../../common/modal/search-count';
|
|
36
34
|
import { SiteSelector } from '../../common/modal/site-selector';
|
|
37
35
|
import { EmptyState, IssueLikeDataTableView } from '../../issue-like-table';
|
|
38
36
|
import { useColumnResize } from '../../issue-like-table/use-column-resize';
|
|
@@ -46,10 +44,6 @@ const inputContainerStyles = xcss({
|
|
|
46
44
|
display: 'flex',
|
|
47
45
|
minHeight: '72px'
|
|
48
46
|
});
|
|
49
|
-
const searchCountStyles = xcss({
|
|
50
|
-
flex: 1,
|
|
51
|
-
fontWeight: 600
|
|
52
|
-
});
|
|
53
47
|
export const PlainConfluenceSearchConfigModal = props => {
|
|
54
48
|
const {
|
|
55
49
|
datasourceId,
|
|
@@ -417,25 +411,12 @@ export const PlainConfluenceSearchConfigModal = props => {
|
|
|
417
411
|
title: confluenceSearchModalMessages.noAccessToConfluenceSitesTitle,
|
|
418
412
|
description: confluenceSearchModalMessages.noAccessToConfluenceSitesDescription,
|
|
419
413
|
testId: 'no-confluence-instances-content'
|
|
420
|
-
})), jsx(ModalFooter, null, shouldShowResultsCount && confluenceSearchUrl && jsx(
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
testId: "item-count-url"
|
|
427
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
428
|
-
,
|
|
429
|
-
style: {
|
|
430
|
-
color: `var(--ds-text-accent-gray, ${N800})`
|
|
431
|
-
}
|
|
432
|
-
}, jsx(FormattedNumber, {
|
|
433
|
-
value: totalCount
|
|
434
|
-
}), ' ', jsx(FormattedMessage, _extends({}, confluenceSearchModalMessages.searchCountText, {
|
|
435
|
-
values: {
|
|
436
|
-
totalCount
|
|
437
|
-
}
|
|
438
|
-
})))), jsx(CancelButton, {
|
|
414
|
+
})), jsx(ModalFooter, null, shouldShowResultsCount && confluenceSearchUrl && jsx(TableSearchCount, {
|
|
415
|
+
searchCount: totalCount,
|
|
416
|
+
url: confluenceSearchUrl,
|
|
417
|
+
prefixTextType: "result",
|
|
418
|
+
testId: "confluence-search-datasource-modal-total-results-count"
|
|
419
|
+
}), jsx(CancelButton, {
|
|
439
420
|
onCancel: onCancel,
|
|
440
421
|
getAnalyticsPayload: getCancelButtonAnalyticsPayload,
|
|
441
422
|
testId: "confluence-search-modal--cancel-button"
|
|
@@ -3,15 +3,13 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
3
3
|
import { Fragment, useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
4
4
|
|
|
5
5
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
6
|
-
import {
|
|
7
|
-
import { FormattedMessage
|
|
6
|
+
import { jsx } from '@emotion/react';
|
|
7
|
+
import { FormattedMessage } from 'react-intl-next';
|
|
8
8
|
import { withAnalyticsContext } from '@atlaskit/analytics-next';
|
|
9
9
|
import Button from '@atlaskit/button/standard-button';
|
|
10
10
|
import { IntlMessagesProvider } from '@atlaskit/intl-messages-provider';
|
|
11
11
|
import { ModalBody, ModalFooter, ModalHeader, ModalTitle, ModalTransition } from '@atlaskit/modal-dialog';
|
|
12
12
|
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
13
|
-
import LinkUrl from '@atlaskit/smart-card/link-url';
|
|
14
|
-
import { N800 } from '@atlaskit/theme/colors';
|
|
15
13
|
import { EVENT_CHANNEL, useDatasourceAnalyticsEvents } from '../../../analytics';
|
|
16
14
|
import { componentMetadata } from '../../../analytics/constants';
|
|
17
15
|
import { DatasourceAction, DatasourceDisplay } from '../../../analytics/types';
|
|
@@ -38,6 +36,7 @@ import { ContentContainer } from '../../common/modal/content-container';
|
|
|
38
36
|
import { SmartCardPlaceholder, SmartLink } from '../../common/modal/count-view-smart-link';
|
|
39
37
|
import { DatasourceModal } from '../../common/modal/datasource-modal';
|
|
40
38
|
import { DisplayViewDropDown } from '../../common/modal/display-view-dropdown/display-view-drop-down';
|
|
39
|
+
import TableSearchCount from '../../common/modal/search-count';
|
|
41
40
|
import { SiteSelector } from '../../common/modal/site-selector';
|
|
42
41
|
import { EmptyState, IssueLikeDataTableView } from '../../issue-like-table';
|
|
43
42
|
import { useColumnResize } from '../../issue-like-table/use-column-resize';
|
|
@@ -48,10 +47,6 @@ import { isQueryTooComplex } from '../basic-filters/utils/isQueryTooComplex';
|
|
|
48
47
|
import { JiraSearchContainer } from '../jira-search-container';
|
|
49
48
|
import { JiraInitialStateSVG } from './jira-issues-initial-state-svg';
|
|
50
49
|
import { modalMessages } from './messages';
|
|
51
|
-
const issueCountStyles = css({
|
|
52
|
-
flex: 1,
|
|
53
|
-
fontWeight: 600
|
|
54
|
-
});
|
|
55
50
|
const getDisplayValue = (currentViewMode, itemCount) => {
|
|
56
51
|
if (currentViewMode === 'table') {
|
|
57
52
|
return DatasourceDisplay.DATASOURCE_TABLE;
|
|
@@ -464,25 +459,12 @@ const PlainJiraIssuesConfigModal = props => {
|
|
|
464
459
|
title: loadingErrorMessages.noAccessToJiraSitesTitle,
|
|
465
460
|
description: loadingErrorMessages.noAccessToJiraSitesDescription,
|
|
466
461
|
testId: `no-jira-instances-content`
|
|
467
|
-
})), jsx(ModalFooter, null, shouldShowIssueCount && jsx(
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
testId: "item-count-url"
|
|
474
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
475
|
-
,
|
|
476
|
-
style: {
|
|
477
|
-
color: `var(--ds-text-accent-gray, ${N800})`
|
|
478
|
-
}
|
|
479
|
-
}, jsx(FormattedNumber, {
|
|
480
|
-
value: totalCount
|
|
481
|
-
}), ' ', jsx(FormattedMessage, _extends({}, modalMessages.issueText, {
|
|
482
|
-
values: {
|
|
483
|
-
totalCount
|
|
484
|
-
}
|
|
485
|
-
})))), jsx(CancelButton, {
|
|
462
|
+
})), jsx(ModalFooter, null, shouldShowIssueCount && jsx(TableSearchCount, {
|
|
463
|
+
searchCount: totalCount,
|
|
464
|
+
url: jqlUrl,
|
|
465
|
+
prefixTextType: "issue",
|
|
466
|
+
testId: "jira-datasource-modal-total-issues-count"
|
|
467
|
+
}), jsx(CancelButton, {
|
|
486
468
|
onCancel: onCancel,
|
|
487
469
|
getAnalyticsPayload: getCancelButtonAnalyticsPayload,
|
|
488
470
|
testId: "jira-datasource-modal--cancel-button"
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/extends";
|
|
2
1
|
/** @jsx jsx */
|
|
3
2
|
import { Fragment, useEffect, useState } from 'react';
|
|
4
3
|
|
|
@@ -6,13 +5,13 @@ import { Fragment, useEffect, useState } from 'react';
|
|
|
6
5
|
import { jsx } from '@emotion/react';
|
|
7
6
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
8
7
|
import styled from '@emotion/styled';
|
|
9
|
-
import { FormattedMessage,
|
|
8
|
+
import { FormattedMessage, useIntl } from 'react-intl-next';
|
|
10
9
|
import Button from '@atlaskit/button';
|
|
11
|
-
import Heading from '@atlaskit/heading';
|
|
12
10
|
import RefreshIcon from '@atlaskit/icon/glyph/refresh';
|
|
13
|
-
import
|
|
14
|
-
import { N0, N40,
|
|
11
|
+
import { Flex } from '@atlaskit/primitives';
|
|
12
|
+
import { N0, N40, N90 } from '@atlaskit/theme/colors';
|
|
15
13
|
import { ASSETS_LIST_OF_LINKS_DATASOURCE_ID } from '../assets-modal';
|
|
14
|
+
import TableSearchCount from '../common/modal/search-count';
|
|
16
15
|
import { footerMessages } from './messages';
|
|
17
16
|
import { PoweredByJSMAssets } from './powered-by-jsm-assets';
|
|
18
17
|
import { SyncInfo } from './sync-info';
|
|
@@ -35,12 +34,6 @@ const TopBorderWrapper = styled.div({
|
|
|
35
34
|
padding: `${"var(--ds-space-250, 20px)"} ${"var(--ds-space-0, 0px)"}`
|
|
36
35
|
});
|
|
37
36
|
|
|
38
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled -- To migrate as part of go/ui-styling-standard
|
|
39
|
-
const ItemCounterWrapper = styled.div({
|
|
40
|
-
display: 'flex',
|
|
41
|
-
alignSelf: 'center'
|
|
42
|
-
});
|
|
43
|
-
|
|
44
37
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled -- To migrate as part of go/ui-styling-standard
|
|
45
38
|
const SyncWrapper = styled.div({
|
|
46
39
|
display: 'flex',
|
|
@@ -73,27 +66,12 @@ export const TableFooter = ({
|
|
|
73
66
|
// ensure correct positioning since 'justify-content: space-between' is used).
|
|
74
67
|
return onRefresh || showItemCount ? jsx(FooterWrapper, {
|
|
75
68
|
"data-testid": "table-footer"
|
|
76
|
-
}, jsx(TopBorderWrapper, null, jsx(
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
style: {
|
|
83
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
84
|
-
color: `var(--ds-text-accent-gray, ${N800})`,
|
|
85
|
-
textDecoration: !url ? 'none' : ''
|
|
86
|
-
}
|
|
87
|
-
}, jsx(Heading, {
|
|
88
|
-
testId: "item-count",
|
|
89
|
-
level: "h200"
|
|
90
|
-
}, jsx(FormattedNumber, {
|
|
91
|
-
value: itemCount
|
|
92
|
-
}), ' ', jsx(FormattedMessage, _extends({}, footerMessages.itemText, {
|
|
93
|
-
values: {
|
|
94
|
-
itemCount
|
|
95
|
-
}
|
|
96
|
-
}))))), datasourceId === ASSETS_LIST_OF_LINKS_DATASOURCE_ID ? jsx(PoweredByJSMAssets, {
|
|
69
|
+
}, jsx(TopBorderWrapper, null, showItemCount && jsx(Flex, null, jsx(TableSearchCount, {
|
|
70
|
+
searchCount: itemCount,
|
|
71
|
+
url: url,
|
|
72
|
+
prefixTextType: "item",
|
|
73
|
+
testId: "item-count"
|
|
74
|
+
})), datasourceId === ASSETS_LIST_OF_LINKS_DATASOURCE_ID ? jsx(PoweredByJSMAssets, {
|
|
97
75
|
text: intl.formatMessage(footerMessages.powerByJSM)
|
|
98
76
|
}) : null, jsx(SyncWrapper, null, onRefresh && jsx(Fragment, null, jsx(SyncTextWrapper, {
|
|
99
77
|
"data-testid": "sync-text"
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { FormattedMessage, FormattedNumber } from 'react-intl-next';
|
|
4
|
+
import Heading from '@atlaskit/heading';
|
|
5
|
+
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
6
|
+
import { Flex, xcss } from '@atlaskit/primitives';
|
|
7
|
+
import LinkUrl from '@atlaskit/smart-card/link-url';
|
|
8
|
+
import { N800 } from '@atlaskit/theme/colors';
|
|
9
|
+
import { confluenceSearchModalMessages } from '../../../confluence-search-modal/modal/messages';
|
|
10
|
+
import { modalMessages } from '../../../jira-issues-modal/modal/messages';
|
|
11
|
+
import { footerMessages } from '../../../table-footer/messages';
|
|
12
|
+
import { searchCountMessages } from './messages';
|
|
13
|
+
var searchCountStyles = xcss({
|
|
14
|
+
flex: 1
|
|
15
|
+
});
|
|
16
|
+
var TableSearchCount = function TableSearchCount(_ref) {
|
|
17
|
+
var url = _ref.url,
|
|
18
|
+
searchCount = _ref.searchCount,
|
|
19
|
+
_ref$testId = _ref.testId,
|
|
20
|
+
testId = _ref$testId === void 0 ? 'datasource-table-total-results-count' : _ref$testId,
|
|
21
|
+
_ref$prefixTextType = _ref.prefixTextType,
|
|
22
|
+
prefixTextType = _ref$prefixTextType === void 0 ? 'issue' : _ref$prefixTextType;
|
|
23
|
+
return /*#__PURE__*/React.createElement(Flex, {
|
|
24
|
+
testId: testId,
|
|
25
|
+
xcss: searchCountStyles,
|
|
26
|
+
alignItems: "center"
|
|
27
|
+
}, /*#__PURE__*/React.createElement(LinkUrl, {
|
|
28
|
+
href: url,
|
|
29
|
+
target: "_blank",
|
|
30
|
+
testId: "item-count-url"
|
|
31
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
32
|
+
,
|
|
33
|
+
style: {
|
|
34
|
+
color: "var(--ds-text-accent-gray, ".concat(N800, ")"),
|
|
35
|
+
textDecoration: !url ? 'none' : ''
|
|
36
|
+
}
|
|
37
|
+
}, /*#__PURE__*/React.createElement(Heading, {
|
|
38
|
+
level: "h200"
|
|
39
|
+
}, getBooleanFF('platform.linking-platform.datasource.total-count-i18n-single-key') ? /*#__PURE__*/React.createElement(FormattedMessage, _extends({}, searchCountMessages["".concat(prefixTextType, "CountText")], {
|
|
40
|
+
values: {
|
|
41
|
+
searchCount: searchCount
|
|
42
|
+
}
|
|
43
|
+
})) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(FormattedNumber, {
|
|
44
|
+
value: searchCount
|
|
45
|
+
}), ' ', prefixTextType === 'issue' && /*#__PURE__*/React.createElement(FormattedMessage, _extends({}, modalMessages.issueText, {
|
|
46
|
+
values: {
|
|
47
|
+
totalCount: searchCount
|
|
48
|
+
}
|
|
49
|
+
})), prefixTextType === 'result' && /*#__PURE__*/React.createElement(FormattedMessage, _extends({}, confluenceSearchModalMessages.searchCountText, {
|
|
50
|
+
values: {
|
|
51
|
+
totalCount: searchCount
|
|
52
|
+
}
|
|
53
|
+
})), prefixTextType === 'item' && /*#__PURE__*/React.createElement(FormattedMessage, _extends({}, footerMessages.itemText, {
|
|
54
|
+
values: {
|
|
55
|
+
itemCount: searchCount
|
|
56
|
+
}
|
|
57
|
+
}))))));
|
|
58
|
+
};
|
|
59
|
+
export default TableSearchCount;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { defineMessages } from 'react-intl-next';
|
|
2
|
+
export var searchCountMessages = defineMessages({
|
|
3
|
+
resultCountText: {
|
|
4
|
+
id: 'linkDataSource.search.configmodal.resultCountText',
|
|
5
|
+
description: 'Text that indicates the number of search results.',
|
|
6
|
+
defaultMessage: '{searchCount, plural, one {# result} other {# results}}'
|
|
7
|
+
},
|
|
8
|
+
issueCountText: {
|
|
9
|
+
id: 'linkDataSource.search.configmodal.issueCountText',
|
|
10
|
+
description: 'Text that indicates the number of jira issues in the search result.',
|
|
11
|
+
defaultMessage: '{searchCount, plural, one {# issue} other {# issues}}'
|
|
12
|
+
},
|
|
13
|
+
itemCountText: {
|
|
14
|
+
id: 'linkDataSource.search.configmodal.itemCountText',
|
|
15
|
+
description: 'Text that indicates the number of items in the search result.',
|
|
16
|
+
defaultMessage: '{searchCount, plural, one {# item} other {# items}}'
|
|
17
|
+
}
|
|
18
|
+
});
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/extends";
|
|
2
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
2
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
4
3
|
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; }
|
|
@@ -8,15 +7,13 @@ import { Fragment, useCallback, useEffect, useMemo, useRef, useState } from 'rea
|
|
|
8
7
|
|
|
9
8
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
10
9
|
import { jsx } from '@emotion/react';
|
|
11
|
-
import { FormattedMessage
|
|
10
|
+
import { FormattedMessage } from 'react-intl-next';
|
|
12
11
|
import { withAnalyticsContext } from '@atlaskit/analytics-next';
|
|
13
12
|
import Button from '@atlaskit/button/standard-button';
|
|
14
13
|
import { IntlMessagesProvider } from '@atlaskit/intl-messages-provider';
|
|
15
14
|
import { ModalBody, ModalFooter, ModalHeader, ModalTitle } from '@atlaskit/modal-dialog';
|
|
16
15
|
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
17
16
|
import { Box, xcss } from '@atlaskit/primitives';
|
|
18
|
-
import LinkUrl from '@atlaskit/smart-card/link-url';
|
|
19
|
-
import { N800 } from '@atlaskit/theme/colors';
|
|
20
17
|
import { EVENT_CHANNEL, useDatasourceAnalyticsEvents } from '../../../analytics';
|
|
21
18
|
import { componentMetadata } from '../../../analytics/constants';
|
|
22
19
|
import { DatasourceAction, DatasourceDisplay, DatasourceSearchMethod } from '../../../analytics/types';
|
|
@@ -37,6 +34,7 @@ import { ContentContainer } from '../../common/modal/content-container';
|
|
|
37
34
|
import { SmartCardPlaceholder, SmartLink } from '../../common/modal/count-view-smart-link';
|
|
38
35
|
import { DatasourceModal } from '../../common/modal/datasource-modal';
|
|
39
36
|
import { DisplayViewDropDown } from '../../common/modal/display-view-dropdown/display-view-drop-down';
|
|
37
|
+
import TableSearchCount from '../../common/modal/search-count';
|
|
40
38
|
import { SiteSelector } from '../../common/modal/site-selector';
|
|
41
39
|
import { EmptyState, IssueLikeDataTableView } from '../../issue-like-table';
|
|
42
40
|
import { useColumnResize } from '../../issue-like-table/use-column-resize';
|
|
@@ -50,10 +48,6 @@ var inputContainerStyles = xcss({
|
|
|
50
48
|
display: 'flex',
|
|
51
49
|
minHeight: '72px'
|
|
52
50
|
});
|
|
53
|
-
var searchCountStyles = xcss({
|
|
54
|
-
flex: 1,
|
|
55
|
-
fontWeight: 600
|
|
56
|
-
});
|
|
57
51
|
export var PlainConfluenceSearchConfigModal = function PlainConfluenceSearchConfigModal(props) {
|
|
58
52
|
var datasourceId = props.datasourceId,
|
|
59
53
|
initialColumnCustomSizes = props.columnCustomSizes,
|
|
@@ -438,25 +432,12 @@ export var PlainConfluenceSearchConfigModal = function PlainConfluenceSearchConf
|
|
|
438
432
|
title: confluenceSearchModalMessages.noAccessToConfluenceSitesTitle,
|
|
439
433
|
description: confluenceSearchModalMessages.noAccessToConfluenceSitesDescription,
|
|
440
434
|
testId: 'no-confluence-instances-content'
|
|
441
|
-
})), jsx(ModalFooter, null, shouldShowResultsCount && confluenceSearchUrl && jsx(
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
testId: "item-count-url"
|
|
448
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
449
|
-
,
|
|
450
|
-
style: {
|
|
451
|
-
color: "var(--ds-text-accent-gray, ".concat(N800, ")")
|
|
452
|
-
}
|
|
453
|
-
}, jsx(FormattedNumber, {
|
|
454
|
-
value: totalCount
|
|
455
|
-
}), ' ', jsx(FormattedMessage, _extends({}, confluenceSearchModalMessages.searchCountText, {
|
|
456
|
-
values: {
|
|
457
|
-
totalCount: totalCount
|
|
458
|
-
}
|
|
459
|
-
})))), jsx(CancelButton, {
|
|
435
|
+
})), jsx(ModalFooter, null, shouldShowResultsCount && confluenceSearchUrl && jsx(TableSearchCount, {
|
|
436
|
+
searchCount: totalCount,
|
|
437
|
+
url: confluenceSearchUrl,
|
|
438
|
+
prefixTextType: "result",
|
|
439
|
+
testId: "confluence-search-datasource-modal-total-results-count"
|
|
440
|
+
}), jsx(CancelButton, {
|
|
460
441
|
onCancel: onCancel,
|
|
461
442
|
getAnalyticsPayload: getCancelButtonAnalyticsPayload,
|
|
462
443
|
testId: "confluence-search-modal--cancel-button"
|
|
@@ -7,15 +7,13 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
7
7
|
import { Fragment, useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
8
8
|
|
|
9
9
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
10
|
-
import {
|
|
11
|
-
import { FormattedMessage
|
|
10
|
+
import { jsx } from '@emotion/react';
|
|
11
|
+
import { FormattedMessage } from 'react-intl-next';
|
|
12
12
|
import { withAnalyticsContext } from '@atlaskit/analytics-next';
|
|
13
13
|
import Button from '@atlaskit/button/standard-button';
|
|
14
14
|
import { IntlMessagesProvider } from '@atlaskit/intl-messages-provider';
|
|
15
15
|
import { ModalBody, ModalFooter, ModalHeader, ModalTitle, ModalTransition } from '@atlaskit/modal-dialog';
|
|
16
16
|
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
17
|
-
import LinkUrl from '@atlaskit/smart-card/link-url';
|
|
18
|
-
import { N800 } from '@atlaskit/theme/colors';
|
|
19
17
|
import { EVENT_CHANNEL, useDatasourceAnalyticsEvents } from '../../../analytics';
|
|
20
18
|
import { componentMetadata } from '../../../analytics/constants';
|
|
21
19
|
import { DatasourceAction, DatasourceDisplay } from '../../../analytics/types';
|
|
@@ -42,6 +40,7 @@ import { ContentContainer } from '../../common/modal/content-container';
|
|
|
42
40
|
import { SmartCardPlaceholder, SmartLink } from '../../common/modal/count-view-smart-link';
|
|
43
41
|
import { DatasourceModal } from '../../common/modal/datasource-modal';
|
|
44
42
|
import { DisplayViewDropDown } from '../../common/modal/display-view-dropdown/display-view-drop-down';
|
|
43
|
+
import TableSearchCount from '../../common/modal/search-count';
|
|
45
44
|
import { SiteSelector } from '../../common/modal/site-selector';
|
|
46
45
|
import { EmptyState, IssueLikeDataTableView } from '../../issue-like-table';
|
|
47
46
|
import { useColumnResize } from '../../issue-like-table/use-column-resize';
|
|
@@ -52,10 +51,6 @@ import { isQueryTooComplex } from '../basic-filters/utils/isQueryTooComplex';
|
|
|
52
51
|
import { JiraSearchContainer } from '../jira-search-container';
|
|
53
52
|
import { JiraInitialStateSVG } from './jira-issues-initial-state-svg';
|
|
54
53
|
import { modalMessages } from './messages';
|
|
55
|
-
var issueCountStyles = css({
|
|
56
|
-
flex: 1,
|
|
57
|
-
fontWeight: 600
|
|
58
|
-
});
|
|
59
54
|
var getDisplayValue = function getDisplayValue(currentViewMode, itemCount) {
|
|
60
55
|
if (currentViewMode === 'table') {
|
|
61
56
|
return DatasourceDisplay.DATASOURCE_TABLE;
|
|
@@ -477,25 +472,12 @@ var PlainJiraIssuesConfigModal = function PlainJiraIssuesConfigModal(props) {
|
|
|
477
472
|
title: loadingErrorMessages.noAccessToJiraSitesTitle,
|
|
478
473
|
description: loadingErrorMessages.noAccessToJiraSitesDescription,
|
|
479
474
|
testId: "no-jira-instances-content"
|
|
480
|
-
})), jsx(ModalFooter, null, shouldShowIssueCount && jsx(
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
testId: "item-count-url"
|
|
487
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
488
|
-
,
|
|
489
|
-
style: {
|
|
490
|
-
color: "var(--ds-text-accent-gray, ".concat(N800, ")")
|
|
491
|
-
}
|
|
492
|
-
}, jsx(FormattedNumber, {
|
|
493
|
-
value: totalCount
|
|
494
|
-
}), ' ', jsx(FormattedMessage, _extends({}, modalMessages.issueText, {
|
|
495
|
-
values: {
|
|
496
|
-
totalCount: totalCount
|
|
497
|
-
}
|
|
498
|
-
})))), jsx(CancelButton, {
|
|
475
|
+
})), jsx(ModalFooter, null, shouldShowIssueCount && jsx(TableSearchCount, {
|
|
476
|
+
searchCount: totalCount,
|
|
477
|
+
url: jqlUrl,
|
|
478
|
+
prefixTextType: "issue",
|
|
479
|
+
testId: "jira-datasource-modal-total-issues-count"
|
|
480
|
+
}), jsx(CancelButton, {
|
|
499
481
|
onCancel: onCancel,
|
|
500
482
|
getAnalyticsPayload: getCancelButtonAnalyticsPayload,
|
|
501
483
|
testId: "jira-datasource-modal--cancel-button"
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/extends";
|
|
2
1
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
2
|
/** @jsx jsx */
|
|
4
3
|
import { Fragment, useEffect, useState } from 'react';
|
|
@@ -7,13 +6,13 @@ import { Fragment, useEffect, useState } from 'react';
|
|
|
7
6
|
import { jsx } from '@emotion/react';
|
|
8
7
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
9
8
|
import styled from '@emotion/styled';
|
|
10
|
-
import { FormattedMessage,
|
|
9
|
+
import { FormattedMessage, useIntl } from 'react-intl-next';
|
|
11
10
|
import Button from '@atlaskit/button';
|
|
12
|
-
import Heading from '@atlaskit/heading';
|
|
13
11
|
import RefreshIcon from '@atlaskit/icon/glyph/refresh';
|
|
14
|
-
import
|
|
15
|
-
import { N0, N40,
|
|
12
|
+
import { Flex } from '@atlaskit/primitives';
|
|
13
|
+
import { N0, N40, N90 } from '@atlaskit/theme/colors';
|
|
16
14
|
import { ASSETS_LIST_OF_LINKS_DATASOURCE_ID } from '../assets-modal';
|
|
15
|
+
import TableSearchCount from '../common/modal/search-count';
|
|
17
16
|
import { footerMessages } from './messages';
|
|
18
17
|
import { PoweredByJSMAssets } from './powered-by-jsm-assets';
|
|
19
18
|
import { SyncInfo } from './sync-info';
|
|
@@ -36,12 +35,6 @@ var TopBorderWrapper = styled.div({
|
|
|
36
35
|
padding: "var(--ds-space-250, 20px)".concat(" ", "var(--ds-space-0, 0px)")
|
|
37
36
|
});
|
|
38
37
|
|
|
39
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled -- To migrate as part of go/ui-styling-standard
|
|
40
|
-
var ItemCounterWrapper = styled.div({
|
|
41
|
-
display: 'flex',
|
|
42
|
-
alignSelf: 'center'
|
|
43
|
-
});
|
|
44
|
-
|
|
45
38
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled -- To migrate as part of go/ui-styling-standard
|
|
46
39
|
var SyncWrapper = styled.div({
|
|
47
40
|
display: 'flex',
|
|
@@ -76,27 +69,12 @@ export var TableFooter = function TableFooter(_ref) {
|
|
|
76
69
|
// ensure correct positioning since 'justify-content: space-between' is used).
|
|
77
70
|
return onRefresh || showItemCount ? jsx(FooterWrapper, {
|
|
78
71
|
"data-testid": "table-footer"
|
|
79
|
-
}, jsx(TopBorderWrapper, null, jsx(
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
style: {
|
|
86
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
87
|
-
color: "var(--ds-text-accent-gray, ".concat(N800, ")"),
|
|
88
|
-
textDecoration: !url ? 'none' : ''
|
|
89
|
-
}
|
|
90
|
-
}, jsx(Heading, {
|
|
91
|
-
testId: "item-count",
|
|
92
|
-
level: "h200"
|
|
93
|
-
}, jsx(FormattedNumber, {
|
|
94
|
-
value: itemCount
|
|
95
|
-
}), ' ', jsx(FormattedMessage, _extends({}, footerMessages.itemText, {
|
|
96
|
-
values: {
|
|
97
|
-
itemCount: itemCount
|
|
98
|
-
}
|
|
99
|
-
}))))), datasourceId === ASSETS_LIST_OF_LINKS_DATASOURCE_ID ? jsx(PoweredByJSMAssets, {
|
|
72
|
+
}, jsx(TopBorderWrapper, null, showItemCount && jsx(Flex, null, jsx(TableSearchCount, {
|
|
73
|
+
searchCount: itemCount,
|
|
74
|
+
url: url,
|
|
75
|
+
prefixTextType: "item",
|
|
76
|
+
testId: "item-count"
|
|
77
|
+
})), datasourceId === ASSETS_LIST_OF_LINKS_DATASOURCE_ID ? jsx(PoweredByJSMAssets, {
|
|
100
78
|
text: intl.formatMessage(footerMessages.powerByJSM)
|
|
101
79
|
}) : null, jsx(SyncWrapper, null, onRefresh && jsx(Fragment, null, jsx(SyncTextWrapper, {
|
|
102
80
|
"data-testid": "sync-text"
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
interface TableSearchCountProps {
|
|
3
|
+
url?: string;
|
|
4
|
+
prefixTextType: 'issue' | 'result' | 'item';
|
|
5
|
+
searchCount: number;
|
|
6
|
+
testId?: string;
|
|
7
|
+
}
|
|
8
|
+
declare const TableSearchCount: ({ url, searchCount, testId, prefixTextType, }: TableSearchCountProps) => JSX.Element;
|
|
9
|
+
export default TableSearchCount;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export declare const searchCountMessages: {
|
|
2
|
+
resultCountText: {
|
|
3
|
+
id: string;
|
|
4
|
+
description: string;
|
|
5
|
+
defaultMessage: string;
|
|
6
|
+
};
|
|
7
|
+
issueCountText: {
|
|
8
|
+
id: string;
|
|
9
|
+
description: string;
|
|
10
|
+
defaultMessage: string;
|
|
11
|
+
};
|
|
12
|
+
itemCountText: {
|
|
13
|
+
id: string;
|
|
14
|
+
description: string;
|
|
15
|
+
defaultMessage: string;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
interface TableSearchCountProps {
|
|
3
|
+
url?: string;
|
|
4
|
+
prefixTextType: 'issue' | 'result' | 'item';
|
|
5
|
+
searchCount: number;
|
|
6
|
+
testId?: string;
|
|
7
|
+
}
|
|
8
|
+
declare const TableSearchCount: ({ url, searchCount, testId, prefixTextType, }: TableSearchCountProps) => JSX.Element;
|
|
9
|
+
export default TableSearchCount;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export declare const searchCountMessages: {
|
|
2
|
+
resultCountText: {
|
|
3
|
+
id: string;
|
|
4
|
+
description: string;
|
|
5
|
+
defaultMessage: string;
|
|
6
|
+
};
|
|
7
|
+
issueCountText: {
|
|
8
|
+
id: string;
|
|
9
|
+
description: string;
|
|
10
|
+
defaultMessage: string;
|
|
11
|
+
};
|
|
12
|
+
itemCountText: {
|
|
13
|
+
id: string;
|
|
14
|
+
description: string;
|
|
15
|
+
defaultMessage: string;
|
|
16
|
+
};
|
|
17
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/link-datasource",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.3",
|
|
4
4
|
"description": "UI Components to support linking platform dataset feature",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -158,6 +158,9 @@
|
|
|
158
158
|
"platform.linking-platform.datasource-assets_add_version_parameter": {
|
|
159
159
|
"type": "boolean"
|
|
160
160
|
},
|
|
161
|
+
"platform.linking-platform.datasource.total-count-i18n-single-key": {
|
|
162
|
+
"type": "boolean"
|
|
163
|
+
},
|
|
161
164
|
"platform.linking-platform.datasource-assets_update_refresh_button_dt3qk": {
|
|
162
165
|
"type": "boolean"
|
|
163
166
|
},
|