Skip to content

Commit

Permalink
Fix diagram exception breaking page layout. Fixes #2087
Browse files Browse the repository at this point in the history
  • Loading branch information
fbacall committed Dec 12, 2024
1 parent 1cac060 commit ae8ee40
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions app/views/workflows/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,12 @@

<% begin %>
<% if @display_workflow.diagram_exists? || @display_workflow.can_render_diagram? %>
<% diagram_path = diagram_workflow_path(@workflow, version: @display_workflow.version) %>
<% is_svg = @display_workflow&.diagram.extension == 'svg' %>
<div class="row">
<div class="col-md-12">
<div class="workflow-diagram">
<% diagram_path = diagram_workflow_path(@workflow, version: @display_workflow.version) %>
<% if @display_workflow&.diagram.extension == 'svg' %>
<% if is_svg %>
<%= content_tag(:embed, '', type: 'image/svg+xml', src: diagram_path, class: 'svg-pan-zoom', width: 1000, height: 500) %>
<p class="help-block">Click and drag the diagram to pan, double click or use the controls to zoom.</p>
<% else %>
Expand All @@ -44,7 +45,7 @@
</div>
<% end %>
<% rescue StandardError => e %>
<% raise e if Rails.env.development? %>
<% raise e unless Rails.env.production? %>
<% Rails.logger.error(e.inspect) %>
<% Rails.logger.error(e.backtrace.join("\n")) %>
<div class="alert alert-warning">Could not render the workflow diagram.</div>
Expand Down

0 comments on commit ae8ee40

Please sign in to comment.