Event listeners are not being attached to some modal windows

Bug #1427756 reported by Victor Feitosa
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
OpenStack Dashboard (Horizon)
Fix Released
High
Sam Betts
Kilo
Fix Released
High
Matthias Runge

Bug Description

In some modal windows, form event listeners are not being attached correctly. For example the date picker that should be triggered on a focus event in the text box in [dashboard/admin/metering -> Modify Usage Report Parameters -> Other] is not. This might be a problem with the modal loading or a django issue.
This issue is not present if the form is not in a modal window (like it was in juno release), the event listeners are attached regularly and work as expected if the form is in a page of its own.

See attached files for reference.

Steps to reproduce:
1) Open the dashboard and go to admin/metering
2) Press the 'Modify Usage Report Parameters' button.
3) When the modal window appear select 'Other' from the spinner.
4) Click the 'from' or 'to' text inputs, a datepicker should pop out from there but it does not.
5) If you repeat these steps in juno, the datepicker will appear since the admin/metering/create url is in a page of its own.

Revision history for this message
Victor Feitosa (victor-feitosa) wrote :
Thiago Gomes (fthiagogv)
Changed in horizon:
status: New → Confirmed
assignee: nobody → Thiago Gomes (fthiagogv)
Thiago Gomes (fthiagogv)
Changed in horizon:
assignee: Thiago Gomes (fthiagogv) → nobody
Thiago Gomes (fthiagogv)
Changed in horizon:
assignee: nobody → Thiago Gomes (fthiagogv)
Thiago Gomes (fthiagogv)
Changed in horizon:
assignee: Thiago Gomes (thgomes) → nobody
Revision history for this message
Rob Cresswell (robcresswell-deactivatedaccount) wrote :

Seems like the modals have introduced an obvious regression here, and I can still reproduce the broken behaviour reliably

Changed in horizon:
importance: Undecided → Medium
Sam Betts (sambetts)
Changed in horizon:
assignee: nobody → Sam Betts (sambetts)
tags: added: kilo-rc-potential
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to horizon (master)

Fix proposed to branch: master
Review: https://review.openstack.org/168985

Changed in horizon:
status: Confirmed → In Progress
David Lyle (david-lyle)
Changed in horizon:
importance: Medium → High
milestone: none → kilo-rc1
David Lyle (david-lyle)
tags: removed: attaching django event listener modal window
Revision history for this message
Thierry Carrez (ttx) wrote :

Might be included in a RC2 if this is fixed in master soon

Changed in horizon:
milestone: kilo-rc1 → none
Thierry Carrez (ttx)
tags: removed: kilo-rc-potential
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to horizon (master)

Reviewed: https://review.openstack.org/168985
Committed: https://git.openstack.org/cgit/openstack/horizon/commit/?id=0d010f601cecacac01c26be572ae0d6444df9669
Submitter: Jenkins
Branch: master

commit 0d010f601cecacac01c26be572ae0d6444df9669
Author: Sam Betts <email address hidden>
Date: Mon Mar 30 16:49:24 2015 +0100

    Fix date pickers in metering modal

    The metering forms were using the date picker functionality from the
    d3 line chart library, this used to work when it was loaded as a whole
    page as the d3 libary would run intending to setup any d3 graphs however
    now it is being loaded as a modal the elements that would be affected by
    the d3 code do not exist at page load time.

    In order to get the date picker events to be added to the elements on
    the form when the modal loads, the JS in the forms template has been
    extended in this patch to support adding those events.

    This patch also changes the data attributes on the form elements so that
    they do not conflict with any d3 line chart elements.

    Alongside the javascript this patch fixes bug to do with parsing the
    dates in metering utils and adds UTs to prevent regression.

    Change-Id: I4e239daa03b2f54e434254bac48ba0cceb037b5d
    Closes-Bug: 1427756

Changed in horizon:
status: In Progress → Fix Committed
Matthias Runge (mrunge)
tags: added: kilo-backport-potential
Changed in horizon:
milestone: none → liberty-1
Revision history for this message
Matthias Runge (mrunge) wrote :

still valid on master

Changed in horizon:
status: Fix Committed → Confirmed
Revision history for this message
Matthias Runge (mrunge) wrote :

ok, this is fixed on master, but not fixed in kilo

Changed in horizon:
status: Confirmed → Fix Committed
Changed in horizon:
status: Fix Committed → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to horizon (stable/kilo)

Fix proposed to branch: stable/kilo
Review: https://review.openstack.org/195922

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to horizon (stable/kilo)

Reviewed: https://review.openstack.org/195922
Committed: https://git.openstack.org/cgit/openstack/horizon/commit/?id=ec27165a8db420ea1620b87353cb565fd7e5a03d
Submitter: Jenkins
Branch: stable/kilo

commit ec27165a8db420ea1620b87353cb565fd7e5a03d
Author: Sam Betts <email address hidden>
Date: Mon Mar 30 16:49:24 2015 +0100

    Fix date pickers in metering modal

    The metering forms were using the date picker functionality from the
    d3 line chart library, this used to work when it was loaded as a whole
    page as the d3 libary would run intending to setup any d3 graphs however
    now it is being loaded as a modal the elements that would be affected by
    the d3 code do not exist at page load time.

    In order to get the date picker events to be added to the elements on
    the form when the modal loads, the JS in the forms template has been
    extended in this patch to support adding those events.

    This patch also changes the data attributes on the form elements so that
    they do not conflict with any d3 line chart elements.

    Alongside the javascript this patch fixes bug to do with parsing the
    dates in metering utils and adds UTs to prevent regression.

    Change-Id: I4e239daa03b2f54e434254bac48ba0cceb037b5d
    Closes-Bug: 1427756
    (cherry picked from commit 0d010f601cecacac01c26be572ae0d6444df9669)

Thierry Carrez (ttx)
Changed in horizon:
milestone: liberty-1 → 8.0.0
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.