diff --git a/app/controllers/workflows/stages_controller.rb b/app/controllers/workflows/stages_controller.rb index c85016dcc..f6422f9d6 100644 --- a/app/controllers/workflows/stages_controller.rb +++ b/app/controllers/workflows/stages_controller.rb @@ -31,6 +31,6 @@ class Workflows::StagesController < ApplicationController end def stage_params - params.expect workflow_stage: [ :name ] + params.require(:workflow_stage).permit(:name, :color) end end diff --git a/app/helpers/workflows_helper.rb b/app/helpers/workflows_helper.rb index 32fd5e68a..f54da0757 100644 --- a/app/helpers/workflows_helper.rb +++ b/app/helpers/workflows_helper.rb @@ -9,4 +9,8 @@ module WorkflowsHelper end end end + + def stage_color(stage) + stage.color.presence || "#2c6da8" + end end diff --git a/app/views/workflows/stages/_color.html.erb b/app/views/workflows/stages/_color.html.erb new file mode 100644 index 000000000..fc0b65b6e --- /dev/null +++ b/app/views/workflows/stages/_color.html.erb @@ -0,0 +1,27 @@ +