@atlaskit/link-datasource 1.17.5 → 1.17.7

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,19 @@
1
1
  # @atlaskit/link-datasource
2
2
 
3
+ ## 1.17.7
4
+
5
+ ### Patch Changes
6
+
7
+ - [#43413](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/43413) [`73c1cebfd62`](https://bitbucket.org/atlassian/atlassian-frontend/commits/73c1cebfd62) - Move all logic to onOpen when opening the filter dropdown.
8
+ - Updated dependencies
9
+
10
+ ## 1.17.6
11
+
12
+ ### Patch Changes
13
+
14
+ - [#43358](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/43358) [`d275736284c`](https://bitbucket.org/atlassian/atlassian-frontend/commits/d275736284c) - Add analytics event when basic filter dropdown menu is opened.
15
+ - [#43379](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/43379) [`482c025520d`](https://bitbucket.org/atlassian/atlassian-frontend/commits/482c025520d) - ED-20763 Upgrade ADF schema version to 33.2.3 for MBE nodes.
16
+
3
17
  ## 1.17.5
4
18
 
5
19
  ### Patch Changes
@@ -7,5 +7,5 @@ exports.packageMetaData = exports.EVENT_CHANNEL = void 0;
7
7
  var EVENT_CHANNEL = exports.EVENT_CHANNEL = 'media';
8
8
  var packageMetaData = exports.packageMetaData = {
9
9
  packageName: "@atlaskit/link-datasource",
10
- packageVersion: "1.17.5"
10
+ packageVersion: "1.17.7"
11
11
  };
@@ -17,6 +17,7 @@ var _isEqual = _interopRequireDefault(require("lodash/isEqual"));
17
17
  var _reactIntlNext = require("react-intl-next");
18
18
  var _useDebounce = require("use-debounce");
19
19
  var _select = require("@atlaskit/select");
20
+ var _analytics = require("../../../../../analytics");
20
21
  var _useFilterOptions2 = require("../../hooks/useFilterOptions");
21
22
  var _menuList = _interopRequireDefault(require("../menu-list"));
22
23
  var _control = _interopRequireDefault(require("./control"));
@@ -45,6 +46,8 @@ var AsyncPopupSelect = function AsyncPopupSelect(_ref) {
45
46
  isDisabled = _ref$isDisabled === void 0 ? false : _ref$isDisabled;
46
47
  var _useIntl = (0, _reactIntlNext.useIntl)(),
47
48
  formatMessage = _useIntl.formatMessage;
49
+ var _useDatasourceAnalyti = (0, _analytics.useDatasourceAnalyticsEvents)(),
50
+ fireEvent = _useDatasourceAnalyti.fireEvent;
48
51
  var _useState = (0, _react.useState)(''),
49
52
  _useState2 = (0, _slicedToArray2.default)(_useState, 2),
50
53
  searchTerm = _useState2[0],
@@ -151,7 +154,7 @@ var AsyncPopupSelect = function AsyncPopupSelect(_ref) {
151
154
  });
152
155
  }
153
156
  }, [fetchFilterOptions, pageCursor, searchTerm]);
154
- var handleOpenPopup = (0, _react.useCallback)(function () {
157
+ var handleMenuOpen = (0, _react.useCallback)(function () {
155
158
  if (status === 'empty' || status === 'rejected') {
156
159
  // if user searches and gets status as rejected, we want the dropdown to try load the request with searchString when the user reopens the dropdown
157
160
  fetchFilterOptions({
@@ -160,7 +163,11 @@ var AsyncPopupSelect = function AsyncPopupSelect(_ref) {
160
163
  } else if (status === 'resolved') {
161
164
  sortOptionsOnPopupOpen();
162
165
  }
163
- }, [fetchFilterOptions, searchTerm, sortOptionsOnPopupOpen, status]);
166
+ fireEvent('ui.dropdown.opened.basicSearchDropdown', {
167
+ filterType: filterType,
168
+ selectionCount: selectedOptions.length
169
+ });
170
+ }, [fetchFilterOptions, filterType, fireEvent, searchTerm, selectedOptions.length, sortOptionsOnPopupOpen, status]);
164
171
  (0, _react.useEffect)(function () {
165
172
  if (status === 'resolved') {
166
173
  sortOptionsOnResolve();
@@ -235,6 +242,7 @@ var AsyncPopupSelect = function AsyncPopupSelect(_ref) {
235
242
  formatOptionLabel: _formatOptionLabel.default,
236
243
  onChange: handleOptionSelection,
237
244
  onInputChange: handleInputChange,
245
+ onOpen: handleMenuOpen,
238
246
  target: function target(_ref3) {
239
247
  var isOpen = _ref3.isOpen,
240
248
  triggerProps = (0, _objectWithoutProperties2.default)(_ref3, _excluded);
@@ -242,7 +250,6 @@ var AsyncPopupSelect = function AsyncPopupSelect(_ref) {
242
250
  filterType: filterType,
243
251
  selectedOptions: selectedOptions,
244
252
  isSelected: isOpen,
245
- onClick: handleOpenPopup,
246
253
  isDisabled: isDisabled
247
254
  }));
248
255
  },
@@ -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.17.5"
4
+ packageVersion: "1.17.7"
5
5
  };
@@ -4,6 +4,7 @@ import isEqual from 'lodash/isEqual';
4
4
  import { useIntl } from 'react-intl-next';
5
5
  import { useDebouncedCallback } from 'use-debounce';
6
6
  import { CheckboxOption, PopupSelect } from '@atlaskit/select';
7
+ import { useDatasourceAnalyticsEvents } from '../../../../../analytics';
7
8
  import { useFilterOptions } from '../../hooks/useFilterOptions';
8
9
  import CustomMenuList from '../menu-list';
9
10
  import CustomControl from './control';
@@ -26,6 +27,9 @@ const AsyncPopupSelect = ({
26
27
  const {
27
28
  formatMessage
28
29
  } = useIntl();
30
+ const {
31
+ fireEvent
32
+ } = useDatasourceAnalyticsEvents();
29
33
  const [searchTerm, setSearchTerm] = useState('');
30
34
  const [selectedOptions, setSelectedOptions] = useState(selection);
31
35
  const [sortedOptions, setSortedOptions] = useState([]);
@@ -101,7 +105,7 @@ const AsyncPopupSelect = ({
101
105
  });
102
106
  }
103
107
  }, [fetchFilterOptions, pageCursor, searchTerm]);
104
- const handleOpenPopup = useCallback(() => {
108
+ const handleMenuOpen = useCallback(() => {
105
109
  if (status === 'empty' || status === 'rejected') {
106
110
  // if user searches and gets status as rejected, we want the dropdown to try load the request with searchString when the user reopens the dropdown
107
111
  fetchFilterOptions({
@@ -110,7 +114,11 @@ const AsyncPopupSelect = ({
110
114
  } else if (status === 'resolved') {
111
115
  sortOptionsOnPopupOpen();
112
116
  }
113
- }, [fetchFilterOptions, searchTerm, sortOptionsOnPopupOpen, status]);
117
+ fireEvent('ui.dropdown.opened.basicSearchDropdown', {
118
+ filterType,
119
+ selectionCount: selectedOptions.length
120
+ });
121
+ }, [fetchFilterOptions, filterType, fireEvent, searchTerm, selectedOptions.length, sortOptionsOnPopupOpen, status]);
114
122
  useEffect(() => {
115
123
  if (status === 'resolved') {
116
124
  sortOptionsOnResolve();
@@ -185,6 +193,7 @@ const AsyncPopupSelect = ({
185
193
  formatOptionLabel: formatOptionLabel,
186
194
  onChange: handleOptionSelection,
187
195
  onInputChange: handleInputChange,
196
+ onOpen: handleMenuOpen,
188
197
  target: ({
189
198
  isOpen,
190
199
  ...triggerProps
@@ -192,7 +201,6 @@ const AsyncPopupSelect = ({
192
201
  filterType: filterType,
193
202
  selectedOptions: selectedOptions,
194
203
  isSelected: isOpen,
195
- onClick: handleOpenPopup,
196
204
  isDisabled: isDisabled
197
205
  })),
198
206
  footer: shouldShowFooter && /*#__PURE__*/React.createElement(PopupFooter, {
@@ -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.17.5"
4
+ packageVersion: "1.17.7"
5
5
  };
@@ -10,6 +10,7 @@ import isEqual from 'lodash/isEqual';
10
10
  import { useIntl } from 'react-intl-next';
11
11
  import { useDebouncedCallback } from 'use-debounce';
12
12
  import { CheckboxOption, PopupSelect } from '@atlaskit/select';
13
+ import { useDatasourceAnalyticsEvents } from '../../../../../analytics';
13
14
  import { useFilterOptions } from '../../hooks/useFilterOptions';
14
15
  import CustomMenuList from '../menu-list';
15
16
  import CustomControl from './control';
@@ -35,6 +36,8 @@ var AsyncPopupSelect = function AsyncPopupSelect(_ref) {
35
36
  isDisabled = _ref$isDisabled === void 0 ? false : _ref$isDisabled;
36
37
  var _useIntl = useIntl(),
37
38
  formatMessage = _useIntl.formatMessage;
39
+ var _useDatasourceAnalyti = useDatasourceAnalyticsEvents(),
40
+ fireEvent = _useDatasourceAnalyti.fireEvent;
38
41
  var _useState = useState(''),
39
42
  _useState2 = _slicedToArray(_useState, 2),
40
43
  searchTerm = _useState2[0],
@@ -141,7 +144,7 @@ var AsyncPopupSelect = function AsyncPopupSelect(_ref) {
141
144
  });
142
145
  }
143
146
  }, [fetchFilterOptions, pageCursor, searchTerm]);
144
- var handleOpenPopup = useCallback(function () {
147
+ var handleMenuOpen = useCallback(function () {
145
148
  if (status === 'empty' || status === 'rejected') {
146
149
  // if user searches and gets status as rejected, we want the dropdown to try load the request with searchString when the user reopens the dropdown
147
150
  fetchFilterOptions({
@@ -150,7 +153,11 @@ var AsyncPopupSelect = function AsyncPopupSelect(_ref) {
150
153
  } else if (status === 'resolved') {
151
154
  sortOptionsOnPopupOpen();
152
155
  }
153
- }, [fetchFilterOptions, searchTerm, sortOptionsOnPopupOpen, status]);
156
+ fireEvent('ui.dropdown.opened.basicSearchDropdown', {
157
+ filterType: filterType,
158
+ selectionCount: selectedOptions.length
159
+ });
160
+ }, [fetchFilterOptions, filterType, fireEvent, searchTerm, selectedOptions.length, sortOptionsOnPopupOpen, status]);
154
161
  useEffect(function () {
155
162
  if (status === 'resolved') {
156
163
  sortOptionsOnResolve();
@@ -225,6 +232,7 @@ var AsyncPopupSelect = function AsyncPopupSelect(_ref) {
225
232
  formatOptionLabel: formatOptionLabel,
226
233
  onChange: handleOptionSelection,
227
234
  onInputChange: handleInputChange,
235
+ onOpen: handleMenuOpen,
228
236
  target: function target(_ref3) {
229
237
  var isOpen = _ref3.isOpen,
230
238
  triggerProps = _objectWithoutProperties(_ref3, _excluded);
@@ -232,7 +240,6 @@ var AsyncPopupSelect = function AsyncPopupSelect(_ref) {
232
240
  filterType: filterType,
233
241
  selectedOptions: selectedOptions,
234
242
  isSelected: isOpen,
235
- onClick: handleOpenPopup,
236
243
  isDisabled: isDisabled
237
244
  }));
238
245
  },
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * Generates Typescript types for analytics events from analytics.spec.yaml
5
5
  *
6
- * @codegen <<SignedSource::d3722446f615a812f3e336474f9d8d3c>>
6
+ * @codegen <<SignedSource::f6b92bba98139798dca3a8fe75e32625>>
7
7
  * @codegenCommand yarn workspace @atlassian/analytics-tooling run analytics:codegen link-datasource
8
8
  */
9
9
  export type PackageMetaDataType = {
@@ -89,6 +89,10 @@ export type ErrorShownBasicSearchDropdownAttributesType = {
89
89
  filterType: 'project' | 'assignee' | 'issuetype' | 'status';
90
90
  reason: 'agg' | 'network' | 'unknown';
91
91
  };
92
+ export type DropdownOpenedBasicSearchDropdownAttributesType = {
93
+ filterType: 'project' | 'assignee' | 'issuetype' | 'status';
94
+ selectionCount: number;
95
+ };
92
96
  export type AqlEditorSearchedAttributesType = {};
93
97
  export type GetWorkspaceIdSuccessAttributesType = {};
94
98
  export type GetWorkspaceIdFailedAttributesType = {
@@ -161,6 +165,9 @@ export type AnalyticsEventAttributes = {
161
165
  /**
162
166
  * Fired when the basic filter search dropdown shows an error UI */
163
167
  'ui.error.shown.basicSearchDropdown': ErrorShownBasicSearchDropdownAttributesType;
168
+ /**
169
+ * Fired when the basic filter dropdown is opened */
170
+ 'ui.dropdown.opened.basicSearchDropdown': DropdownOpenedBasicSearchDropdownAttributesType;
164
171
  /**
165
172
  * Fired when search is initiated via the search icon or enter key press for aql editor input field. */
166
173
  'ui.aqlEditor.searched': AqlEditorSearchedAttributesType;
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * Generates Typescript types for analytics events from analytics.spec.yaml
5
5
  *
6
- * @codegen <<SignedSource::d3722446f615a812f3e336474f9d8d3c>>
6
+ * @codegen <<SignedSource::f6b92bba98139798dca3a8fe75e32625>>
7
7
  * @codegenCommand yarn workspace @atlassian/analytics-tooling run analytics:codegen link-datasource
8
8
  */
9
9
  export type PackageMetaDataType = {
@@ -89,6 +89,10 @@ export type ErrorShownBasicSearchDropdownAttributesType = {
89
89
  filterType: 'project' | 'assignee' | 'issuetype' | 'status';
90
90
  reason: 'agg' | 'network' | 'unknown';
91
91
  };
92
+ export type DropdownOpenedBasicSearchDropdownAttributesType = {
93
+ filterType: 'project' | 'assignee' | 'issuetype' | 'status';
94
+ selectionCount: number;
95
+ };
92
96
  export type AqlEditorSearchedAttributesType = {};
93
97
  export type GetWorkspaceIdSuccessAttributesType = {};
94
98
  export type GetWorkspaceIdFailedAttributesType = {
@@ -161,6 +165,9 @@ export type AnalyticsEventAttributes = {
161
165
  /**
162
166
  * Fired when the basic filter search dropdown shows an error UI */
163
167
  'ui.error.shown.basicSearchDropdown': ErrorShownBasicSearchDropdownAttributesType;
168
+ /**
169
+ * Fired when the basic filter dropdown is opened */
170
+ 'ui.dropdown.opened.basicSearchDropdown': DropdownOpenedBasicSearchDropdownAttributesType;
164
171
  /**
165
172
  * Fired when search is initiated via the search icon or enter key press for aql editor input field. */
166
173
  'ui.aqlEditor.searched': AqlEditorSearchedAttributesType;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/link-datasource",
3
- "version": "1.17.5",
3
+ "version": "1.17.7",
4
4
  "description": "UI Components to support linking platform dataset feature",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -30,7 +30,7 @@
30
30
  "analytics:codegen": "yarn workspace @atlassian/analytics-tooling run analytics:codegen link-datasource --output ./src/analytics/generated"
31
31
  },
32
32
  "dependencies": {
33
- "@atlaskit/adf-schema": "^32.0.0",
33
+ "@atlaskit/adf-schema": "^33.2.3",
34
34
  "@atlaskit/analytics-next": "^9.1.3",
35
35
  "@atlaskit/avatar": "^21.4.0",
36
36
  "@atlaskit/badge": "^15.1.16",
@@ -39,7 +39,7 @@
39
39
  "@atlaskit/empty-state": "^7.5.0",
40
40
  "@atlaskit/form": "^9.0.0",
41
41
  "@atlaskit/heading": "^1.4.0",
42
- "@atlaskit/icon": "^21.12.0",
42
+ "@atlaskit/icon": "^22.0.0",
43
43
  "@atlaskit/icon-object": "^6.3.0",
44
44
  "@atlaskit/image": "^1.1.0",
45
45
  "@atlaskit/intl-messages-provider": "^1.0.0",