Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds contributors for plans #2402

Closed
wants to merge 1 commit into from
Closed

Adds contributors for plans #2402

wants to merge 1 commit into from

Conversation

briri
Copy link
Contributor

@briri briri commented Feb 20, 2020

Addresses #2349.

These changes are dependent on the ROR/Fundref PR's new identifiers table

Changes proposed in this PR:

  • Adds a contributors table (with f_key to orgs)
  • Adds a plans_contributors join table that sets a bitflag roles field based on the CRediT Taxonomy (thanks for alerting us to that @xsrust)
  • Adds the 3 new ethical_issues fields to the plans table
  • Added factories/tests for the new models
  • Rake upgrade task to convert all data_contact ('Data curation' role) and principal_investigator ('Investigation' role) information on a plan over to contributors and adds a 'Writing - original draft' role to all of the plan's authors.

Changes to model/UI forthcoming. Need to update the code that creates a plan or shares a plan to add these contributors.

@@ -420,7 +427,7 @@ def owner
.administrator
.order(:created_at)
.pluck(:user_id).first
User.find(usr_id)
usr_id.present? ? User.find(usr_id) : nil
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this was an edge case error that came up with some test records (a plan with no owner)

@raycarrick-ed
Copy link
Contributor

Looks good to me as far as I can tell.
My one (very minor) comment is that we use "firstname" in users but "given_name" here.
Not a big deal but a mild incnsistency.
Not merging so Sam and Marta can take a look.

@briri
Copy link
Contributor Author

briri commented Feb 21, 2020

yes, good point @raycarrick-ed I'll change it to firstname

@briri briri force-pushed the contributors branch 2 times, most recently from ec6e3fb to 639aa4a Compare February 24, 2020 16:38
@briri
Copy link
Contributor Author

briri commented Feb 24, 2020

rebased with workflow fixes

* bumped rack and tinymce

* updated tinymce

added identifiers polymorphic table

finished cleanup of old identifiers

fixed bug

fixed bug and some rubocop issues

added managed lflag to Org

updated code to work with new managed flag

fixed issue with scope

Added lib task for orgs.managed

added a rake db:migrate step to github workflow tests

fixed rubocop issues

removed db:migrate from workflows

fixed bug in upgrade task

removed bad index from schema and replaced with good one

fixed broken tests

initial ROR service and abstract Base service with config and tests

updated tests

rubocop fixes

added webmock exception for chromedriver

Part 1 - maDMP ROR/Fundref - Identifier consolidation (#2361)

* added identifiers polymorphic table

* finished cleanup of old identifiers

* fixed bug

* fixed bug and some rubocop issues

parent b6af5de
author briri <[email protected]> 1579797878 -0800
committer briri <[email protected]> 1580422823 -0800

added identifiers polymorphic table

finished cleanup of old identifiers

fixed bug

fixed bug and some rubocop issues

added managed lflag to Org

updated code to work with new managed flag

fixed issue with scope

Added lib task for orgs.managed

added a rake db:migrate step to github workflow tests

fixed rubocop issues

removed db:migrate from workflows

fixed bug in upgrade task

removed bad index from schema and replaced with good one

fixed broken tests

initial ROR service and abstract Base service with config and tests

updated tests

rubocop fixes

added webmock exception for chromedriver

initial org selection service

pulled in a bunch of changes from other branch

added tests

added controller to rails_helper

fixed typos in upgrade rake

fixed some issues with models and specs

work on org selector

further work on new selection boxes

cleaned up org selection service and added to profile and create plan pages

got all org selectors switched over to new autocomplete

Added contextual flags to identifier_schemes and fixed tests for org model

update scopes on identiifer_scheme for contextual access

cleaned up schema

ran annotate

cleaned up annotations

cleaned up annotationss

added some tests and cleaned up presenters

added tests for hash_to_org_service

finished up refactor of org selection

fixed failing tests

fixed some rubocop issues in new objects

added funder_id and org_id to the plans table

added funder and org associatyions to Plan

updated create plan and project details to use funder

finished up issues with ROR/Fundref

finished ror work

fixed issues

more spec issues

fixed trypo in commented out test

Removed debug statements

fixed tests and added orgselectable to invitiations

updated rake task to use new services

fixed up remaining issues with JS and org selectors

fixed weird bug when filtered_shib_discovery_service is enabled

fixed weird bug when filtered_shib_discovery_service is enabled

fixed some issues saving shib entityId

fixed another shib entityID issue

final fix for shib entityID

Added contributors model and ethical_issues fields

updated upgrade rake task

Added org_id to contributors

fixed bug with identifier lookup

updated tests with org_id for contributors

changed given_name to firstname

added wkhtmltopdf package and updated postgres image to latest

debug statement to test github workflow issue

debug statement to test github workflow issue

debug statement to test github workflow issue

debug statement to test github workflow issue

debug statement to test github workflow issue

debug statement to test github workflow issue

debug statement to test github workflow issue

debug statement to test github workflow issue

debug statement to test github workflow issue

cleanup

trying to fix wkhtmltopdf

trying to fix wkhtmltopdf

trying to fix wkhtmltopdf

trying to fix wkhtmltopdf

trying to fix wkhtmltopdf

added wkhtmltopdf fix to mysql workflow

added 'unique' to usage helper test

fixed tests broken by changing given_name to firstname on contributors
@xsrust
Copy link
Contributor

xsrust commented Mar 2, 2020

Looks like everything is now passing the tests.

I have a question about the implimentation, It makes sense to me that a Plan has_many contributors, but it's unclear to me why a contributor would have_many plans. It seems like this would allow anybody who's editing a contributor to update all references to that contributor, which I believe would be unintended.

@briri
Copy link
Contributor Author

briri commented Mar 3, 2020

Hmm. The original intention with using the plans_contributors join table was to keep the size of the contributors table down. I see your point though on a belongs_to relation being a better fit. I have switched it over in the api-v1 branch so closing this one out

@briri briri closed this Mar 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants