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

Added Support for User Family Members #1713

Merged
merged 10 commits into from
Feb 3, 2024

Conversation

AdityaRaimec22
Copy link
Contributor

What kind of change does this PR introduce?
Add Support for User Family Members

Issue Number:

Fixes #1584

Did you add tests for your changes?
Yes

Snapshots/Videos:

If relevant, did you update the documentation?
Not relevant

Summary

Does this PR introduce a breaking change?
No

Other information
Some tests are failing and I am currently addressing them, and I have raised a pull request because the assigned issue has been pending for a significant period.

Have you read the contributing guide?
Yes

Copy link

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 these 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
  3. Merge conflicts

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

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

CONTRIBUTING.md

Read our CONTRIBUTING.md file. Most importantly:

  1. PRs with issues not assigned to you will be closed by the reviewer
  2. Fix the first comment in the PR so that each issue listed automatically closes

Other

  1. 🎯 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.
  2. Read the CONTRIBUTING.md file make

@palisadoes
Copy link
Contributor

Please fix the conflicting files

Copy link
Contributor

@palisadoes palisadoes left a comment

Choose a reason for hiding this comment

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

You have interchangeably used the term familyGroup and Family in the PR definitions. To make it unambiguous for future developers use userFamily to replace familyGroup and Family.

import "dotenv/config";
import type mongoose from "mongoose";
import { Types } from "mongoose";
import type { MutationCreateFamilyGroupArgs } from "../../../src/types/generatedGraphQLTypes";
Copy link
Contributor

Choose a reason for hiding this comment

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

You have interchangeably used the term familyGroup and Family in the PR definitions. To make it unambiguous for future developers use userFamily to replace familyGroup and Family.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

Copy link
Contributor

@palisadoes palisadoes left a comment

Choose a reason for hiding this comment

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

The Mutation Test file names should more closely reflect the UserFamily naming convention

image

@AdityaRaimec22
Copy link
Contributor Author

The Mutation Test file names should more closely reflect the UserFamily naming convention

image

committed changes @palisadoes

@palisadoes
Copy link
Contributor

Please fix the failing tests

@SiddheshKukade
Copy link
Member

Please fix the tests.

@AdityaRaimec22
Copy link
Contributor Author

working on the failing tests will fix them ASAP.

@palisadoes
Copy link
Contributor

Please fix the conflicting files

1 similar comment
@palisadoes
Copy link
Contributor

Please fix the conflicting files

@palisadoes palisadoes reopened this Jan 31, 2024
@palisadoes
Copy link
Contributor

Please fix the conflicting file

@palisadoes palisadoes requested review from palisadoes and removed request for palisadoes January 31, 2024 19:12
@AdityaRaimec22
Copy link
Contributor Author

AdityaRaimec22 commented Jan 31, 2024

@palisadoes The PR is up for review now all the tests has been passed from my side for the code that I have changed.

@palisadoes palisadoes requested a review from EshaanAgg January 31, 2024 19:35
Copy link
Contributor

@EshaanAgg EshaanAgg left a comment

Choose a reason for hiding this comment

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

Need some changes in the proposed schema, and subsequently, the implemented resolvers. Otherwise, the overall implementation looks good.

src/models/User.ts Outdated Show resolved Hide resolved
src/models/User.ts Outdated Show resolved Hide resolved
src/models/User.ts Outdated Show resolved Hide resolved
src/models/userFamily.ts Show resolved Hide resolved
Copy link
Contributor

@EshaanAgg EshaanAgg left a comment

Choose a reason for hiding this comment

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

Minor changes needed.

Copy link
Contributor

Choose a reason for hiding this comment

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

Rename file to addUserToUserFamily

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

src/resolvers/Mutation/adminAddMemberToUserFamily.ts Outdated Show resolved Hide resolved
src/resolvers/Mutation/adminRemoveMemberFromUserFamily.ts Outdated Show resolved Hide resolved
@EshaanAgg EshaanAgg dismissed their stale review February 2, 2024 15:48

Due to failing test suite

@palisadoes
Copy link
Contributor

Please fix the failing tests

@AdityaRaimec22
Copy link
Contributor Author

@palisadoes @EshaanAgg All the checks are passed from my side. Can you approve the PR now. Thanks

image

Copy link

codecov bot commented Feb 3, 2024

Codecov Report

Attention: 117 lines in your changes are missing coverage. Please review.

Comparison is base (c0468a4) 98.17% compared to head (d6fae60) 97.91%.
Report is 229 commits behind head on develop.

Files Patch % Lines
src/resolvers/Mutation/removeUserFromUserFamily.ts 82.17% 22 Missing and 1 partial ⚠️
src/resolvers/Mutation/addUserToUserFamily.ts 78.04% 18 Missing ⚠️
src/libraries/errors/ImageSizeLimitExceeded.ts 27.27% 16 Missing ⚠️
src/resolvers/Mutation/updateUserProfile.ts 70.90% 1 Missing and 15 partials ⚠️
src/resolvers/Mutation/createEvent.ts 83.51% 13 Missing and 2 partials ⚠️
src/resolvers/middleware/currentUserExists.ts 45.83% 13 Missing ⚠️
src/resolvers/Mutation/createPost.ts 90.32% 6 Missing ⚠️
src/resolvers/Mutation/createOrganization.ts 95.78% 4 Missing ⚠️
src/resolvers/Mutation/removeAdvertisement.ts 92.85% 2 Missing ⚠️
...c/resolvers/Query/postsByOrganizationConnection.ts 33.33% 2 Missing ⚠️
... and 2 more
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1713      +/-   ##
===========================================
- Coverage    98.17%   97.91%   -0.27%     
===========================================
  Files          184      234      +50     
  Lines        10767    14124    +3357     
  Branches       835     1175     +340     
===========================================
+ Hits         10571    13829    +3258     
- Misses         186      262      +76     
- Partials        10       33      +23     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@AdityaRaimec22
Copy link
Contributor Author

@AdityaRaimec22 where is the UI Equivalent fort this feature can you please link that I wanted to check that.

@SiddheshKukade here is the UI equivalent of this feature.

806a668f-722e-4956-a860-693f4c61ee6c.mp4

@palisadoes palisadoes merged commit 8707a9c into PalisadoesFoundation:develop Feb 3, 2024
7 of 11 checks passed
palisadoes added a commit that referenced this pull request Feb 3, 2024
palisadoes added a commit that referenced this pull request Feb 3, 2024
@palisadoes
Copy link
Contributor

@AdityaRaimec22

You bypassed the lint rules some how and now everyone else is having linting issues. Please resubmit your changes with the correct linting applied.

@AdityaRaimec22
Copy link
Contributor Author

@palisadoesI haven't overridden or bypassed any of the changes; they were all pushed in the usual manner, and the checks also passed in this pull request. Could you please provide a link to a pull request where the lint checks failed, or share some resource indicating that checks failed for this reason? I'd like to take a look at why those changes failed.

@palisadoes
Copy link
Contributor

@AdityaRaimec22

  1. That was the impression given to me by @LakshyaSatpal by this comment right after i merged. When it was reverted the issue went away.
  2. However, that may have been caused by fixing merge conflicts which may have triggered the problem, based on the fact that he mentioned the conflicts going away, which were not mentioned initially. It could have been a question of timing as it was noted very soon after the merge.
    1. feat: Event Volunteers #1774 (comment)
      If you feel confident that the linting was OK, let's resubmit and let's try to see whether others have the same issue.

I'll hang around until you do.

@palisadoes
Copy link
Contributor

If I was hasty, I apologize. The timing was so close that I might have jumped to an incorrect conclusion

@AdityaRaimec22
Copy link
Contributor Author

If I was hasty, I apologize. The timing was so close that I might have jumped to an incorrect conclusion

@palisadoes so should I open a new PR.

@palisadoes
Copy link
Contributor

Yes

@lakshz
Copy link
Contributor

lakshz commented Feb 4, 2024

@AdityaRaimec22 In most cases, the use of any in your changes, was causing lint errors.
I confirmed this by looking at the changed files in this PR.

@AdityaRaimec22
Copy link
Contributor Author

AdityaRaimec22 commented Feb 4, 2024

@AdityaRaimec22 In most cases, the use of any in your changes, was causing lint errors. I confirmed this by looking at the changed files in this PR.

@LakshyaSatpal The code I've added isn't failing in the checks of this PR or when tested locally. Additionally, the code I've implemented draws inspiration from existing code in the codebase; I haven't introduced any new methods to incorporate this feature So I don't think any has any impact on test failures. It is due to other reasons which we are working on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants