Skip to content

fix: clear workspace name validation on field dirty #10927

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

Merged
merged 1 commit into from
Nov 29, 2023

Conversation

Kira-Pilot
Copy link
Member

resolves #10637

@@ -127,6 +127,7 @@ const CreateWorkspacePage: FC = () => {
defaultOwner={me}
defaultBuildParameters={defaultBuildParameters}
error={createWorkspaceMutation.error}
resetMutation={createWorkspaceMutation.reset}
Copy link
Collaborator

Choose a reason for hiding this comment

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

For me, resetMutation does not say too much about its intention. Maybe resetError could be a better name?

@@ -157,7 +159,8 @@ export const CreateWorkspacePageView: FC<CreateWorkspacePageViewProps> = ({
<TextField
{...getFieldHelpers("name")}
disabled={creatingWorkspace}
onChange={onChangeTrimmed(form)}
// resetMutation facilitates the clearing of validation errors
onChange={onChangeTrimmed(form, resetMutation)}
Copy link
Collaborator

Choose a reason for hiding this comment

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

We should not have to reset the mutation to clear the form error. But I think it is probably out of scope since it looks to be an issue with how we use the getFormHelpers gets the errors.

Copy link
Collaborator

@BrunoQuaresma BrunoQuaresma left a comment

Choose a reason for hiding this comment

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

Just minor comments.

@Kira-Pilot Kira-Pilot merged commit 88f4490 into main Nov 29, 2023
@Kira-Pilot Kira-Pilot deleted the clear-workspace-validation/kira-pilot branch November 29, 2023 15:53
@github-actions github-actions bot locked and limited conversation to collaborators Nov 29, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug: After correcting a duplicate workspace name, the validation errors remain
2 participants