in ui/src/app/components/sidenav-view-assessment/sidenav-view-assessment.component.ts [168:255]
generateIssueReport() {
this.fetch.getDStructuredReport().subscribe({
next: (resStructured: IStructuredReport) => {
let fetchedTableReports = resStructured.tableReports
var report: IIssueReport = {
errors: new Map<string, TablesInformation>(),
warnings: new Map<string, TablesInformation>(),
suggestions: new Map<string, TablesInformation>(),
notes: new Map<string, TablesInformation>(),
}
// iterate each table
for (var fetchedTableReport of fetchedTableReports) {
let allIssues = fetchedTableReport.issues
// If the conversion is clean, then allIssues will be null.
if (allIssues == null) {
continue
}
// iterate each issue
for (var issue of allIssues) {
let defaultIssue: TablesInformation = {
tableCount: 0,
tableNames: new Set<string>(),
}
switch (issue.issueType) {
case "Error":
case "Errors":
// store errors with table count and table names in report.errors
let errorIssues = issue.issueList
this.appendIssueWithTableInformation(errorIssues, report.errors, defaultIssue, fetchedTableReport)
break
case "Warnings":
case "Warning":
// store warnings with table count and table names in report.warnings
let warningIssues = issue.issueList
this.appendIssueWithTableInformation(warningIssues, report.warnings, defaultIssue, fetchedTableReport)
break
case "Suggestion":
case "Suggestions":
// store suggestions with table count and table names in report.suggestions
let suggestionIssues = issue.issueList
this.appendIssueWithTableInformation(suggestionIssues, report.suggestions, defaultIssue, fetchedTableReport)
break
case "Note":
case "Notes":
// store notes with table count and table names in report.notes
let noteIssues = issue.issueList
this.appendIssueWithTableInformation(noteIssues, report.notes, defaultIssue, fetchedTableReport)
break
}
}
}
// populate issueTableData_Warnings with data from report.warnings
let map_report = report.warnings
this.issueTableData_Warnings = []
if (map_report.size != 0) {
this.populateTableData(map_report, this.issueTableData_Warnings)
}
// populate issueTableData_Errors with data from report.errors
map_report = report.errors
this.issueTableData_Errors = []
if (map_report.size != 0) {
this.populateTableData(map_report, this.issueTableData_Errors)
}
// populate issueTableData_Suggestions with data from report.suggestions
map_report = report.suggestions
this.issueTableData_Suggestions = []
if (map_report.size != 0) {
this.populateTableData(map_report, this.issueTableData_Suggestions)
}
// populate issueTableData_Notes with data from report.notes
map_report = report.notes
this.issueTableData_Notes = []
if (map_report.size != 0) {
this.populateTableData(map_report, this.issueTableData_Notes)
}
}
})
}