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

Details page fails to render spec fields with kebab-case #3127

Closed
kevin-kho opened this issue Aug 15, 2024 · 2 comments · Fixed by #3348
Closed

Details page fails to render spec fields with kebab-case #3127

kevin-kho opened this issue Aug 15, 2024 · 2 comments · Fixed by #3348
Assignees
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@kevin-kho
Copy link
Contributor

Description

When rendering a CustomResource, if the spec has fields with kebab-case (example: spec.redisConfiguration.notify-keyspace-events). It will fail to render the values on Details page.

The field renders fine for the Form page (both UI and YAML).

Expected result

Detail page renders the values for kebab-case fields

Actual result

Detail page fails to render the values for kebab-case fields

Steps to reproduce

Detail page fails to render the kebab-case fields
image

Form page renders it fine.
image

This is the CustomResource's YAML view

image

Troubleshooting

I dove into the busola code base and I think I narrowed it down to ExtensibilityDetails.js line 113 where customComponents is defined.

@kevin-kho
Copy link
Contributor Author

I've narrowed it down to the following code in useJsonata.ts; it fails to retrieve the value if the query is kebab-case

  const value = jsonataWrapper(query).evaluate(
    extras.scope || scope || extras.resource || resource,
    {
      ...mapValues(dataSourceFetchers, dsf => dsf.value),
      root: extras.resource || resource,
      parent: parent,
      embedResource: embedResource,
      items: extras?.arrayItems || arrayItems,
      item:
        last(extras?.arrayItems) ||
        last(arrayItems) ||
        extras.resource ||
        resource,
      ...extras,
    },
  );

@kevin-kho
Copy link
Contributor Author

kevin-kho commented Aug 15, 2024

The jsonataWrapper(query) seems to split the key on - thinking it's a path. I think Jsonata is taking the - as an expression

image

@mrCherry97 mrCherry97 added the kind/bug Categorizes issue or PR as related to a bug. label Sep 12, 2024
@chriskari chriskari self-assigned this Sep 13, 2024
@chriskari chriskari linked a pull request Sep 16, 2024 that will close this issue
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants