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 create profile picture selection for admin #1470

Closed

Conversation

Haoj1
Copy link
Contributor

@Haoj1 Haoj1 commented Oct 29, 2023

Description

image

Related PRS (if any):

This frontend PR is related to the #591 backend PR.

Main changes explained:

  • Update src/actions/userManagement.js and add a new column for owners to manage the profile pictures
  • Create src/actions/userManagement.js for admin to select proper profile picture that matches the user

How to test:

  1. check into current branch
  2. do npm install and npm run start:local to run this PR locally
  3. See backend how to setup #591, change the cronjob period
  4. log in as owner user
  5. go to other link→ user management → Profile Image →…
  6. Create a new user according to the name on https://www.onecommunityglobal.org/team/. If you cannot see your name on the site, feel free to create a new user with the following cases. Then wait for the cronjob execution
  7. Case 1: If the user already has a profile picture, the cronjob will skip and not overwrite the original picture. (You can paste an image URL into the "Profile Image" and click "add". Wait and see if cronjob will overwrite the picture)
  8. Case 2: If the user name is unique and there is no profile picture, the cronjob automatically assigns one
  9. Case 3: If the user name matches multiple images on the sites. For example, there is a person named Yifan Wang and another named Yi Wang, cronjob may not be able to tell the belongings of pictures. Owners in that case, could select the proper one from all possible pictures.

Screenshots or videos of changes:

Case1 & 2:

fetch.a.picture.if.do.not.have.one.mp4

Case 3:

handle.multiple.pictures.issues.mp4

Note:

URL is currently valid and available for the profile picture

@Haoj1 Haoj1 changed the title Haoji create profile picture selection by admin Haoji create profile picture selection for admin Oct 29, 2023
Copy link
Contributor

@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 @Haoj1, I tried running this PR locally but while running the FE server I encountered a "Failed to Compile" error:
image

I guess there is a typo in the below file/component name:

./src/components/UserManagement/UserManagement.jsx
Cannot find file: 'SelectProfilePicPopUp.jsx' does not match the corresponding name on disk: '.\src\components\UserManagement\SelectProfilePicPopup.jsx'.

Copy link
Contributor

@shubhankarval shubhankarval left a comment

Choose a reason for hiding this comment

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

Hey @Haoj1, I made the required changes you mentioned in backend PR. but I've encountered a error while running the Cronjob on the frontend.

Screenshot 2023-11-04 122635

Error text:
Failed to compile.
./src/components/UserManagement/UserManagement.jsx
Cannot find file: 'SelectProfilePicPopUp.jsx' does not match the corresponding name on disk: '.\src\components\UserManagement\SelectProfilePicPopup.jsx'.

Suggested Changes:
While importing the SelectProfilePicPopup.jsx into UserManagement.jsx, I think you've made a typo between "PopUp" and "Popup". Could you fix that? Thanks!

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.

4 participants