Skip to content

Commit

Permalink
ensure mml validation works as expected
Browse files Browse the repository at this point in the history
  • Loading branch information
alvarezmelissa87 committed Oct 5, 2020
1 parent c14e344 commit 2c7099a
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -425,13 +425,15 @@ const validateForm = (state: State): State => {
dependentVariable === '';

const mmlValidationResult = validateMml(estimatedModelMemoryLimit, modelMemoryLimit);
const mmlInvalid = mmlValidationResult !== null && mmlValidationResult.invalidUnits !== undefined;
const mmlInvalid =
mmlValidationResult !== null &&
(mmlValidationResult.invalidUnits !== undefined || mmlValidationResult.required === true);

state.form.modelMemoryLimitValidationResult = mmlValidationResult;

state.isValid =
!jobTypeEmpty &&
mmlInvalid &&
!mmlInvalid &&
!jobIdEmpty &&
jobIdValid &&
!jobIdExists &&
Expand Down

0 comments on commit 2c7099a

Please sign in to comment.