@atlaskit/link-datasource 1.27.3 → 1.28.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (126) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/cjs/ui/common/modal/popup-select/constants.js +8 -0
  3. package/dist/cjs/ui/common/modal/popup-select/footer.js +3 -2
  4. package/dist/cjs/ui/common/modal/popup-select/formatOptionLabel.js +11 -6
  5. package/dist/cjs/ui/common/modal/popup-select/index.js +2 -1
  6. package/dist/cjs/ui/common/modal/popup-select/menu-list/errorMessage.js +3 -3
  7. package/dist/cjs/ui/common/modal/popup-select/menu-list/index.js +4 -2
  8. package/dist/cjs/ui/common/modal/popup-select/menu-list/loadingMessage.js +3 -2
  9. package/dist/cjs/ui/common/modal/popup-select/menu-list/noOptionsMessage.js +3 -3
  10. package/dist/cjs/ui/common/modal/popup-select/menu-list/showMoreButton.js +1 -1
  11. package/dist/cjs/ui/confluence-search-modal/basic-filters/filters/date-range-picker/PopupComponent.js +19 -0
  12. package/dist/cjs/ui/confluence-search-modal/basic-filters/filters/date-range-picker/index.js +89 -0
  13. package/dist/cjs/ui/confluence-search-modal/basic-filters/filters/date-range-picker/messages.js +49 -0
  14. package/dist/cjs/ui/confluence-search-modal/basic-filters/filters/date-range-picker/styled.js +75 -0
  15. package/dist/cjs/ui/confluence-search-modal/basic-filters/filters/date-range-picker/trigger.js +32 -0
  16. package/dist/cjs/ui/confluence-search-modal/basic-filters/index.js +5 -3
  17. package/dist/cjs/ui/confluence-search-modal/basic-filters/types.js +11 -0
  18. package/dist/cjs/ui/confluence-search-modal/confluence-search-container/index.js +16 -1
  19. package/dist/cjs/ui/confluence-search-modal/modal/index.js +36 -15
  20. package/dist/cjs/ui/datasource-table-view/datasourceTableView.js +1 -0
  21. package/dist/cjs/ui/jira-issues-modal/basic-filters/ui/async-popup-select/index.js +6 -5
  22. package/dist/cjs/ui/jira-issues-modal/jira-search-container/index.js +3 -3
  23. package/dist/cjs/ui/table-footer/index.js +8 -2
  24. package/dist/cjs/ui/table-footer/messages.js +5 -0
  25. package/dist/cjs/ui/table-footer/powered-by-jsm-assets/index.js +53 -0
  26. package/dist/es2019/ui/common/modal/popup-select/constants.js +2 -0
  27. package/dist/es2019/ui/common/modal/popup-select/footer.js +3 -2
  28. package/dist/es2019/ui/common/modal/popup-select/formatOptionLabel.js +8 -6
  29. package/dist/es2019/ui/common/modal/popup-select/index.js +2 -1
  30. package/dist/es2019/ui/common/modal/popup-select/menu-list/errorMessage.js +2 -2
  31. package/dist/es2019/ui/common/modal/popup-select/menu-list/index.js +4 -2
  32. package/dist/es2019/ui/common/modal/popup-select/menu-list/loadingMessage.js +4 -2
  33. package/dist/es2019/ui/common/modal/popup-select/menu-list/noOptionsMessage.js +2 -2
  34. package/dist/es2019/ui/common/modal/popup-select/menu-list/showMoreButton.js +1 -1
  35. package/dist/es2019/ui/confluence-search-modal/basic-filters/filters/date-range-picker/PopupComponent.js +7 -0
  36. package/dist/es2019/ui/confluence-search-modal/basic-filters/filters/date-range-picker/index.js +68 -0
  37. package/dist/es2019/ui/confluence-search-modal/basic-filters/filters/date-range-picker/messages.js +43 -0
  38. package/dist/es2019/ui/confluence-search-modal/basic-filters/filters/date-range-picker/styled.js +66 -0
  39. package/dist/es2019/ui/confluence-search-modal/basic-filters/filters/date-range-picker/trigger.js +26 -0
  40. package/dist/es2019/ui/confluence-search-modal/basic-filters/index.js +7 -2
  41. package/dist/es2019/ui/confluence-search-modal/basic-filters/types.js +5 -0
  42. package/dist/es2019/ui/confluence-search-modal/confluence-search-container/index.js +13 -1
  43. package/dist/es2019/ui/confluence-search-modal/modal/index.js +27 -8
  44. package/dist/es2019/ui/datasource-table-view/datasourceTableView.js +1 -0
  45. package/dist/es2019/ui/jira-issues-modal/basic-filters/ui/async-popup-select/index.js +4 -3
  46. package/dist/es2019/ui/jira-issues-modal/jira-search-container/index.js +1 -1
  47. package/dist/es2019/ui/table-footer/index.js +7 -1
  48. package/dist/es2019/ui/table-footer/messages.js +5 -0
  49. package/dist/es2019/ui/table-footer/powered-by-jsm-assets/index.js +45 -0
  50. package/dist/esm/ui/common/modal/popup-select/constants.js +2 -0
  51. package/dist/esm/ui/common/modal/popup-select/footer.js +3 -2
  52. package/dist/esm/ui/common/modal/popup-select/formatOptionLabel.js +8 -6
  53. package/dist/esm/ui/common/modal/popup-select/index.js +2 -1
  54. package/dist/esm/ui/common/modal/popup-select/menu-list/errorMessage.js +2 -2
  55. package/dist/esm/ui/common/modal/popup-select/menu-list/index.js +4 -2
  56. package/dist/esm/ui/common/modal/popup-select/menu-list/loadingMessage.js +3 -2
  57. package/dist/esm/ui/common/modal/popup-select/menu-list/noOptionsMessage.js +2 -2
  58. package/dist/esm/ui/common/modal/popup-select/menu-list/showMoreButton.js +1 -1
  59. package/dist/esm/ui/confluence-search-modal/basic-filters/filters/date-range-picker/PopupComponent.js +9 -0
  60. package/dist/esm/ui/confluence-search-modal/basic-filters/filters/date-range-picker/index.js +79 -0
  61. package/dist/esm/ui/confluence-search-modal/basic-filters/filters/date-range-picker/messages.js +43 -0
  62. package/dist/esm/ui/confluence-search-modal/basic-filters/filters/date-range-picker/styled.js +68 -0
  63. package/dist/esm/ui/confluence-search-modal/basic-filters/filters/date-range-picker/trigger.js +25 -0
  64. package/dist/esm/ui/confluence-search-modal/basic-filters/index.js +5 -3
  65. package/dist/esm/ui/confluence-search-modal/basic-filters/types.js +5 -0
  66. package/dist/esm/ui/confluence-search-modal/confluence-search-container/index.js +16 -1
  67. package/dist/esm/ui/confluence-search-modal/modal/index.js +36 -15
  68. package/dist/esm/ui/datasource-table-view/datasourceTableView.js +1 -0
  69. package/dist/esm/ui/jira-issues-modal/basic-filters/ui/async-popup-select/index.js +4 -3
  70. package/dist/esm/ui/jira-issues-modal/jira-search-container/index.js +1 -1
  71. package/dist/esm/ui/table-footer/index.js +8 -2
  72. package/dist/esm/ui/table-footer/messages.js +5 -0
  73. package/dist/esm/ui/table-footer/powered-by-jsm-assets/index.js +46 -0
  74. package/dist/types/analytics/generated/analytics.types.d.ts +7 -0
  75. package/dist/types/ui/common/modal/popup-select/constants.d.ts +2 -0
  76. package/dist/types/ui/common/modal/popup-select/footer.d.ts +2 -1
  77. package/dist/types/ui/common/modal/popup-select/index.d.ts +5 -4
  78. package/dist/types/ui/common/modal/popup-select/menu-list/index.d.ts +1 -1
  79. package/dist/types/ui/common/modal/popup-select/menu-list/loadingMessage.d.ts +3 -1
  80. package/dist/types/ui/common/modal/popup-select/types.d.ts +6 -1
  81. package/dist/types/ui/confluence-search-modal/basic-filters/filters/date-range-picker/PopupComponent.d.ts +3 -0
  82. package/dist/types/ui/confluence-search-modal/basic-filters/filters/date-range-picker/index.d.ts +8 -0
  83. package/dist/types/ui/confluence-search-modal/basic-filters/filters/date-range-picker/messages.d.ts +42 -0
  84. package/dist/types/ui/confluence-search-modal/basic-filters/filters/date-range-picker/styled.d.ts +31 -0
  85. package/dist/types/ui/confluence-search-modal/basic-filters/filters/date-range-picker/trigger.d.ts +10 -0
  86. package/dist/types/ui/confluence-search-modal/basic-filters/index.d.ts +4 -1
  87. package/dist/types/ui/confluence-search-modal/basic-filters/types.d.ts +20 -0
  88. package/dist/types/ui/confluence-search-modal/confluence-search-container/index.d.ts +2 -1
  89. package/dist/types/ui/confluence-search-modal/types.d.ts +4 -1
  90. package/dist/types/ui/jira-issues-modal/basic-filters/hooks/useFilterOptions.d.ts +2 -1
  91. package/dist/types/ui/jira-issues-modal/basic-filters/types.d.ts +1 -20
  92. package/dist/types/ui/jira-issues-modal/basic-filters/ui/async-popup-select/index.d.ts +2 -2
  93. package/dist/types/ui/jira-issues-modal/basic-filters/ui/index.d.ts +2 -1
  94. package/dist/types/ui/jira-issues-modal/basic-filters/utils/transformers.d.ts +2 -1
  95. package/dist/types/ui/jira-issues-modal/jira-search-container/index.d.ts +0 -1
  96. package/dist/types/ui/table-footer/index.d.ts +2 -1
  97. package/dist/types/ui/table-footer/messages.d.ts +5 -0
  98. package/dist/types/ui/table-footer/powered-by-jsm-assets/index.d.ts +4 -0
  99. package/dist/types-ts4.5/analytics/generated/analytics.types.d.ts +7 -0
  100. package/dist/types-ts4.5/ui/common/modal/popup-select/constants.d.ts +2 -0
  101. package/dist/types-ts4.5/ui/common/modal/popup-select/footer.d.ts +2 -1
  102. package/dist/types-ts4.5/ui/common/modal/popup-select/index.d.ts +5 -4
  103. package/dist/types-ts4.5/ui/common/modal/popup-select/menu-list/index.d.ts +1 -1
  104. package/dist/types-ts4.5/ui/common/modal/popup-select/menu-list/loadingMessage.d.ts +3 -1
  105. package/dist/types-ts4.5/ui/common/modal/popup-select/types.d.ts +6 -1
  106. package/dist/types-ts4.5/ui/confluence-search-modal/basic-filters/filters/date-range-picker/PopupComponent.d.ts +3 -0
  107. package/dist/types-ts4.5/ui/confluence-search-modal/basic-filters/filters/date-range-picker/index.d.ts +8 -0
  108. package/dist/types-ts4.5/ui/confluence-search-modal/basic-filters/filters/date-range-picker/messages.d.ts +42 -0
  109. package/dist/types-ts4.5/ui/confluence-search-modal/basic-filters/filters/date-range-picker/styled.d.ts +31 -0
  110. package/dist/types-ts4.5/ui/confluence-search-modal/basic-filters/filters/date-range-picker/trigger.d.ts +10 -0
  111. package/dist/types-ts4.5/ui/confluence-search-modal/basic-filters/index.d.ts +4 -1
  112. package/dist/types-ts4.5/ui/confluence-search-modal/basic-filters/types.d.ts +20 -0
  113. package/dist/types-ts4.5/ui/confluence-search-modal/confluence-search-container/index.d.ts +2 -1
  114. package/dist/types-ts4.5/ui/confluence-search-modal/types.d.ts +4 -1
  115. package/dist/types-ts4.5/ui/jira-issues-modal/basic-filters/hooks/useFilterOptions.d.ts +2 -1
  116. package/dist/types-ts4.5/ui/jira-issues-modal/basic-filters/types.d.ts +1 -20
  117. package/dist/types-ts4.5/ui/jira-issues-modal/basic-filters/ui/async-popup-select/index.d.ts +2 -2
  118. package/dist/types-ts4.5/ui/jira-issues-modal/basic-filters/ui/index.d.ts +2 -1
  119. package/dist/types-ts4.5/ui/jira-issues-modal/basic-filters/utils/transformers.d.ts +2 -1
  120. package/dist/types-ts4.5/ui/jira-issues-modal/jira-search-container/index.d.ts +0 -1
  121. package/dist/types-ts4.5/ui/table-footer/index.d.ts +2 -1
  122. package/dist/types-ts4.5/ui/table-footer/messages.d.ts +5 -0
  123. package/dist/types-ts4.5/ui/table-footer/powered-by-jsm-assets/index.d.ts +4 -0
  124. package/examples-helpers/buildAssetsIssuesTable.tsx +71 -0
  125. package/examples-helpers/useAssetsTableProps.tsx +57 -0
  126. package/package.json +10 -5
@@ -0,0 +1,43 @@
1
+ import { defineMessages } from 'react-intl-next';
2
+ export var dateRangeMessages = defineMessages({
3
+ dateRangeTitle: {
4
+ id: 'linkDataSource.confluence-search.configmodal.date.range.title',
5
+ defaultMessage: 'Last updated',
6
+ description: 'Filter by the date content was modified'
7
+ },
8
+ dateRangeAnyTime: {
9
+ id: 'linkDataSource.confluence-search.configmodal.date.range.any.time',
10
+ defaultMessage: 'Anytime',
11
+ description: 'Option to show content from any time'
12
+ },
13
+ dateRangeToday: {
14
+ id: 'linkDataSource.confluence-search.configmodal.date.range.today',
15
+ defaultMessage: 'Today',
16
+ description: 'Date range of content modified today'
17
+ },
18
+ dateRangeYesterday: {
19
+ id: 'linkDataSource.confluence-search.configmodal.date.range.yesterday',
20
+ defaultMessage: 'Yesterday',
21
+ description: 'Date range of content modified yesterday'
22
+ },
23
+ dateRangeLastWeek: {
24
+ id: 'linkDataSource.confluence-search.configmodal.date.range.last.week',
25
+ defaultMessage: 'Past 7 days',
26
+ description: 'Date range of content modified in the last 7 days'
27
+ },
28
+ dateRangeLastMonth: {
29
+ id: 'linkDataSource.confluence-search.configmodal.date.range.last.month',
30
+ defaultMessage: 'Past 30 days',
31
+ description: 'Date range of content modified in the last 30 days'
32
+ },
33
+ dateRangeLastYear: {
34
+ id: 'linkDataSource.confluence-search.configmodal.date.range.last.year',
35
+ defaultMessage: 'Past year',
36
+ description: 'Date range of content modified in the last 365 days'
37
+ },
38
+ dateRangeCustom: {
39
+ id: 'linkDataSource.confluence-search.configmodal.date.range.custom',
40
+ defaultMessage: 'Custom',
41
+ description: 'Custom date range'
42
+ }
43
+ });
@@ -0,0 +1,68 @@
1
+ import styled from '@emotion/styled';
2
+ import { B400, B50, N0, N20, N30, R400 } from '@atlaskit/theme/colors';
3
+ export var PopupComponentContainer = styled.div({
4
+ boxSizing: 'border-box',
5
+ display: 'block',
6
+ flex: '1 1 auto',
7
+ overflow: 'visible',
8
+ background: "var(--ds-background-input, ".concat(N0, ")"),
9
+ ':focus': {
10
+ outline: 'none'
11
+ },
12
+ boxShadow: "var(--ds-shadow-overlay, 0px 0px 1px 0px rgba(9, 30, 66, 0.31), 0px 3px 5px 0px rgba(9, 30, 66, 0.20))"
13
+ });
14
+ export var CustomDropdown = styled.div({
15
+ width: '360px',
16
+ background: "var(--ds-background-input, ".concat(N0, ")"),
17
+ borderRadius: '3px',
18
+ boxShadow: "var(--ds-shadow-overlay, 0px 0px 1px 0px rgba(9, 30, 66, 0.31), 0px 3px 5px 0px rgba(9, 30, 66, 0.20))",
19
+ zIndex: '900'
20
+ });
21
+ export var CustomDropdownItem = styled.div(function (props) {
22
+ return {
23
+ height: '36px',
24
+ width: '100%',
25
+ display: 'flex',
26
+ justifyContent: 'flex-start',
27
+ alignItems: 'center',
28
+ paddingLeft: props.isSelected ? '15px' : '16px',
29
+ boxSizing: 'border-box',
30
+ color: props.isSelected ? "var(--ds-text-selected, ".concat(B400, ")") : 'inherit',
31
+ background: props.isSelected ? "var(--ds-background-accent-blue-subtlest, ".concat(B50, ")") : 'transparent',
32
+ borderLeft: props.isSelected ? "2px solid ".concat("var(--ds-text-selected, ".concat(B400, ")")) : 'none',
33
+ '&:hover': {
34
+ background: props.isSelected ? "var(--ds-background-accent-blue-subtlest, ".concat(B50, ")") : "var(--ds-background-input-hovered, ".concat(N20, ")"),
35
+ cursor: 'default'
36
+ }
37
+ };
38
+ });
39
+ export var CustomDateWrapper = styled.div({
40
+ padding: "var(--ds-space-150, 12px)",
41
+ boxSizing: 'border-box'
42
+ });
43
+ export var DatePickersWrapper = styled.div({
44
+ display: 'flex',
45
+ justifyContent: 'space-between',
46
+ alignItems: 'center',
47
+ width: '100%'
48
+ });
49
+ export var SelectDateRangeButton = styled.button({
50
+ background: "var(--ds-background-accent-gray-subtler, ".concat(N20, ")"),
51
+ border: 'none',
52
+ font: 'inherit',
53
+ width: '70px',
54
+ height: '40px',
55
+ marginTop: "var(--ds-space-150, 12px)",
56
+ borderRadius: '3px',
57
+ '&:hover': {
58
+ background: "var(--ds-background-accent-gray-subtler, ".concat(N30, ")"),
59
+ cursor: 'pointer'
60
+ }
61
+ });
62
+ export var DateRangeErrorMessage = styled.div({
63
+ display: 'flex',
64
+ lineHeight: 1.3333,
65
+ marginTop: "var(--ds-space-050, 4px)",
66
+ fontSize: '12px',
67
+ color: "var(--ds-text-danger, ".concat(R400, ")")
68
+ });
@@ -0,0 +1,25 @@
1
+ import _extends from "@babel/runtime/helpers/extends";
2
+ import React from 'react';
3
+ import Button from '@atlaskit/button/standard-button';
4
+ import ChevronDownIcon from '@atlaskit/icon/glyph/chevron-down';
5
+ export var PopupTrigger = function PopupTrigger(_ref) {
6
+ var triggerProps = _ref.triggerProps,
7
+ optionSelected = _ref.optionSelected,
8
+ label = _ref.label,
9
+ selectedLabel = _ref.selectedLabel,
10
+ onClickButton = _ref.onClickButton;
11
+ return /*#__PURE__*/React.createElement(Button, _extends({}, triggerProps, {
12
+ testId: 'confluence-search-modal--date-range-button',
13
+ onClick: onClickButton,
14
+ isSelected: optionSelected,
15
+ iconAfter: /*#__PURE__*/React.createElement("span", {
16
+ style: {
17
+ display: 'flex',
18
+ alignItems: 'center'
19
+ }
20
+ }, /*#__PURE__*/React.createElement(ChevronDownIcon, {
21
+ size: "medium",
22
+ label: ""
23
+ }))
24
+ }), label, selectedLabel ? ": ".concat(selectedLabel) : '');
25
+ };
@@ -1,15 +1,17 @@
1
- import _objectDestructuringEmpty from "@babel/runtime/helpers/objectDestructuringEmpty";
2
1
  import React from 'react';
