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

Container is not defined with django-unfold #2

Open
Stf-F opened this issue Oct 17, 2024 · 2 comments
Open

Container is not defined with django-unfold #2

Stf-F opened this issue Oct 17, 2024 · 2 comments

Comments

@Stf-F
Copy link

Stf-F commented Oct 17, 2024

  • django-recurring version: 1.0.0
  • Python version: 3.12.3
  • Operating System: Mac OS 13.3.1
  • Django-unfold: 0.40.0

Hey,
First of all thanks for your work on this lib and offering some fixes and fresh air to the Jazzband version.
I have found a small issue in the admin that should be simple to fix, see below.
I have also found the UX of the EventForm a bit complex and misleading. I will come back a bit later to comment / PR on this if you are ok with the idea.
Thanks

Description

When trying to save a model in the admin, the following error shows up: container is not defined
image

Coming from the following:

          if (event.recurrence_rule) {
                const foreverRadio = container.querySelector('input[name^="end-recurrence"][value="forever"]');
               //....
            }

To fix this, I have added the validateDateInputs function like so:

function validateDateInputs() {
 const container = calendarEntryForm.container // NEW
}
@boosh
Copy link
Owner

boosh commented Oct 18, 2024

Hmm strange, I can't reproduce that. Can you post a screenshot of the event you were trying to create please?

As for the UX it basically wraps datetime's rruleset pretty tightly. I initially found it unintuitive that the start/end dates were of the event itself and the recurrence rule controlled (surprise) recurrence. Intuitively I wanted to create an event that ran from e.g. 1-31 October as the start/end times, but that's not how rruleset works. I've tried to address that with help text. Maybe that's what you're referring to?

@Stf-F
Copy link
Author

Stf-F commented Oct 22, 2024

Hi @boosh , sorry, busy couple of past days.
I was using django-unfold in the project where I observed these issues, so to be on the safe side I created a fresh project with nothing else that your package and I haven't been able to reproduce this issue either.
Re-installed django-unfold in this test project and the error was back. Not sure what's causing it but that's not a bug with the Django stock UI. I will keep looking into it, and in the meantime update the issue title accordingly.
Cheers.

@Stf-F Stf-F changed the title container is not defined Container is not defined with django-unfold Oct 22, 2024
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

No branches or pull requests

2 participants