@@ -53,10 +53,10 @@ return _.get(e, "metadata.name");
53
53
return _.get(e, "metadata.uid");
54
54
}, G = function() {
55
55
return _.size(P.deploymentConfigs) + _.size(P.vanillaReplicationControllers) + _.size(P.deployments) + _.size(P.vanillaReplicaSets) + _.size(P.statefulSets) + _.size(P.monopods) + _.size(P.state.serviceInstances);
56
- }, K = function() {
57
- return _.size(P.filteredDeploymentConfigs) + _.size(P.filteredReplicationControllers) + _.size(P.filteredDeployments) + _.size(P.filteredReplicaSets) + _.size(P.filteredStatefulSets) + _.size(P.filteredMonopods) + _.size(P.filteredServiceInstances);
58
56
}, W = function() {
59
- P.size = G(), P.filteredSize = K();
57
+ return _.size(P.filteredDeploymentConfigs) + _.size(P.filteredReplicationControllers) + _.size(P.filteredDeployments) + _.size(P.filteredReplicaSets) + _.size(P.filteredStatefulSets) + _.size(P.filteredMonopods) + _.size(P.filteredServiceInstances);
58
+ }, K = function() {
59
+ P.size = G(), P.filteredSize = W();
60
60
var e = 0 === P.size, t = P.deploymentConfigs && P.replicationControllers && P.deployments && P.replicaSets && P.statefulSets && P.pods && P.state.serviceInstances;
61
61
V.expandAll = t && 1 === P.size, P.showGetStarted = t && e, P.showLoading = !t && e, P.everythingFiltered = !e && !P.filteredSize, P.hidePipelineOtherResources = "pipeline" === P.viewBy && (P.filterActive || _.isEmpty(P.pipelineBuildConfigs));
62
62
}, Q = function(e) {
@@ -119,7 +119,7 @@ case "name":
119
119
return !_.isEmpty(V.filterKeywords);
120
120
}
121
121
}, ie = function() {
122
- P.filteredDeploymentConfigs = re(P.deploymentConfigs), P.filteredReplicationControllers = re(P.vanillaReplicationControllers), P.filteredDeployments = re(P.deployments), P.filteredReplicaSets = re(P.vanillaReplicaSets), P.filteredStatefulSets = re(P.statefulSets), P.filteredMonopods = re(P.monopods), P.filteredPipelineBuildConfigs = re(P.pipelineBuildConfigs), P.filteredServiceInstances = re(V.orderedServiceInstances), P.filterActive = oe(), Z(), W ();
122
+ P.filteredDeploymentConfigs = re(P.deploymentConfigs), P.filteredReplicationControllers = re(P.vanillaReplicationControllers), P.filteredDeployments = re(P.deployments), P.filteredReplicaSets = re(P.vanillaReplicaSets), P.filteredStatefulSets = re(P.statefulSets), P.filteredMonopods = re(P.monopods), P.filteredPipelineBuildConfigs = re(P.pipelineBuildConfigs), P.filteredServiceInstances = re(V.orderedServiceInstances), P.filterActive = oe(), Z(), K ();
123
123
}, se = n.project + "/overview/view-by";
124
124
P.viewBy = localStorage.getItem(se) || "app", e.$watch(function() {
125
125
return P.viewBy;
@@ -315,7 +315,7 @@ _.isEmpty(o) || (t = t.concat(o));
315
315
qe(), ze();
316
316
}, Ge = function() {
317
317
_.each(P.deploymentConfigs, Me);
318
- }, Ke = function() {
318
+ }, We = function() {
319
319
if (V.builds && P.buildConfigs) {
320
320
P.recentPipelinesByBuildConfig = {}, V.recentBuildsByBuildConfig = {}, V.recentPipelinesByDeploymentConfig = {};
321
321
var e = {};
@@ -330,7 +330,7 @@ return i.sortBuilds(e, !0);
330
330
return i.sortBuilds(e, !0);
331
331
}), Ge();
332
332
}
333
- }, We = function() {
333
+ }, Ke = function() {
334
334
k.setQuotaNotifications(V.quotas, V.clusterQuotas, n.project);
335
335
};
336
336
P.clearFilter = function() {
@@ -395,7 +395,7 @@ resource: "deployments"
395
395
}, a, function(e) {
396
396
I = e.by("metadata.uid"), P.deployments = _.sortBy(I, "metadata.name"), Ee(), Ae(P.deployments), Ae(P.vanillaReplicaSets), we(P.deployments), Qe(), ie(), h.log("deployments (subscribe)", P.deploymentsByUID);
397
397
})), Ye.push(l.watch("builds", a, function(e) {
398
- V.builds = e.by("metadata.name"), Ke (), h.log("builds (subscribe)", V.builds);
398
+ V.builds = e.by("metadata.name"), We (), h.log("builds (subscribe)", V.builds);
399
399
})), Ye.push(l.watch({
400
400
group: "apps",
401
401
resource: "statefulsets"
@@ -415,7 +415,7 @@ P.routes = e.by("metadata.name"), Be(), h.log("routes (subscribe)", P.routes);
415
415
poll: R,
416
416
pollInterval: 6e4
417
417
})), Ye.push(l.watch("buildConfigs", a, function(e) {
418
- P.buildConfigs = e.by("metadata.name"), Fe(), He(), Ke (), ie(), h.log("buildconfigs (subscribe)", P.buildConfigs);
418
+ P.buildConfigs = e.by("metadata.name"), Fe(), He(), We (), ie(), h.log("buildconfigs (subscribe)", P.buildConfigs);
419
419
}, {
420
420
poll: R,
421
421
pollInterval: 6e4
@@ -434,12 +434,12 @@ T = e.by("metadata.name"), m.buildDockerRefMapForImageStreams(T, V.imageStreamIm
434
434
poll: R,
435
435
pollInterval: 6e4
436
436
})), Ye.push(l.watch("resourcequotas", a, function(e) {
437
- V.quotas = e.by("metadata.name"), We ();
437
+ V.quotas = e.by("metadata.name"), Ke ();
438
438
}, {
439
439
poll: !0,
440
440
pollInterval: 6e4
441
441
})), Ye.push(l.watch("appliedclusterresourcequotas", a, function(e) {
442
- V.clusterQuotas = e.by("metadata.name"), We ();
442
+ V.clusterQuotas = e.by("metadata.name"), Ke ();
443
443
}, {
444
444
poll: !0,
445
445
pollInterval: 6e4
@@ -4277,52 +4277,80 @@ controller: !0
4277
4277
});
4278
4278
}
4279
4279
};
4280
- }), angular.module("openshiftConsole").factory("ServiceInstancesService", [ "$filter", "$uibModal", "DataService", "NotificationsService", function(e, t, n, a) {
4281
- return {
4282
- deprovision: function(r) {
4283
- var o = e("getErrorDetails"), i = {
4284
- alerts: {
4285
- deprovision: {
4286
- type: "error",
4287
- message: "Service '" + r.spec.serviceClassName + "' will be deleted and no longer available."
4288
- }
4289
- },
4290
- detailsMarkup: "Delete Service?",
4280
+ }), angular.module("openshiftConsole").factory("ServiceInstancesService", [ "$filter", "$uibModal", "BindingService", "CatalogService", "DataService", "NotificationsService", function(e, t, n, a, r, o) {
4281
+ var i = function(n) {
4282
+ var a, i = e("getErrorDetails"), s = {
4283
+ kind: n.kind,
4284
+ displayName: n.metadata.name,
4291
4285
okButtonText: "Delete",
4292
4286
okButtonClass: "btn-danger",
4293
- cancelButtonText: "Cancel"
4287
+ cancelButtonText: "Cancel",
4288
+ delete: function() {
4289
+ a.close("delete");
4290
+ }
4294
4291
};
4295
- return t.open({
4292
+ return (a = t.open({
4296
4293
animation: !0,
4297
- templateUrl: "views/modals/confirm .html",
4294
+ templateUrl: "views/modals/delete-resource .html",
4298
4295
controller: "ConfirmModalController",
4299
4296
resolve: {
4300
4297
modalConfig: function() {
4301
- return i ;
4298
+ return s ;
4302
4299
}
4303
4300
}
4304
- }).result.then(function() {
4305
- return a.hideNotification("deprovision-service-error"), n.delete({
4301
+ })).result.then(function() {
4302
+ o.hideNotification("deprovision-service-error");
4303
+ var e = {
4304
+ namespace: n.metadata.namespace
4305
+ }, t = {
4306
4306
group: "servicecatalog.k8s.io",
4307
4307
resource: "serviceinstances"
4308
- }, r.metadata.name, {
4309
- namespace: r.metadata.namespace
4310
- }, {
4308
+ }, a = {
4311
4309
propagationPolicy: null
4312
- }).then(function() {
4313
- a.addNotification({
4310
+ };
4311
+ return r.delete(t, n.metadata.name, e, a).then(function() {
4312
+ o.addNotification({
4314
4313
type: "success",
4315
- message: "Successfully deleted provisioned service " + r .metadata.name + "."
4314
+ message: "Successfully deleted provisioned service " + n .metadata.name + "."
4316
4315
});
4317
4316
}, function(e) {
4318
- a .addNotification({
4317
+ o .addNotification({
4319
4318
id: "deprovision-service-error",
4320
4319
type: "error",
4321
- message: "An error occurred while deleting provisioned service " + r .metadata.name + ".",
4322
- details: o (e)
4320
+ message: "An error occurred while deleting provisioned service " + n .metadata.name + ".",
4321
+ details: i (e)
4323
4322
});
4324
4323
});
4325
4324
});
4325
+ }, s = function() {
4326
+ return t.open({
4327
+ animation: !0,
4328
+ templateUrl: "views/modals/warning.html",
4329
+ controller: "WarningModalController",
4330
+ resolve: {
4331
+ modalConfig: function() {
4332
+ return {
4333
+ title: "Unable to Deprovision",
4334
+ strongMessage: "This service cannot be deprovisioned because it has bindings.",
4335
+ message: "You must delete all bindings from the service before you can deprovision it."
4336
+ };
4337
+ }
4338
+ }
4339
+ });
4340
+ };
4341
+ return {
4342
+ deprovision: function(e) {
4343
+ var t = {
4344
+ namespace: e.metadata.namespace
4345
+ }, o = {
4346
+ group: "servicecatalog.k8s.io",
4347
+ resource: "serviceinstancecredentials"
4348
+ };
4349
+ a.SERVICE_CATALOG_ENABLED ? r.list(o, t, function(t) {
4350
+ n.getBindingsForResource(t.by("metadata.name"), e).length > 0 ? s() : i(e);
4351
+ }, function() {
4352
+ i(e);
4353
+ }) : i(e);
4326
4354
}
4327
4355
};
4328
4356
} ]), angular.module("openshiftConsole").controller("LandingPageController", [ "$scope", "$rootScope", "AuthService", "Catalog", "Constants", "DataService", "Navigate", "NotificationsService", "RecentlyViewedServiceItems", "GuidedTourService", "HTMLService", "$timeout", "$q", "$routeParams", "$location", function(e, t, n, a, r, o, i, s, c, l, u, d, p, m, f) {
@@ -8666,6 +8694,10 @@ t.close("ok");
8666
8694
e.ok = function() {
8667
8695
t.close("ok");
8668
8696
};
8697
+ } ]), angular.module("openshiftConsole").controller("WarningModalController", [ "$scope", "$uibModalInstance", "modalConfig", function(e, t, n) {
8698
+ _.extend(e, n), e.close = function() {
8699
+ t.dismiss("cancel");
8700
+ };
8669
8701
} ]), angular.module("openshiftConsole").controller("AboutController", [ "$scope", "AuthService", "Constants", function(e, t, n) {
8670
8702
t.withUser(), e.version = {
8671
8703
master: {
0 commit comments