DMPRoadmap / roadmap

DCC/UC3 collaboration for a data management planning tool
MIT License
102 stars 109 forks source link

Add visibility to Template details page for Funders #845

Closed briri closed 6 years ago

briri commented 6 years ago

This issue was uncovered while working with migrated DMPTool data.

Some funders like the USGS have normal funder templates but they also have users who create DMPs and have templates for internal use. Right now the public facing 'DMP Templates' page displays any published funder template. We need a way for a funder's Org Admin to identify whether the template is for users applying for a grant with their organisation or if the template is for their internal users.

The templates table has a visibility (INT) column that is no longer in use after we converted the codebase over to publishable versions. We can use this column to identify these internal templates. By default we would set the value to 'zero' (organisational visibility). Funder Org Admin's could then change this value via a checkbox to 'one' (public visibility). (We should run a rake task that sets any existing funder templates to 'one' automatically).

The public facing 'DMP Templates' page should then be updated to only collect the funder templates whose visibility = 1. The create plan page would also need to be updated to consider this value in the ajax endpoint in the templates_controller that collects available templates for the research org and funder combo (research org templates visibility = 0 and funder templates visibility = 1. The Org Admin templates page would also need to be updated to check for visibility = 1 when generating the list of customizable templates for non-funder orgs.

sjDCC commented 6 years ago

So if I'm understanding the use case right @briri, the logic that we'd need to apply on the create plan page is that:

1) If user is affiliated with funder and selects funder from the organisation dropdown, present the internal funder template

2) If the user is affiliated with funder and selects funder from the organisation dropdown AND funder dropdown, present the internal funder template, not public one? Currently the logic does the opposite as funder templates take precedence over institutional ones so we'd need an exception here for when the org affiliation is a funder

3) If a user affiliated with a non-funder selects a funder in the org dropdown, present the funder guidance not internal funder template as these templates are just for internal funder use?

I assume this is related to ticket #665 to ensure funders display in the org dropdown

briri commented 6 years ago

Yes, it is indeed linked to the #665.

Right now, affiliation is irrelevant in the create plan page since we allow any user to select any research org+funder combination. If they happen to select a research org who has customized the selected funder template then they would get the customization

My assumption was: 1) If the user selects 'USGS' from the funder dropdown and any non-USGS research org (or tick the no research org box) then they would get the USGS funder template (along with any organisational templates available for the selected research org).

2) If the user selects 'USGS' from the research org dropdown and ticks the no-funder checkbox then they would get the USGS organisational template.

3) If the user selects 'USGS' from the research org dropdown AND the funder dropdown they would be asked to select from either the funder or organisational templates.

sjDCC commented 6 years ago

Invoking the template selector is a good idea so the user has to pick. So long as those internal funder templates don't need to remain private that should work. Otherwise I guess you can just give user guidance in case any researchers picks the wrong one by accident.

I don't think this will play much significance in the UK/European domain, but we do have a number of general researchers affiliated with a funder (researchers from Dutch unis applying to ZonMw as that was the most appropriate org listed when they signed up) which is what made me wonder what should happen if standard users select the funder from the org list. For these folk it would be the value defaulted to once we add funders to the org dropdown.

stephaniesimms commented 6 years ago

@briri's assumptions above are correct. we tested on DMPonline and existing logic/workflow should meet the need w/#665 . there's no need to keep USGS org templates private. the use case relates to the difference between intramural and extramural research at US federal agencies. a lot of researchers are employed directly by the agencies and have internal requirements for data mgmt (Org Templates) but don't need to apply for funding (Funder Template meant for external researchers).

sjDCC commented 6 years ago

Ok great, even better if no logic needs to be changed in the 'create plan' workflow.

You may want to share guidance with those funders that their internal users should just pick them from org dropdown and select 'no funder' as @briri outlines in option 2. If the user picked them in both dropdowns, they'd get the public template not the private one I think as the funder selection takes precedence over any organisational templates. Or perhaps the template selector would be presented automatically since both are actually funder templates?

If the latter is the case, it might be that you need to have some guidance for general users about the difference between intra- and extramural templates so they know which is the public template to choose.

stephaniesimms commented 6 years ago

If I select USGS as my Org and as the Funder I believe I get both the individual Org templates and public/funder template (intra and extramural). Template names will clarify which to select as intramural folks usually know what they're looking for (very specific programs like USGS Aquatic eDNA). Users who apply for extramural funding are most likely to use their own (non-USGS) affiliation and therefore won't see the intramural templates at all.

sjDCC commented 6 years ago

On reflection I suspect the template selector would be presented automatically if USGS is picked in either one or both of the two selectors. The intra- and extramural templates will both be classed as funder templates by the system as the owning org type is a funder. Best to just test it with real data though and see what happens.

briri commented 6 years ago

Added the logic to change the template's visibility setting if the template is from a funder.

screen shot 2017-12-04 at 3 15 04 pm

