Permalink
Browse files

Think this addresses #550, however there's another case where the pro…

…file detail directive causes an error even though it's not being shown
  • Loading branch information...
1 parent f08a4cf commit c879a9b7de22425c048e7c2041ff6d8229441530 @gashcrumb gashcrumb committed Sep 16, 2013
@@ -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,
@@ -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);
}
});
@@ -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();

0 comments on commit c879a9b

Please sign in to comment.