@atlaskit/link-datasource 1.26.2 → 1.26.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/dist/cjs/ui/common/modal/basic-search-input/index.js +9 -18
- package/dist/cjs/ui/common/modal/popup-select/index.js +217 -0
- package/dist/cjs/ui/{jira-issues-modal/basic-filters/ui → common/modal/popup-select}/menu-list/errorMessage.js +3 -3
- package/dist/cjs/ui/{jira-issues-modal/basic-filters/ui → common/modal/popup-select}/menu-list/index.js +6 -5
- package/dist/cjs/ui/{jira-issues-modal/basic-filters/ui → common/modal/popup-select}/menu-list/messages.js +5 -0
- package/dist/cjs/ui/{jira-issues-modal/basic-filters/ui → common/modal/popup-select}/menu-list/noOptionsMessage.js +3 -3
- package/dist/cjs/ui/common/modal/popup-select/menu-list/showMoreButton.js +36 -0
- package/dist/cjs/ui/common/modal/popup-select/messages.js +19 -0
- package/dist/cjs/ui/{jira-issues-modal/basic-filters/ui/async-popup-select → common/modal/popup-select}/trigger.js +12 -13
- package/dist/cjs/ui/common/modal/popup-select/types.js +5 -0
- package/dist/cjs/ui/confluence-search-modal/basic-filters/index.js +22 -0
- package/dist/cjs/ui/confluence-search-modal/confluence-search-container/index.js +18 -3
- package/dist/cjs/ui/jira-issues-modal/basic-filters/ui/async-popup-select/index.js +27 -163
- package/dist/cjs/ui/jira-issues-modal/basic-filters/ui/async-popup-select/messages.js +0 -15
- package/dist/cjs/ui/jira-issues-modal/jira-search-container/index.js +2 -1
- package/dist/es2019/ui/common/modal/basic-search-input/index.js +2 -10
- package/dist/es2019/ui/common/modal/popup-select/index.js +170 -0
- package/dist/es2019/ui/{jira-issues-modal/basic-filters/ui → common/modal/popup-select}/menu-list/errorMessage.js +3 -3
- package/dist/es2019/ui/{jira-issues-modal/basic-filters/ui → common/modal/popup-select}/menu-list/index.js +6 -5
- package/dist/es2019/ui/{jira-issues-modal/basic-filters/ui → common/modal/popup-select}/menu-list/messages.js +5 -0
- package/dist/es2019/ui/{jira-issues-modal/basic-filters/ui → common/modal/popup-select}/menu-list/noOptionsMessage.js +3 -3
- package/dist/es2019/ui/common/modal/popup-select/menu-list/showMoreButton.js +29 -0
- package/dist/es2019/ui/common/modal/popup-select/messages.js +13 -0
- package/dist/es2019/ui/{jira-issues-modal/basic-filters/ui/async-popup-select → common/modal/popup-select}/trigger.js +10 -11
- package/dist/es2019/ui/common/modal/popup-select/types.js +1 -0
- package/dist/es2019/ui/confluence-search-modal/basic-filters/index.js +13 -0
- package/dist/es2019/ui/confluence-search-modal/confluence-search-container/index.js +19 -4
- package/dist/es2019/ui/jira-issues-modal/basic-filters/ui/async-popup-select/index.js +25 -145
- package/dist/es2019/ui/jira-issues-modal/basic-filters/ui/async-popup-select/messages.js +0 -15
- package/dist/es2019/ui/jira-issues-modal/jira-search-container/index.js +2 -1
- package/dist/esm/ui/common/modal/basic-search-input/index.js +2 -10
- package/dist/esm/ui/common/modal/popup-select/index.js +207 -0
- package/dist/esm/ui/{jira-issues-modal/basic-filters/ui → common/modal/popup-select}/menu-list/errorMessage.js +3 -3
- package/dist/esm/ui/{jira-issues-modal/basic-filters/ui → common/modal/popup-select}/menu-list/index.js +6 -5
- package/dist/esm/ui/{jira-issues-modal/basic-filters/ui → common/modal/popup-select}/menu-list/messages.js +5 -0
- package/dist/esm/ui/{jira-issues-modal/basic-filters/ui → common/modal/popup-select}/menu-list/noOptionsMessage.js +3 -3
- package/dist/esm/ui/common/modal/popup-select/menu-list/showMoreButton.js +26 -0
- package/dist/esm/ui/common/modal/popup-select/messages.js +13 -0
- package/dist/esm/ui/{jira-issues-modal/basic-filters/ui/async-popup-select → common/modal/popup-select}/trigger.js +12 -13
- package/dist/esm/ui/common/modal/popup-select/types.js +1 -0
- package/dist/esm/ui/confluence-search-modal/basic-filters/index.js +15 -0
- package/dist/esm/ui/confluence-search-modal/confluence-search-container/index.js +19 -4
- package/dist/esm/ui/jira-issues-modal/basic-filters/ui/async-popup-select/index.js +27 -163
- package/dist/esm/ui/jira-issues-modal/basic-filters/ui/async-popup-select/messages.js +0 -15
- package/dist/esm/ui/jira-issues-modal/jira-search-container/index.js +2 -1
- package/dist/types/analytics/generated/analytics.types.d.ts +6 -6
- package/dist/types/ui/common/modal/basic-search-input/index.d.ts +1 -0
- package/dist/types/ui/{jira-issues-modal/basic-filters/ui/async-popup-select → common/modal/popup-select}/control.d.ts +1 -1
- package/dist/{types-ts4.5/ui/jira-issues-modal/basic-filters/ui/async-popup-select → types/ui/common/modal/popup-select}/dropdownIndicator.d.ts +1 -1
- package/dist/types/ui/{jira-issues-modal/basic-filters/ui/async-popup-select → common/modal/popup-select}/formatOptionLabel.d.ts +1 -1
- package/dist/types/ui/common/modal/popup-select/index.d.ts +21 -0
- package/dist/types/ui/common/modal/popup-select/menu-list/errorMessage.d.ts +6 -0
- package/dist/types/ui/common/modal/popup-select/menu-list/index.d.ts +15 -0
- package/dist/{types-ts4.5/ui/jira-issues-modal/basic-filters/ui → types/ui/common/modal/popup-select}/menu-list/messages.d.ts +5 -0
- package/dist/types/ui/common/modal/popup-select/menu-list/noOptionsMessage.d.ts +5 -0
- package/dist/{types-ts4.5/ui/jira-issues-modal/basic-filters/ui/async-popup-select → types/ui/common/modal/popup-select/menu-list}/showMoreButton.d.ts +2 -1
- package/dist/types/ui/common/modal/popup-select/messages.d.ts +12 -0
- package/dist/types/ui/{jira-issues-modal/basic-filters/ui/async-popup-select → common/modal/popup-select}/trigger.d.ts +3 -2
- package/dist/types/ui/common/modal/popup-select/types.d.ts +22 -0
- package/dist/types/ui/confluence-search-modal/basic-filters/index.d.ts +5 -0
- package/dist/types/ui/jira-issues-modal/basic-filters/types.d.ts +0 -2
- package/dist/types/ui/jira-issues-modal/basic-filters/ui/async-popup-select/messages.d.ts +0 -15
- package/dist/types-ts4.5/analytics/generated/analytics.types.d.ts +6 -6
- package/dist/types-ts4.5/ui/common/modal/basic-search-input/index.d.ts +1 -0
- package/dist/types-ts4.5/ui/{jira-issues-modal/basic-filters/ui/async-popup-select → common/modal/popup-select}/control.d.ts +1 -1
- package/dist/{types/ui/jira-issues-modal/basic-filters/ui/async-popup-select → types-ts4.5/ui/common/modal/popup-select}/dropdownIndicator.d.ts +1 -1
- package/dist/types-ts4.5/ui/{jira-issues-modal/basic-filters/ui/async-popup-select → common/modal/popup-select}/formatOptionLabel.d.ts +1 -1
- package/dist/types-ts4.5/ui/common/modal/popup-select/index.d.ts +21 -0
- package/dist/types-ts4.5/ui/common/modal/popup-select/menu-list/errorMessage.d.ts +6 -0
- package/dist/types-ts4.5/ui/common/modal/popup-select/menu-list/index.d.ts +15 -0
- package/dist/{types/ui/jira-issues-modal/basic-filters/ui → types-ts4.5/ui/common/modal/popup-select}/menu-list/messages.d.ts +5 -0
- package/dist/types-ts4.5/ui/common/modal/popup-select/menu-list/noOptionsMessage.d.ts +5 -0
- package/dist/{types/ui/jira-issues-modal/basic-filters/ui/async-popup-select → types-ts4.5/ui/common/modal/popup-select/menu-list}/showMoreButton.d.ts +2 -1
- package/dist/types-ts4.5/ui/common/modal/popup-select/messages.d.ts +12 -0
- package/dist/types-ts4.5/ui/{jira-issues-modal/basic-filters/ui/async-popup-select → common/modal/popup-select}/trigger.d.ts +3 -2
- package/dist/types-ts4.5/ui/common/modal/popup-select/types.d.ts +22 -0
- package/dist/types-ts4.5/ui/confluence-search-modal/basic-filters/index.d.ts +5 -0
- package/dist/types-ts4.5/ui/jira-issues-modal/basic-filters/types.d.ts +0 -2
- package/dist/types-ts4.5/ui/jira-issues-modal/basic-filters/ui/async-popup-select/messages.d.ts +0 -15
- package/package.json +6 -3
- package/dist/cjs/ui/jira-issues-modal/basic-filters/ui/async-popup-select/showMoreButton.js +0 -22
- package/dist/es2019/ui/jira-issues-modal/basic-filters/ui/async-popup-select/showMoreButton.js +0 -17
- package/dist/esm/ui/jira-issues-modal/basic-filters/ui/async-popup-select/showMoreButton.js +0 -15
- package/dist/types/ui/jira-issues-modal/basic-filters/ui/menu-list/errorMessage.d.ts +0 -8
- package/dist/types/ui/jira-issues-modal/basic-filters/ui/menu-list/index.d.ts +0 -5
- package/dist/types/ui/jira-issues-modal/basic-filters/ui/menu-list/noOptionsMessage.d.ts +0 -6
- package/dist/types-ts4.5/ui/jira-issues-modal/basic-filters/ui/menu-list/errorMessage.d.ts +0 -8
- package/dist/types-ts4.5/ui/jira-issues-modal/basic-filters/ui/menu-list/index.d.ts +0 -5
- package/dist/types-ts4.5/ui/jira-issues-modal/basic-filters/ui/menu-list/noOptionsMessage.d.ts +0 -6
- /package/dist/cjs/ui/{jira-issues-modal/basic-filters/ui/async-popup-select → common/modal/popup-select}/control.js +0 -0
- /package/dist/cjs/ui/{jira-issues-modal/basic-filters/ui/async-popup-select → common/modal/popup-select}/dropdownIndicator.js +0 -0
- /package/dist/cjs/ui/{jira-issues-modal/basic-filters/ui/async-popup-select → common/modal/popup-select}/footer.js +0 -0
- /package/dist/cjs/ui/{jira-issues-modal/basic-filters/ui/async-popup-select → common/modal/popup-select}/formatOptionLabel.js +0 -0
- /package/dist/cjs/ui/{jira-issues-modal/basic-filters/ui → common/modal/popup-select}/menu-list/loadingMessage.js +0 -0
- /package/dist/cjs/ui/{jira-issues-modal/basic-filters/ui → common/modal/popup-select}/menu-list/selectMessage.js +0 -0
- /package/dist/es2019/ui/{jira-issues-modal/basic-filters/ui/async-popup-select → common/modal/popup-select}/control.js +0 -0
- /package/dist/es2019/ui/{jira-issues-modal/basic-filters/ui/async-popup-select → common/modal/popup-select}/dropdownIndicator.js +0 -0
- /package/dist/es2019/ui/{jira-issues-modal/basic-filters/ui/async-popup-select → common/modal/popup-select}/footer.js +0 -0
- /package/dist/es2019/ui/{jira-issues-modal/basic-filters/ui/async-popup-select → common/modal/popup-select}/formatOptionLabel.js +0 -0
- /package/dist/es2019/ui/{jira-issues-modal/basic-filters/ui → common/modal/popup-select}/menu-list/loadingMessage.js +0 -0
- /package/dist/es2019/ui/{jira-issues-modal/basic-filters/ui → common/modal/popup-select}/menu-list/selectMessage.js +0 -0
- /package/dist/esm/ui/{jira-issues-modal/basic-filters/ui/async-popup-select → common/modal/popup-select}/control.js +0 -0
- /package/dist/esm/ui/{jira-issues-modal/basic-filters/ui/async-popup-select → common/modal/popup-select}/dropdownIndicator.js +0 -0
- /package/dist/esm/ui/{jira-issues-modal/basic-filters/ui/async-popup-select → common/modal/popup-select}/footer.js +0 -0
- /package/dist/esm/ui/{jira-issues-modal/basic-filters/ui/async-popup-select → common/modal/popup-select}/formatOptionLabel.js +0 -0
- /package/dist/esm/ui/{jira-issues-modal/basic-filters/ui → common/modal/popup-select}/menu-list/loadingMessage.js +0 -0
- /package/dist/esm/ui/{jira-issues-modal/basic-filters/ui → common/modal/popup-select}/menu-list/selectMessage.js +0 -0
- /package/dist/types/ui/{jira-issues-modal/basic-filters/ui/async-popup-select → common/modal/popup-select}/footer.d.ts +0 -0
- /package/dist/types/ui/{jira-issues-modal/basic-filters/ui → common/modal/popup-select}/menu-list/loadingMessage.d.ts +0 -0
- /package/dist/types/ui/{jira-issues-modal/basic-filters/ui → common/modal/popup-select}/menu-list/selectMessage.d.ts +0 -0
- /package/dist/types-ts4.5/ui/{jira-issues-modal/basic-filters/ui/async-popup-select → common/modal/popup-select}/footer.d.ts +0 -0
- /package/dist/types-ts4.5/ui/{jira-issues-modal/basic-filters/ui → common/modal/popup-select}/menu-list/loadingMessage.d.ts +0 -0
- /package/dist/types-ts4.5/ui/{jira-issues-modal/basic-filters/ui → common/modal/popup-select}/menu-list/selectMessage.d.ts +0 -0
|
@@ -4,7 +4,7 @@ import { useDebouncedCallback } from 'use-debounce';
|
|
|
4
4
|
import ErrorIcon from '@atlaskit/icon/glyph/error';
|
|
5
5
|
import { N500 } from '@atlaskit/theme/colors';
|
|
6
6
|
import { useDatasourceAnalyticsEvents } from '../../../../../analytics';
|
|
7
|
-
import { SEARCH_DEBOUNCE_MS } from '
|
|
7
|
+
import { SEARCH_DEBOUNCE_MS } from '../../../../jira-issues-modal/basic-filters/ui/async-popup-select';
|
|
8
8
|
import { asyncPopupSelectMessages } from './messages';
|
|
9
9
|
import CustomSelectMessage from './selectMessage';
|
|
10
10
|
var getErrorReasonType = function getErrorReasonType(errors) {
|
|
@@ -20,7 +20,7 @@ var getErrorReasonType = function getErrorReasonType(errors) {
|
|
|
20
20
|
return 'unknown';
|
|
21
21
|
};
|
|
22
22
|
var CustomErrorMessage = function CustomErrorMessage(_ref3) {
|
|
23
|
-
var
|
|
23
|
+
var filterName = _ref3.filterName,
|
|
24
24
|
errors = _ref3.errors;
|
|
25
25
|
var _useDatasourceAnalyti = useDatasourceAnalyticsEvents(),
|
|
26
26
|
fireEvent = _useDatasourceAnalyti.fireEvent;
|
|
@@ -31,7 +31,7 @@ var CustomErrorMessage = function CustomErrorMessage(_ref3) {
|
|
|
31
31
|
*/
|
|
32
32
|
var _useDebouncedCallback = useDebouncedCallback(function () {
|
|
33
33
|
fireEvent('ui.error.shown.basicSearchDropdown', {
|
|
34
|
-
|
|
34
|
+
filterName: filterName,
|
|
35
35
|
reason: getErrorReasonType(errors)
|
|
36
36
|
});
|
|
37
37
|
}, SEARCH_DEBOUNCE_MS),
|
|
@@ -4,10 +4,10 @@ import React from 'react';
|
|
|
4
4
|
import { Box, Flex, xcss } from '@atlaskit/primitives';
|
|
5
5
|
import { components } from '@atlaskit/select';
|
|
6
6
|
import Spinner from '@atlaskit/spinner';
|
|
7
|
-
import ShowMoreButton from '../async-popup-select/showMoreButton';
|
|
8
7
|
import CustomErrorMessage from './errorMessage';
|
|
9
8
|
import CustomDropdownLoadingMessage from './loadingMessage';
|
|
10
9
|
import CustomNoOptionsMessage from './noOptionsMessage';
|
|
10
|
+
import ShowMoreButton from './showMoreButton';
|
|
11
11
|
var inlineSpinnerStyles = xcss({
|
|
12
12
|
paddingTop: 'space.075'
|
|
13
13
|
});
|
|
@@ -19,7 +19,7 @@ var CustomMenuList = function CustomMenuList(_ref) {
|
|
|
19
19
|
var children = _ref.children,
|
|
20
20
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
21
21
|
var _props$selectProps$me = props.selectProps.menuListProps,
|
|
22
|
-
|
|
22
|
+
filterName = _props$selectProps$me.filterName,
|
|
23
23
|
isLoading = _props$selectProps$me.isLoading,
|
|
24
24
|
isLoadingMore = _props$selectProps$me.isLoadingMore,
|
|
25
25
|
isError = _props$selectProps$me.isError,
|
|
@@ -43,19 +43,20 @@ var CustomMenuList = function CustomMenuList(_ref) {
|
|
|
43
43
|
}
|
|
44
44
|
if (isError) {
|
|
45
45
|
return /*#__PURE__*/React.createElement(CustomErrorMessage, {
|
|
46
|
-
|
|
46
|
+
filterName: filterName,
|
|
47
47
|
errors: errors
|
|
48
48
|
});
|
|
49
49
|
}
|
|
50
50
|
if (isEmpty) {
|
|
51
51
|
return /*#__PURE__*/React.createElement(CustomNoOptionsMessage, {
|
|
52
|
-
|
|
52
|
+
filterName: filterName
|
|
53
53
|
});
|
|
54
54
|
}
|
|
55
55
|
return /*#__PURE__*/React.createElement(React.Fragment, null, children, shouldDisplayShowMore && /*#__PURE__*/React.createElement(Box, {
|
|
56
56
|
xcss: showMoreButtonBoxStyles
|
|
57
57
|
}, /*#__PURE__*/React.createElement(ShowMoreButton, {
|
|
58
|
-
onShowMore: handleShowMore
|
|
58
|
+
onShowMore: handleShowMore,
|
|
59
|
+
filterName: filterName
|
|
59
60
|
})), isLoadingMoreData && /*#__PURE__*/React.createElement(InlineSpinner, null));
|
|
60
61
|
};
|
|
61
62
|
return /*#__PURE__*/React.createElement(components.MenuList, props, renderChildren());
|
|
@@ -14,5 +14,10 @@ export var asyncPopupSelectMessages = defineMessages({
|
|
|
14
14
|
id: 'linkDataSource.basic-filter.error-message',
|
|
15
15
|
defaultMessage: 'Something went wrong',
|
|
16
16
|
description: 'The text for when an error occurs when loading options'
|
|
17
|
+
},
|
|
18
|
+
showMoreMessage: {
|
|
19
|
+
id: 'linkDataSource.basic-filter.showMoreButton',
|
|
20
|
+
defaultMessage: 'Show more',
|
|
21
|
+
description: 'The text to show more options in dropdown'
|
|
17
22
|
}
|
|
18
23
|
});
|
|
@@ -4,11 +4,11 @@ import { useDebouncedCallback } from 'use-debounce';
|
|
|
4
4
|
import QuestionCircleIcon from '@atlaskit/icon/glyph/question-circle';
|
|
5
5
|
import { N500 } from '@atlaskit/theme/colors';
|
|
6
6
|
import { useDatasourceAnalyticsEvents } from '../../../../../analytics';
|
|
7
|
-
import { SEARCH_DEBOUNCE_MS } from '
|
|
7
|
+
import { SEARCH_DEBOUNCE_MS } from '../../../../jira-issues-modal/basic-filters/ui/async-popup-select';
|
|
8
8
|
import { asyncPopupSelectMessages } from './messages';
|
|
9
9
|
import CustomSelectMessage from './selectMessage';
|
|
10
10
|
var CustomNoOptionsMessage = function CustomNoOptionsMessage(_ref) {
|
|
11
|
-
var
|
|
11
|
+
var filterName = _ref.filterName;
|
|
12
12
|
var _useDatasourceAnalyti = useDatasourceAnalyticsEvents(),
|
|
13
13
|
fireEvent = _useDatasourceAnalyti.fireEvent;
|
|
14
14
|
|
|
@@ -20,7 +20,7 @@ var CustomNoOptionsMessage = function CustomNoOptionsMessage(_ref) {
|
|
|
20
20
|
*/
|
|
21
21
|
var _useDebouncedCallback = useDebouncedCallback(function () {
|
|
22
22
|
fireEvent('ui.emptyResult.shown.basicSearchDropdown', {
|
|
23
|
-
|
|
23
|
+
filterName: filterName
|
|
24
24
|
});
|
|
25
25
|
}, SEARCH_DEBOUNCE_MS),
|
|
26
26
|
_useDebouncedCallback2 = _slicedToArray(_useDebouncedCallback, 1),
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React, { useCallback } from 'react';
|
|
2
|
+
import { useIntl } from 'react-intl-next';
|
|
3
|
+
import Button from '@atlaskit/button';
|
|
4
|
+
import { useDatasourceAnalyticsEvents } from '../../../../../analytics';
|
|
5
|
+
import { asyncPopupSelectMessages } from './messages';
|
|
6
|
+
var ShowMoreButton = function ShowMoreButton(_ref) {
|
|
7
|
+
var onShowMore = _ref.onShowMore,
|
|
8
|
+
filterName = _ref.filterName;
|
|
9
|
+
var _useIntl = useIntl(),
|
|
10
|
+
formatMessage = _useIntl.formatMessage;
|
|
11
|
+
var _useDatasourceAnalyti = useDatasourceAnalyticsEvents(),
|
|
12
|
+
fireEvent = _useDatasourceAnalyti.fireEvent;
|
|
13
|
+
var handleShowMore = useCallback(function () {
|
|
14
|
+
fireEvent('ui.button.clicked.basicSearchDropdown', {
|
|
15
|
+
filterName: filterName,
|
|
16
|
+
type: 'showMore'
|
|
17
|
+
});
|
|
18
|
+
onShowMore();
|
|
19
|
+
}, [filterName, fireEvent, onShowMore]);
|
|
20
|
+
return /*#__PURE__*/React.createElement(Button, {
|
|
21
|
+
onClick: handleShowMore,
|
|
22
|
+
appearance: "link",
|
|
23
|
+
testId: "jlol-basic-filter-popup-select--show-more-button"
|
|
24
|
+
}, formatMessage(asyncPopupSelectMessages.showMoreMessage));
|
|
25
|
+
};
|
|
26
|
+
export default ShowMoreButton;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { defineMessages } from 'react-intl-next';
|
|
2
|
+
export var asyncPopupSelectMessages = defineMessages({
|
|
3
|
+
selectPlaceholder: {
|
|
4
|
+
id: 'linkDataSource.basic-filter.dropdown.select.placeholder',
|
|
5
|
+
description: 'Placeholder text to be displayed for the search input box.',
|
|
6
|
+
defaultMessage: 'Search'
|
|
7
|
+
},
|
|
8
|
+
paginationDetails: {
|
|
9
|
+
id: 'linkDataSource.basic-filter.footer.pagination-details',
|
|
10
|
+
description: 'Text to indicate page count and total count information.',
|
|
11
|
+
defaultMessage: '{currentDisplayCount} of {totalCount}'
|
|
12
|
+
}
|
|
13
|
+
});
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
2
|
import React, { forwardRef, useCallback } from 'react';
|
|
3
3
|
import styled from '@emotion/styled';
|
|
4
|
-
import { FormattedMessage } from 'react-intl-next';
|
|
5
4
|
import Badge from '@atlaskit/badge';
|
|
6
5
|
import Button from '@atlaskit/button/standard-button';
|
|
7
6
|
import ChevronDownIcon from '@atlaskit/icon/glyph/chevron-down';
|
|
8
7
|
import { Box, Flex, xcss } from '@atlaskit/primitives';
|
|
9
8
|
import Spinner from '@atlaskit/spinner';
|
|
10
|
-
import { asyncPopupSelectMessages } from './messages';
|
|
11
9
|
var triggerButtonLabelStyles = xcss({
|
|
12
10
|
textOverflow: 'ellipsis',
|
|
13
11
|
overflow: 'hidden',
|
|
@@ -32,25 +30,26 @@ export var LoadingStateAnimationWrapper = styled.div({
|
|
|
32
30
|
}
|
|
33
31
|
});
|
|
34
32
|
var PopupTrigger = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
35
|
-
var
|
|
36
|
-
isSelected = _ref.isSelected,
|
|
33
|
+
var isSelected = _ref.isSelected,
|
|
37
34
|
isDisabled = _ref.isDisabled,
|
|
38
35
|
isLoading = _ref.isLoading,
|
|
39
|
-
selectedOptions = _ref.selectedOptions
|
|
36
|
+
selectedOptions = _ref.selectedOptions,
|
|
37
|
+
testId = _ref.testId,
|
|
38
|
+
label = _ref.label;
|
|
40
39
|
var _ref2 = selectedOptions || [],
|
|
41
40
|
_ref3 = _slicedToArray(_ref2, 1),
|
|
42
41
|
firstOption = _ref3[0];
|
|
43
42
|
var hasOptions = selectedOptions && selectedOptions.length > 0;
|
|
44
43
|
var showButtonLoading = !isDisabled && isLoading;
|
|
45
|
-
var
|
|
44
|
+
var tiggerButtonTestId = "".concat(testId, "-trigger");
|
|
46
45
|
var LoadingButton = useCallback(function () {
|
|
47
46
|
return /*#__PURE__*/React.createElement(LoadingStateAnimationWrapper, null, /*#__PURE__*/React.createElement(Button, {
|
|
48
47
|
iconAfter: /*#__PURE__*/React.createElement(Spinner, {
|
|
49
48
|
size: 'xsmall'
|
|
50
49
|
}),
|
|
51
|
-
testId: "".concat(
|
|
52
|
-
},
|
|
53
|
-
}, [
|
|
50
|
+
testId: "".concat(tiggerButtonTestId, "--loading-button")
|
|
51
|
+
}, label));
|
|
52
|
+
}, [label, tiggerButtonTestId]);
|
|
54
53
|
var DefaultButton = useCallback(function () {
|
|
55
54
|
return /*#__PURE__*/React.createElement(Button, {
|
|
56
55
|
appearance: "default",
|
|
@@ -59,16 +58,16 @@ var PopupTrigger = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
59
58
|
iconAfter: /*#__PURE__*/React.createElement(ChevronDownIcon, {
|
|
60
59
|
label: ""
|
|
61
60
|
}),
|
|
62
|
-
testId: "".concat(
|
|
61
|
+
testId: "".concat(tiggerButtonTestId, "--button")
|
|
63
62
|
}, /*#__PURE__*/React.createElement(Flex, null, /*#__PURE__*/React.createElement(Box, {
|
|
64
63
|
xcss: triggerButtonLabelStyles
|
|
65
|
-
},
|
|
64
|
+
}, label, firstOption && /*#__PURE__*/React.createElement(React.Fragment, null, ": ", firstOption.label)), selectedOptions && selectedOptions.length > 1 && /*#__PURE__*/React.createElement(Flex, {
|
|
66
65
|
xcss: badgeStyles,
|
|
67
66
|
alignItems: "center"
|
|
68
67
|
}, /*#__PURE__*/React.createElement(Badge, {
|
|
69
68
|
appearance: "primary"
|
|
70
69
|
}, "+", selectedOptions.length - 1))));
|
|
71
|
-
}, [
|
|
70
|
+
}, [firstOption, hasOptions, isDisabled, isSelected, label, selectedOptions, tiggerButtonTestId]);
|
|
72
71
|
|
|
73
72
|
/**
|
|
74
73
|
* We had an issue with the popup component referencing a stale DOM ref for the trigger button.
|
|
@@ -76,7 +75,7 @@ var PopupTrigger = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
76
75
|
*/
|
|
77
76
|
return /*#__PURE__*/React.createElement(Box, {
|
|
78
77
|
ref: ref,
|
|
79
|
-
testId:
|
|
78
|
+
testId: tiggerButtonTestId
|
|
80
79
|
}, showButtonLoading ? /*#__PURE__*/React.createElement(LoadingButton, null) : /*#__PURE__*/React.createElement(DefaultButton, null));
|
|
81
80
|
});
|
|
82
81
|
export default PopupTrigger;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import _objectDestructuringEmpty from "@babel/runtime/helpers/objectDestructuringEmpty";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { Flex, xcss } from '@atlaskit/primitives';
|
|
4
|
+
var basicFilterContainerStyles = xcss({
|
|
5
|
+
paddingLeft: 'space.100'
|
|
6
|
+
});
|
|
7
|
+
var BasicFilterContainer = function BasicFilterContainer(_ref) {
|
|
8
|
+
_objectDestructuringEmpty(_ref);
|
|
9
|
+
return /*#__PURE__*/React.createElement(Flex, {
|
|
10
|
+
xcss: basicFilterContainerStyles,
|
|
11
|
+
gap: "space.100",
|
|
12
|
+
testId: "clol-basic-filter-container"
|
|
13
|
+
}, /*#__PURE__*/React.createElement(React.Fragment, null), /*#__PURE__*/React.createElement(React.Fragment, null));
|
|
14
|
+
};
|
|
15
|
+
export default BasicFilterContainer;
|
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
-
import React, { useCallback, useEffect, useRef, useState } from 'react';
|
|
2
|
+
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
3
|
+
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
4
|
+
import { Flex, xcss } from '@atlaskit/primitives';
|
|
3
5
|
import { BasicSearchInput } from '../../common/modal/basic-search-input';
|
|
6
|
+
import BasicFilters from '../basic-filters';
|
|
4
7
|
import { searchMessages } from './messages';
|
|
8
|
+
var basicSearchInputContainerStyles = xcss({
|
|
9
|
+
flexGrow: 1
|
|
10
|
+
});
|
|
5
11
|
var ConfluenceSearchContainer = function ConfluenceSearchContainer(_ref) {
|
|
6
12
|
var cloudId = _ref.cloudId,
|
|
7
13
|
initialSearchValue = _ref.initialSearchValue,
|
|
@@ -25,14 +31,23 @@ var ConfluenceSearchContainer = function ConfluenceSearchContainer(_ref) {
|
|
|
25
31
|
currentCloudId.current = cloudId;
|
|
26
32
|
}
|
|
27
33
|
}, [cloudId]);
|
|
28
|
-
|
|
34
|
+
var showBasicFilters = useMemo(function () {
|
|
35
|
+
if (getBooleanFF('platform.linking-platform.datasource.show-clol-basic-filters')) {
|
|
36
|
+
return true;
|
|
37
|
+
}
|
|
38
|
+
return false;
|
|
39
|
+
}, []);
|
|
40
|
+
return /*#__PURE__*/React.createElement(Flex, {
|
|
41
|
+
alignItems: "center",
|
|
42
|
+
xcss: basicSearchInputContainerStyles
|
|
43
|
+
}, /*#__PURE__*/React.createElement(BasicSearchInput, {
|
|
29
44
|
testId: "confluence-search-datasource-modal",
|
|
30
45
|
isSearching: isSearching,
|
|
31
46
|
onChange: handleSearchChange,
|
|
32
47
|
onSearch: onSearch,
|
|
33
48
|
searchTerm: searchBarSearchString,
|
|
34
49
|
placeholder: searchMessages.searchLabel,
|
|
35
|
-
fullWidth:
|
|
36
|
-
});
|
|
50
|
+
fullWidth: !showBasicFilters
|
|
51
|
+
}), showBasicFilters && /*#__PURE__*/React.createElement(BasicFilters, null));
|
|
37
52
|
};
|
|
38
53
|
export default ConfluenceSearchContainer;
|
|
@@ -1,28 +1,13 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
-
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
4
1
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
5
2
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
6
|
-
var _excluded = ["isOpen"];
|
|
7
3
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
8
4
|
import React, { useCallback, useEffect, useRef, useState } from 'react';
|
|
9
5
|
import isEqual from 'lodash/isEqual';
|
|
10
6
|
import { useIntl } from 'react-intl-next';
|
|
11
7
|
import { useDebouncedCallback } from 'use-debounce';
|
|
12
|
-
import {
|
|
13
|
-
import { useDatasourceAnalyticsEvents } from '../../../../../analytics';
|
|
8
|
+
import { FilterPopupSelect } from '../../../../common/modal/popup-select';
|
|
14
9
|
import { useFilterOptions } from '../../hooks/useFilterOptions';
|
|
15
|
-
import CustomMenuList from '../menu-list';
|
|
16
|
-
import CustomControl from './control';
|
|
17
|
-
import CustomDropdownIndicator from './dropdownIndicator';
|
|
18
|
-
import PopupFooter from './footer';
|
|
19
|
-
import formatOptionLabel from './formatOptionLabel';
|
|
20
10
|
import { asyncPopupSelectMessages } from './messages';
|
|
21
|
-
import PopupTrigger from './trigger';
|
|
22
|
-
// Needed to disable filtering from react-select
|
|
23
|
-
var noFilterOptions = function noFilterOptions() {
|
|
24
|
-
return true;
|
|
25
|
-
};
|
|
26
11
|
export var SEARCH_DEBOUNCE_MS = 350;
|
|
27
12
|
var AsyncPopupSelect = function AsyncPopupSelect(_ref) {
|
|
28
13
|
var filterType = _ref.filterType,
|
|
@@ -35,8 +20,6 @@ var AsyncPopupSelect = function AsyncPopupSelect(_ref) {
|
|
|
35
20
|
isDisabled = _ref$isDisabled === void 0 ? false : _ref$isDisabled;
|
|
36
21
|
var _useIntl = useIntl(),
|
|
37
22
|
formatMessage = _useIntl.formatMessage;
|
|
38
|
-
var _useDatasourceAnalyti = useDatasourceAnalyticsEvents(),
|
|
39
|
-
fireEvent = _useDatasourceAnalyti.fireEvent;
|
|
40
23
|
var _useState = useState(''),
|
|
41
24
|
_useState2 = _slicedToArray(_useState, 2),
|
|
42
25
|
searchTerm = _useState2[0],
|
|
@@ -45,15 +28,9 @@ var AsyncPopupSelect = function AsyncPopupSelect(_ref) {
|
|
|
45
28
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
46
29
|
selectedOptions = _useState4[0],
|
|
47
30
|
setSelectedOptions = _useState4[1];
|
|
48
|
-
var _useState5 = useState([]),
|
|
49
|
-
_useState6 = _slicedToArray(_useState5, 2),
|
|
50
|
-
sortedOptions = _useState6[0],
|
|
51
|
-
setSortedOptions = _useState6[1];
|
|
52
31
|
var _ref2 = site || {},
|
|
53
32
|
cloudId = _ref2.cloudId;
|
|
54
33
|
var currentSiteCloudId = useRef(cloudId || '');
|
|
55
|
-
var sortPaginatedResults = useRef(false); // this is to track pagination for sorting purpose
|
|
56
|
-
|
|
57
34
|
var _useFilterOptions = useFilterOptions({
|
|
58
35
|
filterType: filterType,
|
|
59
36
|
site: site
|
|
@@ -73,123 +50,44 @@ var AsyncPopupSelect = function AsyncPopupSelect(_ref) {
|
|
|
73
50
|
_useDebouncedCallback2 = _slicedToArray(_useDebouncedCallback, 1),
|
|
74
51
|
handleDebouncedFetchFilterOptions = _useDebouncedCallback2[0];
|
|
75
52
|
var handleInputChange = useCallback( /*#__PURE__*/function () {
|
|
76
|
-
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(newSearchTerm
|
|
53
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(newSearchTerm) {
|
|
77
54
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
78
55
|
while (1) switch (_context.prev = _context.next) {
|
|
79
56
|
case 0:
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
}
|
|
84
|
-
case 1:
|
|
57
|
+
setSearchTerm(newSearchTerm);
|
|
58
|
+
handleDebouncedFetchFilterOptions(newSearchTerm);
|
|
59
|
+
case 2:
|
|
85
60
|
case "end":
|
|
86
61
|
return _context.stop();
|
|
87
62
|
}
|
|
88
63
|
}, _callee);
|
|
89
64
|
}));
|
|
90
|
-
return function (_x
|
|
65
|
+
return function (_x) {
|
|
91
66
|
return _ref3.apply(this, arguments);
|
|
92
67
|
};
|
|
93
|
-
}(), [handleDebouncedFetchFilterOptions
|
|
68
|
+
}(), [handleDebouncedFetchFilterOptions]);
|
|
94
69
|
var handleOptionSelection = useCallback(function (newValue) {
|
|
95
70
|
onSelectionChange(filterType, newValue);
|
|
96
71
|
}, [filterType, onSelectionChange]);
|
|
97
|
-
var sortOptionsOnPopupOpen = useCallback(function () {
|
|
98
|
-
if (selectedOptions.length === 0) {
|
|
99
|
-
return setSortedOptions(filterOptions);
|
|
100
|
-
}
|
|
101
|
-
var nonSelectedOptions = filterOptions.filter(function (option) {
|
|
102
|
-
return !selectedOptions.find(function (selectedOption) {
|
|
103
|
-
return selectedOption.value === option.value;
|
|
104
|
-
});
|
|
105
|
-
});
|
|
106
|
-
var newOptions = [].concat(_toConsumableArray(selectedOptions), _toConsumableArray(nonSelectedOptions));
|
|
107
|
-
if (!isEqual(newOptions, sortedOptions)) {
|
|
108
|
-
setSortedOptions(newOptions);
|
|
109
|
-
}
|
|
110
|
-
}, [selectedOptions, filterOptions, sortedOptions]);
|
|
111
|
-
var sortOptionsOnResolve = useCallback(function () {
|
|
112
|
-
// when the user is searching, we want the search result to be displayed as it is, and the select component will take care of marking the selected items
|
|
113
|
-
if (searchTerm) {
|
|
114
|
-
sortPaginatedResults.current = false; // set to false to indicate pagination resolve action is completed from the sorting perspective
|
|
115
|
-
return setSortedOptions(filterOptions);
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
// sortedOptions is empty initially, this will take care of setting the initial value and bring the selected items to the top
|
|
119
|
-
if (sortedOptions.length === 0) {
|
|
120
|
-
return sortOptionsOnPopupOpen();
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
// this block handles the pagination, where on pagination, we will just append newOptions to the current list
|
|
124
|
-
if (sortPaginatedResults.current) {
|
|
125
|
-
var newOptions = filterOptions.filter(function (option) {
|
|
126
|
-
return !sortedOptions.find(function (sortedOption) {
|
|
127
|
-
return sortedOption.value === option.value;
|
|
128
|
-
});
|
|
129
|
-
});
|
|
130
|
-
if (newOptions.length > 0) {
|
|
131
|
-
setSortedOptions([].concat(_toConsumableArray(sortedOptions), _toConsumableArray(newOptions)));
|
|
132
|
-
}
|
|
133
|
-
sortPaginatedResults.current = false; // set to false to indicate pagination resolve action is completed from the sorting perspective
|
|
134
|
-
return;
|
|
135
|
-
}
|
|
136
|
-
sortPaginatedResults.current = false; // set to false to indicate pagination resolve action is completed from the sorting perspective
|
|
137
|
-
sortOptionsOnPopupOpen();
|
|
138
|
-
}, [filterOptions, searchTerm, sortOptionsOnPopupOpen, sortedOptions]);
|
|
139
72
|
var handleShowMore = useCallback(function () {
|
|
140
73
|
if (pageCursor) {
|
|
141
|
-
sortPaginatedResults.current = true;
|
|
142
74
|
fetchFilterOptions({
|
|
143
75
|
pageCursor: pageCursor,
|
|
144
76
|
searchString: searchTerm
|
|
145
77
|
});
|
|
146
|
-
fireEvent('ui.button.clicked.basicSearchDropdown', {
|
|
147
|
-
filterType: filterType,
|
|
148
|
-
type: 'showMore'
|
|
149
|
-
});
|
|
150
78
|
}
|
|
151
|
-
}, [fetchFilterOptions,
|
|
79
|
+
}, [fetchFilterOptions, pageCursor, searchTerm]);
|
|
152
80
|
var handleMenuOpen = useCallback(function () {
|
|
153
81
|
if (status === 'empty' || status === 'rejected') {
|
|
154
82
|
// if user searches and gets status as rejected, we want the dropdown to try load the request with searchString when the user reopens the dropdown
|
|
155
83
|
fetchFilterOptions({
|
|
156
84
|
searchString: searchTerm
|
|
157
85
|
});
|
|
158
|
-
} else if (status === 'resolved') {
|
|
159
|
-
sortOptionsOnPopupOpen();
|
|
160
86
|
}
|
|
161
|
-
|
|
162
|
-
filterType: filterType,
|
|
163
|
-
selectionCount: selectedOptions.length
|
|
164
|
-
});
|
|
165
|
-
}, [fetchFilterOptions, filterType, fireEvent, searchTerm, selectedOptions.length, sortOptionsOnPopupOpen, status]);
|
|
166
|
-
var handleMenuClose = useCallback(function () {
|
|
167
|
-
/**
|
|
168
|
-
* Clearing the search is to ensure that the sortOptionsOnPopupOpen logic does not mess up.
|
|
169
|
-
* Without this, when the user opens, sortOptionsOnPopupOpen will inject the selected options to the list and the list count and values will be off
|
|
170
|
-
*/
|
|
171
|
-
if (searchTerm) {
|
|
172
|
-
handleInputChange('', {
|
|
173
|
-
action: 'input-change',
|
|
174
|
-
prevInputValue: searchTerm
|
|
175
|
-
});
|
|
176
|
-
}
|
|
177
|
-
fireEvent('ui.dropdown.closed.basicSearchDropdown', {
|
|
178
|
-
filterType: filterType,
|
|
179
|
-
selectionCount: selectedOptions.length
|
|
180
|
-
});
|
|
181
|
-
}, [filterType, fireEvent, handleInputChange, searchTerm, selectedOptions.length]);
|
|
182
|
-
useEffect(function () {
|
|
183
|
-
if (status === 'resolved') {
|
|
184
|
-
sortOptionsOnResolve();
|
|
185
|
-
}
|
|
186
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
187
|
-
}, [status]); // we only want the sortOptionsOnResolve to run when there is a status change
|
|
188
|
-
|
|
87
|
+
}, [fetchFilterOptions, searchTerm, status]);
|
|
189
88
|
useEffect(function () {
|
|
190
89
|
if (cloudId && currentSiteCloudId.current !== cloudId) {
|
|
191
90
|
currentSiteCloudId.current = cloudId;
|
|
192
|
-
setSortedOptions([]);
|
|
193
91
|
setSearchTerm('');
|
|
194
92
|
resetHook();
|
|
195
93
|
}
|
|
@@ -204,29 +102,27 @@ var AsyncPopupSelect = function AsyncPopupSelect(_ref) {
|
|
|
204
102
|
var isLoading = status === 'loading' || status === 'empty';
|
|
205
103
|
var isLoadingMore = status === 'loadingMore';
|
|
206
104
|
var isEmpty = status === 'resolved' && filterOptionsLength === 0;
|
|
207
|
-
var popupSelectOptions = isLoading || isError ? [] :
|
|
105
|
+
var popupSelectOptions = isLoading || isError ? [] : filterOptions; // if not set to [], then on loading, no loading UI will be shown
|
|
208
106
|
var areAllResultsLoaded = filterOptionsLength === totalCount;
|
|
209
107
|
var shouldShowFooter = (status === 'resolved' || isLoadingMore) && filterOptionsLength > 0; // footer should not disappear when there is an inline spinner for loading more data
|
|
210
108
|
var shouldDisplayShowMoreButton = status === 'resolved' && !!pageCursor && !areAllResultsLoaded;
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
isLoading: isLoading,
|
|
227
|
-
placeholder: formatMessage(asyncPopupSelectMessages.selectPlaceholder),
|
|
109
|
+
var triggerButtonLabel = formatMessage(asyncPopupSelectMessages["".concat(filterType, "Label")]);
|
|
110
|
+
return /*#__PURE__*/React.createElement(FilterPopupSelect, {
|
|
111
|
+
filterName: "jlol-basic-filter-".concat(filterType),
|
|
112
|
+
status: status,
|
|
113
|
+
showLoading: isLoading,
|
|
114
|
+
showHydrating: isJQLHydrating,
|
|
115
|
+
isDisabled: isDisabled,
|
|
116
|
+
totalCount: totalCount,
|
|
117
|
+
shouldShowFooter: shouldShowFooter,
|
|
118
|
+
selectedOptions: selectedOptions,
|
|
119
|
+
options: popupSelectOptions,
|
|
120
|
+
buttonLabel: triggerButtonLabel,
|
|
121
|
+
onInputChange: handleInputChange,
|
|
122
|
+
onSelectionChange: handleOptionSelection,
|
|
123
|
+
onMenuOpen: handleMenuOpen,
|
|
228
124
|
menuListProps: {
|
|
229
|
-
|
|
125
|
+
filterName: filterType,
|
|
230
126
|
isError: isError,
|
|
231
127
|
isEmpty: isEmpty,
|
|
232
128
|
isLoading: isLoading,
|
|
@@ -234,39 +130,7 @@ var AsyncPopupSelect = function AsyncPopupSelect(_ref) {
|
|
|
234
130
|
handleShowMore: handleShowMore,
|
|
235
131
|
errors: errors,
|
|
236
132
|
showMore: shouldDisplayShowMoreButton
|
|
237
|
-
}
|
|
238
|
-
components: {
|
|
239
|
-
Option: CheckboxOption,
|
|
240
|
-
Control: CustomControl,
|
|
241
|
-
MenuList: CustomMenuList,
|
|
242
|
-
DropdownIndicator: CustomDropdownIndicator,
|
|
243
|
-
LoadingIndicator: undefined,
|
|
244
|
-
// disables the three ... indicator in the searchbox when picker is loading
|
|
245
|
-
IndicatorSeparator: undefined // disables the | separator between search input and icon
|
|
246
|
-
},
|
|
247
|
-
options: popupSelectOptions,
|
|
248
|
-
value: selectedOptions,
|
|
249
|
-
filterOption: noFilterOptions,
|
|
250
|
-
formatOptionLabel: formatOptionLabel,
|
|
251
|
-
onChange: handleOptionSelection,
|
|
252
|
-
onInputChange: handleInputChange,
|
|
253
|
-
onOpen: handleMenuOpen,
|
|
254
|
-
onClose: handleMenuClose,
|
|
255
|
-
target: function target(_ref4) {
|
|
256
|
-
var isOpen = _ref4.isOpen,
|
|
257
|
-
triggerProps = _objectWithoutProperties(_ref4, _excluded);
|
|
258
|
-
return /*#__PURE__*/React.createElement(PopupTrigger, _extends({}, triggerProps, {
|
|
259
|
-
filterType: filterType,
|
|
260
|
-
selectedOptions: selectedOptions,
|
|
261
|
-
isSelected: isOpen,
|
|
262
|
-
isDisabled: isDisabled,
|
|
263
|
-
isLoading: isJQLHydrating
|
|
264
|
-
}));
|
|
265
|
-
},
|
|
266
|
-
footer: shouldShowFooter && /*#__PURE__*/React.createElement(PopupFooter, {
|
|
267
|
-
currentDisplayCount: popupSelectOptions.length,
|
|
268
|
-
totalCount: totalCount
|
|
269
|
-
})
|
|
133
|
+
}
|
|
270
134
|
});
|
|
271
135
|
};
|
|
272
136
|
export default AsyncPopupSelect;
|
|
@@ -1,15 +1,5 @@
|
|
|
1
1
|
import { defineMessages } from 'react-intl-next';
|
|
2
2
|
export var asyncPopupSelectMessages = defineMessages({
|
|
3
|
-
selectPlaceholder: {
|
|
4
|
-
id: 'linkDataSource.basic-filter.dropdown.select.placeholder',
|
|
5
|
-
description: 'Placeholder text to be displayed for the search input box.',
|
|
6
|
-
defaultMessage: 'Search'
|
|
7
|
-
},
|
|
8
|
-
paginationDetails: {
|
|
9
|
-
id: 'linkDataSource.basic-filter.footer.pagination-details',
|
|
10
|
-
description: 'Text to indicate page count and total count information.',
|
|
11
|
-
defaultMessage: '{currentDisplayCount} of {totalCount}'
|
|
12
|
-
},
|
|
13
3
|
projectLabel: {
|
|
14
4
|
id: 'linkDataSource.basic-filter.project.label',
|
|
15
5
|
description: 'Label to be displayed for project filter dropdown button.',
|
|
@@ -29,10 +19,5 @@ export var asyncPopupSelectMessages = defineMessages({
|
|
|
29
19
|
id: 'linkDataSource.basic-filter.assignee.label',
|
|
30
20
|
description: 'Label to be displayed for assignee filter dropdown button.',
|
|
31
21
|
defaultMessage: 'Assignee'
|
|
32
|
-
},
|
|
33
|
-
showMoreMessage: {
|
|
34
|
-
id: 'linkDataSource.basic-filter.showMoreButton',
|
|
35
|
-
defaultMessage: 'Show more',
|
|
36
|
-
description: 'The text to show more options in dropdown'
|
|
37
22
|
}
|
|
38
23
|
});
|
|
@@ -218,7 +218,8 @@ export var JiraSearchContainer = function JiraSearchContainer(props) {
|
|
|
218
218
|
onSearch: handleSearch,
|
|
219
219
|
searchTerm: basicSearchTerm,
|
|
220
220
|
placeholder: basicSearchInputMessages.basicTextSearchLabel,
|
|
221
|
-
testId: "jira-datasource-modal"
|
|
221
|
+
testId: "jira-datasource-modal",
|
|
222
|
+
fullWidth: !showBasicFilters
|
|
222
223
|
}), showBasicFilters && jsx(BasicFilters, {
|
|
223
224
|
jql: searchBarJql,
|
|
224
225
|
site: site,
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Generates Typescript types for analytics events from analytics.spec.yaml
|
|
5
5
|
*
|
|
6
|
-
* @codegen <<SignedSource::
|
|
6
|
+
* @codegen <<SignedSource::6518dea178189cd102e0ca6ce7eae059>>
|
|
7
7
|
* @codegenCommand yarn workspace @atlassian/analytics-tooling run analytics:codegen link-datasource
|
|
8
8
|
*/
|
|
9
9
|
export type ComponentMetaDataType = {
|
|
@@ -103,22 +103,22 @@ export type LinkViewedCountAttributesType = {
|
|
|
103
103
|
extensionKey: string | null;
|
|
104
104
|
};
|
|
105
105
|
export type EmptyResultShownBasicSearchDropdownAttributesType = {
|
|
106
|
-
|
|
106
|
+
filterName: string;
|
|
107
107
|
};
|
|
108
108
|
export type ErrorShownBasicSearchDropdownAttributesType = {
|
|
109
|
-
|
|
109
|
+
filterName: string;
|
|
110
110
|
reason: 'agg' | 'network' | 'unknown';
|
|
111
111
|
};
|
|
112
112
|
export type DropdownOpenedBasicSearchDropdownAttributesType = {
|
|
113
|
-
|
|
113
|
+
filterName: string;
|
|
114
114
|
selectionCount: number;
|
|
115
115
|
};
|
|
116
116
|
export type DropdownClosedBasicSearchDropdownAttributesType = {
|
|
117
|
-
|
|
117
|
+
filterName: string;
|
|
118
118
|
selectionCount: number;
|
|
119
119
|
};
|
|
120
120
|
export type ButtonClickedBasicSearchDropdownAttributesType = {
|
|
121
|
-
|
|
121
|
+
filterName: string;
|
|
122
122
|
type: 'showMore';
|
|
123
123
|
};
|
|
124
124
|
export type AqlEditorSearchedAttributesType = {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { ControlProps } from '@atlaskit/select';
|
|
3
|
-
import { SelectOption } from '
|
|
3
|
+
import { SelectOption } from './types';
|
|
4
4
|
export declare const CustomControl: ({ children, ...innerProps }: ControlProps<SelectOption, true>) => JSX.Element;
|
|
5
5
|
export default CustomControl;
|