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

Xiao F Create way for owner to edit & update ChatGPT prompt text #1510

Conversation

tsunami776
Copy link
Contributor

@tsunami776 tsunami776 commented Nov 10, 2023

Description

CleanShot 2023-11-10 at 11 19 59

Related PRS (if any):

To test this front-end PR you need to checkout the #603 back-end PR.

Main changes explained:

  • Update file src/components/WeeklySummary/CurrentPromptModal.jsx to get and update prompt with a fallback prompt if error occurs
  • Create and update multiple files for reducer function of get and update prompt

How to test:

  1. Check into current branch
  2. Do npm install and npm run start:local to run this PR locally
  3. Clearing cache/site data
  4. Log in as owner user
  5. Go to dashboard -> Summary -> View and Copy Current AI Prompt -> Edit prompt -> Save
  6. Check if prompt is updated
  7. Check if 'Copy Prompt' works as intended
  8. Log in as roles other than owner
  9. Go to dashboard -> Summary -> View and Copy Current AI Prompt -> Make sure 'Edit' does not appear

Screenshots or videos of changes:

AI.Prompt.Test.mp4

Note:

N/A

@tsunami776 tsunami776 marked this pull request as ready for review November 15, 2023 16:08
Copy link
Contributor

@Jiyuanxia Jiyuanxia left a comment

Choose a reason for hiding this comment

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

Hi @tsunami776 , I have reviewed your pull request and tested it. It works as you intended. Well done!

prompt is editable
Screenshot 2023-11-16 184932

successfully edited after refreshing
Screenshot 2023-11-16 185011

copy functions well
Screenshot 2023-11-16 185024

edit button disappear while logging as volunteer role
Screenshot 2023-11-16 185106

@this-journey
Copy link
Contributor

Just finished reviewing your changes and everything works as intended. See attached video.

PR.603.FE.mov

@DragonSlayer2401
Copy link
Contributor

I tested your PR on both an Owner and Volunteer account. On the owner account, the edit button appeared, and the edit functionality worked as intended. On the volunteer account, the edit button did not appear as intended. On both accounts, I was able to copy the prompt as intended. Please see the overview video for more details:

2023-12-02.10-44-54.mov

@ptrpengdev
Copy link
Contributor

Hi @tsunami776 , I tested your PR, and the code works as expected. Great job!

Login as Owner role:

  • Edit button is displayed
    1701563015409
  • Able to edit prompt
    1701563036861
  • Able to copy prompt
    1701563056846
  • Verify the Adminrole on the new prompt
    1701563079016

@ZichanYang324 ZichanYang324 self-requested a review December 7, 2023 19:19
ZichanYang324
ZichanYang324 previously approved these changes Dec 7, 2023
Copy link
Contributor

@ZichanYang324 ZichanYang324 left a comment

Choose a reason for hiding this comment

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

Hi @tsunami776

I have tested all the new features, and all of them worked as intended.
(1) When I log in as Owner, I can click on the edit prompt and change the current prompt.
(2) After saving the prompt, I can also use the copy function, no error occurred.
(3) When I log in as a Volunteer, I cannot edit the prompt, I only see the latest change for the prompt.
(4) the copy function worked very well for the volunteer role.

Here are the two videos for the test process.

Screen.Recording.2023-12-07.at.14.19.31.mov
Screen.Recording.2023-12-07.at.14.18.09.mov

Copy link
Contributor

@sucheta90 sucheta90 left a comment

Choose a reason for hiding this comment

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

Hi @tsunami776 I conducted tests on this PR both as the Owner and as a Volunteer. Upon my initial login and clicking the "View and Copy Current AI Prompt," I noticed that the default prompt was not displayed. However, I managed to rectify this by clicking the edit button and pasting the prompt into the box, successfully saving it. I believe it would be beneficial if the default prompt could be set in the initial state. This would allow users to easily copy the prompt in the case of a Volunteer, and Owners could then have the option to edit the prompt as needed.

PR1510+603_recording.mov

I don't see any issues other than the one mentioned earlier. Overall, the features are working as intended. Great job!

pika-chu11
pika-chu11 previously approved these changes Dec 9, 2023
Copy link

@pika-chu11 pika-chu11 left a comment

Choose a reason for hiding this comment

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

Hi @tsunami776 , I have tested your PR with different roles of account. The code works as intended that only the Owner have the permission to edit the ChatGPT prompt text while other account like Manager, Mentor, CoreTeam, Volunteer, and Admin cannot do that.
Great Job!
Check the video below for details:

PR.1510.mp4

Alforoan
Alforoan previously approved these changes Dec 16, 2023
Copy link
Contributor

@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.

It all seems to work as intended. Nice!

pr.review.1510.mp4

keyunhuangg
keyunhuangg previously approved these changes Dec 22, 2023
Copy link
Contributor

@keyunhuangg keyunhuangg left a comment

Choose a reason for hiding this comment

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

Everything works as it described.

  1. Logged in as owner, edit and save the current ai prompt.
Screenshot 2023-12-22 at 12 51 09 PM
  1. clicked the copy button and paste it onto the summary text box
Screenshot 2023-12-22 at 12 51 27 PM
  1. logged in as volunteer and the edit button is not present
Screenshot 2023-12-22 at 12 52 09 PM

ljrirene

This comment was marked as duplicate.

ljrirene
ljrirene previously approved these changes Dec 24, 2023
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.

Good job Xiaofei, everything works perfectly on my side.

Screen.Recording.2023-12-23.at.17.47.19.mov

@chappdev2019
Copy link
Member

Hi @tsunami776 , I have reviewed your pull request and tested it. It works as intended. Good Job!

  • Logged in as owner, edit and save the current ai prompt.

test1510_1

test1510_2

Logged in as volunteer, the edit button is not present and see the updated prompt

test1510

@one-community
Copy link
Member

Thank you all, moving to final review.

Copy link
Contributor

@cvtqx cvtqx left a comment

Choose a reason for hiding this comment

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

Tested this PR and everything works as described.

  1. Logged in as admin and I do not see Edit button:
    Admin

  2. Logged in as owner, I see the Edit button and am able to edit the prompt successfully:

owner.mov

@Haoxiang310
Copy link

Tested using both owner account and admin account.
Edited the prompt using owner account:
PR5-#1510(owner)
In the admin account, the prompt cannot be edited:
PR5-#1510(admin)

@one-community
Copy link
Member

Thank you all, merging!

@one-community one-community merged commit 58d7d73 into development Jan 6, 2024
1 check passed
@one-community
Copy link
Member

Thank you all, merging!

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.