Skip to content
Snippets Groups Projects
Commit d4006761 authored by Alex ORLUC's avatar Alex ORLUC
Browse files

FEAT #12869 TIME 0:10 fix undefined data

parent bdc08ea9
No related branches found
No related tags found
No related merge requests found
......@@ -91,6 +91,17 @@ export class SearchAdvListComponent implements OnInit {
}
processPostData(data: any) {
data.resources.forEach((linkeRes: any) => {
Object.keys(linkeRes).forEach((key) => {
if (key == 'statusImage' && this.functions.empty(linkeRes[key])) {
linkeRes[key] = 'fa-question undefined';
} else if (this.functions.empty(linkeRes[key]) && ['senders', 'recipients', 'attachments', 'hasDocument'].indexOf(key) === -1) {
linkeRes[key] = this.lang.undefined;
}
});
});
return data;
}
......
......@@ -11,6 +11,7 @@ import { of } from 'rxjs';
import { ConfirmComponent } from '../../plugins/modal/confirm.component';
import { MatDialog } from '@angular/material';
import { LinkResourceModalComponent } from './linkResourceModal/link-resource-modal.component';
import { FunctionsService } from '../../service/functions.service';
declare function $j(selector: any): any;
......@@ -42,6 +43,7 @@ export class LinkedResourceListComponent implements OnInit {
private notify: NotificationService,
public appService: AppService,
public dialog: MatDialog,
public functions: FunctionsService
) { }
ngOnInit(): void {
......@@ -55,6 +57,7 @@ export class LinkedResourceListComponent implements OnInit {
this.linkedResources = data.linkedResources;
this.reloadBadgeLinkedResources.emit(`${this.linkedResources.length}`);
setTimeout(() => {
this.linkedResources = this.processPostData(this.linkedResources);
this.dataSource = new MatTableDataSource(this.linkedResources);
this.dataSource.paginator = this.paginator;
this.dataSource.sort = this.sort;
......@@ -68,6 +71,21 @@ export class LinkedResourceListComponent implements OnInit {
).subscribe();
}
processPostData(data: any) {
data.forEach((linkeRes: any) => {
Object.keys(linkeRes).forEach((key) => {
if (key == 'statusImage' && this.functions.empty(linkeRes[key])) {
linkeRes[key] = 'fa-question undefined';
} else if (this.functions.empty(linkeRes[key]) && ['senders', 'recipients', 'attachments', 'hasDocument', 'confidentiality'].indexOf(key) === -1) {
linkeRes[key] = this.lang.undefined;
}
});
});
return data;
}
getUsersVisaCircuit(row: any) {
return row.visaCircuit.map((item: any) => item.userLabel);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment