12479: Assign default vocabulary on model instantiation
authorLucas Di Pentima <ldipentima@veritasgenetics.com>
Mon, 18 Dec 2017 13:57:34 +0000 (10:57 -0300)
committerLucas Di Pentima <ldipentima@veritasgenetics.com>
Mon, 18 Dec 2017 13:57:34 +0000 (10:57 -0300)
Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <ldipentima@veritasgenetics.com>

apps/workbench/app/assets/javascripts/models/tags.js

index e98c4396b234e181b200286a6156c2594e810a27..ddf0728d7f93bca268f2f8e352db59bdb748d689 100644 (file)
@@ -13,16 +13,11 @@ window.Vocabulary = function(url) {
     var v = this
     Object.assign(v, {
         url: url,
-        data: {},
+        data: vocabulary, // Default vocabulary
         load: function() {
             // Load vocabulary from rails' public directory
             m.request(v.url.origin + '/vocabulary.json').then(function(resp) {
-                console.log('Vocabulary loaded')
                 v.data = resp
-            }).catch(function(err) {
-                // Not found, use a default vocabulary
-                console.log('Using default vocabulary')
-                v.data = vocabulary
             })
         },
         getDef: function(tagName) {