@atlaskit/link-datasource 0.33.1 → 0.33.3

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 CHANGED
@@ -1,5 +1,17 @@
1
1
  # @atlaskit/link-datasource
2
2
 
3
+ ## 0.33.3
4
+
5
+ ### Patch Changes
6
+
7
+ - [`60170e1d0cd`](https://bitbucket.org/atlassian/atlassian-frontend/commits/60170e1d0cd) - Fixes to table view header: Remove drag handles, add tooltip, fix padding in editor context
8
+
9
+ ## 0.33.2
10
+
11
+ ### Patch Changes
12
+
13
+ - [`7e77ad40512`](https://bitbucket.org/atlassian/atlassian-frontend/commits/7e77ad40512) - [ux] Add question mark to search field with link to aql docs
14
+
3
15
  ## 0.33.1
4
16
 
5
17
  ### Patch Changes
@@ -16,8 +16,11 @@ var _form = require("@atlaskit/form");
16
16
  var _checkCircle = _interopRequireDefault(require("@atlaskit/icon/glyph/check-circle"));
17
17
  var _crossCircle = _interopRequireDefault(require("@atlaskit/icon/glyph/cross-circle"));
18
18
  var _search = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/search"));
19
+ var _questionCircle = _interopRequireDefault(require("@atlaskit/icon/glyph/question-circle"));
19
20
  var _spinner = _interopRequireDefault(require("@atlaskit/spinner"));
20
21
  var _textfield = _interopRequireDefault(require("@atlaskit/textfield"));
22
+ var _colors = require("@atlaskit/theme/colors");
23
+ var _tooltip = _interopRequireDefault(require("@atlaskit/tooltip"));
21
24
  var _useValidateAqlText2 = require("../../../../hooks/useValidateAqlText");
22
25
  var _types = require("../../../../types/assets/types");
23
26
  var _styled = require("../styled");
@@ -27,6 +30,16 @@ var _messages = require("./messages");
27
30
  /* Meta isn't exported in @atlaskit/form
28
31
  Taken from packages/design-system/form/src/field.tsx */
29
32
 
33
+ var buttonBaseStyles = (0, _react2.css)({
34
+ display: 'flex',
35
+ height: '100%',
36
+ position: 'relative',
37
+ alignItems: 'center',
38
+ justifyContent: 'center',
39
+ flexDirection: 'column',
40
+ marginRight: "var(--ds-space-100, 0.5em)"
41
+ });
42
+ var AQLSupportDocumentLink = 'https://support.atlassian.com/jira-service-management-cloud/docs/use-assets-query-language-aql/';
30
43
  var searchButtonStyles = (0, _react2.css)({
31
44
  marginRight: "var(--ds-space-075, 6px)"
32
45
  });
@@ -143,7 +156,19 @@ var AqlSearchInput = function AqlSearchInput(_ref) {
143
156
  width: 24
144
157
  }
145
158
  }, renderValidatorIcon(fieldProps.value, error, meta)),
146
- elemAfterInput: (0, _react2.jsx)(_button.LoadingButton, {
159
+ elemAfterInput: (0, _react2.jsx)(_react.Fragment, null, (0, _react2.jsx)(_tooltip.default, {
160
+ content: formatMessage(_messages.searchInputMessages.helpTooltipText),
161
+ position: "bottom"
162
+ }, (0, _react2.jsx)("a", {
163
+ href: AQLSupportDocumentLink,
164
+ target: "_blank",
165
+ css: buttonBaseStyles
166
+ }, (0, _react2.jsx)(_questionCircle.default, {
167
+ label: "label",
168
+ primaryColor: "var(--ds-icon, ".concat(_colors.N500, ")"),
169
+ size: "medium",
170
+ testId: "assets-datasource-modal-help"
171
+ }))), (0, _react2.jsx)(_button.LoadingButton, {
147
172
  appearance: "primary",
148
173
  css: searchButtonStyles,
149
174
  iconBefore: (0, _react2.jsx)(_search.default, {
@@ -154,7 +179,7 @@ var AqlSearchInput = function AqlSearchInput(_ref) {
154
179
  spacing: "none",
155
180
  testId: "assets-datasource-modal--aql-search-button",
156
181
  type: "submit"
157
- }),
182
+ })),
158
183
  placeholder: formatMessage(_messages.searchInputMessages.placeholder),
159
184
  testId: testId
160
185
  }));
