@atlaskit/link-datasource 1.27.2 → 1.27.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.
- package/CHANGELOG.md +14 -0
- package/dist/cjs/ui/assets-modal/search-container/styled.js +21 -7
- package/dist/cjs/ui/common/modal/popup-select/constants.js +8 -0
- package/dist/cjs/ui/common/modal/popup-select/footer.js +3 -2
- package/dist/cjs/ui/common/modal/popup-select/formatOptionLabel.js +4 -5
- package/dist/cjs/ui/common/modal/popup-select/index.js +2 -1
- package/dist/cjs/ui/common/modal/popup-select/menu-list/errorMessage.js +3 -3
- package/dist/cjs/ui/common/modal/popup-select/menu-list/index.js +4 -2
- package/dist/cjs/ui/common/modal/popup-select/menu-list/loadingMessage.js +3 -2
- package/dist/cjs/ui/common/modal/popup-select/menu-list/noOptionsMessage.js +3 -3
- package/dist/cjs/ui/common/modal/popup-select/menu-list/showMoreButton.js +1 -1
- package/dist/cjs/ui/confluence-search-modal/modal/index.js +14 -5
- package/dist/cjs/ui/issue-like-table/empty-state/type.js +5 -3
- package/dist/cjs/ui/issue-like-table/render-type/icon/index.js +5 -3
- package/dist/cjs/ui/jira-issues-modal/basic-filters/ui/async-popup-select/index.js +6 -5
- package/dist/cjs/ui/jira-issues-modal/jira-search-container/index.js +3 -3
- package/dist/es2019/ui/assets-modal/search-container/styled.js +20 -20
- package/dist/es2019/ui/common/modal/popup-select/constants.js +2 -0
- package/dist/es2019/ui/common/modal/popup-select/footer.js +3 -2
- package/dist/es2019/ui/common/modal/popup-select/formatOptionLabel.js +4 -5
- package/dist/es2019/ui/common/modal/popup-select/index.js +2 -1
- package/dist/es2019/ui/common/modal/popup-select/menu-list/errorMessage.js +2 -2
- package/dist/es2019/ui/common/modal/popup-select/menu-list/index.js +4 -2
- package/dist/es2019/ui/common/modal/popup-select/menu-list/loadingMessage.js +4 -2
- package/dist/es2019/ui/common/modal/popup-select/menu-list/noOptionsMessage.js +2 -2
- package/dist/es2019/ui/common/modal/popup-select/menu-list/showMoreButton.js +1 -1
- package/dist/es2019/ui/confluence-search-modal/modal/index.js +16 -5
- package/dist/es2019/ui/issue-like-table/empty-state/type.js +5 -5
- package/dist/es2019/ui/issue-like-table/render-type/icon/index.js +5 -5
- package/dist/es2019/ui/jira-issues-modal/basic-filters/ui/async-popup-select/index.js +4 -3
- package/dist/es2019/ui/jira-issues-modal/jira-search-container/index.js +1 -1
- package/dist/esm/ui/assets-modal/search-container/styled.js +21 -7
- package/dist/esm/ui/common/modal/popup-select/constants.js +2 -0
- package/dist/esm/ui/common/modal/popup-select/footer.js +3 -2
- package/dist/esm/ui/common/modal/popup-select/formatOptionLabel.js +4 -5
- package/dist/esm/ui/common/modal/popup-select/index.js +2 -1
- package/dist/esm/ui/common/modal/popup-select/menu-list/errorMessage.js +2 -2
- package/dist/esm/ui/common/modal/popup-select/menu-list/index.js +4 -2
- package/dist/esm/ui/common/modal/popup-select/menu-list/loadingMessage.js +3 -2
- package/dist/esm/ui/common/modal/popup-select/menu-list/noOptionsMessage.js +2 -2
- package/dist/esm/ui/common/modal/popup-select/menu-list/showMoreButton.js +1 -1
- package/dist/esm/ui/confluence-search-modal/modal/index.js +14 -5
- package/dist/esm/ui/issue-like-table/empty-state/type.js +5 -3
- package/dist/esm/ui/issue-like-table/render-type/icon/index.js +5 -3
- package/dist/esm/ui/jira-issues-modal/basic-filters/ui/async-popup-select/index.js +4 -3
- package/dist/esm/ui/jira-issues-modal/jira-search-container/index.js +1 -1
- package/dist/types/ui/common/modal/popup-select/constants.d.ts +2 -0
- package/dist/types/ui/common/modal/popup-select/footer.d.ts +2 -1
- package/dist/types/ui/common/modal/popup-select/index.d.ts +5 -4
- package/dist/types/ui/common/modal/popup-select/menu-list/index.d.ts +1 -1
- package/dist/types/ui/common/modal/popup-select/menu-list/loadingMessage.d.ts +3 -1
- package/dist/types/ui/confluence-search-modal/types.d.ts +2 -0
- package/dist/types/ui/jira-issues-modal/basic-filters/hooks/useFilterOptions.d.ts +2 -1
- package/dist/types/ui/jira-issues-modal/basic-filters/types.d.ts +1 -20
- package/dist/types/ui/jira-issues-modal/basic-filters/ui/async-popup-select/index.d.ts +2 -2
- package/dist/types/ui/jira-issues-modal/basic-filters/ui/index.d.ts +2 -1
- package/dist/types/ui/jira-issues-modal/basic-filters/utils/transformers.d.ts +2 -1
- package/dist/types/ui/jira-issues-modal/jira-search-container/index.d.ts +0 -1
- package/dist/types-ts4.5/ui/common/modal/popup-select/constants.d.ts +2 -0
- package/dist/types-ts4.5/ui/common/modal/popup-select/footer.d.ts +2 -1
- package/dist/types-ts4.5/ui/common/modal/popup-select/index.d.ts +5 -4
- package/dist/types-ts4.5/ui/common/modal/popup-select/menu-list/index.d.ts +1 -1
- package/dist/types-ts4.5/ui/common/modal/popup-select/menu-list/loadingMessage.d.ts +3 -1
- package/dist/types-ts4.5/ui/confluence-search-modal/types.d.ts +2 -0
- package/dist/types-ts4.5/ui/jira-issues-modal/basic-filters/hooks/useFilterOptions.d.ts +2 -1
- package/dist/types-ts4.5/ui/jira-issues-modal/basic-filters/types.d.ts +1 -20
- package/dist/types-ts4.5/ui/jira-issues-modal/basic-filters/ui/async-popup-select/index.d.ts +2 -2
- package/dist/types-ts4.5/ui/jira-issues-modal/basic-filters/ui/index.d.ts +2 -1
- package/dist/types-ts4.5/ui/jira-issues-modal/basic-filters/utils/transformers.d.ts +2 -1
- package/dist/types-ts4.5/ui/jira-issues-modal/jira-search-container/index.d.ts +0 -1
- package/package.json +7 -7
|
@@ -69,7 +69,9 @@ export const PlainConfluenceSearchConfigModal = props => {
|
|
|
69
69
|
viewMode = 'table',
|
|
70
70
|
parameters: initialParameters,
|
|
71
71
|
url: urlBeingEdited,
|
|
72
|
-
visibleColumnKeys: initialVisibleColumnKeys
|
|
72
|
+
visibleColumnKeys: initialVisibleColumnKeys,
|
|
73
|
+
disableDisplayDropdown = false,
|
|
74
|
+
overrideParameters
|
|
73
75
|
} = props;
|
|
74
76
|
const [availableSites, setAvailableSites] = useState(undefined);
|
|
75
77
|
const [currentViewMode, setCurrentViewMode] = useState(viewMode);
|
|
@@ -90,6 +92,15 @@ export const PlainConfluenceSearchConfigModal = props => {
|
|
|
90
92
|
searchString
|
|
91
93
|
}), [cloudId, initialParameters, searchString /** Add more parameters when more filters are added */]);
|
|
92
94
|
const isParametersSet = useMemo(() => !!cloudId && Object.values(parameters !== null && parameters !== void 0 ? parameters : {}).filter(v => v !== undefined).length > 1, [cloudId, parameters]);
|
|
95
|
+
const parametersToSend = useMemo(() => {
|
|
96
|
+
if (!isParametersSet) {
|
|
97
|
+
return undefined;
|
|
98
|
+
}
|
|
99
|
+
return {
|
|
100
|
+
...parameters,
|
|
101
|
+
...(overrideParameters !== null && overrideParameters !== void 0 ? overrideParameters : {})
|
|
102
|
+
};
|
|
103
|
+
}, [parameters, overrideParameters, isParametersSet]);
|
|
93
104
|
const {
|
|
94
105
|
reset,
|
|
95
106
|
status,
|
|
@@ -104,7 +115,7 @@ export const PlainConfluenceSearchConfigModal = props => {
|
|
|
104
115
|
destinationObjectTypes
|
|
105
116
|
} = useDatasourceTableState({
|
|
106
117
|
datasourceId,
|
|
107
|
-
parameters:
|
|
118
|
+
parameters: parametersToSend,
|
|
108
119
|
fieldKeys: visibleColumnKeys
|
|
109
120
|
});
|
|
110
121
|
const {
|
|
@@ -321,7 +332,7 @@ export const PlainConfluenceSearchConfigModal = props => {
|
|
|
321
332
|
onInsert(buildDatasourceAdf({
|
|
322
333
|
id: datasourceId,
|
|
323
334
|
parameters: {
|
|
324
|
-
...
|
|
335
|
+
...parametersToSend,
|
|
325
336
|
cloudId
|
|
326
337
|
},
|
|
327
338
|
views: [{
|
|
@@ -344,7 +355,7 @@ export const PlainConfluenceSearchConfigModal = props => {
|
|
|
344
355
|
}]
|
|
345
356
|
}, confluenceSearchUrl), consumerEvent);
|
|
346
357
|
}
|
|
347
|
-
}, [isParametersSet, cloudId, analyticsPayload, totalCount, currentViewMode, onInsert, confluenceSearchUrl, datasourceId,
|
|
358
|
+
}, [isParametersSet, cloudId, analyticsPayload, totalCount, currentViewMode, onInsert, confluenceSearchUrl, datasourceId, parametersToSend, visibleColumnKeys, columnCustomSizes, wrappedColumnKeys]);
|
|
348
359
|
const handleViewModeChange = selectedMode => {
|
|
349
360
|
userInteractionActions.current.add(DatasourceAction.DISPLAY_VIEW_CHANGED);
|
|
350
361
|
setCurrentViewMode(selectedMode);
|
|
@@ -380,7 +391,7 @@ export const PlainConfluenceSearchConfigModal = props => {
|
|
|
380
391
|
selectedSite: selectedConfluenceSite,
|
|
381
392
|
testId: "confluence-search-datasource-modal--site-selector",
|
|
382
393
|
label: siteSelectorLabel
|
|
383
|
-
})), !hasNoConfluenceSites && jsx(DisplayViewDropDown, {
|
|
394
|
+
})), !hasNoConfluenceSites && !disableDisplayDropdown && jsx(DisplayViewDropDown, {
|
|
384
395
|
onViewModeChange: handleViewModeChange,
|
|
385
396
|
viewMode: currentViewMode
|
|
386
397
|
})), jsx(ModalBody, null, !hasNoConfluenceSites ? jsx(Fragment, null, jsx(Box, {
|
|
@@ -6,11 +6,11 @@ import Epic16Icon from '@atlaskit/icon-object/glyph/epic/16';
|
|
|
6
6
|
import Issue16Icon from '@atlaskit/icon-object/glyph/issue/16';
|
|
7
7
|
import Story16Icon from '@atlaskit/icon-object/glyph/story/16';
|
|
8
8
|
import Task16Icon from '@atlaskit/icon-object/glyph/task/16';
|
|
9
|
-
const IconWrapper = styled.div
|
|
10
|
-
display: flex
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
const IconWrapper = styled.div({
|
|
10
|
+
display: 'flex',
|
|
11
|
+
alignItems: 'center',
|
|
12
|
+
justifyContent: 'left'
|
|
13
|
+
});
|
|
14
14
|
export default (({
|
|
15
15
|
type
|
|
16
16
|
}) => {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import styled from '@emotion/styled';
|
|
3
3
|
import Image from '@atlaskit/image';
|
|
4
|
-
const IconWrapper = styled.div
|
|
5
|
-
display: flex
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
const IconWrapper = styled.div({
|
|
5
|
+
display: 'flex',
|
|
6
|
+
alignItems: 'center',
|
|
7
|
+
justifyContent: 'left'
|
|
8
|
+
});
|
|
9
9
|
export const ICON_TYPE_TEST_ID = 'link-datasource-render-type--icon';
|
|
10
10
|
const IconRenderType = ({
|
|
11
11
|
label,
|
|
@@ -3,9 +3,9 @@ import isEqual from 'lodash/isEqual';
|
|
|
3
3
|
import { useIntl } from 'react-intl-next';
|
|
4
4
|
import { useDebouncedCallback } from 'use-debounce';
|
|
5
5
|
import { FilterPopupSelect } from '../../../../common/modal/popup-select';
|
|
6
|
+
import { SEARCH_DEBOUNCE_MS } from '../../../../common/modal/popup-select/constants';
|
|
6
7
|
import { useFilterOptions } from '../../hooks/useFilterOptions';
|
|
7
8
|
import { asyncPopupSelectMessages } from './messages';
|
|
8
|
-
export const SEARCH_DEBOUNCE_MS = 350;
|
|
9
9
|
const AsyncPopupSelect = ({
|
|
10
10
|
filterType,
|
|
11
11
|
site,
|
|
@@ -82,11 +82,12 @@ const AsyncPopupSelect = ({
|
|
|
82
82
|
const isEmpty = status === 'resolved' && filterOptionsLength === 0;
|
|
83
83
|
const popupSelectOptions = isLoading || isError ? [] : filterOptions; // if not set to [], then on loading, no loading UI will be shown
|
|
84
84
|
const areAllResultsLoaded = filterOptionsLength === totalCount;
|
|
85
|
+
const filterName = `jlol-basic-filter-${filterType}`;
|
|
85
86
|
const shouldShowFooter = (status === 'resolved' || isLoadingMore) && filterOptionsLength > 0; // footer should not disappear when there is an inline spinner for loading more data
|
|
86
87
|
const shouldDisplayShowMoreButton = status === 'resolved' && !!pageCursor && !areAllResultsLoaded;
|
|
87
88
|
const triggerButtonLabel = formatMessage(asyncPopupSelectMessages[`${filterType}Label`]);
|
|
88
89
|
return /*#__PURE__*/React.createElement(FilterPopupSelect, {
|
|
89
|
-
filterName:
|
|
90
|
+
filterName: filterName,
|
|
90
91
|
status: status,
|
|
91
92
|
showLoading: isLoading,
|
|
92
93
|
showHydrating: isJQLHydrating,
|
|
@@ -100,7 +101,7 @@ const AsyncPopupSelect = ({
|
|
|
100
101
|
onSelectionChange: handleOptionSelection,
|
|
101
102
|
onMenuOpen: handleMenuOpen,
|
|
102
103
|
menuListProps: {
|
|
103
|
-
filterName
|
|
104
|
+
filterName,
|
|
104
105
|
isError,
|
|
105
106
|
isEmpty,
|
|
106
107
|
isLoading,
|
|
@@ -8,6 +8,7 @@ import { Flex, xcss } from '@atlaskit/primitives';
|
|
|
8
8
|
import { useDatasourceAnalyticsEvents } from '../../../analytics';
|
|
9
9
|
import { BasicSearchInput } from '../../common/modal/basic-search-input';
|
|
10
10
|
import { basicSearchInputMessages } from '../../common/modal/basic-search-input/messages';
|
|
11
|
+
import { FILTER_SELECTION_DEBOUNCE_MS } from '../../common/modal/popup-select/constants';
|
|
11
12
|
import { BasicFilters } from '../basic-filters';
|
|
12
13
|
import { useHydrateJqlQuery } from '../basic-filters/hooks/useHydrateJqlQuery';
|
|
13
14
|
import { isQueryTooComplex } from '../basic-filters/utils/isQueryTooComplex';
|
|
@@ -25,7 +26,6 @@ const basicSearchInputContainerStyles = xcss({
|
|
|
25
26
|
});
|
|
26
27
|
export const DEFAULT_JQL_QUERY = 'ORDER BY created DESC';
|
|
27
28
|
export const ALLOWED_ORDER_BY_KEYS = ['key', 'summary', 'assignee', 'status', 'created'];
|
|
28
|
-
export const FILTER_SELECTION_DEBOUNCE_MS = 500;
|
|
29
29
|
export const JiraSearchContainer = props => {
|
|
30
30
|
const {
|
|
31
31
|
isSearching,
|
|
@@ -1,11 +1,25 @@
|
|
|
1
|
-
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4;
|
|
3
1
|
import styled from '@emotion/styled';
|
|
4
|
-
export var FormRowContainer = styled.div(
|
|
5
|
-
return
|
|
2
|
+
export var FormRowContainer = styled.div(function (props) {
|
|
3
|
+
return {
|
|
4
|
+
alignItems: 'center',
|
|
5
|
+
display: 'flex',
|
|
6
|
+
gap: props.isNarrowGap ? "var(--ds-space-100, 8px)" : "var(--ds-space-200, 16px)",
|
|
7
|
+
flexGrow: 1,
|
|
8
|
+
width: '100%'
|
|
9
|
+
};
|
|
10
|
+
});
|
|
11
|
+
export var FormContainer = styled.form({
|
|
12
|
+
display: 'grid',
|
|
13
|
+
rowGap: "var(--ds-space-200, 16px)",
|
|
14
|
+
width: '100%'
|
|
6
15
|
});
|
|
7
|
-
export var FormContainer = styled.form(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n display: grid;\n row-gap: ", ";\n width: 100%;\n"])), "var(--ds-space-200, 16px)");
|
|
8
16
|
|
|
9
17
|
// Override the top margin of fields
|
|
10
|
-
export var FieldContainer = styled.div(
|
|
11
|
-
|
|
18
|
+
export var FieldContainer = styled.div({
|
|
19
|
+
flex: 1,
|
|
20
|
+
marginTop: "var(--ds-space-negative-100, -8px)"
|
|
21
|
+
});
|
|
22
|
+
export var SchemaSelectContainer = styled.div({
|
|
23
|
+
width: '100%',
|
|
24
|
+
maxWidth: '386px'
|
|
25
|
+
});
|
|
@@ -16,9 +16,10 @@ var footerPaginationInfoStyles = xcss({
|
|
|
16
16
|
});
|
|
17
17
|
var PopupFooter = function PopupFooter(_ref) {
|
|
18
18
|
var currentDisplayCount = _ref.currentDisplayCount,
|
|
19
|
-
totalCount = _ref.totalCount
|
|
19
|
+
totalCount = _ref.totalCount,
|
|
20
|
+
filterName = _ref.filterName;
|
|
20
21
|
return /*#__PURE__*/React.createElement(Flex, {
|
|
21
|
-
testId: "
|
|
22
|
+
testId: "".concat(filterName, "--footer"),
|
|
22
23
|
direction: "row",
|
|
23
24
|
alignItems: "center",
|
|
24
25
|
justifyContent: "end",
|
|
@@ -29,14 +29,14 @@ var IconOptionLabel = function IconOptionLabel(_ref) {
|
|
|
29
29
|
};
|
|
30
30
|
return /*#__PURE__*/React.createElement(AvatarOptionLabel, {
|
|
31
31
|
data: avatarOptionLabelData,
|
|
32
|
-
testId: "
|
|
32
|
+
testId: "basic-filter-popup-select-option--icon-label"
|
|
33
33
|
});
|
|
34
34
|
};
|
|
35
35
|
var LozengeOptionLabel = function LozengeOptionLabel(_ref2) {
|
|
36
36
|
var data = _ref2.data;
|
|
37
37
|
return /*#__PURE__*/React.createElement(Lozenge, {
|
|
38
38
|
appearance: data.appearance,
|
|
39
|
-
testId: "
|
|
39
|
+
testId: "basic-filter-popup-select-option--lozenge"
|
|
40
40
|
}, /*#__PURE__*/React.createElement(Box, {
|
|
41
41
|
xcss: [commonLabelStyles]
|
|
42
42
|
}, data.label));
|
|
@@ -46,7 +46,7 @@ var AvatarOptionLabel = function AvatarOptionLabel(_ref3) {
|
|
|
46
46
|
testId = _ref3.testId;
|
|
47
47
|
return /*#__PURE__*/React.createElement(Flex, {
|
|
48
48
|
alignItems: "center",
|
|
49
|
-
testId: testId || '
|
|
49
|
+
testId: testId || 'basic-filter-popup-select-option--avatar'
|
|
50
50
|
}, data.isGroup ? /*#__PURE__*/React.createElement(Flex, {
|
|
51
51
|
alignItems: "center",
|
|
52
52
|
justifyContent: "center",
|
|
@@ -59,8 +59,7 @@ var AvatarOptionLabel = function AvatarOptionLabel(_ref3) {
|
|
|
59
59
|
src: data.avatar,
|
|
60
60
|
size: "xsmall"
|
|
61
61
|
}), /*#__PURE__*/React.createElement(Box, {
|
|
62
|
-
xcss: [commonLabelStyles, avatarOptionLabelStyles]
|
|
63
|
-
testId: "nidhin"
|
|
62
|
+
xcss: [commonLabelStyles, avatarOptionLabelStyles]
|
|
64
63
|
}, data.label));
|
|
65
64
|
};
|
|
66
65
|
var formatOptionLabel = function formatOptionLabel(data) {
|
|
@@ -205,7 +205,8 @@ export var FilterPopupSelect = function FilterPopupSelect(_ref) {
|
|
|
205
205
|
},
|
|
206
206
|
footer: shouldShowFooter && /*#__PURE__*/React.createElement(PopupFooter, {
|
|
207
207
|
currentDisplayCount: options.length,
|
|
208
|
-
totalCount: totalCount
|
|
208
|
+
totalCount: totalCount,
|
|
209
|
+
filterName: filterName
|
|
209
210
|
})
|
|
210
211
|
});
|
|
211
212
|
};
|
|
@@ -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 '../constants';
|
|
8
8
|
import { asyncPopupSelectMessages } from './messages';
|
|
9
9
|
import CustomSelectMessage from './selectMessage';
|
|
10
10
|
var getErrorReasonType = function getErrorReasonType(errors) {
|
|
@@ -45,7 +45,7 @@ var CustomErrorMessage = function CustomErrorMessage(_ref3) {
|
|
|
45
45
|
size: "xlarge"
|
|
46
46
|
}),
|
|
47
47
|
message: asyncPopupSelectMessages.errorMessage,
|
|
48
|
-
testId: "
|
|
48
|
+
testId: "".concat(filterName, "--error-message")
|
|
49
49
|
});
|
|
50
50
|
};
|
|
51
51
|
export default CustomErrorMessage;
|
|
@@ -39,7 +39,9 @@ var CustomMenuList = function CustomMenuList(_ref) {
|
|
|
39
39
|
};
|
|
40
40
|
var renderChildren = function renderChildren() {
|
|
41
41
|
if (isLoading) {
|
|
42
|
-
return /*#__PURE__*/React.createElement(CustomDropdownLoadingMessage,
|
|
42
|
+
return /*#__PURE__*/React.createElement(CustomDropdownLoadingMessage, {
|
|
43
|
+
filterName: filterName
|
|
44
|
+
});
|
|
43
45
|
}
|
|
44
46
|
if (isError) {
|
|
45
47
|
return /*#__PURE__*/React.createElement(CustomErrorMessage, {
|
|
@@ -52,7 +54,7 @@ var CustomMenuList = function CustomMenuList(_ref) {
|
|
|
52
54
|
filterName: filterName
|
|
53
55
|
});
|
|
54
56
|
}
|
|
55
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, children, shouldDisplayShowMore && /*#__PURE__*/React.createElement(Box, {
|
|
57
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, children, shouldDisplayShowMore && handleShowMore && /*#__PURE__*/React.createElement(Box, {
|
|
56
58
|
xcss: showMoreButtonBoxStyles
|
|
57
59
|
}, /*#__PURE__*/React.createElement(ShowMoreButton, {
|
|
58
60
|
onShowMore: handleShowMore,
|
|
@@ -2,13 +2,14 @@ import React from 'react';
|
|
|
2
2
|
import Spinner from '@atlaskit/spinner';
|
|
3
3
|
import { asyncPopupSelectMessages } from './messages';
|
|
4
4
|
import CustomSelectMessage from './selectMessage';
|
|
5
|
-
var CustomDropdownLoadingMessage = function CustomDropdownLoadingMessage() {
|
|
5
|
+
var CustomDropdownLoadingMessage = function CustomDropdownLoadingMessage(_ref) {
|
|
6
|
+
var filterName = _ref.filterName;
|
|
6
7
|
return /*#__PURE__*/React.createElement(CustomSelectMessage, {
|
|
7
8
|
icon: /*#__PURE__*/React.createElement(Spinner, {
|
|
8
9
|
size: "large"
|
|
9
10
|
}),
|
|
10
11
|
message: asyncPopupSelectMessages.loadingMessage,
|
|
11
|
-
testId: "
|
|
12
|
+
testId: "".concat(filterName, "--loading-message")
|
|
12
13
|
});
|
|
13
14
|
};
|
|
14
15
|
export default CustomDropdownLoadingMessage;
|
|
@@ -4,7 +4,7 @@ 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 '../constants';
|
|
8
8
|
import { asyncPopupSelectMessages } from './messages';
|
|
9
9
|
import CustomSelectMessage from './selectMessage';
|
|
10
10
|
var CustomNoOptionsMessage = function CustomNoOptionsMessage(_ref) {
|
|
@@ -33,7 +33,7 @@ var CustomNoOptionsMessage = function CustomNoOptionsMessage(_ref) {
|
|
|
33
33
|
label: ""
|
|
34
34
|
}),
|
|
35
35
|
message: asyncPopupSelectMessages.noOptionsMessage,
|
|
36
|
-
testId: "
|
|
36
|
+
testId: "".concat(filterName, "--no-options-message")
|
|
37
37
|
});
|
|
38
38
|
};
|
|
39
39
|
export default CustomNoOptionsMessage;
|
|
@@ -20,7 +20,7 @@ var ShowMoreButton = function ShowMoreButton(_ref) {
|
|
|
20
20
|
return /*#__PURE__*/React.createElement(Button, {
|
|
21
21
|
onClick: handleShowMore,
|
|
22
22
|
appearance: "link",
|
|
23
|
-
testId: "
|
|
23
|
+
testId: "".concat(filterName, "--show-more-button")
|
|
24
24
|
}, formatMessage(asyncPopupSelectMessages.showMoreMessage));
|
|
25
25
|
};
|
|
26
26
|
export default ShowMoreButton;
|
|
@@ -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],
|
|
@@ -115,9 +118,15 @@ export var PlainConfluenceSearchConfigModal = function PlainConfluenceSearchConf
|
|
|
115
118
|
return v !== undefined;
|
|
116
119
|
}).length > 1;
|
|
117
120
|
}, [cloudId, parameters]);
|
|
121
|
+
var parametersToSend = useMemo(function () {
|
|
122
|
+
if (!isParametersSet) {
|
|
123
|
+
return undefined;
|
|
124
|
+
}
|
|
125
|
+
return _objectSpread(_objectSpread({}, parameters), overrideParameters !== null && overrideParameters !== void 0 ? overrideParameters : {});
|
|
126
|
+
}, [parameters, overrideParameters, isParametersSet]);
|
|
118
127
|
var _useDatasourceTableSt = useDatasourceTableState({
|
|
119
128
|
datasourceId: datasourceId,
|
|
120
|
-
parameters:
|
|
129
|
+
parameters: parametersToSend,
|
|
121
130
|
fieldKeys: visibleColumnKeys
|
|
122
131
|
}),
|
|
123
132
|
reset = _useDatasourceTableSt.reset,
|
|
@@ -372,7 +381,7 @@ export var PlainConfluenceSearchConfigModal = function PlainConfluenceSearchConf
|
|
|
372
381
|
} else {
|
|
373
382
|
onInsert(buildDatasourceAdf({
|
|
374
383
|
id: datasourceId,
|
|
375
|
-
parameters: _objectSpread(_objectSpread({},
|
|
384
|
+
parameters: _objectSpread(_objectSpread({}, parametersToSend), {}, {
|
|
376
385
|
cloudId: cloudId
|
|
377
386
|
}),
|
|
378
387
|
views: [{
|
|
@@ -393,7 +402,7 @@ export var PlainConfluenceSearchConfigModal = function PlainConfluenceSearchConf
|
|
|
393
402
|
}]
|
|
394
403
|
}, confluenceSearchUrl), consumerEvent);
|
|
395
404
|
}
|
|
396
|
-
}, [isParametersSet, cloudId, analyticsPayload, totalCount, currentViewMode, onInsert, confluenceSearchUrl, datasourceId,
|
|
405
|
+
}, [isParametersSet, cloudId, analyticsPayload, totalCount, currentViewMode, onInsert, confluenceSearchUrl, datasourceId, parametersToSend, visibleColumnKeys, columnCustomSizes, wrappedColumnKeys]);
|
|
397
406
|
var handleViewModeChange = function handleViewModeChange(selectedMode) {
|
|
398
407
|
userInteractionActions.current.add(DatasourceAction.DISPLAY_VIEW_CHANGED);
|
|
399
408
|
setCurrentViewMode(selectedMode);
|
|
@@ -429,7 +438,7 @@ export var PlainConfluenceSearchConfigModal = function PlainConfluenceSearchConf
|
|
|
429
438
|
selectedSite: selectedConfluenceSite,
|
|
430
439
|
testId: "confluence-search-datasource-modal--site-selector",
|
|
431
440
|
label: siteSelectorLabel
|
|
432
|
-
})), !hasNoConfluenceSites && jsx(DisplayViewDropDown, {
|
|
441
|
+
})), !hasNoConfluenceSites && !disableDisplayDropdown && jsx(DisplayViewDropDown, {
|
|
433
442
|
onViewModeChange: handleViewModeChange,
|
|
434
443
|
viewMode: currentViewMode
|
|
435
444
|
})), jsx(ModalBody, null, !hasNoConfluenceSites ? jsx(Fragment, null, jsx(Box, {
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
|
-
var _templateObject;
|
|
3
1
|
import React from 'react';
|
|
4
2
|
import styled from '@emotion/styled';
|
|
5
3
|
import Bug16Icon from '@atlaskit/icon-object/glyph/bug/16';
|
|
@@ -8,7 +6,11 @@ import Epic16Icon from '@atlaskit/icon-object/glyph/epic/16';
|
|
|
8
6
|
import Issue16Icon from '@atlaskit/icon-object/glyph/issue/16';
|
|
9
7
|
import Story16Icon from '@atlaskit/icon-object/glyph/story/16';
|
|
10
8
|
import Task16Icon from '@atlaskit/icon-object/glyph/task/16';
|
|
11
|
-
var IconWrapper = styled.div(
|
|
9
|
+
var IconWrapper = styled.div({
|
|
10
|
+
display: 'flex',
|
|
11
|
+
alignItems: 'center',
|
|
12
|
+
justifyContent: 'left'
|
|
13
|
+
});
|
|
12
14
|
export default (function (_ref) {
|
|
13
15
|
var type = _ref.type;
|
|
14
16
|
var TypeIcon = function TypeIcon() {
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
|
-
var _templateObject;
|
|
3
1
|
import React from 'react';
|
|
4
2
|
import styled from '@emotion/styled';
|
|
5
3
|
import Image from '@atlaskit/image';
|
|
6
|
-
var IconWrapper = styled.div(
|
|
4
|
+
var IconWrapper = styled.div({
|
|
5
|
+
display: 'flex',
|
|
6
|
+
alignItems: 'center',
|
|
7
|
+
justifyContent: 'left'
|
|
8
|
+
});
|
|
7
9
|
export var ICON_TYPE_TEST_ID = 'link-datasource-render-type--icon';
|
|
8
10
|
var IconRenderType = function IconRenderType(_ref) {
|
|
9
11
|
var label = _ref.label,
|
|
@@ -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:
|
|
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:
|
|
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,
|
|
@@ -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
|
|
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?: (
|
|
20
|
-
onMenuClose?: (
|
|
21
|
-
}
|
|
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;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { DatasourceAdf, InlineCardAdf } from '@atlaskit/linking-common/types';
|
|
2
2
|
import { ConfigModalProps } from '../../common/types';
|
|
3
3
|
export interface ConfluenceSearchConfigModalProps extends ConfigModalProps<InlineCardAdf | ConfluenceSearchDatasourceAdf, ConfluenceSearchDatasourceParameters> {
|
|
4
|
+
disableDisplayDropdown?: boolean;
|
|
5
|
+
overrideParameters?: Pick<ConfluenceSearchDatasourceParameters, 'entityTypes'>;
|
|
4
6
|
}
|
|
5
7
|
export type ConfluenceSearchDatasourceParameters = {
|
|
6
8
|
cloudId: string;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { IntlShape } from 'react-intl-next';
|
|
2
2
|
import type { Site } from '../../../../common/types';
|
|
3
|
-
import { AvatarLabelOption,
|
|
3
|
+
import { AvatarLabelOption, SelectOption } from '../../../common/modal/popup-select/types';
|
|
4
|
+
import { BasicFilterFieldType } from '../types';
|
|
4
5
|
interface FilterOptionsProps {
|
|
5
6
|
filterType: BasicFilterFieldType;
|
|
6
7
|
site?: Site;
|
|
@@ -1,24 +1,5 @@
|
|
|
1
|
+
import { SelectOption } from '../../common/modal/popup-select/types';
|
|
1
2
|
export type BasicFilterFieldType = 'project' | 'assignee' | 'type' | 'status';
|
|
2
|
-
export interface OptionBase {
|
|
3
|
-
label: string;
|
|
4
|
-
value: string;
|
|
5
|
-
}
|
|
6
|
-
export type IconLabelOption = OptionBase & {
|
|
7
|
-
optionType: 'iconLabel';
|
|
8
|
-
icon: string;
|
|
9
|
-
};
|
|
10
|
-
export type LozengeLabelOption = OptionBase & {
|
|
11
|
-
optionType: 'lozengeLabel';
|
|
12
|
-
appearance?: LozengeAppearance;
|
|
13
|
-
};
|
|
14
|
-
export type LozengeAppearance = 'default' | 'inprogress' | 'moved' | 'new' | 'removed' | 'success';
|
|
15
|
-
export type AvatarLabelOption = OptionBase & {
|
|
16
|
-
optionType: 'avatarLabel';
|
|
17
|
-
avatar?: string;
|
|
18
|
-
isSquare?: boolean;
|
|
19
|
-
isGroup?: boolean;
|
|
20
|
-
};
|
|
21
|
-
export type SelectOption = IconLabelOption | LozengeLabelOption | AvatarLabelOption;
|
|
22
3
|
export type SelectedOptionsMap = {
|
|
23
4
|
[key in BasicFilterFieldType]?: SelectOption[];
|
|
24
5
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { Site } from '../../../../../common/types';
|
|
3
|
-
import {
|
|
3
|
+
import { SelectOption } from '../../../../common/modal/popup-select/types';
|
|
4
|
+
import { BasicFilterFieldType } from '../../types';
|
|
4
5
|
export interface AsyncPopupSelectProps {
|
|
5
6
|
filterType: BasicFilterFieldType;
|
|
6
7
|
selection: SelectOption[];
|
|
@@ -9,6 +10,5 @@ export interface AsyncPopupSelectProps {
|
|
|
9
10
|
isDisabled?: boolean;
|
|
10
11
|
site?: Site;
|
|
11
12
|
}
|
|
12
|
-
export declare const SEARCH_DEBOUNCE_MS = 350;
|
|
13
13
|
declare const AsyncPopupSelect: ({ filterType, site, selection, isJQLHydrating, onSelectionChange, isDisabled, }: AsyncPopupSelectProps) => JSX.Element;
|
|
14
14
|
export default AsyncPopupSelect;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { Site } from '../../../../common/types';
|
|
3
|
-
import
|
|
3
|
+
import { SelectOption } from '../../../common/modal/popup-select/types';
|
|
4
|
+
import type { BasicFilterFieldType, SelectedOptionsMap } from '../types';
|
|
4
5
|
export declare const availableBasicFilterTypes: BasicFilterFieldType[];
|
|
5
6
|
export interface BasicFilterContainerProps {
|
|
6
7
|
jql: string;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { SelectOption } from '../../../common/modal/popup-select/types';
|
|
2
|
+
import { FieldValuesResponse, HydrateResponse, SelectedOptionsMap } from '../types';
|
|
2
3
|
export declare function mapHydrateResponseData({ data }: HydrateResponse): SelectedOptionsMap;
|
|
3
4
|
export declare function mapFieldValuesToFilterOptions({ data, siteUrl, }: FieldValuesResponse & {
|
|
4
5
|
siteUrl?: string;
|
|
@@ -4,7 +4,6 @@ import { SelectedOptionsMap } from '../basic-filters/types';
|
|
|
4
4
|
import { JiraIssueDatasourceParameters, JiraIssueDatasourceParametersQuery } from '../types';
|
|
5
5
|
export declare const DEFAULT_JQL_QUERY = "ORDER BY created DESC";
|
|
6
6
|
export declare const ALLOWED_ORDER_BY_KEYS: string[];
|
|
7
|
-
export declare const FILTER_SELECTION_DEBOUNCE_MS = 500;
|
|
8
7
|
export interface SearchContainerProps {
|
|
9
8
|
isSearching?: boolean;
|
|
10
9
|
onSearch: (query: JiraIssueDatasourceParametersQuery, { searchMethod, basicFilterSelections, }: {
|