-
Notifications
You must be signed in to change notification settings - Fork 991
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixes #23598 - move report metrics chart to c3 #5563
Conversation
Issues: #23598 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @lizagilman
I left some inline comments.
We have a component for a chart box with this design:
although I know that this page uses chart bar which still using flot.
<div style="margin-top:50px;padding-bottom: 40px;"> | ||
<%= flot_pie_chart("metrics" ,_("Report Metrics"), metrics, :class => "statistics-pie small")%> | ||
</div> | ||
<div id="metrics_chart" class='metrics-chart' style="margin-top:50px;padding-bottom: 40px;"></div> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not add the inline style to the metrics-chart
class?
@@ -18,7 +17,7 @@ | |||
<div class="col-md-4"> | |||
<table class="<%= table_css_classes %>" style="height: 398px;"> | |||
<tbody> | |||
<% metrics.sort.each do |title, value|%> | |||
<% metrics.sort.each do |title, value|%> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indentation should be 2 space
<tr> | ||
<th><%= _("Total") %></th><th><%= metric (@totaltime || @config_report.runtime) %></th> | ||
</tr> | ||
<tr> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
<%= flot_pie_chart("metrics" ,_("Report Metrics"), metrics, :class => "statistics-pie small")%> | ||
</div> | ||
<div id="metrics_chart" class='metrics-chart' style="margin-top:50px;padding-bottom: 40px;"></div> | ||
<%= mount_react_component('DonutChart', '#metrics_chart', metrics.to_a) %> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
data should be in json format (to_json
)
3a151c5
to
54ca054
Compare
@amirfefer thanks for the quick review, updated. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @lizagilman , just one minor issue with the css.
Generally speaking, We do test the component behavior,
but we don't test if a component actually is rendered in a page (end to end test).
do we want this kind of test?
app/assets/stylesheets/charts.scss
Outdated
.metrics-chart { | ||
width: 240px; | ||
margin: 12px auto; | ||
margin-top: 50px; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
duplicate margin-top
with 12px and 50px values.
maybe use margin with 4 values?
@amirfefer thanks, css updated |
@lizagilman, in order to run js in integration test you should use js driver, tests with js end with |
@amirfefer ok, I added a test |
@lizagilman mind adding an updated screenshot? thanks. |
|
||
class ConfigReportJSTest < IntegrationTestWithJavascript | ||
test "should display report metrics chart" do | ||
@report = ConfigReport.import(read_json_fixture('reports/applied.json')) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think @
is redundant here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
this looks like a solid change, the only thing I'm a bit uncomfortable with is the red (and to some degree green) color inside the chart, in your screenshots it looks like something requires attention, when i looked at it on some other sample data it didnt look as bad, but it still feels wrong to me, @Rohoover any thoughts? |
@ohadlevy: these colors are suggested by pf color-palette and mentioned here |
@amirfefer Is correct. There is some flexibility as the donut doesn't specify which colors and only gives guidance to use the recommended PF Color palette. We can technically choose from any of those colors. |
so in this case would you recommend changing the colors or its just me?
…On Tue, May 22, 2018 at 2:53 PM, Roxanne Hoover ***@***.***> wrote:
@amirfefer <https://github.com/amirfefer> Is correct. There is some
flexibility as the donut doesn't specify which colors and only gives
guidance to use the recommended PF Color palette
<http://www.patternfly.org/styles/color-palette/>. We can technically
choose from any of those colors.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#5563 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AABOx0zXmL4VInsl4WwmtDwwMWRDFPxnks5t0_wygaJpZM4T_n3V>
.
|
It's you. ;) In all seriousness, I am not married to any particular color choice at this point. I think PF does use the red, orange, green colors as both color and status in the donuts, which can be a bit confusing. |
I'd also prefer to avoid red if that's easy to do. But I can live with it :-) |
I prefer option 2, but not strong opinion. If red helps color-blind people, I'm fine with keeping it. |
@tstrachota any preferences? or can we merge? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I prefer option 2 as well,
Please pick another color from this list.
LGTM 👍 test failures not related. |
[test foreman] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested, works well. Thanks @lizagilman !
Using pf-react donut chart instead of flot