Skip to content
This repository has been archived by the owner on Mar 11, 2021. It is now read-only.

Pre omniauth migrations and test fixes #445

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

esthervillars
Copy link
Contributor

@esthervillars esthervillars commented Feb 15, 2017

Migrations for documentcloud platform and Collaboration Project relationship

This will enable smoother transition when migration to the accounts service (circlet). Migrations include:

  • organization_project relationship

  • adding membership_id to collaborations (db backend only, fe disabled)

  • adding omniauth columns to account in preparation for dc_omniauth

  • Also test fixes and removes unused test for previous omniauth implementation that is not used.

  • Add collaboration serializer using AR serializers

e.g. CollaborationSerializer.new(Collaboration.first).to_json or .as_json

{:id=>1, 
:account_id=>2,
 :creator_id=>2, 
:membership_id=>nil, 
:hidden=>false, :project_id=>1, 
:title=>"DC_project1", 
:account_full_name=>"SiteAdmin SiteAdmin", 
:annotation_count=>0, 
:document_count=>0, 
:public_url=>"http://dev.dcloud.org/public/search/projectid:1-DC-project1", 
:collaborators=>[
     {"id"=>3, "slug"=>"3-administrator-vagrant", "email"=>"[email protected]","first_name"=>"Administrator", "last_name"=>"Vagrant", "language"=>"eng", "document_language"=>"eng", "hashed_email"=>"1617b7e531ef5cc58ed183e06954f361", "pending"=>false, "organization_id"=>1, "role"=>1, "organization_name"=>"DocumentCloud", 
        "organizations"=>[{"name"=>"DocumentCloud", "slug"=>"documentcloud", "language"=>"eng", "document_language"=>"eng", "demo"=>false, "id"=>1}
    ]}
]} 

```

@knowtheory
Copy link
Member

Okay! To get things together for Justin's UX changes... i wanted to run down a few things here.

We discussed adding a membership_id to Collaboration. That way, a Collaboration could be set up provisionally, and a user can refuse/hide a proposed Collaboration (rather than the current situation where anyone can just make stuff show up in someone else's sidebar if they know their email address).

The possible states for a Collaboration then are basically:

  • Created but provisional (account_id is set, but not membership_id).
  • Accepted (recipient accepts the project and the membership_id is set).
  • Hidden (recipient declines to accept, and instead just hides the project).

I'll make these changes to the models and we can roll forward unless anyone has any other thoughts/objections.

@reefdog
Copy link
Contributor

reefdog commented Feb 15, 2017

@knowtheory That sounds right. Where will we store/read hidden state?

@knowtheory
Copy link
Member

So these migrations include a hidden boolean on projects. So there's now a hidden field and also a membership_id field, which should be everything we need.

@knowtheory
Copy link
Member

Oops, sorry i meant on Collaborations not on Projects

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants