-
-
Notifications
You must be signed in to change notification settings - Fork 717
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
Tree refactoring, plugin api changes #457
Conversation
baev
commented
Jul 4, 2017
- Sign CLA
- Add unit tests
@@ -71,7 +71,8 @@ class WidgetsGridView extends View { | |||
|
|||
this.addRegion(name, {el: el.find('.widget__body')}); | |||
/// fetchAndShow(this, name, this.model, new Widget({model: this.model})) | |||
this.getRegion(name).show(new Widget({model: this.model})); | |||
const model = this.model; | |||
this.getRegion(name).show(new Widget({model, name})); |
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.
would be better to prepare the correct model here
new Widget({model: this.model.getWidgetData(name)})
instead of doing this inside the Widget
constructor
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.
the problem is that graphs are widgets as well
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 mean this: https://github.com/allure-framework/allure2/blob/master/allure-generator/src/main/javascript/plugins/widget-status/StatusWidgetView.js
So, what is the problem?
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 mean that graphs
tab uses WidgetsGridView
but model is different (plain list of results)
statistic[value] = 0; | ||
}); | ||
items.forEach(item => { | ||
if (item.children) { |
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 also add a check for item.statistic
and don't do it on every forEach
loop
return time; | ||
} | ||
|
||
static updateTime(timeA, timeB, field, operation) { |
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 is not Java you don't need to use static methods, you can just create a standalone function within this module
} else if ('status' in a && 'status' in b) { | ||
return nodeCmp(a, b); | ||
function compare(a, b, nodeCmp, groupCmp, direction) { | ||
if (a.hasOwnProperty('children') && !b.hasOwnProperty('children')) { |
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 do you do this instead of just if (a.children && !b.children) {
?
Also tested manually, key navigation was not broken 👍 |
72012ed
to
a14464c
Compare