From 677432d91535aee8cfa97a8c76a87a8802cbd8bf Mon Sep 17 00:00:00 2001 From: haaeriks Date: Tue, 3 May 2016 12:12:25 +0200 Subject: [PATCH 1/4] clearer colors for on/off toggles. Helps me who is color blind --- public/css/unleash.css | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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; From 2adbfa16969af8b64cd3f49341133caa5c9f29b5 Mon Sep 17 00:00:00 2001 From: haaeriks Date: Tue, 3 May 2016 12:12:37 +0200 Subject: [PATCH 2/4] ignore all idea files with .gitignore --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 04b43fe3af..7a328cb301 100644 --- a/.gitignore +++ b/.gitignore @@ -29,6 +29,6 @@ unleash-db.jar unleash-server.tar.gz # idea stuff: -*.iml +.idea/* .vagrant/ From 65c69369bae42a574c5bfd23a4c3336d68948a16 Mon Sep 17 00:00:00 2001 From: ivaosthu Date: Fri, 6 May 2016 09:39:37 +0200 Subject: [PATCH 3/4] upgrade knex --- .vscode/settings.json | 4 ++++ lib/dbPool.js | 5 ++++- package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 .vscode/settings.json 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/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", From 6cc28ede55bedd1b0a7a68ba36ff8db32214e60b Mon Sep 17 00:00:00 2001 From: ivaosthu Date: Fri, 6 May 2016 11:11:32 +0200 Subject: [PATCH 4/4] seems like knex 0.11 is more restrict about not using undefined --- lib/eventStore.js | 2 +- lib/featureDb.js | 6 +++--- lib/strategyDb.js | 2 +- test/specHelper.js | 3 ++- 4 files changed, 7 insertions(+), 6 deletions(-) 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/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",