3
2
  import { Flex, xcss } from '@atlaskit/primitives';
3
+ import { DateRangePicker } from './filters/date-range-picker';
4
4
  var basicFilterContainerStyles = xcss({
5
5
  paddingLeft: 'space.100'
6
6
  });
7
7
  var BasicFilterContainer = function BasicFilterContainer(_ref) {
8
- _objectDestructuringEmpty(_ref);
8
+ var onChange = _ref.onChange;
9
9
  return /*#__PURE__*/React.createElement(Flex, {
10
10
  xcss: basicFilterContainerStyles,
11
11
  gap: "space.100",
12
12
  testId: "clol-basic-filter-container"
13
- }, /*#__PURE__*/React.createElement(React.Fragment, null), /*#__PURE__*/React.createElement(React.Fragment, null));
13
+ }, /*#__PURE__*/React.createElement(DateRangePicker, {
14
+ onSelectionChange: onChange
15
+ }), /*#__PURE__*/React.createElement(React.Fragment, null));
14
16
  };
15
17
  export default BasicFilterContainer;
@@ -0,0 +1,5 @@
1
+ export var CLOLBasicFilters = /*#__PURE__*/function (CLOLBasicFilters) {
2
+ CLOLBasicFilters["editedOrCreatedBy"] = "editedOrCreatedBy";
3
+ CLOLBasicFilters["lastModified"] = "lastModified";
4
+ return CLOLBasicFilters;
5
+ }({});
@@ -1,4 +1,7 @@
1
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
1
2
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
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; }
4
+ 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) { _defineProperty(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; }
2
5
  import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
3
6
  import { getBooleanFF } from '@atlaskit/platform-feature-flags';
4
7
  import { Flex, xcss } from '@atlaskit/primitives';
@@ -18,6 +21,10 @@ var ConfluenceSearchContainer = function ConfluenceSearchContainer(_ref) {
18
21
  _useState2 = _slicedToArray(_useState, 2),
19
22
  searchBarSearchString = _useState2[0],
20
23
  setSearchBarSearchString = _useState2[1];
24
+ var _useState3 = useState({}),
25
+ _useState4 = _slicedToArray(_useState3, 2),
26
+ filterSelections = _useState4[0],
27
+ setFilterSelections = _useState4[1];
21
28
  var handleSearchChange = useCallback(function (e) {
22
29
  var rawSearch = e.currentTarget.value;
23
30
  setSearchBarSearchString(rawSearch);
@@ -31,6 +38,12 @@ var ConfluenceSearchContainer = function ConfluenceSearchContainer(_ref) {
31
38
  currentCloudId.current = cloudId;
32
39
  }
33
40
  }, [cloudId]);
41
+ var handleBasicFilterSelectionChange = useCallback(function (filterType, options) {
42
+ var updatedSelection = _objectSpread(_objectSpread({}, filterSelections), {}, _defineProperty({}, filterType, options));
43
+ setFilterSelections(updatedSelection);
44
+ //TODO: move to debounce fn in https://product-fabric.atlassian.net/browse/EDM-9485
45
+ onSearch(searchBarSearchString, updatedSelection);
46
+ }, [filterSelections, onSearch, searchBarSearchString]);
34
47
  var showBasicFilters = useMemo(function () {
35
48
  if (getBooleanFF('platform.linking-platform.datasource.show-clol-basic-filters')) {
36
49
  return true;
@@ -48,6 +61,8 @@ var ConfluenceSearchContainer = function ConfluenceSearchContainer(_ref) {
48
61
  searchTerm: searchBarSearchString,
49
62
  placeholder: searchMessages.searchLabel,
50
63
  fullWidth: !showBasicFilters
51
- }), showBasicFilters && /*#__PURE__*/React.createElement(BasicFilters, null));
64
+ }), showBasicFilters && /*#__PURE__*/React.createElement(BasicFilters, {
65
+ onChange: handleBasicFilterSelectionChange
66
+ }));
52
67
  };
