BiologicalRecordsCentre / SPRING

Repository for tracking issues for the SPRING (EU Pollinator Monitoring) project
GNU General Public License v3.0
0 stars 0 forks source link

SPRING - add transect setup page #35

Closed DavidRoy closed 2 years ago

DavidRoy commented 2 years ago

based on: https://butterfly-monitoring.net/ebms-site-details

But a sub-site under the main SPRING MVS sites

andrewvanbreda commented 2 years ago

Hi @DavidRoy @JimBacon @BirenRathod

I setup a prototype version of the page here after setting up all the attributes on the site. https://test-eu-pollinator.pantheonsite.io/ebms-site-details

There appears to be errors on the page (but am not overly surprised about that as not attempted any fixes).

I have 2 questions about EBMS and porting the forms to SPRING

  1. Is it running any node.x.js files or files that wouldn't have been in main Indicia repository?

  2. I see quite a lot of configuration on the edit tab includes hard coded paths to things like http://tile1.geoportail.lu/ WMS Layer stuff. This is not really an area I have much in way of experience with. What needs to be done to get this running for SPRING anyone know?

andrewvanbreda commented 2 years ago

Noting that I don't have it on my Pantheon Dashboard so can't check the js files etc

BirenRathod commented 2 years ago

@andrewvanbreda you can find out thorough IMCE file browser module installed on ebms site. I just checked and there are five of them.

andrewvanbreda commented 2 years ago

@BirenRathod Ok thanks. I assume you mean the .js files. Think I will probably need those unless they are for other pages. Is it possible to zip and send them to my email cheers.

BirenRathod commented 2 years ago

@andrewvanbreda yes that is right and three of node.x.css files too.

andrewvanbreda commented 2 years ago

@BirenRathod OK thanks. If you zip anything like that up I will take a look to see if needed.

BirenRathod commented 2 years ago

@andrewvanbreda I sent you an email with zip file.

andrewvanbreda commented 2 years ago

@BirenRathod Brilliant, thanks that arrived, really useful.

DavidRoy commented 2 years ago

The extra map layers for Luxembourg are not essential for SPRING, but happy to have them there if straightforward

andrewvanbreda commented 2 years ago

Hi @BirenRathod This page is complaining about api keys. The Place Search and also complaining the Google Hybrid layer is in development mode. Would you be able to setup the appropriate keys please. Cheers https://test-eu-pollinator.pantheonsite.io/ebms-site-details

BirenRathod commented 2 years ago

@andrewvanbreda I have now added google api key and hybrid layer works now.

andrewvanbreda commented 2 years ago

@BirenRathod Thanks that is working great :)

andrewvanbreda commented 2 years ago

Hi @DavidRoy Which transect locations need to go in the select list on the data entry page? It looks to me on the EBMS site, the list is a combination of the location type Transect and Transect Section. Are those the same ones you want to use on SPRING? If so, I think I will need to get Biren to apply SQL to the database as there are lots of them and are all currently assigned to the EBMS website only.

DavidRoy commented 2 years ago

@andrewvanbreda no pre-population of transects from EBMS. There will be new ones created for SPRING. These will be setup linked to the MVS sites

andrewvanbreda commented 2 years ago

@DavidRoy Hi again. OK I understand. So MVS Sites will be the parents of the Transects.

Does EBMS have this parent/child structure too? (I assume not as I don't think I have seen that.)

If it isn't the same, SPRING may need extra code to allow for the MVS Site to be selected first when adding a new transect. But also the data entry page might need enhancement so that the the MVS site is selected as a filter before the transect is selected?

Also on SPRING will there be the concept of both Transect locations AND Trans Sections as well?

My other thought is that perhaps the Transection location type(s) should be a completely new location type for SPRING then.

Apologies for all the questions

DavidRoy commented 2 years ago

@andrewvanbreda. Good questions! You are right. SPRING will need a parent/child/child structure of MVS site/transect/transect section SPRING does need TransectSection as a location type. The design is for a single transect for each MVS site and each transect has a fixed number of TransectSection = 10

andrewvanbreda commented 2 years ago

@DavidRoy OK thanks for letting me know. I cannot comment any further at this moment. Obviously makes the deploy trickier as might need new prebuilt forms inheriting from the EBMS forms, (unless I add just an option to the existing forms with default parent off). Hard to say the implications of this right this second as I am new to the forms.

I suppose my one comment right now would be to ask is the structure of the data much different in any other way?. Might be useful to have a quick chat about this. I should be able to do anytime from 4 today, or all of tomorrow.

andrewvanbreda commented 2 years ago

@DavidRoy Just to let you know I created new prebuilt forms today that are on the site for the Data Entry and Transect Setup page (even though for now they look visually the same, it is now easy for me to remove things like the country functionality) I decided to use the existing Transect and Transect Section location types in the end. I think this is the more correct approach (in the same way as we would created a new City or Country location type for a specific project). The EBMS website filters will exclude the data from that site, we can double check that anyway.

andrewvanbreda commented 2 years ago

Hi @DavidRoy Am trying to convert the EBMS forms for SPRING. I think the main area of confusion for me is the Allocate Users to Site functionality. I am not sure how you want this to work on SPRING (actually I am not 100% sure what it does on EBMS either, as hard to examine all the code).

If I were to guess, I would think the following, can you confirm. On SPRING the user will add their own transects, then I assume these are what they are allowed use during data entry. So I assume we want to auto-allocate the site to that user as soon as they create the transect. Then do we allow admins to re-allocated the transect if needed?

Do you want the data entry to only show users the transects users are allocated to?

This seems to me to be the most obvious conclusion......however am a bit confused, as actually EBMS's "Select Transect" drop-down doesn't seem to work like that (at least doesn't appear to from code examination, so I could be wrong).

Can you confirm your intention for the allocate users to sites functionality for SPRING?

DavidRoy commented 2 years ago

@andrewvanbreda the main answer is that we have not decided how this will work for SPRING. It is ok at the moment to remove the assignment element and make the transect route available to all registered users. We can revisit the approach at the end of the 2022 recording season

The reason that eBMS has this assignment is to avoid multiple versions of the transect being setup when more than one volunteer walks the transects. This is less likely in SPRING

andrewvanbreda commented 2 years ago

Hi @BirenRathod Would you be able to pull these two reports onto live for me please. We are pushed for time for getting this site live, so if you are able to do this as soon as you are able to it would be much appreciated. Cheers. reports/projects/PoMS/get_default_country_for_transect.xml reports/projects/PoMS/get_squares_for_country_id.xml

BirenRathod commented 2 years ago

@andrewvanbreda I just pull this repo but these reports have not been updated. can you check your commit please?

andrewvanbreda commented 2 years ago

Hi @BirenRathod Oh. I can see them here on GitHub https://github.com/BiologicalRecordsCentre/indicia-reports/tree/master/reports/projects/PoMS

BirenRathod commented 2 years ago

@andrewvanbreda Sorry my mistake, it was not pulling due to other reports was created. I have resolved it that and reports are now in the folder.

andrewvanbreda commented 2 years ago

@BirenRathod No problem. Thanks Biren

andrewvanbreda commented 2 years ago

Hi @DavidRoy This is also an area when enough progress as been made for it to be worthwhile having another nose around if you want, although (again) theming problems are causing issues with popup boxes being obstructed

DavidRoy commented 2 years ago

@andrewvanbreda this is coming together. A few comments: Site details tab

  1. Once the country and 1km site is chosen, the map should zoom to that location
  2. Reword drop-down list label from '1km square for the transect:' to 'Site for the transect:'
  3. Change label 'Site name' to 'Transect name'
  4. Remove the drop-down list of setting the projection?
  5. Number of sections should default to 10 and be hidden (or greyed out - similar to the length field?)
  6. Site code field should be hidden/greyed-out and be auto-created as a concatenation of 'Site name - Transect name'
  7. For now, remove the other drop-downs for habitat/ownership etc
  8. What is the field above the map labelled 'LANG_Georef_Label:'. Either needs some help text or be removed

'Your route' tab Maps should default to Google hybrid to show the satellite layer

andrewvanbreda commented 2 years ago

@DavidRoy All done apart from the zoom which will be more work, so will let you know when that is done.

andrewvanbreda commented 2 years ago

@DavidRoy Zoom done. As squares are just a point, you may need to give me your opinion on how far we zoom in.

andrewvanbreda commented 2 years ago

@DavidRoy I just noticed zoom does not occur in edit mode loading up an existing transect. Please ignore that for now, I will fix it (from a coding point of view it is essentially a separate problem).

DavidRoy commented 2 years ago

@andrewvanbreda Thanks. I suggest a zoom level of 3

I've also realised that Transect Width can also be hidden

DavidRoy commented 2 years ago

The route tab is not working? It is not possible to select the section numbers to add the lines section-by-section

andrewvanbreda commented 2 years ago

Hi @DavidRoy I think it is just a visual thing, the section numbers do react if you click on them and can be tested if you want. But yes the buttons do need to be placed there, I will put into the theme issue.

DavidRoy commented 2 years ago

@andrewvanbreda the section selection does work, thanks for confirming. I'm still struggling to setup transects though. I complete the section routes and required information but then get an error on saving. I'm using Edge at browser. eupoms1

andrewvanbreda commented 2 years ago

@DavidRoy Noted, will investigate further

andrewvanbreda commented 2 years ago

Width removed

andrewvanbreda commented 2 years ago

Hi @DavidRoy Although I am not super-familiar with the functionality, I have had a play around and can save routes etc on my Mac. I don't have the Edge browser though. Is it doing the same on another browser on your machine? That message in the screenshot looks a bit odd, almost like one that is shown by the browser not by own code (searching confirms the lack of that message in our code). I think by "site" it means website. Does that message appear on "Save Route"?

DavidRoy commented 2 years ago

I'll try on another browser. The message only appears when clicking on the 'Finish' button on the save route tab

andrewvanbreda commented 2 years ago

@DavidRoy Ok, I did get it just now, but it is only doing it sometimes. If you click to Leave, does it actually affect functionality, or is it behaving normally? (ignoring the message) I wonder if not detecting it has saved properly and thinks you are leaving without saving

DavidRoy commented 2 years ago

Leaving does affect functionality as the Transect site does not save (i.e. not listed under https://test-eu-pollinator.pantheonsite.io/transects-list)

andrewvanbreda commented 2 years ago

@DavidRoy OK, I will have a look. I thought it was saving for me, but having said that I was only getting the message sometimes, so probably does save when that message doesn't display. I will let you know.

DavidRoy commented 2 years ago

@andrewvanbreda I confirm the same issue occurs on Chrome

andrewvanbreda commented 2 years ago

Hi @DavidRoy Just to break the silence on this. Having look at this whole situation on my machine in quite a lot of detail. I hope actually there isn't anything that will be very difficult to fix out of the current know issues.

I have 2 questions

  1. You requested the number of sections to be set to 10 and greyed out/hidden. Do you want the Add/Remove sections options to be available? as they obviously alter the number of sections.
  2. EBMS seems to have a lot of logic in it that is a bit difficult to get my head around regarding who can do particular edits, when they can do them, permissions. One example is prevention of alterations when walks exist. Can you provide some guidance on the access logic that should apply to SPRING Thanks
andrewvanbreda commented 2 years ago

@DavidRoy I have deployed a fix that improves the functional stability of this page greatly. So section removals etc will now work. Note the confirmation messages shown to the users are not correct at the moment, so ignore those, and if you get an unexpected confirmation just choose to continue (although I note that EBMS does ask the user if they want to save changes even if there are none....but SPRING is behaving more erratically with confirmations than EBMS currently) The problem occurred due to a bug in the changes that were needed to EBMS' user permission system (So the user was shown certain functions that the system underneath did not think they had access to). Note there appears to be a problem with the system's theme where the main menu is not showing at the moment, I have made Biren away of this. So you need to go to the direct URL here https://test-eu-pollinator.pantheonsite.io/transect-setup?id=290122

BirenRathod commented 2 years ago

@andrewvanbreda See my comments about the main menu here

andrewvanbreda commented 2 years ago

Yes the menu now fixed.

DavidRoy commented 2 years ago

thanks @andrewvanbreda. I managed to save a route now thanks. In answer to your questions:

Note that the map does not automatically zoom into level 3 for the Details or Route tab

andrewvanbreda commented 2 years ago

@DavidRoy Yes the zoom issue is noted elsewhere.

https://github.com/BiologicalRecordsCentre/SPRING/issues/49

The code is actually implemented to zoom to 3, and works on my machine, it just doesn't on test at the moment, and I haven't had chance to properly look why.

Will implement those points. Think I have worked out the cause of the confirmation problems. It is because SPRING is doing some automatic things in the background (such as setting the square drop-down) then system is mistakenly thinking the user has altered the page.

andrewvanbreda commented 2 years ago

Some improvements to confirmation boxes deployed, and also removal of the Add/Remove Section buttons.

DavidRoy commented 2 years ago

@andrewvanbreda a few minor things for this page:

  1. can you add some help text for the 'Site Code' text box of "Please add site code if you have another reference code for your transect. Otherwise, leave blank."
  2. on the 'Your route' tab, can you edit the help text at the top to the following: "Select a section from the list then click on the map to draw the route and double click to finish. Then click on save route to save this section. You can also select a section using the "Query" tool to click on the section lines. If you make a mistake in the middle of drawing a route, then you can use the "Erase Route" button to remove the last point drawn. After a route has been completed use the "Modify feature" tool to correct the line shape (either by dragging one of the circles along the line to form the correct shape, or by placing the mouse over a circle and pressing the "Delete" button on your keyboard to remove that point). Alternatively you could just redraw the line - this new line will then replace the old one completely. If you are not in the middle of drawing a line, the "Erase Route" button will erase the whole route for the currently selected section.

Once all route sections are drawn and saved, select the "Section Details" tab (or use the "Complete section details" button) to review the route setup (e.g. check auto-calculated section lengths). Return to the 'Your Route' tab to click on the Finish button. If you get a 'Leave site' pop-up warning this can be ignored (click on Leave)."

Note: I still get the 'Leave site' pop-up so have added some text to explain this.