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

ignore not relevant fields at model #25007

Merged
merged 1 commit into from
Jan 30, 2024
Merged

ignore not relevant fields at model #25007

merged 1 commit into from
Jan 30, 2024

Conversation

mshima
Copy link
Member

@mshima mshima commented Jan 30, 2024

Fixes #24653


Please make sure the below checklist is followed for Pull Requests.

When you are still working on the PR, consider converting it to Draft (below reviewers) and adding skip-ci label, you can still see CI build result at your branch.

@DanielFran DanielFran merged commit bbcdea4 into jhipster:main Jan 30, 2024
39 checks passed
@mshima mshima deleted the rest branch January 30, 2024 17:33
@emilpaw
Copy link
Contributor

emilpaw commented Feb 1, 2024

Thanks for working on this.

I wanted to check if the behavior is now consistent between the frameworks. And it is, but I wondered why, because you only changed the template for Angular in this PR and I didn't find other relevant changes in the code.

But then I noticed that actually React and Vue use the Angular template file https://github.com/jhipster/generator-jhipster/blob/main/generators/angular/templates/src/main/webapp/app/entities/_entityFolder_/_entityFile_.model.ts.ejs for generation of their <entityName>.model.ts.

Where is it defined that React and Vue use Angular's template? Sharing templates between the frameworks is nice, but it would be easier to understand if such templates are moved to a shared folder.

Also, what are https://github.com/jhipster/generator-jhipster/blob/main/generators/vue/templates/src/main/webapp/app/shared/model/_entityModel_.model.ts.ejs and https://github.com/jhipster/generator-jhipster/blob/main/generators/react/templates/src/main/webapp/app/entities/_entityFolder_/_entityModel_.model.ts.ejs used for if not for the model type generation?

@mshima
Copy link
Member Author

mshima commented Feb 1, 2024

It's not shared.

clientApplicationTemplatesBlock({
relativePath: 'shared/model/',
templates: ['_entityModel_.model.ts'],
}),

@emilpaw
Copy link
Contributor

emilpaw commented Feb 2, 2024

I mistakenly thought I was looking at code generated with React or Vue to compare it to Angular, but I accidentally generated it all with Angular. 😅 Thanks for clarifying.

But React and Vue do still have the non-relevant fields in their models. I fix that with #25065.

@deepu105 deepu105 added this to the 8.2.0 milestone Mar 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Non-owning relationship fields in entity types
4 participants