BiologicalRecordsCentre / ABLE

Assessing ButterfLies in Europe project repository
2 stars 3 forks source link

Add extra download buttons in My Annual report page #525

Open CrisSevilleja opened 1 year ago

CrisSevilleja commented 1 year ago

In My Annual Reports page, https://butterfly-monitoring.net/annual-report normal users cannot download data by occurrences, and samples as I do, only the grid (wide table, instead of long tables to analyze data). missing download_annual report

Please, include the extra download buttons for all recorders in My Annual report like the image below image

@JimBacon @andrewvanbreda I don't know who can do this. Thanks in advance

andrewvanbreda commented 1 year ago

Hi @CrisSevilleja I think @DavidRoy would need to confirm to me he wanted changes in this area before I went ahead with anything. However I didn't try and look at the system, and couldn't find a user with the page behaving in the way you are describing (people to either seem to have more or fewer options). Do you have an example username that behaves in this way?

CrisSevilleja commented 1 year ago

Good that David has to confirm this new functionality. I checked several users, that are indeed regional coordinators, supervising several transects like (https://butterfly-monitoring.net/user/1392) or Fernando Jubete.

They want to download data in the normal format of long tables to analyse the data, at the moment only the grid tables.

andrewvanbreda commented 1 year ago

Hi @CrisSevilleja @DavidRoy I see the issues here

  1. Both these users seem to only have the "data recorder" role, so the system is not treating them with manager rights.
  2. Looking at the code, the system is designed so that only people with the "super manager" role have access to those downloads (the "regional coordinator" permission is only given to the "super manager" role). David: Do these particular users need to be made super managers? or does the the code need changing?
CrisSevilleja commented 1 year ago

thanks @andrewvanbreda I think this issue is related to issue #524 to allow users to download data from their assigned transects as well. Here I don't want supermanager rights to them, just to be able to download data in another format only.

DavidRoy commented 1 year ago

@andrewvanbreda the code needs changing. I agree with Cristina that we don't want to give the super manager role

andrewvanbreda commented 1 year ago

Hi @DavidRoy @CrisSevilleja I will examine the code and see what can be done .

andrewvanbreda commented 1 year ago

Hi @DavidRoy @CrisSevilleja

I have just taken another look at this. I understand this situation better now (I didn't original write the code for this page, so it needs an examination to understand).

This page is a standard Indicia page (so not written specifically for EBMS). It therefore relies on our general Indicia system security which is shared by different projects, this would make it hard to specifically change for EBMS as I would have to create a new version of the page. However looking at this again, I believe the page is operating correctly. If we use Saba's account as an example. He has the standard "data recorder" role, so this means he wouldn't have the permissions required to download the data in detail for other users. You can see in the screenshot the "Combine data for all recorders" option is selected, so the system will limit his download to summaries only. If he selects the "My Data" option, he will notice that the tabs and options displayed to him are also limited, but this is for a different reason, it is because he hasn't added any 2023 data yet. So if he then changes the year to be 2022 he will see the full range of downloads becomes available for his own data.

CrisSevilleja commented 1 year ago

Hi @andrewvanbreda thanks for having another look.

I think we have to agree on the roles and permissions before going further. At the moment, a "data recorder" role doesn't have the permissions required to download the data in detail for other users and that is why I created this issue and issue #524 to allow users to download assigned transects.

The coordinator is the one assigning the transects to several users, therefore there is a control on who can enter data for that transects, can see the data entered by him and other users however it cannot download data from other users. I want to change this last assumption to a user can see and enter data for other and download it because, at the moment, it is annoying not able to download that data.

I understand @DavidRoy has to agree on this before going further and provide permission to allow normal data recorders to download data from assigned transects, not giving supermanager rights. There is control by the coordinators and supermanager on who has assigned transects

andrewvanbreda commented 1 year ago

Hi @CrisSevilleja

I have just had a quick look at the page again.

If we look at the page is set there are essentially 3 modes the page runs in.

Normal User

Branch Coordinator

Manager

So normal users can only see their own data. I am not quite sure what extra capabilities a Branch Manager has, those capabilities don't seem to extend to seeing the whole dataset. A Manager can see a whole data set.

Currently the page is setup as follows The Branch Coordinator functions are currently set to be for scheme coordinators. The Manager mode is currently assigned to Super Managers.

Although it would technically possible to set a data recorders to be the manager for the screen, it would be problematic as I think it would probably give access to things like email addresses which we don't want data recorders to have.

If David wants this to go ahead, I think what we need is a new EMS specific version of the screen with a new mode(s) which isn't fully management but can't see larger datasets.

DavidRoy commented 1 year ago

@andrewvanbreda I think we either need:

andrewvanbreda commented 1 year ago

Hi @DavidRoy

Option 2 looks same as this issue but for a different report page https://github.com/BiologicalRecordsCentre/ABLE/issues/524

So I think that requirement needs unifying across the system, so probably best go with option 2, then reassess.

Gary-van-Breda commented 1 year ago

@andrewvanbreda : be aware that with the changes we'll be doing under #255, the Annual summary page will change so that there is not a fixed number of downloads: the form config will allow any number each with an optional associated permission.

CrisSevilleja commented 1 year ago

Regional role #255 will solve part of this issue, due to there are regional coordinators in some countries controlling several transects and that functionality will allow them to download data from those transects.

I would like to go for option 2 if possible, I didn't see this option as complicated when I proposed it sorry about that. I thought the downloads can be related to the assigned transects and not only to the data submitted by the users as they can see data from other people if they have those transects assigned.

andrewvanbreda commented 1 year ago

Hi @BirenRathod Whenever you can a sec during the week, could you pull this reports please. Cheers reports/projects/ebms/ebms_occurrence_download_2.xml reports/projects/ebms/ebms_sample_download_2.xml

BirenRathod commented 1 year ago

@andrewvanbreda These reports have gone live now.

andrewvanbreda commented 1 year ago

@BirenRathod That is great, thanks Biren :)

andrewvanbreda commented 1 year ago

Hi @BirenRathod Would you be able to pull those reports again whenever you get a chance please, as I have made some changes. Thanks. Andy

BirenRathod commented 1 year ago

@andrewvanbreda Those reports gone live now.

andrewvanbreda commented 1 year ago

Hi @BirenRathod Further bug fix, if you could pull them again that would be great please. Thanks Andy

BirenRathod commented 1 year ago

@andrewvanbreda I have pulled it again.

andrewvanbreda commented 11 months ago

@CrisSevilleja @DavidRoy I have implemented this on this test site for further checking. https://avb-git-525-brc-ebms.pantheonsite.io/

I have tried to tried to test by masquerading but would be interested in your opinions.

The Samples and Occurrences options found on the Download tab for the Annual Report now include data from other people's samples providing you are assigned to that sample's transect.

Note: I have had to change the way the system works so the Download tab is always shown. It used to be that it was only shown if their was data available, now it is displayed all the time, but will return nothing in the download if no data is available.