[ARVADOS] updated: b0ec95277b9be2bcbe8e35008f490855a98cd70e

git at public.curoverse.com git at public.curoverse.com
Thu Apr 16 17:20:38 EDT 2015


Summary of changes:
 apps/workbench/app/assets/javascripts/pipeline_instances.js | 2 +-
 apps/workbench/app/helpers/application_helper.rb            | 8 ++++----
 apps/workbench/test/integration/anonymous_access_test.rb    | 9 ++++++---
 services/api/test/fixtures/pipeline_instances.yml           | 2 +-
 4 files changed, 12 insertions(+), 9 deletions(-)

       via  b0ec95277b9be2bcbe8e35008f490855a98cd70e (commit)
       via  d037508525b0e3c09a475e2ccfb5f7dd7f39f62d (commit)
      from  fc9a042a58627303ecfbda7660563fcfbe458ea5 (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 b0ec95277b9be2bcbe8e35008f490855a98cd70e
Author: Radhika Chippada <radhika at curoverse.com>
Date:   Thu Apr 16 17:18:59 2015 -0400

    5417: in case of a File dataclass with unreadable input and uneditable pipeline, the Run button should be disabled.

diff --git a/apps/workbench/app/helpers/application_helper.rb b/apps/workbench/app/helpers/application_helper.rb
index 923a366..c42028f 100644
--- a/apps/workbench/app/helpers/application_helper.rb
+++ b/apps/workbench/app/helpers/application_helper.rb
@@ -178,7 +178,7 @@ module ApplicationHelper
   end
 
   def link_to_arvados_object_if_readable(attrvalue, link_text_if_not_readable, opts={})
-    resource_class = resource_class_for_uuid(attrvalue)
+    resource_class = resource_class_for_uuid(attrvalue.split('/')[0]) if attrvalue
     if !resource_class
       return link_to_if_arvados_object attrvalue, opts
     end
@@ -197,14 +197,14 @@ module ApplicationHelper
   # Hence you can improve performance by first preloading objects
   # related to the page context before using this method.
   def object_readable attrvalue, resource_class=nil
+    # if it is a collection filename, check readable for the locator
+    attrvalue = attrvalue.split('/')[0] if attrvalue
+
     resource_class = resource_class_for_uuid(attrvalue) if resource_class.nil?
     return if resource_class.nil?
 
     return_value = nil
     if resource_class.to_s == 'Collection'
-      # if it is a collection filename, check readable for the locator
-      attrvalue = attrvalue.split('/')[0] if attrvalue
-
       if CollectionsHelper.match(attrvalue)
         found = collection_for_pdh(attrvalue)
         return_value = found.first if found.any?
diff --git a/apps/workbench/test/integration/anonymous_access_test.rb b/apps/workbench/test/integration/anonymous_access_test.rb
index 9f31ef9..d1aea71 100644
--- a/apps/workbench/test/integration/anonymous_access_test.rb
+++ b/apps/workbench/test/integration/anonymous_access_test.rb
@@ -248,6 +248,7 @@ class AnonymousAccessTest < ActionDispatch::IntegrationTest
     ['new_pipeline_in_publicly_accessible_project_but_other_objects_elsewhere', false, 'spectator'],
     ['new_pipeline_in_publicly_accessible_project_but_other_objects_elsewhere', true, 'admin'],
     ['new_pipeline_in_publicly_accessible_project_with_dataclass_file_and_other_objects_elsewhere', false, 'spectator'],
+    ['new_pipeline_in_publicly_accessible_project_with_dataclass_file_and_other_objects_elsewhere', true, 'admin'],
   ].each do |fixture, objects_readable, user=nil|
     test "access #{fixture} in public project with objects readable=#{objects_readable} with user #{user}" do
       object = api_fixture('pipeline_instances')[fixture]
@@ -274,14 +275,16 @@ class AnonymousAccessTest < ActionDispatch::IntegrationTest
         end
       else
         assert_no_text 'This pipeline was created from'  # template is not readable
-        assert_no_selector 'a', text: object['components']['foo']['script_parameters']['input']['value']
+        input = object['components']['foo']['script_parameters']['input']['value']
+        input = input.gsub('/', '\\/')
+        assert_no_selector 'a', text: input
         if user
           assert_text "One or more inputs provided are not readable"
-          assert_selector "input[type=text][value=#{object['components']['foo']['script_parameters']['input']['value']}]"
+          assert_selector "input[type=text][value=#{input}]"
           assert_selector 'a.disabled', text: 'Run'
         else
           assert_no_text "One or more inputs provided are not readable"
-          assert_text object['components']['foo']['script_parameters']['input']['value']
+          assert_text input
           assert_no_selector 'a', text: 'Run'
         end
       end
diff --git a/services/api/test/fixtures/pipeline_instances.yml b/services/api/test/fixtures/pipeline_instances.yml
index da41678..41eb044 100644
--- a/services/api/test/fixtures/pipeline_instances.yml
+++ b/services/api/test/fixtures/pipeline_instances.yml
@@ -353,7 +353,7 @@ new_pipeline_in_publicly_accessible_project_with_dataclass_file_and_other_object
         input:
           required: true
           dataclass: File
-          value: zzzzz-4zz18-bv31uwvy3neko21
+          value: zzzzz-4zz18-bv31uwvy3neko21/bar
 
 pipeline_in_running_state:
   name: running_with_job

commit d037508525b0e3c09a475e2ccfb5f7dd7f39f62d
Author: Radhika Chippada <radhika at curoverse.com>
Date:   Thu Apr 16 14:28:14 2015 -0400

    5417: revert unreadable-input check for links since no such case exists.

diff --git a/apps/workbench/app/assets/javascripts/pipeline_instances.js b/apps/workbench/app/assets/javascripts/pipeline_instances.js
index 9824400..8bb25c1 100644
--- a/apps/workbench/app/assets/javascripts/pipeline_instances.js
+++ b/apps/workbench/app/assets/javascripts/pipeline_instances.js
@@ -35,7 +35,7 @@ $(document).on('editable:success', function(event, tag, response, newValue) {
 $(document).on('ready ajax:complete', function() {
     $('a.editable.required').each(function() {
         var $tag = $(this);
-        if ($tag.hasClass("editable-empty") || $tag.hasClass("unreadable-input")) {
+        if ($tag.hasClass("editable-empty")) {
             $tag.parent().css("background-color", "#ffdddd");
             $tag.parent().prev().css("background-color", "#ffdddd");
         }

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list