Sorting the data during tree data loading using the natural sort

algorithm.

This patch takes care of:
* Consistent behaviour during create, update operation on any node.
  - It should return the node data during creating a new object, or
    updating the existing one.
* Now that - we have consistent behaviour during these operations, we
  can consistently move, update the tree item based the node data from
  the server.
* Implemented the methods for each node to get the information about
  that particular node only.
* Using the above changes to implement the 'refresh' operation on tree
  node properly.

I must thank Surinder, and Harshal for helping me implement the 'node'
method, and also changed the behaviour of create & update methods to
return the node data for most of the nodes.

Fixes #1244
This commit is contained in:
Ashesh Vashi
2016-08-29 20:06:48 +05:30
parent 2c6f6609bc
commit b6f307256b
156 changed files with 5299 additions and 3400 deletions

View File

@@ -104,9 +104,19 @@ define([
// We will listen to the visibility change of the statistics panel
pgBrowser.Events.on(
'pgadmin-browser:panel-statistics:' +
wcDocker.EVENT.VISIBILITY_CHANGED,
this.panelVisibilityChanged);
'pgadmin-browser:panel-statistics:' +
wcDocker.EVENT.VISIBILITY_CHANGED,
this.panelVisibilityChanged
);
pgBrowser.Events.on(
'pgadmin:browser:node:updated', function() {
if (this.panel && this.panel.length) {
$(this.panel[0]).data('node-prop', '');
this.panelVisibilityChanged(this.panel[0]);
}
}, this
);
// Hmm.. Did we find the statistics panel, and is it visible (openned)?
// If that is the case - we need to listen the browser tree selection
@@ -214,7 +224,7 @@ define([
error: function(xhr, error, message) {
var _label = treeHierarchy[n_type].label;
pgBrowser.Events.trigger(
'pgadmin:node:retrieval:error', 'statistics', xhr, status, error, item
'pgadmin:node:retrieval:error', 'statistics', xhr, error, message, item
);
if (
!Alertify.pgHandleItemError(xhr, error, message, {
@@ -222,7 +232,7 @@ define([
})
) {
Alertify.pgNotifier(
status, xhr,
error, xhr,
S(
pgBrowser.messages['ERR_RETRIEVAL_INFO']
).sprintf(message || _label).value(),