File tree Expand file tree Collapse file tree 16 files changed +72
-106
lines changed Expand file tree Collapse file tree 16 files changed +72
-106
lines changed Original file line number Diff line number Diff line change @@ -83,6 +83,7 @@ angular.module('openshiftConsole')
83
83
var navigateBack = function ( ) {
84
84
$window . history . back ( ) ;
85
85
} ;
86
+ $scope . cancel = navigateBack ;
86
87
87
88
var displayError = function ( errorMessage , errorDetails ) {
88
89
NotificationsService . addNotification ( {
@@ -96,6 +97,7 @@ angular.module('openshiftConsole')
96
97
var hideErrorNotifications = function ( ) {
97
98
NotificationsService . hideNotification ( "add-config-volume-error" ) ;
98
99
} ;
100
+ $scope . $on ( '$destroy' , hideErrorNotifications ) ;
99
101
100
102
$scope . addItem = function ( ) {
101
103
$scope . attach . items . push ( { } ) ;
@@ -107,11 +109,6 @@ angular.module('openshiftConsole')
107
109
setDirty ( ) ;
108
110
} ;
109
111
110
- $scope . cancel = function ( ) {
111
- hideErrorNotifications ( ) ;
112
- navigateBack ( ) ;
113
- } ;
114
-
115
112
ProjectsService
116
113
. get ( $routeParams . project )
117
114
. then ( _ . spread ( function ( project , context ) {
Original file line number Diff line number Diff line change @@ -99,10 +99,12 @@ angular.module('openshiftConsole')
99
99
var hideErrorNotifications = function ( ) {
100
100
NotificationsService . hideNotification ( "attach-pvc-error" ) ;
101
101
} ;
102
+ $scope . $on ( '$destroy' , hideErrorNotifications ) ;
102
103
103
104
var navigateBack = function ( ) {
104
105
$window . history . back ( ) ;
105
106
} ;
107
+ $scope . cancel = navigateBack ;
106
108
107
109
var isContainerSelected = function ( container ) {
108
110
return $scope . attach . allContainers || $scope . attach . containers [ container . name ] ;
@@ -214,10 +216,5 @@ angular.module('openshiftConsole')
214
216
) ;
215
217
}
216
218
} ;
217
-
218
- $scope . cancel = function ( ) {
219
- hideErrorNotifications ( ) ;
220
- navigateBack ( ) ;
221
- } ;
222
219
} ) ) ;
223
220
} ) ;
Original file line number Diff line number Diff line change @@ -77,6 +77,7 @@ angular.module("openshiftConsole")
77
77
}
78
78
} ) ;
79
79
} ;
80
+ $scope . $on ( '$destroy' , hideErrorNotifications ) ;
80
81
81
82
ProjectsService
82
83
. get ( $routeParams . project )
@@ -410,7 +411,6 @@ angular.module("openshiftConsole")
410
411
} ) ) ;
411
412
412
413
$scope . cancel = function ( ) {
413
- hideErrorNotifications ( ) ;
414
414
Navigate . toProjectOverview ( $scope . projectName ) ;
415
415
} ;
416
416
} ) ;
Original file line number Diff line number Diff line change @@ -38,15 +38,12 @@ angular.module('openshiftConsole')
38
38
var hideErrorNotifications = function ( ) {
39
39
NotificationsService . hideNotification ( "create-config-map-error" ) ;
40
40
} ;
41
+ $scope . $on ( '$destroy' , hideErrorNotifications ) ;
41
42
42
43
var navigateBack = function ( ) {
43
44
$window . history . back ( ) ;
44
45
} ;
45
-
46
- $scope . cancel = function ( ) {
47
- hideErrorNotifications ( ) ;
48
- navigateBack ( ) ;
49
- } ;
46
+ $scope . cancel = navigateBack ;
50
47
51
48
ProjectsService
52
49
. get ( $routeParams . project )
Original file line number Diff line number Diff line change @@ -41,15 +41,12 @@ angular.module('openshiftConsole')
41
41
var hideErrorNotifications = function ( ) {
42
42
NotificationsService . hideNotification ( "create-pvc-error" ) ;
43
43
} ;
44
+ $scope . $on ( '$destroy' , hideErrorNotifications ) ;
44
45
45
46
var navigateBack = function ( ) {
46
47
$window . history . back ( ) ;
47
48
} ;
48
-
49
- $scope . cancel = function ( ) {
50
- hideErrorNotifications ( ) ;
51
- navigateBack ( ) ;
52
- } ;
49
+ $scope . cancel = navigateBack ;
53
50
54
51
ProjectsService
55
52
. get ( $routeParams . project )
Original file line number Diff line number Diff line change @@ -49,15 +49,12 @@ angular.module('openshiftConsole')
49
49
var hideErrorNotifications = function ( ) {
50
50
NotificationsService . hideNotification ( "create-route-error" ) ;
51
51
} ;
52
+ $scope . $on ( '$destroy' , hideErrorNotifications ) ;
52
53
53
54
var navigateBack = function ( ) {
54
55
$window . history . back ( ) ;
55
56
} ;
56
-
57
- $scope . cancel = function ( ) {
58
- hideErrorNotifications ( ) ;
59
- navigateBack ( ) ;
60
- } ;
57
+ $scope . cancel = navigateBack ;
61
58
62
59
ProjectsService
63
60
. get ( $routeParams . project )
Original file line number Diff line number Diff line change @@ -68,15 +68,12 @@ angular.module('openshiftConsole')
68
68
var navigateBack = function ( ) {
69
69
$window . history . back ( ) ;
70
70
} ;
71
+ $scope . cancel = navigateBack ;
71
72
72
73
var hideErrorNotifications = function ( ) {
73
74
NotificationsService . hideNotification ( 'edit-hpa-error' ) ;
74
75
} ;
75
-
76
- $scope . cancel = function ( ) {
77
- hideErrorNotifications ( ) ;
78
- navigateBack ( ) ;
79
- } ;
76
+ $scope . $on ( '$destroy' , hideErrorNotifications ) ;
80
77
81
78
ProjectsService
82
79
. get ( $routeParams . project )
Original file line number Diff line number Diff line change @@ -238,18 +238,15 @@ angular.module('openshiftConsole')
238
238
$window . history . back ( ) ;
239
239
}
240
240
} ;
241
+ $scope . cancel = navigateBack ;
241
242
242
243
var hideErrorNotifications = function ( ) {
243
244
// TODO: Add method to NotificationsService for passing a list of IDs.
244
245
NotificationsService . hideNotification ( "edit-build-config-error" ) ;
245
246
NotificationsService . hideNotification ( "edit-build-config-conflict" ) ;
246
247
NotificationsService . hideNotification ( "edit-build-config-deleted" ) ;
247
248
} ;
248
-
249
- $scope . cancel = function ( ) {
250
- hideErrorNotifications ( ) ;
251
- navigateBack ( ) ;
252
- } ;
249
+ $scope . $on ( '$destroy' , hideErrorNotifications ) ;
253
250
254
251
ProjectsService
255
252
. get ( $routeParams . project )
Original file line number Diff line number Diff line change @@ -41,11 +41,7 @@ angular.module('openshiftConsole')
41
41
var navigateBack = function ( ) {
42
42
$window . history . back ( ) ;
43
43
} ;
44
-
45
- $scope . cancel = function ( ) {
46
- hideErrorNotifications ( ) ;
47
- navigateBack ( ) ;
48
- } ;
44
+ $scope . cancel = navigateBack ;
49
45
50
46
ProjectsService
51
47
. get ( $routeParams . project )
@@ -97,6 +93,7 @@ angular.module('openshiftConsole')
97
93
98
94
$scope . $on ( '$destroy' , function ( ) {
99
95
DataService . unwatchAll ( watches ) ;
96
+ hideErrorNotifications ( ) ;
100
97
} ) ;
101
98
} ) ) ;
102
99
} ) ;
Original file line number Diff line number Diff line change @@ -392,11 +392,11 @@ angular.module('openshiftConsole')
392
392
} ;
393
393
394
394
$scope . cancel = function ( ) {
395
- hideErrorNotifications ( ) ;
396
395
$window . history . back ( ) ;
397
396
} ;
398
397
399
398
$scope . $on ( '$destroy' , function ( ) {
400
399
DataService . unwatchAll ( watches ) ;
400
+ hideErrorNotifications ( ) ;
401
401
} ) ;
402
402
} ) ;
Original file line number Diff line number Diff line change @@ -66,15 +66,12 @@ angular.module('openshiftConsole')
66
66
var navigateBack = function ( ) {
67
67
$location . url ( $scope . resourceURL ) ;
68
68
} ;
69
+ $scope . cancel = navigateBack ;
69
70
70
71
var hideErrorNotifications = function ( ) {
71
72
NotificationsService . hideNotification ( "add-health-check-error" ) ;
72
73
} ;
73
-
74
- $scope . cancel = function ( ) {
75
- hideErrorNotifications ( ) ;
76
- navigateBack ( ) ;
77
- } ;
74
+ $scope . $on ( '$destroy' , hideErrorNotifications ) ;
78
75
79
76
ProjectsService
80
77
. get ( $routeParams . project )
Original file line number Diff line number Diff line change @@ -43,15 +43,12 @@ angular.module('openshiftConsole')
43
43
var hideErrorNotifications = function ( ) {
44
44
NotificationsService . hideNotification ( "edit-route-error" ) ;
45
45
} ;
46
+ $scope . $on ( '$destroy' , hideErrorNotifications ) ;
46
47
47
48
var navigateBack = function ( ) {
48
49
$location . path ( $scope . routeURL ) ;
49
50
} ;
50
-
51
- $scope . cancel = function ( ) {
52
- hideErrorNotifications ( ) ;
53
- navigateBack ( ) ;
54
- } ;
51
+ $scope . cancel = navigateBack ;
55
52
56
53
ProjectsService
57
54
. get ( $routeParams . project )
Original file line number Diff line number Diff line change @@ -78,10 +78,8 @@ angular.module('openshiftConsole')
78
78
NotificationsService . hideNotification ( "set-compute-limits-error" ) ;
79
79
} ;
80
80
81
- $scope . cancel = function ( ) {
82
- hideErrorNotifications ( ) ;
83
- navigateBack ( ) ;
84
- } ;
81
+ $scope . cancel = navigateBack ;
82
+ $scope . $on ( '$destroy' , hideErrorNotifications ) ;
85
83
86
84
ProjectsService
87
85
. get ( $routeParams . project )
You can’t perform that action at this time.
0 commit comments