Merge pull request #2748 from shubhamkumar9199/fix/performance-entity-data-table-checks

WEB-(395)-fix(entity-data-table-checks): optimize setEntity() to prevent UI lag…
This commit is contained in:
Gopi Kishan
2025-11-04 04:08:34 +05:30
committed by GitHub
@@ -124,17 +124,18 @@ export class EntityDataTableChecksComponent implements OnInit {
this.setEntity();
}
/**
* Sets Entity to its corresponding values
*/
setEntity() {
for (let i = 0; i < this.dataSource.data.length; i++) {
for (let j = 0; j < this.entityValues.length; j++) {
if (this.entityValues[j].code === this.dataSource.data[i].entity) {
this.dataSource.data[i].entity = this.entityValues[j].value;
}
const entityMap = new Map<string, string>();
this.entityValues.forEach((entity: any) => {
entityMap.set(entity.code, entity.value);
});
this.dataSource.data.forEach((item: any) => {
const entityValue = entityMap.get(item.entity);
if (entityValue) {
item.entity = entityValue;
}
}
});
}
/**