@atlaskit/link-datasource 7.7.0 → 7.8.1
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 +17 -0
- package/compass.yml +3 -0
- package/dist/cjs/ui/assets-modal/modal/index.js +5 -3
- package/dist/cjs/ui/assets-modal/modal/messages.js +15 -0
- package/dist/cjs/ui/assets-modal/modal/render-assets-content/index.js +12 -0
- package/dist/cjs/ui/assets-modal/modal-config-popup/index.compiled.css +6 -0
- package/dist/cjs/ui/assets-modal/modal-config-popup/index.js +155 -0
- package/dist/cjs/ui/assets-modal/modal-config-popup/messages.js +29 -0
- package/dist/cjs/ui/assets-modal/search-container/index.compiled.css +0 -1
- package/dist/cjs/ui/assets-modal/search-container/index.js +37 -8
- package/dist/es2019/ui/assets-modal/modal/index.js +3 -3
- package/dist/es2019/ui/assets-modal/modal/messages.js +15 -0
- package/dist/es2019/ui/assets-modal/modal/render-assets-content/index.js +12 -0
- package/dist/es2019/ui/assets-modal/modal-config-popup/index.compiled.css +6 -0
- package/dist/es2019/ui/assets-modal/modal-config-popup/index.js +126 -0
- package/dist/es2019/ui/assets-modal/modal-config-popup/messages.js +23 -0
- package/dist/es2019/ui/assets-modal/search-container/index.compiled.css +0 -1
- package/dist/es2019/ui/assets-modal/search-container/index.js +37 -8
- package/dist/esm/ui/assets-modal/modal/index.js +5 -3
- package/dist/esm/ui/assets-modal/modal/messages.js +15 -0
- package/dist/esm/ui/assets-modal/modal/render-assets-content/index.js +12 -0
- package/dist/esm/ui/assets-modal/modal-config-popup/index.compiled.css +6 -0
- package/dist/esm/ui/assets-modal/modal-config-popup/index.js +147 -0
- package/dist/esm/ui/assets-modal/modal-config-popup/messages.js +23 -0
- package/dist/esm/ui/assets-modal/search-container/index.compiled.css +0 -1
- package/dist/esm/ui/assets-modal/search-container/index.js +37 -8
- package/dist/types/ui/assets-modal/modal/messages.d.ts +19 -4
- package/dist/types/ui/assets-modal/modal-config-popup/index.d.ts +30 -0
- package/dist/types/ui/assets-modal/modal-config-popup/messages.d.ts +22 -0
- package/package.json +13 -10
|
@@ -4,18 +4,23 @@ import "./index.compiled.css";
|
|
|
4
4
|
import { forwardRef } from 'react';
|
|
5
5
|
import * as React from 'react';
|
|
6
6
|
import { ax, ix } from "@compiled/react/runtime";
|
|
7
|
+
import { FormattedMessage } from 'react-intl';
|
|
7
8
|
import Form from '@atlaskit/form/form';
|
|
9
|
+
import Heading from '@atlaskit/heading/heading';
|
|
8
10
|
import { CloseButton } from '@atlaskit/modal-dialog/close-button';
|
|
9
11
|
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
10
12
|
import { Flex } from '@atlaskit/primitives/compiled/flex';
|
|
13
|
+
import { Text } from '@atlaskit/primitives/compiled/text';
|
|
11
14
|
import { useDatasourceAnalyticsEvents } from '../../../analytics';
|
|
12
15
|
import { aqlKey } from '../../../types/assets/types';
|
|
16
|
+
import { AssetsModalConfigPopup } from '../modal-config-popup';
|
|
17
|
+
import { modalMessages } from '../modal/messages';
|
|
13
18
|
import { AqlSearchInput } from './aql-search-input';
|
|
14
19
|
import { AssetsObjectSchemaSelect } from './object-schema-select';
|
|
15
20
|
import { FormRowContainer } from './styled';
|
|
16
21
|
const styles = {
|
|
17
22
|
modalTitleContainer: "_zulppxbi _4cvr1h6o",
|
|
18
|
-
flexStyles: "
|
|
23
|
+
flexStyles: "_1bsb1osq"
|
|
19
24
|
};
|
|
20
25
|
const DEFAULT_AQL_QUERY = '';
|
|
21
26
|
const SEARCH_FORM_ID = 'linkDataSource.assets.configModal.searchContainer-form';
|
|
@@ -64,7 +69,7 @@ export const AssetsSearchContainer = props => {
|
|
|
64
69
|
formProps,
|
|
65
70
|
setFieldValue
|
|
66
71
|
}) => {
|
|
67
|
-
var _initialSearchData$ob, _initialSearchData$ob2, _initialSearchData$aq;
|
|
72
|
+
var _initialSearchData$ob, _initialSearchData$ob2, _initialSearchData$ob3, _initialSearchData$ob4, _initialSearchData$aq;
|
|
68
73
|
const onSchemaChange = schema => {
|
|
69
74
|
if (fg('platform_lp_sllv_assets_default_schema_aql')) {
|
|
70
75
|
const defaultAql = `objectSchema = "${schema.label}"`;
|
|
@@ -76,24 +81,48 @@ export const AssetsSearchContainer = props => {
|
|
|
76
81
|
id: SEARCH_FORM_ID
|
|
77
82
|
}), /*#__PURE__*/React.createElement(FormRowContainer, {
|
|
78
83
|
isNarrowGap: true
|
|
79
|
-
}, /*#__PURE__*/React.createElement(Flex, {
|
|
84
|
+
}, fg('astral_assets_macro_table_ui_uplift') ? /*#__PURE__*/React.createElement(Flex, {
|
|
80
85
|
gap: "space.200",
|
|
81
86
|
justifyContent: "space-between",
|
|
82
87
|
xcss: styles.flexStyles
|
|
83
88
|
}, /*#__PURE__*/React.createElement(Flex, {
|
|
89
|
+
justifyContent: "start",
|
|
90
|
+
xcss: styles.modalTitleContainer
|
|
91
|
+
}, modalTitle), /*#__PURE__*/React.createElement(Flex, {
|
|
84
92
|
justifyContent: "end"
|
|
85
|
-
}, /*#__PURE__*/React.createElement(
|
|
93
|
+
}, /*#__PURE__*/React.createElement(Flex, {
|
|
94
|
+
alignItems: "center",
|
|
95
|
+
gap: "space.100"
|
|
96
|
+
}, /*#__PURE__*/React.createElement(Text, null, /*#__PURE__*/React.createElement(FormattedMessage, modalMessages.insertObjectsTitle), ":"), /*#__PURE__*/React.createElement(AssetsObjectSchemaSelect, {
|
|
97
|
+
value: (_initialSearchData$ob = initialSearchData.objectSchema) !== null && _initialSearchData$ob !== void 0 ? _initialSearchData$ob : undefined,
|
|
98
|
+
workspaceId: workspaceId,
|
|
99
|
+
initialObjectSchemas: (_initialSearchData$ob2 = initialSearchData.objectSchemas) !== null && _initialSearchData$ob2 !== void 0 ? _initialSearchData$ob2 : undefined,
|
|
100
|
+
classNamePrefix: "assets-datasource-modal--object-schema-select",
|
|
101
|
+
onSchemaChange: onSchemaChange
|
|
102
|
+
})), /*#__PURE__*/React.createElement(AssetsModalConfigPopup, {
|
|
103
|
+
onChange: () => {}
|
|
104
|
+
}), /*#__PURE__*/React.createElement(CloseButton, {
|
|
86
105
|
onClick: onCancel
|
|
87
|
-
}))
|
|
106
|
+
}))) : /*#__PURE__*/React.createElement(Flex, {
|
|
107
|
+
gap: "space.200",
|
|
108
|
+
justifyContent: "space-between",
|
|
109
|
+
xcss: styles.flexStyles
|
|
110
|
+
}, /*#__PURE__*/React.createElement(Flex, {
|
|
88
111
|
justifyContent: "start",
|
|
89
112
|
xcss: styles.modalTitleContainer
|
|
90
113
|
}, modalTitle, /*#__PURE__*/React.createElement(AssetsObjectSchemaSelect, {
|
|
91
|
-
value: (_initialSearchData$
|
|
114
|
+
value: (_initialSearchData$ob3 = initialSearchData.objectSchema) !== null && _initialSearchData$ob3 !== void 0 ? _initialSearchData$ob3 : undefined,
|
|
92
115
|
workspaceId: workspaceId,
|
|
93
|
-
initialObjectSchemas: (_initialSearchData$
|
|
116
|
+
initialObjectSchemas: (_initialSearchData$ob4 = initialSearchData.objectSchemas) !== null && _initialSearchData$ob4 !== void 0 ? _initialSearchData$ob4 : undefined,
|
|
94
117
|
classNamePrefix: "assets-datasource-modal--object-schema-select",
|
|
95
118
|
onSchemaChange: onSchemaChange
|
|
96
|
-
}))
|
|
119
|
+
})), /*#__PURE__*/React.createElement(Flex, {
|
|
120
|
+
justifyContent: "end"
|
|
121
|
+
}, /*#__PURE__*/React.createElement(CloseButton, {
|
|
122
|
+
onClick: onCancel
|
|
123
|
+
})))), fg('astral_assets_macro_table_ui_uplift') ? /*#__PURE__*/React.createElement(Heading, {
|
|
124
|
+
size: "xsmall"
|
|
125
|
+
}, /*#__PURE__*/React.createElement(FormattedMessage, modalMessages.filterObjectsText)) : null, /*#__PURE__*/React.createElement(FormRowContainer, null, /*#__PURE__*/React.createElement(AqlSearchInput, {
|
|
97
126
|
value: (_initialSearchData$aq = initialSearchData.aql) !== null && _initialSearchData$aq !== void 0 ? _initialSearchData$aq : DEFAULT_AQL_QUERY,
|
|
98
127
|
workspaceId: workspaceId,
|
|
99
128
|
isSearching: isSearching
|
|
@@ -46,7 +46,9 @@ import { modalMessages } from './messages';
|
|
|
46
46
|
import { RenderAssetsContent } from './render-assets-content';
|
|
47
47
|
var VERSION_TWO = '2';
|
|
48
48
|
var modalBodyErrorWrapperStyles = null;
|
|
49
|
-
var AssetsModalTitle =
|
|
49
|
+
var AssetsModalTitle = function AssetsModalTitle() {
|
|
50
|
+
return /*#__PURE__*/React.createElement(ModalTitle, null, /*#__PURE__*/React.createElement(FormattedMessage, fg('astral_assets_macro_table_ui_uplift') ? modalMessages.assetsConfigModalTitle : modalMessages.insertObjectsTitle));
|
|
51
|
+
};
|
|
50
52
|
var PlainAssetsConfigModal = function PlainAssetsConfigModal(props) {
|
|
51
53
|
var datasourceId = props.datasourceId,
|
|
52
54
|
initialParameters = props.parameters,
|
|
@@ -361,7 +363,7 @@ var PlainAssetsConfigModal = function PlainAssetsConfigModal(props) {
|
|
|
361
363
|
} else {
|
|
362
364
|
if (!workspaceId || assetsClientLoading) {
|
|
363
365
|
return /*#__PURE__*/React.createElement(AssetsSearchContainerLoading, {
|
|
364
|
-
modalTitle: AssetsModalTitle
|
|
366
|
+
modalTitle: /*#__PURE__*/React.createElement(AssetsModalTitle, null)
|
|
365
367
|
});
|
|
366
368
|
}
|
|
367
369
|
return /*#__PURE__*/React.createElement(AssetsSearchContainer, {
|
|
@@ -372,7 +374,7 @@ var PlainAssetsConfigModal = function PlainAssetsConfigModal(props) {
|
|
|
372
374
|
objectSchemas: objectSchemas
|
|
373
375
|
},
|
|
374
376
|
onSearch: handleOnSearch,
|
|
375
|
-
modalTitle: AssetsModalTitle,
|
|
377
|
+
modalTitle: /*#__PURE__*/React.createElement(AssetsModalTitle, null),
|
|
376
378
|
isSearching: status === 'loading',
|
|
377
379
|
onCancel: onCancel
|
|
378
380
|
});
|
|
@@ -14,5 +14,20 @@ export var modalMessages = defineMessages({
|
|
|
14
14
|
id: 'linkDataSource.assets.configmodal.insertObjectsTitle',
|
|
15
15
|
description: 'Title for the Assets Objects Datasource config modal which prefixes a select picker',
|
|
16
16
|
defaultMessage: 'Insert objects from'
|
|
17
|
+
},
|
|
18
|
+
assetsConfigModalTitle: {
|
|
19
|
+
id: 'linkDataSource.assets.configmodal.title',
|
|
20
|
+
description: 'Title for the Assets Objects Datasource config modal',
|
|
21
|
+
defaultMessage: 'Assets table macro configuration'
|
|
22
|
+
},
|
|
23
|
+
filterObjectsText: {
|
|
24
|
+
id: 'linkDataSource.assets.configmodal.filterObjectsText',
|
|
25
|
+
description: 'Text for the filter option using aql search',
|
|
26
|
+
defaultMessage: 'Filter'
|
|
27
|
+
},
|
|
28
|
+
tablePreviewText: {
|
|
29
|
+
id: 'linkDataSource.assets.configmodal.tablePreviewText',
|
|
30
|
+
description: 'Heading above the table preview in the Assets configuration modal',
|
|
31
|
+
defaultMessage: 'Table preview'
|
|
17
32
|
}
|
|
18
33
|
});
|
|
@@ -3,11 +3,16 @@ import "./index.compiled.css";
|
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import { ax, ix } from "@compiled/react/runtime";
|
|
5
5
|
import { useCallback, useMemo } from 'react';
|
|
6
|
+
import { FormattedMessage } from 'react-intl';
|
|
7
|
+
import Heading from '@atlaskit/heading/heading';
|
|
8
|
+
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
9
|
+
import { Stack } from '@atlaskit/primitives/compiled/stack';
|
|
6
10
|
import { AccessRequired } from '../../../common/error-state/access-required';
|
|
7
11
|
import { ModalLoadingError } from '../../../common/error-state/modal-loading-error';
|
|
8
12
|
import { NoResults } from '../../../common/error-state/no-results';
|
|
9
13
|
import EmptyState from '../../../issue-like-table/empty-state';
|
|
10
14
|
import { IssueLikeDataTableView } from '../../../issue-like-table/issue-like-data-table-view';
|
|
15
|
+
import { modalMessages } from '../messages';
|
|
11
16
|
import { InitialStateView } from './initial-state-view';
|
|
12
17
|
export var MODAL_HEIGHT = 420;
|
|
13
18
|
|
|
@@ -91,5 +96,12 @@ export var RenderAssetsContent = function RenderAssetsContent(props) {
|
|
|
91
96
|
}
|
|
92
97
|
return issueLikeDataTableView;
|
|
93
98
|
}, [columns.length, isFetchingInitialData, issueLikeDataTableView, resolvedWithNoResults, shouldRenderTableWithNoResults, status]);
|
|
99
|
+
if (fg('astral_assets_macro_table_ui_uplift')) {
|
|
100
|
+
return /*#__PURE__*/React.createElement(Stack, {
|
|
101
|
+
space: "space.200"
|
|
102
|
+
}, status !== 'empty' && /*#__PURE__*/React.createElement(Heading, {
|
|
103
|
+
size: "xsmall"
|
|
104
|
+
}, /*#__PURE__*/React.createElement(FormattedMessage, modalMessages.tablePreviewText)), renderAssetsContentView());
|
|
105
|
+
}
|
|
94
106
|
return renderAssetsContentView();
|
|
95
107
|
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
._19bvpxbi{padding-left:var(--ds-space-200,1pc)}
|
|
2
|
+
._19bvxy5q{padding-left:var(--ds-space-400,2pc)}
|
|
3
|
+
._1bsb1kdj{width:25pc}
|
|
4
|
+
._ca0qpxbi{padding-top:var(--ds-space-200,1pc)}
|
|
5
|
+
._n3tdpxbi{padding-bottom:var(--ds-space-200,1pc)}
|
|
6
|
+
._u5f3pxbi{padding-right:var(--ds-space-200,1pc)}
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
/* index.tsx generated by @compiled/babel-plugin v3.0.2 */
|
|
2
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
3
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
4
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
5
|
+
import "./index.compiled.css";
|
|
6
|
+
import * as React from 'react';
|
|
7
|
+
import { ax, ix } from "@compiled/react/runtime";
|
|
8
|
+
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; }
|
|
9
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
10
|
+
import { useId, useState } from 'react';
|
|
11
|
+
import { useIntl, FormattedMessage } from 'react-intl';
|
|
12
|
+
import IconButton from '@atlaskit/button/icon/button';
|
|
13
|
+
import Checkbox from '@atlaskit/checkbox/checkbox';
|
|
14
|
+
import { Label } from '@atlaskit/form/label/default';
|
|
15
|
+
import CustomizeIcon from '@atlaskit/icon/core/customize';
|
|
16
|
+
import { Popup } from '@atlaskit/popup/popup';
|
|
17
|
+
import { Box } from '@atlaskit/primitives/compiled/box';
|
|
18
|
+
import { Stack } from '@atlaskit/primitives/compiled/stack';
|
|
19
|
+
import Select from '@atlaskit/select/default';
|
|
20
|
+
import { aboveModal } from '../../../common/zindex';
|
|
21
|
+
import { modalConfigPopupMessages } from './messages';
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Rendering a `<Select>` in a `<Modal>` results in the select options getting cut off by the bottom of the modal and
|
|
25
|
+
* scrolling. This is a work-around for that, see https://atlassian.slack.com/archives/CFJ9DU39U/p1623179496484100
|
|
26
|
+
*/
|
|
27
|
+
export var selectInAModalStyleFixProps = {
|
|
28
|
+
styles: {
|
|
29
|
+
menuPortal: function menuPortal(base) {
|
|
30
|
+
return _objectSpread(_objectSpread({}, base), {}, {
|
|
31
|
+
zIndex: aboveModal
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
menuPortalTarget: document.body
|
|
36
|
+
};
|
|
37
|
+
export var PAGE_SIZE_OPTIONS = [10, 20, 50, 100];
|
|
38
|
+
export var DEFAULT_PAGE_SIZE = 20;
|
|
39
|
+
var styles = {
|
|
40
|
+
trigger: "_19bvxy5q _u5f3pxbi",
|
|
41
|
+
content: "_1bsb1kdj _ca0qpxbi _u5f3pxbi _n3tdpxbi _19bvpxbi"
|
|
42
|
+
};
|
|
43
|
+
export var AssetsModalConfigPopup = function AssetsModalConfigPopup(_ref) {
|
|
44
|
+
var _initialConfig$pageSi, _initialConfig$isNest;
|
|
45
|
+
var initialConfig = _ref.initialConfig,
|
|
46
|
+
onChange = _ref.onChange,
|
|
47
|
+
_ref$testId = _ref.testId,
|
|
48
|
+
testId = _ref$testId === void 0 ? 'assets-datasource-modal--config-popup' : _ref$testId;
|
|
49
|
+
var _useIntl = useIntl(),
|
|
50
|
+
formatMessage = _useIntl.formatMessage;
|
|
51
|
+
var _useState = useState(false),
|
|
52
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
53
|
+
isOpen = _useState2[0],
|
|
54
|
+
setIsOpen = _useState2[1];
|
|
55
|
+
var _useState3 = useState({
|
|
56
|
+
pageSize: (_initialConfig$pageSi = initialConfig === null || initialConfig === void 0 ? void 0 : initialConfig.pageSize) !== null && _initialConfig$pageSi !== void 0 ? _initialConfig$pageSi : DEFAULT_PAGE_SIZE,
|
|
57
|
+
isNestedReferenceAttributeSelectionEnabled: (_initialConfig$isNest = initialConfig === null || initialConfig === void 0 ? void 0 : initialConfig.isNestedReferenceAttributeSelectionEnabled) !== null && _initialConfig$isNest !== void 0 ? _initialConfig$isNest : false
|
|
58
|
+
}),
|
|
59
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
60
|
+
config = _useState4[0],
|
|
61
|
+
setConfig = _useState4[1];
|
|
62
|
+
var pageSizeSelectId = useId();
|
|
63
|
+
var pageSizeOptions = PAGE_SIZE_OPTIONS.map(function (count) {
|
|
64
|
+
return {
|
|
65
|
+
label: formatMessage(modalConfigPopupMessages.objectsPerPage, {
|
|
66
|
+
count: count
|
|
67
|
+
}),
|
|
68
|
+
value: count
|
|
69
|
+
};
|
|
70
|
+
});
|
|
71
|
+
var updateConfig = function updateConfig(partialConfig) {
|
|
72
|
+
var nextConfig = _objectSpread(_objectSpread({}, config), partialConfig);
|
|
73
|
+
setConfig(nextConfig);
|
|
74
|
+
onChange(nextConfig);
|
|
75
|
+
};
|
|
76
|
+
var handlePageSizeChange = function handlePageSizeChange(option) {
|
|
77
|
+
if (option) {
|
|
78
|
+
updateConfig({
|
|
79
|
+
pageSize: option.value
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
var handleNestedReferenceAttributeSelectionChange = function handleNestedReferenceAttributeSelectionChange(event) {
|
|
84
|
+
updateConfig({
|
|
85
|
+
isNestedReferenceAttributeSelectionEnabled: event.target.checked
|
|
86
|
+
});
|
|
87
|
+
};
|
|
88
|
+
var selectedPageSizeOption = pageSizeOptions.find(function (option) {
|
|
89
|
+
return option.value === config.pageSize;
|
|
90
|
+
});
|
|
91
|
+
return /*#__PURE__*/React.createElement(Popup, {
|
|
92
|
+
isOpen: isOpen,
|
|
93
|
+
onClose: function onClose() {
|
|
94
|
+
return setIsOpen(false);
|
|
95
|
+
},
|
|
96
|
+
placement: "bottom-end",
|
|
97
|
+
testId: testId,
|
|
98
|
+
role: "dialog",
|
|
99
|
+
label: formatMessage(modalConfigPopupMessages.configureTable),
|
|
100
|
+
zIndex: aboveModal,
|
|
101
|
+
trigger: function trigger(triggerProps) {
|
|
102
|
+
return /*#__PURE__*/React.createElement(Box, {
|
|
103
|
+
xcss: styles.trigger
|
|
104
|
+
}, /*#__PURE__*/React.createElement(IconButton, {
|
|
105
|
+
ref: triggerProps.ref,
|
|
106
|
+
"aria-controls": triggerProps['aria-controls'],
|
|
107
|
+
"aria-expanded": triggerProps['aria-expanded'],
|
|
108
|
+
"aria-haspopup": triggerProps['aria-haspopup'],
|
|
109
|
+
icon: CustomizeIcon,
|
|
110
|
+
isSelected: isOpen,
|
|
111
|
+
isTooltipDisabled: false,
|
|
112
|
+
label: formatMessage(modalConfigPopupMessages.configureTable),
|
|
113
|
+
onClick: function onClick() {
|
|
114
|
+
return setIsOpen(function (currentIsOpen) {
|
|
115
|
+
return !currentIsOpen;
|
|
116
|
+
});
|
|
117
|
+
},
|
|
118
|
+
testId: "".concat(testId, "--trigger")
|
|
119
|
+
}));
|
|
120
|
+
},
|
|
121
|
+
content: function content() {
|
|
122
|
+
return /*#__PURE__*/React.createElement(Box, {
|
|
123
|
+
xcss: styles.content
|
|
124
|
+
}, /*#__PURE__*/React.createElement(Stack, {
|
|
125
|
+
space: "space.200"
|
|
126
|
+
}, /*#__PURE__*/React.createElement(Stack, {
|
|
127
|
+
space: "space.050",
|
|
128
|
+
alignInline: "start"
|
|
129
|
+
}, /*#__PURE__*/React.createElement(Label, {
|
|
130
|
+
htmlFor: pageSizeSelectId
|
|
131
|
+
}, /*#__PURE__*/React.createElement(FormattedMessage, modalConfigPopupMessages.tablePagination)), /*#__PURE__*/React.createElement(Select, _extends({}, selectInAModalStyleFixProps, {
|
|
132
|
+
inputId: pageSizeSelectId,
|
|
133
|
+
options: pageSizeOptions,
|
|
134
|
+
value: selectedPageSizeOption,
|
|
135
|
+
onChange: handlePageSizeChange,
|
|
136
|
+
isSearchable: false,
|
|
137
|
+
menuPlacement: "bottom",
|
|
138
|
+
testId: "".concat(testId, "--page-size-select")
|
|
139
|
+
}))), /*#__PURE__*/React.createElement(Checkbox, {
|
|
140
|
+
isChecked: config.isNestedReferenceAttributeSelectionEnabled,
|
|
141
|
+
onChange: handleNestedReferenceAttributeSelectionChange,
|
|
142
|
+
label: formatMessage(modalConfigPopupMessages.nestedReferenceAttributeSelection),
|
|
143
|
+
testId: "".concat(testId, "--nested-reference-attribute-selection")
|
|
144
|
+
})));
|
|
145
|
+
}
|
|
146
|
+
});
|
|
147
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { defineMessages } from 'react-intl';
|
|
2
|
+
export var modalConfigPopupMessages = defineMessages({
|
|
3
|
+
configureTable: {
|
|
4
|
+
id: 'linkDataSource.assets.configModal.configPopup.configureTable',
|
|
5
|
+
description: 'Tooltip and accessibility label for the icon button that opens the Assets table configuration popup',
|
|
6
|
+
defaultMessage: 'Configure table'
|
|
7
|
+
},
|
|
8
|
+
nestedReferenceAttributeSelection: {
|
|
9
|
+
id: 'linkDataSource.assets.configModal.configPopup.nestedReferenceAttributeSelection',
|
|
10
|
+
description: 'Label for the checkbox that allows users to select attributes of referenced objects (nested attributes) as table columns',
|
|
11
|
+
defaultMessage: 'Enable nested reference attribute selection'
|
|
12
|
+
},
|
|
13
|
+
objectsPerPage: {
|
|
14
|
+
id: 'linkDataSource.assets.configModal.configPopup.objectsPerPage',
|
|
15
|
+
description: 'Option label in the pagination select showing how many Assets objects are displayed per table page. {count} is the number of objects.',
|
|
16
|
+
defaultMessage: '{count, plural, one {# object per page} other {# objects per page}}'
|
|
17
|
+
},
|
|
18
|
+
tablePagination: {
|
|
19
|
+
id: 'linkDataSource.assets.configModal.configPopup.tablePagination',
|
|
20
|
+
description: 'Label for the select input where users choose how many Assets objects are displayed per table page',
|
|
21
|
+
defaultMessage: 'Table pagination:'
|
|
22
|
+
}
|
|
23
|
+
});
|
|
@@ -6,18 +6,23 @@ import "./index.compiled.css";
|
|
|
6
6
|
import { forwardRef } from 'react';
|
|
7
7
|
import * as React from 'react';
|
|
8
8
|
import { ax, ix } from "@compiled/react/runtime";
|
|
9
|
+
import { FormattedMessage } from 'react-intl';
|
|
9
10
|
import Form from '@atlaskit/form/form';
|
|
11
|
+
import Heading from '@atlaskit/heading/heading';
|
|
10
12
|
import { CloseButton } from '@atlaskit/modal-dialog/close-button';
|
|
11
13
|
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
12
14
|
import { Flex } from '@atlaskit/primitives/compiled/flex';
|
|
15
|
+
import { Text } from '@atlaskit/primitives/compiled/text';
|
|
13
16
|
import { useDatasourceAnalyticsEvents } from '../../../analytics';
|
|
14
17
|
import { aqlKey } from '../../../types/assets/types';
|
|
18
|
+
import { AssetsModalConfigPopup } from '../modal-config-popup';
|
|
19
|
+
import { modalMessages } from '../modal/messages';
|
|
15
20
|
import { AqlSearchInput } from './aql-search-input';
|
|
16
21
|
import { AssetsObjectSchemaSelect } from './object-schema-select';
|
|
17
22
|
import { FormRowContainer } from './styled';
|
|
18
23
|
var styles = {
|
|
19
24
|
modalTitleContainer: "_zulppxbi _4cvr1h6o",
|
|
20
|
-
flexStyles: "
|
|
25
|
+
flexStyles: "_1bsb1osq"
|
|
21
26
|
};
|
|
22
27
|
var DEFAULT_AQL_QUERY = '';
|
|
23
28
|
var SEARCH_FORM_ID = 'linkDataSource.assets.configModal.searchContainer-form';
|
|
@@ -58,7 +63,7 @@ export var AssetsSearchContainer = function AssetsSearchContainer(props) {
|
|
|
58
63
|
return /*#__PURE__*/React.createElement(Form, {
|
|
59
64
|
onSubmit: onFormSubmit
|
|
60
65
|
}, function (_ref2) {
|
|
61
|
-
var _initialSearchData$ob, _initialSearchData$ob2, _initialSearchData$aq;
|
|
66
|
+
var _initialSearchData$ob, _initialSearchData$ob2, _initialSearchData$ob3, _initialSearchData$ob4, _initialSearchData$aq;
|
|
62
67
|
var formProps = _ref2.formProps,
|
|
63
68
|
setFieldValue = _ref2.setFieldValue;
|
|
64
69
|
var onSchemaChange = function onSchemaChange(schema) {
|
|
@@ -72,24 +77,48 @@ export var AssetsSearchContainer = function AssetsSearchContainer(props) {
|
|
|
72
77
|
id: SEARCH_FORM_ID
|
|
73
78
|
}), /*#__PURE__*/React.createElement(FormRowContainer, {
|
|
74
79
|
isNarrowGap: true
|
|
75
|
-
}, /*#__PURE__*/React.createElement(Flex, {
|
|
80
|
+
}, fg('astral_assets_macro_table_ui_uplift') ? /*#__PURE__*/React.createElement(Flex, {
|
|
76
81
|
gap: "space.200",
|
|
77
82
|
justifyContent: "space-between",
|
|
78
83
|
xcss: styles.flexStyles
|
|
79
84
|
}, /*#__PURE__*/React.createElement(Flex, {
|
|
85
|
+
justifyContent: "start",
|
|
86
|
+
xcss: styles.modalTitleContainer
|
|
87
|
+
}, modalTitle), /*#__PURE__*/React.createElement(Flex, {
|
|
80
88
|
justifyContent: "end"
|
|
81
|
-
}, /*#__PURE__*/React.createElement(
|
|
89
|
+
}, /*#__PURE__*/React.createElement(Flex, {
|
|
90
|
+
alignItems: "center",
|
|
91
|
+
gap: "space.100"
|
|
92
|
+
}, /*#__PURE__*/React.createElement(Text, null, /*#__PURE__*/React.createElement(FormattedMessage, modalMessages.insertObjectsTitle), ":"), /*#__PURE__*/React.createElement(AssetsObjectSchemaSelect, {
|
|
93
|
+
value: (_initialSearchData$ob = initialSearchData.objectSchema) !== null && _initialSearchData$ob !== void 0 ? _initialSearchData$ob : undefined,
|
|
94
|
+
workspaceId: workspaceId,
|
|
95
|
+
initialObjectSchemas: (_initialSearchData$ob2 = initialSearchData.objectSchemas) !== null && _initialSearchData$ob2 !== void 0 ? _initialSearchData$ob2 : undefined,
|
|
96
|
+
classNamePrefix: "assets-datasource-modal--object-schema-select",
|
|
97
|
+
onSchemaChange: onSchemaChange
|
|
98
|
+
})), /*#__PURE__*/React.createElement(AssetsModalConfigPopup, {
|
|
99
|
+
onChange: function onChange() {}
|
|
100
|
+
}), /*#__PURE__*/React.createElement(CloseButton, {
|
|
82
101
|
onClick: onCancel
|
|
83
|
-
}))
|
|
102
|
+
}))) : /*#__PURE__*/React.createElement(Flex, {
|
|
103
|
+
gap: "space.200",
|
|
104
|
+
justifyContent: "space-between",
|
|
105
|
+
xcss: styles.flexStyles
|
|
106
|
+
}, /*#__PURE__*/React.createElement(Flex, {
|
|
84
107
|
justifyContent: "start",
|
|
85
108
|
xcss: styles.modalTitleContainer
|
|
86
109
|
}, modalTitle, /*#__PURE__*/React.createElement(AssetsObjectSchemaSelect, {
|
|
87
|
-
value: (_initialSearchData$
|
|
110
|
+
value: (_initialSearchData$ob3 = initialSearchData.objectSchema) !== null && _initialSearchData$ob3 !== void 0 ? _initialSearchData$ob3 : undefined,
|
|
88
111
|
workspaceId: workspaceId,
|
|
89
|
-
initialObjectSchemas: (_initialSearchData$
|
|
112
|
+
initialObjectSchemas: (_initialSearchData$ob4 = initialSearchData.objectSchemas) !== null && _initialSearchData$ob4 !== void 0 ? _initialSearchData$ob4 : undefined,
|
|
90
113
|
classNamePrefix: "assets-datasource-modal--object-schema-select",
|
|
91
114
|
onSchemaChange: onSchemaChange
|
|
92
|
-
}))
|
|
115
|
+
})), /*#__PURE__*/React.createElement(Flex, {
|
|
116
|
+
justifyContent: "end"
|
|
117
|
+
}, /*#__PURE__*/React.createElement(CloseButton, {
|
|
118
|
+
onClick: onCancel
|
|
119
|
+
})))), fg('astral_assets_macro_table_ui_uplift') ? /*#__PURE__*/React.createElement(Heading, {
|
|
120
|
+
size: "xsmall"
|
|
121
|
+
}, /*#__PURE__*/React.createElement(FormattedMessage, modalMessages.filterObjectsText)) : null, /*#__PURE__*/React.createElement(FormRowContainer, null, /*#__PURE__*/React.createElement(AqlSearchInput, {
|
|
93
122
|
value: (_initialSearchData$aq = initialSearchData.aql) !== null && _initialSearchData$aq !== void 0 ? _initialSearchData$aq : DEFAULT_AQL_QUERY,
|
|
94
123
|
workspaceId: workspaceId,
|
|
95
124
|
isSearching: isSearching
|
|
@@ -1,17 +1,32 @@
|
|
|
1
1
|
export declare const modalMessages: {
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
assetsConfigModalTitle: {
|
|
3
|
+
defaultMessage: string;
|
|
4
4
|
description: string;
|
|
5
|
+
id: string;
|
|
6
|
+
};
|
|
7
|
+
filterObjectsText: {
|
|
5
8
|
defaultMessage: string;
|
|
9
|
+
description: string;
|
|
10
|
+
id: string;
|
|
6
11
|
};
|
|
7
12
|
insertIssuesButtonText: {
|
|
8
|
-
id: string;
|
|
9
|
-
description: string;
|
|
10
13
|
defaultMessage: string;
|
|
14
|
+
description: string;
|
|
15
|
+
id: string;
|
|
11
16
|
};
|
|
12
17
|
insertObjectsTitle: {
|
|
18
|
+
defaultMessage: string;
|
|
19
|
+
description: string;
|
|
13
20
|
id: string;
|
|
21
|
+
};
|
|
22
|
+
tablePreviewText: {
|
|
23
|
+
defaultMessage: string;
|
|
14
24
|
description: string;
|
|
25
|
+
id: string;
|
|
26
|
+
};
|
|
27
|
+
updateObjectsButtonText: {
|
|
15
28
|
defaultMessage: string;
|
|
29
|
+
description: string;
|
|
30
|
+
id: string;
|
|
16
31
|
};
|
|
17
32
|
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @jsxRuntime classic
|
|
3
|
+
* @jsx jsx
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Rendering a `<Select>` in a `<Modal>` results in the select options getting cut off by the bottom of the modal and
|
|
7
|
+
* scrolling. This is a work-around for that, see https://atlassian.slack.com/archives/CFJ9DU39U/p1623179496484100
|
|
8
|
+
*/
|
|
9
|
+
export declare const selectInAModalStyleFixProps: {
|
|
10
|
+
menuPortalTarget: HTMLElement;
|
|
11
|
+
styles: {
|
|
12
|
+
menuPortal: (base: any) => any;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
export declare const PAGE_SIZE_OPTIONS: readonly number[];
|
|
16
|
+
export declare const DEFAULT_PAGE_SIZE = 20;
|
|
17
|
+
export type AssetsModalConfig = {
|
|
18
|
+
/** Whether users can select attributes of referenced objects (nested attributes) as table columns */
|
|
19
|
+
isNestedReferenceAttributeSelectionEnabled: boolean;
|
|
20
|
+
/** Number of Assets objects displayed per table page */
|
|
21
|
+
pageSize: number;
|
|
22
|
+
};
|
|
23
|
+
export type AssetsModalConfigPopupProps = {
|
|
24
|
+
/** Initial values. Missing keys fall back to `DEFAULT_PAGE_SIZE` and `false` respectively. */
|
|
25
|
+
initialConfig?: Partial<AssetsModalConfig>;
|
|
26
|
+
/** Called with the full config every time either the select or the checkbox changes. */
|
|
27
|
+
onChange: (config: AssetsModalConfig) => void;
|
|
28
|
+
testId?: string;
|
|
29
|
+
};
|
|
30
|
+
export declare const AssetsModalConfigPopup: ({ initialConfig, onChange, testId, }: AssetsModalConfigPopupProps) => JSX.Element;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export declare const modalConfigPopupMessages: {
|
|
2
|
+
configureTable: {
|
|
3
|
+
defaultMessage: string;
|
|
4
|
+
description: string;
|
|
5
|
+
id: string;
|
|
6
|
+
};
|
|
7
|
+
nestedReferenceAttributeSelection: {
|
|
8
|
+
defaultMessage: string;
|
|
9
|
+
description: string;
|
|
10
|
+
id: string;
|
|
11
|
+
};
|
|
12
|
+
objectsPerPage: {
|
|
13
|
+
defaultMessage: string;
|
|
14
|
+
description: string;
|
|
15
|
+
id: string;
|
|
16
|
+
};
|
|
17
|
+
tablePagination: {
|
|
18
|
+
defaultMessage: string;
|
|
19
|
+
description: string;
|
|
20
|
+
id: string;
|
|
21
|
+
};
|
|
22
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/link-datasource",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.8.1",
|
|
4
4
|
"description": "UI Components to support linking platform dataset feature",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
41
|
"@atlaskit/adf-schema": "^57.7.0",
|
|
42
|
-
"@atlaskit/afm-i18n-platform-linking-platform-link-datasource": "2.
|
|
42
|
+
"@atlaskit/afm-i18n-platform-linking-platform-link-datasource": "2.292.0",
|
|
43
43
|
"@atlaskit/analytics-cross-product": "^2.3.0",
|
|
44
44
|
"@atlaskit/analytics-next": "^12.6.0",
|
|
45
45
|
"@atlaskit/atlassian-context": "^2.0.0",
|
|
@@ -47,6 +47,7 @@
|
|
|
47
47
|
"@atlaskit/avatar-group": "^14.4.0",
|
|
48
48
|
"@atlaskit/badge": "^22.0.0",
|
|
49
49
|
"@atlaskit/button": "^25.6.0",
|
|
50
|
+
"@atlaskit/checkbox": "^19.3.0",
|
|
50
51
|
"@atlaskit/css": "^1.1.0",
|
|
51
52
|
"@atlaskit/datetime-picker": "^19.4.0",
|
|
52
53
|
"@atlaskit/dropdown-menu": "^21.0.0",
|
|
@@ -54,7 +55,7 @@
|
|
|
54
55
|
"@atlaskit/empty-state": "^12.2.0",
|
|
55
56
|
"@atlaskit/feature-gate-js-client": "^7.0.0",
|
|
56
57
|
"@atlaskit/flag": "^19.0.0",
|
|
57
|
-
"@atlaskit/form": "^18.
|
|
58
|
+
"@atlaskit/form": "^18.3.0",
|
|
58
59
|
"@atlaskit/heading": "^8.0.0",
|
|
59
60
|
"@atlaskit/icon": "^38.0.0",
|
|
60
61
|
"@atlaskit/image": "^5.2.0",
|
|
@@ -77,7 +78,7 @@
|
|
|
77
78
|
"@atlaskit/platform-feature-experiments": "^0.3.0",
|
|
78
79
|
"@atlaskit/platform-feature-flags": "^2.2.0",
|
|
79
80
|
"@atlaskit/platform-feature-flags-react": "^1.2.0",
|
|
80
|
-
"@atlaskit/popup": "^10.
|
|
81
|
+
"@atlaskit/popup": "^10.1.0",
|
|
81
82
|
"@atlaskit/pragmatic-drag-and-drop": "^4.0.0",
|
|
82
83
|
"@atlaskit/pragmatic-drag-and-drop-hitbox": "^3.0.0",
|
|
83
84
|
"@atlaskit/pragmatic-drag-and-drop-react-beautiful-dnd-autoscroll": "^3.2.0",
|
|
@@ -86,16 +87,16 @@
|
|
|
86
87
|
"@atlaskit/react-compiler-gating": "^0.2.0",
|
|
87
88
|
"@atlaskit/react-select": "^4.12.0",
|
|
88
89
|
"@atlaskit/select": "^23.1.0",
|
|
89
|
-
"@atlaskit/smart-card": "^46.
|
|
90
|
-
"@atlaskit/smart-user-picker": "^12.
|
|
90
|
+
"@atlaskit/smart-card": "^46.10.0",
|
|
91
|
+
"@atlaskit/smart-user-picker": "^12.8.0",
|
|
91
92
|
"@atlaskit/spinner": "^20.4.0",
|
|
92
93
|
"@atlaskit/tag": "^17.0.0",
|
|
93
|
-
"@atlaskit/textfield": "^10.
|
|
94
|
+
"@atlaskit/textfield": "^10.3.0",
|
|
94
95
|
"@atlaskit/theme": "^28.2.0",
|
|
95
96
|
"@atlaskit/toggle": "^17.3.0",
|
|
96
97
|
"@atlaskit/tokens": "^20.8.0",
|
|
97
98
|
"@atlaskit/tooltip": "^24.4.0",
|
|
98
|
-
"@atlaskit/top-layer": "^
|
|
99
|
+
"@atlaskit/top-layer": "^7.0.0",
|
|
99
100
|
"@atlaskit/ufo": "^2.0.0",
|
|
100
101
|
"@atlaskit/user-picker": "^14.3.0",
|
|
101
102
|
"@atlaskit/visually-hidden": "^4.4.0",
|
|
@@ -143,8 +144,7 @@
|
|
|
143
144
|
"jest-fetch-mock": "^3.0.3",
|
|
144
145
|
"react": "^18.0.0",
|
|
145
146
|
"react-dom": "^18.0.0",
|
|
146
|
-
"react-intl": "^7.0.0"
|
|
147
|
-
"wait-for-expect": "^1.2.0"
|
|
147
|
+
"react-intl": "^7.0.0"
|
|
148
148
|
},
|
|
149
149
|
"platform-feature-flags": {
|
|
150
150
|
"platform_datasource_missing_columns_error": {
|
|
@@ -181,6 +181,9 @@
|
|
|
181
181
|
"platform_lp_sllv_assets_default_schema_aql": {
|
|
182
182
|
"type": "boolean"
|
|
183
183
|
},
|
|
184
|
+
"astral_assets_macro_table_ui_uplift": {
|
|
185
|
+
"type": "boolean"
|
|
186
|
+
},
|
|
184
187
|
"electric_issue_like_table_xpc_url_wrapping": {
|
|
185
188
|
"type": "boolean"
|
|
186
189
|
},
|