-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix bug of subject admin page rewriting subject name as #249
Conversation
view/admin/utils/getFormData.js
Outdated
@@ -154,14 +179,15 @@ function getFormData(form, aspectRangeFormat, propertyMetaData) { | |||
if (aspectRangeFormat === 'BOOLEAN') { | |||
fromBooleanInput(inputs, jsonData); | |||
} else if (aspectRangeFormat === 'NUMERIC') { | |||
fromTextInput(inputs, jsonData, function(value) { | |||
fromTextInput(inputs, jsonData, (value) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fromTextInput(inputs, jsonData, (value) => parseFloat(value));
view/admin/utils/getFormData.js
Outdated
return parseFloat(value); | ||
}); | ||
} else if (aspectRangeFormat === 'PERCENT') { | ||
fromTextInput(inputs, jsonData, function(value) { | ||
return value/100; | ||
fromTextInput(inputs, jsonData, (value) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fromTextInput(inputs, jsonData, (value) => value / 100);
@@ -80,9 +85,19 @@ function fromTextInput(inputs, jsonData, alterDataFunc) { | |||
* @returns {Object} with keys to particular DOM elements | |||
*/ | |||
function getInputsAndSelects(form) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any way to add a test for this fix?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are ways but they are verbose to write and maintain. The crux of the method is node.contains, which is well-documented https://developer.mozilla.org/en-US/docs/Web/API/Node/contains
Demo app deployed to http://refocus-pr-249.herokuapp.com/subjects |
0670a36
to
beecc07
Compare
relatedLinks name