Commit 3d2d1be2 authored by Luke Bennett's avatar Luke Bennett

Re-enable direction select if pull mirror is deleted

parent 4d216110
......@@ -108,7 +108,10 @@ export default class EEMirrorRepos extends MirrorRepos {
};
}
super.deleteMirror(event, payload);
return super.deleteMirror(event, payload)
.then(() => {
if (isPullMirror) this.$mirrorDirectionSelect.removeAttr('disabled');
});
}
removeRow($target) {
......
......@@ -2,14 +2,17 @@
- is_one_user_option = default_mirror_users.count == 1
- protocols = Gitlab::UrlSanitizer::ALLOWED_SCHEMES.join('|')
- can_push = can?(current_user, :admin_remote_mirror, @project)
- can_pull = can?(current_user, :admin_mirror, @project) && !@project.mirror
- can_pull = can?(current_user, :admin_mirror, @project)
- options = []
- options.push([_('Pull'), 'pull']) if can_pull
- options.push([_('Push'), 'push']) if can_push
- if can_pull
- has_existing_pull_mirror = can_pull && @project.mirror
- pull_addition_method = has_existing_pull_mirror ? options.method(:push) : options.method(:unshift)
- pull_addition_method.call([_('Pull'), 'pull']) if can_pull
.form-group
= label_tag :mirror_direction, _('Mirror direction'), class: 'label-light'
= select_tag :mirror_direction, options_for_select(options), class: 'form-control js-mirror-direction', disabled: options.count == 1
= select_tag :mirror_direction, options_for_select(options), class: 'form-control js-mirror-direction', disabled: (options.count == 1) || has_existing_pull_mirror
.js-form-insertion-point
......
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