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

Haoji fetch profile images from team page and sending email for selecting correct images #608

Open
wants to merge 29 commits into
base: development
Choose a base branch
from

Conversation

Haoj1
Copy link
Contributor

@Haoj1 Haoj1 commented Nov 12, 2023

Description

image

Related PRS (if any):

To test this backend PR you need to checkout the #1531 frontend PR.
The main changes are based on the previous PR: #591.

Main changes explained:

  • Update package.json for Web Scraping tools
  • Update src/controllers/userProfileController.js for allowing url as a valid img source
  • Create a function updateProfilesPic in src/controllers/userProfileController.js for fetching the pictures from the sites
  • Update src/models/userProfile.js to allow temporarily store the possible pictures
  • Create an email sender for alerting the user if there are more than one possible imgs fetched by the cronjob

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. log as owner user

  4. Please change the cronjob interval in src/cronjobs/userProfileJobs.js, the following change allows cronjob to run every minute. You could make the interval longer appropriately for testing. If you forget to change this, cronjob would only run everyday 12:00am

image
  1. If you do not want to modify others' profiles during testing, you can add a search keyword in src/helpers/userHelper.js like the following. That could make sure cronjob only works on your own created users.
image
  1. See how to test in frontend
  2. do git restore . to undo the changes

Screenshots or videos of changes:

Note:

See frontend

@Haoj1 Haoj1 changed the title Haoji fetch profile images from team page and Haoji fetch profile images from team page and sending email for selecting correct images Nov 17, 2023
@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 Nov 17, 2023
@ptrpengdev
Copy link
Contributor

Tested with FE PR 1471. The PR worked as expected.

ljrirene

This comment was marked as duplicate.

Copy link

@ljrirene ljrirene left a comment

Choose a reason for hiding this comment

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

Hi Haoji, I got the same issue here. The permission list can't be scrolled down.

Screen.Recording.2023-12-09.at.03.19.44.mov

@Haoj1
Copy link
Contributor Author

Haoj1 commented Dec 11, 2023

1471

Hi @ljrirene I did not update the permission list in Frontend. Did you checkout into a different branch in FE? Thank you

Copy link

@Sophie-lei Sophie-lei left a comment

Choose a reason for hiding this comment

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

Hey! I tested this PR and left a comment in PR#1531. Please review.

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.

Hello, the backend console keeps showing "update picture" whenever I create a new user with the same name, but no photo gets added to the user profile. I have attached a video for your reference.

Screen.Recording.2024-02-02.at.1.44.35.PM.mov

Screenshot 2024-02-02 at 1 57 52 PM

@XiaohanMeng XiaohanMeng self-requested a review February 15, 2024 21:04
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 tested this PR and commented at FE project: OneCommunityGlobal/HighestGoodNetworkApp#1531

Copy link
Contributor

@DiegoSalas27 DiegoSalas27 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 made an inline comment in the userHelper.js file suggesting a code change to prevent non active users profile images being updated. Overall, great work!

screen-recording-2024-03-01-at-123007-pm_siO0U1qh.mp4

});

for (let profile of userProfiles) {
const { firstName, lastName, profilePic, isActive, email } = profile;
Copy link
Contributor

Choose a reason for hiding this comment

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

Consider using the isActive property, as it's not being used anywhere to prevent assigning a picture to an existing user that is not active. Eg:

if (!isActive) continue

@XiaohanMeng XiaohanMeng self-requested a review March 7, 2024 23:39
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 latest review here: OneCommunityGlobal/HighestGoodNetworkApp#1531 (review)

Copy link
Contributor

@DiegoSalas27 DiegoSalas27 left a comment

Choose a reason for hiding this comment

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

Awesome job!

Copy link

@ljrirene ljrirene left a comment

Choose a reason for hiding this comment

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

Hi Haoji, I tested case 1&2 here. I used Ivan Manzurov's name for the test. I also changed this line here:
image
Is there any problem with the way I tested? I didn't get the crawler‘s information in the backend terminal. Please refer to this video:
https://drive.google.com/file/d/1seFbVWXZLhTlTAq4Yn23GcEBgUFdJhEF/view?usp=sharing

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.

I left a review on the frontend PR. It seems to fetch multiple images despite unique combination of first and last name.

Also, is the email sending part of the requirements for this PR? I don't see it anywhere in the code and wonder if reviewers should set it up ourselves.

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 tested frontend and backend PR and left a comment on frontend PR. Please review there.

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