@atlaskit/link-datasource 2.9.0 → 2.9.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 +8 -0
- package/dist/cjs/ui/common/modal/datasource-modal/createDatasourceModal.js +55 -0
- package/dist/cjs/ui/common/modal/datasources-table-in-modal-preview/index.js +13 -2
- package/dist/cjs/ui/common/modal/insert-button/index.js +5 -4
- package/dist/cjs/ui/confluence-search-modal/modal/index.js +35 -39
- package/dist/cjs/ui/jira-issues-modal/modal/index.js +141 -211
- package/dist/es2019/ui/common/modal/datasource-context/index.js +1 -1
- package/dist/es2019/ui/common/modal/datasource-modal/createDatasourceModal.js +51 -0
- package/dist/es2019/ui/common/modal/datasources-table-in-modal-preview/index.js +9 -2
- package/dist/es2019/ui/common/modal/insert-button/index.js +5 -4
- package/dist/es2019/ui/confluence-search-modal/modal/index.js +35 -39
- package/dist/es2019/ui/jira-issues-modal/modal/index.js +133 -202
- package/dist/esm/ui/common/modal/datasource-modal/createDatasourceModal.js +48 -0
- package/dist/esm/ui/common/modal/datasources-table-in-modal-preview/index.js +10 -2
- package/dist/esm/ui/common/modal/insert-button/index.js +5 -4
- package/dist/esm/ui/confluence-search-modal/modal/index.js +38 -42
- package/dist/esm/ui/jira-issues-modal/modal/index.js +146 -216
- package/dist/types/common/types.d.ts +2 -1
- package/dist/types/ui/common/modal/datasource-context/index.d.ts +9 -12
- package/dist/types/ui/common/modal/datasource-modal/createDatasourceModal.d.ts +15 -0
- package/dist/types/ui/common/modal/insert-button/index.d.ts +4 -2
- package/dist/types/ui/confluence-search-modal/modal/index.d.ts +3 -4
- package/dist/types/ui/confluence-search-modal/types.d.ts +6 -1
- package/dist/types/ui/jira-issues-modal/modal/index.d.ts +3 -3
- package/dist/types/ui/jira-issues-modal/types.d.ts +3 -0
- package/dist/types-ts4.5/common/types.d.ts +2 -1
- package/dist/types-ts4.5/ui/common/modal/datasource-context/index.d.ts +9 -12
- package/dist/types-ts4.5/ui/common/modal/datasource-modal/createDatasourceModal.d.ts +15 -0
- package/dist/types-ts4.5/ui/common/modal/insert-button/index.d.ts +4 -2
- package/dist/types-ts4.5/ui/confluence-search-modal/modal/index.d.ts +3 -4
- package/dist/types-ts4.5/ui/confluence-search-modal/types.d.ts +6 -1
- package/dist/types-ts4.5/ui/jira-issues-modal/modal/index.d.ts +3 -3
- package/dist/types-ts4.5/ui/jira-issues-modal/types.d.ts +3 -0
- package/package.json +1 -1
|
@@ -14,23 +14,20 @@ import { Fragment, useCallback, useEffect, useMemo, useRef, useState } from 'rea
|
|
|
14
14
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
15
15
|
import { jsx } from '@emotion/react';
|
|
16
16
|
import { FormattedMessage } from 'react-intl-next';
|
|
17
|
-
import {
|
|
18
|
-
import Button from '@atlaskit/button/standard-button';
|
|
17
|
+
import { AnalyticsContext } from '@atlaskit/analytics-next';
|
|
19
18
|
import { IntlMessagesProvider } from '@atlaskit/intl-messages-provider';
|
|
20
19
|
import { ModalBody, ModalFooter, ModalHeader, ModalTitle, ModalTransition } from '@atlaskit/modal-dialog';
|
|
21
20
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
22
|
-
import {
|
|
23
|
-
import { componentMetadata } from '../../../analytics/constants';
|
|
21
|
+
import { useDatasourceAnalyticsEvents } from '../../../analytics';
|
|
22
|
+
import { componentMetadata, EVENT_CHANNEL } from '../../../analytics/constants';
|
|
24
23
|
import { DatasourceAction, DatasourceDisplay } from '../../../analytics/types';
|
|
25
24
|
import { startUfoExperience } from '../../../analytics/ufoExperiences';
|
|
26
25
|
import { useColumnPickerRenderedFailedUfoExperience } from '../../../analytics/ufoExperiences/hooks/useColumnPickerRenderedFailedUfoExperience';
|
|
27
26
|
import { useDataRenderedUfoExperience } from '../../../analytics/ufoExperiences/hooks/useDataRenderedUfoExperience';
|
|
28
27
|
import { mapSearchMethod } from '../../../analytics/utils';
|
|
29
|
-
import { buildDatasourceAdf } from '../../../common/utils/adf';
|
|
30
28
|
import { fetchMessagesForLocale } from '../../../common/utils/locale/fetch-messages-for-locale';
|
|
31
29
|
import { DatasourceExperienceIdProvider, useDatasourceExperienceId } from '../../../contexts/datasource-experience-id';
|
|
32
30
|
import { UserInteractionsProvider, useUserInteractions } from '../../../contexts/user-interactions';
|
|
33
|
-
import { useDatasourceTableState } from '../../../hooks/useDatasourceTableState';
|
|
34
31
|
import i18nEN from '../../../i18n/en';
|
|
35
32
|
import { useAvailableSites } from '../../../services/useAvailableSites';
|
|
36
33
|
import { StoreContainer } from '../../../state';
|
|
@@ -44,22 +41,22 @@ import { initialStateViewMessages } from '../../common/initial-state-view/messag
|
|
|
44
41
|
import { CancelButton } from '../../common/modal/cancel-button';
|
|
45
42
|
import { ContentContainer } from '../../common/modal/content-container';
|
|
46
43
|
import { SmartCardPlaceholder, SmartLink } from '../../common/modal/count-view-smart-link';
|
|
44
|
+
import { useDatasourceContext } from '../../common/modal/datasource-context';
|
|
47
45
|
import { DatasourceModal } from '../../common/modal/datasource-modal';
|
|
48
|
-
import {
|
|
49
|
-
import
|
|
46
|
+
import { createDatasourceModal } from '../../common/modal/datasource-modal/createDatasourceModal';
|
|
47
|
+
import DatasourcesTableInModalPreview from '../../common/modal/datasources-table-in-modal-preview';
|
|
48
|
+
import { InsertButton } from '../../common/modal/insert-button';
|
|
50
49
|
import { DatasourceViewModeDropDown } from '../../common/modal/mode-switcher';
|
|
51
|
-
import {
|
|
50
|
+
import { useViewModeContext } from '../../common/modal/mode-switcher/useViewModeContext';
|
|
52
51
|
import TableSearchCount from '../../common/modal/search-count';
|
|
53
52
|
import { SiteSelector } from '../../common/modal/site-selector';
|
|
54
|
-
import { EmptyState
|
|
55
|
-
import { getColumnAction } from '../../issue-like-table/utils';
|
|
53
|
+
import { EmptyState } from '../../issue-like-table';
|
|
56
54
|
import { availableBasicFilterTypes } from '../basic-filters/ui';
|
|
57
55
|
import { isQueryTooComplex } from '../basic-filters/utils/isQueryTooComplex';
|
|
58
56
|
import { JiraSearchContainer } from '../jira-search-container';
|
|
59
57
|
import { JiraInitialStateSVG } from './jira-issues-initial-state-svg';
|
|
60
58
|
import { modalMessages } from './messages';
|
|
61
59
|
import { PlainJiraIssuesConfigModalOld } from './ModalOld';
|
|
62
|
-
var DEFAULT_VIEW_MODE = 'table';
|
|
63
60
|
var getDisplayValue = function getDisplayValue(currentViewMode, itemCount) {
|
|
64
61
|
if (currentViewMode === 'table') {
|
|
65
62
|
return DatasourceDisplay.DATASOURCE_TABLE;
|
|
@@ -67,81 +64,55 @@ var getDisplayValue = function getDisplayValue(currentViewMode, itemCount) {
|
|
|
67
64
|
return itemCount === 1 ? DatasourceDisplay.INLINE : DatasourceDisplay.DATASOURCE_INLINE;
|
|
68
65
|
};
|
|
69
66
|
var jqlSupportDocumentLink = 'https://support.atlassian.com/jira-service-management-cloud/docs/use-advanced-search-with-jira-query-language-jql/';
|
|
67
|
+
var isValidParameters = function isValidParameters(parameters) {
|
|
68
|
+
return typeof (parameters === null || parameters === void 0 ? void 0 : parameters.jql) === 'string' && parameters.jql.length > 0 && typeof (parameters === null || parameters === void 0 ? void 0 : parameters.cloudId) === 'string' && parameters.cloudId.length > 0;
|
|
69
|
+
};
|
|
70
70
|
var PlainJiraIssuesConfigModal = function PlainJiraIssuesConfigModal(props) {
|
|
71
|
-
var
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
71
|
+
var onCancel = props.onCancel,
|
|
72
|
+
urlBeingEdited = props.url;
|
|
73
|
+
var _useDatasourceContext = useDatasourceContext(),
|
|
74
|
+
visibleColumnCount = _useDatasourceContext.visibleColumnCount,
|
|
75
|
+
visibleColumnKeys = _useDatasourceContext.visibleColumnKeys,
|
|
76
|
+
parameters = _useDatasourceContext.parameters,
|
|
77
|
+
setParameters = _useDatasourceContext.setParameters,
|
|
78
|
+
tableState = _useDatasourceContext.tableState;
|
|
79
|
+
var reset = tableState.reset,
|
|
80
|
+
status = tableState.status,
|
|
81
|
+
responseItems = tableState.responseItems,
|
|
82
|
+
columns = tableState.columns,
|
|
83
|
+
totalCount = tableState.totalCount,
|
|
84
|
+
_tableState$extension = tableState.extensionKey,
|
|
85
|
+
extensionKey = _tableState$extension === void 0 ? null : _tableState$extension,
|
|
86
|
+
destinationObjectTypes = tableState.destinationObjectTypes;
|
|
87
|
+
var _ref = parameters !== null && parameters !== void 0 ? parameters : {},
|
|
88
|
+
cloudId = _ref.cloudId,
|
|
89
|
+
jql = _ref.jql;
|
|
90
|
+
var _useState = useState(jql),
|
|
91
|
+
_useState2 = _slicedToArray(_useState, 1),
|
|
92
|
+
initialJql = _useState2[0];
|
|
79
93
|
var _useViewModeContext = useViewModeContext(),
|
|
80
94
|
currentViewMode = _useViewModeContext.currentViewMode;
|
|
81
|
-
var _useState = useState(initialParameters === null || initialParameters === void 0 ? void 0 : initialParameters.cloudId),
|
|
82
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
83
|
-
cloudId = _useState2[0],
|
|
84
|
-
setCloudId = _useState2[1];
|
|
85
95
|
var _useAvailableSites = useAvailableSites('jira', cloudId),
|
|
86
96
|
availableSites = _useAvailableSites.availableSites,
|
|
87
97
|
selectedJiraSite = _useAvailableSites.selectedSite;
|
|
88
|
-
var _useState3 = useState(
|
|
98
|
+
var _useState3 = useState(jql),
|
|
89
99
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
var _useState5 = useState(initialParameters === null || initialParameters === void 0 ? void 0 : initialParameters.jql),
|
|
93
|
-
_useState6 = _slicedToArray(_useState5, 2),
|
|
94
|
-
searchBarJql = _useState6[0],
|
|
95
|
-
setSearchBarJql = _useState6[1];
|
|
96
|
-
var _useState7 = useState(initialVisibleColumnKeys),
|
|
97
|
-
_useState8 = _slicedToArray(_useState7, 2),
|
|
98
|
-
visibleColumnKeys = _useState8[0],
|
|
99
|
-
setVisibleColumnKeys = _useState8[1];
|
|
100
|
+
searchBarJql = _useState4[0],
|
|
101
|
+
setSearchBarJql = _useState4[1];
|
|
100
102
|
|
|
101
103
|
// analytics related parameters
|
|
102
104
|
var searchCount = useRef(0);
|
|
103
105
|
var userInteractions = useUserInteractions();
|
|
104
106
|
var initialSearchMethod =
|
|
105
107
|
// eslint-disable-next-line @atlaskit/platform/no-preconditioning
|
|
106
|
-
fg('platform.linking-platform.datasource.show-jlol-basic-filters') && !isQueryTooComplex(
|
|
107
|
-
var
|
|
108
|
-
|
|
109
|
-
currentSearchMethod =
|
|
110
|
-
setCurrentSearchMethod =
|
|
108
|
+
fg('platform.linking-platform.datasource.show-jlol-basic-filters') && !isQueryTooComplex(initialJql || '') ? 'basic' : 'jql';
|
|
109
|
+
var _useState5 = useState(initialSearchMethod),
|
|
110
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
111
|
+
currentSearchMethod = _useState6[0],
|
|
112
|
+
setCurrentSearchMethod = _useState6[1];
|
|
111
113
|
var searchMethodSearchedWith = useRef(null);
|
|
112
|
-
var visibleColumnCount = useRef((visibleColumnKeys === null || visibleColumnKeys === void 0 ? void 0 : visibleColumnKeys.length) || 0);
|
|
113
114
|
var basicFilterSelectionsSearchedWith = useRef({});
|
|
114
115
|
var isSearchedWithComplexQuery = useRef(false);
|
|
115
|
-
var parameters = useMemo(function () {
|
|
116
|
-
return !!cloudId ? {
|
|
117
|
-
cloudId: cloudId,
|
|
118
|
-
jql: jql || ''
|
|
119
|
-
} : undefined;
|
|
120
|
-
}, [cloudId, jql]);
|
|
121
|
-
var isParametersSet = !!(jql && cloudId);
|
|
122
|
-
var _useColumnResize = useColumnResize(initialColumnCustomSizes),
|
|
123
|
-
columnCustomSizes = _useColumnResize.columnCustomSizes,
|
|
124
|
-
onColumnResize = _useColumnResize.onColumnResize;
|
|
125
|
-
var _useColumnWrapping = useColumnWrapping(initialWrappedColumnKeys),
|
|
126
|
-
wrappedColumnKeys = _useColumnWrapping.wrappedColumnKeys,
|
|
127
|
-
onWrappedColumnChange = _useColumnWrapping.onWrappedColumnChange;
|
|
128
|
-
var _useDatasourceTableSt = useDatasourceTableState({
|
|
129
|
-
datasourceId: datasourceId,
|
|
130
|
-
parameters: isParametersSet ? parameters : undefined,
|
|
131
|
-
fieldKeys: visibleColumnKeys
|
|
132
|
-
}),
|
|
133
|
-
reset = _useDatasourceTableSt.reset,
|
|
134
|
-
status = _useDatasourceTableSt.status,
|
|
135
|
-
onNextPage = _useDatasourceTableSt.onNextPage,
|
|
136
|
-
responseItems = _useDatasourceTableSt.responseItems,
|
|
137
|
-
hasNextPage = _useDatasourceTableSt.hasNextPage,
|
|
138
|
-
columns = _useDatasourceTableSt.columns,
|
|
139
|
-
defaultVisibleColumnKeys = _useDatasourceTableSt.defaultVisibleColumnKeys,
|
|
140
|
-
loadDatasourceDetails = _useDatasourceTableSt.loadDatasourceDetails,
|
|
141
|
-
totalCount = _useDatasourceTableSt.totalCount,
|
|
142
|
-
_useDatasourceTableSt2 = _useDatasourceTableSt.extensionKey,
|
|
143
|
-
extensionKey = _useDatasourceTableSt2 === void 0 ? null : _useDatasourceTableSt2,
|
|
144
|
-
destinationObjectTypes = _useDatasourceTableSt.destinationObjectTypes;
|
|
145
116
|
var _useDatasourceAnalyti = useDatasourceAnalyticsEvents(),
|
|
146
117
|
fireEvent = _useDatasourceAnalyti.fireEvent;
|
|
147
118
|
var experienceId = useDatasourceExperienceId();
|
|
@@ -153,7 +124,6 @@ var PlainJiraIssuesConfigModal = function PlainJiraIssuesConfigModal(props) {
|
|
|
153
124
|
}, [destinationObjectTypes, extensionKey]);
|
|
154
125
|
var resolvedWithNoResults = status === 'resolved' && !responseItems.length;
|
|
155
126
|
var jqlUrl = selectedJiraSite && jql && "".concat(selectedJiraSite.url, "/issues/?jql=").concat(encodeURI(jql));
|
|
156
|
-
var isInsertDisabled = !isParametersSet || status === 'rejected' || status === 'unauthorized' || status === 'loading';
|
|
157
127
|
var shouldShowIssueCount = !!totalCount && totalCount !== 1 && currentViewMode === 'table';
|
|
158
128
|
var isDataReady = (visibleColumnKeys || []).length > 0;
|
|
159
129
|
var hasNoJiraSites = availableSites && availableSites.length === 0;
|
|
@@ -180,16 +150,21 @@ var PlainJiraIssuesConfigModal = function PlainJiraIssuesConfigModal(props) {
|
|
|
180
150
|
canBeLink: currentViewMode === 'inline',
|
|
181
151
|
extensionKey: extensionKey
|
|
182
152
|
});
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* If the selected Jira site changes, update the cloudId in the parameters
|
|
156
|
+
* This is mainly useful for setting the initial cloudId after the site selection loads
|
|
157
|
+
*/
|
|
188
158
|
useEffect(function () {
|
|
189
159
|
if (selectedJiraSite && (!cloudId || cloudId !== selectedJiraSite.cloudId)) {
|
|
190
|
-
|
|
160
|
+
setParameters(function () {
|
|
161
|
+
return {
|
|
162
|
+
jql: '',
|
|
163
|
+
cloudId: selectedJiraSite.cloudId
|
|
164
|
+
};
|
|
165
|
+
});
|
|
191
166
|
}
|
|
192
|
-
}, [cloudId, selectedJiraSite]);
|
|
167
|
+
}, [cloudId, selectedJiraSite, setParameters]);
|
|
193
168
|
var fireSingleItemViewedEvent = useCallback(function () {
|
|
194
169
|
fireEvent('ui.link.viewed.singleItem', _objectSpread(_objectSpread({}, analyticsPayload), {}, {
|
|
195
170
|
searchMethod: mapSearchMethod(searchMethodSearchedWith.current)
|
|
@@ -209,7 +184,7 @@ var PlainJiraIssuesConfigModal = function PlainJiraIssuesConfigModal(props) {
|
|
|
209
184
|
displayedColumnCount: visibleColumnCount.current
|
|
210
185
|
}));
|
|
211
186
|
}
|
|
212
|
-
}, [
|
|
187
|
+
}, [isDataReady, fireEvent, analyticsPayload, totalCount, visibleColumnCount]);
|
|
213
188
|
var fireIssueViewAnalytics = useCallback(function () {
|
|
214
189
|
if (!totalCount) {
|
|
215
190
|
return;
|
|
@@ -234,10 +209,10 @@ var PlainJiraIssuesConfigModal = function PlainJiraIssuesConfigModal(props) {
|
|
|
234
209
|
}
|
|
235
210
|
}, [currentViewMode, status, fireIssueViewAnalytics, fireCountViewedEvent]);
|
|
236
211
|
useColumnPickerRenderedFailedUfoExperience(status, experienceId);
|
|
237
|
-
var onSearch = useCallback(function (newParameters,
|
|
238
|
-
var searchMethod =
|
|
239
|
-
basicFilterSelections =
|
|
240
|
-
isQueryComplex =
|
|
212
|
+
var onSearch = useCallback(function (newParameters, _ref2) {
|
|
213
|
+
var searchMethod = _ref2.searchMethod,
|
|
214
|
+
basicFilterSelections = _ref2.basicFilterSelections,
|
|
215
|
+
isQueryComplex = _ref2.isQueryComplex;
|
|
241
216
|
searchCount.current++;
|
|
242
217
|
searchMethodSearchedWith.current = searchMethod;
|
|
243
218
|
basicFilterSelectionsSearchedWith.current = basicFilterSelections;
|
|
@@ -245,19 +220,26 @@ var PlainJiraIssuesConfigModal = function PlainJiraIssuesConfigModal(props) {
|
|
|
245
220
|
if (jql !== newParameters.jql) {
|
|
246
221
|
userInteractions.add(DatasourceAction.QUERY_UPDATED);
|
|
247
222
|
}
|
|
248
|
-
|
|
223
|
+
setParameters(function (state) {
|
|
224
|
+
return state && newParameters.jql ? {
|
|
225
|
+
cloudId: state.cloudId,
|
|
226
|
+
jql: newParameters.jql
|
|
227
|
+
} : undefined;
|
|
228
|
+
});
|
|
249
229
|
reset({
|
|
250
230
|
shouldForceRequest: true
|
|
251
231
|
});
|
|
252
|
-
}, [jql, reset, userInteractions]);
|
|
232
|
+
}, [jql, reset, userInteractions, setParameters]);
|
|
253
233
|
var onSiteSelection = useCallback(function (site) {
|
|
254
234
|
userInteractions.add(DatasourceAction.INSTANCE_UPDATED);
|
|
255
|
-
|
|
256
|
-
|
|
235
|
+
setParameters({
|
|
236
|
+
jql: '',
|
|
237
|
+
cloudId: site.cloudId
|
|
238
|
+
});
|
|
257
239
|
reset({
|
|
258
240
|
shouldForceRequest: true
|
|
259
241
|
});
|
|
260
|
-
}, [reset, userInteractions]);
|
|
242
|
+
}, [reset, userInteractions, setParameters]);
|
|
261
243
|
var retrieveUrlForSmartCardRender = useCallback(function () {
|
|
262
244
|
var _data$key;
|
|
263
245
|
var _responseItems = _slicedToArray(responseItems, 1),
|
|
@@ -265,120 +247,6 @@ var PlainJiraIssuesConfigModal = function PlainJiraIssuesConfigModal(props) {
|
|
|
265
247
|
// agreement with BE that we will use `key` for rendering smartlink
|
|
266
248
|
return data === null || data === void 0 || (_data$key = data.key) === null || _data$key === void 0 || (_data$key = _data$key.data) === null || _data$key === void 0 ? void 0 : _data$key.url;
|
|
267
249
|
}, [responseItems]);
|
|
268
|
-
var onInsertPressed = useCallback(function (e, analyticsEvent) {
|
|
269
|
-
var _insertButtonClickedE;
|
|
270
|
-
if (!isParametersSet || !jql || !selectedJiraSite) {
|
|
271
|
-
return;
|
|
272
|
-
}
|
|
273
|
-
|
|
274
|
-
// During insertion, we want the JQL of the datasource to be whatever is in the search bar,
|
|
275
|
-
// even if the user didn't previously click search
|
|
276
|
-
var upToDateJql = searchBarJql !== null && searchBarJql !== void 0 ? searchBarJql : jql;
|
|
277
|
-
var upToDateJqlUrl = selectedJiraSite && jql && "".concat(selectedJiraSite.url, "/issues/?jql=").concat(encodeURIComponent(upToDateJql));
|
|
278
|
-
var filterSelectionCount = availableBasicFilterTypes.reduce(function (current, filter) {
|
|
279
|
-
var _basicFilterSelection;
|
|
280
|
-
return _objectSpread(_objectSpread({}, current), {}, _defineProperty({}, "".concat(filter, "BasicFilterSelectionCount"), ((_basicFilterSelection = basicFilterSelectionsSearchedWith.current[filter]) === null || _basicFilterSelection === void 0 ? void 0 : _basicFilterSelection.length) || 0));
|
|
281
|
-
}, {});
|
|
282
|
-
var insertButtonClickedEvent = analyticsEvent.update({
|
|
283
|
-
actionSubjectId: 'insert',
|
|
284
|
-
attributes: _objectSpread(_objectSpread({}, analyticsPayload), {}, {
|
|
285
|
-
totalItemCount: totalCount || 0,
|
|
286
|
-
displayedColumnCount: visibleColumnCount.current,
|
|
287
|
-
display: getDisplayValue(currentViewMode, totalCount || 0),
|
|
288
|
-
searchCount: searchCount.current,
|
|
289
|
-
searchMethod: mapSearchMethod(searchMethodSearchedWith.current),
|
|
290
|
-
actions: userInteractions.get(),
|
|
291
|
-
isQueryComplex: isSearchedWithComplexQuery.current
|
|
292
|
-
}, searchMethodSearchedWith.current === 'basic' ? _objectSpread({}, filterSelectionCount) : {}),
|
|
293
|
-
eventType: 'ui'
|
|
294
|
-
});
|
|
295
|
-
|
|
296
|
-
// additional event for tracking in confluence against JIM
|
|
297
|
-
var macroInsertedEvent = analyticsEvent.clone();
|
|
298
|
-
macroInsertedEvent === null || macroInsertedEvent === void 0 || macroInsertedEvent.update({
|
|
299
|
-
eventType: 'track',
|
|
300
|
-
action: 'inserted',
|
|
301
|
-
actionSubject: 'macro',
|
|
302
|
-
actionSubjectId: 'jlol',
|
|
303
|
-
attributes: _objectSpread(_objectSpread({}, analyticsPayload), {}, {
|
|
304
|
-
totalItemCount: totalCount || 0,
|
|
305
|
-
displayedColumnCount: visibleColumnCount.current,
|
|
306
|
-
display: getDisplayValue(currentViewMode, totalCount || 0),
|
|
307
|
-
searchCount: searchCount.current,
|
|
308
|
-
searchMethod: mapSearchMethod(searchMethodSearchedWith.current),
|
|
309
|
-
actions: userInteractions.get()
|
|
310
|
-
})
|
|
311
|
-
});
|
|
312
|
-
var consumerEvent = (_insertButtonClickedE = insertButtonClickedEvent.clone()) !== null && _insertButtonClickedE !== void 0 ? _insertButtonClickedE : undefined;
|
|
313
|
-
insertButtonClickedEvent.fire(EVENT_CHANNEL);
|
|
314
|
-
var firstIssueUrl = retrieveUrlForSmartCardRender();
|
|
315
|
-
if (currentViewMode === 'inline') {
|
|
316
|
-
macroInsertedEvent === null || macroInsertedEvent === void 0 || macroInsertedEvent.fire(EVENT_CHANNEL);
|
|
317
|
-
var url = responseItems.length === 1 ? firstIssueUrl : upToDateJqlUrl;
|
|
318
|
-
onInsert({
|
|
319
|
-
type: 'inlineCard',
|
|
320
|
-
attrs: {
|
|
321
|
-
url: url
|
|
322
|
-
}
|
|
323
|
-
}, consumerEvent);
|
|
324
|
-
} else {
|
|
325
|
-
onInsert(buildDatasourceAdf({
|
|
326
|
-
id: datasourceId,
|
|
327
|
-
parameters: {
|
|
328
|
-
cloudId: cloudId,
|
|
329
|
-
jql: upToDateJql // TODO support non JQL type
|
|
330
|
-
},
|
|
331
|
-
views: [{
|
|
332
|
-
type: 'table',
|
|
333
|
-
properties: {
|
|
334
|
-
columns: (visibleColumnKeys || []).map(function (key) {
|
|
335
|
-
var width = columnCustomSizes === null || columnCustomSizes === void 0 ? void 0 : columnCustomSizes[key];
|
|
336
|
-
var isWrapped = wrappedColumnKeys === null || wrappedColumnKeys === void 0 ? void 0 : wrappedColumnKeys.includes(key);
|
|
337
|
-
return _objectSpread(_objectSpread({
|
|
338
|
-
key: key
|
|
339
|
-
}, width ? {
|
|
340
|
-
width: width
|
|
341
|
-
} : {}), isWrapped ? {
|
|
342
|
-
isWrapped: isWrapped
|
|
343
|
-
} : {});
|
|
344
|
-
})
|
|
345
|
-
}
|
|
346
|
-
}]
|
|
347
|
-
}, upToDateJqlUrl), consumerEvent);
|
|
348
|
-
}
|
|
349
|
-
}, [isParametersSet, jql, selectedJiraSite, searchBarJql, analyticsPayload, totalCount, currentViewMode, retrieveUrlForSmartCardRender, responseItems.length, onInsert, datasourceId, cloudId, visibleColumnKeys, columnCustomSizes, wrappedColumnKeys, userInteractions]);
|
|
350
|
-
var handleOnNextPage = useCallback(function () {
|
|
351
|
-
var onNextPageProps = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
352
|
-
userInteractions.add(DatasourceAction.NEXT_PAGE_SCROLLED);
|
|
353
|
-
onNextPage(onNextPageProps);
|
|
354
|
-
}, [onNextPage, userInteractions]);
|
|
355
|
-
var handleVisibleColumnKeysChange = useCallback(function () {
|
|
356
|
-
var newVisibleColumnKeys = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
357
|
-
var columnAction = getColumnAction(visibleColumnKeys || [], newVisibleColumnKeys);
|
|
358
|
-
userInteractions.add(columnAction);
|
|
359
|
-
visibleColumnCount.current = newVisibleColumnKeys.length;
|
|
360
|
-
setVisibleColumnKeys(newVisibleColumnKeys);
|
|
361
|
-
}, [visibleColumnKeys, userInteractions]);
|
|
362
|
-
var issueLikeDataTableView = useMemo(function () {
|
|
363
|
-
return jsx(ContentContainer, {
|
|
364
|
-
withTableBorder: true
|
|
365
|
-
}, jsx(IssueLikeDataTableView, {
|
|
366
|
-
testId: "jira-datasource-table",
|
|
367
|
-
status: status,
|
|
368
|
-
columns: columns,
|
|
369
|
-
items: responseItems,
|
|
370
|
-
hasNextPage: hasNextPage,
|
|
371
|
-
visibleColumnKeys: visibleColumnKeys || defaultVisibleColumnKeys,
|
|
372
|
-
onNextPage: handleOnNextPage,
|
|
373
|
-
onLoadDatasourceDetails: loadDatasourceDetails,
|
|
374
|
-
onVisibleColumnKeysChange: handleVisibleColumnKeysChange,
|
|
375
|
-
extensionKey: extensionKey,
|
|
376
|
-
columnCustomSizes: columnCustomSizes,
|
|
377
|
-
onColumnResize: onColumnResize,
|
|
378
|
-
wrappedColumnKeys: wrappedColumnKeys,
|
|
379
|
-
onWrappedColumnChange: fg('platform.linking-platform.datasource-word_wrap') ? onWrappedColumnChange : undefined
|
|
380
|
-
}));
|
|
381
|
-
}, [status, columns, responseItems, hasNextPage, visibleColumnKeys, defaultVisibleColumnKeys, handleOnNextPage, loadDatasourceDetails, handleVisibleColumnKeysChange, extensionKey, columnCustomSizes, onColumnResize, wrappedColumnKeys, onWrappedColumnChange]);
|
|
382
250
|
var renderCountModeContent = useCallback(function () {
|
|
383
251
|
var selectedJiraSiteUrl = selectedJiraSite === null || selectedJiraSite === void 0 ? void 0 : selectedJiraSite.url;
|
|
384
252
|
if (status === 'unauthorized') {
|
|
@@ -438,8 +306,12 @@ var PlainJiraIssuesConfigModal = function PlainJiraIssuesConfigModal(props) {
|
|
|
438
306
|
} : undefined
|
|
439
307
|
}));
|
|
440
308
|
}
|
|
441
|
-
return
|
|
442
|
-
|
|
309
|
+
return jsx(ContentContainer, {
|
|
310
|
+
withTableBorder: true
|
|
311
|
+
}, jsx(DatasourcesTableInModalPreview, {
|
|
312
|
+
testId: "jira-datasource-table"
|
|
313
|
+
}));
|
|
314
|
+
}, [columns.length, currentSearchMethod, jql, jqlUrl, resolvedWithNoResults, selectedJiraSite === null || selectedJiraSite === void 0 ? void 0 : selectedJiraSite.url, status, urlBeingEdited]);
|
|
443
315
|
var siteSelectorLabel = availableSites && availableSites.length > 1 ? modalMessages.insertIssuesTitleManySites : modalMessages.insertIssuesTitle;
|
|
444
316
|
var getCancelButtonAnalyticsPayload = useCallback(function () {
|
|
445
317
|
return _objectSpread(_objectSpread({}, analyticsPayload), {}, {
|
|
@@ -447,6 +319,38 @@ var PlainJiraIssuesConfigModal = function PlainJiraIssuesConfigModal(props) {
|
|
|
447
319
|
actions: userInteractions.get()
|
|
448
320
|
});
|
|
449
321
|
}, [analyticsPayload, userInteractions]);
|
|
322
|
+
var filterSelectionCount = availableBasicFilterTypes.reduce(function (current, filter) {
|
|
323
|
+
var _basicFilterSelection;
|
|
324
|
+
return _objectSpread(_objectSpread({}, current), {}, _defineProperty({}, "".concat(filter, "BasicFilterSelectionCount"), ((_basicFilterSelection = basicFilterSelectionsSearchedWith.current[filter]) === null || _basicFilterSelection === void 0 ? void 0 : _basicFilterSelection.length) || 0));
|
|
325
|
+
}, {});
|
|
326
|
+
var getInsertButtonAnalyticsPayload = useCallback(function () {
|
|
327
|
+
return _objectSpread(_objectSpread({}, analyticsPayload), {}, {
|
|
328
|
+
display: getDisplayValue(currentViewMode, totalCount || 0),
|
|
329
|
+
isQueryComplex: isSearchedWithComplexQuery.current,
|
|
330
|
+
searchMethod: mapSearchMethod(searchMethodSearchedWith.current),
|
|
331
|
+
searchCount: searchCount.current,
|
|
332
|
+
actions: userInteractions.get()
|
|
333
|
+
}, searchMethodSearchedWith.current === 'basic' ? _objectSpread({}, filterSelectionCount) : {});
|
|
334
|
+
}, [analyticsPayload, currentViewMode, filterSelectionCount, totalCount, userInteractions]);
|
|
335
|
+
var urlToInsert = useMemo(function () {
|
|
336
|
+
var jql = parameters === null || parameters === void 0 ? void 0 : parameters.jql;
|
|
337
|
+
if (!jql || !(selectedJiraSite !== null && selectedJiraSite !== void 0 && selectedJiraSite.url)) {
|
|
338
|
+
return;
|
|
339
|
+
}
|
|
340
|
+
// During insertion, we want the JQL of the datasource to be whatever is in the search bar,
|
|
341
|
+
// even if the user didn't previously click search
|
|
342
|
+
var upToDateJql = searchBarJql !== null && searchBarJql !== void 0 ? searchBarJql : jql;
|
|
343
|
+
var upToDateJqlUrl = "".concat(selectedJiraSite.url, "/issues/?jql=").concat(encodeURIComponent(upToDateJql));
|
|
344
|
+
return currentViewMode === 'inline' && responseItems.length === 1 ? retrieveUrlForSmartCardRender() : upToDateJqlUrl;
|
|
345
|
+
}, [currentViewMode, parameters === null || parameters === void 0 ? void 0 : parameters.jql, responseItems, retrieveUrlForSmartCardRender, searchBarJql, selectedJiraSite === null || selectedJiraSite === void 0 ? void 0 : selectedJiraSite.url]);
|
|
346
|
+
var updateParametersBeforeInsert = function updateParametersBeforeInsert(parameters) {
|
|
347
|
+
return {
|
|
348
|
+
cloudId: parameters.cloudId,
|
|
349
|
+
// searchBarJql will not be null at this point, since this function is only called when user press insert button
|
|
350
|
+
//
|
|
351
|
+
jql: searchBarJql || ''
|
|
352
|
+
};
|
|
353
|
+
};
|
|
450
354
|
return jsx(IntlMessagesProvider, {
|
|
451
355
|
defaultMessages: i18nEN,
|
|
452
356
|
loaderFn: fetchMessagesForLocale
|
|
@@ -481,11 +385,11 @@ var PlainJiraIssuesConfigModal = function PlainJiraIssuesConfigModal(props) {
|
|
|
481
385
|
onCancel: onCancel,
|
|
482
386
|
getAnalyticsPayload: getCancelButtonAnalyticsPayload,
|
|
483
387
|
testId: "jira-datasource-modal--cancel-button"
|
|
484
|
-
}), !hasNoJiraSites && jsx(
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
388
|
+
}), !hasNoJiraSites && jsx(InsertButton, {
|
|
389
|
+
testId: "jira-datasource-modal--insert-button",
|
|
390
|
+
url: urlToInsert,
|
|
391
|
+
overwriteParameters: updateParametersBeforeInsert,
|
|
392
|
+
getAnalyticsPayload: getInsertButtonAnalyticsPayload
|
|
489
393
|
}, jsx(FormattedMessage, modalMessages.insertIssuesButtonText))))));
|
|
490
394
|
};
|
|
491
395
|
var analyticsContextAttributes = {
|
|
@@ -497,9 +401,35 @@ var analyticsContextData = _objectSpread(_objectSpread({}, componentMetadata.con
|
|
|
497
401
|
var contextData = _objectSpread(_objectSpread({}, analyticsContextData), {}, {
|
|
498
402
|
attributes: _objectSpread({}, analyticsContextAttributes)
|
|
499
403
|
});
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
404
|
+
var ConnectedJiraIssueConfigModal = createDatasourceModal({
|
|
405
|
+
isValidParameters: isValidParameters,
|
|
406
|
+
dataProvider: 'jira-issues',
|
|
407
|
+
component: PlainJiraIssuesConfigModal
|
|
408
|
+
});
|
|
409
|
+
var JiraIssuesConfigModalWithExtraAnalyticsOnInsert = function JiraIssuesConfigModalWithExtraAnalyticsOnInsert(props) {
|
|
410
|
+
var onInsert = props.onInsert;
|
|
411
|
+
var onInsertWithMacroAnalytics = useCallback(function (adf, analyticsEvent) {
|
|
412
|
+
if (analyticsEvent && adf.type === 'inlineCard') {
|
|
413
|
+
var macroInsertedEvent = analyticsEvent.clone();
|
|
414
|
+
macroInsertedEvent === null || macroInsertedEvent === void 0 || macroInsertedEvent.update({
|
|
415
|
+
eventType: 'track',
|
|
416
|
+
action: 'inserted',
|
|
417
|
+
actionSubject: 'macro',
|
|
418
|
+
actionSubjectId: 'jlol'
|
|
419
|
+
});
|
|
420
|
+
macroInsertedEvent === null || macroInsertedEvent === void 0 || macroInsertedEvent.fire(EVENT_CHANNEL);
|
|
421
|
+
}
|
|
422
|
+
onInsert(adf, analyticsEvent);
|
|
423
|
+
}, [onInsert]);
|
|
424
|
+
return jsx(StoreContainer, null, jsx(ConnectedJiraIssueConfigModal, _extends({}, props, {
|
|
425
|
+
onInsert: onInsertWithMacroAnalytics
|
|
426
|
+
})));
|
|
427
|
+
};
|
|
428
|
+
export var JiraIssuesConfigModal = function JiraIssuesConfigModal(props) {
|
|
429
|
+
if (fg('platform-datasources-use-refactored-config-modal')) {
|
|
430
|
+
return jsx(JiraIssuesConfigModalWithExtraAnalyticsOnInsert, props);
|
|
431
|
+
}
|
|
432
|
+
return jsx(StoreContainer, null, jsx(AnalyticsContext, {
|
|
433
|
+
data: contextData
|
|
434
|
+
}, jsx(DatasourceExperienceIdProvider, null, jsx(UserInteractionsProvider, null, jsx(PlainJiraIssuesConfigModalOld, props)))));
|
|
435
|
+
};
|
|
@@ -7,6 +7,7 @@ export interface Site {
|
|
|
7
7
|
url: string;
|
|
8
8
|
}
|
|
9
9
|
export type DisplayViewModes = 'table' | 'inline';
|
|
10
|
+
export type OnInsertFunction<ADF> = (adf: ADF, analyticsEvent?: UIAnalyticsEvent) => void;
|
|
10
11
|
export type ConfigModalProps<ADF, Parameters> = {
|
|
11
12
|
/** Unique identifier for which type of datasource is being rendered and for making its requests */
|
|
12
13
|
datasourceId: string;
|
|
@@ -17,7 +18,7 @@ export type ConfigModalProps<ADF, Parameters> = {
|
|
|
17
18
|
/** Callback function to be invoked when the modal is closed either via cancel button click, esc keydown, or modal blanket click */
|
|
18
19
|
onCancel: () => void;
|
|
19
20
|
/** Callback function to be invoked when the insert issues button is clicked */
|
|
20
|
-
onInsert:
|
|
21
|
+
onInsert: OnInsertFunction<ADF>;
|
|
21
22
|
/**
|
|
22
23
|
* The view mode that the modal will show on open:
|
|
23
24
|
* - Table = Displays a list of links in table format
|
|
@@ -1,30 +1,27 @@
|
|
|
1
1
|
import React, { type PropsWithChildren } from 'react';
|
|
2
|
-
import { type UIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
3
2
|
import { type DatasourceAdf, type InlineCardAdf } from '@atlaskit/linking-common';
|
|
4
3
|
import type { DatasourceParameters } from '@atlaskit/linking-types';
|
|
4
|
+
import { type OnInsertFunction } from '../../../../common/types';
|
|
5
5
|
import { type DatasourceTableState } from '../../../../hooks/useDatasourceTableState';
|
|
6
6
|
import type { ColumnSizesMap } from '../../../issue-like-table/types';
|
|
7
7
|
import { type ColumnResizeProps } from '../datasources-table-in-modal-preview/use-column-resize';
|
|
8
8
|
import { type ColumnVisibilityProps } from '../datasources-table-in-modal-preview/use-column-visibility';
|
|
9
9
|
import { type ColumnWrappingProps } from '../datasources-table-in-modal-preview/use-column-wrapping';
|
|
10
|
-
type
|
|
11
|
-
datasourceId: string;
|
|
12
|
-
isValidParameters: (params: DatasourceParameters | undefined) => boolean;
|
|
10
|
+
type DatasourceContextValue<Parameters extends DatasourceParameters = DatasourceParameters> = ColumnVisibilityProps & ColumnWrappingProps & ColumnResizeProps & Pick<DatasourceContextProviderProps<Parameters>, 'datasourceId' | 'onInsert' | 'isValidParameters'> & {
|
|
13
11
|
tableState: DatasourceTableState;
|
|
14
12
|
visibleColumnKeys?: string[];
|
|
15
|
-
parameters:
|
|
16
|
-
setParameters: React.Dispatch<React.SetStateAction<
|
|
17
|
-
onInsert: (adf: InlineCardAdf | DatasourceAdf<any>, analyticsEvent?: UIAnalyticsEvent) => void;
|
|
13
|
+
parameters: Parameters | undefined;
|
|
14
|
+
setParameters: React.Dispatch<React.SetStateAction<Parameters | undefined>>;
|
|
18
15
|
};
|
|
19
|
-
|
|
16
|
+
type DatasourceContextProviderProps<Parameters extends DatasourceParameters> = PropsWithChildren<{
|
|
20
17
|
datasourceId: string;
|
|
21
18
|
isValidParameters: (params: DatasourceParameters | undefined) => boolean;
|
|
22
|
-
initialParameters:
|
|
19
|
+
initialParameters: Parameters | undefined;
|
|
23
20
|
initialVisibleColumnKeys?: string[] | undefined;
|
|
24
21
|
initialWrappedColumnKeys?: string[] | undefined;
|
|
25
22
|
initialColumnCustomSizes?: ColumnSizesMap | undefined;
|
|
26
|
-
onInsert:
|
|
23
|
+
onInsert: OnInsertFunction<InlineCardAdf | DatasourceAdf<Parameters>>;
|
|
27
24
|
}>;
|
|
28
|
-
export declare const DatasourceContextProvider: ({ children, datasourceId, isValidParameters, initialParameters, initialVisibleColumnKeys, initialColumnCustomSizes, initialWrappedColumnKeys, onInsert, }:
|
|
29
|
-
export declare const useDatasourceContext: () =>
|
|
25
|
+
export declare const DatasourceContextProvider: <Parameters extends DatasourceParameters>({ children, datasourceId, isValidParameters, initialParameters, initialVisibleColumnKeys, initialColumnCustomSizes, initialWrappedColumnKeys, onInsert, }: DatasourceContextProviderProps<Parameters>) => JSX.Element;
|
|
26
|
+
export declare const useDatasourceContext: <Parameters extends DatasourceParameters>() => DatasourceContextValue<Parameters>;
|
|
30
27
|
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @jsxRuntime classic
|
|
3
|
+
* @jsx jsx
|
|
4
|
+
*/
|
|
5
|
+
import React from 'react';
|
|
6
|
+
import { jsx } from '@emotion/react';
|
|
7
|
+
import { type DatasourceAdf, type InlineCardAdf } from '@atlaskit/linking-common';
|
|
8
|
+
import { type DatasourceParameters } from '@atlaskit/linking-types';
|
|
9
|
+
import { type ConfigModalProps } from '../../../../common/types';
|
|
10
|
+
export type ConnectedConfigModalProps<Parameters extends DatasourceParameters> = Omit<ConfigModalProps<DatasourceAdf<Parameters> | InlineCardAdf, Parameters>, 'onInsert' | 'parameters'>;
|
|
11
|
+
export declare const createDatasourceModal: <Parameters extends DatasourceParameters>({ isValidParameters, dataProvider, component: ModalContent, }: {
|
|
12
|
+
isValidParameters: (params: DatasourceParameters | undefined) => boolean;
|
|
13
|
+
dataProvider: string;
|
|
14
|
+
component: React.ComponentType<ConnectedConfigModalProps<Parameters>>;
|
|
15
|
+
}) => (props: ConfigModalProps<DatasourceAdf<Parameters> | InlineCardAdf, DatasourceParameters | Parameters>) => jsx.JSX.Element;
|
|
@@ -4,9 +4,11 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { type PropsWithChildren } from 'react';
|
|
6
6
|
import { jsx } from '@emotion/react';
|
|
7
|
-
|
|
7
|
+
import { type DatasourceParameters } from '@atlaskit/linking-types';
|
|
8
|
+
export type InsertButtonProps<Parameters extends DatasourceParameters> = PropsWithChildren<{
|
|
8
9
|
testId: string;
|
|
9
10
|
url: string | undefined;
|
|
10
11
|
getAnalyticsPayload: () => Record<string, any>;
|
|
12
|
+
overwriteParameters?: (parameters: Parameters) => Parameters;
|
|
11
13
|
}>;
|
|
12
|
-
export declare const InsertButton: ({ testId, url, getAnalyticsPayload, children }: InsertButtonProps) => jsx.JSX.Element;
|
|
14
|
+
export declare const InsertButton: <Parameters extends DatasourceParameters>({ testId, url, getAnalyticsPayload, overwriteParameters, children, }: InsertButtonProps<Parameters>) => jsx.JSX.Element;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { jsx } from '@emotion/react';
|
|
3
|
-
import { type ConfluenceSearchConfigModalProps } from '../types';
|
|
4
|
-
export declare const PlainConfluenceSearchConfigModal: (props:
|
|
5
|
-
export declare const ConfluenceSearchConfigModal:
|
|
2
|
+
import { type ConfluenceSearchConfigModalProps, type ConnectedConfluenceSearchConfigModalProps } from '../types';
|
|
3
|
+
export declare const PlainConfluenceSearchConfigModal: (props: ConnectedConfluenceSearchConfigModalProps) => jsx.JSX.Element;
|
|
4
|
+
export declare const ConfluenceSearchConfigModal: (props: ConfluenceSearchConfigModalProps) => jsx.JSX.Element;
|
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
import { type DatasourceAdf, type InlineCardAdf } from '@atlaskit/linking-common/types';
|
|
2
|
-
import type
|
|
2
|
+
import { type DatasourceParameters } from '@atlaskit/linking-types';
|
|
3
3
|
import { type ConfigModalProps } from '../../common/types';
|
|
4
|
+
import { type ConnectedConfigModalProps } from '../common/modal/datasource-modal/createDatasourceModal';
|
|
4
5
|
import { type DateRangeType } from '../common/modal/popup-select/types';
|
|
5
6
|
export interface ConfluenceSearchConfigModalProps extends ConfigModalProps<InlineCardAdf | ConfluenceSearchDatasourceAdf, DatasourceParameters | ConfluenceSearchDatasourceParameters> {
|
|
6
7
|
disableDisplayDropdown?: boolean;
|
|
7
8
|
overrideParameters?: Pick<ConfluenceSearchDatasourceParameters, 'entityTypes'>;
|
|
8
9
|
}
|
|
10
|
+
export interface ConnectedConfluenceSearchConfigModalProps extends ConnectedConfigModalProps<ConfluenceSearchDatasourceParameters> {
|
|
11
|
+
disableDisplayDropdown?: boolean;
|
|
12
|
+
overrideParameters?: Pick<ConfluenceSearchDatasourceParameters, 'entityTypes'>;
|
|
13
|
+
}
|
|
9
14
|
export type ConfluenceSearchDatasourceParameters = {
|
|
10
15
|
cloudId: string;
|
|
11
16
|
searchString?: string;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
import type
|
|
3
|
-
export declare const JiraIssuesConfigModal:
|
|
1
|
+
import { jsx } from '@emotion/react';
|
|
2
|
+
import { type JiraConfigModalProps } from '../types';
|
|
3
|
+
export declare const JiraIssuesConfigModal: (props: JiraConfigModalProps) => jsx.JSX.Element;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type DatasourceAdf, type InlineCardAdf } from '@atlaskit/linking-common/types';
|
|
2
2
|
import { type DatasourceParameters } from '@atlaskit/linking-types';
|
|
3
3
|
import { type ConfigModalProps } from '../../common/types';
|
|
4
|
+
import { type ConnectedConfigModalProps } from '../common/modal/datasource-modal/createDatasourceModal';
|
|
4
5
|
type XOR<T1, T2> = (T1 & {
|
|
5
6
|
[k in Exclude<keyof T2, keyof T1>]?: never;
|
|
6
7
|
}) | (T2 & {
|
|
@@ -17,4 +18,6 @@ export type JiraIssueDatasourceParameters = {
|
|
|
17
18
|
export type JiraIssuesDatasourceAdf = DatasourceAdf<JiraIssueDatasourceParameters>;
|
|
18
19
|
export interface JiraConfigModalProps extends ConfigModalProps<InlineCardAdf | DatasourceAdf, DatasourceParameters | JiraIssueDatasourceParameters> {
|
|
19
20
|
}
|
|
21
|
+
export interface ConnectedJiraConfigModalProps extends ConnectedConfigModalProps<JiraIssueDatasourceParameters> {
|
|
22
|
+
}
|
|
20
23
|
export {};
|