@atlaskit/link-datasource 1.19.22 → 1.19.24

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 (33) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/cjs/analytics/constants.js +1 -1
  3. package/dist/cjs/hooks/useValidateAqlText.js +83 -45
  4. package/dist/cjs/ui/assets-modal/modal/index.js +20 -34
  5. package/dist/cjs/ui/assets-modal/modal/render-assets-content/index.js +18 -15
  6. package/dist/cjs/ui/assets-modal/search-container/aql-search-input/index.js +14 -84
  7. package/dist/cjs/ui/assets-modal/search-container/index.js +1 -1
  8. package/dist/cjs/ui/datasource-table-view/datasourceTableView.js +33 -30
  9. package/dist/cjs/ui/jira-issues-modal/initial-state-view/messages.js +2 -2
  10. package/dist/cjs/ui/jira-issues-modal/modal/index.js +8 -2
  11. package/dist/es2019/analytics/constants.js +1 -1
  12. package/dist/es2019/hooks/useValidateAqlText.js +70 -31
  13. package/dist/es2019/ui/assets-modal/modal/index.js +5 -4
  14. package/dist/es2019/ui/assets-modal/modal/render-assets-content/index.js +19 -16
  15. package/dist/es2019/ui/assets-modal/search-container/aql-search-input/index.js +13 -56
  16. package/dist/es2019/ui/assets-modal/search-container/index.js +1 -1
  17. package/dist/es2019/ui/datasource-table-view/datasourceTableView.js +33 -30
  18. package/dist/es2019/ui/jira-issues-modal/initial-state-view/messages.js +2 -2
  19. package/dist/es2019/ui/jira-issues-modal/modal/index.js +8 -2
  20. package/dist/esm/analytics/constants.js +1 -1
  21. package/dist/esm/hooks/useValidateAqlText.js +83 -45
  22. package/dist/esm/ui/assets-modal/modal/index.js +20 -34
  23. package/dist/esm/ui/assets-modal/modal/render-assets-content/index.js +19 -16
  24. package/dist/esm/ui/assets-modal/search-container/aql-search-input/index.js +14 -85
  25. package/dist/esm/ui/assets-modal/search-container/index.js +1 -1
  26. package/dist/esm/ui/datasource-table-view/datasourceTableView.js +33 -30
  27. package/dist/esm/ui/jira-issues-modal/initial-state-view/messages.js +2 -2
  28. package/dist/esm/ui/jira-issues-modal/modal/index.js +8 -2
  29. package/dist/types/hooks/useValidateAqlText.d.ts +21 -5
  30. package/dist/types/ui/assets-modal/search-container/aql-search-input/index.d.ts +0 -1
  31. package/dist/types-ts4.5/hooks/useValidateAqlText.d.ts +21 -5
  32. package/dist/types-ts4.5/ui/assets-modal/search-container/aql-search-input/index.d.ts +0 -1
  33. package/package.json +4 -4
@@ -1,8 +1,6 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
- import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
3
2
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
4
3
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
5
- import _regeneratorRuntime from "@babel/runtime/regenerator";
6
4
  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; }
7
5
  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; }
8
6
  /** @jsx jsx */
@@ -277,36 +275,24 @@ var PlainAssetsConfigModal = function PlainAssetsConfigModal(props) {
277
275
  }).fire(EVENT_CHANNEL);
278
276
  onCancel();
279
277
  }, [analyticsPayload, onCancel]);
