Skip to content

Fix the incorrect function of assigning a new badge#3237

Closed
ShraddhaShahari wants to merge 1 commit into
developmentfrom
shraddha-Fix-the-incorrect-function-of-assigning-a-new-badge
Closed

Fix the incorrect function of assigning a new badge#3237
ShraddhaShahari wants to merge 1 commit into
developmentfrom
shraddha-Fix-the-incorrect-function-of-assigning-a-new-badge

Conversation

@ShraddhaShahari
Copy link
Copy Markdown
Contributor

@ShraddhaShahari ShraddhaShahari commented Mar 7, 2025

Description

Fixed the incorrect function of assigning a new badge, previously it was showing blank page after clicking on "Assign Badge".
Fixes # (bug priority: medium)

Main changes explained:

  • Implemented Optional Chaining (?.) - To prevent runtime errors when accessing properties of potentially null or undefined objects.
  • Added filter() to Validate Data - This ensures only valid badge.badge objects are processed before calling map()
  • Enhanced Error Handling
  • Improved Data Integrity & Reliability

How to test:

  1. check into current branch
  2. do npm install and ... to run this PR locally
  3. Clear site data/cache
  4. log as owner user
  5. go to View Profile→ Assign Badge
  6. verify after clicking on Assign badge it should show list of badges
  7. verify that it should not show a blank page after clicking on Assign Badge

Screenshots or videos of changes:

Before fix: screen recording with an error:

Screen.Recording-before.fix.mov

After fix: screen recording:

Screen.Recording-after.fix.mov

Note:

Include the information the reviewers need to know.

@netlify
Copy link
Copy Markdown

netlify Bot commented Mar 7, 2025

Deploy Preview for highestgoodnetwork-dev ready!

Name Link
🔨 Latest commit 6fa47ac
🔍 Latest deploy log https://app.netlify.com/sites/highestgoodnetwork-dev/deploys/67ca56c71fe58700081d432e
😎 Deploy Preview https://deploy-preview-3237--highestgoodnetwork-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Copy Markdown
Contributor

@aaryaneil aaryaneil left a comment

Choose a reason for hiding this comment

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

Tested the PR and while assigning the badge on submitting the badge I am getting a PUT error and the badge is not assigned.

Screen.Recording.2025-03-08.at.2.45.40.AM.mov

@rnavyaprabha rnavyaprabha self-requested a review March 9, 2025 07:40
Copy link
Copy Markdown

@rnavyaprabha rnavyaprabha left a comment

Choose a reason for hiding this comment

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

i have checked the code changes and also verified if the badge list is correctly displayed or not. It functionality and the code look good to me.
I am approving this PR.
Here is the screenshot 👍
image

@ShraddhaShahari
Copy link
Copy Markdown
Contributor Author

Tested the PR and while assigning the badge on submitting the badge I am getting a PUT error and the badge is not assigned.

Screen.Recording.2025-03-08.at.2.45.40.AM.mov

@aaryaneil, The error you getting while assigning a badge is not related to my changes. Please go through the code again and double check.
Thank you!

Copy link
Copy Markdown

@rsripathi2906 rsripathi2906 left a comment

Choose a reason for hiding this comment

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

Tested the PR by following these steps: logged in as an owner user, and navigated to View Profile → Assign Badge. Verified that after clicking on Assign Badge, the list of badges appears and that it does not show a blank page. Everything works as expected. Approving the PR.

Screenshot 2025-03-29 231110

Copy link
Copy Markdown
Contributor

@guthaVamshi guthaVamshi left a comment

Choose a reason for hiding this comment

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

Tested the PR as per the provided steps, and everything is working as expected. However, I noticed that when switching to dark mode, Name , Badge info (i) button above the checkbox remains unchanged(color), making it difficult to see. Aside from that, everything else looks good.

image

@one-community one-community added Needs New Developer This is a PR that is partially developed but needs someone new to take it over and finish it. do not review Do not review or look at code without full context labels Apr 25, 2026
@one-community
Copy link
Copy Markdown
Member

Redone with this: #5194

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

Labels

do not review Do not review or look at code without full context Needs New Developer This is a PR that is partially developed but needs someone new to take it over and finish it.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants