@atlaskit/link-datasource 1.19.13 → 1.19.15
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 +13 -0
- package/dist/cjs/analytics/constants.js +1 -1
- package/dist/cjs/ui/assets-modal/modal/index.js +7 -15
- package/dist/cjs/ui/assets-modal/modal/render-assets-content/index.js +50 -18
- package/dist/es2019/analytics/constants.js +1 -1
- package/dist/es2019/ui/assets-modal/modal/index.js +8 -16
- package/dist/es2019/ui/assets-modal/modal/render-assets-content/index.js +40 -18
- package/dist/esm/analytics/constants.js +1 -1
- package/dist/esm/ui/assets-modal/modal/index.js +8 -16
- package/dist/esm/ui/assets-modal/modal/render-assets-content/index.js +50 -18
- package/dist/types/ui/assets-modal/modal/render-assets-content/index.d.ts +1 -0
- package/dist/types-ts4.5/ui/assets-modal/modal/render-assets-content/index.d.ts +1 -0
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @atlaskit/link-datasource
|
|
2
2
|
|
|
3
|
+
## 1.19.15
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#56962](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/56962) [`b21600324544`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/b21600324544) - [ux] Updated styling of datasource table in Assets Config Modal
|
|
8
|
+
- Updated dependencies
|
|
9
|
+
|
|
10
|
+
## 1.19.14
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- [#57894](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/57894) [`81bd6e9856b2`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/81bd6e9856b2) - Fix flaky basic filter test.
|
|
15
|
+
|
|
3
16
|
## 1.19.13
|
|
4
17
|
|
|
5
18
|
### Patch Changes
|
|
@@ -7,5 +7,5 @@ exports.packageMetaData = exports.EVENT_CHANNEL = void 0;
|
|
|
7
7
|
var EVENT_CHANNEL = exports.EVENT_CHANNEL = 'media';
|
|
8
8
|
var packageMetaData = exports.packageMetaData = {
|
|
9
9
|
packageName: "@atlaskit/link-datasource",
|
|
10
|
-
packageVersion: "1.19.
|
|
10
|
+
packageVersion: "1.19.15"
|
|
11
11
|
};
|
|
@@ -32,7 +32,6 @@ var _en = _interopRequireDefault(require("../../../i18n/en"));
|
|
|
32
32
|
var _cmdbService = require("../../../services/cmdbService.utils");
|
|
33
33
|
var _accessRequired = require("../../../ui/common/error-state/access-required");
|
|
34
34
|
var _modalLoadingError = require("../../common/error-state/modal-loading-error");
|
|
35
|
-
var _issueLikeTable = require("../../issue-like-table");
|
|
36
35
|
var _searchContainer = require("../search-container");
|
|
37
36
|
var _loadingState = require("../search-container/loading-state");
|
|
38
37
|
var _messages = require("./messages");
|
|
@@ -41,17 +40,10 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
41
40
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
42
41
|
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; }
|
|
43
42
|
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 */
|
|
44
|
-
var modalBodyWrapperStyles = (0, _react2.css)({
|
|
45
|
-
display: 'grid',
|
|
46
|
-
height: '420px',
|
|
47
|
-
overflow: 'auto',
|
|
48
|
-
background: _issueLikeTable.scrollableContainerShadowsCssComponents.background,
|
|
49
|
-
backgroundRepeat: _issueLikeTable.scrollableContainerShadowsCssComponents.backgroundRepeat,
|
|
50
|
-
backgroundSize: _issueLikeTable.scrollableContainerShadowsCssComponents.backgroundSize,
|
|
51
|
-
backgroundAttachment: _issueLikeTable.scrollableContainerShadowsCssComponents.backgroundAttachment
|
|
52
|
-
});
|
|
53
43
|
var modalBodyErrorWrapperStyles = (0, _react2.css)({
|
|
54
|
-
alignItems: 'center'
|
|
44
|
+
alignItems: 'center',
|
|
45
|
+
display: 'grid',
|
|
46
|
+
height: _renderAssetsContent.MODAL_HEIGHT
|
|
55
47
|
});
|
|
56
48
|
var AssetsModalTitle = (0, _react2.jsx)(_modalDialog.ModalTitle, null, (0, _react2.jsx)(_reactIntlNext.FormattedMessage, _messages.modalMessages.insertObjectsTitle));
|
|
57
49
|
var PlainAssetsConfigModal = function PlainAssetsConfigModal(props) {
|
|
@@ -367,9 +359,9 @@ var PlainAssetsConfigModal = function PlainAssetsConfigModal(props) {
|
|
|
367
359
|
width: "calc(100% - 80px)",
|
|
368
360
|
shouldScrollInViewport: true,
|
|
369
361
|
shouldCloseOnOverlayClick: false
|
|
370
|
-
}, (0, _react2.jsx)(_modalDialog.ModalHeader, null, renderModalTitleContent()), (0, _react2.jsx)(_modalDialog.ModalBody, null, (0, _react2.jsx)("div", {
|
|
371
|
-
css:
|
|
372
|
-
},
|
|
362
|
+
}, (0, _react2.jsx)(_modalDialog.ModalHeader, null, renderModalTitleContent()), (0, _react2.jsx)(_modalDialog.ModalBody, null, errorState ? (0, _react2.jsx)("div", {
|
|
363
|
+
css: modalBodyErrorWrapperStyles
|
|
364
|
+
}, renderErrorState()) : (0, _react2.jsx)(_renderAssetsContent.RenderAssetsContent, {
|
|
373
365
|
isFetchingInitialData: assetsClientLoading,
|
|
374
366
|
status: status,
|
|
375
367
|
responseItems: responseItems,
|
|
@@ -384,7 +376,7 @@ var PlainAssetsConfigModal = function PlainAssetsConfigModal(props) {
|
|
|
384
376
|
columns: columns,
|
|
385
377
|
defaultVisibleColumnKeys: defaultVisibleColumnKeys,
|
|
386
378
|
modalRenderInstanceId: modalRenderInstanceId
|
|
387
|
-
}))
|
|
379
|
+
})), (0, _react2.jsx)(_modalDialog.ModalFooter, null, (0, _react2.jsx)(_standardButton.default, {
|
|
388
380
|
appearance: "default",
|
|
389
381
|
onClick: onCancelClick,
|
|
390
382
|
testId: 'asset-datasource-modal--cancel-button'
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.RenderAssetsContent = void 0;
|
|
6
|
+
exports.RenderAssetsContent = exports.MODAL_HEIGHT = void 0;
|
|
7
7
|
var _react = require("react");
|
|
8
8
|
var _react2 = require("@emotion/react");
|
|
9
9
|
var _colors = require("@atlaskit/theme/colors");
|
|
@@ -14,16 +14,54 @@ var _issueLikeTable = require("../../../issue-like-table");
|
|
|
14
14
|
var _initialStateView = require("./initial-state-view");
|
|
15
15
|
/** @jsx jsx */
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
var MODAL_HEIGHT = exports.MODAL_HEIGHT = 420;
|
|
18
|
+
|
|
19
|
+
// This is to prevent y scrollbar when showing table loading state
|
|
20
|
+
var disableOverflowStyles = (0, _react2.css)({
|
|
20
21
|
overflow: 'hidden'
|
|
21
22
|
});
|
|
23
|
+
var contentContainerStyles = (0, _react2.css)({
|
|
24
|
+
height: MODAL_HEIGHT,
|
|
25
|
+
display: 'grid',
|
|
26
|
+
overflow: 'auto'
|
|
27
|
+
});
|
|
22
28
|
var tableBordersStyles = (0, _react2.css)({
|
|
23
29
|
border: "1px solid ".concat("var(--ds-border, ".concat(_colors.N40, ")")),
|
|
24
30
|
borderTopLeftRadius: "var(--ds-border-radius-200, 8px)",
|
|
25
|
-
borderTopRightRadius: "var(--ds-border-radius-200, 8px)"
|
|
31
|
+
borderTopRightRadius: "var(--ds-border-radius-200, 8px)",
|
|
32
|
+
borderBottom: "2px solid ".concat("var(--ds-background-accent-gray-subtler, ".concat(_colors.N40, ")")),
|
|
33
|
+
background: _issueLikeTable.scrollableContainerShadowsCssComponents.background,
|
|
34
|
+
backgroundRepeat: _issueLikeTable.scrollableContainerShadowsCssComponents.backgroundRepeat,
|
|
35
|
+
backgroundSize: _issueLikeTable.scrollableContainerShadowsCssComponents.backgroundSize,
|
|
36
|
+
backgroundAttachment: _issueLikeTable.scrollableContainerShadowsCssComponents.backgroundAttachment
|
|
26
37
|
});
|
|
38
|
+
var RejectedView = function RejectedView() {
|
|
39
|
+
return (0, _react2.jsx)("div", {
|
|
40
|
+
css: [contentContainerStyles]
|
|
41
|
+
}, (0, _react2.jsx)(_modalLoadingError.ModalLoadingError, null));
|
|
42
|
+
};
|
|
43
|
+
var UnauthorizedView = function UnauthorizedView() {
|
|
44
|
+
return (0, _react2.jsx)("div", {
|
|
45
|
+
css: [contentContainerStyles]
|
|
46
|
+
}, (0, _react2.jsx)(_accessRequired.AccessRequired, null));
|
|
47
|
+
};
|
|
48
|
+
var EmptyView = function EmptyView() {
|
|
49
|
+
return (0, _react2.jsx)("div", {
|
|
50
|
+
css: [contentContainerStyles]
|
|
51
|
+
}, (0, _react2.jsx)(_initialStateView.InitialStateView, null));
|
|
52
|
+
};
|
|
53
|
+
var NoResultsView = function NoResultsView() {
|
|
54
|
+
return (0, _react2.jsx)("div", {
|
|
55
|
+
css: [contentContainerStyles]
|
|
56
|
+
}, (0, _react2.jsx)(_noResults.NoResults, null));
|
|
57
|
+
};
|
|
58
|
+
var LoadingView = function LoadingView() {
|
|
59
|
+
return (0, _react2.jsx)("div", {
|
|
60
|
+
css: [contentContainerStyles, contentContainerStyles, tableBordersStyles, disableOverflowStyles]
|
|
61
|
+
}, (0, _react2.jsx)(_issueLikeTable.EmptyState, {
|
|
62
|
+
testId: "assets-aql-datasource-modal--loading-state"
|
|
63
|
+
}));
|
|
64
|
+
};
|
|
27
65
|
var RenderAssetsContent = exports.RenderAssetsContent = function RenderAssetsContent(props) {
|
|
28
66
|
var status = props.status,
|
|
29
67
|
responseItems = props.responseItems,
|
|
@@ -39,7 +77,7 @@ var RenderAssetsContent = exports.RenderAssetsContent = function RenderAssetsCon
|
|
|
39
77
|
var resolvedWithNoResults = status === 'resolved' && !responseItems.length;
|
|
40
78
|
var issueLikeDataTableView = (0, _react.useMemo)(function () {
|
|
41
79
|
return (0, _react2.jsx)("div", {
|
|
42
|
-
css: tableBordersStyles
|
|
80
|
+
css: [contentContainerStyles, tableBordersStyles]
|
|
43
81
|
}, (0, _react2.jsx)(_issueLikeTable.IssueLikeDataTableView, {
|
|
44
82
|
testId: "asset-datasource-table",
|
|
45
83
|
status: status,
|
|
@@ -55,23 +93,17 @@ var RenderAssetsContent = exports.RenderAssetsContent = function RenderAssetsCon
|
|
|
55
93
|
}, [columns, defaultVisibleColumnKeys, hasNextPage, loadDatasourceDetails, onNextPage, onVisibleColumnKeysChange, responseItems, status, visibleColumnKeys, modalRenderInstanceId]);
|
|
56
94
|
if (isFetchingInitialData) {
|
|
57
95
|
// Placing this check first as it's a priority before all others
|
|
58
|
-
return (0, _react2.jsx)(
|
|
59
|
-
css: [tableBordersStyles, emptyStateOverrideStyles]
|
|
60
|
-
}, (0, _react2.jsx)(_issueLikeTable.EmptyState, {
|
|
61
|
-
testId: "assets-aql-datasource-modal--loading-state"
|
|
62
|
-
}));
|
|
96
|
+
return (0, _react2.jsx)(LoadingView, null);
|
|
63
97
|
} else if (status === 'rejected') {
|
|
64
|
-
return (0, _react2.jsx)(
|
|
98
|
+
return (0, _react2.jsx)(RejectedView, null);
|
|
65
99
|
} else if (status === 'unauthorized') {
|
|
66
|
-
return (0, _react2.jsx)(
|
|
100
|
+
return (0, _react2.jsx)(UnauthorizedView, null);
|
|
67
101
|
} else if (status === 'empty') {
|
|
68
|
-
return (0, _react2.jsx)(
|
|
102
|
+
return (0, _react2.jsx)(EmptyView, null);
|
|
69
103
|
} else if (resolvedWithNoResults) {
|
|
70
|
-
return (0, _react2.jsx)(
|
|
104
|
+
return (0, _react2.jsx)(NoResultsView, null);
|
|
71
105
|
} else if (status === 'loading' && !columns.length) {
|
|
72
|
-
return (0, _react2.jsx)(
|
|
73
|
-
testId: "assets-aql-datasource-modal--loading-state"
|
|
74
|
-
});
|
|
106
|
+
return (0, _react2.jsx)(LoadingView, null);
|
|
75
107
|
}
|
|
76
108
|
return issueLikeDataTableView;
|
|
77
109
|
};
|
|
@@ -21,22 +21,14 @@ import i18nEN from '../../../i18n/en';
|
|
|
21
21
|
import { PermissionError } from '../../../services/cmdbService.utils';
|
|
22
22
|
import { AccessRequired } from '../../../ui/common/error-state/access-required';
|
|
23
23
|
import { ModalLoadingError } from '../../common/error-state/modal-loading-error';
|
|
24
|
-
import { scrollableContainerShadowsCssComponents } from '../../issue-like-table';
|
|
25
24
|
import { AssetsSearchContainer } from '../search-container';
|
|
26
25
|
import { AssetsSearchContainerLoading } from '../search-container/loading-state';
|
|
27
26
|
import { modalMessages } from './messages';
|
|
28
|
-
import { RenderAssetsContent } from './render-assets-content';
|
|
29
|
-
const modalBodyWrapperStyles = css({
|
|
30
|
-
display: 'grid',
|
|
31
|
-
height: '420px',
|
|
32
|
-
overflow: 'auto',
|
|
33
|
-
background: scrollableContainerShadowsCssComponents.background,
|
|
34
|
-
backgroundRepeat: scrollableContainerShadowsCssComponents.backgroundRepeat,
|
|
35
|
-
backgroundSize: scrollableContainerShadowsCssComponents.backgroundSize,
|
|
36
|
-
backgroundAttachment: scrollableContainerShadowsCssComponents.backgroundAttachment
|
|
37
|
-
});
|
|
27
|
+
import { MODAL_HEIGHT, RenderAssetsContent } from './render-assets-content';
|
|
38
28
|
const modalBodyErrorWrapperStyles = css({
|
|
39
|
-
alignItems: 'center'
|
|
29
|
+
alignItems: 'center',
|
|
30
|
+
display: 'grid',
|
|
31
|
+
height: MODAL_HEIGHT
|
|
40
32
|
});
|
|
41
33
|
const AssetsModalTitle = jsx(ModalTitle, null, jsx(FormattedMessage, modalMessages.insertObjectsTitle));
|
|
42
34
|
const PlainAssetsConfigModal = props => {
|
|
@@ -327,9 +319,9 @@ const PlainAssetsConfigModal = props => {
|
|
|
327
319
|
width: "calc(100% - 80px)",
|
|
328
320
|
shouldScrollInViewport: true,
|
|
329
321
|
shouldCloseOnOverlayClick: false
|
|
330
|
-
}, jsx(ModalHeader, null, renderModalTitleContent()), jsx(ModalBody, null, jsx("div", {
|
|
331
|
-
css:
|
|
332
|
-
},
|
|
322
|
+
}, jsx(ModalHeader, null, renderModalTitleContent()), jsx(ModalBody, null, errorState ? jsx("div", {
|
|
323
|
+
css: modalBodyErrorWrapperStyles
|
|
324
|
+
}, renderErrorState()) : jsx(RenderAssetsContent, {
|
|
333
325
|
isFetchingInitialData: assetsClientLoading,
|
|
334
326
|
status: status,
|
|
335
327
|
responseItems: responseItems,
|
|
@@ -344,7 +336,7 @@ const PlainAssetsConfigModal = props => {
|
|
|
344
336
|
columns: columns,
|
|
345
337
|
defaultVisibleColumnKeys: defaultVisibleColumnKeys,
|
|
346
338
|
modalRenderInstanceId: modalRenderInstanceId
|
|
347
|
-
}))
|
|
339
|
+
})), jsx(ModalFooter, null, jsx(Button, {
|
|
348
340
|
appearance: "default",
|
|
349
341
|
onClick: onCancelClick,
|
|
350
342
|
testId: 'asset-datasource-modal--cancel-button'
|
|
@@ -5,18 +5,46 @@ import { N40 } from '@atlaskit/theme/colors';
|
|
|
5
5
|
import { AccessRequired } from '../../../common/error-state/access-required';
|
|
6
6
|
import { ModalLoadingError } from '../../../common/error-state/modal-loading-error';
|
|
7
7
|
import { NoResults } from '../../../common/error-state/no-results';
|
|
8
|
-
import { EmptyState, IssueLikeDataTableView } from '../../../issue-like-table';
|
|
8
|
+
import { EmptyState, IssueLikeDataTableView, scrollableContainerShadowsCssComponents } from '../../../issue-like-table';
|
|
9
9
|
import { InitialStateView } from './initial-state-view';
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
export const MODAL_HEIGHT = 420;
|
|
11
|
+
|
|
12
|
+
// This is to prevent y scrollbar when showing table loading state
|
|
13
|
+
const disableOverflowStyles = css({
|
|
13
14
|
overflow: 'hidden'
|
|
14
15
|
});
|
|
16
|
+
const contentContainerStyles = css({
|
|
17
|
+
height: MODAL_HEIGHT,
|
|
18
|
+
display: 'grid',
|
|
19
|
+
overflow: 'auto'
|
|
20
|
+
});
|
|
15
21
|
const tableBordersStyles = css({
|
|
16
22
|
border: `1px solid ${`var(--ds-border, ${N40})`}`,
|
|
17
23
|
borderTopLeftRadius: "var(--ds-border-radius-200, 8px)",
|
|
18
|
-
borderTopRightRadius: "var(--ds-border-radius-200, 8px)"
|
|
24
|
+
borderTopRightRadius: "var(--ds-border-radius-200, 8px)",
|
|
25
|
+
borderBottom: `2px solid ${`var(--ds-background-accent-gray-subtler, ${N40})`}`,
|
|
26
|
+
background: scrollableContainerShadowsCssComponents.background,
|
|
27
|
+
backgroundRepeat: scrollableContainerShadowsCssComponents.backgroundRepeat,
|
|
28
|
+
backgroundSize: scrollableContainerShadowsCssComponents.backgroundSize,
|
|
29
|
+
backgroundAttachment: scrollableContainerShadowsCssComponents.backgroundAttachment
|
|
19
30
|
});
|
|
31
|
+
const RejectedView = () => jsx("div", {
|
|
32
|
+
css: [contentContainerStyles]
|
|
33
|
+
}, jsx(ModalLoadingError, null));
|
|
34
|
+
const UnauthorizedView = () => jsx("div", {
|
|
35
|
+
css: [contentContainerStyles]
|
|
36
|
+
}, jsx(AccessRequired, null));
|
|
37
|
+
const EmptyView = () => jsx("div", {
|
|
38
|
+
css: [contentContainerStyles]
|
|
39
|
+
}, jsx(InitialStateView, null));
|
|
40
|
+
const NoResultsView = () => jsx("div", {
|
|
41
|
+
css: [contentContainerStyles]
|
|
42
|
+
}, jsx(NoResults, null));
|
|
43
|
+
const LoadingView = () => jsx("div", {
|
|
44
|
+
css: [contentContainerStyles, contentContainerStyles, tableBordersStyles, disableOverflowStyles]
|
|
45
|
+
}, jsx(EmptyState, {
|
|
46
|
+
testId: "assets-aql-datasource-modal--loading-state"
|
|
47
|
+
}));
|
|
20
48
|
export const RenderAssetsContent = props => {
|
|
21
49
|
const {
|
|
22
50
|
status,
|
|
@@ -33,7 +61,7 @@ export const RenderAssetsContent = props => {
|
|
|
33
61
|
} = props;
|
|
34
62
|
const resolvedWithNoResults = status === 'resolved' && !responseItems.length;
|
|
35
63
|
const issueLikeDataTableView = useMemo(() => jsx("div", {
|
|
36
|
-
css: tableBordersStyles
|
|
64
|
+
css: [contentContainerStyles, tableBordersStyles]
|
|
37
65
|
}, jsx(IssueLikeDataTableView, {
|
|
38
66
|
testId: "asset-datasource-table",
|
|
39
67
|
status: status,
|
|
@@ -48,23 +76,17 @@ export const RenderAssetsContent = props => {
|
|
|
48
76
|
})), [columns, defaultVisibleColumnKeys, hasNextPage, loadDatasourceDetails, onNextPage, onVisibleColumnKeysChange, responseItems, status, visibleColumnKeys, modalRenderInstanceId]);
|
|
49
77
|
if (isFetchingInitialData) {
|
|
50
78
|
// Placing this check first as it's a priority before all others
|
|
51
|
-
return jsx(
|
|
52
|
-
css: [tableBordersStyles, emptyStateOverrideStyles]
|
|
53
|
-
}, jsx(EmptyState, {
|
|
54
|
-
testId: "assets-aql-datasource-modal--loading-state"
|
|
55
|
-
}));
|
|
79
|
+
return jsx(LoadingView, null);
|
|
56
80
|
} else if (status === 'rejected') {
|
|
57
|
-
return jsx(
|
|
81
|
+
return jsx(RejectedView, null);
|
|
58
82
|
} else if (status === 'unauthorized') {
|
|
59
|
-
return jsx(
|
|
83
|
+
return jsx(UnauthorizedView, null);
|
|
60
84
|
} else if (status === 'empty') {
|
|
61
|
-
return jsx(
|
|
85
|
+
return jsx(EmptyView, null);
|
|
62
86
|
} else if (resolvedWithNoResults) {
|
|
63
|
-
return jsx(
|
|
87
|
+
return jsx(NoResultsView, null);
|
|
64
88
|
} else if (status === 'loading' && !columns.length) {
|
|
65
|
-
return jsx(
|
|
66
|
-
testId: "assets-aql-datasource-modal--loading-state"
|
|
67
|
-
});
|
|
89
|
+
return jsx(LoadingView, null);
|
|
68
90
|
}
|
|
69
91
|
return issueLikeDataTableView;
|
|
70
92
|
};
|
|
@@ -27,22 +27,14 @@ import i18nEN from '../../../i18n/en';
|
|
|
27
27
|
import { PermissionError } from '../../../services/cmdbService.utils';
|
|
28
28
|
import { AccessRequired } from '../../../ui/common/error-state/access-required';
|
|
29
29
|
import { ModalLoadingError } from '../../common/error-state/modal-loading-error';
|
|
30
|
-
import { scrollableContainerShadowsCssComponents } from '../../issue-like-table';
|
|
31
30
|
import { AssetsSearchContainer } from '../search-container';
|
|
32
31
|
import { AssetsSearchContainerLoading } from '../search-container/loading-state';
|
|
33
32
|
import { modalMessages } from './messages';
|
|
34
|
-
import { RenderAssetsContent } from './render-assets-content';
|
|
35
|
-
var modalBodyWrapperStyles = css({
|
|
36
|
-
display: 'grid',
|
|
37
|
-
height: '420px',
|
|
38
|
-
overflow: 'auto',
|
|
39
|
-
background: scrollableContainerShadowsCssComponents.background,
|
|
40
|
-
backgroundRepeat: scrollableContainerShadowsCssComponents.backgroundRepeat,
|
|
41
|
-
backgroundSize: scrollableContainerShadowsCssComponents.backgroundSize,
|
|
42
|
-
backgroundAttachment: scrollableContainerShadowsCssComponents.backgroundAttachment
|
|
43
|
-
});
|
|
33
|
+
import { MODAL_HEIGHT, RenderAssetsContent } from './render-assets-content';
|
|
44
34
|
var modalBodyErrorWrapperStyles = css({
|
|
45
|
-
alignItems: 'center'
|
|
35
|
+
alignItems: 'center',
|
|
36
|
+
display: 'grid',
|
|
37
|
+
height: MODAL_HEIGHT
|
|
46
38
|
});
|
|
47
39
|
var AssetsModalTitle = jsx(ModalTitle, null, jsx(FormattedMessage, modalMessages.insertObjectsTitle));
|
|
48
40
|
var PlainAssetsConfigModal = function PlainAssetsConfigModal(props) {
|
|
@@ -358,9 +350,9 @@ var PlainAssetsConfigModal = function PlainAssetsConfigModal(props) {
|
|
|
358
350
|
width: "calc(100% - 80px)",
|
|
359
351
|
shouldScrollInViewport: true,
|
|
360
352
|
shouldCloseOnOverlayClick: false
|
|
361
|
-
}, jsx(ModalHeader, null, renderModalTitleContent()), jsx(ModalBody, null, jsx("div", {
|
|
362
|
-
css:
|
|
363
|
-
},
|
|
353
|
+
}, jsx(ModalHeader, null, renderModalTitleContent()), jsx(ModalBody, null, errorState ? jsx("div", {
|
|
354
|
+
css: modalBodyErrorWrapperStyles
|
|
355
|
+
}, renderErrorState()) : jsx(RenderAssetsContent, {
|
|
364
356
|
isFetchingInitialData: assetsClientLoading,
|
|
365
357
|
status: status,
|
|
366
358
|
responseItems: responseItems,
|
|
@@ -375,7 +367,7 @@ var PlainAssetsConfigModal = function PlainAssetsConfigModal(props) {
|
|
|
375
367
|
columns: columns,
|
|
376
368
|
defaultVisibleColumnKeys: defaultVisibleColumnKeys,
|
|
377
369
|
modalRenderInstanceId: modalRenderInstanceId
|
|
378
|
-
}))
|
|
370
|
+
})), jsx(ModalFooter, null, jsx(Button, {
|
|
379
371
|
appearance: "default",
|
|
380
372
|
onClick: onCancelClick,
|
|
381
373
|
testId: 'asset-datasource-modal--cancel-button'
|
|
@@ -5,18 +5,56 @@ import { N40 } from '@atlaskit/theme/colors';
|
|
|
5
5
|
import { AccessRequired } from '../../../common/error-state/access-required';
|
|
6
6
|
import { ModalLoadingError } from '../../../common/error-state/modal-loading-error';
|
|
7
7
|
import { NoResults } from '../../../common/error-state/no-results';
|
|
8
|
-
import { EmptyState, IssueLikeDataTableView } from '../../../issue-like-table';
|
|
8
|
+
import { EmptyState, IssueLikeDataTableView, scrollableContainerShadowsCssComponents } from '../../../issue-like-table';
|
|
9
9
|
import { InitialStateView } from './initial-state-view';
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
export var MODAL_HEIGHT = 420;
|
|
11
|
+
|
|
12
|
+
// This is to prevent y scrollbar when showing table loading state
|
|
13
|
+
var disableOverflowStyles = css({
|
|
13
14
|
overflow: 'hidden'
|
|
14
15
|
});
|
|
16
|
+
var contentContainerStyles = css({
|
|
17
|
+
height: MODAL_HEIGHT,
|
|
18
|
+
display: 'grid',
|
|
19
|
+
overflow: 'auto'
|
|
20
|
+
});
|
|
15
21
|
var tableBordersStyles = css({
|
|
16
22
|
border: "1px solid ".concat("var(--ds-border, ".concat(N40, ")")),
|
|
17
23
|
borderTopLeftRadius: "var(--ds-border-radius-200, 8px)",
|
|
18
|
-
borderTopRightRadius: "var(--ds-border-radius-200, 8px)"
|
|
24
|
+
borderTopRightRadius: "var(--ds-border-radius-200, 8px)",
|
|
25
|
+
borderBottom: "2px solid ".concat("var(--ds-background-accent-gray-subtler, ".concat(N40, ")")),
|
|
26
|
+
background: scrollableContainerShadowsCssComponents.background,
|
|
27
|
+
backgroundRepeat: scrollableContainerShadowsCssComponents.backgroundRepeat,
|
|
28
|
+
backgroundSize: scrollableContainerShadowsCssComponents.backgroundSize,
|
|
29
|
+
backgroundAttachment: scrollableContainerShadowsCssComponents.backgroundAttachment
|
|
19
30
|
});
|
|
31
|
+
var RejectedView = function RejectedView() {
|
|
32
|
+
return jsx("div", {
|
|
33
|
+
css: [contentContainerStyles]
|
|
34
|
+
}, jsx(ModalLoadingError, null));
|
|
35
|
+
};
|
|
36
|
+
var UnauthorizedView = function UnauthorizedView() {
|
|
37
|
+
return jsx("div", {
|
|
38
|
+
css: [contentContainerStyles]
|
|
39
|
+
}, jsx(AccessRequired, null));
|
|
40
|
+
};
|
|
41
|
+
var EmptyView = function EmptyView() {
|
|
42
|
+
return jsx("div", {
|
|
43
|
+
css: [contentContainerStyles]
|
|
44
|
+
}, jsx(InitialStateView, null));
|
|
45
|
+
};
|
|
46
|
+
var NoResultsView = function NoResultsView() {
|
|
47
|
+
return jsx("div", {
|
|
48
|
+
css: [contentContainerStyles]
|
|
49
|
+
}, jsx(NoResults, null));
|
|
50
|
+
};
|
|
51
|
+
var LoadingView = function LoadingView() {
|
|
52
|
+
return jsx("div", {
|
|
53
|
+
css: [contentContainerStyles, contentContainerStyles, tableBordersStyles, disableOverflowStyles]
|
|
54
|
+
}, jsx(EmptyState, {
|
|
55
|
+
testId: "assets-aql-datasource-modal--loading-state"
|
|
56
|
+
}));
|
|
57
|
+
};
|
|
20
58
|
export var RenderAssetsContent = function RenderAssetsContent(props) {
|
|
21
59
|
var status = props.status,
|
|
22
60
|
responseItems = props.responseItems,
|
|
@@ -32,7 +70,7 @@ export var RenderAssetsContent = function RenderAssetsContent(props) {
|
|
|
32
70
|
var resolvedWithNoResults = status === 'resolved' && !responseItems.length;
|
|
33
71
|
var issueLikeDataTableView = useMemo(function () {
|
|
34
72
|
return jsx("div", {
|
|
35
|
-
css: tableBordersStyles
|
|
73
|
+
css: [contentContainerStyles, tableBordersStyles]
|
|
36
74
|
}, jsx(IssueLikeDataTableView, {
|
|
37
75
|
testId: "asset-datasource-table",
|
|
38
76
|
status: status,
|
|
@@ -48,23 +86,17 @@ export var RenderAssetsContent = function RenderAssetsContent(props) {
|
|
|
48
86
|
}, [columns, defaultVisibleColumnKeys, hasNextPage, loadDatasourceDetails, onNextPage, onVisibleColumnKeysChange, responseItems, status, visibleColumnKeys, modalRenderInstanceId]);
|
|
49
87
|
if (isFetchingInitialData) {
|
|
50
88
|
// Placing this check first as it's a priority before all others
|
|
51
|
-
return jsx(
|
|
52
|
-
css: [tableBordersStyles, emptyStateOverrideStyles]
|
|
53
|
-
}, jsx(EmptyState, {
|
|
54
|
-
testId: "assets-aql-datasource-modal--loading-state"
|
|
55
|
-
}));
|
|
89
|
+
return jsx(LoadingView, null);
|
|
56
90
|
} else if (status === 'rejected') {
|
|
57
|
-
return jsx(
|
|
91
|
+
return jsx(RejectedView, null);
|
|
58
92
|
} else if (status === 'unauthorized') {
|
|
59
|
-
return jsx(
|
|
93
|
+
return jsx(UnauthorizedView, null);
|
|
60
94
|
} else if (status === 'empty') {
|
|
61
|
-
return jsx(
|
|
95
|
+
return jsx(EmptyView, null);
|
|
62
96
|
} else if (resolvedWithNoResults) {
|
|
63
|
-
return jsx(
|
|
97
|
+
return jsx(NoResultsView, null);
|
|
64
98
|
} else if (status === 'loading' && !columns.length) {
|
|
65
|
-
return jsx(
|
|
66
|
-
testId: "assets-aql-datasource-modal--loading-state"
|
|
67
|
-
});
|
|
99
|
+
return jsx(LoadingView, null);
|
|
68
100
|
}
|
|
69
101
|
return issueLikeDataTableView;
|
|
70
102
|
};
|
|
@@ -16,4 +16,5 @@ export interface RenderAssetsContentProps {
|
|
|
16
16
|
onVisibleColumnKeysChange: (visibleColumnKeys: string[]) => void;
|
|
17
17
|
modalRenderInstanceId: string;
|
|
18
18
|
}
|
|
19
|
+
export declare const MODAL_HEIGHT = 420;
|
|
19
20
|
export declare const RenderAssetsContent: (props: RenderAssetsContentProps) => jsx.JSX.Element;
|
|
@@ -16,4 +16,5 @@ export interface RenderAssetsContentProps {
|
|
|
16
16
|
onVisibleColumnKeysChange: (visibleColumnKeys: string[]) => void;
|
|
17
17
|
modalRenderInstanceId: string;
|
|
18
18
|
}
|
|
19
|
+
export declare const MODAL_HEIGHT = 420;
|
|
19
20
|
export declare const RenderAssetsContent: (props: RenderAssetsContentProps) => jsx.JSX.Element;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/link-datasource",
|
|
3
|
-
"version": "1.19.
|
|
3
|
+
"version": "1.19.15",
|
|
4
4
|
"description": "UI Components to support linking platform dataset feature",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"@atlaskit/adf-schema": "^34.0.1",
|
|
34
34
|
"@atlaskit/analytics-next": "^9.1.3",
|
|
35
35
|
"@atlaskit/avatar": "^21.4.0",
|
|
36
|
-
"@atlaskit/badge": "^15.
|
|
36
|
+
"@atlaskit/badge": "^15.2.0",
|
|
37
37
|
"@atlaskit/button": "^16.17.0",
|
|
38
38
|
"@atlaskit/editor-prosemirror": "1.1.0",
|
|
39
39
|
"@atlaskit/empty-state": "^7.5.0",
|
|
@@ -48,8 +48,8 @@
|
|
|
48
48
|
"@atlaskit/link-client-extension": "^1.8.0",
|
|
49
49
|
"@atlaskit/linking-common": "^4.21.0",
|
|
50
50
|
"@atlaskit/linking-types": "^8.5.0",
|
|
51
|
-
"@atlaskit/lozenge": "^11.
|
|
52
|
-
"@atlaskit/modal-dialog": "^12.
|
|
51
|
+
"@atlaskit/lozenge": "^11.5.0",
|
|
52
|
+
"@atlaskit/modal-dialog": "^12.10.0",
|
|
53
53
|
"@atlaskit/platform-feature-flags": "^0.2.4",
|
|
54
54
|
"@atlaskit/pragmatic-drag-and-drop": "^0.24.0",
|
|
55
55
|
"@atlaskit/pragmatic-drag-and-drop-hitbox": "^0.12.0",
|