diff --git a/scm-webapp/src/main/webapp/resources/js/group/sonia.group.grid.js b/scm-webapp/src/main/webapp/resources/js/group/sonia.group.grid.js index 6ca5822949..deade08457 100644 --- a/scm-webapp/src/main/webapp/resources/js/group/sonia.group.grid.js +++ b/scm-webapp/src/main/webapp/resources/js/group/sonia.group.grid.js @@ -46,6 +46,7 @@ Sonia.group.Grid = Ext.extend(Sonia.rest.Grid, { url: restUrl + 'groups.json', disableCaching: false }), + id: 'name', fields: [ 'name', 'members', 'description', 'creationDate', 'type'], sortInfo: { field: 'name' diff --git a/scm-webapp/src/main/webapp/resources/js/repository/sonia.repository.grid.js b/scm-webapp/src/main/webapp/resources/js/repository/sonia.repository.grid.js index 185f0e8012..f5b61315ba 100644 --- a/scm-webapp/src/main/webapp/resources/js/repository/sonia.repository.grid.js +++ b/scm-webapp/src/main/webapp/resources/js/repository/sonia.repository.grid.js @@ -43,7 +43,7 @@ Sonia.repository.Grid = Ext.extend(Sonia.rest.Grid, { initComponent: function(){ var repositoryStore = new Sonia.rest.JsonStore({ - id: 'repositoryStore', + id: 'id', proxy: new Ext.data.HttpProxy({ url: restUrl + 'repositories.json', disableCaching: false @@ -103,7 +103,7 @@ Sonia.repository.Grid = Ext.extend(Sonia.rest.Grid, { console.debug( item.name + ' selected' ); } - Sonia.History.append(item.name); + Sonia.History.append(item.id); var infoPanel = main.getInfoPanel(item.type); infoPanel.item = item; diff --git a/scm-webapp/src/main/webapp/resources/js/rest/sonia.rest.grid.js b/scm-webapp/src/main/webapp/resources/js/rest/sonia.rest.grid.js index 6ac18f04e1..7383ac949d 100644 --- a/scm-webapp/src/main/webapp/resources/js/rest/sonia.rest.grid.js +++ b/scm-webapp/src/main/webapp/resources/js/rest/sonia.rest.grid.js @@ -129,6 +129,15 @@ Sonia.rest.Grid = Ext.extend(Ext.grid.GridPanel, { param = "checked='checked' "; } 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); + } + } } }); diff --git a/scm-webapp/src/main/webapp/resources/js/sonia.scm.js b/scm-webapp/src/main/webapp/resources/js/sonia.scm.js index c246c9cb7d..e34c931b22 100644 --- a/scm-webapp/src/main/webapp/resources/js/sonia.scm.js +++ b/scm-webapp/src/main/webapp/resources/js/sonia.scm.js @@ -156,18 +156,33 @@ Sonia.scm.Main = Ext.extend(Ext.util.Observable, { createHistory: function(){ Sonia.History.register('repositories', function(params){ 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); Sonia.History.register('scmConfig', this.addScmConfigTabPanel, this); Sonia.History.register('repositoryConfig', this.addRepositoryConfigTabPanel, this); Sonia.History.register('plugins', this.addPluginTabPanel, this); Sonia.History.register('users', function(params){ 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); Sonia.History.register('groups', function(params){ - this.addUsersTabPanel(); - // todo handle params + this.addGroupsTabPanel(); + var grid = Ext.getCmp('groupGrid'); + if (grid){ + grid.handleHistory(params); + } else if (debug){ + console.debug('could not find group grid'); + } }, this); }, diff --git a/scm-webapp/src/main/webapp/resources/js/user/sonia.user.grid.js b/scm-webapp/src/main/webapp/resources/js/user/sonia.user.grid.js index ea71d7cd9a..879a918fca 100644 --- a/scm-webapp/src/main/webapp/resources/js/user/sonia.user.grid.js +++ b/scm-webapp/src/main/webapp/resources/js/user/sonia.user.grid.js @@ -49,6 +49,7 @@ Sonia.user.Grid = Ext.extend(Sonia.rest.Grid, { url: restUrl + 'users.json', disableCaching: false }), + id: 'name', fields: [ 'name', 'displayName', 'mail', 'admin', 'creationDate', 'lastModified', 'type'], sortInfo: { field: 'name'