@@ -9381,56 +9381,59 @@ scope:!1,
9381
9381
templateUrl :"views/directives/from-file.html" ,
9382
9382
controller :[ "$scope" , function ( l ) {
9383
9383
function m ( a ) {
9384
- return a . kind ? a . metadata ? a . metadata . name || a . kind . endsWith ( "List" ) ? ! a . metadata . namespace || a . metadata . namespace === l . projectName || ( l . error = {
9384
+ return ! ! a . kind || ( l . error = {
9385
+ message :"Resource is missing kind field."
9386
+ } , ! 1 ) ;
9387
+ }
9388
+ function n ( a ) {
9389
+ return ! ! l . isList || ( a . metadata ? a . metadata . name ? ! a . metadata . namespace || a . metadata . namespace === l . projectName || ( l . error = {
9385
9390
message :a . kind + " " + a . metadata . name + " can't be created in project " + a . metadata . namespace + ". Can't create resource in different projects."
9386
9391
} , ! 1 ) :( l . error = {
9387
9392
message :"Resource name is missing in metadata field."
9388
9393
} , ! 1 ) :( l . error = {
9389
9394
message :"Resource is missing metadata field."
9390
- } , ! 1 ) :( l . error = {
9391
- message :"Resource is missing kind field."
9392
- } , ! 1 ) ;
9395
+ } , ! 1 ) ) ;
9393
9396
}
9394
- function n ( ) {
9397
+ function o ( ) {
9395
9398
var a = b . open ( {
9396
9399
animation :! 0 ,
9397
9400
templateUrl :"views/modals/process-template.html" ,
9398
9401
controller :"ProcessTemplateModalController" ,
9399
9402
scope :l
9400
9403
} ) ;
9401
9404
a . result . then ( function ( ) {
9402
- l . templateOptions . add ? p ( ) :( e . setTemplate ( l . resourceList [ 0 ] ) , q ( ) ) ;
9405
+ l . templateOptions . add ? q ( ) :( e . setTemplate ( l . resourceList [ 0 ] ) , r ( ) ) ;
9403
9406
} ) ;
9404
9407
}
9405
- function o ( ) {
9408
+ function p ( ) {
9406
9409
var a = b . open ( {
9407
9410
animation :! 0 ,
9408
9411
templateUrl :"views/modals/confirm-replace.html" ,
9409
9412
controller :"ConfirmReplaceModalController" ,
9410
9413
scope :l
9411
9414
} ) ;
9412
9415
a . result . then ( function ( ) {
9413
- k . getLatestQuotaAlerts ( l . createResources , l . context ) . then ( B ) ;
9416
+ k . getLatestQuotaAlerts ( l . createResources , l . context ) . then ( C ) ;
9414
9417
} ) ;
9415
9418
}
9416
- function p ( ) {
9419
+ function q ( ) {
9417
9420
var b = l . createResources . length , c = l . updateResources . length ;
9418
9421
if ( l . resourceKind . endsWith ( "List" ) ) {
9419
9422
var d = [ ] ;
9420
- c > 0 && d . push ( u ( ) ) , b > 0 && d . push ( t ( ) ) , a . all ( d ) . then ( q ) ;
9421
- } else s ( ) ;
9423
+ c > 0 && d . push ( v ( ) ) , b > 0 && d . push ( u ( ) ) , a . all ( d ) . then ( r ) ;
9424
+ } else t ( ) ;
9422
9425
}
9423
- function q ( ) {
9426
+ function r ( ) {
9424
9427
var a ;
9425
9428
if ( "Template" === l . resourceKind && l . templateOptions . process && ! l . errorOccured ) {
9426
9429
var b = l . templateOptions . add || l . updateResources . length > 0 ? l . projectName :"" ;
9427
- a = g . createFromTemplateURL ( z , l . projectName , {
9430
+ a = g . createFromTemplateURL ( A , l . projectName , {
9428
9431
namespace :b
9429
9432
} ) ;
9430
9433
} else a = g . projectOverviewURL ( l . projectName ) ;
9431
9434
c . url ( a ) ;
9432
9435
}
9433
- function r ( a ) {
9436
+ function s ( a ) {
9434
9437
var b = j . objectToResourceGroupVersion ( a ) ;
9435
9438
return b ? j . apiInfo ( b ) ? i . get ( b , a . metadata . name , l . context , {
9436
9439
errorNotification :! 1
@@ -9445,7 +9448,7 @@ message:j.unsupportedObjectKindOrVersion(a)
9445
9448
message :j . invalidObjectKindOrVersion ( a )
9446
9449
} ) ) ;
9447
9450
}
9448
- function s ( ) {
9451
+ function t ( ) {
9449
9452
var a ;
9450
9453
_ . isEmpty ( l . createResources ) ? ( a = _ . head ( l . updateResources ) , i . update ( j . kindToResource ( a . kind ) , a . metadata . name , a , {
9451
9454
namespace :l . projectName
@@ -9456,11 +9459,11 @@ data:{
9456
9459
type :"success" ,
9457
9460
message :a . kind + " " + a . metadata . name + " was successfully updated."
9458
9461
}
9459
- } ) , q ( ) ;
9462
+ } ) , r ( ) ;
9460
9463
} , function ( b ) {
9461
9464
l . alerts [ "update" + a . metadata . name ] = {
9462
9465
type :"error" ,
9463
- message :"Unable to update the " + w ( a . kind ) + " '" + a . metadata . name + "'." ,
9466
+ message :"Unable to update the " + x ( a . kind ) + " '" + a . metadata . name + "'." ,
9464
9467
details :d ( "getErrorDetails" ) ( b )
9465
9468
} ;
9466
9469
} ) ) :( a = _ . head ( l . createResources ) , i . create ( j . kindToResource ( a . kind ) , null , a , {
@@ -9472,16 +9475,16 @@ data:{
9472
9475
type :"success" ,
9473
9476
message :a . kind + " " + a . metadata . name + " was successfully created."
9474
9477
}
9475
- } ) , q ( ) ;
9478
+ } ) , r ( ) ;
9476
9479
} , function ( b ) {
9477
9480
l . alerts [ "create" + a . metadata . name ] = {
9478
9481
type :"error" ,
9479
- message :"Unable to create the " + w ( a . kind ) + " '" + a . metadata . name + "'." ,
9482
+ message :"Unable to create the " + x ( a . kind ) + " '" + a . metadata . name + "'." ,
9480
9483
details :d ( "getErrorDetails" ) ( b )
9481
9484
} ;
9482
9485
} ) ) ;
9483
9486
}
9484
- function t ( ) {
9487
+ function u ( ) {
9485
9488
var b = {
9486
9489
started :"Creating resources in project " + l . projectName ,
9487
9490
success :"Creating resources in project " + l . projectName ,
@@ -9494,17 +9497,17 @@ var c = [], d = !1;
9494
9497
if ( a . failure . length > 0 ) d = ! 0 , l . errorOccured = ! 0 , a . failure . forEach ( function ( a ) {
9495
9498
c . push ( {
9496
9499
type :"error" ,
9497
- message :"Cannot create " + w ( a . object . kind ) + ' "' + a . object . metadata . name + '". ' ,
9500
+ message :"Cannot create " + x ( a . object . kind ) + ' "' + a . object . metadata . name + '". ' ,
9498
9501
details :a . data . message
9499
9502
} ) ;
9500
9503
} ) , a . success . forEach ( function ( a ) {
9501
9504
c . push ( {
9502
9505
type :"success" ,
9503
- message :"Created " + w ( a . kind ) + ' "' + a . metadata . name + '" successfully. '
9506
+ message :"Created " + x ( a . kind ) + ' "' + a . metadata . name + '" successfully. '
9504
9507
} ) ;
9505
9508
} ) ; else {
9506
9509
var e ;
9507
- e = l . isList ? "All items in list were created successfully." :w ( l . resourceKind ) + " " + l . resourceName + " was successfully created." , c . push ( {
9510
+ e = l . isList ? "All items in list were created successfully." :x ( l . resourceKind ) + " " + l . resourceName + " was successfully created." , c . push ( {
9508
9511
type :"success" ,
9509
9512
message :e
9510
9513
} ) ;
@@ -9516,7 +9519,7 @@ hasErrors:d
9516
9519
} ) , b . promise ;
9517
9520
} ) ;
9518
9521
}
9519
- function u ( ) {
9522
+ function v ( ) {
9520
9523
var b = {
9521
9524
started :"Updating resources in project " + l . projectName ,
9522
9525
success :"Updated resources in project " + l . projectName ,
@@ -9529,17 +9532,17 @@ var c = [], d = !1;
9529
9532
if ( a . failure . length > 0 ) d = ! 0 , l . errorOccured = ! 0 , a . failure . forEach ( function ( a ) {
9530
9533
c . push ( {
9531
9534
type :"error" ,
9532
- message :"Cannot update " + w ( a . object . kind ) + ' "' + a . object . metadata . name + '". ' ,
9535
+ message :"Cannot update " + x ( a . object . kind ) + ' "' + a . object . metadata . name + '". ' ,
9533
9536
details :a . data . message
9534
9537
} ) ;
9535
9538
} ) , a . success . forEach ( function ( a ) {
9536
9539
c . push ( {
9537
9540
type :"success" ,
9538
- message :"Updated " + w ( a . kind ) + ' "' + a . metadata . name + '" successfully. '
9541
+ message :"Updated " + x ( a . kind ) + ' "' + a . metadata . name + '" successfully. '
9539
9542
} ) ;
9540
9543
} ) ; else {
9541
9544
var e ;
9542
- e = l . isList ? "All items in list were updated successfully." :w ( l . resourceKind ) + " " + l . resourceName + " was successfully updated." , c . push ( {
9545
+ e = l . isList ? "All items in list were updated successfully." :x ( l . resourceKind ) + " " + l . resourceName + " was successfully updated." , c . push ( {
9543
9546
type :"success" ,
9544
9547
message :e
9545
9548
} ) ;
@@ -9560,27 +9563,27 @@ alerts:c
9560
9563
} ) , b . promise ;
9561
9564
} ) ;
9562
9565
}
9563
- var v , w = d ( "humanizeKind" ) ;
9566
+ var w , x = d ( "humanizeKind" ) ;
9564
9567
h . clear ( ) , l . aceLoaded = function ( a ) {
9565
- v = a . getSession ( ) , v . setOption ( "tabSize" , 2 ) , v . setOption ( "useSoftTabs" , ! 0 ) , a . setDragDelay = 0 , a . $blockScrolling = 1 / 0 ;
9568
+ w = a . getSession ( ) , w . setOption ( "tabSize" , 2 ) , w . setOption ( "useSoftTabs" , ! 0 ) , a . setDragDelay = 0 , a . $blockScrolling = 1 / 0 ;
9566
9569
} ;
9567
- var x = function ( ) {
9568
- var a = v . getAnnotations ( ) ;
9570
+ var y = function ( ) {
9571
+ var a = w . getAnnotations ( ) ;
9569
9572
l . editorErrorAnnotation = _ . some ( a , {
9570
9573
type :"error"
9571
9574
} ) ;
9572
- } , y = _ . debounce ( function ( ) {
9575
+ } , z = _ . debounce ( function ( ) {
9573
9576
try {
9574
- JSON . parse ( l . editorContent ) , v . setMode ( "ace/mode/json" ) ;
9577
+ JSON . parse ( l . editorContent ) , w . setMode ( "ace/mode/json" ) ;
9575
9578
} catch ( a ) {
9576
9579
try {
9577
- jsyaml . safeLoad ( l . editorContent ) , v . setMode ( "ace/mode/yaml" ) ;
9580
+ jsyaml . safeLoad ( l . editorContent ) , w . setMode ( "ace/mode/yaml" ) ;
9578
9581
} catch ( a ) { }
9579
9582
}
9580
- l . $apply ( x ) ;
9583
+ l . $apply ( y ) ;
9581
9584
} , 300 ) ;
9582
- l . aceChanged = y ;
9583
- var z , A = function ( a ) {
9585
+ l . aceChanged = z ;
9586
+ var A , B = function ( a ) {
9584
9587
var c = b . open ( {
9585
9588
animation :! 0 ,
9586
9589
templateUrl :"views/modals/confirm.html" ,
@@ -9597,34 +9600,34 @@ cancelButtonText:"Cancel"
9597
9600
}
9598
9601
}
9599
9602
} ) ;
9600
- c . result . then ( p ) ;
9601
- } , B = function ( a ) {
9603
+ c . result . then ( q ) ;
9604
+ } , C = function ( a ) {
9602
9605
var b = a . quotaAlerts || [ ] , c = _ . filter ( b , {
9603
9606
type :"error"
9604
9607
} ) ;
9605
- c . length ? ( l . disableInputs = ! 1 , l . alerts = b ) :b . length ? ( A ( b ) , l . disableInputs = ! 1 ) :p ( ) ;
9608
+ c . length ? ( l . disableInputs = ! 1 , l . alerts = b ) :b . length ? ( B ( b ) , l . disableInputs = ! 1 ) :q ( ) ;
9606
9609
} ;
9607
9610
l . create = function ( ) {
9608
9611
l . alerts = { } , delete l . error ;
9609
9612
try {
9610
- z = JSON . parse ( l . editorContent ) ;
9613
+ A = JSON . parse ( l . editorContent ) ;
9611
9614
} catch ( b ) {
9612
9615
try {
9613
- z = jsyaml . safeLoad ( l . editorContent ) ;
9616
+ A = jsyaml . safeLoad ( l . editorContent ) ;
9614
9617
} catch ( b ) {
9615
9618
return void ( l . error = b ) ;
9616
9619
}
9617
9620
}
9618
- if ( m ( z ) ) {
9619
- l . resourceKind = z . kind , l . resourceKind . endsWith ( "List" ) ? ( l . isList = ! 0 , l . resourceList = z . items , l . resourceName = "" ) :( l . resourceList = [ z ] , l . resourceName = z . metadata . name , "Template" === l . resourceKind && ( l . templateOptions = {
9621
+ if ( m ( A ) && ( l . resourceKind = A . kind , l . resourceKind . endsWith ( "List" ) ? l . isList = ! 0 : l . isList = ! 1 , n ( A ) ) ) {
9622
+ l . isList ? ( l . resourceList = A . items , l . resourceName = "" ) :( l . resourceList = [ A ] , l . resourceName = A . metadata . name , "Template" === l . resourceKind && ( l . templateOptions = {
9620
9623
process :! 0 ,
9621
9624
add :! 1
9622
9625
} ) ) , l . updateResources = [ ] , l . createResources = [ ] ;
9623
9626
var c = [ ] ;
9624
9627
l . errorOccured = ! 1 , _ . forEach ( l . resourceList , function ( a ) {
9625
- return m ( a ) ? void c . push ( r ( a ) ) :( l . errorOccured = ! 0 , ! 1 ) ;
9628
+ return n ( a ) ? void c . push ( s ( a ) ) :( l . errorOccured = ! 0 , ! 1 ) ;
9626
9629
} ) , a . all ( c ) . then ( function ( ) {
9627
- l . errorOccured || ( 1 === l . createResources . length && "Template" === l . resourceList [ 0 ] . kind ? n ( ) :_ . isEmpty ( l . updateResources ) ? k . getLatestQuotaAlerts ( l . createResources , l . context ) . then ( B ) :( l . updateTemplate = 1 === l . updateResources . length && "Template" === l . updateResources [ 0 ] . kind , l . updateTemplate ? n ( ) :o ( ) ) ) ;
9630
+ l . errorOccured || ( 1 === l . createResources . length && "Template" === l . resourceList [ 0 ] . kind ? o ( ) :_ . isEmpty ( l . updateResources ) ? k . getLatestQuotaAlerts ( l . createResources , l . context ) . then ( C ) :( l . updateTemplate = 1 === l . updateResources . length && "Template" === l . updateResources [ 0 ] . kind , l . updateTemplate ? o ( ) :p ( ) ) ) ;
9628
9631
} ) ;
9629
9632
}
9630
9633
} ;
0 commit comments