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

Fixed UI and made UX improvements

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