11454: Replace link buttons with form buttons on search results,
authorLucas Di Pentima <ldipentima@veritasgenetics.com>
Thu, 8 Feb 2018 21:49:48 +0000 (18:49 -0300)
committerLucas Di Pentima <ldipentima@veritasgenetics.com>
Thu, 8 Feb 2018 21:49:48 +0000 (18:49 -0300)
so that embedded api tokens aren't shared accidentally.

Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <ldipentima@veritasgenetics.com>

apps/workbench/app/assets/javascripts/components/search.js

index 51d352ab829b065c8ec932c10eff498262b40f1a..f854411455888e57d5f3e4b184789be92fc17676 100644 (file)
@@ -60,9 +60,16 @@ window.SearchResultsTable = {
                         tokenParam = '?api_token='+session.token
                     }
                     return m('tr', [
-                        m('td', [
+                        m('td', m('form', {
+                            onsubmit: function() {
+                                return false;
+                            }
+                        }, [
                             item.workbenchBaseURL() &&
-                                m('a.btn.btn-xs.btn-default', {
+                                m('button.btn.btn-xs.btn-default[type=submit]', {
+                                    onclick: m.withAttr('href', function(v) {
+                                        document.location = v;
+                                    }),
                                     'data-original-title': 'show '+item.objectType.description,
                                     'data-placement': 'top',
                                     'data-toggle': 'tooltip',
@@ -70,7 +77,7 @@ window.SearchResultsTable = {
                                     // Bootstrap's tooltip feature
                                     oncreate: function(vnode) { $(vnode.dom).tooltip() },
                                 }, iconsMap[item.objectType.wb_path]),
-                        ]),
+                        ])),
                         m('td.arvados-uuid', item.uuid),
                         m('td', item.name || '(unnamed)'),
                         m('td', m(LocalizedDateTime, {parse: item.modified_at})),