@@ -7894,7 +7894,7 @@ n(o + " could not be loaded.", m(a));
7894
7894
} ) :void j . toErrorPage ( "You do not have authority to update " + o + "." , "access_denied" ) ;
7895
7895
} ) ) ;
7896
7896
} ] ) , angular . module ( "openshiftConsole" ) . controller ( "EditRouteController" , [ "$filter" , "$location" , "$routeParams" , "$scope" , "AlertMessageService" , "AuthorizationService" , "DataService" , "Navigate" , "NotificationsService" , "ProjectsService" , "RoutesService" , function ( a , b , c , d , e , f , g , h , i , j , k ) {
7897
- d . alerts = { } , d . renderOptions = {
7897
+ d . renderOptions = {
7898
7898
hideFilterWidget :! 0
7899
7899
} , d . projectName = c . project , d . routeName = c . route , d . loading = ! 0 , d . routeURL = h . resourceURL ( d . routeName , "Route" , d . projectName ) , d . breadcrumbs = [ {
7900
7900
title :d . projectName ,
@@ -7907,7 +7907,9 @@ title:d.routeName,
7907
7907
link :d . routeURL
7908
7908
} , {
7909
7909
title :"Edit"
7910
- } ] , j . get ( c . project ) . then ( _ . spread ( function ( e , j ) {
7910
+ } ] , d . hideErrorNotifications = function ( ) {
7911
+ i . hideNotification ( "edit-route-error" ) ;
7912
+ } , j . get ( c . project ) . then ( _ . spread ( function ( e , j ) {
7911
7913
if ( d . project = e , d . breadcrumbs [ 0 ] . title = a ( "displayName" ) ( e ) , ! f . canI ( "routes" , "update" , c . project ) ) return void h . toErrorPage ( "You do not have authority to update route " + c . routeName + "." , "access_denied" ) ;
7912
7914
var l , m = a ( "orderByDisplayName" ) ;
7913
7915
g . get ( "routes" , d . routeName , j ) . then ( function ( a ) {
@@ -7953,7 +7955,7 @@ weight:a.weight
7953
7955
} ;
7954
7956
d . updateRoute = function ( ) {
7955
7957
if ( d . form . $valid ) {
7956
- d . disableInputs = ! 0 ;
7958
+ d . hideErrorNotifications ( ) , d . disableInputs = ! 0 ;
7957
7959
var c = n ( ) ;
7958
7960
g . update ( "routes" , d . routeName , c , j ) . then ( function ( ) {
7959
7961
i . addNotification ( {
@@ -7963,6 +7965,7 @@ message:"Route " + d.routeName + " was successfully updated."
7963
7965
} , function ( b ) {
7964
7966
d . disableInputs = ! 1 , i . addNotification ( {
7965
7967
type :"error" ,
7968
+ id :"edit-route-error" ,
7966
7969
message :"An error occurred updating route " + d . routeName + "." ,
7967
7970
details :a ( "getErrorDetails" ) ( b )
7968
7971
} ) ;
@@ -8717,7 +8720,7 @@ details:c("getErrorDetails")(b)
8717
8720
} ) ;
8718
8721
} ) ) ;
8719
8722
} ] ) , angular . module ( "openshiftConsole" ) . controller ( "CreateRouteController" , [ "$filter" , "$routeParams" , "$scope" , "$window" , "ApplicationGenerator" , "AuthorizationService" , "DataService" , "Navigate" , "NotificationsService" , "ProjectsService" , "keyValueEditorUtils" , function ( a , b , c , d , e , f , g , h , i , j , k ) {
8720
- c . alerts = { } , c . renderOptions = {
8723
+ c . renderOptions = {
8721
8724
hideFilterWidget :! 0
8722
8725
} , c . projectName = b . project , c . serviceName = b . service , c . labels = [ ] , c . routing = {
8723
8726
name :c . serviceName || ""
@@ -8729,11 +8732,17 @@ title:"Routes",
8729
8732
link :"project/" + c . projectName + "/browse/routes"
8730
8733
} , {
8731
8734
title :"Create Route"
8732
- } ] , j . get ( b . project ) . then ( _ . spread ( function ( j , l ) {
8735
+ } ] ;
8736
+ var l = function ( ) {
8737
+ i . hideNotification ( "create-route-error" ) ;
8738
+ } ;
8739
+ c . cancel = function ( ) {
8740
+ l ( ) , d . history . back ( ) ;
8741
+ } , j . get ( b . project ) . then ( _ . spread ( function ( j , m ) {
8733
8742
if ( c . project = j , c . breadcrumbs [ 0 ] . title = a ( "displayName" ) ( j ) , ! f . canI ( "routes" , "create" , b . project ) ) return void h . toErrorPage ( "You do not have authority to create routes in project " + b . project + "." , "access_denied" ) ;
8734
- var m = a ( "orderByDisplayName" ) ;
8735
- g . list ( "services" , l ) . then ( function ( a ) {
8736
- c . services = m ( a . by ( "metadata.name" ) ) , c . routing . to = { } , c . routing . to . service = _ . find ( c . services , function ( a ) {
8743
+ var n = a ( "orderByDisplayName" ) ;
8744
+ g . list ( "services" , m ) . then ( function ( a ) {
8745
+ c . services = n ( a . by ( "metadata.name" ) ) , c . routing . to = { } , c . routing . to . service = _ . find ( c . services , function ( a ) {
8737
8746
return ! c . serviceName || a . metadata . name === c . serviceName ;
8738
8747
} ) ;
8739
8748
} ) , c . copyServiceLabels = function ( ) {
@@ -8746,22 +8755,23 @@ value:a
8746
8755
} ) ;
8747
8756
} , c . createRoute = function ( ) {
8748
8757
if ( c . createRouteForm . $valid ) {
8749
- c . disableInputs = ! 0 ;
8758
+ l ( ) , c . disableInputs = ! 0 ;
8750
8759
var b = c . routing . to . service . metadata . name , f = k . mapEntries ( k . compactEntries ( c . labels ) ) , h = e . createRoute ( c . routing , b , f ) , j = _ . get ( c , "routing.alternateServices" , [ ] ) ;
8751
8760
_ . isEmpty ( j ) || ( h . spec . to . weight = _ . get ( c , "routing.to.weight" ) , h . spec . alternateBackends = _ . map ( j , function ( a ) {
8752
8761
return {
8753
8762
kind :"Service" ,
8754
8763
name :_ . get ( a , "service.metadata.name" ) ,
8755
8764
weight :a . weight
8756
8765
} ;
8757
- } ) ) , g . create ( "routes" , null , h , l ) . then ( function ( ) {
8766
+ } ) ) , g . create ( "routes" , null , h , m ) . then ( function ( ) {
8758
8767
i . addNotification ( {
8759
8768
type :"success" ,
8760
8769
message :"Route " + h . metadata . name + " was successfully created."
8761
8770
} ) , d . history . back ( ) ;
8762
8771
} , function ( b ) {
8763
8772
c . disableInputs = ! 1 , i . addNotification ( {
8764
8773
type :"error" ,
8774
+ id :"create-route-error" ,
8765
8775
message :"An error occurred creating the route." ,
8766
8776
details :a ( "getErrorDetails" ) ( b )
8767
8777
} ) ;
0 commit comments