jhipster / generator-jhipster

JHipster is a development platform to quickly generate, develop, & deploy modern web applications & microservice architectures.
https://www.jhipster.tech
Apache License 2.0
21.4k stars 4.02k forks source link

Vue: Blank Parent column in Child entity list for both one-to-one and many-to-one relationships #25846

Open vw98075 opened 4 months ago

vw98075 commented 4 months ago
Overview of the issue

For an one-to-one relationship:

@service(serviceClass)
entity Parent {
    name String required
}

@service(serviceClass)
entity Child {
    name String required
}

relationship OneToOne {
    Child{parent(name)} to @Id Parent{child(name)}
}

and a many-to-one relationship:

@service(serviceClass)
entity Parent {
    name String required
}

@service(serviceClass)
entity Child {
    name String required
}

relationship ManyToOne {
    Child{parent(name)} to Parent{child(name)}
}

The parent column of a Child entity list is blank although the field isn't blank on both view and edit pages.

Motivation for or Use Case
Reproduce the error
Related issues
Suggest a Fix
JHipster Version(s)

8.3

JHipster configuration
{
  "generator-jhipster": {
    "applicationType": "monolith",
    "authenticationType": "jwt",
    "baseName": "manyToOne",
    "buildTool": "gradle",
    "cacheProvider": "ehcache",
    "clientFramework": "vue",
    "clientTestFrameworks": [],
    "clientTheme": "none",
    "creationTimestamp": 1713067956252,
    "databaseType": "sql",
    "devDatabaseType": "h2Memory",
    "devServerPort": 9060,
    "enableGradleEnterprise": false,
    "enableHibernateCache": false,
    "enableSwaggerCodegen": false,
    "enableTranslation": false,
    "entities": ["Parent", "Child"],
    "feignClient": null,
    "gradleEnterpriseHost": null,
    "jhipsterVersion": "8.3.0",
    "jwtSecretKey": "...",
    "lastLiquibaseTimestamp": 1713068387000,
    "messageBroker": false,
    "microfrontend": null,
    "microfrontends": [],
    "nativeLanguage": "en",
    "packageName": "com.mycompany.myapp",
    "prodDatabaseType": "postgresql",
    "reactive": false,
    "searchEngine": false,
    "serverPort": null,
    "serverSideOptions": [],
    "serviceDiscoveryType": false,
    "syncUserWithIdp": null,
    "testFrameworks": [],
    "websocket": false,
    "withAdminUi": true
  }
}
Entity configuration(s) entityName.json files generated in the .jhipster directory
Browsers and Operating System
qmonmert commented 4 months ago

@DanielFran I confirm bug

@vw98075 can you try #25876 ?

mraible commented 3 months ago

I'm not sure this is related, but I'm seeing a similar issue in my jhipster8-demo project. If I clone the project, run rm -rf *, and recreate it from the main branch with jhipster, the user column is not populated when I view the blog listing.

Screenshot 2024-04-29 at 2 12 22 PM

If you look at the screenshot in the tutorial for this project, the user was rendered in 8.1.0.

image

mraible commented 3 months ago

Nevermind, the reason there's no user listed is because there is no user assigned by Faker. It works as expected with the main branch if I modify the data.

Screenshot 2024-04-29 at 2 16 12 PM
qmonmert commented 3 months ago

@mraible working also when you view and edit?

mraible commented 3 months ago

@qmonmert Yes.

qmonmert commented 3 months ago

@mraible ok it works on Angular but not with Vue

mraible commented 3 months ago

@qmonmert I changed the project to use Vue and it seems to work as expected.

Screenshot 2024-04-29 at 2 29 51 PM

React works too.

Screenshot 2024-04-29 at 2 33 49 PM

Maybe this issue is about something other than the relationships I have in my project? Here's the JDL that jhipster8-demo uses:

entity Blog {
  name String required minlength(3)
  handle String required minlength(2)
}

entity Post {
  title String required
  content TextBlob required
  date Instant required
}

entity Tag {
  name String required minlength(2)
}

relationship ManyToOne {
  Blog{user(login)} to User with builtInEntity
  Post{blog(name)} to Blog
}

relationship ManyToMany {
  Post{tag(name)} to Tag{post}
}

paginate Post, Tag with infinite-scroll