@atlaskit/link-datasource 2.0.3 → 2.1.0
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 +36 -0
- package/dist/cjs/ui/confluence-search-modal/modal/index.js +11 -35
- package/dist/cjs/ui/issue-like-table/use-column-resize/index.js +25 -0
- package/dist/cjs/ui/issue-like-table/use-column-wrapping/index.js +29 -0
- package/dist/cjs/ui/issue-like-table/utils.js +18 -1
- package/dist/cjs/ui/jira-issues-modal/modal/index.js +12 -39
- package/dist/cjs/ui/table-footer/index.js +1 -2
- package/dist/es2019/ui/confluence-search-modal/modal/index.js +11 -30
- package/dist/es2019/ui/issue-like-table/use-column-resize/index.js +14 -0
- package/dist/es2019/ui/issue-like-table/use-column-wrapping/index.js +17 -0
- package/dist/es2019/ui/issue-like-table/utils.js +17 -0
- package/dist/es2019/ui/jira-issues-modal/modal/index.js +11 -33
- package/dist/es2019/ui/table-footer/index.js +1 -2
- package/dist/esm/ui/confluence-search-modal/modal/index.js +9 -33
- package/dist/esm/ui/issue-like-table/use-column-resize/index.js +18 -0
- package/dist/esm/ui/issue-like-table/use-column-wrapping/index.js +22 -0
- package/dist/esm/ui/issue-like-table/utils.js +17 -0
- package/dist/esm/ui/jira-issues-modal/modal/index.js +11 -38
- package/dist/esm/ui/table-footer/index.js +1 -2
- package/dist/types/ui/assets-modal/modal/index.d.ts +1 -1
- package/dist/types/ui/assets-modal/types.d.ts +4 -8
- package/dist/types/ui/confluence-search-modal/modal/index.d.ts +0 -2
- package/dist/types/ui/confluence-search-modal/types.d.ts +2 -1
- package/dist/types/ui/issue-like-table/types.d.ts +2 -2
- package/dist/types/ui/issue-like-table/use-column-resize/index.d.ts +5 -0
- package/dist/types/ui/issue-like-table/use-column-wrapping/index.d.ts +4 -0
- package/dist/types/ui/issue-like-table/utils.d.ts +6 -0
- package/dist/types/ui/jira-issues-modal/modal/index.d.ts +1 -7
- package/dist/types-ts4.5/ui/assets-modal/modal/index.d.ts +1 -1
- package/dist/types-ts4.5/ui/assets-modal/types.d.ts +4 -8
- package/dist/types-ts4.5/ui/confluence-search-modal/modal/index.d.ts +0 -2
- package/dist/types-ts4.5/ui/confluence-search-modal/types.d.ts +2 -1
- package/dist/types-ts4.5/ui/issue-like-table/types.d.ts +2 -2
- package/dist/types-ts4.5/ui/issue-like-table/use-column-resize/index.d.ts +5 -0
- package/dist/types-ts4.5/ui/issue-like-table/use-column-wrapping/index.d.ts +4 -0
- package/dist/types-ts4.5/ui/issue-like-table/utils.d.ts +6 -0
- package/dist/types-ts4.5/ui/jira-issues-modal/modal/index.d.ts +1 -7
- package/examples-helpers/useCommonTableProps.tsx +8 -24
- package/package.json +2 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,41 @@
|
|
|
1
1
|
# @atlaskit/link-datasource
|
|
2
2
|
|
|
3
|
+
## 2.1.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#97537](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/97537)
|
|
8
|
+
[`ab7caf1bf7ee`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/ab7caf1bf7ee) -
|
|
9
|
+
Update AssetsConfigModalProps to be aligned with other modals. New fields made available
|
|
10
|
+
including:
|
|
11
|
+
|
|
12
|
+
- `url`: The url that was used to insert a List of Links
|
|
13
|
+
- `viewMode`: 2 viewModes `inline` and `table` for different display.
|
|
14
|
+
- `wrappedColumnKeys`: toggle line-wrapping for each column.
|
|
15
|
+
- `columnCustomSizes`: allow customized column sizes.
|
|
16
|
+
|
|
17
|
+
The new fields are not required for each modal to implement.
|
|
18
|
+
|
|
19
|
+
### Patch Changes
|
|
20
|
+
|
|
21
|
+
- [#98158](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/98158)
|
|
22
|
+
[`2ec887a95a61`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/2ec887a95a61) -
|
|
23
|
+
Minor internal refactor. No expected functional changes.
|
|
24
|
+
|
|
25
|
+
## 2.0.4
|
|
26
|
+
|
|
27
|
+
### Patch Changes
|
|
28
|
+
|
|
29
|
+
- [#97036](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/97036)
|
|
30
|
+
[`e5916b757500`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/e5916b757500) -
|
|
31
|
+
Power by Assets FF cleanup
|
|
32
|
+
- [#98096](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/98096)
|
|
33
|
+
[`56ced02c4cfe`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/56ced02c4cfe) -
|
|
34
|
+
Minor internal refactor to column resizing. No expected functional changes.
|
|
35
|
+
- [#97626](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/97626)
|
|
36
|
+
[`6cce587bf7c2`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/6cce587bf7c2) -
|
|
37
|
+
Minor internal refactor to column wrapping. No expected functional changes.
|
|
38
|
+
|
|
3
39
|
## 2.0.3
|
|
4
40
|
|
|
5
41
|
### Patch Changes
|
|
@@ -5,7 +5,7 @@ var _typeof = require("@babel/runtime/helpers/typeof");
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.
|
|
8
|
+
exports.PlainConfluenceSearchConfigModal = exports.ConfluenceSearchConfigModal = void 0;
|
|
9
9
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
10
10
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
11
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
@@ -43,6 +43,9 @@ var _countViewSmartLink = require("../../common/modal/count-view-smart-link");
|
|
|
43
43
|
var _displayViewDropDown = require("../../common/modal/display-view-dropdown/display-view-drop-down");
|
|
44
44
|
var _siteSelector = require("../../common/modal/site-selector");
|
|
45
45
|
var _issueLikeTable = require("../../issue-like-table");
|
|
46
|
+
var _useColumnResize2 = require("../../issue-like-table/use-column-resize");
|
|
47
|
+
var _useColumnWrapping2 = require("../../issue-like-table/use-column-wrapping");
|
|
48
|
+
var _utils = require("../../issue-like-table/utils");
|
|
46
49
|
var _confluenceSearchContainer = _interopRequireDefault(require("../confluence-search-container"));
|
|
47
50
|
var _confluenceSearchInitialStateSvg = require("./confluence-search-initial-state-svg");
|
|
48
51
|
var _messages = require("./messages");
|
|
@@ -59,19 +62,6 @@ var searchCountStyles = (0, _primitives.xcss)({
|
|
|
59
62
|
flex: 1,
|
|
60
63
|
fontWeight: 600
|
|
61
64
|
});
|
|
62
|
-
|
|
63
|
-
// TODO: common functionality of all modals refactor in EDM-9573
|
|
64
|
-
var getColumnAction = exports.getColumnAction = function getColumnAction(oldVisibleColumnKeys, newVisibleColumnKeys) {
|
|
65
|
-
var newColumnSize = newVisibleColumnKeys.length;
|
|
66
|
-
var oldColumnSize = oldVisibleColumnKeys.length;
|
|
67
|
-
if (newColumnSize > oldColumnSize) {
|
|
68
|
-
return _types.DatasourceAction.COLUMN_ADDED;
|
|
69
|
-
} else if (newColumnSize < oldColumnSize) {
|
|
70
|
-
return _types.DatasourceAction.COLUMN_REMOVED;
|
|
71
|
-
} else {
|
|
72
|
-
return _types.DatasourceAction.COLUMN_REORDERED;
|
|
73
|
-
}
|
|
74
|
-
};
|
|
75
65
|
var PlainConfluenceSearchConfigModal = exports.PlainConfluenceSearchConfigModal = function PlainConfluenceSearchConfigModal(props) {
|
|
76
66
|
var _useRef = (0, _react.useRef)((0, _uuid.v4)()),
|
|
77
67
|
modalRenderInstanceId = _useRef.current;
|
|
@@ -242,31 +232,17 @@ var PlainConfluenceSearchConfigModal = exports.PlainConfluenceSearchConfigModal
|
|
|
242
232
|
setVisibleColumnKeys(newVisibleColumnKeys);
|
|
243
233
|
}, [initialVisibleColumnKeys, defaultVisibleColumnKeys]);
|
|
244
234
|
var siteSelectorLabel = availableSites && availableSites.length > 1 ? _messages.confluenceSearchModalMessages.insertIssuesTitleManySites : _messages.confluenceSearchModalMessages.insertIssuesTitle;
|
|
245
|
-
var
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
}, [columnCustomSizes]);
|
|
252
|
-
var _useState17 = (0, _react.useState)(initialWrappedColumnKeys),
|
|
253
|
-
_useState18 = (0, _slicedToArray2.default)(_useState17, 2),
|
|
254
|
-
wrappedColumnKeys = _useState18[0],
|
|
255
|
-
setWrappedColumnKeys = _useState18[1];
|
|
256
|
-
var onWrappedColumnChange = (0, _react.useCallback)(function (key, isWrapped) {
|
|
257
|
-
var set = new Set(wrappedColumnKeys);
|
|
258
|
-
if (isWrapped) {
|
|
259
|
-
set.add(key);
|
|
260
|
-
} else {
|
|
261
|
-
set.delete(key);
|
|
262
|
-
}
|
|
263
|
-
setWrappedColumnKeys(Array.from(set));
|
|
264
|
-
}, [wrappedColumnKeys]);
|
|
235
|
+
var _useColumnResize = (0, _useColumnResize2.useColumnResize)(initialColumnCustomSizes),
|
|
236
|
+
columnCustomSizes = _useColumnResize.columnCustomSizes,
|
|
237
|
+
onColumnResize = _useColumnResize.onColumnResize;
|
|
238
|
+
var _useColumnWrapping = (0, _useColumnWrapping2.useColumnWrapping)(initialWrappedColumnKeys),
|
|
239
|
+
wrappedColumnKeys = _useColumnWrapping.wrappedColumnKeys,
|
|
240
|
+
onWrappedColumnChange = _useColumnWrapping.onWrappedColumnChange;
|
|
265
241
|
|
|
266
242
|
// TODO: common functionality of all modals refactor in EDM-9573
|
|
267
243
|
var handleVisibleColumnKeysChange = (0, _react.useCallback)(function () {
|
|
268
244
|
var newVisibleColumnKeys = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
269
|
-
var columnAction = getColumnAction(visibleColumnKeys || [], newVisibleColumnKeys);
|
|
245
|
+
var columnAction = (0, _utils.getColumnAction)(visibleColumnKeys || [], newVisibleColumnKeys);
|
|
270
246
|
userInteractionActions.current.add(columnAction);
|
|
271
247
|
visibleColumnCount.current = newVisibleColumnKeys.length;
|
|
272
248
|
setVisibleColumnKeys(newVisibleColumnKeys);
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.useColumnResize = void 0;
|
|
8
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
10
|
+
var _react = require("react");
|
|
11
|
+
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; }
|
|
12
|
+
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; }
|
|
13
|
+
var useColumnResize = exports.useColumnResize = function useColumnResize(initialColumnCustomSizes) {
|
|
14
|
+
var _useState = (0, _react.useState)(initialColumnCustomSizes),
|
|
15
|
+
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
16
|
+
columnCustomSizes = _useState2[0],
|
|
17
|
+
setColumnCustomSizes = _useState2[1];
|
|
18
|
+
var onColumnResize = (0, _react.useCallback)(function (key, width) {
|
|
19
|
+
setColumnCustomSizes(_objectSpread(_objectSpread({}, columnCustomSizes), {}, (0, _defineProperty2.default)({}, key, width)));
|
|
20
|
+
}, [columnCustomSizes]);
|
|
21
|
+
return {
|
|
22
|
+
columnCustomSizes: columnCustomSizes,
|
|
23
|
+
onColumnResize: onColumnResize
|
|
24
|
+
};
|
|
25
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.useColumnWrapping = void 0;
|
|
8
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
9
|
+
var _react = require("react");
|
|
10
|
+
var useColumnWrapping = exports.useColumnWrapping = function useColumnWrapping() {
|
|
11
|
+
var initialWrappedColumnKeys = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
12
|
+
var _useState = (0, _react.useState)(initialWrappedColumnKeys),
|
|
13
|
+
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
14
|
+
wrappedColumnKeys = _useState2[0],
|
|
15
|
+
setWrappedColumnKeys = _useState2[1];
|
|
16
|
+
var onWrappedColumnChange = (0, _react.useCallback)(function (key, isWrapped) {
|
|
17
|
+
var set = new Set(wrappedColumnKeys);
|
|
18
|
+
if (isWrapped) {
|
|
19
|
+
set.add(key);
|
|
20
|
+
} else {
|
|
21
|
+
set.delete(key);
|
|
22
|
+
}
|
|
23
|
+
setWrappedColumnKeys(Array.from(set));
|
|
24
|
+
}, [wrappedColumnKeys]);
|
|
25
|
+
return {
|
|
26
|
+
wrappedColumnKeys: wrappedColumnKeys,
|
|
27
|
+
onWrappedColumnChange: onWrappedColumnChange
|
|
28
|
+
};
|
|
29
|
+
};
|
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.getWidthCss = exports.COLUMN_MIN_WIDTH = exports.COLUMN_BASE_WIDTH = void 0;
|
|
6
|
+
exports.getWidthCss = exports.getColumnAction = exports.COLUMN_MIN_WIDTH = exports.COLUMN_BASE_WIDTH = void 0;
|
|
7
|
+
var _types = require("../../analytics/types");
|
|
7
8
|
var COLUMN_BASE_WIDTH = exports.COLUMN_BASE_WIDTH = 8;
|
|
8
9
|
var COLUMN_MIN_WIDTH = exports.COLUMN_MIN_WIDTH = COLUMN_BASE_WIDTH * 3;
|
|
9
10
|
/**
|
|
@@ -23,4 +24,20 @@ var getWidthCss = exports.getWidthCss = function getWidthCss(_ref) {
|
|
|
23
24
|
} : {
|
|
24
25
|
maxWidth: width
|
|
25
26
|
};
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* This method should be called when one atomic action is performed on columns: adding new item, removing one item, changing items order.
|
|
31
|
+
* The assumption is that since only one action is changed at each time, we don't have to verify the actual contents of the lists.
|
|
32
|
+
*/
|
|
33
|
+
var getColumnAction = exports.getColumnAction = function getColumnAction(oldVisibleColumnKeys, newVisibleColumnKeys) {
|
|
34
|
+
var newColumnSize = newVisibleColumnKeys.length;
|
|
35
|
+
var oldColumnSize = oldVisibleColumnKeys.length;
|
|
36
|
+
if (newColumnSize > oldColumnSize) {
|
|
37
|
+
return _types.DatasourceAction.COLUMN_ADDED;
|
|
38
|
+
} else if (newColumnSize < oldColumnSize) {
|
|
39
|
+
return _types.DatasourceAction.COLUMN_REMOVED;
|
|
40
|
+
} else {
|
|
41
|
+
return _types.DatasourceAction.COLUMN_REORDERED;
|
|
42
|
+
}
|
|
26
43
|
};
|
|
@@ -5,12 +5,12 @@ var _typeof = require("@babel/runtime/helpers/typeof");
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.
|
|
8
|
+
exports.PlainJiraIssuesConfigModal = exports.JiraIssuesConfigModal = void 0;
|
|
9
9
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
10
10
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
12
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
12
13
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
13
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
14
14
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
15
15
|
var _react = require("react");
|
|
16
16
|
var _react2 = require("@emotion/react");
|
|
@@ -48,6 +48,9 @@ var _countViewSmartLink = require("../../common/modal/count-view-smart-link");
|
|
|
48
48
|
var _displayViewDropDown = require("../../common/modal/display-view-dropdown/display-view-drop-down");
|
|
49
49
|
var _siteSelector = require("../../common/modal/site-selector");
|
|
50
50
|
var _issueLikeTable = require("../../issue-like-table");
|
|
51
|
+
var _useColumnResize2 = require("../../issue-like-table/use-column-resize");
|
|
52
|
+
var _useColumnWrapping2 = require("../../issue-like-table/use-column-wrapping");
|
|
53
|
+
var _utils2 = require("../../issue-like-table/utils");
|
|
51
54
|
var _ui = require("../basic-filters/ui");
|
|
52
55
|
var _isQueryTooComplex = require("../basic-filters/utils/isQueryTooComplex");
|
|
53
56
|
var _jiraSearchContainer = require("../jira-search-container");
|
|
@@ -68,22 +71,6 @@ var getDisplayValue = function getDisplayValue(currentViewMode, itemCount) {
|
|
|
68
71
|
return itemCount === 1 ? _types.DatasourceDisplay.INLINE : _types.DatasourceDisplay.DATASOURCE_INLINE;
|
|
69
72
|
};
|
|
70
73
|
var jqlSupportDocumentLink = 'https://support.atlassian.com/jira-service-management-cloud/docs/use-advanced-search-with-jira-query-language-jql/';
|
|
71
|
-
|
|
72
|
-
/**
|
|
73
|
-
* This method should be called when one atomic action is performed on columns: adding new item, removing one item, changing items order.
|
|
74
|
-
* The assumption is that since only one action is changed at each time, we don't have to verify the actual contents of the lists.
|
|
75
|
-
*/
|
|
76
|
-
var getColumnAction = exports.getColumnAction = function getColumnAction(oldVisibleColumnKeys, newVisibleColumnKeys) {
|
|
77
|
-
var newColumnSize = newVisibleColumnKeys.length;
|
|
78
|
-
var oldColumnSize = oldVisibleColumnKeys.length;
|
|
79
|
-
if (newColumnSize > oldColumnSize) {
|
|
80
|
-
return _types.DatasourceAction.COLUMN_ADDED;
|
|
81
|
-
} else if (newColumnSize < oldColumnSize) {
|
|
82
|
-
return _types.DatasourceAction.COLUMN_REMOVED;
|
|
83
|
-
} else {
|
|
84
|
-
return _types.DatasourceAction.COLUMN_REORDERED;
|
|
85
|
-
}
|
|
86
|
-
};
|
|
87
74
|
var PlainJiraIssuesConfigModal = exports.PlainJiraIssuesConfigModal = function PlainJiraIssuesConfigModal(props) {
|
|
88
75
|
var datasourceId = props.datasourceId,
|
|
89
76
|
initialColumnCustomSizes = props.columnCustomSizes,
|
|
@@ -139,26 +126,12 @@ var PlainJiraIssuesConfigModal = exports.PlainJiraIssuesConfigModal = function P
|
|
|
139
126
|
} : undefined;
|
|
140
127
|
}, [cloudId, jql]);
|
|
141
128
|
var isParametersSet = !!(jql && cloudId);
|
|
142
|
-
var
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
}, [columnCustomSizes]);
|
|
149
|
-
var _useState17 = (0, _react.useState)(initialWrappedColumnKeys),
|
|
150
|
-
_useState18 = (0, _slicedToArray2.default)(_useState17, 2),
|
|
151
|
-
wrappedColumnKeys = _useState18[0],
|
|
152
|
-
setWrappedColumnKeys = _useState18[1];
|
|
153
|
-
var onWrappedColumnChange = (0, _react.useCallback)(function (key, isWrapped) {
|
|
154
|
-
var set = new Set(wrappedColumnKeys);
|
|
155
|
-
if (isWrapped) {
|
|
156
|
-
set.add(key);
|
|
157
|
-
} else {
|
|
158
|
-
set.delete(key);
|
|
159
|
-
}
|
|
160
|
-
setWrappedColumnKeys(Array.from(set));
|
|
161
|
-
}, [wrappedColumnKeys]);
|
|
129
|
+
var _useColumnResize = (0, _useColumnResize2.useColumnResize)(initialColumnCustomSizes),
|
|
130
|
+
columnCustomSizes = _useColumnResize.columnCustomSizes,
|
|
131
|
+
onColumnResize = _useColumnResize.onColumnResize;
|
|
132
|
+
var _useColumnWrapping = (0, _useColumnWrapping2.useColumnWrapping)(initialWrappedColumnKeys),
|
|
133
|
+
wrappedColumnKeys = _useColumnWrapping.wrappedColumnKeys,
|
|
134
|
+
onWrappedColumnChange = _useColumnWrapping.onWrappedColumnChange;
|
|
162
135
|
var _useDatasourceTableSt = (0, _useDatasourceTableState.useDatasourceTableState)({
|
|
163
136
|
datasourceId: datasourceId,
|
|
164
137
|
parameters: isParametersSet ? parameters : undefined,
|
|
@@ -434,7 +407,7 @@ var PlainJiraIssuesConfigModal = exports.PlainJiraIssuesConfigModal = function P
|
|
|
434
407
|
}, [onNextPage]);
|
|
435
408
|
var handleVisibleColumnKeysChange = (0, _react.useCallback)(function () {
|
|
436
409
|
var newVisibleColumnKeys = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
437
|
-
var columnAction = getColumnAction(visibleColumnKeys || [], newVisibleColumnKeys);
|
|
410
|
+
var columnAction = (0, _utils2.getColumnAction)(visibleColumnKeys || [], newVisibleColumnKeys);
|
|
438
411
|
userInteractionActions.current.add(columnAction);
|
|
439
412
|
visibleColumnCount.current = newVisibleColumnKeys.length;
|
|
440
413
|
setVisibleColumnKeys(newVisibleColumnKeys);
|
|
@@ -14,7 +14,6 @@ var _reactIntlNext = require("react-intl-next");
|
|
|
14
14
|
var _button = _interopRequireDefault(require("@atlaskit/button"));
|
|
15
15
|
var _heading = _interopRequireDefault(require("@atlaskit/heading"));
|
|
16
16
|
var _refresh = _interopRequireDefault(require("@atlaskit/icon/glyph/refresh"));
|
|
17
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
18
17
|
var _linkUrl = _interopRequireDefault(require("@atlaskit/smart-card/link-url"));
|
|
19
18
|
var _colors = require("@atlaskit/theme/colors");
|
|
20
19
|
var _assetsModal = require("../assets-modal");
|
|
@@ -92,7 +91,7 @@ var TableFooter = exports.TableFooter = function TableFooter(_ref) {
|
|
|
92
91
|
values: {
|
|
93
92
|
itemCount: itemCount
|
|
94
93
|
}
|
|
95
|
-
}))))),
|
|
94
|
+
}))))), datasourceId === _assetsModal.ASSETS_LIST_OF_LINKS_DATASOURCE_ID ? (0, _react2.jsx)(_poweredByJsmAssets.PoweredByJSMAssets, {
|
|
96
95
|
text: intl.formatMessage(_messages.footerMessages.powerByJSM)
|
|
97
96
|
}) : null, (0, _react2.jsx)(SyncWrapper, null, onRefresh && (0, _react2.jsx)(_react.Fragment, null, (0, _react2.jsx)(SyncTextWrapper, {
|
|
98
97
|
"data-testid": "sync-text"
|
|
@@ -31,6 +31,9 @@ import { SmartCardPlaceholder, SmartLink } from '../../common/modal/count-view-s
|
|
|
31
31
|
import { DisplayViewDropDown } from '../../common/modal/display-view-dropdown/display-view-drop-down';
|
|
32
32
|
import { SiteSelector } from '../../common/modal/site-selector';
|
|
33
33
|
import { EmptyState, IssueLikeDataTableView } from '../../issue-like-table';
|
|
34
|
+
import { useColumnResize } from '../../issue-like-table/use-column-resize';
|
|
35
|
+
import { useColumnWrapping } from '../../issue-like-table/use-column-wrapping';
|
|
36
|
+
import { getColumnAction } from '../../issue-like-table/utils';
|
|
34
37
|
import ConfluenceSearchContainer from '../confluence-search-container';
|
|
35
38
|
import { ConfluenceSearchInitialStateSVG } from './confluence-search-initial-state-svg';
|
|
36
39
|
import { confluenceSearchModalMessages } from './messages';
|
|
@@ -43,19 +46,6 @@ const searchCountStyles = xcss({
|
|
|
43
46
|
flex: 1,
|
|
44
47
|
fontWeight: 600
|
|
45
48
|
});
|
|
46
|
-
|
|
47
|
-
// TODO: common functionality of all modals refactor in EDM-9573
|
|
48
|
-
export const getColumnAction = (oldVisibleColumnKeys, newVisibleColumnKeys) => {
|
|
49
|
-
const newColumnSize = newVisibleColumnKeys.length;
|
|
50
|
-
const oldColumnSize = oldVisibleColumnKeys.length;
|
|
51
|
-
if (newColumnSize > oldColumnSize) {
|
|
52
|
-
return DatasourceAction.COLUMN_ADDED;
|
|
53
|
-
} else if (newColumnSize < oldColumnSize) {
|
|
54
|
-
return DatasourceAction.COLUMN_REMOVED;
|
|
55
|
-
} else {
|
|
56
|
-
return DatasourceAction.COLUMN_REORDERED;
|
|
57
|
-
}
|
|
58
|
-
};
|
|
59
49
|
export const PlainConfluenceSearchConfigModal = props => {
|
|
60
50
|
const {
|
|
61
51
|
current: modalRenderInstanceId
|
|
@@ -182,23 +172,14 @@ export const PlainConfluenceSearchConfigModal = props => {
|
|
|
182
172
|
setVisibleColumnKeys(newVisibleColumnKeys);
|
|
183
173
|
}, [initialVisibleColumnKeys, defaultVisibleColumnKeys]);
|
|
184
174
|
const siteSelectorLabel = availableSites && availableSites.length > 1 ? confluenceSearchModalMessages.insertIssuesTitleManySites : confluenceSearchModalMessages.insertIssuesTitle;
|
|
185
|
-
const
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
const onWrappedColumnChange = useCallback((key, isWrapped) => {
|
|
194
|
-
const set = new Set(wrappedColumnKeys);
|
|
195
|
-
if (isWrapped) {
|
|
196
|
-
set.add(key);
|
|
197
|
-
} else {
|
|
198
|
-
set.delete(key);
|
|
199
|
-
}
|
|
200
|
-
setWrappedColumnKeys(Array.from(set));
|
|
201
|
-
}, [wrappedColumnKeys]);
|
|
175
|
+
const {
|
|
176
|
+
columnCustomSizes,
|
|
177
|
+
onColumnResize
|
|
178
|
+
} = useColumnResize(initialColumnCustomSizes);
|
|
179
|
+
const {
|
|
180
|
+
wrappedColumnKeys,
|
|
181
|
+
onWrappedColumnChange
|
|
182
|
+
} = useColumnWrapping(initialWrappedColumnKeys);
|
|
202
183
|
|
|
203
184
|
// TODO: common functionality of all modals refactor in EDM-9573
|
|
204
185
|
const handleVisibleColumnKeysChange = useCallback((newVisibleColumnKeys = []) => {
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { useCallback, useState } from 'react';
|
|
2
|
+
export const useColumnResize = initialColumnCustomSizes => {
|
|
3
|
+
const [columnCustomSizes, setColumnCustomSizes] = useState(initialColumnCustomSizes);
|
|
4
|
+
const onColumnResize = useCallback((key, width) => {
|
|
5
|
+
setColumnCustomSizes({
|
|
6
|
+
...columnCustomSizes,
|
|
7
|
+
[key]: width
|
|
8
|
+
});
|
|
9
|
+
}, [columnCustomSizes]);
|
|
10
|
+
return {
|
|
11
|
+
columnCustomSizes,
|
|
12
|
+
onColumnResize
|
|
13
|
+
};
|
|
14
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { useCallback, useState } from 'react';
|
|
2
|
+
export const useColumnWrapping = (initialWrappedColumnKeys = []) => {
|
|
3
|
+
const [wrappedColumnKeys, setWrappedColumnKeys] = useState(initialWrappedColumnKeys);
|
|
4
|
+
const onWrappedColumnChange = useCallback((key, isWrapped) => {
|
|
5
|
+
const set = new Set(wrappedColumnKeys);
|
|
6
|
+
if (isWrapped) {
|
|
7
|
+
set.add(key);
|
|
8
|
+
} else {
|
|
9
|
+
set.delete(key);
|
|
10
|
+
}
|
|
11
|
+
setWrappedColumnKeys(Array.from(set));
|
|
12
|
+
}, [wrappedColumnKeys]);
|
|
13
|
+
return {
|
|
14
|
+
wrappedColumnKeys,
|
|
15
|
+
onWrappedColumnChange
|
|
16
|
+
};
|
|
17
|
+
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { DatasourceAction } from '../../analytics/types';
|
|
1
2
|
export const COLUMN_BASE_WIDTH = 8;
|
|
2
3
|
export const COLUMN_MIN_WIDTH = COLUMN_BASE_WIDTH * 3;
|
|
3
4
|
/**
|
|
@@ -16,4 +17,20 @@ export const getWidthCss = ({
|
|
|
16
17
|
width
|
|
17
18
|
} : {
|
|
18
19
|
maxWidth: width
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* This method should be called when one atomic action is performed on columns: adding new item, removing one item, changing items order.
|
|
24
|
+
* The assumption is that since only one action is changed at each time, we don't have to verify the actual contents of the lists.
|
|
25
|
+
*/
|
|
26
|
+
export const getColumnAction = (oldVisibleColumnKeys, newVisibleColumnKeys) => {
|
|
27
|
+
const newColumnSize = newVisibleColumnKeys.length;
|
|
28
|
+
const oldColumnSize = oldVisibleColumnKeys.length;
|
|
29
|
+
if (newColumnSize > oldColumnSize) {
|
|
30
|
+
return DatasourceAction.COLUMN_ADDED;
|
|
31
|
+
} else if (newColumnSize < oldColumnSize) {
|
|
32
|
+
return DatasourceAction.COLUMN_REMOVED;
|
|
33
|
+
} else {
|
|
34
|
+
return DatasourceAction.COLUMN_REORDERED;
|
|
35
|
+
}
|
|
19
36
|
};
|
|
@@ -36,6 +36,9 @@ import { SmartCardPlaceholder, SmartLink } from '../../common/modal/count-view-s
|
|
|
36
36
|
import { DisplayViewDropDown } from '../../common/modal/display-view-dropdown/display-view-drop-down';
|
|
37
37
|
import { SiteSelector } from '../../common/modal/site-selector';
|
|
38
38
|
import { EmptyState, IssueLikeDataTableView } from '../../issue-like-table';
|
|
39
|
+
import { useColumnResize } from '../../issue-like-table/use-column-resize';
|
|
40
|
+
import { useColumnWrapping } from '../../issue-like-table/use-column-wrapping';
|
|
41
|
+
import { getColumnAction } from '../../issue-like-table/utils';
|
|
39
42
|
import { availableBasicFilterTypes } from '../basic-filters/ui';
|
|
40
43
|
import { isQueryTooComplex } from '../basic-filters/utils/isQueryTooComplex';
|
|
41
44
|
import { JiraSearchContainer } from '../jira-search-container';
|
|
@@ -52,22 +55,6 @@ const getDisplayValue = (currentViewMode, itemCount) => {
|
|
|
52
55
|
return itemCount === 1 ? DatasourceDisplay.INLINE : DatasourceDisplay.DATASOURCE_INLINE;
|
|
53
56
|
};
|
|
54
57
|
const jqlSupportDocumentLink = 'https://support.atlassian.com/jira-service-management-cloud/docs/use-advanced-search-with-jira-query-language-jql/';
|
|
55
|
-
|
|
56
|
-
/**
|
|
57
|
-
* This method should be called when one atomic action is performed on columns: adding new item, removing one item, changing items order.
|
|
58
|
-
* The assumption is that since only one action is changed at each time, we don't have to verify the actual contents of the lists.
|
|
59
|
-
*/
|
|
60
|
-
export const getColumnAction = (oldVisibleColumnKeys, newVisibleColumnKeys) => {
|
|
61
|
-
const newColumnSize = newVisibleColumnKeys.length;
|
|
62
|
-
const oldColumnSize = oldVisibleColumnKeys.length;
|
|
63
|
-
if (newColumnSize > oldColumnSize) {
|
|
64
|
-
return DatasourceAction.COLUMN_ADDED;
|
|
65
|
-
} else if (newColumnSize < oldColumnSize) {
|
|
66
|
-
return DatasourceAction.COLUMN_REMOVED;
|
|
67
|
-
} else {
|
|
68
|
-
return DatasourceAction.COLUMN_REORDERED;
|
|
69
|
-
}
|
|
70
|
-
};
|
|
71
58
|
export const PlainJiraIssuesConfigModal = props => {
|
|
72
59
|
const {
|
|
73
60
|
datasourceId,
|
|
@@ -101,23 +88,14 @@ export const PlainJiraIssuesConfigModal = props => {
|
|
|
101
88
|
jql: jql || ''
|
|
102
89
|
} : undefined, [cloudId, jql]);
|
|
103
90
|
const isParametersSet = !!(jql && cloudId);
|
|
104
|
-
const
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
const onWrappedColumnChange = useCallback((key, isWrapped) => {
|
|
113
|
-
const set = new Set(wrappedColumnKeys);
|
|
114
|
-
if (isWrapped) {
|
|
115
|
-
set.add(key);
|
|
116
|
-
} else {
|
|
117
|
-
set.delete(key);
|
|
118
|
-
}
|
|
119
|
-
setWrappedColumnKeys(Array.from(set));
|
|
120
|
-
}, [wrappedColumnKeys]);
|
|
91
|
+
const {
|
|
92
|
+
columnCustomSizes,
|
|
93
|
+
onColumnResize
|
|
94
|
+
} = useColumnResize(initialColumnCustomSizes);
|
|
95
|
+
const {
|
|
96
|
+
wrappedColumnKeys,
|
|
97
|
+
onWrappedColumnChange
|
|
98
|
+
} = useColumnWrapping(initialWrappedColumnKeys);
|
|
121
99
|
const {
|
|
122
100
|
reset,
|
|
123
101
|
status,
|
|
@@ -7,7 +7,6 @@ import { FormattedMessage, FormattedNumber, useIntl } from 'react-intl-next';
|
|
|
7
7
|
import Button from '@atlaskit/button';
|
|
8
8
|
import Heading from '@atlaskit/heading';
|
|
9
9
|
import RefreshIcon from '@atlaskit/icon/glyph/refresh';
|
|
10
|
-
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
11
10
|
import LinkUrl from '@atlaskit/smart-card/link-url';
|
|
12
11
|
import { N0, N40, N800, N90 } from '@atlaskit/theme/colors';
|
|
13
12
|
import { ASSETS_LIST_OF_LINKS_DATASOURCE_ID } from '../assets-modal';
|
|
@@ -81,7 +80,7 @@ export const TableFooter = ({
|
|
|
81
80
|
values: {
|
|
82
81
|
itemCount
|
|
83
82
|
}
|
|
84
|
-
}))))),
|
|
83
|
+
}))))), datasourceId === ASSETS_LIST_OF_LINKS_DATASOURCE_ID ? jsx(PoweredByJSMAssets, {
|
|
85
84
|
text: intl.formatMessage(footerMessages.powerByJSM)
|
|
86
85
|
}) : null, jsx(SyncWrapper, null, onRefresh && jsx(Fragment, null, jsx(SyncTextWrapper, {
|
|
87
86
|
"data-testid": "sync-text"
|
|
@@ -38,6 +38,9 @@ import { SmartCardPlaceholder, SmartLink } from '../../common/modal/count-view-s
|
|
|
38
38
|
import { DisplayViewDropDown } from '../../common/modal/display-view-dropdown/display-view-drop-down';
|
|
39
39
|
import { SiteSelector } from '../../common/modal/site-selector';
|
|
40
40
|
import { EmptyState, IssueLikeDataTableView } from '../../issue-like-table';
|
|
41
|
+
import { useColumnResize } from '../../issue-like-table/use-column-resize';
|
|
42
|
+
import { useColumnWrapping } from '../../issue-like-table/use-column-wrapping';
|
|
43
|
+
import { getColumnAction } from '../../issue-like-table/utils';
|
|
41
44
|
import ConfluenceSearchContainer from '../confluence-search-container';
|
|
42
45
|
import { ConfluenceSearchInitialStateSVG } from './confluence-search-initial-state-svg';
|
|
43
46
|
import { confluenceSearchModalMessages } from './messages';
|
|
@@ -50,19 +53,6 @@ var searchCountStyles = xcss({
|
|
|
50
53
|
flex: 1,
|
|
51
54
|
fontWeight: 600
|
|
52
55
|
});
|
|
53
|
-
|
|
54
|
-
// TODO: common functionality of all modals refactor in EDM-9573
|
|
55
|
-
export var getColumnAction = function getColumnAction(oldVisibleColumnKeys, newVisibleColumnKeys) {
|
|
56
|
-
var newColumnSize = newVisibleColumnKeys.length;
|
|
57
|
-
var oldColumnSize = oldVisibleColumnKeys.length;
|
|
58
|
-
if (newColumnSize > oldColumnSize) {
|
|
59
|
-
return DatasourceAction.COLUMN_ADDED;
|
|
60
|
-
} else if (newColumnSize < oldColumnSize) {
|
|
61
|
-
return DatasourceAction.COLUMN_REMOVED;
|
|
62
|
-
} else {
|
|
63
|
-
return DatasourceAction.COLUMN_REORDERED;
|
|
64
|
-
}
|
|
65
|
-
};
|
|
66
56
|
export var PlainConfluenceSearchConfigModal = function PlainConfluenceSearchConfigModal(props) {
|
|
67
57
|
var _useRef = useRef(uuidv4()),
|
|
68
58
|
modalRenderInstanceId = _useRef.current;
|
|
@@ -233,26 +223,12 @@ export var PlainConfluenceSearchConfigModal = function PlainConfluenceSearchConf
|
|
|
233
223
|
setVisibleColumnKeys(newVisibleColumnKeys);
|
|
234
224
|
}, [initialVisibleColumnKeys, defaultVisibleColumnKeys]);
|
|
235
225
|
var siteSelectorLabel = availableSites && availableSites.length > 1 ? confluenceSearchModalMessages.insertIssuesTitleManySites : confluenceSearchModalMessages.insertIssuesTitle;
|
|
236
|
-
var
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
}, [columnCustomSizes]);
|
|
243
|
-
var _useState17 = useState(initialWrappedColumnKeys),
|
|
244
|
-
_useState18 = _slicedToArray(_useState17, 2),
|
|
245
|
-
wrappedColumnKeys = _useState18[0],
|
|
246
|
-
setWrappedColumnKeys = _useState18[1];
|
|
247
|
-
var onWrappedColumnChange = useCallback(function (key, isWrapped) {
|
|
248
|
-
var set = new Set(wrappedColumnKeys);
|
|
249
|
-
if (isWrapped) {
|
|
250
|
-
set.add(key);
|
|
251
|
-
} else {
|
|
252
|
-
set.delete(key);
|
|
253
|
-
}
|
|
254
|
-
setWrappedColumnKeys(Array.from(set));
|
|
255
|
-
}, [wrappedColumnKeys]);
|
|
226
|
+
var _useColumnResize = useColumnResize(initialColumnCustomSizes),
|
|
227
|
+
columnCustomSizes = _useColumnResize.columnCustomSizes,
|
|
228
|
+
onColumnResize = _useColumnResize.onColumnResize;
|
|
229
|
+
var _useColumnWrapping = useColumnWrapping(initialWrappedColumnKeys),
|
|
230
|
+
wrappedColumnKeys = _useColumnWrapping.wrappedColumnKeys,
|
|
231
|
+
onWrappedColumnChange = _useColumnWrapping.onWrappedColumnChange;
|
|
256
232
|
|
|
257
233
|
// TODO: common functionality of all modals refactor in EDM-9573
|
|
258
234
|
var handleVisibleColumnKeysChange = useCallback(function () {
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
|
+
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; }
|
|
4
|
+
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; }
|
|
5
|
+
import { useCallback, useState } from 'react';
|
|
6
|
+
export var useColumnResize = function useColumnResize(initialColumnCustomSizes) {
|
|
7
|
+
var _useState = useState(initialColumnCustomSizes),
|
|
8
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
9
|
+
columnCustomSizes = _useState2[0],
|
|
10
|
+
setColumnCustomSizes = _useState2[1];
|
|
11
|
+
var onColumnResize = useCallback(function (key, width) {
|
|
12
|
+
setColumnCustomSizes(_objectSpread(_objectSpread({}, columnCustomSizes), {}, _defineProperty({}, key, width)));
|
|
13
|
+
}, [columnCustomSizes]);
|
|
14
|
+
return {
|
|
15
|
+
columnCustomSizes: columnCustomSizes,
|
|
16
|
+
onColumnResize: onColumnResize
|
|
17
|
+
};
|
|
18
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
+
import { useCallback, useState } from 'react';
|
|
3
|
+
export var useColumnWrapping = function useColumnWrapping() {
|
|
4
|
+
var initialWrappedColumnKeys = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
5
|
+
var _useState = useState(initialWrappedColumnKeys),
|
|
6
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
7
|
+
wrappedColumnKeys = _useState2[0],
|
|
8
|
+
setWrappedColumnKeys = _useState2[1];
|
|
9
|
+
var onWrappedColumnChange = useCallback(function (key, isWrapped) {
|
|
10
|
+
var set = new Set(wrappedColumnKeys);
|
|
11
|
+
if (isWrapped) {
|
|
12
|
+
set.add(key);
|
|
13
|
+
} else {
|
|
14
|
+
set.delete(key);
|
|
15
|
+
}
|
|
16
|
+
setWrappedColumnKeys(Array.from(set));
|
|
17
|
+
}, [wrappedColumnKeys]);
|
|
18
|
+
return {
|
|
19
|
+
wrappedColumnKeys: wrappedColumnKeys,
|
|
20
|
+
onWrappedColumnChange: onWrappedColumnChange
|
|
21
|
+
};
|
|
22
|
+
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { DatasourceAction } from '../../analytics/types';
|
|
1
2
|
export var COLUMN_BASE_WIDTH = 8;
|
|
2
3
|
export var COLUMN_MIN_WIDTH = COLUMN_BASE_WIDTH * 3;
|
|
3
4
|
/**
|
|
@@ -17,4 +18,20 @@ export var getWidthCss = function getWidthCss(_ref) {
|
|
|
17
18
|
} : {
|
|
18
19
|
maxWidth: width
|
|
19
20
|
};
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* This method should be called when one atomic action is performed on columns: adding new item, removing one item, changing items order.
|
|
25
|
+
* The assumption is that since only one action is changed at each time, we don't have to verify the actual contents of the lists.
|
|
26
|
+
*/
|
|
27
|
+
export var getColumnAction = function getColumnAction(oldVisibleColumnKeys, newVisibleColumnKeys) {
|
|
28
|
+
var newColumnSize = newVisibleColumnKeys.length;
|
|
29
|
+
var oldColumnSize = oldVisibleColumnKeys.length;
|
|
30
|
+
if (newColumnSize > oldColumnSize) {
|
|
31
|
+
return DatasourceAction.COLUMN_ADDED;
|
|
32
|
+
} else if (newColumnSize < oldColumnSize) {
|
|
33
|
+
return DatasourceAction.COLUMN_REMOVED;
|
|
34
|
+
} else {
|
|
35
|
+
return DatasourceAction.COLUMN_REORDERED;
|
|
36
|
+
}
|
|
20
37
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
3
|
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
3
4
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
4
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
5
5
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
6
|
-
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
7
6
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
8
7
|
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; }
|
|
8
|
+
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
9
9
|
/** @jsx jsx */
|
|
10
10
|
import { Fragment, useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
11
11
|
import { css, jsx } from '@emotion/react';
|
|
@@ -43,6 +43,9 @@ import { SmartCardPlaceholder, SmartLink } from '../../common/modal/count-view-s
|
|
|
43
43
|
import { DisplayViewDropDown } from '../../common/modal/display-view-dropdown/display-view-drop-down';
|
|
44
44
|
import { SiteSelector } from '../../common/modal/site-selector';
|
|
45
45
|
import { EmptyState, IssueLikeDataTableView } from '../../issue-like-table';
|
|
46
|
+
import { useColumnResize } from '../../issue-like-table/use-column-resize';
|
|
47
|
+
import { useColumnWrapping } from '../../issue-like-table/use-column-wrapping';
|
|
48
|
+
import { getColumnAction } from '../../issue-like-table/utils';
|
|
46
49
|
import { availableBasicFilterTypes } from '../basic-filters/ui';
|
|
47
50
|
import { isQueryTooComplex } from '../basic-filters/utils/isQueryTooComplex';
|
|
48
51
|
import { JiraSearchContainer } from '../jira-search-container';
|
|
@@ -59,22 +62,6 @@ var getDisplayValue = function getDisplayValue(currentViewMode, itemCount) {
|
|
|
59
62
|
return itemCount === 1 ? DatasourceDisplay.INLINE : DatasourceDisplay.DATASOURCE_INLINE;
|
|
60
63
|
};
|
|
61
64
|
var jqlSupportDocumentLink = 'https://support.atlassian.com/jira-service-management-cloud/docs/use-advanced-search-with-jira-query-language-jql/';
|
|
62
|
-
|
|
63
|
-
/**
|
|
64
|
-
* This method should be called when one atomic action is performed on columns: adding new item, removing one item, changing items order.
|
|
65
|
-
* The assumption is that since only one action is changed at each time, we don't have to verify the actual contents of the lists.
|
|
66
|
-
*/
|
|
67
|
-
export var getColumnAction = function getColumnAction(oldVisibleColumnKeys, newVisibleColumnKeys) {
|
|
68
|
-
var newColumnSize = newVisibleColumnKeys.length;
|
|
69
|
-
var oldColumnSize = oldVisibleColumnKeys.length;
|
|
70
|
-
if (newColumnSize > oldColumnSize) {
|
|
71
|
-
return DatasourceAction.COLUMN_ADDED;
|
|
72
|
-
} else if (newColumnSize < oldColumnSize) {
|
|
73
|
-
return DatasourceAction.COLUMN_REMOVED;
|
|
74
|
-
} else {
|
|
75
|
-
return DatasourceAction.COLUMN_REORDERED;
|
|
76
|
-
}
|
|
77
|
-
};
|
|
78
65
|
export var PlainJiraIssuesConfigModal = function PlainJiraIssuesConfigModal(props) {
|
|
79
66
|
var datasourceId = props.datasourceId,
|
|
80
67
|
initialColumnCustomSizes = props.columnCustomSizes,
|
|
@@ -130,26 +117,12 @@ export var PlainJiraIssuesConfigModal = function PlainJiraIssuesConfigModal(prop
|
|
|
130
117
|
} : undefined;
|
|
131
118
|
}, [cloudId, jql]);
|
|
132
119
|
var isParametersSet = !!(jql && cloudId);
|
|
133
|
-
var
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
}, [columnCustomSizes]);
|
|
140
|
-
var _useState17 = useState(initialWrappedColumnKeys),
|
|
141
|
-
_useState18 = _slicedToArray(_useState17, 2),
|
|
142
|
-
wrappedColumnKeys = _useState18[0],
|
|
143
|
-
setWrappedColumnKeys = _useState18[1];
|
|
144
|
-
var onWrappedColumnChange = useCallback(function (key, isWrapped) {
|
|
145
|
-
var set = new Set(wrappedColumnKeys);
|
|
146
|
-
if (isWrapped) {
|
|
147
|
-
set.add(key);
|
|
148
|
-
} else {
|
|
149
|
-
set.delete(key);
|
|
150
|
-
}
|
|
151
|
-
setWrappedColumnKeys(Array.from(set));
|
|
152
|
-
}, [wrappedColumnKeys]);
|
|
120
|
+
var _useColumnResize = useColumnResize(initialColumnCustomSizes),
|
|
121
|
+
columnCustomSizes = _useColumnResize.columnCustomSizes,
|
|
122
|
+
onColumnResize = _useColumnResize.onColumnResize;
|
|
123
|
+
var _useColumnWrapping = useColumnWrapping(initialWrappedColumnKeys),
|
|
124
|
+
wrappedColumnKeys = _useColumnWrapping.wrappedColumnKeys,
|
|
125
|
+
onWrappedColumnChange = _useColumnWrapping.onWrappedColumnChange;
|
|
153
126
|
var _useDatasourceTableSt = useDatasourceTableState({
|
|
154
127
|
datasourceId: datasourceId,
|
|
155
128
|
parameters: isParametersSet ? parameters : undefined,
|
|
@@ -8,7 +8,6 @@ import { FormattedMessage, FormattedNumber, useIntl } from 'react-intl-next';
|
|
|
8
8
|
import Button from '@atlaskit/button';
|
|
9
9
|
import Heading from '@atlaskit/heading';
|
|
10
10
|
import RefreshIcon from '@atlaskit/icon/glyph/refresh';
|
|
11
|
-
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
12
11
|
import LinkUrl from '@atlaskit/smart-card/link-url';
|
|
13
12
|
import { N0, N40, N800, N90 } from '@atlaskit/theme/colors';
|
|
14
13
|
import { ASSETS_LIST_OF_LINKS_DATASOURCE_ID } from '../assets-modal';
|
|
@@ -84,7 +83,7 @@ export var TableFooter = function TableFooter(_ref) {
|
|
|
84
83
|
values: {
|
|
85
84
|
itemCount: itemCount
|
|
86
85
|
}
|
|
87
|
-
}))))),
|
|
86
|
+
}))))), datasourceId === ASSETS_LIST_OF_LINKS_DATASOURCE_ID ? jsx(PoweredByJSMAssets, {
|
|
88
87
|
text: intl.formatMessage(footerMessages.powerByJSM)
|
|
89
88
|
}) : null, jsx(SyncWrapper, null, onRefresh && jsx(Fragment, null, jsx(SyncTextWrapper, {
|
|
90
89
|
"data-testid": "sync-text"
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { AssetsConfigModalProps } from '../types';
|
|
2
|
+
import { type AssetsConfigModalProps } from '../types';
|
|
3
3
|
export declare const AssetsConfigModal: import("react").ForwardRefExoticComponent<AssetsConfigModalProps & import("@atlaskit/analytics-next").WithContextProps & import("react").RefAttributes<any>>;
|
|
@@ -1,15 +1,11 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import {
|
|
1
|
+
import { type DatasourceAdf, type InlineCardAdf } from '@atlaskit/linking-common/types';
|
|
2
|
+
import { type DatasourceParameters } from '@atlaskit/linking-types';
|
|
3
|
+
import { type ConfigModalProps } from '../../common/types';
|
|
3
4
|
export type AssetsDatasourceParameters = {
|
|
4
5
|
workspaceId: string;
|
|
5
6
|
aql: string;
|
|
6
7
|
schemaId: string;
|
|
7
8
|
};
|
|
8
9
|
export type AssetsDatasourceAdf = DatasourceAdf<AssetsDatasourceParameters>;
|
|
9
|
-
export interface AssetsConfigModalProps {
|
|
10
|
-
datasourceId: string;
|
|
11
|
-
visibleColumnKeys?: string[];
|
|
12
|
-
parameters?: AssetsDatasourceParameters;
|
|
13
|
-
onCancel: () => void;
|
|
14
|
-
onInsert: (adf: InlineCardAdf | AssetsDatasourceAdf, analyticsEvent?: UIAnalyticsEvent) => void;
|
|
10
|
+
export interface AssetsConfigModalProps extends ConfigModalProps<InlineCardAdf | AssetsDatasourceAdf, DatasourceParameters | AssetsDatasourceParameters> {
|
|
15
11
|
}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { jsx } from '@emotion/react';
|
|
3
|
-
import { DatasourceAction } from '../../../analytics/types';
|
|
4
3
|
import { type ConfluenceSearchConfigModalProps } from '../types';
|
|
5
|
-
export declare const getColumnAction: (oldVisibleColumnKeys: string[], newVisibleColumnKeys: string[]) => DatasourceAction;
|
|
6
4
|
export declare const PlainConfluenceSearchConfigModal: (props: ConfluenceSearchConfigModalProps) => jsx.JSX.Element;
|
|
7
5
|
export declare const ConfluenceSearchConfigModal: import("react").ForwardRefExoticComponent<ConfluenceSearchConfigModalProps & import("@atlaskit/analytics-next").WithContextProps & import("react").RefAttributes<any>>;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { type DatasourceAdf, type InlineCardAdf } from '@atlaskit/linking-common/types';
|
|
2
|
+
import type { DatasourceParameters } from '@atlaskit/linking-types';
|
|
2
3
|
import { type ConfigModalProps } from '../../common/types';
|
|
3
4
|
import { type DateRangeType } from '../common/modal/popup-select/types';
|
|
4
|
-
export interface ConfluenceSearchConfigModalProps extends ConfigModalProps<InlineCardAdf | ConfluenceSearchDatasourceAdf, ConfluenceSearchDatasourceParameters> {
|
|
5
|
+
export interface ConfluenceSearchConfigModalProps extends ConfigModalProps<InlineCardAdf | ConfluenceSearchDatasourceAdf, DatasourceParameters | ConfluenceSearchDatasourceParameters> {
|
|
5
6
|
disableDisplayDropdown?: boolean;
|
|
6
7
|
overrideParameters?: Pick<ConfluenceSearchDatasourceParameters, 'entityTypes'>;
|
|
7
8
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { DatasourceDataResponseItem, DatasourceResponseSchemaProperty, DatasourceTableStatusType, DatasourceType } from '@atlaskit/linking-types';
|
|
3
|
-
import { NextPageType } from '../../hooks/useDatasourceTableState';
|
|
2
|
+
import type { DatasourceDataResponseItem, DatasourceResponseSchemaProperty, DatasourceTableStatusType, DatasourceType } from '@atlaskit/linking-types';
|
|
3
|
+
import type { NextPageType } from '../../hooks/useDatasourceTableState';
|
|
4
4
|
export type DatasourceTypeWithOnlyValues = {
|
|
5
5
|
[K in DatasourceType['type']]: {
|
|
6
6
|
type: K;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
import { DatasourceAction } from '../../analytics/types';
|
|
2
3
|
export declare const COLUMN_BASE_WIDTH = 8;
|
|
3
4
|
export declare const COLUMN_MIN_WIDTH: number;
|
|
4
5
|
export type GetWidthCss = (arg: {
|
|
@@ -15,3 +16,8 @@ export type GetWidthCss = (arg: {
|
|
|
15
16
|
* @param width
|
|
16
17
|
*/
|
|
17
18
|
export declare const getWidthCss: GetWidthCss;
|
|
19
|
+
/**
|
|
20
|
+
* This method should be called when one atomic action is performed on columns: adding new item, removing one item, changing items order.
|
|
21
|
+
* The assumption is that since only one action is changed at each time, we don't have to verify the actual contents of the lists.
|
|
22
|
+
*/
|
|
23
|
+
export declare const getColumnAction: (oldVisibleColumnKeys: string[], newVisibleColumnKeys: string[]) => DatasourceAction;
|
|
@@ -1,11 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { jsx } from '@emotion/react';
|
|
3
|
-
import {
|
|
4
|
-
import { JiraConfigModalProps } from '../types';
|
|
5
|
-
/**
|
|
6
|
-
* This method should be called when one atomic action is performed on columns: adding new item, removing one item, changing items order.
|
|
7
|
-
* The assumption is that since only one action is changed at each time, we don't have to verify the actual contents of the lists.
|
|
8
|
-
*/
|
|
9
|
-
export declare const getColumnAction: (oldVisibleColumnKeys: string[], newVisibleColumnKeys: string[]) => DatasourceAction;
|
|
3
|
+
import type { JiraConfigModalProps } from '../types';
|
|
10
4
|
export declare const PlainJiraIssuesConfigModal: (props: JiraConfigModalProps) => jsx.JSX.Element;
|
|
11
5
|
export declare const JiraIssuesConfigModal: import("react").ForwardRefExoticComponent<JiraConfigModalProps & import("@atlaskit/analytics-next").WithContextProps & import("react").RefAttributes<any>>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { AssetsConfigModalProps } from '../types';
|
|
2
|
+
import { type AssetsConfigModalProps } from '../types';
|
|
3
3
|
export declare const AssetsConfigModal: import("react").ForwardRefExoticComponent<AssetsConfigModalProps & import("@atlaskit/analytics-next").WithContextProps & import("react").RefAttributes<any>>;
|
|
@@ -1,15 +1,11 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import {
|
|
1
|
+
import { type DatasourceAdf, type InlineCardAdf } from '@atlaskit/linking-common/types';
|
|
2
|
+
import { type DatasourceParameters } from '@atlaskit/linking-types';
|
|
3
|
+
import { type ConfigModalProps } from '../../common/types';
|
|
3
4
|
export type AssetsDatasourceParameters = {
|
|
4
5
|
workspaceId: string;
|
|
5
6
|
aql: string;
|
|
6
7
|
schemaId: string;
|
|
7
8
|
};
|
|
8
9
|
export type AssetsDatasourceAdf = DatasourceAdf<AssetsDatasourceParameters>;
|
|
9
|
-
export interface AssetsConfigModalProps {
|
|
10
|
-
datasourceId: string;
|
|
11
|
-
visibleColumnKeys?: string[];
|
|
12
|
-
parameters?: AssetsDatasourceParameters;
|
|
13
|
-
onCancel: () => void;
|
|
14
|
-
onInsert: (adf: InlineCardAdf | AssetsDatasourceAdf, analyticsEvent?: UIAnalyticsEvent) => void;
|
|
10
|
+
export interface AssetsConfigModalProps extends ConfigModalProps<InlineCardAdf | AssetsDatasourceAdf, DatasourceParameters | AssetsDatasourceParameters> {
|
|
15
11
|
}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { jsx } from '@emotion/react';
|
|
3
|
-
import { DatasourceAction } from '../../../analytics/types';
|
|
4
3
|
import { type ConfluenceSearchConfigModalProps } from '../types';
|
|
5
|
-
export declare const getColumnAction: (oldVisibleColumnKeys: string[], newVisibleColumnKeys: string[]) => DatasourceAction;
|
|
6
4
|
export declare const PlainConfluenceSearchConfigModal: (props: ConfluenceSearchConfigModalProps) => jsx.JSX.Element;
|
|
7
5
|
export declare const ConfluenceSearchConfigModal: import("react").ForwardRefExoticComponent<ConfluenceSearchConfigModalProps & import("@atlaskit/analytics-next").WithContextProps & import("react").RefAttributes<any>>;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { type DatasourceAdf, type InlineCardAdf } from '@atlaskit/linking-common/types';
|
|
2
|
+
import type { DatasourceParameters } from '@atlaskit/linking-types';
|
|
2
3
|
import { type ConfigModalProps } from '../../common/types';
|
|
3
4
|
import { type DateRangeType } from '../common/modal/popup-select/types';
|
|
4
|
-
export interface ConfluenceSearchConfigModalProps extends ConfigModalProps<InlineCardAdf | ConfluenceSearchDatasourceAdf, ConfluenceSearchDatasourceParameters> {
|
|
5
|
+
export interface ConfluenceSearchConfigModalProps extends ConfigModalProps<InlineCardAdf | ConfluenceSearchDatasourceAdf, DatasourceParameters | ConfluenceSearchDatasourceParameters> {
|
|
5
6
|
disableDisplayDropdown?: boolean;
|
|
6
7
|
overrideParameters?: Pick<ConfluenceSearchDatasourceParameters, 'entityTypes'>;
|
|
7
8
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { DatasourceDataResponseItem, DatasourceResponseSchemaProperty, DatasourceTableStatusType, DatasourceType } from '@atlaskit/linking-types';
|
|
3
|
-
import { NextPageType } from '../../hooks/useDatasourceTableState';
|
|
2
|
+
import type { DatasourceDataResponseItem, DatasourceResponseSchemaProperty, DatasourceTableStatusType, DatasourceType } from '@atlaskit/linking-types';
|
|
3
|
+
import type { NextPageType } from '../../hooks/useDatasourceTableState';
|
|
4
4
|
export type DatasourceTypeWithOnlyValues = {
|
|
5
5
|
[K in DatasourceType['type']]: {
|
|
6
6
|
type: K;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
import { DatasourceAction } from '../../analytics/types';
|
|
2
3
|
export declare const COLUMN_BASE_WIDTH = 8;
|
|
3
4
|
export declare const COLUMN_MIN_WIDTH: number;
|
|
4
5
|
export type GetWidthCss = (arg: {
|
|
@@ -15,3 +16,8 @@ export type GetWidthCss = (arg: {
|
|
|
15
16
|
* @param width
|
|
16
17
|
*/
|
|
17
18
|
export declare const getWidthCss: GetWidthCss;
|
|
19
|
+
/**
|
|
20
|
+
* This method should be called when one atomic action is performed on columns: adding new item, removing one item, changing items order.
|
|
21
|
+
* The assumption is that since only one action is changed at each time, we don't have to verify the actual contents of the lists.
|
|
22
|
+
*/
|
|
23
|
+
export declare const getColumnAction: (oldVisibleColumnKeys: string[], newVisibleColumnKeys: string[]) => DatasourceAction;
|
|
@@ -1,11 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { jsx } from '@emotion/react';
|
|
3
|
-
import {
|
|
4
|
-
import { JiraConfigModalProps } from '../types';
|
|
5
|
-
/**
|
|
6
|
-
* This method should be called when one atomic action is performed on columns: adding new item, removing one item, changing items order.
|
|
7
|
-
* The assumption is that since only one action is changed at each time, we don't have to verify the actual contents of the lists.
|
|
8
|
-
*/
|
|
9
|
-
export declare const getColumnAction: (oldVisibleColumnKeys: string[], newVisibleColumnKeys: string[]) => DatasourceAction;
|
|
3
|
+
import type { JiraConfigModalProps } from '../types';
|
|
10
4
|
export declare const PlainJiraIssuesConfigModal: (props: JiraConfigModalProps) => jsx.JSX.Element;
|
|
11
5
|
export declare const JiraIssuesConfigModal: import("react").ForwardRefExoticComponent<JiraConfigModalProps & import("@atlaskit/analytics-next").WithContextProps & import("react").RefAttributes<any>>;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { useState } from 'react';
|
|
2
2
|
|
|
3
3
|
import { defaultInitialVisibleJiraColumnKeys } from '@atlaskit/link-test-helpers/datasource';
|
|
4
4
|
|
|
5
|
-
import { DatasourceTableViewProps } from '../src/ui/datasource-table-view/types';
|
|
6
|
-
import { ColumnSizesMap } from '../src/ui/issue-like-table/types';
|
|
5
|
+
import type { DatasourceTableViewProps } from '../src/ui/datasource-table-view/types';
|
|
6
|
+
import type { ColumnSizesMap } from '../src/ui/issue-like-table/types';
|
|
7
|
+
import { useColumnResize } from '../src/ui/issue-like-table/use-column-resize';
|
|
8
|
+
import { useColumnWrapping } from '../src/ui/issue-like-table/use-column-wrapping';
|
|
7
9
|
|
|
8
10
|
export const useCommonTableProps = (
|
|
9
11
|
props: { defaultColumnCustomSizes?: ColumnSizesMap } = {},
|
|
@@ -22,29 +24,11 @@ export const useCommonTableProps = (
|
|
|
22
24
|
defaultInitialVisibleJiraColumnKeys,
|
|
23
25
|
);
|
|
24
26
|
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
>(props.defaultColumnCustomSizes);
|
|
28
|
-
|
|
29
|
-
const onColumnResize = useCallback(
|
|
30
|
-
(key: string, width: number) => {
|
|
31
|
-
setColumnCustomSizes({ ...columnCustomSizes, [key]: width });
|
|
32
|
-
},
|
|
33
|
-
[columnCustomSizes],
|
|
27
|
+
const { columnCustomSizes, onColumnResize } = useColumnResize(
|
|
28
|
+
props.defaultColumnCustomSizes,
|
|
34
29
|
);
|
|
35
30
|
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
const onWrappedColumnChange = useCallback(
|
|
39
|
-
(key: string, shouldWrap: boolean) => {
|
|
40
|
-
if (shouldWrap) {
|
|
41
|
-
setWrappedColumnKeys([...wrappedColumnKeys, key]);
|
|
42
|
-
} else {
|
|
43
|
-
setWrappedColumnKeys(wrappedColumnKeys.filter(k => k !== key));
|
|
44
|
-
}
|
|
45
|
-
},
|
|
46
|
-
[wrappedColumnKeys],
|
|
47
|
-
);
|
|
31
|
+
const { wrappedColumnKeys, onWrappedColumnChange } = useColumnWrapping([]);
|
|
48
32
|
|
|
49
33
|
return {
|
|
50
34
|
visibleColumnKeys,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/link-datasource",
|
|
3
|
-
"version": "2.0
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"description": "UI Components to support linking platform dataset feature",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@atlaskit/adf-schema": "^35.12.2",
|
|
36
36
|
"@atlaskit/analytics-next": "^9.3.0",
|
|
37
|
-
"@atlaskit/avatar": "^21.
|
|
37
|
+
"@atlaskit/avatar": "^21.8.0",
|
|
38
38
|
"@atlaskit/avatar-group": "^9.6.0",
|
|
39
39
|
"@atlaskit/badge": "^16.1.0",
|
|
40
40
|
"@atlaskit/button": "^17.14.0",
|
|
@@ -167,9 +167,6 @@
|
|
|
167
167
|
},
|
|
168
168
|
"platform.editor-update-tag-link-and-color_x6hcf": {
|
|
169
169
|
"type": "boolean"
|
|
170
|
-
},
|
|
171
|
-
"platform.linking-platform.datasource-assets_objects_add_jsm_promotional_tag": {
|
|
172
|
-
"type": "boolean"
|
|
173
170
|
}
|
|
174
171
|
}
|
|
175
172
|
}
|