mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-14 09:25:43 +01:00
added debug mode
This commit is contained in:
@@ -3,6 +3,8 @@
|
|||||||
* and open the template in the editor.
|
* and open the template in the editor.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
var debug = true;
|
||||||
|
|
||||||
var repositoryTypes = [ ['Mercurial', 'hg'], ['Subversion','svn'], ['Git','git'] ];
|
var repositoryTypes = [ ['Mercurial', 'hg'], ['Subversion','svn'], ['Git','git'] ];
|
||||||
|
|
||||||
var repositoryTypeStore = new Ext.data.ArrayStore({
|
var repositoryTypeStore = new Ext.data.ArrayStore({
|
||||||
|
|||||||
@@ -9,7 +9,6 @@ var addGroupWindow = null;
|
|||||||
|
|
||||||
/** Sonia.GroupGrid **/
|
/** Sonia.GroupGrid **/
|
||||||
function addGroup(){
|
function addGroup(){
|
||||||
console.debug( 'add group' );
|
|
||||||
addGroupWindow = new Sonia.group.DetailWindow();
|
addGroupWindow = new Sonia.group.DetailWindow();
|
||||||
addGroupWindow.show();
|
addGroupWindow.show();
|
||||||
}
|
}
|
||||||
@@ -17,7 +16,10 @@ function addGroup(){
|
|||||||
function removeGroup(){
|
function removeGroup(){
|
||||||
if (groupSelModel.hasSelection()){
|
if (groupSelModel.hasSelection()){
|
||||||
var group = groupSelModel.getSelected().data.name;
|
var group = groupSelModel.getSelected().data.name;
|
||||||
console.debug( 'remove group ' + group );
|
|
||||||
|
if ( debug ){
|
||||||
|
console.debug( 'remove group ' + group );
|
||||||
|
}
|
||||||
|
|
||||||
Ext.MessageBox.show({
|
Ext.MessageBox.show({
|
||||||
title: 'Remove Group',
|
title: 'Remove Group',
|
||||||
@@ -78,7 +80,9 @@ var groupToolbar = new Ext.Toolbar({
|
|||||||
specialkey: function(field, e){
|
specialkey: function(field, e){
|
||||||
if (e.getKey() == e.ENTER) {
|
if (e.getKey() == e.ENTER) {
|
||||||
var value = this.getValue();
|
var value = this.getValue();
|
||||||
console.log( 'Filter: ' + value );
|
if ( debug ){
|
||||||
|
console.log( 'Filter: ' + value );
|
||||||
|
}
|
||||||
// TODO filter by member
|
// TODO filter by member
|
||||||
groupStore.filter('name', new RegExp('.*' + value + '.*'));
|
groupStore.filter('name', new RegExp('.*' + value + '.*'));
|
||||||
}
|
}
|
||||||
@@ -276,6 +280,11 @@ Sonia.group.AddForm = new Ext.extend(Ext.FormPanel, {
|
|||||||
url = restUrl + 'groups.json';
|
url = restUrl + 'groups.json';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( debug ){
|
||||||
|
var action = this.update ? 'edit' : 'add';
|
||||||
|
console.debug( action + ' group ' + name );
|
||||||
|
}
|
||||||
|
|
||||||
Ext.Ajax.request({
|
Ext.Ajax.request({
|
||||||
url: url,
|
url: url,
|
||||||
jsonData: group,
|
jsonData: group,
|
||||||
|
|||||||
@@ -9,12 +9,15 @@ Sonia.rest.JsonStore = Ext.extend( Ext.data.JsonStore, {
|
|||||||
|
|
||||||
constructor: function(config) {
|
constructor: function(config) {
|
||||||
var baseConfig = {
|
var baseConfig = {
|
||||||
autoLoad: true,
|
autoLoad: false,
|
||||||
listeners: {
|
listeners: {
|
||||||
// fix jersey empty array problem
|
// fix jersey empty array problem
|
||||||
exception: {
|
exception: {
|
||||||
fn: function(proxy, type, action, options, response, arg){
|
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();
|
this.removeAll();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user