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

Fix Turbo.config.forms.confirm deprecation message #3452

Merged
merged 1 commit into from
Nov 22, 2024

Conversation

iainbeeston
Copy link
Contributor

Description

Turbo 8 deprecated Turbo.setConfirmMethod() and instead moved it to Turbo.config.forms.confirm instead (see hotwired/turbo#1216). Because of that, avo is throwing deprecation messages in the javascript console:

Please replace `Turbo.setConfirmMethod(confirmMethod)` with `Turbo.config.forms.confirm = confirmMethod`. The top-level function is deprecated and will be removed in a future version of Turbo.

I've updated the code to use the new config object instead, which should resolve the deprecation warning.

Fixes # (issue)

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works

Screenshots & recording

Manual review steps

  1. Confirm that turbo confirmation popups still work.

Manual reviewer: please leave a comment with output from the test if that's the case.

Turbo 8 deprecated `Turbo.setConfirmMethod()` and instead moved it to `Turbo.config.forms.confirm` instead (see hotwired/turbo#1216). Because of that, avo is throwing deprecation messages in the javascript console:

    Please replace `Turbo.setConfirmMethod(confirmMethod)` with `Turbo.config.forms.confirm = confirmMethod`. The top-level function is deprecated and will be removed in a future version of Turbo.

I've updated the code to use the new config object instead, which should resolve the deprecation warning.
Copy link

codeclimate bot commented Nov 21, 2024

Code Climate has analyzed commit 5ea60ec and detected 0 issues on this pull request.

View more on Code Climate.

Copy link
Contributor

@Paul-Bob Paul-Bob left a comment

Choose a reason for hiding this comment

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

Looking good! Thank you @iainbeeston

@Paul-Bob Paul-Bob added the Fix label Nov 22, 2024
@Paul-Bob Paul-Bob merged commit 31daae1 into avo-hq:main Nov 22, 2024
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants