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, #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_for, #completed_issues_in_range, #current_board, #daily_chart_dataset, #description_text, #filter_issues, #format_integer, #format_status, #header_text, #holidays, #label_days, #label_issues, #link_to_issue, #next_id, #random_color, #render, #sprints_in_time_range, #status_category_color, #wrap_and_render

Constructor Details

#initialize(block = nil) ⇒ 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 = nil
  super()

  header_text 'Hierarchy Table'
  description_text <<-HTML
    <p>content goes here</p>
  HTML

  instance_eval(&block) if 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 = String.new
    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