Skip to content

Function getNestedField in FormFIeld doesn't return correct value for objects containing arrays  #580

@dvcanton

Description

@dvcanton

Describe the bug
When using the FormField component in a form containing nested arrays (for example, the new sources field in Argo's application spec definition), the implemented function will not return the correct value for the field.

How to reproduce
Use an object containing an array as src parameter and a path inside the array.
Example:

src:
{
    "apiVersion": "argoproj.io/v1alpha1",
    "kind": "Application",
    "metadata": {
        "name": ""
    },
    "spec": {
        "destination": {
            "name": "",
            "namespace": "",
            "server": ""
        },
        "sources": [
            {
                "repoURL": "https://github.com/argoproj/argocd-example-apps.git",
                "name": "guestbook",
                "path": "guestbook",
                "ref": "guestbook"
            }
        ],
        "project": ""
    }
}

path: spec.sources[0].repoURL

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions