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
Update Image Format.classnames to be Format.classname #10987
Update Image Format.classnames to be Format.classname #10987
Conversation
Manage this branch in SquashTest this branch here: https://lb-cleanupupdate-classname-pro-g2ktn.squash.io |
@@ -115,11 +115,11 @@ The unique key used to identify the format. To unregister this format, call `unr | |||
**`label`**\ | |||
The label used in the chooser form when inserting the image into the `RichTextField`. | |||
|
|||
**`classnames`**\ | |||
**`classname`**\ | |||
The string to assign to the `class` attribute of the generated `<img>` tag. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These docs are really only for the args, as these are not kwargs the naming here does not matter but I thought it would be good to update nonetheless.
I have intentionally not included a changed in 5.2 note as I thought this would just cause more confusion.
@@ -25,7 +25,7 @@ class SubclassedImageFormat(Format): | |||
|
|||
|
|||
register_image_format( | |||
SubclassedImageFormat('subclassed_format', 'Subclassed Format', classnames, filter_spec) | |||
SubclassedImageFormat('subclassed_format', 'Subclassed Format', 'image-classes object-contain', filter_spec) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just updated the example code to be more 'real world', instead of some uncleared variable classname
.
If it's ok, seeing as this is the last (I think) dev facing usage of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have no qualms with any of the changes. 🌟
dd7df4a
to
432bee3
Compare
- Aligns with the naming convention set from Wagtail 4.2 - Add deprecation warnings if classnames is accessed & unit tests for this - Update other unit tests to use the naming
432bee3
to
02c78f2
Compare
Format.classname
is the last of theclassnames
naming migrations, this will help Wagtail be more predictable for developers and builds on the work already done over the last year.This usage is not fully 'public'/'documented', but I have included some upgrade considerations and a deprecation path nonetheless.
classname
instead ofclassnames
in all MenuItem/Sidebar usage #10907 & Ensure icon template tag can useclassname
instead ofclass_name
by default #9769 & Ensure all icon template tags useclassname
instead ofclass_name
& add deprecation warning #9770