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

Fixes Organization not found error in LeftDrawerOrg #1385

Closed

Conversation

nitishkumar333
Copy link
Contributor

What kind of change does this PR introduce?

Bugfix

Fixes #1333

Did you add tests for your changes?
Yes

Snapshots/Videos:

leftdrawer.mp4

Does this PR introduce a breaking change?
No

Summary

When user profile is opened through the orglist page, an error is shown on the member page and redirected back to orglist page. I fixed the issue by conditionally renderingthe MemberDetails component.

Have you read the contributing guide?
Yes

Copy link

github-actions bot commented Jan 6, 2024

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

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Congratulations on making your first PR! 🎊 If you haven't already, check out our Contributing Guidelines and PR Reporting Guidelines to ensure that you are following our guidelines for contributing and creating PR.

@@ -18,19 +19,29 @@ import Loader from 'components/Loader/Loader';

type MemberDetailProps = {
id: string; // This is the userId
from?: string;
};
type LocationStateProps = {
Copy link
Contributor

Choose a reason for hiding this comment

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

You could have used MemberDetailProps here, why create LocationStateProps which have similar keys ?, this is redundant

src/components/LeftDrawer/LeftDrawer.tsx Fixed Show resolved Hide resolved
<img src={userImage} alt={`profile picture`} />
) : (
<img
src={`https://api.dicebear.com/5.x/initials/svg?seed=${firstName}%20${lastName}`}

Check warning

Code scanning / CodeQL

DOM text reinterpreted as HTML Medium

DOM text
is reinterpreted as HTML without escaping meta-characters.
DOM text
is reinterpreted as HTML without escaping meta-characters.
Copy link
Contributor

Choose a reason for hiding this comment

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

Please fix this security vulnterability

Copy link

codecov bot commented Jan 6, 2024

Codecov Report

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

Comparison is base (751bcbe) 96.23% compared to head (318cb20) 96.31%.
Report is 9 commits behind head on develop.

Files Patch % Lines
src/screens/MemberDetail/MemberDetail.tsx 88.88% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1385      +/-   ##
===========================================
+ Coverage    96.23%   96.31%   +0.07%     
===========================================
  Files          133      133              
  Lines         3404     3416      +12     
  Branches      1031     1045      +14     
===========================================
+ Hits          3276     3290      +14     
+ Misses         123      122       -1     
+ Partials         5        4       -1     

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

Copy link

This pull request did not get any activity in the past 10 days and will be closed in 180 days if no update occurs. Please verify it has no conflicts with the develop branch and rebase if needed. Mention it now if you need help or give permission to other people to finish your work.

@github-actions github-actions bot added no-pr-activity No pull request activity and removed no-pr-activity No pull request activity labels Jan 17, 2024
@palisadoes
Copy link
Contributor

Closing due to inactivity

@palisadoes palisadoes closed this Jan 19, 2024
@palisadoes palisadoes reopened this Jan 19, 2024
@palisadoes
Copy link
Contributor

  1. Please fix the conflicting files.
  2. We should get this PR merged
  3. Let us know when you are done so the reviewers can look again.

@nitishkumar333
Copy link
Contributor Author

@rishav-jha-mech removed the merge conflict, please review

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 failing test.

@palisadoes
Copy link
Contributor

@noman2002 The introspection tests will fail for a few days as the API has new functionality that is not reflected in Admin.

@palisadoes palisadoes requested a review from noman2002 January 21, 2024 17:17
@palisadoes
Copy link
Contributor

@nitishkumar333

  1. This seems to have been fixed. I tried doing the steps in the video and they all work.
  2. Please verify and close the PR if it has been addressed

@nitishkumar333
Copy link
Contributor Author

@palisadoes it's not fixed yet.

To reproduce the error, login to talawa-admin and directly click on leftDrawer username (without opening any other page)

Here is the video just after login.

video1.mp4

But, if we open any organization and then go back to homescreen then it will work because the URL doesn't get full changed (which it should be changed back to "/orglist" and not "/orglist/id=6776343783475434")
Here is the video

video2.mp4

@palisadoes
Copy link
Contributor

  1. Yes I see it now.
  2. Please fix the DOM vulnerability. It looks like you may have to escape some characters in the strings

<img src={userImage} alt={`profile picture`} />
) : (
<img
src={`https://api.dicebear.com/5.x/initials/svg?seed=${firstName} ${lastName}`}

Check warning

Code scanning / CodeQL

DOM text reinterpreted as HTML Medium

DOM text
is reinterpreted as HTML without escaping meta-characters.
DOM text
is reinterpreted as HTML without escaping meta-characters.
@palisadoes
Copy link
Contributor

Please fix the failing tests

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

@@ -133,7 +133,7 @@
<img src={userImage} alt={`Profile Picture`} />
) : (
<img
src={`https://api.dicebear.com/5.x/initials/svg?seed=${firstName}%20${lastName}`}
src={`https://api.dicebear.com/5.x/initials/svg?seed=${firstName} ${lastName}`}

Check warning

Code scanning / CodeQL

DOM text reinterpreted as HTML Medium

DOM text
is reinterpreted as HTML without escaping meta-characters.
DOM text
is reinterpreted as HTML without escaping meta-characters.
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 DOM vulnerability.

@noman2002
Copy link
Member

Closing due to inactivity.

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

4 participants