Skip to content

V0.1.5#31

Open
aaronhaslett wants to merge 72 commits into
masterfrom
v0.1.5
Open

V0.1.5#31
aaronhaslett wants to merge 72 commits into
masterfrom
v0.1.5

Conversation

@aaronhaslett
Copy link
Copy Markdown

No description provided.

aaronhaslett and others added 30 commits May 24, 2021 12:18
This hack was introduced to allow wagtailfontawesome icons to render
with <span> tags, but it's kind of horrible so I'm pulling it out in
favour of just using upstream wagtail icons for now.
DB conversion rules to support new wagtail's markup DB format
I don't know why this is necessary but 2.0.2 wagtail seems to want it
You need a strong background in draftail customization to understand this

We're stuck with the following bad things:
* We gotta save to the DB in the HTML format we're going to render.
    This means draftail is sharing that format so we have to save
    everything draftail needs.
* There needs to be a system-unique DOM selector rule to find tags in
    the HTML to convert to contentstate for the draftail editor.

To solve both at the same time we add an attr called modelchooser_choice_{}
which holds the choice id, and the name of the attr resolves the unique
DOM selector thing, because we can use span[modelchooser_choice_{}].

That's fine, frontend can just ignore it, but the big drawback is that
draftail needs the DOM element's children so it can display the block,
but then the frontend gets it too.  Frontend does the correct thing and
replaces the text with live data, but you see a flicker of the alt
text.  Really annoying, but will resolve soon with some kind of
rewriter solution.
Comment thread wagtailmodelchoosers/widgets.py Outdated
else:
return value.pk
return ''
return value
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

When value is None here we end up with stringified "None" as the value in form field.

Suggested change
return value
return value or ""

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants