-
-
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
Add UI and API docs custom context path support #12923
Conversation
@PierreBesson It seems you have conflicts and you need to sign CLA also |
@clocken Could you sign the CLA please as I have included your commit. Thanks! |
As for the conflict, I am unable to see it locally 🤔. |
@PierreBesson : check with your main branch, instead of master branch ;) |
I had totally forgot that it's not the same. |
018ea1d
to
3c6608f
Compare
3c6608f
to
9db704a
Compare
@PierreBesson Thanks for the implementation but it looks like we had a bit of a "race condition" here. PS: PR for doc update is here: jhipster.github.io#1030 |
Before merging, please make sure a path with multiple slashes (such as Without the changes from @clocken, this PR causes the initial page load to fail in prod (attempts to find |
9db704a
to
f6c8ac6
Compare
I think the PR is finalized now. Let's validate those cases (including the metrics page as @ruddell pointed out) :
Note: the control center should also be checked for context-path support. |
Ok, I'm done testing now. The
|
a4043bc
to
3ac3b02
Compare
I have done extensive testing and rebased to main. I confirm @clocken tests and everything should be fine now. However CI does seem to have issues due to loading jhipster dependencies 7.0.0-beta and not the 7.0.0-SNAPSHOT from the context-path branch. Maybe this is related to the current in-progress release. @pascalgrimaud if this is not included in the first v7 beta, it can be included in the next beta version. |
yes, I think it's better to include it in beta.1 |
Any updates @PierreBesson? |
* inject <base href="./"> instead of <base href="/"> into index.html via Webpack * use '../swagger-resources' for axios-request in SwaggerUI * use '..' + resource.location for Resource-URLs displayed in SwaggerUI
…es to take into account the application context-path fixes jhipster#12649
Directly set it in the template and remove webpack.common.js.ejs as client app now uses AngularCLI.
Be consistent with the default api doc pattern :)
Emit relative paths for hashed resources from webpack asset modules
This reverts commit 641f991.
f104ccf
to
b2a7050
Compare
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.
index.html moved to https://github.com/jhipster/generator-jhipster/blob/main/generators/client/templates/common/src/main/webapp/index.html.ejs
swagger-ui/index.html moved to https://github.com/jhipster/generator-jhipster/blob/main/generators/client/templates/common/src/main/webapp/swagger-ui/index.html.ejs.
They should be dropped and any changes should be implemented there.
Co-authored-by: Marcelo Shima <marceloshima@gmail.com>
Yes I have also noticed this. Thanks ! |
I am currently not able to make this works on my machine. This is not such a big change but it might be impacted by some recent changes in spring boot 2.4, I'm not sure. |
There are several major changes with Spring Boot 2.4:
We had to adapt our code, to change the result from API, it was not easy but I'm confident it's done today. Important thing, about context path. You can easily add this property, but there will be several things which are broken:
I forgot probably some items, as I already did this for my customer. And as I said, I'm not sure we can automate this, because the property comes from Spring Boot property and I needed to put this context path in some .vue / .ts file. These files can't guess this property. |
@PierreBesson @pascalgrimaud Following #14250, this PR should be closed? |
Depend on #jhipster/jhipster-bom#42
Fixes #12649
These changes follow @clocken's great suggestions and analysis for supporting a custom context-path for JHipster apps including UI and openapi docs support.
How to test
TODO: