@atlaskit/link-datasource 2.0.4 → 2.1.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 +32 -0
- package/dist/cjs/services/useAvailableSites.js +64 -0
- package/dist/cjs/ui/confluence-search-modal/modal/index.js +32 -86
- package/dist/cjs/ui/issue-like-table/utils.js +18 -1
- package/dist/cjs/ui/jira-issues-modal/modal/index.js +37 -94
- package/dist/es2019/services/useAvailableSites.js +27 -0
- package/dist/es2019/ui/confluence-search-modal/modal/index.js +13 -37
- package/dist/es2019/ui/issue-like-table/utils.js +17 -0
- package/dist/es2019/ui/jira-issues-modal/modal/index.js +14 -41
- package/dist/esm/services/useAvailableSites.js +57 -0
- package/dist/esm/ui/confluence-search-modal/modal/index.js +30 -84
- package/dist/esm/ui/issue-like-table/utils.js +17 -0
- package/dist/esm/ui/jira-issues-modal/modal/index.js +35 -92
- package/dist/types/services/useAvailableSites.d.ts +5 -0
- package/dist/types/ui/assets-modal/modal/index.d.ts +1 -1
- package/dist/types/ui/assets-modal/types.d.ts +4 -8
- package/dist/types/ui/confluence-search-modal/modal/index.d.ts +0 -2
- package/dist/types/ui/confluence-search-modal/types.d.ts +2 -1
- package/dist/types/ui/issue-like-table/index.d.ts +3 -3
- package/dist/types/ui/issue-like-table/utils.d.ts +6 -0
- package/dist/types/ui/jira-issues-modal/modal/index.d.ts +0 -6
- package/dist/types-ts4.5/services/useAvailableSites.d.ts +5 -0
- package/dist/types-ts4.5/ui/assets-modal/modal/index.d.ts +1 -1
- package/dist/types-ts4.5/ui/assets-modal/types.d.ts +4 -8
- package/dist/types-ts4.5/ui/confluence-search-modal/modal/index.d.ts +0 -2
- package/dist/types-ts4.5/ui/confluence-search-modal/types.d.ts +2 -1
- package/dist/types-ts4.5/ui/issue-like-table/index.d.ts +3 -3
- package/dist/types-ts4.5/ui/issue-like-table/utils.d.ts +6 -0
- package/dist/types-ts4.5/ui/jira-issues-modal/modal/index.d.ts +0 -6
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,37 @@
|
|
|
1
1
|
# @atlaskit/link-datasource
|
|
2
2
|
|
|
3
|
+
## 2.1.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#97731](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/97731)
|
|
8
|
+
[`3c244075bbb8`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/3c244075bbb8) -
|
|
9
|
+
Minor refactor to site picker for Jira and Confluence site picker. No expected functional
|
|
10
|
+
changes.
|
|
11
|
+
- Updated dependencies
|
|
12
|
+
|
|
13
|
+
## 2.1.0
|
|
14
|
+
|
|
15
|
+
### Minor Changes
|
|
16
|
+
|
|
17
|
+
- [#97537](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/97537)
|
|
18
|
+
[`ab7caf1bf7ee`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/ab7caf1bf7ee) -
|
|
19
|
+
Update AssetsConfigModalProps to be aligned with other modals. New fields made available
|
|
20
|
+
including:
|
|
21
|
+
|
|
22
|
+
- `url`: The url that was used to insert a List of Links
|
|
23
|
+
- `viewMode`: 2 viewModes `inline` and `table` for different display.
|
|
24
|
+
- `wrappedColumnKeys`: toggle line-wrapping for each column.
|
|
25
|
+
- `columnCustomSizes`: allow customized column sizes.
|
|
26
|
+
|
|
27
|
+
The new fields are not required for each modal to implement.
|
|
28
|
+
|
|
29
|
+
### Patch Changes
|
|
30
|
+
|
|
31
|
+
- [#98158](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/98158)
|
|
32
|
+
[`2ec887a95a61`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/2ec887a95a61) -
|
|
33
|
+
Minor internal refactor. No expected functional changes.
|
|
34
|
+
|
|
3
35
|
## 2.0.4
|
|
4
36
|
|
|
5
37
|
### Patch Changes
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.useAvailableSites = void 0;
|
|
8
|
+
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
9
|
+
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
10
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
11
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
12
|
+
var _react = require("react");
|
|
13
|
+
var _getAvailableSites = require("./getAvailableSites");
|
|
14
|
+
var useAvailableSites = exports.useAvailableSites = function useAvailableSites(product, cloudId) {
|
|
15
|
+
var _useState = (0, _react.useState)(undefined),
|
|
16
|
+
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
17
|
+
availableSites = _useState2[0],
|
|
18
|
+
setAvailableSites = _useState2[1];
|
|
19
|
+
(0, _react.useEffect)(function () {
|
|
20
|
+
var fetchSiteDisplayNames = /*#__PURE__*/function () {
|
|
21
|
+
var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
22
|
+
var sites, sortedAvailableSites;
|
|
23
|
+
return _regenerator.default.wrap(function _callee$(_context) {
|
|
24
|
+
while (1) switch (_context.prev = _context.next) {
|
|
25
|
+
case 0:
|
|
26
|
+
_context.next = 2;
|
|
27
|
+
return (0, _getAvailableSites.getAvailableSites)(product);
|
|
28
|
+
case 2:
|
|
29
|
+
sites = _context.sent;
|
|
30
|
+
sortedAvailableSites = (0, _toConsumableArray2.default)(sites).sort(function (a, b) {
|
|
31
|
+
return a.displayName.localeCompare(b.displayName);
|
|
32
|
+
});
|
|
33
|
+
setAvailableSites(sortedAvailableSites);
|
|
34
|
+
case 5:
|
|
35
|
+
case "end":
|
|
36
|
+
return _context.stop();
|
|
37
|
+
}
|
|
38
|
+
}, _callee);
|
|
39
|
+
}));
|
|
40
|
+
return function fetchSiteDisplayNames() {
|
|
41
|
+
return _ref.apply(this, arguments);
|
|
42
|
+
};
|
|
43
|
+
}();
|
|
44
|
+
void fetchSiteDisplayNames();
|
|
45
|
+
}, [product]);
|
|
46
|
+
var selectedSite = (0, _react.useMemo)(function () {
|
|
47
|
+
if (cloudId) {
|
|
48
|
+
return availableSites === null || availableSites === void 0 ? void 0 : availableSites.find(function (site) {
|
|
49
|
+
return site.cloudId === cloudId;
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
var currentlyLoggedInSiteUrl;
|
|
53
|
+
if (typeof window.location !== 'undefined') {
|
|
54
|
+
currentlyLoggedInSiteUrl = window.location.origin;
|
|
55
|
+
}
|
|
56
|
+
return (availableSites === null || availableSites === void 0 ? void 0 : availableSites.find(function (site) {
|
|
57
|
+
return site.url === currentlyLoggedInSiteUrl;
|
|
58
|
+
})) || (availableSites === null || availableSites === void 0 ? void 0 : availableSites[0]);
|
|
59
|
+
}, [availableSites, cloudId]);
|
|
60
|
+
return {
|
|
61
|
+
availableSites: availableSites,
|
|
62
|
+
selectedSite: selectedSite
|
|
63
|
+
};
|
|
64
|
+
};
|
|
@@ -5,11 +5,8 @@ var _typeof = require("@babel/runtime/helpers/typeof");
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.
|
|
9
|
-
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
8
|
+
exports.PlainConfluenceSearchConfigModal = exports.ConfluenceSearchConfigModal = void 0;
|
|
10
9
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
|
-
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
12
|
-
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
13
10
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
14
11
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
15
12
|
var _react = require("react");
|
|
@@ -31,7 +28,7 @@ var _adf = require("../../../common/utils/adf");
|
|
|
31
28
|
var _fetchMessagesForLocale = require("../../../common/utils/locale/fetch-messages-for-locale");
|
|
32
29
|
var _useDatasourceTableState = require("../../../hooks/useDatasourceTableState");
|
|
33
30
|
var _en = _interopRequireDefault(require("../../../i18n/en"));
|
|
34
|
-
var
|
|
31
|
+
var _useAvailableSites2 = require("../../../services/useAvailableSites");
|
|
35
32
|
var _accessRequired = require("../../common/error-state/access-required");
|
|
36
33
|
var _modalLoadingError = require("../../common/error-state/modal-loading-error");
|
|
37
34
|
var _noInstances = require("../../common/error-state/no-instances");
|
|
@@ -45,6 +42,7 @@ var _siteSelector = require("../../common/modal/site-selector");
|
|
|
45
42
|
var _issueLikeTable = require("../../issue-like-table");
|
|
46
43
|
var _useColumnResize2 = require("../../issue-like-table/use-column-resize");
|
|
47
44
|
var _useColumnWrapping2 = require("../../issue-like-table/use-column-wrapping");
|
|
45
|
+
var _utils = require("../../issue-like-table/utils");
|
|
48
46
|
var _confluenceSearchContainer = _interopRequireDefault(require("../confluence-search-container"));
|
|
49
47
|
var _confluenceSearchInitialStateSvg = require("./confluence-search-initial-state-svg");
|
|
50
48
|
var _messages = require("./messages");
|
|
@@ -61,19 +59,6 @@ var searchCountStyles = (0, _primitives.xcss)({
|
|
|
61
59
|
flex: 1,
|
|
62
60
|
fontWeight: 600
|
|
63
61
|
});
|
|
64
|
-
|
|
65
|
-
// TODO: common functionality of all modals refactor in EDM-9573
|
|
66
|
-
var getColumnAction = exports.getColumnAction = function getColumnAction(oldVisibleColumnKeys, newVisibleColumnKeys) {
|
|
67
|
-
var newColumnSize = newVisibleColumnKeys.length;
|
|
68
|
-
var oldColumnSize = oldVisibleColumnKeys.length;
|
|
69
|
-
if (newColumnSize > oldColumnSize) {
|
|
70
|
-
return _types.DatasourceAction.COLUMN_ADDED;
|
|
71
|
-
} else if (newColumnSize < oldColumnSize) {
|
|
72
|
-
return _types.DatasourceAction.COLUMN_REMOVED;
|
|
73
|
-
} else {
|
|
74
|
-
return _types.DatasourceAction.COLUMN_REORDERED;
|
|
75
|
-
}
|
|
76
|
-
};
|
|
77
62
|
var PlainConfluenceSearchConfigModal = exports.PlainConfluenceSearchConfigModal = function PlainConfluenceSearchConfigModal(props) {
|
|
78
63
|
var _useRef = (0, _react.useRef)((0, _uuid.v4)()),
|
|
79
64
|
modalRenderInstanceId = _useRef.current;
|
|
@@ -90,38 +75,37 @@ var PlainConfluenceSearchConfigModal = exports.PlainConfluenceSearchConfigModal
|
|
|
90
75
|
_props$disableDisplay = props.disableDisplayDropdown,
|
|
91
76
|
disableDisplayDropdown = _props$disableDisplay === void 0 ? false : _props$disableDisplay,
|
|
92
77
|
overrideParameters = props.overrideParameters;
|
|
93
|
-
var _useState = (0, _react.useState)(
|
|
78
|
+
var _useState = (0, _react.useState)(viewMode),
|
|
94
79
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
var _useState3 = (0, _react.useState)(
|
|
80
|
+
currentViewMode = _useState2[0],
|
|
81
|
+
setCurrentViewMode = _useState2[1];
|
|
82
|
+
var _useState3 = (0, _react.useState)(initialParameters === null || initialParameters === void 0 ? void 0 : initialParameters.cloudId),
|
|
98
83
|
_useState4 = (0, _slicedToArray2.default)(_useState3, 2),
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
var
|
|
84
|
+
cloudId = _useState4[0],
|
|
85
|
+
setCloudId = _useState4[1];
|
|
86
|
+
var _useAvailableSites = (0, _useAvailableSites2.useAvailableSites)('confluence', cloudId),
|
|
87
|
+
availableSites = _useAvailableSites.availableSites,
|
|
88
|
+
selectedConfluenceSite = _useAvailableSites.selectedSite;
|
|
89
|
+
var _useState5 = (0, _react.useState)(initialParameters === null || initialParameters === void 0 ? void 0 : initialParameters.searchString),
|
|
102
90
|
_useState6 = (0, _slicedToArray2.default)(_useState5, 2),
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
var _useState7 = (0, _react.useState)(
|
|
91
|
+
searchString = _useState6[0],
|
|
92
|
+
setSearchString = _useState6[1];
|
|
93
|
+
var _useState7 = (0, _react.useState)(initialVisibleColumnKeys),
|
|
106
94
|
_useState8 = (0, _slicedToArray2.default)(_useState7, 2),
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
var _useState9 = (0, _react.useState)(
|
|
95
|
+
visibleColumnKeys = _useState8[0],
|
|
96
|
+
setVisibleColumnKeys = _useState8[1];
|
|
97
|
+
var _useState9 = (0, _react.useState)((initialParameters === null || initialParameters === void 0 ? void 0 : initialParameters.contributorAccountIds) || []),
|
|
110
98
|
_useState10 = (0, _slicedToArray2.default)(_useState9, 2),
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
var _useState11 = (0, _react.useState)(
|
|
114
|
-
_useState12 = (0, _slicedToArray2.default)(_useState11, 2),
|
|
115
|
-
contributorAccountIds = _useState12[0],
|
|
116
|
-
setContributorAccountIds = _useState12[1];
|
|
117
|
-
var _useState13 = (0, _react.useState)(initialParameters !== null && initialParameters !== void 0 && initialParameters.lastModified ? {
|
|
99
|
+
contributorAccountIds = _useState10[0],
|
|
100
|
+
setContributorAccountIds = _useState10[1];
|
|
101
|
+
var _useState11 = (0, _react.useState)(initialParameters !== null && initialParameters !== void 0 && initialParameters.lastModified ? {
|
|
118
102
|
value: initialParameters === null || initialParameters === void 0 ? void 0 : initialParameters.lastModified,
|
|
119
103
|
from: initialParameters === null || initialParameters === void 0 ? void 0 : initialParameters.lastModifiedFrom,
|
|
120
104
|
to: initialParameters === null || initialParameters === void 0 ? void 0 : initialParameters.lastModifiedTo
|
|
121
105
|
} : undefined),
|
|
122
|
-
|
|
123
|
-
lastModified =
|
|
124
|
-
setLastModified =
|
|
106
|
+
_useState12 = (0, _slicedToArray2.default)(_useState11, 2),
|
|
107
|
+
lastModified = _useState12[0],
|
|
108
|
+
setLastModified = _useState12[1];
|
|
125
109
|
|
|
126
110
|
// analytics related parameters
|
|
127
111
|
var searchCount = (0, _react.useRef)(0);
|
|
@@ -168,21 +152,14 @@ var PlainConfluenceSearchConfigModal = exports.PlainConfluenceSearchConfigModal
|
|
|
168
152
|
var _useDatasourceAnalyti = (0, _analytics.useDatasourceAnalyticsEvents)(),
|
|
169
153
|
fireEvent = _useDatasourceAnalyti.fireEvent;
|
|
170
154
|
var hasNoConfluenceSites = availableSites && availableSites.length === 0;
|
|
171
|
-
|
|
172
|
-
if (
|
|
173
|
-
|
|
174
|
-
|
|
155
|
+
(0, _react.useEffect)(function () {
|
|
156
|
+
if (availableSites) {
|
|
157
|
+
fireEvent('ui.modal.ready.datasource', {
|
|
158
|
+
instancesCount: availableSites.length,
|
|
159
|
+
schemasCount: null
|
|
175
160
|
});
|
|
176
|
-
} else {
|
|
177
|
-
var currentlyLoggedInSiteUrl;
|
|
178
|
-
if (typeof window.location !== 'undefined') {
|
|
179
|
-
currentlyLoggedInSiteUrl = window.location.origin;
|
|
180
|
-
}
|
|
181
|
-
return (availableSites === null || availableSites === void 0 ? void 0 : availableSites.find(function (confluenceSite) {
|
|
182
|
-
return confluenceSite.url === currentlyLoggedInSiteUrl;
|
|
183
|
-
})) || (availableSites === null || availableSites === void 0 ? void 0 : availableSites[0]);
|
|
184
161
|
}
|
|
185
|
-
}, [
|
|
162
|
+
}, [fireEvent, availableSites]);
|
|
186
163
|
(0, _react.useEffect)(function () {
|
|
187
164
|
fireEvent('screen.datasourceModalDialog.viewed', {});
|
|
188
165
|
}, [fireEvent]);
|
|
@@ -207,37 +184,6 @@ var PlainConfluenceSearchConfigModal = exports.PlainConfluenceSearchConfigModal
|
|
|
207
184
|
shouldForceRequest: true
|
|
208
185
|
});
|
|
209
186
|
}, [reset]);
|
|
210
|
-
(0, _react.useEffect)(function () {
|
|
211
|
-
var fetchSiteDisplayNames = /*#__PURE__*/function () {
|
|
212
|
-
var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
213
|
-
var confluenceSites, sortedAvailableSites;
|
|
214
|
-
return _regenerator.default.wrap(function _callee$(_context) {
|
|
215
|
-
while (1) switch (_context.prev = _context.next) {
|
|
216
|
-
case 0:
|
|
217
|
-
_context.next = 2;
|
|
218
|
-
return (0, _getAvailableSites.getAvailableSites)('confluence');
|
|
219
|
-
case 2:
|
|
220
|
-
confluenceSites = _context.sent;
|
|
221
|
-
sortedAvailableSites = (0, _toConsumableArray2.default)(confluenceSites).sort(function (a, b) {
|
|
222
|
-
return a.displayName.localeCompare(b.displayName);
|
|
223
|
-
});
|
|
224
|
-
setAvailableSites(sortedAvailableSites);
|
|
225
|
-
fireEvent('ui.modal.ready.datasource', {
|
|
226
|
-
instancesCount: sortedAvailableSites.length,
|
|
227
|
-
schemasCount: null
|
|
228
|
-
});
|
|
229
|
-
case 6:
|
|
230
|
-
case "end":
|
|
231
|
-
return _context.stop();
|
|
232
|
-
}
|
|
233
|
-
}, _callee);
|
|
234
|
-
}));
|
|
235
|
-
return function fetchSiteDisplayNames() {
|
|
236
|
-
return _ref.apply(this, arguments);
|
|
237
|
-
};
|
|
238
|
-
}();
|
|
239
|
-
void fetchSiteDisplayNames();
|
|
240
|
-
}, [fireEvent]);
|
|
241
187
|
(0, _react.useEffect)(function () {
|
|
242
188
|
var newVisibleColumnKeys = !initialVisibleColumnKeys || (initialVisibleColumnKeys || []).length === 0 ? defaultVisibleColumnKeys : initialVisibleColumnKeys;
|
|
243
189
|
visibleColumnCount.current = newVisibleColumnKeys.length;
|
|
@@ -254,7 +200,7 @@ var PlainConfluenceSearchConfigModal = exports.PlainConfluenceSearchConfigModal
|
|
|
254
200
|
// TODO: common functionality of all modals refactor in EDM-9573
|
|
255
201
|
var handleVisibleColumnKeysChange = (0, _react.useCallback)(function () {
|
|
256
202
|
var newVisibleColumnKeys = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
257
|
-
var columnAction = getColumnAction(visibleColumnKeys || [], newVisibleColumnKeys);
|
|
203
|
+
var columnAction = (0, _utils.getColumnAction)(visibleColumnKeys || [], newVisibleColumnKeys);
|
|
258
204
|
userInteractionActions.current.add(columnAction);
|
|
259
205
|
visibleColumnCount.current = newVisibleColumnKeys.length;
|
|
260
206
|
setVisibleColumnKeys(newVisibleColumnKeys);
|
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.getWidthCss = exports.COLUMN_MIN_WIDTH = exports.COLUMN_BASE_WIDTH = void 0;
|
|
6
|
+
exports.getWidthCss = exports.getColumnAction = exports.COLUMN_MIN_WIDTH = exports.COLUMN_BASE_WIDTH = void 0;
|
|
7
|
+
var _types = require("../../analytics/types");
|
|
7
8
|
var COLUMN_BASE_WIDTH = exports.COLUMN_BASE_WIDTH = 8;
|
|
8
9
|
var COLUMN_MIN_WIDTH = exports.COLUMN_MIN_WIDTH = COLUMN_BASE_WIDTH * 3;
|
|
9
10
|
/**
|
|
@@ -23,4 +24,20 @@ var getWidthCss = exports.getWidthCss = function getWidthCss(_ref) {
|
|
|
23
24
|
} : {
|
|
24
25
|
maxWidth: width
|
|
25
26
|
};
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* This method should be called when one atomic action is performed on columns: adding new item, removing one item, changing items order.
|
|
31
|
+
* The assumption is that since only one action is changed at each time, we don't have to verify the actual contents of the lists.
|
|
32
|
+
*/
|
|
33
|
+
var getColumnAction = exports.getColumnAction = function getColumnAction(oldVisibleColumnKeys, newVisibleColumnKeys) {
|
|
34
|
+
var newColumnSize = newVisibleColumnKeys.length;
|
|
35
|
+
var oldColumnSize = oldVisibleColumnKeys.length;
|
|
36
|
+
if (newColumnSize > oldColumnSize) {
|
|
37
|
+
return _types.DatasourceAction.COLUMN_ADDED;
|
|
38
|
+
} else if (newColumnSize < oldColumnSize) {
|
|
39
|
+
return _types.DatasourceAction.COLUMN_REMOVED;
|
|
40
|
+
} else {
|
|
41
|
+
return _types.DatasourceAction.COLUMN_REORDERED;
|
|
42
|
+
}
|
|
26
43
|
};
|
|
@@ -5,12 +5,9 @@ var _typeof = require("@babel/runtime/helpers/typeof");
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.
|
|
9
|
-
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
8
|
+
exports.PlainJiraIssuesConfigModal = exports.JiraIssuesConfigModal = void 0;
|
|
10
9
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
10
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
12
|
-
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
13
|
-
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
14
11
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
15
12
|
var _react = require("react");
|
|
16
13
|
var _react2 = require("@emotion/react");
|
|
@@ -34,7 +31,7 @@ var _adf = require("../../../common/utils/adf");
|
|
|
34
31
|
var _fetchMessagesForLocale = require("../../../common/utils/locale/fetch-messages-for-locale");
|
|
35
32
|
var _useDatasourceTableState = require("../../../hooks/useDatasourceTableState");
|
|
36
33
|
var _en = _interopRequireDefault(require("../../../i18n/en"));
|
|
37
|
-
var
|
|
34
|
+
var _useAvailableSites2 = require("../../../services/useAvailableSites");
|
|
38
35
|
var _accessRequired = require("../../common/error-state/access-required");
|
|
39
36
|
var _messages = require("../../common/error-state/messages");
|
|
40
37
|
var _modalLoadingError = require("../../common/error-state/modal-loading-error");
|
|
@@ -50,6 +47,7 @@ var _siteSelector = require("../../common/modal/site-selector");
|
|
|
50
47
|
var _issueLikeTable = require("../../issue-like-table");
|
|
51
48
|
var _useColumnResize2 = require("../../issue-like-table/use-column-resize");
|
|
52
49
|
var _useColumnWrapping2 = require("../../issue-like-table/use-column-wrapping");
|
|
50
|
+
var _utils2 = require("../../issue-like-table/utils");
|
|
53
51
|
var _ui = require("../basic-filters/ui");
|
|
54
52
|
var _isQueryTooComplex = require("../basic-filters/utils/isQueryTooComplex");
|
|
55
53
|
var _jiraSearchContainer = require("../jira-search-container");
|
|
@@ -70,22 +68,6 @@ var getDisplayValue = function getDisplayValue(currentViewMode, itemCount) {
|
|
|
70
68
|
return itemCount === 1 ? _types.DatasourceDisplay.INLINE : _types.DatasourceDisplay.DATASOURCE_INLINE;
|
|
71
69
|
};
|
|
72
70
|
var jqlSupportDocumentLink = 'https://support.atlassian.com/jira-service-management-cloud/docs/use-advanced-search-with-jira-query-language-jql/';
|
|
73
|
-
|
|
74
|
-
/**
|
|
75
|
-
* This method should be called when one atomic action is performed on columns: adding new item, removing one item, changing items order.
|
|
76
|
-
* The assumption is that since only one action is changed at each time, we don't have to verify the actual contents of the lists.
|
|
77
|
-
*/
|
|
78
|
-
var getColumnAction = exports.getColumnAction = function getColumnAction(oldVisibleColumnKeys, newVisibleColumnKeys) {
|
|
79
|
-
var newColumnSize = newVisibleColumnKeys.length;
|
|
80
|
-
var oldColumnSize = oldVisibleColumnKeys.length;
|
|
81
|
-
if (newColumnSize > oldColumnSize) {
|
|
82
|
-
return _types.DatasourceAction.COLUMN_ADDED;
|
|
83
|
-
} else if (newColumnSize < oldColumnSize) {
|
|
84
|
-
return _types.DatasourceAction.COLUMN_REMOVED;
|
|
85
|
-
} else {
|
|
86
|
-
return _types.DatasourceAction.COLUMN_REORDERED;
|
|
87
|
-
}
|
|
88
|
-
};
|
|
89
71
|
var PlainJiraIssuesConfigModal = exports.PlainJiraIssuesConfigModal = function PlainJiraIssuesConfigModal(props) {
|
|
90
72
|
var datasourceId = props.datasourceId,
|
|
91
73
|
initialColumnCustomSizes = props.columnCustomSizes,
|
|
@@ -97,39 +79,38 @@ var PlainJiraIssuesConfigModal = exports.PlainJiraIssuesConfigModal = function P
|
|
|
97
79
|
initialParameters = props.parameters,
|
|
98
80
|
urlBeingEdited = props.url,
|
|
99
81
|
initialVisibleColumnKeys = props.visibleColumnKeys;
|
|
100
|
-
var _useState = (0, _react.useState)(
|
|
82
|
+
var _useState = (0, _react.useState)(viewMode),
|
|
101
83
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
var _useState3 = (0, _react.useState)(
|
|
84
|
+
currentViewMode = _useState2[0],
|
|
85
|
+
setCurrentViewMode = _useState2[1];
|
|
86
|
+
var _useState3 = (0, _react.useState)(initialParameters === null || initialParameters === void 0 ? void 0 : initialParameters.cloudId),
|
|
105
87
|
_useState4 = (0, _slicedToArray2.default)(_useState3, 2),
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
var
|
|
88
|
+
cloudId = _useState4[0],
|
|
89
|
+
setCloudId = _useState4[1];
|
|
90
|
+
var _useAvailableSites = (0, _useAvailableSites2.useAvailableSites)('jira', cloudId),
|
|
91
|
+
availableSites = _useAvailableSites.availableSites,
|
|
92
|
+
selectedJiraSite = _useAvailableSites.selectedSite;
|
|
93
|
+
var _useState5 = (0, _react.useState)(initialParameters === null || initialParameters === void 0 ? void 0 : initialParameters.jql),
|
|
109
94
|
_useState6 = (0, _slicedToArray2.default)(_useState5, 2),
|
|
110
|
-
|
|
111
|
-
|
|
95
|
+
jql = _useState6[0],
|
|
96
|
+
setJql = _useState6[1];
|
|
112
97
|
var _useState7 = (0, _react.useState)(initialParameters === null || initialParameters === void 0 ? void 0 : initialParameters.jql),
|
|
113
98
|
_useState8 = (0, _slicedToArray2.default)(_useState7, 2),
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
var _useState9 = (0, _react.useState)(
|
|
99
|
+
searchBarJql = _useState8[0],
|
|
100
|
+
setSearchBarJql = _useState8[1];
|
|
101
|
+
var _useState9 = (0, _react.useState)(initialVisibleColumnKeys),
|
|
117
102
|
_useState10 = (0, _slicedToArray2.default)(_useState9, 2),
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
var _useState11 = (0, _react.useState)(initialVisibleColumnKeys),
|
|
121
|
-
_useState12 = (0, _slicedToArray2.default)(_useState11, 2),
|
|
122
|
-
visibleColumnKeys = _useState12[0],
|
|
123
|
-
setVisibleColumnKeys = _useState12[1];
|
|
103
|
+
visibleColumnKeys = _useState10[0],
|
|
104
|
+
setVisibleColumnKeys = _useState10[1];
|
|
124
105
|
|
|
125
106
|
// analytics related parameters
|
|
126
107
|
var searchCount = (0, _react.useRef)(0);
|
|
127
108
|
var userInteractionActions = (0, _react.useRef)(new Set());
|
|
128
109
|
var initialSearchMethod = (0, _platformFeatureFlags.getBooleanFF)('platform.linking-platform.datasource.show-jlol-basic-filters') && !(0, _isQueryTooComplex.isQueryTooComplex)((initialParameters === null || initialParameters === void 0 ? void 0 : initialParameters.jql) || '') ? 'basic' : 'jql';
|
|
129
|
-
var
|
|
130
|
-
|
|
131
|
-
currentSearchMethod =
|
|
132
|
-
setCurrentSearchMethod =
|
|
110
|
+
var _useState11 = (0, _react.useState)(initialSearchMethod),
|
|
111
|
+
_useState12 = (0, _slicedToArray2.default)(_useState11, 2),
|
|
112
|
+
currentSearchMethod = _useState12[0],
|
|
113
|
+
setCurrentSearchMethod = _useState12[1];
|
|
133
114
|
var searchMethodSearchedWith = (0, _react.useRef)(null);
|
|
134
115
|
var visibleColumnCount = (0, _react.useRef)((visibleColumnKeys === null || visibleColumnKeys === void 0 ? void 0 : visibleColumnKeys.length) || 0);
|
|
135
116
|
var basicFilterSelectionsSearchedWith = (0, _react.useRef)({});
|
|
@@ -168,21 +149,6 @@ var PlainJiraIssuesConfigModal = exports.PlainJiraIssuesConfigModal = function P
|
|
|
168
149
|
fireEvent = _useDatasourceAnalyti.fireEvent;
|
|
169
150
|
var _useRef = (0, _react.useRef)((0, _uuid.v4)()),
|
|
170
151
|
modalRenderInstanceId = _useRef.current;
|
|
171
|
-
var selectedJiraSite = (0, _react.useMemo)(function () {
|
|
172
|
-
if (cloudId) {
|
|
173
|
-
return availableSites === null || availableSites === void 0 ? void 0 : availableSites.find(function (jiraSite) {
|
|
174
|
-
return jiraSite.cloudId === cloudId;
|
|
175
|
-
});
|
|
176
|
-
} else {
|
|
177
|
-
var currentlyLoggedInSiteUrl;
|
|
178
|
-
if (typeof window.location !== 'undefined') {
|
|
179
|
-
currentlyLoggedInSiteUrl = window.location.origin;
|
|
180
|
-
}
|
|
181
|
-
return (availableSites === null || availableSites === void 0 ? void 0 : availableSites.find(function (jiraSite) {
|
|
182
|
-
return jiraSite.url === currentlyLoggedInSiteUrl;
|
|
183
|
-
})) || (availableSites === null || availableSites === void 0 ? void 0 : availableSites[0]);
|
|
184
|
-
}
|
|
185
|
-
}, [availableSites, cloudId]);
|
|
186
152
|
var analyticsPayload = (0, _react.useMemo)(function () {
|
|
187
153
|
return {
|
|
188
154
|
extensionKey: extensionKey,
|
|
@@ -195,6 +161,14 @@ var PlainJiraIssuesConfigModal = exports.PlainJiraIssuesConfigModal = function P
|
|
|
195
161
|
var shouldShowIssueCount = !!totalCount && totalCount !== 1 && currentViewMode === 'table';
|
|
196
162
|
var isDataReady = (visibleColumnKeys || []).length > 0;
|
|
197
163
|
var hasNoJiraSites = availableSites && availableSites.length === 0;
|
|
164
|
+
(0, _react.useEffect)(function () {
|
|
165
|
+
if (availableSites) {
|
|
166
|
+
fireEvent('ui.modal.ready.datasource', {
|
|
167
|
+
instancesCount: availableSites.length,
|
|
168
|
+
schemasCount: null
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
}, [fireEvent, availableSites]);
|
|
198
172
|
(0, _react.useEffect)(function () {
|
|
199
173
|
var shouldStartUfoExperience = status === 'loading';
|
|
200
174
|
if (shouldStartUfoExperience) {
|
|
@@ -218,37 +192,6 @@ var PlainJiraIssuesConfigModal = exports.PlainJiraIssuesConfigModal = function P
|
|
|
218
192
|
visibleColumnCount.current = newVisibleColumnKeys.length;
|
|
219
193
|
setVisibleColumnKeys(newVisibleColumnKeys);
|
|
220
194
|
}, [initialVisibleColumnKeys, defaultVisibleColumnKeys]);
|
|
221
|
-
(0, _react.useEffect)(function () {
|
|
222
|
-
var fetchSiteDisplayNames = /*#__PURE__*/function () {
|
|
223
|
-
var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
224
|
-
var jiraSites, sortedAvailableSites;
|
|
225
|
-
return _regenerator.default.wrap(function _callee$(_context) {
|
|
226
|
-
while (1) switch (_context.prev = _context.next) {
|
|
227
|
-
case 0:
|
|
228
|
-
_context.next = 2;
|
|
229
|
-
return (0, _getAvailableSites.getAvailableSites)('jira');
|
|
230
|
-
case 2:
|
|
231
|
-
jiraSites = _context.sent;
|
|
232
|
-
sortedAvailableSites = (0, _toConsumableArray2.default)(jiraSites).sort(function (a, b) {
|
|
233
|
-
return a.displayName.localeCompare(b.displayName);
|
|
234
|
-
});
|
|
235
|
-
setAvailableSites(sortedAvailableSites);
|
|
236
|
-
fireEvent('ui.modal.ready.datasource', {
|
|
237
|
-
instancesCount: sortedAvailableSites.length,
|
|
238
|
-
schemasCount: null
|
|
239
|
-
});
|
|
240
|
-
case 6:
|
|
241
|
-
case "end":
|
|
242
|
-
return _context.stop();
|
|
243
|
-
}
|
|
244
|
-
}, _callee);
|
|
245
|
-
}));
|
|
246
|
-
return function fetchSiteDisplayNames() {
|
|
247
|
-
return _ref.apply(this, arguments);
|
|
248
|
-
};
|
|
249
|
-
}();
|
|
250
|
-
void fetchSiteDisplayNames();
|
|
251
|
-
}, [fireEvent]);
|
|
252
195
|
(0, _react.useEffect)(function () {
|
|
253
196
|
if (selectedJiraSite && (!cloudId || cloudId !== selectedJiraSite.cloudId)) {
|
|
254
197
|
setCloudId(selectedJiraSite.cloudId);
|
|
@@ -298,10 +241,10 @@ var PlainJiraIssuesConfigModal = exports.PlainJiraIssuesConfigModal = function P
|
|
|
298
241
|
}
|
|
299
242
|
}, [currentViewMode, status, fireIssueViewAnalytics, fireCountViewedEvent]);
|
|
300
243
|
(0, _useColumnPickerRenderedFailedUfoExperience.useColumnPickerRenderedFailedUfoExperience)(status, modalRenderInstanceId);
|
|
301
|
-
var onSearch = (0, _react.useCallback)(function (newParameters,
|
|
302
|
-
var searchMethod =
|
|
303
|
-
basicFilterSelections =
|
|
304
|
-
isQueryComplex =
|
|
244
|
+
var onSearch = (0, _react.useCallback)(function (newParameters, _ref) {
|
|
245
|
+
var searchMethod = _ref.searchMethod,
|
|
246
|
+
basicFilterSelections = _ref.basicFilterSelections,
|
|
247
|
+
isQueryComplex = _ref.isQueryComplex;
|
|
305
248
|
searchCount.current++;
|
|
306
249
|
searchMethodSearchedWith.current = searchMethod;
|
|
307
250
|
basicFilterSelectionsSearchedWith.current = basicFilterSelections;
|
|
@@ -422,7 +365,7 @@ var PlainJiraIssuesConfigModal = exports.PlainJiraIssuesConfigModal = function P
|
|
|
422
365
|
}, [onNextPage]);
|
|
423
366
|
var handleVisibleColumnKeysChange = (0, _react.useCallback)(function () {
|
|
424
367
|
var newVisibleColumnKeys = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
425
|
-
var columnAction = getColumnAction(visibleColumnKeys || [], newVisibleColumnKeys);
|
|
368
|
+
var columnAction = (0, _utils2.getColumnAction)(visibleColumnKeys || [], newVisibleColumnKeys);
|
|
426
369
|
userInteractionActions.current.add(columnAction);
|
|
427
370
|
visibleColumnCount.current = newVisibleColumnKeys.length;
|
|
428
371
|
setVisibleColumnKeys(newVisibleColumnKeys);
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { useEffect, useMemo, useState } from 'react';
|
|
2
|
+
import { getAvailableSites } from './getAvailableSites';
|
|
3
|
+
export const useAvailableSites = (product, cloudId) => {
|
|
4
|
+
const [availableSites, setAvailableSites] = useState(undefined);
|
|
5
|
+
useEffect(() => {
|
|
6
|
+
const fetchSiteDisplayNames = async () => {
|
|
7
|
+
const sites = await getAvailableSites(product);
|
|
8
|
+
const sortedAvailableSites = [...sites].sort((a, b) => a.displayName.localeCompare(b.displayName));
|
|
9
|
+
setAvailableSites(sortedAvailableSites);
|
|
10
|
+
};
|
|
11
|
+
void fetchSiteDisplayNames();
|
|
12
|
+
}, [product]);
|
|
13
|
+
const selectedSite = useMemo(() => {
|
|
14
|
+
if (cloudId) {
|
|
15
|
+
return availableSites === null || availableSites === void 0 ? void 0 : availableSites.find(site => site.cloudId === cloudId);
|
|
16
|
+
}
|
|
17
|
+
let currentlyLoggedInSiteUrl;
|
|
18
|
+
if (typeof window.location !== 'undefined') {
|
|
19
|
+
currentlyLoggedInSiteUrl = window.location.origin;
|
|
20
|
+
}
|
|
21
|
+
return (availableSites === null || availableSites === void 0 ? void 0 : availableSites.find(site => site.url === currentlyLoggedInSiteUrl)) || (availableSites === null || availableSites === void 0 ? void 0 : availableSites[0]);
|
|
22
|
+
}, [availableSites, cloudId]);
|
|
23
|
+
return {
|
|
24
|
+
availableSites,
|
|
25
|
+
selectedSite
|
|
26
|
+
};
|
|
27
|
+
};
|
|
@@ -19,7 +19,7 @@ import { buildDatasourceAdf } from '../../../common/utils/adf';
|
|
|
19
19
|
import { fetchMessagesForLocale } from '../../../common/utils/locale/fetch-messages-for-locale';
|
|
20
20
|
import { useDatasourceTableState } from '../../../hooks/useDatasourceTableState';
|
|
21
21
|
import i18nEN from '../../../i18n/en';
|
|
22
|
-
import {
|
|
22
|
+
import { useAvailableSites } from '../../../services/useAvailableSites';
|
|
23
23
|
import { AccessRequired } from '../../common/error-state/access-required';
|
|
24
24
|
import { ModalLoadingError } from '../../common/error-state/modal-loading-error';
|
|
25
25
|
import { NoInstancesView } from '../../common/error-state/no-instances';
|
|
@@ -33,6 +33,7 @@ import { SiteSelector } from '../../common/modal/site-selector';
|
|
|
33
33
|
import { EmptyState, IssueLikeDataTableView } from '../../issue-like-table';
|
|
34
34
|
import { useColumnResize } from '../../issue-like-table/use-column-resize';
|
|
35
35
|
import { useColumnWrapping } from '../../issue-like-table/use-column-wrapping';
|
|
36
|
+
import { getColumnAction } from '../../issue-like-table/utils';
|
|
36
37
|
import ConfluenceSearchContainer from '../confluence-search-container';
|
|
37
38
|
import { ConfluenceSearchInitialStateSVG } from './confluence-search-initial-state-svg';
|
|
38
39
|
import { confluenceSearchModalMessages } from './messages';
|
|
@@ -45,19 +46,6 @@ const searchCountStyles = xcss({
|
|
|
45
46
|
flex: 1,
|
|
46
47
|
fontWeight: 600
|
|
47
48
|
});
|
|
48
|
-
|
|
49
|
-
// TODO: common functionality of all modals refactor in EDM-9573
|
|
50
|
-
export const getColumnAction = (oldVisibleColumnKeys, newVisibleColumnKeys) => {
|
|
51
|
-
const newColumnSize = newVisibleColumnKeys.length;
|
|
52
|
-
const oldColumnSize = oldVisibleColumnKeys.length;
|
|
53
|
-
if (newColumnSize > oldColumnSize) {
|
|
54
|
-
return DatasourceAction.COLUMN_ADDED;
|
|
55
|
-
} else if (newColumnSize < oldColumnSize) {
|
|
56
|
-
return DatasourceAction.COLUMN_REMOVED;
|
|
57
|
-
} else {
|
|
58
|
-
return DatasourceAction.COLUMN_REORDERED;
|
|
59
|
-
}
|
|
60
|
-
};
|
|
61
49
|
export const PlainConfluenceSearchConfigModal = props => {
|
|
62
50
|
const {
|
|
63
51
|
current: modalRenderInstanceId
|
|
@@ -75,9 +63,12 @@ export const PlainConfluenceSearchConfigModal = props => {
|
|
|
75
63
|
disableDisplayDropdown = false,
|
|
76
64
|
overrideParameters
|
|
77
65
|
} = props;
|
|
78
|
-
const [availableSites, setAvailableSites] = useState(undefined);
|
|
79
66
|
const [currentViewMode, setCurrentViewMode] = useState(viewMode);
|
|
80
67
|
const [cloudId, setCloudId] = useState(initialParameters === null || initialParameters === void 0 ? void 0 : initialParameters.cloudId);
|
|
68
|
+
const {
|
|
69
|
+
availableSites,
|
|
70
|
+
selectedSite: selectedConfluenceSite
|
|
71
|
+
} = useAvailableSites('confluence', cloudId);
|
|
81
72
|
const [searchString, setSearchString] = useState(initialParameters === null || initialParameters === void 0 ? void 0 : initialParameters.searchString);
|
|
82
73
|
const [visibleColumnKeys, setVisibleColumnKeys] = useState(initialVisibleColumnKeys);
|
|
83
74
|
const [contributorAccountIds, setContributorAccountIds] = useState((initialParameters === null || initialParameters === void 0 ? void 0 : initialParameters.contributorAccountIds) || []);
|
|
@@ -131,17 +122,14 @@ export const PlainConfluenceSearchConfigModal = props => {
|
|
|
131
122
|
fireEvent
|
|
132
123
|
} = useDatasourceAnalyticsEvents();
|
|
133
124
|
const hasNoConfluenceSites = availableSites && availableSites.length === 0;
|
|
134
|
-
|
|
135
|
-
if (
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
currentlyLoggedInSiteUrl = window.location.origin;
|
|
141
|
-
}
|
|
142
|
-
return (availableSites === null || availableSites === void 0 ? void 0 : availableSites.find(confluenceSite => confluenceSite.url === currentlyLoggedInSiteUrl)) || (availableSites === null || availableSites === void 0 ? void 0 : availableSites[0]);
|
|
125
|
+
useEffect(() => {
|
|
126
|
+
if (availableSites) {
|
|
127
|
+
fireEvent('ui.modal.ready.datasource', {
|
|
128
|
+
instancesCount: availableSites.length,
|
|
129
|
+
schemasCount: null
|
|
130
|
+
});
|
|
143
131
|
}
|
|
144
|
-
}, [
|
|
132
|
+
}, [fireEvent, availableSites]);
|
|
145
133
|
useEffect(() => {
|
|
146
134
|
fireEvent('screen.datasourceModalDialog.viewed', {});
|
|
147
135
|
}, [fireEvent]);
|
|
@@ -166,18 +154,6 @@ export const PlainConfluenceSearchConfigModal = props => {
|
|
|
166
154
|
shouldForceRequest: true
|
|
167
155
|
});
|
|
168
156
|
}, [reset]);
|
|
169
|
-
useEffect(() => {
|
|
170
|
-
const fetchSiteDisplayNames = async () => {
|
|
171
|
-
const confluenceSites = await getAvailableSites('confluence');
|
|
172
|
-
const sortedAvailableSites = [...confluenceSites].sort((a, b) => a.displayName.localeCompare(b.displayName));
|
|
173
|
-
setAvailableSites(sortedAvailableSites);
|
|
174
|
-
fireEvent('ui.modal.ready.datasource', {
|
|
175
|
-
instancesCount: sortedAvailableSites.length,
|
|
176
|
-
schemasCount: null
|
|
177
|
-
});
|
|
178
|
-
};
|
|
179
|
-
void fetchSiteDisplayNames();
|
|
180
|
-
}, [fireEvent]);
|
|
181
157
|
useEffect(() => {
|
|
182
158
|
const newVisibleColumnKeys = !initialVisibleColumnKeys || (initialVisibleColumnKeys || []).length === 0 ? defaultVisibleColumnKeys : initialVisibleColumnKeys;
|
|
183
159
|
visibleColumnCount.current = newVisibleColumnKeys.length;
|