NAVADMC / ADSM

A simulation of disease spread in livestock populations. Includes detection and containment simulation.
Other
10 stars 5 forks source link

Send to loading screen when pressing "Delete Results and Apply Changes" #1013

Open ConradSelig opened 3 years ago

ConradSelig commented 3 years ago

See title.

@missyschoenbaum If you have any other buttons that you would like to send to a loading screen just mark them in this ticket. This would be any button where it takes a long time to process something before refreshing the screen.

missyschoenbaum commented 3 years ago

Added note, it does show loading screen, but returns to screen and bottom button is still showing Return to Inputs. I think it is moving slow, but does it even on Sample Scenario.

missyschoenbaum commented 3 years ago

RightaterLoadingFinsihed

missyschoenbaum commented 3 years ago

That's what it looks like. Again, I hit delete, loading indicator ran, screen comes back to this (View Results) and in 5 or so seconds changes to Validate Scenario as expected.

BryanHurst commented 3 years ago

When I tried this, I saw the loading notification, then when it went away it took about 1.5 seconds for the page to reload and change the button.

@missyschoenbaum this performance difference is about the same difference we see in #1014. It appears the performance difference between our two computers is pretty consistent.

To account for slower machines, we might want to go ahead with the idea of showing the full loading screen when deleting results instead of just the small loading notification. This way when the page comes back up the correct button should be in place.

missyschoenbaum commented 3 years ago

Works for me.

BryanHurst commented 3 years ago

@ConradSelig You should be good to take this over now.

ConradSelig commented 3 years ago

OK so long story short the typically loading screen is going to be harder to invoke than I expected - so I instead changed when the page is refreshed after deleting results.

The overlay that says "Working..." is still going to display, but it should no longer refresh BEFORE the validate / view results button has changed.

Unfortunately, my system is a lot like Bryan's such that the time between the "Working..." overlay closing and the button text updating is very small, so it's difficult for me to tell how much of a difference this change makes. I did record my screen both before and after this change - and slowing down the video it does seem to me that this change has fixed the issue, but it will likely come down to if it works on a slower machine like Missy's.

Fingers crossed this does the trick - moving to testing.

missyschoenbaum commented 3 years ago

This actually got worse. Loading hourglass finished after Delete and Appply changes, and I'm still sitting on View Results. I actually got distracted for a few minutes, so it had about 5 minutes to refresh. I will retest again before I throw back.

Here's the image, showing View Results and green bar, but I already deleted results . image

missyschoenbaum commented 3 years ago

Have repeated this in 3 places. Steps to recreate Open scenario with results (Sample Scenario with output) Notice View results is present on action button, and greem simulation complete bar Go to any page (Output settings) Change parameter (change iterations from 10 to 9 Hit the red Delete results and apply changes loading screen runs, then returns as shown in image above.

BryanHurst commented 3 years ago

@ConradSelig can you follow up on this one?

ConradSelig commented 3 years ago

I didn't actually remove any code - just changed the order that actions happened - so I'm not sure why things have gotten worse here.

I recall that sending the user to the full loading screen was going to be difficult in this case, that's because the "Delete Results and Apply Changes" button isn't an href like most cases - it runs some java-script that performs the actions. I'm not sure why I didn't think of it at the time, but I imagine an ajax call could be make that would still send the user to the full loading screen. I assume that would fix the problem.

@BryanHurst I can give a shot if you like, 2 hours at most? I struggle with ajax and have only ever had limited success with it. Not sure what billing status is currently so your call on what to do next.

missyschoenbaum commented 3 years ago

We can just roll back the change if we think it is only my slow PC.

BryanHurst commented 3 years ago

@ConradSelig we still have some hours that we billed out at the end, so lets go ahead and make this an ajax call so the loading process is in line with all other loading processes (full screen).

BryanHurst commented 3 years ago

I'll follow up on this one tomorrow (Tuesday 8/17/2020) and then make a production build.

missyschoenbaum commented 3 years ago

@BryanHurst Sounds good. I am out of office but will check in later this week.