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

feat: Use of same Login/Register Component on User and Admin #1493

Conversation

rishabhbizzle
Copy link

What kind of change does this PR introduce?

This PR addresses the separate Login/Register components for Admin and User. In this we uses a single Login/Register Component made from the base UI and code of Admin Panel's Login/Register Component for both Admin & User page which helps in maintaining the DRY principle and also solves the issue of unnecessary dependency in the project where we always need to synchronise the UI and other elements for both the User portal and Admin portal.

Issue Number:

Fixes #1377

Did you add tests for your changes?

Yes

Snapshots/Videos:
A video of demonstrating the whole login and register process for both admin & user:

Recording.2024-01-08.000058.mp4

Summary

Does this PR introduce a breaking change?

Other information

Have you read the contributing guide?

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

Copy link

codecov bot commented Jan 24, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (683207f) 96.23% compared to head (c7e8f14) 96.08%.

❗ Current head c7e8f14 differs from pull request most recent head 8bc9e74. Consider uploading reports for the commit 8bc9e74 to get more accurate results

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1493      +/-   ##
===========================================
- Coverage    96.23%   96.08%   -0.16%     
===========================================
  Files          133      132       -1     
  Lines         3404     3292     -112     
  Branches      1031      994      -37     
===========================================
- Hits          3276     3163     -113     
- Misses         123      124       +1     
  Partials         5        5              

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

@Cioppolo14
Copy link

@rishabhbizzle Please fix the failing codecov tests.

@rishabhbizzle
Copy link
Author

@rishabhbizzle Please fix the failing codecov tests.

Done ✅ @Cioppolo14

@Cioppolo14
Copy link

@tasneemkoushar @beingnoble03 Please review this PR.

Copy link
Member

@noman2002 noman2002 left a comment

Choose a reason for hiding this comment

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

Please fix the conflicting files.

@rishabhbizzle
Copy link
Author

Please fix the conflicting files.

Done ✅ @noman2002

@palisadoes
Copy link
Contributor

Please fix the failing tests

  • Code coverage is declining. The tests for the files you have submitted are not complete

@rishabhbizzle
Copy link
Author

These 2 lines are the reason coverage is declining slightly. Please help me with this @palisadoes @noman2002
image

@palisadoes
Copy link
Contributor

Search the code base for a similar construct and see how the coverage was handled in those cases

@beingnoble03
Copy link
Member

@rishabhbizzle this can't be tested. So, for similar situations we have added /* istanbul ignore next */ comment before the if branch to tackle the code coverage issue. You can observe that in the other files of the codebase.

@rishabhbizzle
Copy link
Author

@rishabhbizzle this can't be tested. So, for similar situations we have added /* istanbul ignore next */ comment before the if branch to tackle the code coverage issue. You can observe that in the other files of the codebase.

Should I add this comment before the try line?? @beingnoble03

@beingnoble03
Copy link
Member

I guess after that. Please check other files. I have used the same before.

@rishabhbizzle
Copy link
Author

I guess after that. Please check other files. I have used the same before.

I've added the comment but now the coverage is even lower than before even though the missing line count decreased from 2 to 1. I'm confused here please help @noman2002 @beingnoble03

image

@rishav-jha-mech
Copy link
Contributor

@rishabhbizzle
In your PR, ensure that both the Admin and User tabs are exactly similar. Make the following changes: increase the height/padding of the text input boxes and buttons to match the Figma design. Also, ensure there is enough space between elements as they currently appear too clustered.

Copy link
Member

@noman2002 noman2002 left a comment

Choose a reason for hiding this comment

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

Please fix the conflicting files.

@rishav-jha-mech rishav-jha-mech self-requested a review February 12, 2024 18:17
@palisadoes
Copy link
Contributor

NOTE Read very carefully

  1. We just merged this PR which upgraded the prettier package.
    1. Upgraded prettier from 2.3.2 to 3.2.5 #1599
  2. It reformatted over 150 files.

This will put your PR at risk of extensive merge conflicts. Do the following IN THIS ORDER:

  1. upgrade your prettier in your local branch to the same version
  2. run prettier on your local branch
  3. update your local branch with the latest upstream

This will help to reduce the number of existing and future merge conflicts for your PR.

@noman2002
Copy link
Member

Closing due to inactivity.

@noman2002 noman2002 closed this Feb 18, 2024
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.

6 participants