mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-14 17:26:22 +01:00
handle history events for repository, user and group items
This commit is contained in:
@@ -46,6 +46,7 @@ Sonia.group.Grid = Ext.extend(Sonia.rest.Grid, {
|
|||||||
url: restUrl + 'groups.json',
|
url: restUrl + 'groups.json',
|
||||||
disableCaching: false
|
disableCaching: false
|
||||||
}),
|
}),
|
||||||
|
id: 'name',
|
||||||
fields: [ 'name', 'members', 'description', 'creationDate', 'type'],
|
fields: [ 'name', 'members', 'description', 'creationDate', 'type'],
|
||||||
sortInfo: {
|
sortInfo: {
|
||||||
field: 'name'
|
field: 'name'
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ Sonia.repository.Grid = Ext.extend(Sonia.rest.Grid, {
|
|||||||
initComponent: function(){
|
initComponent: function(){
|
||||||
|
|
||||||
var repositoryStore = new Sonia.rest.JsonStore({
|
var repositoryStore = new Sonia.rest.JsonStore({
|
||||||
id: 'repositoryStore',
|
id: 'id',
|
||||||
proxy: new Ext.data.HttpProxy({
|
proxy: new Ext.data.HttpProxy({
|
||||||
url: restUrl + 'repositories.json',
|
url: restUrl + 'repositories.json',
|
||||||
disableCaching: false
|
disableCaching: false
|
||||||
@@ -103,7 +103,7 @@ Sonia.repository.Grid = Ext.extend(Sonia.rest.Grid, {
|
|||||||
console.debug( item.name + ' selected' );
|
console.debug( item.name + ' selected' );
|
||||||
}
|
}
|
||||||
|
|
||||||
Sonia.History.append(item.name);
|
Sonia.History.append(item.id);
|
||||||
|
|
||||||
var infoPanel = main.getInfoPanel(item.type);
|
var infoPanel = main.getInfoPanel(item.type);
|
||||||
infoPanel.item = item;
|
infoPanel.item = item;
|
||||||
|
|||||||
@@ -129,6 +129,15 @@ Sonia.rest.Grid = Ext.extend(Ext.grid.GridPanel, {
|
|||||||
param = "checked='checked' ";
|
param = "checked='checked' ";
|
||||||
}
|
}
|
||||||
return String.format( this.checkboxTemplate, param );
|
return String.format( this.checkboxTemplate, param );
|
||||||
|
},
|
||||||
|
|
||||||
|
handleHistory: function(params){
|
||||||
|
if (params){
|
||||||
|
var index = this.getStore().indexOfId(params[0]);
|
||||||
|
if ( index >= 0 ){
|
||||||
|
this.getSelectionModel().selectRow(index);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -156,18 +156,33 @@ Sonia.scm.Main = Ext.extend(Ext.util.Observable, {
|
|||||||
createHistory: function(){
|
createHistory: function(){
|
||||||
Sonia.History.register('repositories', function(params){
|
Sonia.History.register('repositories', function(params){
|
||||||
this.addRepositoriesTabPanel();
|
this.addRepositoriesTabPanel();
|
||||||
// todo handle params
|
var grid = Ext.getCmp('repositoryGrid');
|
||||||
|
if (grid){
|
||||||
|
grid.handleHistory(params);
|
||||||
|
} else if (debug){
|
||||||
|
console.debug('could not find repository grid');
|
||||||
|
}
|
||||||
}, this);
|
}, this);
|
||||||
Sonia.History.register('scmConfig', this.addScmConfigTabPanel, this);
|
Sonia.History.register('scmConfig', this.addScmConfigTabPanel, this);
|
||||||
Sonia.History.register('repositoryConfig', this.addRepositoryConfigTabPanel, this);
|
Sonia.History.register('repositoryConfig', this.addRepositoryConfigTabPanel, this);
|
||||||
Sonia.History.register('plugins', this.addPluginTabPanel, this);
|
Sonia.History.register('plugins', this.addPluginTabPanel, this);
|
||||||
Sonia.History.register('users', function(params){
|
Sonia.History.register('users', function(params){
|
||||||
this.addUsersTabPanel();
|
this.addUsersTabPanel();
|
||||||
// todo handle params
|
var grid = Ext.getCmp('userGrid');
|
||||||
|
if (grid){
|
||||||
|
grid.handleHistory(params);
|
||||||
|
} else if (debug){
|
||||||
|
console.debug('could not find user grid');
|
||||||
|
}
|
||||||
}, this);
|
}, this);
|
||||||
Sonia.History.register('groups', function(params){
|
Sonia.History.register('groups', function(params){
|
||||||
this.addUsersTabPanel();
|
this.addGroupsTabPanel();
|
||||||
// todo handle params
|
var grid = Ext.getCmp('groupGrid');
|
||||||
|
if (grid){
|
||||||
|
grid.handleHistory(params);
|
||||||
|
} else if (debug){
|
||||||
|
console.debug('could not find group grid');
|
||||||
|
}
|
||||||
}, this);
|
}, this);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@@ -49,6 +49,7 @@ Sonia.user.Grid = Ext.extend(Sonia.rest.Grid, {
|
|||||||
url: restUrl + 'users.json',
|
url: restUrl + 'users.json',
|
||||||
disableCaching: false
|
disableCaching: false
|
||||||
}),
|
}),
|
||||||
|
id: 'name',
|
||||||
fields: [ 'name', 'displayName', 'mail', 'admin', 'creationDate', 'lastModified', 'type'],
|
fields: [ 'name', 'displayName', 'mail', 'admin', 'creationDate', 'lastModified', 'type'],
|
||||||
sortInfo: {
|
sortInfo: {
|
||||||
field: 'name'
|
field: 'name'
|
||||||
|
|||||||
Reference in New Issue
Block a user