280
- var handleOnSearch = useCallback( /*#__PURE__*/function () {
281
- var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(searchAql, searchSchemaId) {
282
- return _regeneratorRuntime.wrap(function _callee$(_context) {
283
- while (1) switch (_context.prev = _context.next) {
284
- case 0:
285
- if (schemaId !== searchSchemaId || aql !== searchAql || status === 'rejected') {
286
- searchCount.current++;
287
- if (schemaId !== searchSchemaId) {
288
- userInteractionActions.current.add(DatasourceAction.SCHEMA_UPDATED);
289
- }
290
- if (aql !== searchAql) {
291
- userInteractionActions.current.add(DatasourceAction.QUERY_UPDATED);
292
- }
293
- reset({
294
- shouldResetColumns: true
295
- });
296
- setAql(searchAql);
297
- setSchemaId(searchSchemaId);
298
- setIsNewSearch(true);
299
- }
300
- case 1:
301
- case "end":
302
- return _context.stop();
303
- }
304
- }, _callee);
305
- }));
306
- return function (_x, _x2) {
307
- return _ref.apply(this, arguments);
308
- };
309
- }(), [aql, reset, schemaId, status]);
278
+ var handleOnSearch = useCallback(function (searchAql, searchSchemaId) {
279
+ if (schemaId !== searchSchemaId || aql !== searchAql || status === 'rejected') {
280
+ searchCount.current++;
281
+ if (schemaId !== searchSchemaId) {
282
+ userInteractionActions.current.add(DatasourceAction.SCHEMA_UPDATED);
283
+ }
284
+ if (aql !== searchAql) {
285
+ userInteractionActions.current.add(DatasourceAction.QUERY_UPDATED);
286
+ }
287
+ reset({
288
+ shouldResetColumns: true,
289
+ shouldForceRequest: true
290
+ });
291
+ setAql(searchAql);
292
+ setSchemaId(searchSchemaId);
293
+ setIsNewSearch(true);
294
+ }
295
+ }, [aql, reset, schemaId, status]);
310
296
  var renderErrorState = useCallback(function () {
311
297
  if (errorState) {
312
298
  switch (errorState) {
@@ -331,7 +317,7 @@ var PlainAssetsConfigModal = function PlainAssetsConfigModal(props) {
331
317
  return jsx(AssetsSearchContainer, {
332
318
  workspaceId: workspaceId,
333
319
  initialSearchData: {
334
- aql: aql,
320
+ aql: initialParameters === null || initialParameters === void 0 ? void 0 : initialParameters.aql,
335
321
  objectSchema: existingObjectSchema,
336
322
  objectSchemas: objectSchemas
337
323
  },
@@ -340,7 +326,7 @@ var PlainAssetsConfigModal = function PlainAssetsConfigModal(props) {
340
326
  isSearching: status === 'loading'
341
327
  });
342
328
  }
343
- }, [errorState, workspaceId, assetsClientLoading, aql, existingObjectSchema, objectSchemas, handleOnSearch, status]);
329
+ }, [errorState, workspaceId, assetsClientLoading, initialParameters === null || initialParameters === void 0 ? void 0 : initialParameters.aql, existingObjectSchema, objectSchemas, handleOnSearch, status]);
344
330
  return jsx(IntlMessagesProvider, {
345
331
  defaultMessages: i18nEN,
346
332
  loaderFn: fetchMessagesForLocale
@@ -1,5 +1,5 @@
1
1
  /** @jsx jsx */
2
- import { useMemo } from 'react';
2
+ import { useCallback, useMemo } from 'react';
3
3
  import { css, jsx } from '@emotion/react';
4
4
  import { N40 } from '@atlaskit/theme/colors';
5
5
  import { AccessRequired } from '../../../common/error-state/access-required';
@@ -84,19 +84,22 @@ export var RenderAssetsContent = function RenderAssetsContent(props) {
84
84
  parentContainerRenderInstanceId: modalRenderInstanceId
85
85
  }));
86
86
  }, [columns, defaultVisibleColumnKeys, hasNextPage, loadDatasourceDetails, onNextPage, onVisibleColumnKeysChange, responseItems, status, visibleColumnKeys, modalRenderInstanceId]);
