Whenever a new response is added to the array of 15 responses, I aim to dynamically update the view without requiring the page to refresh.
addResponseToItemArray(res: DashboardInfo[]): void {
this.item.push([]); // ERROR
this.item.push([]); // WARNING
this.item.push([]); // INFORMATION
this.item.push([]); // OK
let element;
while ((element = res.pop())) {
let index: number;
if (element.level === "ERROR") index = 0;
else if (element.level === "WARNING") index = 1;
else if (element.level === "INFORMATION") index = 2;
else index = 3;
if (element.path !== undefined) {
if (this.featuresFlag.visibleFeatures.includes(element.path)) {
this.item[index].push(element);
this.item = this.item.slice();
}
}
}
}