BiologicalRecordsCentre / UKBMS-online

Issue tracking for UKBMS online recording site
2 stars 0 forks source link

Holiday Square tick box on WCBS Site Details #172

Closed MeganLowe closed 3 years ago

MeganLowe commented 3 years ago

I really like the new function that allows you to tick whether a square is a holiday square on the site details page, but please can we make this only visible to site administrators i.e. normal users and branch managers cannot assign a square as a holiday square.

Thanks very much, Megan

Gary-van-Breda commented 3 years ago

Code changed to allow attribute inclusion depending on a permission, and form config changed so that the Holiday Square checkbox (attribute 212) is included for "region coordinator" permission only, i.e. site admins. Deployed to Test.

MeganLowe commented 3 years ago

Hi @Gary-van-Breda I can't see the holiday square checkbox on the Site Details pages now - not sure if that is because of the type of account I have or whether it is not visible to any user now? It would be great if I were able to check or uncheck this holiday square box as it means I can add extra holiday squares to the map when required, and also remove holiday squares when a recorder decides to take on a square indefinitely. Thanks

Gary-van-Breda commented 3 years ago

@MeganLowe - Sorry about that: the issue was with the permission name in the form configuration. Now sorted, so you should be able to see the checkbox when editing the Site Details.

MeganLowe commented 3 years ago

Thank you @Gary-van-Breda I can see and use the holiday square tick box now. I'm not sure if it's working that well though - I tested adding a holiday square and then removing it, but it has remained on the map. Is this an issue or is there a delay to updating? Also on the Site Details pages of the existing holiday squares the box remains unticked. I expected these to be ticked so then I can untick to remove them from the list? Hope that all makes sense.

Gary-van-Breda commented 3 years ago

@MeganLowe : I've deployed a fix to the holiday squares form for squares that used to be Holiday squares but are no longer. To see changes to the status of sites re the Holiday square checkbox, you will have to reload the page, rather than just press the "List closest sites" button on the page. (Tested using NO3006, which I've reset to a holiday square) I haven't been able to replicate the issue you seem to be having with the display of the checkbox value in the Sites Detail page. Can you give me an example square where this is happening?

MeganLowe commented 3 years ago

Hi @Gary-van-Breda I think it's the squares that I have added as holiday squares when testing that are having this issue. SU4724 is an example. It has remained on the holiday squares map, even though I have unticked the checkbox (and saved) on it's Site Details page. There are now 5 squares (all in Southern England) that I've tried adding and removing using the checkbox. Ticking the checkbox works perfectly, the problem I am having is in the removal. It seems the tickbox unticks, but the square is not removed from the map?

Gary-van-Breda commented 3 years ago

I've just tried this with SU4724, and it worked OK with me. These are the steps I followed:

The list of sites is cached by the Holiday squares page when it is opened/refreshed.

@MeganLowe : what steps are you following which makes you think it is not working properly? (and which browser are you using?)

MeganLowe commented 3 years ago

@Gary-van-Breda that's strange. SU4724 is still on the holiday squares map for me. I've tried refreshing, tried going to an entirely different page and then coming back, it's still there. Another example is TQ4773 - when testing yesterday I followed the exact same steps as you have detailed above for this square, but it is still on the holiday squares page today even though I tried to remove it yesterday. I'm using Microsoft Edge Version 88.0.705.50 (Official build) (64-bit)

Gary-van-Breda commented 3 years ago

@MeganLowe : OK, I definitely do not have TQ4773 on mine. Can you copy in the URL of the page you are looking at (just to make sure)? Is there anything being displayed as an error in the Console? (Press F12 in the browser, and select the Console tab)

MeganLowe commented 3 years ago

URL: https://test-ukbms8.pantheonsite.io/holiday-squares

Here's a screenshot of what I see on the Console tab:

Capture

Gary-van-Breda commented 3 years ago

@MeganLowe : can you clear your browser cache, in particular the "Cached images and files", and then try again? I think you may have the old version of the form javascript cached, so you haven't picked up yesterday's fix.

MeganLowe commented 3 years ago

@Gary-van-Breda that was it! Works fine now. Sorry about that, and thanks for all your help!

MeganLowe commented 3 years ago

Hello @Gary-van-Breda @DavidRoy, I've just found another holiday square tickbox under the section details tab on the Site Details pages. Here's an example of where I mean: https://ukbms.org/site-details?id=125015 The checkbox seems to be on every section (S1 - S10) and is tickable by all users. Please can we remove it from this location completely? Or if not possible to remove completely, just make it visible to admin users only? Thank you, Megan.

Gary-van-Breda commented 3 years ago

@MeganLowe : I can't see it - can you attach a screen shot?

MeganLowe commented 3 years ago

Hi @Gary-van-Breda, that's odd, I can't see it now either! Will close the issue but keep an eye on it and let you know if it reappears. Thanks, Megan.