@@ -50,6 +50,10 @@ AVAILABLE_KINDS_BLACKLIST:[ "Binding", "Ingress", "DeploymentConfigRollback" ],
50
50
ENABLE_TECH_PREVIEW_FEATURE :{
51
51
pipelines :! 0
52
52
} ,
53
+ SAMPLE_PIPELINE_TEMPLATE :{
54
+ name :"jenkins-pipeline-example" ,
55
+ namespace :"openshift"
56
+ } ,
53
57
PROJECT_NAVIGATION :[ {
54
58
label :"Overview" ,
55
59
iconClass :"fa fa-dashboard" ,
@@ -5200,47 +5204,60 @@ b.buildConfigs = a.select(b.unfilteredBuildConfigs), j(), m();
5200
5204
d . unwatchAll ( l ) ;
5201
5205
} ) ;
5202
5206
} ) ) ;
5203
- } ] ) , angular . module ( "openshiftConsole" ) . controller ( "PipelinesController" , [ "$filter" , "$routeParams" , "$scope" , "AlertMessageService" , "BuildsService" , "DataService" , "Logger" , "ProjectsService" , function ( a , b , c , d , e , f , g , h ) {
5204
- c . projectName = b . project , c . alerts = c . alerts || { } , c . buildConfigs = { } , d . getAlerts ( ) . forEach ( function ( a ) {
5207
+ } ] ) , angular . module ( "openshiftConsole" ) . controller ( "PipelinesController" , [ "$filter" , "$routeParams" , "$scope" , "Constants" , "Navigate" , " AlertMessageService", "BuildsService" , "DataService" , "Logger" , "ProjectsService" , function ( a , b , c , d , e , f , g , h , i , j ) {
5208
+ c . projectName = b . project , c . alerts = c . alerts || { } , c . buildConfigs = { } , f . getAlerts ( ) . forEach ( function ( a ) {
5205
5209
c . alerts [ a . name ] = a . data ;
5206
- } ) , d . clearAlerts ( ) ;
5207
- var i = [ ] ;
5208
- h . get ( b . project ) . then ( _ . spread ( function ( b , d ) {
5210
+ } ) , f . clearAlerts ( ) ;
5211
+ var k = [ ] ;
5212
+ j . get ( b . project ) . then ( _ . spread ( function ( b , f ) {
5209
5213
c . project = b ;
5210
- var g = { } , h = a ( "buildConfigForBuild" ) , j = a ( "isIncompleteBuild" ) , k = a ( "isJenkinsPipelineStrategy" ) , l = a ( "isNewerResource" ) , m = function ( a , b ) {
5211
- if ( ! j ( b ) ) {
5214
+ var i = { } , j = a ( "buildConfigForBuild" ) , l = a ( "isIncompleteBuild" ) , m = a ( "isJenkinsPipelineStrategy" ) , n = a ( "isNewerResource" ) , o = function ( a , b ) {
5215
+ if ( ! l ( b ) ) {
5212
5216
c . statsByConfig [ a ] || ( c . statsByConfig [ a ] = {
5213
5217
count :0 ,
5214
5218
totalDuration :0
5215
5219
} ) ;
5216
5220
var d = c . statsByConfig [ a ] ;
5217
- d . count ++ , d . totalDuration += e . getDuration ( b ) , d . avgDuration = _ . round ( d . totalDuration / d . count ) ;
5221
+ d . count ++ , d . totalDuration += g . getDuration ( b ) , d . avgDuration = _ . round ( d . totalDuration / d . count ) ;
5218
5222
}
5219
- } , n = function ( ) {
5223
+ } , p = function ( ) {
5220
5224
var a = { } , b = { } ;
5221
- c . statsByConfig = { } , _ . each ( g , function ( d ) {
5222
- if ( k ( d ) ) {
5223
- var e = h ( d ) || "" ;
5224
- c . buildConfigs [ e ] || ( c . buildConfigs [ e ] = null ) , j ( d ) ? _ . set ( a , [ e , d . metadata . name ] , d ) :l ( d , b [ e ] ) && ( b [ e ] = d ) , m ( e , d ) ;
5225
+ c . statsByConfig = { } , _ . each ( i , function ( d ) {
5226
+ if ( m ( d ) ) {
5227
+ var e = j ( d ) || "" ;
5228
+ c . buildConfigs [ e ] || ( c . buildConfigs [ e ] = null ) , l ( d ) ? _ . set ( a , [ e , d . metadata . name ] , d ) :n ( d , b [ e ] ) && ( b [ e ] = d ) , o ( e , d ) ;
5225
5229
}
5226
5230
} ) , _ . each ( b , function ( b , c ) {
5227
5231
_ . set ( a , [ c , b . metadata . name ] , b ) ;
5228
5232
} ) , c . interestingBuildsByConfig = a ;
5229
5233
} ;
5230
- i . push ( f . watch ( "builds" , d , function ( a ) {
5231
- c . buildsLoaded = ! 0 , g = a . by ( "metadata.name" ) , n ( ) ;
5232
- } ) ) , i . push ( f . watch ( "buildconfigs" , d , function ( a ) {
5233
- c . buildConfigsLoaded = ! 0 , c . buildConfigs = _ . pick ( a . by ( "metadata.name" ) , k ) , n ( ) ;
5234
+ k . push ( h . watch ( "builds" , f , function ( a ) {
5235
+ c . buildsLoaded = ! 0 , i = a . by ( "metadata.name" ) , p ( ) ;
5236
+ } ) ) ;
5237
+ var q = ! 1 ;
5238
+ k . push ( h . watch ( "buildconfigs" , f , function ( a ) {
5239
+ if ( c . buildConfigsLoaded = ! 0 , c . buildConfigs = _ . pick ( a . by ( "metadata.name" ) , m ) , _ . isEmpty ( c . buildConfigs ) && ! q ) {
5240
+ q = ! 0 ;
5241
+ var b = d . SAMPLE_PIPELINE_TEMPLATE . name , f = d . SAMPLE_PIPELINE_TEMPLATE . namespace ;
5242
+ h . get ( "templates" , b , {
5243
+ namespace :f
5244
+ } , {
5245
+ errorNotification :! 1
5246
+ } ) . then ( function ( ) {
5247
+ c . createSampleURL = e . fromTemplateURL ( c . projectName , b , f ) ;
5248
+ } ) ;
5249
+ }
5250
+ p ( ) ;
5234
5251
} ) ) , c . startBuild = function ( b ) {
5235
- e . startBuild ( b , d ) . then ( _ . noop , function ( b ) {
5252
+ g . startBuild ( b , f ) . then ( _ . noop , function ( b ) {
5236
5253
c . alerts [ "start-build" ] = {
5237
5254
type :"error" ,
5238
5255
message :"An error occurred while starting the build." ,
5239
5256
details :a ( "getErrorDetails" ) ( b )
5240
5257
} ;
5241
5258
} ) ;
5242
5259
} , c . $on ( "$destroy" , function ( ) {
5243
- f . unwatchAll ( i ) ;
5260
+ h . unwatchAll ( k ) ;
5244
5261
} ) ;
5245
5262
} ) ) ;
5246
5263
} ] ) , angular . module ( "openshiftConsole" ) . controller ( "BuildConfigController" , [ "$scope" , "$filter" , "$routeParams" , "AlertMessageService" , "APIService" , "BuildsService" , "ImagesService" , "DataService" , "LabelFilter" , "ModalsService" , "ProjectsService" , "keyValueEditorUtils" , function ( a , b , c , d , e , f , g , h , i , j , k , l ) {
0 commit comments