-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
add firstName and lastName to UserDTO and IUser #14229
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Additional fields should not be generated by default but on demand.
generators/server/templates/src/main/java/package/service/dto/UserDTO.java.ejs
Outdated
Show resolved
Hide resolved
generators/server/templates/src/main/java/package/service/dto/UserDTO.java.ejs
Outdated
Show resolved
Hide resolved
generators/server/templates/src/main/java/package/service/dto/UserDTO.java.ejs
Outdated
Show resolved
Hide resolved
generators/server/templates/src/main/java/package/service/dto/UserDTO.java.ejs
Outdated
Show resolved
Hide resolved
generators/server/templates/src/test/java/package/web/rest/PublicUserResourceIT.java.ejs
Outdated
Show resolved
Hide resolved
generators/server/templates/src/test/java/package/web/rest/PublicUserResourceIT.java.ejs
Outdated
Show resolved
Hide resolved
generators/server/templates/src/test/java/package/web/rest/PublicUserResourceIT.java.ejs
Outdated
Show resolved
Hide resolved
Thanks for the reply and I added all changes @mshima but the PublicUserResourceIT it's crashing because the DEFAULT_FIRSTNAME and DEFAUL_LASTNAME has wrong constants.
generates: but should be: Should i adding some function to convertToConstants ? |
generators/client/templates/angular/src/main/webapp/app/entities/user/user.model.ts.ejs
Outdated
Show resolved
Hide resolved
generators/client/templates/angular/src/main/webapp/app/entities/user/user.model.ts.ejs
Outdated
Show resolved
Hide resolved
generators/server/templates/src/main/java/package/service/dto/UserDTO.java.ejs
Outdated
Show resolved
Hide resolved
generators/server/templates/src/main/java/package/service/dto/UserDTO.java.ejs
Outdated
Show resolved
Hide resolved
generators/server/templates/src/main/java/package/service/dto/UserDTO.java.ejs
Outdated
Show resolved
Hide resolved
generators/server/templates/src/main/java/package/service/dto/UserDTO.java.ejs
Outdated
Show resolved
Hide resolved
generators/server/templates/src/test/java/package/web/rest/PublicUserResourceIT.java.ejs
Outdated
Show resolved
Hide resolved
generators/server/templates/src/test/java/package/web/rest/PublicUserResourceIT.java.ejs
Outdated
Show resolved
Hide resolved
generators/server/templates/src/test/java/package/web/rest/PublicUserResourceIT.java.ejs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no test case that uses those custom fields, not sure is a feature we must add tests for.
I am supposing it's working.
yeah, i don't know the jhipster policy for tests, but i already know a edge case. if a end user create project and trying to import jdl that uses firtsName as display field, the jdl will be generate but the code will be broken. The end user need to regenerate the entity User. |
With this PR it's the developer choice what fields to expose. It's not a privacy problem. |
Thanks @VergilSkye |
Thanks @mshima for your help, guidance and all the work done on the Jhipster project. I am very excited about V7 and for having a small participation in this release. |
As discussed in #14164. firstName and lastName were removed from the user for
securityprivacy reasons, so they cannot be used as a display fields.this pr returns the old behavior and allows firstName and lastName to be used, but I don't think it should be merged without discussing options.
in my view, we have 3 options
Don't merge this pr and and classify this as custom behavior. Focus on
securityprivacyMerge this pr and rollback the old behavior. Old jdls, which use these fields, can be imported with as little friction as possible. Focus on backward compatibility
Allow jdl using firstName and lastName but dont change User and IUser. this will break the code but we can create a tip on how to make the code work again write custom code ( how to change User java, integration test and IUser class). Balance between 1 and 2.
Please make sure the below checklist is followed for Pull Requests.
When you are still working on the PR, consider converting it to Draft (bellow reviewers) and adding
skip-ci
label, you can still see CI build result at your branch.