-
Notifications
You must be signed in to change notification settings - Fork 8.4k
fix: Make settings hyperlink functional in Add MCP Server modal #11339
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
base: main
Are you sure you want to change the base?
fix: Make settings hyperlink functional in Add MCP Server modal #11339
Conversation
Fixes langflow-ai#11293 Changed error response key from 'message' to 'detail' in SideBarFoldersButtonComponent to properly display error messages from the backend API when project upload fails. Co-Authored-By: Claude <noreply@anthropic.com>
Fixes langflow-ai#10460 Changed CustomLink to a button with onClick handler that properly: 1. Closes the modal 2. Navigates to the MCP Servers settings page This resolves the issue where clicking the "settings" hyperlink in the Add MCP Server dialog did nothing. Co-Authored-By: Claude <noreply@anthropic.com>
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the WalkthroughThese changes fix a bug in the MCP Server modal where the settings hyperlink was non-functional. One file replaces a declarative link component with programmatic button-based navigation, while another updates error message handling to reference a different response property. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Important Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional. ❌ Failed checks (1 error, 3 warnings)
✅ Passed checks (5 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 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.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/frontend/src/components/core/folderSidebarComponent/components/sideBarFolderButtons/index.tsx (1)
157-162: Guard error detail access to avoid secondary exceptions.
err.responsecan be undefined on network failures; the current access can throw and prevent the alert from rendering. Add optional chaining and a fallback message.🐛 Proposed fix
- setErrorData({ - title: `Error on uploading your project, try dragging it into an existing project.`, - list: [err["response"]["data"]["detail"]], - }); + setErrorData({ + title: `Error on uploading your project, try dragging it into an existing project.`, + list: [ + err?.response?.data?.detail ?? + err?.response?.data?.message ?? + err?.message ?? + "Unknown upload error.", + ], + });
🤖 Fix all issues with AI agents
In `@src/frontend/src/modals/addMcpServerModal/index.tsx`:
- Around line 292-300: The "settings" button in addMcpServerModal currently has
no explicit type and can trigger a form submit if BaseModal renders a <form>;
update the button element used in the onClick handler that calls setOpen(false)
and navigate("/settings/mcp-servers") to include type="button" to prevent
unintended form submission.
| <button | ||
| className="underline cursor-pointer bg-transparent border-0 p-0 text-inherit" | ||
| onClick={() => { | ||
| setOpen(false); | ||
| navigate("/settings/mcp-servers"); | ||
| }} | ||
| > | ||
| settings | ||
| </CustomLink> | ||
| </button> |
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.
Set type="button" to prevent unintended form submit.
If BaseModal renders a <form> when onSubmit is provided, the default button type will submit the form when users click “settings”.
🐛 Proposed fix
- <button
- className="underline cursor-pointer bg-transparent border-0 p-0 text-inherit"
- onClick={() => {
- setOpen(false);
- navigate("/settings/mcp-servers");
- }}
- >
+ <button
+ type="button"
+ className="cursor-pointer bg-transparent border-0 p-0 text-inherit underline"
+ onClick={() => {
+ setOpen(false);
+ navigate("/settings/mcp-servers");
+ }}
+ >📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| <button | |
| className="underline cursor-pointer bg-transparent border-0 p-0 text-inherit" | |
| onClick={() => { | |
| setOpen(false); | |
| navigate("/settings/mcp-servers"); | |
| }} | |
| > | |
| settings | |
| </CustomLink> | |
| </button> | |
| <button | |
| type="button" | |
| className="cursor-pointer bg-transparent border-0 p-0 text-inherit underline" | |
| onClick={() => { | |
| setOpen(false); | |
| navigate("/settings/mcp-servers"); | |
| }} | |
| > | |
| settings | |
| </button> |
🤖 Prompt for AI Agents
In `@src/frontend/src/modals/addMcpServerModal/index.tsx` around lines 292 - 300,
The "settings" button in addMcpServerModal currently has no explicit type and
can trigger a form submit if BaseModal renders a <form>; update the button
element used in the onClick handler that calls setOpen(false) and
navigate("/settings/mcp-servers") to include type="button" to prevent unintended
form submission.
…ttings button - Add optional chaining with fallbacks for err.response.data.detail access - Add type="button" to settings button in addMcpServerModal to prevent form submit Co-Authored-By: Claude <noreply@anthropic.com>
Summary
Changes
src/frontend/src/modals/addMcpServerModal/index.tsxIssue
Fixes #10460
Test Plan
🤖 Generated with Claude Code
Summary by CodeRabbit
Release Notes
✏️ Tip: You can customize this high-level summary in your review settings.