Workflow display styling

This commit is contained in:
2026-03-21 19:57:01 +02:00
parent eb9f3e982c
commit 72af5a0610
8 changed files with 75 additions and 7 deletions
@@ -0,0 +1,28 @@
# frozen_string_literal: true
module Workflows
class DisplayViewModel
DEFAULT_ICON = 'task_line'
ICONS = {
warning: 'warning_line'
}.freeze
def initialize(workflow, full: false)
@workflow = workflow
@full = full
end
def icon
icon = ICONS.fetch(@workflow.icon.to_sym, DEFAULT_ICON)
"mingcute/#{icon}.svg"
end
def render_in(view_context)
view_context.render(
partial: 'workflows/display',
locals: @workflow.attributes.symbolize_keys.merge(icon:, full: @full)
)
end
end
end