Change pVal comparsion to strict to fix checkboxes in fastcompare #6
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Again, this applies to
ndbi021, unsure about other branches.During the implementation of a new plugin to fastcompare, I have used the
ParameterType.BOOLfor some parameters of the algorithm. The problem is that in the current fastcompare template file, the following snippet of code "validates" the parameters.EasyStudy/server/plugins/fastcompare/templates/fastcompare_create.html
Lines 480 to 494 in ac6ac7e
In JavaScript, an unchecked checkbox results
let pVal = this.selectedAlgorithmsParameters[i][j].value;inpVal = false(which is correct), but then the validation fails here:result = result && pVal != null && pVal != '';aspval != ''returns the wrong value, becausefalseis a valid value for a checkbox (see the following image).So, what all of this means is that the study cannot be created and there is no actual error description and I had no idea what's wrong. This pull request makes the comparsion strict which fixes the checkboxes problem.
To be honest, I'm not sure which of the comparsions should be
!==instead of!=(resp.===vs==) in the entire file and if there are any similar issues. I don't have time to go through this, maybe using some linter would help.