Skip to content

Amalesh taking over for Jay - Toggle Request Bio Permission#704

Closed
Alforoan wants to merge 7 commits intodevelopmentfrom
Jay_Toggle_Request_Bio_BackEnd
Closed

Amalesh taking over for Jay - Toggle Request Bio Permission#704
Alforoan wants to merge 7 commits intodevelopmentfrom
Jay_Toggle_Request_Bio_BackEnd

Conversation

@Alforoan
Copy link
Contributor

Description

A user with a 'requestBio' permission is now able to toggle the bio switch under Weekly Summaries Report.

Related PRS (if any):

To test this backend PR you need to checkout the #1831 frontend PR.

Main changes explained:

  • Add controller logic so that once the user with the requestBio permission toggles the switch under Weekly Summaries Report, the change is saved properly.

How to test:

  1. check into current branch
  2. do npm install, npm run build and npm run start to run this PR locally
  3. Clear site data/cache

const isRequestorAuthorized = (!!(
canRequestorUpdateUser(req.body.requestor.requestorId, userid) && (
await hasPermission(req.body.requestor, 'putUserProfile')
await hasPermission(req.body.requestor, 'putUserProfile')) || await hasPermission(req.body.requestor, 'requestBio')
Copy link
Contributor

Choose a reason for hiding this comment

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

This makes the requestBio permission also able to modify the rest of users' profiles, not just the bioRequested field.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed.

Copy link

@Renanluizssx Renanluizssx left a comment

Choose a reason for hiding this comment

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

Copy link
Contributor

@Pandani07 Pandani07 left a comment

Choose a reason for hiding this comment

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

Got an error when testing this PR, posted a review on the frontend PR

@galgalinidhi
Copy link

Hi @Alforoan, I left a comment here- OneCommunityGlobal/HighestGoodNetworkApp#1831

Copy link
Contributor

@mohabbasd mohabbasd left a comment

Choose a reason for hiding this comment

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

Hello, I tested your PR but it is not working as expected.
Screenshot 2024-02-12 at 12 39 27 AM

@XiaohanMeng XiaohanMeng self-requested a review February 15, 2024 22:20
Copy link
Contributor

@XiaohanMeng XiaohanMeng left a comment

Choose a reason for hiding this comment

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

Hi, I left my review on the FE project: OneCommunityGlobal/HighestGoodNetworkApp#1831

@skaush21
Copy link
Contributor

skaush21 commented Feb 21, 2024

see review on the frontend PR: OneCommunityGlobal/HighestGoodNetworkApp#1831

Copy link
Contributor

@Jingyii800 Jingyii800 left a comment

Choose a reason for hiding this comment

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

Hi, while trying to test this feature, I encountered a bug on this backend. Please check in this comment. OneCommunityGlobal/HighestGoodNetworkApp#1831 (review)

Copy link
Contributor

@chrischenlixing chrischenlixing left a comment

Choose a reason for hiding this comment

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

Check out frontend comment

Copy link

@MALAV1308 MALAV1308 left a comment

Choose a reason for hiding this comment

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

Hello, I got an error while reviewing your PR. Please refer this link. OneCommunityGlobal/HighestGoodNetworkApp#1831 (review)

Copy link

@brandta-1 brandta-1 left a comment

Choose a reason for hiding this comment

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

Review

see front-end review.

Co-authored-by: Nathan Hoffman <nathanahoffman@gmail.com>
@DiegoSalas27
Copy link
Contributor

Hi Jay,

I have been trying to run the backend but I am not able to do that. I get an error that breaks the backend project and it nevers runs. I have attached a video showcasing it.

Screen.Recording.2024-03-09.at.9.50.21.PM.mov

@rajnada
Copy link

rajnada commented Mar 19, 2024

Hii,

I am getting the Error after pulling this current branch.
704Er

Copy link

@hetvi11110 hetvi11110 left a comment

Choose a reason for hiding this comment

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

I am also encountering the same error when running the npm run build command. It seems to be a syntax error. Here is a reference screenshot.
image

Copy link
Contributor

@iven-yao iven-yao left a comment

Choose a reason for hiding this comment

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

unable to build, following is the error message:
image

Copy link

@Coops023 Coops023 left a comment

Choose a reason for hiding this comment

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

Hi, i got an error while trying to run the backend locally, find a screenshot attached.

Uploading error2.png…

Copy link

@Tiantian-C Tiantian-C left a comment

Choose a reason for hiding this comment

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

Hi,
I tried to run the backend code, but I came across some errors when I ran it.

Screenshot 2024-03-24 at 6 04 41 PM

Copy link

@SRamen1999 SRamen1999 left a comment

Choose a reason for hiding this comment

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

When running this backend PR I am encountering an error when running the npm run build command.

Screen Shot 2024-03-27 at 12 59 43 PM

@Gayathr-2012
Copy link

Hi
I checked out your branch and encountered an error. It appears there's a missing closing parenthesis. Please ensure the user profiles section is correctly closed. This PR has issue.

image image

Copy link
Contributor

@kylepham kylepham left a comment

Choose a reason for hiding this comment

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

There is a redundant open curly bracket in this PR. Removing it allows the code to build and run. There are also some variables being declared but not used.

);

if (!isRequestorAuthorized) {
const canEditTeamCode = req.body.requestor.role === 'Owner'
Copy link
Contributor

Choose a reason for hiding this comment

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

This variable is declared but not used?

Copy link

@Kavil-Jain-514 Kavil-Jain-514 left a comment

Choose a reason for hiding this comment

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

Facing errors when building the application
Steps: Checkout to the branch -> npm install -> npm run build
Error:
image

Copy link

@nyelmela nyelmela left a comment

Choose a reason for hiding this comment

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

I am encountering an issue when attempting to build the current branch. After performing npm install, running npm run build results in a BABEL_PARSE_ERROR related to an unexpected token in userProfileController.js at line 1052. I've attached the error screenshot.
image

Copy link

@Shadhrush5 Shadhrush5 left a comment

Choose a reason for hiding this comment

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

Hi, I reviewed the PR #704. Seems like I ran into an issue while building the current branch. I have attached a screenshot as well.

Screenshot 2024-07-26 at 10 38 04 AM

@souravwalke
Copy link

I tried reviewing the PR but was unable to deploy and got the following error on running the npm run build.

Screenshot 2024-08-03 at 9 25 39 PM

Copy link

@swaroop-2007 swaroop-2007 left a comment

Choose a reason for hiding this comment

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

Hi, I tried reviewing this PR but am experiencing problems while starting the server.
Please refer to the screenshot below:
Screenshot (399)

@crystallow1168
Copy link

@Alforoan,

I am having issues starting the backend's server. Refer to the image for the errors.
The steps I did:

  • I'm on node v14.17.6
  • npm install -> npm run build -> run into errors

image

@nishitag5 nishitag5 self-requested a review September 15, 2024 05:18
Copy link

@nishitag5 nishitag5 left a comment

Choose a reason for hiding this comment

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

After checking out these changes and running npm build command, I am getting the below error:
image

Copy link

@neeharikakoniki neeharikakoniki left a comment

Choose a reason for hiding this comment

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

Unable to build run
image

Copy link

@Muzammil603 Muzammil603 left a comment

Choose a reason for hiding this comment

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

image
Its not working

Copy link
Contributor

@mrinalini-raghavendran19 mrinalini-raghavendran19 left a comment

Choose a reason for hiding this comment

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

Hello!

The PR works mostly as expected - attached below is a recording of the same working.

I was able to login as an Owner and assign Toggle Request Bio permission to a volunteer user.

By logging in as a volunteer I was able to navigate to the Reports page -> weekly summaries section and use the toggle bar as expected.

Screen.Recording.2024-10-01.at.1.28.25.PM.mov

I do however have a few suggestions -

When I check into the backend branch, I face issues at build time. More specifically from the userProfileController.js.

There seems to be a redundant { in the code (snippet attached below for reference to anyone else facing the same issue):

if (!isRequestorAuthorized && !canToggleRequestBio) { // remove this brace { res.status(403).send('You are not authorized to update this user'); return; }

Screenshot 2024-10-01 at 1 30 32 PM

Great work!

Copy link

@Supriya1659 Supriya1659 left a comment

Choose a reason for hiding this comment

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

Got an error while testing this PR

image

@Deekshith010905
Copy link
Contributor

The dashboard page loaded, but multiple “Unexpected error” messages were displayed, and some values such as "Current Week" and "HGN Totals" showed as NaN or undefined. This suggests that required data is either not loading properly from the backend or is being parsed incorrectly on the frontend.
Screenshot 2025-07-09 140128

@one-community one-community changed the title Jay - Toggle Request Bio Permission Amalesh taking over for Jay - Toggle Request Bio Permission Oct 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.