Skip to content

Commit

Permalink
Think this addresses #550, however there's another case where the pro…
Browse files Browse the repository at this point in the history
…file detail directive causes an error even though it's not being shown
  • Loading branch information
gashcrumb committed Sep 16, 2013
1 parent f08a4cf commit c879a9b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
3 changes: 1 addition & 2 deletions hawtio-web/src/main/webapp/app/fabric/js/profile.ts
Expand Up @@ -31,20 +31,19 @@ module Fabric {
$scope.profilePath = Fabric.profilePath;

$scope.$watch('versionId', (newValue, oldValue) => {
Core.unregister(jolokia, $scope);
if (angular.isDefined($scope.versionId) && angular.isDefined($scope.profileId)) {
$scope.doRegister();
}
});

$scope.$watch('profileId', (newValue, oldValue) => {
Core.unregister(jolokia, $scope);
if (angular.isDefined($scope.versionId) && angular.isDefined($scope.profileId)) {
$scope.doRegister();
}
});

$scope.doRegister = () => {
Core.unregister(jolokia, $scope);
if ($scope.versionId && $scope.profileId && !$scope.versionId.isBlank() && !$scope.profileId.isBlank()) {
Core.register(jolokia, $scope, {
type: 'exec', mbean: managerMBean,
Expand Down
Expand Up @@ -155,7 +155,13 @@ module Fabric {

$scope.$watch('versionId', (newValue, oldValue) => {
if ($scope.versionId && $scope.versionId !== '') {
$scope.init();
if (jolokia.execute(Fabric.managerMBean, "versions()").some((version) => { return version.id === newValue })) {
$scope.init();
} else {
Core.unregister(jolokia, $scope);
}
} else {
Core.unregister(jolokia, $scope);
}
});

Expand Down
4 changes: 1 addition & 3 deletions hawtio-web/src/main/webapp/app/wiki/js/view.ts
Expand Up @@ -16,10 +16,8 @@ module Wiki {

$scope.versionId = $scope.branch;

console.log("pageId: ", $scope.pageId);

$scope.profileId = Fabric.pagePathToProfileId($scope.pageId);
$scope.profile = $scope.profileId? true: false;
$scope.profile = $scope.profileId ? true: false;

$scope.operationCounter = 1;
$scope.addDialog = new Core.Dialog();
Expand Down

0 comments on commit c879a9b

Please sign in to comment.