53
68
  export default ConfluenceSearchContainer;
@@ -75,7 +75,10 @@ export var PlainConfluenceSearchConfigModal = function PlainConfluenceSearchConf
75
75
  viewMode = _props$viewMode === void 0 ? 'table' : _props$viewMode,
76
76
  initialParameters = props.parameters,
77
77
  urlBeingEdited = props.url,
78
- initialVisibleColumnKeys = props.visibleColumnKeys;
78
+ initialVisibleColumnKeys = props.visibleColumnKeys,
79
+ _props$disableDisplay = props.disableDisplayDropdown,
80
+ disableDisplayDropdown = _props$disableDisplay === void 0 ? false : _props$disableDisplay,
81
+ overrideParameters = props.overrideParameters;
79
82
  var _useState = useState(undefined),
80
83
  _useState2 = _slicedToArray(_useState, 2),
81
84
  availableSites = _useState2[0],
@@ -96,6 +99,10 @@ export var PlainConfluenceSearchConfigModal = function PlainConfluenceSearchConf
96
99
  _useState10 = _slicedToArray(_useState9, 2),
97
100
  visibleColumnKeys = _useState10[0],
98
101
  setVisibleColumnKeys = _useState10[1];
102
+ var _useState11 = useState(),
103
+ _useState12 = _slicedToArray(_useState11, 2),
104
+ lastModified = _useState12[0],
105
+ setLastModified = _useState12[1];
99
106
 
