Skip to content
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

Merged
merged 1 commit into from
Sep 25, 2023

Conversation

cservakt
Copy link
Collaborator

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.

@cservakt cservakt added WIP 💣 Work In Progress GUI 🎨 usability 👍 Usability-related features style 📝 Formatting, missing semi colons, etc; no code change labels Sep 21, 2023
@cservakt cservakt added this to the release 6.23.0 milestone Sep 21, 2023
@cservakt cservakt requested a review from Szelethus September 21, 2023 07:08
@cservakt cservakt removed the WIP 💣 Work In Progress label Sep 22, 2023
Copy link
Contributor

@bruntib bruntib left a 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 :)

Comment on lines 386 to 396
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;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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?

Copy link
Collaborator Author

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.
@cservakt cservakt force-pushed the unnecessary-reports-columns branch from 8e8426e to fbf4082 Compare September 25, 2023 09:16
@cservakt cservakt requested a review from bruntib September 25, 2023 09:21
@bruntib bruntib merged commit 35792f1 into Ericsson:master Sep 25, 2023
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
GUI 🎨 style 📝 Formatting, missing semi colons, etc; no code change usability 👍 Usability-related features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants