@atlaskit/link-datasource 1.1.7 → 1.2.0
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 +6 -0
- package/dist/cjs/analytics/constants.js +1 -1
- package/dist/cjs/ui/assets-modal/modal/index.js +1 -1
- package/dist/cjs/ui/jira-issues-modal/modal/index.js +10 -7
- package/dist/es2019/analytics/constants.js +1 -1
- package/dist/es2019/ui/assets-modal/modal/index.js +1 -1
- package/dist/es2019/ui/jira-issues-modal/modal/index.js +10 -7
- package/dist/esm/analytics/constants.js +1 -1
- package/dist/esm/ui/assets-modal/modal/index.js +1 -1
- package/dist/esm/ui/jira-issues-modal/modal/index.js +10 -7
- package/dist/types/ui/jira-issues-modal/types.d.ts +2 -1
- package/dist/types-ts4.5/ui/jira-issues-modal/types.d.ts +2 -1
- package/package.json +1 -1
- package/report.api.md +5 -1
- package/tmp/api-report-tmp.d.ts +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @atlaskit/link-datasource
|
|
2
2
|
|
|
3
|
+
## 1.2.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`bab3ac9e64e`](https://bitbucket.org/atlassian/atlassian-frontend/commits/bab3ac9e64e) - Passing analytic events with attributes from link-datasource modal to editor.
|
|
8
|
+
|
|
3
9
|
## 1.1.7
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
|
@@ -231,7 +231,7 @@ var analyticsContextAttributes = {
|
|
|
231
231
|
};
|
|
232
232
|
var analyticsContextData = {
|
|
233
233
|
packageName: "@atlaskit/link-datasource",
|
|
234
|
-
packageVersion: "1.
|
|
234
|
+
packageVersion: "1.2.0",
|
|
235
235
|
source: 'datasourceConfigModal'
|
|
236
236
|
};
|
|
237
237
|
var contextData = _objectSpread(_objectSpread({}, analyticsContextData), {}, {
|
|
@@ -162,8 +162,7 @@ var PlainJiraIssuesConfigModal = function PlainJiraIssuesConfigModal(props) {
|
|
|
162
162
|
var buttonClickedAnalyticsPayload = (0, _react.useMemo)(function () {
|
|
163
163
|
return {
|
|
164
164
|
extensionKey: extensionKey,
|
|
165
|
-
destinationObjectTypes: destinationObjectTypes
|
|
166
|
-
actions: userInteractionActions.current
|
|
165
|
+
destinationObjectTypes: destinationObjectTypes
|
|
167
166
|
};
|
|
168
167
|
}, [destinationObjectTypes, extensionKey]);
|
|
169
168
|
var resolvedWithNoResults = status === 'resolved' && !responseItems.length;
|
|
@@ -252,6 +251,7 @@ var PlainJiraIssuesConfigModal = function PlainJiraIssuesConfigModal(props) {
|
|
|
252
251
|
eventType: 'ui',
|
|
253
252
|
actionSubjectId: 'cancel',
|
|
254
253
|
attributes: _objectSpread(_objectSpread({}, buttonClickedAnalyticsPayload), {}, {
|
|
254
|
+
actions: Array.from(userInteractionActions.current),
|
|
255
255
|
searchCount: searchCount.current
|
|
256
256
|
})
|
|
257
257
|
}).fire(_analytics.EVENT_CHANNEL);
|
|
@@ -271,13 +271,15 @@ var PlainJiraIssuesConfigModal = function PlainJiraIssuesConfigModal(props) {
|
|
|
271
271
|
// agreement with BE that we will use `key` for rendering smartlink
|
|
272
272
|
return data === null || data === void 0 ? void 0 : (_data$key = data.key) === null || _data$key === void 0 ? void 0 : (_data$key$data = _data$key.data) === null || _data$key$data === void 0 ? void 0 : _data$key$data.url;
|
|
273
273
|
}, [responseItems]);
|
|
274
|
-
var onInsertPressed = (0, _react.useCallback)(function (e,
|
|
274
|
+
var onInsertPressed = (0, _react.useCallback)(function (e, analyticsEvent) {
|
|
275
|
+
var _insertButtonClickedE;
|
|
275
276
|
if (!isParametersSet || !jql || !selectedJiraSite) {
|
|
276
277
|
return;
|
|
277
278
|
}
|
|
278
|
-
var insertButtonClickedEvent =
|
|
279
|
+
var insertButtonClickedEvent = analyticsEvent.update({
|
|
279
280
|
actionSubjectId: 'insert',
|
|
280
281
|
attributes: _objectSpread(_objectSpread({}, buttonClickedAnalyticsPayload), {}, {
|
|
282
|
+
actions: Array.from(userInteractionActions.current),
|
|
281
283
|
totalItemCount: totalCount || 0,
|
|
282
284
|
displayedColumnCount: (visibleColumnKeys === null || visibleColumnKeys === void 0 ? void 0 : visibleColumnKeys.length) || 0,
|
|
283
285
|
display: getDisplayValue(currentViewMode, totalCount || 0),
|
|
@@ -286,6 +288,7 @@ var PlainJiraIssuesConfigModal = function PlainJiraIssuesConfigModal(props) {
|
|
|
286
288
|
}),
|
|
287
289
|
eventType: 'ui'
|
|
288
290
|
});
|
|
291
|
+
var consumerEvent = (_insertButtonClickedE = insertButtonClickedEvent.clone()) !== null && _insertButtonClickedE !== void 0 ? _insertButtonClickedE : undefined;
|
|
289
292
|
insertButtonClickedEvent.fire(_analytics.EVENT_CHANNEL);
|
|
290
293
|
var firstIssueUrl = retrieveUrlForSmartCardRender();
|
|
291
294
|
if (currentViewMode === 'count') {
|
|
@@ -294,14 +297,14 @@ var PlainJiraIssuesConfigModal = function PlainJiraIssuesConfigModal(props) {
|
|
|
294
297
|
attrs: {
|
|
295
298
|
url: jqlUrl
|
|
296
299
|
}
|
|
297
|
-
});
|
|
300
|
+
}, consumerEvent);
|
|
298
301
|
} else if (responseItems.length === 1 && firstIssueUrl) {
|
|
299
302
|
onInsert({
|
|
300
303
|
type: 'inlineCard',
|
|
301
304
|
attrs: {
|
|
302
305
|
url: firstIssueUrl
|
|
303
306
|
}
|
|
304
|
-
});
|
|
307
|
+
}, consumerEvent);
|
|
305
308
|
} else {
|
|
306
309
|
onInsert({
|
|
307
310
|
type: 'blockCard',
|
|
@@ -326,7 +329,7 @@ var PlainJiraIssuesConfigModal = function PlainJiraIssuesConfigModal(props) {
|
|
|
326
329
|
}]
|
|
327
330
|
}
|
|
328
331
|
}
|
|
329
|
-
});
|
|
332
|
+
}, consumerEvent);
|
|
330
333
|
}
|
|
331
334
|
}, [isParametersSet, jql, selectedJiraSite, buttonClickedAnalyticsPayload, totalCount, visibleColumnKeys, currentViewMode, retrieveUrlForSmartCardRender, responseItems.length, onInsert, jqlUrl, datasourceId, cloudId]);
|
|
332
335
|
var handleViewModeChange = function handleViewModeChange(selectedMode) {
|
|
@@ -129,8 +129,7 @@ export const PlainJiraIssuesConfigModal = props => {
|
|
|
129
129
|
const buttonClickedAnalyticsPayload = useMemo(() => {
|
|
130
130
|
return {
|
|
131
131
|
extensionKey: extensionKey,
|
|
132
|
-
destinationObjectTypes: destinationObjectTypes
|
|
133
|
-
actions: userInteractionActions.current
|
|
132
|
+
destinationObjectTypes: destinationObjectTypes
|
|
134
133
|
};
|
|
135
134
|
}, [destinationObjectTypes, extensionKey]);
|
|
136
135
|
const resolvedWithNoResults = status === 'resolved' && !responseItems.length;
|
|
@@ -203,6 +202,7 @@ export const PlainJiraIssuesConfigModal = props => {
|
|
|
203
202
|
actionSubjectId: 'cancel',
|
|
204
203
|
attributes: {
|
|
205
204
|
...buttonClickedAnalyticsPayload,
|
|
205
|
+
actions: Array.from(userInteractionActions.current),
|
|
206
206
|
searchCount: searchCount.current
|
|
207
207
|
}
|
|
208
208
|
}).fire(EVENT_CHANNEL);
|
|
@@ -221,14 +221,16 @@ export const PlainJiraIssuesConfigModal = props => {
|
|
|
221
221
|
// agreement with BE that we will use `key` for rendering smartlink
|
|
222
222
|
return data === null || data === void 0 ? void 0 : (_data$key = data.key) === null || _data$key === void 0 ? void 0 : (_data$key$data = _data$key.data) === null || _data$key$data === void 0 ? void 0 : _data$key$data.url;
|
|
223
223
|
}, [responseItems]);
|
|
224
|
-
const onInsertPressed = useCallback((e,
|
|
224
|
+
const onInsertPressed = useCallback((e, analyticsEvent) => {
|
|
225
|
+
var _insertButtonClickedE;
|
|
225
226
|
if (!isParametersSet || !jql || !selectedJiraSite) {
|
|
226
227
|
return;
|
|
227
228
|
}
|
|
228
|
-
const insertButtonClickedEvent =
|
|
229
|
+
const insertButtonClickedEvent = analyticsEvent.update({
|
|
229
230
|
actionSubjectId: 'insert',
|
|
230
231
|
attributes: {
|
|
231
232
|
...buttonClickedAnalyticsPayload,
|
|
233
|
+
actions: Array.from(userInteractionActions.current),
|
|
232
234
|
totalItemCount: totalCount || 0,
|
|
233
235
|
displayedColumnCount: (visibleColumnKeys === null || visibleColumnKeys === void 0 ? void 0 : visibleColumnKeys.length) || 0,
|
|
234
236
|
display: getDisplayValue(currentViewMode, totalCount || 0),
|
|
@@ -237,6 +239,7 @@ export const PlainJiraIssuesConfigModal = props => {
|
|
|
237
239
|
},
|
|
238
240
|
eventType: 'ui'
|
|
239
241
|
});
|
|
242
|
+
const consumerEvent = (_insertButtonClickedE = insertButtonClickedEvent.clone()) !== null && _insertButtonClickedE !== void 0 ? _insertButtonClickedE : undefined;
|
|
240
243
|
insertButtonClickedEvent.fire(EVENT_CHANNEL);
|
|
241
244
|
const firstIssueUrl = retrieveUrlForSmartCardRender();
|
|
242
245
|
if (currentViewMode === 'count') {
|
|
@@ -245,14 +248,14 @@ export const PlainJiraIssuesConfigModal = props => {
|
|
|
245
248
|
attrs: {
|
|
246
249
|
url: jqlUrl
|
|
247
250
|
}
|
|
248
|
-
});
|
|
251
|
+
}, consumerEvent);
|
|
249
252
|
} else if (responseItems.length === 1 && firstIssueUrl) {
|
|
250
253
|
onInsert({
|
|
251
254
|
type: 'inlineCard',
|
|
252
255
|
attrs: {
|
|
253
256
|
url: firstIssueUrl
|
|
254
257
|
}
|
|
255
|
-
});
|
|
258
|
+
}, consumerEvent);
|
|
256
259
|
} else {
|
|
257
260
|
onInsert({
|
|
258
261
|
type: 'blockCard',
|
|
@@ -275,7 +278,7 @@ export const PlainJiraIssuesConfigModal = props => {
|
|
|
275
278
|
}]
|
|
276
279
|
}
|
|
277
280
|
}
|
|
278
|
-
});
|
|
281
|
+
}, consumerEvent);
|
|
279
282
|
}
|
|
280
283
|
}, [isParametersSet, jql, selectedJiraSite, buttonClickedAnalyticsPayload, totalCount, visibleColumnKeys, currentViewMode, retrieveUrlForSmartCardRender, responseItems.length, onInsert, jqlUrl, datasourceId, cloudId]);
|
|
281
284
|
const handleViewModeChange = selectedMode => {
|
|
@@ -222,7 +222,7 @@ var analyticsContextAttributes = {
|
|
|
222
222
|
};
|
|
223
223
|
var analyticsContextData = {
|
|
224
224
|
packageName: "@atlaskit/link-datasource",
|
|
225
|
-
packageVersion: "1.
|
|
225
|
+
packageVersion: "1.2.0",
|
|
226
226
|
source: 'datasourceConfigModal'
|
|
227
227
|
};
|
|
228
228
|
var contextData = _objectSpread(_objectSpread({}, analyticsContextData), {}, {
|
|
@@ -152,8 +152,7 @@ export var PlainJiraIssuesConfigModal = function PlainJiraIssuesConfigModal(prop
|
|
|
152
152
|
var buttonClickedAnalyticsPayload = useMemo(function () {
|
|
153
153
|
return {
|
|
154
154
|
extensionKey: extensionKey,
|
|
155
|
-
destinationObjectTypes: destinationObjectTypes
|
|
156
|
-
actions: userInteractionActions.current
|
|
155
|
+
destinationObjectTypes: destinationObjectTypes
|
|
157
156
|
};
|
|
158
157
|
}, [destinationObjectTypes, extensionKey]);
|
|
159
158
|
var resolvedWithNoResults = status === 'resolved' && !responseItems.length;
|
|
@@ -242,6 +241,7 @@ export var PlainJiraIssuesConfigModal = function PlainJiraIssuesConfigModal(prop
|
|
|
242
241
|
eventType: 'ui',
|
|
243
242
|
actionSubjectId: 'cancel',
|
|
244
243
|
attributes: _objectSpread(_objectSpread({}, buttonClickedAnalyticsPayload), {}, {
|
|
244
|
+
actions: Array.from(userInteractionActions.current),
|
|
245
245
|
searchCount: searchCount.current
|
|
246
246
|
})
|
|
247
247
|
}).fire(EVENT_CHANNEL);
|
|
@@ -261,13 +261,15 @@ export var PlainJiraIssuesConfigModal = function PlainJiraIssuesConfigModal(prop
|
|
|
261
261
|
// agreement with BE that we will use `key` for rendering smartlink
|
|
262
262
|
return data === null || data === void 0 ? void 0 : (_data$key = data.key) === null || _data$key === void 0 ? void 0 : (_data$key$data = _data$key.data) === null || _data$key$data === void 0 ? void 0 : _data$key$data.url;
|
|
263
263
|
}, [responseItems]);
|
|
264
|
-
var onInsertPressed = useCallback(function (e,
|
|
264
|
+
var onInsertPressed = useCallback(function (e, analyticsEvent) {
|
|
265
|
+
var _insertButtonClickedE;
|
|
265
266
|
if (!isParametersSet || !jql || !selectedJiraSite) {
|
|
266
267
|
return;
|
|
267
268
|
}
|
|
268
|
-
var insertButtonClickedEvent =
|
|
269
|
+
var insertButtonClickedEvent = analyticsEvent.update({
|
|
269
270
|
actionSubjectId: 'insert',
|
|
270
271
|
attributes: _objectSpread(_objectSpread({}, buttonClickedAnalyticsPayload), {}, {
|
|
272
|
+
actions: Array.from(userInteractionActions.current),
|
|
271
273
|
totalItemCount: totalCount || 0,
|
|
272
274
|
displayedColumnCount: (visibleColumnKeys === null || visibleColumnKeys === void 0 ? void 0 : visibleColumnKeys.length) || 0,
|
|
273
275
|
display: getDisplayValue(currentViewMode, totalCount || 0),
|
|
@@ -276,6 +278,7 @@ export var PlainJiraIssuesConfigModal = function PlainJiraIssuesConfigModal(prop
|
|
|
276
278
|
}),
|
|
277
279
|
eventType: 'ui'
|
|
278
280
|
});
|
|
281
|
+
var consumerEvent = (_insertButtonClickedE = insertButtonClickedEvent.clone()) !== null && _insertButtonClickedE !== void 0 ? _insertButtonClickedE : undefined;
|
|
279
282
|
insertButtonClickedEvent.fire(EVENT_CHANNEL);
|
|
280
283
|
var firstIssueUrl = retrieveUrlForSmartCardRender();
|
|
281
284
|
if (currentViewMode === 'count') {
|
|
@@ -284,14 +287,14 @@ export var PlainJiraIssuesConfigModal = function PlainJiraIssuesConfigModal(prop
|
|
|
284
287
|
attrs: {
|
|
285
288
|
url: jqlUrl
|
|
286
289
|
}
|
|
287
|
-
});
|
|
290
|
+
}, consumerEvent);
|
|
288
291
|
} else if (responseItems.length === 1 && firstIssueUrl) {
|
|
289
292
|
onInsert({
|
|
290
293
|
type: 'inlineCard',
|
|
291
294
|
attrs: {
|
|
292
295
|
url: firstIssueUrl
|
|
293
296
|
}
|
|
294
|
-
});
|
|
297
|
+
}, consumerEvent);
|
|
295
298
|
} else {
|
|
296
299
|
onInsert({
|
|
297
300
|
type: 'blockCard',
|
|
@@ -316,7 +319,7 @@ export var PlainJiraIssuesConfigModal = function PlainJiraIssuesConfigModal(prop
|
|
|
316
319
|
}]
|
|
317
320
|
}
|
|
318
321
|
}
|
|
319
|
-
});
|
|
322
|
+
}, consumerEvent);
|
|
320
323
|
}
|
|
321
324
|
}, [isParametersSet, jql, selectedJiraSite, buttonClickedAnalyticsPayload, totalCount, visibleColumnKeys, currentViewMode, retrieveUrlForSmartCardRender, responseItems.length, onInsert, jqlUrl, datasourceId, cloudId]);
|
|
322
325
|
var handleViewModeChange = function handleViewModeChange(selectedMode) {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { UIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
1
2
|
import { DatasourceAdf, InlineCardAdf } from '@atlaskit/linking-common/types';
|
|
2
3
|
type XOR<T1, T2> = (T1 & {
|
|
3
4
|
[k in Exclude<keyof T2, keyof T1>]?: never;
|
|
@@ -37,6 +38,6 @@ export interface JiraIssuesConfigModalProps {
|
|
|
37
38
|
visibleColumnKeys?: string[];
|
|
38
39
|
parameters?: JiraIssueDatasourceParameters;
|
|
39
40
|
onCancel: () => void;
|
|
40
|
-
onInsert: (adf: InlineCardAdf | JiraIssuesDatasourceAdf) => void;
|
|
41
|
+
onInsert: (adf: InlineCardAdf | JiraIssuesDatasourceAdf, analyticsEvent?: UIAnalyticsEvent) => void;
|
|
41
42
|
}
|
|
42
43
|
export {};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { UIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
1
2
|
import { DatasourceAdf, InlineCardAdf } from '@atlaskit/linking-common/types';
|
|
2
3
|
type XOR<T1, T2> = (T1 & {
|
|
3
4
|
[k in Exclude<keyof T2, keyof T1>]?: never;
|
|
@@ -37,6 +38,6 @@ export interface JiraIssuesConfigModalProps {
|
|
|
37
38
|
visibleColumnKeys?: string[];
|
|
38
39
|
parameters?: JiraIssueDatasourceParameters;
|
|
39
40
|
onCancel: () => void;
|
|
40
|
-
onInsert: (adf: InlineCardAdf | JiraIssuesDatasourceAdf) => void;
|
|
41
|
+
onInsert: (adf: InlineCardAdf | JiraIssuesDatasourceAdf, analyticsEvent?: UIAnalyticsEvent) => void;
|
|
41
42
|
}
|
|
42
43
|
export {};
|
package/package.json
CHANGED
package/report.api.md
CHANGED
|
@@ -21,6 +21,7 @@ import { DatasourceAdf } from '@atlaskit/linking-common/types';
|
|
|
21
21
|
import { DatasourceAdfTableView } from '@atlaskit/linking-common/types';
|
|
22
22
|
import { DatasourceAdfView } from '@atlaskit/linking-common/types';
|
|
23
23
|
import { InlineCardAdf } from '@atlaskit/linking-common/types';
|
|
24
|
+
import type { UIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
24
25
|
|
|
25
26
|
// @public (undocumented)
|
|
26
27
|
export const ASSETS_LIST_OF_LINKS_DATASOURCE_ID =
|
|
@@ -126,7 +127,10 @@ interface JiraIssuesConfigModalProps {
|
|
|
126
127
|
// (undocumented)
|
|
127
128
|
onCancel: () => void;
|
|
128
129
|
// (undocumented)
|
|
129
|
-
onInsert: (
|
|
130
|
+
onInsert: (
|
|
131
|
+
adf: InlineCardAdf | JiraIssuesDatasourceAdf,
|
|
132
|
+
analyticsEvent?: UIAnalyticsEvent,
|
|
133
|
+
) => void;
|
|
130
134
|
// (undocumented)
|
|
131
135
|
parameters?: JiraIssueDatasourceParameters;
|
|
132
136
|
// (undocumented)
|
package/tmp/api-report-tmp.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ import { DatasourceAdf } from '@atlaskit/linking-common/types';
|
|
|
10
10
|
import { DatasourceAdfTableView } from '@atlaskit/linking-common/types';
|
|
11
11
|
import { DatasourceAdfView } from '@atlaskit/linking-common/types';
|
|
12
12
|
import { InlineCardAdf } from '@atlaskit/linking-common/types';
|
|
13
|
+
import type { UIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
13
14
|
|
|
14
15
|
// @public (undocumented)
|
|
15
16
|
export const ASSETS_LIST_OF_LINKS_DATASOURCE_ID = "361d618a-3c04-40ad-9b27-3c8ea6927020";
|
|
@@ -104,7 +105,7 @@ interface JiraIssuesConfigModalProps {
|
|
|
104
105
|
// (undocumented)
|
|
105
106
|
onCancel: () => void;
|
|
106
107
|
// (undocumented)
|
|
107
|
-
onInsert: (adf: InlineCardAdf | JiraIssuesDatasourceAdf) => void;
|
|
108
|
+
onInsert: (adf: InlineCardAdf | JiraIssuesDatasourceAdf, analyticsEvent?: UIAnalyticsEvent) => void;
|
|
108
109
|
// (undocumented)
|
|
109
110
|
parameters?: JiraIssueDatasourceParameters;
|
|
110
111
|
// (undocumented)
|