Skip to content

Commit ab6c4f4

Browse files
committed
fix/handle-null-report-category-display
1 parent cbc7cd5 commit ab6c4f4

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

src/app/system/manage-reports/manage-reports.component.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,9 @@
4242

4343
<ng-container matColumnDef="reportCategory">
4444
<th mat-header-cell *matHeaderCellDef mat-sort-header>{{ 'labels.inputs.Report Category' | translate }}</th>
45-
<td mat-cell *matCellDef="let report">{{ report.reportCategory | translateKey: 'catalogs' }}</td>
45+
<td mat-cell *matCellDef="let report">
46+
{{ report.reportCategory ? (report.reportCategory | translateKey: 'catalogs') : '' }}
47+
</td>
4648
</ng-container>
4749

4850
<ng-container matColumnDef="coreReport">

src/app/system/manage-reports/manage-reports.component.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,14 @@ export class ManageReportsComponent implements OnInit, AfterViewInit {
118118
* Initializes the data source, paginator and sorter for reports table.
119119
*/
120120
setReports() {
121-
this.dataSource = new MatTableDataSource(this.reportsData);
121+
// Transform data to replace "(NULL)" strings with null
122+
const transformedData = this.reportsData.map((report: any) => ({
123+
...report,
124+
reportCategory: report.reportCategory === '(NULL)' ? null : report.reportCategory,
125+
description: report.description === '(NULL)' ? null : report.description
126+
}));
127+
128+
this.dataSource = new MatTableDataSource(transformedData);
122129
this.dataSource.paginator = this.paginator;
123130
this.dataSource.sort = this.sort;
124131
}

0 commit comments

Comments
 (0)