Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fixes #241 so we only show the source on the context / routes / route…
… or the diagram on a route selection
  • Loading branch information
jstrachan committed Apr 17, 2013
1 parent c6acd54 commit 573301c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions hawtio-web/src/main/webapp/app/camel/js/camelPlugin.ts
Expand Up @@ -115,13 +115,13 @@ module Camel {
workspace.subLevelTabs.push({
content: '<i class="icon-picture"></i> Diagram',
title: "View a diagram of the Camel routes",
isValid: (workspace: Workspace) => workspace.isCamelFolder(),
isValid: (workspace: Workspace) => workspace.isRoute(),
href: () => "#/camel/routes"
});
workspace.subLevelTabs.push({
content: '<i class=" icon-file-alt"></i> Source',
title: "View the source of the Camel routes",
isValid: (workspace: Workspace) => workspace.isCamelFolder(),
isValid: (workspace: Workspace) => workspace.isRoute() || workspace.isRoutesFolder() || workspace.isCamelContext(),
href: () => "#/camel/source"
});
workspace.subLevelTabs.push({
Expand Down
6 changes: 5 additions & 1 deletion hawtio-web/src/main/webapp/app/core/js/workspace.ts
Expand Up @@ -626,13 +626,17 @@ class Workspace {


public selectionHasDomainAndLastFolderName(objectName: string, lastName: string) {
var lastNameLower = (lastName || "").toLowerCase();
function isName(name) {
return (name || "").toLowerCase() === lastNameLower
}
var node = this.selection;
if (node) {
if (objectName === node.domain) {
var folders = node.folderNames;
if (folders) {
var last = folders.last();
return last === lastName && node.isFolder() && !node.objectName;
return (isName(last) || isName(node.title)) && node.isFolder() && !node.objectName;
}
}
}
Expand Down

0 comments on commit 573301c

Please sign in to comment.