mirror of
https://github.com/scm-manager/scm-manager.git
synced 2026-01-27 01:39:09 +01:00
do not show branch or tag toolbar if the commands are not supported
This commit is contained in:
@@ -101,7 +101,11 @@ Sonia.repository.ChangesetViewerPanel = Ext.extend(Ext.Panel, {
|
||||
|
||||
if ( ! this.inline ){
|
||||
config.title = String.format(this.changesetViewerTitleText, this.repository.name)
|
||||
config.tbar = this.createTopToolbar();
|
||||
|
||||
var type = Sonia.repository.getTypeByName( this.repository.type );
|
||||
if ( type && type.supportedCommands && type.supportedCommands.indexOf('BRANCHES') >= 0){
|
||||
config.tbar = this.createTopToolbar();
|
||||
}
|
||||
config.bbar = {
|
||||
xtype: 'paging',
|
||||
store: this.changesetStore,
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
*/
|
||||
var repositoryTypeStore = new Ext.data.JsonStore({
|
||||
id: 1,
|
||||
fields: [ 'displayName', 'name' ]
|
||||
fields: [ 'displayName', 'name', 'supportedCommands' ]
|
||||
});
|
||||
|
||||
function loadRepositoryTypes(state){
|
||||
@@ -86,6 +86,16 @@ Sonia.repository.createUrlFromObject = function(repository){
|
||||
return Sonia.repository.createUrl(repository.type, repository.name);
|
||||
}
|
||||
|
||||
Sonia.repository.getTypeByName = function(name){
|
||||
var type = null;
|
||||
repositoryTypeStore.queryBy(function(rec){
|
||||
if ( rec.get('name') == name ){
|
||||
type = rec.data;
|
||||
}
|
||||
});
|
||||
return type;
|
||||
}
|
||||
|
||||
/**
|
||||
* default panel
|
||||
*/
|
||||
|
||||
@@ -121,7 +121,6 @@ Sonia.repository.RepositoryBrowser = Ext.extend(Ext.grid.GridPanel, {
|
||||
this.appendRepositoryProperties(bar);
|
||||
|
||||
var config = {
|
||||
tbar: this.createTopToolbar(),
|
||||
bbar: bar,
|
||||
autoExpandColumn: 'description',
|
||||
title: String.format(this.repositoryBrowserTitleText, this.repository.name),
|
||||
@@ -140,6 +139,11 @@ Sonia.repository.RepositoryBrowser = Ext.extend(Ext.grid.GridPanel, {
|
||||
}
|
||||
};
|
||||
|
||||
var type = Sonia.repository.getTypeByName( this.repository.type );
|
||||
if ( type && type.supportedCommands && type.supportedCommands.indexOf('BRANCHES') >= 0){
|
||||
config.tbar = this.createTopToolbar();
|
||||
}
|
||||
|
||||
Ext.apply(this, Ext.apply(this.initialConfig, config));
|
||||
Sonia.repository.RepositoryBrowser.superclass.initComponent.apply(this, arguments);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user