diff --git a/ee/app/helpers/ee/geo_helper.rb b/ee/app/helpers/ee/geo_helper.rb index 882e5f8715445c70410be19e0b7a4e2e95d7bb30..51d92a9287c64e309e8635b77d7bbbe505a9246a 100644 --- a/ee/app/helpers/ee/geo_helper.rb +++ b/ee/app/helpers/ee/geo_helper.rb @@ -43,49 +43,6 @@ def selective_sync_types_json options.to_json end - def geo_registry_status(registry) - status_type = case registry.synchronization_state - when :synced then 'gl-text-green-500' - when :pending then 'gl-text-orange-500' - when :failed then 'gl-text-red-500' - else 'gl-text-gray-500' - end - - content_tag(:div, class: status_type, data: { testid: 'project-status-icon' }) do - icon = geo_registry_status_icon(registry) - text = geo_registry_status_text(registry) - - [icon, text].join(' ').html_safe - end - end - - def geo_registry_status_icon(registry) - sprite_icon(STATUS_ICON_NAMES_BY_STATE.fetch(registry.synchronization_state, 'status_notfound')) - end - - def geo_registry_status_text(registry) - case registry.synchronization_state - when :never - _('Never') - when :failed - _('Failed') - when :pending - if registry.pending_synchronization? - s_('Geo|Pending synchronization') - elsif registry.pending_verification? - s_('Geo|Pending verification') - else - # should never reach this state, unless we introduce new behavior - _('Unknown') - end - when :synced - _('Synced') - else - # should never reach this state, unless we introduce new behavior - _('Unknown') - end - end - def replicable_types enabled_replicator_classes.map do |replicator_class| { diff --git a/ee/app/models/geo/upload_registry.rb b/ee/app/models/geo/upload_registry.rb index 9f0b7d4ce6492f0c46305086cd4be304612160d7..2a715b19193150ee7b7a358b7fa74122e3bef5c0 100644 --- a/ee/app/models/geo/upload_registry.rb +++ b/ee/app/models/geo/upload_registry.rb @@ -48,17 +48,4 @@ def file def project return upload.model if upload&.model.is_a?(Project) end - - # Returns a synchronization state based on existing attribute values - # - # It takes into account things like if a successful replication has been done - # if there are pending actions or existing errors - # - # @return [Symbol] :synced, :never, or :failed - def synchronization_state - return :synced if success? - return :never if retry_count.nil? - - :failed - end end diff --git a/ee/spec/helpers/ee/geo_helper_spec.rb b/ee/spec/helpers/ee/geo_helper_spec.rb index 9efbedb0be6f8d860353ab0afa581e451a64d299..3115d0ac4a0c62a74ec5d9b5c50eba727de19a22 100644 --- a/ee/spec/helpers/ee/geo_helper_spec.rb +++ b/ee/spec/helpers/ee/geo_helper_spec.rb @@ -70,34 +70,6 @@ end end - describe '#geo_registry_status_text' do - where(:synchronization_state, :pending_synchronization, :pending_verification, :result) do - [ - [:never, false, false, 'Never'], - [:failed, false, false, 'Failed'], - [:pending, true, false, 'Pending synchronization'], - [:pending, false, true, 'Pending verification'], - [:pending, false, false, 'Unknown'], - [:synced, false, false, 'Synced'], - [:fake, false, false, 'Unknown'] - ] - end - - with_them do - let(:registry) do - Struct.new( - :synchronization_state, - :pending_synchronization?, - :pending_verification? - ).new(synchronization_state, pending_synchronization, pending_verification) - end - - it 'returns the correct result' do - expect(helper.geo_registry_status_text(registry)).to eq(result) - end - end - end - describe '#format_file_size_for_checksum' do context 'when file size is of even length' do it 'returns same file size string' do diff --git a/locale/gitlab.pot b/locale/gitlab.pot index 2c249a38de7c688ef69a040d655fb0626b3e4e6f..2a2f7c434b950ed04ccfc0408427082c740142de 100644 --- a/locale/gitlab.pot +++ b/locale/gitlab.pot @@ -22018,12 +22018,6 @@ msgstr "" msgid "Geo|Offline" msgstr "" -msgid "Geo|Pending synchronization" -msgstr "" - -msgid "Geo|Pending verification" -msgstr "" - msgid "Geo|Primary" msgstr ""