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

template-export needs .label suffix for enum fields #2605

Open
tomwwinter opened this issue Oct 7, 2024 · 1 comment
Open

template-export needs .label suffix for enum fields #2605

tomwwinter opened this issue Oct 7, 2024 · 1 comment

Comments

@tomwwinter
Copy link
Contributor

Describe the bug
When exporting a dataset with the template export feature, its required to set the .label suffix on enum fields.
e.g. instad of {d.anrede} it must be {d.anrede.label}

Reason for that is, that the payload contains a nested object, instead the label of the value:

"anrede": {
    "id": "Herr",
    "label": "Herr"
}

To Reproduce
Steps to reproduce the behavior:

  1. Go to 'any client'
  2. Click on 'Datei generieren'
  3. Select prepared Template
  4. See error in downloaded file

image

Expected behavior
Should not be necessary to add .label, instead the label value should be send to the API directly.

Additional context
Add any other context about the problem here.

@sleidig
Copy link
Member

sleidig commented Oct 8, 2024

To "future-proof" this for further extensions (maybe sending multiple entities or some calculated values to the pdf generator), I would suggest to put this logic into the TemplateExportService.
We already have some data transformation logic for the csv exports (see DownloadService and the formatting logic called there) which would probably be suitable for the data of pdf exports here as well?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Todo (ready for work)
Development

No branches or pull requests

2 participants