mirror of
https://github.com/discourse/discourse.git
synced 2026-08-05 18:57:20 -05:00
DEV: adds rake task "rake themes:advanced_search_banner:migrate_all" (#35981)
Prefixes numbers to `themes:advanced_search_banner` rake task names to clarify their intended execution order: * `migrate_settings_to_welcome_banner` => `1_migrate_settings_to_welcome_banner` * `migrate_translations_to_welcome_banner` => `2_migrate_translations_to_welcome_banner` * `exclude_and_disable` => `3_exclude_and_disable` Also adds a combined rake task `themes:advanced_search_banner:migrate_all` to run all three sequentially. The output will look like this: <img width="814" height="517" alt="migrate_all console output" src="https://github.com/user-attachments/assets/5452c038-7d5f-4ae3-a1d0-3b40bf2cb4e6" />
This commit is contained in:
@@ -4,8 +4,17 @@
|
||||
THEME_GIT_URL ||= "https://github.com/discourse/discourse-search-banner.git"
|
||||
REQUIRED_TRANSLATION_KEYS ||= %w[search_banner.headline search_banner.subhead]
|
||||
|
||||
desc "Run all Advanced Search Banner migration tasks"
|
||||
task "themes:advanced_search_banner:migrate_all" => %w[
|
||||
themes:advanced_search_banner:1_migrate_settings_to_welcome_banner
|
||||
themes:advanced_search_banner:2_migrate_translations_to_welcome_banner
|
||||
themes:advanced_search_banner:3_exclude_and_disable
|
||||
]
|
||||
|
||||
desc "Migrate settings from Advanced Search Banner to core welcome banner"
|
||||
task "themes:advanced_search_banner:migrate_settings_to_welcome_banner" => :environment do
|
||||
task "themes:advanced_search_banner:1_migrate_settings_to_welcome_banner" => :environment do
|
||||
puts "\n1. Migrating settings..."
|
||||
puts "------------------------"
|
||||
components = find_all_components([:theme_settings])
|
||||
|
||||
if components.empty?
|
||||
@@ -17,7 +26,9 @@ task "themes:advanced_search_banner:migrate_settings_to_welcome_banner" => :envi
|
||||
end
|
||||
|
||||
desc "Migrate translations from Advanced Search Banner to core welcome banner"
|
||||
task "themes:advanced_search_banner:migrate_translations_to_welcome_banner" => :environment do
|
||||
task "themes:advanced_search_banner:2_migrate_translations_to_welcome_banner" => :environment do
|
||||
puts "\n2. Migrating translations..."
|
||||
puts "----------------------------"
|
||||
components = find_all_components([:theme_translation_overrides])
|
||||
|
||||
if components.empty?
|
||||
@@ -29,7 +40,9 @@ task "themes:advanced_search_banner:migrate_translations_to_welcome_banner" => :
|
||||
end
|
||||
|
||||
desc "Exclude and disable Advanced Search Banner theme component"
|
||||
task "themes:advanced_search_banner:exclude_and_disable" => :environment do
|
||||
task "themes:advanced_search_banner:3_exclude_and_disable" => :environment do
|
||||
puts "\n3. Excluding and disabling..."
|
||||
puts "-----------------------------"
|
||||
components = find_all_components
|
||||
|
||||
if components.empty?
|
||||
|
||||
Reference in New Issue
Block a user