From 09c3c25bf80459d1ba83799e42d080bbdcc7c321 Mon Sep 17 00:00:00 2001 From: Julianna Tetreault <32834804+juliannatetreault@users.noreply.github.com> Date: Tue, 18 Aug 2020 11:48:23 -0600 Subject: [PATCH] Add Options to "Invalidate" and "Mark as Valid" Vomit Reactions (#9769) [deploy] * Adds valid status to the feedback_message model and a spec to validate the status * Adds an unresolve button to resolved vomits in _abuse_reports.html.erb * Adds functions to update valid status in reaction_controller.js * Use invalidate in place of unresolve for unconfirming vomit button * Add option to reopen vomit reactions marked as invalid and invalidate resolved vomits - Adds a Reopen button under the invalid tab - Adds confirmedStatus JS to reaction_controller.js - Adds conditional to _abuse_reports.html.erb --- .../admin/controllers/reaction_controller.js | 4 ++++ .../feedback_messages/_abuse_reports.html.erb | 19 +++++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/app/javascript/admin/controllers/reaction_controller.js b/app/javascript/admin/controllers/reaction_controller.js index ca70ca65a..be2d68a2e 100644 --- a/app/javascript/admin/controllers/reaction_controller.js +++ b/app/javascript/admin/controllers/reaction_controller.js @@ -41,6 +41,10 @@ export default class ReactionController extends Controller { this.updateReaction(this.reactionId, this.invalidStatus); } + updateReactionConfirmed() { + this.updateReaction(this.reactionId, this.confirmedStatus); + } + reactableUserCheck() { if (this.reactableType === 'user') { // eslint-disable-next-line no-restricted-globals diff --git a/app/views/admin/feedback_messages/_abuse_reports.html.erb b/app/views/admin/feedback_messages/_abuse_reports.html.erb index bc1e9f127..8efed1296 100644 --- a/app/views/admin/feedback_messages/_abuse_reports.html.erb +++ b/app/views/admin/feedback_messages/_abuse_reports.html.erb @@ -73,6 +73,25 @@ INVALID <% end %> + <% if params[:status] == "Resolved" %> + + <% elsif params[:status] == "Invalid" %> + + <% end %>