@atlaskit/link-datasource 1.4.0 → 1.4.1
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 +6 -0
- package/dist/cjs/analytics/constants.js +1 -1
- package/dist/cjs/hooks/useDatasourceTableState.js +5 -4
- package/dist/cjs/ui/assets-modal/modal/index.js +1 -1
- package/dist/es2019/analytics/constants.js +1 -1
- package/dist/es2019/hooks/useDatasourceTableState.js +5 -4
- package/dist/es2019/ui/assets-modal/modal/index.js +1 -1
- package/dist/esm/analytics/constants.js +1 -1
- package/dist/esm/hooks/useDatasourceTableState.js +5 -4
- package/dist/esm/ui/assets-modal/modal/index.js +1 -1
- package/package.json +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @atlaskit/link-datasource
|
|
2
2
|
|
|
3
|
+
## 1.4.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`c8a7c9e33a8`](https://bitbucket.org/atlassian/atlassian-frontend/commits/c8a7c9e33a8) - [ux] Fixed columns not updating on reinsertion with new columns
|
|
8
|
+
|
|
3
9
|
## 1.4.0
|
|
4
10
|
|
|
5
11
|
### Minor Changes
|
|
@@ -10,6 +10,7 @@ var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers
|
|
|
10
10
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
11
11
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
12
12
|
var _react = require("react");
|
|
13
|
+
var _isEqual = _interopRequireDefault(require("lodash/isEqual"));
|
|
13
14
|
var _linkClientExtension = require("@atlaskit/link-client-extension");
|
|
14
15
|
var _analytics = require("../analytics");
|
|
15
16
|
var useDatasourceTableState = function useDatasourceTableState(_ref) {
|
|
@@ -114,7 +115,7 @@ var useDatasourceTableState = function useDatasourceTableState(_ref) {
|
|
|
114
115
|
}, _callee, null, [[2, 17]]);
|
|
115
116
|
})), [columns, datasourceId, getDatasourceDetails, parameters]);
|
|
116
117
|
var applySchemaProperties = (0, _react.useCallback)(function (properties) {
|
|
117
|
-
if (columns
|
|
118
|
+
if (!(0, _isEqual.default)(columns, properties)) {
|
|
118
119
|
setColumns(properties);
|
|
119
120
|
}
|
|
120
121
|
var defaultProperties = properties.map(function (prop) {
|
|
@@ -123,13 +124,13 @@ var useDatasourceTableState = function useDatasourceTableState(_ref) {
|
|
|
123
124
|
|
|
124
125
|
// when loading for the first time, we will need to set default visible props as /data does not give you that info
|
|
125
126
|
// also, since we dont pass any fields, we will need to set this info as lastRequestedFieldKeys
|
|
126
|
-
if (defaultVisibleColumnKeys
|
|
127
|
+
if (!(0, _isEqual.default)(defaultVisibleColumnKeys, defaultProperties)) {
|
|
127
128
|
setDefaultVisibleColumnKeys(defaultProperties);
|
|
128
129
|
}
|
|
129
|
-
if (lastRequestedFieldKeys
|
|
130
|
+
if (!(0, _isEqual.default)(lastRequestedFieldKeys, defaultProperties)) {
|
|
130
131
|
setLastRequestedFieldKeys(defaultProperties);
|
|
131
132
|
}
|
|
132
|
-
}, [columns
|
|
133
|
+
}, [columns, defaultVisibleColumnKeys, lastRequestedFieldKeys]);
|
|
133
134
|
var onNextPage = (0, _react.useCallback)( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
|
|
134
135
|
var requestInfo,
|
|
135
136
|
_requestInfo$isSchema,
|
|
@@ -231,7 +231,7 @@ var analyticsContextAttributes = {
|
|
|
231
231
|
};
|
|
232
232
|
var analyticsContextData = {
|
|
233
233
|
packageName: "@atlaskit/link-datasource",
|
|
234
|
-
packageVersion: "1.4.
|
|
234
|
+
packageVersion: "1.4.1",
|
|
235
235
|
source: 'datasourceConfigModal'
|
|
236
236
|
};
|
|
237
237
|
var contextData = _objectSpread(_objectSpread({}, analyticsContextData), {}, {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { useCallback, useEffect, useState } from 'react';
|
|
2
|
+
import isEqual from 'lodash/isEqual';
|
|
2
3
|
import { DEFAULT_GET_DATASOURCE_DATA_PAGE_SIZE, useDatasourceClientExtension } from '@atlaskit/link-client-extension';
|
|
3
4
|
import { useDatasourceAnalyticsEvents } from '../analytics';
|
|
4
5
|
export const useDatasourceTableState = ({
|
|
@@ -52,20 +53,20 @@ export const useDatasourceTableState = ({
|
|
|
52
53
|
}
|
|
53
54
|
}, [columns, datasourceId, getDatasourceDetails, parameters]);
|
|
54
55
|
const applySchemaProperties = useCallback(properties => {
|
|
55
|
-
if (columns
|
|
56
|
+
if (!isEqual(columns, properties)) {
|
|
56
57
|
setColumns(properties);
|
|
57
58
|
}
|
|
58
59
|
const defaultProperties = properties.map(prop => prop.key);
|
|
59
60
|
|
|
60
61
|
// when loading for the first time, we will need to set default visible props as /data does not give you that info
|
|
61
62
|
// also, since we dont pass any fields, we will need to set this info as lastRequestedFieldKeys
|
|
62
|
-
if (defaultVisibleColumnKeys
|
|
63
|
+
if (!isEqual(defaultVisibleColumnKeys, defaultProperties)) {
|
|
63
64
|
setDefaultVisibleColumnKeys(defaultProperties);
|
|
64
65
|
}
|
|
65
|
-
if (lastRequestedFieldKeys
|
|
66
|
+
if (!isEqual(lastRequestedFieldKeys, defaultProperties)) {
|
|
66
67
|
setLastRequestedFieldKeys(defaultProperties);
|
|
67
68
|
}
|
|
68
|
-
}, [columns
|
|
69
|
+
}, [columns, defaultVisibleColumnKeys, lastRequestedFieldKeys]);
|
|
69
70
|
const onNextPage = useCallback(async (requestInfo = {}) => {
|
|
70
71
|
if (!parameters) {
|
|
71
72
|
return;
|
|
@@ -3,6 +3,7 @@ import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
|
3
3
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
4
4
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
5
5
|
import { useCallback, useEffect, useState } from 'react';
|
|
6
|
+
import isEqual from 'lodash/isEqual';
|
|
6
7
|
import { DEFAULT_GET_DATASOURCE_DATA_PAGE_SIZE, useDatasourceClientExtension } from '@atlaskit/link-client-extension';
|
|
7
8
|
import { useDatasourceAnalyticsEvents } from '../analytics';
|
|
8
9
|
export var useDatasourceTableState = function useDatasourceTableState(_ref) {
|
|
@@ -107,7 +108,7 @@ export var useDatasourceTableState = function useDatasourceTableState(_ref) {
|
|
|
107
108
|
}, _callee, null, [[2, 17]]);
|
|
108
109
|
})), [columns, datasourceId, getDatasourceDetails, parameters]);
|
|
109
110
|
var applySchemaProperties = useCallback(function (properties) {
|
|
110
|
-
if (columns
|
|
111
|
+
if (!isEqual(columns, properties)) {
|
|
111
112
|
setColumns(properties);
|
|
112
113
|
}
|
|
113
114
|
var defaultProperties = properties.map(function (prop) {
|
|
@@ -116,13 +117,13 @@ export var useDatasourceTableState = function useDatasourceTableState(_ref) {
|
|
|
116
117
|
|
|
117
118
|
// when loading for the first time, we will need to set default visible props as /data does not give you that info
|
|
118
119
|
// also, since we dont pass any fields, we will need to set this info as lastRequestedFieldKeys
|
|
119
|
-
if (defaultVisibleColumnKeys
|
|
120
|
+
if (!isEqual(defaultVisibleColumnKeys, defaultProperties)) {
|
|
120
121
|
setDefaultVisibleColumnKeys(defaultProperties);
|
|
121
122
|
}
|
|
122
|
-
if (lastRequestedFieldKeys
|
|
123
|
+
if (!isEqual(lastRequestedFieldKeys, defaultProperties)) {
|
|
123
124
|
setLastRequestedFieldKeys(defaultProperties);
|
|
124
125
|
}
|
|
125
|
-
}, [columns
|
|
126
|
+
}, [columns, defaultVisibleColumnKeys, lastRequestedFieldKeys]);
|
|
126
127
|
var onNextPage = useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
|
127
128
|
var requestInfo,
|
|
128
129
|
_requestInfo$isSchema,
|
|
@@ -222,7 +222,7 @@ var analyticsContextAttributes = {
|
|
|
222
222
|
};
|
|
223
223
|
var analyticsContextData = {
|
|
224
224
|
packageName: "@atlaskit/link-datasource",
|
|
225
|
-
packageVersion: "1.4.
|
|
225
|
+
packageVersion: "1.4.1",
|
|
226
226
|
source: 'datasourceConfigModal'
|
|
227
227
|
};
|
|
228
228
|
var contextData = _objectSpread(_objectSpread({}, analyticsContextData), {}, {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/link-datasource",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.1",
|
|
4
4
|
"description": "UI Components to support linking platform dataset feature",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -67,6 +67,7 @@
|
|
|
67
67
|
"@emotion/react": "^11.7.1",
|
|
68
68
|
"@emotion/styled": "^11.0.0",
|
|
69
69
|
"debounce-promise": "^3.1.2",
|
|
70
|
+
"lodash": "^4.17.21",
|
|
70
71
|
"react-dom": "^16.8.0",
|
|
71
72
|
"tiny-invariant": "^1.2.0",
|
|
72
73
|
"uuid": "^3.1.0"
|