From 301a980ebec344a387a520b07e0e7d6c6ddb04b4 Mon Sep 17 00:00:00 2001 From: Jatin Katyal Date: Tue, 21 Apr 2020 21:02:16 +0530 Subject: [PATCH 1/4] add: positive and negative weight editing support added --- app/pods/components/choice-editor/template.hbs | 16 ++++++++++++++++ config/environment.js | 4 ++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/app/pods/components/choice-editor/template.hbs b/app/pods/components/choice-editor/template.hbs index 2d683c6..6f9b818 100644 --- a/app/pods/components/choice-editor/template.hbs +++ b/app/pods/components/choice-editor/template.hbs @@ -25,6 +25,22 @@ {{markdown-to-html choice.description extensions='katex'}} +
+
+ Positive Weight: +
+
+ {{input type="number" class="input-text" placeholder="Positive Weight" value=choice.positiveWeight}} +
+
+
+
+ Negative Weight: +
+
+ {{input type="number" class="input-text" placeholder="Negative Weight" value=choice.negativeWeight}} +
+
{{else}}

{{choice.title}}

diff --git a/config/environment.js b/config/environment.js index 028fd61..f04f451 100644 --- a/config/environment.js +++ b/config/environment.js @@ -36,9 +36,9 @@ module.exports = function(environment) { // ENV.APP.LOG_VIEW_LOOKUPS = true; ENV.ONEAUTH = { clientID: "2636937167", - callbackURL: "http://localhost:4200/callback" + callbackURL: "http://test.troublemaker/callback" } - ENV.apiHost = 'http://localhost:8080' + ENV.apiHost = 'http://test.troublemakerbackend' ENV.sentry.development = true } From a05d023d147ae760f5dccd7dbac1c5086425b8a2 Mon Sep 17 00:00:00 2001 From: Jatin Katyal Date: Wed, 22 Apr 2020 19:28:12 +0530 Subject: [PATCH 2/4] score is now part of the question --- app/models/choice.js | 2 -- app/models/question.js | 2 ++ app/pods/components/question-editor/template.hbs | 16 ++++++++++++++++ 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/app/models/choice.js b/app/models/choice.js index 9454e50..b5e1dbb 100644 --- a/app/models/choice.js +++ b/app/models/choice.js @@ -3,7 +3,5 @@ import DS from "ember-data"; export default DS.Model.extend({ title: DS.attr(), description: DS.attr(), - positiveWeight: DS.attr(), - negativeWeight: DS.attr(), question: DS.belongsTo('question') }) \ No newline at end of file diff --git a/app/models/question.js b/app/models/question.js index d01ba7a..93d1bd9 100644 --- a/app/models/question.js +++ b/app/models/question.js @@ -4,6 +4,8 @@ export default DS.Model.extend({ title: DS.attr(), description: DS.attr(), difficulty: DS.attr(), + positiveScore: DS.attr(), + negativeScore: DS.attr(), user: DS.belongsTo('user'), choices: DS.hasMany('choice'), tags: DS.hasMany('tag') diff --git a/app/pods/components/question-editor/template.hbs b/app/pods/components/question-editor/template.hbs index 48a05dc..c7f8950 100644 --- a/app/pods/components/question-editor/template.hbs +++ b/app/pods/components/question-editor/template.hbs @@ -30,6 +30,22 @@ +

+
+ +
+
+ {{input type="number" class="input-text" value=question.positiveScore}} +
+ +
+ +
+
+ {{input type="number" class="input-text" value=question.negativeScore}} +
+
+ {{#unless question.isNew}}
From faabfd62eb914898e53fc32ecad5d957213fa1f6 Mon Sep 17 00:00:00 2001 From: Jatin Katyal Date: Wed, 22 Apr 2020 19:32:47 +0530 Subject: [PATCH 3/4] remove weights from choices --- app/pods/components/choice-editor/template.hbs | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/app/pods/components/choice-editor/template.hbs b/app/pods/components/choice-editor/template.hbs index 6f9b818..2d683c6 100644 --- a/app/pods/components/choice-editor/template.hbs +++ b/app/pods/components/choice-editor/template.hbs @@ -25,22 +25,6 @@ {{markdown-to-html choice.description extensions='katex'}}
-
-
- Positive Weight: -
-
- {{input type="number" class="input-text" placeholder="Positive Weight" value=choice.positiveWeight}} -
-
-
-
- Negative Weight: -
-
- {{input type="number" class="input-text" placeholder="Negative Weight" value=choice.negativeWeight}} -
-
{{else}}

{{choice.title}}

From 647ee8b63bb8710fe06b41fb84ab1e5f55119ddc Mon Sep 17 00:00:00 2001 From: Jatin Katyal Date: Wed, 22 Apr 2020 19:36:54 +0530 Subject: [PATCH 4/4] revert: custom environment --- config/environment.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/environment.js b/config/environment.js index f04f451..dd6b21b 100644 --- a/config/environment.js +++ b/config/environment.js @@ -36,9 +36,9 @@ module.exports = function(environment) { // ENV.APP.LOG_VIEW_LOOKUPS = true; ENV.ONEAUTH = { clientID: "2636937167", - callbackURL: "http://test.troublemaker/callback" + callbackURL: process.env.ONEAUTH_CALLBACK_URL || "http://localhost:4200/callback" } - ENV.apiHost = 'http://test.troublemakerbackend' + ENV.apiHost = process.env.API_HOST || 'http://localhost:8080' ENV.sentry.development = true }