From be0b5161f1e1cb0f16f34801be52729e47769783 Mon Sep 17 00:00:00 2001 From: ckitsanelis Date: Thu, 18 Jan 2024 13:16:40 +0100 Subject: [PATCH] Fix structure export bug --- src/viewer/App.tsx | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/viewer/App.tsx b/src/viewer/App.tsx index 8d162fe..f1aa334 100644 --- a/src/viewer/App.tsx +++ b/src/viewer/App.tsx @@ -432,11 +432,12 @@ export default class App extends React.Component { } } - exportData(exportIndices: number[]) { + exportData(exportIndices: number[], structureExport: boolean) { var exportObjects: Object[] = [] const originalColumns = this.state.logFile.headers; - if (exportIndices.length === 0 || this.state.filterSearch === false) - exportIndices = Array.from(Array(this.state.logFile.amountOfRows()).keys()) + if (!structureExport) + if (exportIndices.length === 0 || this.state.filterSearch === false) + exportIndices = Array.from(Array(this.state.logFile.amountOfRows()).keys()) for (var index of exportIndices) { var rowObject = {}; const row = this.state.logFile.rows[index] @@ -485,7 +486,7 @@ export default class App extends React.Component { this.exportData(this.state.searchMatches)} + onClick={() => this.exportData(this.state.searchMatches, false)} > Export @@ -769,7 +770,7 @@ export default class App extends React.Component { onMatchStructure={(expression) => this.handleStructureMatching(expression)} onDefineSegment={(collapsibleRows) => this.updateSegmentation(collapsibleRows)} onNavigateStructureMatches={(isGoingForward) => this.handleNavigation(isGoingForward, true)} - onExportStructureMatches={() => this.exportData(this.state.structureMatches.flat(1))} + onExportStructureMatches={() => this.exportData(this.state.structureMatches.flat(1), true)} /> )}