Closed david-martin closed 4 years ago
ping @spadgett @PhilipGough @pb82 @maleck13
Related to UI & Broker changes discussed in https://github.com/openshift/ansible-service-broker/issues/859 & https://github.com/openshift/origin-web-catalog/pull/675
In the example I see a field always shows. Is it possible to not show any fields also? excuse my ignorance just not sure
@maleck13 do you mean "don't show this field if another field has a specific value" ?
If yes, I don't think that's part of json schema dependencies. i.e. you define fields that are dependencies of others, but not fields that are negated dependencies. You can workaround this though quite easily e.g
In this case, field 3 & 4 won't be shown if option 1 is selected on field 1.
Is there a use case you're thinking of?
@philipgough I've added support for below if you want to try it again:
After discussion on https://github.com/openshift/ansible-service-broker/issues/859#issuecomment-387359151 I'll look to round out this PR by allowing oneOf
conditions with booleans and numbers (not just string).
@spadgett This is ready for review now. Where would be an appropriate place for documenting this catalog feature?
@spadgett Thanks for the feedback. My typescript skills are obviously lacking :)
I've pushed up changes for re-review
@spadgett ok to merge this now as it is generically useful
Issues go stale after 90d of inactivity.
Mark the issue as fresh by commenting /remove-lifecycle stale
.
Stale issues rot after an additional 30d of inactivity and eventually close.
Exclude this issue from closing by commenting /lifecycle frozen
.
If this issue is safe to close now please do so with /close
.
/lifecycle stale
Out of date, no longer required
This change examines the json schema object in the service plan, looking for a
dependencies
object. If this exists, anyoneOf
property dependencies defined will be examined and a corresponding angular-schema-formcondition
will be added to the form definition so specified fields will only be shown when the corresponding option is selected/entered in another field.Short clip of how it looks https://youtu.be/MX-G0TjaP7E
Example plan
Example parameters in an apb.yml (pending related broker changes in https://github.com/openshift/ansible-service-broker/pull/928)
Changes based on initial integration with broker (with @philipgough)
dependencies
and in theproperties