@@ -10,6 +10,11 @@ var searchInputMessages = (0, _reactIntlNext.defineMessages)({
10
10
  id: 'linkDataSource.assets.configModal.aqlSearchInput.placeholder',
11
11
  description: 'Display text for AQL search button',
12
12
  defaultMessage: 'Search via AQL'
13
+ },
14
+ helpTooltipText: {
15
+ id: 'linkDataSource.assets.configModal.aqlSearchInput.helpTooltipText',
16
+ description: 'Link to AQL Syntax help document',
17
+ defaultMessage: 'Syntax help'
13
18
  }
14
19
  });
15
20
  exports.searchInputMessages = searchInputMessages;
@@ -10,7 +10,6 @@ var _react = require("react");
10
10
  var _react2 = require("@emotion/react");
11
11
  var _reactDom = _interopRequireDefault(require("react-dom"));
12
12
  var _tinyInvariant = _interopRequireDefault(require("tiny-invariant"));
13
- var _dragHandler = _interopRequireDefault(require("@atlaskit/icon/glyph/drag-handler"));
14
13
  var _closestEdge = require("@atlaskit/pragmatic-drag-and-drop-hitbox/addon/closest-edge");
15
14
  var _boxWithoutTerminal = require("@atlaskit/pragmatic-drag-and-drop-react-indicator/box-without-terminal");
16
15
  var _element = require("@atlaskit/pragmatic-drag-and-drop/adapter/element");
@@ -36,18 +35,6 @@ var verticallyAlignedStyles = (0, _react2.css)({
36
35
  alignItems: 'center',
37
36
  whiteSpace: 'nowrap'
38
37
  });
39
- var dragHandleStyles = (0, _react2.css)({
40
- position: 'relative',
41
- display: 'flex',
42
- alignItems: 'center',
43
- overflow: 'hidden',
44
- width: 0,
45
- transition: 'width 0.5s'
46
- });
47
- var dragHandleSpacerStyles = (0, _react2.css)({
48
- width: 24,
49
- transition: 'width 0.5s'
50
- });
51
38
  var dropTargetStyles = (0, _react2.css)({
52
39
  position: 'absolute',
53
40
  top: 0,
@@ -207,15 +194,6 @@ var DraggableTableHeading = function DraggableTableHeading(_ref) {
207
194
  edge: closestEdge
208
195
  })), (0, _react2.jsx)("div", {
209
196
  css: verticallyAlignedStyles
210
- }, (0, _react2.jsx)("div", {
211
- css: dragHandleStyles,
212
- className: "issue-like-table-drag-handle"
213
- }, (0, _react2.jsx)(_dragHandler.default, {
214
- label: "".concat(id, "-drag-icon"),
215
- size: "medium"
216
- })), children, (0, _react2.jsx)("div", {
217
- css: dragHandleSpacerStyles,
218
- className: "issue-like-table-drag-handle-spacer"
219
- })), state.type === 'preview' ? /*#__PURE__*/_reactDom.default.createPortal(dragPreview, state.container) : null);
197
+ }, children), state.type === 'preview' ? /*#__PURE__*/_reactDom.default.createPortal(dragPreview, state.container) : null);
220
198
  };
221
199
  exports.DraggableTableHeading = DraggableTableHeading;
