Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
New admin preview #3383
Currently, the admin preview is easily breakable. You get an infinite spinner on the preview page when you:
As agreed with @tomdyson, I worked on a solution to fix these annoyances.
The solution was to avoid sending form data directly to the preview page. So data had to be stored somewhere, and I chose to store it in django session data. I automatically clean the session to remove old preview data to avoid increasing its weight too much. This is the best compromise I found to avoid creating an extra database table just for previews…
It also adds
I noticed a browser performance issue while typing data, and thought at first it was coming from my changes, but it appears to be coming from something else since it also occurs on the master branch. I didn’t dig much, but it’s not happening on my deployed Wagtail 1.8 sites.
Another existing issue is that request.FILES is correctly sent to the preview page, but since files are not saved before rendering the page, it only leads to dead links. I chose to ignore request.FILES; we can’t find a solution unless we actually save these files temporarily. Since Wagtail sites mostly use wagtailimages and wagtaildocs instead, it seemed reasonable to put this aside for the moment.
Here are a couple of comments to make this more user-friendly (hopefully).
Tested and OK
Looks good to me! Just a few minor nitpicky things that I think would be nice.