From 4ff33c0ee29e2298839bc7d367bedd39830ae76a Mon Sep 17 00:00:00 2001 From: Heiko Date: Tue, 6 Mar 2018 12:02:26 +0100 Subject: [PATCH] fixed wrong behaviour when updatating foxx repository was not successful (#4762) --- .../frontend/js/views/installServiceView.js | 19 +++++++++++++------ js/common/modules/@arangodb/foxx/store.js | 3 +-- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/js/apps/system/_admin/aardvark/APP/frontend/js/views/installServiceView.js b/js/apps/system/_admin/aardvark/APP/frontend/js/views/installServiceView.js index 67232071df..bf2605739c 100644 --- a/js/apps/system/_admin/aardvark/APP/frontend/js/views/installServiceView.js +++ b/js/apps/system/_admin/aardvark/APP/frontend/js/views/installServiceView.js @@ -6,6 +6,7 @@ window.ServiceInstallView = Backbone.View.extend({ el: '#content', readOnly: false, + foxxStoreRetry: 0, template: templateEngine.createTemplate('serviceInstallView.ejs'), @@ -31,11 +32,17 @@ } }, - waitForResponse: function () { + fetchStore: function () { var self = this; - window.setTimeout(function () { - self.render(); - }, 200); + this.foxxStoreRetry = 1; + this.collection.fetch({ + cache: false, + success: function () { + if (window.location.hash === '#services/install') { + self.render(); + } + } + }); }, search: function () { @@ -90,8 +97,8 @@ arangoHelper.buildServicesSubNav('Store'); this.breadcrumb(); - if (this.collection.length === 0) { - this.waitForResponse(); + if (this.collection.length === 0 && this.foxxStoreRetry === 0) { + this.fetchStore(); return; } diff --git a/js/common/modules/@arangodb/foxx/store.js b/js/common/modules/@arangodb/foxx/store.js index 24fab1c56d..f6b95d5053 100644 --- a/js/common/modules/@arangodb/foxx/store.js +++ b/js/common/modules/@arangodb/foxx/store.js @@ -160,8 +160,7 @@ var updateFishbowlFromZip = function (filename) { } }); - arangodb.printf('Updated local repository information with %d service(s)\n', - toSave.length); + require('console').log('Updated local foxx repository with ' + toSave.length + ' service(s)'); } } catch (err) { if (tempPath !== undefined && tempPath !== '') {