From 09edb0f8d929f12ea994b710712ec7ff73b8e8f2 Mon Sep 17 00:00:00 2001 From: Henriette Darge Date: Tue, 15 Oct 2024 08:39:40 +0200 Subject: [PATCH 1/2] Add migration to remove unused variables from database --- ...081341_remove_obsolete_design_variables.rb | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 db/migrate/20241015081341_remove_obsolete_design_variables.rb diff --git a/db/migrate/20241015081341_remove_obsolete_design_variables.rb b/db/migrate/20241015081341_remove_obsolete_design_variables.rb new file mode 100644 index 000000000000..641b7c1af75f --- /dev/null +++ b/db/migrate/20241015081341_remove_obsolete_design_variables.rb @@ -0,0 +1,21 @@ +class RemoveObsoleteDesignVariables < ActiveRecord::Migration[7.1] + OBSOLETE_COLOR_VARIABLES = %w( main-menu-font-color + main-menu-selected-font-color + main-menu-hover-font-color + main-menu-border-color + header-item-font-color + header-item-font-hover-color + header-border-bottom-color ).freeze + + class MigrationDesignColor < ApplicationRecord + self.table_name = "design_colors" + end + + def up + MigrationDesignColor.where(variable: OBSOLETE_COLOR_VARIABLES).delete_all + end + + def down + # This is not revertible + end +end From c9df8a26d9fb613095cb6839db054ad6849147a2 Mon Sep 17 00:00:00 2001 From: Henriette Darge Date: Tue, 15 Oct 2024 08:40:22 +0200 Subject: [PATCH 2/2] Remove references to unused variables in code --- config/locales/en.yml | 7 ------- .../custom_styles/color_themes.rb | 21 ------------------- 2 files changed, 28 deletions(-) diff --git a/config/locales/en.yml b/config/locales/en.yml index 81979583af5f..302f58edbfbd 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -48,16 +48,9 @@ en: accent-color: "Accent" header-bg-color: "Header background" header-item-bg-hover-color: "Header background on hover" - header-item-font-color: "Header font" - header-item-font-hover-color: "Header font on hover" - header-border-bottom-color: "Header border" main-menu-bg-color: "Main menu background" main-menu-bg-selected-background: "Main menu when selected" main-menu-bg-hover-background: "Main menu on hover" - main-menu-font-color: "Main menu font" - main-menu-selected-font-color: "Main menu font when selected" - main-menu-hover-font-color: "Main menu font on hover" - main-menu-border-color: "Main menu border" custom_colors: "Custom colors" customize: "Customize your OpenProject installation with your own logo and colors." enterprise_notice: "As a special 'Thank you!' for their financial contribution to develop OpenProject, this tiny add-on is only available for Enterprise edition support subscribers." diff --git a/lib/open_project/custom_styles/color_themes.rb b/lib/open_project/custom_styles/color_themes.rb index d5624ee35eb4..b550e312de35 100644 --- a/lib/open_project/custom_styles/color_themes.rb +++ b/lib/open_project/custom_styles/color_themes.rb @@ -48,16 +48,9 @@ module ColorThemes "accent-color" => ACCENT_COLOR, "header-bg-color" => "#1A67A3", "header-item-bg-hover-color" => "#175A8E", - "header-item-font-color" => "#FFFFFF", - "header-item-font-hover-color" => "#FFFFFF", - "header-border-bottom-color" => "", "main-menu-bg-color" => "#333739", "main-menu-bg-selected-background" => "#175A8E", "main-menu-bg-hover-background" => "#124E7C", - "main-menu-font-color" => "#FFFFFF", - "main-menu-hover-font-color" => "#FFFFFF", - "main-menu-selected-font-color" => "#FFFFFF", - "main-menu-border-color" => "#EAEAEA" } }, { @@ -67,16 +60,9 @@ module ColorThemes "accent-color" => ACCENT_COLOR, "header-bg-color" => "#FAFAFA", "header-item-bg-hover-color" => "#E1E1E1", - "header-item-font-color" => "#313131", - "header-item-font-hover-color" => "#313131", - "header-border-bottom-color" => "#E1E1E1", "main-menu-bg-color" => "#ECECEC", "main-menu-bg-selected-background" => "#A9A9A9", "main-menu-bg-hover-background" => "#FFFFFF", - "main-menu-font-color" => "#000000", - "main-menu-hover-font-color" => "#000000", - "main-menu-selected-font-color" => "#000000", - "main-menu-border-color" => "#EAEAEA" }, logo: "logo_openproject.png" }, @@ -87,16 +73,9 @@ module ColorThemes "accent-color" => ACCENT_COLOR, "header-bg-color" => "#05002C", "header-item-bg-hover-color" => "#163473", - "header-item-font-color" => "#FFFFFF", - "header-item-font-hover-color" => "#FFFFFF", - "header-border-bottom-color" => "", "main-menu-bg-color" => "#0E2045", "main-menu-bg-selected-background" => "#3270DB", "main-menu-bg-hover-background" => "#163473", - "main-menu-font-color" => "#FFFFFF", - "main-menu-hover-font-color" => "#FFFFFF", - "main-menu-selected-font-color" => "#FFFFFF", - "main-menu-border-color" => "#EAEAEA" } } ].freeze