NAVADMC / ADSM

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

Adding destination in disease spread unexpected behavior #851

Closed missyschoenbaum closed 5 years ago

missyschoenbaum commented 6 years ago

Steps to recreate 1) Open empty sample, save as new name (test851) 2) Go to production type panel, add a new species (Nilgai) 3) Go to population, edit population and turn some units into new species, and make one latent disease state 4) Go to Assign progression, assign the new species the Cattle Reaction 5) Go to Disease Spread - we will attempt to add on to an existing one, so pick Swine>Swine 6) Go to the bottom middle panel, to Production Type Combinations (this is where we assign who infects who) 7) + Add New Source, In the Source Production Type, pick your new species, this part works and flies out the panel 8) Under destination, click the pull down and attempt to pick any production type listed. when you try to click on one, the New Source disappears.

Here's a catch, I was able to actually pick one, once but could not repeat it. I am wondering if the functionality works, but maybe the alignment of click is off. Notice the cross bar on the pull down is sort of out of place. So one time I accidentally landed in the right click spot, but just can't find it. The whole word highlights on hover. I tried checking the box, picking the name, picking anywhere in the highlight.

I will save my sqlite up into Google if you don't want to go through full steps. addingnewptpair

missyschoenbaum commented 6 years ago

OK, I went and tested, and I can add new when the production type previously existed. Maybe it is not just alignment. I tested in all other places for assign to make sure new Prod Type is coming through, and it appears to be. I can assign a protocol and a zone. I tried it on Indirect Spread and Airborne and get same action. I tried just modifying the Prod Type name, and it works. I also cheated it, by adding a spread combination with an existing Prod Type, and then I changed the source, and that saved.

missyschoenbaum commented 6 years ago

If a new production type combination is added, the user is able to select a source production type, but when they go to select a destination the order of the source production types is applied as the user selects the first destination. The order that is applied is the same order that is found in the production types panel. After the order is applied, the bottom most source production type is shown as "selected" and its destination drop down is also shown (looks as if the user had selected that source production type).

productiontypeserrorexample

From this point, if the user tries to add a source production type "A", they are allowed to select the first destination before "Nothing" is selected. The order of the production types is then "E,F,B,D,C,A,Nothing". The user can add destinations to "A" but must go up the list and re-select it by hand.

Bug only seems to happen when there is an existing list of source/destination present. First one works without issue.

It is expected the the production types combinations are not sorted until the "Apply" button is pressed.

missyschoenbaum commented 6 years ago

@ConradSelig Do you want me to add the new example on to this one? Or create new ticket?

missyschoenbaum commented 6 years ago

@ConradSelig KSU is hitting this, can you look into it and see if we can find a workaround?

ConradSelig commented 6 years ago

I still dont have my production types showing, I would have to fix that before I could make any progress on this.

I can still look into it if you want, but I guarantee it will take me longer than you want - even for something as simple as a workaround.

ConradSelig commented 6 years ago

Just a quick update after several hours of work:

I think I have the problem narrowed down, it appears to be a destination id error of some sort. Basically when you make a POST (add) request for a new spread combination, it parses the source and the destination production types as integers instead of the string displayed. When adding a new production type, it seems that no id is "registered", meaning the part of the code parsing the ids cannot find it (and therefor does not think it exists). Because of that, when you go to add a new spread with your new production type it defaults to erasing it so the program does not crash. Hopefully that makes at least a little sense.

I'm not sure yet how to fix this problem, it might still be a parsing error, but it may also have something to do with how production types are added manually. More updates to come!

ConradSelig commented 6 years ago

Another update (and a workaround!):

My last hypothesis was incorrect, this is not an ID problem. I went back through and found where the ids are being generated and found no problems. Further testing led to an important discovery, although I'm not quite sure how the two are linked yet.

I've numbered the steps in the original post to make referencing them easier. Following the steps, if you stop after step 7 and first go to the "Review Disease Spread" page, then step 8 acts like you expect it to (you can chose the new production type both as a source and a destination).

Clearly the "Review Disease Spread" page is initializing something that the "Disease Spread" page need to initialize as well. I'm not sure what that is quite yet, but I'm looking into it next.

More updates to come!

missyschoenbaum commented 6 years ago

Excellent, having a good workaround makes me less worried about it. If there isn't a quick resolution, we can drop the priority on this.

ConradSelig commented 6 years ago

I don't know enough JavaScript to know for sure, so I'll put this one back in groomed and ready until I've done some more research.

I can say this - the function that needs to be run is almost certainly in "SpreadGrid.js", I'm just not sure what component in there needs to be run.

missyschoenbaum commented 6 years ago

