@@ -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" , " AlertMessageService", "BuildsService" , "DataService" , "Logger" , "ProjectsService" , function ( a , b , c , d , e , f , g , h , i ) {
5208
+ c . projectName = b . project , c . alerts = c . alerts || { } , c . buildConfigs = { } , e . 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
+ } ) , e . clearAlerts ( ) ;
5211
+ var j = [ ] ;
5212
+ i . get ( b . project ) . then ( _ . spread ( function ( b , e ) {
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 h = { } , i = a ( "buildConfigForBuild" ) , k = a ( "isIncompleteBuild" ) , l = a ( "isJenkinsPipelineStrategy" ) , m = a ( "isNewerResource" ) , n = function ( a , b ) {
5215
+ if ( ! k ( 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 += f . getDuration ( b ) , d . avgDuration = _ . round ( d . totalDuration / d . count ) ;
5218
5222
}
5219
- } , n = function ( ) {
5223
+ } , o = 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 ( h , function ( d ) {
5226
+ if ( l ( d ) ) {
5227
+ var e = i ( d ) || "" ;
5228
+ c . buildConfigs [ e ] || ( c . buildConfigs [ e ] = null ) , k ( d ) ? _ . set ( a , [ e , d . metadata . name ] , d ) :m ( d , b [ e ] ) && ( b [ e ] = d ) , n ( 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
+ j . push ( g . watch ( "builds" , e , function ( a ) {
5235
+ c . buildsLoaded = ! 0 , h = a . by ( "metadata.name" ) , o ( ) ;
5236
+ } ) ) ;
5237
+ var p = ! 1 ;
5238
+ j . push ( g . watch ( "buildconfigs" , e , function ( a ) {
5239
+ if ( c . buildConfigsLoaded = ! 0 , c . buildConfigs = _ . pick ( a . by ( "metadata.name" ) , l ) , _ . isEmpty ( c . buildConfigs ) && ! p ) {
5240
+ p = ! 0 ;
5241
+ var b = d . SAMPLE_PIPELINE_TEMPLATE . name , e = d . SAMPLE_PIPELINE_TEMPLATE . namespace ;
5242
+ g . get ( "templates" , b , {
5243
+ namespace :e
5244
+ } , {
5245
+ errorNotification :! 1
5246
+ } ) . then ( function ( ) {
5247
+ c . deploySampleURL = "project/" + c . projectName + "/create/fromtemplate?name=" + encodeURIComponent ( b ) + "&namespace=" + encodeURIComponent ( e ) ;
5248
+ } ) ;
5249
+ }
5250
+ o ( ) ;
5234
5251
} ) ) , c . startBuild = function ( b ) {
5235
- e . startBuild ( b , d ) . then ( _ . noop , function ( b ) {
5252
+ f . startBuild ( b , e ) . 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
+ g . unwatchAll ( j ) ;
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