[ARVADOS] updated: 1e54d655b91afae99816f47ac3b9283ae12ba4c2

git at public.curoverse.com git at public.curoverse.com
Fri Mar 13 15:18:12 EDT 2015


Summary of changes:
 apps/workbench/Gemfile                             |  2 +-
 apps/workbench/Gemfile.lock                        |  4 ++--
 .../app/assets/javascripts/application.js          |  3 +++
 .../app/assets/stylesheets/application.css.scss    | 10 ++++++++++
 .../application/_show_autoselect_text.html.erb     |  4 ++++
 .../collections/_show_source_summary.html.erb      |  4 ++++
 apps/workbench/app/views/collections/show.html.erb | 23 +++++++++++-----------
 sdk/ruby/lib/arvados/keep.rb                       |  5 +++++
 sdk/ruby/test/test_keep_manifest.rb                | 13 ++++++++++++
 9 files changed, 54 insertions(+), 14 deletions(-)
 create mode 100644 apps/workbench/app/views/application/_show_autoselect_text.html.erb

       via  1e54d655b91afae99816f47ac3b9283ae12ba4c2 (commit)
       via  71c4fdc3352ad5ca34c2f260fe43fa1150868a04 (commit)
       via  2f27d8fa4c8f10989d1066df4df9c8995ee755f5 (commit)
       via  1bda9759f558316f01894634504a4346085be24d (commit)
      from  a7f932428b30582f54ea26084813eb7b3e8f3251 (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 1e54d655b91afae99816f47ac3b9283ae12ba4c2
Author: Brett Smith <brett at curoverse.com>
Date:   Fri Mar 13 15:16:44 2015 -0400

    5034: Update Workbench Gemfile post-merge.
    
    Refs #5034.

diff --git a/apps/workbench/Gemfile b/apps/workbench/Gemfile
index 7747801..b51f674 100644
--- a/apps/workbench/Gemfile
+++ b/apps/workbench/Gemfile
@@ -1,7 +1,7 @@
 source 'https://rubygems.org'
 
 gem 'rails', '~> 4.1.0'
-gem 'arvados', '>= 0.1.20150310184329'
+gem 'arvados', '>= 0.1.20150313191637'
 
 gem 'sqlite3'
 
diff --git a/apps/workbench/Gemfile.lock b/apps/workbench/Gemfile.lock
index 266f9b7..19b2857 100644
--- a/apps/workbench/Gemfile.lock
+++ b/apps/workbench/Gemfile.lock
@@ -40,7 +40,7 @@ GEM
     andand (1.3.3)
     angularjs-rails (1.3.8)
     arel (5.0.1.20140414130214)
-    arvados (0.1.20150310184329)
+    arvados (0.1.20150313191637)
       activesupport (>= 3.2.13)
       andand (~> 1.3, >= 1.3.3)
       google-api-client (~> 0.6.3, >= 0.6.3)
@@ -258,7 +258,7 @@ DEPENDENCIES
   RedCloth
   andand
   angularjs-rails
-  arvados (>= 0.1.20150310184329)
+  arvados (>= 0.1.20150313191637)
   bootstrap-sass (~> 3.1.0)
   bootstrap-tab-history-rails
   bootstrap-x-editable-rails

commit 71c4fdc3352ad5ca34c2f260fe43fa1150868a04
Merge: a7f9324 2f27d8f
Author: Brett Smith <brett at curoverse.com>
Date:   Fri Mar 13 15:14:11 2015 -0400

    Merge branch '5034-workbench-collection-summary-wip'
    
    Closes #5027, #5034, #5452.


commit 2f27d8fa4c8f10989d1066df4df9c8995ee755f5
Author: Brett Smith <brett at curoverse.com>
Date:   Thu Mar 12 10:15:39 2015 -0400

    5034: Improve Workbench collection display.
    
    * Display the UUID, and make it auto-select for easy copying.
    * Do the same for the portable data hash, and call it the content
      address to emphasize that.
    * Display information about the collection's size on the show page and
      preview pane.  This relies on an updated Ruby SDK.
    * Clean up code that checks for a portable data hash in the UUID.
      That can't happen anymore thanks to the redirect/list display logic
      in the controller.

diff --git a/apps/workbench/Gemfile b/apps/workbench/Gemfile
index d3746a8..7747801 100644
--- a/apps/workbench/Gemfile
+++ b/apps/workbench/Gemfile
@@ -1,7 +1,7 @@
 source 'https://rubygems.org'
 
 gem 'rails', '~> 4.1.0'
-gem 'arvados', '>= 0.1.20150210011250'
+gem 'arvados', '>= 0.1.20150310184329'
 
 gem 'sqlite3'
 
diff --git a/apps/workbench/Gemfile.lock b/apps/workbench/Gemfile.lock
index 9a88697..266f9b7 100644
--- a/apps/workbench/Gemfile.lock
+++ b/apps/workbench/Gemfile.lock
@@ -40,7 +40,7 @@ GEM
     andand (1.3.3)
     angularjs-rails (1.3.8)
     arel (5.0.1.20140414130214)
-    arvados (0.1.20150210011250)
+    arvados (0.1.20150310184329)
       activesupport (>= 3.2.13)
       andand (~> 1.3, >= 1.3.3)
       google-api-client (~> 0.6.3, >= 0.6.3)
@@ -258,7 +258,7 @@ DEPENDENCIES
   RedCloth
   andand
   angularjs-rails
-  arvados (>= 0.1.20150210011250)
+  arvados (>= 0.1.20150310184329)
   bootstrap-sass (~> 3.1.0)
   bootstrap-tab-history-rails
   bootstrap-x-editable-rails
diff --git a/apps/workbench/app/assets/javascripts/application.js b/apps/workbench/app/assets/javascripts/application.js
index 63887b3..172ff87 100644
--- a/apps/workbench/app/assets/javascripts/application.js
+++ b/apps/workbench/app/assets/javascripts/application.js
@@ -129,6 +129,9 @@ jQuery(function($){
                     this.addClass('label-danger').fadeTo('fast', '1');
                 });
             return false;
+        }).
+        on('click focusin', 'input.select-on-focus', function(event) {
+            event.target.select();
         });
 
     $(document).
