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

Capture additional profile information about users #112

Closed
jonrkarr opened this issue Nov 3, 2019 · 8 comments
Closed

Capture additional profile information about users #112

jonrkarr opened this issue Nov 3, 2019 · 8 comments
Assignees
Labels
enhancement New feature or request

Comments

@jonrkarr
Copy link
Member

jonrkarr commented Nov 3, 2019

(1) Create data model

  • Affiliation
  • Brief textual description (e.g., of scientific interests)
  • Website
  • Public email address
  • Professional profiles: GitHub id and/or LinkedIn id
  • Publication history: ORCID, Google scholar id, or id of NCBI bibliography

Rather than enumerating many possible linked accounts, users could enter key/value pairs of URLs (e.g., URl for LinkedIn profile) and their type (e.g., "LinkedIn profile")

(2) Persist the data

A nice option is to let Auth0 manage this
https://auth0.com/docs/users/guides/manage-user-metadata
https://community.auth0.com/t/how-do-i-allow-users-to-view-update-their-user-metadata/29957/5

(3) Add page to edit this information

@jonrkarr jonrkarr added the enhancement New feature or request label Nov 3, 2019
@jonrkarr
Copy link
Member Author

Done

  • Model for user data is implemented.
  • Form to edit user data

Todo

  • Persist data

@bilalshaikh42
Copy link
Member

There are two approaches that I can think of to take for this.
One would be to have the front end access the management API as described in the docs. This ties the front end to auth0

The other would be to have the front end simply call our back-end api for user operations. Then the back-end can be the one that interacts with the management api. This would have the front end be entirely independent of whatever user authentication system we use.

The user service would be responsible for making the call to our back-end API. All calls will already have the authorization token so the back-end could use that to then edit the metadata

I can work on seeing which solution is easier to implement. I think the SPA approach might be quicker to get running and then we can later work on having our own user records as a backup

@jonrkarr
Copy link
Member Author

jonrkarr commented Dec 5, 2019

Do whichever you think is easier to implement.

@bilalshaikh42
Copy link
Member

bilalshaikh42 commented Dec 9, 2019

#201 includes all the needed front end changes to persist data and pull profile information
The API needs to updated to support the calls

@bilalshaikh42
Copy link
Member

The API has been updated to create persistent user profiles in the database

@bilalshaikh42 bilalshaikh42 pinned this issue Dec 18, 2019
@bilalshaikh42
Copy link
Member

@jonrkarr
The set method on the API overrides the user object with the information sent from the site.
The form to edit the profile currently has blank values as default. We need the form to read the current information and prepopulate the form to prevent existing fields from being overwritten. I can do this as I work on #201 but if its an easy fix for you that would be very helpful!

@jonrkarr
Copy link
Member Author

jonrkarr commented Dec 18, 2019

The forms can be populated using this.formGroup.patchValue(user). user can be an instance of User or an object with the same fields. This was working with the demo data. This should be linked to the handler for receiving the user data.

formGroup is an instance of FormGroup

The data in the forms can be accessed as this.formGroup.value. The validity of the form is this.formGroup.valid. Validators are easy to add. They're specified as an array of validator instances when the form control component is constructed.

@bilalshaikh42
Copy link
Member

Done in #258

@bilalshaikh42 bilalshaikh42 unpinned this issue Dec 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants