From 090a0a3244e7b6d05b031b96d6002736707ccb3f Mon Sep 17 00:00:00 2001 From: Ewoud Kohl van Wijngaarden Date: Fri, 5 Jul 2024 12:22:15 +0200 Subject: [PATCH] Drop SPECIAL_LINKS from documentation Since https://projects.theforeman.org/issues/32848 the registration link goes through the normal controller. --- app/controllers/concerns/documentation_controller_branding.rb | 4 +--- lib/foreman_theme_satellite/documentation.rb | 4 ---- lib/tasks/foreman_theme_satellite_tasks.rake | 1 - 3 files changed, 1 insertion(+), 8 deletions(-) diff --git a/app/controllers/concerns/documentation_controller_branding.rb b/app/controllers/concerns/documentation_controller_branding.rb index 33f3adf..4c780ef 100644 --- a/app/controllers/concerns/documentation_controller_branding.rb +++ b/app/controllers/concerns/documentation_controller_branding.rb @@ -15,9 +15,7 @@ def documentation_url(section = nil, options = {}) if (upstream_url =~ /redhat.com/) url = upstream_url else - special_links_pair = ForemanThemeSatellite::Documentation::SPECIAL_LINKS.find { |regex, _val| regex.match(upstream_url) } - url = special_links_pair[1] if special_links_pair - url = "#{ForemanThemeSatellite.documentation_root}/administering_red_hat_satellite" if url.empty? + url = "#{ForemanThemeSatellite.documentation_root}/administering_red_hat_satellite" end end url diff --git a/lib/foreman_theme_satellite/documentation.rb b/lib/foreman_theme_satellite/documentation.rb index b3241cd..6bff39d 100644 --- a/lib/foreman_theme_satellite/documentation.rb +++ b/lib/foreman_theme_satellite/documentation.rb @@ -77,10 +77,6 @@ module Documentation 'foreman_discovery' => "#{ForemanThemeSatellite.documentation_root}/provisioning_hosts/discovering-hosts-on-a-network_provisioning", }.freeze - SPECIAL_LINKS = [ - [/docs\.theforeman\.org\/.*?\/Managing_Hosts\/.*?registering-a-host.*?managing-hosts/i, "#{ForemanThemeSatellite.documentation_root}/managing_hosts/registering_hosts_to_server_managing-hosts#Registering_Hosts_by_Using_Global_Registration_managing-hosts"], - ] - DOCS_GUIDES_LINKS = { 'Managing_Hosts' => { 'registering-a-host_managing-hosts' => "#{ForemanThemeSatellite.documentation_root}/managing_hosts/registering_hosts_to_server_managing-hosts#Registering_Hosts_by_Using_Global_Registration_managing-hosts", diff --git a/lib/tasks/foreman_theme_satellite_tasks.rake b/lib/tasks/foreman_theme_satellite_tasks.rake index 68ae651..ecb78db 100644 --- a/lib/tasks/foreman_theme_satellite_tasks.rake +++ b/lib/tasks/foreman_theme_satellite_tasks.rake @@ -44,7 +44,6 @@ namespace :foreman_theme_satellite do all_links = ForemanThemeSatellite::Documentation::USER_GUIDE_DICTIONARY .merge(ForemanThemeSatellite::Documentation::PLUGINS_DOCUMENTATION) - .merge(Hash[ForemanThemeSatellite::Documentation::SPECIAL_LINKS]) .merge(ForemanThemeSatellite::Documentation.flat_docs_guides_links) failed = all_links.filter { |_key, doc_address| doc_address.include?('/html/') && !checker.test_link(doc_address) }