100
107
  // analytics related parameters
101
108
  var searchCount = useRef(0);
@@ -108,16 +115,24 @@ export var PlainConfluenceSearchConfigModal = function PlainConfluenceSearchConf
108
115
  return _objectSpread(_objectSpread({}, initialParameters), {}, {
109
116
  cloudId: cloudId,
110
117
  searchString: searchString
118
+ }, lastModified && {
119
+ lastModified: lastModified
111
120
  });
112
- }, [cloudId, initialParameters, searchString /** Add more parameters when more filters are added */]);
121
+ }, [cloudId, lastModified, initialParameters, searchString /** Add more parameters when more filters are added */]);
113
122
  var isParametersSet = useMemo(function () {
114
123
  return !!cloudId && Object.values(parameters !== null && parameters !== void 0 ? parameters : {}).filter(function (v) {
115
124
  return v !== undefined;
116
125
  }).length > 1;
117
126
  }, [cloudId, parameters]);
127
+ var parametersToSend = useMemo(function () {
128
+ if (!isParametersSet) {
129
+ return undefined;
130
+ }
131
+ return _objectSpread(_objectSpread({}, parameters), overrideParameters !== null && overrideParameters !== void 0 ? overrideParameters : {});
132
+ }, [parameters, overrideParameters, isParametersSet]);
118
133
  var _useDatasourceTableSt = useDatasourceTableState({
119
134
  datasourceId: datasourceId,
120
- parameters: isParametersSet ? parameters : undefined,
135
+ parameters: parametersToSend,
121
136
  fieldKeys: visibleColumnKeys
122
137
  }),
123
138
  reset = _useDatasourceTableSt.reset,
@@ -209,17 +224,17 @@ export var PlainConfluenceSearchConfigModal = function PlainConfluenceSearchConf
209
224
  setVisibleColumnKeys(newVisibleColumnKeys);
210
225
  }, [initialVisibleColumnKeys, defaultVisibleColumnKeys]);
211
226
  var siteSelectorLabel = availableSites && availableSites.length > 1 ? confluenceSearchModalMessages.insertIssuesTitleManySites : confluenceSearchModalMessages.insertIssuesTitle;
212
- var _useState11 = useState(initialColumnCustomSizes),
213
- _useState12 = _slicedToArray(_useState11, 2),
214
- columnCustomSizes = _useState12[0],
215
- setColumnCustomSizes = _useState12[1];
227
+ var _useState13 = useState(initialColumnCustomSizes),
228
+ _useState14 = _slicedToArray(_useState13, 2),
229
+ columnCustomSizes = _useState14[0],
230
+ setColumnCustomSizes = _useState14[1];
216
231
  var onColumnResize = useCallback(function (key, width) {
217
232
  setColumnCustomSizes(_objectSpread(_objectSpread({}, columnCustomSizes), {}, _defineProperty({}, key, width)));
218
233
  }, [columnCustomSizes]);
219
- var _useState13 = useState(initialWrappedColumnKeys),
220
- _useState14 = _slicedToArray(_useState13, 2),
221
- wrappedColumnKeys = _useState14[0],
222
- setWrappedColumnKeys = _useState14[1];
234
+ var _useState15 = useState(initialWrappedColumnKeys),
235
+ _useState16 = _slicedToArray(_useState15, 2),
236
+ wrappedColumnKeys = _useState16[0],
237
+ setWrappedColumnKeys = _useState16[1];
223
238
  var onWrappedColumnChange = useCallback(function (key, isWrapped) {
224
239
  var set = new Set(wrappedColumnKeys);
225
240
  if (isWrapped) {
@@ -372,7 +387,7 @@ export var PlainConfluenceSearchConfigModal = function PlainConfluenceSearchConf
372
387
  } else {
373
388
  onInsert(buildDatasourceAdf({
374
389
  id: datasourceId,
375
- parameters: _objectSpread(_objectSpread({}, parameters), {}, {
390
+ parameters: _objectSpread(_objectSpread({}, parametersToSend), {}, {
376
391
  cloudId: cloudId
377
392
  }),
378
393
  views: [{
@@ -393,14 +408,20 @@ export var PlainConfluenceSearchConfigModal = function PlainConfluenceSearchConf
393
408
  }]
394
409
  }, confluenceSearchUrl), consumerEvent);
395
410
  }
396
- }, [isParametersSet, cloudId, analyticsPayload, totalCount, currentViewMode, onInsert, confluenceSearchUrl, datasourceId, parameters, visibleColumnKeys, columnCustomSizes, wrappedColumnKeys]);
411
+ }, [isParametersSet, cloudId, analyticsPayload, totalCount, currentViewMode, onInsert, confluenceSearchUrl, datasourceId, parametersToSend, visibleColumnKeys, columnCustomSizes, wrappedColumnKeys]);
397
412
  var handleViewModeChange = function handleViewModeChange(selectedMode) {
398
413
  userInteractionActions.current.add(DatasourceAction.DISPLAY_VIEW_CHANGED);
399
414
  setCurrentViewMode(selectedMode);
400
415
  };
401
- var onSearch = useCallback(function (newSearchString) {
416
+ var onSearch = useCallback(function (newSearchString, filters) {
402
417
  searchCount.current++;
403
418
  userInteractionActions.current.add(DatasourceAction.QUERY_UPDATED);
419
+ if (filters !== null && filters !== void 0 && filters.lastModified) {
420
+ var lastModifiedValue = filters.lastModified.find(function (range) {
421
+ return range.value;
422
+ });
423
+ setLastModified(lastModifiedValue === null || lastModifiedValue === void 0 ? void 0 : lastModifiedValue.value);
424
+ }
404
425
  setSearchString(newSearchString);
405
426
  reset({
406
427
  shouldForceRequest: true
@@ -429,7 +450,7 @@ export var PlainConfluenceSearchConfigModal = function PlainConfluenceSearchConf
429
450
  selectedSite: selectedConfluenceSite,
430
451
  testId: "confluence-search-datasource-modal--site-selector",
431
452
  label: siteSelectorLabel
432
- })), !hasNoConfluenceSites && jsx(DisplayViewDropDown, {
453
+ })), !hasNoConfluenceSites && !disableDisplayDropdown && jsx(DisplayViewDropDown, {
433
454
  onViewModeChange: handleViewModeChange,
434
455
  viewMode: currentViewMode
435
456
  })), jsx(ModalBody, null, !hasNoConfluenceSites ? jsx(Fragment, null, jsx(Box, {
@@ -170,6 +170,7 @@ var DatasourceTableViewWithoutAnalytics = function DatasourceTableViewWithoutAna
170
170
  testId: "datasource-table-view-skeleton",
171
171
  isCompact: true
172
172
  }), jsx(TableFooter, {
173
+ datasourceId: datasourceId,
173
174
  itemCount: isDataReady ? totalCount : undefined,
174
175
  onRefresh: onRefresh,
175
176
  isLoading: !isDataReady || status === 'loading',
@@ -6,9 +6,9 @@ import isEqual from 'lodash/isEqual';
6
6
  import { useIntl } from 'react-intl-next';
7
7
  import { useDebouncedCallback } from 'use-debounce';
8
8
  import { FilterPopupSelect } from '../../../../common/modal/popup-select';
9
+ import { SEARCH_DEBOUNCE_MS } from '../../../../common/modal/popup-select/constants';
9
10
  import { useFilterOptions } from '../../hooks/useFilterOptions';
10
11
  import { asyncPopupSelectMessages } from './messages';
11
- export var SEARCH_DEBOUNCE_MS = 350;
12
12
  var AsyncPopupSelect = function AsyncPopupSelect(_ref) {
13
13
  var filterType = _ref.filterType,
14
14
  site = _ref.site,
@@ -104,11 +104,12 @@ var AsyncPopupSelect = function AsyncPopupSelect(_ref) {
104
104
  var isEmpty = status === 'resolved' && filterOptionsLength === 0;
105
105
  var popupSelectOptions = isLoading || isError ? [] : filterOptions; // if not set to [], then on loading, no loading UI will be shown
106
106
  var areAllResultsLoaded = filterOptionsLength === totalCount;
107
+ var filterName = "jlol-basic-filter-".concat(filterType);
107
108
  var shouldShowFooter = (status === 'resolved' || isLoadingMore) && filterOptionsLength > 0; // footer should not disappear when there is an inline spinner for loading more data
108
109
  var shouldDisplayShowMoreButton = status === 'resolved' && !!pageCursor && !areAllResultsLoaded;
109
110
  var triggerButtonLabel = formatMessage(asyncPopupSelectMessages["".concat(filterType, "Label")]);
110
111
  return /*#__PURE__*/React.createElement(FilterPopupSelect, {
111
- filterName: "jlol-basic-filter-".concat(filterType),
112
+ filterName: filterName,
112
113
  status: status,
113
114
  showLoading: isLoading,
114
115
  showHydrating: isJQLHydrating,
@@ -122,7 +123,7 @@ var AsyncPopupSelect = function AsyncPopupSelect(_ref) {
122
123
  onSelectionChange: handleOptionSelection,
123
124
  onMenuOpen: handleMenuOpen,
124
125
  menuListProps: {
125
- filterName: filterType,
126
+ filterName: filterName,
126
127
  isError: isError,
127
128
  isEmpty: isEmpty,
128
129
  isLoading: isLoading,
@@ -14,6 +14,7 @@ import { Flex, xcss } from '@atlaskit/primitives';
14
14
  import { useDatasourceAnalyticsEvents } from '../../../analytics';
15
15
  import { BasicSearchInput } from '../../common/modal/basic-search-input';
16
16
  import { basicSearchInputMessages } from '../../common/modal/basic-search-input/messages';
17
+ import { FILTER_SELECTION_DEBOUNCE_MS } from '../../common/modal/popup-select/constants';
17
18
  import { BasicFilters } from '../basic-filters';
18
19
  import { useHydrateJqlQuery } from '../basic-filters/hooks/useHydrateJqlQuery';
19
20
  import { isQueryTooComplex } from '../basic-filters/utils/isQueryTooComplex';
@@ -31,7 +32,6 @@ var basicSearchInputContainerStyles = xcss({
31
32
  });
32
33
  export var DEFAULT_JQL_QUERY = 'ORDER BY created DESC';
33
34
  export var ALLOWED_ORDER_BY_KEYS = ['key', 'summary', 'assignee', 'status', 'created'];
34
- export var FILTER_SELECTION_DEBOUNCE_MS = 500;
35
35
  export var JiraSearchContainer = function JiraSearchContainer(props) {
36
36
  var isSearching = props.isSearching,
37
37
  parameters = props.parameters,
@@ -8,9 +8,12 @@ import { FormattedMessage, FormattedNumber, useIntl } from 'react-intl-next';
8
8
  import Button from '@atlaskit/button';
9
9
  import Heading from '@atlaskit/heading';
10
10
  import RefreshIcon from '@atlaskit/icon/glyph/refresh';
11
+ import { getBooleanFF } from '@atlaskit/platform-feature-flags';
11
12
  import LinkUrl from '@atlaskit/smart-card/link-url';
12
13
  import { N0, N40, N800, N90 } from '@atlaskit/theme/colors';
14
+ import { ASSETS_LIST_OF_LINKS_DATASOURCE_ID } from '../assets-modal';
13
15
  import { footerMessages } from './messages';
16
+ import { PoweredByJSMAssets } from './powered-by-jsm-assets';
14
17
  import { SyncInfo } from './sync-info';
15
18
  var FooterWrapper = styled.div({
16
19
  padding: "var(--ds-space-0, 0px)".concat(" ", "var(--ds-space-200, 16px)"),
@@ -41,7 +44,8 @@ var SyncTextWrapper = styled.div({
41
44
  fontSize: '12px'
42
45
  });
43
46
  export var TableFooter = function TableFooter(_ref) {
44
- var itemCount = _ref.itemCount,
47
+ var datasourceId = _ref.datasourceId,
48
+ itemCount = _ref.itemCount,
45
49
  onRefresh = _ref.onRefresh,
46
50
  isLoading = _ref.isLoading,
47
51
  url = _ref.url;
@@ -80,7 +84,9 @@ export var TableFooter = function TableFooter(_ref) {
80
84
  values: {
81
85
  itemCount: itemCount
82
86
  }
83
- }))))), jsx(SyncWrapper, null, onRefresh && jsx(Fragment, null, jsx(SyncTextWrapper, {
87
+ }))))), getBooleanFF('platform.linking-platform.datasource-assets_objects_add_jsm_promotional_tag') && datasourceId === ASSETS_LIST_OF_LINKS_DATASOURCE_ID ? jsx(PoweredByJSMAssets, {
88
+ text: intl.formatMessage(footerMessages.powerByJSM)
89
+ }) : null, jsx(SyncWrapper, null, onRefresh && jsx(Fragment, null, jsx(SyncTextWrapper, {
84
90
  "data-testid": "sync-text"
85
91
  }, isLoading ? jsx(FormattedMessage, footerMessages.loadingText) : jsx(SyncInfo, {
86
92
  lastSyncTime: lastSyncTime
@@ -14,5 +14,10 @@ export var footerMessages = defineMessages({
14
14
  id: 'linkDataSource.table-footer.refresh',
15
15
  description: 'Label for refresh icon',
16
16
  defaultMessage: 'Refresh'
17
+ },
18
+ powerByJSM: {
19
+ id: 'linkDataSource.table-footer.power-by-jsm',
20
+ description: 'Displayed on the issue like table footer to increase JSM Assets visibility',
21
+ defaultMessage: 'Powered by Assets in Jira Service Management'
17
22
  }
18
23
  });
@@ -0,0 +1,46 @@
1
+ import React from 'react';
2
+ import { JiraServiceManagementIcon } from '@atlaskit/logo';
3
+ import { Box, xcss } from '@atlaskit/primitives';
4
+ import { useDatasourceAnalyticsEvents } from '../../../analytics';
5
+ var jsmTextStyles = xcss({
6
+ fontSize: 'small',
7
+ color: 'color.text.subtle',
8
+ marginLeft: "var(--ds-space-075, 6px)",
9
+ ':hover': {
10
+ color: 'color.link.pressed'
11
+ }
12
+ });
13
+ var jsmContainerStyles = xcss({
14
+ display: 'flex',
15
+ flexDirection: 'row-reverse'
16
+ });
17
+ export var PoweredByJSMAssets = function PoweredByJSMAssets(props) {
18
+ var ASSETS_LINK = '/jira/servicedesk/assets';
19
+ var _useDatasourceAnalyti = useDatasourceAnalyticsEvents(),
20
+ fireEvent = _useDatasourceAnalyti.fireEvent;
21
+ return /*#__PURE__*/React.createElement(Box, {
22
+ xcss: jsmContainerStyles,
23
+ padding: "space.150"
24
+ }, /*#__PURE__*/React.createElement("a", {
25
+ "data-testid": 'powered-by-jsm-assets-link',
26
+ onClick: function onClick() {
27
+ return fireEvent('ui.link.clicked.poweredBy', {
28
+ componentHierarchy: 'datasourceTable',
29
+ extensionKey: 'jsm-cmdb-gateway'
30
+ });
31
+ },
32
+ href: ASSETS_LINK,
33
+ rel: "noreferrer",
34
+ target: "_blank",
35
+ style: {
36
+ display: 'inline-flex',
37
+ alignItems: 'center'
38
+ }
39
+ }, /*#__PURE__*/React.createElement(JiraServiceManagementIcon, {
40
+ size: "xsmall",
41
+ appearance: "brand",
42
+ label: props.text
43
+ }), /*#__PURE__*/React.createElement(Box, {
44
+ xcss: jsmTextStyles
45
+ }, props.text)));
46
+ };
@@ -16,6 +16,10 @@ export type AnalyticsContextAttributesType = {
16
16
  dataProvider: 'jira-issues' | 'jsm-assets' | 'confluence-search';
17
17
  };
18
18
  export type DatasourceModalDialogViewedAttributesType = {};
19
+ export type LinkClickedPoweredByAttributesType = {
20
+ extensionKey: string;
21
+ componentHierarchy: string;
22
+ };
19
23
  export type ModalReadyDatasourceAttributesType = {
20
24
  instancesCount: number | null;
21
25
  schemasCount: number | null;
@@ -211,6 +215,9 @@ export type AnalyticsEventAttributes = {
211
215
  /**
212
216
  * Fired when the “show more” button inside the dropdown menu is clicked */
213
217
  'ui.button.clicked.basicSearchDropdown': ButtonClickedBasicSearchDropdownAttributesType;
218
+ /**
219
+ * Fired when the “show more” button inside the dropdown menu is clicked */
220
+ 'ui.link.clicked.poweredBy': LinkClickedPoweredByAttributesType;
214
221
  /**
215
222
  * Fired when search is initiated via the search icon or enter key press for aql editor input field. */
216
223
  'ui.aqlEditor.searched': AqlEditorSearchedAttributesType;
@@ -0,0 +1,2 @@
1
+ export declare const FILTER_SELECTION_DEBOUNCE_MS = 500;
2
+ export declare const SEARCH_DEBOUNCE_MS = 350;
@@ -2,6 +2,7 @@
2
2
  export interface PopupFooterProps {
3
3
  currentDisplayCount: number;
4
4
  totalCount: number;
5
+ filterName: string;
5
6
  }
6
- declare const PopupFooter: ({ currentDisplayCount, totalCount }: PopupFooterProps) => JSX.Element;
7
+ declare const PopupFooter: ({ currentDisplayCount, totalCount, filterName, }: PopupFooterProps) => JSX.Element;
7
8
  export default PopupFooter;
@@ -2,7 +2,7 @@
2
2
  import { InputActionMeta, ValueType } from '@atlaskit/select';
3
3
  import { CustomMenuListProps } from './menu-list';
4
4
  import { SelectOption } from './types';
5
- export declare const FilterPopupSelect: ({ filterName, totalCount, status, buttonLabel, showLoading, isDisabled, showHydrating, shouldShowFooter, menuListProps, options, selectedOptions, onSelectionChange, onInputChange, onMenuClose, onMenuOpen, }: {
5
+ export interface FilterPopupSelectProps {
6
6
  buttonLabel: string;
7
7
  totalCount: number;
8
8
  filterName: string;
@@ -16,6 +16,7 @@ export declare const FilterPopupSelect: ({ filterName, totalCount, status, butto
16
16
  selectedOptions: ValueType<SelectOption, true>;
17
17
  onSelectionChange: (newValue: ValueType<SelectOption, true>) => void;
18
18
  onInputChange: (newValue: string, actionMeta: InputActionMeta) => void;
19
- onMenuOpen?: (() => void) | undefined;
20
- onMenuClose?: (() => void) | undefined;
21
- }) => JSX.Element;
19
+ onMenuOpen?: () => void;
20
+ onMenuClose?: () => void;
21
+ }
22
+ export declare const FilterPopupSelect: ({ filterName, totalCount, status, buttonLabel, showLoading, isDisabled, showHydrating, shouldShowFooter, menuListProps, options, selectedOptions, onSelectionChange, onInputChange, onMenuClose, onMenuOpen, }: FilterPopupSelectProps) => JSX.Element;
@@ -7,7 +7,7 @@ export type CustomMenuListProps = {
7
7
  isLoadingMore?: boolean;
8
8
  isEmpty?: boolean;
9
9
  showMore?: boolean;
10
- handleShowMore: () => void;
10
+ handleShowMore?: () => void;
11
11
  filterName: string;
12
12
  errors?: unknown[];
13
13
  };
@@ -1,3 +1,5 @@
1
1
  /// <reference types="react" />
2
- declare const CustomDropdownLoadingMessage: () => JSX.Element;
2
+ declare const CustomDropdownLoadingMessage: ({ filterName, }: {
3
+ filterName: string;
4
+ }) => JSX.Element;
3
5
  export default CustomDropdownLoadingMessage;
@@ -18,5 +18,10 @@ export type AvatarLabelOption = OptionBase & {
18
18
  isSquare?: boolean;
19
19
  isGroup?: boolean;
20
20
  };
21
- export type SelectOption = IconLabelOption | LozengeLabelOption | AvatarLabelOption;
21
+ export type DateRangeType = 'anyTime' | 'today' | 'yesterday' | 'past7Days' | 'past30Days' | 'pastYear' | 'custom';
22
+ export type DateRangeOption = OptionBase & {
23
+ optionType: 'defaultOption';
24
+ value: DateRangeType;
25
+ };
26
+ export type SelectOption = IconLabelOption | LozengeLabelOption | AvatarLabelOption | DateRangeOption;
22
27
  export type FormatOptionLabel = (option: SelectOption) => ReactElement;
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ import type { PopupComponentProps } from '@atlaskit/popup';
3
+ export declare const PopupComponent: React.ForwardRefExoticComponent<Pick<PopupComponentProps, "style" | "children" | "id" | "tabIndex" | "data-testid" | "shouldRenderToParent" | "data-placement"> & React.RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,8 @@
1
+ /// <reference types="react" />
2
+ import { SelectOption } from '../../../../common/modal/popup-select/types';
3
+ import { CLOLBasicFilters } from '../../types';
4
+ interface DateRangeProps {
5
+ onSelectionChange: (filterType: CLOLBasicFilters, options: SelectOption[]) => void;
6
+ }
7
+ export declare const DateRangePicker: ({ onSelectionChange }: DateRangeProps) => JSX.Element;
8
+ export {};
@@ -0,0 +1,42 @@
1
+ export declare const dateRangeMessages: {
2
+ dateRangeTitle: {
3
+ id: string;
4
+ defaultMessage: string;
5
+ description: string;
6
+ };
7
+ dateRangeAnyTime: {
8
+ id: string;
9
+ defaultMessage: string;
10
+ description: string;
11
+ };
12
+ dateRangeToday: {
13
+ id: string;
14
+ defaultMessage: string;
15
+ description: string;
16
+ };
17
+ dateRangeYesterday: {
18
+ id: string;
19
+ defaultMessage: string;
20
+ description: string;
21
+ };
22
+ dateRangeLastWeek: {
23
+ id: string;
24
+ defaultMessage: string;
25
+ description: string;
26
+ };
27
+ dateRangeLastMonth: {
28
+ id: string;
29
+ defaultMessage: string;
30
+ description: string;
31
+ };
32
+ dateRangeLastYear: {
33
+ id: string;
34
+ defaultMessage: string;
35
+ description: string;
36
+ };
37
+ dateRangeCustom: {
38
+ id: string;
39
+ defaultMessage: string;
40
+ description: string;
41
+ };
42
+ };