14738: Fixes the double-slash usage on requests to prevent 301 from controller
[arvados.git] / apps / workbench / app / assets / javascripts / components / edit_tags.js
index 3389dd7289dfb2be0d6f50cb3fe1441cb537dd08..946344a2c41f19c70ecc7a665d69f453e53cd58d 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,16 +186,17 @@ 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)
         vnode.state.dirty.map(m.redraw)
-        vnode.state.objPath = '/arvados/v1/'+vnode.attrs.targetController+'/'+vnode.attrs.targetUuid
+        vnode.state.objPath = 'arvados/v1/'+vnode.attrs.targetController+'/'+vnode.attrs.targetUuid
         // Get tags
         vnode.state.sessionDB.request(
             vnode.state.sessionDB.loadLocal(),
-            '/arvados/v1/'+vnode.attrs.targetController,
+            'arvados/v1/'+vnode.attrs.targetController,
             {
                 data: {
                     filters: JSON.stringify([['uuid', '=', vnode.attrs.targetUuid]]),