PalisadoesFoundation / talawa

Community Organization Management Software. Click on the link below to see our documentation.
https://docs.talawa.io/
GNU General Public License v3.0
311 stars 438 forks source link

Fix userType (Fixed SignUp and LogIn) #2389

Closed Dante291 closed 7 months ago

Dante291 commented 7 months ago

What kind of change does this PR introduce?

Fixes userType in the app by adding isSuperAdmin filed in user schema.

Issue Number:

Fixes 2373 (not tagging issue as that will close it)

Did you add tests for your changes?

No

Does this PR introduce a breaking change?

Somewhat yeah

Have you read the contributing guide?

Yes

github-actions[bot] commented 7 months ago

Our Pull Request Approval Process

We have these basic policies to make the approval process smoother for our volunteer team.

Testing Your Code

Please make sure your code passes all tests. Our test code coverage system will fail if either of these two conditions occur:

  1. The overall code coverage drops below the target threshold of the repository
  2. Any file in the pull request has code coverage levels below the repository threshold

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.

Reviewers

Do not assign reviewers. Our Queue Monitors will review your PR and assign them. When your PR has been assigned reviewers contact them to get your code reviewed and approved via:

  1. comments in this PR or
  2. our slack channel

Reviewing Your Code

Your reviewer(s) will have the following roles:

  1. arbitrators of future discussions with other contributors about the validity of your changes
  2. point of contact for evaluating the validity of your work
  3. person who verifies matching issues by others that should be closed.
  4. person who gives general guidance in fixing your tests

Other

:dart: Please be considerate of our volunteers' time. Contacting the person who assigned the reviewers is not advised unless they ask for your input. Do not @ the person who did the assignment otherwise.

Dante291 commented 7 months ago

@palisadoes @noman2002 @AVtheking

Instead of adding userAppProfile schema in the App I have added isSuperAdmin field and have updated the fetching and storing user Info (createdOrganisation, adminFor and isSuperAdmin), have updated queries such that logIn and SignUp work properly.

Please let me know if this approach is fine or do I need to add more field from appUserProfile document?

palisadoes commented 7 months ago

We want no admin features in the mobile app, so you'll need to assume a user login.

Dante291 commented 7 months ago

@palisadoes sorry I didn't get you sir, what you mean by I will need to assume user login.

palisadoes commented 7 months ago
  1. I was mixing up Admin where there are separate routes for Admin and User screens.
  2. No admin features in the mobile app at this time. We want to keep it simple
codecov[bot] commented 7 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 95.54%. Comparing base (eb333ad) to head (077e138).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## develop-userTypeFix #2389 +/- ## ======================================================= - Coverage 95.56% 95.54% -0.02% ======================================================= Files 147 147 Lines 7187 7165 -22 ======================================================= - Hits 6868 6846 -22 Misses 319 319 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

Dante291 commented 7 months ago

@palisadoes This is ready for review

AVtheking commented 7 months ago
  1. I was mixing up Admin where there are separate routes for Admin and User screens.

    1. No admin features in the mobile app at this time. We want to keep it simple

This means we do not require adminFor field in app ? @Dante291 if it was previously not being used then remove it

Dante291 commented 7 months ago
  1. I was mixing up Admin where there are separate routes for Admin and User screens.

    1. No admin features in the mobile app at this time. We want to keep it simple

This means we do not require adminFor field in app ? @Dante291 if it was previously not being used then remove it

I am gonna let this be in the userInfo schema as we might have some support for admin user type in future, this field will be helpful that time.

AVtheking commented 7 months ago
  1. I was mixing up Admin where there are separate routes for Admin and User screens.

    1. No admin features in the mobile app at this time. We want to keep it simple

This means we do not require adminFor field in app ? @Dante291 if it was previously not being used then remove it

I am gonna let this be in the userInfo schema as we might have some support for admin user type in future, this field will be helpful that time.

if we are going to have admin support in feature then okay

palisadoes commented 7 months ago

@noman2002 @literalEval @Ayush0Chaudhary

Please review