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

Luis fix user profile projects delay #596

Merged
merged 11 commits into from
May 2, 2024

Conversation

luisarevalo21
Copy link
Contributor

@luisarevalo21 luisarevalo21 commented Nov 6, 2023

Description

Screenshot 2023-11-05 at 7 42 52 PM

Related PRS (if any):

To test this backend PR you need to checkout development branch

Main changes explained:

On the backend I added a check to remove cache.
The issue was the backend was sending back old cache instead of clearing it when a project was added.
Hence it was sending old data.
The change occurs in ProjectController.js inside of the assignProjectToUsers() when mapping over each element cache is checked if so it removes it and adds the user.

How to test:

  1. check into current branch
  2. The frontend should be development, check into and runnpm install
  3. Note if you are getting the WBS error, you may need to pull the latest development branch
  4. Run on the backend npm run install, then build and run the server npm run build && npm run start
  5. log as admin user or owner account
  6. go to view-profile→ projects→ take note how many projects are there.
  7. Next go to other links → projects → select a project → add your current user that you are logged in as.
  8. Add the user then navigate to the view-profile→ projects→ and check if the project was added to the list of projects.
  9. Next click timelog check to see if the project is in the list of tasks.
  10. click "add tangible time entry"
  11. click on projects/task and see if the newly added project is inside of the drop down menu

Screenshots or videos of changes:

Screen.Recording.2023-11-05.at.7.09.11.PM.mov
Screen.Recording.2023-11-05.at.7.25.40.PM.mov

Updated video

Screen.Recording.2024-04-11.at.7.49.31.PM.mov

Note:

There was a front end branch but for some reason, it removed the projects.
Upon testing the development branch worked just fine. So, I may have adjusted the frontend which caused the issue.
However, checking ino the development branch then pull this backend, fixes everything.
There are a few errors that pop up on the frontend please disregard them as they are irrelevant to this PR.
Screenshot 2024-04-11 at 7 48 51 PM

Copy link

@malikjahanzaib malikjahanzaib left a comment

Choose a reason for hiding this comment

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

Hi @luisarevalo21, checkout my detailed review on FE PR #1496.

@Shuhua-L
Copy link
Contributor

Shuhua-L commented Nov 8, 2023

Hi @luisarevalo21, I left a detailed review on the FE PR.

@luisarevalo21
Copy link
Contributor Author

Hello @Shuhua-L and @malikjahanzaib
Please re-review this PR and view the changes.
Notable changes are, there is no longer a Frontend PR only this backend.
The instructions are the same.
I've also closed the front end branch

Thanks

@Shuhua-L
Copy link
Contributor

Hello @Shuhua-L and @malikjahanzaib Please re-review this PR and view the changes. Notable changes are, there is no longer a Frontend PR only this backend. The instructions are the same. I've also closed the front end branch

Thanks

Thanks for letting me know! Happy to review. However, there are a lot of formatting changes, making it a bit challenging for me to identify the actual modifications. Could you help by reducing some of those changes?

@luisarevalo21
Copy link
Contributor Author

Hello @Shuhua-L and @malikjahanzaib Please re-review this PR and view the changes. Notable changes are, there is no longer a Frontend PR only this backend. The instructions are the same. I've also closed the front end branch
Thanks

Thanks for letting me know! Happy to review. However, there are a lot of formatting changes, making it a bit challenging for me to identify the actual modifications. Could you help by reducing some of those changes?

Hello @Shuhua-L
Sorry for the delay.
The actual fix is inside controllers projectController.js inside the function assignProjectToUsers the code used to fixed the delay is line 182, where if there is cache for the user, it is removed, as this was causing the problem
See the screenshot for further details
Screenshot 2023-11-13 at 8 30 16 PM

Copy link

@Alforoan Alforoan left a comment

Choose a reason for hiding this comment

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

I got errors and was not able to start the server.

image

image

@one-community one-community added the High Priority - Please Review First This is an important PR we'd like to get merged as soon as possible label Feb 16, 2024
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

Verified on current frontend branch.

Video

00_add_project_front-end.mov

01_add_MongoDB

02_add_MongoDB_project

Copy link

@psharma1984 psharma1984 left a comment

Choose a reason for hiding this comment

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

@luisarevalo21 tested with the mentioned steps. The project shows up in the project list. Verified on current dev branch
Screencast from 02-20-2024 09:02:19 AM.webm

@XiaohanMeng XiaohanMeng self-requested a review February 21, 2024 22:44
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 attempted to test this PR using an admin account but encountered an issue when trying to assign a project to my account. After accessing the members section, I was unable to search for users, and a "404 not found" error was displayed. Please see the reference video.

PR596_error.mov

Copy link

@PratimaSingh02 PratimaSingh02 left a comment

Choose a reason for hiding this comment

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

Hi Luis, can we change the 2nd step where the commands are mentioned. After checking out into the current branch, it should be npm install first, then build and then run. As this might confuse the new developers.

Copy link

@PratimaSingh02 PratimaSingh02 left a comment

Choose a reason for hiding this comment

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

projects_delay.mp4

Hi, the project works as expected.
However, when I added my name from the list of users in a particular project, I could add it twice (once directly from the list and the next time from the search result of my name)
This happened without reloading the page.
(first I searched my name, as it took time to show the search result, I clicked "+" directly from the list, and my name got added. Then the search result appeared and I could click on "+" again. And my name got added twice.

I feel this is a React state issue that can be looked into.

Copy link
Contributor

@skaush21 skaush21 left a comment

Choose a reason for hiding this comment

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

Error when fetching members userId.

  • cleared cache
  • logged in using owner account
  • went to view-profile -> projects -> checked how many projects were there (3)
  • went to other links -> projects -> selected a project -> attempted to add user, unable to fetch user
    I took a look at the code and most of the changes seemed to be changes in formatting for readability. I noticed that there were quite a few problems related to the eslint formatting in src/helpers/userHelper.js, src/controllers/projectController.js and many more. However, these problems are unrelated to the issue with fetching the data.
error when fetching users eslint format issue

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 Luis, i have reviewed this PR however i get a 404 error when searching for users to add to a project.

Screenshot 2024-03-08 at 21 07 47

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 have reviewed this PR as mentioned here, and it is working as expected. Here is the reference video.

PR.596.mp4

@luisarevalo21 luisarevalo21 added the Do Not Review Do not review or look at code without full context label Mar 23, 2024
@luisarevalo21 luisarevalo21 removed the Do Not Review Do not review or look at code without full context label Apr 12, 2024
Copy link

@jennZhang93 jennZhang93 left a comment

Choose a reason for hiding this comment

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

Tested with owner account. Described features are working. Good work

The only thing is that during adding my current user to a project, I used the search bar at the top to search for my username. But it wouldn't return any search results (shown in video). I need to display all users and use ctrl+F to find my username. Not sure if this is within the scope of the PR but would like to point that out.

pr4.mov

@one-community one-community added Do Not Review Do not review or look at code without full context and removed High Priority - Please Review First This is an important PR we'd like to get merged as soon as possible labels Apr 29, 2024
@one-community one-community dismissed stale reviews from skaush21, PratimaSingh02, and XiaohanMeng May 2, 2024 18:34

Luis said suggestions have been addressed

@one-community one-community merged commit 5adcae8 into development May 2, 2024
3 checks passed
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.