11454: Avoid instantiating new SessionDB before autoRedirectToHomeCluster()
[arvados.git] / apps / workbench / app / assets / javascripts / components / edit_tags.js
index 607e2151afdf13fd357f5933c3e69d372e1f3f4a..ac4d2df7b235f57851c80dae768d1da7fda3182f 100644 (file)
@@ -35,7 +35,9 @@ window.SelectOrAutocomplete = {
         vnode.state.awesomplete = new Awesomplete(vnode.dom, {
             list: vnode.attrs.options,
             minChars: 0,
+            maxItems: 1000000,
             autoFirst: true,
+            sort: false,
         })
         vnode.state.create = vnode.attrs.create
         vnode.state.options = vnode.attrs.options
@@ -184,7 +186,8 @@ window.TagEditorApp = {
         vnode.state.sessionDB = new SessionDB()
         // Get vocabulary
         vnode.state.vocabulary = m.stream({"strict":false, "tags":{}})
-        m.request('/vocabulary.json').then(vnode.state.vocabulary)
+        var vocabularyTimestamp = parseInt(Date.now() / 300000) // Bust cache every 5 minutes
+        m.request('/vocabulary.json?v=' + vocabularyTimestamp).then(vnode.state.vocabulary)
         vnode.state.editMode = vnode.attrs.targetEditable
         vnode.state.tags = []
         vnode.state.dirty = m.stream(false)
@@ -233,7 +236,8 @@ window.TagEditorApp = {
                     onclick: function(e) {
                         var tags = {}
                         vnode.state.tags.forEach(function(t) {
-                            if (t.name() != '' && t.value() != '') {
+                            // Only ignore tags with empty key
+                            if (t.name() != '') {
                                 tags[t.name()] = t.value()
                             }
                         })