Skip to content

Commit

Permalink
better rendering for catch events.
Browse files Browse the repository at this point in the history
  • Loading branch information
apotonick committed Jan 30, 2024
1 parent ca7d8ec commit 8e08dd0
Show file tree
Hide file tree
Showing 4 changed files with 151 additions and 85 deletions.
2 changes: 1 addition & 1 deletion lib/trailblazer/workflow/state/discovery.rb
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ def self.render_cli_state_table(discovery_state_table)
end

def self.readable_name_for_catch_event(position)
"#{position[:tuple][0]} / (?) --> [#{position[:comment][1]}]"
"#{position[:tuple][0]} / (✉)➔[#{position[:comment][1]}]"
end

def self.render_cli_event_table(discovery_state_table, render_ids: false, hide_lanes: [])
Expand Down
22 changes: 21 additions & 1 deletion lib/trailblazer/workflow/state/discovery/testing.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,34 @@ def self.render_structure(states, lanes:, additional_state_data:, task_map:)
{
start_position: {
tuple: [activity_id, triggered_catch_event_id],
comment: Discovery.find_next_task_label(start_position.activity, start_position.task)
comment: ["before", Discovery.find_next_task_label(start_position.activity, start_position.task)]
},
start_configuration: serialized_start_configuration,
expected_lane_positions: expected_lane_positions,
}
end
end

def self.render_comment_header(structure)
cli_rows = structure.collect do |testing_row| # row = :start_position, :start_configuration, :expected_lane_positions
triggered_catch_event_label = Discovery.readable_name_for_catch_event(testing_row[:start_position])

Hash[
"triggered catch",
triggered_catch_event_label,

]
end


Hirb::Helpers::Table.render(cli_rows, fields: [
"triggered catch",
# *lane_ids,
],
max_width: 186,
) # 186 for laptop 13"
end

# A lane position is always a {Suspend} (or a terminus).
def self.serialize_lane_position(lane_position, lanes:)
activity, suspend = lane_position.to_a
Expand Down
Loading

0 comments on commit 8e08dd0

Please sign in to comment.