Commit 59ec9b1d authored by Gabriel Mazetto's avatar Gabriel Mazetto

Fixed UI and made UX improvements

parent d302da37
......@@ -20,7 +20,7 @@ module Geo
no_repository_resync
.and(no_repository_sync_failure)
.and(repository_verified)
).includes(project: :route)
).includes(project: :route).includes(project: { namespace: :route })
end
# Return any project registry which project is pending to update
......@@ -40,7 +40,7 @@ module Geo
.and(flagged_for_resync
.or(repository_pending_verification
.and(repository_without_verification_failure_before)))
).includes(project: :route)
).includes(project: :route).includes(project: { namespace: :route })
end
# Return any project registry which project has a failure
......@@ -55,7 +55,7 @@ module Geo
repository_sync_failed
.or(repository_verification_failed)
.or(repository_checksum_mismatch)
).includes(project: :route)
).includes(project: :route).includes(project: { namespace: :route })
end
# Return any project registry that has never been fully synced
......@@ -63,7 +63,9 @@ module Geo
# We don't include projects without a corresponding ProjectRegistry
# for performance reasons.
def never_synced_projects
Geo::ProjectRegistry.where(last_repository_successful_sync_at: nil).includes(project: :route)
Geo::ProjectRegistry.where(last_repository_successful_sync_at: nil)
.includes(project: :route)
.includes(project: { namespace: :route })
end
private
......
......@@ -3,7 +3,7 @@
.card-header{ id: "project-#{project_registry.project.id}-header" }
.d-flex
%strong.header-text-primary.flex-fill
= project_registry.project.full_name
= link_to project_registry.project.full_name, admin_namespace_project_path(project_registry.project.namespace, project_registry.project)
- if project_registry.candidate_for_redownload?
= link_to(force_redownload_admin_geo_project_path(project_registry), method: :post, class: 'btn btn-outline btn-sm mr-2') do
= s_('Geo|Redownload')
......@@ -25,20 +25,20 @@
- if project_registry.repository_retry_at
= distance_of_time_in_words(Time.now, project_registry.repository_retry_at)
- else
= s_('Geo|Never')
= s_('Geo|Waiting for scheduler')
.col-sm.project-status-container
.project-status-title.text-muted
= s_('Geo|Last sync attempt')
.project-status-content
- if project_registry.last_repository_synced_at
= distance_of_time_in_words(Time.now, project_registry.last_repository_synced_at)
= time_ago_with_tooltip(project_registry.last_repository_synced_at, placement: 'bottom')
- else
= s_('Geo|Never')
= s_('Geo|Waiting for scheduler')
.col-sm.project-status-container
.project-status-title.text-muted
= s_('Geo|Retry counts')
= s_('Geo|Retry count')
.project-status-content
= project_registry.repository_retry_count
= project_registry.repository_retry_count.nil? ? 0 : project_registry.repository_retry_count
.project-card-errors
.card-header.bg-transparent.border-bottom-0.border-top
......@@ -53,7 +53,7 @@
.collapse{ id: "project-errors-#{project_registry.project.id}",
'aria-labelledby' => "project-#{project_registry.project.id}-header" }
.card-body
.container
.container.project-container
%ul.unstyled-list.errors-list
- if project_registry.last_repository_sync_failure
%li.p-0.d-flex
......
- @registries.each do |project_registry|
.card.project-card.prepend-top-15
.card-header{ id: "project-#{project.id}-header" }
.card-header{ id: "project-#{project_registry.project.id}-header" }
.d-flex
%strong.header-text-primary.flex-fill
= project_registry.project.full_name
= link_to project_registry.project.full_name, admin_namespace_project_path(project_registry.project.namespace, project_registry.project)
.card-body
.container.project-container
......@@ -15,15 +15,15 @@
- if project_registry.repository_retry_at
= distance_of_time_in_words(Time.now, project_registry.repository_retry_at)
- else
= s_('Geo|Never')
= s_('Geo|Waiting for scheduler')
.col-sm.project-status-container
.project-status-title.text-muted
= s_('Geo|Last sync attempt')
.project-status-content
- if project_registry.last_repository_synced_at
= distance_of_time_in_words(Time.now, project_registry.last_repository_synced_at)
= time_ago_with_tooltip(project_registry.last_repository_synced_at, placement: 'bottom')
- else
= s_('Geo|Never')
= s_('Geo|Waiting for scheduler')
.col-sm.project-status-container
.project-status-title.text-muted
= s_('Geo|Retry counts')
......
......@@ -3,11 +3,13 @@
.card-header{ id: "project-#{project_registry.project.id}-header" }
.d-flex
%strong.header-text-primary.flex-fill
= project_registry.project.full_name
= link_to(recheck_admin_geo_project_path(project_registry), method: :post, class: 'btn btn-outline btn-sm mr-2') do
= s_('Geo|Recheck')
= link_to(resync_admin_geo_project_path(project_registry), method: :post, class: 'btn btn-outline-primary btn-sm') do
= s_('Geo|Resync')
= link_to project_registry.project.full_name, admin_namespace_project_path(project_registry.project.namespace, project_registry.project)
- unless project_registry.verification_pending?
= link_to(recheck_admin_geo_project_path(project_registry), method: :post, class: 'btn btn-outline btn-sm mr-2') do
= s_('Geo|Recheck')
- unless project_registry.resync_repository?
= link_to(resync_admin_geo_project_path(project_registry), method: :post, class: 'btn btn-outline-primary btn-sm') do
= s_('Geo|Resync')
.card-body
.container.project-container
......@@ -16,7 +18,12 @@
.project-status-title.text-muted
= s_('Geo|Status')
.project-status-content
= s_('Geo|Pending')
- if project_registry.resync_repository?
= s_('Geo|Pending synchronization')
- elsif project_registry.verification_pending?
= s_('Geo|Pending verification')
- else
= s_('Geo|Unknown state') # should never reach this state, unless we introduce new behavior
.col-sm.project-status-container
.project-status-title.text-muted
= s_('Geo|Next sync scheduled at')
......@@ -24,13 +31,13 @@
- if project_registry.repository_retry_at
= distance_of_time_in_words(Time.now, project_registry.repository_retry_at)
- else
= s_('Geo|Never')
= s_('Geo|Waiting for scheduler')
.col-sm.project-status-container
.project-status-title.text-muted
= s_('Geo|Last sync attempt')
.project-status-content
- if project_registry.last_repository_synced_at
= distance_of_time_in_words(Time.now, project_registry.last_repository_synced_at)
= time_ago_with_tooltip(project_registry.last_repository_synced_at, placement: 'bottom')
- else
= s_('Geo|Never')
.col-sm.d-sm-none.d-md-block
......
......@@ -3,7 +3,7 @@
.card-header{ id: "project-#{project_registry.project.id}-header" }
.d-flex
%strong.header-text-primary.flex-fill
= project_registry.project.full_name
= link_to project_registry.project.full_name, admin_namespace_project_path(project_registry.project.namespace, project_registry.project)
= link_to(recheck_admin_geo_project_path(project_registry), method: :post, class: 'btn btn-outline btn-sm mr-2') do
= s_('Geo|Recheck')
= link_to(resync_admin_geo_project_path(project_registry), method: :post, class: 'btn btn-outline-primary btn-sm') do
......@@ -22,15 +22,15 @@
= s_('Geo|Last successful sync')
.project-status-content
- if project_registry.last_repository_successful_sync_at
= distance_of_time_in_words(Time.now, project_registry.last_repository_successful_sync_at)
= time_ago_with_tooltip(project_registry.last_repository_successful_sync_at, placement: 'bottom')
- else
= s_('Geo|Never')
= s_('Geo|Never')
.col-sm.project-status-container
.project-status-title.text-muted
= s_('Geo|Last time verified')
.project-status-content
- if project_registry.last_repository_check_at
= distance_of_time_in_words(Time.now, project_registry.last_repository_check_at)
= time_ago_with_tooltip(project_registry.last_repository_check_at, placement: 'bottom')
- else
= s_('Geo|Never')
.col-sm.d-sm-none.d-md-block
......
......@@ -3268,6 +3268,12 @@ msgstr ""
msgid "Geo|Pending"
msgstr ""
msgid "Geo|Pending synchronization"
msgstr ""
msgid "Geo|Pending verification"
msgstr ""
msgid "Geo|Projects in certain groups"
msgstr ""
......@@ -3286,6 +3292,9 @@ msgstr ""
msgid "Geo|Resync"
msgstr ""
msgid "Geo|Retry count"
msgstr ""
msgid "Geo|Retry counts"
msgstr ""
......@@ -3304,12 +3313,18 @@ msgstr ""
msgid "Geo|Synchronization failed - %{error}"
msgstr ""
msgid "Geo|Unknown state"
msgstr ""
msgid "Geo|Verification capacity"
msgstr ""
msgid "Geo|Verification failed - %{error}"
msgstr ""
msgid "Geo|Waiting for scheduler"
msgstr ""
msgid "Geo|You need a different license to use Geo replication"
msgstr ""
......
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