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

Fixes #18 - AJAX Selector and dynamic inlines #67

Merged
merged 1 commit into from
Feb 26, 2014

Conversation

peterfarrell
Copy link

Klugy, but fixes issue with inlines dynamically added by "Add another XXX item" in which the AJAX select is not init'ed.

@crucialfelix
Copy link
Owner

What is the issue ? Do you know how to reproduce it ? Thanks for the fix,
ill check it out.
On Jan 17, 2014 5:13 PM, "Peter J. Farrell" [email protected]
wrote:

Klugy, but fixes issue with inlines dynamically added by "Add another XXX

item" in which the AJAX select is not init'ed.

You can merge this Pull Request by running

git pull https://github.com/GreatBizTools/django-ajax-selects develop

Or view, comment on, or merge it at:

#67
Commit Summary

  • Fixes issue with dynamically added rows not having a select

File Changes

Patch Links:


Reply to this email directly or view it on GitHubhttps://github.com//pull/67
.

@peterfarrell
Copy link
Author

ISSUE:

The issue is when using tabular inlines with an ajax select when adding
a new row. The new row's ajax select doesn't work because the
init-autocomplete is only called when the page loads.

REPRO:

Click "Add XX" button or anchor in a tabular inline when an ajax select
is used. The new row's ajax select doesn't work.

FIX:

There is no JS event to watch to call init-autocomplete so the hack is
watch for 3 different CSS selectors (that references the "Add XX" text
)that cause the init-autocomplete to be called when the new row is added
for the tabular inline.

crucialfelix said the following on 01/17/2014 10:18 AM:

What is the issue ? Do you know how to reproduce it ? Thanks for the fix,
ill check it out.
On Jan 17, 2014 5:13 PM, "Peter J. Farrell" [email protected]
wrote:

Klugy, but fixes issue with inlines dynamically added by "Add
another XXX

item" in which the AJAX select is not init'ed.

You can merge this Pull Request by running

git pull https://github.com/GreatBizTools/django-ajax-selects develop

Or view, comment on, or merge it at:

#67
Commit Summary

  • Fixes issue with dynamically added rows not having a select

File Changes

Patch Links:


Reply to this email directly or view it on
GitHubhttps://github.com//pull/67
.


Reply to this email directly or view it on GitHub
#67 (comment).

Peter J. Farrell
Principal Technologist - GreatBizTools, LLC
651-747-1250 x101

@hogdarog
Copy link

hogdarog commented Feb 4, 2014

works for me.
Would love to see this merged...

@markshust
Copy link

Confirmed this fixes the bug, it's not kludgy if it works perfect... please merge!!

@crucialfelix
Copy link
Owner

OK, I'm really busy but I'm going to trust you guys on this one and merge
and release it ! Thanks all for checking it.

I'd love to get unit testing in here so we can easily test and confirm
issues. Its tricky with the popups though.

On Thu, Feb 20, 2014 at 10:17 PM, Mark Shust [email protected]:

Confirmed this fixes the bug, it's not kludgy if it works perfect...
please merge!!


Reply to this email directly or view it on GitHubhttps://github.com//pull/67#issuecomment-35669921
.

@peterfarrell
Copy link
Author

In addition to unit testing, adding some integration testing via Selenium
would make testing the actual interface in the browser and popups feasible.

Fyi, the pull request just looks for the CSS selector that are added to the
DOM when Add XXX link is clicked to get a new entry row. In the future, it
sounds like django will create a js event / signal so we would have
something to watch (maybe in 1.7) instead of looking for elements to be
dynamically added to the DOM.
On Feb 20, 2014 3:42 PM, "crucialfelix" [email protected] wrote:

OK, I'm really busy but I'm going to trust you guys on this one and merge
and release it ! Thanks all for checking it.

I'd love to get unit testing in here so we can easily test and confirm
issues. Its tricky with the popups though.

On Thu, Feb 20, 2014 at 10:17 PM, Mark Shust [email protected]:

Confirmed this fixes the bug, it's not kludgy if it works perfect...
please merge!!


Reply to this email directly or view it on GitHub<
https://github.com/crucialfelix/django-ajax-selects/pull/67#issuecomment-35669921>

.


Reply to this email directly or view it on GitHubhttps://github.com//pull/67#issuecomment-35672441
.

@crucialfelix
Copy link
Owner

Yeah I've been thinking of setting it up with selenium for a while. It
would be fun.

On Thu, Feb 20, 2014 at 10:49 PM, Peter J. Farrell <[email protected]

wrote:

In addition to unit testing, adding some integration testing via Selenium
would make testing the actual interface in the browser and popups
feasible.

Fyi, the pull request just looks for the CSS selector that are added to
the
DOM when Add XXX link is clicked to get a new entry row. In the future, it
sounds like django will create a js event / signal so we would have
something to watch (maybe in 1.7) instead of looking for elements to be
dynamically added to the DOM.
On Feb 20, 2014 3:42 PM, "crucialfelix" [email protected] wrote:

OK, I'm really busy but I'm going to trust you guys on this one and
merge
and release it ! Thanks all for checking it.

I'd love to get unit testing in here so we can easily test and confirm
issues. Its tricky with the popups though.

On Thu, Feb 20, 2014 at 10:17 PM, Mark Shust [email protected]:

Confirmed this fixes the bug, it's not kludgy if it works perfect...
please merge!!


Reply to this email directly or view it on GitHub<

https://github.com/crucialfelix/django-ajax-selects/pull/67#issuecomment-35669921>

.


Reply to this email directly or view it on GitHub<
https://github.com/crucialfelix/django-ajax-selects/pull/67#issuecomment-35672441>

.


Reply to this email directly or view it on GitHubhttps://github.com//pull/67#issuecomment-35673190
.

@peterfarrell
Copy link
Author

Yep, very useful. Let me know if you need any help with it...
On Feb 20, 2014 3:56 PM, "crucialfelix" [email protected] wrote:

Yeah I've been thinking of setting it up with selenium for a while. It
would be fun.

On Thu, Feb 20, 2014 at 10:49 PM, Peter J. Farrell <
[email protected]

wrote:

In addition to unit testing, adding some integration testing via
Selenium
would make testing the actual interface in the browser and popups
feasible.

Fyi, the pull request just looks for the CSS selector that are added to
the
DOM when Add XXX link is clicked to get a new entry row. In the future,
it
sounds like django will create a js event / signal so we would have
something to watch (maybe in 1.7) instead of looking for elements to be
dynamically added to the DOM.
On Feb 20, 2014 3:42 PM, "crucialfelix" [email protected]
wrote:

OK, I'm really busy but I'm going to trust you guys on this one and
merge
and release it ! Thanks all for checking it.

I'd love to get unit testing in here so we can easily test and confirm
issues. Its tricky with the popups though.

On Thu, Feb 20, 2014 at 10:17 PM, Mark Shust [email protected]:

Confirmed this fixes the bug, it's not kludgy if it works perfect...
please merge!!


Reply to this email directly or view it on GitHub<

https://github.com/crucialfelix/django-ajax-selects/pull/67#issuecomment-35669921>

.


Reply to this email directly or view it on GitHub<

https://github.com/crucialfelix/django-ajax-selects/pull/67#issuecomment-35672441>

.


Reply to this email directly or view it on GitHub<
https://github.com/crucialfelix/django-ajax-selects/pull/67#issuecomment-35673190>

.


Reply to this email directly or view it on GitHubhttps://github.com//pull/67#issuecomment-35674073
.

@crucialfelix
Copy link
Owner

Have you set up selenium tests before ?

On Thu, Feb 20, 2014 at 10:59 PM, Peter J. Farrell <[email protected]

wrote:

Yep, very useful. Let me know if you need any help with it...
On Feb 20, 2014 3:56 PM, "crucialfelix" [email protected] wrote:

Yeah I've been thinking of setting it up with selenium for a while. It
would be fun.

On Thu, Feb 20, 2014 at 10:49 PM, Peter J. Farrell <
[email protected]

wrote:

In addition to unit testing, adding some integration testing via
Selenium
would make testing the actual interface in the browser and popups
feasible.

Fyi, the pull request just looks for the CSS selector that are added
to
the
DOM when Add XXX link is clicked to get a new entry row. In the
future,
it
sounds like django will create a js event / signal so we would have
something to watch (maybe in 1.7) instead of looking for elements to
be
dynamically added to the DOM.
On Feb 20, 2014 3:42 PM, "crucialfelix" [email protected]
wrote:

OK, I'm really busy but I'm going to trust you guys on this one and
merge
and release it ! Thanks all for checking it.

I'd love to get unit testing in here so we can easily test and
confirm
issues. Its tricky with the popups though.

On Thu, Feb 20, 2014 at 10:17 PM, Mark Shust <
[email protected]>wrote:

Confirmed this fixes the bug, it's not kludgy if it works
perfect...
please merge!!


Reply to this email directly or view it on GitHub<

https://github.com/crucialfelix/django-ajax-selects/pull/67#issuecomment-35669921>

.


Reply to this email directly or view it on GitHub<

https://github.com/crucialfelix/django-ajax-selects/pull/67#issuecomment-35672441>

.


Reply to this email directly or view it on GitHub<

https://github.com/crucialfelix/django-ajax-selects/pull/67#issuecomment-35673190>

.


Reply to this email directly or view it on GitHub<
https://github.com/crucialfelix/django-ajax-selects/pull/67#issuecomment-35674073>

.


Reply to this email directly or view it on GitHubhttps://github.com//pull/67#issuecomment-35674311
.

@peterfarrell
Copy link
Author

Yes, quite a few at work. Never explored using selenium with windows that
popup. I could probably help get the basics setup... In not 100% sure that
know what you would want to test so I'd need some help planning test cases.
On Feb 20, 2014 4:02 PM, "crucialfelix" [email protected] wrote:

Have you set up selenium tests before ?

On Thu, Feb 20, 2014 at 10:59 PM, Peter J. Farrell <
[email protected]

wrote:

Yep, very useful. Let me know if you need any help with it...
On Feb 20, 2014 3:56 PM, "crucialfelix" [email protected]
wrote:

Yeah I've been thinking of setting it up with selenium for a while. It
would be fun.

On Thu, Feb 20, 2014 at 10:49 PM, Peter J. Farrell <
[email protected]

wrote:

In addition to unit testing, adding some integration testing via
Selenium
would make testing the actual interface in the browser and popups
feasible.

Fyi, the pull request just looks for the CSS selector that are added
to
the
DOM when Add XXX link is clicked to get a new entry row. In the
future,
it
sounds like django will create a js event / signal so we would have
something to watch (maybe in 1.7) instead of looking for elements to
be
dynamically added to the DOM.
On Feb 20, 2014 3:42 PM, "crucialfelix" [email protected]
wrote:

OK, I'm really busy but I'm going to trust you guys on this one
and
merge
and release it ! Thanks all for checking it.

I'd love to get unit testing in here so we can easily test and
confirm
issues. Its tricky with the popups though.

On Thu, Feb 20, 2014 at 10:17 PM, Mark Shust <
[email protected]>wrote:

Confirmed this fixes the bug, it's not kludgy if it works
perfect...
please merge!!


Reply to this email directly or view it on GitHub<

https://github.com/crucialfelix/django-ajax-selects/pull/67#issuecomment-35669921>

.


Reply to this email directly or view it on GitHub<

https://github.com/crucialfelix/django-ajax-selects/pull/67#issuecomment-35672441>

.


Reply to this email directly or view it on GitHub<

https://github.com/crucialfelix/django-ajax-selects/pull/67#issuecomment-35673190>

.


Reply to this email directly or view it on GitHub<

https://github.com/crucialfelix/django-ajax-selects/pull/67#issuecomment-35674073>

.


Reply to this email directly or view it on GitHub<
https://github.com/crucialfelix/django-ajax-selects/pull/67#issuecomment-35674311>

.


Reply to this email directly or view it on GitHubhttps://github.com//pull/67#issuecomment-35674664
.

@crucialfelix
Copy link
Owner

The popups are hard I think. If you want to submit even a basic pull
request with selenium tests, that would be great. I can bang out pure
python tests quite easily.

On Thu, Feb 20, 2014 at 11:05 PM, Peter J. Farrell <[email protected]

wrote:

Yes, quite a few at work. Never explored using selenium with windows that
popup. I could probably help get the basics setup... In not 100% sure that
know what you would want to test so I'd need some help planning test
cases.

@peterfarrell
Copy link
Author

I might have time setup Selenium this weekend or next. FYI, it's really
easy to record tests in Selenium IDE in FF/Chrome, then use export to
Python and then tweak them. The IDE is pretty good but by no means
perfect (you figure out that everything you want to assert or type /
select should have an ID or you end up with long CSS selectors) however
it does get you 95% of the way there and is a time saver.

crucialfelix said the following on 02/20/2014 04:32 PM:

The popups are hard I think. If you want to submit even a basic pull
request with selenium tests, that would be great. I can bang out pure
python tests quite easily.

On Thu, Feb 20, 2014 at 11:05 PM, Peter J. Farrell
<[email protected]

wrote:

Yes, quite a few at work. Never explored using selenium with windows
that
popup. I could probably help get the basics setup... In not 100%
sure that
know what you would want to test so I'd need some help planning test
cases.


Reply to this email directly or view it on GitHub
#67 (comment).

Peter J. Farrell
Principal Technologist - GreatBizTools, LLC
651-747-1250 x101

@crucialfelix
Copy link
Owner

no stress, only if it interests you and you want to do it.
thanks !

On Thu, Feb 20, 2014 at 11:50 PM, Peter J. Farrell <[email protected]

wrote:

I might have time setup Selenium this weekend or next. FYI, it's really
easy to record tests in Selenium IDE in FF/Chrome, then use export to
Python and then tweak them. The IDE is pretty good but by no means
perfect (you figure out that everything you want to assert or type /
select should have an ID or you end up with long CSS selectors) however
it does get you 95% of the way there and is a time saver.

crucialfelix said the following on 02/20/2014 04:32 PM:

The popups are hard I think. If you want to submit even a basic pull
request with selenium tests, that would be great. I can bang out pure
python tests quite easily.

On Thu, Feb 20, 2014 at 11:05 PM, Peter J. Farrell
<[email protected]

wrote:

Yes, quite a few at work. Never explored using selenium with windows
that
popup. I could probably help get the basics setup... In not 100%
sure that
know what you would want to test so I'd need some help planning test
cases.


Reply to this email directly or view it on GitHub
<
#67 (comment)
.

Peter J. Farrell
Principal Technologist - GreatBizTools, LLC
651-747-1250 x101

Reply to this email directly or view it on GitHubhttps://github.com//pull/67#issuecomment-35679311
.

crucialfelix added a commit that referenced this pull request Feb 26, 2014
Fixes #18 - AJAX Selector and dynamic inlines
@crucialfelix crucialfelix merged commit 1433db4 into crucialfelix:develop Feb 26, 2014
jact added a commit to migasfree/migasfree that referenced this pull request Dec 13, 2015
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

Successfully merging this pull request may close these issues.

4 participants