Fix event_logs download functionality#2373
Merged
Merged
Conversation
Functionality was previously listed but not working, as mentioned in issue @2329. This fix creates another function that calls the correct API endpoint.
Contributor
|
Addresses #2329 |
Fix csv file format in operation report download.
CJellen Additions
mkultraWasHere
previously approved these changes
Nov 30, 2021
iguannalin
suggested changes
Nov 30, 2021
Contributor
iguannalin
left a comment
There was a problem hiding this comment.
Hi @heatonk, I think this file could be reduced a bit, if all that's changing is the API endpoint.
downloadInfo(formatType) {
const endpoint = formatType === 'full-report' ? 'report' : formatType;
apiV2('POST', `${this.ENDPOINT}/${this.selectedOperationID}/${endpoint}`, { enable_agent_output: this.isAgentOutputSelected })
.then((res) => {
this.createDownloadReport(res, `${this.selectedOperation.name}_${formatType}`);
})
.catch(() => toast(`Error generating operation ${formatType.replace('-', ' ')}`));
},
downloadCSV() {...},
handleDownload() {
if (this.selectedReportType === 'full-report') this.downloadInfo('full-report');
else if (this.selectedReportType === 'event-logs') this.downloadInfo('event-logs');
else if (this.selectedReportType === 'csv') this.downloadCSV();
},
iguannalin
approved these changes
Dec 1, 2021
Contributor
There was a problem hiding this comment.
Looks good! I'll suggest making sure to pull the latest changes from the master some linting to match the spacing with the rest of the functions.operations.html (i.e. I see there's a console error for operation that has been fixed but is still popping up in this branch's ver.), and
mkultraWasHere
approved these changes
Dec 1, 2021
|
Kudos, SonarCloud Quality Gate passed!
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.








Description
Functionality was previously listed but not working, as mentioned in issue @2329. This fixes @2329 by creating another function that calls the correct API endpoint.
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Verified solution by running locally and downloading event logs and reports from test operations.
Checklist: