Class: HierarchyTable

Inherits:
ChartBase show all
Defined in:
lib/jirametrics/hierarchy_table.rb

Instance Attribute Summary

Attributes inherited from ChartBase

#aggregated_project, #all_boards, #board_id, #canvas_height, #canvas_width, #data_quality, #date_range, #file_system, #holiday_dates, #issues, #settings, #time_range, #timezone_offset

Instance Method Summary collapse

Methods inherited from ChartBase

#aggregated_project?, #canvas, #canvas_responsive?, #chart_format, #collapsible_issues_panel, #color_block, #color_for, #completed_issues_in_range, #current_board, #daily_chart_dataset, #describe_non_working_days, #description_text, #format_integer, #format_status, #header_text, #holidays, #html_directory, #icon_span, #label_days, #label_issues, #link_to_issue, #next_id, #random_color, #render, #render_top_text, #status_category_color, #wrap_and_render

Constructor Details

#initialize(block) ⇒ HierarchyTable

Returns a new instance of HierarchyTable.



6
7
8
9
10
11
12
13
14
15
# File 'lib/jirametrics/hierarchy_table.rb', line 6

def initialize block
  super()

  header_text 'Hierarchy Table'
  description_text <<~HTML
    <p>Shows all issues through this time period and the full hierarchy of their parents.</p>
  HTML

  instance_eval(&block)
end

Instance Method Details

#runObject



17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/jirametrics/hierarchy_table.rb', line 17

def run
  tree_organizer = TreeOrganizer.new issues: @issues
  unless tree_organizer.cyclical_links.empty?
    message = +''
    message << '<p>Found cyclical links in the parent hierarchy. This is an error and should be '
    message << 'fixed.</p><ul>'
    tree_organizer.cyclical_links.each do |link|
      message << '<li>' << link.join(' > ') << '</ul>'
    end
    message << '</ul>'
    @description_text += message
  end
  wrap_and_render(binding, __FILE__)
end