by default, a template is organisationally visible. The message displayed to the user when they view the template are (the 'once published' portion only shows if the template is unpublished:

screen shot 2017-12-04 at 3 13 50 pm

screen shot 2017-12-04 at 3 19 11 pm

stephaniesimms commented 6 years ago

@briri the logic seems good here, except for one tweak: the tickbox appears on the template editing page for any Org designation (I can see it for my UCOP templates). it should only appear for Funder/Orgs (e.g., USGS) and Org/Orgs (e.g., BCO-DMO).

briri commented 6 years ago

If we open this to allow regular Orgs like BCO-DMO to set the visibility does that also mean that we want Orgs public templates to appear in the 'funder' list on the create plan page as well as the public DMP Templates page?

stephaniesimms commented 6 years ago

if including Orgs like BCO-DMO gets messy then let's just stick w/funders. BCO-DMO has a public template but currently i switch the Org affiliation on the template from NSF when they need to edit it. or I do it for them. this is a super edge case so not necessary to include it here.

jollopre commented 6 years ago

@briri if org BCO-DMO is organisation type, a workaround would be to add it as funder type too, that's the reason the bit flags are in place for org type.

briri commented 6 years ago

Indeed worth trying @jollopre. I don't see any issues with doing that after a quick search of the code for 'org_type'. To my knowledge though we don't currently have any Orgs with multiple Org types in the system.

@stephaniesimms I don't see 'The Biological and Chemical Oceanography Data Management Office (BCO-DMO) ' in the DMPTool data anywhere. I'd like to try this approach out.

briri commented 6 years ago

ok @stephaniesimms Woods Hole is now an Organization and a funder on dmp2-stg. Give it a try and let me know if it works for you

stephaniesimms commented 6 years ago

@briri this works ok on the template side now. but I no longer see Org/Funders in the Org list when I try to create a plan (e.g. Woods Hole and USGS are missing). to be clear, i'm testing on dmp stage.

from an admin user perspective, the important thing to distinguish here is public templates from org/internal templates. so e.g. as an admin i would expect to find the internal USGS templates in my Org templates list. and the public/funder USGS template in the Funder templates list. a better name might, in fact, be "Public Templates"...TBD

sjDCC commented 6 years ago

I have tested this by adding a secondary template for the Medical Research Council and making that internal only. When I go to create a plan with this, the MRC is not visible in the 'organisation' list under create plan. This is the issues @stephaniesimms mentions above about USGS and Woods Hole. I think this dropdown was set to only display institutions and organisations so we need to change it to include funders now too.

When I create a plan with a uni affiliation (I picked Edge hill at random) and select MRC, I get a template dropdown to select the main public one or the internal-only template. I guess you only want to display this option for internal funder staff, not to all users. I expect the additional dropdown should only be invoked if a MRC-affiliated member of staff selects MRC from both dropdowns on create plan as it's ambiguous what they need. If they just pick MRC in the org dropdown (once it displays there) and 'no funder' they should automatically get the internal template rather than the public one. General end users / researchers need never really be aware that their funder has an internal template as they shouldn't be using it.

funder

The other issue I noticed is that the internal funder templates show up in the list of funder templates to be customised by orgs. See:

should-be-invisible

This makes no sense as they're internal-only, not public. Perhaps we should categorise the actual templates differently e.g.

This differentiation ties in with the terminology suggestion I make below.

@stephaniesimms I'd prefer to stick with the terminology of 'Funder templates' vs 'Org templates' if possible as I think that's clearer across the board. It seems a bit of an exception when funders have internal / private templates (or do you expect this to become more common place?) and in those cases the templates are more like organisational ones than funder ones as it's for people within their own institution (even though that institution is a funder).

stephaniesimms commented 6 years ago

@sjDCC - sounds good to stick w/terminology for Funder templates v Org templates. I don't anticipate this becoming more common and you're correct that the USGS internal templates are conceptually like Org templates.

after some more testing this is looking good to me. the appropriate templates appear in the appropriate lists now. #665 resolved the presentation of appropriate templates when creating a plan. i want to test a bit more as a USGS Org admin but that will have to wait until Mon. I'll leave this here for now.

stephaniesimms commented 6 years ago

after further testing on DMP stage w/USGS data I think everything is working as expected. I just question the need for the tickbox to designate a template for "internal use only" - this appears to be irrelevant since I get the appropriate list of templates regardless of whether I tick the box or not (screenshot below). The official "funder" USGS template is marked as such in the database and is the only one that appears for users with an affiliation other than USGS.

is there a reason to keep the tickbox @briri ? if not, i'd prefer to remove it.

screen shot 2018-01-08 at 1 19 58 pm

briri commented 6 years ago

@stephaniesimms if checked it prevents the template from appearing in the public DMP templates page Might be a good idea to note that somewhere on here

stephaniesimms commented 6 years ago

aha. in that case it serves a purpose and we should keep it indeed. thanks @briri . i propose adding a question mark popover next to "Visibility" with the following text:

"Checking this box prevents the template from appearing in the public list of templates."

stephaniesimms commented 6 years ago

popover looks good and template presentation behavior works as expected to create a new plan. closing issue.

sjDCC commented 6 years ago

This is good to close out and remove from board. I raised a related question today though #1042 as I think this should only apply to funder templates not institutional ones