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

Yufei - Add a mouseover text edit button near 'Total Time' #454

Merged
merged 8 commits into from
Aug 4, 2023

Conversation

yufeiStella
Copy link
Contributor

@yufeiStella yufeiStella commented Jul 22, 2023

Description

Screen Shot 2023-07-21 at 16 31 39

Related PRS (if any):

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

Main changes explained:

  • Create new modal mouseoverText.js
  • Create new controller mouseoverTextController.js
  • Create new routes mouseoverTextRoute.js
  • Update startup/routes to add mouseoverText api

How to test:

  1. check into current branch
  2. do npm install and ... to run this PR locally
  3. log in as an owner user and verify that the mouseover text appears when you move your mouse over both 'Total Time' and the numbers on the Leaderboard. Some numbers are blue (indicating intangible hours logged), and some numbers are black. Mouseover text will appear on both types of numbers.
  4. Only the owner can see the edit button next to 'Total Time'. Click on it and enter the new text to update the mouseover text. Please note that it may take some time to respond, as shown in my screen recording.
  5. Wait a few seconds for a green pop-up box to appear, showing the message "Mouseover Text updated!" Then you will see the newly updated mouseover text when you move your mouse over both 'Total Time' and the numbers. If you don't immediately see the changes, just wait a few more seconds, as it may take some time for the updates to respond.
  6. Hard refresh the page to see the change is globally. The same thing is if you don't immediately see the changes, just wait a few more seconds, as it may take some time for the updates to respond.
  7. log in as any other role to verify the mouseoverText updates globally and they do not see the edit button.

Screenshots or videos of changes:

Log in as an owner:
Screen Shot 2023-07-21 at 19 43 12

Screen.Recording.2023-08-03.at.21.10.09.mov

Log in as any other user except owner:

Screen.Recording.2023-08-03.at.21.15.51.mov

Note:

Sometimes, you may need to wait for the page to respond and display the mouseover text. I encountered a similar situation as shown in my screenshot recording. When you move your mouse to another place where there should be mouseover text, you may experience the same situation. Just be patient and wait.

@n0vay
Copy link

n0vay commented Jul 22, 2023

How do I create a owner account?

Copy link
Contributor

@AuroraLovesWhales AuroraLovesWhales left a comment

Choose a reason for hiding this comment

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

Hi @yufeiStella. I have left my comment in the related frontend PR. The functionality is working as intended. Great job!

Copy link
Contributor

@shiva2096 shiva2096 left a comment

Choose a reason for hiding this comment

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

Hi @yufeiStella

Reviewed this PR with frontend PR 1030, working as expected .

@AnishPandita
Copy link

Hi @yufeiStella I can confirm it works as intended.

Screenshot 2023-07-24 at 5 25 36 PM Screenshot 2023-07-24 at 5 31 50 PM Screenshot 2023-07-24 at 5 33 07 PM

Copy link

@DavidC0126 DavidC0126 left a comment

Choose a reason for hiding this comment

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

Hi @yufeiStella,

Reviewed this PR with frontend PR#1030, working as expected.

Copy link
Contributor

@sxiong5 sxiong5 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 left a comment in HighestGoodNetworkApp#1030. The PR worked as expected.

Copy link

@veronicacheng2 veronicacheng2 left a comment

Choose a reason for hiding this comment

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

Hi @yufeiStella, I have tested together with the Frontend, and they are working as intended

When logged in as Owner, there will be a text edit button:
Logged in as Owner

Clicking the edit text button:
Edit mouseover text

Hovering to total time:
Hover onto total time

No edit text button when logged in as volunteer:
Logged in as Volunteer

@Shreyj14
Copy link

Hi @yufeiStella

Reviewed this PR with frontend PR 1030, working as expected .

@iTvX
Copy link

iTvX commented Jul 27, 2023

Tested with the front end, I have review on the front end.

I have checked your PR. The owner can change the text, and it looks good. But when I switch accounts (not the owner's account), I cannot see the text. It seems like it's not global.

256637192-cd5d1198-0e63-4f84-a35d-92400f833841.mp4

@mounica-dingari-by
Copy link

mounica-dingari-by commented Jul 28, 2023

Hi @yufeiStella , this feature works as expected, but the page is little slow . I'm not sure, if it's because this branch or not. I'm including the screenshots below.

Screenshot from 2023-07-28 00-52-39
Screenshot from 2023-07-28 00-52-43


return MouseoverText.findById(id, (error, mouseoverText) => {
if (error || mouseoverText === null) {
res.status(400).send('No mouseoverText found');
Copy link

Choose a reason for hiding this comment

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

400 means bad request, but in this case the error could be database error. I suggest use error 500.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you! I use error 500 now.

Copy link

@yurisokolovicz yurisokolovicz left a comment

Choose a reason for hiding this comment

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

Dear @yufeiStella,

The code looks good overall. I think making minor corrections in error handling could help in further debugging. Excellent work!


return MouseoverText.findById(id, (error, mouseoverText) => {
if (error || mouseoverText === null) {
res.status(400).send('No mouseoverText found');

Choose a reason for hiding this comment

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

For improving error handling, I think the error 404 code could be used, along with a more intuitive error message that could aid in debugging.

Example:

res.status(404).send('MouseoverText not found with the given ID' );

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated! @yurisokolovicz, could you please re-review the PR and approve it if you agree with it? Thank you

@yufeiStella
Copy link
Contributor Author

yufeiStella commented Aug 2, 2023

Tested with the front end, I have review on the front end.

I have checked your PR. The owner can change the text, and it looks good. But when I switch accounts (not the owner's account), I cannot see the text. It seems like it's not global.

256637192-cd5d1198-0e63-4f84-a35d-92400f833841.mp4

Hi @iTvX! It's all about slow loading but the change is global. For me, usually I just reload it again since it's too slow. You can also find that we are talking the problem in slack(code channel).
Screen Shot 2023-08-02 at 00 28 56

Copy link

@yurisokolovicz yurisokolovicz left a comment

Choose a reason for hiding this comment

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

Perfect!

@beblicarl
Copy link
Contributor

Tested, everything works as expected and the code is great!

@beblicarl beblicarl self-requested a review August 2, 2023 18:32
@one-community one-community merged commit 63321d7 into development Aug 4, 2023
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.