@atlaskit/link-datasource 1.24.6 → 1.24.7
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 +6 -0
- package/dist/cjs/ui/common/modal/content-container/index.js +35 -0
- package/dist/cjs/ui/confluence-search-modal/modal/index.js +2 -17
- package/dist/cjs/ui/issue-like-table/index.js +2 -0
- package/dist/cjs/ui/jira-issues-modal/modal/index.js +5 -20
- package/dist/es2019/ui/common/modal/content-container/index.js +30 -0
- package/dist/es2019/ui/confluence-search-modal/modal/index.js +2 -17
- package/dist/es2019/ui/issue-like-table/index.js +5 -0
- package/dist/es2019/ui/jira-issues-modal/modal/index.js +7 -22
- package/dist/esm/ui/common/modal/content-container/index.js +29 -0
- package/dist/esm/ui/confluence-search-modal/modal/index.js +2 -17
- package/dist/esm/ui/issue-like-table/index.js +2 -0
- package/dist/esm/ui/jira-issues-modal/modal/index.js +7 -22
- package/dist/types/ui/common/modal/content-container/index.d.ts +8 -0
- package/dist/types-ts4.5/ui/common/modal/content-container/index.d.ts +8 -0
- package/examples-helpers/mockSmartLinkData.ts +44 -0
- package/examples-helpers/smartLinkCustomClient.ts +31 -20
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @atlaskit/link-datasource
|
|
2
2
|
|
|
3
|
+
## 1.24.7
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#83952](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/83952) [`300149437193`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/300149437193) - [ux] Make smart-links rendered non-word-wrapped (truncated) by default and only be word-wrapped when user chooses it
|
|
8
|
+
|
|
3
9
|
## 1.24.6
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.ContentContainer = void 0;
|
|
7
|
+
var _react = require("@emotion/react");
|
|
8
|
+
var _primitives = require("@atlaskit/primitives");
|
|
9
|
+
var _colors = require("@atlaskit/theme/colors");
|
|
10
|
+
var _issueLikeTable = require("../../../issue-like-table");
|
|
11
|
+
/** @jsx jsx */
|
|
12
|
+
|
|
13
|
+
var contentContainerStyles = (0, _primitives.xcss)({
|
|
14
|
+
display: 'grid',
|
|
15
|
+
maxHeight: '420px',
|
|
16
|
+
overflow: 'auto',
|
|
17
|
+
borderBottom: "2px solid ".concat("var(--ds-background-accent-gray-subtler, ".concat(_colors.N40, ")")),
|
|
18
|
+
backgroundImage: _issueLikeTable.scrollableContainerShadowsCssComponents.backgroundImage,
|
|
19
|
+
backgroundPosition: _issueLikeTable.scrollableContainerShadowsCssComponents.backgroundPosition,
|
|
20
|
+
backgroundRepeat: _issueLikeTable.scrollableContainerShadowsCssComponents.backgroundRepeat,
|
|
21
|
+
backgroundSize: _issueLikeTable.scrollableContainerShadowsCssComponents.backgroundSize,
|
|
22
|
+
backgroundAttachment: _issueLikeTable.scrollableContainerShadowsCssComponents.backgroundAttachment
|
|
23
|
+
});
|
|
24
|
+
var tableContainerStyles = (0, _primitives.xcss)({
|
|
25
|
+
borderTopLeftRadius: "var(--ds-border-radius-200, 8px)",
|
|
26
|
+
borderTopRightRadius: "var(--ds-border-radius-200, 8px)",
|
|
27
|
+
border: "1px solid ".concat("var(--ds-border, ".concat(_colors.N40, ")"))
|
|
28
|
+
});
|
|
29
|
+
var ContentContainer = exports.ContentContainer = function ContentContainer(_ref) {
|
|
30
|
+
var children = _ref.children,
|
|
31
|
+
withTableBorder = _ref.withTableBorder;
|
|
32
|
+
return (0, _react.jsx)(_primitives.Box, {
|
|
33
|
+
xcss: [contentContainerStyles, withTableBorder && tableContainerStyles]
|
|
34
|
+
}, children);
|
|
35
|
+
};
|
|
@@ -16,33 +16,20 @@ var _reactIntlNext = require("react-intl-next");
|
|
|
16
16
|
var _standardButton = _interopRequireDefault(require("@atlaskit/button/standard-button"));
|
|
17
17
|
var _intlMessagesProvider = require("@atlaskit/intl-messages-provider");
|
|
18
18
|
var _modalDialog = _interopRequireWildcard(require("@atlaskit/modal-dialog"));
|
|
19
|
-
var _primitives = require("@atlaskit/primitives");
|
|
20
|
-
var _colors = require("@atlaskit/theme/colors");
|
|
21
19
|
var _fetchMessagesForLocale = require("../../../common/utils/locale/fetch-messages-for-locale");
|
|
22
20
|
var _en = _interopRequireDefault(require("../../../i18n/en"));
|
|
23
21
|
var _getAvailableSites = require("../../../services/getAvailableSites");
|
|
24
22
|
var _noInstances = require("../../common/error-state/no-instances");
|
|
25
23
|
var _initialStateView = require("../../common/initial-state-view");
|
|
26
24
|
var _basicSearchInput = require("../../common/modal/basic-search-input");
|
|
25
|
+
var _contentContainer = require("../../common/modal/content-container");
|
|
27
26
|
var _siteSelector = require("../../common/modal/site-selector");
|
|
28
|
-
var _issueLikeTable = require("../../issue-like-table");
|
|
29
27
|
var _confluenceSearchInitialStateSvg = require("./confluence-search-initial-state-svg");
|
|
30
28
|
var _messages = require("./messages");
|
|
31
29
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
32
30
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
33
31
|
/** @jsx jsx */
|
|
34
32
|
|
|
35
|
-
var contentContainerStyles = (0, _primitives.xcss)({
|
|
36
|
-
display: 'grid',
|
|
37
|
-
maxHeight: '420px',
|
|
38
|
-
overflow: 'auto',
|
|
39
|
-
borderBottom: "2px solid ".concat("var(--ds-background-accent-gray-subtler, ".concat(_colors.N40, ")")),
|
|
40
|
-
backgroundImage: _issueLikeTable.scrollableContainerShadowsCssComponents.backgroundImage,
|
|
41
|
-
backgroundPosition: _issueLikeTable.scrollableContainerShadowsCssComponents.backgroundPosition,
|
|
42
|
-
backgroundRepeat: _issueLikeTable.scrollableContainerShadowsCssComponents.backgroundRepeat,
|
|
43
|
-
backgroundSize: _issueLikeTable.scrollableContainerShadowsCssComponents.backgroundSize,
|
|
44
|
-
backgroundAttachment: _issueLikeTable.scrollableContainerShadowsCssComponents.backgroundAttachment
|
|
45
|
-
});
|
|
46
33
|
var ConfluenceSearchConfigModal = exports.ConfluenceSearchConfigModal = function ConfluenceSearchConfigModal(props) {
|
|
47
34
|
var initialParameters = props.parameters,
|
|
48
35
|
onCancel = props.onCancel;
|
|
@@ -131,9 +118,7 @@ var ConfluenceSearchConfigModal = exports.ConfluenceSearchConfigModal = function
|
|
|
131
118
|
searchTerm: searchTerm,
|
|
132
119
|
placeholder: _messages.confluenceSearchModalMessages.searchLabel,
|
|
133
120
|
fullWidth: true
|
|
134
|
-
}), (0, _react2.jsx)(
|
|
135
|
-
xcss: contentContainerStyles
|
|
136
|
-
}, (0, _react2.jsx)(_initialStateView.InitialStateView, {
|
|
121
|
+
}), (0, _react2.jsx)(_contentContainer.ContentContainer, null, (0, _react2.jsx)(_initialStateView.InitialStateView, {
|
|
137
122
|
icon: (0, _react2.jsx)(_confluenceSearchInitialStateSvg.ConfluenceSearchInitialStateSVG, null),
|
|
138
123
|
title: _messages.confluenceSearchModalMessages.initialViewSearchTitle,
|
|
139
124
|
description: _messages.confluenceSearchModalMessages.initialViewSearchDescription
|
|
@@ -85,6 +85,8 @@ var TableCell = _styled.default.td((_styled$td = {}, (0, _defineProperty2.defaul
|
|
|
85
85
|
}), (0, _defineProperty2.default)(_styled$td, "".concat((0, _styled2.withTablePluginBodyPrefix)('&:last-child')), {
|
|
86
86
|
borderRight: 0,
|
|
87
87
|
paddingRight: "var(--ds-space-100, 8px)"
|
|
88
|
+
}), (0, _defineProperty2.default)(_styled$td, "& [data-testid='inline-card-icon-and-title'], " + "& [data-testid='button-connect-account'] > span", {
|
|
89
|
+
whiteSpace: 'unset'
|
|
88
90
|
}), _styled$td));
|
|
89
91
|
var tableContainerStyles = (0, _react2.css)({
|
|
90
92
|
borderRadius: 'inherit',
|
|
@@ -42,6 +42,7 @@ var _noInstances = require("../../common/error-state/no-instances");
|
|
|
42
42
|
var _noResults = require("../../common/error-state/no-results");
|
|
43
43
|
var _initialStateView = require("../../common/initial-state-view");
|
|
44
44
|
var _messages2 = require("../../common/initial-state-view/messages");
|
|
45
|
+
var _contentContainer = require("../../common/modal/content-container");
|
|
45
46
|
var _siteSelector = require("../../common/modal/site-selector");
|
|
46
47
|
var _issueLikeTable = require("../../issue-like-table");
|
|
47
48
|
var _link = _interopRequireDefault(require("../../issue-like-table/render-type/link"));
|
|
@@ -55,22 +56,6 @@ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return
|
|
|
55
56
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
56
57
|
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; }
|
|
57
58
|
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; } /** @jsx jsx */
|
|
58
|
-
var tableContainerStyles = (0, _react2.css)({
|
|
59
|
-
borderTopLeftRadius: "var(--ds-border-radius-200, 8px)",
|
|
60
|
-
borderTopRightRadius: "var(--ds-border-radius-200, 8px)",
|
|
61
|
-
border: "1px solid ".concat("var(--ds-border, ".concat(_colors.N40, ")"))
|
|
62
|
-
});
|
|
63
|
-
var contentContainerStyles = (0, _react2.css)({
|
|
64
|
-
display: 'grid',
|
|
65
|
-
maxHeight: '420px',
|
|
66
|
-
overflow: 'auto',
|
|
67
|
-
borderBottom: "2px solid ".concat("var(--ds-background-accent-gray-subtler, ".concat(_colors.N40, ")")),
|
|
68
|
-
backgroundImage: _issueLikeTable.scrollableContainerShadowsCssComponents.backgroundImage,
|
|
69
|
-
backgroundPosition: _issueLikeTable.scrollableContainerShadowsCssComponents.backgroundPosition,
|
|
70
|
-
backgroundRepeat: _issueLikeTable.scrollableContainerShadowsCssComponents.backgroundRepeat,
|
|
71
|
-
backgroundSize: _issueLikeTable.scrollableContainerShadowsCssComponents.backgroundSize,
|
|
72
|
-
backgroundAttachment: _issueLikeTable.scrollableContainerShadowsCssComponents.backgroundAttachment
|
|
73
|
-
});
|
|
74
59
|
var placeholderSmartLinkStyles = (0, _react2.css)({
|
|
75
60
|
backgroundColor: "var(--ds-surface-raised, ".concat(_colors.N0, ")"),
|
|
76
61
|
borderRadius: "var(--ds-border-radius-200, 3px)",
|
|
@@ -475,8 +460,8 @@ var PlainJiraIssuesConfigModal = exports.PlainJiraIssuesConfigModal = function P
|
|
|
475
460
|
setVisibleColumnKeys(newVisibleColumnKeys);
|
|
476
461
|
}, [visibleColumnKeys]);
|
|
477
462
|
var issueLikeDataTableView = (0, _react.useMemo)(function () {
|
|
478
|
-
return (0, _react2.jsx)(
|
|
479
|
-
|
|
463
|
+
return (0, _react2.jsx)(_contentContainer.ContentContainer, {
|
|
464
|
+
withTableBorder: true
|
|
480
465
|
}, (0, _react2.jsx)(_issueLikeTable.IssueLikeDataTableView, {
|
|
481
466
|
testId: "jira-datasource-table",
|
|
482
467
|
status: status,
|
|
@@ -536,8 +521,8 @@ var PlainJiraIssuesConfigModal = exports.PlainJiraIssuesConfigModal = function P
|
|
|
536
521
|
return (0, _react2.jsx)(_noResults.NoResults, null);
|
|
537
522
|
} else if (status === 'empty' || !columns.length) {
|
|
538
523
|
// persist the empty state when making the initial /data request which contains the columns
|
|
539
|
-
return (0, _react2.jsx)(
|
|
540
|
-
|
|
524
|
+
return (0, _react2.jsx)(_contentContainer.ContentContainer, {
|
|
525
|
+
withTableBorder: !!jql
|
|
541
526
|
}, !!jql ? (0, _react2.jsx)(_issueLikeTable.EmptyState, {
|
|
542
527
|
testId: "jira-datasource-modal--empty-state"
|
|
543
528
|
}) : (0, _react2.jsx)(_initialStateView.InitialStateView, {
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
|
|
3
|
+
import { jsx } from '@emotion/react';
|
|
4
|
+
import { Box, xcss } from '@atlaskit/primitives';
|
|
5
|
+
import { N40 } from '@atlaskit/theme/colors';
|
|
6
|
+
import { scrollableContainerShadowsCssComponents } from '../../../issue-like-table';
|
|
7
|
+
const contentContainerStyles = xcss({
|
|
8
|
+
display: 'grid',
|
|
9
|
+
maxHeight: '420px',
|
|
10
|
+
overflow: 'auto',
|
|
11
|
+
borderBottom: `2px solid ${`var(--ds-background-accent-gray-subtler, ${N40})`}`,
|
|
12
|
+
backgroundImage: scrollableContainerShadowsCssComponents.backgroundImage,
|
|
13
|
+
backgroundPosition: scrollableContainerShadowsCssComponents.backgroundPosition,
|
|
14
|
+
backgroundRepeat: scrollableContainerShadowsCssComponents.backgroundRepeat,
|
|
15
|
+
backgroundSize: scrollableContainerShadowsCssComponents.backgroundSize,
|
|
16
|
+
backgroundAttachment: scrollableContainerShadowsCssComponents.backgroundAttachment
|
|
17
|
+
});
|
|
18
|
+
const tableContainerStyles = xcss({
|
|
19
|
+
borderTopLeftRadius: "var(--ds-border-radius-200, 8px)",
|
|
20
|
+
borderTopRightRadius: "var(--ds-border-radius-200, 8px)",
|
|
21
|
+
border: `1px solid ${`var(--ds-border, ${N40})`}`
|
|
22
|
+
});
|
|
23
|
+
export const ContentContainer = ({
|
|
24
|
+
children,
|
|
25
|
+
withTableBorder
|
|
26
|
+
}) => {
|
|
27
|
+
return jsx(Box, {
|
|
28
|
+
xcss: [contentContainerStyles, withTableBorder && tableContainerStyles]
|
|
29
|
+
}, children);
|
|
30
|
+
};
|
|
@@ -5,29 +5,16 @@ import { FormattedMessage } from 'react-intl-next';
|
|
|
5
5
|
import Button from '@atlaskit/button/standard-button';
|
|
6
6
|
import { IntlMessagesProvider } from '@atlaskit/intl-messages-provider';
|
|
7
7
|
import Modal, { ModalBody, ModalFooter, ModalHeader, ModalTitle } from '@atlaskit/modal-dialog';
|
|
8
|
-
import { Box, xcss } from '@atlaskit/primitives';
|
|
9
|
-
import { N40 } from '@atlaskit/theme/colors';
|
|
10
8
|
import { fetchMessagesForLocale } from '../../../common/utils/locale/fetch-messages-for-locale';
|
|
11
9
|
import i18nEN from '../../../i18n/en';
|
|
12
10
|
import { getAvailableSites } from '../../../services/getAvailableSites';
|
|
13
11
|
import { NoInstancesView } from '../../common/error-state/no-instances';
|
|
14
12
|
import { InitialStateView } from '../../common/initial-state-view';
|
|
15
13
|
import { BasicSearchInput } from '../../common/modal/basic-search-input';
|
|
14
|
+
import { ContentContainer } from '../../common/modal/content-container';
|
|
16
15
|
import { SiteSelector } from '../../common/modal/site-selector';
|
|
17
|
-
import { scrollableContainerShadowsCssComponents } from '../../issue-like-table';
|
|
18
16
|
import { ConfluenceSearchInitialStateSVG } from './confluence-search-initial-state-svg';
|
|
19
17
|
import { confluenceSearchModalMessages } from './messages';
|
|
20
|
-
const contentContainerStyles = xcss({
|
|
21
|
-
display: 'grid',
|
|
22
|
-
maxHeight: '420px',
|
|
23
|
-
overflow: 'auto',
|
|
24
|
-
borderBottom: `2px solid ${`var(--ds-background-accent-gray-subtler, ${N40})`}`,
|
|
25
|
-
backgroundImage: scrollableContainerShadowsCssComponents.backgroundImage,
|
|
26
|
-
backgroundPosition: scrollableContainerShadowsCssComponents.backgroundPosition,
|
|
27
|
-
backgroundRepeat: scrollableContainerShadowsCssComponents.backgroundRepeat,
|
|
28
|
-
backgroundSize: scrollableContainerShadowsCssComponents.backgroundSize,
|
|
29
|
-
backgroundAttachment: scrollableContainerShadowsCssComponents.backgroundAttachment
|
|
30
|
-
});
|
|
31
18
|
export const ConfluenceSearchConfigModal = props => {
|
|
32
19
|
const {
|
|
33
20
|
parameters: initialParameters,
|
|
@@ -86,9 +73,7 @@ export const ConfluenceSearchConfigModal = props => {
|
|
|
86
73
|
searchTerm: searchTerm,
|
|
87
74
|
placeholder: confluenceSearchModalMessages.searchLabel,
|
|
88
75
|
fullWidth: true
|
|
89
|
-
}), jsx(
|
|
90
|
-
xcss: contentContainerStyles
|
|
91
|
-
}, jsx(InitialStateView, {
|
|
76
|
+
}), jsx(ContentContainer, null, jsx(InitialStateView, {
|
|
92
77
|
icon: jsx(ConfluenceSearchInitialStateSVG, null),
|
|
93
78
|
title: confluenceSearchModalMessages.initialViewSearchTitle,
|
|
94
79
|
description: confluenceSearchModalMessages.initialViewSearchDescription
|
|
@@ -76,6 +76,11 @@ const TableCell = styled.td({
|
|
|
76
76
|
[`${withTablePluginBodyPrefix('&:last-child')}`]: {
|
|
77
77
|
borderRight: 0,
|
|
78
78
|
paddingRight: "var(--ds-space-100, 8px)"
|
|
79
|
+
},
|
|
80
|
+
// Inline smart links are pretty opinionated about word-wrapping.
|
|
81
|
+
// We want it to be controlled by user, so we make it overflow and truncate by default.
|
|
82
|
+
["& [data-testid='inline-card-icon-and-title'], " + "& [data-testid='button-connect-account'] > span"]: {
|
|
83
|
+
whiteSpace: 'unset'
|
|
79
84
|
}
|
|
80
85
|
});
|
|
81
86
|
const tableContainerStyles = css({
|
|
@@ -10,7 +10,7 @@ import { IntlMessagesProvider } from '@atlaskit/intl-messages-provider';
|
|
|
10
10
|
import Modal, { ModalBody, ModalFooter, ModalHeader, ModalTitle, ModalTransition } from '@atlaskit/modal-dialog';
|
|
11
11
|
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
12
12
|
import LinkUrl from '@atlaskit/smart-card/link-url';
|
|
13
|
-
import { B400, N0,
|
|
13
|
+
import { B400, N0, N800 } from '@atlaskit/theme/colors';
|
|
14
14
|
import { EVENT_CHANNEL, useDatasourceAnalyticsEvents } from '../../../analytics';
|
|
15
15
|
import { componentMetadata } from '../../../analytics/constants';
|
|
16
16
|
import { DatasourceAction, DatasourceDisplay } from '../../../analytics/types';
|
|
@@ -30,8 +30,9 @@ import { NoInstancesView } from '../../common/error-state/no-instances';
|
|
|
30
30
|
import { NoResults } from '../../common/error-state/no-results';
|
|
31
31
|
import { InitialStateView } from '../../common/initial-state-view';
|
|
32
32
|
import { initialStateViewMessages } from '../../common/initial-state-view/messages';
|
|
33
|
+
import { ContentContainer } from '../../common/modal/content-container';
|
|
33
34
|
import { SiteSelector } from '../../common/modal/site-selector';
|
|
34
|
-
import { EmptyState, IssueLikeDataTableView
|
|
35
|
+
import { EmptyState, IssueLikeDataTableView } from '../../issue-like-table';
|
|
35
36
|
import LinkRenderType from '../../issue-like-table/render-type/link';
|
|
36
37
|
import { availableBasicFilterTypes } from '../basic-filters/ui';
|
|
37
38
|
import { isQueryTooComplex } from '../basic-filters/utils/isQueryTooComplex';
|
|
@@ -39,22 +40,6 @@ import { JiraSearchContainer } from '../jira-search-container';
|
|
|
39
40
|
import { JiraDisplayViewDropDown } from './jira-display-view-dropdown/jira-display-view-drop-down';
|
|
40
41
|
import { JiraInitialStateSVG } from './jira-issues-initial-state-svg';
|
|
41
42
|
import { modalMessages } from './messages';
|
|
42
|
-
const tableContainerStyles = css({
|
|
43
|
-
borderTopLeftRadius: "var(--ds-border-radius-200, 8px)",
|
|
44
|
-
borderTopRightRadius: "var(--ds-border-radius-200, 8px)",
|
|
45
|
-
border: `1px solid ${`var(--ds-border, ${N40})`}`
|
|
46
|
-
});
|
|
47
|
-
const contentContainerStyles = css({
|
|
48
|
-
display: 'grid',
|
|
49
|
-
maxHeight: '420px',
|
|
50
|
-
overflow: 'auto',
|
|
51
|
-
borderBottom: `2px solid ${`var(--ds-background-accent-gray-subtler, ${N40})`}`,
|
|
52
|
-
backgroundImage: scrollableContainerShadowsCssComponents.backgroundImage,
|
|
53
|
-
backgroundPosition: scrollableContainerShadowsCssComponents.backgroundPosition,
|
|
54
|
-
backgroundRepeat: scrollableContainerShadowsCssComponents.backgroundRepeat,
|
|
55
|
-
backgroundSize: scrollableContainerShadowsCssComponents.backgroundSize,
|
|
56
|
-
backgroundAttachment: scrollableContainerShadowsCssComponents.backgroundAttachment
|
|
57
|
-
});
|
|
58
43
|
const placeholderSmartLinkStyles = css({
|
|
59
44
|
backgroundColor: `var(--ds-surface-raised, ${N0})`,
|
|
60
45
|
borderRadius: "var(--ds-border-radius-200, 3px)",
|
|
@@ -424,8 +409,8 @@ export const PlainJiraIssuesConfigModal = props => {
|
|
|
424
409
|
visibleColumnCount.current = newVisibleColumnKeys.length;
|
|
425
410
|
setVisibleColumnKeys(newVisibleColumnKeys);
|
|
426
411
|
}, [visibleColumnKeys]);
|
|
427
|
-
const issueLikeDataTableView = useMemo(() => jsx(
|
|
428
|
-
|
|
412
|
+
const issueLikeDataTableView = useMemo(() => jsx(ContentContainer, {
|
|
413
|
+
withTableBorder: true
|
|
429
414
|
}, jsx(IssueLikeDataTableView, {
|
|
430
415
|
testId: "jira-datasource-table",
|
|
431
416
|
status: status,
|
|
@@ -484,8 +469,8 @@ export const PlainJiraIssuesConfigModal = props => {
|
|
|
484
469
|
return jsx(NoResults, null);
|
|
485
470
|
} else if (status === 'empty' || !columns.length) {
|
|
486
471
|
// persist the empty state when making the initial /data request which contains the columns
|
|
487
|
-
return jsx(
|
|
488
|
-
|
|
472
|
+
return jsx(ContentContainer, {
|
|
473
|
+
withTableBorder: !!jql
|
|
489
474
|
}, !!jql ? jsx(EmptyState, {
|
|
490
475
|
testId: `jira-datasource-modal--empty-state`
|
|
491
476
|
}) : jsx(InitialStateView, {
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
|
|
3
|
+
import { jsx } from '@emotion/react';
|
|
4
|
+
import { Box, xcss } from '@atlaskit/primitives';
|
|
5
|
+
import { N40 } from '@atlaskit/theme/colors';
|
|
6
|
+
import { scrollableContainerShadowsCssComponents } from '../../../issue-like-table';
|
|
7
|
+
var contentContainerStyles = xcss({
|
|
8
|
+
display: 'grid',
|
|
9
|
+
maxHeight: '420px',
|
|
10
|
+
overflow: 'auto',
|
|
11
|
+
borderBottom: "2px solid ".concat("var(--ds-background-accent-gray-subtler, ".concat(N40, ")")),
|
|
12
|
+
backgroundImage: scrollableContainerShadowsCssComponents.backgroundImage,
|
|
13
|
+
backgroundPosition: scrollableContainerShadowsCssComponents.backgroundPosition,
|
|
14
|
+
backgroundRepeat: scrollableContainerShadowsCssComponents.backgroundRepeat,
|
|
15
|
+
backgroundSize: scrollableContainerShadowsCssComponents.backgroundSize,
|
|
16
|
+
backgroundAttachment: scrollableContainerShadowsCssComponents.backgroundAttachment
|
|
17
|
+
});
|
|
18
|
+
var tableContainerStyles = xcss({
|
|
19
|
+
borderTopLeftRadius: "var(--ds-border-radius-200, 8px)",
|
|
20
|
+
borderTopRightRadius: "var(--ds-border-radius-200, 8px)",
|
|
21
|
+
border: "1px solid ".concat("var(--ds-border, ".concat(N40, ")"))
|
|
22
|
+
});
|
|
23
|
+
export var ContentContainer = function ContentContainer(_ref) {
|
|
24
|
+
var children = _ref.children,
|
|
25
|
+
withTableBorder = _ref.withTableBorder;
|
|
26
|
+
return jsx(Box, {
|
|
27
|
+
xcss: [contentContainerStyles, withTableBorder && tableContainerStyles]
|
|
28
|
+
}, children);
|
|
29
|
+
};
|
|
@@ -9,29 +9,16 @@ import { FormattedMessage } from 'react-intl-next';
|
|
|
9
9
|
import Button from '@atlaskit/button/standard-button';
|
|
10
10
|
import { IntlMessagesProvider } from '@atlaskit/intl-messages-provider';
|
|
11
11
|
import Modal, { ModalBody, ModalFooter, ModalHeader, ModalTitle } from '@atlaskit/modal-dialog';
|
|
12
|
-
import { Box, xcss } from '@atlaskit/primitives';
|
|
13
|
-
import { N40 } from '@atlaskit/theme/colors';
|
|
14
12
|
import { fetchMessagesForLocale } from '../../../common/utils/locale/fetch-messages-for-locale';
|
|
15
13
|
import i18nEN from '../../../i18n/en';
|
|
16
14
|
import { getAvailableSites } from '../../../services/getAvailableSites';
|
|
17
15
|
import { NoInstancesView } from '../../common/error-state/no-instances';
|
|
18
16
|
import { InitialStateView } from '../../common/initial-state-view';
|
|
19
17
|
import { BasicSearchInput } from '../../common/modal/basic-search-input';
|
|
18
|
+
import { ContentContainer } from '../../common/modal/content-container';
|
|
20
19
|
import { SiteSelector } from '../../common/modal/site-selector';
|
|
21
|
-
import { scrollableContainerShadowsCssComponents } from '../../issue-like-table';
|
|
22
20
|
import { ConfluenceSearchInitialStateSVG } from './confluence-search-initial-state-svg';
|
|
23
21
|
import { confluenceSearchModalMessages } from './messages';
|
|
24
|
-
var contentContainerStyles = xcss({
|
|
25
|
-
display: 'grid',
|
|
26
|
-
maxHeight: '420px',
|
|
27
|
-
overflow: 'auto',
|
|
28
|
-
borderBottom: "2px solid ".concat("var(--ds-background-accent-gray-subtler, ".concat(N40, ")")),
|
|
29
|
-
backgroundImage: scrollableContainerShadowsCssComponents.backgroundImage,
|
|
30
|
-
backgroundPosition: scrollableContainerShadowsCssComponents.backgroundPosition,
|
|
31
|
-
backgroundRepeat: scrollableContainerShadowsCssComponents.backgroundRepeat,
|
|
32
|
-
backgroundSize: scrollableContainerShadowsCssComponents.backgroundSize,
|
|
33
|
-
backgroundAttachment: scrollableContainerShadowsCssComponents.backgroundAttachment
|
|
34
|
-
});
|
|
35
22
|
export var ConfluenceSearchConfigModal = function ConfluenceSearchConfigModal(props) {
|
|
36
23
|
var initialParameters = props.parameters,
|
|
37
24
|
onCancel = props.onCancel;
|
|
@@ -120,9 +107,7 @@ export var ConfluenceSearchConfigModal = function ConfluenceSearchConfigModal(pr
|
|
|
120
107
|
searchTerm: searchTerm,
|
|
121
108
|
placeholder: confluenceSearchModalMessages.searchLabel,
|
|
122
109
|
fullWidth: true
|
|
123
|
-
}), jsx(
|
|
124
|
-
xcss: contentContainerStyles
|
|
125
|
-
}, jsx(InitialStateView, {
|
|
110
|
+
}), jsx(ContentContainer, null, jsx(InitialStateView, {
|
|
126
111
|
icon: jsx(ConfluenceSearchInitialStateSVG, null),
|
|
127
112
|
title: confluenceSearchModalMessages.initialViewSearchTitle,
|
|
128
113
|
description: confluenceSearchModalMessages.initialViewSearchDescription
|
|
@@ -78,6 +78,8 @@ var TableCell = styled.td((_styled$td = {}, _defineProperty(_styled$td, "".conca
|
|
|
78
78
|
}), _defineProperty(_styled$td, "".concat(withTablePluginBodyPrefix('&:last-child')), {
|
|
79
79
|
borderRight: 0,
|
|
80
80
|
paddingRight: "var(--ds-space-100, 8px)"
|
|
81
|
+
}), _defineProperty(_styled$td, "& [data-testid='inline-card-icon-and-title'], " + "& [data-testid='button-connect-account'] > span", {
|
|
82
|
+
whiteSpace: 'unset'
|
|
81
83
|
}), _styled$td));
|
|
82
84
|
var tableContainerStyles = css({
|
|
83
85
|
borderRadius: 'inherit',
|
|
@@ -17,7 +17,7 @@ import { IntlMessagesProvider } from '@atlaskit/intl-messages-provider';
|
|
|
17
17
|
import Modal, { ModalBody, ModalFooter, ModalHeader, ModalTitle, ModalTransition } from '@atlaskit/modal-dialog';
|
|
18
18
|
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
19
19
|
import LinkUrl from '@atlaskit/smart-card/link-url';
|
|
20
|
-
import { B400, N0,
|
|
20
|
+
import { B400, N0, N800 } from '@atlaskit/theme/colors';
|
|
21
21
|
import { EVENT_CHANNEL, useDatasourceAnalyticsEvents } from '../../../analytics';
|
|
22
22
|
import { componentMetadata } from '../../../analytics/constants';
|
|
23
23
|
import { DatasourceAction, DatasourceDisplay } from '../../../analytics/types';
|
|
@@ -37,8 +37,9 @@ import { NoInstancesView } from '../../common/error-state/no-instances';
|
|
|
37
37
|
import { NoResults } from '../../common/error-state/no-results';
|
|
38
38
|
import { InitialStateView } from '../../common/initial-state-view';
|
|
39
39
|
import { initialStateViewMessages } from '../../common/initial-state-view/messages';
|
|
40
|
+
import { ContentContainer } from '../../common/modal/content-container';
|
|
40
41
|
import { SiteSelector } from '../../common/modal/site-selector';
|
|
41
|
-
import { EmptyState, IssueLikeDataTableView
|
|
42
|
+
import { EmptyState, IssueLikeDataTableView } from '../../issue-like-table';
|
|
42
43
|
import LinkRenderType from '../../issue-like-table/render-type/link';
|
|
43
44
|
import { availableBasicFilterTypes } from '../basic-filters/ui';
|
|
44
45
|
import { isQueryTooComplex } from '../basic-filters/utils/isQueryTooComplex';
|
|
@@ -46,22 +47,6 @@ import { JiraSearchContainer } from '../jira-search-container';
|
|
|
46
47
|
import { JiraDisplayViewDropDown } from './jira-display-view-dropdown/jira-display-view-drop-down';
|
|
47
48
|
import { JiraInitialStateSVG } from './jira-issues-initial-state-svg';
|
|
48
49
|
import { modalMessages } from './messages';
|
|
49
|
-
var tableContainerStyles = css({
|
|
50
|
-
borderTopLeftRadius: "var(--ds-border-radius-200, 8px)",
|
|
51
|
-
borderTopRightRadius: "var(--ds-border-radius-200, 8px)",
|
|
52
|
-
border: "1px solid ".concat("var(--ds-border, ".concat(N40, ")"))
|
|
53
|
-
});
|
|
54
|
-
var contentContainerStyles = css({
|
|
55
|
-
display: 'grid',
|
|
56
|
-
maxHeight: '420px',
|
|
57
|
-
overflow: 'auto',
|
|
58
|
-
borderBottom: "2px solid ".concat("var(--ds-background-accent-gray-subtler, ".concat(N40, ")")),
|
|
59
|
-
backgroundImage: scrollableContainerShadowsCssComponents.backgroundImage,
|
|
60
|
-
backgroundPosition: scrollableContainerShadowsCssComponents.backgroundPosition,
|
|
61
|
-
backgroundRepeat: scrollableContainerShadowsCssComponents.backgroundRepeat,
|
|
62
|
-
backgroundSize: scrollableContainerShadowsCssComponents.backgroundSize,
|
|
63
|
-
backgroundAttachment: scrollableContainerShadowsCssComponents.backgroundAttachment
|
|
64
|
-
});
|
|
65
50
|
var placeholderSmartLinkStyles = css({
|
|
66
51
|
backgroundColor: "var(--ds-surface-raised, ".concat(N0, ")"),
|
|
67
52
|
borderRadius: "var(--ds-border-radius-200, 3px)",
|
|
@@ -466,8 +451,8 @@ export var PlainJiraIssuesConfigModal = function PlainJiraIssuesConfigModal(prop
|
|
|
466
451
|
setVisibleColumnKeys(newVisibleColumnKeys);
|
|
467
452
|
}, [visibleColumnKeys]);
|
|
468
453
|
var issueLikeDataTableView = useMemo(function () {
|
|
469
|
-
return jsx(
|
|
470
|
-
|
|
454
|
+
return jsx(ContentContainer, {
|
|
455
|
+
withTableBorder: true
|
|
471
456
|
}, jsx(IssueLikeDataTableView, {
|
|
472
457
|
testId: "jira-datasource-table",
|
|
473
458
|
status: status,
|
|
@@ -527,8 +512,8 @@ export var PlainJiraIssuesConfigModal = function PlainJiraIssuesConfigModal(prop
|
|
|
527
512
|
return jsx(NoResults, null);
|
|
528
513
|
} else if (status === 'empty' || !columns.length) {
|
|
529
514
|
// persist the empty state when making the initial /data request which contains the columns
|
|
530
|
-
return jsx(
|
|
531
|
-
|
|
515
|
+
return jsx(ContentContainer, {
|
|
516
|
+
withTableBorder: !!jql
|
|
532
517
|
}, !!jql ? jsx(EmptyState, {
|
|
533
518
|
testId: "jira-datasource-modal--empty-state"
|
|
534
519
|
}) : jsx(InitialStateView, {
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
import { jsx } from '@emotion/react';
|
|
4
|
+
export interface ContentContainerProps {
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
withTableBorder?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare const ContentContainer: ({ children, withTableBorder, }: ContentContainerProps) => jsx.JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
import { jsx } from '@emotion/react';
|
|
4
|
+
export interface ContentContainerProps {
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
withTableBorder?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare const ContentContainer: ({ children, withTableBorder, }: ContentContainerProps) => jsx.JSX.Element;
|
|
@@ -64,4 +64,48 @@ export const mocks = {
|
|
|
64
64
|
url: 'https://product-fabric.atlassian.net/browse/EDM-5941',
|
|
65
65
|
},
|
|
66
66
|
} as JsonLd.Response,
|
|
67
|
+
notFound: {
|
|
68
|
+
meta: {
|
|
69
|
+
visibility: 'not_found',
|
|
70
|
+
access: 'forbidden',
|
|
71
|
+
auth: [],
|
|
72
|
+
definitionId: 'd1',
|
|
73
|
+
key: 'object-provider',
|
|
74
|
+
},
|
|
75
|
+
data: {
|
|
76
|
+
'@context': {
|
|
77
|
+
'@vocab': 'https://www.w3.org/ns/activitystreams#',
|
|
78
|
+
atlassian: 'https://schema.atlassian.com/ns/vocabulary#',
|
|
79
|
+
schema: 'http://schema.org/',
|
|
80
|
+
},
|
|
81
|
+
'@type': 'Object',
|
|
82
|
+
name: 'I love cheese',
|
|
83
|
+
url: 'https://some.url',
|
|
84
|
+
},
|
|
85
|
+
} as JsonLd.Response,
|
|
86
|
+
forbidden: {
|
|
87
|
+
meta: {
|
|
88
|
+
visibility: 'restricted',
|
|
89
|
+
access: 'forbidden',
|
|
90
|
+
auth: [
|
|
91
|
+
{
|
|
92
|
+
key: 'some-flow',
|
|
93
|
+
displayName: 'Flow',
|
|
94
|
+
url: 'https://outbound-auth/flow',
|
|
95
|
+
},
|
|
96
|
+
],
|
|
97
|
+
definitionId: 'd1',
|
|
98
|
+
key: 'object-provider',
|
|
99
|
+
},
|
|
100
|
+
data: {
|
|
101
|
+
'@context': {
|
|
102
|
+
'@vocab': 'https://www.w3.org/ns/activitystreams#',
|
|
103
|
+
atlassian: 'https://schema.atlassian.com/ns/vocabulary#',
|
|
104
|
+
schema: 'http://schema.org/',
|
|
105
|
+
},
|
|
106
|
+
'@type': 'Object',
|
|
107
|
+
name: 'I love cheese',
|
|
108
|
+
url: 'https://some.url',
|
|
109
|
+
},
|
|
110
|
+
} as JsonLd.Response,
|
|
67
111
|
};
|
|
@@ -8,27 +8,38 @@ import { mocks } from './mockSmartLinkData';
|
|
|
8
8
|
|
|
9
9
|
const jqlUrlRegExp = /.+[jql=].+/;
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
11
|
+
const mockedFetch = (url: string): Promise<JsonLd.Response> => {
|
|
12
|
+
switch (url) {
|
|
13
|
+
case 'https://product-fabric.atlassian.net/browse/EDM-5941':
|
|
14
|
+
case 'https://product-fabric.atlassian.net/browse/EDM-5591':
|
|
15
|
+
return Promise.resolve(mocks.resolved);
|
|
16
|
+
case 'https://link-that-does-not-resolve.com':
|
|
17
|
+
return Promise.reject(`Can't resolve from ${url}`);
|
|
18
|
+
case 'https://link-that-is-still-resolving.com/long-url/very-very-very-very-very-very-very-long':
|
|
19
|
+
return new Promise(() => {});
|
|
20
|
+
case 'https://link-that-is-unauthorized.com':
|
|
21
|
+
return Promise.resolve(mocks.unauthorized);
|
|
22
|
+
case 'https://link-that-is-not-found.com/long':
|
|
23
|
+
return Promise.resolve(mocks.notFound);
|
|
24
|
+
case 'https://link-that-is-forbidden.com':
|
|
25
|
+
return Promise.resolve(mocks.forbidden);
|
|
26
|
+
case 'https://link-that-is-unsupported.com':
|
|
27
|
+
throw new APIError(
|
|
28
|
+
'fatal',
|
|
29
|
+
new URL(url).hostname,
|
|
30
|
+
'received unsupported error',
|
|
31
|
+
'ResolveUnsupportedError',
|
|
32
|
+
);
|
|
33
|
+
case jqlUrlRegExp.test(url) ? url : undefined:
|
|
34
|
+
return Promise.resolve(mockJqlSmartLinkData.resolved);
|
|
35
|
+
default:
|
|
36
|
+
return Promise.resolve(mocks.unauthorized);
|
|
31
37
|
}
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
class SmartLinkClient extends CardClient {
|
|
41
|
+
prefetchData = mockedFetch;
|
|
42
|
+
fetchData = mockedFetch;
|
|
32
43
|
}
|
|
33
44
|
|
|
34
45
|
export default SmartLinkClient;
|