Skip to content

Commit e679211

Browse files
author
OpenShift Bot
authored
Merge pull request #2256 from spadgett/service-instance-breadcrumbs
Merged by openshift-bot
2 parents ba1a820 + f8df8aa commit e679211

File tree

2 files changed

+13
-10
lines changed

2 files changed

+13
-10
lines changed

app/scripts/controllers/serviceInstance.js

+5-2
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,18 @@ angular.module('openshiftConsole')
3737
});
3838
};
3939

40+
var serviceClassPromise;
4041
var updateServiceClass = function() {
41-
if ($scope.serviceClass) {
42+
// If we've previously loaded the service class or a request is in flight, don't do anything.
43+
if ($scope.serviceClass || serviceClassPromise) {
4244
return;
4345
}
4446

45-
ServiceInstancesService.fetchServiceClassForInstance($scope.serviceInstance).then(function(serviceClass) {
47+
serviceClassPromise = ServiceInstancesService.fetchServiceClassForInstance($scope.serviceInstance).then(function(serviceClass) {
4648
$scope.serviceClass = serviceClass;
4749
$scope.displayName = serviceInstanceDisplayName($scope.serviceInstance, serviceClass);
4850
updateBreadcrumbs();
51+
serviceClassPromise = null;
4952
});
5053
};
5154

dist/scripts/scripts.js

+8-8
Original file line numberDiff line numberDiff line change
@@ -6315,29 +6315,29 @@ i.deprovision(e.serviceInstance);
63156315
};
63166316
var s = [], c = t("serviceInstanceDisplayName");
63176317
e.serviceInstancesVersion = a.getPreferredVersion("serviceinstances");
6318-
var l = function() {
6318+
var l, u = function() {
63196319
e.breadcrumbs.push({
63206320
title: e.displayName
63216321
});
6322-
}, u = function() {
6323-
e.serviceClass || i.fetchServiceClassForInstance(e.serviceInstance).then(function(t) {
6324-
e.serviceClass = t, e.displayName = c(e.serviceInstance, t), l();
6325-
});
63266322
}, d = function() {
6323+
e.serviceClass || l || (l = i.fetchServiceClassForInstance(e.serviceInstance).then(function(t) {
6324+
e.serviceClass = t, e.displayName = c(e.serviceInstance, t), u(), l = null;
6325+
}));
6326+
}, m = function() {
63276327
i.isCurrentPlan(e.serviceInstance, e.plan) || i.fetchServicePlanForInstance(e.serviceInstance).then(function(t) {
63286328
e.plan = t;
63296329
});
6330-
}, m = function(t, n) {
6330+
}, p = function(t, n) {
63316331
e.loaded = !0, e.serviceInstance = t, "DELETED" === n && (e.alerts.deleted = {
63326332
type: "warning",
63336333
message: "This provisioned service has been deleted."
6334-
}), u(), d();
6334+
}), d(), m();
63356335
};
63366336
o.get(n.project).then(_.spread(function(a, o) {
63376337
e.project = a, e.projectContext = o, r.get(e.serviceInstancesVersion, n.instance, o, {
63386338
errorNotification: !1
63396339
}).then(function(t) {
6340-
m(t), s.push(r.watchObject(e.serviceInstancesVersion, n.instance, o, m));
6340+
p(t), s.push(r.watchObject(e.serviceInstancesVersion, n.instance, o, p));
63416341
}, function(n) {
63426342
e.loaded = !0, e.alerts.load = {
63436343
type: "error",

0 commit comments

Comments
 (0)