@@ -10653,25 +10653,30 @@ alerts:"="
10653
10653
templateUrl:"views/_overview-deployment.html"
10654
10654
};
10655
10655
}), angular.module("openshiftConsole").directive("sidebar", [ "$location", "$filter", "Constants", function(a, b, c) {
10656
- var d = function(a, b) {
10656
+ var d = b("canI"), e = function(a, b) {
10657
10657
return a.href === b || _.some(a.prefixes, function(a) {
10658
10658
return _.startsWith(b, a);
10659
10659
});
10660
10660
};
10661
10661
return {
10662
10662
restrict:"E",
10663
10663
templateUrl:"views/_sidebar.html",
10664
- controller:[ "$scope", function(e ) {
10665
- var f = a.path().replace("/project/" + e .projectName, "");
10666
- e .activeSecondary, e .navItems = c.PROJECT_NAVIGATION, e .activePrimary = _.find(e .navItems, function(a) {
10667
- return d (a, f ) ? (e .activeSecondary = null, !0) :_.some(a.secondaryNavSections, function(a) {
10664
+ controller:[ "$scope", function(f ) {
10665
+ var g = a.path().replace("/project/" + f .projectName, "");
10666
+ f .activeSecondary, f .navItems = c.PROJECT_NAVIGATION, f .activePrimary = _.find(f .navItems, function(a) {
10667
+ return e (a, g ) ? (f .activeSecondary = null, !0) :_.some(a.secondaryNavSections, function(a) {
10668
10668
var b = _.find(a.items, function(a) {
10669
- return d (a, f );
10669
+ return e (a, g );
10670
10670
});
10671
- return !!b && (e .activeSecondary = b, !0);
10671
+ return !!b && (f .activeSecondary = b, !0);
10672
10672
});
10673
- }), e.navURL = function(a) {
10674
- return a ? b("isAbsoluteURL")(a) ? a :"project/" + e.projectName + a :"";
10673
+ }), f.navURL = function(a) {
10674
+ return a ? b("isAbsoluteURL")(a) ? a :"project/" + f.projectName + a :"";
10675
+ }, f.show = function(a) {
10676
+ var b = !a.isValid || a.isValid();
10677
+ if (!b) return !1;
10678
+ var c = !a.canI || d(a.canI.resource, a.canI.verb, a.canI.group);
10679
+ return c;
10675
10680
};
10676
10681
} ]
10677
10682
};
@@ -13592,126 +13597,6 @@ return function(c, d) {
13592
13597
var e = a(c), f = c.metadata.name;
13593
13598
return e !== f && b(d)[e] > 1 ? e + " (" + f + ")" :e;
13594
13599
};
13595
- } ]).filter("canI", [ "AuthorizationService", function(a) {
13596
- return function(b, c, d) {
13597
- return a.canI(b, c, d);
13598
- };
13599
- } ]).filter("canIAddToProject", [ "AuthorizationService", function(a) {
13600
- return function(b) {
13601
- return a.canIAddToProject(b);
13602
- };
13603
- } ]).filter("canIDoAny", [ "canIFilter", function(a) {
13604
- var b = {
13605
- buildConfigs:[ {
13606
- group:"",
13607
- resource:"buildconfigs",
13608
- verbs:[ "delete", "update" ]
13609
- }, {
13610
- group:"",
13611
- resource:"buildconfigs/instantiate",
13612
- verbs:[ "create" ]
13613
- } ],
13614
- builds:[ {
13615
- group:"",
13616
- resource:"builds/clone",
13617
- verbs:[ "create" ]
13618
- }, {
13619
- group:"",
13620
- resource:"builds",
13621
- verbs:[ "delete", "update" ]
13622
- } ],
13623
- deployments:[ {
13624
- group:"extensions",
13625
- resource:"horizontalpodautoscalers",
13626
- verbs:[ "create", "update" ]
13627
- }, {
13628
- group:"extensions",
13629
- resource:"deployments",
13630
- verbs:[ "create", "update" ]
13631
- } ],
13632
- deploymentConfigs:[ {
13633
- group:"extensions",
13634
- resource:"horizontalpodautoscalers",
13635
- verbs:[ "create", "update" ]
13636
- }, {
13637
- group:"",
13638
- resource:"deploymentconfigs",
13639
- verbs:[ "create", "update" ]
13640
- } ],
13641
- horizontalPodAutoscalers:[ {
13642
- group:"extensions",
13643
- resource:"horizontalpodautoscalers",
13644
- verbs:[ "update", "delete" ]
13645
- } ],
13646
- imageStreams:[ {
13647
- group:"",
13648
- resource:"imagestreams",
13649
- verbs:[ "update", "delete" ]
13650
- } ],
13651
- persistentVolumeClaims:[ {
13652
- group:"",
13653
- resource:"persistentvolumeclaims",
13654
- verbs:[ "update", "delete" ]
13655
- } ],
13656
- pods:[ {
13657
- group:"",
13658
- resource:"pods",
13659
- verbs:[ "update", "delete" ]
13660
- }, {
13661
- group:"",
13662
- resource:"deploymentconfigs",
13663
- verbs:[ "update" ]
13664
- } ],
13665
- replicaSets:[ {
13666
- group:"extensions",
13667
- resource:"horizontalpodautoscalers",
13668
- verbs:[ "create", "update" ]
13669
- }, {
13670
- group:"extensions",
13671
- resource:"replicasets",
13672
- verbs:[ "update", "delete" ]
13673
- } ],
13674
- replicationControllers:[ {
13675
- group:"",
13676
- resource:"replicationcontrollers",
13677
- verbs:[ "update", "delete" ]
13678
- } ],
13679
- routes:[ {
13680
- group:"",
13681
- resource:"routes",
13682
- verbs:[ "update", "delete" ]
13683
- } ],
13684
- services:[ {
13685
- group:"",
13686
- resource:"services",
13687
- verbs:[ "update", "create", "delete" ]
13688
- } ],
13689
- secrets:[ {
13690
- group:"",
13691
- resource:"secrets",
13692
- verbs:[ "update", "delete" ]
13693
- } ],
13694
- projects:[ {
13695
- group:"",
13696
- resource:"projects",
13697
- verbs:[ "delete", "update" ]
13698
- } ]
13699
- };
13700
- return function(c) {
13701
- return _.some(b[c], function(b) {
13702
- return _.some(b.verbs, function(c) {
13703
- return a({
13704
- resource:b.resource,
13705
- group:b.group
13706
- }, c);
13707
- });
13708
- });
13709
- };
13710
- } ]).filter("canIScale", [ "canIFilter", "hasDeploymentConfigFilter", "DeploymentsService", function(a, b, c) {
13711
- return function(b) {
13712
- var d = c.getScaleResource(b);
13713
- return a(d, "update");
13714
- };
13715
13600
} ]).filter("tags", [ "annotationFilter", function(a) {
13716
13601
return function(b, c) {
13717
13602
c = c || "tags";
@@ -14357,6 +14242,126 @@ if (!b) return "";
14357
14242
var c = a(b, "deployment.kubernetes.io/revision");
14358
14243
return c ? "#" + c :"Unknown";
14359
14244
};
14245
+ } ]), angular.module("openshiftConsole").filter("canI", [ "AuthorizationService", function(a) {
14246
+ return function(b, c, d) {
14247
+ return a.canI(b, c, d);
14248
+ };
14249
+ } ]).filter("canIAddToProject", [ "AuthorizationService", function(a) {
14250
+ return function(b) {
14251
+ return a.canIAddToProject(b);
14252
+ };
14253
+ } ]).filter("canIDoAny", [ "canIFilter", function(a) {
14254
+ var b = {
14255
+ buildConfigs:[ {
14256
+ group:"",
14257
+ resource:"buildconfigs",
14258
+ verbs:[ "delete", "update" ]
14259
+ }, {
14260
+ group:"",
14261
+ resource:"buildconfigs/instantiate",
14262
+ verbs:[ "create" ]
14263
+ } ],
14264
+ builds:[ {
14265
+ group:"",
14266
+ resource:"builds/clone",
14267
+ verbs:[ "create" ]
14268
+ }, {
14269
+ group:"",
14270
+ resource:"builds",
14271
+ verbs:[ "delete", "update" ]
14272
+ } ],
14273
+ deployments:[ {
14274
+ group:"extensions",
14275
+ resource:"horizontalpodautoscalers",
14276
+ verbs:[ "create", "update" ]
14277
+ }, {
14278
+ group:"extensions",
14279
+ resource:"deployments",
14280
+ verbs:[ "create", "update" ]
14281
+ } ],
14282
+ deploymentConfigs:[ {
14283
+ group:"extensions",
14284
+ resource:"horizontalpodautoscalers",
14285
+ verbs:[ "create", "update" ]
14286
+ }, {
14287
+ group:"",
14288
+ resource:"deploymentconfigs",
14289
+ verbs:[ "create", "update" ]
14290
+ } ],
14291
+ horizontalPodAutoscalers:[ {
14292
+ group:"extensions",
14293
+ resource:"horizontalpodautoscalers",
14294
+ verbs:[ "update", "delete" ]
14295
+ } ],
14296
+ imageStreams:[ {
14297
+ group:"",
14298
+ resource:"imagestreams",
14299
+ verbs:[ "update", "delete" ]
14300
+ } ],
14301
+ persistentVolumeClaims:[ {
14302
+ group:"",
14303
+ resource:"persistentvolumeclaims",
14304
+ verbs:[ "update", "delete" ]
14305
+ } ],
14306
+ pods:[ {
14307
+ group:"",
14308
+ resource:"pods",
14309
+ verbs:[ "update", "delete" ]
14310
+ }, {
14311
+ group:"",
14312
+ resource:"deploymentconfigs",
14313
+ verbs:[ "update" ]
14314
+ } ],
14315
+ replicaSets:[ {
14316
+ group:"extensions",
14317
+ resource:"horizontalpodautoscalers",
14318
+ verbs:[ "create", "update" ]
14319
+ }, {
14320
+ group:"extensions",
14321
+ resource:"replicasets",
14322
+ verbs:[ "update", "delete" ]
14323
+ } ],
14324
+ replicationControllers:[ {
14325
+ group:"",
14326
+ resource:"replicationcontrollers",
14327
+ verbs:[ "update", "delete" ]
14328
+ } ],
14329
+ routes:[ {
14330
+ group:"",
14331
+ resource:"routes",
14332
+ verbs:[ "update", "delete" ]
14333
+ } ],
14334
+ services:[ {
14335
+ group:"",
14336
+ resource:"services",
14337
+ verbs:[ "update", "create", "delete" ]
14338
+ } ],
14339
+ secrets:[ {
14340
+ group:"",
14341
+ resource:"secrets",
14342
+ verbs:[ "update", "delete" ]
14343
+ } ],
14344
+ projects:[ {
14345
+ group:"",
14346
+ resource:"projects",
14347
+ verbs:[ "delete", "update" ]
14348
+ } ]
14349
+ };
14350
+ return function(c) {
14351
+ return _.some(b[c], function(b) {
14352
+ return _.some(b.verbs, function(c) {
14353
+ return a({
14354
+ resource:b.resource,
14355
+ group:b.group
14356
+ }, c);
14357
+ });
14358
+ });
14359
+ };
14360
+ } ]).filter("canIScale", [ "canIFilter", "hasDeploymentConfigFilter", "DeploymentsService", function(a, b, c) {
14361
+ return function(b) {
14362
+ var d = c.getScaleResource(b);
14363
+ return a(d, "update");
14364
+ };
14360
14365
} ]), angular.module("openshiftConsole").filter("underscore", function() {
14361
14366
return function(a) {
14362
14367
return a.replace(/\./g, "_");
@@ -15461,7 +15466,7 @@ var _scriptsTemplatesJs = []byte(`angular.module('openshiftConsoleTemplates', []
15461
15466
$templateCache.put('views/_sidebar.html',
15462
15467
"<nav class=\"navbar navbar-sidebar\">\n" +
15463
15468
"<ul class=\"nav nav-sidenav-primary\">\n" +
15464
- "<li ng-repeat=\"primaryItem in navItems\" ng-class=\"{ active: primaryItem === activePrimary }\" ng-if=\"!primaryItem.isValid || primaryItem.isValid( )\">\n" +
15469
+ "<li ng-repeat=\"primaryItem in navItems\" ng-class=\"{ active: primaryItem === activePrimary }\" ng-if=\"show(primaryItem )\">\n" +
15465
15470
"<a ng-if=\"primaryItem.href\" ng-href=\"{{navURL(primaryItem.href)}}\">\n" +
15466
15471
"<span class=\"{{primaryItem.iconClass}}\"></span> {{primaryItem.label}}\n" +
15467
15472
"</a>\n" +
@@ -15473,7 +15478,7 @@ var _scriptsTemplatesJs = []byte(`angular.module('openshiftConsoleTemplates', []
15473
15478
"<li ng-repeat-start=\"secondarySection in primaryItem.secondaryNavSections\" ng-if=\"secondarySection.header\" class=\"dropdown-header\">\n" +
15474
15479
"{{secondarySection.header}}\n" +
15475
15480
"</li>\n" +
15476
- "<li ng-repeat=\"secondaryItem in secondarySection.items\" ng-class=\"{ active: secondaryItem === activeSecondary }\" ng-if=\"!secondaryItem.isValid || secondaryItem.isValid( )\">\n" +
15481
+ "<li ng-repeat=\"secondaryItem in secondarySection.items\" ng-class=\"{ active: secondaryItem === activeSecondary }\" ng-if=\"show(secondaryItem )\">\n" +
15477
15482
"<a ng-href=\"{{navURL(secondaryItem.href)}}\">{{secondaryItem.label}}</a>\n" +
15478
15483
"</li>\n" +
15479
15484
"<li ng-repeat-end style=\"display:none\"></li>\n" +
@@ -15484,7 +15489,7 @@ var _scriptsTemplatesJs = []byte(`angular.module('openshiftConsoleTemplates', []
15484
15489
"<li ng-repeat-start=\"secondarySection in primaryItem.secondaryNavSections\" ng-if=\"secondarySection.header\" class=\"dropdown-header\">\n" +
15485
15490
"{{secondarySection.header}}\n" +
15486
15491
"</li>\n" +
15487
- "<li ng-repeat=\"secondaryItem in secondarySection.items\" ng-class=\"{ active: secondaryItem === activeSecondary }\" ng-if=\"!secondaryItem.isValid || secondaryItem.isValid( )\">\n" +
15492
+ "<li ng-repeat=\"secondaryItem in secondarySection.items\" ng-class=\"{ active: secondaryItem === activeSecondary }\" ng-if=\"show(secondaryItem )\">\n" +
15488
15493
"<a ng-href=\"{{navURL(secondaryItem.href)}}\">{{secondaryItem.label}}</a>\n" +
15489
15494
"</li>\n" +
15490
15495
"<li ng-repeat-end style=\"display:none\"></li>\n" +
0 commit comments