@atlaskit/link-datasource 2.11.11 → 2.11.13
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 +22 -0
- package/dist/cjs/hooks/useDatasourceTableState.js +15 -12
- package/dist/cjs/state/actions/index.js +19 -1
- package/dist/cjs/ui/issue-like-table/draggable-table-heading.js +3 -3
- package/dist/cjs/ui/issue-like-table/table-cell-content/index.js +0 -1
- package/dist/cjs/ui/issue-like-table/table-cell-content/inline-edit.js +1 -8
- package/dist/cjs/ui/issue-like-table/utils.js +9 -2
- package/dist/es2019/hooks/useDatasourceTableState.js +15 -12
- package/dist/es2019/state/actions/index.js +21 -1
- package/dist/es2019/ui/issue-like-table/draggable-table-heading.js +4 -4
- package/dist/es2019/ui/issue-like-table/table-cell-content/index.js +0 -1
- package/dist/es2019/ui/issue-like-table/table-cell-content/inline-edit.js +1 -9
- package/dist/es2019/ui/issue-like-table/utils.js +8 -1
- package/dist/esm/hooks/useDatasourceTableState.js +15 -12
- package/dist/esm/state/actions/index.js +19 -1
- package/dist/esm/ui/issue-like-table/draggable-table-heading.js +4 -4
- package/dist/esm/ui/issue-like-table/table-cell-content/index.js +0 -1
- package/dist/esm/ui/issue-like-table/table-cell-content/inline-edit.js +1 -8
- package/dist/esm/ui/issue-like-table/utils.js +8 -1
- package/dist/types/analytics/generated/analytics.types.d.ts +8 -1
- package/dist/types/ui/issue-like-table/table-cell-content/inline-edit.d.ts +1 -2
- package/dist/types/ui/issue-like-table/utils.d.ts +1 -1
- package/dist/types-ts4.5/analytics/generated/analytics.types.d.ts +8 -1
- package/dist/types-ts4.5/ui/issue-like-table/table-cell-content/inline-edit.d.ts +1 -2
- package/dist/types-ts4.5/ui/issue-like-table/utils.d.ts +1 -1
- package/package.json +4 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# @atlaskit/link-datasource
|
|
2
2
|
|
|
3
|
+
## 2.11.13
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#134868](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/134868)
|
|
8
|
+
[`2b61da0339af2`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/2b61da0339af2) -
|
|
9
|
+
[ux] Enforce mininum width of the datasource column
|
|
10
|
+
- [#119756](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/119756)
|
|
11
|
+
[`3ebb67c9feed7`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/3ebb67c9feed7) -
|
|
12
|
+
Adds dependency to @atlaskit/atlassian-context to use isFedRamp() function to exclude connections
|
|
13
|
+
to actions service and 2 way sync functionality, behind existing feature flag so no functional
|
|
14
|
+
behaviour change.
|
|
15
|
+
|
|
16
|
+
## 2.11.12
|
|
17
|
+
|
|
18
|
+
### Patch Changes
|
|
19
|
+
|
|
20
|
+
- [#134926](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/134926)
|
|
21
|
+
[`891fc0be667d7`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/891fc0be667d7) -
|
|
22
|
+
Adds an operational analytic event fired when an atomic execute action request succeeds, and moves
|
|
23
|
+
the error logging from the InlineEdit component into the action itself.
|
|
24
|
+
|
|
3
25
|
## 2.11.11
|
|
4
26
|
|
|
5
27
|
### Patch Changes
|
|
@@ -11,6 +11,7 @@ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/
|
|
|
11
11
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
12
12
|
var _react = require("react");
|
|
13
13
|
var _isEqual = _interopRequireDefault(require("lodash/isEqual"));
|
|
14
|
+
var _atlassianContext = require("@atlaskit/atlassian-context");
|
|
14
15
|
var _linkClientExtension = require("@atlaskit/link-client-extension");
|
|
15
16
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
16
17
|
var _analytics = require("../analytics");
|
|
@@ -318,18 +319,20 @@ var useDatasourceTableState = exports.useDatasourceTableState = function useData
|
|
|
318
319
|
return [].concat((0, _toConsumableArray2.default)(currentIds), (0, _toConsumableArray2.default)(newIds));
|
|
319
320
|
});
|
|
320
321
|
if ((0, _platformFeatureFlags.fg)('platform-datasources-enable-two-way-sync')) {
|
|
321
|
-
if (
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
322
|
+
if (!(0, _atlassianContext.isFedRamp)()) {
|
|
323
|
+
if (typeof integrationKey === 'string') {
|
|
324
|
+
aris = items.reduce(function (acc, item) {
|
|
325
|
+
var _item$ari;
|
|
326
|
+
return typeof ((_item$ari = item.ari) === null || _item$ari === void 0 ? void 0 : _item$ari.data) === 'string' ? [].concat((0, _toConsumableArray2.default)(acc), [item.ari.data]) : acc;
|
|
327
|
+
}, []);
|
|
328
|
+
if (aris.length && _destinationObjectTypes.length) {
|
|
329
|
+
discoverActions({
|
|
330
|
+
aris: aris,
|
|
331
|
+
integrationKey: integrationKey,
|
|
332
|
+
fieldKeys: fieldKeys,
|
|
333
|
+
entityType: _destinationObjectTypes[0]
|
|
334
|
+
});
|
|
335
|
+
}
|
|
333
336
|
}
|
|
334
337
|
}
|
|
335
338
|
}
|
|
@@ -12,6 +12,8 @@ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/
|
|
|
12
12
|
var _react = require("react");
|
|
13
13
|
var _reactSweetState = require("react-sweet-state");
|
|
14
14
|
var _linkClientExtension = require("@atlaskit/link-client-extension");
|
|
15
|
+
var _analytics = require("../../analytics");
|
|
16
|
+
var _useErrorLogger2 = _interopRequireDefault(require("../../hooks/useErrorLogger"));
|
|
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
|
/**
|
|
@@ -177,6 +179,12 @@ var useExecuteAtomicAction = exports.useExecuteAtomicAction = function useExecut
|
|
|
177
179
|
schema = _useAtomicUpdateActio2[0];
|
|
178
180
|
var _useDatasourceClientE2 = (0, _linkClientExtension.useDatasourceClientExtension)(),
|
|
179
181
|
executeAction = _useDatasourceClientE2.executeAtomicAction;
|
|
182
|
+
var _useDatasourceAnalyti = (0, _analytics.useDatasourceAnalyticsEvents)(),
|
|
183
|
+
fireEvent = _useDatasourceAnalyti.fireEvent;
|
|
184
|
+
var _useErrorLogger = (0, _useErrorLogger2.default)({
|
|
185
|
+
integrationKey: integrationKey
|
|
186
|
+
}),
|
|
187
|
+
captureError = _useErrorLogger.captureError;
|
|
180
188
|
var execute = (0, _react.useCallback)(function (value) {
|
|
181
189
|
if (!schema) {
|
|
182
190
|
throw new Error('No action schema found.');
|
|
@@ -190,8 +198,18 @@ var useExecuteAtomicAction = exports.useExecuteAtomicAction = function useExecut
|
|
|
190
198
|
ari: ari
|
|
191
199
|
}
|
|
192
200
|
}
|
|
201
|
+
}).then(function (resp) {
|
|
202
|
+
fireEvent('operational.actionExecution.success', {
|
|
203
|
+
integrationKey: integrationKey,
|
|
204
|
+
experience: 'datasource'
|
|
205
|
+
});
|
|
206
|
+
return resp;
|
|
207
|
+
}).catch(function (error) {
|
|
208
|
+
captureError('actionExecution', error);
|
|
209
|
+
// Rethrow up to component for flags and other handling
|
|
210
|
+
throw error;
|
|
193
211
|
});
|
|
194
|
-
}, [schema, executeAction, integrationKey, fieldKey, ari]);
|
|
212
|
+
}, [schema, executeAction, integrationKey, fieldKey, ari, fireEvent, captureError]);
|
|
195
213
|
if (!schema) {
|
|
196
214
|
return {};
|
|
197
215
|
}
|
|
@@ -289,6 +289,9 @@ var DraggableTableHeading = exports.DraggableTableHeading = function DraggableTa
|
|
|
289
289
|
|
|
290
290
|
// Set the width of our header being resized
|
|
291
291
|
var proposedWidth = initialWidth + relativeDistanceX;
|
|
292
|
+
if (proposedWidth < (0, _utils.getColumnMinWidth)(id)) {
|
|
293
|
+
proposedWidth = (0, _utils.getColumnMinWidth)(id);
|
|
294
|
+
}
|
|
292
295
|
|
|
293
296
|
// We update width css directly live
|
|
294
297
|
mainHeaderCell.style.setProperty('width', "".concat(proposedWidth, "px"));
|
|
@@ -298,9 +301,6 @@ var DraggableTableHeading = exports.DraggableTableHeading = function DraggableTa
|
|
|
298
301
|
setState(idleState);
|
|
299
302
|
if (onWidthChange) {
|
|
300
303
|
var cssWidth = +mainHeaderCell.style.getPropertyValue('width').slice(0, -2);
|
|
301
|
-
if (cssWidth < _utils.COLUMN_MIN_WIDTH) {
|
|
302
|
-
cssWidth = _utils.COLUMN_MIN_WIDTH;
|
|
303
|
-
}
|
|
304
304
|
onWidthChange(cssWidth);
|
|
305
305
|
}
|
|
306
306
|
}
|
|
@@ -14,7 +14,6 @@ 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"));
|
|
18
17
|
var _state = require("../../../state");
|
|
19
18
|
var _editType = require("../edit-type");
|
|
20
19
|
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); }
|
|
@@ -42,7 +41,6 @@ var InlineEdit = exports.InlineEdit = function InlineEdit(_ref) {
|
|
|
42
41
|
execute = _ref.execute,
|
|
43
42
|
_readView = _ref.readView,
|
|
44
43
|
columnKey = _ref.columnKey,
|
|
45
|
-
integrationKey = _ref.integrationKey,
|
|
46
44
|
datasourceTypeWithValues = _ref.datasourceTypeWithValues;
|
|
47
45
|
var _useState = (0, _react.useState)(false),
|
|
48
46
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
@@ -55,10 +53,6 @@ var InlineEdit = exports.InlineEdit = function InlineEdit(_ref) {
|
|
|
55
53
|
showErrorFlag = _useDatasourceTableFl.showErrorFlag;
|
|
56
54
|
var _useDatasourceActions = (0, _state.useDatasourceActions)(),
|
|
57
55
|
onUpdateItem = _useDatasourceActions.onUpdateItem;
|
|
58
|
-
var _useErrorLogger = (0, _useErrorLogger2.default)({
|
|
59
|
-
integrationKey: integrationKey
|
|
60
|
-
}),
|
|
61
|
-
captureError = _useErrorLogger.captureError;
|
|
62
56
|
var onCommitUpdate = (0, _react.useCallback)(function (value) {
|
|
63
57
|
if (!item) {
|
|
64
58
|
setIsEditing(false);
|
|
@@ -77,10 +71,9 @@ var InlineEdit = exports.InlineEdit = function InlineEdit(_ref) {
|
|
|
77
71
|
status: status
|
|
78
72
|
});
|
|
79
73
|
onUpdateItem(ari, existingData);
|
|
80
|
-
captureError('actionExecution', error);
|
|
81
74
|
});
|
|
82
75
|
setIsEditing(false);
|
|
83
|
-
}, [item, datasourceTypeWithValues.type, columnKey, onUpdateItem,
|
|
76
|
+
}, [ari, item, datasourceTypeWithValues.type, columnKey, onUpdateItem, execute, showErrorFlag]);
|
|
84
77
|
return /*#__PURE__*/_react.default.createElement(_primitives.Box, {
|
|
85
78
|
xcss: editContainerStyles
|
|
86
79
|
}, /*#__PURE__*/_react.default.createElement(_inlineEdit.default, (0, _extends2.default)({}, (0, _editType.editType)(datasourceTypeWithValues), {
|
|
@@ -3,10 +3,17 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.getWidthCss = exports.
|
|
6
|
+
exports.getWidthCss = exports.getColumnMinWidth = exports.getColumnAction = exports.COLUMN_BASE_WIDTH = void 0;
|
|
7
7
|
var _types = require("../../analytics/types");
|
|
8
8
|
var COLUMN_BASE_WIDTH = exports.COLUMN_BASE_WIDTH = 8;
|
|
9
|
-
var COLUMN_MIN_WIDTH =
|
|
9
|
+
var COLUMN_MIN_WIDTH = COLUMN_BASE_WIDTH * 4;
|
|
10
|
+
var keyBasedMinWidthMap = {
|
|
11
|
+
summary: COLUMN_BASE_WIDTH * 26
|
|
12
|
+
};
|
|
13
|
+
var getColumnMinWidth = exports.getColumnMinWidth = function getColumnMinWidth(key) {
|
|
14
|
+
return keyBasedMinWidthMap[key] || COLUMN_MIN_WIDTH;
|
|
15
|
+
};
|
|
16
|
+
|
|
10
17
|
/**
|
|
11
18
|
* Generate width related portion of css for table cell.
|
|
12
19
|
*
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { useCallback, useEffect, useRef, useState } from 'react';
|
|
2
2
|
import isEqual from 'lodash/isEqual';
|
|
3
|
+
import { isFedRamp } from '@atlaskit/atlassian-context';
|
|
3
4
|
import { DEFAULT_GET_DATASOURCE_DATA_PAGE_SIZE, useDatasourceClientExtension } from '@atlaskit/link-client-extension';
|
|
4
5
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
5
6
|
import { useDatasourceAnalyticsEvents } from '../analytics';
|
|
@@ -201,18 +202,20 @@ export const useDatasourceTableState = ({
|
|
|
201
202
|
const newIds = onAddItems(items, typeof integrationKey === 'string' ? integrationKey : undefined);
|
|
202
203
|
setResponseItemIds(currentIds => [...currentIds, ...newIds]);
|
|
203
204
|
if (fg('platform-datasources-enable-two-way-sync')) {
|
|
204
|
-
if (
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
205
|
+
if (!isFedRamp()) {
|
|
206
|
+
if (typeof integrationKey === 'string') {
|
|
207
|
+
const aris = items.reduce((acc, item) => {
|
|
208
|
+
var _item$ari;
|
|
209
|
+
return typeof ((_item$ari = item.ari) === null || _item$ari === void 0 ? void 0 : _item$ari.data) === 'string' ? [...acc, item.ari.data] : acc;
|
|
210
|
+
}, []);
|
|
211
|
+
if (aris.length && destinationObjectTypes.length) {
|
|
212
|
+
discoverActions({
|
|
213
|
+
aris,
|
|
214
|
+
integrationKey,
|
|
215
|
+
fieldKeys,
|
|
216
|
+
entityType: destinationObjectTypes[0]
|
|
217
|
+
});
|
|
218
|
+
}
|
|
216
219
|
}
|
|
217
220
|
}
|
|
218
221
|
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { useCallback, useMemo } from 'react';
|
|
2
2
|
import { createActionsHook, createHook, createStore } from 'react-sweet-state';
|
|
3
3
|
import { useDatasourceClientExtension } from '@atlaskit/link-client-extension';
|
|
4
|
+
import { useDatasourceAnalyticsEvents } from '../../analytics';
|
|
5
|
+
import useErrorLogger from '../../hooks/useErrorLogger';
|
|
4
6
|
|
|
5
7
|
/**
|
|
6
8
|
* Atomic actions available for an integration (by field)
|
|
@@ -156,6 +158,14 @@ export const useExecuteAtomicAction = ({
|
|
|
156
158
|
const {
|
|
157
159
|
executeAtomicAction: executeAction
|
|
158
160
|
} = useDatasourceClientExtension();
|
|
161
|
+
const {
|
|
162
|
+
fireEvent
|
|
163
|
+
} = useDatasourceAnalyticsEvents();
|
|
164
|
+
const {
|
|
165
|
+
captureError
|
|
166
|
+
} = useErrorLogger({
|
|
167
|
+
integrationKey
|
|
168
|
+
});
|
|
159
169
|
const execute = useCallback(value => {
|
|
160
170
|
if (!schema) {
|
|
161
171
|
throw new Error('No action schema found.');
|
|
@@ -171,8 +181,18 @@ export const useExecuteAtomicAction = ({
|
|
|
171
181
|
ari
|
|
172
182
|
}
|
|
173
183
|
}
|
|
184
|
+
}).then(resp => {
|
|
185
|
+
fireEvent('operational.actionExecution.success', {
|
|
186
|
+
integrationKey: integrationKey,
|
|
187
|
+
experience: 'datasource'
|
|
188
|
+
});
|
|
189
|
+
return resp;
|
|
190
|
+
}).catch(error => {
|
|
191
|
+
captureError('actionExecution', error);
|
|
192
|
+
// Rethrow up to component for flags and other handling
|
|
193
|
+
throw error;
|
|
174
194
|
});
|
|
175
|
-
}, [schema, executeAction, integrationKey, fieldKey, ari]);
|
|
195
|
+
}, [schema, executeAction, integrationKey, fieldKey, ari, fireEvent, captureError]);
|
|
176
196
|
if (!schema) {
|
|
177
197
|
return {};
|
|
178
198
|
}
|
|
@@ -28,7 +28,7 @@ import { useDatasourceAnalyticsEvents } from '../../analytics';
|
|
|
28
28
|
import { GlyphPlaceholder, UnwrapTextIcon, WrapTextIcon } from './custom-icons';
|
|
29
29
|
import { issueLikeTableMessages } from './messages';
|
|
30
30
|
import { TableHeading } from './styled';
|
|
31
|
-
import {
|
|
31
|
+
import { getColumnMinWidth, getWidthCss } from './utils';
|
|
32
32
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled -- To migrate as part of go/ui-styling-standard
|
|
33
33
|
const DropdownParent = styled.div({
|
|
34
34
|
display: 'flex',
|
|
@@ -273,6 +273,9 @@ export const DraggableTableHeading = ({
|
|
|
273
273
|
|
|
274
274
|
// Set the width of our header being resized
|
|
275
275
|
let proposedWidth = initialWidth + relativeDistanceX;
|
|
276
|
+
if (proposedWidth < getColumnMinWidth(id)) {
|
|
277
|
+
proposedWidth = getColumnMinWidth(id);
|
|
278
|
+
}
|
|
276
279
|
|
|
277
280
|
// We update width css directly live
|
|
278
281
|
mainHeaderCell.style.setProperty('width', `${proposedWidth}px`);
|
|
@@ -282,9 +285,6 @@ export const DraggableTableHeading = ({
|
|
|
282
285
|
setState(idleState);
|
|
283
286
|
if (onWidthChange) {
|
|
284
287
|
let cssWidth = +mainHeaderCell.style.getPropertyValue('width').slice(0, -2);
|
|
285
|
-
if (cssWidth < COLUMN_MIN_WIDTH) {
|
|
286
|
-
cssWidth = COLUMN_MIN_WIDTH;
|
|
287
|
-
}
|
|
288
288
|
onWidthChange(cssWidth);
|
|
289
289
|
}
|
|
290
290
|
}
|
|
@@ -3,7 +3,6 @@ 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';
|
|
7
6
|
import { useDatasourceActions, useDatasourceItem } from '../../../state';
|
|
8
7
|
import { editType } from '../edit-type';
|
|
9
8
|
const editContainerStyles = xcss({
|
|
@@ -30,7 +29,6 @@ export const InlineEdit = ({
|
|
|
30
29
|
execute,
|
|
31
30
|
readView,
|
|
32
31
|
columnKey,
|
|
33
|
-
integrationKey,
|
|
34
32
|
datasourceTypeWithValues
|
|
35
33
|
}) => {
|
|
36
34
|
const [isEditing, setIsEditing] = useState(false);
|
|
@@ -43,11 +41,6 @@ export const InlineEdit = ({
|
|
|
43
41
|
const {
|
|
44
42
|
onUpdateItem
|
|
45
43
|
} = useDatasourceActions();
|
|
46
|
-
const {
|
|
47
|
-
captureError
|
|
48
|
-
} = useErrorLogger({
|
|
49
|
-
integrationKey
|
|
50
|
-
});
|
|
51
44
|
const onCommitUpdate = useCallback(value => {
|
|
52
45
|
if (!item) {
|
|
53
46
|
setIsEditing(false);
|
|
@@ -66,10 +59,9 @@ export const InlineEdit = ({
|
|
|
66
59
|
status
|
|
67
60
|
});
|
|
68
61
|
onUpdateItem(ari, existingData);
|
|
69
|
-
captureError('actionExecution', error);
|
|
70
62
|
});
|
|
71
63
|
setIsEditing(false);
|
|
72
|
-
}, [item, datasourceTypeWithValues.type, columnKey, onUpdateItem,
|
|
64
|
+
}, [ari, item, datasourceTypeWithValues.type, columnKey, onUpdateItem, execute, showErrorFlag]);
|
|
73
65
|
return /*#__PURE__*/React.createElement(Box, {
|
|
74
66
|
xcss: editContainerStyles
|
|
75
67
|
}, /*#__PURE__*/React.createElement(AKInlineEdit, _extends({}, editType(datasourceTypeWithValues), {
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
import { DatasourceAction } from '../../analytics/types';
|
|
2
2
|
export const COLUMN_BASE_WIDTH = 8;
|
|
3
|
-
|
|
3
|
+
const COLUMN_MIN_WIDTH = COLUMN_BASE_WIDTH * 4;
|
|
4
|
+
const keyBasedMinWidthMap = {
|
|
5
|
+
summary: COLUMN_BASE_WIDTH * 26
|
|
6
|
+
};
|
|
7
|
+
export const getColumnMinWidth = key => {
|
|
8
|
+
return keyBasedMinWidthMap[key] || COLUMN_MIN_WIDTH;
|
|
9
|
+
};
|
|
10
|
+
|
|
4
11
|
/**
|
|
5
12
|
* Generate width related portion of css for table cell.
|
|
6
13
|
*
|
|
@@ -4,6 +4,7 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
|
4
4
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
5
5
|
import { useCallback, useEffect, useRef, useState } from 'react';
|
|
6
6
|
import isEqual from 'lodash/isEqual';
|
|
7
|
+
import { isFedRamp } from '@atlaskit/atlassian-context';
|
|
7
8
|
import { DEFAULT_GET_DATASOURCE_DATA_PAGE_SIZE, useDatasourceClientExtension } from '@atlaskit/link-client-extension';
|
|
8
9
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
9
10
|
import { useDatasourceAnalyticsEvents } from '../analytics';
|
|
@@ -311,18 +312,20 @@ export var useDatasourceTableState = function useDatasourceTableState(_ref) {
|
|
|
311
312
|
return [].concat(_toConsumableArray(currentIds), _toConsumableArray(newIds));
|
|
312
313
|
});
|
|
313
314
|
if (fg('platform-datasources-enable-two-way-sync')) {
|
|
314
|
-
if (
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
315
|
+
if (!isFedRamp()) {
|
|
316
|
+
if (typeof integrationKey === 'string') {
|
|
317
|
+
aris = items.reduce(function (acc, item) {
|
|
318
|
+
var _item$ari;
|
|
319
|
+
return typeof ((_item$ari = item.ari) === null || _item$ari === void 0 ? void 0 : _item$ari.data) === 'string' ? [].concat(_toConsumableArray(acc), [item.ari.data]) : acc;
|
|
320
|
+
}, []);
|
|
321
|
+
if (aris.length && _destinationObjectTypes.length) {
|
|
322
|
+
discoverActions({
|
|
323
|
+
aris: aris,
|
|
324
|
+
integrationKey: integrationKey,
|
|
325
|
+
fieldKeys: fieldKeys,
|
|
326
|
+
entityType: _destinationObjectTypes[0]
|
|
327
|
+
});
|
|
328
|
+
}
|
|
326
329
|
}
|
|
327
330
|
}
|
|
328
331
|
}
|
|
@@ -7,6 +7,8 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
7
7
|
import { useCallback, useMemo } from 'react';
|
|
8
8
|
import { createActionsHook, createHook, createStore } from 'react-sweet-state';
|
|
9
9
|
import { useDatasourceClientExtension } from '@atlaskit/link-client-extension';
|
|
10
|
+
import { useDatasourceAnalyticsEvents } from '../../analytics';
|
|
11
|
+
import useErrorLogger from '../../hooks/useErrorLogger';
|
|
10
12
|
|
|
11
13
|
/**
|
|
12
14
|
* Atomic actions available for an integration (by field)
|
|
@@ -171,6 +173,12 @@ export var useExecuteAtomicAction = function useExecuteAtomicAction(_ref5) {
|
|
|
171
173
|
schema = _useAtomicUpdateActio2[0];
|
|
172
174
|
var _useDatasourceClientE2 = useDatasourceClientExtension(),
|
|
173
175
|
executeAction = _useDatasourceClientE2.executeAtomicAction;
|
|
176
|
+
var _useDatasourceAnalyti = useDatasourceAnalyticsEvents(),
|
|
177
|
+
fireEvent = _useDatasourceAnalyti.fireEvent;
|
|
178
|
+
var _useErrorLogger = useErrorLogger({
|
|
179
|
+
integrationKey: integrationKey
|
|
180
|
+
}),
|
|
181
|
+
captureError = _useErrorLogger.captureError;
|
|
174
182
|
var execute = useCallback(function (value) {
|
|
175
183
|
if (!schema) {
|
|
176
184
|
throw new Error('No action schema found.');
|
|
@@ -184,8 +192,18 @@ export var useExecuteAtomicAction = function useExecuteAtomicAction(_ref5) {
|
|
|
184
192
|
ari: ari
|
|
185
193
|
}
|
|
186
194
|
}
|
|
195
|
+
}).then(function (resp) {
|
|
196
|
+
fireEvent('operational.actionExecution.success', {
|
|
197
|
+
integrationKey: integrationKey,
|
|
198
|
+
experience: 'datasource'
|
|
199
|
+
});
|
|
200
|
+
return resp;
|
|
201
|
+
}).catch(function (error) {
|
|
202
|
+
captureError('actionExecution', error);
|
|
203
|
+
// Rethrow up to component for flags and other handling
|
|
204
|
+
throw error;
|
|
187
205
|
});
|
|
188
|
-
}, [schema, executeAction, integrationKey, fieldKey, ari]);
|
|
206
|
+
}, [schema, executeAction, integrationKey, fieldKey, ari, fireEvent, captureError]);
|
|
189
207
|
if (!schema) {
|
|
190
208
|
return {};
|
|
191
209
|
}
|
|
@@ -34,7 +34,7 @@ import { useDatasourceAnalyticsEvents } from '../../analytics';
|
|
|
34
34
|
import { GlyphPlaceholder, UnwrapTextIcon, WrapTextIcon } from './custom-icons';
|
|
35
35
|
import { issueLikeTableMessages } from './messages';
|
|
36
36
|
import { TableHeading } from './styled';
|
|
37
|
-
import {
|
|
37
|
+
import { getColumnMinWidth, getWidthCss } from './utils';
|
|
38
38
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled -- To migrate as part of go/ui-styling-standard
|
|
39
39
|
var DropdownParent = styled.div({
|
|
40
40
|
display: 'flex',
|
|
@@ -280,6 +280,9 @@ export var DraggableTableHeading = function DraggableTableHeading(_ref) {
|
|
|
280
280
|
|
|
281
281
|
// Set the width of our header being resized
|
|
282
282
|
var proposedWidth = initialWidth + relativeDistanceX;
|
|
283
|
+
if (proposedWidth < getColumnMinWidth(id)) {
|
|
284
|
+
proposedWidth = getColumnMinWidth(id);
|
|
285
|
+
}
|
|
283
286
|
|
|
284
287
|
// We update width css directly live
|
|
285
288
|
mainHeaderCell.style.setProperty('width', "".concat(proposedWidth, "px"));
|
|
@@ -289,9 +292,6 @@ export var DraggableTableHeading = function DraggableTableHeading(_ref) {
|
|
|
289
292
|
setState(idleState);
|
|
290
293
|
if (onWidthChange) {
|
|
291
294
|
var cssWidth = +mainHeaderCell.style.getPropertyValue('width').slice(0, -2);
|
|
292
|
-
if (cssWidth < COLUMN_MIN_WIDTH) {
|
|
293
|
-
cssWidth = COLUMN_MIN_WIDTH;
|
|
294
|
-
}
|
|
295
295
|
onWidthChange(cssWidth);
|
|
296
296
|
}
|
|
297
297
|
}
|
|
@@ -8,7 +8,6 @@ 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';
|
|
12
11
|
import { useDatasourceActions, useDatasourceItem } from '../../../state';
|
|
13
12
|
import { editType } from '../edit-type';
|
|
14
13
|
var editContainerStyles = xcss({
|
|
@@ -32,7 +31,6 @@ export var InlineEdit = function InlineEdit(_ref) {
|
|
|
32
31
|
execute = _ref.execute,
|
|
33
32
|
_readView = _ref.readView,
|
|
34
33
|
columnKey = _ref.columnKey,
|
|
35
|
-
integrationKey = _ref.integrationKey,
|
|
36
34
|
datasourceTypeWithValues = _ref.datasourceTypeWithValues;
|
|
37
35
|
var _useState = useState(false),
|
|
38
36
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -45,10 +43,6 @@ export var InlineEdit = function InlineEdit(_ref) {
|
|
|
45
43
|
showErrorFlag = _useDatasourceTableFl.showErrorFlag;
|
|
46
44
|
var _useDatasourceActions = useDatasourceActions(),
|
|
47
45
|
onUpdateItem = _useDatasourceActions.onUpdateItem;
|
|
48
|
-
var _useErrorLogger = useErrorLogger({
|
|
49
|
-
integrationKey: integrationKey
|
|
50
|
-
}),
|
|
51
|
-
captureError = _useErrorLogger.captureError;
|
|
52
46
|
var onCommitUpdate = useCallback(function (value) {
|
|
53
47
|
if (!item) {
|
|
54
48
|
setIsEditing(false);
|
|
@@ -67,10 +61,9 @@ export var InlineEdit = function InlineEdit(_ref) {
|
|
|
67
61
|
status: status
|
|
68
62
|
});
|
|
69
63
|
onUpdateItem(ari, existingData);
|
|
70
|
-
captureError('actionExecution', error);
|
|
71
64
|
});
|
|
72
65
|
setIsEditing(false);
|
|
73
|
-
}, [item, datasourceTypeWithValues.type, columnKey, onUpdateItem,
|
|
66
|
+
}, [ari, item, datasourceTypeWithValues.type, columnKey, onUpdateItem, execute, showErrorFlag]);
|
|
74
67
|
return /*#__PURE__*/React.createElement(Box, {
|
|
75
68
|
xcss: editContainerStyles
|
|
76
69
|
}, /*#__PURE__*/React.createElement(AKInlineEdit, _extends({}, editType(datasourceTypeWithValues), {
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
import { DatasourceAction } from '../../analytics/types';
|
|
2
2
|
export var COLUMN_BASE_WIDTH = 8;
|
|
3
|
-
|
|
3
|
+
var COLUMN_MIN_WIDTH = COLUMN_BASE_WIDTH * 4;
|
|
4
|
+
var keyBasedMinWidthMap = {
|
|
5
|
+
summary: COLUMN_BASE_WIDTH * 26
|
|
6
|
+
};
|
|
7
|
+
export var getColumnMinWidth = function getColumnMinWidth(key) {
|
|
8
|
+
return keyBasedMinWidthMap[key] || COLUMN_MIN_WIDTH;
|
|
9
|
+
};
|
|
10
|
+
|
|
4
11
|
/**
|
|
5
12
|
* Generate width related portion of css for table cell.
|
|
6
13
|
*
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Generates Typescript types for analytics events from analytics.spec.yaml
|
|
5
5
|
*
|
|
6
|
-
* @codegen <<SignedSource::
|
|
6
|
+
* @codegen <<SignedSource::a773c6cad8ff2e59bb7020ea85e35bc5>>
|
|
7
7
|
* @codegenCommand yarn workspace @atlassian/analytics-tooling run analytics:codegen link-datasource
|
|
8
8
|
*/
|
|
9
9
|
export type ComponentMetaDataType = {
|
|
@@ -141,6 +141,10 @@ export type ObjectSchemasSuccessAttributesType = {};
|
|
|
141
141
|
export type ObjectSchemasFailedAttributesType = {
|
|
142
142
|
statusCodeGroup: '1xx' | '3xx' | '4xx' | '5xx' | 'unknown';
|
|
143
143
|
};
|
|
144
|
+
export type ActionExecutionSuccessAttributesType = {
|
|
145
|
+
integrationKey: string;
|
|
146
|
+
experience: 'datasource';
|
|
147
|
+
};
|
|
144
148
|
export type ActionDiscoverySuccessAttributesType = {
|
|
145
149
|
experience: 'datasource';
|
|
146
150
|
entityType: string;
|
|
@@ -256,6 +260,9 @@ export type AnalyticsEventAttributes = {
|
|
|
256
260
|
/**
|
|
257
261
|
* Fired when fetching object schemas fails. */
|
|
258
262
|
'operational.objectSchemas.failed': ObjectSchemasFailedAttributesType;
|
|
263
|
+
/**
|
|
264
|
+
* Fired when an atomic action execution is successful */
|
|
265
|
+
'operational.actionExecution.success': ActionExecutionSuccessAttributesType;
|
|
259
266
|
/**
|
|
260
267
|
* Fired when the action discovery and permissions request is successful. */
|
|
261
268
|
'operational.actionDiscovery.success': ActionDiscoverySuccessAttributesType;
|
|
@@ -4,10 +4,9 @@ import type { DatasourceTypeWithOnlyValues } from '../types';
|
|
|
4
4
|
interface InlineEditProps {
|
|
5
5
|
ari: string;
|
|
6
6
|
columnKey: string;
|
|
7
|
-
integrationKey: string;
|
|
8
7
|
readView: React.ReactNode;
|
|
9
8
|
datasourceTypeWithValues: DatasourceTypeWithOnlyValues;
|
|
10
9
|
execute: (value: string | number) => Promise<AtomicActionExecuteResponse>;
|
|
11
10
|
}
|
|
12
|
-
export declare const InlineEdit: ({ ari, execute, readView, columnKey,
|
|
11
|
+
export declare const InlineEdit: ({ ari, execute, readView, columnKey, datasourceTypeWithValues, }: InlineEditProps) => JSX.Element;
|
|
13
12
|
export {};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { DatasourceAction } from '../../analytics/types';
|
|
3
3
|
export declare const COLUMN_BASE_WIDTH = 8;
|
|
4
|
-
export declare const COLUMN_MIN_WIDTH: number;
|
|
5
4
|
export type GetWidthCss = (arg: {
|
|
6
5
|
shouldUseWidth: boolean;
|
|
7
6
|
width?: number;
|
|
8
7
|
}) => React.CSSProperties;
|
|
8
|
+
export declare const getColumnMinWidth: (key: string) => number;
|
|
9
9
|
/**
|
|
10
10
|
* Generate width related portion of css for table cell.
|
|
11
11
|
*
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Generates Typescript types for analytics events from analytics.spec.yaml
|
|
5
5
|
*
|
|
6
|
-
* @codegen <<SignedSource::
|
|
6
|
+
* @codegen <<SignedSource::a773c6cad8ff2e59bb7020ea85e35bc5>>
|
|
7
7
|
* @codegenCommand yarn workspace @atlassian/analytics-tooling run analytics:codegen link-datasource
|
|
8
8
|
*/
|
|
9
9
|
export type ComponentMetaDataType = {
|
|
@@ -141,6 +141,10 @@ export type ObjectSchemasSuccessAttributesType = {};
|
|
|
141
141
|
export type ObjectSchemasFailedAttributesType = {
|
|
142
142
|
statusCodeGroup: '1xx' | '3xx' | '4xx' | '5xx' | 'unknown';
|
|
143
143
|
};
|
|
144
|
+
export type ActionExecutionSuccessAttributesType = {
|
|
145
|
+
integrationKey: string;
|
|
146
|
+
experience: 'datasource';
|
|
147
|
+
};
|
|
144
148
|
export type ActionDiscoverySuccessAttributesType = {
|
|
145
149
|
experience: 'datasource';
|
|
146
150
|
entityType: string;
|
|
@@ -256,6 +260,9 @@ export type AnalyticsEventAttributes = {
|
|
|
256
260
|
/**
|
|
257
261
|
* Fired when fetching object schemas fails. */
|
|
258
262
|
'operational.objectSchemas.failed': ObjectSchemasFailedAttributesType;
|
|
263
|
+
/**
|
|
264
|
+
* Fired when an atomic action execution is successful */
|
|
265
|
+
'operational.actionExecution.success': ActionExecutionSuccessAttributesType;
|
|
259
266
|
/**
|
|
260
267
|
* Fired when the action discovery and permissions request is successful. */
|
|
261
268
|
'operational.actionDiscovery.success': ActionDiscoverySuccessAttributesType;
|
|
@@ -4,10 +4,9 @@ import type { DatasourceTypeWithOnlyValues } from '../types';
|
|
|
4
4
|
interface InlineEditProps {
|
|
5
5
|
ari: string;
|
|
6
6
|
columnKey: string;
|
|
7
|
-
integrationKey: string;
|
|
8
7
|
readView: React.ReactNode;
|
|
9
8
|
datasourceTypeWithValues: DatasourceTypeWithOnlyValues;
|
|
10
9
|
execute: (value: string | number) => Promise<AtomicActionExecuteResponse>;
|
|
11
10
|
}
|
|
12
|
-
export declare const InlineEdit: ({ ari, execute, readView, columnKey,
|
|
11
|
+
export declare const InlineEdit: ({ ari, execute, readView, columnKey, datasourceTypeWithValues, }: InlineEditProps) => JSX.Element;
|
|
13
12
|
export {};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { DatasourceAction } from '../../analytics/types';
|
|
3
3
|
export declare const COLUMN_BASE_WIDTH = 8;
|
|
4
|
-
export declare const COLUMN_MIN_WIDTH: number;
|
|
5
4
|
export type GetWidthCss = (arg: {
|
|
6
5
|
shouldUseWidth: boolean;
|
|
7
6
|
width?: number;
|
|
8
7
|
}) => React.CSSProperties;
|
|
8
|
+
export declare const getColumnMinWidth: (key: string) => number;
|
|
9
9
|
/**
|
|
10
10
|
* Generate width related portion of css for table cell.
|
|
11
11
|
*
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/link-datasource",
|
|
3
|
-
"version": "2.11.
|
|
3
|
+
"version": "2.11.13",
|
|
4
4
|
"description": "UI Components to support linking platform dataset feature",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -38,12 +38,13 @@
|
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@atlaskit/adf-schema": "^40.9.0",
|
|
40
40
|
"@atlaskit/analytics-next": "^10.1.0",
|
|
41
|
+
"@atlaskit/atlassian-context": "^0.0.1",
|
|
41
42
|
"@atlaskit/avatar": "^21.15.0",
|
|
42
43
|
"@atlaskit/avatar-group": "^9.11.0",
|
|
43
44
|
"@atlaskit/badge": "^16.4.0",
|
|
44
45
|
"@atlaskit/button": "^20.1.0",
|
|
45
46
|
"@atlaskit/datetime-picker": "^14.0.0",
|
|
46
|
-
"@atlaskit/dropdown-menu": "^12.
|
|
47
|
+
"@atlaskit/dropdown-menu": "^12.18.0",
|
|
47
48
|
"@atlaskit/editor-prosemirror": "5.0.1",
|
|
48
49
|
"@atlaskit/empty-state": "^7.11.0",
|
|
49
50
|
"@atlaskit/flag": "^15.8.0",
|
|
@@ -73,7 +74,7 @@
|
|
|
73
74
|
"@atlaskit/pragmatic-drag-and-drop-react-drop-indicator": "^1.1.0",
|
|
74
75
|
"@atlaskit/primitives": "^12.0.0",
|
|
75
76
|
"@atlaskit/select": "^17.15.0",
|
|
76
|
-
"@atlaskit/smart-card": "^27.
|
|
77
|
+
"@atlaskit/smart-card": "^27.19.0",
|
|
77
78
|
"@atlaskit/smart-user-picker": "6.10.2",
|
|
78
79
|
"@atlaskit/spinner": "^16.3.0",
|
|
79
80
|
"@atlaskit/tag": "^12.5.0",
|