mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Fixed an issue where the newly added table is not alphabetically added to the tree. Fixes #5434
Fixed an issue when renaming the column not added in the proper order. Fixes #5450
This commit is contained in:
@@ -27,8 +27,10 @@ Bug fixes
|
||||
| `Issue #4840 <https://redmine.postgresql.org/issues/4840>`_ - Ensure that 'With OID' option should be disabled while taking backup of database server version 12 and above.
|
||||
| `Issue #5001 <https://redmine.postgresql.org/issues/5001>`_ - Fixed invalid literal issue when removing the connection limit for the existing role.
|
||||
| `Issue #5422 <https://redmine.postgresql.org/issues/5422>`_ - Ensure that the dependencies tab shows correct information for Synonyms.
|
||||
| `Issue #5434 <https://redmine.postgresql.org/issues/5434>`_ - Fixed an issue where the newly added table is not alphabetically added to the tree.
|
||||
| `Issue #5440 <https://redmine.postgresql.org/issues/5440>`_ - Fixed list sorting issue in the schema diff tool.
|
||||
| `Issue #5449 <https://redmine.postgresql.org/issues/5449>`_ - Fixed an issue while comparing the two identical schemas using the schema diff tool.
|
||||
| `Issue #5450 <https://redmine.postgresql.org/issues/5450>`_ - Fixed an issue when renaming the column not added in the proper order.
|
||||
| `Issue #5466 <https://redmine.postgresql.org/issues/5466>`_ - Correct ipv4 "all interfaces" address in the container docs, per Frank Limpert.
|
||||
| `Issue #5469 <https://redmine.postgresql.org/issues/5469>`_ - Fixed an issue where select2 hover is inconsistent for the SSL field in create server dialog.
|
||||
| `Issue #5473 <https://redmine.postgresql.org/issues/5473>`_ - Fixed post-login redirect location when running in server mode under a non-default root.
|
||||
|
@@ -1011,15 +1011,16 @@ define('pgadmin.browser', [
|
||||
}
|
||||
s++;
|
||||
}
|
||||
//when the current element is greater than the end element
|
||||
if (e != items.length - 1) {
|
||||
i = items.eq(e);
|
||||
i = items.eq(e+1);
|
||||
return true;
|
||||
}
|
||||
i = null;
|
||||
return false;
|
||||
},
|
||||
binarySearch = function() {
|
||||
var d, m, res;
|
||||
var d, m;
|
||||
// Binary search only outperforms Linear search for n > 44.
|
||||
// Reference:
|
||||
// https://en.wikipedia.org/wiki/Binary_search_algorithm#cite_note-30
|
||||
@@ -1037,26 +1038,34 @@ define('pgadmin.browser', [
|
||||
}
|
||||
i = items.eq(e);
|
||||
d = ctx.t.itemData(i);
|
||||
let result;
|
||||
if (d._type === 'column') {
|
||||
if (pgAdmin.numeric_comparator(d._id, _data._id) == -1)
|
||||
return false;
|
||||
result = pgAdmin.numeric_comparator(d._id, _data._id);
|
||||
} else {
|
||||
if (pgAdmin.natural_sort(d._label, _data._label) != 1)
|
||||
result = pgAdmin.natural_sort(d._label, _data._label);
|
||||
}
|
||||
if (result !=1) {
|
||||
if (e != items.length - 1) {
|
||||
i = items.eq(e+1);
|
||||
return true;
|
||||
}
|
||||
i = null;
|
||||
return false;
|
||||
}
|
||||
m = s + Math.round((e - s) / 2);
|
||||
i = items.eq(m);
|
||||
d = ctx.t.itemData(i);
|
||||
if(d._type === 'column'){
|
||||
res = pgAdmin.numeric_comparator(d._id, _data._id);
|
||||
result = pgAdmin.numeric_comparator(d._id, _data._id);
|
||||
} else {
|
||||
res = pgAdmin.natural_sort(d._label, _data._label);
|
||||
result = pgAdmin.natural_sort(d._label, _data._label);
|
||||
}
|
||||
|
||||
if (res == 0)
|
||||
//result will never become 0 because of remove operation
|
||||
//which happens with updateTreeNode
|
||||
if (result == 0)
|
||||
return true;
|
||||
|
||||
if (res == -1) {
|
||||
if (result == -1) {
|
||||
s = m + 1;
|
||||
e--;
|
||||
} else {
|
||||
@@ -1509,16 +1518,17 @@ define('pgadmin.browser', [
|
||||
while (e >= s) {
|
||||
i = items.eq(s);
|
||||
var d = ctx.t.itemData(i);
|
||||
if (
|
||||
pgAdmin.natural_sort(
|
||||
d._label, _new._label
|
||||
) == 1
|
||||
)
|
||||
return true;
|
||||
if (d._type === 'column') {
|
||||
if (pgAdmin.numeric_comparator(d._id, _new._id) == 1)
|
||||
return true;
|
||||
} else {
|
||||
if (pgAdmin.natural_sort(d._label, _new._label) == 1)
|
||||
return true;
|
||||
}
|
||||
s++;
|
||||
}
|
||||
if (e != items.length - 1) {
|
||||
i = items.eq(e);
|
||||
i = items.eq(e+1);
|
||||
return true;
|
||||
}
|
||||
i = null;
|
||||
@@ -1528,28 +1538,43 @@ define('pgadmin.browser', [
|
||||
while (e - s > 22) {
|
||||
i = items.eq(s);
|
||||
var d = ctx.t.itemData(i);
|
||||
if (
|
||||
pgAdmin.natural_sort(
|
||||
d._label, _new._label
|
||||
) != -1
|
||||
)
|
||||
return true;
|
||||
if (d._type === 'column') {
|
||||
if (pgAdmin.numeric_comparator(d._id, _new._id) != -1)
|
||||
return true;
|
||||
} else {
|
||||
if (pgAdmin.natural_sort(d._label, _new._label) != -1)
|
||||
return true;
|
||||
}
|
||||
i = items.eq(e);
|
||||
d = ctx.t.itemData(i);
|
||||
if (
|
||||
pgAdmin.natural_sort(
|
||||
d._label, _new._label
|
||||
) != 1
|
||||
)
|
||||
return true;
|
||||
let result;
|
||||
if (d._type === 'column') {
|
||||
result = pgAdmin.numeric_comparator(d._id, _new._id);
|
||||
} else {
|
||||
result = pgAdmin.natural_sort(d._label, _new._label);
|
||||
}
|
||||
if (result !=1) {
|
||||
if (e != items.length - 1) {
|
||||
i = items.eq(e+1);
|
||||
return true;
|
||||
}
|
||||
i = null;
|
||||
return false;
|
||||
}
|
||||
var m = s + Math.round((e - s) / 2);
|
||||
i = items.eq(m);
|
||||
d = ctx.t.itemData(i);
|
||||
var res = pgAdmin.natural_sort(d._label, _new._label);
|
||||
if (res == 0)
|
||||
if(d._type === 'column'){
|
||||
result = pgAdmin.numeric_comparator(d._id, _new._id);
|
||||
} else {
|
||||
result = pgAdmin.natural_sort(d._label, _new._label);
|
||||
}
|
||||
//result will never become 0 because of remove operation
|
||||
//which happens with updateTreeNode
|
||||
if (result == 0)
|
||||
return true;
|
||||
|
||||
if (res == -1) {
|
||||
if (result == -1) {
|
||||
s = m + 1;
|
||||
e--;
|
||||
} else {
|
||||
|
@@ -119,9 +119,11 @@ define([], function() {
|
||||
a = parseInt(a);
|
||||
b = parseInt(b);
|
||||
if (a < b)
|
||||
return -1 ;
|
||||
return -1;
|
||||
else if (a == b)
|
||||
return 0;
|
||||
else
|
||||
return 1 ;
|
||||
return 1;
|
||||
};
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user