-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Fix event_logs download functionality #2373
Conversation
Functionality was previously listed but not working, as mentioned in issue @2329. This fix creates another function that calls the correct API endpoint.
Addresses #2329 |
Fix csv file format in operation report download.
CJellen Additions
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.
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();
},
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.
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
Kudos, SonarCloud Quality Gate passed!
|
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: