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

Respect 'title' field when rendering object properties from json schema in helm charts #878

Closed
skykanin opened this issue Nov 20, 2024 · 6 comments
Assignees

Comments

@skykanin
Copy link

Currently object property names are rendered in the onyxia UI by capitalizing the json key. Instead read the corresponding 'title' field the same way it is done when rendering other data types in the form.

So a property like this in values.schema.json:

...
"sourceData": {
  "title": "Kildedata",
  "description": "Tilgang som data-admins krever begrunnelse og lengde på varighet",
  "type": "object",
  "properties": ...
}

should instead render with the name "Kildedata" and not "SourceData".
image

@ddecrulle
Copy link
Contributor

Hello,

The screenshot you provided suggests that you might not be using the latest version of Onyxia. It seems that the most recent versions do support rendering the “title” property.

Let me know if you need further assistance!

@skykanin
Copy link
Author

We're running version 10.1.9 of onyxia and the offending code I linked is taken from the main branch of the onyxia github repository so I would assume this behaviour is included in the latest version.

@ddecrulle
Copy link
Contributor

Really sorry, I overinterpreted. I’ve made the fix and am waiting for @garronej feedback. Thank you for the report!

@garronej
Copy link
Contributor

Hello @skykanin thanks for reporting and @ddecrulle thanks for taking this so quickly.

@skykanin
Copy link
Author

AFAICT the fix in 4bd9b0a only applies to root settings elements, but the 'title' field in non-root object properties should be respected too.

In the example below the root "resources" title is now rendered correctly as "Ressurser", but title field "Forespørsel" of the non-root property "requests" is ignored and is still rendered by capitalizing the json key "requests".

This was tested on tag: web-v4.34.14, tag: v10.1.13 of onyxia-web.

image

{
   "resouces": {
      "title": "Ressurser",
      "description": "Velg minimum mengde RAM og CPU som skal være tilgjengelig i tjenesten.",
      "type": "object",
      "properties": {
         "requests": {
            "title": "Forespørsel", // This is not used during rendering
            "description": "Velg mengden CPU-ressurser i millicores (M)",
            "type": "object",
            "properties": {
               "cpu": {...},
               "memory": {...}
               }
            }
         }
      }
}

@ddecrulle ddecrulle reopened this Nov 25, 2024
@garronej garronej self-assigned this Nov 26, 2024
garronej added a commit that referenced this issue Nov 26, 2024
@garronej
Copy link
Contributor

Hello @skykanin it should be fixed for good now.
Thank you for reporting!

garronej added a commit that referenced this issue Nov 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants