Skip to content

Commit

Permalink
#800: Camel plugin do not show source tab when selected endpoints tree.
Browse files Browse the repository at this point in the history
  • Loading branch information
davsclaus committed Dec 11, 2013
1 parent b06b583 commit cf065c1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 13 deletions.
2 changes: 1 addition & 1 deletion hawtio-web/src/main/webapp/app/camel/js/camelPlugin.ts
Expand Up @@ -178,7 +178,7 @@ module Camel {
workspace.subLevelTabs.push({
content: '<i class=" icon-file-alt"></i> Source',
title: "View the source of the Camel routes",
isValid: (workspace: Workspace) => workspace.isRoute() || workspace.isRoutesFolder() || workspace.isCamelContext(),
isValid: (workspace: Workspace) => !workspace.isEndpointsFolder() && (workspace.isRoute() || workspace.isRoutesFolder() || workspace.isCamelContext()),
href: () => "#/camel/source"
});
workspace.subLevelTabs.push({
Expand Down
16 changes: 4 additions & 12 deletions hawtio-web/src/main/webapp/app/core/js/workspace.ts
Expand Up @@ -769,7 +769,6 @@ module Core {
return null;
}


public selectionHasDomainAndLastFolderName(objectName: string, lastName: string) {
var lastNameLower = (lastName || "").toLowerCase();
function isName(name) {
Expand Down Expand Up @@ -799,31 +798,25 @@ module Core {
hasFabricMBean() {
return this.hasDomainAndProperties('org.fusesource.fabric', {type: 'Fabric'});
}

isFabricFolder() {
return this.hasDomainAndProperties('org.fusesource.fabric');
}

isCamelContext() {
return this.hasDomainAndProperties('org.apache.camel', {type: 'context'});
}

isCamelFolder() {
return this.hasDomainAndProperties('org.apache.camel');
}

isEndpointsFolder() {
return this.selectionHasDomainAndLastFolderName('org.apache.camel', 'endpoints');
}

isEndpoint() {
return this.hasDomainAndProperties('org.apache.camel', {type: 'endpoints'});
}

isRoutesFolder() {
return this.selectionHasDomainAndLastFolderName('org.apache.camel', 'routes')
}

isRoute() {
return this.hasDomainAndProperties('org.apache.camel', {type: 'routes'});
}
Expand All @@ -832,12 +825,11 @@ module Core {
return this.hasDomainAndProperties('osgi.core');
}
isKarafFolder() {
return this.hasDomainAndProperties('org.apache.karaf');
return this.hasDomainAndProperties('org.apache.karaf');
}
isOsgiCompendiumFolder() {
return this.hasDomainAndProperties('osgi.compendium');
}

isOsgiCompendiumFolder() {
return this.hasDomainAndProperties('osgi.compendium');
}
}

}
Expand Down

0 comments on commit cf065c1

Please sign in to comment.