ucsb-cs156-s21 / proj-ucsb-cs-las

https://proj-ucsb-cs-las.herokuapp.com/
MIT License
2 stars 3 forks source link

6pm-3 getting the delete button in tutorNotesForum to work #318

Closed Zwang1680 closed 3 years ago

Zwang1680 commented 3 years ago

In the TutorNotesTable.js component the delete button had no onClick and therefore had no functionality. In this PR, we add an event handler so that pressing the button causes that TutorNotes object to be deleted in the database. There are toasts that appear upon a successful delete or unsuccessful delete. The delete button will only render if you are an Admin.

github-actions[bot] commented 3 years ago

Nice PR! Your PR can be merged once you get an approving review from a staff member and a member of your team.

Keep in mind, code reviews only count if you use the "Approve" or "Request changes" option in GitHub. You can find this under the "Files changed" tab under the "Review changes" button.

PR review process

Generated by :no_entry_sign: dangerJS against 60d0af6904884e81374e00f357d29077d4ca56f3

codecov[bot] commented 3 years ago

Codecov Report

Merging #318 (60d0af6) into main (c1fbf77) will decrease coverage by 0.12%. The diff coverage is 62.50%.

Impacted file tree graph

@@             Coverage Diff              @@
##               main     #318      +/-   ##
============================================
- Coverage     99.69%   99.56%   -0.13%     
  Complexity      439      439              
============================================
  Files           107      107              
  Lines          2303     2316      +13     
  Branches        104      104              
============================================
+ Hits           2296     2306      +10     
- Misses            7       10       +3     
Impacted Files Coverage Δ
.../src/main/services/TutorNotes/TutorNotesService.js 100.00% <ø> (ø)
javascript/src/main/pages/TutorNotes/TutorNotes.js 85.71% <50.00%> (-14.29%) :arrow_down:
.../src/main/components/TutorNotes/TutorNotesTable.js 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update c1fbf77...60d0af6. Read the comment docs.

pconrad commented 3 years ago

To fix the test coverage problem with toasts, would involve writing code like this:

But we'll address that in a separate issue