BiologicalRecordsCentre / plantportal

Focused repo for the Plant Portal website
0 stars 0 forks source link

Occurrences should have a selected or entered abundance value #109

Closed sacrevert closed 2 months ago

sacrevert commented 4 months ago

Regardless of abundance scheme, all entered occurrences should have a selected or entered abundance value

andrewvanbreda commented 2 months ago

Hi @sacrevert This is live now, so Standard Mode now also shows abundance warning.

Due to the need to support several abundance types, the Standard Mode abundances cannot be made mandatory at the Warehouse end (otherwise you would never be able to submit, as the Warehouse would always complain that not all the abundance types have been used) So in this case I have added a custom warning using code on submit. The wording is this "Please make sure every species you have entered has an abundance value before saving" This can be changed if you wish. Note because it is non-standard code, there are no red stars used, and the rows with a problem are not highlighted, but it should be obvious to the user.

Just another thought. One thing I had to be careful of is that when the abundance type is changed, we clear any existing entered abundance, otherwise the hidden data could be submitted. This works.

However we also have a similar situation with the optional canopy grid. This is different however. The checkbox that shows this grid currently works like a show the grid checkbox, however the data is still there in the background. Selecting, and unselecting, and reselecting the canopy checkbox does not clear the data. So it is mearly a show box. The data is submitted even if not shown. I think this would be very difficult to change, because I cannot easily recreate the occurrence grid very easily if it is hidden and reshown, as all the code that generated it in the first place is PHP code which needs a page reload.....certainly not easy in current budgets anyway. Should we put an instruction on the page to make it clear this is the behaviour?

One last point, as the abundances weren't mandatory before, I have checked the database and the following 4 occurrences have not had an abundance entered

36415473 37118262 37118637 36280796

sacrevert commented 2 months ago

Should we put an instruction on the page to make it clear this is the behaviour?

Yes, a brief message above the canopy grid would be useful.

the following 4 occurrences have not had an abundance entered

Thanks, as far as I can see those are all training data

andrewvanbreda commented 2 months ago

@sacrevert Done. Also note that as discussedm, occurrence images have also been switched on