@atlaskit/link-datasource 1.19.9 → 1.19.10
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 +7 -0
- package/dist/cjs/analytics/constants.js +1 -1
- package/dist/cjs/ui/jira-issues-modal/basic-filters/ui/async-popup-select/index.js +1 -4
- package/dist/cjs/ui/jira-issues-modal/basic-filters/ui/index.js +1 -3
- package/dist/cjs/ui/jira-issues-modal/jira-search-container/index.js +27 -18
- package/dist/cjs/ui/jira-issues-modal/modal/index.js +4 -1
- package/dist/es2019/analytics/constants.js +1 -1
- package/dist/es2019/ui/jira-issues-modal/basic-filters/ui/async-popup-select/index.js +1 -3
- package/dist/es2019/ui/jira-issues-modal/basic-filters/ui/index.js +1 -3
- package/dist/es2019/ui/jira-issues-modal/jira-search-container/index.js +12 -6
- package/dist/es2019/ui/jira-issues-modal/modal/index.js +4 -1
- package/dist/esm/analytics/constants.js +1 -1
- package/dist/esm/ui/jira-issues-modal/basic-filters/ui/async-popup-select/index.js +1 -4
- package/dist/esm/ui/jira-issues-modal/basic-filters/ui/index.js +1 -3
- package/dist/esm/ui/jira-issues-modal/jira-search-container/index.js +26 -17
- package/dist/esm/ui/jira-issues-modal/modal/index.js +4 -1
- package/dist/types/ui/jira-issues-modal/basic-filters/ui/async-popup-select/index.d.ts +1 -2
- package/dist/types/ui/jira-issues-modal/basic-filters/ui/index.d.ts +1 -2
- package/dist/types/ui/jira-issues-modal/jira-search-container/index.d.ts +1 -0
- package/dist/types-ts4.5/ui/jira-issues-modal/basic-filters/ui/async-popup-select/index.d.ts +1 -2
- package/dist/types-ts4.5/ui/jira-issues-modal/basic-filters/ui/index.d.ts +1 -2
- package/dist/types-ts4.5/ui/jira-issues-modal/jira-search-container/index.d.ts +1 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# @atlaskit/link-datasource
|
|
2
2
|
|
|
3
|
+
## 1.19.10
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#56769](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/56769) [`dccc142da2de`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/dccc142da2de) - Changing cloud ids with site selector resets previous JiraIssuesModal table results, basic search filters, and jql to default.
|
|
8
|
+
- [#57035](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/57035) [`63ab16a4d4a7`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/63ab16a4d4a7) - Update config modal logic to open in basic mode if the query is not complex.
|
|
9
|
+
|
|
3
10
|
## 1.19.9
|
|
4
11
|
|
|
5
12
|
### Patch Changes
|
|
@@ -7,5 +7,5 @@ exports.packageMetaData = exports.EVENT_CHANNEL = void 0;
|
|
|
7
7
|
var EVENT_CHANNEL = exports.EVENT_CHANNEL = 'media';
|
|
8
8
|
var packageMetaData = exports.packageMetaData = {
|
|
9
9
|
packageName: "@atlaskit/link-datasource",
|
|
10
|
-
packageVersion: "1.19.
|
|
10
|
+
packageVersion: "1.19.10"
|
|
11
11
|
};
|
|
@@ -41,8 +41,6 @@ var AsyncPopupSelect = function AsyncPopupSelect(_ref) {
|
|
|
41
41
|
isJQLHydrating = _ref.isJQLHydrating,
|
|
42
42
|
_ref$onSelectionChang = _ref.onSelectionChange,
|
|
43
43
|
onSelectionChange = _ref$onSelectionChang === void 0 ? function () {} : _ref$onSelectionChang,
|
|
44
|
-
_ref$onReset = _ref.onReset,
|
|
45
|
-
resetSelection = _ref$onReset === void 0 ? function () {} : _ref$onReset,
|
|
46
44
|
_ref$isDisabled = _ref.isDisabled,
|
|
47
45
|
isDisabled = _ref$isDisabled === void 0 ? false : _ref$isDisabled;
|
|
48
46
|
var _useIntl = (0, _reactIntlNext.useIntl)(),
|
|
@@ -192,9 +190,8 @@ var AsyncPopupSelect = function AsyncPopupSelect(_ref) {
|
|
|
192
190
|
setSortedOptions([]);
|
|
193
191
|
setSearchTerm('');
|
|
194
192
|
resetHook();
|
|
195
|
-
resetSelection();
|
|
196
193
|
}
|
|
197
|
-
}, [cloudId, resetHook
|
|
194
|
+
}, [cloudId, resetHook]);
|
|
198
195
|
(0, _react.useEffect)(function () {
|
|
199
196
|
if (!(0, _isEqual.default)(selection, selectedOptions)) {
|
|
200
197
|
setSelectedOptions(selection);
|
|
@@ -16,7 +16,6 @@ var BasicFilterContainer = function BasicFilterContainer(_ref) {
|
|
|
16
16
|
var cloudId = _ref.cloudId,
|
|
17
17
|
onChange = _ref.onChange,
|
|
18
18
|
selections = _ref.selections,
|
|
19
|
-
onReset = _ref.onReset,
|
|
20
19
|
isJQLHydrating = _ref.isJQLHydrating;
|
|
21
20
|
return /*#__PURE__*/_react.default.createElement(_primitives.Flex, {
|
|
22
21
|
xcss: basicFilterContainerStyles,
|
|
@@ -30,8 +29,7 @@ var BasicFilterContainer = function BasicFilterContainer(_ref) {
|
|
|
30
29
|
selection: selections[filter] || [],
|
|
31
30
|
isJQLHydrating: isJQLHydrating,
|
|
32
31
|
isDisabled: !cloudId,
|
|
33
|
-
onSelectionChange: onChange
|
|
34
|
-
onReset: onReset
|
|
32
|
+
onSelectionChange: onChange
|
|
35
33
|
});
|
|
36
34
|
}));
|
|
37
35
|
};
|
|
@@ -5,7 +5,7 @@ var _typeof = require("@babel/runtime/helpers/typeof");
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.JiraSearchContainer = exports.ALLOWED_ORDER_BY_KEYS = void 0;
|
|
8
|
+
exports.JiraSearchContainer = exports.DEFAULT_JQL_QUERY = exports.ALLOWED_ORDER_BY_KEYS = void 0;
|
|
9
9
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
10
10
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
11
11
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
@@ -39,7 +39,7 @@ var inputContainerStyles = (0, _react2.css)({
|
|
|
39
39
|
var basicSearchInputContainerStyles = (0, _primitives.xcss)({
|
|
40
40
|
flexGrow: 1
|
|
41
41
|
});
|
|
42
|
-
var DEFAULT_JQL_QUERY = 'created >= -30d order by created DESC';
|
|
42
|
+
var DEFAULT_JQL_QUERY = exports.DEFAULT_JQL_QUERY = 'created >= -30d order by created DESC';
|
|
43
43
|
var ALLOWED_ORDER_BY_KEYS = exports.ALLOWED_ORDER_BY_KEYS = ['key', 'summary', 'assignee', 'status', 'created'];
|
|
44
44
|
var JiraSearchMethodSwitcher = _modeSwitcher.ModeSwitcher;
|
|
45
45
|
var JiraSearchContainer = exports.JiraSearchContainer = function JiraSearchContainer(props) {
|
|
@@ -49,7 +49,7 @@ var JiraSearchContainer = exports.JiraSearchContainer = function JiraSearchConta
|
|
|
49
49
|
onSearchMethodChangeCallback = props.onSearchMethodChange,
|
|
50
50
|
initialSearchMethod = props.initialSearchMethod;
|
|
51
51
|
var _ref = parameters || {},
|
|
52
|
-
|
|
52
|
+
currentCloudId = _ref.cloudId,
|
|
53
53
|
initialJql = _ref.jql;
|
|
54
54
|
var _useIntl = (0, _reactIntlNext.useIntl)(),
|
|
55
55
|
formatMessage = _useIntl.formatMessage;
|
|
@@ -67,22 +67,26 @@ var JiraSearchContainer = exports.JiraSearchContainer = function JiraSearchConta
|
|
|
67
67
|
_useState6 = (0, _slicedToArray2.default)(_useState5, 2),
|
|
68
68
|
jql = _useState6[0],
|
|
69
69
|
setJql = _useState6[1];
|
|
70
|
-
var _useState7 = (0, _react.useState)(
|
|
70
|
+
var _useState7 = (0, _react.useState)(currentCloudId),
|
|
71
71
|
_useState8 = (0, _slicedToArray2.default)(_useState7, 2),
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
var _useState9 = (0, _react.useState)(),
|
|
72
|
+
cloudId = _useState8[0],
|
|
73
|
+
setCloudId = _useState8[1];
|
|
74
|
+
var _useState9 = (0, _react.useState)(false),
|
|
75
75
|
_useState10 = (0, _slicedToArray2.default)(_useState9, 2),
|
|
76
|
-
|
|
77
|
-
|
|
76
|
+
isComplexQuery = _useState10[0],
|
|
77
|
+
setIsComplexQuery = _useState10[1];
|
|
78
78
|
var _useState11 = (0, _react.useState)(),
|
|
79
79
|
_useState12 = (0, _slicedToArray2.default)(_useState11, 2),
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
var _useState13 = (0, _react.useState)(
|
|
80
|
+
orderKey = _useState12[0],
|
|
81
|
+
setOrderKey = _useState12[1];
|
|
82
|
+
var _useState13 = (0, _react.useState)(),
|
|
83
83
|
_useState14 = (0, _slicedToArray2.default)(_useState13, 2),
|
|
84
|
-
|
|
85
|
-
|
|
84
|
+
orderDirection = _useState14[0],
|
|
85
|
+
setOrderDirection = _useState14[1];
|
|
86
|
+
var _useState15 = (0, _react.useState)({}),
|
|
87
|
+
_useState16 = (0, _slicedToArray2.default)(_useState15, 2),
|
|
88
|
+
filterSelections = _useState16[0],
|
|
89
|
+
setFilterSelections = _useState16[1];
|
|
86
90
|
var showBasicFilters = (0, _react.useMemo)(function () {
|
|
87
91
|
if ((0, _platformFeatureFlags.getBooleanFF)('platform.linking-platform.datasource.show-jlol-basic-filters')) {
|
|
88
92
|
return true;
|
|
@@ -191,11 +195,17 @@ var JiraSearchContainer = exports.JiraSearchContainer = function JiraSearchConta
|
|
|
191
195
|
setFilterSelections(updatedSelection);
|
|
192
196
|
handleBasicFilterSelectionChange(updatedSelection);
|
|
193
197
|
}, [handleBasicFilterSelectionChange, filterSelections]);
|
|
194
|
-
|
|
195
|
-
if (
|
|
198
|
+
(0, _react.useEffect)(function () {
|
|
199
|
+
if (currentCloudId !== cloudId) {
|
|
200
|
+
setBasicSearchTerm('');
|
|
201
|
+
setJql(DEFAULT_JQL_QUERY);
|
|
202
|
+
setIsComplexQuery(false);
|
|
203
|
+
setOrderKey(undefined);
|
|
204
|
+
setOrderDirection(undefined);
|
|
196
205
|
setFilterSelections({});
|
|
206
|
+
setCloudId(currentCloudId);
|
|
197
207
|
}
|
|
198
|
-
}, [
|
|
208
|
+
}, [currentCloudId, cloudId]);
|
|
199
209
|
return (0, _react2.jsx)("div", {
|
|
200
210
|
css: inputContainerStyles,
|
|
201
211
|
"data-testid": "jira-search-container"
|
|
@@ -211,7 +221,6 @@ var JiraSearchContainer = exports.JiraSearchContainer = function JiraSearchConta
|
|
|
211
221
|
cloudId: cloudId || '',
|
|
212
222
|
onChange: handleSelectionChange,
|
|
213
223
|
selections: filterSelections,
|
|
214
|
-
onReset: handleBasicFiltersReset,
|
|
215
224
|
isJQLHydrating: basicFilterHydrationStatus === 'loading'
|
|
216
225
|
})), currentSearchMethod === 'jql' && (0, _react2.jsx)(_jqlEditor.JiraJQLEditor, {
|
|
217
226
|
cloudId: cloudId || '',
|
|
@@ -19,6 +19,7 @@ var _uuid = require("uuid");
|
|
|
19
19
|
var _analyticsNext = require("@atlaskit/analytics-next");
|
|
20
20
|
var _standardButton = _interopRequireDefault(require("@atlaskit/button/standard-button"));
|
|
21
21
|
var _modalDialog = _interopRequireWildcard(require("@atlaskit/modal-dialog"));
|
|
22
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
22
23
|
var _linkUrl = _interopRequireDefault(require("@atlaskit/smart-card/link-url"));
|
|
23
24
|
var _colors = require("@atlaskit/theme/colors");
|
|
24
25
|
var _analytics = require("../../../analytics");
|
|
@@ -37,6 +38,7 @@ var _noResults = require("../../common/error-state/no-results");
|
|
|
37
38
|
var _issueLikeTable = require("../../issue-like-table");
|
|
38
39
|
var _link = _interopRequireDefault(require("../../issue-like-table/render-type/link"));
|
|
39
40
|
var _ui = require("../basic-filters/ui");
|
|
41
|
+
var _isQueryTooComplex = require("../basic-filters/utils/isQueryTooComplex");
|
|
40
42
|
var _initialStateView = require("../initial-state-view");
|
|
41
43
|
var _jiraSearchContainer = require("../jira-search-container");
|
|
42
44
|
var _modeSwitcher = require("../mode-switcher");
|
|
@@ -138,7 +140,7 @@ var PlainJiraIssuesConfigModal = exports.PlainJiraIssuesConfigModal = function P
|
|
|
138
140
|
// analytics related parameters
|
|
139
141
|
var searchCount = (0, _react.useRef)(0);
|
|
140
142
|
var userInteractionActions = (0, _react.useRef)(new Set());
|
|
141
|
-
var initialSearchMethod = '
|
|
143
|
+
var initialSearchMethod = (0, _platformFeatureFlags.getBooleanFF)('platform.linking-platform.datasource.show-jlol-basic-filters') && !(0, _isQueryTooComplex.isQueryTooComplex)((initialParameters === null || initialParameters === void 0 ? void 0 : initialParameters.jql) || '') ? 'basic' : 'jql';
|
|
142
144
|
var _useState11 = (0, _react.useState)(initialSearchMethod),
|
|
143
145
|
_useState12 = (0, _slicedToArray2.default)(_useState11, 2),
|
|
144
146
|
currentSearchMethod = _useState12[0],
|
|
@@ -340,6 +342,7 @@ var PlainJiraIssuesConfigModal = exports.PlainJiraIssuesConfigModal = function P
|
|
|
340
342
|
}, [analyticsPayload, onCancel]);
|
|
341
343
|
var onSiteSelection = (0, _react.useCallback)(function (site) {
|
|
342
344
|
userInteractionActions.current.add(_types.DatasourceAction.INSTANCE_UPDATED);
|
|
345
|
+
setJql('');
|
|
343
346
|
setCloudId(site.cloudId);
|
|
344
347
|
reset({
|
|
345
348
|
shouldForceRequest: true
|
|
@@ -22,7 +22,6 @@ const AsyncPopupSelect = ({
|
|
|
22
22
|
selection,
|
|
23
23
|
isJQLHydrating,
|
|
24
24
|
onSelectionChange = () => {},
|
|
25
|
-
onReset: resetSelection = () => {},
|
|
26
25
|
isDisabled = false
|
|
27
26
|
}) => {
|
|
28
27
|
const {
|
|
@@ -143,9 +142,8 @@ const AsyncPopupSelect = ({
|
|
|
143
142
|
setSortedOptions([]);
|
|
144
143
|
setSearchTerm('');
|
|
145
144
|
resetHook();
|
|
146
|
-
resetSelection();
|
|
147
145
|
}
|
|
148
|
-
}, [cloudId, resetHook
|
|
146
|
+
}, [cloudId, resetHook]);
|
|
149
147
|
useEffect(() => {
|
|
150
148
|
if (!isEqual(selection, selectedOptions)) {
|
|
151
149
|
setSelectedOptions(selection);
|
|
@@ -9,7 +9,6 @@ const BasicFilterContainer = ({
|
|
|
9
9
|
cloudId,
|
|
10
10
|
onChange,
|
|
11
11
|
selections,
|
|
12
|
-
onReset,
|
|
13
12
|
isJQLHydrating
|
|
14
13
|
}) => {
|
|
15
14
|
return /*#__PURE__*/React.createElement(Flex, {
|
|
@@ -24,8 +23,7 @@ const BasicFilterContainer = ({
|
|
|
24
23
|
selection: selections[filter] || [],
|
|
25
24
|
isJQLHydrating: isJQLHydrating,
|
|
26
25
|
isDisabled: !cloudId,
|
|
27
|
-
onSelectionChange: onChange
|
|
28
|
-
onReset: onReset
|
|
26
|
+
onSelectionChange: onChange
|
|
29
27
|
});
|
|
30
28
|
}));
|
|
31
29
|
};
|
|
@@ -23,7 +23,7 @@ const inputContainerStyles = css({
|
|
|
23
23
|
const basicSearchInputContainerStyles = xcss({
|
|
24
24
|
flexGrow: 1
|
|
25
25
|
});
|
|
26
|
-
const DEFAULT_JQL_QUERY = 'created >= -30d order by created DESC';
|
|
26
|
+
export const DEFAULT_JQL_QUERY = 'created >= -30d order by created DESC';
|
|
27
27
|
export const ALLOWED_ORDER_BY_KEYS = ['key', 'summary', 'assignee', 'status', 'created'];
|
|
28
28
|
const JiraSearchMethodSwitcher = ModeSwitcher;
|
|
29
29
|
export const JiraSearchContainer = props => {
|
|
@@ -35,7 +35,7 @@ export const JiraSearchContainer = props => {
|
|
|
35
35
|
initialSearchMethod
|
|
36
36
|
} = props;
|
|
37
37
|
const {
|
|
38
|
-
cloudId,
|
|
38
|
+
cloudId: currentCloudId,
|
|
39
39
|
jql: initialJql
|
|
40
40
|
} = parameters || {};
|
|
41
41
|
const {
|
|
@@ -47,6 +47,7 @@ export const JiraSearchContainer = props => {
|
|
|
47
47
|
const [basicSearchTerm, setBasicSearchTerm] = useState('');
|
|
48
48
|
const [currentSearchMethod, setCurrentSearchMethod] = useState(initialSearchMethod);
|
|
49
49
|
const [jql, setJql] = useState(initialJql || DEFAULT_JQL_QUERY);
|
|
50
|
+
const [cloudId, setCloudId] = useState(currentCloudId);
|
|
50
51
|
const [isComplexQuery, setIsComplexQuery] = useState(false);
|
|
51
52
|
const [orderKey, setOrderKey] = useState();
|
|
52
53
|
const [orderDirection, setOrderDirection] = useState();
|
|
@@ -161,11 +162,17 @@ export const JiraSearchContainer = props => {
|
|
|
161
162
|
setFilterSelections(updatedSelection);
|
|
162
163
|
handleBasicFilterSelectionChange(updatedSelection);
|
|
163
164
|
}, [handleBasicFilterSelectionChange, filterSelections]);
|
|
164
|
-
|
|
165
|
-
if (
|
|
165
|
+
useEffect(() => {
|
|
166
|
+
if (currentCloudId !== cloudId) {
|
|
167
|
+
setBasicSearchTerm('');
|
|
168
|
+
setJql(DEFAULT_JQL_QUERY);
|
|
169
|
+
setIsComplexQuery(false);
|
|
170
|
+
setOrderKey(undefined);
|
|
171
|
+
setOrderDirection(undefined);
|
|
166
172
|
setFilterSelections({});
|
|
173
|
+
setCloudId(currentCloudId);
|
|
167
174
|
}
|
|
168
|
-
}, [
|
|
175
|
+
}, [currentCloudId, cloudId]);
|
|
169
176
|
return jsx("div", {
|
|
170
177
|
css: inputContainerStyles,
|
|
171
178
|
"data-testid": "jira-search-container"
|
|
@@ -181,7 +188,6 @@ export const JiraSearchContainer = props => {
|
|
|
181
188
|
cloudId: cloudId || '',
|
|
182
189
|
onChange: handleSelectionChange,
|
|
183
190
|
selections: filterSelections,
|
|
184
|
-
onReset: handleBasicFiltersReset,
|
|
185
191
|
isJQLHydrating: basicFilterHydrationStatus === 'loading'
|
|
186
192
|
})), currentSearchMethod === 'jql' && jsx(JiraJQLEditor, {
|
|
187
193
|
cloudId: cloudId || '',
|
|
@@ -7,6 +7,7 @@ import { v4 as uuidv4 } from 'uuid';
|
|
|
7
7
|
import { withAnalyticsContext } from '@atlaskit/analytics-next';
|
|
8
8
|
import Button from '@atlaskit/button/standard-button';
|
|
9
9
|
import Modal, { ModalBody, ModalFooter, ModalHeader, ModalTitle, ModalTransition } from '@atlaskit/modal-dialog';
|
|
10
|
+
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
10
11
|
import LinkUrl from '@atlaskit/smart-card/link-url';
|
|
11
12
|
import { B400, N0, N40, N800 } from '@atlaskit/theme/colors';
|
|
12
13
|
import { EVENT_CHANNEL, useDatasourceAnalyticsEvents } from '../../../analytics';
|
|
@@ -25,6 +26,7 @@ import { NoResults } from '../../common/error-state/no-results';
|
|
|
25
26
|
import { EmptyState, IssueLikeDataTableView, scrollableContainerShadowsCssComponents } from '../../issue-like-table';
|
|
26
27
|
import LinkRenderType from '../../issue-like-table/render-type/link';
|
|
27
28
|
import { availableBasicFilterTypes } from '../basic-filters/ui';
|
|
29
|
+
import { isQueryTooComplex } from '../basic-filters/utils/isQueryTooComplex';
|
|
28
30
|
import { InitialStateView } from '../initial-state-view';
|
|
29
31
|
import { JiraSearchContainer } from '../jira-search-container';
|
|
30
32
|
import { ModeSwitcher } from '../mode-switcher';
|
|
@@ -108,7 +110,7 @@ export const PlainJiraIssuesConfigModal = props => {
|
|
|
108
110
|
// analytics related parameters
|
|
109
111
|
const searchCount = useRef(0);
|
|
110
112
|
const userInteractionActions = useRef(new Set());
|
|
111
|
-
const initialSearchMethod = '
|
|
113
|
+
const initialSearchMethod = getBooleanFF('platform.linking-platform.datasource.show-jlol-basic-filters') && !isQueryTooComplex((initialParameters === null || initialParameters === void 0 ? void 0 : initialParameters.jql) || '') ? 'basic' : 'jql';
|
|
112
114
|
const [currentSearchMethod, setCurrentSearchMethod] = useState(initialSearchMethod);
|
|
113
115
|
const searchMethodSearchedWith = useRef(null);
|
|
114
116
|
const visibleColumnCount = useRef((visibleColumnKeys === null || visibleColumnKeys === void 0 ? void 0 : visibleColumnKeys.length) || 0);
|
|
@@ -290,6 +292,7 @@ export const PlainJiraIssuesConfigModal = props => {
|
|
|
290
292
|
}, [analyticsPayload, onCancel]);
|
|
291
293
|
const onSiteSelection = useCallback(site => {
|
|
292
294
|
userInteractionActions.current.add(DatasourceAction.INSTANCE_UPDATED);
|
|
295
|
+
setJql('');
|
|
293
296
|
setCloudId(site.cloudId);
|
|
294
297
|
reset({
|
|
295
298
|
shouldForceRequest: true
|
|
@@ -31,8 +31,6 @@ var AsyncPopupSelect = function AsyncPopupSelect(_ref) {
|
|
|
31
31
|
isJQLHydrating = _ref.isJQLHydrating,
|
|
32
32
|
_ref$onSelectionChang = _ref.onSelectionChange,
|
|
33
33
|
onSelectionChange = _ref$onSelectionChang === void 0 ? function () {} : _ref$onSelectionChang,
|
|
34
|
-
_ref$onReset = _ref.onReset,
|
|
35
|
-
resetSelection = _ref$onReset === void 0 ? function () {} : _ref$onReset,
|
|
36
34
|
_ref$isDisabled = _ref.isDisabled,
|
|
37
35
|
isDisabled = _ref$isDisabled === void 0 ? false : _ref$isDisabled;
|
|
38
36
|
var _useIntl = useIntl(),
|
|
@@ -182,9 +180,8 @@ var AsyncPopupSelect = function AsyncPopupSelect(_ref) {
|
|
|
182
180
|
setSortedOptions([]);
|
|
183
181
|
setSearchTerm('');
|
|
184
182
|
resetHook();
|
|
185
|
-
resetSelection();
|
|
186
183
|
}
|
|
187
|
-
}, [cloudId, resetHook
|
|
184
|
+
}, [cloudId, resetHook]);
|
|
188
185
|
useEffect(function () {
|
|
189
186
|
if (!isEqual(selection, selectedOptions)) {
|
|
190
187
|
setSelectedOptions(selection);
|
|
@@ -9,7 +9,6 @@ var BasicFilterContainer = function BasicFilterContainer(_ref) {
|
|
|
9
9
|
var cloudId = _ref.cloudId,
|
|
10
10
|
onChange = _ref.onChange,
|
|
11
11
|
selections = _ref.selections,
|
|
12
|
-
onReset = _ref.onReset,
|
|
13
12
|
isJQLHydrating = _ref.isJQLHydrating;
|
|
14
13
|
return /*#__PURE__*/React.createElement(Flex, {
|
|
15
14
|
xcss: basicFilterContainerStyles,
|
|
@@ -23,8 +22,7 @@ var BasicFilterContainer = function BasicFilterContainer(_ref) {
|
|
|
23
22
|
selection: selections[filter] || [],
|
|
24
23
|
isJQLHydrating: isJQLHydrating,
|
|
25
24
|
isDisabled: !cloudId,
|
|
26
|
-
onSelectionChange: onChange
|
|
27
|
-
onReset: onReset
|
|
25
|
+
onSelectionChange: onChange
|
|
28
26
|
});
|
|
29
27
|
}));
|
|
30
28
|
};
|
|
@@ -29,7 +29,7 @@ var inputContainerStyles = css({
|
|
|
29
29
|
var basicSearchInputContainerStyles = xcss({
|
|
30
30
|
flexGrow: 1
|
|
31
31
|
});
|
|
32
|
-
var DEFAULT_JQL_QUERY = 'created >= -30d order by created DESC';
|
|
32
|
+
export var DEFAULT_JQL_QUERY = 'created >= -30d order by created DESC';
|
|
33
33
|
export var ALLOWED_ORDER_BY_KEYS = ['key', 'summary', 'assignee', 'status', 'created'];
|
|
34
34
|
var JiraSearchMethodSwitcher = ModeSwitcher;
|
|
35
35
|
export var JiraSearchContainer = function JiraSearchContainer(props) {
|
|
@@ -39,7 +39,7 @@ export var JiraSearchContainer = function JiraSearchContainer(props) {
|
|
|
39
39
|
onSearchMethodChangeCallback = props.onSearchMethodChange,
|
|
40
40
|
initialSearchMethod = props.initialSearchMethod;
|
|
41
41
|
var _ref = parameters || {},
|
|
42
|
-
|
|
42
|
+
currentCloudId = _ref.cloudId,
|
|
43
43
|
initialJql = _ref.jql;
|
|
44
44
|
var _useIntl = useIntl(),
|
|
45
45
|
formatMessage = _useIntl.formatMessage;
|
|
@@ -57,22 +57,26 @@ export var JiraSearchContainer = function JiraSearchContainer(props) {
|
|
|
57
57
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
58
58
|
jql = _useState6[0],
|
|
59
59
|
setJql = _useState6[1];
|
|
60
|
-
var _useState7 = useState(
|
|
60
|
+
var _useState7 = useState(currentCloudId),
|
|
61
61
|
_useState8 = _slicedToArray(_useState7, 2),
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
var _useState9 = useState(),
|
|
62
|
+
cloudId = _useState8[0],
|
|
63
|
+
setCloudId = _useState8[1];
|
|
64
|
+
var _useState9 = useState(false),
|
|
65
65
|
_useState10 = _slicedToArray(_useState9, 2),
|
|
66
|
-
|
|
67
|
-
|
|
66
|
+
isComplexQuery = _useState10[0],
|
|
67
|
+
setIsComplexQuery = _useState10[1];
|
|
68
68
|
var _useState11 = useState(),
|
|
69
69
|
_useState12 = _slicedToArray(_useState11, 2),
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
var _useState13 = useState(
|
|
70
|
+
orderKey = _useState12[0],
|
|
71
|
+
setOrderKey = _useState12[1];
|
|
72
|
+
var _useState13 = useState(),
|
|
73
73
|
_useState14 = _slicedToArray(_useState13, 2),
|
|
74
|
-
|
|
75
|
-
|
|
74
|
+
orderDirection = _useState14[0],
|
|
75
|
+
setOrderDirection = _useState14[1];
|
|
76
|
+
var _useState15 = useState({}),
|
|
77
|
+
_useState16 = _slicedToArray(_useState15, 2),
|
|
78
|
+
filterSelections = _useState16[0],
|
|
79
|
+
setFilterSelections = _useState16[1];
|
|
76
80
|
var showBasicFilters = useMemo(function () {
|
|
77
81
|
if (getBooleanFF('platform.linking-platform.datasource.show-jlol-basic-filters')) {
|
|
78
82
|
return true;
|
|
@@ -181,11 +185,17 @@ export var JiraSearchContainer = function JiraSearchContainer(props) {
|
|
|
181
185
|
setFilterSelections(updatedSelection);
|
|
182
186
|
handleBasicFilterSelectionChange(updatedSelection);
|
|
183
187
|
}, [handleBasicFilterSelectionChange, filterSelections]);
|
|
184
|
-
|
|
185
|
-
if (
|
|
188
|
+
useEffect(function () {
|
|
189
|
+
if (currentCloudId !== cloudId) {
|
|
190
|
+
setBasicSearchTerm('');
|
|
191
|
+
setJql(DEFAULT_JQL_QUERY);
|
|
192
|
+
setIsComplexQuery(false);
|
|
193
|
+
setOrderKey(undefined);
|
|
194
|
+
setOrderDirection(undefined);
|
|
186
195
|
setFilterSelections({});
|
|
196
|
+
setCloudId(currentCloudId);
|
|
187
197
|
}
|
|
188
|
-
}, [
|
|
198
|
+
}, [currentCloudId, cloudId]);
|
|
189
199
|
return jsx("div", {
|
|
190
200
|
css: inputContainerStyles,
|
|
191
201
|
"data-testid": "jira-search-container"
|
|
@@ -201,7 +211,6 @@ export var JiraSearchContainer = function JiraSearchContainer(props) {
|
|
|
201
211
|
cloudId: cloudId || '',
|
|
202
212
|
onChange: handleSelectionChange,
|
|
203
213
|
selections: filterSelections,
|
|
204
|
-
onReset: handleBasicFiltersReset,
|
|
205
214
|
isJQLHydrating: basicFilterHydrationStatus === 'loading'
|
|
206
215
|
})), currentSearchMethod === 'jql' && jsx(JiraJQLEditor, {
|
|
207
216
|
cloudId: cloudId || '',
|
|
@@ -14,6 +14,7 @@ import { v4 as uuidv4 } from 'uuid';
|
|
|
14
14
|
import { withAnalyticsContext } from '@atlaskit/analytics-next';
|
|
15
15
|
import Button from '@atlaskit/button/standard-button';
|
|
16
16
|
import Modal, { ModalBody, ModalFooter, ModalHeader, ModalTitle, ModalTransition } from '@atlaskit/modal-dialog';
|
|
17
|
+
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
17
18
|
import LinkUrl from '@atlaskit/smart-card/link-url';
|
|
18
19
|
import { B400, N0, N40, N800 } from '@atlaskit/theme/colors';
|
|
19
20
|
import { EVENT_CHANNEL, useDatasourceAnalyticsEvents } from '../../../analytics';
|
|
@@ -32,6 +33,7 @@ import { NoResults } from '../../common/error-state/no-results';
|
|
|
32
33
|
import { EmptyState, IssueLikeDataTableView, scrollableContainerShadowsCssComponents } from '../../issue-like-table';
|
|
33
34
|
import LinkRenderType from '../../issue-like-table/render-type/link';
|
|
34
35
|
import { availableBasicFilterTypes } from '../basic-filters/ui';
|
|
36
|
+
import { isQueryTooComplex } from '../basic-filters/utils/isQueryTooComplex';
|
|
35
37
|
import { InitialStateView } from '../initial-state-view';
|
|
36
38
|
import { JiraSearchContainer } from '../jira-search-container';
|
|
37
39
|
import { ModeSwitcher } from '../mode-switcher';
|
|
@@ -129,7 +131,7 @@ export var PlainJiraIssuesConfigModal = function PlainJiraIssuesConfigModal(prop
|
|
|
129
131
|
// analytics related parameters
|
|
130
132
|
var searchCount = useRef(0);
|
|
131
133
|
var userInteractionActions = useRef(new Set());
|
|
132
|
-
var initialSearchMethod = '
|
|
134
|
+
var initialSearchMethod = getBooleanFF('platform.linking-platform.datasource.show-jlol-basic-filters') && !isQueryTooComplex((initialParameters === null || initialParameters === void 0 ? void 0 : initialParameters.jql) || '') ? 'basic' : 'jql';
|
|
133
135
|
var _useState11 = useState(initialSearchMethod),
|
|
134
136
|
_useState12 = _slicedToArray(_useState11, 2),
|
|
135
137
|
currentSearchMethod = _useState12[0],
|
|
@@ -331,6 +333,7 @@ export var PlainJiraIssuesConfigModal = function PlainJiraIssuesConfigModal(prop
|
|
|
331
333
|
}, [analyticsPayload, onCancel]);
|
|
332
334
|
var onSiteSelection = useCallback(function (site) {
|
|
333
335
|
userInteractionActions.current.add(DatasourceAction.INSTANCE_UPDATED);
|
|
336
|
+
setJql('');
|
|
334
337
|
setCloudId(site.cloudId);
|
|
335
338
|
reset({
|
|
336
339
|
shouldForceRequest: true
|
|
@@ -6,9 +6,8 @@ export interface AsyncPopupSelectProps {
|
|
|
6
6
|
selection: SelectOption[];
|
|
7
7
|
isJQLHydrating: boolean;
|
|
8
8
|
onSelectionChange?: (filterType: BasicFilterFieldType, options: SelectOption[]) => void;
|
|
9
|
-
onReset?: () => void;
|
|
10
9
|
isDisabled?: boolean;
|
|
11
10
|
}
|
|
12
11
|
export declare const SEARCH_DEBOUNCE_MS = 350;
|
|
13
|
-
declare const AsyncPopupSelect: ({ filterType, cloudId, selection, isJQLHydrating, onSelectionChange,
|
|
12
|
+
declare const AsyncPopupSelect: ({ filterType, cloudId, selection, isJQLHydrating, onSelectionChange, isDisabled, }: AsyncPopupSelectProps) => JSX.Element;
|
|
14
13
|
export default AsyncPopupSelect;
|
|
@@ -5,8 +5,7 @@ export interface BasicFilterContainerProps {
|
|
|
5
5
|
cloudId: string;
|
|
6
6
|
selections: SelectedOptionsMap;
|
|
7
7
|
onChange: (filterType: BasicFilterFieldType, options: SelectOption[]) => void;
|
|
8
|
-
onReset: () => void;
|
|
9
8
|
isJQLHydrating: boolean;
|
|
10
9
|
}
|
|
11
|
-
declare const BasicFilterContainer: ({ cloudId, onChange, selections,
|
|
10
|
+
declare const BasicFilterContainer: ({ cloudId, onChange, selections, isJQLHydrating, }: BasicFilterContainerProps) => JSX.Element;
|
|
12
11
|
export default BasicFilterContainer;
|
|
@@ -2,6 +2,7 @@ import { jsx } from '@emotion/react';
|
|
|
2
2
|
import type { JiraSearchMethod } from '../../../common/types';
|
|
3
3
|
import { SelectedOptionsMap } from '../basic-filters/types';
|
|
4
4
|
import { JiraIssueDatasourceParameters, JiraIssueDatasourceParametersQuery } from '../types';
|
|
5
|
+
export declare const DEFAULT_JQL_QUERY = "created >= -30d order by created DESC";
|
|
5
6
|
export declare const ALLOWED_ORDER_BY_KEYS: string[];
|
|
6
7
|
export interface SearchContainerProps {
|
|
7
8
|
isSearching?: boolean;
|
package/dist/types-ts4.5/ui/jira-issues-modal/basic-filters/ui/async-popup-select/index.d.ts
CHANGED
|
@@ -6,9 +6,8 @@ export interface AsyncPopupSelectProps {
|
|
|
6
6
|
selection: SelectOption[];
|
|
7
7
|
isJQLHydrating: boolean;
|
|
8
8
|
onSelectionChange?: (filterType: BasicFilterFieldType, options: SelectOption[]) => void;
|
|
9
|
-
onReset?: () => void;
|
|
10
9
|
isDisabled?: boolean;
|
|
11
10
|
}
|
|
12
11
|
export declare const SEARCH_DEBOUNCE_MS = 350;
|
|
13
|
-
declare const AsyncPopupSelect: ({ filterType, cloudId, selection, isJQLHydrating, onSelectionChange,
|
|
12
|
+
declare const AsyncPopupSelect: ({ filterType, cloudId, selection, isJQLHydrating, onSelectionChange, isDisabled, }: AsyncPopupSelectProps) => JSX.Element;
|
|
14
13
|
export default AsyncPopupSelect;
|
|
@@ -5,8 +5,7 @@ export interface BasicFilterContainerProps {
|
|
|
5
5
|
cloudId: string;
|
|
6
6
|
selections: SelectedOptionsMap;
|
|
7
7
|
onChange: (filterType: BasicFilterFieldType, options: SelectOption[]) => void;
|
|
8
|
-
onReset: () => void;
|
|
9
8
|
isJQLHydrating: boolean;
|
|
10
9
|
}
|
|
11
|
-
declare const BasicFilterContainer: ({ cloudId, onChange, selections,
|
|
10
|
+
declare const BasicFilterContainer: ({ cloudId, onChange, selections, isJQLHydrating, }: BasicFilterContainerProps) => JSX.Element;
|
|
12
11
|
export default BasicFilterContainer;
|
|
@@ -2,6 +2,7 @@ import { jsx } from '@emotion/react';
|
|
|
2
2
|
import type { JiraSearchMethod } from '../../../common/types';
|
|
3
3
|
import { SelectedOptionsMap } from '../basic-filters/types';
|
|
4
4
|
import { JiraIssueDatasourceParameters, JiraIssueDatasourceParametersQuery } from '../types';
|
|
5
|
+
export declare const DEFAULT_JQL_QUERY = "created >= -30d order by created DESC";
|
|
5
6
|
export declare const ALLOWED_ORDER_BY_KEYS: string[];
|
|
6
7
|
export interface SearchContainerProps {
|
|
7
8
|
isSearching?: boolean;
|