87
- if (isFetchingInitialData) {
88
- // Placing this check first as it's a priority before all others
89
- return jsx(LoadingView, null);
90
- } else if (status === 'rejected') {
91
- return jsx(RejectedView, null);
92
- } else if (status === 'unauthorized') {
93
- return jsx(UnauthorizedView, null);
94
- } else if (status === 'empty') {
95
- return jsx(EmptyView, null);
96
- } else if (resolvedWithNoResults) {
97
- return jsx(NoResultsView, null);
98
- } else if (status === 'loading' && !columns.length) {
99
- return jsx(LoadingView, null);
100
- }
101
- return issueLikeDataTableView;
87
+ var renderAssetsContentView = useCallback(function () {
88
+ if (isFetchingInitialData) {
89
+ // Placing this check first as it's a priority before all others
90
+ return jsx(LoadingView, null);
91
+ } else if (status === 'rejected') {
92
+ return jsx(RejectedView, null);
93
+ } else if (status === 'unauthorized') {
94
+ return jsx(UnauthorizedView, null);
95
+ } else if (status === 'empty') {
96
+ return jsx(EmptyView, null);
97
+ } else if (resolvedWithNoResults) {
98
+ return jsx(NoResultsView, null);
99
+ } else if (status === 'loading' && !columns.length) {
100
+ return jsx(LoadingView, null);
101
+ }
102
+ return issueLikeDataTableView;
103
+ }, [columns.length, isFetchingInitialData, issueLikeDataTableView, resolvedWithNoResults, status]);
104
+ return renderAssetsContentView();
102
105
  };
@@ -1,9 +1,6 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
- import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
3
- import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
4
- import _regeneratorRuntime from "@babel/runtime/regenerator";
5
2
  /** @jsx jsx */
6
- import { Fragment, useCallback, useRef, useState } from 'react';
3
+ import { Fragment } from 'react';
7
4
  import { css, jsx } from '@emotion/react';
8
5
  import { useIntl } from 'react-intl-next';
9
6
  import { LoadingButton } from '@atlaskit/button';
@@ -20,10 +17,6 @@ import { useValidateAqlText } from '../../../../hooks/useValidateAqlText';
20
17
  import { aqlKey } from '../../../../types/assets/types';
21
18
  import { FieldContainer } from '../styled';
22
19
  import { searchInputMessages } from './messages';
