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

Split country and timezone inputs to fix deprecated way of passing priority countries to country input. #1782

Merged
merged 3 commits into from
Dec 29, 2022

Conversation

nashby
Copy link
Collaborator

@nashby nashby commented Jul 6, 2022

fixes #1781

@leifcr
Copy link

leifcr commented Aug 15, 2022

thanks for doing the pr @nashby

@anny-goerl
Copy link

@nashby thanks for doing this, can you @carlosantoniodasilva please approve and merge it or write how it can be improved? Would be happy to have it, we receive to many deprecation warnings. Thanks in advance.

Copy link
Member

@carlosantoniodasilva carlosantoniodasilva left a comment

Choose a reason for hiding this comment

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

Thanks @nashby! My understanding is that this doesn't break existing country select usage, since both versions work since v2? But it fixes the deprecation warning since they're going to be removing the old argument version soon, right?

With the code as-is, I had just a minor suggestion regarding expanding the tests now with split components.

One concern that I have is that PriorityInput is probably being used by other projects, so this is technically a breaking change that would require us to release a v6 or something like that. I wonder if we should "keep" a version of PriorityInput somehow for the time being, to allow us to go with something like v5.2 instead? Perhaps we could have both CountryInput and TimeZoneInput inheriting from PriorityInput? (or even keep pointing the TZ input to that one)

We can probably leave a note to deprecate/remove it once we feel like a v6 is worth releasing, but for now I think I'd prefer to avoid that if we can, since it can affect other projects. Wdyt?

Other than that, just a changelog entry and we should be good to go. Thanks!

with_input_for @user, :country, :country
assert_select 'select.required'
assert_select 'select[aria-required]'
end

Choose a reason for hiding this comment

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

We might want to add the two tests above about required to the time zone tests as well, since those aren't specific to the country one.

@nashby nashby force-pushed the country-timezone-split branch 3 times, most recently from 0f648a9 to 1b72be7 Compare September 23, 2022 15:53
…iority countries to country input.

It still uses SimpleForm's PriorityInput for backward compatibility.
@nashby nashby force-pushed the country-timezone-split branch from 1b72be7 to f38c6a1 Compare September 23, 2022 15:53
@nashby
Copy link
Collaborator Author

nashby commented Sep 23, 2022

@carlosantoniodasilva thanks for review! Totally makes sense to keep PriorityInput so I just put it back and just used separate calls to render country and priority inputs. Does it make sense now?

@leifcr
Copy link

leifcr commented Nov 25, 2022

Looks good to me

@jaredmoody
Copy link

I'd love to get this deprecation warning out of my CI logs if someone has time to merge this! 🙏

@nashby nashby merged commit 7790db2 into main Dec 29, 2022
@nashby
Copy link
Collaborator Author

nashby commented Dec 29, 2022

@carlosantoniodasilva sorry, merged it without your approval but I think it's good to finally do it so we can fix this annoying warnings.

@jaredmoody @leifcr @leifcr it's merged. Feel free to test it with master branch and report any issue!

Copy link
Member

@carlosantoniodasilva carlosantoniodasilva left a comment

Choose a reason for hiding this comment

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

@nashby sorry mate, this looks great, thanks for the fixes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Deprecation warning when using country_select
5 participants