Resolving comments- Add Authentication Step validation
@@ -82,20 +82,20 @@ function validateAppCreation() {
}
});
- if (!scriptIsDirty) {
if(checkEmptyStep()){
- CARBON.showConfirmationDialog('Some authentication steps do not have authenticators added. Update anyway?',
- checkStepSubmit, null);
+ CARBON.showErrorDialog('Some authentication steps do not have authenticators. Add' +
+ ' missing authenticators or delete the empty step.',
+ null, null);
} else {
- submitFormWithDIsabledScript();
- }
+ if (!scriptIsDirty) {
+ submitFormWithDisabledScript();
} else {
var stepsInUI = getExecuteStepsInUI();
var stepsInScript = getExecuteStepsInScript();
if (stepsInUI.length < stepsInScript.length) {
CARBON.showConfirmationDialog('Total number of steps are smaller than that of the Script.',
- submitFormWithDIsabledScript, null);
+ submitFormWithDisabledScript, null);
} else if (stepsInUI.length > stepsInScript.length) {
CARBON.showConfirmationDialog('Total number of steps are greater than that of the Script.',
submitFormWithEnabledScript, null);
@@ -106,13 +106,13 @@ function validateAppCreation() {
if (errorCount > 0) {
CARBON.showConfirmationDialog('Save script with errors? (Script will not be evaluated and will only be' +
' saved)',
- submitFormWithDIsabledScript, null);
+ submitFormWithDisabledScript, null);
}
if (warnCount > 0) {
CARBON.showConfirmationDialog('Save script with warnings? (Script will be saved and evaluated)',
submitFormWithEnabledScript, null);
}
-
+ }
}
}
@@ -127,13 +127,7 @@ function checkEmptyStep() {
return isEmptyStep;
}
-function checkStepSubmit() {
- var stepElementWithAuth = $('.step_body .auth_table > tbody > tr');
- buildScriptString(stepElementWithAuth);
- submitFormWithDIsabledScript();
-}
-
-function submitFormWithDIsabledScript() {
+function submitFormWithDisabledScript() {
$("#enableScript").prop("checked", false);
$("#configure-auth-flow-form").submit();
}
