@@ -5355,19 +5355,19 @@ a.deploymentConfigs = b.select(a.unfilteredDeploymentConfigs), a.replicationCont
5355
5355
d . unwatchAll ( n ) ;
5356
5356
} ) ;
5357
5357
} ) ) ;
5358
- } ] ) , angular . module ( "openshiftConsole" ) . controller ( "DeploymentController" , [ "$scope" , "$filter" , "$routeParams" , "DataService" , "DeploymentsService" , "EnvironmentService" , "HPAService" , "ImageStreamResolver" , "ModalsService" , "Navigate" , "OwnerReferencesService" , "Logger" , "ProjectsService" , "StorageService" , function ( a , b , c , d , e , f , g , h , i , j , k , l , m , n ) {
5359
- var o = { } ;
5360
- a . projectName = c . project , a . name = c . deployment , a . forms = { } , a . alerts = { } , a . imagesByDockerReference = { } , a . breadcrumbs = [ {
5358
+ } ] ) , angular . module ( "openshiftConsole" ) . controller ( "DeploymentController" , [ "$scope" , "$filter" , "$routeParams" , "DataService" , "DeploymentsService" , "EnvironmentService" , "HPAService" , "ImageStreamResolver" , "ModalsService" , "Navigate" , "OwnerReferencesService" , "Logger" , "ProjectsService" , "StorageService" , "LabelFilter" , function ( a , b , c , d , e , f , g , h , i , j , k , l , m , n , o ) {
5359
+ var p = { } ;
5360
+ a . projectName = c . project , a . name = c . deployment , a . replicaSetsForDeployment = { } , a . unfilteredReplicaSetsForDeployment = { } , a . emptyMessage = "Loading..." , a . forms = { } , a . alerts = { } , a . imagesByDockerReference = { } , a . breadcrumbs = [ {
5361
5361
title :"Deployments" ,
5362
5362
link :"project/" + c . project + "/browse/deployments"
5363
5363
} , {
5364
5364
title :c . deployment
5365
5365
} ] , a . healthCheckURL = j . healthCheckURL ( c . project , "Deployment" , c . deployment , "extensions" ) ;
5366
- var p = ! 1 , q = function ( b , c ) {
5367
- if ( ! p ) {
5366
+ var q = ! 1 , r = function ( b , c ) {
5367
+ if ( ! q ) {
5368
5368
if ( ! a . forms . deploymentEnvVars || a . forms . deploymentEnvVars . $pristine ) return void ( a . updatedDeployment = f . copyAndNormalize ( b ) ) ;
5369
5369
if ( f . isEnvironmentEqual ( b , c ) ) return void ( a . updatedDeployment = f . mergeEdits ( a . updatedDeployment , b ) ) ;
5370
- p = ! 0 , a . alerts [ "env-conflict" ] = {
5370
+ q = ! 0 , a . alerts [ "env-conflict" ] = {
5371
5371
type :"warning" ,
5372
5372
message :"The environment variables for the deployment have been updated in the background. Saving your changes may create a conflict or cause loss of data." ,
5373
5373
links :[ {
@@ -5378,17 +5378,23 @@ return a.clearEnvVarUpdates(), !0;
5378
5378
} ]
5379
5379
} ;
5380
5380
}
5381
- } , r = b ( "orderByDisplayName" ) , s = b ( "getErrorDetails" ) , t = function ( b , c ) {
5381
+ } , s = b ( "orderByDisplayName" ) , t = b ( "getErrorDetails" ) , u = function ( b , c ) {
5382
5382
a . alerts [ "from-value-objects" ] = {
5383
5383
type :"error" ,
5384
5384
message :b ,
5385
5385
details :c
5386
5386
} ;
5387
- } , u = [ ] ;
5387
+ } , v = [ ] ;
5388
5388
m . get ( c . project ) . then ( _ . spread ( function ( j , m ) {
5389
+ function w ( ) {
5390
+ o . getLabelSelector ( ) . isEmpty ( ) || ! $ . isArray ( a . replicaSetsForDeployment ) || a . replicaSetsForDeployment . length || $ . isEmptyObject ( a . unfilteredReplicaSetsForDeployment ) ? delete a . alerts . deployments :a . alerts . deployments = {
5391
+ type :"warning" ,
5392
+ details :"The active filters are hiding all deployments."
5393
+ } ;
5394
+ }
5389
5395
a . project = j , a . projectContext = m ;
5390
- var v , w = { } , x = function ( ) {
5391
- g . getHPAWarnings ( a . deployment , a . autoscalers , w , j ) . then ( function ( b ) {
5396
+ var x , y = { } , z = function ( ) {
5397
+ g . getHPAWarnings ( a . deployment , a . autoscalers , y , j ) . then ( function ( b ) {
5392
5398
a . hpaWarnings = b ;
5393
5399
} ) ;
5394
5400
} ;
@@ -5398,11 +5404,11 @@ resource:"deployments"
5398
5404
} , c . deployment , m , {
5399
5405
errorNotification :! 1
5400
5406
} ) . then ( function ( g ) {
5401
- a . loaded = ! 0 , a . deployment = g , x ( ) , a . saveEnvVars = function ( ) {
5402
- f . compact ( a . updatedDeployment ) , v = d . update ( {
5407
+ a . loaded = ! 0 , a . deployment = g , z ( ) , a . saveEnvVars = function ( ) {
5408
+ f . compact ( a . updatedDeployment ) , x = d . update ( {
5403
5409
group :"extensions" ,
5404
5410
resource :"deployments"
5405
- } , c . deployment , a . updatedDeployment , m ) , v . then ( function ( ) {
5411
+ } , c . deployment , a . updatedDeployment , m ) , x . then ( function ( ) {
5406
5412
a . alerts . saveEnvSuccess = {
5407
5413
type :"success" ,
5408
5414
message :c . deployment + " was updated."
@@ -5414,11 +5420,11 @@ message:c.deployment + " was not updated.",
5414
5420
details :b ( "getErrorDetails" ) ( d )
5415
5421
} ;
5416
5422
} ) [ "finally" ] ( function ( ) {
5417
- v = null ;
5423
+ x = null ;
5418
5424
} ) ;
5419
5425
} , a . clearEnvVarUpdates = function ( ) {
5420
- a . updatedDeployment = f . copyAndNormalize ( a . deployment ) , a . forms . deploymentEnvVars . $setPristine ( ) , p = ! 1 ;
5421
- } , u . push ( d . watchObject ( {
5426
+ a . updatedDeployment = f . copyAndNormalize ( a . deployment ) , a . forms . deploymentEnvVars . $setPristine ( ) , q = ! 1 ;
5427
+ } , v . push ( d . watchObject ( {
5422
5428
group :"extensions" ,
5423
5429
resource :"deployments"
5424
5430
} , c . deployment , m , function ( b , c ) {
@@ -5427,15 +5433,16 @@ type:"warning",
5427
5433
message :"This deployment has been deleted."
5428
5434
} ) ;
5429
5435
var d = a . deployment ;
5430
- a . deployment = b , a . updatingPausedState = ! 1 , x ( ) , q ( b , d ) , v ? v [ "finally" ] ( function ( ) {
5431
- q ( b , d ) ;
5432
- } ) :q ( b , d ) , h . fetchReferencedImageStreamImages ( [ b . spec . template ] , a . imagesByDockerReference , o , m ) ;
5433
- } ) ) , u . push ( d . watch ( {
5436
+ a . deployment = b , a . updatingPausedState = ! 1 , z ( ) , r ( b , d ) , x ? x [ "finally" ] ( function ( ) {
5437
+ r ( b , d ) ;
5438
+ } ) :r ( b , d ) , h . fetchReferencedImageStreamImages ( [ b . spec . template ] , a . imagesByDockerReference , p , m ) ;
5439
+ } ) ) , v . push ( d . watch ( {
5434
5440
group :"extensions" ,
5435
5441
resource :"replicasets"
5436
5442
} , m , function ( b ) {
5443
+ a . emptyMessage = "No deployments to show" ;
5437
5444
var c = b . by ( "metadata.name" ) ;
5438
- c = k . filterForController ( c , g ) , a . inProgressDeployment = _ . chain ( c ) . filter ( "status.replicas" ) . size ( ) > 1 , a . replicaSetsForDeployment = e . sortByRevision ( c ) ;
5445
+ c = k . filterForController ( c , g ) , a . inProgressDeployment = _ . chain ( c ) . filter ( "status.replicas" ) . size ( ) > 1 , a . unfilteredReplicaSetsForDeployment = e . sortByRevision ( c ) , a . replicaSetsForDeployment = o . getLabelSelector ( ) . select ( a . unfilteredReplicaSetsForDeployment ) , a . orderedReplicaSetsForDeployment = a . replicaSetsForDeployment ;
5439
5446
} ) ) ;
5440
5447
} , function ( c ) {
5441
5448
a . loaded = ! 0 , a . alerts . load = {
@@ -5444,33 +5451,37 @@ message:404 === c.status ? "This deployment can not be found, it may have been d
5444
5451
details :b ( "getErrorDetails" ) ( c )
5445
5452
} ;
5446
5453
} ) , d . list ( "limitranges" , m ) . then ( function ( a ) {
5447
- w = a . by ( "metadata.name" ) , x ( ) ;
5454
+ y = a . by ( "metadata.name" ) , z ( ) ;
5448
5455
} ) ;
5449
- var y = [ ] , z = [ ] ;
5456
+ var A = [ ] , B = [ ] ;
5450
5457
a . valueFromObjects = [ ] , d . list ( "configmaps" , m , null , {
5451
5458
errorNotification :! 1
5452
5459
} ) . then ( function ( b ) {
5453
- y = r ( b . by ( "metadata.name" ) ) , a . valueFromObjects = y . concat ( z ) ;
5460
+ A = s ( b . by ( "metadata.name" ) ) , a . valueFromObjects = A . concat ( B ) ;
5454
5461
} , function ( a ) {
5455
- 403 !== a . code && t ( "Could not load config maps" , s ( a ) ) ;
5462
+ 403 !== a . code && u ( "Could not load config maps" , t ( a ) ) ;
5456
5463
} ) , d . list ( "secrets" , m , null , {
5457
5464
errorNotification :! 1
5458
5465
} ) . then ( function ( b ) {
5459
- z = r ( b . by ( "metadata.name" ) ) , a . valueFromObjects = z . concat ( y ) ;
5466
+ B = s ( b . by ( "metadata.name" ) ) , a . valueFromObjects = B . concat ( A ) ;
5460
5467
} , function ( a ) {
5461
- 403 !== a . code && t ( "Could not load secrets" , s ( a ) ) ;
5462
- } ) , u . push ( d . watch ( "imagestreams" , m , function ( b ) {
5468
+ 403 !== a . code && u ( "Could not load secrets" , t ( a ) ) ;
5469
+ } ) , v . push ( d . watch ( "imagestreams" , m , function ( b ) {
5463
5470
var c = b . by ( "metadata.name" ) ;
5464
- h . buildDockerRefMapForImageStreams ( c , o ) , a . deployment && h . fetchReferencedImageStreamImages ( [ a . deployment . spec . template ] , a . imagesByDockerReference , o , m ) , l . log ( "imagestreams (subscribe)" , a . imageStreams ) ;
5465
- } ) ) , u . push ( d . watch ( {
5471
+ h . buildDockerRefMapForImageStreams ( c , p ) , a . deployment && h . fetchReferencedImageStreamImages ( [ a . deployment . spec . template ] , a . imagesByDockerReference , p , m ) , l . log ( "imagestreams (subscribe)" , a . imageStreams ) ;
5472
+ } ) ) , v . push ( d . watch ( {
5466
5473
group :"autoscaling" ,
5467
5474
resource :"horizontalpodautoscalers" ,
5468
5475
version :"v1"
5469
5476
} , m , function ( b ) {
5470
- a . autoscalers = g . filterHPA ( b . by ( "metadata.name" ) , "Deployment" , c . deployment ) , x ( ) ;
5471
- } ) ) , u . push ( d . watch ( "builds" , m , function ( b ) {
5477
+ a . autoscalers = g . filterHPA ( b . by ( "metadata.name" ) , "Deployment" , c . deployment ) , z ( ) ;
5478
+ } ) ) , v . push ( d . watch ( "builds" , m , function ( b ) {
5472
5479
a . builds = b . by ( "metadata.name" ) , l . log ( "builds (subscribe)" , a . builds ) ;
5473
- } ) ) , a . scale = function ( c ) {
5480
+ } ) ) , o . onActiveFiltersChanged ( function ( b ) {
5481
+ a . $apply ( function ( ) {
5482
+ a . replicaSetsForDeployment = b . select ( a . unfilteredReplicaSetsForDeployment ) , a . orderedReplicaSetsForDeployment = a . replicaSetsForDeployment , w ( ) ;
5483
+ } ) ;
5484
+ } ) , a . scale = function ( c ) {
5474
5485
var d = function ( c ) {
5475
5486
a . alerts = a . alerts || { } , a . alerts . scale = {
5476
5487
type :"error" ,
@@ -5501,7 +5512,7 @@ n.removeVolume(a.deployment, b, m);
5501
5512
} ;
5502
5513
d . then ( e ) ;
5503
5514
} , a . $on ( "$destroy" , function ( ) {
5504
- d . unwatchAll ( u ) ;
5515
+ d . unwatchAll ( v ) ;
5505
5516
} ) ;
5506
5517
} ) ) ;
5507
5518
} ] ) , angular . module ( "openshiftConsole" ) . controller ( "DeploymentConfigController" , [ "$scope" , "$filter" , "$routeParams" , "BreadcrumbsService" , "DataService" , "DeploymentsService" , "EnvironmentService" , "HPAService" , "ImageStreamResolver" , "ModalsService" , "Navigate" , "NotificationsService" , "Logger" , "ProjectsService" , "StorageService" , "LabelFilter" , "labelNameFilter" , function ( a , b , c , d , e , f , g , h , i , j , k , l , m , n , o , p , q ) {
0 commit comments