Service instance details configuration and edit#2237
Service instance details configuration and edit#2237openshift-merge-robot merged 1 commit intoopenshift:masterfrom
Conversation
|
|
||
| $scope.showConfigValues = false; | ||
|
|
||
| $scope.toggleConfigValues = function() { |
There was a problem hiding this comment.
nit: I have a small preference for calling them parameter values in the code since it's what they're called in the API.
| $scope.parameterData = angular.extend($scope.parameterData, _.get($scope.serviceInstance, 'spec.parameters', {})); | ||
|
|
||
| _.each(_.get($scope.serviceInstance, 'spec.parametersFrom'), function(parametersSource) { | ||
| secretWatcher = DataService.watchObject("secrets", _.get(parametersSource, 'secretKeyRef.name'), $scope.projectContext, function (secret) { |
There was a problem hiding this comment.
If there's more than one secret, you'll lose the previous secretWatcher reference and leak watches
| var updatePlan = function() { | ||
| if (ServiceInstancesService.isCurrentPlan($scope.serviceInstance, $scope.plan)) { | ||
| var updateParameterSchema = function() { | ||
| $scope.parameterFormDefinition = angular.copy(_.get($scope.plan, 'spec.externalMetadata.schemas.service_instance.create.openshift_form_definition')); |
There was a problem hiding this comment.
For update I think this should be
spec.externalMetadata.schemas.service_instance.update.openshift_form_definition
| var updateParameterSchema = function() { | ||
| $scope.parameterFormDefinition = angular.copy(_.get($scope.plan, 'spec.externalMetadata.schemas.service_instance.create.openshift_form_definition')); | ||
|
|
||
| $scope.parameterSchema = angular.copy(_.get($scope.plan, 'spec.instanceCreateParameterSchema')); |
There was a problem hiding this comment.
spec.instanceUpdateParameterSchema
| $scope.displayName = serviceInstanceDisplayName($scope.serviceInstance, $scope.serviceClass); | ||
| updateBreadcrumbs(); | ||
|
|
||
| Catalog.getServicePlans().then(function(plans) { |
There was a problem hiding this comment.
We should be able to only request plans for a specific service class, but OK for now. I worry down the road that this might be a lot of data, though.
| <overlay-panel show-panel="editDialogShown" handle-close="closeEditDialog"> | ||
| <update-service | ||
| project="project" | ||
| display-name="serviceInstance | serviceInstanceDisplayName:serviceClasses" |
There was a problem hiding this comment.
You'll need to rebase. This now takes in one service class instead of a map.
| View Secret | ||
| </a> | ||
| </div> | ||
| <div class="service-binding-parameters" ng-if="$ctrl.bindParameterSchema.properties && (true || !($ctrl.binding | isBindingFailed) && ($ctrl.binding | isBindingReady))"> |
There was a problem hiding this comment.
Is there a reason not to show parameter for failed bindings? It might help the user debug.
| </a> | ||
| </div> | ||
| <div class="service-binding-parameters" ng-if="$ctrl.bindParameterSchema.properties && (true || !($ctrl.binding | isBindingFailed) && ($ctrl.binding | isBindingReady))"> | ||
| <span class="parameters-heading">PARAMETERS</span> |
There was a problem hiding this comment.
<span class="parameters-heading">Parameters</span>and use text-transform to make it uppercase in CSS
| </div> | ||
| <div class="service-binding-parameters" ng-if="$ctrl.bindParameterSchema.properties && (true || !($ctrl.binding | isBindingFailed) && ($ctrl.binding | isBindingReady))"> | ||
| <span class="parameters-heading">PARAMETERS</span> | ||
| <a href="" ng-click="$ctrl.toggleShowParameterValues()">{{$ctrl.showParameterValues ? 'Hide Values' : 'Reveal Values'}}</a> |
| <div class="service-binding-parameters" ng-if="$ctrl.bindParameterSchema.properties && (true || !($ctrl.binding | isBindingFailed) && ($ctrl.binding | isBindingReady))"> | ||
| <span class="parameters-heading">PARAMETERS</span> | ||
| <a href="" ng-click="$ctrl.toggleShowParameterValues()">{{$ctrl.showParameterValues ? 'Hide Values' : 'Reveal Values'}}</a> | ||
| <a ng-if="!$ctrl.binding.metadata.deletionTimestamp" href="" ng-click="$ctrl.editParameters()">Edit</a> |
278a077 to
33a944f
Compare
33a944f to
24901be
Compare
|
Believe I have addressed @spadgett comments. Have not been able to test with multiple plans and/or editable plans. |
24901be to
5f705f4
Compare
5f705f4 to
314219b
Compare
314219b to
4aa04c1
Compare
|
@jmontleon FYI, this is the plan and parameter update PR. We saw some problems (in our code) when working against your ASB changes that we're debugging now. |
4aa04c1 to
2e578cf
Compare
|
Fixed updating the plan editability while being updated. No known issues atm, but have not tested updating the service instance's parameters with an instanceUpdateParameterSchema. |
7fe74fb to
c237c65
Compare
c237c65 to
e0ce938
Compare
|
|
||
| $scope.parameterData = angular.extend($scope.parameterData, _.get($scope.serviceInstance, 'spec.parameters', {})); | ||
|
|
||
| if (AuthorizationService.canI('secrets', 'get', $scope.projectName)) { |
There was a problem hiding this comment.
This means that you will not be able to see that there's a parameter at all when it comes from a secret and you can't get the secret, correct?
We could possibly fill in the redacted values using status.externalProperties.parameters when users can't list secrets (without letting them reveal). I'm OK handling this as a follow on, however.
There was a problem hiding this comment.
@spadgett What should we do when the user does reveal and we have redacted values for some of the parameters? Continue to show ***** for those parameters?
There was a problem hiding this comment.
Maybe remove the "reveal" action?
There was a problem hiding this comment.
I think we're close enough here it should be a follow-on anyway.
|
The checkboxes issue is fixed in the catalog-parameters component |
e0ce938 to
9699099
Compare
| padding-bottom: 0; | ||
| } | ||
|
|
||
| .config-parameters-form { |
There was a problem hiding this comment.
Nit: alpha of this rule and the rules nested within
There was a problem hiding this comment.
@rhamilto do we alpha ignoring the . or are there any preferences on selector type ordering?
There was a problem hiding this comment.
Generally ignore the non-alpha characters as I think most folks don't think about 'em when they're scanning the code. The overall goal is to make the Less more human-readable. You would not believe the number of times I've seen rules declared multiple times or even the same declaration twice within the same rule. Either way this rule should come first in this block. :)
| </dl> | ||
| <div class="hidden-lg"> | ||
| <h3 ng-if-start="serviceClass.spec.description || serviceClass.spec.externalMetadata.longDescription">Description</h3> | ||
| <dl ng-if-end class="dl-horizontal left"> |
There was a problem hiding this comment.
A dl should only contain dt, dd, or div/script/template elements. So either don't use a dl or change the p elements to divs and add a margin using a helper class (e.g., mar-bottom-md)? I think I prefer the former as that maintains the semantic value of the p.
There was a problem hiding this comment.
No need for the dl. Just remove it and render the p as individual elements.
| <div class="col-lg-6"> | ||
| <div class="hidden-xs hidden-sm hidden-md"> | ||
| <h3 ng-if-start="serviceClass.spec.description || serviceClass.spec.externalMetadata.longDescription">Description</h3> | ||
| <dl ng-if-end class="dl-horizontal left"> |
9699099 to
56b9d70
Compare
|
Addressed @rhamilto comments. Removed WIP status 🙌 🤘 |
| if (ServiceInstancesService.isCurrentPlan($scope.serviceInstance, $scope.plan)) { | ||
| return; | ||
| } | ||
| Catalog.getServicePlans().then(function (plans) { |
There was a problem hiding this comment.
When we fix the removed plans, let's use a field filter on list to get just the plans for this service class and filter removed plans client side (follow on)
| _.each(_.get(ctrl.binding, 'spec.parametersFrom'), function (parametersSource) { | ||
| DataService.get('secrets', _.get(parametersSource, 'secretKeyRef.name'), context).then(function (secret) { | ||
| try { | ||
| _.extend(ctrl.parameterData, SecretsService.decodeSecretData(secret.data).parameters); |
There was a problem hiding this comment.
This is not always parameters. It is the secretKeyRef.key
There was a problem hiding this comment.
Surprised you don't need a JSON.parse here
There was a problem hiding this comment.
Yes. Thanks, I do need a JSON.parse here.
|
Looks like a dist mismatch |
56b9d70 to
cbe5aba
Compare
|
/retest |
cbe5aba to
ce5a3ef
Compare
|
/lgtm |
|
Automatic merge from submit-queue. |

Depends on openshift/origin-web-catalog#474
Fixes #2278 with catalog version bump
Bumped origin-web-catalog to 0.0.56