Skip to content

Commit

Permalink
Sub-optimal solution for rule update
Browse files Browse the repository at this point in the history
  • Loading branch information
ckitsanelis committed Oct 2, 2023
1 parent 30ca918 commit 6b43630
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/viewer/LogFile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,13 @@ export default class LogFile {
}

updateRules(rules: Rule[]): LogFile {
// Slow solution
// const headers = LogFile.getHeaders(this.contentHeaders, rules);
// let logFile = new LogFile(this.contentHeaders, headers, this.rows);
// logFile = this.copyDefaultColumnColors(logFile, this.columnsColors);
// logFile.computeRulesValuesAndColors(rules);
// return logFile;

this.updateSelectedColumns(rules);
this.updateHeaders(rules);
this.computeRulesValuesAndColors(rules);
Expand Down Expand Up @@ -118,6 +125,13 @@ export default class LogFile {
}
}

private copyDefaultColumnColors(logFile: LogFile, colours: string[][]) {
for (let i = 0; i < this.contentHeaders.length; i++) {
logFile.columnsColors[i] = colours[i];
}
return logFile
}

private computeRulesValuesAndColors(rules: Rule[]) {
// Compute rules values
const startIndex = this.headers.length - rules.length;
Expand Down

0 comments on commit 6b43630

Please sign in to comment.