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

refactors answers codes to parse user data from jwt token. Moves pars… #274

Merged
merged 52 commits into from
May 4, 2020

Conversation

qckpckt
Copy link
Contributor

@qckpckt qckpckt commented May 1, 2020

…eToken to seperate file to be imported to avoid duplication

Motivation

Relating to this trello board task, and this issue, and maybe this issue too?

Implementation

  • Moved parsetoken (renamed to camel case) to separate file (common.js) to be imported by both userList.js and questionList.js
  • Updated parseAnswer logic to read user data from jwt token
  • Updated addAnswer and editAnswer to use the new user data fields generated by parseAnswer

To do

  • ensure that the client methods that call the add/edit answer can provide the jwt token in the request body? (not sure if this is in scope for this ticket)
  • test that it actually works

Unknowns

  • the github issue called for location. I can see country in the user object -- hopefully that's enough?

christianlomboy and others added 30 commits April 16, 2020 14:44
Integration/webapp: Navlink.js contact us -> disclaimer
Integration/webapp hide language menu side bar
Integration/webapp: Funtional Twitter Button Share Social
…-button

Add Televideo button to patient facing board and fix some mobile styling for social menu
…ub.com:nthopinion/covid19 into integration/webapp
sethuraj and others added 22 commits April 26, 2020 13:10
Multiple Answers to a question release to prod
Production release Merge to Master 04262020
Fix unanswered question secttion, Answer saving issue
Fix unanswered question secttion, Answer saving issue release Patch
Production release 04282020-Fix Unanswered question section
Fix delete questions patch refactorQnA Test
Question Like sort, images, grouping QnAs closer
Question Like sort, images, grouping QnAs closer -release#250
Physician Regstration API and User Verification - Test
Physician Regstration API and User Verification-Prod Release
…eToken to seperate file to be imported to avoid duplication
@qckpckt qckpckt changed the base branch from master to develop/refactorQnA May 1, 2020 22:44
Comment on lines +6 to +10
user.profilestatus = "level 0";
user.fullname = item.given_name + " " + item.family_name;
user.b2cid = item.sub;
user.lastsignintime = item.auth_time;
user.email = item.emails[0];
Copy link
Collaborator

Choose a reason for hiding this comment

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

better to use camelCase variable naming. Will make our code consistent

Copy link
Contributor

Choose a reason for hiding this comment

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

Hi @aviskarkc10 The class variables for the class user is matched with how the fields in the NoSQL container. CosmosDB is case sensitive. In C# we can map the class variable to database field , not sure how it is in node.js, so kept exactly the same. That is my code. We can discuss more in slack. Thanks


const userDetails = {
id: userData.id,
name: userData.anonymous ? userData.fullname : null
Copy link
Collaborator

Choose a reason for hiding this comment

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

shouldn't name be null when anonymous is true? I am thinking this should be reversed?

Copy link
Contributor

Choose a reason for hiding this comment

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

Hi @aviskarkc10 If anonymous, we should call it "Anonymous". I am going to merge this code from Alex to test and test. Thanks Jay

Copy link
Contributor

Choose a reason for hiding this comment

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

This will be reversed. I will make this change.
const userDetails = {
id: userData.id,
name: userData.anonymous ? "Dr. Anonymous" : userData.fullname
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes this should be reversed. Sorry!

@sethuraj sethuraj merged commit e3b523e into nthopinion:develop/refactorQnA May 4, 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.

None yet

6 participants