diff --git a/apps/workbench/app/assets/stylesheets/application.css.scss b/apps/workbench/app/assets/stylesheets/application.css.scss
index 710bc92..ec7eee4 100644
--- a/apps/workbench/app/assets/stylesheets/application.css.scss
+++ b/apps/workbench/app/assets/stylesheets/application.css.scss
@@ -93,6 +93,16 @@ form.small-form-margin {
 .nowrap {
     white-space: nowrap;
 }
+input.select-on-focus {
+    font-family: monospace;
+    background: inherit;
+    border: thin #ccc solid;
+    border-radius: .2em;
+    padding: .15em .5em;
+}
+input.select-on-focus:focus {
+    border-color: #9bf;
+}
 
 /* top nav */
 $top-nav-bg: #3c163d;
diff --git a/apps/workbench/app/views/application/_show_autoselect_text.html.erb b/apps/workbench/app/views/application/_show_autoselect_text.html.erb
new file mode 100644
index 0000000..e82b8c1
--- /dev/null
+++ b/apps/workbench/app/views/application/_show_autoselect_text.html.erb
@@ -0,0 +1,4 @@
+<%# Render local variable `text` so the entire text is automatically
+    selected when clicked or focused. %>
+<input class="select-on-focus <%= tagclass %>" type="text" readonly
+       size="<%= text.size %>" value="<%= text %>">
diff --git a/apps/workbench/app/views/collections/_show_source_summary.html.erb b/apps/workbench/app/views/collections/_show_source_summary.html.erb
index 592e802..3d8032b 100644
--- a/apps/workbench/app/views/collections/_show_source_summary.html.erb
+++ b/apps/workbench/app/views/collections/_show_source_summary.html.erb
@@ -1,3 +1,7 @@
+<p><i>Content size:</i><br />
+  <%= pluralize(@object.manifest.files_count, "file") %> totalling
+  <%= raw(human_readable_bytes_html(@object.manifest.files_size)) %></p>
+
 <% if not (@output_of.andand.any? or @log_of.andand.any?) %>
   <p><i>No source information available.</i></p>
 <% end %>
diff --git a/apps/workbench/app/views/collections/show.html.erb b/apps/workbench/app/views/collections/show.html.erb
index 75a7086..c6bad7d 100644
--- a/apps/workbench/app/views/collections/show.html.erb
+++ b/apps/workbench/app/views/collections/show.html.erb
@@ -3,15 +3,13 @@
     <div class="panel panel-info">
       <div class="panel-heading">
         <h3 class="panel-title">
-          <% if @name_link.nil? and @object.uuid.match /[0-9a-f]{32}/ %>
-            Content hash <%= @object.portable_data_hash %>
-          <% else %>
-            <%= if @object.respond_to? :name
-                  render_editable_attribute @object, :name
-                else
-                  @name_link.andand.name || @object.uuid
-                end %>
-            <% end %>
+          <%= if @object.respond_to? :name
+                render_editable_attribute @object, :name
+              elsif @name_link
+                @name_link.name
+              else
+                @object.uuid
+              end %>
         </h3>
       </div>
       <div class="panel-body">
@@ -19,8 +17,11 @@
           <%= render_editable_attribute @object, 'description', nil, { 'data-emptytext' => "(No description provided)", 'data-toggle' => 'manual' } %>
         </div>
         <img src="/favicon.ico" class="pull-right" alt="" style="opacity: 0.3"/>
-        <p><i>Content hash:</i><br />
-          <span class="arvados-uuid"><%= link_to @object.portable_data_hash, collection_path(@object.portable_data_hash) %></span>
+        <p><i>Collection UUID:</i><br />
+          <%= render partial: "show_autoselect_text", locals: {text: @object.uuid, tagclass: "arvados-uuid"} %>
+        </p>
+        <p><i>Content address:</i><br />
+          <%= render partial: "show_autoselect_text", locals: {text: @object.portable_data_hash, tagclass: "arvados-uuid"} %>
         </p>
         <%= render partial: "show_source_summary" %>
       </div>

commit 1bda9759f558316f01894634504a4346085be24d
Author: Brett Smith <brett at curoverse.com>
Date:   Tue Mar 10 14:43:29 2015 -0400

    5034: Add Keep::Manifest#files_size to Ruby SDK.

diff --git a/sdk/ruby/lib/arvados/keep.rb b/sdk/ruby/lib/arvados/keep.rb
index ede40c3..e4f6208 100644
--- a/sdk/ruby/lib/arvados/keep.rb
+++ b/sdk/ruby/lib/arvados/keep.rb
@@ -191,6 +191,11 @@ module Keep
       seen_files.size
     end
 
+    def files_size
+      # Return the total size of all files in this manifest.
+      files.reduce(0) { |total, (_, _, size)| total + size }
+    end
+
     def exact_file_count?(want_count)
       files_count(want_count + 1) == want_count
     end
diff --git a/sdk/ruby/test/test_keep_manifest.rb b/sdk/ruby/test/test_keep_manifest.rb
index 2ad0941..f1f1a53 100644
--- a/sdk/ruby/test/test_keep_manifest.rb
+++ b/sdk/ruby/test/test_keep_manifest.rb
@@ -58,6 +58,10 @@ class ManifestTest < Minitest::Test
     assert_equal(0, Keep::Manifest.new("").files_count)
   end
 
+  def test_empty_files_size
+    assert_equal(0, Keep::Manifest.new("").files_size)
+  end
+
   def test_empty_has_file?
     refute(Keep::Manifest.new("").has_file?(""))
   end
@@ -151,6 +155,15 @@ class ManifestTest < Minitest::Test
     refute(manifest.exact_file_count?(6), "+1 file count true")
   end
 
+  def test_files_size_multiblock
+    assert_equal(22, Keep::Manifest.new(MULTIBLOCK_FILE_MANIFEST).files_size)
+  end
+
+  def test_files_size_with_skipped_overlapping_data
+    manifest = Keep::Manifest.new(". #{random_block(9)} 3:3:f1 5:3:f2\n")
+    assert_equal(6, manifest.files_size)
+  end
+
   def test_has_file
     manifest = Keep::Manifest.new(MULTIBLOCK_FILE_MANIFEST)
     assert(manifest.has_file?("./repfile"), "one-arg repfile not found")

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list