23
-
24
- /* Meta isn't exported in @atlaskit/form
25
- Taken from packages/design-system/form/src/field.tsx */
26
-
27
20
  var buttonBaseStyles = css({
28
21
  display: 'flex',
29
22
  height: '100%',
@@ -37,15 +30,14 @@ var AQLSupportDocumentLink = 'https://support.atlassian.com/jira-service-managem
37
30
  var searchButtonStyles = css({
38
31
  marginRight: "var(--ds-space-075, 6px)"
39
32
  });
40
- export var SEARCH_DEBOUNCE_MS = 350;
41
- var renderValidatorIcon = function renderValidatorIcon(value, error, meta) {
42
- if (value && meta !== null && meta !== void 0 && meta.validating) {
33
+ var renderValidatorIcon = function renderValidatorIcon(lastValidationResult) {
34
+ if (lastValidationResult.type === 'loading') {
43
35
  return jsx(Spinner, {
44
36
  size: "medium",
45
37
  testId: "assets-datasource-modal--aql-validating"
46
38
  });
47
39
  }
48
- if (value && error) {
40
+ if (lastValidationResult.type === 'invalid') {
49
41
  return jsx(CrossCircleIcon, {
50
42
  label: "label",
51
43
  primaryColor: "red",
@@ -53,7 +45,7 @@ var renderValidatorIcon = function renderValidatorIcon(value, error, meta) {
53
45
  testId: "assets-datasource-modal--aql-invalid"
54
46
  });
55
47
  }
56
- if (value && meta.valid) {
48
+ if (lastValidationResult.type === 'valid') {
57
49
  return jsx(CheckCircleIcon, {
58
50
  label: "label",
59
51
  primaryColor: "green",
@@ -75,85 +67,22 @@ export var AqlSearchInput = function AqlSearchInput(_ref) {
75
67
  isSearching = _ref.isSearching;
76
68
  var _useIntl = useIntl(),
77
69
  formatMessage = _useIntl.formatMessage;
78
- var timeout = useRef();
79
- var lastValue = useRef(value);
80
- var lastResult = useRef(Promise.resolve(undefined));
81
- var _useState = useState(null),
82
- _useState2 = _slicedToArray(_useState, 2),
83
- message = _useState2[0],
84
- setMessage = _useState2[1];
85
- var _useValidateAqlText = useValidateAqlText(workspaceId),
86
- validateAqlText = _useValidateAqlText.validateAqlText;
87
-
88
- // Validation expects undefined when valid and a string as an error message when invalid
89
- var handleValidation = useCallback( /*#__PURE__*/function () {
90
- var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(newUnvalidatedQlQuery) {
91
- var validation;
92
- return _regeneratorRuntime.wrap(function _callee$(_context) {
93
- while (1) switch (_context.prev = _context.next) {
94
- case 0:
95
- if (newUnvalidatedQlQuery) {
96
- _context.next = 2;
97
- break;
98
- }
99
- return _context.abrupt("return", undefined);
100
- case 2:
101
- _context.next = 4;
102
- return validateAqlText(newUnvalidatedQlQuery);
103
- case 4:
104
- validation = _context.sent;
105
- setMessage(validation.message);
106
- return _context.abrupt("return", validation.isValid ? undefined : 'invalid');
107
- case 7:
108
- case "end":
109
- return _context.stop();
110
- }
111
- }, _callee);
112
- }));
113
- return function (_x) {
114
- return _ref2.apply(this, arguments);
115
- };
116
- }(), [validateAqlText]);
117
-
118
- /* Debounce async validation for input, validation is also called on every field change
119
- in a form so we need to also memoize. The async validate function is expected to either:
120
- Immediately return a promise (which is then collected into an array, every single time validation is run),
121
- or immediately return either undefined or an error message */
122
- var debouncedMemoizedValidation = function debouncedMemoizedValidation(value) {
123
- return new Promise(function (resolve) {
124
- if (timeout.current) {
125
- timeout.current();
126
- }
127
- if (value !== lastValue.current) {
128
- var timerId = setTimeout(function () {
129
- lastValue.current = value;
130
- lastResult.current = handleValidation(value);
131
- resolve(lastResult.current);
132
- }, SEARCH_DEBOUNCE_MS);
133
- timeout.current = function () {
134
- clearTimeout(timerId);
135
- resolve('debouncing');
136
- };
137
- } else {
138
- resolve(lastResult.current);
139
- }
140
- });
141
- };
70
+ var _useValidateAqlText = useValidateAqlText(workspaceId, value),
71
+ debouncedValidation = _useValidateAqlText.debouncedValidation,
72
+ lastValidationResult = _useValidateAqlText.lastValidationResult;
142
73
  return jsx(FieldContainer, null, jsx(Field, {
143
74
  name: aqlKey,
144
75
  defaultValue: value,
145
- validate: debouncedMemoizedValidation
146
- }, function (_ref3) {
147
- var fieldProps = _ref3.fieldProps,
148
- meta = _ref3.meta,
149
- error = _ref3.error;
76
+ validate: debouncedValidation
77
+ }, function (_ref2) {
78
+ var fieldProps = _ref2.fieldProps;
150
79
  return jsx(Fragment, null, jsx(Textfield, _extends({}, fieldProps, {
151
80
  elemBeforeInput: jsx("span", {
152
81
  style: {
153
82
  paddingLeft: 6,
154
83
  width: 24
155
84
  }
156
- }, renderValidatorIcon(fieldProps.value, error, meta)),
85
+ }, renderValidatorIcon(lastValidationResult)),
157
86
  elemAfterInput: jsx(Fragment, null, jsx(Tooltip, {
158
87
  content: formatMessage(searchInputMessages.helpTooltipText),
159
88
  position: "bottom"
@@ -177,10 +106,10 @@ export var AqlSearchInput = function AqlSearchInput(_ref) {
177
106
  spacing: "none",
178
107
  testId: "assets-datasource-modal--aql-search-button",
179
108
  type: "submit",
180
- isDisabled: fieldProps.value.trim() === '' || meta.validating || !meta.valid
109
+ isDisabled: lastValidationResult.type !== 'valid'
181
110
  })),
182
111
  placeholder: formatMessage(searchInputMessages.placeholder),
183
112
  testId: testId
184
- })), fieldProps.value && error && message && jsx(ErrorMessage, null, message));
113
+ })), lastValidationResult.type === 'invalid' && lastValidationResult.error && jsx(ErrorMessage, null, lastValidationResult.error));
185
114
  }));
186
115
  };
@@ -19,7 +19,7 @@ export var AssetsSearchContainer = function AssetsSearchContainer(props) {
19
19
  var onFormSubmit = function onFormSubmit(searchFormValues) {
20
20
  var aql = searchFormValues.aql,
21
21
  objectSchema = searchFormValues.objectSchema;
22
- if (objectSchema) {
22
+ if (aql && objectSchema) {
23
23
  fireEvent('ui.aqlEditor.searched', {});
24
24
  // Pass the validated aql and object schema back to modal
25
25
  onSearch(aql, objectSchema.value);
@@ -3,12 +3,15 @@ import { useCallback, useEffect, useRef } from 'react';
3
3
  import { css, jsx } from '@emotion/react';
4
4
  import { v4 as uuidv4 } from 'uuid';
5
5
  import { withAnalyticsContext } from '@atlaskit/analytics-next';
6
+ import { IntlMessagesProvider } from '@atlaskit/intl-messages-provider';
6
7
  import { useDatasourceAnalyticsEvents } from '../../analytics';
7
8
  import { packageMetaData } from '../../analytics/constants';
8
9
  import { startUfoExperience } from '../../analytics/ufoExperiences';
9
10
  import { useColumnPickerRenderedFailedUfoExperience } from '../../analytics/ufoExperiences/hooks/useColumnPickerRenderedFailedUfoExperience';
10
11
  import { useDataRenderedUfoExperience } from '../../analytics/ufoExperiences/hooks/useDataRenderedUfoExperience';
12
+ import { fetchMessagesForLocale } from '../../common/utils/locale/fetch-messages-for-locale';
11
13
  import { useDatasourceTableState } from '../../hooks/useDatasourceTableState';
14
+ import i18nEN from '../../i18n/en';
12
15
  import { ScrollableContainerHeight } from '../../ui/issue-like-table/styled';
13
16
  import { AccessRequired } from '../common/error-state/access-required';
14
17
  import { LoadingError } from '../common/error-state/loading-error';
@@ -120,35 +123,35 @@ var DatasourceTableViewWithoutAnalytics = function DatasourceTableViewWithoutAna
120
123
  onRefresh: reset
121
124
  });
122
125
  }
123
- return (
124
- // datasource-table classname is to exclude all children from being commentable - exclude list is in CFE
125
- jsx("div", {
126
- css: containerStyles,
127
- className: "datasource-table"
128
- }, hasColumns ? jsx(IssueLikeDataTableView, {
129
- testId: 'datasource-table-view',
130
- hasNextPage: hasNextPage,
131
- items: responseItems,
132
- onNextPage: onNextPage,
133
- onLoadDatasourceDetails: loadDatasourceDetails,
134
- status: status,
135
- columns: columns,
136
- visibleColumnKeys: visibleColumnKeys || defaultVisibleColumnKeys,
137
- onVisibleColumnKeysChange: onVisibleColumnKeysChange,
138
- columnCustomSizes: columnCustomSizes,
139
- onColumnResize: onColumnResize,
140
- scrollableContainerHeight: ScrollableContainerHeight,
141
- parentContainerRenderInstanceId: tableRenderInstanceId,
142
- extensionKey: extensionKey
143
- }) : jsx(EmptyState, {
144
- testId: "datasource-table-view-skeleton",
145
- isCompact: true
146
- }), jsx(TableFooter, {
147
- itemCount: isDataReady ? totalCount : undefined,
148
- onRefresh: forcedReset,
149
- isLoading: !isDataReady || status === 'loading',
150
- url: url
151
- }))
152
- );
126
+ return jsx(IntlMessagesProvider, {
127
+ defaultMessages: i18nEN,
128
+ loaderFn: fetchMessagesForLocale
129
+ }, jsx("div", {
130
+ css: containerStyles,
131
+ className: "datasource-table"
132
+ }, hasColumns ? jsx(IssueLikeDataTableView, {
133
+ testId: 'datasource-table-view',
134
+ hasNextPage: hasNextPage,
135
+ items: responseItems,
136
+ onNextPage: onNextPage,
137
+ onLoadDatasourceDetails: loadDatasourceDetails,
138
+ status: status,
139
+ columns: columns,
140
+ visibleColumnKeys: visibleColumnKeys || defaultVisibleColumnKeys,
141
+ onVisibleColumnKeysChange: onVisibleColumnKeysChange,
142
+ columnCustomSizes: columnCustomSizes,
143
+ onColumnResize: onColumnResize,
144
+ scrollableContainerHeight: ScrollableContainerHeight,
145
+ parentContainerRenderInstanceId: tableRenderInstanceId,
146
+ extensionKey: extensionKey
147
+ }) : jsx(EmptyState, {
148
+ testId: "datasource-table-view-skeleton",
149
+ isCompact: true
150
+ }), jsx(TableFooter, {
151
+ itemCount: isDataReady ? totalCount : undefined,
152
+ onRefresh: forcedReset,
153
+ isLoading: !isDataReady || status === 'loading',
154
+ url: url
155
+ })));
153
156
  };
154
157
  export var DatasourceTableView = withAnalyticsContext(packageMetaData)(DatasourceTableViewWithoutAnalytics);
@@ -11,12 +11,12 @@ export var initialStateViewMessages = defineMessages({
11
11
  defaultMessage: 'Beta'
12
12
  },
13
13
  searchDescriptionForBasicSearch: {
14
- id: 'linkDataSource.modal-initial-state.searchDescription',
14
+ id: 'linkDataSource.modal-initial-state.searchDescription-basic',
15
15
  description: 'The initial modal search state helper message displayed under the search title when basic search mode is selected',
16
16
  defaultMessage: 'Search by keyword for issues to insert.'
17
17
  },
18
18
  searchDescriptionForJQLSearch: {
19
- id: 'linkDataSource.modal-initial-state.searchDescription',
19
+ id: 'linkDataSource.modal-initial-state.searchDescription-jql',
20
20
  description: 'The initial modal search state helper message displayed under the search title when JQL search mode is selected',
21
21
  defaultMessage: 'Use JQL (Jira Query Language) to search for issues.'
22
22
  },
@@ -13,6 +13,7 @@ import { FormattedMessage, FormattedNumber, useIntl } from 'react-intl-next';
13
13
  import { v4 as uuidv4 } from 'uuid';
14
14
  import { withAnalyticsContext } from '@atlaskit/analytics-next';
15
15
  import Button from '@atlaskit/button/standard-button';
16
+ import { IntlMessagesProvider } from '@atlaskit/intl-messages-provider';
16
17
  import Modal, { ModalBody, ModalFooter, ModalHeader, ModalTitle, ModalTransition } from '@atlaskit/modal-dialog';
17
18
  import { getBooleanFF } from '@atlaskit/platform-feature-flags';
18
19
  import LinkUrl from '@atlaskit/smart-card/link-url';
@@ -24,7 +25,9 @@ import { startUfoExperience } from '../../../analytics/ufoExperiences';
24
25
  import { useColumnPickerRenderedFailedUfoExperience } from '../../../analytics/ufoExperiences/hooks/useColumnPickerRenderedFailedUfoExperience';
25
26
  import { useDataRenderedUfoExperience } from '../../../analytics/ufoExperiences/hooks/useDataRenderedUfoExperience';
26
27
  import { mapSearchMethod } from '../../../analytics/utils';
28
+ import { fetchMessagesForLocale } from '../../../common/utils/locale/fetch-messages-for-locale';
27
29
  import { useDatasourceTableState } from '../../../hooks/useDatasourceTableState';
30
+ import i18nEN from '../../../i18n/en';
28
31
  import { getAvailableJiraSites } from '../../../services/getAvailableJiraSites';
29
32
  import { AccessRequired } from '../../common/error-state/access-required';
30
33
  import { ModalLoadingError } from '../../common/error-state/modal-loading-error';
@@ -531,7 +534,10 @@ export var PlainJiraIssuesConfigModal = function PlainJiraIssuesConfigModal(prop
531
534
  }
532
535
  return issueLikeDataTableView;
533
536
  }, [columns.length, currentSearchMethod, issueLikeDataTableView, jql, jqlUrl, resolvedWithNoResults, responseItems.length, retrieveUrlForSmartCardRender, selectedJiraSite === null || selectedJiraSite === void 0 ? void 0 : selectedJiraSite.url, status, urlBeingEdited]);
534
- return jsx(ModalTransition, null, jsx(Modal, {
537
+ return jsx(IntlMessagesProvider, {
538
+ defaultMessages: i18nEN,
539
+ loaderFn: fetchMessagesForLocale
540
+ }, jsx(ModalTransition, null, jsx(Modal, {
535
541
  testId: "jira-jql-datasource-modal",
536
542
  onClose: onCancel,
537
543
  width: "calc(100% - 80px)",
@@ -587,7 +593,7 @@ export var PlainJiraIssuesConfigModal = function PlainJiraIssuesConfigModal(prop
587
593
  onClick: onInsertPressed,
588
594
  isDisabled: isInsertDisabled,
589
595
  testId: "jira-jql-datasource-modal--insert-button"
590
- }, jsx(FormattedMessage, modalMessages.insertIssuesButtonText)))));
596
+ }, jsx(FormattedMessage, modalMessages.insertIssuesButtonText))))));
591
597
  };
