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

Ensure all icon template tags use classname instead of class_name & add deprecation warning #9770

Conversation

lb-
Copy link
Member

@lb- lb- commented Dec 9, 2022

This PR builds on top of #9769 and updates all {% icon ... template tag usage to classname instead of class_name. It also adds a deprecation warning & upgrade considerations to move away from using the previous approach.

To validate

Within Bakerydemo, or even Wagtail admin code, change an icon template usage to use class_name='...' and you should see something like the following warning in the console.

/code/wagtail/wagtail/admin/templatetags/wagtailadmin_tags.py:693: RemovedInWagtail50Warning: ('Icon template tag `class_name` has been renamed to `classname`, please adopt the new usage instead.', 'Replace `{% icon ... class_name="button-longrunning__icon" %}` with `{% icon ... classname="button-longrunning__icon" %}`')

Checklist

  • Do the tests still pass?
  • Does the code comply with the style guide?
  • For Python changes: Have you added tests to cover the new/fixed behaviour?
  • For new features: Has the documentation been updated accordingly?

@squash-labs
Copy link

squash-labs bot commented Dec 9, 2022

Manage this branch in Squash

Test this branch here: https://lb-feature6107-ensure-icon-tem-cgwnh.squash.io

- If using `class_name` we will now trigger a warning that this will be removed in Wagtail 5.0
- Update release notes accordingly
@lb- lb- force-pushed the feature/6107-ensure-icon-template-tag-uses-classname-with-warning branch from dd97faa to 1428705 Compare January 11, 2023 09:58
@gasman gasman self-requested a review January 19, 2023 09:51
Copy link
Collaborator

@gasman gasman left a comment

Choose a reason for hiding this comment

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

Looks good to me! Will check for any other occurrences that have snuck in, when I rebase / fix the merge conflict.

@gasman
Copy link
Collaborator

gasman commented Jan 19, 2023

Merged in 899730d

@gasman gasman closed this Jan 19, 2023
@lb- lb- deleted the feature/6107-ensure-icon-template-tag-uses-classname-with-warning branch January 31, 2023 22:35
@lb-
Copy link
Member Author

lb- commented Jan 31, 2023

Thanks Matt.

lb- added a commit to lb-/wagtail that referenced this pull request Feb 1, 2023
lb- added a commit to lb-/wagtail that referenced this pull request Sep 15, 2023
…ar usage

- https://docs.wagtail.org/en/stable/contributing/general_guidelines.html#use-classname-in-python-html-template-tag-variables
- Adds a deprecation path, including documentation to further remove unpredictable naming of adding `classname` in Python APIs
- Intentionally keeps `classNames` in Telepath adaptor inner usage as this convention is not set, however, the server side value passed in will use `classname`
- See wagtail#9769 & wagtail#9770
lb- added a commit to lb-/wagtail that referenced this pull request Sep 17, 2023
- Adds a deprecation path, including documentation to further remove unpredictable naming of adding `classname` in Python APIs
- Intentionally keeps `classNames` in Telepath adaptor inner usage as this convention is not set, however, the server side value passed in will use `classname`
- See https://docs.wagtail.org/en/stable/contributing/general_guidelines.html#use-classname-in-python-html-template-tag-variables
- See wagtail#9769 & wagtail#9770
lb- added a commit to lb-/wagtail that referenced this pull request Sep 25, 2023
- Adds a deprecation path, including documentation to further remove unpredictable naming of adding `classname` in Python APIs
- Intentionally keeps `classNames` in Telepath adaptor inner usage as this convention is not set, however, the server side value passed in will use `classname`
- See https://docs.wagtail.org/en/stable/contributing/general_guidelines.html#use-classname-in-python-html-template-tag-variables
- See wagtail#9769 & wagtail#9770
lb- added a commit to lb-/wagtail that referenced this pull request Oct 2, 2023
- Adds a deprecation path, including documentation to further remove unpredictable naming of adding `classname` in Python APIs
- Intentionally keeps `classNames` in Telepath adaptor inner usage as this convention is not set, however, the server side value passed in will use `classname`
- See https://docs.wagtail.org/en/stable/contributing/general_guidelines.html#use-classname-in-python-html-template-tag-variables
- See wagtail#9769 & wagtail#9770
lb- added a commit to lb-/wagtail that referenced this pull request Oct 2, 2023
- Adds a deprecation path, including documentation to further remove unpredictable naming of adding `classname` in Python APIs
- Intentionally keeps `classNames` in Telepath adaptor inner usage as this convention is not set, however, the server side value passed in will use `classname`
- See https://docs.wagtail.org/en/stable/contributing/general_guidelines.html#use-classname-in-python-html-template-tag-variables
- See wagtail#9769 & wagtail#9770
lb- added a commit to lb-/wagtail that referenced this pull request Oct 2, 2023
- Adds a deprecation path, including documentation to further remove unpredictable naming of adding `classname` in Python APIs
- Intentionally keeps `classNames` in Telepath adaptor inner usage as this convention is not set, however, the server side value passed in will use `classname`
- See https://docs.wagtail.org/en/stable/contributing/general_guidelines.html#use-classname-in-python-html-template-tag-variables
- See wagtail#9769 & wagtail#9770
lb- added a commit to lb-/wagtail that referenced this pull request Oct 2, 2023
- Adds a deprecation path, including documentation to further remove unpredictable naming of adding `classname` in Python APIs
- Intentionally keeps `classNames` in Telepath adaptor inner usage as this convention is not set, however, the server side value passed in will use `classname`
- See https://docs.wagtail.org/en/stable/contributing/general_guidelines.html#use-classname-in-python-html-template-tag-variables
- See wagtail#9769 & wagtail#9770
lb- added a commit to lb-/wagtail that referenced this pull request Oct 3, 2023
- Adds a deprecation path, including documentation to further remove unpredictable naming of adding `classname` in Python APIs
- Intentionally keeps `classNames` in Telepath adaptor inner usage as this convention is not set, however, the server side value passed in will use `classname`
- See https://docs.wagtail.org/en/stable/contributing/general_guidelines.html#use-classname-in-python-html-template-tag-variables
- See wagtail#9769 & wagtail#9770
lb- added a commit that referenced this pull request Oct 3, 2023
- Adds a deprecation path, including documentation to further remove unpredictable naming of adding `classname` in Python APIs
- Intentionally keeps `classNames` in Telepath adaptor inner usage as this convention is not set, however, the server side value passed in will use `classname`
- See https://docs.wagtail.org/en/stable/contributing/general_guidelines.html#use-classname-in-python-html-template-tag-variables
- See #9769 & #9770
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants