Skip to content

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

priscilawebdev
Copy link
Member

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

@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label May 21, 2025
Comment on lines +417 to +423
setErrors(error.responseJSON);
addErrorMessage(t('Failed to create project %s', `${projectName}`));
Copy link
Member Author

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.

@priscilawebdev priscilawebdev force-pushed the priscila/fix/project-creation/error-not-shown-when-invalid-slack-channel branch from be19b38 to 527c626 Compare May 21, 2025 13:23
@priscilawebdev priscilawebdev changed the title fix lint errors fix(project-install): Render request errors on the bottom if any May 21, 2025
@priscilawebdev priscilawebdev changed the title fix(project-install): Render request errors on the bottom if any fix(project-install): Render request errors at the bottom if any May 21, 2025
@@ -153,24 +157,19 @@ export function CreateProject() {
project,
alertRuleConfig,
}: {project: Project} & Pick<FormData, 'alertRuleConfig'>) => {
const ruleIds = [];
const ruleIds: Array<string | undefined> = [];
Copy link
Member Author

@priscilawebdev priscilawebdev May 22, 2025

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

@priscilawebdev priscilawebdev marked this pull request as ready for review May 22, 2025 06:49
@priscilawebdev priscilawebdev requested review from a team as code owners May 22, 2025 06:49
@@ -238,7 +235,10 @@ export function CreateProject() {
].filter(value => value).length;

const canSubmitForm =
!createProject.isPending && canUserCreateProject && formErrorCount === 0;
!createProjectRules.isPending &&
Copy link
Member Author

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

@priscilawebdev priscilawebdev changed the title fix(project-install): Render request errors at the bottom if any fix(project-install): Render request errors at the bottom if any & disable project if rule is being created May 22, 2025
@priscilawebdev priscilawebdev marked this pull request as draft May 22, 2025 08:29
@priscilawebdev
Copy link
Member Author

will open a follow-up PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Scope: Frontend Automatically applied to PRs that change frontend components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant