Skip to content
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

1-1334: show short error message when validation fails #4617

Conversation

thomasheartman
Copy link
Contributor

@thomasheartman thomasheartman commented Sep 6, 2023

The error message only tells the user that the name doesn't match the
pattern. Because we already show the pattern above the input, we don't
need to repeat it in the error message. This makes for a shorter and
more concise message and better UX.

At the same time, for API users, we can keep the more detailed message
that includes info about the pattern, the example, and the description.

image

The error message only tells the user that the name doesn't match the
pattern. Because we already show the pattern above the input, we don't
need to repeat it in the error message. This makes for a shorter and
more concise message and better UX.

At the same time, for API users, we can keep the more detailed message
that includes info about the pattern, the example, and the description.
@vercel
Copy link

vercel bot commented Sep 6, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

2 Ignored Deployments
Name Status Preview Comments Updated (UTC)
unleash-docs ⬜️ Ignored (Inspect) Visit Preview Sep 6, 2023 10:22am
unleash-monorepo-frontend ⬜️ Ignored (Inspect) Visit Preview Sep 6, 2023 10:22am

Base automatically changed from 1-1307-show-pattern-and-description-before-inputting-flag-names to main September 6, 2023 10:14
@thomasheartman thomasheartman enabled auto-merge (squash) September 6, 2023 10:16
@@ -137,6 +137,7 @@ const CreateFeature = () => {
handleCancel={handleCancel}
mode="Create"
clearErrors={clearErrors}
featureNaming={projectInfo.featureNaming}
Copy link
Contributor

Choose a reason for hiding this comment

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

Will this always exists? According to the type in featureForm it can be undefined.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes. So we send it down. If we have it, all good, otherwise featureForm handles that too. Am I missing something that makes this not work in some cases?

<dd>
<code>{featureNaming?.pattern}</code>
</dd>
{Boolean(featureNaming?.example) && (
Copy link
Contributor

Choose a reason for hiding this comment

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

Could use conditional render component for readability

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, I thought about that, but decided against it because of the layers of nesting. Felt like it would take up a lot of extra vertical space for not a lot of extra value. However, I do see your point and would be happy to switch to the component instead if you think that's better ☺️

<dd>{featureNaming?.example}</dd>
</>
)}
{Boolean(featureNaming?.description) && (
Copy link
Contributor

Choose a reason for hiding this comment

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

Could also be used here

@thomasheartman thomasheartman merged commit f55c67f into main Sep 6, 2023
3 of 6 checks passed
@thomasheartman thomasheartman deleted the 1-1334-show-sensible-user-feedback-when-the-validation-fails branch September 6, 2023 10:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

3 participants