-
Notifications
You must be signed in to change notification settings - Fork 710
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create additional "JSON Schema form" param renderers #5436
Labels
component/ui
Issue related to kubeapps UI
kind/enhancement
An issue that reports an enhancement for an implemented feature
Milestone
Comments
This was referenced Oct 20, 2022
Merged
antgamdia
added a commit
that referenced
this issue
Oct 21, 2022
### Description of the change While working on #5436, I noticed some errors during the YAML parsing; well not errors, but unexpected (for me) values being returned by the `genIn` method. In collections, the returned thing is not a js object, but a custom data type from the YAML library. This PR is just to convert collections (YAML sequences and YAML maps) back to plain js objects (even if the function says `toJSON()` 😅 ### Benefits We will be able to use arrays and object fields in the form. ### Possible drawbacks N/A ### Applicable issues - fixes #5519 ### Additional information > **Note** > This PR is part of a series of PRs aimed at closing [this milestone](https://github.com/vmware-tanzu/kubeapps/milestone/27). I have split the changes to ease the review process, but as there are many interrelated changes, the tests will be performed in a separate PR (on top of the branch containing all the changes). > PR 2 out of 6 Signed-off-by: Antonio Gamez Diaz <[email protected]>
antgamdia
added a commit
that referenced
this issue
Oct 21, 2022
### Description of the change In #5436 we mentioned that several fields were still pending, namely - 1st level: object (at least, as array of tuples <string, any> for defining each property. - Array level: enum, arrays, objects WRT the top-level objects, it is not an actual problem: if they have `properties`, they will get rendered as any other nested param more. It is only the case when it lacks the `properties` fields that we need to handle. - Solution: allow any serialized object like `{"foo": 1234}` and add more validation messages. WRT the array-level properties: - Solution for enum: use the same approach as in the top-level enum. - Solution for arrays and objects: use the same approach as in the top-level objects: render a text field but enforce validation. Additionally, the array now enforces `maxItems` and `minItems` ### Benefits Every json schema datatype is now supported. ### Possible drawbacks N/A ### Applicable issues - fixes #5436 ### Additional information > **Note** > This PR is part of a series of PRs aimed at closing [this milestone](https://github.com/vmware-tanzu/kubeapps/milestone/27). I have split the changes to ease the review process, but as there are many interrelated changes, the tests will be performed in a separate PR (on top of the branch containing all the changes). > PR 5 out of 6 #### `Top-level objects`:  #### `Array<enum>`:  #### `Array<array>`:  #### `Array<object>`:  #### `YAML output`  #### `Array max/min items` Min items:  Max items:  Signed-off-by: Antonio Gamez Diaz <[email protected]>
Repository owner
moved this from 🔎 In Review
to ✅ Done
in Kubeapps
Oct 26, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
component/ui
Issue related to kubeapps UI
kind/enhancement
An issue that reports an enhancement for an implemented feature
Summary
After #5412 is done, there are some param renderers for some data types that haven't been implemented yet.
Background and rationale
We implemented some params for the more frequent data types (string, number, array, etc), but there are some still pending.
Description
Create these missing renderers (we are currently falling back to a textarea):
Acceptance criteria
Additional context
Related to #4917
The text was updated successfully, but these errors were encountered: