Addressed observations
This commit is contained in:
parent
f68b3aaaad
commit
4f4060ab4c
|
@ -50,13 +50,13 @@ export default class ProtectedBranchCreate {
|
|||
const $branchInput = this.$form.find('input[name="protected_branch[name]"]');
|
||||
const $allowedToMergeInput = this.$form.find('input[name="protected_branch[merge_access_levels_attributes][0][access_level]"]');
|
||||
const $allowedToPushInput = this.$form.find('input[name="protected_branch[push_access_levels_attributes][0][access_level]"]');
|
||||
const completedForm = !($branchInput.val() && $allowedToMergeInput.length
|
||||
&& $allowedToPushInput.length);
|
||||
// Save previously used settings
|
||||
if (!completedForm) {
|
||||
this.savePreviousSelection($allowedToMergeInput.val(), $allowedToPushInput.val());
|
||||
}
|
||||
const completedForm = !(
|
||||
$branchInput.val() &&
|
||||
$allowedToMergeInput.length &&
|
||||
$allowedToPushInput.length
|
||||
);
|
||||
|
||||
this.savePreviousSelection($allowedToMergeInput.val(), $allowedToPushInput.val());
|
||||
this.$form.find('input[type="submit"]').attr('disabled', completedForm);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue