OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
Remove any custom colors if setting a new theme
Oliver Günther0c339d33029b
diff --git a/app/services/design/update_design_service.rb b/app/services/design/update_design_service.rbindex 0f20c4f5ea3..dbc52a0c2f2 100644--- a/app/services/design/update_design_service.rb+++ b/app/services/design/update_design_service.rb@@ -35,12 +35,17 @@ module Designenddef call- set_logo- set_colors- set_theme+ CustomStyle.transaction do+ set_logo+ set_colors+ set_theme- ServiceResult.new success: custom_style.save,- result: custom_style+ custom_style.save!++ ServiceResult.new success: true, result: custom_style+ end+ rescue StandardError => e+ ServiceResult.new success: false, message: e.messageendprivate@@ -52,6 +57,11 @@ module Designdef set_colorsreturn unless params[:colors]+ # reset all colors if a new theme is set+ if params[:theme].present?+ DesignColor.delete_all+ end+params[:colors].each do |param_variable, param_hexcode|if design_color = DesignColor.find_by(variable: param_variable)if param_hexcode.blank?