@atlaskit/link-datasource 2.5.5 → 2.5.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +17 -0
- package/dist/cjs/ui/common/modal/datasource-context/DatasourceContext.js +18 -0
- package/dist/cjs/ui/common/modal/datasource-context/DatasourceContextProvider.js +35 -0
- package/dist/cjs/ui/common/modal/search-count/index.js +40 -9
- package/dist/cjs/ui/confluence-search-modal/modal/ModalOld.js +451 -0
- package/dist/cjs/ui/confluence-search-modal/modal/index.js +18 -23
- package/dist/cjs/ui/datasources-table-in-modal-preview/index.js +26 -0
- package/dist/cjs/ui/table-footer/index.js +10 -2
- package/dist/es2019/ui/common/modal/datasource-context/DatasourceContext.js +9 -0
- package/dist/es2019/ui/common/modal/datasource-context/DatasourceContextProvider.js +27 -0
- package/dist/es2019/ui/common/modal/search-count/index.js +34 -2
- package/dist/es2019/ui/confluence-search-modal/modal/ModalOld.js +426 -0
- package/dist/es2019/ui/confluence-search-modal/modal/index.js +33 -37
- package/dist/es2019/ui/datasources-table-in-modal-preview/index.js +20 -0
- package/dist/es2019/ui/table-footer/index.js +7 -2
- package/dist/esm/ui/common/modal/datasource-context/DatasourceContext.js +9 -0
- package/dist/esm/ui/common/modal/datasource-context/DatasourceContextProvider.js +26 -0
- package/dist/esm/ui/common/modal/search-count/index.js +40 -9
- package/dist/esm/ui/confluence-search-modal/modal/ModalOld.js +447 -0
- package/dist/esm/ui/confluence-search-modal/modal/index.js +19 -24
- package/dist/esm/ui/datasources-table-in-modal-preview/index.js +19 -0
- package/dist/esm/ui/table-footer/index.js +7 -2
- package/dist/types/ui/common/modal/datasource-context/DatasourceContext.d.ts +11 -0
- package/dist/types/ui/common/modal/datasource-context/DatasourceContextProvider.d.ts +10 -0
- package/dist/types/ui/common/modal/search-count/index.d.ts +5 -0
- package/dist/types/ui/confluence-search-modal/modal/ModalOld.d.ts +3 -0
- package/dist/types/ui/datasources-table-in-modal-preview/index.d.ts +20 -0
- package/dist/types-ts4.5/ui/common/modal/datasource-context/DatasourceContext.d.ts +11 -0
- package/dist/types-ts4.5/ui/common/modal/datasource-context/DatasourceContextProvider.d.ts +10 -0
- package/dist/types-ts4.5/ui/common/modal/search-count/index.d.ts +5 -0
- package/dist/types-ts4.5/ui/confluence-search-modal/modal/ModalOld.d.ts +3 -0
- package/dist/types-ts4.5/ui/datasources-table-in-modal-preview/index.d.ts +20 -0
- package/package.json +11 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @atlaskit/link-datasource
|
|
2
2
|
|
|
3
|
+
## 2.5.7
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#117343](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/117343)
|
|
8
|
+
[`d5fc4325dc0e4`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/d5fc4325dc0e4) -
|
|
9
|
+
[ux] Limit total results count to 1000 for Assets LoL. Show 1000+ if total is >= 1000
|
|
10
|
+
|
|
11
|
+
## 2.5.6
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- [#117026](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/117026)
|
|
16
|
+
[`dbba7a8f78916`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/dbba7a8f78916) -
|
|
17
|
+
Refactored confluence config modal so that the 1p makers don't need to worry about column resizing
|
|
18
|
+
and line wraps
|
|
19
|
+
|
|
3
20
|
## 2.5.5
|
|
4
21
|
|
|
5
22
|
### Patch Changes
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.useDatasourceContext = exports.DatasourceContext = void 0;
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
10
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
11
|
+
var DatasourceContext = exports.DatasourceContext = /*#__PURE__*/_react.default.createContext(null);
|
|
12
|
+
var useDatasourceContext = exports.useDatasourceContext = function useDatasourceContext() {
|
|
13
|
+
var value = (0, _react.useContext)(DatasourceContext);
|
|
14
|
+
if (!value) {
|
|
15
|
+
throw new Error('useDatasourceStore must be used within DatasourceContextProvider');
|
|
16
|
+
}
|
|
17
|
+
return value;
|
|
18
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.DatasourceContextProvider = void 0;
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
var _useColumnResize2 = require("../../../issue-like-table/use-column-resize");
|
|
10
|
+
var _useColumnWrapping2 = require("../../../issue-like-table/use-column-wrapping");
|
|
11
|
+
var _DatasourceContext = require("./DatasourceContext");
|
|
12
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
13
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
14
|
+
var DatasourceContextProvider = exports.DatasourceContextProvider = function DatasourceContextProvider(_ref) {
|
|
15
|
+
var children = _ref.children,
|
|
16
|
+
initialColumnCustomSizes = _ref.initialColumnCustomSizes,
|
|
17
|
+
initialWrappedColumnKeys = _ref.initialWrappedColumnKeys;
|
|
18
|
+
var _useColumnResize = (0, _useColumnResize2.useColumnResize)(initialColumnCustomSizes),
|
|
19
|
+
columnCustomSizes = _useColumnResize.columnCustomSizes,
|
|
20
|
+
onColumnResize = _useColumnResize.onColumnResize;
|
|
21
|
+
var _useColumnWrapping = (0, _useColumnWrapping2.useColumnWrapping)(initialWrappedColumnKeys),
|
|
22
|
+
wrappedColumnKeys = _useColumnWrapping.wrappedColumnKeys,
|
|
23
|
+
onWrappedColumnChange = _useColumnWrapping.onWrappedColumnChange;
|
|
24
|
+
var contextValue = (0, _react.useMemo)(function () {
|
|
25
|
+
return {
|
|
26
|
+
columnCustomSizes: columnCustomSizes,
|
|
27
|
+
onColumnResize: onColumnResize,
|
|
28
|
+
wrappedColumnKeys: wrappedColumnKeys,
|
|
29
|
+
onWrappedColumnChange: onWrappedColumnChange
|
|
30
|
+
};
|
|
31
|
+
}, [columnCustomSizes, onColumnResize, onWrappedColumnChange, wrappedColumnKeys]);
|
|
32
|
+
return /*#__PURE__*/_react.default.createElement(_DatasourceContext.DatasourceContext.Provider, {
|
|
33
|
+
value: contextValue
|
|
34
|
+
}, children);
|
|
35
|
+
};
|
|
@@ -4,7 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.default = void 0;
|
|
7
|
+
exports.default = exports.AssetsItemCount = void 0;
|
|
8
8
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
9
|
var _react = _interopRequireDefault(require("react"));
|
|
10
10
|
var _reactIntlNext = require("react-intl-next");
|
|
@@ -20,13 +20,13 @@ var _messages4 = require("./messages");
|
|
|
20
20
|
var searchCountStyles = (0, _primitives.xcss)({
|
|
21
21
|
flex: 1
|
|
22
22
|
});
|
|
23
|
-
var
|
|
24
|
-
var
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
23
|
+
var AssetsItemCount = exports.AssetsItemCount = function AssetsItemCount(_ref) {
|
|
24
|
+
var searchCount = _ref.searchCount,
|
|
25
|
+
url = _ref.url,
|
|
26
|
+
testId = _ref.testId;
|
|
27
|
+
var capCount = searchCount >= 1000;
|
|
28
|
+
var displayCount = capCount ? 1000 : searchCount;
|
|
29
|
+
var countModifier = capCount ? '+' : '';
|
|
30
30
|
return /*#__PURE__*/_react.default.createElement(_primitives.Flex, {
|
|
31
31
|
testId: testId,
|
|
32
32
|
xcss: searchCountStyles,
|
|
@@ -43,7 +43,38 @@ var TableSearchCount = function TableSearchCount(_ref) {
|
|
|
43
43
|
}
|
|
44
44
|
}, /*#__PURE__*/_react.default.createElement(_heading.default, {
|
|
45
45
|
level: "h200"
|
|
46
|
-
},
|
|
46
|
+
}, /*#__PURE__*/_react.default.createElement(_reactIntlNext.FormattedNumber, {
|
|
47
|
+
value: displayCount
|
|
48
|
+
}), countModifier, ' ', /*#__PURE__*/_react.default.createElement(_reactIntlNext.FormattedMessage, (0, _extends2.default)({}, _messages3.footerMessages.itemText, {
|
|
49
|
+
values: {
|
|
50
|
+
itemCount: searchCount
|
|
51
|
+
}
|
|
52
|
+
})))));
|
|
53
|
+
};
|
|
54
|
+
var TableSearchCount = function TableSearchCount(_ref2) {
|
|
55
|
+
var url = _ref2.url,
|
|
56
|
+
searchCount = _ref2.searchCount,
|
|
57
|
+
_ref2$testId = _ref2.testId,
|
|
58
|
+
testId = _ref2$testId === void 0 ? 'datasource-table-total-results-count' : _ref2$testId,
|
|
59
|
+
_ref2$prefixTextType = _ref2.prefixTextType,
|
|
60
|
+
prefixTextType = _ref2$prefixTextType === void 0 ? 'issue' : _ref2$prefixTextType;
|
|
61
|
+
return /*#__PURE__*/_react.default.createElement(_primitives.Flex, {
|
|
62
|
+
testId: testId,
|
|
63
|
+
xcss: searchCountStyles,
|
|
64
|
+
alignItems: "center"
|
|
65
|
+
}, /*#__PURE__*/_react.default.createElement(_linkUrl.default, {
|
|
66
|
+
href: url,
|
|
67
|
+
target: "_blank",
|
|
68
|
+
testId: "item-count-url"
|
|
69
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
70
|
+
,
|
|
71
|
+
style: {
|
|
72
|
+
color: "var(--ds-text-accent-gray, ".concat(_colors.N800, ")"),
|
|
73
|
+
textDecoration: !url ? 'none' : ''
|
|
74
|
+
}
|
|
75
|
+
}, /*#__PURE__*/_react.default.createElement(_heading.default, {
|
|
76
|
+
level: "h200"
|
|
77
|
+
}, (0, _platformFeatureFlags.fg)('platform.linking-platform.datasource.total-count-i18n-single-key') ? /*#__PURE__*/_react.default.createElement(_reactIntlNext.FormattedMessage, (0, _extends2.default)({}, _messages4.searchCountMessages["".concat(prefixTextType, "CountText")], {
|
|
47
78
|
values: {
|
|
48
79
|
searchCount: searchCount
|
|
49
80
|
}
|
|
@@ -0,0 +1,451 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.PlainConfluenceSearchConfigModal = void 0;
|
|
8
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
10
|
+
var _react = require("react");
|
|
11
|
+
var _react2 = require("@emotion/react");
|
|
12
|
+
var _reactIntlNext = require("react-intl-next");
|
|
13
|
+
var _standardButton = _interopRequireDefault(require("@atlaskit/button/standard-button"));
|
|
14
|
+
var _intlMessagesProvider = require("@atlaskit/intl-messages-provider");
|
|
15
|
+
var _modalDialog = require("@atlaskit/modal-dialog");
|
|
16
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
17
|
+
var _primitives = require("@atlaskit/primitives");
|
|
18
|
+
var _analytics = require("../../../analytics");
|
|
19
|
+
var _types = require("../../../analytics/types");
|
|
20
|
+
var _adf = require("../../../common/utils/adf");
|
|
21
|
+
var _fetchMessagesForLocale = require("../../../common/utils/locale/fetch-messages-for-locale");
|
|
22
|
+
var _userInteractions = require("../../../contexts/user-interactions");
|
|
23
|
+
var _useDatasourceTableState = require("../../../hooks/useDatasourceTableState");
|
|
24
|
+
var _en = _interopRequireDefault(require("../../../i18n/en"));
|
|
25
|
+
var _useAvailableSites2 = require("../../../services/useAvailableSites");
|
|
26
|
+
var _accessRequired = require("../../common/error-state/access-required");
|
|
27
|
+
var _modalLoadingError = require("../../common/error-state/modal-loading-error");
|
|
28
|
+
var _noInstances = require("../../common/error-state/no-instances");
|
|
29
|
+
var _noResults = require("../../common/error-state/no-results");
|
|
30
|
+
var _initialStateView = require("../../common/initial-state-view");
|
|
31
|
+
var _cancelButton = require("../../common/modal/cancel-button");
|
|
32
|
+
var _contentContainer = require("../../common/modal/content-container");
|
|
33
|
+
var _countViewSmartLink = require("../../common/modal/count-view-smart-link");
|
|
34
|
+
var _datasourceModal = require("../../common/modal/datasource-modal");
|
|
35
|
+
var _displayViewDropDown = require("../../common/modal/display-view-dropdown/display-view-drop-down");
|
|
36
|
+
var _searchCount = _interopRequireDefault(require("../../common/modal/search-count"));
|
|
37
|
+
var _siteSelector = require("../../common/modal/site-selector");
|
|
38
|
+
var _issueLikeTable = require("../../issue-like-table");
|
|
39
|
+
var _useColumnResize2 = require("../../issue-like-table/use-column-resize");
|
|
40
|
+
var _useColumnWrapping2 = require("../../issue-like-table/use-column-wrapping");
|
|
41
|
+
var _utils = require("../../issue-like-table/utils");
|
|
42
|
+
var _confluenceSearchContainer = _interopRequireDefault(require("../confluence-search-container"));
|
|
43
|
+
var _confluenceSearchInitialStateSvg = require("./confluence-search-initial-state-svg");
|
|
44
|
+
var _messages = require("./messages");
|
|
45
|
+
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; }
|
|
46
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } /** @jsx jsx */ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
47
|
+
var inputContainerStyles = (0, _primitives.xcss)({
|
|
48
|
+
alignItems: 'baseline',
|
|
49
|
+
display: 'flex',
|
|
50
|
+
minHeight: '72px'
|
|
51
|
+
});
|
|
52
|
+
var PlainConfluenceSearchConfigModal = exports.PlainConfluenceSearchConfigModal = function PlainConfluenceSearchConfigModal(props) {
|
|
53
|
+
var datasourceId = props.datasourceId,
|
|
54
|
+
initialColumnCustomSizes = props.columnCustomSizes,
|
|
55
|
+
initialWrappedColumnKeys = props.wrappedColumnKeys,
|
|
56
|
+
onCancel = props.onCancel,
|
|
57
|
+
onInsert = props.onInsert,
|
|
58
|
+
_props$viewMode = props.viewMode,
|
|
59
|
+
viewMode = _props$viewMode === void 0 ? 'table' : _props$viewMode,
|
|
60
|
+
initialParameters = props.parameters,
|
|
61
|
+
urlBeingEdited = props.url,
|
|
62
|
+
initialVisibleColumnKeys = props.visibleColumnKeys,
|
|
63
|
+
_props$disableDisplay = props.disableDisplayDropdown,
|
|
64
|
+
disableDisplayDropdown = _props$disableDisplay === void 0 ? false : _props$disableDisplay,
|
|
65
|
+
overrideParameters = props.overrideParameters;
|
|
66
|
+
var _useState = (0, _react.useState)(viewMode),
|
|
67
|
+
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
68
|
+
currentViewMode = _useState2[0],
|
|
69
|
+
setCurrentViewMode = _useState2[1];
|
|
70
|
+
var _useState3 = (0, _react.useState)(initialParameters === null || initialParameters === void 0 ? void 0 : initialParameters.cloudId),
|
|
71
|
+
_useState4 = (0, _slicedToArray2.default)(_useState3, 2),
|
|
72
|
+
cloudId = _useState4[0],
|
|
73
|
+
setCloudId = _useState4[1];
|
|
74
|
+
var _useAvailableSites = (0, _useAvailableSites2.useAvailableSites)('confluence', cloudId),
|
|
75
|
+
availableSites = _useAvailableSites.availableSites,
|
|
76
|
+
selectedConfluenceSite = _useAvailableSites.selectedSite;
|
|
77
|
+
var _useState5 = (0, _react.useState)(initialParameters === null || initialParameters === void 0 ? void 0 : initialParameters.searchString),
|
|
78
|
+
_useState6 = (0, _slicedToArray2.default)(_useState5, 2),
|
|
79
|
+
searchString = _useState6[0],
|
|
80
|
+
setSearchString = _useState6[1];
|
|
81
|
+
var _useState7 = (0, _react.useState)(initialVisibleColumnKeys),
|
|
82
|
+
_useState8 = (0, _slicedToArray2.default)(_useState7, 2),
|
|
83
|
+
visibleColumnKeys = _useState8[0],
|
|
84
|
+
setVisibleColumnKeys = _useState8[1];
|
|
85
|
+
var _useState9 = (0, _react.useState)((initialParameters === null || initialParameters === void 0 ? void 0 : initialParameters.contributorAccountIds) || []),
|
|
86
|
+
_useState10 = (0, _slicedToArray2.default)(_useState9, 2),
|
|
87
|
+
contributorAccountIds = _useState10[0],
|
|
88
|
+
setContributorAccountIds = _useState10[1];
|
|
89
|
+
var _useState11 = (0, _react.useState)(initialParameters !== null && initialParameters !== void 0 && initialParameters.lastModified ? {
|
|
90
|
+
value: initialParameters === null || initialParameters === void 0 ? void 0 : initialParameters.lastModified,
|
|
91
|
+
from: initialParameters === null || initialParameters === void 0 ? void 0 : initialParameters.lastModifiedFrom,
|
|
92
|
+
to: initialParameters === null || initialParameters === void 0 ? void 0 : initialParameters.lastModifiedTo
|
|
93
|
+
} : undefined),
|
|
94
|
+
_useState12 = (0, _slicedToArray2.default)(_useState11, 2),
|
|
95
|
+
lastModified = _useState12[0],
|
|
96
|
+
setLastModified = _useState12[1];
|
|
97
|
+
|
|
98
|
+
// analytics related parameters
|
|
99
|
+
var searchCount = (0, _react.useRef)(0);
|
|
100
|
+
var userInteractions = (0, _userInteractions.useUserInteractions)();
|
|
101
|
+
var visibleColumnCount = (0, _react.useRef)((visibleColumnKeys === null || visibleColumnKeys === void 0 ? void 0 : visibleColumnKeys.length) || 0);
|
|
102
|
+
var parameters = (0, _react.useMemo)(function () {
|
|
103
|
+
return _objectSpread(_objectSpread({}, initialParameters), {}, {
|
|
104
|
+
cloudId: cloudId || '',
|
|
105
|
+
searchString: searchString,
|
|
106
|
+
lastModified: lastModified === null || lastModified === void 0 ? void 0 : lastModified.value,
|
|
107
|
+
lastModifiedFrom: lastModified === null || lastModified === void 0 ? void 0 : lastModified.from,
|
|
108
|
+
lastModifiedTo: lastModified === null || lastModified === void 0 ? void 0 : lastModified.to,
|
|
109
|
+
contributorAccountIds: (contributorAccountIds === null || contributorAccountIds === void 0 ? void 0 : contributorAccountIds.length) > 0 ? contributorAccountIds : undefined
|
|
110
|
+
});
|
|
111
|
+
}, [initialParameters, cloudId, searchString, lastModified, contributorAccountIds]);
|
|
112
|
+
var isParametersSet = (0, _react.useMemo)(function () {
|
|
113
|
+
return !!cloudId && Object.values(parameters !== null && parameters !== void 0 ? parameters : {}).filter(function (v) {
|
|
114
|
+
return v !== undefined;
|
|
115
|
+
}).length > 1;
|
|
116
|
+
}, [cloudId, parameters]);
|
|
117
|
+
var parametersToSend = (0, _react.useMemo)(function () {
|
|
118
|
+
if (!isParametersSet) {
|
|
119
|
+
return undefined;
|
|
120
|
+
}
|
|
121
|
+
return _objectSpread(_objectSpread({}, parameters), overrideParameters !== null && overrideParameters !== void 0 ? overrideParameters : {});
|
|
122
|
+
}, [parameters, overrideParameters, isParametersSet]);
|
|
123
|
+
var _useDatasourceTableSt = (0, _useDatasourceTableState.useDatasourceTableState)({
|
|
124
|
+
datasourceId: datasourceId,
|
|
125
|
+
parameters: parametersToSend,
|
|
126
|
+
fieldKeys: visibleColumnKeys
|
|
127
|
+
}),
|
|
128
|
+
reset = _useDatasourceTableSt.reset,
|
|
129
|
+
status = _useDatasourceTableSt.status,
|
|
130
|
+
onNextPage = _useDatasourceTableSt.onNextPage,
|
|
131
|
+
responseItems = _useDatasourceTableSt.responseItems,
|
|
132
|
+
hasNextPage = _useDatasourceTableSt.hasNextPage,
|
|
133
|
+
columns = _useDatasourceTableSt.columns,
|
|
134
|
+
defaultVisibleColumnKeys = _useDatasourceTableSt.defaultVisibleColumnKeys,
|
|
135
|
+
loadDatasourceDetails = _useDatasourceTableSt.loadDatasourceDetails,
|
|
136
|
+
totalCount = _useDatasourceTableSt.totalCount,
|
|
137
|
+
_useDatasourceTableSt2 = _useDatasourceTableSt.extensionKey,
|
|
138
|
+
extensionKey = _useDatasourceTableSt2 === void 0 ? null : _useDatasourceTableSt2,
|
|
139
|
+
destinationObjectTypes = _useDatasourceTableSt.destinationObjectTypes;
|
|
140
|
+
var _useDatasourceAnalyti = (0, _analytics.useDatasourceAnalyticsEvents)(),
|
|
141
|
+
fireEvent = _useDatasourceAnalyti.fireEvent;
|
|
142
|
+
var hasNoConfluenceSites = availableSites && availableSites.length === 0;
|
|
143
|
+
(0, _react.useEffect)(function () {
|
|
144
|
+
if (availableSites) {
|
|
145
|
+
fireEvent('ui.modal.ready.datasource', {
|
|
146
|
+
instancesCount: availableSites.length,
|
|
147
|
+
schemasCount: null
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
}, [fireEvent, availableSites]);
|
|
151
|
+
|
|
152
|
+
// TODO: further refactoring in EDM-9573
|
|
153
|
+
// https://stash.atlassian.com/projects/ATLASSIAN/repos/atlassian-frontend-monorepo/pull-requests/82725/overview?commentId=6828283
|
|
154
|
+
(0, _react.useEffect)(function () {
|
|
155
|
+
if (selectedConfluenceSite && (!cloudId || cloudId !== selectedConfluenceSite.cloudId)) {
|
|
156
|
+
setCloudId(selectedConfluenceSite.cloudId);
|
|
157
|
+
}
|
|
158
|
+
}, [cloudId, selectedConfluenceSite]);
|
|
159
|
+
|
|
160
|
+
// TODO: further refactoring in EDM-9573
|
|
161
|
+
// https://stash.atlassian.com/projects/ATLASSIAN/repos/atlassian-frontend-monorepo/pull-requests/82725/overview?commentId=6829171
|
|
162
|
+
var onSiteSelection = (0, _react.useCallback)(function (site) {
|
|
163
|
+
userInteractions.add(_types.DatasourceAction.INSTANCE_UPDATED);
|
|
164
|
+
setSearchString(undefined);
|
|
165
|
+
setLastModified(undefined);
|
|
166
|
+
setContributorAccountIds([]);
|
|
167
|
+
setCloudId(site.cloudId);
|
|
168
|
+
reset({
|
|
169
|
+
shouldForceRequest: true
|
|
170
|
+
});
|
|
171
|
+
}, [reset, userInteractions]);
|
|
172
|
+
(0, _react.useEffect)(function () {
|
|
173
|
+
var newVisibleColumnKeys = !initialVisibleColumnKeys || (initialVisibleColumnKeys || []).length === 0 ? defaultVisibleColumnKeys : initialVisibleColumnKeys;
|
|
174
|
+
visibleColumnCount.current = newVisibleColumnKeys.length;
|
|
175
|
+
setVisibleColumnKeys(newVisibleColumnKeys);
|
|
176
|
+
}, [initialVisibleColumnKeys, defaultVisibleColumnKeys]);
|
|
177
|
+
var siteSelectorLabel = availableSites && availableSites.length > 1 ? _messages.confluenceSearchModalMessages.insertIssuesTitleManySites : _messages.confluenceSearchModalMessages.insertIssuesTitle;
|
|
178
|
+
var _useColumnResize = (0, _useColumnResize2.useColumnResize)(initialColumnCustomSizes),
|
|
179
|
+
columnCustomSizes = _useColumnResize.columnCustomSizes,
|
|
180
|
+
onColumnResize = _useColumnResize.onColumnResize;
|
|
181
|
+
var _useColumnWrapping = (0, _useColumnWrapping2.useColumnWrapping)(initialWrappedColumnKeys),
|
|
182
|
+
wrappedColumnKeys = _useColumnWrapping.wrappedColumnKeys,
|
|
183
|
+
onWrappedColumnChange = _useColumnWrapping.onWrappedColumnChange;
|
|
184
|
+
|
|
185
|
+
// TODO: common functionality of all modals refactor in EDM-9573
|
|
186
|
+
var handleVisibleColumnKeysChange = (0, _react.useCallback)(function () {
|
|
187
|
+
var newVisibleColumnKeys = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
188
|
+
var columnAction = (0, _utils.getColumnAction)(visibleColumnKeys || [], newVisibleColumnKeys);
|
|
189
|
+
userInteractions.add(columnAction);
|
|
190
|
+
visibleColumnCount.current = newVisibleColumnKeys.length;
|
|
191
|
+
setVisibleColumnKeys(newVisibleColumnKeys);
|
|
192
|
+
}, [visibleColumnKeys, userInteractions]);
|
|
193
|
+
|
|
194
|
+
// TODO: further refactoring in EDM-9573
|
|
195
|
+
// https://stash.atlassian.com/projects/ATLASSIAN/repos/atlassian-frontend-monorepo/pull-requests/82725/overview?commentId=6798258
|
|
196
|
+
var confluenceSearchTable = (0, _react.useMemo)(function () {
|
|
197
|
+
return (0, _react2.jsx)(_contentContainer.ContentContainer, {
|
|
198
|
+
withTableBorder: true
|
|
199
|
+
}, (0, _react2.jsx)(_issueLikeTable.IssueLikeDataTableView, {
|
|
200
|
+
testId: "confluence-search-datasource-table",
|
|
201
|
+
status: status,
|
|
202
|
+
columns: columns,
|
|
203
|
+
items: responseItems,
|
|
204
|
+
hasNextPage: hasNextPage,
|
|
205
|
+
visibleColumnKeys: visibleColumnKeys || defaultVisibleColumnKeys,
|
|
206
|
+
onNextPage: onNextPage,
|
|
207
|
+
onLoadDatasourceDetails: loadDatasourceDetails,
|
|
208
|
+
onVisibleColumnKeysChange: handleVisibleColumnKeysChange,
|
|
209
|
+
extensionKey: extensionKey,
|
|
210
|
+
columnCustomSizes: columnCustomSizes,
|
|
211
|
+
onColumnResize: onColumnResize,
|
|
212
|
+
wrappedColumnKeys: wrappedColumnKeys,
|
|
213
|
+
onWrappedColumnChange: (0, _platformFeatureFlags.fg)('platform.linking-platform.datasource-word_wrap') ? onWrappedColumnChange : undefined
|
|
214
|
+
}));
|
|
215
|
+
}, [status, columns, responseItems, hasNextPage, visibleColumnKeys, defaultVisibleColumnKeys, onNextPage, loadDatasourceDetails, handleVisibleColumnKeysChange, extensionKey, columnCustomSizes, onColumnResize, wrappedColumnKeys, onWrappedColumnChange]);
|
|
216
|
+
var resolvedWithNoResults = status === 'resolved' && !responseItems.length;
|
|
217
|
+
var hasConfluenceSearchParams = selectedConfluenceSite && searchString;
|
|
218
|
+
var selectedConfluenceSiteUrl = selectedConfluenceSite === null || selectedConfluenceSite === void 0 ? void 0 : selectedConfluenceSite.url;
|
|
219
|
+
var confluenceSearchUrl = (0, _react.useMemo)(function () {
|
|
220
|
+
if (!selectedConfluenceSiteUrl || searchString === undefined) {
|
|
221
|
+
return undefined;
|
|
222
|
+
}
|
|
223
|
+
var params = new URLSearchParams();
|
|
224
|
+
// we are appending "text" without checking searchString as we need the url to have "text" when a user does an empty search
|
|
225
|
+
params.append('text', searchString);
|
|
226
|
+
if (contributorAccountIds.length > 0) {
|
|
227
|
+
params.append('contributors', contributorAccountIds.join(','));
|
|
228
|
+
}
|
|
229
|
+
if (lastModified !== null && lastModified !== void 0 && lastModified.value) {
|
|
230
|
+
params.append('lastModified', lastModified.value);
|
|
231
|
+
}
|
|
232
|
+
if (lastModified !== null && lastModified !== void 0 && lastModified.from) {
|
|
233
|
+
params.append('from', lastModified === null || lastModified === void 0 ? void 0 : lastModified.from);
|
|
234
|
+
}
|
|
235
|
+
if (lastModified !== null && lastModified !== void 0 && lastModified.to) {
|
|
236
|
+
params.append('to', lastModified === null || lastModified === void 0 ? void 0 : lastModified.to);
|
|
237
|
+
}
|
|
238
|
+
return "".concat(selectedConfluenceSiteUrl, "/wiki/search?").concat(params.toString());
|
|
239
|
+
}, [contributorAccountIds, lastModified, searchString, selectedConfluenceSiteUrl]);
|
|
240
|
+
var analyticsPayload = (0, _react.useMemo)(function () {
|
|
241
|
+
return {
|
|
242
|
+
extensionKey: extensionKey,
|
|
243
|
+
destinationObjectTypes: destinationObjectTypes,
|
|
244
|
+
searchCount: searchCount.current,
|
|
245
|
+
actions: userInteractions.get()
|
|
246
|
+
};
|
|
247
|
+
}, [destinationObjectTypes, extensionKey, userInteractions]);
|
|
248
|
+
var isDataReady = (visibleColumnKeys || []).length > 0;
|
|
249
|
+
var fireInlineViewedEvent = (0, _react.useCallback)(function () {
|
|
250
|
+
fireEvent('ui.link.viewed.count', _objectSpread(_objectSpread({}, analyticsPayload), {}, {
|
|
251
|
+
searchMethod: _types.DatasourceSearchMethod.DATASOURCE_SEARCH_QUERY,
|
|
252
|
+
totalItemCount: totalCount || 0
|
|
253
|
+
}));
|
|
254
|
+
}, [analyticsPayload, fireEvent, totalCount]);
|
|
255
|
+
var fireTableViewedEvent = (0, _react.useCallback)(function () {
|
|
256
|
+
if (isDataReady) {
|
|
257
|
+
fireEvent('ui.table.viewed.datasourceConfigModal', _objectSpread(_objectSpread({}, analyticsPayload), {}, {
|
|
258
|
+
totalItemCount: totalCount || 0,
|
|
259
|
+
searchMethod: _types.DatasourceSearchMethod.DATASOURCE_SEARCH_QUERY,
|
|
260
|
+
displayedColumnCount: visibleColumnCount.current
|
|
261
|
+
}));
|
|
262
|
+
}
|
|
263
|
+
}, [analyticsPayload, fireEvent, totalCount, isDataReady]);
|
|
264
|
+
(0, _react.useEffect)(function () {
|
|
265
|
+
var isResolved = status === 'resolved';
|
|
266
|
+
var isTableViewMode = currentViewMode === 'table';
|
|
267
|
+
var isInlineViewMode = currentViewMode === 'inline';
|
|
268
|
+
if (!isResolved) {
|
|
269
|
+
return;
|
|
270
|
+
}
|
|
271
|
+
if (isTableViewMode) {
|
|
272
|
+
fireTableViewedEvent();
|
|
273
|
+
} else if (isInlineViewMode) {
|
|
274
|
+
fireInlineViewedEvent();
|
|
275
|
+
}
|
|
276
|
+
}, [currentViewMode, fireInlineViewedEvent, fireTableViewedEvent, status]);
|
|
277
|
+
var renderTableModalContent = (0, _react.useCallback)(function () {
|
|
278
|
+
if (status === 'rejected') {
|
|
279
|
+
return (0, _react2.jsx)(_modalLoadingError.ModalLoadingError, null);
|
|
280
|
+
} else if (status === 'unauthorized') {
|
|
281
|
+
return (0, _react2.jsx)(_accessRequired.AccessRequired, {
|
|
282
|
+
url: selectedConfluenceSiteUrl || urlBeingEdited
|
|
283
|
+
});
|
|
284
|
+
} else if (resolvedWithNoResults || status === 'forbidden') {
|
|
285
|
+
return (0, _react2.jsx)(_noResults.NoResults, null);
|
|
286
|
+
} else if (status === 'empty' || !columns.length) {
|
|
287
|
+
// persist the empty state when making the initial /data request which contains the columns
|
|
288
|
+
if (hasConfluenceSearchParams !== undefined) {
|
|
289
|
+
return (0, _react2.jsx)(_issueLikeTable.EmptyState, {
|
|
290
|
+
testId: "confluence-search-datasource-modal--empty-state"
|
|
291
|
+
});
|
|
292
|
+
}
|
|
293
|
+
return (0, _react2.jsx)(_contentContainer.ContentContainer, null, (0, _react2.jsx)(_initialStateView.InitialStateView, {
|
|
294
|
+
icon: (0, _react2.jsx)(_confluenceSearchInitialStateSvg.ConfluenceSearchInitialStateSVG, null),
|
|
295
|
+
title: _messages.confluenceSearchModalMessages.initialViewSearchTitle,
|
|
296
|
+
description: _messages.confluenceSearchModalMessages.initialViewSearchDescription
|
|
297
|
+
}));
|
|
298
|
+
}
|
|
299
|
+
return confluenceSearchTable;
|
|
300
|
+
}, [columns.length, selectedConfluenceSiteUrl, confluenceSearchTable, resolvedWithNoResults, status, urlBeingEdited, hasConfluenceSearchParams]);
|
|
301
|
+
var renderInlineLinkModalContent = (0, _react.useCallback)(function () {
|
|
302
|
+
if (status === 'unauthorized') {
|
|
303
|
+
return (0, _react2.jsx)(_accessRequired.AccessRequired, {
|
|
304
|
+
url: selectedConfluenceSiteUrl || urlBeingEdited
|
|
305
|
+
});
|
|
306
|
+
} else if (status === 'empty' || !selectedConfluenceSiteUrl) {
|
|
307
|
+
return (0, _react2.jsx)(_countViewSmartLink.SmartCardPlaceholder, {
|
|
308
|
+
placeholderText: _messages.confluenceSearchModalMessages.resultsCountSmartCardPlaceholderText
|
|
309
|
+
});
|
|
310
|
+
} else {
|
|
311
|
+
return confluenceSearchUrl && (0, _react2.jsx)(_countViewSmartLink.SmartLink, {
|
|
312
|
+
url: confluenceSearchUrl
|
|
313
|
+
});
|
|
314
|
+
}
|
|
315
|
+
}, [confluenceSearchUrl, selectedConfluenceSiteUrl, status, urlBeingEdited]);
|
|
316
|
+
var shouldShowResultsCount = !!totalCount && currentViewMode === 'table';
|
|
317
|
+
var onInsertPressed = (0, _react.useCallback)(function (e, analyticsEvent) {
|
|
318
|
+
var _insertButtonClickedE;
|
|
319
|
+
if (!isParametersSet || !cloudId || !confluenceSearchUrl) {
|
|
320
|
+
return;
|
|
321
|
+
}
|
|
322
|
+
var insertButtonClickedEvent = analyticsEvent.update({
|
|
323
|
+
actionSubjectId: 'insert',
|
|
324
|
+
attributes: _objectSpread(_objectSpread({}, analyticsPayload), {}, {
|
|
325
|
+
totalItemCount: totalCount || 0,
|
|
326
|
+
displayedColumnCount: visibleColumnCount.current,
|
|
327
|
+
display: currentViewMode === 'inline' ? _types.DatasourceDisplay.DATASOURCE_INLINE : _types.DatasourceDisplay.DATASOURCE_TABLE,
|
|
328
|
+
searchCount: searchCount.current,
|
|
329
|
+
searchMethod: _types.DatasourceSearchMethod.DATASOURCE_SEARCH_QUERY,
|
|
330
|
+
actions: userInteractions.get()
|
|
331
|
+
}),
|
|
332
|
+
eventType: 'ui'
|
|
333
|
+
});
|
|
334
|
+
var consumerEvent = (_insertButtonClickedE = insertButtonClickedEvent.clone()) !== null && _insertButtonClickedE !== void 0 ? _insertButtonClickedE : undefined;
|
|
335
|
+
insertButtonClickedEvent.fire(_analytics.EVENT_CHANNEL);
|
|
336
|
+
if (currentViewMode === 'inline') {
|
|
337
|
+
onInsert({
|
|
338
|
+
type: 'inlineCard',
|
|
339
|
+
attrs: {
|
|
340
|
+
url: confluenceSearchUrl
|
|
341
|
+
}
|
|
342
|
+
}, consumerEvent);
|
|
343
|
+
} else {
|
|
344
|
+
onInsert((0, _adf.buildDatasourceAdf)({
|
|
345
|
+
id: datasourceId,
|
|
346
|
+
parameters: _objectSpread(_objectSpread({}, parametersToSend), {}, {
|
|
347
|
+
cloudId: cloudId
|
|
348
|
+
}),
|
|
349
|
+
views: [{
|
|
350
|
+
type: 'table',
|
|
351
|
+
properties: {
|
|
352
|
+
columns: (visibleColumnKeys || []).map(function (key) {
|
|
353
|
+
var width = columnCustomSizes === null || columnCustomSizes === void 0 ? void 0 : columnCustomSizes[key];
|
|
354
|
+
var isWrapped = wrappedColumnKeys === null || wrappedColumnKeys === void 0 ? void 0 : wrappedColumnKeys.includes(key);
|
|
355
|
+
return _objectSpread(_objectSpread({
|
|
356
|
+
key: key
|
|
357
|
+
}, width ? {
|
|
358
|
+
width: width
|
|
359
|
+
} : {}), isWrapped ? {
|
|
360
|
+
isWrapped: isWrapped
|
|
361
|
+
} : {});
|
|
362
|
+
})
|
|
363
|
+
}
|
|
364
|
+
}]
|
|
365
|
+
}, confluenceSearchUrl), consumerEvent);
|
|
366
|
+
}
|
|
367
|
+
}, [isParametersSet, cloudId, analyticsPayload, totalCount, currentViewMode, onInsert, confluenceSearchUrl, datasourceId, parametersToSend, visibleColumnKeys, columnCustomSizes, wrappedColumnKeys, userInteractions]);
|
|
368
|
+
var handleViewModeChange = function handleViewModeChange(selectedMode) {
|
|
369
|
+
userInteractions.add(_types.DatasourceAction.DISPLAY_VIEW_CHANGED);
|
|
370
|
+
setCurrentViewMode(selectedMode);
|
|
371
|
+
};
|
|
372
|
+
var onSearch = (0, _react.useCallback)(function (newSearchString, filters) {
|
|
373
|
+
searchCount.current++;
|
|
374
|
+
userInteractions.add(_types.DatasourceAction.QUERY_UPDATED);
|
|
375
|
+
if (filters) {
|
|
376
|
+
var editedOrCreatedBy = filters.editedOrCreatedBy,
|
|
377
|
+
lastModifiedList = filters.lastModified;
|
|
378
|
+
if (lastModifiedList) {
|
|
379
|
+
var updatedDateRangeOption = lastModifiedList.find(function (range) {
|
|
380
|
+
return range.value;
|
|
381
|
+
});
|
|
382
|
+
if ((updatedDateRangeOption === null || updatedDateRangeOption === void 0 ? void 0 : updatedDateRangeOption.optionType) === 'dateRange') {
|
|
383
|
+
setLastModified({
|
|
384
|
+
value: updatedDateRangeOption.value,
|
|
385
|
+
from: updatedDateRangeOption.from,
|
|
386
|
+
to: updatedDateRangeOption.to
|
|
387
|
+
});
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
if (editedOrCreatedBy) {
|
|
391
|
+
var accountIds = editedOrCreatedBy.map(function (user) {
|
|
392
|
+
return user.value;
|
|
393
|
+
});
|
|
394
|
+
setContributorAccountIds(accountIds);
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
setSearchString(newSearchString);
|
|
398
|
+
reset({
|
|
399
|
+
shouldForceRequest: true
|
|
400
|
+
});
|
|
401
|
+
}, [reset, userInteractions]);
|
|
402
|
+
var isInsertDisabled = !isParametersSet || status === 'rejected' || status === 'unauthorized' || status === 'loading';
|
|
403
|
+
var getCancelButtonAnalyticsPayload = (0, _react.useCallback)(function () {
|
|
404
|
+
return {
|
|
405
|
+
extensionKey: extensionKey,
|
|
406
|
+
destinationObjectTypes: destinationObjectTypes,
|
|
407
|
+
searchCount: searchCount.current,
|
|
408
|
+
actions: userInteractions.get()
|
|
409
|
+
};
|
|
410
|
+
}, [destinationObjectTypes, extensionKey, userInteractions]);
|
|
411
|
+
return (0, _react2.jsx)(_intlMessagesProvider.IntlMessagesProvider, {
|
|
412
|
+
defaultMessages: _en.default,
|
|
413
|
+
loaderFn: _fetchMessagesForLocale.fetchMessagesForLocale
|
|
414
|
+
}, (0, _react2.jsx)(_datasourceModal.DatasourceModal, {
|
|
415
|
+
testId: "confluence-search-datasource-modal",
|
|
416
|
+
onClose: onCancel
|
|
417
|
+
}, (0, _react2.jsx)(_modalDialog.ModalHeader, null, (0, _react2.jsx)(_modalDialog.ModalTitle, null, (0, _react2.jsx)(_siteSelector.SiteSelector, {
|
|
418
|
+
availableSites: availableSites,
|
|
419
|
+
onSiteSelection: onSiteSelection,
|
|
420
|
+
selectedSite: selectedConfluenceSite,
|
|
421
|
+
testId: "confluence-search-datasource-modal--site-selector",
|
|
422
|
+
label: siteSelectorLabel
|
|
423
|
+
})), !hasNoConfluenceSites && !disableDisplayDropdown && (0, _react2.jsx)(_displayViewDropDown.DisplayViewDropDown, {
|
|
424
|
+
onViewModeChange: handleViewModeChange,
|
|
425
|
+
viewMode: currentViewMode
|
|
426
|
+
})), (0, _react2.jsx)(_modalDialog.ModalBody, null, !hasNoConfluenceSites ? (0, _react2.jsx)(_react.Fragment, null, (0, _react2.jsx)(_primitives.Box, {
|
|
427
|
+
xcss: inputContainerStyles
|
|
428
|
+
}, (0, _react2.jsx)(_confluenceSearchContainer.default, {
|
|
429
|
+
isSearching: status === 'loading',
|
|
430
|
+
onSearch: onSearch,
|
|
431
|
+
parameters: parameters
|
|
432
|
+
})), currentViewMode === 'inline' ? renderInlineLinkModalContent() : renderTableModalContent()) : (0, _react2.jsx)(_noInstances.NoInstancesView, {
|
|
433
|
+
title: _messages.confluenceSearchModalMessages.noAccessToConfluenceSitesTitle,
|
|
434
|
+
description: _messages.confluenceSearchModalMessages.noAccessToConfluenceSitesDescription,
|
|
435
|
+
testId: 'no-confluence-instances-content'
|
|
436
|
+
})), (0, _react2.jsx)(_modalDialog.ModalFooter, null, shouldShowResultsCount && confluenceSearchUrl && (0, _react2.jsx)(_searchCount.default, {
|
|
437
|
+
searchCount: totalCount,
|
|
438
|
+
url: confluenceSearchUrl,
|
|
439
|
+
prefixTextType: "result",
|
|
440
|
+
testId: "confluence-search-datasource-modal-total-results-count"
|
|
441
|
+
}), (0, _react2.jsx)(_cancelButton.CancelButton, {
|
|
442
|
+
onCancel: onCancel,
|
|
443
|
+
getAnalyticsPayload: getCancelButtonAnalyticsPayload,
|
|
444
|
+
testId: "confluence-search-modal--cancel-button"
|
|
445
|
+
}), !hasNoConfluenceSites && (0, _react2.jsx)(_standardButton.default, {
|
|
446
|
+
appearance: "primary",
|
|
447
|
+
onClick: onInsertPressed,
|
|
448
|
+
isDisabled: isInsertDisabled,
|
|
449
|
+
testId: "confluence-search-datasource-modal--insert-button"
|
|
450
|
+
}, (0, _react2.jsx)(_reactIntlNext.FormattedMessage, _messages.confluenceSearchModalMessages.insertResultsButtonText)))));
|
|
451
|
+
};
|