Skip to content

fix(PM-1322): Redirect to requests page once copilot request is created #1129

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

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from

Conversation

hentrymartin
Copy link
Collaborator

Related JIRA Ticket:

https://topcoder.atlassian.net/browse/PM-1322

What's in this PR?

  • Redirect to requests page once copilot request is created

@@ -7,6 +7,7 @@ import { profileContext, ProfileContextData } from '~/libs/core'
import { Button, IconSolid, InputDatePicker, InputMultiselectOption,
InputRadio, InputSelect, InputSelectReact, InputText, InputTextarea } from '~/libs/ui'
import { InputSkillSelector } from '~/libs/shared'
import { EnvironmentConfig } from '~/config'
Copy link

Choose a reason for hiding this comment

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

The import statement for EnvironmentConfig is added, but it is not used in the current code diff. Ensure that it is necessary for the changes made in this pull request or remove it if it is not needed.

@@ -217,6 +218,7 @@ const CopilotRequestForm: FC<{}> = () => {
setIsFormChanged(false)
setFormErrors({})
setPaymentType('')
window.location.href = `https://copilots.${EnvironmentConfig.TC_DOMAIN}/requests`
Copy link

Choose a reason for hiding this comment

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

Using window.location.href for navigation can cause a full page reload, which is not ideal for single-page applications. Consider using a method from your routing library (e.g., history.push if using React Router) to navigate to the requests page without reloading the entire application.

@@ -217,6 +218,10 @@ const CopilotRequestForm: FC<{}> = () => {
setIsFormChanged(false)
setFormErrors({})
setPaymentType('')
// Added a small timeout for the toast to be visible properly to the users
setTimeout(() => {
Copy link

Choose a reason for hiding this comment

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

Consider defining the timeout duration as a constant or configuration variable to improve code readability and maintainability. This would make it easier to adjust the timeout duration in the future if needed.

@hentrymartin hentrymartin requested a review from kkartunov July 8, 2025 20:54
@@ -217,6 +218,10 @@ const CopilotRequestForm: FC<{}> = () => {
setIsFormChanged(false)
setFormErrors({})
setPaymentType('')
// Added a small timeout for the toast to be visible properly to the users
setTimeout(() => {
window.location.href = `https://copilots.${EnvironmentConfig.TC_DOMAIN}/requests`
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we use the router instead of doing full app reload?

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.

2 participants