diff --git a/src/viewer/LogFile.tsx b/src/viewer/LogFile.tsx index ddd12ee..4dd0c72 100644 --- a/src/viewer/LogFile.tsx +++ b/src/viewer/LogFile.tsx @@ -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); @@ -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;