I exercised this while working on 896. There is still something quirky, but it is hard to pin down exact action to recreate. Sometimes, it acts like it picks whole list, but really only picks one choice. I will circle back and attempt to get a systematic test on it to have steps to recreate.

missyschoenbaum commented 6 years ago

Occasionally, this is still quirky, but I can't give exact steps to recreate. I will keep working on it.

missyschoenbaum commented 5 years ago

I hit this again. Had changed populations and was re-assigning parameter blocks for disease spread. Direct and Indirect worked file. Airborne didn't. It let me add the source. On the destination, it would pull down the menu, but would not allow me to interact with either choice. I could work around it by saving the top portion of the block before the spread assignment. Then it would allow me to access the choices on the menu. I think this is a rare case with a work around. Let's talk and decide if it is worth one more look, or if we should document known bug an close.

missyschoenbaum commented 5 years ago

Hitting this again today. Works one time, doesn't the next. Steps to recreate 1) Any scenario 2) Use the +New direct spread button 3) Name it, check latent can spread, subclinical can 4) set contact rate (.5) mine had prev on, so no inf probability 5) pick a distance dist 6) pick a movt control 7) Now, do apply, but don't leave screen 8) pick source 9) attempt to pick destination list comes up, but does not allow you to check.

If you leave screen, and do review, somehow that resets and then you can work. However, it is NOT intuitive that you cannot work through process in one step.

After I come back, it appears that I did pick something.

ConradSelig commented 5 years ago

I only caught this error when I had not applied the new spread before trying to pick production type combinations (so skipping step 7). This makes sense as the production type combinations are attached to the disease spread and if you have not yet hit "apply" that spread does not exist yet, making it impossible to attach. @missyschoenbaum Best thing to do here would be to hide the production type combinations until the user hits "apply", I have no idea how we would manage to implement this but I'm sure it's possible.

I'm also still catching the error where the combinations are ordered to match the production panel order and this can mess up the destination assignments.

Lot of work to be done here.

ConradSelig commented 5 years ago

Here is a screenshot of the adjusted Production Type Combinations section. I have six productions types (A, B, C, D, E, and F) that are NOT in alphabetical order (see the production type panel in screenshot). Combinations are in the same order as found in the production type panel, and DO NOT change order unless a new production type is added. I've scrolled ALL the way to the bottom of the spread center-panel, but don't worry the rest of the form is up there!

image

@missyschoenbaum Now would be a great time to change wording on anything shown here if you want to pursue that. Otherwise there is still more work to do on this ticket.

@BryanHurst and @851(for the record) I am not pushing these changes yet as there is still some work to do cleaning up the data after preparing it for display so other aspects of the program do not break. The code is on the way!

ConradSelig commented 5 years ago

Have been working on hiding the production type combinations before a form has been created. Here is what it looks like currently:

image

Filling out the form, hitting apply, and reselecting the new spread shows you this screen:

image

@missyschoenbaum I've already pushed the code with wording AS IS. If you are happy with said wording and described actions it move this ticket to Testing and assign to Bryan, otherwise let me know what you want to change and we'll get that sorted out first.

missyschoenbaum commented 5 years ago

I'm on it

missyschoenbaum commented 5 years ago

Are we worried about the yellow color indicating that they are required fields? Do we have any option on that?

missyschoenbaum commented 5 years ago

Can we change the words Production Types Combinations will become available when the above disease spread has been filled out and saved. to Production Types Combinations represent how disease spreads between the different production types. The list will become available when the disease spread parameters above have been filled out and saved.

Otherwise, I am OK

ConradSelig commented 5 years ago

I can't seem the change the color of this widget... I'm going to keep thinking on it however to see if I come up with anything. Otherwise @BryanHurst likely has a better idea of how to get that aspect of the formatting right.

I realized it was a little silly to allow the users to select a source if we were just going to display all of them anyways, so the source is just a label now.

image @missyschoenbaum Do you like how this works?

I also changed the text as requested.

missyschoenbaum commented 5 years ago

Yes, I think presenting the production types as labels is consistent with how we do the other assignment pages. Good catch.

ConradSelig commented 5 years ago

I got the color worked out, but we should watch out for other places in the program where drop-down select menus no longer have the required color but should have the required color.

BryanHurst commented 5 years ago

@ConradSelig the items in the select-box.css aren't exactly safe to modify. Since they are automatically applied by the react framework and never referenced by our code, making changes in that file has wide spread changes.

If you need to modify the color of specific inputs, create a new CSS class in our adsm.css and apply it to the input fields.

missyschoenbaum commented 5 years ago

OK< I may not have gotten every possibility, but this seems to be working.