3654: add selection dropdown to collections pages
[arvados.git] / apps / workbench / app / controllers / actions_controller.rb
index 377f930b58e83d03c4c6b15d4c459c8ce30788c0..7c68ce9f7bfa37c8a6eca526774dfa6b3b6dc9ff 100644 (file)
@@ -1,5 +1,8 @@
 class ActionsController < ApplicationController
 
+  skip_filter :require_thread_api_token, only: [:report_issue_popup, :report_issue]
+  skip_filter :check_user_agreements, only: [:report_issue_popup, :report_issue]
+
   @@exposed_actions = {}
   def self.expose_action method, &block
     @@exposed_actions[method] = true
@@ -161,7 +164,29 @@ class ActionsController < ApplicationController
       l.save!
     end
 
-    redirect_to controller: 'collections', action: :show, id: newc.uuid
+    if params["show_project"]
+      respond_to do |format|
+        format.js {render inline: "location.reload();" }
+      end
+    else
+      redirect_to controller: 'collections', action: :show, id: newc.uuid
+    end
+  end
+
+  def report_issue_popup
+    respond_to do |format|
+      format.js
+      format.html
+    end
+  end
+
+  def report_issue
+    logger.warn "report_issue: #{params.inspect}"
+
+    respond_to do |format|
+      IssueReporter.send_report(current_user, params).deliver
+      format.js {render nothing: true}
+    end
   end
 
 end