@atlaskit/link-datasource 2.11.2 → 2.11.3
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
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# @atlaskit/link-datasource
|
|
2
2
|
|
|
3
|
+
## 2.11.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#131211](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/131211)
|
|
8
|
+
[`35d5f222a8212`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/35d5f222a8212) -
|
|
9
|
+
Prevents inline-edit to fire execute callback on blur or with an empty string
|
|
10
|
+
- Updated dependencies
|
|
11
|
+
|
|
3
12
|
## 2.11.2
|
|
4
13
|
|
|
5
14
|
### Patch Changes
|
|
@@ -33,6 +33,9 @@ var mapUpdatedItem = function mapUpdatedItem(type, existingItem, columnKey, newV
|
|
|
33
33
|
}
|
|
34
34
|
return null;
|
|
35
35
|
};
|
|
36
|
+
var isNewValue = function isNewValue(columnKey, newItem, existingData) {
|
|
37
|
+
return newItem[columnKey].data && newItem[columnKey].data !== existingData[columnKey].data;
|
|
38
|
+
};
|
|
36
39
|
var InlineEdit = exports.InlineEdit = function InlineEdit(_ref) {
|
|
37
40
|
var ari = _ref.ari,
|
|
38
41
|
execute = _ref.execute,
|
|
@@ -60,7 +63,7 @@ var InlineEdit = exports.InlineEdit = function InlineEdit(_ref) {
|
|
|
60
63
|
}
|
|
61
64
|
var existingData = item.data;
|
|
62
65
|
var newItem = mapUpdatedItem(datasourceTypeWithValues.type, item.data, columnKey, value);
|
|
63
|
-
if (!newItem) {
|
|
66
|
+
if (!newItem || !isNewValue(columnKey, newItem, existingData)) {
|
|
64
67
|
setIsEditing(false);
|
|
65
68
|
return;
|
|
66
69
|
}
|
|
@@ -22,6 +22,9 @@ const mapUpdatedItem = (type, existingItem, columnKey, newValue) => {
|
|
|
22
22
|
}
|
|
23
23
|
return null;
|
|
24
24
|
};
|
|
25
|
+
const isNewValue = (columnKey, newItem, existingData) => {
|
|
26
|
+
return newItem[columnKey].data && newItem[columnKey].data !== existingData[columnKey].data;
|
|
27
|
+
};
|
|
25
28
|
export const InlineEdit = ({
|
|
26
29
|
ari,
|
|
27
30
|
execute,
|
|
@@ -49,7 +52,7 @@ export const InlineEdit = ({
|
|
|
49
52
|
}
|
|
50
53
|
const existingData = item.data;
|
|
51
54
|
const newItem = mapUpdatedItem(datasourceTypeWithValues.type, item.data, columnKey, value);
|
|
52
|
-
if (!newItem) {
|
|
55
|
+
if (!newItem || !isNewValue(columnKey, newItem, existingData)) {
|
|
53
56
|
setIsEditing(false);
|
|
54
57
|
return;
|
|
55
58
|
}
|
|
@@ -23,6 +23,9 @@ var mapUpdatedItem = function mapUpdatedItem(type, existingItem, columnKey, newV
|
|
|
23
23
|
}
|
|
24
24
|
return null;
|
|
25
25
|
};
|
|
26
|
+
var isNewValue = function isNewValue(columnKey, newItem, existingData) {
|
|
27
|
+
return newItem[columnKey].data && newItem[columnKey].data !== existingData[columnKey].data;
|
|
28
|
+
};
|
|
26
29
|
export var InlineEdit = function InlineEdit(_ref) {
|
|
27
30
|
var ari = _ref.ari,
|
|
28
31
|
execute = _ref.execute,
|
|
@@ -50,7 +53,7 @@ export var InlineEdit = function InlineEdit(_ref) {
|
|
|
50
53
|
}
|
|
51
54
|
var existingData = item.data;
|
|
52
55
|
var newItem = mapUpdatedItem(datasourceTypeWithValues.type, item.data, columnKey, value);
|
|
53
|
-
if (!newItem) {
|
|
56
|
+
if (!newItem || !isNewValue(columnKey, newItem, existingData)) {
|
|
54
57
|
setIsEditing(false);
|
|
55
58
|
return;
|
|
56
59
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/link-datasource",
|
|
3
|
-
"version": "2.11.
|
|
3
|
+
"version": "2.11.3",
|
|
4
4
|
"description": "UI Components to support linking platform dataset feature",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"@atlaskit/avatar": "^21.15.0",
|
|
42
42
|
"@atlaskit/avatar-group": "^9.11.0",
|
|
43
43
|
"@atlaskit/badge": "^16.4.0",
|
|
44
|
-
"@atlaskit/button": "^20.
|
|
44
|
+
"@atlaskit/button": "^20.1.0",
|
|
45
45
|
"@atlaskit/datetime-picker": "^13.11.0",
|
|
46
46
|
"@atlaskit/dropdown-menu": "^12.17.0",
|
|
47
47
|
"@atlaskit/editor-prosemirror": "5.0.1",
|