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

feature: added context-path support #209

Merged
merged 5 commits into from
Jan 19, 2021

Conversation

xamien
Copy link
Contributor

@xamien xamien commented Dec 19, 2020

I follow up on pull request for route prefix #171 using
server.servlet.context-path

@shawnsarwar

@CLAassistant
Copy link

CLAassistant commented Dec 19, 2020

CLA assistant check
All committers have signed the CLA.

@saig0 saig0 self-requested a review December 19, 2020 21:47
Copy link
Contributor

@saig0 saig0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@xamien thank you for your contribution 🎉

It looks good 👍 I just added some minor suggestions.
Please have a look.

And please have a look at the CLA bot. Maybe, the email of the commit is different from GitHub. See:

Michal Kotek seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.

import org.springframework.context.annotation.Bean;
import org.springframework.core.env.Environment;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new imports are not used and can be removed.

Comment on lines 38 to 39
servlet:
context-path: /zeebe-monitor/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please don't commit this change. Changing the default base path would break the existing deployments and confuses the users 😅

@@ -30,7 +30,7 @@
import java.util.List;

@RestController
@RequestMapping("/api/jobs")
@RequestMapping("${server.servlet.context-path}api/jobs")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is handled by Spring itself. We don't need to add the variable as a prefix here and on the other resources.

For deployments and jobs, the UI doesn't work with the change anymore.

@Override
public void configureMessageBroker(MessageBrokerRegistry config) {
config.enableSimpleBroker("/");
config.enableSimpleBroker(base_path);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems that this change is not required. If I remove it then it still works. Please verify that it is also true for you.

@@ -53,7 +53,7 @@ function reload() {
            }

            function sendMessage(msg) {
                stompClient.send("/notifications", {},
                stompClient.send(base_path + "notifications", {},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Following DRY ("dont-repeat-yourself"), we could extract the building of the path into a method.

@@ -99,6 +105,7 @@ public String workflowList(Map<String, Object> model, Pageable pageable) {

model.put("workflows", workflows);
model.put("count", count);
model.put("context-path", base_path);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Following DRY, we can extract this part into a method.

@xamien
Copy link
Contributor Author

xamien commented Jan 16, 2021

@saig0 thank you for review. I hope that I worked all comments.

@saig0 saig0 self-requested a review January 18, 2021 06:08
Copy link
Contributor

@saig0 saig0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good 🎉

I'll add some minor changes myself to clean up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants