Skip to content

Commit fedc937

Browse files
committed
Fixes several bugs in service instance row
bindable was set incorrectly if service classes loaded after instances displayName was never correct if the service class had a pretty name fixed several references to osbMetadata to be externalMetadata
1 parent 6949924 commit fedc937

File tree

4 files changed

+8
-9
lines changed

4 files changed

+8
-9
lines changed

app/scripts/controllers/overview.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1183,7 +1183,7 @@ function OverviewController($scope,
11831183

11841184
state.orderedServiceInstances = _.sortByAll(state.serviceInstances,
11851185
function(item) {
1186-
return _.get(state.serviceClasses, [item.spec.serviceClassName, 'osbMetadata', 'displayName']) || item.spec.serviceClassName;
1186+
return _.get(state.serviceClasses, [item.spec.serviceClassName, 'externalMetadata', 'displayName']) || item.spec.serviceClassName;
11871187
},
11881188
function(item) {
11891189
return _.get(item, 'metadata.name', '');

app/scripts/directives/bindService.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
if (ctrl.serviceClasses && ctrl.serviceInstances) {
4747
ctrl.orderedServiceInstances = _.sortByAll(ctrl.serviceInstances,
4848
function(item) {
49-
return _.get(ctrl.serviceClasses, [item.spec.serviceClassName, 'osbMetadata', 'displayName']) || item.spec.serviceClassName;
49+
return _.get(ctrl.serviceClasses, [item.spec.serviceClassName, 'externalMetadata', 'displayName']) || item.spec.serviceClassName;
5050
},
5151
function(item) {
5252
return _.get(item, 'metadata.name', '');

app/scripts/directives/overview/serviceInstanceRow.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@
4141

4242
row.$doCheck = function() {
4343
row.notifications = ListRowUtils.getNotifications(row.apiObject, row.state);
44-
row.displayName = serviceInstanceDisplayName(row.apiObject, row.serviceClasses);
44+
row.displayName = serviceInstanceDisplayName(row.apiObject, row.state.serviceClasses);
45+
row.isBindable = BindingService.isServiceBindable(row.apiObject, row.state.serviceClasses);
4546
row.description = getDescription();
4647
};
4748

@@ -55,8 +56,6 @@
5556
return binding && _.get(row, ['state', 'secrets', binding.spec.secretName]);
5657
};
5758

58-
row.isBindable = BindingService.isServiceBindable(row.apiObject, row.state.serviceClasses);
59-
6059
row.actionsDropdownVisible = function() {
6160
// We can create bindings
6261
if (row.isBindable && AuthorizationService.canI({resource: 'bindings', group: 'servicecatalog.k8s.io'}, 'create')) {

dist/scripts/scripts.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@ return c || a.metadata.name;
396396
return Q.serviceInstances || Q.serviceClasses ? (Q.bindableServiceInstances = _.filter(Q.serviceInstances, function(a) {
397397
return w.isServiceBindable(a, Q.serviceClasses);
398398
}), void (Q.orderedServiceInstances = _.sortByAll(Q.serviceInstances, function(a) {
399-
return _.get(Q.serviceClasses, [ a.spec.serviceClassName, "osbMetadata", "displayName" ]) || a.spec.serviceClassName;
399+
return _.get(Q.serviceClasses, [ a.spec.serviceClassName, "externalMetadata", "displayName" ]) || a.spec.serviceClassName;
400400
}, function(a) {
401401
return _.get(a, "metadata.name", "");
402402
}))) :void (Q.bindableServiceInstances = null);
@@ -12268,7 +12268,7 @@ d && (!a || c.metadata.creationTimestamp > a.metadata.creationTimestamp) && (a =
1226812268
}), l.serviceToBind = a || b;
1226912269
}, o = function() {
1227012270
l.serviceClasses && l.serviceInstances && (l.orderedServiceInstances = _.sortByAll(l.serviceInstances, function(a) {
12271-
return _.get(l.serviceClasses, [ a.spec.serviceClassName, "osbMetadata", "displayName" ]) || a.spec.serviceClassName;
12271+
return _.get(l.serviceClasses, [ a.spec.serviceClassName, "externalMetadata", "displayName" ]) || a.spec.serviceClassName;
1227212272
}, function(a) {
1227312273
return _.get(a, "metadata.name", "");
1227412274
}));
@@ -13131,12 +13131,12 @@ var a = h.apiObject.spec.serviceClassName;
1313113131
return _.get(h, [ "state", "serviceClasses", a, "description" ]);
1313213132
};
1313313133
h.$doCheck = function() {
13134-
h.notifications = e.getNotifications(h.apiObject, h.state), h.displayName = j(h.apiObject, h.serviceClasses), h.description = k();
13134+
h.notifications = e.getNotifications(h.apiObject, h.state), h.displayName = j(h.apiObject, h.state.serviceClasses), h.isBindable = d.isServiceBindable(h.apiObject, h.state.serviceClasses), h.description = k();
1313513135
}, h.$onChanges = function(a) {
1313613136
a.bindings && (h.deleteableBindings = _.reject(h.bindings, "metadata.deletionTimestamp"));
1313713137
}, h.getSecretForBinding = function(a) {
1313813138
return a && _.get(h, [ "state", "secrets", a.spec.secretName ]);
13139-
}, h.isBindable = d.isServiceBindable(h.apiObject, h.state.serviceClasses), h.actionsDropdownVisible = function() {
13139+
}, h.actionsDropdownVisible = function() {
1314013140
return !(!h.isBindable || !g.canI({
1314113141
resource:"bindings",
1314213142
group:"servicecatalog.k8s.io"

0 commit comments

Comments
 (0)