developmentConfig: New option to ignore server config

Change-Id: If8357cc815abd53fd0667bf9539b4df3259f8434
This commit is contained in:
aviau 2015-05-20 10:57:48 -04:00
parent 7e1d9c1260
commit 2bc37edc3f
3 changed files with 5 additions and 4 deletions

View File

@ -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);

View File

@ -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) {

View File

@ -1,5 +1,6 @@
{
"env": "production",
"username":"",
"password":""
"password":"",
"useStoredConfig": true
}