-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add release health / mobile devops charts (#571)
- Release Frequency - Number of Hotfixes - Release Duration - Time Spent in Review - Contributors - Duration across steps
- Loading branch information
Showing
19 changed files
with
419 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<div class="w-full bg-white rounded-sm border border-gray-200 p-3"> | ||
<div class="flex justify-between items-center mb-4"> | ||
<div> | ||
<h5 class="flex leading-none text-lg font-normal text-gray-900 items-center gap-x-1"> | ||
<%= title %> | ||
<%= inline_svg("question_mark.svg", classname: "w-4 inline-flex fill-current shrink-0 text-gray-400") %> | ||
</h5> | ||
|
||
<p class="text-sm font-normal text-gray-400"><%= chart_scope %></p> | ||
</div> | ||
|
||
<div class="flex items-center py-0.5 text-base font-semibold text-green-700 text-center"> | ||
<%= inline_svg("thermometer.svg", classname: "w-6 fill-current shrink-0") %> | ||
</div> | ||
</div> | ||
|
||
<% if area? %> | ||
<div data-controller="charts" | ||
data-charts-type-value="area" | ||
data-charts-format-value="<%= value_format %>" | ||
data-charts-area-names-value="<%= legends %>" | ||
data-charts-area-series-value="<%= series %>" | ||
data-charts-area-categories-value="<%= categories %>"> | ||
<div data-charts-target="chart"></div> | ||
</div> | ||
<% end %> | ||
<% if line? %> | ||
<div data-controller="charts" | ||
data-charts-type-value="line" | ||
data-charts-format-value="<%= value_format %>" | ||
data-charts-line-names-value="<%= legends %>" | ||
data-charts-line-series-value="<%= series %>" | ||
data-charts-line-categories-value="<%= categories %>"> | ||
<div data-charts-target="chart"></div> | ||
</div> | ||
<% end %> | ||
<% if stacked_bar? %> | ||
<div data-controller="charts" | ||
data-charts-type-value="stacked-bar" | ||
data-charts-format-value="<%= value_format %>" | ||
data-charts-stacked-bar-names-value="<%= legends %>" | ||
data-charts-stacked-bar-series-value="<%= series %>" | ||
data-charts-stacked-bar-categories-value="<%= categories %>"> | ||
<div data-charts-target="chart"></div> | ||
</div> | ||
<% end %> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
class ChartComponent < ViewComponent::Base | ||
include AssetsHelper | ||
CHART_TYPES = %w[area line donut stacked-bar] | ||
InvalidChartType = Class.new(StandardError) | ||
|
||
def initialize(chart) | ||
@chart = chart | ||
raise InvalidChartType unless chart[:type].in?(CHART_TYPES) | ||
end | ||
|
||
attr_reader :chart | ||
|
||
def area? | ||
type == "area" | ||
end | ||
|
||
def line? | ||
type == "line" | ||
end | ||
|
||
def stacked_bar? | ||
type == "stacked-bar" | ||
end | ||
|
||
def type | ||
@type ||= chart[:type] | ||
end | ||
|
||
def legends | ||
chart[:legends].to_json | ||
end | ||
|
||
def series | ||
chart[:series].to_json | ||
end | ||
|
||
def categories | ||
chart[:x_axis].to_json | ||
end | ||
|
||
def value_format | ||
chart[:value_format] | ||
end | ||
|
||
def title | ||
I18n.t("charts.#{chart[:name]}.title") | ||
end | ||
|
||
def chart_scope | ||
I18n.t("charts.#{chart[:name]}.scope") | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.