-
Notifications
You must be signed in to change notification settings - Fork 90
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
Add plot description #58
Add plot description #58
Conversation
Signed-off-by: ahcorde <ahcorde@gmail.com>
1a7e9d0
to
2f826e7
Compare
Codecov Report
@@ Coverage Diff @@
## master #58 +/- ##
============================================
- Coverage 43.54% 43.35% -0.19%
- Complexity 187 224 +37
============================================
Files 18 18
Lines 1254 1610 +356
Branches 193 278 +85
============================================
+ Hits 546 698 +152
- Misses 643 843 +200
- Partials 65 69 +4
Continue to review full report at Codecov.
|
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.
@ahcorde I would rename Description title
field to Plot description
and move it below Plot title
in jelly file.
It would be nice to follow one of the PR requirements -> Git commits follow
best practices.
@@ -176,6 +176,12 @@ | |||
@SuppressWarnings("visibilitymodifier") | |||
public String title; | |||
|
|||
/** | |||
* Description . |
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.
Please add a more descriptive java doc.
this.title = title; | ||
this.yaxis = yaxis; | ||
this.group = group; | ||
this.numBuilds = numBuilds; | ||
this.description = description; |
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.
Please follow parameters order in CTOR and assignments order inside CTOR -> move below yaxisMaximum
.
@@ -420,7 +427,8 @@ public String toString() { | |||
+ getRightBuildNum() + "),HASLEGEND(" + hasLegend() | |||
+ "),ISLOGARITHMIC(" + isLogarithmic() + "),YAXISMINIMUM(" | |||
+ yaxisMinimum + "),YAXISMAXIMUM(" + yaxisMaximum | |||
+ "),FILENAME(" + getCsvFileName() + ")"; | |||
+ "),FILENAME(" + getCsvFileName() + "),DESCRIPTION" | |||
+ getDescription() + ")"; |
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.
Missing opening "("
before getDescription()
.
@@ -97,6 +99,11 @@ public final void setTitle(@CheckForNull String title) { | |||
this.title = Util.fixEmptyAndTrim(title); | |||
} | |||
|
|||
@DataBoundSetter | |||
public final void setDescription(@CheckForNull String title) { |
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 would move it below setYaxisMaximum
to preserve the order since description
is the last parameter and is after yaxisMaximum
parameter.
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.
title
-> description
@@ -51,6 +51,9 @@ | |||
</div> | |||
</j:if> | |||
<img src="getPlot?index=${index}&width=750&height=450" width="750" height="450" lazymap="getPlotMap?index=${index}" /> | |||
<div> | |||
<h4>Description</h4>: ${plot.description} |
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.
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.
Maybe make the text bold using <b>
tag instead of <h4>
? This way you can keep text in one line.
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.
Proper way of retrieving the description text would be ${it.getPlotDescription(index)}
and adding following method to PlotReport.java
// called from PlotReport/index.jelly
public String getPlotDescription(int i) {
Plot plot = getPlot(i);
return plot.getDescription();
}
@@ -51,6 +51,9 @@ | |||
</div> | |||
</j:if> | |||
<img src="getPlot?index=${index}&width=750&height=450" width="750" height="450" lazymap="getPlotMap?index=${index}" /> | |||
<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.
I would add style="width:750px"
to description div to align its max width with plot image.
<div style="width:750px">
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.
This will also solve the issue of very long text which will go to the next line after max width is reached 👍
@@ -637,6 +658,7 @@ public void plotGraph(StaplerRequest req, StaplerResponse rsp) | |||
setTitle(req); | |||
setStyle(req); | |||
setUseDescr(req); | |||
setDescription(req); |
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.
This will remove description set, please remove.
@@ -665,6 +687,7 @@ public void plotGraphMap(StaplerRequest req, StaplerResponse rsp) throws IOExcep | |||
setTitle(req); | |||
setStyle(req); | |||
setUseDescr(req); | |||
setDescription(req); |
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.
This will remove description set, please remove.
@@ -0,0 +1,3 @@ | |||
<div> | |||
Optional. Specifies the plot description. |
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.
Double-space between sentences.
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.
@ahcorde I still think having plot group
, title
, description
together creates better visual organization, and please rename Description title
to Plot description
.
Everything else works just fine 👍
0878019
to
7d8730c
Compare
Thank you for the reviews! |
@ahcorde welcome. Thanks for your contribution 🎉 Will release the new plugin version soon. |
@ahcorde |
I would like to add a description to the plots. As you can see in the following plot, the idea is to add a small text below the plots.
The text is only shown the first time that I load the site, then the text disappear. any thoughts on this?