[ARVADOS] created: 1.1.0-68-g20dbebc
Git user
git at public.curoverse.com
Fri Oct 20 16:21:28 EDT 2017
at 20dbebcdd863589f47bce138418cfcacd5f32b2e (commit)
commit 20dbebcdd863589f47bce138418cfcacd5f32b2e
Author: Tom Clegg <tclegg at veritasgenetics.com>
Date: Sun Oct 15 01:06:48 2017 -0400
spike: client-side collection browser.
Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tclegg at veritasgenetics.com>
diff --git a/apps/workbench/app/assets/javascripts/components/collections.js b/apps/workbench/app/assets/javascripts/components/collections.js
index 33fca6c..3ffd8c2 100644
--- a/apps/workbench/app/assets/javascripts/components/collections.js
+++ b/apps/workbench/app/assets/javascripts/components/collections.js
@@ -171,3 +171,37 @@ window.CollectionsSearch = {
])
},
}
+
+window.CollectionBrowse = {
+ oninit: function(vnode) {
+ vnode.state.dirXML = m.stream()
+ m.request(vnode.attrs.keepWebUrl, {
+ method: 'PROPFIND',
+ headers: {
+ authorization: 'OAuth2 '+window.defaultSession.token,
+ },
+ extract: function(xhr) {
+ return xhr.responseXML
+ },
+ }).then(vnode.state.dirXML)
+ vnode.state.dirXML.map(function(x) { window.debugXML = x })
+ },
+ view: function(vnode) {
+ return m('div', [
+ m('ul', [
+ m('li', 'collection: ', vnode.attrs['collectionId']),
+ m('li', 'url: ', vnode.attrs['keepWebUrl']),
+ ]),
+ vnode.state.dirXML() && m('ul', [
+ Array.prototype.map.call(
+ vnode.state.dirXML().getElementsByTagNameNS(
+ vnode.state.dirXML().children[0].namespaceURI,
+ 'response'),
+ function(resp) {
+ return m('li', resp.children[0].innerHTML)
+ }
+ ),
+ ]),
+ ])
+ },
+}
diff --git a/apps/workbench/app/assets/javascripts/mithril_mount.js b/apps/workbench/app/assets/javascripts/mithril_mount.js
index f4689b5..7995ffe 100644
--- a/apps/workbench/app/assets/javascripts/mithril_mount.js
+++ b/apps/workbench/app/assets/javascripts/mithril_mount.js
@@ -4,6 +4,7 @@
$(document).on('ready arv:pane:loaded', function() {
$('[data-mount-mithril]').each(function() {
- m.mount(this, window[$(this).data('mount-mithril')])
+ var data = $(this).data()
+ m.mount(this, {view: function () {return m(window[data.mountMithril], data)}})
})
})
diff --git a/apps/workbench/app/controllers/collections_controller.rb b/apps/workbench/app/controllers/collections_controller.rb
index 779d95c..4ad84ee 100644
--- a/apps/workbench/app/controllers/collections_controller.rb
+++ b/apps/workbench/app/controllers/collections_controller.rb
@@ -24,7 +24,7 @@ class CollectionsController < ApplicationController
RELATION_LIMIT = 5
def show_pane_list
- panes = %w(Files Upload Tags Provenance_graph Used_by Advanced)
+ panes = %w(Browse Files Upload Tags Provenance_graph Used_by Advanced)
panes = panes - %w(Upload) unless (@object.editable? rescue false)
panes
end
@@ -169,6 +169,7 @@ class CollectionsController < ApplicationController
def show
return super if !@object
+ return super if params['tab_pane'] == 'Browse'
@logs = []
diff --git a/apps/workbench/app/views/collections/_show_browse.html.erb b/apps/workbench/app/views/collections/_show_browse.html.erb
new file mode 100644
index 0000000..2346da0
--- /dev/null
+++ b/apps/workbench/app/views/collections/_show_browse.html.erb
@@ -0,0 +1,5 @@
+<!-- Copyright (C) The Arvados Authors. All rights reserved.
+
+SPDX-License-Identifier: AGPL-3.0 -->
+
+<div data-mount-mithril="CollectionBrowse" data-collection-id="<%= @object.uuid %>" data-keep-web-url="<%=h(Rails.configuration.keep_web_download_url % {uuid_or_pdh: @object.uuid.gsub('+','-')})%>"></div>
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list