diff --git a/.gitignore b/.gitignore index 4797c840a2..f980b6b65a 100644 --- a/.gitignore +++ b/.gitignore @@ -29,7 +29,7 @@ unleash-db.jar unleash-server.tar.gz # idea stuff: -*.iml +.idea/* .vagrant/ diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000000..e1a0c21f0e --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,4 @@ +// Place your settings in this file to overwrite default and user settings. +{ + "files.autoSave": "onFocusChange" +} \ No newline at end of file diff --git a/lib/dbPool.js b/lib/dbPool.js index 2ef8ffc5a9..5c7cb0ff29 100644 --- a/lib/dbPool.js +++ b/lib/dbPool.js @@ -42,7 +42,10 @@ function createDbPool() { return knex({ client: 'pg', connection: isTestEnv() ? getTestDatabaseUrl() : getDatabaseUrl(), - pool: { min: 2, max: 20 } + pool: { + min: 2, + max: 20 + } }); } diff --git a/lib/eventStore.js b/lib/eventStore.js index f8e24072c0..67802c3cfa 100644 --- a/lib/eventStore.js +++ b/lib/eventStore.js @@ -10,7 +10,7 @@ util.inherits(EventStore, EventEmitter); EventStore.prototype.create = function (event) { var that = this; return eventDb.store(event).then(function() { - that.emit(event.type, event); + return that.emit(event.type, event); }); }; diff --git a/lib/featureDb.js b/lib/featureDb.js index 21b6d55bb4..28f51bd173 100644 --- a/lib/featureDb.js +++ b/lib/featureDb.js @@ -65,11 +65,11 @@ function rowToFeature(row) { function eventDataToRow(data) { return { name: data.name, - description: data.description, + description: data.description || '', enabled: data.enabled ? 1 : 0, archived: data.archived ? 1 :0, - strategy_name: data.strategy, // eslint-disable-line - parameters: data.parameters + strategy_name: data.strategy || 'default', // eslint-disable-line + parameters: data.parameters || {} }; } diff --git a/lib/strategyDb.js b/lib/strategyDb.js index daa7241a82..2972bdfae1 100644 --- a/lib/strategyDb.js +++ b/lib/strategyDb.js @@ -50,7 +50,7 @@ function eventDataToRow(data) { return { name: data.name, description: data.description, - parameters_template: data.parametersTemplate // eslint-disable-line + parameters_template: data.parametersTemplate || {} // eslint-disable-line }; } diff --git a/package.json b/package.json index ddb44211ff..af8e718853 100644 --- a/package.json +++ b/package.json @@ -49,7 +49,7 @@ "ini": "1.3.3", "jsx-loader": "0.12.2", "jsxhint": "0.13.2", - "knex": "^0.10.0", + "knex": "^0.11.0", "lodash": "^3.5.0", "log4js": "0.6.22", "moment": "^2.11.2", diff --git a/public/css/unleash.css b/public/css/unleash.css index 4d903cbfe5..87e3bc926e 100644 --- a/public/css/unleash.css +++ b/public/css/unleash.css @@ -1,7 +1,7 @@ .toggle-active { border: 1px solid black; display: inline-block; - background-color: #3B7908; + background-color: lawngreen; border-radius: 50%; width: 20px; height: 20px; @@ -9,7 +9,7 @@ .toggle-inactive { border: 1px solid black; display: inline-block; - background-color: #E7384A; + background-color: red; border-radius: 50%; width: 20px; height: 20px; diff --git a/test/specHelper.js b/test/specHelper.js index a7f23cf8fc..3f8f7552ca 100644 --- a/test/specHelper.js +++ b/test/specHelper.js @@ -15,7 +15,8 @@ function createStrategies() { return Promise.map([ { name: "default", - description: "Default on or off Strategy." + description: "Default on or off Strategy.", + parametersTemplate: {} }, { name: "usersWithEmail",