-
Notifications
You must be signed in to change notification settings - Fork 400
Add Null Checks and Enhanced Error Handling to admin.js Form Handler #726
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
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
crivetimihai
approved these changes
Aug 13, 2025
Member
crivetimihai
left a comment
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.
✅ Successfully rebased PR #726 onto latest main
Changes Review: The PR improves error handling in mcpgateway/static/admin.js by:
- Adding null/undefined checks using optional chaining (result?.message)
- Providing specific fallback error messages for each form handler
- Ensuring consistent error handling across all 9 form submission functions
Code Quality:
- ✅ Clean implementation following modern JS best practices
- ✅ All web linters pass (HTML, CSS, JS security checks)
- ✅ All Python tests pass (1643 passed, 11 skipped)
- ✅ Successfully rebased with minimal conflicts (only whitespace issues)
The PR correctly addresses issue #668 and improves the robustness of the admin UI error handling.
vk-playground
pushed a commit
to vk-playground/mcp-context-forge
that referenced
this pull request
Sep 14, 2025
…BM#726) * issue 668 Signed-off-by: RAKHI DUTTA <rakdutta@in.ibm.com> * admin.js Signed-off-by: RAKHI DUTTA <rakdutta@in.ibm.com> * admin.js Signed-off-by: RAKHI DUTTA <rakdutta@in.ibm.com> * prettier Signed-off-by: RAKHI DUTTA <rakdutta@in.ibm.com> * admin.js Signed-off-by: RAKHI DUTTA <rakdutta@in.ibm.com> --------- Signed-off-by: RAKHI DUTTA <rakdutta@in.ibm.com> Co-authored-by: RAKHI DUTTA <rakdutta@in.ibm.com>
vk-playground
pushed a commit
to vk-playground/mcp-context-forge
that referenced
this pull request
Sep 14, 2025
…BM#726) * issue 668 Signed-off-by: RAKHI DUTTA <rakdutta@in.ibm.com> * admin.js Signed-off-by: RAKHI DUTTA <rakdutta@in.ibm.com> * admin.js Signed-off-by: RAKHI DUTTA <rakdutta@in.ibm.com> * prettier Signed-off-by: RAKHI DUTTA <rakdutta@in.ibm.com> * admin.js Signed-off-by: RAKHI DUTTA <rakdutta@in.ibm.com> --------- Signed-off-by: RAKHI DUTTA <rakdutta@in.ibm.com> Co-authored-by: RAKHI DUTTA <rakdutta@in.ibm.com>
vk-playground
pushed a commit
to vk-playground/mcp-context-forge
that referenced
this pull request
Sep 16, 2025
…BM#726) * issue 668 Signed-off-by: RAKHI DUTTA <rakdutta@in.ibm.com> * admin.js Signed-off-by: RAKHI DUTTA <rakdutta@in.ibm.com> * admin.js Signed-off-by: RAKHI DUTTA <rakdutta@in.ibm.com> * prettier Signed-off-by: RAKHI DUTTA <rakdutta@in.ibm.com> * admin.js Signed-off-by: RAKHI DUTTA <rakdutta@in.ibm.com> --------- Signed-off-by: RAKHI DUTTA <rakdutta@in.ibm.com> Co-authored-by: RAKHI DUTTA <rakdutta@in.ibm.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary of Changes:
mcpgateway/frontend/admin.jsto add null/undefined checks in all form handlers, in line with issue #668.result.messagemight be missing.Testing Instructions
These steps validate changes for
handleGatewayFormSubmitandhandleEditGatewayFormSubmit.Repeat similar tests for other form handlers.
Locate the line in
admin.js:Case 1: Replace with:
Expected Result:
"Failed to add gateway""Failed to edit gateway"Case 2: Replace with:
Expected Result:
"Failed to add gateway""Failed to edit gateway"