@@ -10013,72 +10013,72 @@ apiObject: "<",
10013
10013
createBinding : "&"
10014
10014
} ,
10015
10015
templateUrl : "views/directives/resource-service-bindings.html"
10016
- } ) , angular . module ( "openshiftConsole" ) . directive ( "sidebar" , [ "$location" , "$filter" , "$timeout" , "$rootScope" , "AuthorizationService" , "Constants" , "HTMLService" , function ( e , t , n , a , r , o , i ) {
10017
- var s = function ( e , t ) {
10016
+ } ) , angular . module ( "openshiftConsole" ) . directive ( "sidebar" , [ "$location" , "$filter" , "$timeout" , "$rootScope" , "$routeParams" , " AuthorizationService", "Constants" , "HTMLService" , function ( e , t , n , a , r , o , i , s ) {
10017
+ var c = function ( e , t ) {
10018
10018
return e . href === t || _ . some ( e . prefixes , function ( e ) {
10019
10019
return _ . startsWith ( t , e ) ;
10020
10020
} ) ;
10021
10021
} ;
10022
10022
return {
10023
10023
restrict : "E" ,
10024
10024
templateUrl : "views/_sidebar.html" ,
10025
- controller : [ "$scope" , function ( c ) {
10026
- var l ;
10027
- c . navItems = o . PROJECT_NAVIGATION , c . sidebar = { } ;
10028
- var u = function ( ) {
10029
- _ . set ( c , "sidebar.secondaryOpen" , ! 1 ) , _ . set ( a , "nav.showMobileNav" , ! 1 ) , c . activeSecondary = null , c . activePrimary = _ . find ( c . navItems , function ( t ) {
10030
- return l = e . path ( ) . replace ( "/project/" + c . projectName , "" ) , s ( t , l ) ? ( c . activeSecondary = null , ! 0 ) : _ . some ( t . secondaryNavSections , function ( e ) {
10025
+ controller : [ "$scope" , function ( l ) {
10026
+ var u ;
10027
+ l . navItems = i . PROJECT_NAVIGATION , l . sidebar = { } ;
10028
+ var d = function ( ) {
10029
+ l . projectName = r . project , _ . set ( l , "sidebar.secondaryOpen" , ! 1 ) , _ . set ( a , "nav.showMobileNav" , ! 1 ) , l . activeSecondary = null , l . activePrimary = _ . find ( l . navItems , function ( t ) {
10030
+ return u = e . path ( ) . replace ( "/project/" + l . projectName , "" ) , c ( t , u ) ? ( l . activeSecondary = null , ! 0 ) : _ . some ( t . secondaryNavSections , function ( e ) {
10031
10031
var t = _ . find ( e . items , function ( e ) {
10032
- return s ( e , l ) ;
10032
+ return c ( e , u ) ;
10033
10033
} ) ;
10034
- return ! ! t && ( c . activeSecondary = t , ! 0 ) ;
10034
+ return ! ! t && ( l . activeSecondary = t , ! 0 ) ;
10035
10035
} ) ;
10036
10036
} ) ;
10037
10037
} ;
10038
- u ( ) , c . $on ( "$routeChangeSuccess" , u ) ;
10039
- var d = function ( ) {
10040
- _ . each ( c . navItems , function ( e ) {
10038
+ d ( ) , l . $on ( "$routeChangeSuccess" , d ) ;
10039
+ var m = function ( ) {
10040
+ _ . each ( l . navItems , function ( e ) {
10041
10041
e . isHover = ! 1 ;
10042
10042
} ) ;
10043
10043
} ;
10044
- c . navURL = function ( e ) {
10045
- return e ? t ( "isAbsoluteURL" ) ( e ) ? e : "project/" + c . projectName + e : "" ;
10046
- } , c . show = function ( e ) {
10047
- return ! ( e . isValid && ! e . isValid ( ) ) && ( ! e . canI || r . canI ( {
10044
+ l . navURL = function ( e ) {
10045
+ return e ? t ( "isAbsoluteURL" ) ( e ) ? e : "project/" + l . projectName + e : "" ;
10046
+ } , l . show = function ( e ) {
10047
+ return ! ( e . isValid && ! e . isValid ( ) ) && ( ! e . canI || o . canI ( {
10048
10048
resource : e . canI . resource ,
10049
10049
group : e . canI . group
10050
- } , e . canI . verb , c . projectName ) ) ;
10051
- } , c . itemClicked = function ( e ) {
10052
- if ( e . href ) return c . nav . showMobileNav = ! 1 , void ( c . sidebar . secondaryOpen = ! 1 ) ;
10053
- d ( ) , e . isHover = ! 0 , e . mobileSecondary = c . isMobile , c . sidebar . showMobileSecondary = c . isMobile , c . sidebar . secondaryOpen = ! 0 ;
10054
- } , c . onMouseEnter = function ( e ) {
10050
+ } , e . canI . verb , l . projectName ) ) ;
10051
+ } , l . itemClicked = function ( e ) {
10052
+ if ( e . href ) return l . nav . showMobileNav = ! 1 , void ( l . sidebar . secondaryOpen = ! 1 ) ;
10053
+ m ( ) , e . isHover = ! 0 , e . mobileSecondary = l . isMobile , l . sidebar . showMobileSecondary = l . isMobile , l . sidebar . secondaryOpen = ! 0 ;
10054
+ } , l . onMouseEnter = function ( e ) {
10055
10055
_ . isEmpty ( e . secondaryNavSections ) || ( e . mouseLeaveTimeout && ( n . cancel ( e . mouseLeaveTimeout ) , e . mouseLeaveTimeout = null ) , e . mouseEnterTimeout = n ( function ( ) {
10056
- e . isHover = ! 0 , e . mouseEnterTimeout = null , c . sidebar . secondaryOpen = ! 0 ;
10056
+ e . isHover = ! 0 , e . mouseEnterTimeout = null , l . sidebar . secondaryOpen = ! 0 ;
10057
10057
} , 300 ) ) ;
10058
- } , c . onMouseLeave = function ( e ) {
10058
+ } , l . onMouseLeave = function ( e ) {
10059
10059
_ . isEmpty ( e . secondaryNavSections ) || ( e . mouseEnterTimeout && ( n . cancel ( e . mouseEnterTimeout ) , e . mouseEnterTimeout = null ) , e . mouseLeaveTimeout = n ( function ( ) {
10060
- e . isHover = ! 1 , e . mouseLeaveTimeout = null , c . sidebar . secondaryOpen = _ . some ( c . navItems , function ( e ) {
10060
+ e . isHover = ! 1 , e . mouseLeaveTimeout = null , l . sidebar . secondaryOpen = _ . some ( l . navItems , function ( e ) {
10061
10061
return e . isHover && ! _ . isEmpty ( e . secondaryNavSections ) ;
10062
10062
} ) ;
10063
10063
} , 500 ) ) ;
10064
- } , c . closeNav = function ( ) {
10065
- d ( ) , c . nav . showMobileNav = ! 1 , c . sidebar . secondaryOpen = ! 1 ;
10066
- } , c . collapseMobileSecondary = function ( e , t ) {
10064
+ } , l . closeNav = function ( ) {
10065
+ m ( ) , l . nav . showMobileNav = ! 1 , l . sidebar . secondaryOpen = ! 1 ;
10066
+ } , l . collapseMobileSecondary = function ( e , t ) {
10067
10067
e . mobileSecondary = ! 1 , t . stopPropagation ( ) ;
10068
10068
} ;
10069
- var m = function ( ) {
10070
- return i . isWindowBelowBreakpoint ( i . WINDOW_SIZE_SM ) ;
10069
+ var p = function ( ) {
10070
+ return s . isWindowBelowBreakpoint ( s . WINDOW_SIZE_SM ) ;
10071
10071
} ;
10072
- c . isMobile = m ( ) ;
10073
- var p = _ . throttle ( function ( ) {
10074
- var e = m ( ) ;
10075
- e !== c . isMobile && c . $evalAsync ( function ( ) {
10076
- c . isMobile = e , e || ( _ . set ( a , "nav.showMobileNav" , ! 1 ) , _ . each ( c . navItems , function ( e ) {
10072
+ l . isMobile = p ( ) ;
10073
+ var f = _ . throttle ( function ( ) {
10074
+ var e = p ( ) ;
10075
+ e !== l . isMobile && l . $evalAsync ( function ( ) {
10076
+ l . isMobile = e , e || ( _ . set ( a , "nav.showMobileNav" , ! 1 ) , _ . each ( l . navItems , function ( e ) {
10077
10077
e . mobileSecondary = ! 1 ;
10078
10078
} ) ) ;
10079
10079
} ) ;
10080
10080
} , 50 ) ;
10081
- $ ( window ) . on ( "resize.verticalnav" , p ) , c . $on ( "$destroy" , function ( ) {
10081
+ $ ( window ) . on ( "resize.verticalnav" , f ) , l . $on ( "$destroy" , function ( ) {
10082
10082
$ ( window ) . off ( ".verticalnav" ) ;
10083
10083
} ) ;
10084
10084
} ]
@@ -10117,7 +10117,7 @@ _.set(r, "ordering.panelName", "");
10117
10117
_ . set ( r , "ordering.panelName" , e ) ;
10118
10118
} , r . catalogLandingPageEnabled = _ . get ( i , "ENABLE_TECH_PREVIEW_FEATURE.service_catalog_landing_page" ) ;
10119
10119
var v = p . find ( ".selectpicker" ) , y = [ ] , b = function ( ) {
10120
- var t = r . projectName ;
10120
+ var t = r . currentProjectName ;
10121
10121
if ( t ) {
10122
10122
var n = function ( e , n ) {
10123
10123
var a = $ ( "<option>" ) . attr ( "value" , e . metadata . name ) . attr ( "selected" , e . metadata . name === t ) ;
@@ -10134,10 +10134,14 @@ l = e.by("metadata.name");
10134
10134
} ;
10135
10135
r . $on ( "$routeChangeSuccess" , function ( ) {
10136
10136
var e = a . project ;
10137
- r . projectName !== e && ( r . projectName = e , r . chromeless = "chromeless" === a . view , e && ! r . chromeless ? ( _ . set ( n , "view.hasProject" , ! 0 ) , r . canIAddToProject = ! 1 , o . getProjectRules ( e ) . then ( function ( ) {
10138
- r . projectName === e && ( r . canIAddToProject = o . canIAddToProject ( e ) ) ;
10137
+ r . currentProjectName !== e && ( r . currentProjectName = e , r . chromeless = "chromeless" === a . view , e && ! r . chromeless ? ( _ . set ( n , "view.hasProject" , ! 0 ) , r . canIAddToProject = ! 1 , o . getProjectRules ( e ) . then ( function ( ) {
10138
+ r . currentProjectName === e && ( r . canIAddToProject = o . canIAddToProject ( e ) ) ;
10139
10139
} ) , C ( ) . then ( function ( ) {
10140
- r . projectName = e , r . currentProject = _ . get ( l , [ e ] ) , b ( ) ;
10140
+ r . currentProjectName && l && ( l [ r . currentProjectName ] || ( l [ r . currentProjectName ] = {
10141
+ metadata : {
10142
+ name : r . currentProjectName
10143
+ }
10144
+ } ) , r . currentProject = l [ r . currentProjectName ] , b ( ) ) ;
10141
10145
} ) ) : _ . set ( n , "view.hasProject" , ! 1 ) ) ;
10142
10146
} ) , v . selectpicker ( {
10143
10147
iconBase : "fa" ,
0 commit comments