@atlaskit/link-datasource 7.8.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 +6 -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 +9 -6
package/CHANGELOG.md
CHANGED
package/compass.yml
CHANGED
|
@@ -54,7 +54,9 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
|
|
|
54
54
|
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; }
|
|
55
55
|
var VERSION_TWO = '2';
|
|
56
56
|
var modalBodyErrorWrapperStyles = null;
|
|
57
|
-
var AssetsModalTitle =
|
|
57
|
+
var AssetsModalTitle = function AssetsModalTitle() {
|
|
58
|
+
return /*#__PURE__*/React.createElement(_modalTitle.default, null, /*#__PURE__*/React.createElement(_reactIntl.FormattedMessage, (0, _fg.fg)('astral_assets_macro_table_ui_uplift') ? _messages.modalMessages.assetsConfigModalTitle : _messages.modalMessages.insertObjectsTitle));
|
|
59
|
+
};
|
|
58
60
|
var PlainAssetsConfigModal = function PlainAssetsConfigModal(props) {
|
|
59
61
|
var datasourceId = props.datasourceId,
|
|
60
62
|
initialParameters = props.parameters,
|
|
@@ -369,7 +371,7 @@ var PlainAssetsConfigModal = function PlainAssetsConfigModal(props) {
|
|
|
369
371
|
} else {
|
|
370
372
|
if (!workspaceId || assetsClientLoading) {
|
|
371
373
|
return /*#__PURE__*/React.createElement(_loadingState.AssetsSearchContainerLoading, {
|
|
372
|
-
modalTitle: AssetsModalTitle
|
|
374
|
+
modalTitle: /*#__PURE__*/React.createElement(AssetsModalTitle, null)
|
|
373
375
|
});
|
|
374
376
|
}
|
|
375
377
|
return /*#__PURE__*/React.createElement(_searchContainer.AssetsSearchContainer, {
|
|
@@ -380,7 +382,7 @@ var PlainAssetsConfigModal = function PlainAssetsConfigModal(props) {
|
|
|
380
382
|
objectSchemas: objectSchemas
|
|
381
383
|
},
|
|
382
384
|
onSearch: handleOnSearch,
|
|
383
|
-
modalTitle: AssetsModalTitle,
|
|
385
|
+
modalTitle: /*#__PURE__*/React.createElement(AssetsModalTitle, null),
|
|
384
386
|
isSearching: status === 'loading',
|
|
385
387
|
onCancel: onCancel
|
|
386
388
|
});
|
|
@@ -20,5 +20,20 @@ var modalMessages = exports.modalMessages = (0, _reactIntl.defineMessages)({
|
|
|
20
20
|
id: 'linkDataSource.assets.configmodal.insertObjectsTitle',
|
|
21
21
|
description: 'Title for the Assets Objects Datasource config modal which prefixes a select picker',
|
|
22
22
|
defaultMessage: 'Insert objects from'
|
|
23
|
+
},
|
|
24
|
+
assetsConfigModalTitle: {
|
|
25
|
+
id: 'linkDataSource.assets.configmodal.title',
|
|
26
|
+
description: 'Title for the Assets Objects Datasource config modal',
|
|
27
|
+
defaultMessage: 'Assets table macro configuration'
|
|
28
|
+
},
|
|
29
|
+
filterObjectsText: {
|
|
30
|
+
id: 'linkDataSource.assets.configmodal.filterObjectsText',
|
|
31
|
+
description: 'Text for the filter option using aql search',
|
|
32
|
+
defaultMessage: 'Filter'
|
|
33
|
+
},
|
|
34
|
+
tablePreviewText: {
|
|
35
|
+
id: 'linkDataSource.assets.configmodal.tablePreviewText',
|
|
36
|
+
description: 'Heading above the table preview in the Assets configuration modal',
|
|
37
|
+
defaultMessage: 'Table preview'
|
|
23
38
|
}
|
|
24
39
|
});
|
|
@@ -11,11 +11,16 @@ require("./index.compiled.css");
|
|
|
11
11
|
var _react = _interopRequireWildcard(require("react"));
|
|
12
12
|
var React = _react;
|
|
13
13
|
var _runtime = require("@compiled/react/runtime");
|
|
14
|
+
var _reactIntl = require("react-intl");
|
|
15
|
+
var _heading = _interopRequireDefault(require("@atlaskit/heading/heading"));
|
|
16
|
+
var _fg = require("@atlaskit/platform-feature-flags/fg");
|
|
17
|
+
var _stack = require("@atlaskit/primitives/compiled/stack");
|
|
14
18
|
var _accessRequired = require("../../../common/error-state/access-required");
|
|
15
19
|
var _modalLoadingError = require("../../../common/error-state/modal-loading-error");
|
|
16
20
|
var _noResults = require("../../../common/error-state/no-results");
|
|
17
21
|
var _emptyState = _interopRequireDefault(require("../../../issue-like-table/empty-state"));
|
|
18
22
|
var _issueLikeDataTableView = require("../../../issue-like-table/issue-like-data-table-view");
|
|
23
|
+
var _messages = require("../messages");
|
|
19
24
|
var _initialStateView = require("./initial-state-view");
|
|
20
25
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
21
26
|
var MODAL_HEIGHT = exports.MODAL_HEIGHT = 420;
|
|
@@ -100,5 +105,12 @@ var RenderAssetsContent = exports.RenderAssetsContent = function RenderAssetsCon
|
|
|
100
105
|
}
|
|
101
106
|
return issueLikeDataTableView;
|
|
102
107
|
}, [columns.length, isFetchingInitialData, issueLikeDataTableView, resolvedWithNoResults, shouldRenderTableWithNoResults, status]);
|
|
108
|
+
if ((0, _fg.fg)('astral_assets_macro_table_ui_uplift')) {
|
|
109
|
+
return /*#__PURE__*/React.createElement(_stack.Stack, {
|
|
110
|
+
space: "space.200"
|
|
111
|
+
}, status !== 'empty' && /*#__PURE__*/React.createElement(_heading.default, {
|
|
112
|
+
size: "xsmall"
|
|
113
|
+
}, /*#__PURE__*/React.createElement(_reactIntl.FormattedMessage, _messages.modalMessages.tablePreviewText)), renderAssetsContentView());
|
|
114
|
+
}
|
|
103
115
|
return renderAssetsContentView();
|
|
104
116
|
};
|
|
@@ -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,155 @@
|
|
|
1
|
+
/* index.tsx generated by @compiled/babel-plugin v3.0.2 */
|
|
2
|
+
"use strict";
|
|
3
|
+
|
|
4
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
5
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
6
|
+
Object.defineProperty(exports, "__esModule", {
|
|
7
|
+
value: true
|
|
8
|
+
});
|
|
9
|
+
exports.selectInAModalStyleFixProps = exports.PAGE_SIZE_OPTIONS = exports.DEFAULT_PAGE_SIZE = exports.AssetsModalConfigPopup = void 0;
|
|
10
|
+
require("./index.compiled.css");
|
|
11
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
12
|
+
var React = _react;
|
|
13
|
+
var _runtime = require("@compiled/react/runtime");
|
|
14
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
15
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
16
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
17
|
+
var _reactIntl = require("react-intl");
|
|
18
|
+
var _button = _interopRequireDefault(require("@atlaskit/button/icon/button"));
|
|
19
|
+
var _checkbox = _interopRequireDefault(require("@atlaskit/checkbox/checkbox"));
|
|
20
|
+
var _default = require("@atlaskit/form/label/default");
|
|
21
|
+
var _customize = _interopRequireDefault(require("@atlaskit/icon/core/customize"));
|
|
22
|
+
var _popup = require("@atlaskit/popup/popup");
|
|
23
|
+
var _box = require("@atlaskit/primitives/compiled/box");
|
|
24
|
+
var _stack = require("@atlaskit/primitives/compiled/stack");
|
|
25
|
+
var _default2 = _interopRequireDefault(require("@atlaskit/select/default"));
|
|
26
|
+
var _zindex = require("../../../common/zindex");
|
|
27
|
+
var _messages = require("./messages");
|
|
28
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
29
|
+
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; }
|
|
30
|
+
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; }
|
|
31
|
+
/**
|
|
32
|
+
* Rendering a `<Select>` in a `<Modal>` results in the select options getting cut off by the bottom of the modal and
|
|
33
|
+
* scrolling. This is a work-around for that, see https://atlassian.slack.com/archives/CFJ9DU39U/p1623179496484100
|
|
34
|
+
*/
|
|
35
|
+
var selectInAModalStyleFixProps = exports.selectInAModalStyleFixProps = {
|
|
36
|
+
styles: {
|
|
37
|
+
menuPortal: function menuPortal(base) {
|
|
38
|
+
return _objectSpread(_objectSpread({}, base), {}, {
|
|
39
|
+
zIndex: _zindex.aboveModal
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
menuPortalTarget: document.body
|
|
44
|
+
};
|
|
45
|
+
var PAGE_SIZE_OPTIONS = exports.PAGE_SIZE_OPTIONS = [10, 20, 50, 100];
|
|
46
|
+
var DEFAULT_PAGE_SIZE = exports.DEFAULT_PAGE_SIZE = 20;
|
|
47
|
+
var styles = {
|
|
48
|
+
trigger: "_19bvxy5q _u5f3pxbi",
|
|
49
|
+
content: "_1bsb1kdj _ca0qpxbi _u5f3pxbi _n3tdpxbi _19bvpxbi"
|
|
50
|
+
};
|
|
51
|
+
var AssetsModalConfigPopup = exports.AssetsModalConfigPopup = function AssetsModalConfigPopup(_ref) {
|
|
52
|
+
var _initialConfig$pageSi, _initialConfig$isNest;
|
|
53
|
+
var initialConfig = _ref.initialConfig,
|
|
54
|
+
onChange = _ref.onChange,
|
|
55
|
+
_ref$testId = _ref.testId,
|
|
56
|
+
testId = _ref$testId === void 0 ? 'assets-datasource-modal--config-popup' : _ref$testId;
|
|
57
|
+
var _useIntl = (0, _reactIntl.useIntl)(),
|
|
58
|
+
formatMessage = _useIntl.formatMessage;
|
|
59
|
+
var _useState = (0, _react.useState)(false),
|
|
60
|
+
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
61
|
+
isOpen = _useState2[0],
|
|
62
|
+
setIsOpen = _useState2[1];
|
|
63
|
+
var _useState3 = (0, _react.useState)({
|
|
64
|
+
pageSize: (_initialConfig$pageSi = initialConfig === null || initialConfig === void 0 ? void 0 : initialConfig.pageSize) !== null && _initialConfig$pageSi !== void 0 ? _initialConfig$pageSi : DEFAULT_PAGE_SIZE,
|
|
65
|
+
isNestedReferenceAttributeSelectionEnabled: (_initialConfig$isNest = initialConfig === null || initialConfig === void 0 ? void 0 : initialConfig.isNestedReferenceAttributeSelectionEnabled) !== null && _initialConfig$isNest !== void 0 ? _initialConfig$isNest : false
|
|
66
|
+
}),
|
|
67
|
+
_useState4 = (0, _slicedToArray2.default)(_useState3, 2),
|
|
68
|
+
config = _useState4[0],
|
|
69
|
+
setConfig = _useState4[1];
|
|
70
|
+
var pageSizeSelectId = (0, _react.useId)();
|
|
71
|
+
var pageSizeOptions = PAGE_SIZE_OPTIONS.map(function (count) {
|
|
72
|
+
return {
|
|
73
|
+
label: formatMessage(_messages.modalConfigPopupMessages.objectsPerPage, {
|
|
74
|
+
count: count
|
|
75
|
+
}),
|
|
76
|
+
value: count
|
|
77
|
+
};
|
|
78
|
+
});
|
|
79
|
+
var updateConfig = function updateConfig(partialConfig) {
|
|
80
|
+
var nextConfig = _objectSpread(_objectSpread({}, config), partialConfig);
|
|
81
|
+
setConfig(nextConfig);
|
|
82
|
+
onChange(nextConfig);
|
|
83
|
+
};
|
|
84
|
+
var handlePageSizeChange = function handlePageSizeChange(option) {
|
|
85
|
+
if (option) {
|
|
86
|
+
updateConfig({
|
|
87
|
+
pageSize: option.value
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
var handleNestedReferenceAttributeSelectionChange = function handleNestedReferenceAttributeSelectionChange(event) {
|
|
92
|
+
updateConfig({
|
|
93
|
+
isNestedReferenceAttributeSelectionEnabled: event.target.checked
|
|
94
|
+
});
|
|
95
|
+
};
|
|
96
|
+
var selectedPageSizeOption = pageSizeOptions.find(function (option) {
|
|
97
|
+
return option.value === config.pageSize;
|
|
98
|
+
});
|
|
99
|
+
return /*#__PURE__*/React.createElement(_popup.Popup, {
|
|
100
|
+
isOpen: isOpen,
|
|
101
|
+
onClose: function onClose() {
|
|
102
|
+
return setIsOpen(false);
|
|
103
|
+
},
|
|
104
|
+
placement: "bottom-end",
|
|
105
|
+
testId: testId,
|
|
106
|
+
role: "dialog",
|
|
107
|
+
label: formatMessage(_messages.modalConfigPopupMessages.configureTable),
|
|
108
|
+
zIndex: _zindex.aboveModal,
|
|
109
|
+
trigger: function trigger(triggerProps) {
|
|
110
|
+
return /*#__PURE__*/React.createElement(_box.Box, {
|
|
111
|
+
xcss: styles.trigger
|
|
112
|
+
}, /*#__PURE__*/React.createElement(_button.default, {
|
|
113
|
+
ref: triggerProps.ref,
|
|
114
|
+
"aria-controls": triggerProps['aria-controls'],
|
|
115
|
+
"aria-expanded": triggerProps['aria-expanded'],
|
|
116
|
+
"aria-haspopup": triggerProps['aria-haspopup'],
|
|
117
|
+
icon: _customize.default,
|
|
118
|
+
isSelected: isOpen,
|
|
119
|
+
isTooltipDisabled: false,
|
|
120
|
+
label: formatMessage(_messages.modalConfigPopupMessages.configureTable),
|
|
121
|
+
onClick: function onClick() {
|
|
122
|
+
return setIsOpen(function (currentIsOpen) {
|
|
123
|
+
return !currentIsOpen;
|
|
124
|
+
});
|
|
125
|
+
},
|
|
126
|
+
testId: "".concat(testId, "--trigger")
|
|
127
|
+
}));
|
|
128
|
+
},
|
|
129
|
+
content: function content() {
|
|
130
|
+
return /*#__PURE__*/React.createElement(_box.Box, {
|
|
131
|
+
xcss: styles.content
|
|
132
|
+
}, /*#__PURE__*/React.createElement(_stack.Stack, {
|
|
133
|
+
space: "space.200"
|
|
134
|
+
}, /*#__PURE__*/React.createElement(_stack.Stack, {
|
|
135
|
+
space: "space.050",
|
|
136
|
+
alignInline: "start"
|
|
137
|
+
}, /*#__PURE__*/React.createElement(_default.Label, {
|
|
138
|
+
htmlFor: pageSizeSelectId
|
|
139
|
+
}, /*#__PURE__*/React.createElement(_reactIntl.FormattedMessage, _messages.modalConfigPopupMessages.tablePagination)), /*#__PURE__*/React.createElement(_default2.default, (0, _extends2.default)({}, selectInAModalStyleFixProps, {
|
|
140
|
+
inputId: pageSizeSelectId,
|
|
141
|
+
options: pageSizeOptions,
|
|
142
|
+
value: selectedPageSizeOption,
|
|
143
|
+
onChange: handlePageSizeChange,
|
|
144
|
+
isSearchable: false,
|
|
145
|
+
menuPlacement: "bottom",
|
|
146
|
+
testId: "".concat(testId, "--page-size-select")
|
|
147
|
+
}))), /*#__PURE__*/React.createElement(_checkbox.default, {
|
|
148
|
+
isChecked: config.isNestedReferenceAttributeSelectionEnabled,
|
|
149
|
+
onChange: handleNestedReferenceAttributeSelectionChange,
|
|
150
|
+
label: formatMessage(_messages.modalConfigPopupMessages.nestedReferenceAttributeSelection),
|
|
151
|
+
testId: "".concat(testId, "--nested-reference-attribute-selection")
|
|
152
|
+
})));
|
|
153
|
+
}
|
|
154
|
+
});
|
|
155
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.modalConfigPopupMessages = void 0;
|
|
7
|
+
var _reactIntl = require("react-intl");
|
|
8
|
+
var modalConfigPopupMessages = exports.modalConfigPopupMessages = (0, _reactIntl.defineMessages)({
|
|
9
|
+
configureTable: {
|
|
10
|
+
id: 'linkDataSource.assets.configModal.configPopup.configureTable',
|
|
11
|
+
description: 'Tooltip and accessibility label for the icon button that opens the Assets table configuration popup',
|
|
12
|
+
defaultMessage: 'Configure table'
|
|
13
|
+
},
|
|
14
|
+
nestedReferenceAttributeSelection: {
|
|
15
|
+
id: 'linkDataSource.assets.configModal.configPopup.nestedReferenceAttributeSelection',
|
|
16
|
+
description: 'Label for the checkbox that allows users to select attributes of referenced objects (nested attributes) as table columns',
|
|
17
|
+
defaultMessage: 'Enable nested reference attribute selection'
|
|
18
|
+
},
|
|
19
|
+
objectsPerPage: {
|
|
20
|
+
id: 'linkDataSource.assets.configModal.configPopup.objectsPerPage',
|
|
21
|
+
description: 'Option label in the pagination select showing how many Assets objects are displayed per table page. {count} is the number of objects.',
|
|
22
|
+
defaultMessage: '{count, plural, one {# object per page} other {# objects per page}}'
|
|
23
|
+
},
|
|
24
|
+
tablePagination: {
|
|
25
|
+
id: 'linkDataSource.assets.configModal.configPopup.tablePagination',
|
|
26
|
+
description: 'Label for the select input where users choose how many Assets objects are displayed per table page',
|
|
27
|
+
defaultMessage: 'Table pagination:'
|
|
28
|
+
}
|
|
29
|
+
});
|
|
@@ -13,12 +13,17 @@ var React = _react;
|
|
|
13
13
|
var _runtime = require("@compiled/react/runtime");
|
|
14
14
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
15
15
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
16
|
+
var _reactIntl = require("react-intl");
|
|
16
17
|
var _form = _interopRequireDefault(require("@atlaskit/form/form"));
|
|
18
|
+
var _heading = _interopRequireDefault(require("@atlaskit/heading/heading"));
|
|
17
19
|
var _closeButton = require("@atlaskit/modal-dialog/close-button");
|
|
18
20
|
var _fg = require("@atlaskit/platform-feature-flags/fg");
|
|
19
21
|
var _flex = require("@atlaskit/primitives/compiled/flex");
|
|
22
|
+
var _text = require("@atlaskit/primitives/compiled/text");
|
|
20
23
|
var _analytics = require("../../../analytics");
|
|
21
24
|
var _types = require("../../../types/assets/types");
|
|
25
|
+
var _modalConfigPopup = require("../modal-config-popup");
|
|
26
|
+
var _messages = require("../modal/messages");
|
|
22
27
|
var _aqlSearchInput = require("./aql-search-input");
|
|
23
28
|
var _objectSchemaSelect = require("./object-schema-select");
|
|
24
29
|
var _styled = require("./styled");
|
|
@@ -26,7 +31,7 @@ var _excluded = ["as", "style"];
|
|
|
26
31
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
27
32
|
var styles = {
|
|
28
33
|
modalTitleContainer: "_zulppxbi _4cvr1h6o",
|
|
29
|
-
flexStyles: "
|
|
34
|
+
flexStyles: "_1bsb1osq"
|
|
30
35
|
};
|
|
31
36
|
var DEFAULT_AQL_QUERY = '';
|
|
32
37
|
var SEARCH_FORM_ID = 'linkDataSource.assets.configModal.searchContainer-form';
|
|
@@ -67,7 +72,7 @@ var AssetsSearchContainer = exports.AssetsSearchContainer = function AssetsSearc
|
|
|
67
72
|
return /*#__PURE__*/React.createElement(_form.default, {
|
|
68
73
|
onSubmit: onFormSubmit
|
|
69
74
|
}, function (_ref2) {
|
|
70
|
-
var _initialSearchData$ob, _initialSearchData$ob2, _initialSearchData$aq;
|
|
75
|
+
var _initialSearchData$ob, _initialSearchData$ob2, _initialSearchData$ob3, _initialSearchData$ob4, _initialSearchData$aq;
|
|
71
76
|
var formProps = _ref2.formProps,
|
|
72
77
|
setFieldValue = _ref2.setFieldValue;
|
|
73
78
|
var onSchemaChange = function onSchemaChange(schema) {
|
|
@@ -81,24 +86,48 @@ var AssetsSearchContainer = exports.AssetsSearchContainer = function AssetsSearc
|
|
|
81
86
|
id: SEARCH_FORM_ID
|
|
82
87
|
}), /*#__PURE__*/React.createElement(_styled.FormRowContainer, {
|
|
83
88
|
isNarrowGap: true
|
|
84
|
-
}, /*#__PURE__*/React.createElement(_flex.Flex, {
|
|
89
|
+
}, (0, _fg.fg)('astral_assets_macro_table_ui_uplift') ? /*#__PURE__*/React.createElement(_flex.Flex, {
|
|
85
90
|
gap: "space.200",
|
|
86
91
|
justifyContent: "space-between",
|
|
87
92
|
xcss: styles.flexStyles
|
|
88
93
|
}, /*#__PURE__*/React.createElement(_flex.Flex, {
|
|
94
|
+
justifyContent: "start",
|
|
95
|
+
xcss: styles.modalTitleContainer
|
|
96
|
+
}, modalTitle), /*#__PURE__*/React.createElement(_flex.Flex, {
|
|
89
97
|
justifyContent: "end"
|
|
90
|
-
}, /*#__PURE__*/React.createElement(
|
|
98
|
+
}, /*#__PURE__*/React.createElement(_flex.Flex, {
|
|
99
|
+
alignItems: "center",
|
|
100
|
+
gap: "space.100"
|
|
101
|
+
}, /*#__PURE__*/React.createElement(_text.Text, null, /*#__PURE__*/React.createElement(_reactIntl.FormattedMessage, _messages.modalMessages.insertObjectsTitle), ":"), /*#__PURE__*/React.createElement(_objectSchemaSelect.AssetsObjectSchemaSelect, {
|
|
102
|
+
value: (_initialSearchData$ob = initialSearchData.objectSchema) !== null && _initialSearchData$ob !== void 0 ? _initialSearchData$ob : undefined,
|
|
103
|
+
workspaceId: workspaceId,
|
|
104
|
+
initialObjectSchemas: (_initialSearchData$ob2 = initialSearchData.objectSchemas) !== null && _initialSearchData$ob2 !== void 0 ? _initialSearchData$ob2 : undefined,
|
|
105
|
+
classNamePrefix: "assets-datasource-modal--object-schema-select",
|
|
106
|
+
onSchemaChange: onSchemaChange
|
|
107
|
+
})), /*#__PURE__*/React.createElement(_modalConfigPopup.AssetsModalConfigPopup, {
|
|
108
|
+
onChange: function onChange() {}
|
|
109
|
+
}), /*#__PURE__*/React.createElement(_closeButton.CloseButton, {
|
|
91
110
|
onClick: onCancel
|
|
92
|
-
}))
|
|
111
|
+
}))) : /*#__PURE__*/React.createElement(_flex.Flex, {
|
|
112
|
+
gap: "space.200",
|
|
113
|
+
justifyContent: "space-between",
|
|
114
|
+
xcss: styles.flexStyles
|
|
115
|
+
}, /*#__PURE__*/React.createElement(_flex.Flex, {
|
|
93
116
|
justifyContent: "start",
|
|
94
117
|
xcss: styles.modalTitleContainer
|
|
95
118
|
}, modalTitle, /*#__PURE__*/React.createElement(_objectSchemaSelect.AssetsObjectSchemaSelect, {
|
|
96
|
-
value: (_initialSearchData$
|
|
119
|
+
value: (_initialSearchData$ob3 = initialSearchData.objectSchema) !== null && _initialSearchData$ob3 !== void 0 ? _initialSearchData$ob3 : undefined,
|
|
97
120
|
workspaceId: workspaceId,
|
|
98
|
-
initialObjectSchemas: (_initialSearchData$
|
|
121
|
+
initialObjectSchemas: (_initialSearchData$ob4 = initialSearchData.objectSchemas) !== null && _initialSearchData$ob4 !== void 0 ? _initialSearchData$ob4 : undefined,
|
|
99
122
|
classNamePrefix: "assets-datasource-modal--object-schema-select",
|
|
100
123
|
onSchemaChange: onSchemaChange
|
|
101
|
-
}))
|
|
124
|
+
})), /*#__PURE__*/React.createElement(_flex.Flex, {
|
|
125
|
+
justifyContent: "end"
|
|
126
|
+
}, /*#__PURE__*/React.createElement(_closeButton.CloseButton, {
|
|
127
|
+
onClick: onCancel
|
|
128
|
+
})))), (0, _fg.fg)('astral_assets_macro_table_ui_uplift') ? /*#__PURE__*/React.createElement(_heading.default, {
|
|
129
|
+
size: "xsmall"
|
|
130
|
+
}, /*#__PURE__*/React.createElement(_reactIntl.FormattedMessage, _messages.modalMessages.filterObjectsText)) : null, /*#__PURE__*/React.createElement(_styled.FormRowContainer, null, /*#__PURE__*/React.createElement(_aqlSearchInput.AqlSearchInput, {
|
|
102
131
|
value: (_initialSearchData$aq = initialSearchData.aql) !== null && _initialSearchData$aq !== void 0 ? _initialSearchData$aq : DEFAULT_AQL_QUERY,
|
|
103
132
|
workspaceId: workspaceId,
|
|
104
133
|
isSearching: isSearching
|
|
@@ -42,7 +42,7 @@ import { modalMessages } from './messages';
|
|
|
42
42
|
import { RenderAssetsContent } from './render-assets-content';
|
|
43
43
|
const VERSION_TWO = '2';
|
|
44
44
|
const modalBodyErrorWrapperStyles = null;
|
|
45
|
-
const AssetsModalTitle = /*#__PURE__*/React.createElement(ModalTitle, null, /*#__PURE__*/React.createElement(FormattedMessage, modalMessages.insertObjectsTitle));
|
|
45
|
+
const AssetsModalTitle = () => /*#__PURE__*/React.createElement(ModalTitle, null, /*#__PURE__*/React.createElement(FormattedMessage, fg('astral_assets_macro_table_ui_uplift') ? modalMessages.assetsConfigModalTitle : modalMessages.insertObjectsTitle));
|
|
46
46
|
const PlainAssetsConfigModal = props => {
|
|
47
47
|
const {
|
|
48
48
|
datasourceId,
|
|
@@ -337,7 +337,7 @@ const PlainAssetsConfigModal = props => {
|
|
|
337
337
|
} else {
|
|
338
338
|
if (!workspaceId || assetsClientLoading) {
|
|
339
339
|
return /*#__PURE__*/React.createElement(AssetsSearchContainerLoading, {
|
|
340
|
-
modalTitle: AssetsModalTitle
|
|
340
|
+
modalTitle: /*#__PURE__*/React.createElement(AssetsModalTitle, null)
|
|
341
341
|
});
|
|
342
342
|
}
|
|
343
343
|
return /*#__PURE__*/React.createElement(AssetsSearchContainer, {
|
|
@@ -348,7 +348,7 @@ const PlainAssetsConfigModal = props => {
|
|
|
348
348
|
objectSchemas
|
|
349
349
|
},
|
|
350
350
|
onSearch: handleOnSearch,
|
|
351
|
-
modalTitle: AssetsModalTitle,
|
|
351
|
+
modalTitle: /*#__PURE__*/React.createElement(AssetsModalTitle, null),
|
|
352
352
|
isSearching: status === 'loading',
|
|
353
353
|
onCancel: onCancel
|
|
354
354
|
});
|
|
@@ -14,5 +14,20 @@ export const 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 const MODAL_HEIGHT = 420;
|
|
13
18
|
|
|
@@ -81,5 +86,12 @@ export const RenderAssetsContent = props => {
|
|
|
81
86
|
}
|
|
82
87
|
return issueLikeDataTableView;
|
|
83
88
|
}, [columns.length, isFetchingInitialData, issueLikeDataTableView, resolvedWithNoResults, shouldRenderTableWithNoResults, status]);
|
|
89
|
+
if (fg('astral_assets_macro_table_ui_uplift')) {
|
|
90
|
+
return /*#__PURE__*/React.createElement(Stack, {
|
|
91
|
+
space: "space.200"
|
|
92
|
+
}, status !== 'empty' && /*#__PURE__*/React.createElement(Heading, {
|
|
93
|
+
size: "xsmall"
|
|
94
|
+
}, /*#__PURE__*/React.createElement(FormattedMessage, modalMessages.tablePreviewText)), renderAssetsContentView());
|
|
95
|
+
}
|
|
84
96
|
return renderAssetsContentView();
|
|
85
97
|
};
|
|
@@ -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,126 @@
|
|
|
1
|
+
/* index.tsx generated by @compiled/babel-plugin v3.0.2 */
|
|
2
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
3
|
+
import "./index.compiled.css";
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
import { ax, ix } from "@compiled/react/runtime";
|
|
6
|
+
import { useId, useState } from 'react';
|
|
7
|
+
import { useIntl, FormattedMessage } from 'react-intl';
|
|
8
|
+
import IconButton from '@atlaskit/button/icon/button';
|
|
9
|
+
import Checkbox from '@atlaskit/checkbox/checkbox';
|
|
10
|
+
import { Label } from '@atlaskit/form/label/default';
|
|
11
|
+
import CustomizeIcon from '@atlaskit/icon/core/customize';
|
|
12
|
+
import { Popup } from '@atlaskit/popup/popup';
|
|
13
|
+
import { Box } from '@atlaskit/primitives/compiled/box';
|
|
14
|
+
import { Stack } from '@atlaskit/primitives/compiled/stack';
|
|
15
|
+
import Select from '@atlaskit/select/default';
|
|
16
|
+
import { aboveModal } from '../../../common/zindex';
|
|
17
|
+
import { modalConfigPopupMessages } from './messages';
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Rendering a `<Select>` in a `<Modal>` results in the select options getting cut off by the bottom of the modal and
|
|
21
|
+
* scrolling. This is a work-around for that, see https://atlassian.slack.com/archives/CFJ9DU39U/p1623179496484100
|
|
22
|
+
*/
|
|
23
|
+
export const selectInAModalStyleFixProps = {
|
|
24
|
+
styles: {
|
|
25
|
+
menuPortal: base => ({
|
|
26
|
+
...base,
|
|
27
|
+
zIndex: aboveModal
|
|
28
|
+
})
|
|
29
|
+
},
|
|
30
|
+
menuPortalTarget: document.body
|
|
31
|
+
};
|
|
32
|
+
export const PAGE_SIZE_OPTIONS = [10, 20, 50, 100];
|
|
33
|
+
export const DEFAULT_PAGE_SIZE = 20;
|
|
34
|
+
const styles = {
|
|
35
|
+
trigger: "_19bvxy5q _u5f3pxbi",
|
|
36
|
+
content: "_1bsb1kdj _ca0qpxbi _u5f3pxbi _n3tdpxbi _19bvpxbi"
|
|
37
|
+
};
|
|
38
|
+
export const AssetsModalConfigPopup = ({
|
|
39
|
+
initialConfig,
|
|
40
|
+
onChange,
|
|
41
|
+
testId = 'assets-datasource-modal--config-popup'
|
|
42
|
+
}) => {
|
|
43
|
+
var _initialConfig$pageSi, _initialConfig$isNest;
|
|
44
|
+
const {
|
|
45
|
+
formatMessage
|
|
46
|
+
} = useIntl();
|
|
47
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
48
|
+
const [config, setConfig] = useState({
|
|
49
|
+
pageSize: (_initialConfig$pageSi = initialConfig === null || initialConfig === void 0 ? void 0 : initialConfig.pageSize) !== null && _initialConfig$pageSi !== void 0 ? _initialConfig$pageSi : DEFAULT_PAGE_SIZE,
|
|
50
|
+
isNestedReferenceAttributeSelectionEnabled: (_initialConfig$isNest = initialConfig === null || initialConfig === void 0 ? void 0 : initialConfig.isNestedReferenceAttributeSelectionEnabled) !== null && _initialConfig$isNest !== void 0 ? _initialConfig$isNest : false
|
|
51
|
+
});
|
|
52
|
+
const pageSizeSelectId = useId();
|
|
53
|
+
const pageSizeOptions = PAGE_SIZE_OPTIONS.map(count => ({
|
|
54
|
+
label: formatMessage(modalConfigPopupMessages.objectsPerPage, {
|
|
55
|
+
count
|
|
56
|
+
}),
|
|
57
|
+
value: count
|
|
58
|
+
}));
|
|
59
|
+
const updateConfig = partialConfig => {
|
|
60
|
+
const nextConfig = {
|
|
61
|
+
...config,
|
|
62
|
+
...partialConfig
|
|
63
|
+
};
|
|
64
|
+
setConfig(nextConfig);
|
|
65
|
+
onChange(nextConfig);
|
|
66
|
+
};
|
|
67
|
+
const handlePageSizeChange = option => {
|
|
68
|
+
if (option) {
|
|
69
|
+
updateConfig({
|
|
70
|
+
pageSize: option.value
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
const handleNestedReferenceAttributeSelectionChange = event => {
|
|
75
|
+
updateConfig({
|
|
76
|
+
isNestedReferenceAttributeSelectionEnabled: event.target.checked
|
|
77
|
+
});
|
|
78
|
+
};
|
|
79
|
+
const selectedPageSizeOption = pageSizeOptions.find(option => option.value === config.pageSize);
|
|
80
|
+
return /*#__PURE__*/React.createElement(Popup, {
|
|
81
|
+
isOpen: isOpen,
|
|
82
|
+
onClose: () => setIsOpen(false),
|
|
83
|
+
placement: "bottom-end",
|
|
84
|
+
testId: testId,
|
|
85
|
+
role: "dialog",
|
|
86
|
+
label: formatMessage(modalConfigPopupMessages.configureTable),
|
|
87
|
+
zIndex: aboveModal,
|
|
88
|
+
trigger: triggerProps => /*#__PURE__*/React.createElement(Box, {
|
|
89
|
+
xcss: styles.trigger
|
|
90
|
+
}, /*#__PURE__*/React.createElement(IconButton, {
|
|
91
|
+
ref: triggerProps.ref,
|
|
92
|
+
"aria-controls": triggerProps['aria-controls'],
|
|
93
|
+
"aria-expanded": triggerProps['aria-expanded'],
|
|
94
|
+
"aria-haspopup": triggerProps['aria-haspopup'],
|
|
95
|
+
icon: CustomizeIcon,
|
|
96
|
+
isSelected: isOpen,
|
|
97
|
+
isTooltipDisabled: false,
|
|
98
|
+
label: formatMessage(modalConfigPopupMessages.configureTable),
|
|
99
|
+
onClick: () => setIsOpen(currentIsOpen => !currentIsOpen),
|
|
100
|
+
testId: `${testId}--trigger`
|
|
101
|
+
})),
|
|
102
|
+
content: () => /*#__PURE__*/React.createElement(Box, {
|
|
103
|
+
xcss: styles.content
|
|
104
|
+
}, /*#__PURE__*/React.createElement(Stack, {
|
|
105
|
+
space: "space.200"
|
|
106
|
+
}, /*#__PURE__*/React.createElement(Stack, {
|
|
107
|
+
space: "space.050",
|
|
108
|
+
alignInline: "start"
|
|
109
|
+
}, /*#__PURE__*/React.createElement(Label, {
|
|
110
|
+
htmlFor: pageSizeSelectId
|
|
111
|
+
}, /*#__PURE__*/React.createElement(FormattedMessage, modalConfigPopupMessages.tablePagination)), /*#__PURE__*/React.createElement(Select, _extends({}, selectInAModalStyleFixProps, {
|
|
112
|
+
inputId: pageSizeSelectId,
|
|
113
|
+
options: pageSizeOptions,
|
|
114
|
+
value: selectedPageSizeOption,
|
|
115
|
+
onChange: handlePageSizeChange,
|
|
116
|
+
isSearchable: false,
|
|
117
|
+
menuPlacement: "bottom",
|
|
118
|
+
testId: `${testId}--page-size-select`
|
|
119
|
+
}))), /*#__PURE__*/React.createElement(Checkbox, {
|
|
120
|
+
isChecked: config.isNestedReferenceAttributeSelectionEnabled,
|
|
121
|
+
onChange: handleNestedReferenceAttributeSelectionChange,
|
|
122
|
+
label: formatMessage(modalConfigPopupMessages.nestedReferenceAttributeSelection),
|
|
123
|
+
testId: `${testId}--nested-reference-attribute-selection`
|
|
124
|
+
})))
|
|
125
|
+
});
|
|
126
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { defineMessages } from 'react-intl';
|
|
2
|
+
export const 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
|
+
});
|
|
@@ -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.8.
|
|
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",
|
|
@@ -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",
|
|
@@ -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",
|
|
@@ -90,12 +91,12 @@
|
|
|
90
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
|
},
|