-
Notifications
You must be signed in to change notification settings - Fork 75
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
Switch to ImageBlock #503
Open
Chiemezuo
wants to merge
7
commits into
wagtail:main
Choose a base branch
from
Chiemezuo:storm-imageblock-migration
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Switch to ImageBlock #503
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
3422c8f
Migrate some `ImageChooserBlock` instances to `ImageBlock`
Stormheg c9f87f5
Patch to use image's default_alt_text when converting existing images…
cnk abca95e
Migration files for the first set of ImageChoiceBlock to ImageBlock c…
cnk 4ef9bad
Revert "Patch to use image's default_alt_text when converting existin…
Chiemezuo d462dab
remove patches as fixed in v6.4
Chiemezuo 2263ecd
run ruff format and lint
Chiemezuo 3efce55
rename imageblock migrations
Chiemezuo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,299 @@ | ||
# Generated by Django 5.0.9 on 2024-11-27 22:16 | ||
|
||
from django.db import migrations | ||
|
||
import wagtail.fields | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("blog", "0013_alter_blogpage_body"), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name="blogpage", | ||
name="body", | ||
field=wagtail.fields.StreamField( | ||
[ | ||
("h2", 0), | ||
("h3", 1), | ||
("h4", 2), | ||
("paragraph", 3), | ||
("blockquote", 4), | ||
("image", 5), | ||
("document", 6), | ||
("embed", 7), | ||
("markdown", 8), | ||
("codeblock", 11), | ||
("teaser", 17), | ||
("get_started_block", 18), | ||
("sign_up_form", 19), | ||
("highlight", 28), | ||
("standalone_cta", 30), | ||
], | ||
block_lookup={ | ||
0: ( | ||
"wagtail.blocks.CharBlock", | ||
(), | ||
{ | ||
"form_classname": "title", | ||
"icon": "title", | ||
"template": "patterns/components/streamfields/headings/heading-2.html", | ||
}, | ||
), | ||
1: ( | ||
"wagtail.blocks.CharBlock", | ||
(), | ||
{ | ||
"form_classname": "title", | ||
"icon": "title", | ||
"template": "patterns/components/streamfields/headings/heading-3.html", | ||
}, | ||
), | ||
2: ( | ||
"wagtail.blocks.CharBlock", | ||
(), | ||
{ | ||
"form_classname": "title", | ||
"icon": "title", | ||
"template": "patterns/components/streamfields/headings/heading-4.html", | ||
}, | ||
), | ||
3: ( | ||
"wagtail.blocks.RichTextBlock", | ||
(), | ||
{ | ||
"icon": "pilcrow", | ||
"template": "patterns/components/streamfields/rich_text_block/rich_text_block.html", | ||
}, | ||
), | ||
4: ( | ||
"wagtail.blocks.CharBlock", | ||
(), | ||
{ | ||
"form_classname": "title", | ||
"icon": "openquote", | ||
"template": "patterns/components/streamfields/quotes/standalone_quote_block.html", | ||
}, | ||
), | ||
5: ( | ||
"wagtail.images.blocks.ImageBlock", | ||
[], | ||
{ | ||
"icon": "image", | ||
"template": "patterns/components/streamfields/image/image.html", | ||
}, | ||
), | ||
6: ( | ||
"wagtail.documents.blocks.DocumentChooserBlock", | ||
(), | ||
{ | ||
"icon": "doc-full-inverse", | ||
"template": "patterns/components/streamfields/document/document.html", | ||
}, | ||
), | ||
7: ( | ||
"wagtail.embeds.blocks.EmbedBlock", | ||
(), | ||
{ | ||
"icon": "code", | ||
"template": "patterns/components/streamfields/embed/embed.html", | ||
}, | ||
), | ||
8: ( | ||
"wagtailio.utils.blocks.MarkDownBlock", | ||
(), | ||
{ | ||
"template": "patterns/components/streamfields/code_block/code_block.html" | ||
}, | ||
), | ||
9: ( | ||
"wagtail.blocks.ChoiceBlock", | ||
[], | ||
{ | ||
"choices": [ | ||
("bash", "Bash/Shell"), | ||
("css", "CSS"), | ||
("django", "Django templating language"), | ||
("html", "HTML"), | ||
("javascript", "Javascript"), | ||
("python", "Python"), | ||
("scss", "SCSS"), | ||
] | ||
}, | ||
), | ||
10: ("wagtail.blocks.TextBlock", (), {}), | ||
11: ( | ||
"wagtail.blocks.StructBlock", | ||
[[("language", 9), ("code", 10)]], | ||
{ | ||
"template": "patterns/components/streamfields/code_block/code_block.html" | ||
}, | ||
), | ||
12: ( | ||
"wagtail.blocks.PageChooserBlock", | ||
(), | ||
{"page_type": ["blog.BlogPage"], "required": False}, | ||
), | ||
13: ("wagtail.blocks.URLBlock", (), {"required": False}), | ||
14: ("wagtail.images.blocks.ImageBlock", [], {}), | ||
15: ("wagtail.blocks.TextBlock", (), {"required": False}), | ||
16: ( | ||
"wagtail.blocks.TextBlock", | ||
(), | ||
{"label": "Subheading for external link", "required": False}, | ||
), | ||
17: ( | ||
"wagtail.blocks.StructBlock", | ||
[ | ||
[ | ||
("page", 12), | ||
("url_chooser", 13), | ||
("image_for_external_link", 14), | ||
("heading_for_external_link", 15), | ||
("subheading_for_ext_link", 16), | ||
] | ||
], | ||
{"group": "CTA options"}, | ||
), | ||
18: ( | ||
"wagtail.snippets.blocks.SnippetChooserBlock", | ||
("core.GetStartedSnippet",), | ||
{ | ||
"group": "CTA options", | ||
"icon": "table-list", | ||
"template": "patterns/components/streamfields/get_started_block/get_started_block.html", | ||
}, | ||
), | ||
19: ( | ||
"wagtail.snippets.blocks.SnippetChooserBlock", | ||
("core.SignupFormSnippet",), | ||
{ | ||
"group": "CTA options", | ||
"icon": "envelope-open-text", | ||
"template": "patterns/components/streamfields/sign_up_form_block/sign_up_form_block.html", | ||
}, | ||
), | ||
20: ("wagtail.blocks.CharBlock", (), {"max_length": 100}), | ||
21: ( | ||
"wagtail.blocks.BooleanBlock", | ||
(), | ||
{"default": False, "required": False}, | ||
), | ||
22: ( | ||
"wagtail.blocks.CharBlock", | ||
(), | ||
{"max_length": 50, "required": False}, | ||
), | ||
23: ( | ||
"wagtail.blocks.ChoiceBlock", | ||
[], | ||
{ | ||
"choices": [ | ||
("arrow-alt", "Arrow alt"), | ||
("arrow-in-circle", "Arrow in circle"), | ||
("arrow-in-square", "Arrow in square"), | ||
("arrows", "Arrows"), | ||
("blog", "Blog"), | ||
("bread", "Bread"), | ||
("briefcase", "Briefcase"), | ||
("building", "Building"), | ||
("calendar", "Calendar"), | ||
("code-file", "Code File"), | ||
("document", "Document"), | ||
("envelope", "Envelope"), | ||
("explanation", "Explanation"), | ||
("eye", "Eye"), | ||
("flame", "Flame"), | ||
("friends", "Friends"), | ||
("github", "Github"), | ||
("handshake", "Handshake"), | ||
("heart", "Heart"), | ||
("history", "History"), | ||
("id-card", "ID Card"), | ||
("image", "Image"), | ||
("knife-fork", "Knife Fork"), | ||
("leaf", "Leaf"), | ||
("location-pin", "Location Pin"), | ||
("map", "Map"), | ||
("magnifying-glass", "Magnifying Glass"), | ||
("money", "Money"), | ||
("moon", "Moon"), | ||
("one-two-steps", "One Two Steps"), | ||
("padlock", "Padlock"), | ||
("paper-plane", "Paper Plane"), | ||
("paper-stack", "Paper Stack"), | ||
("pen-checkbox", "Pen Checkbox"), | ||
("person-in-tie", "Person in Tie"), | ||
("python", "Python"), | ||
("question-mark-circle", "Question Mark Circle"), | ||
("quotes", "Quotes"), | ||
("release-cycle", "Release Cycle"), | ||
("roadmap", "Roadmap"), | ||
("rocket", "Rocket"), | ||
("rollback", "Rollback"), | ||
("slack", "Slack"), | ||
("speech-bubble", "Speech Bubble"), | ||
("sun-cloud", "Sun Cloud"), | ||
("table-tennis", "Table Tennis"), | ||
("tree", "Tree"), | ||
("wordpress", "Wordpress"), | ||
("world", "World"), | ||
], | ||
"required": False, | ||
}, | ||
), | ||
24: ( | ||
"wagtail.blocks.CharBlock", | ||
(), | ||
{"label": "CTA text", "max_length": 255, "required": False}, | ||
), | ||
25: ( | ||
"wagtail.blocks.PageChooserBlock", | ||
(), | ||
{"label": "CTA page", "required": False}, | ||
), | ||
26: ( | ||
"wagtail.blocks.URLBlock", | ||
(), | ||
{"label": "CTA URL", "required": False}, | ||
), | ||
27: ( | ||
"wagtail.blocks.StructBlock", | ||
[[("text", 24), ("cta_page", 25), ("cta_url", 26)]], | ||
{}, | ||
), | ||
28: ( | ||
"wagtail.blocks.StructBlock", | ||
[ | ||
[ | ||
("heading", 20), | ||
("description", 15), | ||
("image", 14), | ||
("image_on_right", 21), | ||
("meta_text", 22), | ||
("meta_icon", 23), | ||
("cta", 27), | ||
] | ||
], | ||
{}, | ||
), | ||
29: ( | ||
"wagtail.blocks.TextBlock", | ||
(), | ||
{ | ||
"label": "Short description", | ||
"max_length": 100, | ||
"required": False, | ||
}, | ||
), | ||
30: ( | ||
"wagtail.blocks.StructBlock", | ||
[[("cta", 27), ("description", 29)]], | ||
{"group": "CTA options"}, | ||
), | ||
}, | ||
), | ||
), | ||
] |
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also looks like there is another instance of ImageChooserBlock in line 463 in LogoBlock. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Looks like there is an instance of ImageChooserBlock left in this file that wasn't replaced by the new ImageBlock. Did you not change it because it wasn't changed in the prior PR @Chiemezuo? Or do you have another reason for leaving it be?
See line 109 in the LogoCardBlock.