-
Notifications
You must be signed in to change notification settings - Fork 383
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
[GUI] Unnecessary reports columns #4014
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.
This is a nice patch, thanks! By the way, it is interesting to see formattedReports
in the watch
section. I've never seen a computed field in this section. But it works, anyway :)
this.hasTimeStamp = this.formattedReports.map( | ||
report => report.timestamp | ||
).filter(ts => ts).length | ||
? true | ||
: false; | ||
|
||
this.hasTestCase = this.formattedReports.map( | ||
report => report.testcase | ||
).filter(tc => tc).length | ||
? true | ||
: false; |
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.hasTimeStamp = this.formattedReports.map( | |
report => report.timestamp | |
).filter(ts => ts).length | |
? true | |
: false; | |
this.hasTestCase = this.formattedReports.map( | |
report => report.testcase | |
).filter(tc => tc).length | |
? true | |
: false; | |
this.hasTimeStamp = | |
this.formattedReports.some(report => report.timestamp); | |
this.hasTestCase = | |
this.formattedReports.some(report => report.testcase); |
May I recommend a shorter implementation?
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.
Thank you for the suggestion. Using some() method is more stylish solution.
The "timestamp" and "testcase" columns are only needed for a special test case, therefore, they can be removed if their content is completely empty. When the "formattedReports" prop is changed, The values are verified again. If a report had timestamp or testcase, the columns would be displayed again.
8e8426e
to
fbf4082
Compare
The "timestamp" and "testcase" columns are only needed for a special test case, therefore, they can be removed if their content is completely empty. When the "formattedReports" prop is changed, the values are verified again. If a report had timestamp or testcase, the columns would be displayed again.