Skip to content
This repository has been archived by the owner on Jun 27, 2020. It is now read-only.

Rw user sees list of orgs #76

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/graphql/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ type User {
email: String!
firstName: String!
githubUser: GithubUser
githubUsername: String!
githubUsername: String
id: Int!
lastName: String!
org: Organization
Expand Down
2 changes: 1 addition & 1 deletion app/graphql/types/user_type.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class UserType < Types::BaseObject
field :first_name, String, null: false
field :last_name, String, null: false
field :email, String, null: false
field :github_username, String, null: false
field :github_username, String, null: true
field :created_at, String, null: false
field :updated_at, String, null: false
field :access_token, Boolean, null: true
Expand Down
2 changes: 1 addition & 1 deletion app/javascript/components/Profile.js
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ export default class Profile extends Component {
<div className="flex-col w-1/2 mt-10 p-5 bg-gray m-auto bg-grey-lightest border border-grey rounded">
<UpdateAccessToken accessToken={data.me.accessToken} />
<UpdateGithubUsername githubUsername={data.me.githubUsername} />
<UpdateGithubOrg orgs={MOCK_ORGS} />
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you pls remove the MOCK_ORGS const, también

<UpdateGithubOrg orgs={data.organizations} />
</div>
);
}}
Expand Down
5 changes: 5 additions & 0 deletions app/javascript/queries/user_queries.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ const LOAD_USER_PROFILE = gql`
htmlUrl
}
}
organizations {
id
name
url
}
}
`;

Expand Down
28 changes: 15 additions & 13 deletions db/seeds.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,12 @@
url: 'https://github.com/department-of-veterans-affairs'
},
{
name: 'etsy',
url: 'https://github.com/etsy'
name: 'adhocteam',
url: 'https://github.com/adhocteam'
},
{
name: 'oddballio',
url: 'https://github.com/oddballio'
}
]

Expand All @@ -28,7 +32,7 @@
end

dova = Organization.find_by(name: 'department-of-veterans-affairs')
etsy = Organization.find_by(name: 'etsy')
oddball = Organization.find_by(name: 'oddballio')


################# Repositories ##################
Expand All @@ -40,9 +44,14 @@
organization_id: dova.id
},
{
name: 'statsd',
url: 'https://github.com/etsy/statsd',
organization_id: etsy.id
name: 'vets-website',
url: 'https://github.com/department-of-veterans-affairs/vets-website',
organization_id: dova.id
},
{
name: 'magnifier',
url: 'https://github.com/oddballio/magnifier',
organization_id: oddball.id
}
]

Expand All @@ -60,13 +69,6 @@
email: '[email protected]',
github_username: 'jsmith',
organization_id: dova.id
},
{
first_name: 'Susan',
last_name: 'Williams',
email: '[email protected]',
github_username: 'suzy',
organization_id: etsy.id
}
]

Expand Down