Skip to content

Commit

Permalink
Merge pull request #16960 from opf/housekeeping/57983-create-a-migrat…
Browse files Browse the repository at this point in the history
…ion-to-remove-the-custom-design-color-variables-that-we-removed-from-the-list

[57983] Create a migration to remove the custom design color variables that we removed from the list
  • Loading branch information
oliverguenther authored Oct 15, 2024
2 parents 4ca5eca + c9df8a2 commit b0ad254
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 28 deletions.
7 changes: 0 additions & 7 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand Down
21 changes: 21 additions & 0 deletions db/migrate/20241015081341_remove_obsolete_design_variables.rb
Original file line number Diff line number Diff line change
@@ -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
21 changes: 0 additions & 21 deletions lib/open_project/custom_styles/color_themes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
},
{
Expand All @@ -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"
},
Expand All @@ -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
Expand Down

0 comments on commit b0ad254

Please sign in to comment.