@@ -14210,26 +14210,26 @@ templateUrl:"views/overview/_builds.html"
14210
14210
function a(a, b, c, d, e, f, g, h) {
14211
14211
var i = this;
14212
14212
_.extend(i, f.ui);
14213
- var j = a("canI"), k = a("deploymentIsInProgress"), l = a("isBinaryBuild"), m = function(a) {
14213
+ var j = a("canI"), k = a("deploymentIsInProgress"), l = a("isBinaryBuild"), m = a("enableTechPreviewFeature"), n = function(a) {
14214
14214
var b = _.get(a, "spec.triggers");
14215
14215
_.isEmpty(b) || (i.imageChangeTriggers = _.filter(b, function(a) {
14216
14216
return "ImageChange" === a.type && _.get(a, "imageChangeParams.automatic");
14217
14217
}));
14218
- }, n = function(a) {
14219
- a && !i.current && "DeploymentConfig" !== a.kind && "Deployment" !== a.kind && (i.current = a);
14220
14218
}, o = function(a) {
14221
- i.rgv = c.objectToResourceGroupVersion(a), n(a), m(a);
14219
+ a && !i.current && "DeploymentConfig" !== a.kind && "Deployment" !== a.kind && (i.current = a);
14220
+ }, p = function(a) {
14221
+ i.rgv = c.objectToResourceGroupVersion(a), o(a), n(a);
14222
14222
};
14223
14223
i.$onChanges = function(a) {
14224
- a.apiObject && o (a.apiObject.currentValue);
14224
+ a.apiObject && p (a.apiObject.currentValue);
14225
14225
};
14226
- var p = [], q = function(a) {
14226
+ var q = [], r = function(a) {
14227
14227
if (!i.state.hpaByResource) return null;
14228
14228
var b = _.get(a, "kind"), c = _.get(a, "metadata.name");
14229
- return _.get(i.state.hpaByResource, [ b, c ], p );
14229
+ return _.get(i.state.hpaByResource, [ b, c ], q );
14230
14230
};
14231
14231
i.$doCheck = function() {
14232
- i.notifications = f.getNotifications(i.apiObject, i.state), i.hpa = q (i.apiObject), i.current && _.isEmpty(i.hpa) && (i.hpa = q (i.current));
14232
+ i.notifications = f.getNotifications(i.apiObject, i.state), i.hpa = r (i.apiObject), i.current && _.isEmpty(i.hpa) && (i.hpa = r (i.current));
14233
14233
var a = _.get(i, "apiObject.metadata.uid");
14234
14234
a && (i.services = _.get(i, [ "state", "servicesByObjectUID", a ]), i.buildConfigs = _.get(i, [ "state", "buildConfigsByObjectUID", a ]), i.bindings = _.get(i, [ "state", "bindingsByApplicationUID", a ]));
14235
14235
var b, c = _.get(i, "apiObject.kind");
@@ -14245,16 +14245,28 @@ return !!_.isEmpty(i.hpa) && !i.isDeploymentInProgress();
14245
14245
}, i.isDeploymentInProgress = function() {
14246
14246
return !(!i.current || !i.previous) || k(i.current);
14247
14247
}, i.canIDoAny = function() {
14248
- var a = _.get(i, "apiObject.kind");
14248
+ var a = _.get(i, "apiObject.kind"), b = _.get(i, "apiObject.metadata.uid"), c = _.get(i.state.deleteableBindingsByApplicationUID, b) ;
14249
14249
switch (a) {
14250
14250
case "DeploymentConfig":
14251
- return !!j("deploymentconfigs/instantiate", "create") || (!!j("deploymentconfigs", "update") || (!(!i.current || !j("deploymentconfigs/log", "get")) || (i.showStartPipelineAction() || i.showStartBuildAction())));
14251
+ return !!j("deploymentconfigs/instantiate", "create") || (!!j("deploymentconfigs", "update") || (!(!i.current || !j("deploymentconfigs/log", "get")) || (!(!m("pod_presets") || _.isEmpty(i.state.bindableServiceInstances) || !j({
14252
+ resource:"bindings",
14253
+ group:"servicecatalog.k8s.io"
14254
+ }, "create")) || (!(!m("pod_presets") || _.isEmpty(c) || !j({
14255
+ resource:"bindings",
14256
+ group:"servicecatalog.k8s.io"
14257
+ }, "delete")) || (i.showStartPipelineAction() || i.showStartBuildAction())))));
14252
14258
14253
14259
case "Pod":
14254
14260
return !!j("pods/log", "get") || !!j("pods", "update");
14255
14261
14256
14262
default:
14257
- return !(!i.firstPod(i.current) || !j("pods/log", "get")) || !!j(i.rgv, "update");
14263
+ return !(!i.firstPod(i.current) || !j("pods/log", "get")) || (!!j(i.rgv, "update") || (!(!m("pod_presets") || _.isEmpty(i.state.bindableServiceInstances) || !j({
14264
+ resource:"bindings",
14265
+ group:"servicecatalog.k8s.io"
14266
+ }, "create")) || !(!m("pod_presets") || _.isEmpty(c) || !j({
14267
+ resource:"bindings",
14268
+ group:"servicecatalog.k8s.io"
14269
+ }, "delete"))));
14258
14270
}
14259
14271
}, i.showStartBuildAction = function() {
14260
14272
if (!_.isEmpty(i.pipelines)) return !1;
@@ -14330,29 +14342,40 @@ hidePipelines:"<"
14330
14342
templateUrl:"views/overview/_list-row.html"
14331
14343
});
14332
14344
}(), function() {
14333
- function a(a, b, c, d, e, f) {
14334
- var g = this;
14335
- _.extend(g, e.ui);
14336
- var h = a("getErrorDetails"), i = a("serviceInstanceDisplayName"), j = function() {
14337
- var a = g.apiObject.spec.serviceClassName;
14338
- return _.get(g, [ "state", "serviceClasses", a, "description" ]);
14339
- };
14340
- g.$doCheck = function() {
14341
- g.notifications = e.getNotifications(g.apiObject, g.state), g.displayName = i(g.apiObject, g.serviceClasses), g.description = j();
14342
- }, g.$onChanges = function(a) {
14343
- a.bindings && (g.deleteableBindings = _.reject(g.bindings, "metadata.deletionTimestamp"));
14344
- }, g.getSecretForBinding = function(a) {
14345
- return a && _.get(g, [ "state", "secrets", a.spec.secretName ]);
14346
- }, g.isBindable = d.isServiceBindable(g.apiObject, g.state.serviceClasses), g.closeOverlayPanel = function() {
14347
- _.set(g, "overlay.panelVisible", !1);
14348
- }, g.showOverlayPanel = function(a, b) {
14349
- _.set(g, "overlay.panelVisible", !0), _.set(g, "overlay.panelName", a), _.set(g, "overlay.state", b);
14350
- }, g.deprovision = function() {
14345
+ function a(a, b, c, d, e, f, g) {
14346
+ var h = this;
14347
+ _.extend(h, e.ui);
14348
+ var i = a("getErrorDetails"), j = a("serviceInstanceDisplayName"), k = function() {
14349
+ var a = h.apiObject.spec.serviceClassName;
14350
+ return _.get(h, [ "state", "serviceClasses", a, "description" ]);
14351
+ };
14352
+ h.$doCheck = function() {
14353
+ h.notifications = e.getNotifications(h.apiObject, h.state), h.displayName = j(h.apiObject, h.serviceClasses), h.description = k();
14354
+ }, h.$onChanges = function(a) {
14355
+ a.bindings && (h.deleteableBindings = _.reject(h.bindings, "metadata.deletionTimestamp"));
14356
+ }, h.getSecretForBinding = function(a) {
14357
+ return a && _.get(h, [ "state", "secrets", a.spec.secretName ]);
14358
+ }, h.isBindable = d.isServiceBindable(h.apiObject, h.state.serviceClasses), h.actionsDropdownVisible = function() {
14359
+ return !(!h.isBindable || !g.canI({
14360
+ resource:"bindings",
14361
+ group:"servicecatalog.k8s.io"
14362
+ }, "create")) || (!(_.isEmpty(h.deleteableBindings) || !g.canI({
14363
+ resource:"bindings",
14364
+ group:"servicecatalog.k8s.io"
14365
+ }, "delete")) || !!g.canI({
14366
+ resource:"instances",
14367
+ group:"servicecatalog.k8s.io"
14368
+ }, "delete"));
14369
+ }, h.closeOverlayPanel = function() {
14370
+ _.set(h, "overlay.panelVisible", !1);
14371
+ }, h.showOverlayPanel = function(a, b) {
14372
+ _.set(h, "overlay.panelVisible", !0), _.set(h, "overlay.panelName", a), _.set(h, "overlay.state", b);
14373
+ }, h.deprovision = function() {
14351
14374
var a = {
14352
14375
alerts:{
14353
14376
deprovision:{
14354
14377
type:"error",
14355
- message:"Service '" + g .apiObject.spec.serviceClassName + "' will be deleted and no longer available."
14378
+ message:"Service '" + h .apiObject.spec.serviceClassName + "' will be deleted and no longer available."
14356
14379
}
14357
14380
},
14358
14381
detailsMarkup:"Delete Service?",
@@ -14373,28 +14396,28 @@ return a;
14373
14396
f.hideNotification("deprovision-service-error"), c["delete"]({
14374
14397
group:"servicecatalog.k8s.io",
14375
14398
resource:"instances"
14376
- }, g .apiObject.metadata.name, {
14377
- namespace:g .apiObject.metadata.namespace
14399
+ }, h .apiObject.metadata.name, {
14400
+ namespace:h .apiObject.metadata.namespace
14378
14401
}, {
14379
14402
propagationPolicy:null
14380
14403
}).then(function() {
14381
14404
f.addNotification({
14382
14405
type:"success",
14383
- message:"Successfully deleted " + g .apiObject.metadata.name + "."
14406
+ message:"Successfully deleted " + h .apiObject.metadata.name + "."
14384
14407
});
14385
14408
}, function(a) {
14386
14409
f.addNotification({
14387
14410
id:"deprovision-service-error",
14388
14411
type:"error",
14389
- message:"An error occurred while deleting " + g .apiObject.metadata.name + ".",
14390
- details:h (a)
14412
+ message:"An error occurred while deleting " + h .apiObject.metadata.name + ".",
14413
+ details:i (a)
14391
14414
});
14392
14415
});
14393
14416
});
14394
14417
};
14395
14418
}
14396
14419
angular.module("openshiftConsole").component("serviceInstanceRow", {
14397
- controller:[ "$filter", "$uibModal", "DataService", "BindingService", "ListRowUtils", "NotificationsService", a ],
14420
+ controller:[ "$filter", "$uibModal", "DataService", "BindingService", "ListRowUtils", "NotificationsService", "AuthorizationService", a ],
14398
14421
controllerAs:"row",
14399
14422
bindings:{
14400
14423
apiObject:"<",
@@ -27869,11 +27892,14 @@ var _scriptsTemplatesJs = []byte(`angular.module('openshiftConsoleTemplates', []
27869
27892
"<li ng-if=\"'deploymentconfigs' | canI : 'update'\" role=\"menuitem\">\n" +
27870
27893
"<a ng-href=\"{{row.apiObject | editResourceURL}}\">Edit</a>\n" +
27871
27894
"</li>\n" +
27872
- "\n" +
27873
- "<li ng-if=\"('pod_presets' | enableTechPreviewFeature) && row.state.bindableServiceInstances.length\" role=\"menuitem\">\n" +
27895
+ "<li ng-if=\"('pod_presets' | enableTechPreviewFeature)\n" +
27896
+ " && row.state.bindableServiceInstances.length\n" +
27897
+ " && ({resource: 'bindings', group: 'servicecatalog.k8s.io'} | canI : 'create')\" role=\"menuitem\">\n" +
27874
27898
"<a href=\"\" ng-click=\"row.showOverlayPanel('bindService', {target: row.apiObject})\">Create Binding</a>\n" +
27875
27899
"</li>\n" +
27876
- "<li ng-if=\"('pod_presets' | enableTechPreviewFeature) && row.state.deleteableBindingsByApplicationUID[row.apiObject.metadata.uid].length\" role=\"menuitem\">\n" +
27900
+ "<li ng-if=\"('pod_presets' | enableTechPreviewFeature)\n" +
27901
+ " && row.state.deleteableBindingsByApplicationUID[row.apiObject.metadata.uid].length\n" +
27902
+ " && ({resource: 'bindings', group: 'servicecatalog.k8s.io'} | canI : 'delete')\" role=\"menuitem\">\n" +
27877
27903
"<a href=\"\" ng-click=\"row.showOverlayPanel('unbindService', {target: row.apiObject})\">Delete Binding</a>\n" +
27878
27904
"</li>\n" +
27879
27905
"<li ng-if=\"row.current && ('deploymentconfigs/log' | canI : 'get')\" role=\"menuitem\">\n" +
@@ -27902,6 +27928,16 @@ var _scriptsTemplatesJs = []byte(`angular.module('openshiftConsoleTemplates', []
27902
27928
"<li role=\"menuitem\" ng-if=\"row.rgv | canI : 'update'\">\n" +
27903
27929
"<a ng-href=\"{{row.apiObject | editYamlURL}}\">Edit YAML</a>\n" +
27904
27930
"</li>\n" +
27931
+ "<li ng-if=\"('pod_presets' | enableTechPreviewFeature)\n" +
27932
+ " && row.state.bindableServiceInstances.length\n" +
27933
+ " && ({resource: 'bindings', group: 'servicecatalog.k8s.io'} | canI : 'create')\" role=\"menuitem\">\n" +
27934
+ "<a href=\"\" ng-click=\"row.showOverlayPanel('bindService', {target: row.apiObject})\">Create Binding</a>\n" +
27935
+ "</li>\n" +
27936
+ "<li ng-if=\"('pod_presets' | enableTechPreviewFeature)\n" +
27937
+ " && row.state.deleteableBindingsByApplicationUID[row.apiObject.metadata.uid].length\n" +
27938
+ " && ({resource: 'bindings', group: 'servicecatalog.k8s.io'} | canI : 'delete')\" role=\"menuitem\">\n" +
27939
+ "<a href=\"\" ng-click=\"row.showOverlayPanel('unbindService', {target: row.apiObject})\">Delete Binding</a>\n" +
27940
+ "</li>\n" +
27905
27941
"<li ng-if=\"(pod = row.firstPod(row.current)) && ('pods/log' | canI : 'get')\" role=\"menuitem\">\n" +
27906
27942
"<a ng-href=\"{{pod | navigateResourceURL}}?tab=logs\">View Logs</a>\n" +
27907
27943
"</li>\n" +
@@ -28389,7 +28425,7 @@ var _scriptsTemplatesJs = []byte(`angular.module('openshiftConsoleTemplates', []
28389
28425
"<div class=\"section-title hidden-xs\">Service Bindings</div>\n" +
28390
28426
"<overview-service-binding ng-repeat=\"binding in $ctrl.bindings track by (binding | uid)\" binding=\"binding\" service-classes=\"$ctrl.serviceClasses\" service-instances=\"$ctrl.serviceInstances\" secrets=\"$ctrl.secrets\">\n" +
28391
28427
"</overview-service-binding>\n" +
28392
- "<div ng-if=\"$ctrl.bindableServiceInstances | size\">\n" +
28428
+ "<div ng-if=\"( $ctrl.bindableServiceInstances | size) && ({resource: 'bindings', group: 'servicecatalog.k8s.io'} | canI : 'create') \">\n" +
28393
28429
"<a href=\"\" ng-click=\"$ctrl.createBinding()\" role=\"button\">Create Binding</a>\n" +
28394
28430
"</div>\n" +
28395
28431
"</div>"
@@ -28437,7 +28473,9 @@ var _scriptsTemplatesJs = []byte(`angular.module('openshiftConsoleTemplates', []
28437
28473
"<div class=\"list-pf-details\">\n" +
28438
28474
"<div ng-if=\"!row.expanded\">\n" +
28439
28475
"<div class=\"hidden-xs hidden-sm\">\n" +
28440
- "<span ng-if=\"!row.bindings.length && row.isBindable\">\n" +
28476
+ "<span ng-if=\"!row.bindings.length\n" +
28477
+ " && row.isBindable\n" +
28478
+ " && ({resource: 'bindings', group: 'servicecatalog.k8s.io'} | canI : 'create')\">\n" +
28441
28479
"<a href=\"\" ng-click=\"row.showOverlayPanel('bindService', {target: row.apiObject})\">Create Binding</a>\n" +
28442
28480
"</span>\n" +
28443
28481
"<span ng-if=\"row.bindings.length\" class=\"component-label\">Bindings</span>\n" +
@@ -28463,18 +28501,18 @@ var _scriptsTemplatesJs = []byte(`angular.module('openshiftConsoleTemplates', []
28463
28501
"</div>\n" +
28464
28502
"</div>\n" +
28465
28503
"</div>\n" +
28466
- "<div class=\"list-pf-actions\">\n" +
28504
+ "<div class=\"list-pf-actions\" ng-if=\"row.actionsDropdownVisible()\" >\n" +
28467
28505
"<div uib-dropdown>\n" +
28468
28506
"<a href=\"\" uib-dropdown-toggle class=\"actions-dropdown-kebab\"><i class=\"fa fa-ellipsis-v\"></i><span class=\"sr-only\">Actions</span></a>\n" +
28469
28507
"<ul class=\"dropdown-menu dropdown-menu-right\" uib-dropdown-menu role=\"menu\">\n" +
28470
- "<li role=\"menuitem\" ng-if=\"('pod_presets' | enableTechPreviewFeature) && row.isBindable \">\n" +
28508
+ "<li role=\"menuitem\" ng-if=\"row.isBindable && ({resource: 'bindings', group: 'servicecatalog.k8s.io'} | canI : 'create') \">\n" +
28471
28509
"<a href=\"\" ng-click=\"row.showOverlayPanel('bindService', {target: row.apiObject})\">Create Binding</a>\n" +
28472
28510
"</li>\n" +
28473
- "<li role=\"menuitem\" ng-if=\"('pod_presets' | enableTechPreviewFeature) && row.deleteableBindings.length \">\n" +
28511
+ "<li role=\"menuitem\" ng-if=\"row.deleteableBindings.length && ({resource: 'bindings', group: 'servicecatalog.k8s.io'} | canI : 'delete') \">\n" +
28474
28512
"<a href=\"\" ng-click=\"row.showOverlayPanel('unbindService', {target: row.apiObject})\">Delete Binding</a>\n" +
28475
28513
"</li>\n" +
28476
28514
"<li role=\"menuitem\">\n" +
28477
- "<a href=\"\" ng-click=\"row.deprovision()\" role=\"button\">Delete</a>\n" +
28515
+ "<a href=\"\" ng-click=\"row.deprovision()\" role=\"button\" ng-if=\"{resource: 'instances', group: 'servicecatalog.k8s.io'} | canI : 'delete'\" >Delete</a>\n" +
28478
28516
"</li>\n" +
28479
28517
"</ul>\n" +
28480
28518
"</div>\n" +
@@ -28531,11 +28569,16 @@ var _scriptsTemplatesJs = []byte(`angular.module('openshiftConsoleTemplates', []
28531
28569
"</a>\n" +
28532
28570
"</div>\n" +
28533
28571
"</div>\n" +
28534
- "<div class=\"row\" ng-if=\"row.isBindable\">\n" +
28572
+ "<div class=\"row\" ng-if=\"row.isBindable && ({resource: 'bindings', group: 'servicecatalog.k8s.io'} | canI : 'create') \">\n" +
28535
28573
"<div class=\"col-sm-12\">\n" +
28536
28574
"<a href=\"\" ng-click=\"row.showOverlayPanel('bindService', {target: row.apiObject})\">Create Binding</a>\n" +
28537
28575
"</div>\n" +
28538
28576
"</div>\n" +
28577
+ "<div class=\"row\" ng-if=\"!row.bindings.length && (!row.isBindable || !({resource: 'bindings', group: 'servicecatalog.k8s.io'} | canI : 'create'))\">\n" +
28578
+ "<div class=\"col-sm-12\">\n" +
28579
+ "<em>No bindings</em>\n" +
28580
+ "</div>\n" +
28581
+ "</div>\n" +
28539
28582
"</div>\n" +
28540
28583
"</div>\n" +
28541
28584
"</div>\n" +
0 commit comments