Closed ghacupha closed 1 year ago
I've only just started using JHipster and immediately ran into this issue. With your detailed bug report, I quickly had a trace of what is going on and how I might manually fix it for now. Thank you for that!
At the same time, I'm a little bit worried about this bug report staying open without any response for quite so long, while it's probably an easy fix (for someone in the know).
@jayveeAtWork The reason this hasn't been fixed is because we're all volunteers, with limited time, and no one has contributed a fix. I'm happy to review a PR that fixes this issue. See our contributing guide for how to do this.
https://github.com/jhipster/generator-jhipster/blob/main/CONTRIBUTING.md
It happens when translation is disabled, which probably isn't commonly used. Had become much more useful recently with native translation.
The offending like is https://github.com/jhipster/generator-jhipster/blob/fa1d0411a17c294d0d7ad4b88c90d3c619887868/generators/client/templates/entity/angular/src/main/webapp/app/entities/update/entity-management-update.component.html.ejs#L53. It's quite easy, maybe you could provide the PR.
@mraible and @mshima I know exactly what you mean when you say limited time. It's the same case here. Am also not very confident in ejs, but will give it a try, now that I have seen that entity-management-update-html line.
Mmh! Ran into #19981. I try later when I figure out this cjs thing since I can't run builder tests
Ok done. Currently, run the pr #20190
Thanks @ghacupha
Overview of the issue
The options of an enumeration do not render properly on the template of an angular client. To display the values of the enumeration within an entity, the generator creates a loop with the *ngFor directive within the custom option tag. But the result is one only sees the class name of the enumeration. This is because the class name is included within the option tag without the brackets to indicate interplation {{ }}. This is what you see on the template of the update component for an entity that contains an enumeration field.
This is how the form-control looks like:
Motivation for or Use Case
The view on the update form consists only of options listed as the name of the enumeration class and the user wouldn't know which option of an enumeration they wanted when creating a record.
Reproduce the error
It's assumed that you are starting with a project that uses the angular framework for the client, without translation
Related issues
Related issues that could have been reported have not been sighted.
Suggest a Fix
As earlier suggested, we need to ensure that the values of the enumeration are correctly rendered by using the interpolation "braces", for instance as shown below. I do not know the part of code in the generator where that is rendered or if an attempt had been made, and something is skipped by the EJS compiler, but the following should be the result.
JHipster Version(s)
Am using version 7.9.2
JHipster configuration
Entity configuration(s)
entityName.json
files generated in the.jhipster
directoryBrowsers and Operating System
Running on windows 10 pro version 1803, Google chrome browser version 104.0.5112.81 (Official Build) (64-bit)
yo-rc.json
Entity file: ProcessFrequency.json
jhipster-info.txt