@atlaskit/link-datasource 6.4.10 → 6.4.12
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 +16 -0
- package/dist/cjs/hooks/useDatasourceTableState.js +7 -1
- package/dist/cjs/ui/assets-modal/modal/render-assets-content/index.js +6 -2
- package/dist/cjs/ui/common/error-state/no-results.compiled.css +2 -0
- package/dist/cjs/ui/common/error-state/no-results.js +4 -2
- package/dist/cjs/ui/common/modal/display-view-dropdown/display-view-drop-down.js +4 -2
- package/dist/cjs/ui/common/modal/popup-select/index.js +1 -3
- package/dist/cjs/ui/common/modal/popup-select/menu-list/index.js +1 -3
- package/dist/cjs/ui/confluence-search-modal/basic-filters/filters/date-range-picker/index.js +1 -3
- package/dist/cjs/ui/confluence-search-modal/modal/index.js +6 -2
- package/dist/cjs/ui/datasource-table-view/datasourceTableView.js +7 -3
- package/dist/cjs/ui/issue-like-table/column-picker/index.js +1 -3
- package/dist/cjs/ui/issue-like-table/index.compiled.css +2 -0
- package/dist/cjs/ui/issue-like-table/index.js +57 -1
- package/dist/cjs/ui/issue-like-table/table-cell-content/index.js +1 -3
- package/dist/cjs/ui/jira-issues-modal/modal/index.js +5 -2
- package/dist/es2019/hooks/useDatasourceTableState.js +6 -1
- package/dist/es2019/ui/assets-modal/modal/render-assets-content/index.js +6 -2
- package/dist/es2019/ui/common/error-state/no-results.compiled.css +2 -0
- package/dist/es2019/ui/common/error-state/no-results.js +3 -1
- package/dist/es2019/ui/common/modal/display-view-dropdown/display-view-drop-down.js +4 -2
- package/dist/es2019/ui/common/modal/popup-select/index.js +1 -3
- package/dist/es2019/ui/common/modal/popup-select/menu-list/index.js +1 -3
- package/dist/es2019/ui/confluence-search-modal/basic-filters/filters/date-range-picker/index.js +1 -3
- package/dist/es2019/ui/confluence-search-modal/modal/index.js +6 -2
- package/dist/es2019/ui/datasource-table-view/datasourceTableView.js +7 -3
- package/dist/es2019/ui/issue-like-table/column-picker/index.js +1 -3
- package/dist/es2019/ui/issue-like-table/index.compiled.css +2 -0
- package/dist/es2019/ui/issue-like-table/index.js +51 -1
- package/dist/es2019/ui/issue-like-table/table-cell-content/index.js +1 -3
- package/dist/es2019/ui/jira-issues-modal/modal/index.js +5 -2
- package/dist/esm/hooks/useDatasourceTableState.js +7 -1
- package/dist/esm/ui/assets-modal/modal/render-assets-content/index.js +6 -2
- package/dist/esm/ui/common/error-state/no-results.compiled.css +2 -0
- package/dist/esm/ui/common/error-state/no-results.js +4 -2
- package/dist/esm/ui/common/modal/display-view-dropdown/display-view-drop-down.js +4 -2
- package/dist/esm/ui/common/modal/popup-select/index.js +1 -3
- package/dist/esm/ui/common/modal/popup-select/menu-list/index.js +1 -3
- package/dist/esm/ui/confluence-search-modal/basic-filters/filters/date-range-picker/index.js +1 -3
- package/dist/esm/ui/confluence-search-modal/modal/index.js +6 -2
- package/dist/esm/ui/datasource-table-view/datasourceTableView.js +7 -3
- package/dist/esm/ui/issue-like-table/column-picker/index.js +1 -3
- package/dist/esm/ui/issue-like-table/index.compiled.css +2 -0
- package/dist/esm/ui/issue-like-table/index.js +57 -1
- package/dist/esm/ui/issue-like-table/table-cell-content/index.js +1 -3
- package/dist/esm/ui/jira-issues-modal/modal/index.js +5 -2
- package/dist/types/ui/common/error-state/no-results.d.ts +3 -1
- package/package.json +6 -3
- package/link-datasource.docs.tsx +0 -169
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @atlaskit/link-datasource
|
|
2
2
|
|
|
3
|
+
## 6.4.12
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
|
|
9
|
+
## 6.4.11
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`24e05fa81e0c7`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/24e05fa81e0c7) -
|
|
14
|
+
[ux] When a search resolves with no items but the response still describes its columns, the
|
|
15
|
+
datasource table now keeps its column headers and footer and renders the "no results" message in
|
|
16
|
+
place of the rows, instead of replacing the entire view. Behind the
|
|
17
|
+
platform_lp_sllv_ux_improvements feature gate.
|
|
18
|
+
|
|
3
19
|
## 6.4.10
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
|
@@ -12,6 +12,7 @@ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/sli
|
|
|
12
12
|
var _react = require("react");
|
|
13
13
|
var _isEqual = _interopRequireDefault(require("lodash/isEqual"));
|
|
14
14
|
var _isFedramp = require("@atlaskit/atlassian-context/is-fedramp");
|
|
15
|
+
var _fg = require("@atlaskit/platform-feature-flags/fg");
|
|
15
16
|
var _linkClientExtension = require("@atlaskit/link-client-extension");
|
|
16
17
|
var _analytics = require("../analytics");
|
|
17
18
|
var _state = require("../state");
|
|
@@ -238,6 +239,7 @@ var useDatasourceTableState = exports.useDatasourceTableState = function useData
|
|
|
238
239
|
entityType,
|
|
239
240
|
newIds,
|
|
240
241
|
aris,
|
|
242
|
+
shouldApplySchemaWithoutItems,
|
|
241
243
|
isUserLoadingNextPage,
|
|
242
244
|
currentLoadedItemCount,
|
|
243
245
|
newlyLoadedItemCount,
|
|
@@ -348,7 +350,11 @@ var useDatasourceTableState = exports.useDatasourceTableState = function useData
|
|
|
348
350
|
if (fieldKeys.length > 0) {
|
|
349
351
|
setLastRequestedFieldKeys(fieldKeys);
|
|
350
352
|
}
|
|
351
|
-
|
|
353
|
+
|
|
354
|
+
// A response with no items still describes its columns, so the schema is worth applying
|
|
355
|
+
// to let the table keep its headers while showing the empty state.
|
|
356
|
+
shouldApplySchemaWithoutItems = items.length === 0 && (0, _fg.fg)('platform_lp_sllv_ux_improvements');
|
|
357
|
+
if ((isSchemaFromData && schema || fullSchema.properties.length > 0) && (items.length > 0 || shouldApplySchemaWithoutItems)) {
|
|
352
358
|
applySchemaProperties(schema || fullSchema, fieldKeys);
|
|
353
359
|
}
|
|
354
360
|
isUserLoadingNextPage = responseItems.length !== 0 && !shouldRequestFirstPage;
|
|
@@ -10,6 +10,7 @@ require("./index.compiled.css");
|
|
|
10
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
11
|
var React = _react;
|
|
12
12
|
var _runtime = require("@compiled/react/runtime");
|
|
13
|
+
var _fg = require("@atlaskit/platform-feature-flags/fg");
|
|
13
14
|
var _accessRequired = require("../../../common/error-state/access-required");
|
|
14
15
|
var _modalLoadingError = require("../../../common/error-state/modal-loading-error");
|
|
15
16
|
var _noResults = require("../../../common/error-state/no-results");
|
|
@@ -62,6 +63,9 @@ var RenderAssetsContent = exports.RenderAssetsContent = function RenderAssetsCon
|
|
|
62
63
|
onVisibleColumnKeysChange = props.onVisibleColumnKeysChange,
|
|
63
64
|
isFetchingInitialData = props.isFetchingInitialData;
|
|
64
65
|
var resolvedWithNoResults = status === 'resolved' && !responseItems.length;
|
|
66
|
+
// With columns available the table can keep its headers and show the empty state in place of
|
|
67
|
+
// the rows, instead of replacing the whole table with it.
|
|
68
|
+
var shouldRenderTableWithNoResults = resolvedWithNoResults && !!columns.length && (0, _fg.fg)('platform_lp_sllv_ux_improvements');
|
|
65
69
|
var issueLikeDataTableView = (0, _react.useMemo)(function () {
|
|
66
70
|
return /*#__PURE__*/React.createElement("div", {
|
|
67
71
|
className: (0, _runtime.ax)(["_1reo1wug _18m91wug _4t3i1pna _1e0c11p5", "_19itia51 _n7zl1mpn _13li1mok _qrwq1mok _1itkz1kv _12vemgnk _1lrw1sd4 _qmxj1c00"])
|
|
@@ -88,12 +92,12 @@ var RenderAssetsContent = exports.RenderAssetsContent = function RenderAssetsCon
|
|
|
88
92
|
return /*#__PURE__*/React.createElement(UnauthorizedView, null);
|
|
89
93
|
} else if (status === 'empty') {
|
|
90
94
|
return /*#__PURE__*/React.createElement(EmptyView, null);
|
|
91
|
-
} else if (resolvedWithNoResults) {
|
|
95
|
+
} else if (resolvedWithNoResults && !shouldRenderTableWithNoResults) {
|
|
92
96
|
return /*#__PURE__*/React.createElement(NoResultsView, null);
|
|
93
97
|
} else if (status === 'loading' && !columns.length) {
|
|
94
98
|
return /*#__PURE__*/React.createElement(LoadingView, null);
|
|
95
99
|
}
|
|
96
100
|
return issueLikeDataTableView;
|
|
97
|
-
}, [columns.length, isFetchingInitialData, issueLikeDataTableView, resolvedWithNoResults, status]);
|
|
101
|
+
}, [columns.length, isFetchingInitialData, issueLikeDataTableView, resolvedWithNoResults, shouldRenderTableWithNoResults, status]);
|
|
98
102
|
return renderAssetsContentView();
|
|
99
103
|
};
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
._zulp1ejb{gap:var(--ds-space-300,24px)}
|
|
2
2
|
._zulppxbi{gap:var(--ds-space-200,1pc)}._10fp1h6o{justify-self:center}
|
|
3
3
|
._18u0oahv{margin-left:var(--ds-space-600,3pc)}
|
|
4
|
+
._19pk1ejb{margin-top:var(--ds-space-300,24px)}
|
|
4
5
|
._19pkoahv{margin-top:var(--ds-space-600,3pc)}
|
|
5
6
|
._1wpz1h6o{align-self:center}
|
|
6
7
|
._2hwxoahv{margin-right:var(--ds-space-600,3pc)}
|
|
7
8
|
._4cvr1h6o{align-items:center}
|
|
8
9
|
._6a6z1h6o{justify-items:center}
|
|
10
|
+
._otyr1ejb{margin-bottom:var(--ds-space-300,24px)}
|
|
9
11
|
._otyroahv{margin-bottom:var(--ds-space-600,3pc)}
|
|
10
12
|
._p12fko4j{max-width:19pc}
|
|
11
13
|
._y3gn1h6o{text-align:center}
|
|
@@ -20,11 +20,13 @@ var _messages = require("./messages");
|
|
|
20
20
|
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
21
|
var styles = {
|
|
22
22
|
noResultsContainerStyles: "_4cvr1h6o _6a6z1h6o _1wpz1h6o _10fp1h6o _19pkoahv _2hwxoahv _otyroahv _18u0oahv",
|
|
23
|
+
noResultsCompactContainerStyles: "_4cvr1h6o _6a6z1h6o _1wpz1h6o _10fp1h6o _19pk1ejb _2hwxoahv _otyr1ejb _18u0oahv",
|
|
23
24
|
noResultsContentStyles: "_zulp1ejb _4cvr1h6o _6a6z1h6o _p12fko4j",
|
|
24
25
|
noResultsMessageContainerStyles: "_zulppxbi _4cvr1h6o _6a6z1h6o _y3gn1h6o"
|
|
25
26
|
};
|
|
26
27
|
var NoResults = exports.NoResults = function NoResults(_ref) {
|
|
27
|
-
var
|
|
28
|
+
var isCompact = _ref.isCompact,
|
|
29
|
+
onRefresh = _ref.onRefresh;
|
|
28
30
|
var _useDatasourceAnalyti = (0, _analytics.useDatasourceAnalyticsEvents)(),
|
|
29
31
|
fireEvent = _useDatasourceAnalyti.fireEvent;
|
|
30
32
|
var _useIntl = (0, _reactIntl.useIntl)(),
|
|
@@ -33,7 +35,7 @@ var NoResults = exports.NoResults = function NoResults(_ref) {
|
|
|
33
35
|
fireEvent('ui.emptyResult.shown.datasource', {});
|
|
34
36
|
}, [fireEvent]);
|
|
35
37
|
return /*#__PURE__*/React.createElement(_compiled.Grid, {
|
|
36
|
-
xcss: styles.noResultsContainerStyles,
|
|
38
|
+
xcss: isCompact ? styles.noResultsCompactContainerStyles : styles.noResultsContainerStyles,
|
|
37
39
|
testId: "datasource-modal--no-results"
|
|
38
40
|
}, /*#__PURE__*/React.createElement(_compiled.Grid, {
|
|
39
41
|
xcss: styles.noResultsContentStyles
|
|
@@ -16,12 +16,14 @@ var _reactIntl = require("react-intl");
|
|
|
16
16
|
var _new = _interopRequireDefault(require("@atlaskit/button/new"));
|
|
17
17
|
var _dropdownMenu = _interopRequireWildcard(require("@atlaskit/dropdown-menu"));
|
|
18
18
|
var _chevronDown = _interopRequireDefault(require("@atlaskit/icon/core/chevron-down"));
|
|
19
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
19
20
|
var _compiled = require("@atlaskit/primitives/compiled");
|
|
20
21
|
var _messages = require("./messages");
|
|
21
22
|
var _excluded = ["triggerRef"];
|
|
22
23
|
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); }
|
|
23
24
|
var styles = {
|
|
24
|
-
dropDownItemGroupStyles: "_2rko12b0 _1bsb1pna _4t3i7iqz"
|
|
25
|
+
dropDownItemGroupStyles: "_2rko12b0 _1bsb1pna _4t3i7iqz",
|
|
26
|
+
dropDownItemGroupStylesWithoutFixedHeight: "_2rko12b0 _1bsb1pna"
|
|
25
27
|
};
|
|
26
28
|
var InlineIcon = /*#__PURE__*/_react.default.createElement("svg", {
|
|
27
29
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -71,7 +73,7 @@ var DisplayViewDropDown = exports.DisplayViewDropDown = function DisplayViewDrop
|
|
|
71
73
|
},
|
|
72
74
|
testId: "datasource-modal--view-drop-down"
|
|
73
75
|
}, /*#__PURE__*/_react.default.createElement(_compiled.Box, {
|
|
74
|
-
xcss: styles.dropDownItemGroupStyles
|
|
76
|
+
xcss: (0, _platformFeatureFlags.fg)('platform_lp_sllv_ux_improvements') ? styles.dropDownItemGroupStylesWithoutFixedHeight : styles.dropDownItemGroupStyles
|
|
75
77
|
}, /*#__PURE__*/_react.default.createElement(_dropdownMenu.DropdownItemGroup, null, /*#__PURE__*/_react.default.createElement(_dropdownMenu.DropdownItem, {
|
|
76
78
|
testId: "dropdown-item-table",
|
|
77
79
|
onClick: function onClick() {
|
|
@@ -188,9 +188,7 @@ var FilterPopupSelect = exports.FilterPopupSelect = function FilterPopupSelect(_
|
|
|
188
188
|
shouldCloseMenuOnTab: false,
|
|
189
189
|
hideSelectedOptions: false,
|
|
190
190
|
isLoading: showLoading,
|
|
191
|
-
placeholder: searchPlaceholder ? searchPlaceholder : formatMessage(_messages.asyncPopupSelectMessages.selectPlaceholder)
|
|
192
|
-
// @ts-ignore - https://product-fabric.atlassian.net/browse/DSP-21000
|
|
193
|
-
,
|
|
191
|
+
placeholder: searchPlaceholder ? searchPlaceholder : formatMessage(_messages.asyncPopupSelectMessages.selectPlaceholder),
|
|
194
192
|
menuListProps: menuListProps,
|
|
195
193
|
components: {
|
|
196
194
|
Option: _customCheckboxOption.CustomCheckboxOption,
|
|
@@ -26,9 +26,7 @@ var styles = {
|
|
|
26
26
|
var CustomMenuList = function CustomMenuList(_ref) {
|
|
27
27
|
var children = _ref.children,
|
|
28
28
|
props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
29
|
-
var _props$selectProps$me =
|
|
30
|
-
// @ts-ignore - https://product-fabric.atlassian.net/browse/DSP-21000
|
|
31
|
-
props.selectProps.menuListProps,
|
|
29
|
+
var _props$selectProps$me = props.selectProps.menuListProps,
|
|
32
30
|
filterName = _props$selectProps$me.filterName,
|
|
33
31
|
isLoading = _props$selectProps$me.isLoading,
|
|
34
32
|
isLoadingMore = _props$selectProps$me.isLoadingMore,
|
package/dist/cjs/ui/confluence-search-modal/basic-filters/filters/date-range-picker/index.js
CHANGED
|
@@ -261,9 +261,7 @@ var DateRangePicker = exports.DateRangePicker = function DateRangePicker(_ref6)
|
|
|
261
261
|
};
|
|
262
262
|
return /*#__PURE__*/_react.default.createElement(_popup.default, {
|
|
263
263
|
isOpen: !!isPickerOpen,
|
|
264
|
-
onClose: handlePickerToggle
|
|
265
|
-
// @ts-ignore: [PIT-1685] Fails in post-office due to backwards incompatibility issue with React 18
|
|
266
|
-
,
|
|
264
|
+
onClose: handlePickerToggle,
|
|
267
265
|
popupComponent: _PopupComponent.PopupComponent,
|
|
268
266
|
zIndex: _constants.layers.modal(),
|
|
269
267
|
content: popupContent,
|
|
@@ -17,6 +17,7 @@ var _featureGateJsClient = _interopRequireDefault(require("@atlaskit/feature-gat
|
|
|
17
17
|
var _main = _interopRequireDefault(require("@atlaskit/intl-messages-provider/main"));
|
|
18
18
|
var _link = _interopRequireDefault(require("@atlaskit/link"));
|
|
19
19
|
var _modalDialog = require("@atlaskit/modal-dialog");
|
|
20
|
+
var _fg = require("@atlaskit/platform-feature-flags/fg");
|
|
20
21
|
var _compiled = require("@atlaskit/primitives/compiled");
|
|
21
22
|
var _analytics = require("../../../analytics");
|
|
22
23
|
var _types = require("../../../analytics/types");
|
|
@@ -160,6 +161,9 @@ var PlainConfluenceSearchConfigModal = exports.PlainConfluenceSearchConfigModal
|
|
|
160
161
|
siteSelectorLabel = availableSites && availableSites.length > 1 ? _messages.confluenceSearchModalMessages.insertIssuesTitleManySites : _messages.confluenceSearchModalMessages.insertIssuesTitle;
|
|
161
162
|
}
|
|
162
163
|
var resolvedWithNoResults = status === 'resolved' && !responseItems.length;
|
|
164
|
+
// With columns available the table can keep its headers and show the empty state in place of
|
|
165
|
+
// the rows, instead of replacing the whole table with it.
|
|
166
|
+
var shouldRenderTableWithNoResults = resolvedWithNoResults && !!columns.length && (0, _fg.fg)('platform_lp_sllv_ux_improvements');
|
|
163
167
|
var hasConfluenceSearchParams = selectedConfluenceSite && (parameters === null || parameters === void 0 ? void 0 : parameters.searchString);
|
|
164
168
|
var selectedConfluenceSiteUrl = selectedConfluenceSite === null || selectedConfluenceSite === void 0 ? void 0 : selectedConfluenceSite.url;
|
|
165
169
|
var confluenceSearchUrl = (0, _react.useMemo)(function () {
|
|
@@ -246,7 +250,7 @@ var PlainConfluenceSearchConfigModal = exports.PlainConfluenceSearchConfigModal
|
|
|
246
250
|
return /*#__PURE__*/_react.default.createElement(_accessRequired.AccessRequired, {
|
|
247
251
|
url: selectedConfluenceSiteUrl || urlBeingEdited
|
|
248
252
|
});
|
|
249
|
-
} else if (resolvedWithNoResults || status === 'forbidden') {
|
|
253
|
+
} else if (resolvedWithNoResults && !shouldRenderTableWithNoResults || status === 'forbidden') {
|
|
250
254
|
return /*#__PURE__*/_react.default.createElement(_noResults.NoResults, null);
|
|
251
255
|
} else if (status === 'empty' || !columns.length) {
|
|
252
256
|
// persist the empty state when making the initial /data request which contains the columns
|
|
@@ -269,7 +273,7 @@ var PlainConfluenceSearchConfigModal = exports.PlainConfluenceSearchConfigModal
|
|
|
269
273
|
}, /*#__PURE__*/_react.default.createElement(_datasourcesTableInModalPreview.default, {
|
|
270
274
|
testId: "confluence-search-datasource-table"
|
|
271
275
|
}));
|
|
272
|
-
}, [status, resolvedWithNoResults, columns.length, selectedConfluenceSiteUrl, urlBeingEdited, hasConfluenceSearchParams, formatMessage, reset, selectedConfluenceSite]);
|
|
276
|
+
}, [status, resolvedWithNoResults, shouldRenderTableWithNoResults, columns.length, selectedConfluenceSiteUrl, urlBeingEdited, hasConfluenceSearchParams, formatMessage, reset, selectedConfluenceSite]);
|
|
273
277
|
var renderInlineLinkModalContent = (0, _react.useCallback)(function () {
|
|
274
278
|
if (status === 'unauthorized') {
|
|
275
279
|
return /*#__PURE__*/_react.default.createElement(_accessRequired.AccessRequired, {
|
|
@@ -188,7 +188,11 @@ var DatasourceTableViewWithoutAnalytics = function DatasourceTableViewWithoutAna
|
|
|
188
188
|
shouldForceRequest: true
|
|
189
189
|
});
|
|
190
190
|
}, [reset]);
|
|
191
|
-
|
|
191
|
+
var isResolvedWithNoResults = status === 'resolved' && !responseItems.length;
|
|
192
|
+
// With columns available the table can keep its headers and footer and show the empty state
|
|
193
|
+
// in place of the rows, instead of replacing the whole view with it.
|
|
194
|
+
var shouldRenderTableWithNoResults = isResolvedWithNoResults && hasColumns && (0, _platformFeatureFlags.fg)('platform_lp_sllv_ux_improvements');
|
|
195
|
+
if (isResolvedWithNoResults && !shouldRenderTableWithNoResults || status === 'forbidden') {
|
|
192
196
|
return /*#__PURE__*/React.createElement(_noResults.NoResults, null);
|
|
193
197
|
}
|
|
194
198
|
if (status === 'unauthorized') {
|
|
@@ -240,9 +244,9 @@ var DatasourceTableViewWithoutAnalytics = function DatasourceTableViewWithoutAna
|
|
|
240
244
|
isCompact: true
|
|
241
245
|
}), /*#__PURE__*/React.createElement(_tableFooter.TableFooter, {
|
|
242
246
|
datasourceId: datasourceId,
|
|
243
|
-
itemCount: isDataReady ? totalCount : undefined,
|
|
247
|
+
itemCount: isDataReady ? totalCount : shouldRenderTableWithNoResults ? 0 : undefined,
|
|
244
248
|
onRefresh: onRefresh,
|
|
245
|
-
isLoading: !isDataReady || status === 'loading',
|
|
249
|
+
isLoading: shouldRenderTableWithNoResults ? false : !isDataReady || status === 'loading',
|
|
246
250
|
url: url
|
|
247
251
|
})));
|
|
248
252
|
};
|
|
@@ -133,9 +133,7 @@ var ColumnPicker = exports.ColumnPicker = function ColumnPicker(_ref) {
|
|
|
133
133
|
ignoreAccents: false
|
|
134
134
|
}),
|
|
135
135
|
options: allOptions,
|
|
136
|
-
value: selectedOptions
|
|
137
|
-
// @ts-ignore - https://product-fabric.atlassian.net/browse/DSP-21000
|
|
138
|
-
,
|
|
136
|
+
value: selectedOptions,
|
|
139
137
|
onOpen: handleOpen,
|
|
140
138
|
closeMenuOnSelect: false,
|
|
141
139
|
hideSelectedOptions: false,
|
|
@@ -78,6 +78,7 @@ thead.has-column-picker ._10i2idpf:nth-last-of-type(2){border-right:0}.ProseMirr
|
|
|
78
78
|
._19bv1b66{padding-left:var(--ds-space-050,4px)}
|
|
79
79
|
._19bvze3t{padding-left:var(--ds-space-0,0)}
|
|
80
80
|
._19pkidpf{margin-top:0}
|
|
81
|
+
._1bah1h6o{justify-content:center}
|
|
81
82
|
._1bsb1osq{width:100%}
|
|
82
83
|
._1bto1l2s{text-overflow:ellipsis}
|
|
83
84
|
._1cimn7od [data-testid=button-connect-account]>span{white-space:unset}
|
|
@@ -87,6 +88,7 @@ thead.has-column-picker ._10i2idpf:nth-last-of-type(2){border-right:0}.ProseMirr
|
|
|
87
88
|
._1ixkusic:last-of-type{text-align:right}
|
|
88
89
|
._1lhc1b66:first-of-type{padding-left:var(--ds-space-050,4px)}
|
|
89
90
|
._1lrw1sd4{background-size:40px 100%,14px 100%,40px 100%,14px 100%,100% 75pt,100% 14px,100% 40px,100% 10px}
|
|
91
|
+
._1ltvidpf{left:0}
|
|
90
92
|
._1nd0cs5v [data-testid=datasource-header-content--container]{-webkit-line-clamp:2}
|
|
91
93
|
._1o0zidpf{border-bottom-right-radius:0}
|
|
92
94
|
._1o59pxbi:last-of-type{padding-right:var(--ds-space-200,1pc)}
|
|
@@ -36,6 +36,7 @@ var _tooltip = _interopRequireDefault(require("@atlaskit/tooltip"));
|
|
|
36
36
|
var _ufoExperiences = require("../../analytics/ufoExperiences");
|
|
37
37
|
var _datasourceExperienceId = require("../../contexts/datasource-experience-id");
|
|
38
38
|
var _useIsInPDFRender = require("../../hooks/useIsInPDFRender");
|
|
39
|
+
var _noResults = require("../common/error-state/no-results");
|
|
39
40
|
var _columnPicker = require("./column-picker");
|
|
40
41
|
var _dragColumnPreview = require("./drag-column-preview");
|
|
41
42
|
var _draggableTableHeading = require("./draggable-table-heading");
|
|
@@ -77,6 +78,22 @@ var wrappedStyles = null;
|
|
|
77
78
|
var richTextCellStyles = null;
|
|
78
79
|
var tableContainerStyles = null;
|
|
79
80
|
|
|
81
|
+
// The cell spans every column, so it is as wide as the scrollable table rather than the part of it
|
|
82
|
+
// that is on screen. Sticking to the left edge of the scrollport keeps the empty state centred on
|
|
83
|
+
// what the user can actually see while the headers still scroll behind it.
|
|
84
|
+
var noResultsCellContentStyles = null;
|
|
85
|
+
var getHorizontalScrollParent = function getHorizontalScrollParent(element) {
|
|
86
|
+
var current = element;
|
|
87
|
+
while (current) {
|
|
88
|
+
var _getComputedStyle = getComputedStyle(current),
|
|
89
|
+
overflowX = _getComputedStyle.overflowX;
|
|
90
|
+
if (overflowX === 'auto' || overflowX === 'scroll') {
|
|
91
|
+
return current;
|
|
92
|
+
}
|
|
93
|
+
current = current.parentElement;
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
|
|
80
97
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled
|
|
81
98
|
var Table = (0, _react.forwardRef)(function (_ref2, __cmplr) {
|
|
82
99
|
var _ref2$as = _ref2.as,
|
|
@@ -344,6 +361,33 @@ var IssueLikeDataTableView = exports.IssueLikeDataTableView = function IssueLike
|
|
|
344
361
|
}, [isInPDFRender, onNextPage, status, hasNextPage]);
|
|
345
362
|
var hasData = items.length > 0;
|
|
346
363
|
|
|
364
|
+
// A resolved response with no items still carries column metadata, so the table can keep its
|
|
365
|
+
// headers and render the empty state where the rows would normally be.
|
|
366
|
+
var hasNoResults = status === 'resolved' && !hasData && (0, _platformFeatureFlags.fg)('platform_lp_sllv_ux_improvements');
|
|
367
|
+
var _useState7 = (0, _react.useState)(),
|
|
368
|
+
_useState8 = (0, _slicedToArray2.default)(_useState7, 2),
|
|
369
|
+
noResultsWidth = _useState8[0],
|
|
370
|
+
setNoResultsWidth = _useState8[1];
|
|
371
|
+
(0, _react.useEffect)(function () {
|
|
372
|
+
var container = containerRef.current;
|
|
373
|
+
if (!hasNoResults || !container) {
|
|
374
|
+
return;
|
|
375
|
+
}
|
|
376
|
+
var scrollport = getHorizontalScrollParent(container) || container;
|
|
377
|
+
var updateWidth = function updateWidth() {
|
|
378
|
+
return setNoResultsWidth(scrollport.clientWidth || undefined);
|
|
379
|
+
};
|
|
380
|
+
updateWidth();
|
|
381
|
+
if (typeof ResizeObserver === 'undefined') {
|
|
382
|
+
return;
|
|
383
|
+
}
|
|
384
|
+
var observer = new ResizeObserver(updateWidth);
|
|
385
|
+
observer.observe(scrollport);
|
|
386
|
+
return function () {
|
|
387
|
+
return observer.disconnect();
|
|
388
|
+
};
|
|
389
|
+
}, [hasNoResults]);
|
|
390
|
+
|
|
347
391
|
// This variable contains initial Y mouse coordinate, so we can restrict
|
|
348
392
|
// autoScroller in X axis only
|
|
349
393
|
var initialAutoScrollerClientY = (0, _react.useRef)();
|
|
@@ -654,7 +698,19 @@ var IssueLikeDataTableView = exports.IssueLikeDataTableView = function IssueLike
|
|
|
654
698
|
})))), /*#__PURE__*/React.createElement("tbody", {
|
|
655
699
|
"data-testid": testId && "".concat(testId, "--body"),
|
|
656
700
|
className: (0, _runtime.ax)(["_n7zlidpf"])
|
|
657
|
-
},
|
|
701
|
+
}, hasNoResults && /*#__PURE__*/React.createElement("tr", {
|
|
702
|
+
"data-testid": testId && "".concat(testId, "--no-results-row")
|
|
703
|
+
}, /*#__PURE__*/React.createElement(InlineEditableTableCell, {
|
|
704
|
+
colSpan: Math.max(headerColumns.length + (onVisibleColumnKeysChange ? 1 : 0), 1)
|
|
705
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
706
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- width is measured from the scrollport at runtime
|
|
707
|
+
style: {
|
|
708
|
+
width: noResultsWidth
|
|
709
|
+
},
|
|
710
|
+
className: (0, _runtime.ax)(["_kqsw1if8 _1ltvidpf _1e0c1txw _1bah1h6o"])
|
|
711
|
+
}, /*#__PURE__*/React.createElement(_noResults.NoResults, {
|
|
712
|
+
isCompact: true
|
|
713
|
+
})))), rows.map(function (_ref16) {
|
|
658
714
|
var key = _ref16.key,
|
|
659
715
|
cells = _ref16.cells,
|
|
660
716
|
ref = _ref16.ref;
|
|
@@ -40,9 +40,7 @@ var TooltipWrapper = function TooltipWrapper(_ref) {
|
|
|
40
40
|
return value !== '';
|
|
41
41
|
}).join(', ');
|
|
42
42
|
if (stringifiedContent && !(wrappedColumnKeys !== null && wrappedColumnKeys !== void 0 && wrappedColumnKeys.includes(columnKey))) {
|
|
43
|
-
return /*#__PURE__*/_react.default.createElement(_tooltip.default
|
|
44
|
-
// @ts-ignore: [PIT-1685] Fails in post-office due to backwards incompatibility issue with React 18
|
|
45
|
-
, {
|
|
43
|
+
return /*#__PURE__*/_react.default.createElement(_tooltip.default, {
|
|
46
44
|
tag: _truncateTextTag.TruncateTextTag,
|
|
47
45
|
content: stringifiedContent,
|
|
48
46
|
testId: "issues-table-cell-tooltip"
|
|
@@ -138,6 +138,9 @@ var PlainJiraIssuesConfigModal = function PlainJiraIssuesConfigModal(props) {
|
|
|
138
138
|
};
|
|
139
139
|
}, [destinationObjectTypes, extensionKey]);
|
|
140
140
|
var resolvedWithNoResults = status === 'resolved' && !responseItems.length;
|
|
141
|
+
// With columns available the table can keep its headers and show the empty state in place of
|
|
142
|
+
// the rows, instead of replacing the whole table with it.
|
|
143
|
+
var shouldRenderTableWithNoResults = resolvedWithNoResults && !!columns.length && (0, _platformFeatureFlags.fg)('platform_lp_sllv_ux_improvements');
|
|
141
144
|
var jqlUrl = selectedJiraSite && jql && "".concat(selectedJiraSite.url, "/issues/?jql=").concat(encodeURI(jql));
|
|
142
145
|
var shouldShowIssueCount = !!totalCount && totalCount !== 1 && currentViewMode === 'table';
|
|
143
146
|
var isDataReady = (visibleColumnKeys || []).length > 0;
|
|
@@ -316,7 +319,7 @@ var PlainJiraIssuesConfigModal = function PlainJiraIssuesConfigModal(props) {
|
|
|
316
319
|
return /*#__PURE__*/_react.default.createElement(_accessRequired.AccessRequired, {
|
|
317
320
|
url: selectedJiraSiteUrl || urlBeingEdited
|
|
318
321
|
});
|
|
319
|
-
} else if (resolvedWithNoResults || status === 'forbidden') {
|
|
322
|
+
} else if (resolvedWithNoResults && !shouldRenderTableWithNoResults || status === 'forbidden') {
|
|
320
323
|
return /*#__PURE__*/_react.default.createElement(_noResults.NoResults, null);
|
|
321
324
|
} else if (status === 'empty' || !columns.length) {
|
|
322
325
|
// persist the empty state when making the initial /data request which contains the columns
|
|
@@ -345,7 +348,7 @@ var PlainJiraIssuesConfigModal = function PlainJiraIssuesConfigModal(props) {
|
|
|
345
348
|
}, /*#__PURE__*/_react.default.createElement(_datasourcesTableInModalPreview.default, {
|
|
346
349
|
testId: "jira-datasource-table"
|
|
347
350
|
}));
|
|
348
|
-
}, [columns.length, currentSearchMethod, formatMessage, jql, jqlUrl, resolvedWithNoResults, selectedJiraSite === null || selectedJiraSite === void 0 ? void 0 : selectedJiraSite.url, status, urlBeingEdited, reset]);
|
|
351
|
+
}, [columns.length, currentSearchMethod, formatMessage, jql, jqlUrl, resolvedWithNoResults, shouldRenderTableWithNoResults, selectedJiraSite === null || selectedJiraSite === void 0 ? void 0 : selectedJiraSite.url, status, urlBeingEdited, reset]);
|
|
349
352
|
var siteSelectorLabel = (0, _react.useMemo)(function () {
|
|
350
353
|
if ((0, _platformFeatureFlags.fg)('confluence-issue-terminology-refresh')) {
|
|
351
354
|
return availableSites && availableSites.length > 1 ? _messages3.modalMessages.insertIssuesTitleManySitesIssueTermRefresh : _messages3.modalMessages.insertIssuesTitleIssueTermRefresh;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { useCallback, useEffect, useRef, useState } from 'react';
|
|
2
2
|
import isEqual from 'lodash/isEqual';
|
|
3
3
|
import { isFedRamp } from '@atlaskit/atlassian-context/is-fedramp';
|
|
4
|
+
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
4
5
|
import { DEFAULT_GET_DATASOURCE_DATA_PAGE_SIZE, useDatasourceClientExtension } from '@atlaskit/link-client-extension';
|
|
5
6
|
import { useDatasourceAnalyticsEvents } from '../analytics';
|
|
6
7
|
import { useDatasourceActions } from '../state';
|
|
@@ -230,7 +231,11 @@ export const useDatasourceTableState = ({
|
|
|
230
231
|
if (fieldKeys.length > 0) {
|
|
231
232
|
setLastRequestedFieldKeys(fieldKeys);
|
|
232
233
|
}
|
|
233
|
-
|
|
234
|
+
|
|
235
|
+
// A response with no items still describes its columns, so the schema is worth applying
|
|
236
|
+
// to let the table keep its headers while showing the empty state.
|
|
237
|
+
const shouldApplySchemaWithoutItems = items.length === 0 && fg('platform_lp_sllv_ux_improvements');
|
|
238
|
+
if ((isSchemaFromData && schema || fullSchema.properties.length > 0) && (items.length > 0 || shouldApplySchemaWithoutItems)) {
|
|
234
239
|
applySchemaProperties(schema || fullSchema, fieldKeys);
|
|
235
240
|
}
|
|
236
241
|
const isUserLoadingNextPage = responseItems.length !== 0 && !shouldRequestFirstPage;
|
|
@@ -3,6 +3,7 @@ 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 { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
6
7
|
import { AccessRequired } from '../../../common/error-state/access-required';
|
|
7
8
|
import { ModalLoadingError } from '../../../common/error-state/modal-loading-error';
|
|
8
9
|
import { NoResults } from '../../../common/error-state/no-results';
|
|
@@ -46,6 +47,9 @@ export const RenderAssetsContent = props => {
|
|
|
46
47
|
isFetchingInitialData
|
|
47
48
|
} = props;
|
|
48
49
|
const resolvedWithNoResults = status === 'resolved' && !responseItems.length;
|
|
50
|
+
// With columns available the table can keep its headers and show the empty state in place of
|
|
51
|
+
// the rows, instead of replacing the whole table with it.
|
|
52
|
+
const shouldRenderTableWithNoResults = resolvedWithNoResults && !!columns.length && fg('platform_lp_sllv_ux_improvements');
|
|
49
53
|
const issueLikeDataTableView = useMemo(() => /*#__PURE__*/React.createElement("div", {
|
|
50
54
|
className: ax(["_1reo1wug _18m91wug _4t3i1pna _1e0c11p5", "_19itia51 _n7zl1mpn _13li1mok _qrwq1mok _1itkz1kv _12vemgnk _1lrw1sd4 _qmxj1c00"])
|
|
51
55
|
}, /*#__PURE__*/React.createElement(IssueLikeDataTableView, {
|
|
@@ -70,12 +74,12 @@ export const RenderAssetsContent = props => {
|
|
|
70
74
|
return /*#__PURE__*/React.createElement(UnauthorizedView, null);
|
|
71
75
|
} else if (status === 'empty') {
|
|
72
76
|
return /*#__PURE__*/React.createElement(EmptyView, null);
|
|
73
|
-
} else if (resolvedWithNoResults) {
|
|
77
|
+
} else if (resolvedWithNoResults && !shouldRenderTableWithNoResults) {
|
|
74
78
|
return /*#__PURE__*/React.createElement(NoResultsView, null);
|
|
75
79
|
} else if (status === 'loading' && !columns.length) {
|
|
76
80
|
return /*#__PURE__*/React.createElement(LoadingView, null);
|
|
77
81
|
}
|
|
78
82
|
return issueLikeDataTableView;
|
|
79
|
-
}, [columns.length, isFetchingInitialData, issueLikeDataTableView, resolvedWithNoResults, status]);
|
|
83
|
+
}, [columns.length, isFetchingInitialData, issueLikeDataTableView, resolvedWithNoResults, shouldRenderTableWithNoResults, status]);
|
|
80
84
|
return renderAssetsContentView();
|
|
81
85
|
};
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
._zulp1ejb{gap:var(--ds-space-300,24px)}
|
|
2
2
|
._zulppxbi{gap:var(--ds-space-200,1pc)}._10fp1h6o{justify-self:center}
|
|
3
3
|
._18u0oahv{margin-left:var(--ds-space-600,3pc)}
|
|
4
|
+
._19pk1ejb{margin-top:var(--ds-space-300,24px)}
|
|
4
5
|
._19pkoahv{margin-top:var(--ds-space-600,3pc)}
|
|
5
6
|
._1wpz1h6o{align-self:center}
|
|
6
7
|
._2hwxoahv{margin-right:var(--ds-space-600,3pc)}
|
|
7
8
|
._4cvr1h6o{align-items:center}
|
|
8
9
|
._6a6z1h6o{justify-items:center}
|
|
10
|
+
._otyr1ejb{margin-bottom:var(--ds-space-300,24px)}
|
|
9
11
|
._otyroahv{margin-bottom:var(--ds-space-600,3pc)}
|
|
10
12
|
._p12fko4j{max-width:19pc}
|
|
11
13
|
._y3gn1h6o{text-align:center}
|
|
@@ -11,10 +11,12 @@ import { SpotSearchNoResult } from '../../../common/ui/spot/error-state/search-n
|
|
|
11
11
|
import { loadingErrorMessages } from './messages';
|
|
12
12
|
const styles = {
|
|
13
13
|
noResultsContainerStyles: "_4cvr1h6o _6a6z1h6o _1wpz1h6o _10fp1h6o _19pkoahv _2hwxoahv _otyroahv _18u0oahv",
|
|
14
|
+
noResultsCompactContainerStyles: "_4cvr1h6o _6a6z1h6o _1wpz1h6o _10fp1h6o _19pk1ejb _2hwxoahv _otyr1ejb _18u0oahv",
|
|
14
15
|
noResultsContentStyles: "_zulp1ejb _4cvr1h6o _6a6z1h6o _p12fko4j",
|
|
15
16
|
noResultsMessageContainerStyles: "_zulppxbi _4cvr1h6o _6a6z1h6o _y3gn1h6o"
|
|
16
17
|
};
|
|
17
18
|
export const NoResults = ({
|
|
19
|
+
isCompact,
|
|
18
20
|
onRefresh
|
|
19
21
|
}) => {
|
|
20
22
|
const {
|
|
@@ -27,7 +29,7 @@ export const NoResults = ({
|
|
|
27
29
|
fireEvent('ui.emptyResult.shown.datasource', {});
|
|
28
30
|
}, [fireEvent]);
|
|
29
31
|
return /*#__PURE__*/React.createElement(Grid, {
|
|
30
|
-
xcss: styles.noResultsContainerStyles,
|
|
32
|
+
xcss: isCompact ? styles.noResultsCompactContainerStyles : styles.noResultsContainerStyles,
|
|
31
33
|
testId: "datasource-modal--no-results"
|
|
32
34
|
}, /*#__PURE__*/React.createElement(Grid, {
|
|
33
35
|
xcss: styles.noResultsContentStyles
|
|
@@ -7,10 +7,12 @@ import { FormattedMessage, useIntl } from 'react-intl';
|
|
|
7
7
|
import Button from '@atlaskit/button/new';
|
|
8
8
|
import DropdownMenu, { DropdownItem, DropdownItemGroup } from '@atlaskit/dropdown-menu';
|
|
9
9
|
import ChevronDownIcon from '@atlaskit/icon/core/chevron-down';
|
|
10
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
10
11
|
import { Box } from '@atlaskit/primitives/compiled';
|
|
11
12
|
import { displayViewDropDownMessages } from './messages';
|
|
12
13
|
const styles = {
|
|
13
|
-
dropDownItemGroupStyles: "_2rko12b0 _1bsb1pna _4t3i7iqz"
|
|
14
|
+
dropDownItemGroupStyles: "_2rko12b0 _1bsb1pna _4t3i7iqz",
|
|
15
|
+
dropDownItemGroupStylesWithoutFixedHeight: "_2rko12b0 _1bsb1pna"
|
|
14
16
|
};
|
|
15
17
|
const InlineIcon = /*#__PURE__*/React.createElement("svg", {
|
|
16
18
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -59,7 +61,7 @@ export const DisplayViewDropDown = ({
|
|
|
59
61
|
}), triggerText),
|
|
60
62
|
testId: "datasource-modal--view-drop-down"
|
|
61
63
|
}, /*#__PURE__*/React.createElement(Box, {
|
|
62
|
-
xcss: styles.dropDownItemGroupStyles
|
|
64
|
+
xcss: fg('platform_lp_sllv_ux_improvements') ? styles.dropDownItemGroupStylesWithoutFixedHeight : styles.dropDownItemGroupStyles
|
|
63
65
|
}, /*#__PURE__*/React.createElement(DropdownItemGroup, null, /*#__PURE__*/React.createElement(DropdownItem, {
|
|
64
66
|
testId: "dropdown-item-table",
|
|
65
67
|
onClick: () => onViewModeChange('table'),
|
|
@@ -139,9 +139,7 @@ export const FilterPopupSelect = ({
|
|
|
139
139
|
shouldCloseMenuOnTab: false,
|
|
140
140
|
hideSelectedOptions: false,
|
|
141
141
|
isLoading: showLoading,
|
|
142
|
-
placeholder: searchPlaceholder ? searchPlaceholder : formatMessage(asyncPopupSelectMessages.selectPlaceholder)
|
|
143
|
-
// @ts-ignore - https://product-fabric.atlassian.net/browse/DSP-21000
|
|
144
|
-
,
|
|
142
|
+
placeholder: searchPlaceholder ? searchPlaceholder : formatMessage(asyncPopupSelectMessages.selectPlaceholder),
|
|
145
143
|
menuListProps: menuListProps,
|
|
146
144
|
components: {
|
|
147
145
|
Option: CustomCheckboxOption,
|
|
@@ -28,9 +28,7 @@ const CustomMenuList = ({
|
|
|
28
28
|
showMore,
|
|
29
29
|
handleShowMore,
|
|
30
30
|
filterLabel
|
|
31
|
-
} =
|
|
32
|
-
// @ts-ignore - https://product-fabric.atlassian.net/browse/DSP-21000
|
|
33
|
-
props.selectProps.menuListProps;
|
|
31
|
+
} = props.selectProps.menuListProps;
|
|
34
32
|
const shouldDisplayShowMore = showMore && !isLoadingMore;
|
|
35
33
|
const isLoadingMoreData = !shouldDisplayShowMore && isLoadingMore;
|
|
36
34
|
const InlineSpinner = () => /*#__PURE__*/React.createElement(Flex, {
|
package/dist/es2019/ui/confluence-search-modal/basic-filters/filters/date-range-picker/index.js
CHANGED
|
@@ -227,9 +227,7 @@ export const DateRangePicker = ({
|
|
|
227
227
|
};
|
|
228
228
|
return /*#__PURE__*/React.createElement(Popup, {
|
|
229
229
|
isOpen: !!isPickerOpen,
|
|
230
|
-
onClose: handlePickerToggle
|
|
231
|
-
// @ts-ignore: [PIT-1685] Fails in post-office due to backwards incompatibility issue with React 18
|
|
232
|
-
,
|
|
230
|
+
onClose: handlePickerToggle,
|
|
233
231
|
popupComponent: PopupComponent,
|
|
234
232
|
zIndex: layers.modal(),
|
|
235
233
|
content: popupContent,
|
|
@@ -8,6 +8,7 @@ import FeatureGates from '@atlaskit/feature-gate-js-client';
|
|
|
8
8
|
import IntlMessagesProvider from '@atlaskit/intl-messages-provider/main';
|
|
9
9
|
import LinkComponent from '@atlaskit/link';
|
|
10
10
|
import { CloseButton, ModalBody, ModalFooter, ModalHeader, ModalTitle } from '@atlaskit/modal-dialog';
|
|
11
|
+
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
11
12
|
import { Box, Flex } from '@atlaskit/primitives/compiled';
|
|
12
13
|
import { useDatasourceAnalyticsEvents } from '../../../analytics';
|
|
13
14
|
import { DatasourceAction, DatasourceSearchMethod } from '../../../analytics/types';
|
|
@@ -152,6 +153,9 @@ export const PlainConfluenceSearchConfigModal = props => {
|
|
|
152
153
|
siteSelectorLabel = availableSites && availableSites.length > 1 ? confluenceSearchModalMessages.insertIssuesTitleManySites : confluenceSearchModalMessages.insertIssuesTitle;
|
|
153
154
|
}
|
|
154
155
|
const resolvedWithNoResults = status === 'resolved' && !responseItems.length;
|
|
156
|
+
// With columns available the table can keep its headers and show the empty state in place of
|
|
157
|
+
// the rows, instead of replacing the whole table with it.
|
|
158
|
+
const shouldRenderTableWithNoResults = resolvedWithNoResults && !!columns.length && fg('platform_lp_sllv_ux_improvements');
|
|
155
159
|
const hasConfluenceSearchParams = selectedConfluenceSite && (parameters === null || parameters === void 0 ? void 0 : parameters.searchString);
|
|
156
160
|
const selectedConfluenceSiteUrl = selectedConfluenceSite === null || selectedConfluenceSite === void 0 ? void 0 : selectedConfluenceSite.url;
|
|
157
161
|
const confluenceSearchUrl = useMemo(() => {
|
|
@@ -234,7 +238,7 @@ export const PlainConfluenceSearchConfigModal = props => {
|
|
|
234
238
|
return /*#__PURE__*/React.createElement(AccessRequired, {
|
|
235
239
|
url: selectedConfluenceSiteUrl || urlBeingEdited
|
|
236
240
|
});
|
|
237
|
-
} else if (resolvedWithNoResults || status === 'forbidden') {
|
|
241
|
+
} else if (resolvedWithNoResults && !shouldRenderTableWithNoResults || status === 'forbidden') {
|
|
238
242
|
return /*#__PURE__*/React.createElement(NoResults, null);
|
|
239
243
|
} else if (status === 'empty' || !columns.length) {
|
|
240
244
|
// persist the empty state when making the initial /data request which contains the columns
|
|
@@ -257,7 +261,7 @@ export const PlainConfluenceSearchConfigModal = props => {
|
|
|
257
261
|
}, /*#__PURE__*/React.createElement(DatasourcesTableInModalPreview, {
|
|
258
262
|
testId: "confluence-search-datasource-table"
|
|
259
263
|
}));
|
|
260
|
-
}, [status, resolvedWithNoResults, columns.length, selectedConfluenceSiteUrl, urlBeingEdited, hasConfluenceSearchParams, formatMessage, reset, selectedConfluenceSite]);
|
|
264
|
+
}, [status, resolvedWithNoResults, shouldRenderTableWithNoResults, columns.length, selectedConfluenceSiteUrl, urlBeingEdited, hasConfluenceSearchParams, formatMessage, reset, selectedConfluenceSite]);
|
|
261
265
|
const renderInlineLinkModalContent = useCallback(() => {
|
|
262
266
|
if (status === 'unauthorized') {
|
|
263
267
|
return /*#__PURE__*/React.createElement(AccessRequired, {
|
|
@@ -173,7 +173,11 @@ const DatasourceTableViewWithoutAnalytics = ({
|
|
|
173
173
|
shouldForceRequest: true
|
|
174
174
|
});
|
|
175
175
|
}, [reset]);
|
|
176
|
-
|
|
176
|
+
const isResolvedWithNoResults = status === 'resolved' && !responseItems.length;
|
|
177
|
+
// With columns available the table can keep its headers and footer and show the empty state
|
|
178
|
+
// in place of the rows, instead of replacing the whole view with it.
|
|
179
|
+
const shouldRenderTableWithNoResults = isResolvedWithNoResults && hasColumns && fg('platform_lp_sllv_ux_improvements');
|
|
180
|
+
if (isResolvedWithNoResults && !shouldRenderTableWithNoResults || status === 'forbidden') {
|
|
177
181
|
return /*#__PURE__*/React.createElement(NoResults, null);
|
|
178
182
|
}
|
|
179
183
|
if (status === 'unauthorized') {
|
|
@@ -225,9 +229,9 @@ const DatasourceTableViewWithoutAnalytics = ({
|
|
|
225
229
|
isCompact: true
|
|
226
230
|
}), /*#__PURE__*/React.createElement(TableFooter, {
|
|
227
231
|
datasourceId: datasourceId,
|
|
228
|
-
itemCount: isDataReady ? totalCount : undefined,
|
|
232
|
+
itemCount: isDataReady ? totalCount : shouldRenderTableWithNoResults ? 0 : undefined,
|
|
229
233
|
onRefresh: onRefresh,
|
|
230
|
-
isLoading: !isDataReady || status === 'loading',
|
|
234
|
+
isLoading: shouldRenderTableWithNoResults ? false : !isDataReady || status === 'loading',
|
|
231
235
|
url: url
|
|
232
236
|
})));
|
|
233
237
|
};
|