@@ -6270,32 +6270,44 @@ a.loaded = !0, a.error = b;
6270
6270
e . unwatchAll ( g ) ;
6271
6271
} ) ;
6272
6272
} ) ) ;
6273
- } ] ) , angular . module ( "openshiftConsole" ) . controller ( "CreateConfigMapController" , [ "$filter" , "$routeParams" , "$scope" , "$window" , "AuthorizationService" , "DataService" , "Navigate" , "ProjectsService" , function ( a , b , c , d , e , f , g , h ) {
6274
- c . alerts = { } , c . projectName = b . project , c . breadcrumbs = [ {
6273
+ } ] ) , angular . module ( "openshiftConsole" ) . controller ( "CreateConfigMapController" , [ "$filter" , "$routeParams" , "$scope" , "$window" , "AuthorizationService" , "DataService" , "Navigate" , "NotificationsService" , " ProjectsService", function ( a , b , c , d , e , f , g , h , i ) {
6274
+ c . projectName = b . project , c . breadcrumbs = [ {
6275
6275
title :c . projectName ,
6276
6276
link :"project/" + c . projectName
6277
6277
} , {
6278
6278
title :"Config Maps" ,
6279
6279
link :"project/" + c . projectName + "/browse/config-maps"
6280
6280
} , {
6281
6281
title :"Create Config Map"
6282
- } ] , h . get ( b . project ) . then ( _ . spread ( function ( h , i ) {
6283
- return c . project = h , c . breadcrumbs [ 0 ] . title = a ( "displayName" ) ( h ) , e . canI ( "configmaps" , "create" , b . project ) ? ( c . configMap = {
6282
+ } ] ;
6283
+ var j = function ( ) {
6284
+ h . hideNotification ( "create-config-map-error" ) ;
6285
+ } , k = function ( ) {
6286
+ d . history . back ( ) ;
6287
+ } ;
6288
+ c . cancel = function ( ) {
6289
+ j ( ) , k ( ) ;
6290
+ } , i . get ( b . project ) . then ( _ . spread ( function ( d , i ) {
6291
+ return c . project = d , c . breadcrumbs [ 0 ] . title = a ( "displayName" ) ( d ) , e . canI ( "configmaps" , "create" , b . project ) ? ( c . configMap = {
6284
6292
apiVersion :"v1" ,
6285
6293
kind :"ConfigMap" ,
6286
6294
metadata :{
6287
6295
namespace :b . project
6288
6296
} ,
6289
6297
data :{ }
6290
6298
} , void ( c . createConfigMap = function ( ) {
6291
- c . createConfigMapForm . $valid && ( c . disableInputs = ! 0 , f . create ( "configmaps" , null , c . configMap , i ) . then ( function ( ) {
6292
- d . history . back ( ) ;
6299
+ c . createConfigMapForm . $valid && ( j ( ) , c . disableInputs = ! 0 , f . create ( "configmaps" , null , c . configMap , i ) . then ( function ( ) {
6300
+ h . addNotification ( {
6301
+ type :"success" ,
6302
+ message :"Config map " + c . configMap . metadata . name + " successfully created."
6303
+ } ) , k ( ) ;
6293
6304
} , function ( b ) {
6294
- c . disableInputs = ! 1 , c . alerts [ "create-config-map" ] = {
6305
+ c . disableInputs = ! 1 , h . addNotification ( {
6306
+ id :"create-config-map-error" ,
6295
6307
type :"error" ,
6296
6308
message :"An error occurred creating the config map." ,
6297
6309
details :a ( "getErrorDetails" ) ( b )
6298
- } ;
6310
+ } ) ;
6299
6311
} ) ) ;
6300
6312
} ) ) :void g . toErrorPage ( "You do not have authority to create config maps in project " + b . project + "." , "access_denied" ) ;
6301
6313
} ) ) ;
@@ -6940,47 +6952,53 @@ details:b("getErrorDetails")(c)
6940
6952
} , a . $on ( "$destroy" , function ( ) {
6941
6953
h . unwatchAll ( q ) ;
6942
6954
} ) ;
6943
- } ] ) , angular . module ( "openshiftConsole" ) . controller ( "EditConfigMapController" , [ "$filter" , "$routeParams" , "$scope" , "$window" , "DataService" , "BreadcrumbsService" , "Navigate" , "ProjectsService" , function ( a , b , c , d , e , f , g , h ) {
6944
- var i = [ ] ;
6945
- c . alerts = { } , c . forms = { } , c . projectName = b . project , c . breadcrumbs = f . getBreadcrumbs ( {
6955
+ } ] ) , angular . module ( "openshiftConsole" ) . controller ( "EditConfigMapController" , [ "$filter" , "$routeParams" , "$scope" , "$window" , "DataService" , "BreadcrumbsService" , "Navigate" , "NotificationsService" , " ProjectsService", function ( a , b , c , d , e , f , g , h , i ) {
6956
+ var j = [ ] ;
6957
+ c . forms = { } , c . projectName = b . project , c . breadcrumbs = f . getBreadcrumbs ( {
6946
6958
name :b . configMap ,
6947
6959
kind :"ConfigMap" ,
6948
6960
namespace :b . project ,
6949
6961
includeProject :! 0 ,
6950
6962
subpage :"Edit Config Map"
6951
6963
} ) ;
6952
- var j = function ( a ) {
6964
+ var k = function ( a ) {
6953
6965
return _ . get ( a , "metadata.resourceVersion" ) ;
6966
+ } , l = function ( ) {
6967
+ h . hideNotification ( "edit-config-map-error" ) ;
6968
+ } , m = function ( ) {
6969
+ d . history . back ( ) ;
6954
6970
} ;
6955
- h . get ( b . project ) . then ( _ . spread ( function ( g , h ) {
6956
- e . get ( "configmaps" , b . configMap , h ) . then ( function ( a ) {
6971
+ c . cancel = function ( ) {
6972
+ l ( ) , m ( ) ;
6973
+ } , i . get ( b . project ) . then ( _ . spread ( function ( d , i ) {
6974
+ e . get ( "configmaps" , b . configMap , i ) . then ( function ( a ) {
6957
6975
c . loaded = ! 0 , c . breadcrumbs = f . getBreadcrumbs ( {
6958
6976
name :b . configMap ,
6959
6977
object :a ,
6960
6978
includeProject :! 0 ,
6961
- project :g ,
6979
+ project :d ,
6962
6980
subpage :"Edit Config Map"
6963
- } ) , c . configMap = a , i . push ( e . watchObject ( "configmaps" , b . configMap , h , function ( a , b ) {
6964
- c . resourceChanged = j ( a ) !== j ( c . configMap ) , c . resourceDeleted = "DELETED" === b ;
6981
+ } ) , c . configMap = a , j . push ( e . watchObject ( "configmaps" , b . configMap , i , function ( a , b ) {
6982
+ c . resourceChanged = k ( a ) !== k ( c . configMap ) , c . resourceDeleted = "DELETED" === b ;
6965
6983
} ) ) ;
6966
- } , function ( b ) {
6967
- c . loaded = ! 0 , c . alerts . load = {
6968
- type :"error" ,
6969
- message :"The config map details could not be loaded." ,
6970
- details :a ( "getErrorDetails" ) ( b )
6971
- } ;
6984
+ } , function ( c ) {
6985
+ g . toErrorPage ( "Could not load config map " + b . configMap + ". " + a ( "getErrorDetails" ) ( c ) ) ;
6972
6986
} ) , c . updateConfigMap = function ( ) {
6973
- c . forms . editConfigMapForm . $valid && ( c . disableInputs = ! 0 , e . update ( "configmaps" , c . configMap . metadata . name , c . configMap , h ) . then ( function ( ) {
6974
- d . history . back ( ) ;
6987
+ c . forms . editConfigMapForm . $valid && ( l ( ) , c . disableInputs = ! 0 , e . update ( "configmaps" , c . configMap . metadata . name , c . configMap , i ) . then ( function ( ) {
6988
+ h . addNotification ( {
6989
+ type :"success" ,
6990
+ message :"Config map " + c . configMap . metadata . name + " successfully updated."
6991
+ } ) , m ( ) ;
6975
6992
} , function ( b ) {
6976
- c . disableInputs = ! 1 , c . alerts [ "create-config-map" ] = {
6993
+ c . disableInputs = ! 1 , h . addNotification ( {
6994
+ id :"edit-config-map-error" ,
6977
6995
type :"error" ,
6978
6996
message :"An error occurred updating the config map." ,
6979
6997
details :a ( "getErrorDetails" ) ( b )
6980
- } ;
6998
+ } ) ;
6981
6999
} ) ) ;
6982
7000
} , c . $on ( "$destroy" , function ( ) {
6983
- e . unwatchAll ( i ) ;
7001
+ e . unwatchAll ( j ) ;
6984
7002
} ) ;
6985
7003
} ) ) ;
6986
7004
} ] ) , angular . module ( "openshiftConsole" ) . controller ( "EditDeploymentConfigController" , [ "$scope" , "$filter" , "$location" , "$routeParams" , "$uibModal" , "$window" , "AuthorizationService" , "BreadcrumbsService" , "DataService" , "EnvironmentService" , "Navigate" , "NotificationsService" , "ProjectsService" , "SecretsService" , "keyValueEditorUtils" , function ( a , b , c , d , e , f , g , h , i , j , k , l , m , n , o ) {
0 commit comments