wagtail-deprecated / wagtail-react-streamfield

Powerful field for inserting multiple blocks with nesting. (NO LONGER MAINTAINED - See Wagtail 2.13 Release Notes)
https://wagtail.github.io/react-streamfield/public/
BSD 3-Clause "New" or "Revised" License
74 stars 23 forks source link

TimeBlock wont accept value from timepicker #10

Closed dougfir-lc closed 6 years ago

dougfir-lc commented 6 years ago

I would like to say that I am excited about this project and can't wait for it to be merged into Wagtail. It is a much needed improvement over the current StreamField backend. Great work! I have a couple of bugs to report that I am submitting as two separate issues.

Version: 0.8.5

Steps to reproduce:

  1. Create a new page and add a TimeBlock
  2. Selecting time from the time picker and then saving will trigger a validation error on the field and empty it.
  3. If “:00” is added to the end of the time that is selected from the picker then the page will save fine. The issue seems to be in the way time values are recognized in the javascript.

Here is a sample of the code used to recreate this issue:

class TestStreamBlock(StreamBlock):
    NUMBERS = (('one', 'one'), ('two', 'two'),)

    time = TimeBlock()
    name = CharBlock(default='Test Name 1')
    number = ChoiceBlock(max_length=3, choices=NUMBERS, default=NUMBERS[0])

class TestPage(Page):
    content = StreamField(TestStreamBlock(required=False),blank=True)

    content_panels = Page.content_panels + [
        StreamFieldPanel('content'),
    ]
BertrandBordage commented 6 years ago

I cannot reproduce the issue on my setup. Could you tell me which version of Wagtail you are using? Now that #9 is merged, this project only supports Wagtail >= 2.2.

dougfir-lc commented 6 years ago

Solved the problem, turns out it was an issue with the ordering of the installed_apps on our end.