@atlaskit/link-datasource 1.19.2 → 1.19.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (30) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/cjs/analytics/constants.js +1 -1
  3. package/dist/cjs/ui/jira-issues-modal/basic-filters/hooks/useHydrateJqlQuery.js +20 -7
  4. package/dist/cjs/ui/jira-issues-modal/basic-filters/utils/extractValuesFromNonComplexJQL.js +93 -0
  5. package/dist/cjs/ui/jira-issues-modal/basic-filters/utils/isClauseTooComplex.js +2 -2
  6. package/dist/cjs/ui/jira-issues-modal/jira-search-container/index.js +12 -4
  7. package/dist/cjs/ui/jira-issues-modal/modal/index.js +6 -2
  8. package/dist/es2019/analytics/constants.js +1 -1
  9. package/dist/es2019/ui/jira-issues-modal/basic-filters/hooks/useHydrateJqlQuery.js +17 -1
  10. package/dist/es2019/ui/jira-issues-modal/basic-filters/utils/extractValuesFromNonComplexJQL.js +64 -0
  11. package/dist/es2019/ui/jira-issues-modal/basic-filters/utils/isClauseTooComplex.js +1 -1
  12. package/dist/es2019/ui/jira-issues-modal/jira-search-container/index.js +12 -4
  13. package/dist/es2019/ui/jira-issues-modal/modal/index.js +5 -1
  14. package/dist/esm/analytics/constants.js +1 -1
  15. package/dist/esm/ui/jira-issues-modal/basic-filters/hooks/useHydrateJqlQuery.js +20 -7
  16. package/dist/esm/ui/jira-issues-modal/basic-filters/utils/extractValuesFromNonComplexJQL.js +87 -0
  17. package/dist/esm/ui/jira-issues-modal/basic-filters/utils/isClauseTooComplex.js +1 -1
  18. package/dist/esm/ui/jira-issues-modal/jira-search-container/index.js +12 -4
  19. package/dist/esm/ui/jira-issues-modal/modal/index.js +6 -2
  20. package/dist/types/analytics/generated/analytics.types.d.ts +5 -2
  21. package/dist/types/ui/jira-issues-modal/basic-filters/hooks/useHydrateJqlQuery.d.ts +3 -1
  22. package/dist/types/ui/jira-issues-modal/basic-filters/utils/extractValuesFromNonComplexJQL.d.ts +4 -0
  23. package/dist/types/ui/jira-issues-modal/basic-filters/utils/isClauseTooComplex.d.ts +1 -0
  24. package/dist/types/ui/jira-issues-modal/jira-search-container/index.d.ts +1 -0
  25. package/dist/types-ts4.5/analytics/generated/analytics.types.d.ts +5 -2
  26. package/dist/types-ts4.5/ui/jira-issues-modal/basic-filters/hooks/useHydrateJqlQuery.d.ts +3 -1
  27. package/dist/types-ts4.5/ui/jira-issues-modal/basic-filters/utils/extractValuesFromNonComplexJQL.d.ts +4 -0
  28. package/dist/types-ts4.5/ui/jira-issues-modal/basic-filters/utils/isClauseTooComplex.d.ts +1 -0
  29. package/dist/types-ts4.5/ui/jira-issues-modal/jira-search-container/index.d.ts +1 -0
  30. package/package.json +3 -3
package/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # @atlaskit/link-datasource
2
2
 
3
+ ## 1.19.4
4
+
5
+ ### Patch Changes
6
+
7
+ - [#43869](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/43869) [`a46528b1133`](https://bitbucket.org/atlassian/atlassian-frontend/commits/a46528b1133) - Update jql searched and insert click analytics events with isQueryComplex attribute.
8
+
9
+ ## 1.19.3
10
+
11
+ ### Patch Changes
12
+
13
+ - [#43787](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/43787) [`a9738b4c894`](https://bitbucket.org/atlassian/atlassian-frontend/commits/a9738b4c894) - Logic to parse text value from JQL and pre-populate input box in basic mode.
14
+ - Updated dependencies
15
+
3
16
  ## 1.19.2
4
17
 
5
18
  ### 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.2"
10
+ packageVersion: "1.19.4"
11
11
  };
@@ -6,11 +6,16 @@ Object.defineProperty(exports, "__esModule", {
6
6
  });
7
7
  exports.useHydrateJqlQuery = void 0;
8
8
  var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
9
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
9
10
  var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
10
11
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
11
12
  var _react = require("react");
12
13
  var _useBasicFilterAGG2 = require("../../../../services/useBasicFilterAGG");
14
+ var _extractValuesFromNonComplexJQL = require("../utils/extractValuesFromNonComplexJQL");
15
+ var _isClauseTooComplex = require("../utils/isClauseTooComplex");
13
16
  var _transformers = require("../utils/transformers");
17
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
18
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
14
19
  var useHydrateJqlQuery = exports.useHydrateJqlQuery = function useHydrateJqlQuery(cloudId, jql) {
15
20
  var _useState = (0, _react.useState)({}),
16
21
  _useState2 = (0, _slicedToArray2.default)(_useState, 2),
@@ -27,7 +32,7 @@ var useHydrateJqlQuery = exports.useHydrateJqlQuery = function useHydrateJqlQuer
27
32
  var _useBasicFilterAGG = (0, _useBasicFilterAGG2.useBasicFilterAGG)(),
28
33
  getHydratedJQL = _useBasicFilterAGG.getHydratedJQL;
29
34
  var fetchHydratedJqlOptions = (0, _react.useCallback)( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
30
- var response;
35
+ var response, _extractValuesFromNon, text, summary, key, _ref2, _ref3, textFieldValue, mappedValues;
31
36
  return _regenerator.default.wrap(function _callee$(_context) {
32
37
  while (1) switch (_context.prev = _context.next) {
33
38
  case 0:
@@ -45,20 +50,28 @@ var useHydrateJqlQuery = exports.useHydrateJqlQuery = function useHydrateJqlQuer
45
50
  setErrors(response.errors);
46
51
  return _context.abrupt("return");
47
52
  case 9:
48
- setHydratedOptions((0, _transformers.mapHydrateResponseData)(response));
53
+ /**
54
+ * Hydrate logic does not return text field, hence we parse and extract value from jql
55
+ */
56
+ _extractValuesFromNon = (0, _extractValuesFromNonComplexJQL.extractValuesFromNonComplexJQL)(jql), text = _extractValuesFromNon.text, summary = _extractValuesFromNon.summary, key = _extractValuesFromNon.key;
57
+ _ref2 = text || summary || key || [], _ref3 = (0, _slicedToArray2.default)(_ref2, 1), textFieldValue = _ref3[0];
58
+ mappedValues = _objectSpread(_objectSpread({}, (0, _transformers.mapHydrateResponseData)(response)), {}, {
59
+ basicInputTextValue: (0, _isClauseTooComplex.removeFuzzyCharacter)(textFieldValue)
60
+ });
61
+ setHydratedOptions(mappedValues);
49
62
  setStatus('resolved');
50
- _context.next = 17;
63
+ _context.next = 20;
51
64
  break;
52
- case 13:
53
- _context.prev = 13;
65
+ case 16:
66
+ _context.prev = 16;
54
67
  _context.t0 = _context["catch"](0);
55
68
  setErrors([_context.t0]);
56
69
  setStatus('rejected');
57
- case 17:
70
+ case 20:
58
71
  case "end":
59
72
  return _context.stop();
60
73
  }
61
- }, _callee, null, [[0, 13]]);
74
+ }, _callee, null, [[0, 16]]);
62
75
  })), [cloudId, getHydratedJQL, jql]);
63
76
  (0, _react.useEffect)(function () {
64
77
  if (status !== 'rejected' && errors.length !== 0) {
@@ -0,0 +1,93 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.extractValuesFromNonComplexJQL = void 0;
8
+ var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
9
+ var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
10
+ var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
11
+ var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
12
+ var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
13
+ var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
14
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
15
+ var _mergeWith = _interopRequireDefault(require("lodash/mergeWith"));
16
+ var _jqlAst = require("@atlaskit/jql-ast");
17
+ var _isQueryTooComplex = require("./isQueryTooComplex");
18
+ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
19
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
20
+ // Map of field keys to their respective clauses in the Jast
21
+
22
+ var getFieldValues = function getFieldValues(operand) {
23
+ switch (operand.operandType) {
24
+ case _jqlAst.OPERAND_TYPE_LIST:
25
+ return operand.values.map(function (value) {
26
+ return value.operandType === _jqlAst.OPERAND_TYPE_VALUE && value.value || undefined;
27
+ }).filter(function (value) {
28
+ return !!value;
29
+ });
30
+ case _jqlAst.OPERAND_TYPE_VALUE:
31
+ return operand.value ? [operand.value] : [];
32
+ case _jqlAst.OPERAND_TYPE_KEYWORD:
33
+ return operand.value === _jqlAst.OPERAND_EMPTY ? [operand.value] : [];
34
+ default:
35
+ return [];
36
+ }
37
+ };
38
+
39
+ /**
40
+ * Rather than having to navigate the entire tree structure ourself, we extend AbstractJastVisitor
41
+ * class and implement visitField to walk through each field and value.
42
+ * */
43
+ var JqlClauseCollectingVisitor = /*#__PURE__*/function (_AbstractJastVisitor) {
44
+ (0, _inherits2.default)(JqlClauseCollectingVisitor, _AbstractJastVisitor);
45
+ var _super = _createSuper(JqlClauseCollectingVisitor);
46
+ function JqlClauseCollectingVisitor() {
47
+ var _this;
48
+ (0, _classCallCheck2.default)(this, JqlClauseCollectingVisitor);
49
+ _this = _super.call(this);
50
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "visitField", function (field) {
51
+ var _field$value;
52
+ var fieldName = (_field$value = field.value) === null || _field$value === void 0 ? void 0 : _field$value.toLowerCase();
53
+ var fieldParent = field.parent;
54
+ if (!fieldParent) {
55
+ return;
56
+ }
57
+
58
+ // we do not want to parse and store the order by field+value
59
+ var fieldGrandParent = fieldParent.parent;
60
+ if (fieldGrandParent.type === _jqlAst.NODE_TYPE_ORDER_BY) {
61
+ return;
62
+ }
63
+ var operand = fieldParent.operand;
64
+ var fieldValues = operand && getFieldValues(operand) || [];
65
+ return (0, _defineProperty2.default)({}, fieldName, fieldValues);
66
+ });
67
+ return _this;
68
+ }
69
+ (0, _createClass2.default)(JqlClauseCollectingVisitor, [{
70
+ key: "aggregateResult",
71
+ value: function aggregateResult(aggregate, nextResult) {
72
+ return (0, _mergeWith.default)(aggregate, nextResult, function (destValue, srcValue) {
73
+ return srcValue.concat(destValue !== null && destValue !== void 0 ? destValue : []);
74
+ });
75
+ }
76
+ }, {
77
+ key: "defaultResult",
78
+ value: function defaultResult() {
79
+ return {};
80
+ }
81
+ }]);
82
+ return JqlClauseCollectingVisitor;
83
+ }(_jqlAst.AbstractJastVisitor);
84
+ var extractValuesFromNonComplexJQL = exports.extractValuesFromNonComplexJQL = function extractValuesFromNonComplexJQL(jql) {
85
+ if ((0, _isQueryTooComplex.isQueryTooComplex)(jql)) {
86
+ return {};
87
+ }
88
+ var jast = new _jqlAst.JastBuilder().build(jql);
89
+ var jqlClauseCollectingVisitor = new JqlClauseCollectingVisitor();
90
+ var mappedValues = jast.query ? jast.query.accept(jqlClauseCollectingVisitor) || {} : {}; // jast.query is defined as void | Query, hence the fallback
91
+
92
+ return mappedValues;
93
+ };
@@ -4,11 +4,11 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
- exports.isClauseTooComplex = void 0;
7
+ exports.removeFuzzyCharacter = exports.isClauseTooComplex = void 0;
8
8
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
9
9
  var _jqlAst = require("@atlaskit/jql-ast");
10
10
  var _buildJQL = require("../../jira-search-container/buildJQL");
11
- var removeFuzzyCharacter = function removeFuzzyCharacter(value) {
11
+ var removeFuzzyCharacter = exports.removeFuzzyCharacter = function removeFuzzyCharacter(value) {
12
12
  if (value !== null && value !== void 0 && value.endsWith(_buildJQL.fuzzyCharacter)) {
13
13
  return value.slice(0, -1);
14
14
  }
@@ -122,17 +122,20 @@ var JiraSearchContainer = exports.JiraSearchContainer = function JiraSearchConta
122
122
  setJql(query);
123
123
  }, []);
124
124
  var handleSearch = (0, _react.useCallback)(function () {
125
+ var isCurrentQueryComplex = (0, _isQueryTooComplex.isQueryTooComplex)(jql);
125
126
  onSearch({
126
127
  jql: jql
127
128
  }, {
128
129
  searchMethod: currentSearchMethod,
129
- basicFilterSelections: filterSelections
130
+ basicFilterSelections: filterSelections,
131
+ isQueryComplex: isCurrentQueryComplex
130
132
  });
131
133
  if (currentSearchMethod === 'basic') {
132
134
  fireEvent('ui.form.submitted.basicSearch', {});
133
135
  } else if (currentSearchMethod === 'jql') {
134
- fireEvent('ui.jqlEditor.searched', {});
135
- var isCurrentQueryComplex = (0, _isQueryTooComplex.isQueryTooComplex)(jql);
136
+ fireEvent('ui.jqlEditor.searched', {
137
+ isQueryComplex: isCurrentQueryComplex
138
+ });
136
139
  setIsComplexQuery(isCurrentQueryComplex);
137
140
  if (showBasicFilters && !isCurrentQueryComplex) {
138
141
  fetchHydratedJqlOptions();
@@ -147,11 +150,13 @@ var JiraSearchContainer = exports.JiraSearchContainer = function JiraSearchConta
147
150
  orderKey: orderKey
148
151
  });
149
152
  setJql(jqlWithFilterValues);
153
+ var isCurrentQueryComplex = (0, _isQueryTooComplex.isQueryTooComplex)(jqlWithFilterValues);
150
154
  onSearch({
151
155
  jql: jqlWithFilterValues
152
156
  }, {
153
157
  searchMethod: currentSearchMethod,
154
- basicFilterSelections: filterSelections
158
+ basicFilterSelections: filterSelections,
159
+ isQueryComplex: isCurrentQueryComplex
155
160
  });
156
161
  }, _asyncPopupSelect.SEARCH_DEBOUNCE_MS),
157
162
  _useDebouncedCallback2 = (0, _slicedToArray2.default)(_useDebouncedCallback, 1),
@@ -171,6 +176,9 @@ var JiraSearchContainer = exports.JiraSearchContainer = function JiraSearchConta
171
176
  (0, _react.useEffect)(function () {
172
177
  if (basicFilterHydrationStatus === 'resolved') {
173
178
  setFilterSelections(hydratedOptions);
179
+ if (hydratedOptions.basicInputTextValue) {
180
+ setBasicSearchTerm(hydratedOptions.basicInputTextValue);
181
+ }
174
182
  }
175
183
  }, [hydratedOptions, basicFilterHydrationStatus]);
176
184
  var handleSelectionChange = (0, _react.useCallback)(function (filterType, options) {
@@ -142,6 +142,7 @@ var PlainJiraIssuesConfigModal = exports.PlainJiraIssuesConfigModal = function P
142
142
  var searchMethodSearchedWith = (0, _react.useRef)(null);
143
143
  var visibleColumnCount = (0, _react.useRef)((visibleColumnKeys === null || visibleColumnKeys === void 0 ? void 0 : visibleColumnKeys.length) || 0);
144
144
  var basicFilterSelectionsSearchedWith = (0, _react.useRef)({});
145
+ var isSearchedWithComplexQuery = (0, _react.useRef)(false);
145
146
  var parameters = (0, _react.useMemo)(function () {
146
147
  return !!cloudId ? {
147
148
  cloudId: cloudId,
@@ -308,10 +309,12 @@ var PlainJiraIssuesConfigModal = exports.PlainJiraIssuesConfigModal = function P
308
309
  (0, _useColumnPickerRenderedFailedUfoExperience.useColumnPickerRenderedFailedUfoExperience)(status, modalRenderInstanceId);
309
310
  var onSearch = (0, _react.useCallback)(function (newParameters, _ref2) {
310
311
  var searchMethod = _ref2.searchMethod,
311
- basicFilterSelections = _ref2.basicFilterSelections;
312
+ basicFilterSelections = _ref2.basicFilterSelections,
313
+ isQueryComplex = _ref2.isQueryComplex;
312
314
  searchCount.current++;
313
315
  searchMethodSearchedWith.current = searchMethod;
314
316
  basicFilterSelectionsSearchedWith.current = basicFilterSelections;
317
+ isSearchedWithComplexQuery.current = isQueryComplex;
315
318
  if (jql !== newParameters.jql) {
316
319
  userInteractionActions.current.add(_types.DatasourceAction.QUERY_UPDATED);
317
320
  }
@@ -362,7 +365,8 @@ var PlainJiraIssuesConfigModal = exports.PlainJiraIssuesConfigModal = function P
362
365
  display: getDisplayValue(currentViewMode, totalCount || 0),
363
366
  searchCount: searchCount.current,
364
367
  searchMethod: (0, _utils.mapSearchMethod)(searchMethodSearchedWith.current),
365
- actions: Array.from(userInteractionActions.current)
368
+ actions: Array.from(userInteractionActions.current),
369
+ isQueryComplex: isSearchedWithComplexQuery.current
366
370
  }, searchMethodSearchedWith.current === 'basic' ? _objectSpread({}, filterSelectionCount) : {}),
367
371
  eventType: 'ui'
368
372
  });
@@ -1,5 +1,5 @@
1
1
  export const EVENT_CHANNEL = 'media';
2
2
  export const packageMetaData = {
3
3
  packageName: "@atlaskit/link-datasource",
4
- packageVersion: "1.19.2"
4
+ packageVersion: "1.19.4"
5
5
  };
@@ -1,5 +1,7 @@
1
1
  import { useCallback, useEffect, useState } from 'react';
2
2
  import { useBasicFilterAGG } from '../../../../services/useBasicFilterAGG';
3
+ import { extractValuesFromNonComplexJQL } from '../utils/extractValuesFromNonComplexJQL';
4
+ import { removeFuzzyCharacter } from '../utils/isClauseTooComplex';
3
5
  import { mapHydrateResponseData } from '../utils/transformers';
4
6
  export const useHydrateJqlQuery = (cloudId, jql) => {
5
7
  const [hydratedOptions, setHydratedOptions] = useState({});
@@ -17,7 +19,21 @@ export const useHydrateJqlQuery = (cloudId, jql) => {
17
19
  setErrors(response.errors);
18
20
  return;
19
21
  }
20
- setHydratedOptions(mapHydrateResponseData(response));
22
+
23
+ /**
24
+ * Hydrate logic does not return text field, hence we parse and extract value from jql
25
+ */
26
+ const {
27
+ text,
28
+ summary,
29
+ key
30
+ } = extractValuesFromNonComplexJQL(jql);
31
+ const [textFieldValue] = text || summary || key || [];
32
+ const mappedValues = {
33
+ ...mapHydrateResponseData(response),
34
+ basicInputTextValue: removeFuzzyCharacter(textFieldValue)
35
+ };
36
+ setHydratedOptions(mappedValues);
21
37
  setStatus('resolved');
22
38
  } catch (error) {
23
39
  setErrors([error]);
@@ -0,0 +1,64 @@
1
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
+ import mergeWith from 'lodash/mergeWith';
3
+ import { AbstractJastVisitor, JastBuilder, NODE_TYPE_ORDER_BY, OPERAND_EMPTY, OPERAND_TYPE_KEYWORD, OPERAND_TYPE_LIST, OPERAND_TYPE_VALUE } from '@atlaskit/jql-ast';
4
+ import { isQueryTooComplex } from './isQueryTooComplex';
5
+
6
+ // Map of field keys to their respective clauses in the Jast
7
+
8
+ const getFieldValues = operand => {
9
+ switch (operand.operandType) {
10
+ case OPERAND_TYPE_LIST:
11
+ return operand.values.map(value => value.operandType === OPERAND_TYPE_VALUE && value.value || undefined).filter(value => !!value);
12
+ case OPERAND_TYPE_VALUE:
13
+ return operand.value ? [operand.value] : [];
14
+ case OPERAND_TYPE_KEYWORD:
15
+ return operand.value === OPERAND_EMPTY ? [operand.value] : [];
16
+ default:
17
+ return [];
18
+ }
19
+ };
20
+
21
+ /**
22
+ * Rather than having to navigate the entire tree structure ourself, we extend AbstractJastVisitor
23
+ * class and implement visitField to walk through each field and value.
24
+ * */
25
+ class JqlClauseCollectingVisitor extends AbstractJastVisitor {
26
+ constructor() {
27
+ super();
28
+ _defineProperty(this, "visitField", field => {
29
+ var _field$value;
30
+ const fieldName = (_field$value = field.value) === null || _field$value === void 0 ? void 0 : _field$value.toLowerCase();
31
+ const fieldParent = field.parent;
32
+ if (!fieldParent) {
33
+ return;
34
+ }
35
+
36
+ // we do not want to parse and store the order by field+value
37
+ const fieldGrandParent = fieldParent.parent;
38
+ if (fieldGrandParent.type === NODE_TYPE_ORDER_BY) {
39
+ return;
40
+ }
41
+ const operand = fieldParent.operand;
42
+ const fieldValues = operand && getFieldValues(operand) || [];
43
+ return {
44
+ [fieldName]: fieldValues
45
+ };
46
+ });
47
+ }
48
+ aggregateResult(aggregate, nextResult) {
49
+ return mergeWith(aggregate, nextResult, (destValue, srcValue) => srcValue.concat(destValue !== null && destValue !== void 0 ? destValue : []));
50
+ }
51
+ defaultResult() {
52
+ return {};
53
+ }
54
+ }
55
+ export const extractValuesFromNonComplexJQL = jql => {
56
+ if (isQueryTooComplex(jql)) {
57
+ return {};
58
+ }
59
+ const jast = new JastBuilder().build(jql);
60
+ const jqlClauseCollectingVisitor = new JqlClauseCollectingVisitor();
61
+ const mappedValues = jast.query ? jast.query.accept(jqlClauseCollectingVisitor) || {} : {}; // jast.query is defined as void | Query, hence the fallback
62
+
63
+ return mappedValues;
64
+ };
@@ -1,6 +1,6 @@
1
1
  import { CLAUSE_TYPE_COMPOUND, CLAUSE_TYPE_TERMINAL, OPERAND_TYPE_VALUE } from '@atlaskit/jql-ast';
2
2
  import { fuzzyCharacter } from '../../jira-search-container/buildJQL';
3
- const removeFuzzyCharacter = value => {
3
+ export const removeFuzzyCharacter = value => {
4
4
  if (value !== null && value !== void 0 && value.endsWith(fuzzyCharacter)) {
5
5
  return value.slice(0, -1);
6
6
  }
@@ -92,17 +92,20 @@ export const JiraSearchContainer = props => {
92
92
  setJql(query);
93
93
  }, []);
94
94
  const handleSearch = useCallback(() => {
95
+ const isCurrentQueryComplex = isQueryTooComplex(jql);
95
96
  onSearch({
96
97
  jql
97
98
  }, {
98
99
  searchMethod: currentSearchMethod,
99
- basicFilterSelections: filterSelections
100
+ basicFilterSelections: filterSelections,
101
+ isQueryComplex: isCurrentQueryComplex
100
102
  });
101
103
  if (currentSearchMethod === 'basic') {
102
104
  fireEvent('ui.form.submitted.basicSearch', {});
103
105
  } else if (currentSearchMethod === 'jql') {
104
- fireEvent('ui.jqlEditor.searched', {});
105
- const isCurrentQueryComplex = isQueryTooComplex(jql);
106
+ fireEvent('ui.jqlEditor.searched', {
107
+ isQueryComplex: isCurrentQueryComplex
108
+ });
106
109
  setIsComplexQuery(isCurrentQueryComplex);
107
110
  if (showBasicFilters && !isCurrentQueryComplex) {
108
111
  fetchHydratedJqlOptions();
@@ -117,11 +120,13 @@ export const JiraSearchContainer = props => {
117
120
  orderKey
118
121
  });
119
122
  setJql(jqlWithFilterValues);
123
+ const isCurrentQueryComplex = isQueryTooComplex(jqlWithFilterValues);
120
124
  onSearch({
121
125
  jql: jqlWithFilterValues
122
126
  }, {
123
127
  searchMethod: currentSearchMethod,
124
- basicFilterSelections: filterSelections
128
+ basicFilterSelections: filterSelections,
129
+ isQueryComplex: isCurrentQueryComplex
125
130
  });
126
131
  }, SEARCH_DEBOUNCE_MS);
127
132
  const handleBasicFilterSelectionChange = useCallback(filterValues => {
@@ -139,6 +144,9 @@ export const JiraSearchContainer = props => {
139
144
  useEffect(() => {
140
145
  if (basicFilterHydrationStatus === 'resolved') {
141
146
  setFilterSelections(hydratedOptions);
147
+ if (hydratedOptions.basicInputTextValue) {
148
+ setBasicSearchTerm(hydratedOptions.basicInputTextValue);
149
+ }
142
150
  }
143
151
  }, [hydratedOptions, basicFilterHydrationStatus]);
144
152
  const handleSelectionChange = useCallback((filterType, options) => {
@@ -109,6 +109,7 @@ export const PlainJiraIssuesConfigModal = props => {
109
109
  const searchMethodSearchedWith = useRef(null);
110
110
  const visibleColumnCount = useRef((visibleColumnKeys === null || visibleColumnKeys === void 0 ? void 0 : visibleColumnKeys.length) || 0);
111
111
  const basicFilterSelectionsSearchedWith = useRef({});
112
+ const isSearchedWithComplexQuery = useRef(false);
112
113
  const parameters = useMemo(() => !!cloudId ? {
113
114
  cloudId,
114
115
  jql: jql || ''
@@ -256,11 +257,13 @@ export const PlainJiraIssuesConfigModal = props => {
256
257
  useColumnPickerRenderedFailedUfoExperience(status, modalRenderInstanceId);
257
258
  const onSearch = useCallback((newParameters, {
258
259
  searchMethod,
259
- basicFilterSelections
260
+ basicFilterSelections,
261
+ isQueryComplex
260
262
  }) => {
261
263
  searchCount.current++;
262
264
  searchMethodSearchedWith.current = searchMethod;
263
265
  basicFilterSelectionsSearchedWith.current = basicFilterSelections;
266
+ isSearchedWithComplexQuery.current = isQueryComplex;
264
267
  if (jql !== newParameters.jql) {
265
268
  userInteractionActions.current.add(DatasourceAction.QUERY_UPDATED);
266
269
  }
@@ -316,6 +319,7 @@ export const PlainJiraIssuesConfigModal = props => {
316
319
  searchCount: searchCount.current,
317
320
  searchMethod: mapSearchMethod(searchMethodSearchedWith.current),
318
321
  actions: Array.from(userInteractionActions.current),
322
+ isQueryComplex: isSearchedWithComplexQuery.current,
319
323
  ...(searchMethodSearchedWith.current === 'basic' ? {
320
324
  ...filterSelectionCount
321
325
  } : {})
@@ -1,5 +1,5 @@
1
1
  export var EVENT_CHANNEL = 'media';
2
2
  export var packageMetaData = {
3
3
  packageName: "@atlaskit/link-datasource",
4
- packageVersion: "1.19.2"
4
+ packageVersion: "1.19.4"
5
5
  };
@@ -1,8 +1,13 @@
1
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
1
2
  import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
2
3
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
3
4
  import _regeneratorRuntime from "@babel/runtime/regenerator";
5
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
6
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
4
7
  import { useCallback, useEffect, useState } from 'react';
5
8
  import { useBasicFilterAGG } from '../../../../services/useBasicFilterAGG';
9
+ import { extractValuesFromNonComplexJQL } from '../utils/extractValuesFromNonComplexJQL';
10
+ import { removeFuzzyCharacter } from '../utils/isClauseTooComplex';
6
11
  import { mapHydrateResponseData } from '../utils/transformers';
7
12
  export var useHydrateJqlQuery = function useHydrateJqlQuery(cloudId, jql) {
8
13
  var _useState = useState({}),
@@ -20,7 +25,7 @@ export var useHydrateJqlQuery = function useHydrateJqlQuery(cloudId, jql) {
20
25
  var _useBasicFilterAGG = useBasicFilterAGG(),
21
26
  getHydratedJQL = _useBasicFilterAGG.getHydratedJQL;
22
27
  var fetchHydratedJqlOptions = useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
23
- var response;
28
+ var response, _extractValuesFromNon, text, summary, key, _ref2, _ref3, textFieldValue, mappedValues;
24
29
  return _regeneratorRuntime.wrap(function _callee$(_context) {
25
30
  while (1) switch (_context.prev = _context.next) {
26
31
  case 0:
@@ -38,20 +43,28 @@ export var useHydrateJqlQuery = function useHydrateJqlQuery(cloudId, jql) {
38
43
  setErrors(response.errors);
39
44
  return _context.abrupt("return");
40
45
  case 9:
41
- setHydratedOptions(mapHydrateResponseData(response));
46
+ /**
47
+ * Hydrate logic does not return text field, hence we parse and extract value from jql
48
+ */
49
+ _extractValuesFromNon = extractValuesFromNonComplexJQL(jql), text = _extractValuesFromNon.text, summary = _extractValuesFromNon.summary, key = _extractValuesFromNon.key;
50
+ _ref2 = text || summary || key || [], _ref3 = _slicedToArray(_ref2, 1), textFieldValue = _ref3[0];
51
+ mappedValues = _objectSpread(_objectSpread({}, mapHydrateResponseData(response)), {}, {
52
+ basicInputTextValue: removeFuzzyCharacter(textFieldValue)
53
+ });
54
+ setHydratedOptions(mappedValues);
42
55
  setStatus('resolved');
43
- _context.next = 17;
56
+ _context.next = 20;
44
57
  break;
45
- case 13:
46
- _context.prev = 13;
58
+ case 16:
59
+ _context.prev = 16;
47
60
  _context.t0 = _context["catch"](0);
48
61
  setErrors([_context.t0]);
49
62
  setStatus('rejected');
50
- case 17:
63
+ case 20:
51
64
  case "end":
52
65
  return _context.stop();
53
66
  }
54
- }, _callee, null, [[0, 13]]);
67
+ }, _callee, null, [[0, 16]]);
55
68
  })), [cloudId, getHydratedJQL, jql]);
56
69
  useEffect(function () {
57
70
  if (status !== 'rejected' && errors.length !== 0) {
@@ -0,0 +1,87 @@
1
+ import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
2
+ import _createClass from "@babel/runtime/helpers/createClass";
3
+ import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
4
+ import _inherits from "@babel/runtime/helpers/inherits";
5
+ import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
6
+ import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
7
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
8
+ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
9
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
10
+ import mergeWith from 'lodash/mergeWith';
11
+ import { AbstractJastVisitor, JastBuilder, NODE_TYPE_ORDER_BY, OPERAND_EMPTY, OPERAND_TYPE_KEYWORD, OPERAND_TYPE_LIST, OPERAND_TYPE_VALUE } from '@atlaskit/jql-ast';
12
+ import { isQueryTooComplex } from './isQueryTooComplex';
13
+
14
+ // Map of field keys to their respective clauses in the Jast
15
+
16
+ var getFieldValues = function getFieldValues(operand) {
17
+ switch (operand.operandType) {
18
+ case OPERAND_TYPE_LIST:
19
+ return operand.values.map(function (value) {
20
+ return value.operandType === OPERAND_TYPE_VALUE && value.value || undefined;
21
+ }).filter(function (value) {
22
+ return !!value;
23
+ });
24
+ case OPERAND_TYPE_VALUE:
25
+ return operand.value ? [operand.value] : [];
26
+ case OPERAND_TYPE_KEYWORD:
27
+ return operand.value === OPERAND_EMPTY ? [operand.value] : [];
28
+ default:
29
+ return [];
30
+ }
31
+ };
32
+
33
+ /**
34
+ * Rather than having to navigate the entire tree structure ourself, we extend AbstractJastVisitor
35
+ * class and implement visitField to walk through each field and value.
36
+ * */
37
+ var JqlClauseCollectingVisitor = /*#__PURE__*/function (_AbstractJastVisitor) {
38
+ _inherits(JqlClauseCollectingVisitor, _AbstractJastVisitor);
39
+ var _super = _createSuper(JqlClauseCollectingVisitor);
40
+ function JqlClauseCollectingVisitor() {
41
+ var _this;
42
+ _classCallCheck(this, JqlClauseCollectingVisitor);
43
+ _this = _super.call(this);
44
+ _defineProperty(_assertThisInitialized(_this), "visitField", function (field) {
45
+ var _field$value;
46
+ var fieldName = (_field$value = field.value) === null || _field$value === void 0 ? void 0 : _field$value.toLowerCase();
47
+ var fieldParent = field.parent;
48
+ if (!fieldParent) {
49
+ return;
50
+ }
51
+
52
+ // we do not want to parse and store the order by field+value
53
+ var fieldGrandParent = fieldParent.parent;
54
+ if (fieldGrandParent.type === NODE_TYPE_ORDER_BY) {
55
+ return;
56
+ }
57
+ var operand = fieldParent.operand;
58
+ var fieldValues = operand && getFieldValues(operand) || [];
59
+ return _defineProperty({}, fieldName, fieldValues);
60
+ });
61
+ return _this;
62
+ }
63
+ _createClass(JqlClauseCollectingVisitor, [{
64
+ key: "aggregateResult",
65
+ value: function aggregateResult(aggregate, nextResult) {
66
+ return mergeWith(aggregate, nextResult, function (destValue, srcValue) {
67
+ return srcValue.concat(destValue !== null && destValue !== void 0 ? destValue : []);
68
+ });
69
+ }
70
+ }, {
71
+ key: "defaultResult",
72
+ value: function defaultResult() {
73
+ return {};
74
+ }
75
+ }]);
76
+ return JqlClauseCollectingVisitor;
77
+ }(AbstractJastVisitor);
78
+ export var extractValuesFromNonComplexJQL = function extractValuesFromNonComplexJQL(jql) {
79
+ if (isQueryTooComplex(jql)) {
80
+ return {};
81
+ }
82
+ var jast = new JastBuilder().build(jql);
83
+ var jqlClauseCollectingVisitor = new JqlClauseCollectingVisitor();
84
+ var mappedValues = jast.query ? jast.query.accept(jqlClauseCollectingVisitor) || {} : {}; // jast.query is defined as void | Query, hence the fallback
85
+
86
+ return mappedValues;
87
+ };
@@ -1,7 +1,7 @@
1
1
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
2
2
  import { CLAUSE_TYPE_COMPOUND, CLAUSE_TYPE_TERMINAL, OPERAND_TYPE_VALUE } from '@atlaskit/jql-ast';
3
3
  import { fuzzyCharacter } from '../../jira-search-container/buildJQL';
4
- var removeFuzzyCharacter = function removeFuzzyCharacter(value) {
4
+ export var removeFuzzyCharacter = function removeFuzzyCharacter(value) {
5
5
  if (value !== null && value !== void 0 && value.endsWith(fuzzyCharacter)) {
6
6
  return value.slice(0, -1);
7
7
  }
@@ -113,17 +113,20 @@ export var JiraSearchContainer = function JiraSearchContainer(props) {
113
113
  setJql(query);
114
114
  }, []);
115
115
  var handleSearch = useCallback(function () {
116
+ var isCurrentQueryComplex = isQueryTooComplex(jql);
116
117
  onSearch({
117
118
  jql: jql
118
119
  }, {
119
120
  searchMethod: currentSearchMethod,
120
- basicFilterSelections: filterSelections
121
+ basicFilterSelections: filterSelections,
122
+ isQueryComplex: isCurrentQueryComplex
121
123
  });
122
124
  if (currentSearchMethod === 'basic') {
123
125
  fireEvent('ui.form.submitted.basicSearch', {});
124
126
  } else if (currentSearchMethod === 'jql') {
125
- fireEvent('ui.jqlEditor.searched', {});
126
- var isCurrentQueryComplex = isQueryTooComplex(jql);
127
+ fireEvent('ui.jqlEditor.searched', {
128
+ isQueryComplex: isCurrentQueryComplex
129
+ });
127
130
  setIsComplexQuery(isCurrentQueryComplex);
128
131
  if (showBasicFilters && !isCurrentQueryComplex) {
129
132
  fetchHydratedJqlOptions();
@@ -138,11 +141,13 @@ export var JiraSearchContainer = function JiraSearchContainer(props) {
138
141
  orderKey: orderKey
139
142
  });
140
143
  setJql(jqlWithFilterValues);
144
+ var isCurrentQueryComplex = isQueryTooComplex(jqlWithFilterValues);
141
145
  onSearch({
142
146
  jql: jqlWithFilterValues
143
147
  }, {
144
148
  searchMethod: currentSearchMethod,
145
- basicFilterSelections: filterSelections
149
+ basicFilterSelections: filterSelections,
150
+ isQueryComplex: isCurrentQueryComplex
146
151
  });
147
152
  }, SEARCH_DEBOUNCE_MS),
148
153
  _useDebouncedCallback2 = _slicedToArray(_useDebouncedCallback, 1),
@@ -162,6 +167,9 @@ export var JiraSearchContainer = function JiraSearchContainer(props) {
162
167
  useEffect(function () {
163
168
  if (basicFilterHydrationStatus === 'resolved') {
164
169
  setFilterSelections(hydratedOptions);
170
+ if (hydratedOptions.basicInputTextValue) {
171
+ setBasicSearchTerm(hydratedOptions.basicInputTextValue);
172
+ }
165
173
  }
166
174
  }, [hydratedOptions, basicFilterHydrationStatus]);
167
175
  var handleSelectionChange = useCallback(function (filterType, options) {
@@ -133,6 +133,7 @@ export var PlainJiraIssuesConfigModal = function PlainJiraIssuesConfigModal(prop
133
133
  var searchMethodSearchedWith = useRef(null);
134
134
  var visibleColumnCount = useRef((visibleColumnKeys === null || visibleColumnKeys === void 0 ? void 0 : visibleColumnKeys.length) || 0);
135
135
  var basicFilterSelectionsSearchedWith = useRef({});
136
+ var isSearchedWithComplexQuery = useRef(false);
136
137
  var parameters = useMemo(function () {
137
138
  return !!cloudId ? {
138
139
  cloudId: cloudId,
@@ -299,10 +300,12 @@ export var PlainJiraIssuesConfigModal = function PlainJiraIssuesConfigModal(prop
299
300
  useColumnPickerRenderedFailedUfoExperience(status, modalRenderInstanceId);
300
301
  var onSearch = useCallback(function (newParameters, _ref2) {
301
302
  var searchMethod = _ref2.searchMethod,
302
- basicFilterSelections = _ref2.basicFilterSelections;
303
+ basicFilterSelections = _ref2.basicFilterSelections,
304
+ isQueryComplex = _ref2.isQueryComplex;
303
305
  searchCount.current++;
304
306
  searchMethodSearchedWith.current = searchMethod;
305
307
  basicFilterSelectionsSearchedWith.current = basicFilterSelections;
308
+ isSearchedWithComplexQuery.current = isQueryComplex;
306
309
  if (jql !== newParameters.jql) {
307
310
  userInteractionActions.current.add(DatasourceAction.QUERY_UPDATED);
308
311
  }
@@ -353,7 +356,8 @@ export var PlainJiraIssuesConfigModal = function PlainJiraIssuesConfigModal(prop
353
356
  display: getDisplayValue(currentViewMode, totalCount || 0),
354
357
  searchCount: searchCount.current,
355
358
  searchMethod: mapSearchMethod(searchMethodSearchedWith.current),
356
- actions: Array.from(userInteractionActions.current)
359
+ actions: Array.from(userInteractionActions.current),
360
+ isQueryComplex: isSearchedWithComplexQuery.current
357
361
  }, searchMethodSearchedWith.current === 'basic' ? _objectSpread({}, filterSelectionCount) : {}),
358
362
  eventType: 'ui'
359
363
  });
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * Generates Typescript types for analytics events from analytics.spec.yaml
5
5
  *
6
- * @codegen <<SignedSource::650bd05729c6d9d8eb143f643a8c34c2>>
6
+ * @codegen <<SignedSource::32dd97482f811937fcb07590b84179dd>>
7
7
  * @codegenCommand yarn workspace @atlassian/analytics-tooling run analytics:codegen link-datasource
8
8
  */
9
9
  export type PackageMetaDataType = {
@@ -21,7 +21,9 @@ export type ModalReadyDatasourceAttributesType = {
21
21
  instancesCount: number | null;
22
22
  schemasCount: number | null;
23
23
  };
24
- export type JqlEditorSearchedAttributesType = {};
24
+ export type JqlEditorSearchedAttributesType = {
25
+ isQueryComplex: boolean;
26
+ };
25
27
  export type FormSubmittedBasicSearchAttributesType = {};
26
28
  export type EmptyResultShownDatasourceAttributesType = {};
27
29
  export type ErrorShownAttributesType = {
@@ -40,6 +42,7 @@ export type ButtonClickedInsertAttributesType = {
40
42
  searchMethod: 'datasource_search_query' | 'datasource_basic_filter' | 'datasource_saved_filter' | null;
41
43
  extensionKey: string | null;
42
44
  actions: unknown[];
45
+ isQueryComplex: boolean;
43
46
  };
44
47
  export type ButtonClickedCancelAttributesType = {
45
48
  searchCount: number;
@@ -1,6 +1,8 @@
1
1
  import { SelectedOptionsMap } from '../types';
2
2
  export interface HydrateJqlState {
3
- hydratedOptions: SelectedOptionsMap;
3
+ hydratedOptions: SelectedOptionsMap & {
4
+ basicInputTextValue?: string;
5
+ };
4
6
  fetchHydratedJqlOptions: () => Promise<void>;
5
7
  status: 'empty' | 'loading' | 'resolved' | 'rejected';
6
8
  errors: unknown[];
@@ -0,0 +1,4 @@
1
+ export type ResultMap = {
2
+ [k: string]: string[];
3
+ };
4
+ export declare const extractValuesFromNonComplexJQL: (jql: string) => ResultMap;
@@ -1,2 +1,3 @@
1
1
  import { Clause } from '@atlaskit/jql-ast';
2
+ export declare const removeFuzzyCharacter: (value?: string) => string | undefined;
2
3
  export declare const isClauseTooComplex: (clauses: Clause[], key: string) => boolean;
@@ -8,6 +8,7 @@ export interface SearchContainerProps {
8
8
  onSearch: (query: JiraIssueDatasourceParametersQuery, { searchMethod, basicFilterSelections, }: {
9
9
  searchMethod: JiraSearchMethod;
10
10
  basicFilterSelections: SelectedOptionsMap;
11
+ isQueryComplex: boolean;
11
12
  }) => void;
12
13
  initialSearchMethod: JiraSearchMethod;
13
14
  onSearchMethodChange: (searchMethod: JiraSearchMethod) => void;
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * Generates Typescript types for analytics events from analytics.spec.yaml
5
5
  *
6
- * @codegen <<SignedSource::650bd05729c6d9d8eb143f643a8c34c2>>
6
+ * @codegen <<SignedSource::32dd97482f811937fcb07590b84179dd>>
7
7
  * @codegenCommand yarn workspace @atlassian/analytics-tooling run analytics:codegen link-datasource
8
8
  */
9
9
  export type PackageMetaDataType = {
@@ -21,7 +21,9 @@ export type ModalReadyDatasourceAttributesType = {
21
21
  instancesCount: number | null;
22
22
  schemasCount: number | null;
23
23
  };
24
- export type JqlEditorSearchedAttributesType = {};
24
+ export type JqlEditorSearchedAttributesType = {
25
+ isQueryComplex: boolean;
26
+ };
25
27
  export type FormSubmittedBasicSearchAttributesType = {};
26
28
  export type EmptyResultShownDatasourceAttributesType = {};
27
29
  export type ErrorShownAttributesType = {
@@ -40,6 +42,7 @@ export type ButtonClickedInsertAttributesType = {
40
42
  searchMethod: 'datasource_search_query' | 'datasource_basic_filter' | 'datasource_saved_filter' | null;
41
43
  extensionKey: string | null;
42
44
  actions: unknown[];
45
+ isQueryComplex: boolean;
43
46
  };
44
47
  export type ButtonClickedCancelAttributesType = {
45
48
  searchCount: number;
@@ -1,6 +1,8 @@
1
1
  import { SelectedOptionsMap } from '../types';
2
2
  export interface HydrateJqlState {
3
- hydratedOptions: SelectedOptionsMap;
3
+ hydratedOptions: SelectedOptionsMap & {
4
+ basicInputTextValue?: string;
5
+ };
4
6
  fetchHydratedJqlOptions: () => Promise<void>;
5
7
  status: 'empty' | 'loading' | 'resolved' | 'rejected';
6
8
  errors: unknown[];
@@ -0,0 +1,4 @@
1
+ export type ResultMap = {
2
+ [k: string]: string[];
3
+ };
4
+ export declare const extractValuesFromNonComplexJQL: (jql: string) => ResultMap;
@@ -1,2 +1,3 @@
1
1
  import { Clause } from '@atlaskit/jql-ast';
2
+ export declare const removeFuzzyCharacter: (value?: string) => string | undefined;
2
3
  export declare const isClauseTooComplex: (clauses: Clause[], key: string) => boolean;
@@ -8,6 +8,7 @@ export interface SearchContainerProps {
8
8
  onSearch: (query: JiraIssueDatasourceParametersQuery, { searchMethod, basicFilterSelections, }: {
9
9
  searchMethod: JiraSearchMethod;
10
10
  basicFilterSelections: SelectedOptionsMap;
11
+ isQueryComplex: boolean;
11
12
  }) => void;
12
13
  initialSearchMethod: JiraSearchMethod;
13
14
  onSearchMethodChange: (searchMethod: JiraSearchMethod) => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/link-datasource",
3
- "version": "1.19.2",
3
+ "version": "1.19.4",
4
4
  "description": "UI Components to support linking platform dataset feature",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -46,10 +46,10 @@
46
46
  "@atlaskit/jql-ast": "^3.0.0",
47
47
  "@atlaskit/jql-editor-autocomplete-rest": "^2.0.0",
48
48
  "@atlaskit/link-client-extension": "^1.8.0",
49
- "@atlaskit/linking-common": "^4.20.0",
49
+ "@atlaskit/linking-common": "^4.21.0",
50
50
  "@atlaskit/linking-types": "^8.5.0",
51
51
  "@atlaskit/lozenge": "^11.4.0",
52
- "@atlaskit/modal-dialog": "^12.8.0",
52
+ "@atlaskit/modal-dialog": "^12.9.0",
53
53
  "@atlaskit/platform-feature-flags": "^0.2.4",
54
54
  "@atlaskit/pragmatic-drag-and-drop": "^0.24.0",
55
55
  "@atlaskit/pragmatic-drag-and-drop-hitbox": "^0.12.0",