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

Display validation errors alongside the fields [Inertia] #1115

Closed
wants to merge 2 commits into from
Closed

Display validation errors alongside the fields [Inertia] #1115

wants to merge 2 commits into from

Conversation

daleweaver777
Copy link
Contributor

Update the Inertia stack to match the Breeze Vue components.

See @jessarcher pull request in Breeze laravel/breeze#175

@SamuelMwangiW
Copy link
Contributor

My 0.0002 cents: @weavdale kindly revert the formatting changes.

@daleweaver777
Copy link
Contributor Author

daleweaver777 commented Aug 9, 2022

My 0.0002 cents: @weavdale kindly revert the formatting changes.

@SamuelMwangiW, I tried to figure out the coding style Laravel is using for Javascript, but didn't want to spend a lot of time on it since the docs say StyleCI will fix it during merge. https://laravel.com/docs/9.x/contributions#styleci

@@ -82,6 +81,7 @@ const submit = () => {
class="mt-1 block w-full"
autocomplete="one-time-code"
/>
<JetInputError class="mt-2" :message="form.errors.code" />
Copy link
Member

Choose a reason for hiding this comment

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

It's a little unfortunate that this needs to be code rather than recovery_code, but it looks like Fortify puts the error here even when it's the recovery code that was attempted. The only time an error will appear under recovery_code is when the provided recovery code is not a string, and I don't think can ever happen in normal usage of the app.

Copy link
Member

@jessarcher jessarcher Aug 12, 2022

Choose a reason for hiding this comment

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

I've created a PR for Fortify to fix this: laravel/fortify#401

If that PR is accepted, this will need to change to:

Suggested change
<JetInputError class="mt-2" :message="form.errors.code" />
<JetInputError class="mt-2" :message="form.errors.recovery_code" />

If that PR is not accepted, it might be a good idea to change it to something like this (untested):

Suggested change
<JetInputError class="mt-2" :message="form.errors.code" />
<JetInputError class="mt-2" :message="form.errors.recovery_code ?? form.errors.code" />

@taylorotwell
Copy link
Member

Will let @jessarcher make any PRs here if needed - we are doing some refactoring on Jetstream.

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.

4 participants