@@ -23,6 +23,7 @@ var _pragmaticDragAndDropReactBeautifulDndAutoscroll = require("@atlaskit/pragma
23
23
  var _element = require("@atlaskit/pragmatic-drag-and-drop/adapter/element");
24
24
  var _combine = require("@atlaskit/pragmatic-drag-and-drop/util/combine");
25
25
  var _colors = require("@atlaskit/theme/colors");
26
+ var _tooltip = _interopRequireDefault(require("@atlaskit/tooltip"));
26
27
  var _columnPicker = require("./column-picker");
27
28
  var _dragColumnPreview = require("./drag-column-preview");
28
29
  var _draggableTableHeading = require("./draggable-table-heading");
@@ -338,6 +339,14 @@ var IssueLikeDataTableView = function IssueLikeDataTableView(_ref2) {
338
339
  var key = _ref11.key,
339
340
  content = _ref11.content,
340
341
  maxWidth = _ref11.maxWidth;
342
+ var heading = (0, _react2.jsx)(_tooltip.default, {
343
+ content: content,
344
+ tag: "span",
345
+ testId: 'datasource-header-content'
346
+ }, (0, _react2.jsx)(_heading.default, {
347
+ level: "h400",
348
+ as: 'span'
349
+ }, content));
341
350
  if (onVisibleColumnKeysChange && hasData) {
342
351
  var _containerRef$current3;
343
352
  var previewRows = tableRows.map(function (_ref12) {
@@ -351,9 +360,7 @@ var IssueLikeDataTableView = function IssueLikeDataTableView(_ref2) {
351
360
  }
352
361
  }).slice(0, 5);
353
362
  var dragPreview = (0, _react2.jsx)(_dragColumnPreview.DragColumnPreview, {
354
- title: (0, _react2.jsx)(_heading.default, {
355
- level: "h400"
356
- }, content),
363
+ title: heading,
357
364
  rows: previewRows
358
365
  });
359
366
  return (0, _react2.jsx)(_draggableTableHeading.DraggableTableHeading, {
@@ -364,9 +371,7 @@ var IssueLikeDataTableView = function IssueLikeDataTableView(_ref2) {
364
371
  maxWidth: maxWidth,
365
372
  dndPreviewHeight: ((_containerRef$current3 = containerRef.current) === null || _containerRef$current3 === void 0 ? void 0 : _containerRef$current3.offsetHeight) || 0,
366
373
  dragPreview: dragPreview
367
- }, (0, _react2.jsx)(_heading.default, {
368
- level: "h400"
369
- }, content));
374
+ }, heading);
370
375
  } else {
371
376
  return (0, _react2.jsx)(_styled2.TableHeading, {
372
377
  key: key,
@@ -374,9 +379,7 @@ var IssueLikeDataTableView = function IssueLikeDataTableView(_ref2) {
374
379
  style: {
375
380
  maxWidth: maxWidth
376
381
  }
377
- }, (0, _react2.jsx)(_heading.default, {
378
- level: "h400"
379
- }, content));
382
+ }, heading);
380
383
  }
381
384
  }), onVisibleColumnKeysChange && hasData && (0, _react2.jsx)(ColumnPickerHeader, null, (0, _react2.jsx)(_columnPicker.ColumnPicker, {
382
385
  columns: hasFullSchema ? orderedColumns : [],
@@ -11,7 +11,7 @@ var _colors = require("@atlaskit/theme/colors");
11
11
  var _templateObject, _templateObject2, _templateObject3;
12
12
  var Table = _styled.default.table(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n width: 100%;\n"])));
13
13
  exports.Table = Table;
14
- var TableHeading = _styled.default.th(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n cursor: grab;\n position: relative;\n padding-block: ", ";\n line-height: ", ";\n border-bottom: 2px solid ", ";\n .ProseMirror & h5,\n & h5 {\n margin-top: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n line-height: 24px; /* Is needed to keep overall height consistent with or without drag handle icon present */\n }\n\n &:hover .issue-like-table-drag-handle {\n width: 24px;\n }\n &:hover .issue-like-table-drag-handle-spacer {\n width: 0px;\n }\n"])), "var(--ds-space-100, 8px)", "var(--ds-font-lineHeight-300, 24px)", "var(--ds-background-accent-gray-subtler, ".concat(_colors.N40, ")"));
14
+ var TableHeading = _styled.default.th(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n cursor: grab;\n position: relative;\n padding-block: ", ";\n line-height: ", ";\n border-bottom: 2px solid ", ";\n & [data-testid='datasource-header-content--container'] {\n margin-top: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n line-height: ", ";\n }\n"])), "var(--ds-space-100, 8px)", "var(--ds-font-lineHeight-300, 24px)", "var(--ds-background-accent-gray-subtler, ".concat(_colors.N40, ")"), "var(--ds-font-lineHeight-300, 24px)");
15
15
  exports.TableHeading = TableHeading;
16
16
  var EmptyStateTableHeading = (0, _styled.default)(TableHeading)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n &:first-child {\n padding-left: ", ";\n }\n"])), "var(--ds-space-100, 8px)");
17
17
  exports.EmptyStateTableHeading = EmptyStateTableHeading;
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/link-datasource",
3
- "version": "0.33.1",
3
+ "version": "0.33.3",
4
4
  "sideEffects": false
5
5
  }
@@ -1,6 +1,6 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  /** @jsx jsx */
3
- import { useCallback, useRef } from 'react';
3
+ import { Fragment, useCallback, useRef } from 'react';
4
4
  import { css, jsx } from '@emotion/react';
5
5
  import { useIntl } from 'react-intl-next';
6
6
  import { LoadingButton } from '@atlaskit/button';
@@ -8,8 +8,11 @@ import { Field } from '@atlaskit/form';
8
8
  import CheckCircleIcon from '@atlaskit/icon/glyph/check-circle';
9
9
  import CrossCircleIcon from '@atlaskit/icon/glyph/cross-circle';
10
10
  import SearchIcon from '@atlaskit/icon/glyph/editor/search';
11
+ import QuestionCircleIcon from '@atlaskit/icon/glyph/question-circle';
11
12
  import Spinner from '@atlaskit/spinner';
12
13
  import Textfield from '@atlaskit/textfield';
14
+ import { N500 } from '@atlaskit/theme/colors';
15
+ import Tooltip from '@atlaskit/tooltip';
13
16
  import { useValidateAqlText } from '../../../../hooks/useValidateAqlText';
14
17
  import { aqlKey } from '../../../../types/assets/types';
15
18
  import { FieldContainer } from '../styled';
@@ -18,6 +21,16 @@ import { searchInputMessages } from './messages';
18
21
  /* Meta isn't exported in @atlaskit/form
19
22
  Taken from packages/design-system/form/src/field.tsx */
20
23
 
24
+ const buttonBaseStyles = css({
25
+ display: 'flex',
26
+ height: '100%',
27
+ position: 'relative',
28
+ alignItems: 'center',
29
+ justifyContent: 'center',
30
+ flexDirection: 'column',
31
+ marginRight: "var(--ds-space-100, 0.5em)"
32
+ });
33
+ const AQLSupportDocumentLink = 'https://support.atlassian.com/jira-service-management-cloud/docs/use-assets-query-language-aql/';
21
34
  const searchButtonStyles = css({
22
35
  marginRight: "var(--ds-space-075, 6px)"
23
36
  });
@@ -113,7 +126,19 @@ export const AqlSearchInput = ({
113
126
  width: 24
114
127
  }
115
128
  }, renderValidatorIcon(fieldProps.value, error, meta)),
116
- elemAfterInput: jsx(LoadingButton, {
129
+ elemAfterInput: jsx(Fragment, null, jsx(Tooltip, {
130
+ content: formatMessage(searchInputMessages.helpTooltipText),
131
+ position: "bottom"
132
+ }, jsx("a", {
133
+ href: AQLSupportDocumentLink,
134
+ target: "_blank",
135
+ css: buttonBaseStyles
136
+ }, jsx(QuestionCircleIcon, {
137
+ label: "label",
138
+ primaryColor: `var(--ds-icon, ${N500})`,
139
+ size: "medium",
140
+ testId: "assets-datasource-modal-help"
141
+ }))), jsx(LoadingButton, {
117
142
  appearance: "primary",
118
143
  css: searchButtonStyles,
119
144
  iconBefore: jsx(SearchIcon, {
@@ -124,7 +149,7 @@ export const AqlSearchInput = ({
124
149
  spacing: "none",
125
150
  testId: "assets-datasource-modal--aql-search-button",
126
151
  type: "submit"
127
- }),
152
+ })),
128
153
  placeholder: formatMessage(searchInputMessages.placeholder),
129
154
  testId: testId
130
155
  }))));
@@ -4,5 +4,10 @@ export const searchInputMessages = defineMessages({
4
4
  id: 'linkDataSource.assets.configModal.aqlSearchInput.placeholder',
5
5
  description: 'Display text for AQL search button',
6
6
  defaultMessage: 'Search via AQL'
7
+ },
8
+ helpTooltipText: {
9
+ id: 'linkDataSource.assets.configModal.aqlSearchInput.helpTooltipText',
10
+ description: 'Link to AQL Syntax help document',
11
+ defaultMessage: 'Syntax help'
7
12
  }
8
13
  });
@@ -3,7 +3,6 @@ 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 DragHandlerIcon from '@atlaskit/icon/glyph/drag-handler';
7
6
  import { attachClosestEdge, extractClosestEdge } from '@atlaskit/pragmatic-drag-and-drop-hitbox/addon/closest-edge';
8
7
  import { DropIndicator } from '@atlaskit/pragmatic-drag-and-drop-react-indicator/box-without-terminal';
9
8
  import { draggable, dropTargetForElements, monitorForElements } from '@atlaskit/pragmatic-drag-and-drop/adapter/element';
@@ -27,18 +26,6 @@ const verticallyAlignedStyles = css({
27
26
  alignItems: 'center',
28
27
  whiteSpace: 'nowrap'
29
28
  });
30
- const dragHandleStyles = css({
31
- position: 'relative',
32
- display: 'flex',
33
- alignItems: 'center',
34
- overflow: 'hidden',
35
- width: 0,
36
- transition: 'width 0.5s'
37
- });
38
- const dragHandleSpacerStyles = css({
39
- width: 24,
40
- transition: 'width 0.5s'
41
- });
42
29
  const dropTargetStyles = css({
43
30
  position: 'absolute',
44
31
  top: 0,
@@ -192,14 +179,5 @@ export const DraggableTableHeading = ({
192
179
  edge: closestEdge
193
180
  })), jsx("div", {
194
181
  css: verticallyAlignedStyles
195
- }, jsx("div", {
196
- css: dragHandleStyles,
197
- className: "issue-like-table-drag-handle"
198
- }, jsx(DragHandlerIcon, {
199
- label: `${id}-drag-icon`,
200
- size: "medium"
201
- })), children, jsx("div", {
202
- css: dragHandleSpacerStyles,
203
- className: "issue-like-table-drag-handle-spacer"
204
- })), state.type === 'preview' ? /*#__PURE__*/ReactDOM.createPortal(dragPreview, state.container) : null);
182
+ }, children), state.type === 'preview' ? /*#__PURE__*/ReactDOM.createPortal(dragPreview, state.container) : null);
205
183
  };
@@ -11,6 +11,7 @@ import { autoScroller } from '@atlaskit/pragmatic-drag-and-drop-react-beautiful-
11
11
  import { monitorForElements } from '@atlaskit/pragmatic-drag-and-drop/adapter/element';
12
12
  import { combine } from '@atlaskit/pragmatic-drag-and-drop/util/combine';
13
13
  import { N40 } from '@atlaskit/theme/colors';
14
+ import Tooltip from '@atlaskit/tooltip';
14
15
  import { ColumnPicker } from './column-picker';
15
16
  import { DragColumnPreview } from './drag-column-preview';
16
17
  import { DraggableTableHeading } from './draggable-table-heading';
@@ -299,6 +300,14 @@ export const IssueLikeDataTableView = ({
299
300
  content,
300
301
  maxWidth
301
302
  }, cellIndex) => {
303
+ const heading = jsx(Tooltip, {
304
+ content: content,
305
+ tag: "span",
306
+ testId: 'datasource-header-content'
307
+ }, jsx(Heading, {
308
+ level: "h400",
309
+ as: 'span'
310
+ }, content));
302
311
  if (onVisibleColumnKeysChange && hasData) {
303
312
  var _containerRef$current3;
304
313
  const previewRows = tableRows.map(({
@@ -312,9 +321,7 @@ export const IssueLikeDataTableView = ({
312
321
  }
313
322
  }).slice(0, 5);
314
323
  const dragPreview = jsx(DragColumnPreview, {
315
- title: jsx(Heading, {
316
- level: "h400"
317
- }, content),
324
+ title: heading,
318
325
  rows: previewRows
319
326
  });
320
327
  return jsx(DraggableTableHeading, {
@@ -325,9 +332,7 @@ export const IssueLikeDataTableView = ({
325
332
  maxWidth: maxWidth,
326
333
  dndPreviewHeight: ((_containerRef$current3 = containerRef.current) === null || _containerRef$current3 === void 0 ? void 0 : _containerRef$current3.offsetHeight) || 0,
327
334
  dragPreview: dragPreview
328
- }, jsx(Heading, {
329
- level: "h400"
330
- }, content));
335
+ }, heading);
331
336
  } else {
332
337
  return jsx(TableHeading, {
333
338
  key: key,
@@ -335,9 +340,7 @@ export const IssueLikeDataTableView = ({
335
340
  style: {
336
341
  maxWidth
337
342
  }
338
- }, jsx(Heading, {
339
- level: "h400"
340
- }, content));
343
+ }, heading);
341
344
  }
342
345
  }), onVisibleColumnKeysChange && hasData && jsx(ColumnPickerHeader, null, jsx(ColumnPicker, {
343
346
  columns: hasFullSchema ? orderedColumns : [],
@@ -9,20 +9,12 @@ export const TableHeading = styled.th`
9
9
  padding-block: ${"var(--ds-space-100, 8px)"};
10
10
  line-height: ${"var(--ds-font-lineHeight-300, 24px)"};
11
11
  border-bottom: 2px solid ${`var(--ds-background-accent-gray-subtler, ${N40})`};
12
- .ProseMirror & h5,
13
- & h5 {
12
+ & [data-testid='datasource-header-content--container'] {
14
13
  margin-top: 0;
15
14
  overflow: hidden;
16
15
  text-overflow: ellipsis;
17
16
  white-space: nowrap;
18
- line-height: 24px; /* Is needed to keep overall height consistent with or without drag handle icon present */
19
- }
20
-
21
- &:hover .issue-like-table-drag-handle {
22
- width: 24px;
23
- }
24
- &:hover .issue-like-table-drag-handle-spacer {
25
- width: 0px;
17
+ line-height: ${"var(--ds-font-lineHeight-300, 24px)"};
26
18
  }
27
19
  `;
28
20
  export const EmptyStateTableHeading = styled(TableHeading)`
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/link-datasource",
3
- "version": "0.33.1",
3
+ "version": "0.33.3",
4
4
  "sideEffects": false
5
5
  }
@@ -2,7 +2,7 @@ import _extends from "@babel/runtime/helpers/extends";
2
2
  import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
3
3
  import _regeneratorRuntime from "@babel/runtime/regenerator";
4
4
  /** @jsx jsx */
5
- import { useCallback, useRef } from 'react';
5
+ import { Fragment, useCallback, useRef } from 'react';
6
6
  import { css, jsx } from '@emotion/react';
7
7
  import { useIntl } from 'react-intl-next';
8
8
  import { LoadingButton } from '@atlaskit/button';
@@ -10,8 +10,11 @@ import { Field } from '@atlaskit/form';
10
10
  import CheckCircleIcon from '@atlaskit/icon/glyph/check-circle';
11
11
  import CrossCircleIcon from '@atlaskit/icon/glyph/cross-circle';
12
12
  import SearchIcon from '@atlaskit/icon/glyph/editor/search';
13
+ import QuestionCircleIcon from '@atlaskit/icon/glyph/question-circle';
13
14
  import Spinner from '@atlaskit/spinner';
14
15
  import Textfield from '@atlaskit/textfield';
16
+ import { N500 } from '@atlaskit/theme/colors';
17
+ import Tooltip from '@atlaskit/tooltip';
15
18
  import { useValidateAqlText } from '../../../../hooks/useValidateAqlText';
16
19
  import { aqlKey } from '../../../../types/assets/types';
17
20
  import { FieldContainer } from '../styled';
@@ -20,6 +23,16 @@ import { searchInputMessages } from './messages';
20
23
  /* Meta isn't exported in @atlaskit/form
21
24
  Taken from packages/design-system/form/src/field.tsx */
22
25
 
26
+ var buttonBaseStyles = css({
27
+ display: 'flex',
28
+ height: '100%',
29
+ position: 'relative',
30
+ alignItems: 'center',
31
+ justifyContent: 'center',
32
+ flexDirection: 'column',
33
+ marginRight: "var(--ds-space-100, 0.5em)"
34
+ });
35
+ var AQLSupportDocumentLink = 'https://support.atlassian.com/jira-service-management-cloud/docs/use-assets-query-language-aql/';
23
36
  var searchButtonStyles = css({
24
37
  marginRight: "var(--ds-space-075, 6px)"
25
38
  });
@@ -135,7 +148,19 @@ export var AqlSearchInput = function AqlSearchInput(_ref) {
135
148
  width: 24
136
149
  }
137
150
  }, renderValidatorIcon(fieldProps.value, error, meta)),
138
- elemAfterInput: jsx(LoadingButton, {
151
+ elemAfterInput: jsx(Fragment, null, jsx(Tooltip, {
152
+ content: formatMessage(searchInputMessages.helpTooltipText),
153
+ position: "bottom"
154
+ }, jsx("a", {
155
+ href: AQLSupportDocumentLink,
156
+ target: "_blank",
157
+ css: buttonBaseStyles
158
+ }, jsx(QuestionCircleIcon, {
159
+ label: "label",
160
+ primaryColor: "var(--ds-icon, ".concat(N500, ")"),
161
+ size: "medium",
162
+ testId: "assets-datasource-modal-help"
163
+ }))), jsx(LoadingButton, {
139
164
  appearance: "primary",
140
165
  css: searchButtonStyles,
141
166
  iconBefore: jsx(SearchIcon, {
@@ -146,7 +171,7 @@ export var AqlSearchInput = function AqlSearchInput(_ref) {
146
171
  spacing: "none",
147
172
  testId: "assets-datasource-modal--aql-search-button",
148
173
  type: "submit"
149
- }),
174
+ })),
150
175
  placeholder: formatMessage(searchInputMessages.placeholder),
151
176
  testId: testId
152
177
  }));
@@ -4,5 +4,10 @@ export var searchInputMessages = defineMessages({
4
4
  id: 'linkDataSource.assets.configModal.aqlSearchInput.placeholder',
5
5
  description: 'Display text for AQL search button',
6
6
  defaultMessage: 'Search via AQL'
7
+ },
8
+ helpTooltipText: {
9
+ id: 'linkDataSource.assets.configModal.aqlSearchInput.helpTooltipText',
10
+ description: 'Link to AQL Syntax help document',
11
+ defaultMessage: 'Syntax help'
7
12
  }
8
13
  });
@@ -4,7 +4,6 @@ import { useEffect, useRef, useState } from 'react';
4
4
  import { css, jsx } from '@emotion/react';
5
5
  import ReactDOM from 'react-dom';
6
6
  import invariant from 'tiny-invariant';
7
- import DragHandlerIcon from '@atlaskit/icon/glyph/drag-handler';
8
7
  import { attachClosestEdge, extractClosestEdge } from '@atlaskit/pragmatic-drag-and-drop-hitbox/addon/closest-edge';
9
8
  import { DropIndicator } from '@atlaskit/pragmatic-drag-and-drop-react-indicator/box-without-terminal';
10
9
  import { draggable, dropTargetForElements, monitorForElements } from '@atlaskit/pragmatic-drag-and-drop/adapter/element';
@@ -28,18 +27,6 @@ var verticallyAlignedStyles = css({
28
27
  alignItems: 'center',
29
28
  whiteSpace: 'nowrap'
30
29
  });
31
- var dragHandleStyles = css({
32
- position: 'relative',
33
- display: 'flex',
34
- alignItems: 'center',
35
- overflow: 'hidden',
36
- width: 0,
37
- transition: 'width 0.5s'
38
- });
39
- var dragHandleSpacerStyles = css({
40
- width: 24,
41
- transition: 'width 0.5s'
42
- });
43
30
  var dropTargetStyles = css({
44
31
  position: 'absolute',
45
32
  top: 0,
@@ -199,14 +186,5 @@ export var DraggableTableHeading = function DraggableTableHeading(_ref) {
199
186
  edge: closestEdge
200
187
  })), jsx("div", {
201
188
  css: verticallyAlignedStyles
202
- }, jsx("div", {
203
- css: dragHandleStyles,
204
- className: "issue-like-table-drag-handle"
205
- }, jsx(DragHandlerIcon, {
206
- label: "".concat(id, "-drag-icon"),
207
- size: "medium"
208
- })), children, jsx("div", {
209
- css: dragHandleSpacerStyles,
210
- className: "issue-like-table-drag-handle-spacer"
211
- })), state.type === 'preview' ? /*#__PURE__*/ReactDOM.createPortal(dragPreview, state.container) : null);
189
+ }, children), state.type === 'preview' ? /*#__PURE__*/ReactDOM.createPortal(dragPreview, state.container) : null);
212
190
  };
@@ -20,6 +20,7 @@ import { autoScroller } from '@atlaskit/pragmatic-drag-and-drop-react-beautiful-
20
20
  import { monitorForElements } from '@atlaskit/pragmatic-drag-and-drop/adapter/element';
21
21
  import { combine } from '@atlaskit/pragmatic-drag-and-drop/util/combine';
22
22
  import { N40 } from '@atlaskit/theme/colors';
23
+ import Tooltip from '@atlaskit/tooltip';
23
24
  import { ColumnPicker } from './column-picker';
24
25
  import { DragColumnPreview } from './drag-column-preview';
25
26
  import { DraggableTableHeading } from './draggable-table-heading';
@@ -331,6 +332,14 @@ export var IssueLikeDataTableView = function IssueLikeDataTableView(_ref2) {
331
332
  var key = _ref11.key,
332
333
  content = _ref11.content,
333
334
  maxWidth = _ref11.maxWidth;
335
+ var heading = jsx(Tooltip, {
336
+ content: content,
337
+ tag: "span",
338
+ testId: 'datasource-header-content'
339
+ }, jsx(Heading, {
340
+ level: "h400",
341
+ as: 'span'
342
+ }, content));
334
343
  if (onVisibleColumnKeysChange && hasData) {
335
344
  var _containerRef$current3;
336
345
  var previewRows = tableRows.map(function (_ref12) {
@@ -344,9 +353,7 @@ export var IssueLikeDataTableView = function IssueLikeDataTableView(_ref2) {
344
353
  }
345
354
  }).slice(0, 5);
346
355
  var dragPreview = jsx(DragColumnPreview, {
347
- title: jsx(Heading, {
348
- level: "h400"
349
- }, content),
356
+ title: heading,
350
357
  rows: previewRows
351
358
  });
352
359
  return jsx(DraggableTableHeading, {
@@ -357,9 +364,7 @@ export var IssueLikeDataTableView = function IssueLikeDataTableView(_ref2) {
357
364
  maxWidth: maxWidth,
358
365
  dndPreviewHeight: ((_containerRef$current3 = containerRef.current) === null || _containerRef$current3 === void 0 ? void 0 : _containerRef$current3.offsetHeight) || 0,
359
366
  dragPreview: dragPreview
360
- }, jsx(Heading, {
361
- level: "h400"
362
- }, content));
367
+ }, heading);
363
368
  } else {
364
369
  return jsx(TableHeading, {
365
370
  key: key,
@@ -367,9 +372,7 @@ export var IssueLikeDataTableView = function IssueLikeDataTableView(_ref2) {
367
372
  style: {
368
373
  maxWidth: maxWidth
369
374
  }
370
- }, jsx(Heading, {
371
- level: "h400"
372
- }, content));
375
+ }, heading);
373
376
  }
374
377
  }), onVisibleColumnKeysChange && hasData && jsx(ColumnPickerHeader, null, jsx(ColumnPicker, {
375
378
  columns: hasFullSchema ? orderedColumns : [],
@@ -3,5 +3,5 @@ var _templateObject, _templateObject2, _templateObject3;
3
3
  import styled from '@emotion/styled';
4
4
  import { N40 } from '@atlaskit/theme/colors';
5
5
  export var Table = styled.table(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n width: 100%;\n"])));
6
- export var TableHeading = styled.th(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n cursor: grab;\n position: relative;\n padding-block: ", ";\n line-height: ", ";\n border-bottom: 2px solid ", ";\n .ProseMirror & h5,\n & h5 {\n margin-top: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n line-height: 24px; /* Is needed to keep overall height consistent with or without drag handle icon present */\n }\n\n &:hover .issue-like-table-drag-handle {\n width: 24px;\n }\n &:hover .issue-like-table-drag-handle-spacer {\n width: 0px;\n }\n"])), "var(--ds-space-100, 8px)", "var(--ds-font-lineHeight-300, 24px)", "var(--ds-background-accent-gray-subtler, ".concat(N40, ")"));
6
+ export var TableHeading = styled.th(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n cursor: grab;\n position: relative;\n padding-block: ", ";\n line-height: ", ";\n border-bottom: 2px solid ", ";\n & [data-testid='datasource-header-content--container'] {\n margin-top: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n line-height: ", ";\n }\n"])), "var(--ds-space-100, 8px)", "var(--ds-font-lineHeight-300, 24px)", "var(--ds-background-accent-gray-subtler, ".concat(N40, ")"), "var(--ds-font-lineHeight-300, 24px)");
7
7
  export var EmptyStateTableHeading = styled(TableHeading)(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n &:first-child {\n padding-left: ", ";\n }\n"])), "var(--ds-space-100, 8px)");
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/link-datasource",
3
- "version": "0.33.1",
3
+ "version": "0.33.3",
4
4
  "sideEffects": false
5
5
  }
@@ -4,4 +4,9 @@ export declare const searchInputMessages: {
4
4
  description: string;
5
5
  defaultMessage: string;
6
6
  };
7
+ helpTooltipText: {
8
+ id: string;
9
+ description: string;
10
+ defaultMessage: string;
11
+ };
7
12
  };
@@ -4,4 +4,9 @@ export declare const searchInputMessages: {
4
4
  description: string;
5
5
  defaultMessage: string;
6
6
  };
7
+ helpTooltipText: {
8
+ id: string;
9
+ description: string;
10
+ defaultMessage: string;
11
+ };
7
12
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/link-datasource",
3
- "version": "0.33.1",
3
+ "version": "0.33.3",
4
4
  "description": "UI Components to support linking platform dataset feature",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -56,6 +56,7 @@
56
56
  "@atlaskit/textfield": "5.6.3",
57
57
  "@atlaskit/theme": "^12.5.0",
58
58
  "@atlaskit/tokens": "^1.14.0",
59
+ "@atlaskit/tooltip": "^17.8.0",
59
60
  "@atlassianlabs/jql-editor": "^2.0.1",
60
61
  "@atlassianlabs/jql-editor-autocomplete-rest": "^1.1.2",
61
62
  "@babel/runtime": "^7.0.0",