Skip to content

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

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.

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.

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
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?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@kkartunov I've modified the logic based on your suggestion.

@hentrymartin hentrymartin merged commit 80720e7 into dev Jul 10, 2025
4 checks passed
@hentrymartin hentrymartin deleted the pm-1322 branch July 10, 2025 18:45
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.

3 participants