@@ -6243,32 +6243,44 @@ a.loaded = !0, a.error = b;
6243
6243
d . unwatchAll ( f ) ;
6244
6244
} ) ;
6245
6245
} ) ) ;
6246
- } ] ) , angular . module ( "openshiftConsole" ) . controller ( "CreateConfigMapController" , [ "$filter" , "$routeParams" , "$scope" , "$window" , "AuthorizationService" , "DataService" , "Navigate" , "ProjectsService" , function ( a , b , c , d , e , f , g , h ) {
6247
- c . alerts = { } , c . projectName = b . project , c . breadcrumbs = [ {
6246
+ } ] ) , angular . module ( "openshiftConsole" ) . controller ( "CreateConfigMapController" , [ "$filter" , "$routeParams" , "$scope" , "$window" , "AuthorizationService" , "DataService" , "Navigate" , "NotificationsService" , " ProjectsService", function ( a , b , c , d , e , f , g , h , i ) {
6247
+ c . projectName = b . project , c . breadcrumbs = [ {
6248
6248
title :c . projectName ,
6249
6249
link :"project/" + c . projectName
6250
6250
} , {
6251
6251
title :"Config Maps" ,
6252
6252
link :"project/" + c . projectName + "/browse/config-maps"
6253
6253
} , {
6254
6254
title :"Create Config Map"
6255
- } ] , h . get ( b . project ) . then ( _ . spread ( function ( h , i ) {
6256
- return c . project = h , c . breadcrumbs [ 0 ] . title = a ( "displayName" ) ( h ) , e . canI ( "configmaps" , "create" , b . project ) ? ( c . configMap = {
6255
+ } ] ;
6256
+ var j = function ( ) {
6257
+ h . hideNotification ( "create-config-map-error" ) ;
6258
+ } , k = function ( ) {
6259
+ d . history . back ( ) ;
6260
+ } ;
6261
+ c . cancel = function ( ) {
6262
+ j ( ) , k ( ) ;
6263
+ } , i . get ( b . project ) . then ( _ . spread ( function ( d , i ) {
6264
+ return c . project = d , c . breadcrumbs [ 0 ] . title = a ( "displayName" ) ( d ) , e . canI ( "configmaps" , "create" , b . project ) ? ( c . configMap = {
6257
6265
apiVersion :"v1" ,
6258
6266
kind :"ConfigMap" ,
6259
6267
metadata :{
6260
6268
namespace :b . project
6261
6269
} ,
6262
6270
data :{ }
6263
6271
} , void ( c . createConfigMap = function ( ) {
6264
- c . createConfigMapForm . $valid && ( c . disableInputs = ! 0 , f . create ( "configmaps" , null , c . configMap , i ) . then ( function ( ) {
6265
- d . history . back ( ) ;
6272
+ c . createConfigMapForm . $valid && ( j ( ) , c . disableInputs = ! 0 , f . create ( "configmaps" , null , c . configMap , i ) . then ( function ( ) {
6273
+ h . addNotification ( {
6274
+ type :"success" ,
6275
+ message :"Config map " + c . configMap . metadata . name + " successfully created."
6276
+ } ) , k ( ) ;
6266
6277
} , function ( b ) {
6267
- c . disableInputs = ! 1 , c . alerts [ "create-config-map" ] = {
6278
+ c . disableInputs = ! 1 , h . addNotification ( {
6279
+ id :"create-config-map-error" ,
6268
6280
type :"error" ,
6269
6281
message :"An error occurred creating the config map." ,
6270
6282
details :a ( "getErrorDetails" ) ( b )
6271
- } ;
6283
+ } ) ;
6272
6284
} ) ) ;
6273
6285
} ) ) :void g . toErrorPage ( "You do not have authority to create config maps in project " + b . project + "." , "access_denied" ) ;
6274
6286
} ) ) ;
@@ -6905,47 +6917,53 @@ details:b("getErrorDetails")(c)
6905
6917
} , a . $on ( "$destroy" , function ( ) {
6906
6918
h . unwatchAll ( q ) ;
6907
6919
} ) ;
6908
- } ] ) , angular . module ( "openshiftConsole" ) . controller ( "EditConfigMapController" , [ "$filter" , "$routeParams" , "$scope" , "$window" , "DataService" , "BreadcrumbsService" , "Navigate" , "ProjectsService" , function ( a , b , c , d , e , f , g , h ) {
6909
- var i = [ ] ;
6910
- c . alerts = { } , c . forms = { } , c . projectName = b . project , c . breadcrumbs = f . getBreadcrumbs ( {
6920
+ } ] ) , angular . module ( "openshiftConsole" ) . controller ( "EditConfigMapController" , [ "$filter" , "$routeParams" , "$scope" , "$window" , "DataService" , "BreadcrumbsService" , "Navigate" , "NotificationsService" , " ProjectsService", function ( a , b , c , d , e , f , g , h , i ) {
6921
+ var j = [ ] ;
6922
+ c . forms = { } , c . projectName = b . project , c . breadcrumbs = f . getBreadcrumbs ( {
6911
6923
name :b . configMap ,
6912
6924
kind :"ConfigMap" ,
6913
6925
namespace :b . project ,
6914
6926
includeProject :! 0 ,
6915
6927
subpage :"Edit Config Map"
6916
6928
} ) ;
6917
- var j = function ( a ) {
6929
+ var k = function ( a ) {
6918
6930
return _ . get ( a , "metadata.resourceVersion" ) ;
6931
+ } , l = function ( ) {
6932
+ h . hideNotification ( "edit-config-map-error" ) ;
6933
+ } , m = function ( ) {
6934
+ d . history . back ( ) ;
6919
6935
} ;
6920
- h . get ( b . project ) . then ( _ . spread ( function ( g , h ) {
6921
- e . get ( "configmaps" , b . configMap , h ) . then ( function ( a ) {
6936
+ c . cancel = function ( ) {
6937
+ l ( ) , m ( ) ;
6938
+ } , i . get ( b . project ) . then ( _ . spread ( function ( d , i ) {
6939
+ e . get ( "configmaps" , b . configMap , i ) . then ( function ( a ) {
6922
6940
c . loaded = ! 0 , c . breadcrumbs = f . getBreadcrumbs ( {
6923
6941
name :b . configMap ,
6924
6942
object :a ,
6925
6943
includeProject :! 0 ,
6926
- project :g ,
6944
+ project :d ,
6927
6945
subpage :"Edit Config Map"
6928
- } ) , c . configMap = a , i . push ( e . watchObject ( "configmaps" , b . configMap , h , function ( a , b ) {
6929
- c . resourceChanged = j ( a ) !== j ( c . configMap ) , c . resourceDeleted = "DELETED" === b ;
6946
+ } ) , c . configMap = a , j . push ( e . watchObject ( "configmaps" , b . configMap , i , function ( a , b ) {
6947
+ c . resourceChanged = k ( a ) !== k ( c . configMap ) , c . resourceDeleted = "DELETED" === b ;
6930
6948
} ) ) ;
6931
- } , function ( b ) {
6932
- c . loaded = ! 0 , c . alerts . load = {
6933
- type :"error" ,
6934
- message :"The config map details could not be loaded." ,
6935
- details :a ( "getErrorDetails" ) ( b )
6936
- } ;
6949
+ } , function ( c ) {
6950
+ g . toErrorPage ( "Could not load config map " + b . configMap + ". " + a ( "getErrorDetails" ) ( c ) ) ;
6937
6951
} ) , c . updateConfigMap = function ( ) {
6938
- c . forms . editConfigMapForm . $valid && ( c . disableInputs = ! 0 , e . update ( "configmaps" , c . configMap . metadata . name , c . configMap , h ) . then ( function ( ) {
6939
- d . history . back ( ) ;
6952
+ c . forms . editConfigMapForm . $valid && ( l ( ) , c . disableInputs = ! 0 , e . update ( "configmaps" , c . configMap . metadata . name , c . configMap , i ) . then ( function ( ) {
6953
+ h . addNotification ( {
6954
+ type :"success" ,
6955
+ message :"Config map " + c . configMap . metadata . name + " successfully updated."
6956
+ } ) , m ( ) ;
6940
6957
} , function ( b ) {
6941
- c . disableInputs = ! 1 , c . alerts [ "create-config-map" ] = {
6958
+ c . disableInputs = ! 1 , h . addNotification ( {
6959
+ id :"edit-config-map-error" ,
6942
6960
type :"error" ,
6943
6961
message :"An error occurred updating the config map." ,
6944
6962
details :a ( "getErrorDetails" ) ( b )
6945
- } ;
6963
+ } ) ;
6946
6964
} ) ) ;
6947
6965
} , c . $on ( "$destroy" , function ( ) {
6948
- e . unwatchAll ( i ) ;
6966
+ e . unwatchAll ( j ) ;
6949
6967
} ) ;
6950
6968
} ) ) ;
6951
6969
} ] ) , 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