@@ -6358,15 +6358,15 @@ e.showParameterValues = !e.showParameterValues;
6358
6358
}, e.closeEditDialog = function() {
6359
6359
e.editDialogShown = !1;
6360
6360
};
6361
- var m, p = [], f = [], g = t("serviceInstanceDisplayName"), v = t("isServiceInstanceReady"), h = a.getPreferredVersion("servicebindings");
6361
+ var m, p, f = [], g = [], v = t("serviceInstanceDisplayName"), h = t("isServiceInstanceReady"), y = a.getPreferredVersion("servicebindings");
6362
6362
e.serviceInstancesVersion = a.getPreferredVersion("serviceinstances");
6363
- var y = function() {
6363
+ var b = function() {
6364
6364
e.breadcrumbs.push({
6365
6365
title: e.displayName
6366
6366
});
6367
- }, b = function() {
6367
+ }, C = function() {
6368
6368
if (e.serviceInstance && e.parameterSchema) {
6369
- s.unwatchAll(f ), f = [], e.allowParametersReveal = o.canI("secrets", "get", e.projectName), e.parameterData = {}, e.opaqueParameterKeys = [];
6369
+ s.unwatchAll(g ), g = [], e.allowParametersReveal = o.canI("secrets", "get", e.projectName), e.parameterData = {}, e.opaqueParameterKeys = [];
6370
6370
var t = e.allowParametersReveal ? "" : "*****";
6371
6371
_.each(_.keys(_.get(e.parameterSchema, "properties")), function(n) {
6372
6372
e.parameterData[n] = t;
@@ -6375,7 +6375,7 @@ var n = _.get(e.serviceInstance, "status.externalProperties.parameters", {});
6375
6375
_.each(_.keys(n), function(t) {
6376
6376
"<redacted>" === n[t] ? e.parameterData[t] = "*****" : (e.parameterData[t] = n[t], e.opaqueParameterKeys.push(t));
6377
6377
}), e.allowParametersReveal && _.each(_.get(e.serviceInstance, "spec.parametersFrom"), function(t) {
6378
- f .push(s.watchObject("secrets", _.get(t, "secretKeyRef.name"), e.projectContext, function(n) {
6378
+ g .push(s.watchObject("secrets", _.get(t, "secretKeyRef.name"), e.projectContext, function(n) {
6379
6379
try {
6380
6380
var a = JSON.parse(u.decodeSecretData(n.data)[t.secretKeyRef.key]);
6381
6381
_.extend(e.parameterData, a);
@@ -6385,34 +6385,42 @@ c.warn("Unable to load parameters from secret " + _.get(t, "secretKeyRef.name"),
6385
6385
}));
6386
6386
});
6387
6387
}
6388
- }, C = function() {
6388
+ }, S = function() {
6389
6389
if (e.plan && e.serviceClass && e.serviceInstance) {
6390
6390
var t = _.get(e.plan, "spec.instanceUpdateParameterSchema"), n = _.size(_.get(t, "properties")) > 0 || _.get(e.serviceClass, "spec.planUpdatable") && _.size(e.servicePlans) > 1;
6391
- e.editAvailable = n && v (e.serviceInstance) && !_.get(e.serviceInstance, "metadata.deletionTimestamp");
6391
+ e.editAvailable = n && h (e.serviceInstance) && !_.get(e.serviceInstance, "metadata.deletionTimestamp");
6392
6392
}
6393
- }, S = function() {
6394
- e.parameterFormDefinition = angular.copy(_.get(e.plan, "spec.externalMetadata.schemas.service_instance.update.openshift_form_definition")), e.parameterSchema = _.get(e.plan, "spec.instanceCreateParameterSchema"), b();
6395
6393
}, w = function() {
6396
- !e.serviceInstance || e.serviceClass || m || (m = d.fetchServiceClassForInstance(e.serviceInstance).then(function(t) {
6397
- e.serviceClass = t, e.displayName = g(e.serviceInstance, e.serviceClass), y(), m = null, i.getServicePlansForServiceClass(e.serviceClass).then(function(t) {
6398
- t = t.by("metadata.name");
6394
+ e.parameterFormDefinition = angular.copy(_.get(e.plan, "spec.externalMetadata.schemas.service_instance.update.openshift_form_definition")), e.parameterSchema = _.get(e.plan, "spec.instanceCreateParameterSchema"), C();
6395
+ }, k = function() {
6396
+ var t = _.get(e.serviceInstance, "spec.clusterServicePlanRef.name");
6397
+ e.plan = _.find(e.servicePlans, {
6398
+ metadata: {
6399
+ name: t
6400
+ }
6401
+ }), w(), S();
6402
+ }, P = function() {
6403
+ e.serviceClass && !p && (e.servicePlans ? k() : p = i.getServicePlansForServiceClass(e.serviceClass).then(function(t) {
6399
6404
var n = _.get(e.serviceInstance, "spec.clusterServicePlanRef.name");
6400
- e.servicePlans = _.reject(t, function(e) {
6405
+ e.servicePlans = _.reject(t.by("metadata.name") , function(e) {
6401
6406
return _.get(e, "status.removedFromBrokerCatalog") && e.metadata.name !== n;
6402
- }), e.plan = t[n], S(), C();
6403
- });
6407
+ }), k(), p = null;
6408
+ }));
6409
+ }, j = function() {
6410
+ e.serviceInstance && !m && (e.serviceClass ? P() : m = d.fetchServiceClassForInstance(e.serviceInstance).then(function(t) {
6411
+ e.serviceClass = t, e.displayName = v(e.serviceInstance, e.serviceClass), b(), m = null, P();
6404
6412
}));
6405
- }, k = function(t, n) {
6413
+ }, R = function(t, n) {
6406
6414
e.loaded = !0, e.serviceInstance = t, "DELETED" === n && (e.alerts.deleted = {
6407
6415
type: "warning",
6408
6416
message: "This provisioned service has been deleted."
6409
- }), w (), b (), C ();
6417
+ }), j (), C (), S ();
6410
6418
};
6411
6419
l.get(n.project).then(_.spread(function(a, o) {
6412
6420
e.project = a, e.projectContext = o, s.get(e.serviceInstancesVersion, n.instance, o, {
6413
6421
errorNotification: !1
6414
6422
}).then(function(t) {
6415
- k (t), p .push(s.watchObject(e.serviceInstancesVersion, n.instance, o, k )), p .push(s.watch(h , o, function(n) {
6423
+ R (t), f .push(s.watchObject(e.serviceInstancesVersion, n.instance, o, R )), f .push(s.watch(y , o, function(n) {
6416
6424
var a = n.by("metadata.name");
6417
6425
e.bindings = r.getBindingsForResource(a, t);
6418
6426
}));
@@ -6430,7 +6438,7 @@ message: "The service details could not be loaded.",
6430
6438
details: t("getErrorDetails")(n)
6431
6439
};
6432
6440
})), e.$on("$destroy", function() {
6433
- s.unwatchAll(p ), s.unwatchAll(f );
6441
+ s.unwatchAll(f ), s.unwatchAll(g );
6434
6442
});
6435
6443
} ]), angular.module("openshiftConsole").controller("SecretsController", [ "$routeParams", "$scope", "DataService", "ProjectsService", function(e, t, n, a) {
6436
6444
t.projectName = e.project, t.secretsByType = {}, a.get(e.project).then(_.spread(function(e, a) {
0 commit comments