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

Bug fixes #97

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from
Open

Conversation

Robert-Lebedeu
Copy link

CHANGES:

  1. Templates:
    • Removed the title inside the change_form template.
    • Commented the _af_handler.destroy() call inside common_js_init because I didn't want to clean up
      every time the add rule button was pressed.
  2. Forms:
    • Changed isnull operator from None to 'None' (Before it wasn't working and with 'None' worked
      perfectly).
    • The value field now is not required anymore if you select one of these operators: 'isnull', 'istrue,
      'isfalse' (Also the value field becomes a readonly field, in these cases).
    • I also removed the part that auto-selects the range operator with datetime fields.
      This was creating some issues and I thought it was a useless feature to keep in so I get rid of
      that part.
  3. Static:
    • Added try-catch when using Django-Grappelli and JQuery-UI
    • Changed the modify_widget
    • I found some functions that were called twice with out any valid reason, I commented that parts
      and this corrected some bugs (for example: now range operator works properly).
    • I also commented the field_selected(...).first() call because I thought that it didn't make any
      sense to re-initiate the first rule (this problem was forcing you to use always an equal operator as
      your first rule) .
    • I also changed the initialize_select2 function to set the autocomplete only with foreign keys and
      'iexact' operator.

@lorenzomorandini
Copy link

This PR actually fixes a lot of JavaScript issues, can it be merged please?

@asfaltboy
Copy link
Member

asfaltboy commented Feb 8, 2019

There's a failing test and a few dubious changes, but I'm sure it can be brought to shape. @lorenzomorandini would you care to review & test the code?

@lorenzomorandini
Copy link

Ok, I will review it

@coveralls
Copy link

Coverage Status

Coverage increased (+0.05%) to 95.969% when pulling b902218 on Robert-Lebedeu:develop into 4f1575a on modlinltd:develop.

@modlinltd modlinltd deleted a comment Feb 11, 2019
@lorenzomorandini
Copy link

I've been trying this version for a few days and all javascript problems seem to have gone:

  • Datetime range works and does not duplicate when adding a new row
  • Select2 autocomplete appears only for foreign key fields
  • Works without django grappelli too

@asfaltboy
Copy link
Member

Update: I'm working on a test suite for JS using selenium, once I am able to anchor all feature and reproduce the issues mentioned here, I this it will reduce the risk when merging this PR.

aatrubilin added a commit to aatrubilin/django-advanced-filters that referenced this pull request Apr 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants