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