[ARVADOS] updated: 5ef491be4c8a6b4f2bb0862dbb1eb00ba1e2388f

git at public.curoverse.com git at public.curoverse.com
Mon Apr 13 13:09:52 EDT 2015


Summary of changes:
 .../app/controllers/actions_controller.rb          | 26 +++++++++++++---------
 .../views/application/_title_and_buttons.html.erb  | 24 +++++++++++---------
 2 files changed, 29 insertions(+), 21 deletions(-)

       via  5ef491be4c8a6b4f2bb0862dbb1eb00ba1e2388f (commit)
       via  dec39dc89e7dc1f44a3c3f09bc52581316eca543 (commit)
      from  b1aa428167b50c40d64253a8faf4f0783759dca7 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit 5ef491be4c8a6b4f2bb0862dbb1eb00ba1e2388f
Author: Brett Smith <brett at curoverse.com>
Date:   Mon Apr 13 12:00:17 2015 -0400

    5614: Workbench shows error flash if combining collections fails to create provenance link.

diff --git a/apps/workbench/app/controllers/actions_controller.rb b/apps/workbench/app/controllers/actions_controller.rb
index d7e07fe..e6ef6eb 100644
--- a/apps/workbench/app/controllers/actions_controller.rb
+++ b/apps/workbench/app/controllers/actions_controller.rb
@@ -180,6 +180,7 @@ class ActionsController < ApplicationController
       manifest_text: new_coll.manifest_text,
       name: "Collection created at #{Time.now.localtime}",
     }
+    flash = {}
 
     # set owner_uuid to current project, provided it is writable
     action_data = Oj.load(params['action_data'] || "{}")
@@ -187,22 +188,27 @@ class ActionsController < ApplicationController
         current_project = Group.find?(action_data['current_project_uuid']) and
         current_project.writable_by.andand.include?(current_user.uuid)
       coll_attrs[:owner_uuid] = current_project.uuid
-      msg = "Created new collection in the project #{current_project.name}."
+      flash[:message] =
+        "Created new collection in the project #{current_project.name}."
     else
-      msg = "Created new collection in your Home project."
+      flash[:message] = "Created new collection in your Home project."
     end
 
     newc = Collection.create!(coll_attrs)
-    redirect_to newc, flash: {'message' => msg}
-
     source_paths.each_key do |src_uuid|
-      Link.create({
-                    tail_uuid: src_uuid,
-                    head_uuid: newc.uuid,
-                    link_class: "provenance",
-                    name: "provided",
-                  })
+      unless Link.create({
+                           tail_uuid: src_uuid,
+                           head_uuid: newc.uuid,
+                           link_class: "provenance",
+                           name: "provided",
+                         })
+        flash[:error] = "
+An error occurred when saving provenance information for this collection.
+You can try recreating the collection to get a copy with full provenance data."
+        break
+      end
     end
+    redirect_to(newc, flash: flash)
   end
 
   def report_issue_popup

commit dec39dc89e7dc1f44a3c3f09bc52581316eca543
Author: Brett Smith <brett at curoverse.com>
Date:   Mon Apr 13 11:59:51 2015 -0400

    5614: Workbench renders error flash separately from others.

diff --git a/apps/workbench/app/views/application/_title_and_buttons.html.erb b/apps/workbench/app/views/application/_title_and_buttons.html.erb
index 31ff2e6..398f248 100644
--- a/apps/workbench/app/views/application/_title_and_buttons.html.erb
+++ b/apps/workbench/app/views/application/_title_and_buttons.html.erb
@@ -52,15 +52,17 @@
   <% end %>
 <% end %>
 
-<%
-  # Display any flash messages in an alert. If there is any entry with "error" key, alert-danger is used.
-  flash_msg = ''
-  flash_msg_is_error = false
-  flash.each do |msg|
-    flash_msg_is_error ||= (msg[0]=='error')
-    flash_msg += ('<p class="contain-align-left">' + msg[1] + '</p>')
-  end
-  if flash_msg != ''
-%>
-<div class="flash-message alert <%= flash_msg_is_error ? 'alert-danger' : 'alert-warning' %>"><%=flash_msg.html_safe%></div>
+<% unless flash["error"].blank? %>
+<div class="flash-message alert alert-danger" role="alert">
+  <p class="contain-align-left"><%= flash["error"] %></p>
+</div>
+<% flash.delete("error") %>
+<% end %>
+
+<% unless flash.empty? %>
+<div class="flash-message alert alert-warning">
+  <% flash.each do |_, msg| %>
+  <p class="contain-align-left"><%= msg %></p>
+  <% end %>
+</div>
 <% end %>

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list