-
-
Notifications
You must be signed in to change notification settings - Fork 985
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
Sign up route changed with bug fix and proper data importation #1770
Conversation
Our Pull Request Approval ProcessWe have these basic policies to make the approval process smoother for our volunteer team. Testing Your CodePlease make sure your code passes all tests. Our test code coverage system will fail if these conditions occur:
The process helps maintain the overall reliability of the code base and is a prerequisite for getting your PR approved. Assigned reviewers regularly review the PR queue and tend to focus on PRs that are passing. ReviewersDo not assign reviewers. Our Queue Monitors will review your PR and assign them.
Reviewing Your CodeYour reviewer(s) will have the following roles:
CONTRIBUTING.mdRead our CONTRIBUTING.md file. Most importantly:
Other
|
I have tested the api in all the way I can think of, @palisadoes, the infinite scrolling bug is fixed now and importation of data and bug being fixed is shown in video (link is in PR description, as video was large) |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #1770 +/- ##
===========================================
- Coverage 96.17% 96.06% -0.11%
===========================================
Files 333 336 +3
Lines 22536 22726 +190
Branches 1949 1995 +46
===========================================
+ Hits 21673 21831 +158
- Misses 854 888 +34
+ Partials 9 7 -2 ☔ View full report in Codecov by Sentry. |
@Manik2708 Please fix the failing code coverage tests. |
Actually this is a bug fix for #1741, The files changed by me are |
@beingnoble03 @anwersayeed Can you review this PR? |
@Manik2708 please fix the conflicting file |
@beingnoble03 @EshaanAgg @anwersayeed Please review! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't understand the reasoning behind the UserToReturn
model. The best way would be just to remove the password
field from the User
model in src/typeDefs/types
so that the client can never request for the same. Database schema and GraphQL can be different (and in most cases they should be).
src/models/User.ts
Outdated
* This is an interface of the user that will be returned to the client side. | ||
* The differrence between this interface and the real User Interface is that it doesn't contains password field | ||
* Although this is a poor way, a better way will include implementing this Model with inclusion of password field and then using that model everywhere. | ||
*/ | ||
export interface InterfaceUserToReturn { | ||
_id: Types.ObjectId; | ||
address: { | ||
city: string; | ||
countryCode: string; | ||
dependentLocality: string; | ||
line1: string; | ||
line2: string; | ||
postalCode: string; | ||
sortingCode: string; | ||
state: string; | ||
}; | ||
adminApproved: boolean; | ||
adminFor: PopulatedDoc<InterfaceOrganization & Document>[]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are we creating a model for this? This is already handled in the GraphQL resolvers by adding the password: 0
argument to the database calls so that the hashed password is not fetched from the database by Mongoose.
I also firstly tried in the same way, but But See this also: And that's why |
Number of conflicts are very high. Please give me some time. |
@Manik2708 Please fix the conflicting files and failing tests. |
@palisadoes There is a doubt while changing the logic according to latest changes. Why Another question which is there: Should user be allowed to enter Talawa Ecosystem if the membership request made by it (Please refer to PR template for the route) for the |
|
Okay, so in this PR, I am going with this logic now:
|
@Manik2708 please can you fix the conflicting files? |
|
|
I'll create a separate issue to fix setup. Focus on the original issue. This PR is taking much too long. I will soon have to close it |
@palisadoes Please review! |
Please see that tests for |
The logic is implemented but the problem lies in testing them. Writing tests for |
We can make the setup tests another issue. This is taking too long. |
Yes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Focus on the registration part. This is taking too long, and the basic testing hasn't been applied. I've opened this issue to fix setup. |
I'd like to put this in context. There has been:
In addition to this:
I'm going to close this PR, and reassign the issue. This is unfortunate. |
No problem @palisadoes. I tried but failed. I hope my efforts in this PR will help the new assignee. |
I never ignored this PR. Changes were so abrupt in the last month, that it was really difficult to cop-up. I always wanted to give my best that's why I picked other testing issues. I can't give the time back but can help the new assignee. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
m purva [email protected]
What kind of change does this PR introduce?
Admin
of organization fromSuper Admin
.adminApproved
was only for testing purpose but now will be used for authenticating whether user is actually Admin approved or not.acceptMemeberShip
mutation is also modified to approve the user if it's his first request.@ts-ignore
anddelete
operand was used before to delete the password fromcreatedUser
, nowomit
method is used by creating a separate interface of the user which doesn't consists password.Issue Number:
Fixes #1703
Did you add tests for your changes?
YesSnapshots/Videos:
Video link for reference of bug getting fixed, and Talawa Admin working and importing of data in setup: https://www.mediafire.com/file/ujr35ynmlxy6ic3/Untitled+design.mp4/file
New SignUp Route
New Accept Membership Request Route
Query with output, when user tries to signUp with Organization that doesn't require User Registration
The organization which was used in above query
Query with output, when user tries to signUp with Organization that require User Registration
The default organization, which was also used in above query
Setup Route
If relevant, did you update the documentation?
Summary
Does this PR introduce a breaking change?
Yes, I have tried to make the system more secured by using `adminApproved` flag.Other information
Have you read the contributing guide?
Yes