-
-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Fix React Travis build #7506
Fix React Travis build #7506
Conversation
@chrisdns Please let me know if you have any questions about how OAuth should work. I coded a lot of it, so happy to help! |
generators/client/files-react.js
Outdated
condition: generator => generator.authenticationType === 'oauth2', | ||
path: REACT_DIR, | ||
templates: [ | ||
'shared/reducers/user-service.ts' |
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.
please name it as user-management
as service is used only in context of angular
2b24616
to
db6b6a3
Compare
@@ -89,7 +89,11 @@ Object.keys(differentRelationships).forEach(key => { | |||
if (uniqueRel.otherEntityAngularName === 'User') { | |||
_%> | |||
import { I<%= uniqueRel.otherEntityAngularName %> } from 'app/shared/model/user.model'; | |||
<%_ if (authenticationType === 'oauth2') { _%> |
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.
I think there is a stray file user-service.spec.ts.ejs
in this PR. Can you check. Other than that, this PR is ready to merge
db6b6a3
to
9ec3b4c
Compare
@@ -82,7 +82,7 @@ _%> | |||
<%_ } _%> | |||
<%_ if (databaseType === 'sql') { _%> | |||
|
|||
default <%= entityClass %> fromId(<% if (hasOAuthUser) { _%>String<%_ } else { _%>Long<% } %> id) { | |||
default <%= entityClass %> fromId(Long id) { |
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.
@mraible is this change good ? It fixes the error incompatible types: java.lang.String cannot be converted to java.lang.Long
with some entities and auth with oauth2 seems to works well but i may have missed something
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.
If you choose OAuth/OIDC as your authenticationType, the user's id is a string. Is this breaking the build?
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.
Yes. When we create entity with mapper that has relationship with 'user' (in a project using oauth2 authentication), the related mapper class has a string as fromId() function argument and this is indeed breaking the build.
I tried to switch it to Long and it doesnt break anymore and authentication is still working.
It may be because some type changes are missing in other entity mapper related files
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.
If it doesn't break anymore, I'm Ok with this change. FWIW, it looks like you need to resolve conflicts before this can be merged.
09cc71d
to
f54ba2d
Compare
Please make sure the below checklist is followed for Pull Requests.
Travis tests are green
Tests are added where necessary
Documentation is added/updated where necessary
Coding Rules & Commit Guidelines as per our CONTRIBUTING.md document are followed