592
598
  var analyticsContextAttributes = {
593
599
  dataProvider: 'jira-issues'
@@ -1,11 +1,27 @@
1
+ type IdleResult = {
2
+ type: 'idle';
3
+ };
4
+ type LoadingResult = {
5
+ type: 'loading';
6
+ };
7
+ export type ValidResult = {
8
+ type: 'valid';
9
+ validatedAql: string;
10
+ };
11
+ export type InvalidResult = {
12
+ type: 'invalid';
13
+ error: string;
14
+ };
15
+ export type AqlValidationResult = IdleResult | LoadingResult | ValidResult | InvalidResult;
1
16
  export type AqlValidationResponse = {
2
17
  isValid: boolean;
3
18
  message: string | null;
4
19
  };
5
20
  export type UseValidateAqlTextState = {
6
- validateAqlTextLoading: boolean;
7
- validateAqlTextError: Error | undefined;
8
- isValidAqlText: boolean;
9
- validateAqlText: (aql: string) => Promise<AqlValidationResponse>;
21
+ debouncedValidation: (value: string | undefined) => Promise<string | undefined>;
22
+ validateAqlText: (aql: string) => Promise<'error' | undefined>;
23
+ lastValidationResult: AqlValidationResult;
10
24
  };
11
- export declare const useValidateAqlText: (workspaceId: string) => UseValidateAqlTextState;
25
+ export declare const SEARCH_DEBOUNCE = 350;
26
+ export declare const useValidateAqlText: (workspaceId: string, initialValue: string) => UseValidateAqlTextState;
27
+ export {};
@@ -5,5 +5,4 @@ export interface AqlSearchInputProps {
5
5
  testId?: string;
6
6
  isSearching: boolean;
7
7
  }
8
- export declare const SEARCH_DEBOUNCE_MS = 350;
9
8
  export declare const AqlSearchInput: ({ value, workspaceId, testId, isSearching, }: AqlSearchInputProps) => jsx.JSX.Element;
@@ -1,11 +1,27 @@
1
+ type IdleResult = {
2
+ type: 'idle';
3
+ };
4
+ type LoadingResult = {
5
+ type: 'loading';
6
+ };
7
+ export type ValidResult = {
8
+ type: 'valid';
9
+ validatedAql: string;
10
+ };
11
+ export type InvalidResult = {
12
+ type: 'invalid';
13
+ error: string;
14
+ };
15
+ export type AqlValidationResult = IdleResult | LoadingResult | ValidResult | InvalidResult;
1
16
  export type AqlValidationResponse = {
2
17
  isValid: boolean;
3
18
  message: string | null;
4
19
  };
5
20
  export type UseValidateAqlTextState = {
6
- validateAqlTextLoading: boolean;
7
- validateAqlTextError: Error | undefined;
8
- isValidAqlText: boolean;
9
- validateAqlText: (aql: string) => Promise<AqlValidationResponse>;
21
+ debouncedValidation: (value: string | undefined) => Promise<string | undefined>;
22
+ validateAqlText: (aql: string) => Promise<'error' | undefined>;
23
+ lastValidationResult: AqlValidationResult;
10
24
  };
11
- export declare const useValidateAqlText: (workspaceId: string) => UseValidateAqlTextState;
25
+ export declare const SEARCH_DEBOUNCE = 350;
26
+ export declare const useValidateAqlText: (workspaceId: string, initialValue: string) => UseValidateAqlTextState;
27
+ export {};
@@ -5,5 +5,4 @@ export interface AqlSearchInputProps {
5
5
  testId?: string;
6
6
  isSearching: boolean;
7
7
  }
8
- export declare const SEARCH_DEBOUNCE_MS = 350;
9
8
  export declare const AqlSearchInput: ({ value, workspaceId, testId, isSearching, }: AqlSearchInputProps) => jsx.JSX.Element;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/link-datasource",
3
- "version": "1.19.22",
3
+ "version": "1.19.24",
4
4
  "description": "UI Components to support linking platform dataset feature",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -34,7 +34,7 @@
34
34
  "@atlaskit/analytics-next": "^9.1.3",
35
35
  "@atlaskit/avatar": "^21.4.0",
36
36
  "@atlaskit/badge": "^15.2.0",
37
- "@atlaskit/button": "^16.17.0",
37
+ "@atlaskit/button": "^16.18.0",
38
38
  "@atlaskit/editor-prosemirror": "1.1.0",
39
39
  "@atlaskit/empty-state": "^7.5.0",
40
40
  "@atlaskit/form": "^9.0.0",
@@ -51,13 +51,13 @@
51
51
  "@atlaskit/lozenge": "^11.5.0",
52
52
  "@atlaskit/modal-dialog": "^12.10.0",
53
53
  "@atlaskit/platform-feature-flags": "^0.2.4",
54
- "@atlaskit/pragmatic-drag-and-drop": "^0.24.0",
54
+ "@atlaskit/pragmatic-drag-and-drop": "^0.25.0",
55
55
  "@atlaskit/pragmatic-drag-and-drop-hitbox": "^0.12.0",
56
56
  "@atlaskit/pragmatic-drag-and-drop-react-beautiful-dnd-autoscroll": "^0.6.0",
57
57
  "@atlaskit/pragmatic-drag-and-drop-react-indicator": "^0.17.0",
58
58
  "@atlaskit/primitives": "^1.13.0",
59
59
  "@atlaskit/select": "^17.0.0",
60
- "@atlaskit/smart-card": "^26.42.0",
60
+ "@atlaskit/smart-card": "^26.43.0",
61
61
  "@atlaskit/spinner": "^16.0.0",
62
62
  "@atlaskit/tag": "^12.0.0",
63
63
  "@atlaskit/textfield": "6.0.0",