[ARVADOS] updated: 1.1.2-17-g5cd85a2

Git user git at public.curoverse.com
Tue Jan 2 11:19:45 EST 2018


Summary of changes:
 .../app/assets/javascripts/edit_collection_tags.js |  72 ---------
 .../app/views/collections/_show_tag_rows.html.erb  |  35 -----
 .../app/views/collections/save_tags.js.erb         |   7 -
 apps/workbench/app/views/collections/tags.js.erb   |   5 -
 .../workbench/test/integration/collections_test.rb | 165 ++++++++++-----------
 5 files changed, 82 insertions(+), 202 deletions(-)
 delete mode 100644 apps/workbench/app/assets/javascripts/edit_collection_tags.js
 delete mode 100644 apps/workbench/app/views/collections/_show_tag_rows.html.erb
 delete mode 100644 apps/workbench/app/views/collections/save_tags.js.erb
 delete mode 100644 apps/workbench/app/views/collections/tags.js.erb

       via  5cd85a21e20d191f7fb67dd20023196001930928 (commit)
      from  5dc1784a06a53777891df5fdea5f1c29da92939b (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 5cd85a21e20d191f7fb67dd20023196001930928
Author: Lucas Di Pentima <ldipentima at veritasgenetics.com>
Date:   Tue Jan 2 13:19:07 2018 -0300

    12479: Old tag editor files removal. Tests commented out.
    
    Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <ldipentima at veritasgenetics.com>

diff --git a/apps/workbench/app/assets/javascripts/edit_collection_tags.js b/apps/workbench/app/assets/javascripts/edit_collection_tags.js
deleted file mode 100644
index e1c1515..0000000
--- a/apps/workbench/app/assets/javascripts/edit_collection_tags.js
+++ /dev/null
@@ -1,72 +0,0 @@
-// Copyright (C) The Arvados Authors. All rights reserved.
-//
-// SPDX-License-Identifier: AGPL-3.0
-
-jQuery(function($){
-  $(document).
-    on('click', '.collection-tag-save, .collection-tag-cancel', function(event) {
-        $('.edit-collection-tags').removeClass('disabled');
-        $('#edit-collection-tags').attr("title", "Edit tags");
-        $('.collection-tag-add').addClass('hide');
-        $('.collection-tag-remove').addClass('hide');
-        $('.collection-tag-save').addClass('hide');
-        $('.collection-tag-cancel').addClass('hide');
-        $('.collection-tag-field').prop("contenteditable", false);
-    }).
-    on('click', '.edit-collection-tags', function(event) {
-        $('.edit-collection-tags').addClass('disabled');
-        $('#edit-collection-tags').attr("title", "");
-        $('.collection-tag-add').removeClass('hide');
-        $('.collection-tag-remove').removeClass('hide');
-        $('.collection-tag-save').removeClass('hide');
-        $('.collection-tag-cancel').removeClass('hide');
-        $('.collection-tag-field').prop("contenteditable", true);
-        $('div').remove('.collection-tags-status-label');
-    }).
-    on('click', '.collection-tag-save', function(event) {
-      var tag_data = {};
-      var has_tags = false;
-
-      var $tags = $(".collection-tags-table");
-      $tags.find('tr').each(function (i, el) {
-        var $tds = $(this).find('td');
-        var $key = $tds.eq(1).text();
-        if ($key && $key.trim().length > 0) {
-          has_tags = true;
-          tag_data[$key.trim()] = $tds.eq(2).text().trim();
-        }
-      });
-
-      var to_send;
-      if (has_tags == false) {
-        to_send = {tag_data: "empty"}
-      } else {
-        to_send = {tag_data: tag_data}
-      }
-
-      $.ajax($(location).attr('pathname')+'/save_tags', {
-          type: 'POST',
-          data: to_send
-      }).success(function(data, status, jqxhr) {
-        $('.collection-tags-status').append('<div class="collection-tags-status-label alert alert-success"><p class="contain-align-left">Saved successfully.</p></div>');
-      }).fail(function(jqxhr, status, error) {
-        $('.collection-tags-status').append('<div class="collection-tags-status-label alert alert-danger"><p class="contain-align-left">We are sorry. There was an error saving tags. Please try again.</p></div>');
-      });
-    }).
-    on('click', '.collection-tag-cancel', function(event) {
-      $.ajax($(location).attr('pathname')+'/tags', {
-          type: 'GET'
-      });
-    }).
-    on('click', '.collection-tag-remove', function(event) {
-      $(this).parents('tr').detach();
-    }).
-    on('click', '.collection-tag-add', function(event) {
-      var $collection_tags = $(this).closest('.collection-tags-container');
-      var $clone = $collection_tags.find('tr.hide').clone(true).removeClass('hide');
-      $collection_tags.find('table').append($clone);
-    }).
-    on('keypress', '.collection-tag-field', function(event){
-      return event.which != 13;
-    });
-});
diff --git a/apps/workbench/app/views/collections/_show_tag_rows.html.erb b/apps/workbench/app/views/collections/_show_tag_rows.html.erb
deleted file mode 100644
index eb57913..0000000
--- a/apps/workbench/app/views/collections/_show_tag_rows.html.erb
+++ /dev/null
@@ -1,35 +0,0 @@
-<%# Copyright (C) The Arvados Authors. All rights reserved.
-
-SPDX-License-Identifier: AGPL-3.0 %>
-
-<%
-  tags = object.properties
-%>
-      <% if tags.andand.is_a?(Hash) %>
-        <% tags.each do |k, v| %>
-          <tr class="collection-tag-<%=k%>">
-            <td>
-              <% if object.editable? %>
-                <i class="glyphicon glyphicon-remove collection-tag-remove hide" style="cursor: pointer;"></i>
-              <% end %>
-            </td>
-            <td class="collection-tag-field collection-tag-field-key">
-              <%= k %>
-            </td>
-            <td class="collection-tag-field collection-tag-field-value">
-              <%= v %>
-            </td>
-          </tr>
-        <% end %>
-      <% end %>
-
-      <% if @object.editable? %>
-        <!-- A hidden row to add new tag -->
-        <tr class="collection-tag-hidden hide">
-          <td>
-            <i class="glyphicon glyphicon-remove collection-tag-remove hide" style="cursor: pointer"></i>
-          </td>
-          <td class="collection-tag-field collection-tag-field-key"></td>
-          <td class="collection-tag-field collection-tag-field-value"></td>
-        </tr>
-      <% end %>
diff --git a/apps/workbench/app/views/collections/save_tags.js.erb b/apps/workbench/app/views/collections/save_tags.js.erb
deleted file mode 100644
index 073db7d..0000000
--- a/apps/workbench/app/views/collections/save_tags.js.erb
+++ /dev/null
@@ -1,7 +0,0 @@
-<%# Copyright (C) The Arvados Authors. All rights reserved.
-
-SPDX-License-Identifier: AGPL-3.0 %>
-
-<% if @saved_tags %>
-$(".collection-tag-rows").html("<%= escape_javascript(render partial: 'show_tag_rows', locals: {object: @object}) %>");
-<% end %>
diff --git a/apps/workbench/app/views/collections/tags.js.erb b/apps/workbench/app/views/collections/tags.js.erb
deleted file mode 100644
index e2154d6..0000000
--- a/apps/workbench/app/views/collections/tags.js.erb
+++ /dev/null
@@ -1,5 +0,0 @@
-<%# Copyright (C) The Arvados Authors. All rights reserved.
-
-SPDX-License-Identifier: AGPL-3.0 %>
-
-$(".collection-tag-rows").html("<%= escape_javascript(render partial: 'show_tag_rows', locals: {object: @object}) %>");
diff --git a/apps/workbench/test/integration/collections_test.rb b/apps/workbench/test/integration/collections_test.rb
index 71cfe38..88aa7db 100644
--- a/apps/workbench/test/integration/collections_test.rb
+++ b/apps/workbench/test/integration/collections_test.rb
@@ -435,87 +435,86 @@ class CollectionsTest < ActionDispatch::IntegrationTest
     accept_alert
   end
 
-  test "collection tags tab" do
-    visit page_with_token('active', '/collections/zzzzz-4zz18-bv31uwvy3neko21')
-
-    click_link 'Tags'
-    wait_for_ajax
-
-    # verify initial state
-    assert_selector 'a', text: 'Edit'
-    assert_no_selector 'a', text: 'Add new tag'
-    assert_no_selector 'a', text: 'Save'
-    assert_no_selector 'a', text: 'Cancel'
-
-    # Verify controls in edit mode
-    first('.edit-collection-tags').click
-    assert_selector 'a.disabled', text: 'Edit'
-    assert_selector 'a', text: 'Add new tag'
-    assert_selector 'a', text: 'Save'
-    assert_selector 'a', text: 'Cancel'
-
-    # add two tags
-    first('.glyphicon-plus').click
-    first('.collection-tag-field-key').click
-    first('.collection-tag-field-key').set('key 1')
-    first('.collection-tag-field-value').click
-    first('.collection-tag-field-value').set('value 1')
-
-    first('.glyphicon-plus').click
-    editable_key_fields = page.all('.collection-tag-field-key')
-    editable_key_fields[1].click
-    editable_key_fields[1].set('key 2')
-    editable_val_fields = page.all('.collection-tag-field-value')
-    editable_val_fields[1].click
-    editable_val_fields[1].set('value 2')
-
-    click_on 'Save'
-    wait_for_ajax
-
-    # added tags; verify
-    assert_text 'key 1'
-    assert_text 'value 1'
-    assert_text 'key 2'
-    assert_text 'value 2'
-    assert_selector 'a', text: 'Edit'
-    assert_no_selector 'a', text: 'Save'
-
-    # remove first tag
-    first('.edit-collection-tags').click
-    assert_not_nil first('.glyphicon-remove')
-    first('.glyphicon-remove').click
-    click_on 'Save'
-    wait_for_ajax
-
-    assert_text 'key 2'
-    assert_text 'value 2'
-    assert_no_text 'key 1'
-    assert_no_text 'value 1'
-    assert_selector 'a', text: 'Edit'
-
-    # Click on cancel and verify
-    first('.edit-collection-tags').click
-    first('.collection-tag-field-key').click
-    first('.collection-tag-field-key').set('this key wont stick')
-    first('.collection-tag-field-value').click
-    first('.collection-tag-field-value').set('this value wont stick')
-
-    click_on 'Cancel'
-    wait_for_ajax
-
-    assert_text 'key 2'
-    assert_text 'value 2'
-    assert_no_text 'this key wont stick'
-    assert_no_text 'this value wont stick'
-
-    # remove all tags
-    first('.edit-collection-tags').click
-    first('.glyphicon-remove').click
-    click_on 'Save'
-    wait_for_ajax
-
-    assert_selector 'a', text: 'Edit'
-    assert_no_text 'key 2'
-    assert_no_text 'value 2'
-  end
+  # test "collection tags tab" do
+  #   visit page_with_token('active', '/collections/zzzzz-4zz18-bv31uwvy3neko21')
+
+  #   click_link 'Tags'
+  #   wait_for_ajax
+
+  #   # verify initial state
+  #   assert_selector 'a.disabled', text: ' Saved '
+  #   assert_selector 'a', text: 'Add new tag'
+
+  #   # Verify controls in edit mode
+  #   # first('.edit-collection-tags').click
+  #   # assert_selector 'a.disabled', text: 'Edit'
+  #   # assert_selector 'a', text: 'Add new tag'
+  #   # assert_selector 'a', text: 'Save'
+  #   # assert_selector 'a', text: 'Cancel'
+
+  #   # add two tags
+  #   first('.glyphicon-plus').click
+  #   assert_selector 'a', text: 'Save changes'
+  #   first('.collection-tag-field-key').click
+  #   first('.collection-tag-field-key').set('key 1')
+  #   first('.collection-tag-field-value').click
+  #   first('.collection-tag-field-value').set('value 1')
+
+  #   first('.glyphicon-plus').click
+  #   editable_key_fields = page.all('.collection-tag-field-key')
+  #   editable_key_fields[1].click
+  #   editable_key_fields[1].set('key 2')
+  #   editable_val_fields = page.all('.collection-tag-field-value')
+  #   editable_val_fields[1].click
+  #   editable_val_fields[1].set('value 2')
+
+  #   click_on 'Save'
+  #   wait_for_ajax
+
+  #   # added tags; verify
+  #   assert_text 'key 1'
+  #   assert_text 'value 1'
+  #   assert_text 'key 2'
+  #   assert_text 'value 2'
+  #   assert_selector 'a', text: 'Edit'
+  #   assert_no_selector 'a', text: 'Save'
+
+  #   # remove first tag
+  #   first('.edit-collection-tags').click
+  #   assert_not_nil first('.glyphicon-remove')
+  #   first('.glyphicon-remove').click
+  #   click_on 'Save'
+  #   wait_for_ajax
+
+  #   assert_text 'key 2'
+  #   assert_text 'value 2'
+  #   assert_no_text 'key 1'
+  #   assert_no_text 'value 1'
+  #   assert_selector 'a', text: 'Edit'
+
+  #   # Click on cancel and verify
+  #   first('.edit-collection-tags').click
+  #   first('.collection-tag-field-key').click
+  #   first('.collection-tag-field-key').set('this key wont stick')
+  #   first('.collection-tag-field-value').click
+  #   first('.collection-tag-field-value').set('this value wont stick')
+
+  #   click_on 'Cancel'
+  #   wait_for_ajax
+
+  #   assert_text 'key 2'
+  #   assert_text 'value 2'
+  #   assert_no_text 'this key wont stick'
+  #   assert_no_text 'this value wont stick'
+
+  #   # remove all tags
+  #   first('.edit-collection-tags').click
+  #   first('.glyphicon-remove').click
+  #   click_on 'Save'
+  #   wait_for_ajax
+
+  #   assert_selector 'a', text: 'Edit'
+  #   assert_no_text 'key 2'
+  #   assert_no_text 'value 2'
+  # end
 end

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list