Skip to content
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

Add JSON Schema editor view #5530

Merged
merged 15 commits into from
Oct 26, 2022
Merged

Add JSON Schema editor view #5530

merged 15 commits into from
Oct 26, 2022

Commits on Oct 20, 2022

  1. Add SchemaEditorForm

    Signed-off-by: Antonio Gamez Diaz <agamez@vmware.com>
    antgamdia committed Oct 20, 2022
    Configuration menu
    Copy the full SHA
    064b5a4 View commit details
    Browse the repository at this point in the history
  2. add missing files

    Signed-off-by: Antonio Gamez Diaz <agamez@vmware.com>
    antgamdia committed Oct 20, 2022
    Configuration menu
    Copy the full SHA
    00b62e0 View commit details
    Browse the repository at this point in the history

Commits on Oct 21, 2022

  1. Yaml decoding fix (#5531)

    ### 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 <agamez@vmware.com>
    antgamdia authored Oct 21, 2022
    Configuration menu
    Copy the full SHA
    bb64580 View commit details
    Browse the repository at this point in the history
  2. Use more json schema annotations in the basic form (#5532)

    ### Description of the change
    
    As pointed out by @jl-beast at
    #5512, we could
    leverage more JSON Schema built-in annotations to enrich the UX.
    
    This PR (and the stacked ones) is adding support for `examples`,
    `readOnly`, `deprecated`, `maxItems`, `multipleOf` amongst others
    (following
    http://json-schema.org/draft/2020-12/json-schema-validation.html#name-a-vocabulary-for-structural)
    
    ### Benefits
    
    Richer UX in the basic form for complex schemas
    
    ### Possible drawbacks
    
    N/A
    
    ### Applicable issues
    
    - fixes #5525 
    
    ### 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 3 out of 6
    
    Signed-off-by: Antonio Gamez Diaz <agamez@vmware.com>
    antgamdia authored Oct 21, 2022
    Configuration menu
    Copy the full SHA
    291a4f0 View commit details
    Browse the repository at this point in the history
  3. Consistent json schema validation of SliderParams (#5533)

    ### Description of the change
    
    As pointed out by @dud225, we weren't enforcing the numeric validation
    consistently in both the slider and the text input. Besides, we were
    missing some json schema fields like `exclusiveMinimum` and
    `exclusiveMaximum`.
    This PR is to fix that.
    
    ### Benefits
    
    Consistent param validation
    
    ### Possible drawbacks
    
    N/A
    
    ### Applicable issues
    
    - fixes #5520
    
    ### 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 4 out of 6
    
    
    
    ````json
        "number-maxmin": {
          "type": "number",
          "maximum": 10,
          "exclusiveMaximum": 9,
          "minimum": 2,
          "exclusiveMinimum": 1
        },
    `````
    
    
    ![image](https://user-images.githubusercontent.com/11535726/197026623-2c2a5284-f939-4af2-a1a2-9816cf65234d.png)
    
    
    ![image](https://user-images.githubusercontent.com/11535726/197026701-370c21d3-7164-405d-b77b-56dd58472dbb.png)
    
    
    Also, note the HTML5 additional validation (user's browser locale msgs):
    
    
    ![image](https://user-images.githubusercontent.com/11535726/197026840-b5dd2e98-245b-4b55-b52a-1deaf0746866.png)
    
    Signed-off-by: Antonio Gamez Diaz <agamez@vmware.com>
    antgamdia authored Oct 21, 2022
    Configuration menu
    Copy the full SHA
    ee3e7b2 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    9fe8529 View commit details
    Browse the repository at this point in the history

Commits on Oct 24, 2022

  1. Add test cases and minor fixes on the form parms (#5548)

    ### Description of the change
    
    Once each of the PRs of the series related to [this
    milestone](https://github.com/vmware-tanzu/kubeapps/milestone/27) has
    been merged, this final one is adding/fixing the test cases: adding new
    ones for the functionality we've added and fixing others. Besides, some
    minor fixes have been added (which have been discovered with the unit
    tests :P)
    
    ### Benefits
    
    Tests will pass now.
    
    ### Possible drawbacks
    
    N/A
    
    ### Applicable issues
    
    - related #3535
    
    ### 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).
    >  PR 6 out of 6
    
    
    Edit: existing e2e tests are also failing :S, will have a look at them
    next week.
    
    Signed-off-by: Antonio Gamez Diaz <agamez@vmware.com>
    antgamdia authored Oct 24, 2022
    Configuration menu
    Copy the full SHA
    0a3ae45 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    6107fa5 View commit details
    Browse the repository at this point in the history
  3. Fix e2e class selectors

    Signed-off-by: Antonio Gamez Diaz <agamez@vmware.com>
    antgamdia committed Oct 24, 2022
    Configuration menu
    Copy the full SHA
    895f202 View commit details
    Browse the repository at this point in the history
  4. Fix editor class selectors. Fix minor style margin issue

    Signed-off-by: Antonio Gamez Diaz <agamez@vmware.com>
    antgamdia committed Oct 24, 2022
    Configuration menu
    Copy the full SHA
    8a46b81 View commit details
    Browse the repository at this point in the history
  5. Fix selector in test

    Signed-off-by: Antonio Gamez Diaz <agamez@vmware.com>
    antgamdia committed Oct 24, 2022
    Configuration menu
    Copy the full SHA
    e3fca14 View commit details
    Browse the repository at this point in the history

Commits on Oct 26, 2022

  1. SchemaEditor behind a feature flag (#5564)

    ### Description of the change
    
    As per the discussion in
    #5530, this PR is adding a
    `featureFlags.schemaEditor` flag to enable the schema editor for those
    users who really want it.
    
    ### Benefits
    
    The schema editor will be available, but only if really needed.
    
    ### Possible drawbacks
    
    It is a work-in-progress feature until we also save the schema or use in
    the backend.
    
    ### Applicable issues
    
    - related #3535 
    
    ### Additional information
    
    I've fixed some typos here as well.
    
    Signed-off-by: Antonio Gamez Diaz <agamez@vmware.com>
    antgamdia authored Oct 26, 2022
    Configuration menu
    Copy the full SHA
    0ab3d3a View commit details
    Browse the repository at this point in the history
  2. Change feature flag from bool to obj

    Signed-off-by: Antonio Gamez Diaz <agamez@vmware.com>
    antgamdia committed Oct 26, 2022
    Configuration menu
    Copy the full SHA
    ed3075b View commit details
    Browse the repository at this point in the history
  3. Merge branch 'main'

    Signed-off-by: Antonio Gamez Diaz <agamez@vmware.com>
    
    Conflicts:
    	chart/kubeapps/Chart.yaml
    	chart/kubeapps/README.md
    	chart/kubeapps/values.yaml
    antgamdia committed Oct 26, 2022
    Configuration menu
    Copy the full SHA
    4e7d1a3 View commit details
    Browse the repository at this point in the history
  4. fix typos in the values.yaml file

    Signed-off-by: Antonio Gamez Diaz <agamez@vmware.com>
    antgamdia committed Oct 26, 2022
    Configuration menu
    Copy the full SHA
    a95485b View commit details
    Browse the repository at this point in the history