From 2bc37edc3f44c80f11e560689b09f098dcef5aa6 Mon Sep 17 00:00:00 2001 From: aviau Date: Wed, 20 May 2015 10:57:48 -0400 Subject: [PATCH] developmentConfig: New option to ignore server config Change-Id: If8357cc815abd53fd0667bf9539b4df3259f8434 --- app/components/authentication/authentication.js | 2 +- app/components/config/config.js | 4 ++-- app/components/config/developmentConfig.json | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/app/components/authentication/authentication.js b/app/components/authentication/authentication.js index 736160b..14d45b4 100644 --- a/app/components/authentication/authentication.js +++ b/app/components/authentication/authentication.js @@ -63,7 +63,7 @@ angular.module('bansho.authentication', []) session.create(data.access.token.id, data.access.token.expires); $http.defaults.headers.common['X-Auth-Token'] = session.sessionId; - configManager.fetchConfig().then(function () { + configManager.fetchConfig(configManager.getDevelopmentConfig().useStoredConfig).then(function () { $location.path('/view'); }, function (message) { throw new Error(message); diff --git a/app/components/config/config.js b/app/components/config/config.js index 4f5cbf6..d7442de 100644 --- a/app/components/config/config.js +++ b/app/components/config/config.js @@ -40,12 +40,12 @@ angular.module('bansho.config', []) return config.data; }; - this.fetchConfig = function () { + this.fetchConfig = function (useStoredConfig) { var responsePromise = $q.defer(); $http.get('surveil/v2/bansho/config') .success(function (conf) { - if (jQuery.isEmptyObject(conf)) { + if (!useStoredConfig || jQuery.isEmptyObject(conf)) { $http.get('components/config/config.json') .success(function (conf) { diff --git a/app/components/config/developmentConfig.json b/app/components/config/developmentConfig.json index c71ac72..bf1a652 100644 --- a/app/components/config/developmentConfig.json +++ b/app/components/config/developmentConfig.json @@ -1,5 +1,6 @@ { "env": "production", "username":"", - "password":"" + "password":"", + "useStoredConfig": true }