Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hide error notifications on $scope destroy, not just cancel #1706

Merged
merged 1 commit into from
Jun 14, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions app/scripts/controllers/addConfigVolume.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ angular.module('openshiftConsole')
var navigateBack = function() {
$window.history.back();
};
$scope.cancel = navigateBack;

var displayError = function(errorMessage, errorDetails) {
NotificationsService.addNotification({
Expand All @@ -96,6 +97,7 @@ angular.module('openshiftConsole')
var hideErrorNotifications = function() {
NotificationsService.hideNotification("add-config-volume-error");
};
$scope.$on('$destroy', hideErrorNotifications);

$scope.addItem = function() {
$scope.attach.items.push({});
Expand All @@ -107,11 +109,6 @@ angular.module('openshiftConsole')
setDirty();
};

$scope.cancel = function() {
hideErrorNotifications();
navigateBack();
};

ProjectsService
.get($routeParams.project)
.then(_.spread(function(project, context) {
Expand Down
7 changes: 2 additions & 5 deletions app/scripts/controllers/attachPVC.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,12 @@ angular.module('openshiftConsole')
var hideErrorNotifications = function() {
NotificationsService.hideNotification("attach-pvc-error");
};
$scope.$on('$destroy', hideErrorNotifications);

var navigateBack = function() {
$window.history.back();
};
$scope.cancel = navigateBack;

var isContainerSelected = function(container) {
return $scope.attach.allContainers || $scope.attach.containers[container.name];
Expand Down Expand Up @@ -214,10 +216,5 @@ angular.module('openshiftConsole')
);
}
};

$scope.cancel = function() {
hideErrorNotifications();
navigateBack();
};
}));
});
2 changes: 1 addition & 1 deletion app/scripts/controllers/create/createFromImage.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ angular.module("openshiftConsole")
}
});
};
$scope.$on('$destroy', hideErrorNotifications);

ProjectsService
.get($routeParams.project)
Expand Down Expand Up @@ -410,7 +411,6 @@ angular.module("openshiftConsole")
}));

$scope.cancel = function() {
hideErrorNotifications();
Navigate.toProjectOverview($scope.projectName);
};
});
7 changes: 2 additions & 5 deletions app/scripts/controllers/createConfigMap.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,12 @@ angular.module('openshiftConsole')
var hideErrorNotifications = function() {
NotificationsService.hideNotification("create-config-map-error");
};
$scope.$on('$destroy', hideErrorNotifications);

var navigateBack = function() {
$window.history.back();
};

$scope.cancel = function() {
hideErrorNotifications();
navigateBack();
};
$scope.cancel = navigateBack;

ProjectsService
.get($routeParams.project)
Expand Down
7 changes: 2 additions & 5 deletions app/scripts/controllers/createPersistentVolumeClaim.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,12 @@ angular.module('openshiftConsole')
var hideErrorNotifications = function() {
NotificationsService.hideNotification("create-pvc-error");
};
$scope.$on('$destroy', hideErrorNotifications);

var navigateBack = function() {
$window.history.back();
};

$scope.cancel = function() {
hideErrorNotifications();
navigateBack();
};
$scope.cancel = navigateBack;

ProjectsService
.get($routeParams.project)
Expand Down
7 changes: 2 additions & 5 deletions app/scripts/controllers/createRoute.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,12 @@ angular.module('openshiftConsole')
var hideErrorNotifications = function() {
NotificationsService.hideNotification("create-route-error");
};
$scope.$on('$destroy', hideErrorNotifications);

var navigateBack = function() {
$window.history.back();
};

$scope.cancel = function() {
hideErrorNotifications();
navigateBack();
};
$scope.cancel = navigateBack;

ProjectsService
.get($routeParams.project)
Expand Down
7 changes: 2 additions & 5 deletions app/scripts/controllers/edit/autoscaler.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,12 @@ angular.module('openshiftConsole')
var navigateBack = function() {
$window.history.back();
};
$scope.cancel = navigateBack;

var hideErrorNotifications = function() {
NotificationsService.hideNotification('edit-hpa-error');
};

$scope.cancel = function() {
hideErrorNotifications();
navigateBack();
};
$scope.$on('$destroy', hideErrorNotifications);

ProjectsService
.get($routeParams.project)
Expand Down
7 changes: 2 additions & 5 deletions app/scripts/controllers/edit/buildConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -238,18 +238,15 @@ angular.module('openshiftConsole')
$window.history.back();
}
};
$scope.cancel = navigateBack;

var hideErrorNotifications = function() {
// TODO: Add method to NotificationsService for passing a list of IDs.
NotificationsService.hideNotification("edit-build-config-error");
NotificationsService.hideNotification("edit-build-config-conflict");
NotificationsService.hideNotification("edit-build-config-deleted");
};

$scope.cancel = function() {
hideErrorNotifications();
navigateBack();
};
$scope.$on('$destroy', hideErrorNotifications);

ProjectsService
.get($routeParams.project)
Expand Down
7 changes: 2 additions & 5 deletions app/scripts/controllers/edit/configMap.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,7 @@ angular.module('openshiftConsole')
var navigateBack = function() {
$window.history.back();
};

$scope.cancel = function() {
hideErrorNotifications();
navigateBack();
};
$scope.cancel = navigateBack;

ProjectsService
.get($routeParams.project)
Expand Down Expand Up @@ -97,6 +93,7 @@ angular.module('openshiftConsole')

$scope.$on('$destroy', function(){
DataService.unwatchAll(watches);
hideErrorNotifications();
});
}));
});
2 changes: 1 addition & 1 deletion app/scripts/controllers/edit/deploymentConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -392,11 +392,11 @@ angular.module('openshiftConsole')
};

$scope.cancel = function() {
hideErrorNotifications();
$window.history.back();
};

$scope.$on('$destroy', function(){
DataService.unwatchAll(watches);
hideErrorNotifications();
});
});
7 changes: 2 additions & 5 deletions app/scripts/controllers/edit/healthChecks.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,12 @@ angular.module('openshiftConsole')
var navigateBack = function() {
$location.url($scope.resourceURL);
};
$scope.cancel = navigateBack;

var hideErrorNotifications = function() {
NotificationsService.hideNotification("add-health-check-error");
};

$scope.cancel = function() {
hideErrorNotifications();
navigateBack();
};
$scope.$on('$destroy', hideErrorNotifications);

ProjectsService
.get($routeParams.project)
Expand Down
7 changes: 2 additions & 5 deletions app/scripts/controllers/edit/route.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,12 @@ angular.module('openshiftConsole')
var hideErrorNotifications = function() {
NotificationsService.hideNotification("edit-route-error");
};
$scope.$on('$destroy', hideErrorNotifications);

var navigateBack = function() {
$location.path($scope.routeURL);
};

$scope.cancel = function() {
hideErrorNotifications();
navigateBack();
};
$scope.cancel = navigateBack;

ProjectsService
.get($routeParams.project)
Expand Down
6 changes: 2 additions & 4 deletions app/scripts/controllers/setLimits.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,8 @@ angular.module('openshiftConsole')
NotificationsService.hideNotification("set-compute-limits-error");
};

$scope.cancel = function() {
hideErrorNotifications();
navigateBack();
};
$scope.cancel = navigateBack;
$scope.$on('$destroy', hideErrorNotifications);

ProjectsService
.get($routeParams.project)
Expand Down
Loading