@atlaskit/link-datasource 2.11.8 → 2.11.10

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.
Files changed (27) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/dist/cjs/hooks/useDatasourceTableState.js +2 -1
  3. package/dist/cjs/state/actions/index.js +16 -13
  4. package/dist/cjs/ui/assets-modal/search-container/aql-search-input/index.js +2 -2
  5. package/dist/cjs/ui/issue-like-table/edit-type/text/index.js +5 -1
  6. package/dist/cjs/ui/issue-like-table/styled.js +9 -6
  7. package/dist/cjs/ui/issue-like-table/table-cell-content/index.js +7 -4
  8. package/dist/cjs/ui/issue-like-table/table-cell-content/inline-edit.js +2 -2
  9. package/dist/es2019/hooks/useDatasourceTableState.js +2 -1
  10. package/dist/es2019/state/actions/index.js +13 -12
  11. package/dist/es2019/ui/assets-modal/search-container/aql-search-input/index.js +1 -1
  12. package/dist/es2019/ui/issue-like-table/edit-type/text/index.js +13 -7
  13. package/dist/es2019/ui/issue-like-table/styled.js +9 -6
  14. package/dist/es2019/ui/issue-like-table/table-cell-content/index.js +7 -4
  15. package/dist/es2019/ui/issue-like-table/table-cell-content/inline-edit.js +2 -2
  16. package/dist/esm/hooks/useDatasourceTableState.js +2 -1
  17. package/dist/esm/state/actions/index.js +16 -13
  18. package/dist/esm/ui/assets-modal/search-container/aql-search-input/index.js +1 -1
  19. package/dist/esm/ui/issue-like-table/edit-type/text/index.js +5 -1
  20. package/dist/esm/ui/issue-like-table/styled.js +9 -6
  21. package/dist/esm/ui/issue-like-table/table-cell-content/index.js +7 -4
  22. package/dist/esm/ui/issue-like-table/table-cell-content/inline-edit.js +2 -2
  23. package/dist/types/analytics/generated/analytics.types.d.ts +11 -2
  24. package/dist/types/state/actions/index.d.ts +12 -6
  25. package/dist/types-ts4.5/analytics/generated/analytics.types.d.ts +11 -2
  26. package/dist/types-ts4.5/state/actions/index.d.ts +12 -6
  27. package/package.json +4 -4
package/CHANGELOG.md CHANGED
@@ -1,5 +1,24 @@
1
1
  # @atlaskit/link-datasource
2
2
 
3
+ ## 2.11.10
4
+
5
+ ### Patch Changes
6
+
7
+ - [#130811](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/130811)
8
+ [`3e95e200fd9e8`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/3e95e200fd9e8) -
9
+ Fire event when action discovery has been successful
10
+ - Updated dependencies
11
+
12
+ ## 2.11.9
13
+
14
+ ### Patch Changes
15
+
16
+ - [#133592](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/133592)
17
+ [`4f2ae93fd3ff1`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/4f2ae93fd3ff1) -
18
+ [ux] Makes IssueLikeTable td cells have a consistent minHeight of 40px and border of 1px, and
19
+ fixes several visual bugs with the edit view of InlineEdit cell
20
+ - Updated dependencies
21
+
3
22
  ## 2.11.8
4
23
 
5
24
  ### Patch Changes
@@ -31,7 +31,8 @@ var useDatasourceTableState = exports.useDatasourceTableState = function useData
31
31
  var _useDatasourceActions = (0, _state.useDatasourceActions)(),
32
32
  onAddItems = _useDatasourceActions.onAddItems;
33
33
  var _useDiscoverActions = (0, _actions.useDiscoverActions)({
34
- captureError: captureError
34
+ captureError: captureError,
35
+ fireEvent: fireEvent
35
36
  }),
36
37
  discoverActions = _useDiscoverActions.discoverActions;
37
38
  var idFieldCount = 1;
@@ -7,13 +7,11 @@ Object.defineProperty(exports, "__esModule", {
7
7
  exports.useExecuteAtomicAction = exports.useDiscoverActions = exports.useAtomicUpdateActionSchema = exports.actions = exports.ActionsStore = void 0;
8
8
  var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
9
9
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
10
- var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
11
10
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
12
11
  var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
13
12
  var _react = require("react");
14
13
  var _reactSweetState = require("react-sweet-state");
15
14
  var _linkClientExtension = require("@atlaskit/link-client-extension");
16
- var _excluded = ["aris", "fieldKeys"];
17
15
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
18
16
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
19
17
  /**
@@ -57,10 +55,10 @@ var getInitialState = function getInitialState() {
57
55
  };
58
56
  };
59
57
  var actions = exports.actions = {
60
- discoverActions: function discoverActions(captureError, api, request) {
58
+ discoverActions: function discoverActions(captureError, fireEvent, api, request) {
61
59
  return /*#__PURE__*/function () {
62
60
  var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(_ref) {
63
- var setState, getState, response, _getState, currentActions, currentPermissions, actionsByIntegration, permissions, aris, fieldKeys, rest;
61
+ var setState, getState, response, _getState, currentActions, currentPermissions, actionsByIntegration, permissions;
64
62
  return _regenerator.default.wrap(function _callee$(_context) {
65
63
  while (1) switch (_context.prev = _context.next) {
66
64
  case 0:
@@ -87,19 +85,23 @@ var actions = exports.actions = {
87
85
  actionsByIntegration: actionsByIntegration,
88
86
  permissions: permissions
89
87
  });
88
+ fireEvent('operational.actionDiscovery.success', {
89
+ integrationKey: 'integrationKey' in request ? request.integrationKey : null,
90
+ datasourceId: 'datasourceId' in request ? request.datasourceId : null,
91
+ entityType: request.entityType,
92
+ experience: 'datasource'
93
+ });
90
94
  }
91
- _context.next = 12;
95
+ _context.next = 11;
92
96
  break;
93
97
  case 8:
94
98
  _context.prev = 8;
95
99
  _context.t0 = _context["catch"](1);
96
100
  /**
97
- * Requests can be made with datasourceId or integrationKey
98
- * We only want one of them with entityType, leave the rest out.
101
+ * captureError was already initialised with integrationKey or datasourceId
99
102
  */
100
- aris = request.aris, fieldKeys = request.fieldKeys, rest = (0, _objectWithoutProperties2.default)(request, _excluded);
101
- captureError('actionDiscovery', _context.t0, rest);
102
- case 12:
103
+ captureError('actionDiscovery', _context.t0);
104
+ case 11:
103
105
  case "end":
104
106
  return _context.stop();
105
107
  }
@@ -118,17 +120,18 @@ var ActionsStore = exports.ActionsStore = (0, _reactSweetState.createStore)({
118
120
  });
119
121
  var useActionStoreActions = (0, _reactSweetState.createActionsHook)(ActionsStore);
120
122
  var useDiscoverActions = exports.useDiscoverActions = function useDiscoverActions(_ref3) {
121
- var captureError = _ref3.captureError;
123
+ var captureError = _ref3.captureError,
124
+ fireEvent = _ref3.fireEvent;
122
125
  var _useDatasourceClientE = (0, _linkClientExtension.useDatasourceClientExtension)(),
123
126
  getDatasourceActionsAndPermissions = _useDatasourceClientE.getDatasourceActionsAndPermissions;
124
127
  var _useActionStoreAction = useActionStoreActions(),
125
128
  discoverActions = _useActionStoreAction.discoverActions;
126
129
  return {
127
130
  discoverActions: (0, _react.useMemo)(function () {
128
- return discoverActions.bind(null, captureError, {
131
+ return discoverActions.bind(null, captureError, fireEvent, {
129
132
  getDatasourceActionsAndPermissions: getDatasourceActionsAndPermissions
130
133
  });
131
- }, [captureError, discoverActions, getDatasourceActionsAndPermissions])
134
+ }, [captureError, discoverActions, fireEvent, getDatasourceActionsAndPermissions])
132
135
  };
133
136
  };
134
137
  var getFieldUpdateActionByAri = function getFieldUpdateActionByAri(state, _ref4) {
@@ -11,10 +11,10 @@ var _react2 = require("@emotion/react");
11
11
  var _reactIntlNext = require("react-intl-next");
12
12
  var _button = require("@atlaskit/button");
13
13
  var _form = require("@atlaskit/form");
14
- var _checkCircle = _interopRequireDefault(require("@atlaskit/icon/core/migration/check-circle"));
15
14
  var _crossCircle = _interopRequireDefault(require("@atlaskit/icon/core/migration/cross-circle"));
16
15
  var _questionCircle = _interopRequireDefault(require("@atlaskit/icon/core/migration/question-circle"));
17
16
  var _searchEditorSearch = _interopRequireDefault(require("@atlaskit/icon/core/migration/search--editor-search"));
17
+ var _successCheckCircle = _interopRequireDefault(require("@atlaskit/icon/core/migration/success--check-circle"));
18
18
  var _spinner = _interopRequireDefault(require("@atlaskit/spinner"));
19
19
  var _textfield = _interopRequireDefault(require("@atlaskit/textfield"));
20
20
  var _colors = require("@atlaskit/theme/colors");
@@ -60,7 +60,7 @@ var renderValidatorIcon = function renderValidatorIcon(lastValidationResult) {
60
60
  });
61
61
  }
62
62
  if (lastValidationResult.type === 'valid') {
63
- return (0, _react2.jsx)(_checkCircle.default, {
63
+ return (0, _react2.jsx)(_successCheckCircle.default, {
64
64
  label: "label",
65
65
  color: "var(--ds-icon-success, ".concat(_colors.G300, ")"),
66
66
  LEGACY_size: "medium",
@@ -15,7 +15,11 @@ var TextEditType = function TextEditType(props) {
15
15
  }, /*#__PURE__*/_react.default.createElement(_textfield.default, (0, _extends2.default)({}, props, {
16
16
  autoFocus: true,
17
17
  isCompact: true,
18
- testId: "inline-edit-text"
18
+ testId: "inline-edit-text",
19
+ style: {
20
+ // We need 8px left padding to match read only version, but there is already 1px of border
21
+ padding: "var(--ds-space-100, 8px)".concat(" calc(", "var(--ds-space-100, 8px)", " - 1px)")
22
+ }
19
23
  })));
20
24
  };
21
25
  var _default = exports.default = TextEditType;
@@ -81,10 +81,12 @@ var TableCell = exports.TableCell = _styled.default.td((_styled$td = {}, (0, _de
81
81
  padding: "var(--ds-space-050, 4px)".concat(" ", "var(--ds-space-100, 8px)"),
82
82
  border: 0,
83
83
  minWidth: 'auto',
84
+ height: '32px',
84
85
  verticalAlign: 'inherit',
85
- boxSizing: 'border-box',
86
- borderRight: "0.5px solid ".concat("var(--ds-border, ".concat(_colors.N40, ")")),
87
- borderBottom: "0.5px solid ".concat("var(--ds-border, ".concat(_colors.N40, ")")),
86
+ boxSizing: 'content-box',
87
+ // Due to padding, content-box makes td height 40px equal to InlineEdit on height of 32px
88
+ borderRight: "var(--ds-border-width, 1px)".concat(" solid ", "var(--ds-border, ".concat(_colors.N40, ")")),
89
+ borderBottom: "var(--ds-border-width, 1px)".concat(" solid ", "var(--ds-border, ".concat(_colors.N40, ")")),
88
90
  overflow: 'hidden'
89
91
  }), (0, _defineProperty2.default)(_styled$td, "".concat(withTablePluginBodyPrefix('&:first-child')), {
90
92
  paddingLeft: "var(--ds-space-100, 8px)"
@@ -103,10 +105,11 @@ var InlineEditableTableCell = exports.InlineEditableTableCell = _styled.default.
103
105
  padding: "var(--ds-space-0, 0)".concat(" ", "var(--ds-space-0, 0)"),
104
106
  border: 0,
105
107
  minWidth: 'auto',
108
+ height: '40px',
106
109
  verticalAlign: 'inherit',
107
- boxSizing: 'border-box',
108
- borderRight: "0.5px solid ".concat("var(--ds-border, ".concat(_colors.N40, ")")),
109
- borderBottom: "0.5px solid ".concat("var(--ds-border, ".concat(_colors.N40, ")")),
110
+ boxSizing: 'content-box',
111
+ borderRight: "var(--ds-border-width, 1px)".concat(" solid ", "var(--ds-border, ".concat(_colors.N40, ")")),
112
+ borderBottom: "var(--ds-border-width, 1px)".concat(" solid ", "var(--ds-border, ".concat(_colors.N40, ")")),
110
113
  overflow: 'hidden'
111
114
  }), (0, _defineProperty2.default)(_styled$td2, "".concat(withTablePluginBodyPrefix('&:last-child')), {
112
115
  borderRight: 0
@@ -15,10 +15,13 @@ var _editType = require("../edit-type");
15
15
  var _renderType = require("../render-type");
16
16
  var _truncateTextTag = require("../truncate-text-tag");
17
17
  var _inlineEdit = require("./inline-edit");
18
- var truncateTextStyles = (0, _primitives.xcss)({
18
+ var readViewStyles = (0, _primitives.xcss)({
19
19
  textOverflow: 'ellipsis',
20
20
  overflow: 'hidden',
21
- width: '100%'
21
+ width: '100%',
22
+ // Compensates for 2px from both top and bottom taken by InlneEdit (from transparent border in read-view mode and border+padding in edit view)
23
+ minHeight: 'calc(40px - 2px * 2)',
24
+ alignContent: 'center'
22
25
  });
23
26
  var TooltipWrapper = function TooltipWrapper(_ref) {
24
27
  var columnKey = _ref.columnKey,
@@ -98,7 +101,7 @@ var InlineEditableCell = function InlineEditableCell(_ref3) {
98
101
  testId: "inline-edit-read-view",
99
102
  paddingInline: isEditable ? 'space.075' : 'space.100',
100
103
  paddingBlock: "space.050",
101
- xcss: truncateTextStyles
104
+ xcss: readViewStyles
102
105
  }, renderItem(values)));
103
106
  if (!isEditable) {
104
107
  return readView;
@@ -149,7 +152,7 @@ var TableCellContent = exports.TableCellContent = function TableCellContent(_ref
149
152
  testId: "inline-edit-read-view",
150
153
  paddingInline: "space.100",
151
154
  paddingBlock: "space.050",
152
- xcss: truncateTextStyles
155
+ xcss: readViewStyles
153
156
  }, /*#__PURE__*/_react.default.createElement(ReadOnlyCell, {
154
157
  id: id,
155
158
  columnKey: columnKey,
@@ -21,7 +21,7 @@ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return
21
21
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof3(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
22
22
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
23
23
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
24
- var containerStyles = (0, _primitives.xcss)({
24
+ var editContainerStyles = (0, _primitives.xcss)({
25
25
  marginBlockStart: 'space.negative.100'
26
26
  });
27
27
  var mapUpdatedItem = function mapUpdatedItem(type, existingItem, columnKey, newValue) {
@@ -82,7 +82,7 @@ var InlineEdit = exports.InlineEdit = function InlineEdit(_ref) {
82
82
  setIsEditing(false);
83
83
  }, [item, datasourceTypeWithValues.type, columnKey, onUpdateItem, ari, execute, showErrorFlag, captureError]);
84
84
  return /*#__PURE__*/_react.default.createElement(_primitives.Box, {
85
- xcss: containerStyles
85
+ xcss: editContainerStyles
86
86
  }, /*#__PURE__*/_react.default.createElement(_inlineEdit.default, (0, _extends2.default)({}, (0, _editType.editType)(datasourceTypeWithValues), {
87
87
  hideActionButtons: true,
88
88
  readView: function readView() {
@@ -25,7 +25,8 @@ export const useDatasourceTableState = ({
25
25
  const {
26
26
  discoverActions
27
27
  } = useDiscoverActions({
28
- captureError
28
+ captureError,
29
+ fireEvent
29
30
  });
30
31
  const idFieldCount = 1;
31
32
  const keyFieldCount = 1;
@@ -41,7 +41,7 @@ const getInitialState = () => ({
41
41
  permissions: {}
42
42
  });
43
43
  export const actions = {
44
- discoverActions: (captureError, api, request) => async ({
44
+ discoverActions: (captureError, fireEvent, api, request) => async ({
45
45
  setState,
46
46
  getState
47
47
  }) => {
@@ -75,18 +75,18 @@ export const actions = {
75
75
  actionsByIntegration,
76
76
  permissions
77
77
  });
78
+ fireEvent('operational.actionDiscovery.success', {
79
+ integrationKey: 'integrationKey' in request ? request.integrationKey : null,
80
+ datasourceId: 'datasourceId' in request ? request.datasourceId : null,
81
+ entityType: request.entityType,
82
+ experience: 'datasource'
83
+ });
78
84
  }
79
85
  } catch (error) {
80
86
  /**
81
- * Requests can be made with datasourceId or integrationKey
82
- * We only want one of them with entityType, leave the rest out.
87
+ * captureError was already initialised with integrationKey or datasourceId
83
88
  */
84
- const {
85
- aris,
86
- fieldKeys,
87
- ...rest
88
- } = request;
89
- captureError('actionDiscovery', error, rest);
89
+ captureError('actionDiscovery', error);
90
90
  }
91
91
  }
92
92
  };
@@ -97,7 +97,8 @@ export const ActionsStore = createStore({
97
97
  });
98
98
  const useActionStoreActions = createActionsHook(ActionsStore);
99
99
  export const useDiscoverActions = ({
100
- captureError
100
+ captureError,
101
+ fireEvent
101
102
  }) => {
102
103
  const {
103
104
  getDatasourceActionsAndPermissions
@@ -106,9 +107,9 @@ export const useDiscoverActions = ({
106
107
  discoverActions
107
108
  } = useActionStoreActions();
108
109
  return {
109
- discoverActions: useMemo(() => discoverActions.bind(null, captureError, {
110
+ discoverActions: useMemo(() => discoverActions.bind(null, captureError, fireEvent, {
110
111
  getDatasourceActionsAndPermissions
111
- }), [captureError, discoverActions, getDatasourceActionsAndPermissions])
112
+ }), [captureError, discoverActions, fireEvent, getDatasourceActionsAndPermissions])
112
113
  };
113
114
  };
114
115
  const getFieldUpdateActionByAri = (state, {
@@ -10,10 +10,10 @@ import { css, jsx } from '@emotion/react';
10
10
  import { useIntl } from 'react-intl-next';
11
11
  import { LoadingButton } from '@atlaskit/button';
12
12
  import { ErrorMessage, Field } from '@atlaskit/form';
13
- import CheckCircleIcon from '@atlaskit/icon/core/migration/check-circle';
14
13
  import CrossCircleIcon from '@atlaskit/icon/core/migration/cross-circle';
15
14
  import QuestionCircleIcon from '@atlaskit/icon/core/migration/question-circle';
16
15
  import SearchIcon from '@atlaskit/icon/core/migration/search--editor-search';
16
+ import CheckCircleIcon from '@atlaskit/icon/core/migration/success--check-circle';
17
17
  import Spinner from '@atlaskit/spinner';
18
18
  import Textfield from '@atlaskit/textfield';
19
19
  import { G300, N500, R400 } from '@atlaskit/theme/colors';
@@ -2,11 +2,17 @@ import _extends from "@babel/runtime/helpers/extends";
2
2
  import React from 'react';
3
3
  import { UNSAFE_LAYERING } from '@atlaskit/layering';
4
4
  import Textfield from '@atlaskit/textfield';
5
- const TextEditType = props => /*#__PURE__*/React.createElement(UNSAFE_LAYERING, {
6
- isDisabled: false
7
- }, /*#__PURE__*/React.createElement(Textfield, _extends({}, props, {
8
- autoFocus: true,
9
- isCompact: true,
10
- testId: "inline-edit-text"
11
- })));
5
+ const TextEditType = props => {
6
+ return /*#__PURE__*/React.createElement(UNSAFE_LAYERING, {
7
+ isDisabled: false
8
+ }, /*#__PURE__*/React.createElement(Textfield, _extends({}, props, {
9
+ autoFocus: true,
10
+ isCompact: true,
11
+ testId: "inline-edit-text",
12
+ style: {
13
+ // We need 8px left padding to match read only version, but there is already 1px of border
14
+ padding: `${"var(--ds-space-100, 8px)"} calc(${"var(--ds-space-100, 8px)"} - 1px)`
15
+ }
16
+ })));
17
+ };
12
18
  export default TextEditType;
@@ -87,10 +87,12 @@ export const TableCell = styled.td({
87
87
  padding: `${"var(--ds-space-050, 4px)"} ${"var(--ds-space-100, 8px)"}`,
88
88
  border: 0,
89
89
  minWidth: 'auto',
90
+ height: '32px',
90
91
  verticalAlign: 'inherit',
91
- boxSizing: 'border-box',
92
- borderRight: `0.5px solid ${`var(--ds-border, ${N40})`}`,
93
- borderBottom: `0.5px solid ${`var(--ds-border, ${N40})`}`,
92
+ boxSizing: 'content-box',
93
+ // Due to padding, content-box makes td height 40px equal to InlineEdit on height of 32px
94
+ borderRight: `${"var(--ds-border-width, 1px)"} solid ${`var(--ds-border, ${N40})`}`,
95
+ borderBottom: `${"var(--ds-border-width, 1px)"} solid ${`var(--ds-border, ${N40})`}`,
94
96
  overflow: 'hidden'
95
97
  },
96
98
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
@@ -120,10 +122,11 @@ export const InlineEditableTableCell = styled.td({
120
122
  padding: `${"var(--ds-space-0, 0)"} ${"var(--ds-space-0, 0)"}`,
121
123
  border: 0,
122
124
  minWidth: 'auto',
125
+ height: '40px',
123
126
  verticalAlign: 'inherit',
124
- boxSizing: 'border-box',
125
- borderRight: `0.5px solid ${`var(--ds-border, ${N40})`}`,
126
- borderBottom: `0.5px solid ${`var(--ds-border, ${N40})`}`,
127
+ boxSizing: 'content-box',
128
+ borderRight: `${"var(--ds-border-width, 1px)"} solid ${`var(--ds-border, ${N40})`}`,
129
+ borderBottom: `${"var(--ds-border-width, 1px)"} solid ${`var(--ds-border, ${N40})`}`,
127
130
  overflow: 'hidden'
128
131
  },
129
132
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
@@ -8,10 +8,13 @@ import { isEditTypeSupported } from '../edit-type';
8
8
  import { stringifyType } from '../render-type';
9
9
  import { TruncateTextTag } from '../truncate-text-tag';
10
10
  import { InlineEdit } from './inline-edit';
11
- const truncateTextStyles = xcss({
11
+ const readViewStyles = xcss({
12
12
  textOverflow: 'ellipsis',
13
13
  overflow: 'hidden',
14
- width: '100%'
14
+ width: '100%',
15
+ // Compensates for 2px from both top and bottom taken by InlneEdit (from transparent border in read-view mode and border+padding in edit view)
16
+ minHeight: 'calc(40px - 2px * 2)',
17
+ alignContent: 'center'
15
18
  });
16
19
  const TooltipWrapper = ({
17
20
  columnKey,
@@ -91,7 +94,7 @@ const InlineEditableCell = ({
91
94
  testId: "inline-edit-read-view",
92
95
  paddingInline: isEditable ? 'space.075' : 'space.100',
93
96
  paddingBlock: "space.050",
94
- xcss: truncateTextStyles
97
+ xcss: readViewStyles
95
98
  }, renderItem(values)));
96
99
  if (!isEditable) {
97
100
  return readView;
@@ -145,7 +148,7 @@ export const TableCellContent = ({
145
148
  testId: "inline-edit-read-view",
146
149
  paddingInline: "space.100",
147
150
  paddingBlock: "space.050",
148
- xcss: truncateTextStyles
151
+ xcss: readViewStyles
149
152
  }, /*#__PURE__*/React.createElement(ReadOnlyCell, {
150
153
  id: id,
151
154
  columnKey: columnKey,
@@ -6,7 +6,7 @@ import { useDatasourceTableFlag } from '../../../hooks/useDatasourceTableFlag';
6
6
  import useErrorLogger from '../../../hooks/useErrorLogger';
7
7
  import { useDatasourceActions, useDatasourceItem } from '../../../state';
8
8
  import { editType } from '../edit-type';
9
- const containerStyles = xcss({
9
+ const editContainerStyles = xcss({
10
10
  marginBlockStart: 'space.negative.100'
11
11
  });
12
12
  const mapUpdatedItem = (type, existingItem, columnKey, newValue) => {
@@ -71,7 +71,7 @@ export const InlineEdit = ({
71
71
  setIsEditing(false);
72
72
  }, [item, datasourceTypeWithValues.type, columnKey, onUpdateItem, ari, execute, showErrorFlag, captureError]);
73
73
  return /*#__PURE__*/React.createElement(Box, {
74
- xcss: containerStyles
74
+ xcss: editContainerStyles
75
75
  }, /*#__PURE__*/React.createElement(AKInlineEdit, _extends({}, editType(datasourceTypeWithValues), {
76
76
  hideActionButtons: true,
77
77
  readView: () => readView,
@@ -24,7 +24,8 @@ export var useDatasourceTableState = function useDatasourceTableState(_ref) {
24
24
  var _useDatasourceActions = useDatasourceActions(),
25
25
  onAddItems = _useDatasourceActions.onAddItems;
26
26
  var _useDiscoverActions = useDiscoverActions({
27
- captureError: captureError
27
+ captureError: captureError,
28
+ fireEvent: fireEvent
28
29
  }),
29
30
  discoverActions = _useDiscoverActions.discoverActions;
30
31
  var idFieldCount = 1;
@@ -1,8 +1,6 @@
1
1
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
2
- import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
2
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
4
3
  import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
5
- var _excluded = ["aris", "fieldKeys"];
6
4
  import _regeneratorRuntime from "@babel/runtime/regenerator";
7
5
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
8
6
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
@@ -51,10 +49,10 @@ var getInitialState = function getInitialState() {
51
49
  };
52
50
  };
53
51
  export var actions = {
54
- discoverActions: function discoverActions(captureError, api, request) {
52
+ discoverActions: function discoverActions(captureError, fireEvent, api, request) {
55
53
  return /*#__PURE__*/function () {
56
54
  var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref) {
57
- var setState, getState, response, _getState, currentActions, currentPermissions, actionsByIntegration, permissions, aris, fieldKeys, rest;
55
+ var setState, getState, response, _getState, currentActions, currentPermissions, actionsByIntegration, permissions;
58
56
  return _regeneratorRuntime.wrap(function _callee$(_context) {
59
57
  while (1) switch (_context.prev = _context.next) {
60
58
  case 0:
@@ -81,19 +79,23 @@ export var actions = {
81
79
  actionsByIntegration: actionsByIntegration,
82
80
  permissions: permissions
83
81
  });
82
+ fireEvent('operational.actionDiscovery.success', {
83
+ integrationKey: 'integrationKey' in request ? request.integrationKey : null,
84
+ datasourceId: 'datasourceId' in request ? request.datasourceId : null,
85
+ entityType: request.entityType,
86
+ experience: 'datasource'
87
+ });
84
88
  }
85
- _context.next = 12;
89
+ _context.next = 11;
86
90
  break;
87
91
  case 8:
88
92
  _context.prev = 8;
89
93
  _context.t0 = _context["catch"](1);
90
94
  /**
91
- * Requests can be made with datasourceId or integrationKey
92
- * We only want one of them with entityType, leave the rest out.
95
+ * captureError was already initialised with integrationKey or datasourceId
93
96
  */
94
- aris = request.aris, fieldKeys = request.fieldKeys, rest = _objectWithoutProperties(request, _excluded);
95
- captureError('actionDiscovery', _context.t0, rest);
96
- case 12:
97
+ captureError('actionDiscovery', _context.t0);
98
+ case 11:
97
99
  case "end":
98
100
  return _context.stop();
99
101
  }
@@ -112,17 +114,18 @@ export var ActionsStore = createStore({
112
114
  });
113
115
  var useActionStoreActions = createActionsHook(ActionsStore);
114
116
  export var useDiscoverActions = function useDiscoverActions(_ref3) {
115
- var captureError = _ref3.captureError;
117
+ var captureError = _ref3.captureError,
118
+ fireEvent = _ref3.fireEvent;
116
119
  var _useDatasourceClientE = useDatasourceClientExtension(),
117
120
  getDatasourceActionsAndPermissions = _useDatasourceClientE.getDatasourceActionsAndPermissions;
118
121
  var _useActionStoreAction = useActionStoreActions(),
119
122
  discoverActions = _useActionStoreAction.discoverActions;
120
123
  return {
121
124
  discoverActions: useMemo(function () {
122
- return discoverActions.bind(null, captureError, {
125
+ return discoverActions.bind(null, captureError, fireEvent, {
123
126
  getDatasourceActionsAndPermissions: getDatasourceActionsAndPermissions
124
127
  });
125
- }, [captureError, discoverActions, getDatasourceActionsAndPermissions])
128
+ }, [captureError, discoverActions, fireEvent, getDatasourceActionsAndPermissions])
126
129
  };
127
130
  };
128
131
  var getFieldUpdateActionByAri = function getFieldUpdateActionByAri(state, _ref4) {
@@ -10,10 +10,10 @@ import { css, jsx } from '@emotion/react';
10
10
  import { useIntl } from 'react-intl-next';
11
11
  import { LoadingButton } from '@atlaskit/button';
12
12
  import { ErrorMessage, Field } from '@atlaskit/form';
13
- import CheckCircleIcon from '@atlaskit/icon/core/migration/check-circle';
14
13
  import CrossCircleIcon from '@atlaskit/icon/core/migration/cross-circle';
15
14
  import QuestionCircleIcon from '@atlaskit/icon/core/migration/question-circle';
16
15
  import SearchIcon from '@atlaskit/icon/core/migration/search--editor-search';
16
+ import CheckCircleIcon from '@atlaskit/icon/core/migration/success--check-circle';
17
17
  import Spinner from '@atlaskit/spinner';
18
18
  import Textfield from '@atlaskit/textfield';
19
19
  import { G300, N500, R400 } from '@atlaskit/theme/colors';
@@ -8,7 +8,11 @@ var TextEditType = function TextEditType(props) {
8
8
  }, /*#__PURE__*/React.createElement(Textfield, _extends({}, props, {
9
9
  autoFocus: true,
10
10
  isCompact: true,
11
- testId: "inline-edit-text"
11
+ testId: "inline-edit-text",
12
+ style: {
13
+ // We need 8px left padding to match read only version, but there is already 1px of border
14
+ padding: "var(--ds-space-100, 8px)".concat(" calc(", "var(--ds-space-100, 8px)", " - 1px)")
15
+ }
12
16
  })));
13
17
  };
14
18
  export default TextEditType;
@@ -75,10 +75,12 @@ export var TableCell = styled.td((_styled$td = {}, _defineProperty(_styled$td, "
75
75
  padding: "var(--ds-space-050, 4px)".concat(" ", "var(--ds-space-100, 8px)"),
76
76
  border: 0,
77
77
  minWidth: 'auto',
78
+ height: '32px',
78
79
  verticalAlign: 'inherit',
79
- boxSizing: 'border-box',
80
- borderRight: "0.5px solid ".concat("var(--ds-border, ".concat(N40, ")")),
81
- borderBottom: "0.5px solid ".concat("var(--ds-border, ".concat(N40, ")")),
80
+ boxSizing: 'content-box',
81
+ // Due to padding, content-box makes td height 40px equal to InlineEdit on height of 32px
82
+ borderRight: "var(--ds-border-width, 1px)".concat(" solid ", "var(--ds-border, ".concat(N40, ")")),
83
+ borderBottom: "var(--ds-border-width, 1px)".concat(" solid ", "var(--ds-border, ".concat(N40, ")")),
82
84
  overflow: 'hidden'
83
85
  }), _defineProperty(_styled$td, "".concat(withTablePluginBodyPrefix('&:first-child')), {
84
86
  paddingLeft: "var(--ds-space-100, 8px)"
@@ -97,10 +99,11 @@ export var InlineEditableTableCell = styled.td((_styled$td2 = {}, _definePropert
97
99
  padding: "var(--ds-space-0, 0)".concat(" ", "var(--ds-space-0, 0)"),
98
100
  border: 0,
99
101
  minWidth: 'auto',
102
+ height: '40px',
100
103
  verticalAlign: 'inherit',
101
- boxSizing: 'border-box',
102
- borderRight: "0.5px solid ".concat("var(--ds-border, ".concat(N40, ")")),
103
- borderBottom: "0.5px solid ".concat("var(--ds-border, ".concat(N40, ")")),
104
+ boxSizing: 'content-box',
105
+ borderRight: "var(--ds-border-width, 1px)".concat(" solid ", "var(--ds-border, ".concat(N40, ")")),
106
+ borderBottom: "var(--ds-border-width, 1px)".concat(" solid ", "var(--ds-border, ".concat(N40, ")")),
104
107
  overflow: 'hidden'
105
108
  }), _defineProperty(_styled$td2, "".concat(withTablePluginBodyPrefix('&:last-child')), {
106
109
  borderRight: 0
@@ -8,10 +8,13 @@ import { isEditTypeSupported } from '../edit-type';
8
8
  import { stringifyType } from '../render-type';
9
9
  import { TruncateTextTag } from '../truncate-text-tag';
10
10
  import { InlineEdit } from './inline-edit';
11
- var truncateTextStyles = xcss({
11
+ var readViewStyles = xcss({
12
12
  textOverflow: 'ellipsis',
13
13
  overflow: 'hidden',
14
- width: '100%'
14
+ width: '100%',
15
+ // Compensates for 2px from both top and bottom taken by InlneEdit (from transparent border in read-view mode and border+padding in edit view)
16
+ minHeight: 'calc(40px - 2px * 2)',
17
+ alignContent: 'center'
15
18
  });
16
19
  var TooltipWrapper = function TooltipWrapper(_ref) {
17
20
  var columnKey = _ref.columnKey,
@@ -91,7 +94,7 @@ var InlineEditableCell = function InlineEditableCell(_ref3) {
91
94
  testId: "inline-edit-read-view",
92
95
  paddingInline: isEditable ? 'space.075' : 'space.100',
93
96
  paddingBlock: "space.050",
94
- xcss: truncateTextStyles
97
+ xcss: readViewStyles
95
98
  }, renderItem(values)));
96
99
  if (!isEditable) {
97
100
  return readView;
@@ -142,7 +145,7 @@ export var TableCellContent = function TableCellContent(_ref4) {
142
145
  testId: "inline-edit-read-view",
143
146
  paddingInline: "space.100",
144
147
  paddingBlock: "space.050",
145
- xcss: truncateTextStyles
148
+ xcss: readViewStyles
146
149
  }, /*#__PURE__*/React.createElement(ReadOnlyCell, {
147
150
  id: id,
148
151
  columnKey: columnKey,
@@ -11,7 +11,7 @@ import { useDatasourceTableFlag } from '../../../hooks/useDatasourceTableFlag';
11
11
  import useErrorLogger from '../../../hooks/useErrorLogger';
12
12
  import { useDatasourceActions, useDatasourceItem } from '../../../state';
13
13
  import { editType } from '../edit-type';
14
- var containerStyles = xcss({
14
+ var editContainerStyles = xcss({
15
15
  marginBlockStart: 'space.negative.100'
16
16
  });
17
17
  var mapUpdatedItem = function mapUpdatedItem(type, existingItem, columnKey, newValue) {
@@ -72,7 +72,7 @@ export var InlineEdit = function InlineEdit(_ref) {
72
72
  setIsEditing(false);
73
73
  }, [item, datasourceTypeWithValues.type, columnKey, onUpdateItem, ari, execute, showErrorFlag, captureError]);
74
74
  return /*#__PURE__*/React.createElement(Box, {
75
- xcss: containerStyles
75
+ xcss: editContainerStyles
76
76
  }, /*#__PURE__*/React.createElement(AKInlineEdit, _extends({}, editType(datasourceTypeWithValues), {
77
77
  hideActionButtons: true,
78
78
  readView: function readView() {
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * Generates Typescript types for analytics events from analytics.spec.yaml
5
5
  *
6
- * @codegen <<SignedSource::a526398bbb8839b31c26c69ef2845c19>>
6
+ * @codegen <<SignedSource::26fd2d06084d185e97be01b2070484ff>>
7
7
  * @codegenCommand yarn workspace @atlassian/analytics-tooling run analytics:codegen link-datasource
8
8
  */
9
9
  export type ComponentMetaDataType = {
@@ -78,8 +78,8 @@ export type ProviderAuthSuccessAttributesType = {
78
78
  };
79
79
  export type ProviderAuthFailureAttributesType = {
80
80
  extensionKey: string | null;
81
- reason: 'auth_window_closed' | 'invalid_request' | 'unauthorized_client' | 'access_denied' | 'unsupported_response_type' | 'invalid_scope' | 'server_error' | 'temporarily_unavailable' | 'authclientoauth2.autherror' | null;
82
81
  experience: 'datasource';
82
+ reason: 'auth_window_closed' | 'invalid_request' | 'unauthorized_client' | 'access_denied' | 'unsupported_response_type' | 'invalid_scope' | 'server_error' | 'temporarily_unavailable' | 'authclientoauth2.autherror' | null;
83
83
  };
84
84
  export type NextItemLoadedAttributesType = {
85
85
  destinationObjectTypes: unknown[];
@@ -141,6 +141,12 @@ export type ObjectSchemasSuccessAttributesType = {};
141
141
  export type ObjectSchemasFailedAttributesType = {
142
142
  statusCodeGroup: '1xx' | '3xx' | '4xx' | '5xx' | 'unknown';
143
143
  };
144
+ export type ActionDiscoverySuccessAttributesType = {
145
+ experience: 'datasource';
146
+ entityType: string;
147
+ integrationKey: string | null;
148
+ datasourceId: string | null;
149
+ };
144
150
  export type AnalyticsEventAttributes = {
145
151
  /**
146
152
  * Fires when user sees modal dialog. */
@@ -250,5 +256,8 @@ export type AnalyticsEventAttributes = {
250
256
  /**
251
257
  * Fired when fetching object schemas fails. */
252
258
  'operational.objectSchemas.failed': ObjectSchemasFailedAttributesType;
259
+ /**
260
+ * Fired when the action discovery and permissions request is successful. */
261
+ 'operational.actionDiscovery.success': ActionDiscoverySuccessAttributesType;
253
262
  };
254
263
  export type EventKey = keyof AnalyticsEventAttributes;
@@ -1,6 +1,8 @@
1
1
  import { type Action } from 'react-sweet-state';
2
2
  import { useDatasourceClientExtension } from '@atlaskit/link-client-extension';
3
3
  import type { ActionsDiscoveryRequest, AtomicActionInterface } from '@atlaskit/linking-types';
4
+ import { type EventKey } from '../../../src/analytics/generated/analytics.types';
5
+ import type createEventPayload from '../../../src/analytics/generated/create-event-payload';
4
6
  type IntegrationKey = string;
5
7
  type FieldKey = string;
6
8
  /**
@@ -47,22 +49,26 @@ export interface ActionsStoreState {
47
49
  interface Client {
48
50
  getDatasourceActionsAndPermissions: ReturnType<typeof useDatasourceClientExtension>['getDatasourceActionsAndPermissions'];
49
51
  }
52
+ type AnalyticsCaptureError = (errorLocation: string, error: unknown) => void;
53
+ type AnalyticsFireEvent = <K extends EventKey>(...params: Parameters<typeof createEventPayload<K>>) => void;
54
+ interface UseDiscoverActionsProps {
55
+ captureError: AnalyticsCaptureError;
56
+ fireEvent: AnalyticsFireEvent;
57
+ }
50
58
  export declare const actions: {
51
- discoverActions: (captureError: (errorLocation: string, error: unknown, extraInfo?: Record<string, any>) => void, api: Client, request: ActionsDiscoveryRequest) => Action<ActionsStoreState>;
59
+ discoverActions: (captureError: AnalyticsCaptureError, fireEvent: AnalyticsFireEvent, api: Client, request: ActionsDiscoveryRequest) => Action<ActionsStoreState>;
52
60
  };
53
61
  export declare const ActionsStore: import("react-sweet-state").Store<ActionsStoreState, {
54
- discoverActions: (captureError: (errorLocation: string, error: unknown, extraInfo?: Record<string, any>) => void, api: Client, request: ActionsDiscoveryRequest) => Action<ActionsStoreState>;
62
+ discoverActions: (captureError: AnalyticsCaptureError, fireEvent: AnalyticsFireEvent, api: Client, request: ActionsDiscoveryRequest) => Action<ActionsStoreState>;
55
63
  }>;
56
- export declare const useDiscoverActions: ({ captureError, }: {
57
- captureError: (errorLocation: string, error: unknown, extraInfo?: Record<string, any>) => void;
58
- }) => {
64
+ export declare const useDiscoverActions: ({ captureError, fireEvent }: UseDiscoverActionsProps) => {
59
65
  discoverActions: (request: ActionsDiscoveryRequest) => void | Promise<void>;
60
66
  };
61
67
  /**
62
68
  * Retrieves the action schema for a given ARI + fieldKey + integrationKey
63
69
  */
64
70
  export declare const useAtomicUpdateActionSchema: import("react-sweet-state").HookFunction<Pick<AtomicActionInterface, "actionKey" | "type" | "description"> | undefined, import("react-sweet-state").BoundActions<ActionsStoreState, {
65
- discoverActions: (captureError: (errorLocation: string, error: unknown, extraInfo?: Record<string, any>) => void, api: Client, request: ActionsDiscoveryRequest) => Action<ActionsStoreState>;
71
+ discoverActions: (captureError: AnalyticsCaptureError, fireEvent: AnalyticsFireEvent, api: Client, request: ActionsDiscoveryRequest) => Action<ActionsStoreState>;
66
72
  }>, {
67
73
  ari: string;
68
74
  fieldKey: string;
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * Generates Typescript types for analytics events from analytics.spec.yaml
5
5
  *
6
- * @codegen <<SignedSource::a526398bbb8839b31c26c69ef2845c19>>
6
+ * @codegen <<SignedSource::26fd2d06084d185e97be01b2070484ff>>
7
7
  * @codegenCommand yarn workspace @atlassian/analytics-tooling run analytics:codegen link-datasource
8
8
  */
9
9
  export type ComponentMetaDataType = {
@@ -78,8 +78,8 @@ export type ProviderAuthSuccessAttributesType = {
78
78
  };
79
79
  export type ProviderAuthFailureAttributesType = {
80
80
  extensionKey: string | null;
81
- reason: 'auth_window_closed' | 'invalid_request' | 'unauthorized_client' | 'access_denied' | 'unsupported_response_type' | 'invalid_scope' | 'server_error' | 'temporarily_unavailable' | 'authclientoauth2.autherror' | null;
82
81
  experience: 'datasource';
82
+ reason: 'auth_window_closed' | 'invalid_request' | 'unauthorized_client' | 'access_denied' | 'unsupported_response_type' | 'invalid_scope' | 'server_error' | 'temporarily_unavailable' | 'authclientoauth2.autherror' | null;
83
83
  };
84
84
  export type NextItemLoadedAttributesType = {
85
85
  destinationObjectTypes: unknown[];
@@ -141,6 +141,12 @@ export type ObjectSchemasSuccessAttributesType = {};
141
141
  export type ObjectSchemasFailedAttributesType = {
142
142
  statusCodeGroup: '1xx' | '3xx' | '4xx' | '5xx' | 'unknown';
143
143
  };
144
+ export type ActionDiscoverySuccessAttributesType = {
145
+ experience: 'datasource';
146
+ entityType: string;
147
+ integrationKey: string | null;
148
+ datasourceId: string | null;
149
+ };
144
150
  export type AnalyticsEventAttributes = {
145
151
  /**
146
152
  * Fires when user sees modal dialog. */
@@ -250,5 +256,8 @@ export type AnalyticsEventAttributes = {
250
256
  /**
251
257
  * Fired when fetching object schemas fails. */
252
258
  'operational.objectSchemas.failed': ObjectSchemasFailedAttributesType;
259
+ /**
260
+ * Fired when the action discovery and permissions request is successful. */
261
+ 'operational.actionDiscovery.success': ActionDiscoverySuccessAttributesType;
253
262
  };
254
263
  export type EventKey = keyof AnalyticsEventAttributes;
@@ -1,6 +1,8 @@
1
1
  import { type Action } from 'react-sweet-state';
2
2
  import { useDatasourceClientExtension } from '@atlaskit/link-client-extension';
3
3
  import type { ActionsDiscoveryRequest, AtomicActionInterface } from '@atlaskit/linking-types';
4
+ import { type EventKey } from '../../../src/analytics/generated/analytics.types';
5
+ import type createEventPayload from '../../../src/analytics/generated/create-event-payload';
4
6
  type IntegrationKey = string;
5
7
  type FieldKey = string;
6
8
  /**
@@ -47,22 +49,26 @@ export interface ActionsStoreState {
47
49
  interface Client {
48
50
  getDatasourceActionsAndPermissions: ReturnType<typeof useDatasourceClientExtension>['getDatasourceActionsAndPermissions'];
49
51
  }
52
+ type AnalyticsCaptureError = (errorLocation: string, error: unknown) => void;
53
+ type AnalyticsFireEvent = <K extends EventKey>(...params: Parameters<typeof createEventPayload<K>>) => void;
54
+ interface UseDiscoverActionsProps {
55
+ captureError: AnalyticsCaptureError;
56
+ fireEvent: AnalyticsFireEvent;
57
+ }
50
58
  export declare const actions: {
51
- discoverActions: (captureError: (errorLocation: string, error: unknown, extraInfo?: Record<string, any>) => void, api: Client, request: ActionsDiscoveryRequest) => Action<ActionsStoreState>;
59
+ discoverActions: (captureError: AnalyticsCaptureError, fireEvent: AnalyticsFireEvent, api: Client, request: ActionsDiscoveryRequest) => Action<ActionsStoreState>;
52
60
  };
53
61
  export declare const ActionsStore: import("react-sweet-state").Store<ActionsStoreState, {
54
- discoverActions: (captureError: (errorLocation: string, error: unknown, extraInfo?: Record<string, any>) => void, api: Client, request: ActionsDiscoveryRequest) => Action<ActionsStoreState>;
62
+ discoverActions: (captureError: AnalyticsCaptureError, fireEvent: AnalyticsFireEvent, api: Client, request: ActionsDiscoveryRequest) => Action<ActionsStoreState>;
55
63
  }>;
56
- export declare const useDiscoverActions: ({ captureError, }: {
57
- captureError: (errorLocation: string, error: unknown, extraInfo?: Record<string, any>) => void;
58
- }) => {
64
+ export declare const useDiscoverActions: ({ captureError, fireEvent }: UseDiscoverActionsProps) => {
59
65
  discoverActions: (request: ActionsDiscoveryRequest) => void | Promise<void>;
60
66
  };
61
67
  /**
62
68
  * Retrieves the action schema for a given ARI + fieldKey + integrationKey
63
69
  */
64
70
  export declare const useAtomicUpdateActionSchema: import("react-sweet-state").HookFunction<Pick<AtomicActionInterface, "actionKey" | "type" | "description"> | undefined, import("react-sweet-state").BoundActions<ActionsStoreState, {
65
- discoverActions: (captureError: (errorLocation: string, error: unknown, extraInfo?: Record<string, any>) => void, api: Client, request: ActionsDiscoveryRequest) => Action<ActionsStoreState>;
71
+ discoverActions: (captureError: AnalyticsCaptureError, fireEvent: AnalyticsFireEvent, api: Client, request: ActionsDiscoveryRequest) => Action<ActionsStoreState>;
66
72
  }>, {
67
73
  ari: string;
68
74
  fieldKey: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/link-datasource",
3
- "version": "2.11.8",
3
+ "version": "2.11.10",
4
4
  "description": "UI Components to support linking platform dataset feature",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -49,7 +49,7 @@
49
49
  "@atlaskit/flag": "^15.8.0",
50
50
  "@atlaskit/form": "^10.5.0",
51
51
  "@atlaskit/heading": "^2.4.0",
52
- "@atlaskit/icon": "^22.14.0",
52
+ "@atlaskit/icon": "^22.15.0",
53
53
  "@atlaskit/icon-object": "^6.5.0",
54
54
  "@atlaskit/image": "^1.3.0",
55
55
  "@atlaskit/inline-edit": "^13.7.0",
@@ -58,7 +58,7 @@
58
58
  "@atlaskit/jql-editor": "^4.5.0",
59
59
  "@atlaskit/jql-editor-autocomplete-rest": "^2.0.0",
60
60
  "@atlaskit/layering": "^0.4.0",
61
- "@atlaskit/link-client-extension": "^2.1.0",
61
+ "@atlaskit/link-client-extension": "^2.2.0",
62
62
  "@atlaskit/linking-common": "^5.11.0",
63
63
  "@atlaskit/linking-types": "^9.0.0",
64
64
  "@atlaskit/logo": "^14.2.0",
@@ -73,7 +73,7 @@
73
73
  "@atlaskit/pragmatic-drag-and-drop-react-drop-indicator": "^1.1.0",
74
74
  "@atlaskit/primitives": "^12.0.0",
75
75
  "@atlaskit/select": "^17.15.0",
76
- "@atlaskit/smart-card": "^27.17.0",
76
+ "@atlaskit/smart-card": "^27.18.0",
77
77
  "@atlaskit/smart-user-picker": "6.10.2",
78
78
  "@atlaskit/spinner": "^16.3.0",
79
79
  "@atlaskit/tag": "^12.5.0",