Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-03-30 18:07:51 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-03-30 18:07:51 +0300
commit4e9acbfba3682c552b3de707c535e6257ef41054 (patch)
tree8b1fd5f89ad3f1be68d8944815b13bb7d498e4a6 /app/assets/javascripts/mirrors
parent506d6dcd7c787ba71a8a53102f3d4fdb6adcfa5e (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/mirrors')
-rw-r--r--app/assets/javascripts/mirrors/mirror_repos.js13
1 files changed, 13 insertions, 0 deletions
diff --git a/app/assets/javascripts/mirrors/mirror_repos.js b/app/assets/javascripts/mirrors/mirror_repos.js
index e5acaaf9366..5401fb7b6ec 100644
--- a/app/assets/javascripts/mirrors/mirror_repos.js
+++ b/app/assets/javascripts/mirrors/mirror_repos.js
@@ -22,15 +22,18 @@ export default class MirrorRepos {
}
initMirrorPush() {
+ this.$keepDivergentRefsInput = $('.js-mirror-keep-divergent-refs', this.$form);
this.$passwordGroup = $('.js-password-group', this.$container);
this.$password = $('.js-password', this.$passwordGroup);
this.$authMethod = $('.js-auth-method', this.$form);
+ this.$keepDivergentRefsInput.on('change', () => this.updateKeepDivergentRefs());
this.$authMethod.on('change', () => this.togglePassword());
this.$password.on('input.updateUrl', () => this.debouncedUpdateUrl());
this.initMirrorSSH();
this.updateProtectedBranches();
+ this.updateKeepDivergentRefs();
}
initMirrorSSH() {
@@ -61,6 +64,16 @@ export default class MirrorRepos {
$('.js-mirror-protected-hidden', this.$form).val(val);
}
+ updateKeepDivergentRefs() {
+ const field = this.$keepDivergentRefsInput.get(0);
+
+ // This field only exists after the form is switched to 'Push' mode
+ if (field) {
+ const val = field.checked ? this.$keepDivergentRefsInput.val() : '0';
+ $('.js-mirror-keep-divergent-refs-hidden', this.$form).val(val);
+ }
+ }
+
registerUpdateListeners() {
this.debouncedUpdateUrl = debounce(() => this.updateUrl(), 200);
this.$urlInput.on('input', () => this.debouncedUpdateUrl());