_performance_indicator.erb 2.3 KB
Newer Older
1
<%= require 'date' %>
David DeSanto's avatar
David DeSanto committed
2 3 4 5 6

<%= current_month = Date::MONTHNAMES[Date.today.month] %>
<%= previous_date = Date.today.prev_month %>
<%= previous_month = Date::MONTHNAMES[previous_date.month] %>

7
<%= performance_indicator.name %>
Eric Johnson's avatar
Eric Johnson committed
8

9 10 11 12 13

<% if performance_indicator.parent %>
   <p>This is a subset of an existing KPI. Please see <a href="<%=performance_indicator.parent=%>">the definition for the parent KPI.</a></p>
<% end %>

14
<p><%= performance_indicator.definition %></p>
Eric Johnson's avatar
Eric Johnson committed
15

Eric Johnson's avatar
Eric Johnson committed
16 17 18 19
<% if performance_indicator.target %>
  <p><b>Target:</b> <%= performance_indicator.target %></p>
<% end %>

emilie's avatar
emilie committed
20
<% if performance_indicator.public == false %>
emilie's avatar
emilie committed
21
  <p><b>This KPI cannot be public.</b> </p>
emilie's avatar
emilie committed
22 23
<% end %>

24 25 26 27 28
<% if performance_indicator.urls %>
  <b>URL(s)</b>
  <ul>
  <% performance_indicator.urls.each do |url| %>
    <li><a href="<%= url %>"><%= url %></a></li>
Kathleen Tam's avatar
Kathleen Tam committed
29
  <% end %>
30
  </ul>
31 32
<% end %>

33
<% if performance_indicator.sisense_data %>
emilie's avatar
emilie committed
34 35 36 37 38 39
  <b>Chart</b>
    <% if performance_indicator.sisense_data.shared_dashboard%>
      (<a href="https://app.periscopedata.com/shared/<%= performance_indicator.sisense_data.shared_dashboard %>">Sisense↗</a>)
    <% elsif performance_indicator.sisense_data.chart && performance_indicator.sisense_data.dashboard%>
      (<a href="https://app.periscopedata.com/app/gitlab/<%= performance_indicator.sisense_data.dashboard %>/?widget=<%= performance_indicator.sisense_data.chart %>">Sisense↗</a>)
    <% end %>
40
  <% if ENV['PERISCOPE_EMBED_API_KEY'] %>
emilie's avatar
emilie committed
41
    <embed width="100%" height="100%" style="min-height:300px;" src="<%= signed_periscope_url(performance_indicator.sisense_data) %>">
42
  <% else %>
emilie's avatar
emilie committed
43
    <p>You must set a <code>PERISCOPE_EMBED_API_KEY</code> environment variable to render this chart.</p>
44
  <% end %>
45 46
<% end %>

47
<b>Status: <%= color_code_health(performance_indicator.health.level) %></b>
48

49
<% performance_indicator.health.reasons.each do |reason| %>
50
<%="  * #{reason}"%>
Eric Johnson's avatar
Eric Johnson committed
51
<% end %>
52

53

54
<% if performance_indicator.instrumentation %>
55 56 57 58
<b>Instrumentation: <%= color_code_instrumentation(performance_indicator.instrumentation.level) %></b>

<% performance_indicator.instrumentation.reasons.each do |reason| %>
<%="  * #{reason}"%>
59
<% end %>
60

61 62

<% if performance_indicator.monthly %>
David DeSanto's avatar
David DeSanto committed
63
<b>Lessons Learned <%= previous_month %>:</b>
64 65 66

<% performance_indicator.monthly.reasons.each do |reason| %>
<%="  * #{reason}"%>
67 68 69
<% end %>

<% end %>
70

71
<% end %>
72