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

bug: wrong display_label when using an enum attribute #4382

Closed
wvandeun opened this issue Sep 19, 2024 · 1 comment
Closed

bug: wrong display_label when using an enum attribute #4382

wvandeun opened this issue Sep 19, 2024 · 1 comment
Assignees
Labels
group/backend Issue related to the backend (API Server, Git Agent) type/bug Something isn't working as expected

Comments

@wvandeun
Copy link
Contributor

Component

API Server / GraphQL

Infrahub version

0.16.0

Current Behavior

When you defined display_labels that references an enum attribute, it renders the display_label as <attr_name>Enum.<variant>, where attr_name is the name of the attribute and variant is the value.

Expected Behavior

The display label should use the string version of the enum variant for the attribute that we defined in the schema.

Steps to Reproduce

  • start an instance of Infrahub
  • load the following schema
---
version: "1.0"
nodes:
  - name: Node
    namespace: Infra
    display_labels:
      - test__value
    attributes:
      - name: test
        kind: Text
        optional: false
        enum:
          - one
          - two
  • create a InfraNode instance, pick one as the value for the test attribute
  • execute the following graphql query
query {
  InfraNode {
    edges {
      node {
        display_label
      }
    }
  }
}
  • the display_label will be rendered as TestEnum.ONE

Additional Information

No response

@wvandeun wvandeun added type/bug Something isn't working as expected group/backend Issue related to the backend (API Server, Git Agent) labels Sep 19, 2024
@exalate-issue-sync exalate-issue-sync bot added this to the Infrahub - 0.16.1 milestone Sep 19, 2024
@dgarros dgarros self-assigned this Sep 21, 2024
@dgarros
Copy link
Collaborator

dgarros commented Sep 23, 2024

Fixed in #4413

@dgarros dgarros closed this as completed Sep 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
group/backend Issue related to the backend (API Server, Git Agent) type/bug Something isn't working as expected
Projects
None yet
Development

No branches or pull requests

2 participants