-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
fix(project-install): Render request errors at the bottom if any & disable project if rule is being created #92022
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
Conversation
setErrors(error.responseJSON); | ||
addErrorMessage(t('Failed to create project %s', `${projectName}`)); |
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.
The error response format is inconsistent. Sometimes it's a flat object with arrays, like:
{
"actions": [
"Slack: The resource \"error\" does not exist or has not been granted access in the Sentry Slack workspace."
]
}
Other times, it follows a different structure. For now, I’ve kept the existing logic mostly as-is and focused on fixing the immediate issue. We can revisit this later and improve error handling more cleanly.
be19b38
to
527c626
Compare
@@ -153,24 +157,19 @@ export function CreateProject() { | |||
project, | |||
alertRuleConfig, | |||
}: {project: Project} & Pick<FormData, 'alertRuleConfig'>) => { | |||
const ruleIds = []; | |||
const ruleIds: Array<string | undefined> = []; |
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.
the createPlatform function is getting complex - happy to clean it up in a follow-up
…own-when-invalid-slack-channel
@@ -238,7 +235,10 @@ export function CreateProject() { | |||
].filter(value => value).length; | |||
|
|||
const canSubmitForm = | |||
!createProject.isPending && canUserCreateProject && formErrorCount === 0; | |||
!createProjectRules.isPending && |
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.
When a rule is being created, the primary button should be disabled as well because the request may fail
will open a follow-up PR |
Before
Screen.Recording.2025-05-21.at.14.56.22.mov
After
Screen.Recording.2025-05-21.at.14.58.06.mov
closes TET-443