-
-
Notifications
You must be signed in to change notification settings - Fork 723
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Add history trend items (fixes #362) #394
Conversation
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 in general
.filter(ExecutorInfo.class::isInstance) | ||
.map(ExecutorInfo.class::cast) | ||
.collect(Collectors.toList()); | ||
return executors.isEmpty() ? null : Collections.max(executors, |
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.
you can use sort together with findFirst
instead and return Optional
. Then use getExecutor().ifPresent(item::setExecutorInfo)
Also I would like to see some unit tests for that plugin |
@sseliverstov this one is up to you |
efcc86b
to
0159344
Compare
return this.options.items.map((item, i) => ({ | ||
...item, | ||
id: item.buildOrder ? `build_${item.buildOrder}` : `item_${i}`, | ||
name: item.buildOrder ? `#${item.buildOrder}` : `${this.options.items.length - i}(?)`, |
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.
What does this (?)
at the end mean?
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.
If buildOrder is absent (for example in pervious format of historical data) we show index and mark it as (?)
id: item.buildOrder ? `build_${item.buildOrder}` : `item_${i}`, | ||
name: item.buildOrder ? `#${item.buildOrder}` : `${this.options.items.length - i}(?)`, | ||
total: item.statistic.total, | ||
statistic: omit(item.statistic, 'total') |
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.
instead of omit
you can do a native thing
const {total, ...statistic} = item.statistic;
@@ -31,50 +39,100 @@ class TrendChartView extends BaseChartView { | |||
} | |||
|
|||
doShow(data) { | |||
data = data.reverse(); |
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.
.reverse()
mutates original data. Would be safer to make a copy first
data = data.slice().reverse();
//: # (
. Thank you so much for sending us a pull request!
.
. Make sure you have a clear name for your pull request.
. The name should start with a capital letter and no dot is required in the end of the sentence.
. To link the request with isses use the following notation: (fixes #123, fixes #321)
.
. An example of good pull request names:
. - Add Russian translation (fixes #123)
. - Add an ability to disable default plugins
. - Support emoji in test descriptions
)