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

V0.1.5 #31

Open
wants to merge 72 commits into
base: master
Choose a base branch
from
Open

V0.1.5 #31

wants to merge 72 commits into from

Conversation

aaronhaslett
Copy link

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.
if isinstance(value.pk, uuid.UUID):
return str(value.pk)
else:
return value.pk
return ''
return value
Copy link

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