@atlaskit/link-datasource 2.5.2 → 2.5.4

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.
Files changed (27) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/dist/cjs/ui/common/modal/search-count/index.js +66 -0
  3. package/dist/cjs/ui/common/modal/search-count/messages.js +24 -0
  4. package/dist/cjs/ui/common/modal/site-selector/index.js +1 -2
  5. package/dist/cjs/ui/confluence-search-modal/basic-filters/filters/date-range-picker/styled.js +1 -1
  6. package/dist/cjs/ui/confluence-search-modal/modal/index.js +7 -26
  7. package/dist/cjs/ui/jira-issues-modal/modal/index.js +7 -25
  8. package/dist/cjs/ui/table-footer/index.js +8 -30
  9. package/dist/es2019/ui/common/modal/search-count/index.js +58 -0
  10. package/dist/es2019/ui/common/modal/search-count/messages.js +18 -0
  11. package/dist/es2019/ui/common/modal/site-selector/index.js +1 -2
  12. package/dist/es2019/ui/confluence-search-modal/basic-filters/filters/date-range-picker/styled.js +1 -1
  13. package/dist/es2019/ui/confluence-search-modal/modal/index.js +8 -27
  14. package/dist/es2019/ui/jira-issues-modal/modal/index.js +9 -27
  15. package/dist/es2019/ui/table-footer/index.js +10 -32
  16. package/dist/esm/ui/common/modal/search-count/index.js +59 -0
  17. package/dist/esm/ui/common/modal/search-count/messages.js +18 -0
  18. package/dist/esm/ui/common/modal/site-selector/index.js +1 -2
  19. package/dist/esm/ui/confluence-search-modal/basic-filters/filters/date-range-picker/styled.js +1 -1
  20. package/dist/esm/ui/confluence-search-modal/modal/index.js +8 -27
  21. package/dist/esm/ui/jira-issues-modal/modal/index.js +9 -27
  22. package/dist/esm/ui/table-footer/index.js +10 -32
  23. package/dist/types/ui/common/modal/search-count/index.d.ts +9 -0
  24. package/dist/types/ui/common/modal/search-count/messages.d.ts +17 -0
  25. package/dist/types-ts4.5/ui/common/modal/search-count/index.d.ts +9 -0
  26. package/dist/types-ts4.5/ui/common/modal/search-count/messages.d.ts +17 -0
  27. package/package.json +6 -3
package/CHANGELOG.md CHANGED
@@ -1,5 +1,25 @@
1
1
  # @atlaskit/link-datasource
2
2
 
3
+ ## 2.5.4
4
+
5
+ ### Patch Changes
6
+
7
+ - [#116025](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/116025)
8
+ [`cd506a937e44f`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/cd506a937e44f) -
9
+ Internal change to how typography is applied. There should be no visual change.
10
+ - [#114548](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/114548)
11
+ [`8b2d47bffb50e`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/8b2d47bffb50e) -
12
+ bump adf-schema version
13
+ - Updated dependencies
14
+
15
+ ## 2.5.3
16
+
17
+ ### Patch Changes
18
+
19
+ - [#113477](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/113477)
20
+ [`2c509c4c06447`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/2c509c4c06447) -
21
+ Updated search count to be displayed from a common component with single i18n message string.
22
+
3
23
  ## 2.5.2
4
24
 
5
25
  ### 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
+ });
@@ -26,9 +26,8 @@ var dropdownContainerStyles = (0, _primitives.xcss)({
26
26
  minHeight: '40px' // to prevent vertical shifting when site selector pops in
27
27
  });
28
28
  var selectStyles = (0, _react2.css)({
29
- fontSize: "var(--ds-font-size-100, 14px)",
29
+ font: "var(--ds-font-body, normal 400 14px/20px ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif)",
30
30
  fontWeight: "var(--ds-font-weight-medium, 500)",
31
- lineHeight: "var(--ds-space-250, 20px)",
32
31
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
33
32
  zIndex: _zindex.siteSelectorIndex
34
33
  });
@@ -93,6 +93,6 @@ var DateRangeErrorMessage = exports.DateRangeErrorMessage = _styled.default.div(
93
93
  display: 'flex',
94
94
  lineHeight: 1.3333,
95
95
  marginTop: "var(--ds-space-050, 2px)",
96
- fontSize: "var(--ds-font-size-075, 12px)",
96
+ fontSize: '12px',
97
97
  color: "var(--ds-text-danger, ".concat(_colors.R400, ")")
98
98
  });
@@ -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)(_primitives.Box, {
446
- testId: "confluence-search-datasource-modal-total-results-count",
447
- xcss: searchCountStyles
448
- }, (0, _react2.jsx)(_linkUrl.default, {
449
- href: confluenceSearchUrl,
450
- target: "_blank",
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)("div", {
485
- "data-testid": "jira-datasource-modal-total-issues-count",
486
- css: issueCountStyles
487
- }, (0, _react2.jsx)(_linkUrl.default, {
488
- href: jqlUrl,
489
- target: "_blank",
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 _linkUrl = _interopRequireDefault(require("@atlaskit/smart-card/link-url"));
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)(ItemCounterWrapper, {
89
- "data-testid": "item-count-wrapper"
90
- }, showItemCount && (0, _react2.jsx)(_linkUrl.default, {
91
- href: url,
92
- target: "_blank",
93
- testId: "item-count-url",
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
+ });
@@ -15,9 +15,8 @@ const dropdownContainerStyles = xcss({
15
15
  minHeight: '40px' // to prevent vertical shifting when site selector pops in
16
16
  });
17
17
  const selectStyles = css({
18
- fontSize: "var(--ds-font-size-100, 14px)",
18
+ font: "var(--ds-font-body, normal 400 14px/20px ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif)",
19
19
  fontWeight: "var(--ds-font-weight-medium, 500)",
20
- lineHeight: "var(--ds-space-250, 20px)",
21
20
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
22
21
  zIndex: siteSelectorIndex
23
22
  });
@@ -83,6 +83,6 @@ export const DateRangeErrorMessage = styled.div({
83
83
  display: 'flex',
84
84
  lineHeight: 1.3333,
85
85
  marginTop: "var(--ds-space-050, 2px)",
86
- fontSize: "var(--ds-font-size-075, 12px)",
86
+ fontSize: '12px',
87
87
  color: `var(--ds-text-danger, ${R400})`
88
88
  });
@@ -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, FormattedNumber } from 'react-intl-next';
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(Box, {
421
- testId: "confluence-search-datasource-modal-total-results-count",
422
- xcss: searchCountStyles
423
- }, jsx(LinkUrl, {
424
- href: confluenceSearchUrl,
425
- target: "_blank",
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 { css, jsx } from '@emotion/react';
7
- import { FormattedMessage, FormattedNumber } from 'react-intl-next';
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("div", {
468
- "data-testid": "jira-datasource-modal-total-issues-count",
469
- css: issueCountStyles
470
- }, jsx(LinkUrl, {
471
- href: jqlUrl,
472
- target: "_blank",
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, FormattedNumber, useIntl } from 'react-intl-next';
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 LinkUrl from '@atlaskit/smart-card/link-url';
14
- import { N0, N40, N800, N90 } from '@atlaskit/theme/colors';
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(ItemCounterWrapper, {
77
- "data-testid": "item-count-wrapper"
78
- }, showItemCount && jsx(LinkUrl, {
79
- href: url,
80
- target: "_blank",
81
- testId: "item-count-url",
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
+ });
@@ -20,9 +20,8 @@ var dropdownContainerStyles = xcss({
20
20
  minHeight: '40px' // to prevent vertical shifting when site selector pops in
21
21
  });
22
22
  var selectStyles = css({
23
- fontSize: "var(--ds-font-size-100, 14px)",
23
+ font: "var(--ds-font-body, normal 400 14px/20px ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif)",
24
24
  fontWeight: "var(--ds-font-weight-medium, 500)",
25
- lineHeight: "var(--ds-space-250, 20px)",
26
25
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
27
26
  zIndex: siteSelectorIndex
28
27
  });
@@ -85,6 +85,6 @@ export var DateRangeErrorMessage = styled.div({
85
85
  display: 'flex',
86
86
  lineHeight: 1.3333,
87
87
  marginTop: "var(--ds-space-050, 2px)",
88
- fontSize: "var(--ds-font-size-075, 12px)",
88
+ fontSize: '12px',
89
89
  color: "var(--ds-text-danger, ".concat(R400, ")")
90
90
  });
@@ -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, FormattedNumber } from 'react-intl-next';
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(Box, {
442
- testId: "confluence-search-datasource-modal-total-results-count",
443
- xcss: searchCountStyles
444
- }, jsx(LinkUrl, {
445
- href: confluenceSearchUrl,
446
- target: "_blank",
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 { css, jsx } from '@emotion/react';
11
- import { FormattedMessage, FormattedNumber } from 'react-intl-next';
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("div", {
481
- "data-testid": "jira-datasource-modal-total-issues-count",
482
- css: issueCountStyles
483
- }, jsx(LinkUrl, {
484
- href: jqlUrl,
485
- target: "_blank",
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, FormattedNumber, useIntl } from 'react-intl-next';
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 LinkUrl from '@atlaskit/smart-card/link-url';
15
- import { N0, N40, N800, N90 } from '@atlaskit/theme/colors';
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(ItemCounterWrapper, {
80
- "data-testid": "item-count-wrapper"
81
- }, showItemCount && jsx(LinkUrl, {
82
- href: url,
83
- target: "_blank",
84
- testId: "item-count-url",
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.2",
3
+ "version": "2.5.4",
4
4
  "description": "UI Components to support linking platform dataset feature",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -35,7 +35,7 @@
35
35
  "analytics:codegen": "yarn workspace @atlassian/analytics-tooling run analytics:codegen link-datasource --output ./src/analytics/generated"
36
36
  },
37
37
  "dependencies": {
38
- "@atlaskit/adf-schema": "^38.0.0",
38
+ "@atlaskit/adf-schema": "^39.0.3",
39
39
  "@atlaskit/analytics-next": "^9.3.0",
40
40
  "@atlaskit/avatar": "^21.10.0",
41
41
  "@atlaskit/avatar-group": "^9.8.0",
@@ -73,7 +73,7 @@
73
73
  "@atlaskit/smart-user-picker": "6.9.3",
74
74
  "@atlaskit/spinner": "^16.2.0",
75
75
  "@atlaskit/tag": "^12.3.0",
76
- "@atlaskit/textfield": "6.4.0",
76
+ "@atlaskit/textfield": "6.4.1",
77
77
  "@atlaskit/theme": "^12.11.0",
78
78
  "@atlaskit/tokens": "^1.53.0",
79
79
  "@atlaskit/tooltip": "^18.5.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
  },