Commit a3d6fb20 authored by Luke Bennett's avatar Luke Bennett

Add push password handing to ce push pull

parent d66182c1
......@@ -16,12 +16,20 @@ export default class PushPull {
init() {
this.registerUpdateListeners();
this.initMirrorPush();
this.$table.on('click', '.js-delete-mirror', this.deleteMirror.bind(this));
}
updateUrl() {
$('.js-mirror-url-hidden', this.$form).val(this.$urlInput.val());
let val = this.$urlInput.val();
if (this.$password) {
const password = this.$password.val();
if (password) val = val.replace('@', `:${password}@`);
}
$('.js-mirror-url-hidden', this.$form).val(val);
}
updateProtectedBranches() {
......@@ -37,6 +45,11 @@ export default class PushPull {
this.$protectedBranchesInput.on('change', () => this.updateProtectedBranches());
}
initMirrorPush() {
this.$password = $('.js-password', this.$form);
this.$password.on('input.updateUrl', () => this.debouncedUpdateUrl());
}
deleteMirror(event, existingPayload) {
const $target = $(event.currentTarget);
let payload = existingPayload;
......
......@@ -26,17 +26,6 @@ export default class EEPushPull extends PushPull {
super.init();
}
updateUrl() {
let val = this.$urlInput.val();
if (this.$password) {
const password = this.$password.val();
if (password) val = val.replace('@', `:${password}@`);
}
$('.js-mirror-url-hidden', this.$form).val(val);
}
handleUpdate() {
return this.hideForm()
.then(() => {
......@@ -92,11 +81,6 @@ export default class EEPushPull extends PushPull {
this.initSelect2();
}
initMirrorPush() {
this.$password = $('.js-password', this.$form);
this.$password.on('input.updateUrl', () => this.debouncedUpdateUrl());
}
initSelect2() {
$('.js-mirror-user', this.$form).select2({
width: 'resolve',
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment