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

[#3316] Allow for editing volunteer notes #3345

Merged

Conversation

rhian-cs
Copy link
Contributor

@rhian-cs rhian-cs commented Apr 6, 2022

What github issue is this PR for, if any?

Resolves #3316

What changed, and why?

  • Supervisors and admins are now able to edit existing notes in volunteers edit page

How will this affect user permissions?

  • Volunteer permissions: Nothing changed.
  • Supervisor permissions: Supervisors can now change existing notes in volunteers edit page
  • Admin permissions: Same as supervisors

How is this tested? (please write tests!) 💖💪

  • Unit tests
  • Feature tests
  • Manual testing
    • Log in as supervisor
    • Go to a volunteer edit page
    • Select a volunteer note and click on "Edit"
    • Edit the note
    • Click "Update note"
    • Check if the note has been updated

Screenshots please :)

Before editing the note:
image

Note edit page:
localhost_3000_volunteers_6_notes_1_edit

Updated note:
image

@github-actions github-actions bot added erb ruby Pull requests that update Ruby code Tests! 🎉💖👏 labels Apr 6, 2022
@rhian-cs rhian-cs force-pushed the 3316-allow-editing-volunteer-note branch from d448115 to cbfda05 Compare April 6, 2022 16:43
Comment on lines +10 to +11
def edit
end
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think it's not necessary, rails will search for the view based on the controller's name

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think rails does need the empty method, but there should be a test that fails if it is removed

volunteer = Volunteer.find(params[:volunteer_id])
volunteer.notes.create(note_params)
redirect_to edit_volunteer_path(volunteer)
@volunteer.notes.create(note_params)
Copy link
Collaborator

Choose a reason for hiding this comment

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

We are missing an authorize somewhere but that may be covered in a different ticket

Copy link
Collaborator

@compwron compwron left a comment

Choose a reason for hiding this comment

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

Yay tests! :)

@compwron compwron merged commit 6654c62 into rubyforgood:main Apr 6, 2022
@rhian-cs rhian-cs deleted the 3316-allow-editing-volunteer-note branch April 6, 2022 17:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
erb ruby Pull requests that update Ruby code Tests! 🎉💖👏
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make Notes on Volunteers Editable
3 participants