Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
Merge pull request #789 from ammendonca/HAWKULAR-948
Browse files Browse the repository at this point in the history
HAWKULAR-948 : Make angular aware of changes from events, using $timeout
  • Loading branch information
mtho11 committed Jan 19, 2016
2 parents 5f00df7 + e05cc89 commit 9312b8d
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 30 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
///
/// Copyright 2015 Red Hat, Inc. and/or its affiliates
/// Copyright 2015-2016 Red Hat, Inc. and/or its affiliates
/// and other contributors as indicated by the @author tags.
///
/// Licensed under the Apache License, Version 2.0 (the "License");
Expand Down Expand Up @@ -84,15 +84,18 @@ module HawkularMetrics {
});

$scope.$on('DatasourceAddSuccess', (event, data) => {
this.dsData.uploading = false;
this.dsData.hasOperationSucceeded = true;
this.dsData.hasOperationFailed = false;

this.$timeout(() => {
this.dsData.uploading = false;
this.dsData.hasOperationSucceeded = true;
this.dsData.hasOperationFailed = false;
});
});
$scope.$on('DatasourceAddError', (event, data) => {
this.dsData.uploading = false;
this.dsData.hasOperationFailed = true;
this.dsData.hasOperationSucceeded = false;
this.$timeout(() => {
this.dsData.uploading = false;
this.dsData.hasOperationFailed = true;
this.dsData.hasOperationSucceeded = false;
});
});

}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
///
/// Copyright 2015 Red Hat, Inc. and/or its affiliates
/// Copyright 2015-2016 Red Hat, Inc. and/or its affiliates
/// and other contributors as indicated by the @author tags.
///
/// Licensed under the Apache License, Version 2.0 (the "License");
Expand Down Expand Up @@ -81,18 +81,18 @@ module HawkularMetrics {
});

$scope.$on('JDBCDriverAddSuccess', (event, data) => {
//this.$log.info('Deployment Add Succeeded!');
this.driverData.uploading = false;
this.driverData.hasDeployedSuccessfully = true;
this.driverData.hasDeploymentError = false;

this.$timeout(() => {
this.driverData.uploading = false;
this.driverData.hasDeployedSuccessfully = true;
this.driverData.hasDeploymentError = false;
});
});
$scope.$on('JDBCDriverAddError', (event, data) => {
//this.$log.warn('Deployment Add Failed!');
//this.$log.warn(data);
this.driverData.uploading = false;
this.driverData.hasDeploymentError = true;
this.driverData.hasDeployedSuccessfully = false;
this.$timeout(() => {
this.driverData.uploading = false;
this.driverData.hasDeploymentError = true;
this.driverData.hasDeployedSuccessfully = false;
});
});

}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
///
/// Copyright 2015 Red Hat, Inc. and/or its affiliates
/// Copyright 2015-2016 Red Hat, Inc. and/or its affiliates
/// and other contributors as indicated by the @author tags.
///
/// Licensed under the Apache License, Version 2.0 (the "License");
Expand Down Expand Up @@ -86,18 +86,21 @@ module HawkularMetrics {
});

$scope.$on('DeploymentAddSuccess', (event, data) => {
this.$log.info('Deployment Add Succeeded!');
this.deploymentData.uploading = false;
this.deploymentData.hasDeployedSuccessfully = true;
this.deploymentData.hasDeploymentError = false;

this.$timeout(() => {
this.$log.info('Deployment Add Succeeded!');
this.deploymentData.uploading = false;
this.deploymentData.hasDeployedSuccessfully = true;
this.deploymentData.hasDeploymentError = false;
});
});
$scope.$on('DeploymentAddError', (event, data) => {
this.$log.warn('Deployment Add Failed!');
this.$log.warn(data);
this.deploymentData.uploading = false;
this.deploymentData.hasDeploymentError = true;
this.deploymentData.hasDeployedSuccessfully = false;
this.$timeout(() => {
this.$log.warn('Deployment Add Failed!');
this.$log.warn(data);
this.deploymentData.uploading = false;
this.deploymentData.hasDeploymentError = true;
this.deploymentData.hasDeployedSuccessfully = false;
});
});

}
Expand Down

0 comments on commit 9312b8d

Please sign in to comment.