Skip to content

Commit

Permalink
Fix the bug: #204
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewtelnov committed Feb 9, 2017
1 parent 4949e7a commit d69beb1
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,4 @@ tmp/*
/bin
/obj
/web.config
/typings
3 changes: 3 additions & 0 deletions src/survey.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,9 @@ export class SurveyModel extends Base implements ISurvey, ISurveyTriggerOwner {
for (var key in data) {
this.valuesHash[key] = data[key];
this.checkTriggers(key, data[key], false);
if (!this.processedTextValues[key.toLowerCase()]) {
this.processedTextValues[key.toLowerCase()] = "value";
}
}
}
this.notifyAllQuestionsOnValueChanged();
Expand Down
3 changes: 3 additions & 0 deletions tests/surveytests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -558,6 +558,9 @@ QUnit.test("Serialize email validator", function (assert) {
});
QUnit.test("pre process title", function (assert) {
var survey = twoPageSimplestSurvey();
survey.data = { name: "John" };
survey.title = "Hello {name}";
assert.equal(survey.processedTitle, "Hello John", "process survey title correctly");
survey.pages[0].title = "Page {PageNo} from {PageCount}.";
assert.equal(survey.pages[0].processedTitle, "Page 1 from 2.");
survey.pages[0].addNewQuestion("text", "email");
Expand Down
8 changes: 8 additions & 0 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,14 @@ module.exports = function (options) {
rimraf.sync(packagePath + 'typings');
fs.createReadStream('./npmREADME.md').pipe(fs.createWriteStream(packagePath + 'README.md'));
}
//TODO someday need to remove
if (options.platform === "knockout") {
if (options.buildType === "prod") {
fs.rename('./packages/survey-knockout/survey.knockout.min.js', './packages/survey-knockout/survey.ko.min.js');
} else {
fs.rename('./packages/survey-knockout/survey.knockout.js', './packages/survey-knockout/survey.ko.js');
}
}
}
};

Expand Down

0 comments on commit d69beb1

Please sign in to comment.