-
Notifications
You must be signed in to change notification settings - Fork 4.6k
chore: redirect ai agent user to app with carbon modal open #39999
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
Changes from all commits
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 | ||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -12,6 +12,7 @@ import { isValidLicense } from "ee/selectors/organizationSelectors"; | |||||||||||||||||||||||||||||||||||||||||
| import { redirectUserAfterSignup } from "ee/utils/signupHelpers"; | ||||||||||||||||||||||||||||||||||||||||||
| import { setUserSignedUpFlag } from "utils/storage"; | ||||||||||||||||||||||||||||||||||||||||||
| import AnalyticsUtil from "ee/utils/AnalyticsUtil"; | ||||||||||||||||||||||||||||||||||||||||||
| import { getIsAiAgentFlowEnabled } from "ee/selectors/aiAgentSelectors"; | ||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
| export function SignupSuccess() { | ||||||||||||||||||||||||||||||||||||||||||
| const dispatch = useDispatch(); | ||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -27,17 +28,17 @@ export function SignupSuccess() { | |||||||||||||||||||||||||||||||||||||||||
| user?.email && setUserSignedUpFlag(user?.email); | ||||||||||||||||||||||||||||||||||||||||||
| }, []); | ||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
| const isNonInvitedUser = shouldEnableFirstTimeUserOnboarding === "true"; | ||||||||||||||||||||||||||||||||||||||||||
| const isAiAgentFlowEnabled = useSelector(getIsAiAgentFlowEnabled); | ||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
| const redirectUsingQueryParam = useCallback( | ||||||||||||||||||||||||||||||||||||||||||
| () => | ||||||||||||||||||||||||||||||||||||||||||
| redirectUserAfterSignup( | ||||||||||||||||||||||||||||||||||||||||||
| redirectUserAfterSignup({ | ||||||||||||||||||||||||||||||||||||||||||
| redirectUrl, | ||||||||||||||||||||||||||||||||||||||||||
| shouldEnableFirstTimeUserOnboarding, | ||||||||||||||||||||||||||||||||||||||||||
| validLicense, | ||||||||||||||||||||||||||||||||||||||||||
| dispatch, | ||||||||||||||||||||||||||||||||||||||||||
| isNonInvitedUser, | ||||||||||||||||||||||||||||||||||||||||||
| ), | ||||||||||||||||||||||||||||||||||||||||||
| isAiAgentFlowEnabled, | ||||||||||||||||||||||||||||||||||||||||||
| }), | ||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+35
to
+41
Contributor
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. 🛠️ Refactor suggestion Updated function call to use object parameter The function call has been updated to use an object parameter which improves maintainability. However, the dependency array is empty which could lead to stale values if the dependencies change. Consider adding the dependencies to the array: const redirectUsingQueryParam = useCallback(
() =>
redirectUserAfterSignup({
redirectUrl,
shouldEnableFirstTimeUserOnboarding,
validLicense,
dispatch,
isAiAgentFlowEnabled,
}),
- [],
+ [redirectUrl, shouldEnableFirstTimeUserOnboarding, validLicense, dispatch, isAiAgentFlowEnabled],
);📝 Committable suggestion
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||
| [], | ||||||||||||||||||||||||||||||||||||||||||
| ); | ||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
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.
💡 Verification agent
🧩 Analysis chain
Updated function signature to use interface
The function now accepts a single object parameter with a defined interface. However,
isAiAgentFlowEnabledis defined in the interface but not used in the function body.🏁 Script executed:
Length of output: 1301
Action Required: Address the Unused Parameter in Signup Helpers
In the updated function signature for
redirectUserAfterSignup, the interface now includes theisAiAgentFlowEnabledproperty. However, this property isn’t being utilized within the function body. Please either removeisAiAgentFlowEnabledfrom theRedirectUserAfterSignupPropsinterface if it isn’t needed in this context, or update the function logic to incorporate it appropriately if it's intended to affect the redirection behavior.app/client/src/ce/utils/signupHelpers.ts(Lines 29-33)