nhsuk / wagtail-nhsuk-frontend

A wagtail implementation of the NHS.UK frontend library
MIT License
21 stars 13 forks source link

Few things from initial installation #162

Open chrimesdev opened 4 years ago

chrimesdev commented 4 years ago

I've recently spun up a blank Wagtail instance and installed this plugin, overall the setup process was really straight forward and it works perfectly. However there were just a few things stumbling blocks that I found, which slowed me down a little bit, but this might just be due to my general lack of Wagtail/Python knowledge.

These are probably small stupid things are the only issues I came across, otherwise I would have managed to setup the Wagtail instance with plugin installed within less than 5 minutes!

mikemonteith commented 4 years ago

When I tried to make migrations after adding the StreamFieldPanel('body') to my Homepage model. I got an error about a non-nullable field, I was given the option to populate the field with a value. At first I had no idea what the value should be, but then I tried "String" but this threw an error so then I tried a blank string "" and this worked - just wondering if there could be any documentation for this or even a work around to avoid the error all together?

This is fairly standard Django behaviour when adding a non-nullable field to an existing model. however our installation docs suggest adding a body to the HomePage model, which already exists in the base wagtail install so anybody following the readme will come across this error. Would be good to at least link to the relevant Django docs at that point.

mikemonteith commented 4 years ago

When adding the Header component along with the site settings configuration. I added 'wagtailnhsukfrontend.settings' to my INSTALLED_APPS but didn't have ‘wagtail.contrib.settings’ in there so it didn't work - again just wondering if this needs to be documented? Not sured if I should have had ‘wagtail.contrib.settings’ by default!

We should definitely mention that wagtail.contrib.settings is a required dependency

mikemonteith commented 4 years ago

When adding the Hero component mixin to the Homepage model, it became a mandatory component/field within the admin for the Homepage. I didn't necessarily want to use the component straight away, but wanted to make it available on the Homepage incase I ever needed. I couldn't save the page without populating the Hero fields - could this component/fields be non mandatory?

I'm not 100% sure about this. Either:

  1. Hero is mandatory, needs extra work to make it optional
  2. Hero is optional, needs extra work to make it mandatory

I think the wagtail convention would be to make it mandatory and have a different page model for pages where the hero was not wanted.

DomBaker commented 3 years ago

Has anything come of this issue or do we require some action against this? @chrimesdev @mikemonteith

chrimesdev commented 3 years ago

Still need to action the above, might be worth trying to do the setup again and see if similar (or other problems) arise