@atlaskit/link-datasource 2.11.6 → 2.11.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 +9 -0
- package/dist/cjs/hooks/useDatasourceTableState.js +3 -1
- package/dist/cjs/hooks/useErrorLogger.js +8 -7
- package/dist/cjs/state/actions/index.js +33 -18
- package/dist/cjs/ui/issue-like-table/table-cell-content/index.js +1 -0
- package/dist/cjs/ui/issue-like-table/table-cell-content/inline-edit.js +8 -1
- package/dist/es2019/hooks/useDatasourceTableState.js +3 -1
- package/dist/es2019/hooks/useErrorLogger.js +5 -7
- package/dist/es2019/state/actions/index.js +47 -32
- package/dist/es2019/ui/issue-like-table/table-cell-content/index.js +1 -0
- package/dist/es2019/ui/issue-like-table/table-cell-content/inline-edit.js +9 -1
- package/dist/esm/hooks/useDatasourceTableState.js +3 -1
- package/dist/esm/hooks/useErrorLogger.js +8 -8
- package/dist/esm/state/actions/index.js +33 -18
- package/dist/esm/ui/issue-like-table/table-cell-content/index.js +1 -0
- package/dist/esm/ui/issue-like-table/table-cell-content/inline-edit.js +8 -1
- package/dist/types/hooks/useErrorLogger.d.ts +6 -2
- package/dist/types/state/actions/index.d.ts +6 -4
- package/dist/types/ui/issue-like-table/table-cell-content/inline-edit.d.ts +2 -1
- package/dist/types-ts4.5/hooks/useErrorLogger.d.ts +6 -2
- package/dist/types-ts4.5/state/actions/index.d.ts +6 -4
- package/dist/types-ts4.5/ui/issue-like-table/table-cell-content/inline-edit.d.ts +2 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# @atlaskit/link-datasource
|
|
2
2
|
|
|
3
|
+
## 2.11.7
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#132813](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/132813)
|
|
8
|
+
[`62c34ffa30fd8`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/62c34ffa30fd8) -
|
|
9
|
+
Fires events analytics for action discovery and execution errors
|
|
10
|
+
- Updated dependencies
|
|
11
|
+
|
|
3
12
|
## 2.11.6
|
|
4
13
|
|
|
5
14
|
### Patch Changes
|
|
@@ -30,7 +30,9 @@ var useDatasourceTableState = exports.useDatasourceTableState = function useData
|
|
|
30
30
|
captureError = _useErrorLogger.captureError;
|
|
31
31
|
var _useDatasourceActions = (0, _state.useDatasourceActions)(),
|
|
32
32
|
onAddItems = _useDatasourceActions.onAddItems;
|
|
33
|
-
var _useDiscoverActions = (0, _actions.useDiscoverActions)(
|
|
33
|
+
var _useDiscoverActions = (0, _actions.useDiscoverActions)({
|
|
34
|
+
captureError: captureError
|
|
35
|
+
}),
|
|
34
36
|
discoverActions = _useDiscoverActions.discoverActions;
|
|
35
37
|
var idFieldCount = 1;
|
|
36
38
|
var keyFieldCount = 1;
|
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
3
4
|
Object.defineProperty(exports, "__esModule", {
|
|
4
5
|
value: true
|
|
5
6
|
});
|
|
6
7
|
exports.logToSentry = exports.default = void 0;
|
|
8
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
7
9
|
var _react = require("react");
|
|
8
10
|
var _sentry = require("@atlaskit/linking-common/sentry");
|
|
9
11
|
var _utils = require("@atlaskit/linking-common/utils");
|
|
10
12
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
11
13
|
var _analytics = require("../analytics");
|
|
14
|
+
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; }
|
|
15
|
+
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; }
|
|
12
16
|
var getNetworkFields = function getNetworkFields(error) {
|
|
13
17
|
return error instanceof Response ? {
|
|
14
18
|
traceId: (0, _utils.getTraceId)(error),
|
|
@@ -24,15 +28,14 @@ var getNetworkFields = function getNetworkFields(error) {
|
|
|
24
28
|
* a helper Tail type which removes the first element of the tuple
|
|
25
29
|
*/
|
|
26
30
|
var logToSentry = exports.logToSentry = function logToSentry(error) {
|
|
27
|
-
if ((0, _platformFeatureFlags.
|
|
31
|
+
if (error instanceof Error && (0, _platformFeatureFlags.fg)('platform.linking-platform.datasources.enable-sentry-client')) {
|
|
28
32
|
for (var _len = arguments.length, captureExceptionParams = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
29
33
|
captureExceptionParams[_key - 1] = arguments[_key];
|
|
30
34
|
}
|
|
31
35
|
_sentry.captureException.apply(void 0, [error].concat(captureExceptionParams));
|
|
32
36
|
}
|
|
33
37
|
};
|
|
34
|
-
var useErrorLogger = function useErrorLogger(
|
|
35
|
-
var datasourceId = _ref.datasourceId;
|
|
38
|
+
var useErrorLogger = function useErrorLogger(loggerProps) {
|
|
36
39
|
var _useDatasourceAnalyti = (0, _analytics.useDatasourceAnalyticsEvents)(),
|
|
37
40
|
fireEvent = _useDatasourceAnalyti.fireEvent;
|
|
38
41
|
|
|
@@ -51,10 +54,8 @@ var useErrorLogger = function useErrorLogger(_ref) {
|
|
|
51
54
|
traceId: traceId,
|
|
52
55
|
status: status
|
|
53
56
|
});
|
|
54
|
-
logToSentry(error, 'link-datasource', {
|
|
55
|
-
|
|
56
|
-
});
|
|
57
|
-
}, [fireEvent, datasourceId]);
|
|
57
|
+
logToSentry(error, 'link-datasource', _objectSpread({}, loggerProps));
|
|
58
|
+
}, [fireEvent, loggerProps]);
|
|
58
59
|
return {
|
|
59
60
|
captureError: captureError
|
|
60
61
|
};
|
|
@@ -7,11 +7,13 @@ 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"));
|
|
10
11
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
12
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
12
13
|
var _react = require("react");
|
|
13
14
|
var _reactSweetState = require("react-sweet-state");
|
|
14
15
|
var _linkClientExtension = require("@atlaskit/link-client-extension");
|
|
16
|
+
var _excluded = ["aris", "fieldKeys"];
|
|
15
17
|
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; }
|
|
16
18
|
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; }
|
|
17
19
|
/**
|
|
@@ -55,17 +57,18 @@ var getInitialState = function getInitialState() {
|
|
|
55
57
|
};
|
|
56
58
|
};
|
|
57
59
|
var actions = exports.actions = {
|
|
58
|
-
discoverActions: function discoverActions(api, request) {
|
|
60
|
+
discoverActions: function discoverActions(captureError, api, request) {
|
|
59
61
|
return /*#__PURE__*/function () {
|
|
60
62
|
var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(_ref) {
|
|
61
|
-
var setState, getState, response, _getState, currentActions, currentPermissions, actionsByIntegration, permissions;
|
|
63
|
+
var setState, getState, response, _getState, currentActions, currentPermissions, actionsByIntegration, permissions, aris, fieldKeys, rest;
|
|
62
64
|
return _regenerator.default.wrap(function _callee$(_context) {
|
|
63
65
|
while (1) switch (_context.prev = _context.next) {
|
|
64
66
|
case 0:
|
|
65
67
|
setState = _ref.setState, getState = _ref.getState;
|
|
66
|
-
_context.
|
|
68
|
+
_context.prev = 1;
|
|
69
|
+
_context.next = 4;
|
|
67
70
|
return api.getDatasourceActionsAndPermissions(request);
|
|
68
|
-
case
|
|
71
|
+
case 4:
|
|
69
72
|
response = _context.sent;
|
|
70
73
|
if ('permissions' in response) {
|
|
71
74
|
_getState = getState(), currentActions = _getState.actionsByIntegration, currentPermissions = _getState.permissions;
|
|
@@ -85,11 +88,22 @@ var actions = exports.actions = {
|
|
|
85
88
|
permissions: permissions
|
|
86
89
|
});
|
|
87
90
|
}
|
|
88
|
-
|
|
91
|
+
_context.next = 12;
|
|
92
|
+
break;
|
|
93
|
+
case 8:
|
|
94
|
+
_context.prev = 8;
|
|
95
|
+
_context.t0 = _context["catch"](1);
|
|
96
|
+
/**
|
|
97
|
+
* Requests can be made with datasourceId or integrationKey
|
|
98
|
+
* We only want one of them with entityType, leave the rest out.
|
|
99
|
+
*/
|
|
100
|
+
aris = request.aris, fieldKeys = request.fieldKeys, rest = (0, _objectWithoutProperties2.default)(request, _excluded);
|
|
101
|
+
captureError('actionDiscovery', _context.t0, rest);
|
|
102
|
+
case 12:
|
|
89
103
|
case "end":
|
|
90
104
|
return _context.stop();
|
|
91
105
|
}
|
|
92
|
-
}, _callee);
|
|
106
|
+
}, _callee, null, [[1, 8]]);
|
|
93
107
|
}));
|
|
94
108
|
return function (_x) {
|
|
95
109
|
return _ref2.apply(this, arguments);
|
|
@@ -103,24 +117,25 @@ var ActionsStore = exports.ActionsStore = (0, _reactSweetState.createStore)({
|
|
|
103
117
|
actions: actions
|
|
104
118
|
});
|
|
105
119
|
var useActionStoreActions = (0, _reactSweetState.createActionsHook)(ActionsStore);
|
|
106
|
-
var useDiscoverActions = exports.useDiscoverActions = function useDiscoverActions() {
|
|
120
|
+
var useDiscoverActions = exports.useDiscoverActions = function useDiscoverActions(_ref3) {
|
|
121
|
+
var captureError = _ref3.captureError;
|
|
107
122
|
var _useDatasourceClientE = (0, _linkClientExtension.useDatasourceClientExtension)(),
|
|
108
123
|
getDatasourceActionsAndPermissions = _useDatasourceClientE.getDatasourceActionsAndPermissions;
|
|
109
124
|
var _useActionStoreAction = useActionStoreActions(),
|
|
110
125
|
discoverActions = _useActionStoreAction.discoverActions;
|
|
111
126
|
return {
|
|
112
127
|
discoverActions: (0, _react.useMemo)(function () {
|
|
113
|
-
return discoverActions.bind(null, {
|
|
128
|
+
return discoverActions.bind(null, captureError, {
|
|
114
129
|
getDatasourceActionsAndPermissions: getDatasourceActionsAndPermissions
|
|
115
130
|
});
|
|
116
|
-
}, [discoverActions, getDatasourceActionsAndPermissions])
|
|
131
|
+
}, [captureError, discoverActions, getDatasourceActionsAndPermissions])
|
|
117
132
|
};
|
|
118
133
|
};
|
|
119
|
-
var getFieldUpdateActionByAri = function getFieldUpdateActionByAri(state,
|
|
134
|
+
var getFieldUpdateActionByAri = function getFieldUpdateActionByAri(state, _ref4) {
|
|
120
135
|
var _state$permissions$ar, _state$actionsByInteg;
|
|
121
|
-
var ari =
|
|
122
|
-
fieldKey =
|
|
123
|
-
integrationKey =
|
|
136
|
+
var ari = _ref4.ari,
|
|
137
|
+
fieldKey = _ref4.fieldKey,
|
|
138
|
+
integrationKey = _ref4.integrationKey;
|
|
124
139
|
var isEditable = (_state$permissions$ar = state.permissions[ari]) === null || _state$permissions$ar === void 0 || (_state$permissions$ar = _state$permissions$ar[fieldKey]) === null || _state$permissions$ar === void 0 ? void 0 : _state$permissions$ar.isEditable;
|
|
125
140
|
if (!isEditable) {
|
|
126
141
|
return;
|
|
@@ -146,10 +161,10 @@ var useAtomicUpdateActionSchema = exports.useAtomicUpdateActionSchema = (0, _rea
|
|
|
146
161
|
* return <button onClick={() => execute('New summary')}>Update summary</button>;
|
|
147
162
|
* ```
|
|
148
163
|
*/
|
|
149
|
-
var useExecuteAtomicAction = exports.useExecuteAtomicAction = function useExecuteAtomicAction(
|
|
150
|
-
var ari =
|
|
151
|
-
fieldKey =
|
|
152
|
-
integrationKey =
|
|
164
|
+
var useExecuteAtomicAction = exports.useExecuteAtomicAction = function useExecuteAtomicAction(_ref5) {
|
|
165
|
+
var ari = _ref5.ari,
|
|
166
|
+
fieldKey = _ref5.fieldKey,
|
|
167
|
+
integrationKey = _ref5.integrationKey;
|
|
153
168
|
var _useAtomicUpdateActio = useAtomicUpdateActionSchema({
|
|
154
169
|
ari: ari,
|
|
155
170
|
fieldKey: fieldKey,
|
|
@@ -173,7 +188,7 @@ var useExecuteAtomicAction = exports.useExecuteAtomicAction = function useExecut
|
|
|
173
188
|
}
|
|
174
189
|
}
|
|
175
190
|
});
|
|
176
|
-
}, [executeAction, integrationKey,
|
|
191
|
+
}, [schema, executeAction, integrationKey, fieldKey, ari]);
|
|
177
192
|
if (!schema) {
|
|
178
193
|
return {};
|
|
179
194
|
}
|
|
@@ -14,6 +14,7 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
14
14
|
var _inlineEdit = _interopRequireDefault(require("@atlaskit/inline-edit"));
|
|
15
15
|
var _primitives = require("@atlaskit/primitives");
|
|
16
16
|
var _useDatasourceTableFlag = require("../../../hooks/useDatasourceTableFlag");
|
|
17
|
+
var _useErrorLogger2 = _interopRequireDefault(require("../../../hooks/useErrorLogger"));
|
|
17
18
|
var _state = require("../../../state");
|
|
18
19
|
var _editType = require("../edit-type");
|
|
19
20
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
@@ -41,6 +42,7 @@ var InlineEdit = exports.InlineEdit = function InlineEdit(_ref) {
|
|
|
41
42
|
execute = _ref.execute,
|
|
42
43
|
_readView = _ref.readView,
|
|
43
44
|
columnKey = _ref.columnKey,
|
|
45
|
+
integrationKey = _ref.integrationKey,
|
|
44
46
|
datasourceTypeWithValues = _ref.datasourceTypeWithValues;
|
|
45
47
|
var _useState = (0, _react.useState)(false),
|
|
46
48
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
@@ -53,6 +55,10 @@ var InlineEdit = exports.InlineEdit = function InlineEdit(_ref) {
|
|
|
53
55
|
showErrorFlag = _useDatasourceTableFl.showErrorFlag;
|
|
54
56
|
var _useDatasourceActions = (0, _state.useDatasourceActions)(),
|
|
55
57
|
onUpdateItem = _useDatasourceActions.onUpdateItem;
|
|
58
|
+
var _useErrorLogger = (0, _useErrorLogger2.default)({
|
|
59
|
+
integrationKey: integrationKey
|
|
60
|
+
}),
|
|
61
|
+
captureError = _useErrorLogger.captureError;
|
|
56
62
|
var onCommitUpdate = (0, _react.useCallback)(function (value) {
|
|
57
63
|
if (!item) {
|
|
58
64
|
setIsEditing(false);
|
|
@@ -71,9 +77,10 @@ var InlineEdit = exports.InlineEdit = function InlineEdit(_ref) {
|
|
|
71
77
|
status: status
|
|
72
78
|
});
|
|
73
79
|
onUpdateItem(ari, existingData);
|
|
80
|
+
captureError('actionExecution', error);
|
|
74
81
|
});
|
|
75
82
|
setIsEditing(false);
|
|
76
|
-
}, [
|
|
83
|
+
}, [item, datasourceTypeWithValues.type, columnKey, onUpdateItem, ari, execute, showErrorFlag, captureError]);
|
|
77
84
|
return /*#__PURE__*/_react.default.createElement(_primitives.Box, {
|
|
78
85
|
xcss: containerStyles
|
|
79
86
|
}, /*#__PURE__*/_react.default.createElement(_inlineEdit.default, (0, _extends2.default)({}, (0, _editType.editType)(datasourceTypeWithValues), {
|
|
@@ -24,7 +24,9 @@ export const useDatasourceTableState = ({
|
|
|
24
24
|
} = useDatasourceActions();
|
|
25
25
|
const {
|
|
26
26
|
discoverActions
|
|
27
|
-
} = useDiscoverActions(
|
|
27
|
+
} = useDiscoverActions({
|
|
28
|
+
captureError
|
|
29
|
+
});
|
|
28
30
|
const idFieldCount = 1;
|
|
29
31
|
const keyFieldCount = 1;
|
|
30
32
|
const [initialEmptyArray] = useState([]);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useCallback } from 'react';
|
|
2
2
|
import { captureException } from '@atlaskit/linking-common/sentry';
|
|
3
3
|
import { getTraceId } from '@atlaskit/linking-common/utils';
|
|
4
|
-
import {
|
|
4
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
5
5
|
import { useDatasourceAnalyticsEvents } from '../analytics';
|
|
6
6
|
const getNetworkFields = error => {
|
|
7
7
|
return error instanceof Response ? {
|
|
@@ -18,13 +18,11 @@ const getNetworkFields = error => {
|
|
|
18
18
|
* a helper Tail type which removes the first element of the tuple
|
|
19
19
|
*/
|
|
20
20
|
export const logToSentry = (error, ...captureExceptionParams) => {
|
|
21
|
-
if (
|
|
21
|
+
if (error instanceof Error && fg('platform.linking-platform.datasources.enable-sentry-client')) {
|
|
22
22
|
captureException(error, ...captureExceptionParams);
|
|
23
23
|
}
|
|
24
24
|
};
|
|
25
|
-
const useErrorLogger =
|
|
26
|
-
datasourceId
|
|
27
|
-
}) => {
|
|
25
|
+
const useErrorLogger = loggerProps => {
|
|
28
26
|
const {
|
|
29
27
|
fireEvent
|
|
30
28
|
} = useDatasourceAnalyticsEvents();
|
|
@@ -46,9 +44,9 @@ const useErrorLogger = ({
|
|
|
46
44
|
status
|
|
47
45
|
});
|
|
48
46
|
logToSentry(error, 'link-datasource', {
|
|
49
|
-
|
|
47
|
+
...loggerProps
|
|
50
48
|
});
|
|
51
|
-
}, [fireEvent,
|
|
49
|
+
}, [fireEvent, loggerProps]);
|
|
52
50
|
return {
|
|
53
51
|
captureError
|
|
54
52
|
};
|
|
@@ -41,39 +41,52 @@ const getInitialState = () => ({
|
|
|
41
41
|
permissions: {}
|
|
42
42
|
});
|
|
43
43
|
export const actions = {
|
|
44
|
-
discoverActions: (api, request) => async ({
|
|
44
|
+
discoverActions: (captureError, api, request) => async ({
|
|
45
45
|
setState,
|
|
46
46
|
getState
|
|
47
47
|
}) => {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
48
|
+
try {
|
|
49
|
+
const response = await api.getDatasourceActionsAndPermissions(request);
|
|
50
|
+
if ('permissions' in response) {
|
|
51
|
+
const {
|
|
52
|
+
actionsByIntegration: currentActions,
|
|
53
|
+
permissions: currentPermissions
|
|
54
|
+
} = getState();
|
|
55
|
+
const actionsByIntegration = response.actions.reduce((acc, action) => ({
|
|
56
|
+
...acc,
|
|
57
|
+
[action.integrationKey]: {
|
|
58
|
+
...acc[action.integrationKey],
|
|
59
|
+
[action.fieldKey]: {
|
|
60
|
+
actionKey: action.actionKey,
|
|
61
|
+
type: action.type
|
|
62
|
+
}
|
|
61
63
|
}
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
64
|
+
}), currentActions);
|
|
65
|
+
const permissions = response.permissions.data.reduce((acc, permission) => ({
|
|
66
|
+
...acc,
|
|
67
|
+
[permission.ari]: {
|
|
68
|
+
...acc[permission.ari],
|
|
69
|
+
[permission.fieldKey]: {
|
|
70
|
+
isEditable: permission.isEditable
|
|
71
|
+
}
|
|
70
72
|
}
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
}
|
|
73
|
+
}), currentPermissions);
|
|
74
|
+
setState({
|
|
75
|
+
actionsByIntegration,
|
|
76
|
+
permissions
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
} catch (error) {
|
|
80
|
+
/**
|
|
81
|
+
* Requests can be made with datasourceId or integrationKey
|
|
82
|
+
* We only want one of them with entityType, leave the rest out.
|
|
83
|
+
*/
|
|
84
|
+
const {
|
|
85
|
+
aris,
|
|
86
|
+
fieldKeys,
|
|
87
|
+
...rest
|
|
88
|
+
} = request;
|
|
89
|
+
captureError('actionDiscovery', error, rest);
|
|
77
90
|
}
|
|
78
91
|
}
|
|
79
92
|
};
|
|
@@ -83,7 +96,9 @@ export const ActionsStore = createStore({
|
|
|
83
96
|
actions
|
|
84
97
|
});
|
|
85
98
|
const useActionStoreActions = createActionsHook(ActionsStore);
|
|
86
|
-
export const useDiscoverActions = (
|
|
99
|
+
export const useDiscoverActions = ({
|
|
100
|
+
captureError
|
|
101
|
+
}) => {
|
|
87
102
|
const {
|
|
88
103
|
getDatasourceActionsAndPermissions
|
|
89
104
|
} = useDatasourceClientExtension();
|
|
@@ -91,9 +106,9 @@ export const useDiscoverActions = () => {
|
|
|
91
106
|
discoverActions
|
|
92
107
|
} = useActionStoreActions();
|
|
93
108
|
return {
|
|
94
|
-
discoverActions: useMemo(() => discoverActions.bind(null, {
|
|
109
|
+
discoverActions: useMemo(() => discoverActions.bind(null, captureError, {
|
|
95
110
|
getDatasourceActionsAndPermissions
|
|
96
|
-
}), [discoverActions, getDatasourceActionsAndPermissions])
|
|
111
|
+
}), [captureError, discoverActions, getDatasourceActionsAndPermissions])
|
|
97
112
|
};
|
|
98
113
|
};
|
|
99
114
|
const getFieldUpdateActionByAri = (state, {
|
|
@@ -156,7 +171,7 @@ export const useExecuteAtomicAction = ({
|
|
|
156
171
|
}
|
|
157
172
|
}
|
|
158
173
|
});
|
|
159
|
-
}, [executeAction, integrationKey,
|
|
174
|
+
}, [schema, executeAction, integrationKey, fieldKey, ari]);
|
|
160
175
|
if (!schema) {
|
|
161
176
|
return {};
|
|
162
177
|
}
|
|
@@ -3,6 +3,7 @@ import React, { useCallback, useState } from 'react';
|
|
|
3
3
|
import AKInlineEdit from '@atlaskit/inline-edit';
|
|
4
4
|
import { Box, xcss } from '@atlaskit/primitives';
|
|
5
5
|
import { useDatasourceTableFlag } from '../../../hooks/useDatasourceTableFlag';
|
|
6
|
+
import useErrorLogger from '../../../hooks/useErrorLogger';
|
|
6
7
|
import { useDatasourceActions, useDatasourceItem } from '../../../state';
|
|
7
8
|
import { editType } from '../edit-type';
|
|
8
9
|
const containerStyles = xcss({
|
|
@@ -29,6 +30,7 @@ export const InlineEdit = ({
|
|
|
29
30
|
execute,
|
|
30
31
|
readView,
|
|
31
32
|
columnKey,
|
|
33
|
+
integrationKey,
|
|
32
34
|
datasourceTypeWithValues
|
|
33
35
|
}) => {
|
|
34
36
|
const [isEditing, setIsEditing] = useState(false);
|
|
@@ -41,6 +43,11 @@ export const InlineEdit = ({
|
|
|
41
43
|
const {
|
|
42
44
|
onUpdateItem
|
|
43
45
|
} = useDatasourceActions();
|
|
46
|
+
const {
|
|
47
|
+
captureError
|
|
48
|
+
} = useErrorLogger({
|
|
49
|
+
integrationKey
|
|
50
|
+
});
|
|
44
51
|
const onCommitUpdate = useCallback(value => {
|
|
45
52
|
if (!item) {
|
|
46
53
|
setIsEditing(false);
|
|
@@ -59,9 +66,10 @@ export const InlineEdit = ({
|
|
|
59
66
|
status
|
|
60
67
|
});
|
|
61
68
|
onUpdateItem(ari, existingData);
|
|
69
|
+
captureError('actionExecution', error);
|
|
62
70
|
});
|
|
63
71
|
setIsEditing(false);
|
|
64
|
-
}, [
|
|
72
|
+
}, [item, datasourceTypeWithValues.type, columnKey, onUpdateItem, ari, execute, showErrorFlag, captureError]);
|
|
65
73
|
return /*#__PURE__*/React.createElement(Box, {
|
|
66
74
|
xcss: containerStyles
|
|
67
75
|
}, /*#__PURE__*/React.createElement(AKInlineEdit, _extends({}, editType(datasourceTypeWithValues), {
|
|
@@ -23,7 +23,9 @@ export var useDatasourceTableState = function useDatasourceTableState(_ref) {
|
|
|
23
23
|
captureError = _useErrorLogger.captureError;
|
|
24
24
|
var _useDatasourceActions = useDatasourceActions(),
|
|
25
25
|
onAddItems = _useDatasourceActions.onAddItems;
|
|
26
|
-
var _useDiscoverActions = useDiscoverActions(
|
|
26
|
+
var _useDiscoverActions = useDiscoverActions({
|
|
27
|
+
captureError: captureError
|
|
28
|
+
}),
|
|
27
29
|
discoverActions = _useDiscoverActions.discoverActions;
|
|
28
30
|
var idFieldCount = 1;
|
|
29
31
|
var keyFieldCount = 1;
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
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; }
|
|
3
|
+
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; }
|
|
1
4
|
import { useCallback } from 'react';
|
|
2
5
|
import { captureException } from '@atlaskit/linking-common/sentry';
|
|
3
6
|
import { getTraceId } from '@atlaskit/linking-common/utils';
|
|
4
|
-
import {
|
|
7
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
5
8
|
import { useDatasourceAnalyticsEvents } from '../analytics';
|
|
6
9
|
var getNetworkFields = function getNetworkFields(error) {
|
|
7
10
|
return error instanceof Response ? {
|
|
@@ -18,15 +21,14 @@ var getNetworkFields = function getNetworkFields(error) {
|
|
|
18
21
|
* a helper Tail type which removes the first element of the tuple
|
|
19
22
|
*/
|
|
20
23
|
export var logToSentry = function logToSentry(error) {
|
|
21
|
-
if (
|
|
24
|
+
if (error instanceof Error && fg('platform.linking-platform.datasources.enable-sentry-client')) {
|
|
22
25
|
for (var _len = arguments.length, captureExceptionParams = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
23
26
|
captureExceptionParams[_key - 1] = arguments[_key];
|
|
24
27
|
}
|
|
25
28
|
captureException.apply(void 0, [error].concat(captureExceptionParams));
|
|
26
29
|
}
|
|
27
30
|
};
|
|
28
|
-
var useErrorLogger = function useErrorLogger(
|
|
29
|
-
var datasourceId = _ref.datasourceId;
|
|
31
|
+
var useErrorLogger = function useErrorLogger(loggerProps) {
|
|
30
32
|
var _useDatasourceAnalyti = useDatasourceAnalyticsEvents(),
|
|
31
33
|
fireEvent = _useDatasourceAnalyti.fireEvent;
|
|
32
34
|
|
|
@@ -45,10 +47,8 @@ var useErrorLogger = function useErrorLogger(_ref) {
|
|
|
45
47
|
traceId: traceId,
|
|
46
48
|
status: status
|
|
47
49
|
});
|
|
48
|
-
logToSentry(error, 'link-datasource', {
|
|
49
|
-
|
|
50
|
-
});
|
|
51
|
-
}, [fireEvent, datasourceId]);
|
|
50
|
+
logToSentry(error, 'link-datasource', _objectSpread({}, loggerProps));
|
|
51
|
+
}, [fireEvent, loggerProps]);
|
|
52
52
|
return {
|
|
53
53
|
captureError: captureError
|
|
54
54
|
};
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
2
3
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
4
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
5
|
+
var _excluded = ["aris", "fieldKeys"];
|
|
4
6
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
5
7
|
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; }
|
|
6
8
|
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; }
|
|
@@ -49,17 +51,18 @@ var getInitialState = function getInitialState() {
|
|
|
49
51
|
};
|
|
50
52
|
};
|
|
51
53
|
export var actions = {
|
|
52
|
-
discoverActions: function discoverActions(api, request) {
|
|
54
|
+
discoverActions: function discoverActions(captureError, api, request) {
|
|
53
55
|
return /*#__PURE__*/function () {
|
|
54
56
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref) {
|
|
55
|
-
var setState, getState, response, _getState, currentActions, currentPermissions, actionsByIntegration, permissions;
|
|
57
|
+
var setState, getState, response, _getState, currentActions, currentPermissions, actionsByIntegration, permissions, aris, fieldKeys, rest;
|
|
56
58
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
57
59
|
while (1) switch (_context.prev = _context.next) {
|
|
58
60
|
case 0:
|
|
59
61
|
setState = _ref.setState, getState = _ref.getState;
|
|
60
|
-
_context.
|
|
62
|
+
_context.prev = 1;
|
|
63
|
+
_context.next = 4;
|
|
61
64
|
return api.getDatasourceActionsAndPermissions(request);
|
|
62
|
-
case
|
|
65
|
+
case 4:
|
|
63
66
|
response = _context.sent;
|
|
64
67
|
if ('permissions' in response) {
|
|
65
68
|
_getState = getState(), currentActions = _getState.actionsByIntegration, currentPermissions = _getState.permissions;
|
|
@@ -79,11 +82,22 @@ export var actions = {
|
|
|
79
82
|
permissions: permissions
|
|
80
83
|
});
|
|
81
84
|
}
|
|
82
|
-
|
|
85
|
+
_context.next = 12;
|
|
86
|
+
break;
|
|
87
|
+
case 8:
|
|
88
|
+
_context.prev = 8;
|
|
89
|
+
_context.t0 = _context["catch"](1);
|
|
90
|
+
/**
|
|
91
|
+
* Requests can be made with datasourceId or integrationKey
|
|
92
|
+
* We only want one of them with entityType, leave the rest out.
|
|
93
|
+
*/
|
|
94
|
+
aris = request.aris, fieldKeys = request.fieldKeys, rest = _objectWithoutProperties(request, _excluded);
|
|
95
|
+
captureError('actionDiscovery', _context.t0, rest);
|
|
96
|
+
case 12:
|
|
83
97
|
case "end":
|
|
84
98
|
return _context.stop();
|
|
85
99
|
}
|
|
86
|
-
}, _callee);
|
|
100
|
+
}, _callee, null, [[1, 8]]);
|
|
87
101
|
}));
|
|
88
102
|
return function (_x) {
|
|
89
103
|
return _ref2.apply(this, arguments);
|
|
@@ -97,24 +111,25 @@ export var ActionsStore = createStore({
|
|
|
97
111
|
actions: actions
|
|
98
112
|
});
|
|
99
113
|
var useActionStoreActions = createActionsHook(ActionsStore);
|
|
100
|
-
export var useDiscoverActions = function useDiscoverActions() {
|
|
114
|
+
export var useDiscoverActions = function useDiscoverActions(_ref3) {
|
|
115
|
+
var captureError = _ref3.captureError;
|
|
101
116
|
var _useDatasourceClientE = useDatasourceClientExtension(),
|
|
102
117
|
getDatasourceActionsAndPermissions = _useDatasourceClientE.getDatasourceActionsAndPermissions;
|
|
103
118
|
var _useActionStoreAction = useActionStoreActions(),
|
|
104
119
|
discoverActions = _useActionStoreAction.discoverActions;
|
|
105
120
|
return {
|
|
106
121
|
discoverActions: useMemo(function () {
|
|
107
|
-
return discoverActions.bind(null, {
|
|
122
|
+
return discoverActions.bind(null, captureError, {
|
|
108
123
|
getDatasourceActionsAndPermissions: getDatasourceActionsAndPermissions
|
|
109
124
|
});
|
|
110
|
-
}, [discoverActions, getDatasourceActionsAndPermissions])
|
|
125
|
+
}, [captureError, discoverActions, getDatasourceActionsAndPermissions])
|
|
111
126
|
};
|
|
112
127
|
};
|
|
113
|
-
var getFieldUpdateActionByAri = function getFieldUpdateActionByAri(state,
|
|
128
|
+
var getFieldUpdateActionByAri = function getFieldUpdateActionByAri(state, _ref4) {
|
|
114
129
|
var _state$permissions$ar, _state$actionsByInteg;
|
|
115
|
-
var ari =
|
|
116
|
-
fieldKey =
|
|
117
|
-
integrationKey =
|
|
130
|
+
var ari = _ref4.ari,
|
|
131
|
+
fieldKey = _ref4.fieldKey,
|
|
132
|
+
integrationKey = _ref4.integrationKey;
|
|
118
133
|
var isEditable = (_state$permissions$ar = state.permissions[ari]) === null || _state$permissions$ar === void 0 || (_state$permissions$ar = _state$permissions$ar[fieldKey]) === null || _state$permissions$ar === void 0 ? void 0 : _state$permissions$ar.isEditable;
|
|
119
134
|
if (!isEditable) {
|
|
120
135
|
return;
|
|
@@ -140,10 +155,10 @@ export var useAtomicUpdateActionSchema = createHook(ActionsStore, {
|
|
|
140
155
|
* return <button onClick={() => execute('New summary')}>Update summary</button>;
|
|
141
156
|
* ```
|
|
142
157
|
*/
|
|
143
|
-
export var useExecuteAtomicAction = function useExecuteAtomicAction(
|
|
144
|
-
var ari =
|
|
145
|
-
fieldKey =
|
|
146
|
-
integrationKey =
|
|
158
|
+
export var useExecuteAtomicAction = function useExecuteAtomicAction(_ref5) {
|
|
159
|
+
var ari = _ref5.ari,
|
|
160
|
+
fieldKey = _ref5.fieldKey,
|
|
161
|
+
integrationKey = _ref5.integrationKey;
|
|
147
162
|
var _useAtomicUpdateActio = useAtomicUpdateActionSchema({
|
|
148
163
|
ari: ari,
|
|
149
164
|
fieldKey: fieldKey,
|
|
@@ -167,7 +182,7 @@ export var useExecuteAtomicAction = function useExecuteAtomicAction(_ref4) {
|
|
|
167
182
|
}
|
|
168
183
|
}
|
|
169
184
|
});
|
|
170
|
-
}, [executeAction, integrationKey,
|
|
185
|
+
}, [schema, executeAction, integrationKey, fieldKey, ari]);
|
|
171
186
|
if (!schema) {
|
|
172
187
|
return {};
|
|
173
188
|
}
|
|
@@ -8,6 +8,7 @@ import React, { useCallback, useState } from 'react';
|
|
|
8
8
|
import AKInlineEdit from '@atlaskit/inline-edit';
|
|
9
9
|
import { Box, xcss } from '@atlaskit/primitives';
|
|
10
10
|
import { useDatasourceTableFlag } from '../../../hooks/useDatasourceTableFlag';
|
|
11
|
+
import useErrorLogger from '../../../hooks/useErrorLogger';
|
|
11
12
|
import { useDatasourceActions, useDatasourceItem } from '../../../state';
|
|
12
13
|
import { editType } from '../edit-type';
|
|
13
14
|
var containerStyles = xcss({
|
|
@@ -31,6 +32,7 @@ export var InlineEdit = function InlineEdit(_ref) {
|
|
|
31
32
|
execute = _ref.execute,
|
|
32
33
|
_readView = _ref.readView,
|
|
33
34
|
columnKey = _ref.columnKey,
|
|
35
|
+
integrationKey = _ref.integrationKey,
|
|
34
36
|
datasourceTypeWithValues = _ref.datasourceTypeWithValues;
|
|
35
37
|
var _useState = useState(false),
|
|
36
38
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -43,6 +45,10 @@ export var InlineEdit = function InlineEdit(_ref) {
|
|
|
43
45
|
showErrorFlag = _useDatasourceTableFl.showErrorFlag;
|
|
44
46
|
var _useDatasourceActions = useDatasourceActions(),
|
|
45
47
|
onUpdateItem = _useDatasourceActions.onUpdateItem;
|
|
48
|
+
var _useErrorLogger = useErrorLogger({
|
|
49
|
+
integrationKey: integrationKey
|
|
50
|
+
}),
|
|
51
|
+
captureError = _useErrorLogger.captureError;
|
|
46
52
|
var onCommitUpdate = useCallback(function (value) {
|
|
47
53
|
if (!item) {
|
|
48
54
|
setIsEditing(false);
|
|
@@ -61,9 +67,10 @@ export var InlineEdit = function InlineEdit(_ref) {
|
|
|
61
67
|
status: status
|
|
62
68
|
});
|
|
63
69
|
onUpdateItem(ari, existingData);
|
|
70
|
+
captureError('actionExecution', error);
|
|
64
71
|
});
|
|
65
72
|
setIsEditing(false);
|
|
66
|
-
}, [
|
|
73
|
+
}, [item, datasourceTypeWithValues.type, columnKey, onUpdateItem, ari, execute, showErrorFlag, captureError]);
|
|
67
74
|
return /*#__PURE__*/React.createElement(Box, {
|
|
68
75
|
xcss: containerStyles
|
|
69
76
|
}, /*#__PURE__*/React.createElement(AKInlineEdit, _extends({}, editType(datasourceTypeWithValues), {
|
|
@@ -6,10 +6,14 @@
|
|
|
6
6
|
export declare const logToSentry: (error: unknown, packageName: string, tags?: {
|
|
7
7
|
[key: string]: string | number | bigint | boolean | symbol | null | undefined;
|
|
8
8
|
} | undefined) => void;
|
|
9
|
-
interface
|
|
9
|
+
interface UseErrorLoggerPropsDatasource {
|
|
10
10
|
datasourceId: string;
|
|
11
11
|
}
|
|
12
|
-
|
|
12
|
+
interface UseErrorLoggerPropsActions {
|
|
13
|
+
integrationKey: string;
|
|
14
|
+
}
|
|
15
|
+
export type UseErrorLoggerProps = UseErrorLoggerPropsDatasource | UseErrorLoggerPropsActions;
|
|
16
|
+
declare const useErrorLogger: (loggerProps: UseErrorLoggerProps) => {
|
|
13
17
|
captureError: (errorLocation: string, error: unknown) => void;
|
|
14
18
|
};
|
|
15
19
|
export default useErrorLogger;
|
|
@@ -48,19 +48,21 @@ interface Client {
|
|
|
48
48
|
getDatasourceActionsAndPermissions: ReturnType<typeof useDatasourceClientExtension>['getDatasourceActionsAndPermissions'];
|
|
49
49
|
}
|
|
50
50
|
export declare const actions: {
|
|
51
|
-
discoverActions: (api: Client, request: ActionsDiscoveryRequest) => Action<ActionsStoreState>;
|
|
51
|
+
discoverActions: (captureError: (errorLocation: string, error: unknown, extraInfo?: Record<string, any>) => void, api: Client, request: ActionsDiscoveryRequest) => Action<ActionsStoreState>;
|
|
52
52
|
};
|
|
53
53
|
export declare const ActionsStore: import("react-sweet-state").Store<ActionsStoreState, {
|
|
54
|
-
discoverActions: (api: Client, request: ActionsDiscoveryRequest) => Action<ActionsStoreState>;
|
|
54
|
+
discoverActions: (captureError: (errorLocation: string, error: unknown, extraInfo?: Record<string, any>) => void, api: Client, request: ActionsDiscoveryRequest) => Action<ActionsStoreState>;
|
|
55
55
|
}>;
|
|
56
|
-
export declare const useDiscoverActions: (
|
|
56
|
+
export declare const useDiscoverActions: ({ captureError, }: {
|
|
57
|
+
captureError: (errorLocation: string, error: unknown, extraInfo?: Record<string, any>) => void;
|
|
58
|
+
}) => {
|
|
57
59
|
discoverActions: (request: ActionsDiscoveryRequest) => void | Promise<void>;
|
|
58
60
|
};
|
|
59
61
|
/**
|
|
60
62
|
* Retrieves the action schema for a given ARI + fieldKey + integrationKey
|
|
61
63
|
*/
|
|
62
64
|
export declare const useAtomicUpdateActionSchema: import("react-sweet-state").HookFunction<Pick<AtomicActionInterface, "actionKey" | "type" | "description"> | undefined, import("react-sweet-state").BoundActions<ActionsStoreState, {
|
|
63
|
-
discoverActions: (api: Client, request: ActionsDiscoveryRequest) => Action<ActionsStoreState>;
|
|
65
|
+
discoverActions: (captureError: (errorLocation: string, error: unknown, extraInfo?: Record<string, any>) => void, api: Client, request: ActionsDiscoveryRequest) => Action<ActionsStoreState>;
|
|
64
66
|
}>, {
|
|
65
67
|
ari: string;
|
|
66
68
|
fieldKey: string;
|
|
@@ -4,9 +4,10 @@ import type { DatasourceTypeWithOnlyValues } from '../types';
|
|
|
4
4
|
interface InlineEditProps {
|
|
5
5
|
ari: string;
|
|
6
6
|
columnKey: string;
|
|
7
|
+
integrationKey: string;
|
|
7
8
|
readView: React.ReactNode;
|
|
8
9
|
datasourceTypeWithValues: DatasourceTypeWithOnlyValues;
|
|
9
10
|
execute: (value: string | number) => Promise<AtomicActionExecuteResponse>;
|
|
10
11
|
}
|
|
11
|
-
export declare const InlineEdit: ({ ari, execute, readView, columnKey, datasourceTypeWithValues, }: InlineEditProps) => JSX.Element;
|
|
12
|
+
export declare const InlineEdit: ({ ari, execute, readView, columnKey, integrationKey, datasourceTypeWithValues, }: InlineEditProps) => JSX.Element;
|
|
12
13
|
export {};
|
|
@@ -6,10 +6,14 @@
|
|
|
6
6
|
export declare const logToSentry: (error: unknown, packageName: string, tags?: {
|
|
7
7
|
[key: string]: string | number | bigint | boolean | symbol | null | undefined;
|
|
8
8
|
} | undefined) => void;
|
|
9
|
-
interface
|
|
9
|
+
interface UseErrorLoggerPropsDatasource {
|
|
10
10
|
datasourceId: string;
|
|
11
11
|
}
|
|
12
|
-
|
|
12
|
+
interface UseErrorLoggerPropsActions {
|
|
13
|
+
integrationKey: string;
|
|
14
|
+
}
|
|
15
|
+
export type UseErrorLoggerProps = UseErrorLoggerPropsDatasource | UseErrorLoggerPropsActions;
|
|
16
|
+
declare const useErrorLogger: (loggerProps: UseErrorLoggerProps) => {
|
|
13
17
|
captureError: (errorLocation: string, error: unknown) => void;
|
|
14
18
|
};
|
|
15
19
|
export default useErrorLogger;
|
|
@@ -48,19 +48,21 @@ interface Client {
|
|
|
48
48
|
getDatasourceActionsAndPermissions: ReturnType<typeof useDatasourceClientExtension>['getDatasourceActionsAndPermissions'];
|
|
49
49
|
}
|
|
50
50
|
export declare const actions: {
|
|
51
|
-
discoverActions: (api: Client, request: ActionsDiscoveryRequest) => Action<ActionsStoreState>;
|
|
51
|
+
discoverActions: (captureError: (errorLocation: string, error: unknown, extraInfo?: Record<string, any>) => void, api: Client, request: ActionsDiscoveryRequest) => Action<ActionsStoreState>;
|
|
52
52
|
};
|
|
53
53
|
export declare const ActionsStore: import("react-sweet-state").Store<ActionsStoreState, {
|
|
54
|
-
discoverActions: (api: Client, request: ActionsDiscoveryRequest) => Action<ActionsStoreState>;
|
|
54
|
+
discoverActions: (captureError: (errorLocation: string, error: unknown, extraInfo?: Record<string, any>) => void, api: Client, request: ActionsDiscoveryRequest) => Action<ActionsStoreState>;
|
|
55
55
|
}>;
|
|
56
|
-
export declare const useDiscoverActions: (
|
|
56
|
+
export declare const useDiscoverActions: ({ captureError, }: {
|
|
57
|
+
captureError: (errorLocation: string, error: unknown, extraInfo?: Record<string, any>) => void;
|
|
58
|
+
}) => {
|
|
57
59
|
discoverActions: (request: ActionsDiscoveryRequest) => void | Promise<void>;
|
|
58
60
|
};
|
|
59
61
|
/**
|
|
60
62
|
* Retrieves the action schema for a given ARI + fieldKey + integrationKey
|
|
61
63
|
*/
|
|
62
64
|
export declare const useAtomicUpdateActionSchema: import("react-sweet-state").HookFunction<Pick<AtomicActionInterface, "actionKey" | "type" | "description"> | undefined, import("react-sweet-state").BoundActions<ActionsStoreState, {
|
|
63
|
-
discoverActions: (api: Client, request: ActionsDiscoveryRequest) => Action<ActionsStoreState>;
|
|
65
|
+
discoverActions: (captureError: (errorLocation: string, error: unknown, extraInfo?: Record<string, any>) => void, api: Client, request: ActionsDiscoveryRequest) => Action<ActionsStoreState>;
|
|
64
66
|
}>, {
|
|
65
67
|
ari: string;
|
|
66
68
|
fieldKey: string;
|
|
@@ -4,9 +4,10 @@ import type { DatasourceTypeWithOnlyValues } from '../types';
|
|
|
4
4
|
interface InlineEditProps {
|
|
5
5
|
ari: string;
|
|
6
6
|
columnKey: string;
|
|
7
|
+
integrationKey: string;
|
|
7
8
|
readView: React.ReactNode;
|
|
8
9
|
datasourceTypeWithValues: DatasourceTypeWithOnlyValues;
|
|
9
10
|
execute: (value: string | number) => Promise<AtomicActionExecuteResponse>;
|
|
10
11
|
}
|
|
11
|
-
export declare const InlineEdit: ({ ari, execute, readView, columnKey, datasourceTypeWithValues, }: InlineEditProps) => JSX.Element;
|
|
12
|
+
export declare const InlineEdit: ({ ari, execute, readView, columnKey, integrationKey, datasourceTypeWithValues, }: InlineEditProps) => JSX.Element;
|
|
12
13
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/link-datasource",
|
|
3
|
-
"version": "2.11.
|
|
3
|
+
"version": "2.11.7",
|
|
4
4
|
"description": "UI Components to support linking platform dataset feature",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-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.
|
|
76
|
+
"@atlaskit/smart-card": "^27.17.0",
|
|
77
77
|
"@atlaskit/smart-user-picker": "6.10.2",
|
|
78
78
|
"@atlaskit/spinner": "^16.3.0",
|
|
79
79
|
"@atlaskit/tag": "^12.5.0",
|