1. Sebastian Sdorra
  2. scm-manager

Commits

Sebastian Sdorra  committed 114c3e9

added debug mode

  • Participants
  • Parent commits 08d1702
  • Branches default

Comments (0)

Files changed (3)

File scm-webapp/src/main/webapp/resources/js/global.js

View file
  * and open the template in the editor.
  */
 
+var debug = true;
+
 var repositoryTypes = [ ['Mercurial', 'hg'], ['Subversion','svn'], ['Git','git'] ];
 
 var repositoryTypeStore = new Ext.data.ArrayStore({

File scm-webapp/src/main/webapp/resources/js/sonia.group.js

View file
 
 /** Sonia.GroupGrid **/
 function addGroup(){
-  console.debug( 'add group' );
   addGroupWindow = new Sonia.group.DetailWindow();
   addGroupWindow.show();
 }
 function removeGroup(){
   if (groupSelModel.hasSelection()){
     var group = groupSelModel.getSelected().data.name;
-    console.debug( 'remove group ' + group );
+
+    if ( debug ){
+      console.debug( 'remove group ' + group );
+    }
 
     Ext.MessageBox.show({
       title: 'Remove Group',
       specialkey: function(field, e){
         if (e.getKey() == e.ENTER) {
           var value = this.getValue();
-          console.log( 'Filter: ' + value );
+          if ( debug ){
+            console.log( 'Filter: ' + value );
+          }
           // TODO filter by member
           groupStore.filter('name', new RegExp('.*' + value + '.*'));
         }
       url = restUrl + 'groups.json';
     }
 
+    if ( debug ){
+      var action = this.update ? 'edit' : 'add';
+      console.debug( action + ' group ' + name );
+    }
+
     Ext.Ajax.request({
       url: url,
       jsonData: group,

File scm-webapp/src/main/webapp/resources/js/sonia.rest.js

View file
 
   constructor: function(config) {
     var baseConfig = {
-      autoLoad: true,
+      autoLoad: false,
       listeners: {
         // fix jersey empty array problem
         exception: {
           fn: function(proxy, type, action, options, response, arg){
-            if ( action == "read" && response.responseText == "null" ){
+            if ( action == 'read' && response.responseText == 'null' ){
+              if ( debug ){
+                console.debug( 'empty array, clear whole store' );
+              }
               this.removeAll();
             }
           },