@@ -4123,35 +4123,48 @@ _.each(e, function(d) {
4123
4123
h ( d , c ) && ( b [ d . id ] = b [ d . id ] || [ ] , b [ d . id ] . push ( a ) , f = ! 0 ) ;
4124
4124
} ) , f || ( b [ "" ] = b [ "" ] || [ ] , b [ "" ] . push ( a ) ) ;
4125
4125
} ) , b ;
4126
- } , k = a ( "displayName" ) , l = function ( a , b ) {
4126
+ } , k = function ( a ) {
4127
+ return a . from && "ImageStreamTag" === a . from . kind && a . from . name . indexOf ( ":" ) === - 1 && ! a . from . namespace ;
4128
+ } , l = a ( "displayName" ) , m = function ( a , b ) {
4127
4129
if ( ! b . length ) return a ;
4128
4130
var c = [ ] ;
4129
4131
return _ . each ( a , function ( a ) {
4130
- var d = _ . get ( a , "metadata.name" , "" ) , e = k ( a , ! 0 ) , f = _ . indexBy ( a . spec . tags , "name" ) ;
4131
- _ . each ( b , function ( b ) {
4132
- b . test ( d ) || e && b . test ( e ) || _ . each ( a . spec . tags , function ( a ) {
4133
- var c = _ . get ( a , "annotations.tags" , "" ) ;
4134
- if ( ! / \b b u i l d e r \b / . test ( c ) || / \b h i d d e n \b / . test ( c ) ) return void delete f [ a . name ] ;
4135
- if ( ! b . test ( a . name ) ) {
4136
- var d = _ . get ( a , "annotations.description" ) ;
4137
- d && b . test ( d ) || delete f [ a . name ] ;
4132
+ var d = _ . get ( a , "metadata.name" , "" ) , e = l ( a , ! 0 ) , f = [ ] , g = { } , h = { } ;
4133
+ _ . each ( a . spec . tags , function ( a ) {
4134
+ return k ( a ) ? ( g [ a . name ] = a . from . name , h [ a . from . name ] = h [ a . from . name ] || [ ] , void h [ a . from . name ] . push ( a . name ) ) :void f . push ( a ) ;
4135
+ } ) ;
4136
+ var i = _ . indexBy ( f , "name" ) ;
4137
+ _ . each ( b , function ( a ) {
4138
+ a . test ( d ) || e && a . test ( e ) || _ . each ( f , function ( b ) {
4139
+ var c = _ . get ( b , "annotations.tags" , "" ) ;
4140
+ if ( ! / \b b u i l d e r \b / . test ( c ) || / \b h i d d e n \b / . test ( c ) ) return void delete i [ b . name ] ;
4141
+ if ( ! a . test ( b . name ) ) {
4142
+ var d = function ( b ) {
4143
+ return a . test ( b ) ;
4144
+ } ;
4145
+ if ( ! _ . some ( h [ b . name ] , d ) ) {
4146
+ var e = _ . get ( b , "annotations.description" ) ;
4147
+ e && a . test ( e ) || delete i [ b . name ] ;
4148
+ }
4138
4149
}
4139
4150
} ) ;
4140
4151
} ) ;
4141
- var g ;
4142
- _ . isEmpty ( f ) || ( g = angular . copy ( a ) , g . status . tags = _ . filter ( g . status . tags , function ( a ) {
4143
- return f [ a . tag ] ;
4144
- } ) , c . push ( g ) ) ;
4152
+ var j ;
4153
+ _ . isEmpty ( i ) || ( j = angular . copy ( a ) , j . status . tags = _ . filter ( j . status . tags , function ( a ) {
4154
+ var b = g [ a . tag ] ;
4155
+ return b ? i [ b ] :i [ a . tag ] ;
4156
+ } ) , c . push ( j ) ) ;
4145
4157
} ) , c ;
4146
- } , m = [ "metadata.name" , 'metadata.annotations["openshift.io/display-name"]' , "metadata.annotations.description" ] , n = function ( a , b ) {
4147
- return c . filterForKeywords ( a , m , b ) ;
4158
+ } , n = [ "metadata.name" , 'metadata.annotations["openshift.io/display-name"]' , "metadata.annotations.description" ] , o = function ( a , b ) {
4159
+ return c . filterForKeywords ( a , n , b ) ;
4148
4160
} ;
4149
4161
return {
4150
4162
getCategoryItem :f ,
4151
4163
categorizeImageStreams :i ,
4152
4164
categorizeTemplates :j ,
4153
- filterImageStreams :l ,
4154
- filterTemplates :n
4165
+ referencesSameImageStream :k ,
4166
+ filterImageStreams :m ,
4167
+ filterTemplates :o
4155
4168
} ;
4156
4169
} ] ) , angular . module ( "openshiftConsole" ) . factory ( "ModalsService" , [ "$uibModal" , function ( a ) {
4157
4170
return {
@@ -11489,7 +11502,7 @@ keyword:""
11489
11502
} , b . $watch ( "filter.keyword" , e ) , b . $watchGroup ( [ "openshiftImageStreams" , "projectImageStreams" ] , g ) , b . $watchGroup ( [ "openshiftTemplates" , "projectTemplates" ] , i ) ;
11490
11503
}
11491
11504
} ;
11492
- } ] ) , angular . module ( "openshiftConsole" ) . directive ( "catalogImage" , [ "$filter" , function ( a ) {
11505
+ } ] ) , angular . module ( "openshiftConsole" ) . directive ( "catalogImage" , [ "$filter" , "CatalogService" , function ( a , b ) {
11493
11506
return {
11494
11507
restrict :"E" ,
11495
11508
replace :! 0 ,
@@ -11501,25 +11514,25 @@ isBuilder:"=?",
11501
11514
keywords :"="
11502
11515
} ,
11503
11516
templateUrl :"views/catalog/_image.html" ,
11504
- link :function ( b ) {
11505
- var c = a ( "imageStreamTagTags" ) , d = { } ;
11506
- b . referencedBy = { } ;
11507
- var e = _ . get ( b , "imageStream.spec.tags" , [ ] ) , f = { } ;
11508
- _ . each ( e , function ( a ) {
11509
- f [ a . name ] = c ( b . imageStream , a . name ) , a . from && "ImageStreamTag" === a . from . kind && a . from . name . indexOf ( ":" ) === - 1 && ! a . from . namespace && ( d [ a . name ] = ! 0 , b . referencedBy [ a . from . name ] = b . referencedBy [ a . from . name ] || [ ] , b . referencedBy [ a . from . name ] . push ( a . name ) ) ;
11517
+ link :function ( c ) {
11518
+ var d = a ( "imageStreamTagTags" ) , e = { } ;
11519
+ c . referencedBy = { } ;
11520
+ var f = _ . get ( c , "imageStream.spec.tags" , [ ] ) , g = { } ;
11521
+ _ . each ( f , function ( a ) {
11522
+ g [ a . name ] = d ( c . imageStream , a . name ) , b . referencesSameImageStream ( a ) && ( e [ a . name ] = ! 0 , c . referencedBy [ a . from . name ] = c . referencedBy [ a . from . name ] || [ ] , c . referencedBy [ a . from . name ] . push ( a . name ) ) ;
11510
11523
} ) ;
11511
- var g = function ( a ) {
11512
- var b = _ . get ( f , [ a ] , [ ] ) ;
11524
+ var h = function ( a ) {
11525
+ var b = _ . get ( g , [ a ] , [ ] ) ;
11513
11526
return _ . includes ( b , "builder" ) && ! _ . includes ( b , "hidden" ) ;
11514
11527
} ;
11515
- b . $watch ( "imageStream.status.tags" , function ( a ) {
11516
- b . tags = _ . filter ( a , function ( a ) {
11517
- return g ( a . tag ) && ! d [ a . tag ] ;
11528
+ c . $watch ( "imageStream.status.tags" , function ( a ) {
11529
+ c . tags = _ . filter ( a , function ( a ) {
11530
+ return h ( a . tag ) && ! e [ a . tag ] ;
11518
11531
} ) ;
11519
- var c = _ . get ( b , "is.tag.tag" ) ;
11520
- c && _ . some ( b . tags , {
11521
- tag :c
11522
- } ) || _ . set ( b , "is.tag" , _ . head ( b . tags ) ) ;
11532
+ var b = _ . get ( c , "is.tag.tag" ) ;
11533
+ b && _ . some ( c . tags , {
11534
+ tag :b
11535
+ } ) || _ . set ( c , "is.tag" , _ . head ( c . tags ) ) ;
11523
11536
} ) ;
11524
11537
}
11525
11538
} ;
0 commit comments