@atlaskit/link-datasource 1.19.4 → 1.19.6
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 +12 -0
- package/dist/cjs/analytics/constants.js +1 -1
- package/dist/cjs/ui/issue-like-table/draggable-table-heading.js +2 -2
- package/dist/cjs/ui/issue-like-table/index.js +2 -2
- package/dist/cjs/ui/jira-issues-modal/basic-filters/hooks/useHydrateJqlQuery.js +2 -2
- package/dist/cjs/ui/jira-issues-modal/basic-filters/utils/transformers.js +8 -0
- package/dist/cjs/ui/jira-issues-modal/jira-search-container/buildJQL.js +16 -7
- package/dist/cjs/ui/jira-issues-modal/jira-search-container/index.js +9 -4
- package/dist/es2019/analytics/constants.js +1 -1
- package/dist/es2019/ui/issue-like-table/draggable-table-heading.js +2 -2
- package/dist/es2019/ui/issue-like-table/index.js +2 -2
- package/dist/es2019/ui/jira-issues-modal/basic-filters/hooks/useHydrateJqlQuery.js +3 -1
- package/dist/es2019/ui/jira-issues-modal/basic-filters/utils/transformers.js +8 -0
- package/dist/es2019/ui/jira-issues-modal/jira-search-container/buildJQL.js +8 -3
- package/dist/es2019/ui/jira-issues-modal/jira-search-container/index.js +7 -3
- package/dist/esm/analytics/constants.js +1 -1
- package/dist/esm/ui/issue-like-table/draggable-table-heading.js +2 -2
- package/dist/esm/ui/issue-like-table/index.js +2 -2
- package/dist/esm/ui/jira-issues-modal/basic-filters/hooks/useHydrateJqlQuery.js +2 -2
- package/dist/esm/ui/jira-issues-modal/basic-filters/utils/transformers.js +8 -0
- package/dist/esm/ui/jira-issues-modal/jira-search-container/buildJQL.js +16 -7
- package/dist/esm/ui/jira-issues-modal/jira-search-container/index.js +7 -3
- package/package.json +1 -1
- package/tmp/api-report-tmp.d.ts +0 -157
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @atlaskit/link-datasource
|
|
2
2
|
|
|
3
|
+
## 1.19.6
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#56508](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/56508) [`39157c94842a`](https://bitbucket.org/atlassian/atlassian-frontend/commits/39157c94842a) - Fix a bug in mapHydrateResponseData which include all fields from hydrate response
|
|
8
|
+
|
|
9
|
+
## 1.19.5
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [#43878](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/43878) [`0eaf28a90c3`](https://bitbucket.org/atlassian/atlassian-frontend/commits/0eaf28a90c3) - Fix an issue where undefined value for basicInputTextValue was breaking build JQL logic.
|
|
14
|
+
|
|
3
15
|
## 1.19.4
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
|
@@ -11,14 +11,14 @@ var _react = require("react");
|
|
|
11
11
|
var _react2 = require("@emotion/react");
|
|
12
12
|
var _reactDom = _interopRequireDefault(require("react-dom"));
|
|
13
13
|
var _tinyInvariant = _interopRequireDefault(require("tiny-invariant"));
|
|
14
|
+
var _closestEdge = require("@atlaskit/pragmatic-drag-and-drop-hitbox/addon/closest-edge");
|
|
15
|
+
var _boxWithoutTerminal = require("@atlaskit/pragmatic-drag-and-drop-react-indicator/box-without-terminal");
|
|
14
16
|
var _element = require("@atlaskit/pragmatic-drag-and-drop/adapter/element");
|
|
15
17
|
var _cancelUnhandled = require("@atlaskit/pragmatic-drag-and-drop/addon/cancel-unhandled");
|
|
16
18
|
var _combine = require("@atlaskit/pragmatic-drag-and-drop/util/combine");
|
|
17
19
|
var _disableNativeDragPreview = require("@atlaskit/pragmatic-drag-and-drop/util/disable-native-drag-preview");
|
|
18
20
|
var _offsetFromPointer = require("@atlaskit/pragmatic-drag-and-drop/util/offset-from-pointer");
|
|
19
21
|
var _setCustomNativeDragPreview = require("@atlaskit/pragmatic-drag-and-drop/util/set-custom-native-drag-preview");
|
|
20
|
-
var _closestEdge = require("@atlaskit/pragmatic-drag-and-drop-hitbox/addon/closest-edge");
|
|
21
|
-
var _boxWithoutTerminal = require("@atlaskit/pragmatic-drag-and-drop-react-indicator/box-without-terminal");
|
|
22
22
|
var _styled = require("./styled");
|
|
23
23
|
var _index = require("./index");
|
|
24
24
|
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; }
|
|
@@ -17,11 +17,11 @@ var _styled = _interopRequireDefault(require("@emotion/styled"));
|
|
|
17
17
|
var _tinyInvariant = _interopRequireDefault(require("tiny-invariant"));
|
|
18
18
|
var _heading = _interopRequireDefault(require("@atlaskit/heading"));
|
|
19
19
|
var _linkingCommon = require("@atlaskit/linking-common");
|
|
20
|
-
var _element = require("@atlaskit/pragmatic-drag-and-drop/adapter/element");
|
|
21
|
-
var _combine = require("@atlaskit/pragmatic-drag-and-drop/util/combine");
|
|
22
20
|
var _closestEdge = require("@atlaskit/pragmatic-drag-and-drop-hitbox/addon/closest-edge");
|
|
23
21
|
var _reorderWithEdge = require("@atlaskit/pragmatic-drag-and-drop-hitbox/util/reorder-with-edge");
|
|
24
22
|
var _pragmaticDragAndDropReactBeautifulDndAutoscroll = require("@atlaskit/pragmatic-drag-and-drop-react-beautiful-dnd-autoscroll");
|
|
23
|
+
var _element = require("@atlaskit/pragmatic-drag-and-drop/adapter/element");
|
|
24
|
+
var _combine = require("@atlaskit/pragmatic-drag-and-drop/util/combine");
|
|
25
25
|
var _colors = require("@atlaskit/theme/colors");
|
|
26
26
|
var _tooltip = _interopRequireDefault(require("@atlaskit/tooltip"));
|
|
27
27
|
var _ufoExperiences = require("../../analytics/ufoExperiences");
|
|
@@ -55,9 +55,9 @@ var useHydrateJqlQuery = exports.useHydrateJqlQuery = function useHydrateJqlQuer
|
|
|
55
55
|
*/
|
|
56
56
|
_extractValuesFromNon = (0, _extractValuesFromNonComplexJQL.extractValuesFromNonComplexJQL)(jql), text = _extractValuesFromNon.text, summary = _extractValuesFromNon.summary, key = _extractValuesFromNon.key;
|
|
57
57
|
_ref2 = text || summary || key || [], _ref3 = (0, _slicedToArray2.default)(_ref2, 1), textFieldValue = _ref3[0];
|
|
58
|
-
mappedValues = _objectSpread(_objectSpread({}, (0, _transformers.mapHydrateResponseData)(response)),
|
|
58
|
+
mappedValues = _objectSpread(_objectSpread({}, (0, _transformers.mapHydrateResponseData)(response)), textFieldValue ? {
|
|
59
59
|
basicInputTextValue: (0, _isClauseTooComplex.removeFuzzyCharacter)(textFieldValue)
|
|
60
|
-
});
|
|
60
|
+
} : {});
|
|
61
61
|
setHydratedOptions(mappedValues);
|
|
62
62
|
setStatus('resolved');
|
|
63
63
|
_context.next = 20;
|
|
@@ -10,6 +10,7 @@ exports.mapFieldValuesToTotalCount = mapFieldValuesToTotalCount;
|
|
|
10
10
|
exports.mapHydrateResponseData = mapHydrateResponseData;
|
|
11
11
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
12
12
|
var _types = require("../types");
|
|
13
|
+
var _ui = require("../ui");
|
|
13
14
|
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; }
|
|
14
15
|
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; }
|
|
15
16
|
function isNonNullSelectOption(edge) {
|
|
@@ -84,6 +85,13 @@ function mapHydrateResponseData(_ref2) {
|
|
|
84
85
|
var jqlTerm = _ref3.jqlTerm,
|
|
85
86
|
_ref3$values = _ref3.values,
|
|
86
87
|
values = _ref3$values === void 0 ? [] : _ref3$values;
|
|
88
|
+
/**
|
|
89
|
+
* Currently, we expect to hydrate only the 4 filter fields that we use.
|
|
90
|
+
* Hence we check if jqlTerm is one of the values in availableBasicFilterTypes
|
|
91
|
+
*/
|
|
92
|
+
if (!_ui.availableBasicFilterTypes.includes(jqlTerm)) {
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
87
95
|
var options = values.map(function (_ref4) {
|
|
88
96
|
var values = _ref4.values;
|
|
89
97
|
return values && values[0] ? mapNodeToOption(values[0]) : null;
|
|
@@ -7,6 +7,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.fuzzyCharacter = exports.buildJQL = void 0;
|
|
8
8
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
9
9
|
var _jqlAst = require("@atlaskit/jql-ast");
|
|
10
|
+
var _ui = require("../basic-filters/ui");
|
|
10
11
|
var fuzzySearchRegExp = /^"(.+)"$/;
|
|
11
12
|
var jiraIssueKeyRegExp = /[A-Z]+-\d+/;
|
|
12
13
|
var fuzzyCharacter = exports.fuzzyCharacter = '*';
|
|
@@ -27,7 +28,15 @@ var buildJQL = exports.buildJQL = function buildJQL(input) {
|
|
|
27
28
|
orderKey = _input$orderKey === void 0 ? 'created' : _input$orderKey,
|
|
28
29
|
filterValues = input.filterValues;
|
|
29
30
|
var trimmedRawSearch = rawSearch.trim();
|
|
30
|
-
var
|
|
31
|
+
var hasValidFilterSelectionAndValues = filterValues &&
|
|
32
|
+
// checks if filterValues have only valid keys
|
|
33
|
+
Object.entries(filterValues).every(function (_ref) {
|
|
34
|
+
var _ref2 = (0, _slicedToArray2.default)(_ref, 1),
|
|
35
|
+
key = _ref2[0];
|
|
36
|
+
return _ui.availableBasicFilterTypes.includes(key);
|
|
37
|
+
}) &&
|
|
38
|
+
// checks if atleast one fitler value has some selection object
|
|
39
|
+
Object.values(filterValues).some(function (value) {
|
|
31
40
|
return value.length > 0;
|
|
32
41
|
});
|
|
33
42
|
if (!query) {
|
|
@@ -46,11 +55,11 @@ var buildJQL = exports.buildJQL = function buildJQL(input) {
|
|
|
46
55
|
var orClause = _jqlAst.creators.compoundClause(_jqlAst.creators.compoundOperator(_jqlAst.COMPOUND_OPERATOR_OR), orClauseFields);
|
|
47
56
|
query.appendClause(orClause, _jqlAst.COMPOUND_OPERATOR_AND);
|
|
48
57
|
}
|
|
49
|
-
if (
|
|
50
|
-
Object.entries(filterValues).forEach(function (
|
|
51
|
-
var
|
|
52
|
-
key =
|
|
53
|
-
filterFieldValues =
|
|
58
|
+
if (hasValidFilterSelectionAndValues) {
|
|
59
|
+
Object.entries(filterValues).forEach(function (_ref3) {
|
|
60
|
+
var _ref4 = (0, _slicedToArray2.default)(_ref3, 2),
|
|
61
|
+
key = _ref4[0],
|
|
62
|
+
filterFieldValues = _ref4[1];
|
|
54
63
|
if (filterFieldValues.length === 0) {
|
|
55
64
|
return;
|
|
56
65
|
}
|
|
@@ -60,7 +69,7 @@ var buildJQL = exports.buildJQL = function buildJQL(input) {
|
|
|
60
69
|
query.appendClause(filterInClause, _jqlAst.COMPOUND_OPERATOR_AND);
|
|
61
70
|
});
|
|
62
71
|
}
|
|
63
|
-
if (!trimmedRawSearch && !
|
|
72
|
+
if (!trimmedRawSearch && !hasValidFilterSelectionAndValues) {
|
|
64
73
|
var created = constructTerminalClause('created', _jqlAst.OPERATOR_GT_EQUALS, '-30d');
|
|
65
74
|
query.appendClause(created, _jqlAst.COMPOUND_OPERATOR_AND);
|
|
66
75
|
}
|
|
@@ -7,6 +7,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
});
|
|
8
8
|
exports.JiraSearchContainer = exports.ALLOWED_ORDER_BY_KEYS = void 0;
|
|
9
9
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
10
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
10
11
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
11
12
|
var _react = _interopRequireWildcard(require("react"));
|
|
12
13
|
var _react2 = require("@emotion/react");
|
|
@@ -24,10 +25,12 @@ var _jqlEditor = require("../jql-editor");
|
|
|
24
25
|
var _modeSwitcher = require("../mode-switcher");
|
|
25
26
|
var _buildJQL = require("./buildJQL");
|
|
26
27
|
var _messages = require("./messages");
|
|
28
|
+
var _excluded = ["basicInputTextValue"];
|
|
29
|
+
/** @jsx jsx */
|
|
27
30
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
28
31
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
29
32
|
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; }
|
|
30
|
-
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; }
|
|
33
|
+
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; }
|
|
31
34
|
var inputContainerStyles = (0, _react2.css)({
|
|
32
35
|
alignItems: 'baseline',
|
|
33
36
|
display: 'flex',
|
|
@@ -175,9 +178,11 @@ var JiraSearchContainer = exports.JiraSearchContainer = function JiraSearchConta
|
|
|
175
178
|
}, []);
|
|
176
179
|
(0, _react.useEffect)(function () {
|
|
177
180
|
if (basicFilterHydrationStatus === 'resolved') {
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
+
var basicInputTextValue = hydratedOptions.basicInputTextValue,
|
|
182
|
+
hydratedFilterOptions = (0, _objectWithoutProperties2.default)(hydratedOptions, _excluded);
|
|
183
|
+
setFilterSelections(hydratedFilterOptions);
|
|
184
|
+
if (basicInputTextValue) {
|
|
185
|
+
setBasicSearchTerm(basicInputTextValue);
|
|
181
186
|
}
|
|
182
187
|
}
|
|
183
188
|
}, [hydratedOptions, basicFilterHydrationStatus]);
|
|
@@ -3,14 +3,14 @@ import { useEffect, useRef, useState } from 'react';
|
|
|
3
3
|
import { css, jsx } from '@emotion/react';
|
|
4
4
|
import ReactDOM from 'react-dom';
|
|
5
5
|
import invariant from 'tiny-invariant';
|
|
6
|
+
import { attachClosestEdge, extractClosestEdge } from '@atlaskit/pragmatic-drag-and-drop-hitbox/addon/closest-edge';
|
|
7
|
+
import { DropIndicator } from '@atlaskit/pragmatic-drag-and-drop-react-indicator/box-without-terminal';
|
|
6
8
|
import { draggable, dropTargetForElements, monitorForElements } from '@atlaskit/pragmatic-drag-and-drop/adapter/element';
|
|
7
9
|
import { cancelUnhandled } from '@atlaskit/pragmatic-drag-and-drop/addon/cancel-unhandled';
|
|
8
10
|
import { combine } from '@atlaskit/pragmatic-drag-and-drop/util/combine';
|
|
9
11
|
import { disableNativeDragPreview } from '@atlaskit/pragmatic-drag-and-drop/util/disable-native-drag-preview';
|
|
10
12
|
import { offsetFromPointer } from '@atlaskit/pragmatic-drag-and-drop/util/offset-from-pointer';
|
|
11
13
|
import { setCustomNativeDragPreview } from '@atlaskit/pragmatic-drag-and-drop/util/set-custom-native-drag-preview';
|
|
12
|
-
import { attachClosestEdge, extractClosestEdge } from '@atlaskit/pragmatic-drag-and-drop-hitbox/addon/closest-edge';
|
|
13
|
-
import { DropIndicator } from '@atlaskit/pragmatic-drag-and-drop-react-indicator/box-without-terminal';
|
|
14
14
|
import { TableHeading } from './styled';
|
|
15
15
|
import { COLUMN_MIN_WIDTH } from './index';
|
|
16
16
|
const verticallyAlignedStyles = css({
|
|
@@ -5,11 +5,11 @@ import styled from '@emotion/styled';
|
|
|
5
5
|
import invariant from 'tiny-invariant';
|
|
6
6
|
import Heading from '@atlaskit/heading';
|
|
7
7
|
import { Skeleton } from '@atlaskit/linking-common';
|
|
8
|
-
import { monitorForElements } from '@atlaskit/pragmatic-drag-and-drop/adapter/element';
|
|
9
|
-
import { combine } from '@atlaskit/pragmatic-drag-and-drop/util/combine';
|
|
10
8
|
import { extractClosestEdge } from '@atlaskit/pragmatic-drag-and-drop-hitbox/addon/closest-edge';
|
|
11
9
|
import { reorderWithEdge } from '@atlaskit/pragmatic-drag-and-drop-hitbox/util/reorder-with-edge';
|
|
12
10
|
import { autoScroller } from '@atlaskit/pragmatic-drag-and-drop-react-beautiful-dnd-autoscroll';
|
|
11
|
+
import { monitorForElements } from '@atlaskit/pragmatic-drag-and-drop/adapter/element';
|
|
12
|
+
import { combine } from '@atlaskit/pragmatic-drag-and-drop/util/combine';
|
|
13
13
|
import { N40 } from '@atlaskit/theme/colors';
|
|
14
14
|
import Tooltip from '@atlaskit/tooltip';
|
|
15
15
|
import { startUfoExperience, succeedUfoExperience } from '../../analytics/ufoExperiences';
|
|
@@ -31,7 +31,9 @@ export const useHydrateJqlQuery = (cloudId, jql) => {
|
|
|
31
31
|
const [textFieldValue] = text || summary || key || [];
|
|
32
32
|
const mappedValues = {
|
|
33
33
|
...mapHydrateResponseData(response),
|
|
34
|
-
|
|
34
|
+
...(textFieldValue ? {
|
|
35
|
+
basicInputTextValue: removeFuzzyCharacter(textFieldValue)
|
|
36
|
+
} : {})
|
|
35
37
|
};
|
|
36
38
|
setHydratedOptions(mappedValues);
|
|
37
39
|
setStatus('resolved');
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { appearanceMap } from '../types';
|
|
2
|
+
import { availableBasicFilterTypes } from '../ui';
|
|
2
3
|
function isNonNullSelectOption(edge) {
|
|
3
4
|
return edge !== null;
|
|
4
5
|
}
|
|
@@ -78,6 +79,13 @@ export function mapHydrateResponseData({
|
|
|
78
79
|
jqlTerm,
|
|
79
80
|
values = []
|
|
80
81
|
}) => {
|
|
82
|
+
/**
|
|
83
|
+
* Currently, we expect to hydrate only the 4 filter fields that we use.
|
|
84
|
+
* Hence we check if jqlTerm is one of the values in availableBasicFilterTypes
|
|
85
|
+
*/
|
|
86
|
+
if (!availableBasicFilterTypes.includes(jqlTerm)) {
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
81
89
|
const options = values.map(({
|
|
82
90
|
values
|
|
83
91
|
}) => values && values[0] ? mapNodeToOption(values[0]) : null).filter(isNonNullSelectOption) || [];
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { COMPOUND_OPERATOR_AND, COMPOUND_OPERATOR_OR, creators, JastBuilder, OPERATOR_EQUALS, OPERATOR_GT_EQUALS, OPERATOR_IN, OPERATOR_LIKE, ORDER_BY_DIRECTION_ASC, ORDER_BY_DIRECTION_DESC, print } from '@atlaskit/jql-ast';
|
|
2
|
+
import { availableBasicFilterTypes } from '../basic-filters/ui';
|
|
2
3
|
const fuzzySearchRegExp = /^"(.+)"$/;
|
|
3
4
|
const jiraIssueKeyRegExp = /[A-Z]+-\d+/;
|
|
4
5
|
export const fuzzyCharacter = '*';
|
|
@@ -19,7 +20,11 @@ export const buildJQL = input => {
|
|
|
19
20
|
filterValues
|
|
20
21
|
} = input;
|
|
21
22
|
const trimmedRawSearch = rawSearch.trim();
|
|
22
|
-
const
|
|
23
|
+
const hasValidFilterSelectionAndValues = filterValues &&
|
|
24
|
+
// checks if filterValues have only valid keys
|
|
25
|
+
Object.entries(filterValues).every(([key]) => availableBasicFilterTypes.includes(key)) &&
|
|
26
|
+
// checks if atleast one fitler value has some selection object
|
|
27
|
+
Object.values(filterValues).some(value => value.length > 0);
|
|
23
28
|
if (!query) {
|
|
24
29
|
return '';
|
|
25
30
|
}
|
|
@@ -36,7 +41,7 @@ export const buildJQL = input => {
|
|
|
36
41
|
const orClause = creators.compoundClause(creators.compoundOperator(COMPOUND_OPERATOR_OR), orClauseFields);
|
|
37
42
|
query.appendClause(orClause, COMPOUND_OPERATOR_AND);
|
|
38
43
|
}
|
|
39
|
-
if (
|
|
44
|
+
if (hasValidFilterSelectionAndValues) {
|
|
40
45
|
Object.entries(filterValues).forEach(([key, filterFieldValues]) => {
|
|
41
46
|
if (filterFieldValues.length === 0) {
|
|
42
47
|
return;
|
|
@@ -45,7 +50,7 @@ export const buildJQL = input => {
|
|
|
45
50
|
query.appendClause(filterInClause, COMPOUND_OPERATOR_AND);
|
|
46
51
|
});
|
|
47
52
|
}
|
|
48
|
-
if (!trimmedRawSearch && !
|
|
53
|
+
if (!trimmedRawSearch && !hasValidFilterSelectionAndValues) {
|
|
49
54
|
const created = constructTerminalClause('created', OPERATOR_GT_EQUALS, '-30d');
|
|
50
55
|
query.appendClause(created, COMPOUND_OPERATOR_AND);
|
|
51
56
|
}
|
|
@@ -143,9 +143,13 @@ export const JiraSearchContainer = props => {
|
|
|
143
143
|
}, []);
|
|
144
144
|
useEffect(() => {
|
|
145
145
|
if (basicFilterHydrationStatus === 'resolved') {
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
146
|
+
const {
|
|
147
|
+
basicInputTextValue,
|
|
148
|
+
...hydratedFilterOptions
|
|
149
|
+
} = hydratedOptions;
|
|
150
|
+
setFilterSelections(hydratedFilterOptions);
|
|
151
|
+
if (basicInputTextValue) {
|
|
152
|
+
setBasicSearchTerm(basicInputTextValue);
|
|
149
153
|
}
|
|
150
154
|
}
|
|
151
155
|
}, [hydratedOptions, basicFilterHydrationStatus]);
|
|
@@ -7,14 +7,14 @@ import { useEffect, useRef, useState } from 'react';
|
|
|
7
7
|
import { css, jsx } from '@emotion/react';
|
|
8
8
|
import ReactDOM from 'react-dom';
|
|
9
9
|
import invariant from 'tiny-invariant';
|
|
10
|
+
import { attachClosestEdge, extractClosestEdge } from '@atlaskit/pragmatic-drag-and-drop-hitbox/addon/closest-edge';
|
|
11
|
+
import { DropIndicator } from '@atlaskit/pragmatic-drag-and-drop-react-indicator/box-without-terminal';
|
|
10
12
|
import { draggable, dropTargetForElements, monitorForElements } from '@atlaskit/pragmatic-drag-and-drop/adapter/element';
|
|
11
13
|
import { cancelUnhandled } from '@atlaskit/pragmatic-drag-and-drop/addon/cancel-unhandled';
|
|
12
14
|
import { combine } from '@atlaskit/pragmatic-drag-and-drop/util/combine';
|
|
13
15
|
import { disableNativeDragPreview } from '@atlaskit/pragmatic-drag-and-drop/util/disable-native-drag-preview';
|
|
14
16
|
import { offsetFromPointer } from '@atlaskit/pragmatic-drag-and-drop/util/offset-from-pointer';
|
|
15
17
|
import { setCustomNativeDragPreview } from '@atlaskit/pragmatic-drag-and-drop/util/set-custom-native-drag-preview';
|
|
16
|
-
import { attachClosestEdge, extractClosestEdge } from '@atlaskit/pragmatic-drag-and-drop-hitbox/addon/closest-edge';
|
|
17
|
-
import { DropIndicator } from '@atlaskit/pragmatic-drag-and-drop-react-indicator/box-without-terminal';
|
|
18
18
|
import { TableHeading } from './styled';
|
|
19
19
|
import { COLUMN_MIN_WIDTH } from './index';
|
|
20
20
|
var verticallyAlignedStyles = css({
|
|
@@ -14,11 +14,11 @@ import styled from '@emotion/styled';
|
|
|
14
14
|
import invariant from 'tiny-invariant';
|
|
15
15
|
import Heading from '@atlaskit/heading';
|
|
16
16
|
import { Skeleton } from '@atlaskit/linking-common';
|
|
17
|
-
import { monitorForElements } from '@atlaskit/pragmatic-drag-and-drop/adapter/element';
|
|
18
|
-
import { combine } from '@atlaskit/pragmatic-drag-and-drop/util/combine';
|
|
19
17
|
import { extractClosestEdge } from '@atlaskit/pragmatic-drag-and-drop-hitbox/addon/closest-edge';
|
|
20
18
|
import { reorderWithEdge } from '@atlaskit/pragmatic-drag-and-drop-hitbox/util/reorder-with-edge';
|
|
21
19
|
import { autoScroller } from '@atlaskit/pragmatic-drag-and-drop-react-beautiful-dnd-autoscroll';
|
|
20
|
+
import { monitorForElements } from '@atlaskit/pragmatic-drag-and-drop/adapter/element';
|
|
21
|
+
import { combine } from '@atlaskit/pragmatic-drag-and-drop/util/combine';
|
|
22
22
|
import { N40 } from '@atlaskit/theme/colors';
|
|
23
23
|
import Tooltip from '@atlaskit/tooltip';
|
|
24
24
|
import { startUfoExperience, succeedUfoExperience } from '../../analytics/ufoExperiences';
|
|
@@ -48,9 +48,9 @@ export var useHydrateJqlQuery = function useHydrateJqlQuery(cloudId, jql) {
|
|
|
48
48
|
*/
|
|
49
49
|
_extractValuesFromNon = extractValuesFromNonComplexJQL(jql), text = _extractValuesFromNon.text, summary = _extractValuesFromNon.summary, key = _extractValuesFromNon.key;
|
|
50
50
|
_ref2 = text || summary || key || [], _ref3 = _slicedToArray(_ref2, 1), textFieldValue = _ref3[0];
|
|
51
|
-
mappedValues = _objectSpread(_objectSpread({}, mapHydrateResponseData(response)),
|
|
51
|
+
mappedValues = _objectSpread(_objectSpread({}, mapHydrateResponseData(response)), textFieldValue ? {
|
|
52
52
|
basicInputTextValue: removeFuzzyCharacter(textFieldValue)
|
|
53
|
-
});
|
|
53
|
+
} : {});
|
|
54
54
|
setHydratedOptions(mappedValues);
|
|
55
55
|
setStatus('resolved');
|
|
56
56
|
_context.next = 20;
|
|
@@ -2,6 +2,7 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
2
2
|
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; }
|
|
3
3
|
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
4
|
import { appearanceMap } from '../types';
|
|
5
|
+
import { availableBasicFilterTypes } from '../ui';
|
|
5
6
|
function isNonNullSelectOption(edge) {
|
|
6
7
|
return edge !== null;
|
|
7
8
|
}
|
|
@@ -74,6 +75,13 @@ export function mapHydrateResponseData(_ref2) {
|
|
|
74
75
|
var jqlTerm = _ref3.jqlTerm,
|
|
75
76
|
_ref3$values = _ref3.values,
|
|
76
77
|
values = _ref3$values === void 0 ? [] : _ref3$values;
|
|
78
|
+
/**
|
|
79
|
+
* Currently, we expect to hydrate only the 4 filter fields that we use.
|
|
80
|
+
* Hence we check if jqlTerm is one of the values in availableBasicFilterTypes
|
|
81
|
+
*/
|
|
82
|
+
if (!availableBasicFilterTypes.includes(jqlTerm)) {
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
77
85
|
var options = values.map(function (_ref4) {
|
|
78
86
|
var values = _ref4.values;
|
|
79
87
|
return values && values[0] ? mapNodeToOption(values[0]) : null;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
2
|
import { COMPOUND_OPERATOR_AND, COMPOUND_OPERATOR_OR, creators, JastBuilder, OPERATOR_EQUALS, OPERATOR_GT_EQUALS, OPERATOR_IN, OPERATOR_LIKE, ORDER_BY_DIRECTION_ASC, ORDER_BY_DIRECTION_DESC, print } from '@atlaskit/jql-ast';
|
|
3
|
+
import { availableBasicFilterTypes } from '../basic-filters/ui';
|
|
3
4
|
var fuzzySearchRegExp = /^"(.+)"$/;
|
|
4
5
|
var jiraIssueKeyRegExp = /[A-Z]+-\d+/;
|
|
5
6
|
export var fuzzyCharacter = '*';
|
|
@@ -20,7 +21,15 @@ export var buildJQL = function buildJQL(input) {
|
|
|
20
21
|
orderKey = _input$orderKey === void 0 ? 'created' : _input$orderKey,
|
|
21
22
|
filterValues = input.filterValues;
|
|
22
23
|
var trimmedRawSearch = rawSearch.trim();
|
|
23
|
-
var
|
|
24
|
+
var hasValidFilterSelectionAndValues = filterValues &&
|
|
25
|
+
// checks if filterValues have only valid keys
|
|
26
|
+
Object.entries(filterValues).every(function (_ref) {
|
|
27
|
+
var _ref2 = _slicedToArray(_ref, 1),
|
|
28
|
+
key = _ref2[0];
|
|
29
|
+
return availableBasicFilterTypes.includes(key);
|
|
30
|
+
}) &&
|
|
31
|
+
// checks if atleast one fitler value has some selection object
|
|
32
|
+
Object.values(filterValues).some(function (value) {
|
|
24
33
|
return value.length > 0;
|
|
25
34
|
});
|
|
26
35
|
if (!query) {
|
|
@@ -39,11 +48,11 @@ export var buildJQL = function buildJQL(input) {
|
|
|
39
48
|
var orClause = creators.compoundClause(creators.compoundOperator(COMPOUND_OPERATOR_OR), orClauseFields);
|
|
40
49
|
query.appendClause(orClause, COMPOUND_OPERATOR_AND);
|
|
41
50
|
}
|
|
42
|
-
if (
|
|
43
|
-
Object.entries(filterValues).forEach(function (
|
|
44
|
-
var
|
|
45
|
-
key =
|
|
46
|
-
filterFieldValues =
|
|
51
|
+
if (hasValidFilterSelectionAndValues) {
|
|
52
|
+
Object.entries(filterValues).forEach(function (_ref3) {
|
|
53
|
+
var _ref4 = _slicedToArray(_ref3, 2),
|
|
54
|
+
key = _ref4[0],
|
|
55
|
+
filterFieldValues = _ref4[1];
|
|
47
56
|
if (filterFieldValues.length === 0) {
|
|
48
57
|
return;
|
|
49
58
|
}
|
|
@@ -53,7 +62,7 @@ export var buildJQL = function buildJQL(input) {
|
|
|
53
62
|
query.appendClause(filterInClause, COMPOUND_OPERATOR_AND);
|
|
54
63
|
});
|
|
55
64
|
}
|
|
56
|
-
if (!trimmedRawSearch && !
|
|
65
|
+
if (!trimmedRawSearch && !hasValidFilterSelectionAndValues) {
|
|
57
66
|
var created = constructTerminalClause('created', OPERATOR_GT_EQUALS, '-30d');
|
|
58
67
|
query.appendClause(created, COMPOUND_OPERATOR_AND);
|
|
59
68
|
}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
2
3
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
4
|
+
var _excluded = ["basicInputTextValue"];
|
|
3
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; }
|
|
4
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; }
|
|
5
7
|
/** @jsx jsx */
|
|
@@ -166,9 +168,11 @@ export var JiraSearchContainer = function JiraSearchContainer(props) {
|
|
|
166
168
|
}, []);
|
|
167
169
|
useEffect(function () {
|
|
168
170
|
if (basicFilterHydrationStatus === 'resolved') {
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
171
|
+
var basicInputTextValue = hydratedOptions.basicInputTextValue,
|
|
172
|
+
hydratedFilterOptions = _objectWithoutProperties(hydratedOptions, _excluded);
|
|
173
|
+
setFilterSelections(hydratedFilterOptions);
|
|
174
|
+
if (basicInputTextValue) {
|
|
175
|
+
setBasicSearchTerm(basicInputTextValue);
|
|
172
176
|
}
|
|
173
177
|
}
|
|
174
178
|
}, [hydratedOptions, basicFilterHydrationStatus]);
|
package/package.json
CHANGED
package/tmp/api-report-tmp.d.ts
DELETED
|
@@ -1,157 +0,0 @@
|
|
|
1
|
-
## API Report File for "@atlaskit/link-datasource"
|
|
2
|
-
|
|
3
|
-
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
|
|
4
|
-
|
|
5
|
-
```ts
|
|
6
|
-
|
|
7
|
-
/// <reference types="react" />
|
|
8
|
-
|
|
9
|
-
import { DatasourceAdf } from '@atlaskit/linking-common/types';
|
|
10
|
-
import { DatasourceAdfTableView } from '@atlaskit/linking-common/types';
|
|
11
|
-
import { DatasourceAdfView } from '@atlaskit/linking-common/types';
|
|
12
|
-
import { InlineCardAdf } from '@atlaskit/linking-common/types';
|
|
13
|
-
import type { UIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
14
|
-
|
|
15
|
-
// @public (undocumented)
|
|
16
|
-
export const ASSETS_LIST_OF_LINKS_DATASOURCE_ID = "361d618a-3c04-40ad-9b27-3c8ea6927020";
|
|
17
|
-
|
|
18
|
-
// @public (undocumented)
|
|
19
|
-
interface AssetsConfigModalProps {
|
|
20
|
-
// (undocumented)
|
|
21
|
-
datasourceId: string;
|
|
22
|
-
// (undocumented)
|
|
23
|
-
onCancel: () => void;
|
|
24
|
-
// (undocumented)
|
|
25
|
-
onInsert: (adf: AssetsDatasourceAdf | InlineCardAdf, analyticsEvent?: UIAnalyticsEvent) => void;
|
|
26
|
-
// (undocumented)
|
|
27
|
-
parameters?: AssetsDatasourceParameters;
|
|
28
|
-
// (undocumented)
|
|
29
|
-
visibleColumnKeys?: string[];
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
// @public (undocumented)
|
|
33
|
-
const AssetsConfigModalWithWrappers: (props: AssetsConfigModalProps) => JSX.Element;
|
|
34
|
-
export { AssetsConfigModalWithWrappers as AssetsConfigModal }
|
|
35
|
-
export { AssetsConfigModalWithWrappers as JSMAssetsConfigModal }
|
|
36
|
-
|
|
37
|
-
// @public (undocumented)
|
|
38
|
-
export interface AssetsDatasourceAdf extends DatasourceAdf {
|
|
39
|
-
// (undocumented)
|
|
40
|
-
attrs: {
|
|
41
|
-
url?: string;
|
|
42
|
-
datasource: {
|
|
43
|
-
id: string;
|
|
44
|
-
parameters: AssetsDatasourceParameters;
|
|
45
|
-
views: DatasourceAdfView[];
|
|
46
|
-
};
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
// @public (undocumented)
|
|
51
|
-
export interface AssetsDatasourceParameters {
|
|
52
|
-
// (undocumented)
|
|
53
|
-
aql: string;
|
|
54
|
-
// (undocumented)
|
|
55
|
-
schemaId: string;
|
|
56
|
-
// (undocumented)
|
|
57
|
-
workspaceId: string;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
export { DatasourceAdf }
|
|
61
|
-
|
|
62
|
-
export { DatasourceAdfTableView }
|
|
63
|
-
|
|
64
|
-
export { DatasourceAdfView }
|
|
65
|
-
|
|
66
|
-
// @public (undocumented)
|
|
67
|
-
export const DatasourceTableView: (props: DatasourceTableViewProps) => JSX.Element;
|
|
68
|
-
|
|
69
|
-
// @public (undocumented)
|
|
70
|
-
interface DatasourceTableViewProps {
|
|
71
|
-
// (undocumented)
|
|
72
|
-
columnCustomSizes?: {
|
|
73
|
-
[key: string]: number;
|
|
74
|
-
};
|
|
75
|
-
datasourceId: string;
|
|
76
|
-
// (undocumented)
|
|
77
|
-
fields?: string[];
|
|
78
|
-
// (undocumented)
|
|
79
|
-
onColumnResize?: (key: string, width: number) => void;
|
|
80
|
-
onVisibleColumnKeysChange?: (visibleColumnKeys: string[]) => void;
|
|
81
|
-
parameters: object;
|
|
82
|
-
url?: string;
|
|
83
|
-
visibleColumnKeys?: string[];
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
// @public (undocumented)
|
|
87
|
-
export const JIRA_LIST_OF_LINKS_DATASOURCE_ID = "d8b75300-dfda-4519-b6cd-e49abbd50401";
|
|
88
|
-
|
|
89
|
-
// @public (undocumented)
|
|
90
|
-
export type JiraIssueDatasourceParameters = {
|
|
91
|
-
cloudId: string;
|
|
92
|
-
} & JiraIssueDatasourceParametersQuery;
|
|
93
|
-
|
|
94
|
-
// @public (undocumented)
|
|
95
|
-
type JiraIssueDatasourceParametersQuery = XOR<{
|
|
96
|
-
jql: string;
|
|
97
|
-
}, {
|
|
98
|
-
filter: string;
|
|
99
|
-
}>;
|
|
100
|
-
|
|
101
|
-
// @public (undocumented)
|
|
102
|
-
export const JiraIssuesConfigModal: (props: JiraIssuesConfigModalProps) => JSX.Element;
|
|
103
|
-
|
|
104
|
-
// @public (undocumented)
|
|
105
|
-
interface JiraIssuesConfigModalProps {
|
|
106
|
-
// (undocumented)
|
|
107
|
-
columnCustomSizes?: {
|
|
108
|
-
[key: string]: number;
|
|
109
|
-
};
|
|
110
|
-
datasourceId: string;
|
|
111
|
-
onCancel: () => void;
|
|
112
|
-
onInsert: (adf: InlineCardAdf | JiraIssuesDatasourceAdf, analyticsEvent?: UIAnalyticsEvent) => void;
|
|
113
|
-
parameters?: JiraIssueDatasourceParameters;
|
|
114
|
-
url?: string;
|
|
115
|
-
viewMode?: JiraIssueViewModes;
|
|
116
|
-
visibleColumnKeys?: string[];
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
// @public (undocumented)
|
|
120
|
-
export interface JiraIssuesDatasourceAdf extends DatasourceAdf {
|
|
121
|
-
// (undocumented)
|
|
122
|
-
attrs: {
|
|
123
|
-
url?: string;
|
|
124
|
-
datasource: {
|
|
125
|
-
id: string;
|
|
126
|
-
parameters: JiraIssueDatasourceParameters;
|
|
127
|
-
views: [
|
|
128
|
-
{
|
|
129
|
-
type: 'table';
|
|
130
|
-
properties?: {
|
|
131
|
-
columns: {
|
|
132
|
-
key: string;
|
|
133
|
-
width?: number;
|
|
134
|
-
}[];
|
|
135
|
-
};
|
|
136
|
-
}
|
|
137
|
-
];
|
|
138
|
-
};
|
|
139
|
-
};
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
// @public (undocumented)
|
|
143
|
-
type JiraIssueViewModes = 'count' | 'issue';
|
|
144
|
-
|
|
145
|
-
// @public (undocumented)
|
|
146
|
-
export const LazyLoadedDatasourceRenderFailedAnalyticsWrapper: (props: any) => JSX.Element;
|
|
147
|
-
|
|
148
|
-
// @public (undocumented)
|
|
149
|
-
type XOR<T1, T2> = (T1 & {
|
|
150
|
-
[k in Exclude<keyof T2, keyof T1>]?: never;
|
|
151
|
-
}) | (T2 & {
|
|
152
|
-
[k in Exclude<keyof T1, keyof T2>]?: never;
|
|
153
|
-
});
|
|
154
|
-
|
|
155
|
-
// (No @packageDocumentation comment for this package)
|
|
156
|
-
|
|
157
|
-
```
|