Wraps label count validation in function

This commit is contained in:
mabashian
2018-08-07 14:27:04 -04:00
parent eb8c1d2c78
commit c7466ce449
4 changed files with 158 additions and 141 deletions

View File

@@ -496,6 +496,7 @@
$state.transitionTo('templates'); $state.transitionTo('templates');
}; };
let handleLabelCount = () => {
/** /**
* This block of code specifically handles the client-side validation of the `labels` field. * This block of code specifically handles the client-side validation of the `labels` field.
* Due to it's detached nature in relation to the other job template fields, we must * Due to it's detached nature in relation to the other job template fields, we must
@@ -509,6 +510,7 @@
* by invalidating the field and inform the user of the error. * by invalidating the field and inform the user of the error.
*/ */
$scope.job_template_labels_isValid = true; $scope.job_template_labels_isValid = true;
const maxCount = 512; const maxCount = 512;
const jt_label_id = 'job_template_labels'; const jt_label_id = 'job_template_labels';
@@ -536,5 +538,8 @@
$scope.job_template_labels_isValid = true; $scope.job_template_labels_isValid = true;
} }
}); });
};
handleLabelCount();
} }
]; ];

View File

@@ -705,6 +705,7 @@ export default
$state.go('templates'); $state.go('templates');
}; };
let handleLabelCount = () => {
/** /**
* This block of code specifically handles the client-side validation of the `labels` field. * This block of code specifically handles the client-side validation of the `labels` field.
* Due to it's detached nature in relation to the other job template fields, we must * Due to it's detached nature in relation to the other job template fields, we must
@@ -745,5 +746,8 @@ export default
$scope.job_template_labels_isValid = true; $scope.job_template_labels_isValid = true;
} }
}); });
};
handleLabelCount();
} }
]; ];

View File

@@ -179,6 +179,7 @@ export default [
$state.transitionTo('templates'); $state.transitionTo('templates');
}; };
let handleLabelCount = () => {
/** /**
* This block of code specifically handles the client-side validation of the `labels` field. * This block of code specifically handles the client-side validation of the `labels` field.
* Due to it's detached nature in relation to the other job template fields, we must * Due to it's detached nature in relation to the other job template fields, we must
@@ -215,5 +216,8 @@ export default [
$scope.workflow_job_template_labels_isValid = true; $scope.workflow_job_template_labels_isValid = true;
} }
}); });
};
handleLabelCount();
} }
]; ];

View File

@@ -323,6 +323,7 @@ export default [
$scope.invalid_survey = false; $scope.invalid_survey = false;
}); });
let handleLabelCount = () => {
/** /**
* This block of code specifically handles the client-side validation of the `labels` field. * This block of code specifically handles the client-side validation of the `labels` field.
* Due to it's detached nature in relation to the other job template fields, we must * Due to it's detached nature in relation to the other job template fields, we must
@@ -359,5 +360,8 @@ export default [
$scope.workflow_job_template_labels_isValid = true; $scope.workflow_job_template_labels_isValid = true;
} }
}); });
};
handleLabelCount();
} }
]; ];