Skip to content

Conversation

@BesherKitaz
Copy link
Contributor

Issue Description

fixes #534

Original Problem Description:
After sorting the Pending Overloads table (from the Pending Forms page), clicking on "Manage" from the Actions menu results in erratic behavior. Sometimes the modal only shows up after the second attempt, sometimes it does not show up at all. It appears to work normally before sorting.

What I found after checking:
The problem is that the modal is ONLY opening when we click the text inside the button, which means if the user clicks anywhere else on the button, the modal will not open. This is because we are checking the event when the text is clicked, not the button. This is also happening to the "view notes" button, but it is far less noticeable since the text covers most of the button's width.
Another problem found is that the modal is opening before the data is loaded/updated, which can cause old data from the previously opened modal to populate in the currently open one until the new data is received.

Changes

  • The modal opens after the data is loaded as a callback function
  • Now we are targeting the entire button whenever a click event happens
  • The modal will open if we click anywhere on the button, not necessarily on the text inside the button
  • All list buttons in the list previously had the same "menu1" id. Now it is changed to be unique so that we can uniquely target each item.
  • Now the id looks like "menu{{allForms.formHistoryID}}" so that each button is unique.

Testing

  • After pulling the branch and checking it out, run in your terminal "flask run"
  • On the LSF website, from the navigation side panel, click "administration" to expand the list
  • Click "Pending Forms" to navigate to that page
  • Inside the page, from the navigation bar on top, navigate to "Pending Overload Forms"
  • You will see a table of the form, each row has a button "Actions" on the right
  • Click that button and test the "manage" and "view notes" buttons from the drop-down list.
  • Make sure the modal is always opening, and the data is accurate inside the modal
  • Make sure you are able to submit the modal and the data uploads successfully.

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.

'Manage' modal for Overloads is erratic after sorting.

2 participants