@atlaskit/link-datasource 1.2.0 → 1.2.2
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 +14 -0
- package/dist/cjs/analytics/constants.js +1 -1
- package/dist/cjs/analytics/ufoExperiences/index.js +51 -0
- package/dist/cjs/analytics/ufoExperiences/types.js +5 -0
- package/dist/cjs/analytics/ufoExperiences/useDataRenderedUfoExperience.js +52 -0
- package/dist/cjs/hooks/useDatasourceTableState.js +28 -33
- package/dist/cjs/ui/assets-modal/modal/index.js +1 -1
- package/dist/cjs/ui/datasource-table-view/datasourceTableView.js +21 -1
- package/dist/cjs/ui/issue-like-table/index.js +10 -1
- package/dist/cjs/ui/jira-issues-modal/modal/index.js +73 -32
- package/dist/es2019/analytics/constants.js +1 -1
- package/dist/es2019/analytics/ufoExperiences/index.js +45 -0
- package/dist/es2019/analytics/ufoExperiences/types.js +1 -0
- package/dist/es2019/analytics/ufoExperiences/useDataRenderedUfoExperience.js +46 -0
- package/dist/es2019/hooks/useDatasourceTableState.js +2 -6
- package/dist/es2019/ui/assets-modal/modal/index.js +1 -1
- package/dist/es2019/ui/datasource-table-view/datasourceTableView.js +22 -1
- package/dist/es2019/ui/issue-like-table/index.js +10 -1
- package/dist/es2019/ui/jira-issues-modal/modal/index.js +73 -28
- package/dist/esm/analytics/constants.js +1 -1
- package/dist/esm/analytics/ufoExperiences/index.js +41 -0
- package/dist/esm/analytics/ufoExperiences/types.js +1 -0
- package/dist/esm/analytics/ufoExperiences/useDataRenderedUfoExperience.js +45 -0
- package/dist/esm/hooks/useDatasourceTableState.js +28 -33
- package/dist/esm/ui/assets-modal/modal/index.js +1 -1
- package/dist/esm/ui/datasource-table-view/datasourceTableView.js +21 -1
- package/dist/esm/ui/issue-like-table/index.js +10 -1
- package/dist/esm/ui/jira-issues-modal/modal/index.js +73 -32
- package/dist/types/analytics/generated/analytics.types.d.ts +5 -4
- package/dist/types/analytics/ufoExperiences/index.d.ts +5 -0
- package/dist/types/analytics/ufoExperiences/types.d.ts +8 -0
- package/dist/types/analytics/ufoExperiences/useDataRenderedUfoExperience.d.ts +22 -0
- package/dist/types/ui/issue-like-table/index.d.ts +1 -1
- package/dist/types/ui/issue-like-table/types.d.ts +4 -0
- package/dist/types-ts4.5/analytics/generated/analytics.types.d.ts +5 -4
- package/dist/types-ts4.5/analytics/ufoExperiences/index.d.ts +5 -0
- package/dist/types-ts4.5/analytics/ufoExperiences/types.d.ts +8 -0
- package/dist/types-ts4.5/analytics/ufoExperiences/useDataRenderedUfoExperience.d.ts +22 -0
- package/dist/types-ts4.5/ui/issue-like-table/index.d.ts +1 -1
- package/dist/types-ts4.5/ui/issue-like-table/types.d.ts +4 -0
- package/package.json +8 -7
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import { useCallback, useEffect, useRef } from 'react';
|
|
3
3
|
import { jsx } from '@emotion/react';
|
|
4
|
+
import { v4 as uuidv4 } from 'uuid';
|
|
4
5
|
import { withAnalyticsContext } from '@atlaskit/analytics-next';
|
|
5
6
|
import { useDatasourceAnalyticsEvents } from '../../analytics';
|
|
6
7
|
import { packageMetaData } from '../../analytics/constants';
|
|
8
|
+
import { startUfoExperience } from '../../analytics/ufoExperiences';
|
|
9
|
+
import { useDataRenderedUfoExperience } from '../../analytics/ufoExperiences/useDataRenderedUfoExperience';
|
|
7
10
|
import { useDatasourceTableState } from '../../hooks/useDatasourceTableState';
|
|
8
11
|
import { AccessRequired } from '../common/error-state/access-required';
|
|
9
12
|
import { LoadingError } from '../common/error-state/loading-error';
|
|
@@ -35,6 +38,8 @@ var DatasourceTableViewWithoutAnalytics = function DatasourceTableViewWithoutAna
|
|
|
35
38
|
destinationObjectTypes = _useDatasourceTableSt.destinationObjectTypes;
|
|
36
39
|
var _useDatasourceAnalyti = useDatasourceAnalyticsEvents(),
|
|
37
40
|
fireEvent = _useDatasourceAnalyti.fireEvent;
|
|
41
|
+
var _useRef = useRef(uuidv4()),
|
|
42
|
+
tableRenderInstanceId = _useRef.current;
|
|
38
43
|
|
|
39
44
|
/* Need this to make sure that the datasource in the editor gets updated new info if any edits are made in the modal
|
|
40
45
|
But we don't want to call it on initial load. This screws up useDatasourceTableState's internal
|
|
@@ -52,6 +57,20 @@ var DatasourceTableViewWithoutAnalytics = function DatasourceTableViewWithoutAna
|
|
|
52
57
|
onVisibleColumnKeysChange(defaultVisibleColumnKeys);
|
|
53
58
|
}
|
|
54
59
|
}, [visibleColumnKeys, defaultVisibleColumnKeys, onVisibleColumnKeysChange]);
|
|
60
|
+
useEffect(function () {
|
|
61
|
+
var shouldStartUfoExperience = datasourceId && parameters && visibleColumnKeys && status === 'loading';
|
|
62
|
+
if (shouldStartUfoExperience) {
|
|
63
|
+
startUfoExperience({
|
|
64
|
+
name: 'datasource-rendered'
|
|
65
|
+
}, tableRenderInstanceId);
|
|
66
|
+
}
|
|
67
|
+
}, [datasourceId, parameters, status, tableRenderInstanceId, visibleColumnKeys]);
|
|
68
|
+
useDataRenderedUfoExperience({
|
|
69
|
+
status: status,
|
|
70
|
+
experienceId: tableRenderInstanceId,
|
|
71
|
+
itemCount: responseItems.length,
|
|
72
|
+
extensionKey: extensionKey
|
|
73
|
+
});
|
|
55
74
|
var forcedReset = useCallback(function () {
|
|
56
75
|
fireEvent('ui.button.clicked.sync', {
|
|
57
76
|
extensionKey: extensionKey,
|
|
@@ -89,7 +108,8 @@ var DatasourceTableViewWithoutAnalytics = function DatasourceTableViewWithoutAna
|
|
|
89
108
|
columns: columns,
|
|
90
109
|
visibleColumnKeys: visibleColumnKeys || defaultVisibleColumnKeys,
|
|
91
110
|
onVisibleColumnKeysChange: onVisibleColumnKeysChange,
|
|
92
|
-
scrollableContainerHeight: 590
|
|
111
|
+
scrollableContainerHeight: 590,
|
|
112
|
+
parentContainerRenderInstanceId: tableRenderInstanceId
|
|
93
113
|
}) : jsx(EmptyState, {
|
|
94
114
|
testId: "datasource-table-view-skeleton",
|
|
95
115
|
isCompact: true,
|
|
@@ -21,6 +21,7 @@ import { monitorForElements } from '@atlaskit/pragmatic-drag-and-drop/adapter/el
|
|
|
21
21
|
import { combine } from '@atlaskit/pragmatic-drag-and-drop/util/combine';
|
|
22
22
|
import { N40 } from '@atlaskit/theme/colors';
|
|
23
23
|
import Tooltip from '@atlaskit/tooltip';
|
|
24
|
+
import { succeedUfoExperience } from '../../analytics/ufoExperiences';
|
|
24
25
|
import { ColumnPicker } from './column-picker';
|
|
25
26
|
import { DragColumnPreview } from './drag-column-preview';
|
|
26
27
|
import { DraggableTableHeading } from './draggable-table-heading';
|
|
@@ -115,7 +116,8 @@ export var IssueLikeDataTableView = function IssueLikeDataTableView(_ref2) {
|
|
|
115
116
|
onVisibleColumnKeysChange = _ref2.onVisibleColumnKeysChange,
|
|
116
117
|
status = _ref2.status,
|
|
117
118
|
hasNextPage = _ref2.hasNextPage,
|
|
118
|
-
scrollableContainerHeight = _ref2.scrollableContainerHeight
|
|
119
|
+
scrollableContainerHeight = _ref2.scrollableContainerHeight,
|
|
120
|
+
parentContainerRenderInstanceId = _ref2.parentContainerRenderInstanceId;
|
|
119
121
|
var tableId = useMemo(function () {
|
|
120
122
|
return Symbol('unique-id');
|
|
121
123
|
}, []);
|
|
@@ -138,6 +140,13 @@ export var IssueLikeDataTableView = function IssueLikeDataTableView(_ref2) {
|
|
|
138
140
|
useEffect(function () {
|
|
139
141
|
setOrderedColumns(orderColumns(_toConsumableArray(columns), _toConsumableArray(visibleColumnKeys)));
|
|
140
142
|
}, [columns, visibleColumnKeys]);
|
|
143
|
+
useEffect(function () {
|
|
144
|
+
if (parentContainerRenderInstanceId && status === 'resolved') {
|
|
145
|
+
succeedUfoExperience({
|
|
146
|
+
name: 'datasource-rendered'
|
|
147
|
+
}, parentContainerRenderInstanceId);
|
|
148
|
+
}
|
|
149
|
+
}, [parentContainerRenderInstanceId, status]);
|
|
141
150
|
var visibleSortedColumns = useMemo(function () {
|
|
142
151
|
return visibleColumnKeys.map(function (visibleKey) {
|
|
143
152
|
return orderedColumns.find(function (_ref3) {
|
|
@@ -9,6 +9,7 @@ import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
|
9
9
|
import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
10
10
|
import { css, jsx } from '@emotion/react';
|
|
11
11
|
import { FormattedMessage, FormattedNumber, useIntl } from 'react-intl-next';
|
|
12
|
+
import { v4 as uuidv4 } from 'uuid';
|
|
12
13
|
import { withAnalyticsContext } from '@atlaskit/analytics-next';
|
|
13
14
|
import Button from '@atlaskit/button/standard-button';
|
|
14
15
|
import Modal, { ModalBody, ModalFooter, ModalHeader, ModalTitle, ModalTransition } from '@atlaskit/modal-dialog';
|
|
@@ -16,6 +17,8 @@ import { B400, N0, N40, N800 } from '@atlaskit/theme/colors';
|
|
|
16
17
|
import { EVENT_CHANNEL, useDatasourceAnalyticsEvents } from '../../../analytics';
|
|
17
18
|
import { packageMetaData } from '../../../analytics/constants';
|
|
18
19
|
import { DatasourceAction, DatasourceDisplay } from '../../../analytics/types';
|
|
20
|
+
import { startUfoExperience } from '../../../analytics/ufoExperiences';
|
|
21
|
+
import { useDataRenderedUfoExperience } from '../../../analytics/ufoExperiences/useDataRenderedUfoExperience';
|
|
19
22
|
import { mapSearchMethod } from '../../../analytics/utils';
|
|
20
23
|
import { useDatasourceTableState } from '../../../hooks/useDatasourceTableState';
|
|
21
24
|
import { getAvailableJiraSites } from '../../../services/getAvailableJiraSites';
|
|
@@ -107,6 +110,7 @@ export var PlainJiraIssuesConfigModal = function PlainJiraIssuesConfigModal(prop
|
|
|
107
110
|
var searchCount = useRef(0);
|
|
108
111
|
var userInteractionActions = useRef(new Set());
|
|
109
112
|
var lastSearchMethodRef = useRef(null);
|
|
113
|
+
var visibleColumnCount = useRef((visibleColumnKeys === null || visibleColumnKeys === void 0 ? void 0 : visibleColumnKeys.length) || 0);
|
|
110
114
|
var parameters = useMemo(function () {
|
|
111
115
|
return !!cloudId ? {
|
|
112
116
|
cloudId: cloudId,
|
|
@@ -135,6 +139,8 @@ export var PlainJiraIssuesConfigModal = function PlainJiraIssuesConfigModal(prop
|
|
|
135
139
|
formatMessage = _useIntl.formatMessage;
|
|
136
140
|
var _useDatasourceAnalyti = useDatasourceAnalyticsEvents(),
|
|
137
141
|
fireEvent = _useDatasourceAnalyti.fireEvent;
|
|
142
|
+
var _useRef = useRef(uuidv4()),
|
|
143
|
+
modalRenderInstanceId = _useRef.current;
|
|
138
144
|
var selectedJiraSite = useMemo(function () {
|
|
139
145
|
if (cloudId) {
|
|
140
146
|
// if the cloud id we're editing isn't in available sites then user is likely unauthorized for that site
|
|
@@ -149,7 +155,7 @@ export var PlainJiraIssuesConfigModal = function PlainJiraIssuesConfigModal(prop
|
|
|
149
155
|
}) || availableSites[0];
|
|
150
156
|
}
|
|
151
157
|
}, [availableSites, cloudId]);
|
|
152
|
-
var
|
|
158
|
+
var analyticsPayload = useMemo(function () {
|
|
153
159
|
return {
|
|
154
160
|
extensionKey: extensionKey,
|
|
155
161
|
destinationObjectTypes: destinationObjectTypes
|
|
@@ -159,11 +165,28 @@ export var PlainJiraIssuesConfigModal = function PlainJiraIssuesConfigModal(prop
|
|
|
159
165
|
var jqlUrl = selectedJiraSite && jql && "".concat(selectedJiraSite.url, "/issues/?jql=").concat(encodeURI(jql));
|
|
160
166
|
var isInsertDisabled = !isParametersSet || status === 'rejected' || status === 'unauthorized' || status === 'loading' || resolvedWithNoResults;
|
|
161
167
|
var shouldShowIssueCount = !!totalCount && totalCount !== 1 && currentViewMode === 'issue';
|
|
168
|
+
var isDataReady = (visibleColumnKeys || []).length > 0;
|
|
169
|
+
useEffect(function () {
|
|
170
|
+
var shouldStartUfoExperience = status === 'loading';
|
|
171
|
+
if (shouldStartUfoExperience) {
|
|
172
|
+
startUfoExperience({
|
|
173
|
+
name: 'datasource-rendered'
|
|
174
|
+
}, modalRenderInstanceId);
|
|
175
|
+
}
|
|
176
|
+
}, [modalRenderInstanceId, status]);
|
|
177
|
+
useDataRenderedUfoExperience({
|
|
178
|
+
status: status,
|
|
179
|
+
experienceId: modalRenderInstanceId,
|
|
180
|
+
itemCount: responseItems.length,
|
|
181
|
+
canBeLink: currentViewMode === 'count',
|
|
182
|
+
extensionKey: extensionKey
|
|
183
|
+
});
|
|
162
184
|
useEffect(function () {
|
|
163
185
|
fireEvent('screen.datasourceModalDialog.viewed', {});
|
|
164
186
|
}, [fireEvent]);
|
|
165
187
|
useEffect(function () {
|
|
166
188
|
var newVisibleColumnKeys = !initialVisibleColumnKeys || (initialVisibleColumnKeys || []).length === 0 ? defaultVisibleColumnKeys : initialVisibleColumnKeys;
|
|
189
|
+
visibleColumnCount.current = newVisibleColumnKeys.length;
|
|
167
190
|
setVisibleColumnKeys(newVisibleColumnKeys);
|
|
168
191
|
}, [initialVisibleColumnKeys, defaultVisibleColumnKeys]);
|
|
169
192
|
useEffect(function () {
|
|
@@ -199,32 +222,48 @@ export var PlainJiraIssuesConfigModal = function PlainJiraIssuesConfigModal(prop
|
|
|
199
222
|
}
|
|
200
223
|
}, [cloudId, selectedJiraSite]);
|
|
201
224
|
var fireSingleItemViewedEvent = useCallback(function () {
|
|
202
|
-
fireEvent('ui.link.viewed.singleItem', {
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
});
|
|
207
|
-
}, [extensionKey, fireEvent, destinationObjectTypes]);
|
|
225
|
+
fireEvent('ui.link.viewed.singleItem', _objectSpread(_objectSpread({}, analyticsPayload), {}, {
|
|
226
|
+
searchMethod: mapSearchMethod(lastSearchMethodRef.current)
|
|
227
|
+
}));
|
|
228
|
+
}, [analyticsPayload, fireEvent]);
|
|
208
229
|
var fireCountViewedEvent = useCallback(function () {
|
|
209
|
-
fireEvent('ui.link.viewed.count', {
|
|
210
|
-
destinationObjectTypes: destinationObjectTypes,
|
|
230
|
+
fireEvent('ui.link.viewed.count', _objectSpread(_objectSpread({}, analyticsPayload), {}, {
|
|
211
231
|
searchMethod: mapSearchMethod(lastSearchMethodRef.current),
|
|
212
|
-
extensionKey: extensionKey,
|
|
213
232
|
totalItemCount: totalCount || 0
|
|
214
|
-
});
|
|
215
|
-
}, [
|
|
233
|
+
}));
|
|
234
|
+
}, [analyticsPayload, fireEvent, totalCount]);
|
|
235
|
+
var fireTableViewedEvent = useCallback(function () {
|
|
236
|
+
if (isDataReady) {
|
|
237
|
+
fireEvent('ui.table.viewed.datasourceConfigModal', _objectSpread(_objectSpread({}, analyticsPayload), {}, {
|
|
238
|
+
totalItemCount: totalCount || 0,
|
|
239
|
+
searchMethod: mapSearchMethod(lastSearchMethodRef.current),
|
|
240
|
+
displayedColumnCount: visibleColumnCount.current
|
|
241
|
+
}));
|
|
242
|
+
}
|
|
243
|
+
}, [analyticsPayload, fireEvent, totalCount, isDataReady]);
|
|
244
|
+
var fireIssueViewAnalytics = useCallback(function () {
|
|
245
|
+
if (!totalCount) {
|
|
246
|
+
return;
|
|
247
|
+
}
|
|
248
|
+
if (totalCount > 1) {
|
|
249
|
+
fireTableViewedEvent();
|
|
250
|
+
} else if (totalCount === 1) {
|
|
251
|
+
fireSingleItemViewedEvent();
|
|
252
|
+
}
|
|
253
|
+
}, [fireSingleItemViewedEvent, fireTableViewedEvent, totalCount]);
|
|
216
254
|
useEffect(function () {
|
|
217
255
|
var isResolved = status === 'resolved';
|
|
218
|
-
var
|
|
219
|
-
var
|
|
220
|
-
if (isResolved) {
|
|
221
|
-
|
|
222
|
-
fireSingleItemViewedEvent();
|
|
223
|
-
} else if (isCountViewed && totalCount) {
|
|
224
|
-
fireCountViewedEvent();
|
|
225
|
-
}
|
|
256
|
+
var isIssueViewMode = currentViewMode === 'issue';
|
|
257
|
+
var isCountViewMode = currentViewMode === 'count';
|
|
258
|
+
if (!isResolved) {
|
|
259
|
+
return;
|
|
226
260
|
}
|
|
227
|
-
|
|
261
|
+
if (isIssueViewMode) {
|
|
262
|
+
fireIssueViewAnalytics();
|
|
263
|
+
} else if (isCountViewMode) {
|
|
264
|
+
fireCountViewedEvent();
|
|
265
|
+
}
|
|
266
|
+
}, [currentViewMode, status, fireIssueViewAnalytics, fireCountViewedEvent]);
|
|
228
267
|
var onSearch = useCallback(function (newParameters, searchMethod) {
|
|
229
268
|
searchCount.current++;
|
|
230
269
|
lastSearchMethodRef.current = searchMethod;
|
|
@@ -240,13 +279,13 @@ export var PlainJiraIssuesConfigModal = function PlainJiraIssuesConfigModal(prop
|
|
|
240
279
|
analyticEvent.update({
|
|
241
280
|
eventType: 'ui',
|
|
242
281
|
actionSubjectId: 'cancel',
|
|
243
|
-
attributes: _objectSpread(_objectSpread({},
|
|
244
|
-
|
|
245
|
-
|
|
282
|
+
attributes: _objectSpread(_objectSpread({}, analyticsPayload), {}, {
|
|
283
|
+
searchCount: searchCount.current,
|
|
284
|
+
actions: Array.from(userInteractionActions.current)
|
|
246
285
|
})
|
|
247
286
|
}).fire(EVENT_CHANNEL);
|
|
248
287
|
onCancel();
|
|
249
|
-
}, [
|
|
288
|
+
}, [analyticsPayload, onCancel]);
|
|
250
289
|
var onSiteSelection = useCallback(function (site) {
|
|
251
290
|
userInteractionActions.current.add(DatasourceAction.INSTANCE_UPDATED);
|
|
252
291
|
setCloudId(site.cloudId);
|
|
@@ -268,13 +307,13 @@ export var PlainJiraIssuesConfigModal = function PlainJiraIssuesConfigModal(prop
|
|
|
268
307
|
}
|
|
269
308
|
var insertButtonClickedEvent = analyticsEvent.update({
|
|
270
309
|
actionSubjectId: 'insert',
|
|
271
|
-
attributes: _objectSpread(_objectSpread({},
|
|
272
|
-
actions: Array.from(userInteractionActions.current),
|
|
310
|
+
attributes: _objectSpread(_objectSpread({}, analyticsPayload), {}, {
|
|
273
311
|
totalItemCount: totalCount || 0,
|
|
274
|
-
displayedColumnCount:
|
|
312
|
+
displayedColumnCount: visibleColumnCount.current,
|
|
275
313
|
display: getDisplayValue(currentViewMode, totalCount || 0),
|
|
276
314
|
searchCount: searchCount.current,
|
|
277
|
-
searchMethod: mapSearchMethod(lastSearchMethodRef.current)
|
|
315
|
+
searchMethod: mapSearchMethod(lastSearchMethodRef.current),
|
|
316
|
+
actions: Array.from(userInteractionActions.current)
|
|
278
317
|
}),
|
|
279
318
|
eventType: 'ui'
|
|
280
319
|
});
|
|
@@ -321,7 +360,7 @@ export var PlainJiraIssuesConfigModal = function PlainJiraIssuesConfigModal(prop
|
|
|
321
360
|
}
|
|
322
361
|
}, consumerEvent);
|
|
323
362
|
}
|
|
324
|
-
}, [isParametersSet, jql, selectedJiraSite,
|
|
363
|
+
}, [isParametersSet, jql, selectedJiraSite, analyticsPayload, totalCount, visibleColumnKeys, currentViewMode, retrieveUrlForSmartCardRender, responseItems.length, onInsert, jqlUrl, datasourceId, cloudId]);
|
|
325
364
|
var handleViewModeChange = function handleViewModeChange(selectedMode) {
|
|
326
365
|
userInteractionActions.current.add(DatasourceAction.DISPLAY_VIEW_CHANGED);
|
|
327
366
|
setCurrentViewMode(selectedMode);
|
|
@@ -334,6 +373,7 @@ export var PlainJiraIssuesConfigModal = function PlainJiraIssuesConfigModal(prop
|
|
|
334
373
|
var newVisibleColumnKeys = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
335
374
|
var columnAction = getColumnAction(visibleColumnKeys || [], newVisibleColumnKeys);
|
|
336
375
|
userInteractionActions.current.add(columnAction);
|
|
376
|
+
visibleColumnCount.current = newVisibleColumnKeys.length;
|
|
337
377
|
setVisibleColumnKeys(newVisibleColumnKeys);
|
|
338
378
|
}, [visibleColumnKeys]);
|
|
339
379
|
var issueLikeDataTableView = useMemo(function () {
|
|
@@ -348,9 +388,10 @@ export var PlainJiraIssuesConfigModal = function PlainJiraIssuesConfigModal(prop
|
|
|
348
388
|
visibleColumnKeys: visibleColumnKeys || defaultVisibleColumnKeys,
|
|
349
389
|
onNextPage: handleOnNextPage,
|
|
350
390
|
onLoadDatasourceDetails: loadDatasourceDetails,
|
|
351
|
-
onVisibleColumnKeysChange: handleVisibleColumnKeysChange
|
|
391
|
+
onVisibleColumnKeysChange: handleVisibleColumnKeysChange,
|
|
392
|
+
parentContainerRenderInstanceId: modalRenderInstanceId
|
|
352
393
|
}));
|
|
353
|
-
}, [columns, defaultVisibleColumnKeys,
|
|
394
|
+
}, [columns, defaultVisibleColumnKeys, handleOnNextPage, handleVisibleColumnKeysChange, hasNextPage, loadDatasourceDetails, modalRenderInstanceId, responseItems, status, visibleColumnKeys]);
|
|
354
395
|
var renderCountModeContent = useCallback(function () {
|
|
355
396
|
var url = selectedJiraSite === null || selectedJiraSite === void 0 ? void 0 : selectedJiraSite.url;
|
|
356
397
|
if (status === 'unauthorized') {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Generates Typescript types for analytics events from analytics.spec.yaml
|
|
5
5
|
*
|
|
6
|
-
* @codegen <<SignedSource::
|
|
6
|
+
* @codegen <<SignedSource::0262ba66242472aeffce99eacc538f23>>
|
|
7
7
|
* @codegenCommand yarn workspace @atlassian/analytics-tooling run analytics:codegen link-datasource
|
|
8
8
|
*/
|
|
9
9
|
export type PackageMetaDataType = {
|
|
@@ -63,11 +63,12 @@ export type NextItemLoadedAttributesType = {
|
|
|
63
63
|
extensionKey: string | null;
|
|
64
64
|
loadedItemCount: number;
|
|
65
65
|
};
|
|
66
|
-
export type
|
|
66
|
+
export type TableViewedDatasourceConfigModalAttributesType = {
|
|
67
67
|
destinationObjectTypes: unknown[];
|
|
68
68
|
totalItemCount: number;
|
|
69
69
|
displayedColumnCount: number | null;
|
|
70
70
|
searchMethod: 'datasource_search_query' | 'datasource_basic_filter' | 'datasource_saved_filter' | null;
|
|
71
|
+
extensionKey: string | null;
|
|
71
72
|
};
|
|
72
73
|
export type LinkViewedSingleItemAttributesType = {
|
|
73
74
|
destinationObjectTypes: unknown[];
|
|
@@ -118,8 +119,8 @@ export type AnalyticsEventAttributes = {
|
|
|
118
119
|
* Fired when user scrolls to the next page/list of the objects */
|
|
119
120
|
'track.nextItem.loaded': NextItemLoadedAttributesType;
|
|
120
121
|
/**
|
|
121
|
-
* Fired when the datasource results are displayed as table */
|
|
122
|
-
'ui.table.viewed.
|
|
122
|
+
* Fired when the datasource results are displayed as table inside of datasource configuration modal */
|
|
123
|
+
'ui.table.viewed.datasourceConfigModal': TableViewedDatasourceConfigModalAttributesType;
|
|
123
124
|
/**
|
|
124
125
|
* Fired when the datasource results are displayed as link(may be smart-link) for a single item */
|
|
125
126
|
'ui.link.viewed.singleItem': LinkViewedSingleItemAttributesType;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { UfoExperience } from './types';
|
|
2
|
+
export declare const startUfoExperience: ({ name, metadata }: UfoExperience, id: string) => void;
|
|
3
|
+
export declare const succeedUfoExperience: ({ name, metadata }: UfoExperience, id: string) => void;
|
|
4
|
+
export declare const failUfoExperience: ({ name, metadata }: UfoExperience, id: string) => void;
|
|
5
|
+
export declare const addMetadataToExperience: ({ name, metadata }: UfoExperience, id: string) => void;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { DatasourceTableStatusType } from '@atlaskit/linking-types';
|
|
2
|
+
interface DataRenderedUfoExperienceProps {
|
|
3
|
+
status: DatasourceTableStatusType;
|
|
4
|
+
experienceId: string;
|
|
5
|
+
itemCount: number;
|
|
6
|
+
canBeLink?: boolean;
|
|
7
|
+
extensionKey?: string | null;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Hook to mark DataRendered UFO experience as either Success or Failure
|
|
11
|
+
* 1. Success when
|
|
12
|
+
* * its rendered as a link
|
|
13
|
+
* * it returns empty results
|
|
14
|
+
* * the request is unauthorized
|
|
15
|
+
* 2. Fail when
|
|
16
|
+
* * request is rejected
|
|
17
|
+
*
|
|
18
|
+
* Note:
|
|
19
|
+
* * When the request is resolved as a datasource table, it will be marked success in the table component, every other success case is marked by this hook
|
|
20
|
+
*/
|
|
21
|
+
export declare const useDataRenderedUfoExperience: ({ status, experienceId, itemCount, canBeLink, extensionKey, }: DataRenderedUfoExperienceProps) => void;
|
|
22
|
+
export {};
|
|
@@ -12,5 +12,5 @@ export interface RowCellType {
|
|
|
12
12
|
content?: React.ReactNode | string;
|
|
13
13
|
maxWidth?: number;
|
|
14
14
|
}
|
|
15
|
-
export declare const IssueLikeDataTableView: ({ testId, onNextPage, onLoadDatasourceDetails, items, columns, renderItem, visibleColumnKeys, onVisibleColumnKeysChange, status, hasNextPage, scrollableContainerHeight, }: IssueLikeDataTableViewProps) => jsx.JSX.Element;
|
|
15
|
+
export declare const IssueLikeDataTableView: ({ testId, onNextPage, onLoadDatasourceDetails, items, columns, renderItem, visibleColumnKeys, onVisibleColumnKeysChange, status, hasNextPage, scrollableContainerHeight, parentContainerRenderInstanceId, }: IssueLikeDataTableViewProps) => jsx.JSX.Element;
|
|
16
16
|
export declare const EmptyState: ({ isCompact, isLoading, testId }: import("./empty-state").Props) => jsx.JSX.Element;
|
|
@@ -4,6 +4,10 @@ import { NextPageType } from '../../hooks/useDatasourceTableState';
|
|
|
4
4
|
export type TableViewPropsRenderType = (item: DatasourceType) => React.ReactNode;
|
|
5
5
|
export interface IssueLikeDataTableViewProps {
|
|
6
6
|
testId?: string;
|
|
7
|
+
/**
|
|
8
|
+
* Unique ID to indicate parent component instance to be used for UFO experiences
|
|
9
|
+
*/
|
|
10
|
+
parentContainerRenderInstanceId?: string;
|
|
7
11
|
/**
|
|
8
12
|
* All available columns/properties.
|
|
9
13
|
* Consumer should not reorder these columns to align with `visibleColumnKeys`.
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Generates Typescript types for analytics events from analytics.spec.yaml
|
|
5
5
|
*
|
|
6
|
-
* @codegen <<SignedSource::
|
|
6
|
+
* @codegen <<SignedSource::0262ba66242472aeffce99eacc538f23>>
|
|
7
7
|
* @codegenCommand yarn workspace @atlassian/analytics-tooling run analytics:codegen link-datasource
|
|
8
8
|
*/
|
|
9
9
|
export type PackageMetaDataType = {
|
|
@@ -63,11 +63,12 @@ export type NextItemLoadedAttributesType = {
|
|
|
63
63
|
extensionKey: string | null;
|
|
64
64
|
loadedItemCount: number;
|
|
65
65
|
};
|
|
66
|
-
export type
|
|
66
|
+
export type TableViewedDatasourceConfigModalAttributesType = {
|
|
67
67
|
destinationObjectTypes: unknown[];
|
|
68
68
|
totalItemCount: number;
|
|
69
69
|
displayedColumnCount: number | null;
|
|
70
70
|
searchMethod: 'datasource_search_query' | 'datasource_basic_filter' | 'datasource_saved_filter' | null;
|
|
71
|
+
extensionKey: string | null;
|
|
71
72
|
};
|
|
72
73
|
export type LinkViewedSingleItemAttributesType = {
|
|
73
74
|
destinationObjectTypes: unknown[];
|
|
@@ -118,8 +119,8 @@ export type AnalyticsEventAttributes = {
|
|
|
118
119
|
* Fired when user scrolls to the next page/list of the objects */
|
|
119
120
|
'track.nextItem.loaded': NextItemLoadedAttributesType;
|
|
120
121
|
/**
|
|
121
|
-
* Fired when the datasource results are displayed as table */
|
|
122
|
-
'ui.table.viewed.
|
|
122
|
+
* Fired when the datasource results are displayed as table inside of datasource configuration modal */
|
|
123
|
+
'ui.table.viewed.datasourceConfigModal': TableViewedDatasourceConfigModalAttributesType;
|
|
123
124
|
/**
|
|
124
125
|
* Fired when the datasource results are displayed as link(may be smart-link) for a single item */
|
|
125
126
|
'ui.link.viewed.singleItem': LinkViewedSingleItemAttributesType;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { UfoExperience } from './types';
|
|
2
|
+
export declare const startUfoExperience: ({ name, metadata }: UfoExperience, id: string) => void;
|
|
3
|
+
export declare const succeedUfoExperience: ({ name, metadata }: UfoExperience, id: string) => void;
|
|
4
|
+
export declare const failUfoExperience: ({ name, metadata }: UfoExperience, id: string) => void;
|
|
5
|
+
export declare const addMetadataToExperience: ({ name, metadata }: UfoExperience, id: string) => void;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { DatasourceTableStatusType } from '@atlaskit/linking-types';
|
|
2
|
+
interface DataRenderedUfoExperienceProps {
|
|
3
|
+
status: DatasourceTableStatusType;
|
|
4
|
+
experienceId: string;
|
|
5
|
+
itemCount: number;
|
|
6
|
+
canBeLink?: boolean;
|
|
7
|
+
extensionKey?: string | null;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Hook to mark DataRendered UFO experience as either Success or Failure
|
|
11
|
+
* 1. Success when
|
|
12
|
+
* * its rendered as a link
|
|
13
|
+
* * it returns empty results
|
|
14
|
+
* * the request is unauthorized
|
|
15
|
+
* 2. Fail when
|
|
16
|
+
* * request is rejected
|
|
17
|
+
*
|
|
18
|
+
* Note:
|
|
19
|
+
* * When the request is resolved as a datasource table, it will be marked success in the table component, every other success case is marked by this hook
|
|
20
|
+
*/
|
|
21
|
+
export declare const useDataRenderedUfoExperience: ({ status, experienceId, itemCount, canBeLink, extensionKey, }: DataRenderedUfoExperienceProps) => void;
|
|
22
|
+
export {};
|
|
@@ -12,5 +12,5 @@ export interface RowCellType {
|
|
|
12
12
|
content?: React.ReactNode | string;
|
|
13
13
|
maxWidth?: number;
|
|
14
14
|
}
|
|
15
|
-
export declare const IssueLikeDataTableView: ({ testId, onNextPage, onLoadDatasourceDetails, items, columns, renderItem, visibleColumnKeys, onVisibleColumnKeysChange, status, hasNextPage, scrollableContainerHeight, }: IssueLikeDataTableViewProps) => jsx.JSX.Element;
|
|
15
|
+
export declare const IssueLikeDataTableView: ({ testId, onNextPage, onLoadDatasourceDetails, items, columns, renderItem, visibleColumnKeys, onVisibleColumnKeysChange, status, hasNextPage, scrollableContainerHeight, parentContainerRenderInstanceId, }: IssueLikeDataTableViewProps) => jsx.JSX.Element;
|
|
16
16
|
export declare const EmptyState: ({ isCompact, isLoading, testId }: import("./empty-state").Props) => jsx.JSX.Element;
|
|
@@ -4,6 +4,10 @@ import { NextPageType } from '../../hooks/useDatasourceTableState';
|
|
|
4
4
|
export type TableViewPropsRenderType = (item: DatasourceType) => React.ReactNode;
|
|
5
5
|
export interface IssueLikeDataTableViewProps {
|
|
6
6
|
testId?: string;
|
|
7
|
+
/**
|
|
8
|
+
* Unique ID to indicate parent component instance to be used for UFO experiences
|
|
9
|
+
*/
|
|
10
|
+
parentContainerRenderInstanceId?: string;
|
|
7
11
|
/**
|
|
8
12
|
* All available columns/properties.
|
|
9
13
|
* Consumer should not reorder these columns to align with `visibleColumnKeys`.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/link-datasource",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.2",
|
|
4
4
|
"description": "UI Components to support linking platform dataset feature",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"@atlaskit/image": "^1.1.0",
|
|
45
45
|
"@atlaskit/jql-editor-autocomplete-rest": "^2.0.0",
|
|
46
46
|
"@atlaskit/link-client-extension": "^1.7.0",
|
|
47
|
-
"@atlaskit/linking-common": "^4.
|
|
47
|
+
"@atlaskit/linking-common": "^4.10.0",
|
|
48
48
|
"@atlaskit/linking-types": "^8.3.0",
|
|
49
49
|
"@atlaskit/lozenge": "^11.4.0",
|
|
50
50
|
"@atlaskit/modal-dialog": "^12.6.0",
|
|
@@ -52,21 +52,23 @@
|
|
|
52
52
|
"@atlaskit/pragmatic-drag-and-drop-hitbox": "^0.11.0",
|
|
53
53
|
"@atlaskit/pragmatic-drag-and-drop-react-beautiful-dnd-autoscroll": "^0.6.0",
|
|
54
54
|
"@atlaskit/pragmatic-drag-and-drop-react-indicator": "^0.16.0",
|
|
55
|
-
"@atlaskit/select": "^16.
|
|
56
|
-
"@atlaskit/smart-card": "^26.
|
|
55
|
+
"@atlaskit/select": "^16.7.0",
|
|
56
|
+
"@atlaskit/smart-card": "^26.27.0",
|
|
57
57
|
"@atlaskit/spinner": "^15.5.0",
|
|
58
58
|
"@atlaskit/tag": "^11.6.0",
|
|
59
59
|
"@atlaskit/textfield": "5.6.7",
|
|
60
60
|
"@atlaskit/theme": "^12.6.0",
|
|
61
|
-
"@atlaskit/tokens": "^1.
|
|
61
|
+
"@atlaskit/tokens": "^1.23.0",
|
|
62
62
|
"@atlaskit/tooltip": "^17.8.0",
|
|
63
|
+
"@atlaskit/ufo": "^0.2.4",
|
|
63
64
|
"@atlassianlabs/jql-editor": "^2.0.1",
|
|
64
65
|
"@babel/runtime": "^7.0.0",
|
|
65
66
|
"@emotion/react": "^11.7.1",
|
|
66
67
|
"@emotion/styled": "^11.0.0",
|
|
67
68
|
"debounce-promise": "^3.1.2",
|
|
68
69
|
"react-dom": "^16.8.0",
|
|
69
|
-
"tiny-invariant": "^1.2.0"
|
|
70
|
+
"tiny-invariant": "^1.2.0",
|
|
71
|
+
"uuid": "^3.1.0"
|
|
70
72
|
},
|
|
71
73
|
"peerDependencies": {
|
|
72
74
|
"react": "^16.8.0",
|
|
@@ -88,7 +90,6 @@
|
|
|
88
90
|
"jest-fetch-mock": "^3.0.3",
|
|
89
91
|
"json-ld-types": "3.9.1",
|
|
90
92
|
"typescript": "~4.9.5",
|
|
91
|
-
"uuid": "^3.1.0",
|
|
92
93
|
"wait-for-expect": "^1.2.0"
|
|
93
94
|
},
|
|
94
95
|
"techstack": {
|