-
Notifications
You must be signed in to change notification settings - Fork 540
fix: link evaluator button to playground in trace drawer #4565
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?
Changes from all commits
6eaecdd
445fc3f
585c6ad
c9d112d
01a6e6d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -56,3 +56,17 @@ export const changePassword = async (payload: { | |
| body: JSON.stringify(payload), | ||
| }) | ||
| } | ||
|
|
||
| /** | ||
| * Generate a password reset link for a user (admin action). | ||
| * Returns the reset password link string. | ||
| */ | ||
| export const resetPassword = async (userId: string): Promise<string> => { | ||
| const base = getBaseUrl() | ||
| const url = new URL("api/profile/reset-password", base) | ||
| url.searchParams.set("user_id", userId) | ||
| const data = await fetchJson<string>(url, { | ||
| method: "POST", | ||
| }) | ||
|
Comment on lines
+64
to
+70
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Route this new API call through the Fern SDK client Line 64 introduces a new frontend API call, but it bypasses the Fern-generated client and manual URL/query handling is used instead. Please switch this to Suggested direction-export const resetPassword = async (userId: string): Promise<string> => {
- const base = getBaseUrl()
- const url = new URL("api/profile/reset-password", base)
- url.searchParams.set("user_id", userId)
- const data = await fetchJson<string>(url, {
- method: "POST",
- })
- return data
-}
+export const resetPassword = async (userId: string): Promise<string> => {
+ const client = getAgentaSdkClient({host: getAgentaApiUrl()})
+ const raw = await client.users.resetUserPassword(
+ {user_id: userId},
+ {queryParams: {user_id: userId}},
+ )
+ const parsed = safeParseWithLogging(/* zod string schema */, raw, "resetPassword")
+ if (!parsed.success) throw new Error("Invalid reset-password response")
+ return parsed.data
+}As per coding guidelines: “All new frontend API code must go through the Fern-generated client, not raw axios”, “Use Source: Coding guidelines |
||
| return data | ||
| } | ||
|
Comment on lines
+64
to
+72
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Line 64 assumes a guaranteed string return, but upstream service behavior can return no link when Sendgrid is configured ( Please align contract explicitly: either make backend always return a link string, or change frontend type/UX to handle “email sent, no link returned” as a separate success path. |
||
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.
Generate-link modal closes before async completion
Line 211 wires async generation correctly, but the modal currently calls
onOkand then immediatelyonCancelinGenerateResetLinkModal(web/oss/src/components/pages/settings/WorkspaceManage/Modals/GenerateResetLinkModal.tsx:7-12). That makesconfirmLoadingat Line 212 ineffective and forces users to reopen the modal after failures.Suggested fix (in
GenerateResetLinkModal.tsx)