@@ -8143,10 +8143,10 @@ details:c("getErrorDetails")(b)
8143
8143
}
8144
8144
} ) ;
8145
8145
} ) ) ;
8146
- } ] ) , angular . module ( "openshiftConsole" ) . controller ( "CreateRouteController" , [ "$filter" , "$routeParams" , "$scope" , "$window" , "ApplicationGenerator" , "AuthorizationService" , "DataService" , "Navigate" , "ProjectsService" , function ( a , b , c , d , e , f , g , h , i ) {
8146
+ } ] ) , 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 ) {
8147
8147
c . alerts = { } , c . renderOptions = {
8148
8148
hideFilterWidget :! 0
8149
- } , c . projectName = b . project , c . serviceName = b . service , c . routing = {
8149
+ } , c . projectName = b . project , c . serviceName = b . service , c . userDefinedLabels = [ ] , c . systemLabels = [ ] , c . routing = {
8150
8150
name :c . serviceName || ""
8151
8151
} , c . breadcrumbs = [ {
8152
8152
title :c . projectName ,
@@ -8156,26 +8156,32 @@ title:"Routes",
8156
8156
link :"project/" + c . projectName + "/browse/routes"
8157
8157
} , {
8158
8158
title :"Create Route"
8159
- } ] , i . get ( b . project ) . then ( _ . spread ( function ( i , j ) {
8159
+ } ] , i . get ( b . project ) . then ( _ . spread ( function ( i , k ) {
8160
8160
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" ) ;
8161
- var k = { } , l = a ( "orderByDisplayName" ) ;
8162
- g . list ( "services" , j , function ( a ) {
8161
+ var l = a ( "orderByDisplayName" ) ;
8162
+ g . list ( "services" , k , function ( a ) {
8163
8163
c . services = l ( a . by ( "metadata.name" ) ) , c . routing . to = { } , c . routing . to . service = _ . find ( c . services , function ( a ) {
8164
8164
return ! c . serviceName || a . metadata . name === c . serviceName ;
8165
- } ) , c . $watch ( "routing.to.service" , function ( ) {
8166
- k = angular . copy ( c . routing . to . service . metadata . labels ) ;
8165
+ } ) , c . $watch ( "routing.to.service" , function ( a ) {
8166
+ var b = _ . get ( a , "metadata.labels" , { } ) ;
8167
+ c . systemLabels = _ . map ( b , function ( a , b ) {
8168
+ return {
8169
+ name :b ,
8170
+ value :a
8171
+ } ;
8172
+ } ) ;
8167
8173
} ) ;
8168
8174
} ) , c . createRoute = function ( ) {
8169
8175
if ( c . createRouteForm . $valid ) {
8170
8176
c . disableInputs = ! 0 ;
8171
- var b = c . routing . to . service . metadata . name , f = e . createRoute ( c . routing , b , k ) , h = _ . get ( c , "routing.alternateServices" , [ ] ) ;
8172
- _ . isEmpty ( h ) || ( f . spec . to . weight = _ . get ( c , "routing.to.weight" ) , f . spec . alternateBackends = _ . map ( h , function ( a ) {
8177
+ var b = c . routing . to . service . metadata . name , f = j . mapEntries ( j . compactEntries ( c . userDefinedLabels ) ) , h = j . mapEntries ( j . compactEntries ( c . systemLabels ) ) , i = _ . extend ( h , f ) , l = e . createRoute ( c . routing , b , i ) , m = _ . get ( c , "routing.alternateServices" , [ ] ) ;
8178
+ _ . isEmpty ( m ) || ( l . spec . to . weight = _ . get ( c , "routing.to.weight" ) , l . spec . alternateBackends = _ . map ( m , function ( a ) {
8173
8179
return {
8174
8180
kind :"Service" ,
8175
8181
name :_ . get ( a , "service.metadata.name" ) ,
8176
8182
weight :a . weight
8177
8183
} ;
8178
- } ) ) , g . create ( "routes" , null , f , j ) . then ( function ( ) {
8184
+ } ) ) , g . create ( "routes" , null , l , k ) . then ( function ( ) {
8179
8185
d . history . back ( ) ;
8180
8186
} , function ( b ) {
8181
8187
c . disableInputs = ! 1 , c . alerts [ "create-route" ] = {
0 commit comments