Commit 214470ca authored by Tiago Botelho's avatar Tiago Botelho

Improves mirror force update button transparency

parent 310c1f12
......@@ -84,11 +84,18 @@ module EE
mirror? && self.mirror_last_update_at
end
def updating_mirror?
return false unless mirror? && !empty_repo?
return true if import_in_progress?
def mirror_with_content?
mirror? && !empty_repo
end
def scheduled_mirror?
enqueued = self.mirror_data.next_execution_timestamp < Time.now
self.mirror_data.next_execution_timestamp < Time.now
mirror_with_content? && import_scheduled? && enqueued
end
def updating_mirror?
mirror_with_content? && import_started?
end
def mirror_last_update_status
......
......@@ -7,7 +7,7 @@
= expanded ? 'Collapse' : 'Expand'
%p
Set up your project to automatically have its branches, tags, and commits
updated from an upstream repository every hour.
updated from an upstream repository.
= link_to 'Read more', help_page_path('workflow/repository_mirroring', anchor: 'pulling-from-a-remote-repository'), target: '_blank'
.settings-content.no-animate{ class: ('expanded' if expanded) }
= form_for @project, url: namespace_project_mirror_path(@project.namespace, @project) do |f|
......@@ -30,8 +30,6 @@
= f.check_box :mirror, class: "pull-left"
.prepend-left-20
= f.label :mirror, "Mirror repository", class: "label-light append-bottom-0"
%p.light.append-bottom-0
Automatically update this project's branches, tags, and commits from the upstream repository every hour.
.form-group
= f.label :import_url, "Git repository URL", class: "label-light"
= f.text_field :import_url, class: 'form-control', placeholder: 'https://username:password@gitlab.company.com/group/project.git'
......
- if @project.mirror? && can?(current_user, :push_code, @project)
.append-bottom-default
- if @project.updating_mirror?
- if @project.scheduled_mirror?
= icon("refresh spin")
Update Scheduled&hellip;
- elsif @project.updating_mirror?
%span.btn.disabled
= icon("refresh spin")
Updating&hellip;
......
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