@atlaskit/link-datasource 2.11.12 → 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 +13 -0
- package/dist/cjs/hooks/useDatasourceTableState.js +15 -12
- package/dist/cjs/ui/issue-like-table/draggable-table-heading.js +3 -3
- package/dist/cjs/ui/issue-like-table/utils.js +9 -2
- package/dist/es2019/hooks/useDatasourceTableState.js +15 -12
- package/dist/es2019/ui/issue-like-table/draggable-table-heading.js +4 -4
- package/dist/es2019/ui/issue-like-table/utils.js +8 -1
- package/dist/esm/hooks/useDatasourceTableState.js +15 -12
- package/dist/esm/ui/issue-like-table/draggable-table-heading.js +4 -4
- package/dist/esm/ui/issue-like-table/utils.js +8 -1
- package/dist/types/ui/issue-like-table/utils.d.ts +1 -1
- package/dist/types-ts4.5/ui/issue-like-table/utils.d.ts +1 -1
- package/package.json +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
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
|
+
|
|
3
16
|
## 2.11.12
|
|
4
17
|
|
|
5
18
|
### 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
|
}
|
|
@@ -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
|
}
|
|
@@ -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
|
}
|
|
@@ -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
|
}
|
|
@@ -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
|
}
|
|
@@ -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
|
}
|
|
@@ -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
|
*
|
|
@@ -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
|
*
|
|
@@ -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,6 +38,7 @@
|
|
|
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",
|