@atlaskit/link-datasource 1.1.0 → 1.1.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 CHANGED
@@ -1,5 +1,17 @@
1
1
  # @atlaskit/link-datasource
2
2
 
3
+ ## 1.1.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [`2378739fad6`](https://bitbucket.org/atlassian/atlassian-frontend/commits/2378739fad6) - Added link-datasource link viewed ui analytics events
8
+
9
+ ## 1.1.1
10
+
11
+ ### Patch Changes
12
+
13
+ - Updated dependencies
14
+
3
15
  ## 1.1.0
4
16
 
5
17
  ### Minor Changes
@@ -8,6 +8,6 @@ var EVENT_CHANNEL = 'media';
8
8
  exports.EVENT_CHANNEL = EVENT_CHANNEL;
9
9
  var packageMetaData = {
10
10
  packageName: "@atlaskit/link-datasource",
11
- packageVersion: "1.1.0"
11
+ packageVersion: "1.1.2"
12
12
  };
13
13
  exports.packageMetaData = packageMetaData;
@@ -231,7 +231,7 @@ var analyticsContextAttributes = {
231
231
  };
232
232
  var analyticsContextData = {
233
233
  packageName: "@atlaskit/link-datasource",
234
- packageVersion: "1.1.0",
234
+ packageVersion: "1.1.2",
235
235
  source: 'datasourceConfigModal'
236
236
  };
237
237
  var contextData = _objectSpread(_objectSpread({}, analyticsContextData), {}, {
@@ -200,6 +200,33 @@ var PlainJiraIssuesConfigModal = function PlainJiraIssuesConfigModal(props) {
200
200
  setCloudId(selectedJiraSite.cloudId);
201
201
  }
202
202
  }, [cloudId, selectedJiraSite]);
203
+ var fireSingleItemViewedEvent = (0, _react.useCallback)(function () {
204
+ fireEvent('ui.link.viewed.singleItem', {
205
+ destinationObjectTypes: destinationObjectTypes,
206
+ searchMethod: (0, _utils.mapSearchMethod)(lastSearchMethodRef.current),
207
+ extensionKey: extensionKey
208
+ });
209
+ }, [extensionKey, fireEvent, destinationObjectTypes]);
210
+ var fireCountViewedEvent = (0, _react.useCallback)(function () {
211
+ fireEvent('ui.link.viewed.count', {
212
+ destinationObjectTypes: destinationObjectTypes,
213
+ searchMethod: (0, _utils.mapSearchMethod)(lastSearchMethodRef.current),
214
+ extensionKey: extensionKey,
215
+ totalItemCount: totalCount || 0
216
+ });
217
+ }, [extensionKey, fireEvent, totalCount, destinationObjectTypes]);
218
+ (0, _react.useEffect)(function () {
219
+ var isResolved = status === 'resolved';
220
+ var isSingleItemViewed = currentViewMode === 'issue' && totalCount === 1;
221
+ var isCountViewed = currentViewMode === 'count';
222
+ if (isResolved) {
223
+ if (isSingleItemViewed) {
224
+ fireSingleItemViewedEvent();
225
+ } else if (isCountViewed && totalCount) {
226
+ fireCountViewedEvent();
227
+ }
228
+ }
229
+ }, [currentViewMode, totalCount, status, fireSingleItemViewedEvent, fireCountViewedEvent]);
203
230
  var onSearch = (0, _react.useCallback)(function (newParameters, searchMethod) {
204
231
  searchCount.current++;
205
232
  lastSearchMethodRef.current = searchMethod;
@@ -1,5 +1,5 @@
1
1
  export const EVENT_CHANNEL = 'media';
2
2
  export const packageMetaData = {
3
3
  packageName: "@atlaskit/link-datasource",
4
- packageVersion: "1.1.0"
4
+ packageVersion: "1.1.2"
5
5
  };
@@ -205,7 +205,7 @@ const analyticsContextAttributes = {
205
205
  };
206
206
  const analyticsContextData = {
207
207
  packageName: "@atlaskit/link-datasource",
208
- packageVersion: "1.1.0",
208
+ packageVersion: "1.1.2",
209
209
  source: 'datasourceConfigModal'
210
210
  };
211
211
  const contextData = {
@@ -150,6 +150,33 @@ export const PlainJiraIssuesConfigModal = props => {
150
150
  setCloudId(selectedJiraSite.cloudId);
151
151
  }
152
152
  }, [cloudId, selectedJiraSite]);
153
+ const fireSingleItemViewedEvent = useCallback(() => {
154
+ fireEvent('ui.link.viewed.singleItem', {
155
+ destinationObjectTypes: destinationObjectTypes,
156
+ searchMethod: mapSearchMethod(lastSearchMethodRef.current),
157
+ extensionKey: extensionKey
158
+ });
159
+ }, [extensionKey, fireEvent, destinationObjectTypes]);
160
+ const fireCountViewedEvent = useCallback(() => {
161
+ fireEvent('ui.link.viewed.count', {
162
+ destinationObjectTypes: destinationObjectTypes,
163
+ searchMethod: mapSearchMethod(lastSearchMethodRef.current),
164
+ extensionKey: extensionKey,
165
+ totalItemCount: totalCount || 0
166
+ });
167
+ }, [extensionKey, fireEvent, totalCount, destinationObjectTypes]);
168
+ useEffect(() => {
169
+ const isResolved = status === 'resolved';
170
+ const isSingleItemViewed = currentViewMode === 'issue' && totalCount === 1;
171
+ const isCountViewed = currentViewMode === 'count';
172
+ if (isResolved) {
173
+ if (isSingleItemViewed) {
174
+ fireSingleItemViewedEvent();
175
+ } else if (isCountViewed && totalCount) {
176
+ fireCountViewedEvent();
177
+ }
178
+ }
179
+ }, [currentViewMode, totalCount, status, fireSingleItemViewedEvent, fireCountViewedEvent]);
153
180
  const onSearch = useCallback((newParameters, searchMethod) => {
154
181
  searchCount.current++;
155
182
  lastSearchMethodRef.current = searchMethod;
@@ -1,5 +1,5 @@
1
1
  export var EVENT_CHANNEL = 'media';
2
2
  export var packageMetaData = {
3
3
  packageName: "@atlaskit/link-datasource",
4
- packageVersion: "1.1.0"
4
+ packageVersion: "1.1.2"
5
5
  };
@@ -222,7 +222,7 @@ var analyticsContextAttributes = {
222
222
  };
223
223
  var analyticsContextData = {
224
224
  packageName: "@atlaskit/link-datasource",
225
- packageVersion: "1.1.0",
225
+ packageVersion: "1.1.2",
226
226
  source: 'datasourceConfigModal'
227
227
  };
228
228
  var contextData = _objectSpread(_objectSpread({}, analyticsContextData), {}, {
@@ -190,6 +190,33 @@ export var PlainJiraIssuesConfigModal = function PlainJiraIssuesConfigModal(prop
190
190
  setCloudId(selectedJiraSite.cloudId);
191
191
  }
192
192
  }, [cloudId, selectedJiraSite]);
193
+ var fireSingleItemViewedEvent = useCallback(function () {
194
+ fireEvent('ui.link.viewed.singleItem', {
195
+ destinationObjectTypes: destinationObjectTypes,
196
+ searchMethod: mapSearchMethod(lastSearchMethodRef.current),
197
+ extensionKey: extensionKey
198
+ });
199
+ }, [extensionKey, fireEvent, destinationObjectTypes]);
200
+ var fireCountViewedEvent = useCallback(function () {
201
+ fireEvent('ui.link.viewed.count', {
202
+ destinationObjectTypes: destinationObjectTypes,
203
+ searchMethod: mapSearchMethod(lastSearchMethodRef.current),
204
+ extensionKey: extensionKey,
205
+ totalItemCount: totalCount || 0
206
+ });
207
+ }, [extensionKey, fireEvent, totalCount, destinationObjectTypes]);
208
+ useEffect(function () {
209
+ var isResolved = status === 'resolved';
210
+ var isSingleItemViewed = currentViewMode === 'issue' && totalCount === 1;
211
+ var isCountViewed = currentViewMode === 'count';
212
+ if (isResolved) {
213
+ if (isSingleItemViewed) {
214
+ fireSingleItemViewedEvent();
215
+ } else if (isCountViewed && totalCount) {
216
+ fireCountViewedEvent();
217
+ }
218
+ }
219
+ }, [currentViewMode, totalCount, status, fireSingleItemViewedEvent, fireCountViewedEvent]);
193
220
  var onSearch = useCallback(function (newParameters, searchMethod) {
194
221
  searchCount.current++;
195
222
  lastSearchMethodRef.current = searchMethod;
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * Generates Typescript types for analytics events from analytics.spec.yaml
5
5
  *
6
- * @codegen <<SignedSource::2d36fde4f879983a499f53e3fb70509b>>
6
+ * @codegen <<SignedSource::bbcd049ca0675b0360080a987c26f6e9>>
7
7
  * @codegenCommand yarn workspace @atlassian/analytics-tooling run analytics:codegen link-datasource
8
8
  */
9
9
  export type PackageMetaDataType = {
@@ -72,11 +72,13 @@ export type TableViewedDatasourceAttributesType = {
72
72
  export type LinkViewedSingleItemAttributesType = {
73
73
  destinationObjectTypes: unknown[];
74
74
  searchMethod: 'datasource_search_query' | 'datasource_basic_filter' | 'datasource_saved_filter' | null;
75
+ extensionKey: string | null;
75
76
  };
76
77
  export type LinkViewedCountAttributesType = {
77
78
  destinationObjectTypes: unknown[];
78
79
  searchMethod: 'datasource_search_query' | 'datasource_basic_filter' | 'datasource_saved_filter' | null;
79
80
  totalItemCount: number;
81
+ extensionKey: string | null;
80
82
  };
81
83
  export type AnalyticsEventAttributes = {
82
84
  /**
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * Generates Typescript types for analytics events from analytics.spec.yaml
5
5
  *
6
- * @codegen <<SignedSource::2d36fde4f879983a499f53e3fb70509b>>
6
+ * @codegen <<SignedSource::bbcd049ca0675b0360080a987c26f6e9>>
7
7
  * @codegenCommand yarn workspace @atlassian/analytics-tooling run analytics:codegen link-datasource
8
8
  */
9
9
  export type PackageMetaDataType = {
@@ -72,11 +72,13 @@ export type TableViewedDatasourceAttributesType = {
72
72
  export type LinkViewedSingleItemAttributesType = {
73
73
  destinationObjectTypes: unknown[];
74
74
  searchMethod: 'datasource_search_query' | 'datasource_basic_filter' | 'datasource_saved_filter' | null;
75
+ extensionKey: string | null;
75
76
  };
76
77
  export type LinkViewedCountAttributesType = {
77
78
  destinationObjectTypes: unknown[];
78
79
  searchMethod: 'datasource_search_query' | 'datasource_basic_filter' | 'datasource_saved_filter' | null;
79
80
  totalItemCount: number;
81
+ extensionKey: string | null;
80
82
  };
81
83
  export type AnalyticsEventAttributes = {
82
84
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/link-datasource",
3
- "version": "1.1.0",
3
+ "version": "1.1.2",
4
4
  "description": "UI Components to support linking platform dataset feature",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -42,9 +42,9 @@
42
42
  "@atlaskit/icon": "^21.12.0",
43
43
  "@atlaskit/icon-object": "^6.3.0",
44
44
  "@atlaskit/image": "^1.1.0",
45
- "@atlaskit/jql-editor-autocomplete-rest": "^1.0.0",
45
+ "@atlaskit/jql-editor-autocomplete-rest": "^2.0.0",
46
46
  "@atlaskit/link-client-extension": "^1.6.0",
47
- "@atlaskit/linking-common": "^4.7.0",
47
+ "@atlaskit/linking-common": "^4.8.0",
48
48
  "@atlaskit/linking-types": "^8.3.0",
49
49
  "@atlaskit/lozenge": "^11.4.0",
50
50
  "@atlaskit/modal-dialog": "^12.6.0",
@@ -53,7 +53,7 @@
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
55
  "@atlaskit/select": "^16.5.0",
56
- "@atlaskit/smart-card": "^26.23.0",
56
+ "@atlaskit/smart-card": "^26.25.0",
57
57
  "@atlaskit/spinner": "^15.5.0",
58
58
  "@atlaskit/tag": "^11.6.0",
59
59
  "@atlaskit/textfield": "5.6.7",