@@ -7864,7 +7864,7 @@ d.disableInputs = !1, n(o + " could not be updated.", m(a));
7864
7864
n ( o + " could not be loaded." , m ( a ) ) ;
7865
7865
} ) :void j . toErrorPage ( "You do not have authority to update " + o + "." , "access_denied" ) ;
7866
7866
} ) ) ;
7867
- } ] ) , angular . module ( "openshiftConsole" ) . controller ( "EditRouteController" , [ "$filter" , "$location" , "$routeParams" , "$scope" , "AlertMessageService" , "AuthorizationService" , "DataService" , "Navigate" , "ProjectsService" , "RoutesService" , function ( a , b , c , d , e , f , g , h , i , j ) {
7867
+ } ] ) , 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 ) {
7868
7868
d . alerts = { } , d . renderOptions = {
7869
7869
hideFilterWidget :! 0
7870
7870
} , d . projectName = c . project , d . routeName = c . route , d . loading = ! 0 , d . routeURL = h . resourceURL ( d . routeName , "Route" , d . projectName ) , d . breadcrumbs = [ {
@@ -7878,20 +7878,20 @@ title:d.routeName,
7878
7878
link :d . routeURL
7879
7879
} , {
7880
7880
title :"Edit"
7881
- } ] , i . get ( c . project ) . then ( _ . spread ( function ( i , k ) {
7882
- if ( d . project = i , d . breadcrumbs [ 0 ] . title = a ( "displayName" ) ( i ) , ! f . canI ( "routes" , "update" , c . project ) ) return void h . toErrorPage ( "You do not have authority to update route " + c . routeName + "." , "access_denied" ) ;
7881
+ } ] , j . get ( c . project ) . then ( _ . spread ( function ( e , j ) {
7882
+ 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" ) ;
7883
7883
var l , m = a ( "orderByDisplayName" ) ;
7884
- g . get ( "routes" , d . routeName , k ) . then ( function ( a ) {
7884
+ g . get ( "routes" , d . routeName , j ) . then ( function ( a ) {
7885
7885
l = angular . copy ( a ) ;
7886
7886
var b = _ . get ( l , "spec.host" ) , c = "Subdomain" === _ . get ( l , "spec.wildcardPolicy" ) ;
7887
- c && ( b = "*." + j . getSubdomain ( l ) ) , d . routing = {
7887
+ c && ( b = "*." + k . getSubdomain ( l ) ) , d . routing = {
7888
7888
service :_ . get ( l , "spec.to.name" ) ,
7889
7889
host :b ,
7890
7890
wildcardPolicy :_ . get ( l , "spec.wildcardPolicy" ) ,
7891
7891
path :_ . get ( l , "spec.path" ) ,
7892
7892
targetPort :_ . get ( l , "spec.port.targetPort" ) ,
7893
7893
tls :angular . copy ( _ . get ( l , "spec.tls" ) )
7894
- } , g . list ( "services" , k ) . then ( function ( a ) {
7894
+ } , g . list ( "services" , j ) . then ( function ( a ) {
7895
7895
var b = a . by ( "metadata.name" ) , c = _ . get ( l , "spec.to" , { } ) ;
7896
7896
d . loading = ! 1 , d . services = m ( b ) , d . routing . to = {
7897
7897
service :b [ c . name ] ,
@@ -7926,20 +7926,17 @@ d.updateRoute = function() {
7926
7926
if ( d . form . $valid ) {
7927
7927
d . disableInputs = ! 0 ;
7928
7928
var c = n ( ) ;
7929
- g . update ( "routes" , d . routeName , c , k ) . then ( function ( ) {
7930
- e . addAlert ( {
7931
- name :d . routeName ,
7932
- data :{
7929
+ g . update ( "routes" , d . routeName , c , j ) . then ( function ( ) {
7930
+ i . addNotification ( {
7933
7931
type :"success" ,
7934
7932
message :"Route " + d . routeName + " was successfully updated."
7935
- }
7936
7933
} ) , b . path ( d . routeURL ) ;
7937
7934
} , function ( b ) {
7938
- d . disableInputs = ! 1 , d . alerts [ "update-route" ] = {
7935
+ d . disableInputs = ! 1 , i . addNotification ( {
7939
7936
type :"error" ,
7940
7937
message :"An error occurred updating route " + d . routeName + "." ,
7941
7938
details :a ( "getErrorDetails" ) ( b )
7942
- } ;
7939
+ } ) ;
7943
7940
} ) ;
7944
7941
}
7945
7942
} ;
@@ -8690,7 +8687,7 @@ details:c("getErrorDetails")(b)
8690
8687
}
8691
8688
} ) ;
8692
8689
} ) ) ;
8693
- } ] ) , angular . module ( "openshiftConsole" ) . controller ( "CreateRouteController" , [ "$filter" , "$routeParams" , "$scope" , "$window" , "ApplicationGenerator" , "AuthorizationService" , "DataService" , "Navigate" , "ProjectsService" , "keyValueEditorUtils" , function ( a , b , c , d , e , f , g , h , i , j ) {
8690
+ } ] ) , 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 ) {
8694
8691
c . alerts = { } , c . renderOptions = {
8695
8692
hideFilterWidget :! 0
8696
8693
} , c . projectName = b . project , c . serviceName = b . service , c . labels = [ ] , c . routing = {
@@ -8703,15 +8700,15 @@ title:"Routes",
8703
8700
link :"project/" + c . projectName + "/browse/routes"
8704
8701
} , {
8705
8702
title :"Create Route"
8706
- } ] , i . get ( b . project ) . then ( _ . spread ( function ( i , k ) {
8707
- if ( c . project = i , c . breadcrumbs [ 0 ] . title = a ( "displayName" ) ( i ) , ! f . canI ( "routes" , "create" , b . project ) ) return void h . toErrorPage ( "You do not have authority to create routes in project " + b . project + "." , "access_denied" ) ;
8708
- var l = a ( "orderByDisplayName" ) ;
8709
- g . list ( "services" , k ) . then ( function ( a ) {
8710
- c . services = l ( a . by ( "metadata.name" ) ) , c . routing . to = { } , c . routing . to . service = _ . find ( c . services , function ( a ) {
8703
+ } ] , j . get ( b . project ) . then ( _ . spread ( function ( j , l ) {
8704
+ 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" ) ;
8705
+ var m = a ( "orderByDisplayName" ) ;
8706
+ g . list ( "services" , l ) . then ( function ( a ) {
8707
+ c . services = m ( a . by ( "metadata.name" ) ) , c . routing . to = { } , c . routing . to . service = _ . find ( c . services , function ( a ) {
8711
8708
return ! c . serviceName || a . metadata . name === c . serviceName ;
8712
8709
} ) ;
8713
8710
} ) , c . copyServiceLabels = function ( ) {
8714
- var a = _ . get ( c , "routing.to.service.metadata.labels" , { } ) , b = j . mapEntries ( j . compactEntries ( c . labels ) ) , d = _ . assign ( b , a ) ;
8711
+ var a = _ . get ( c , "routing.to.service.metadata.labels" , { } ) , b = k . mapEntries ( k . compactEntries ( c . labels ) ) , d = _ . assign ( b , a ) ;
8715
8712
c . labels = _ . map ( d , function ( a , b ) {
8716
8713
return {
8717
8714
name :b ,
@@ -8721,21 +8718,24 @@ value:a
8721
8718
} , c . createRoute = function ( ) {
8722
8719
if ( c . createRouteForm . $valid ) {
8723
8720
c . disableInputs = ! 0 ;
8724
- var b = c . routing . to . service . metadata . name , f = j . mapEntries ( j . compactEntries ( c . labels ) ) , h = e . createRoute ( c . routing , b , f ) , i = _ . get ( c , "routing.alternateServices" , [ ] ) ;
8725
- _ . isEmpty ( i ) || ( h . spec . to . weight = _ . get ( c , "routing.to.weight" ) , h . spec . alternateBackends = _ . map ( i , function ( a ) {
8721
+ 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" , [ ] ) ;
8722
+ _ . isEmpty ( j ) || ( h . spec . to . weight = _ . get ( c , "routing.to.weight" ) , h . spec . alternateBackends = _ . map ( j , function ( a ) {
8726
8723
return {
8727
8724
kind :"Service" ,
8728
8725
name :_ . get ( a , "service.metadata.name" ) ,
8729
8726
weight :a . weight
8730
8727
} ;
8731
- } ) ) , g . create ( "routes" , null , h , k ) . then ( function ( ) {
8732
- d . history . back ( ) ;
8728
+ } ) ) , g . create ( "routes" , null , h , l ) . then ( function ( ) {
8729
+ i . addNotification ( {
8730
+ type :"success" ,
8731
+ message :"Route " + h . metadata . name + " was successfully created."
8732
+ } ) , d . history . back ( ) ;
8733
8733
} , function ( b ) {
8734
- c . disableInputs = ! 1 , c . alerts [ "create-route" ] = {
8734
+ c . disableInputs = ! 1 , i . addNotification ( {
8735
8735
type :"error" ,
8736
8736
message :"An error occurred creating the route." ,
8737
8737
details :a ( "getErrorDetails" ) ( b )
8738
- } ;
8738
+ } ) ;
8739
8739
} ) ;
8740
8740
}
8741
8741
} ;
0 commit comments