Skip to content

Commit

Permalink
Disregard column selection upon refresh
Browse files Browse the repository at this point in the history
  • Loading branch information
ckitsanelis committed Dec 15, 2023
1 parent 45a6d67 commit 34f7d74
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions src/viewer/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import {
useStructureRegularExpressionSearch,
useStructureRegularExpressionNestedSearch
} from "./hooks/useStructureRegularExpressionManager";
import { getRegularExpressionMatches, returnSearchIndices } from "./hooks/useLogSearchManager";
import { returnSearchIndices } from "./hooks/useLogSearchManager";
import { constructNewRowProperty, constructNewSegment } from "./hooks/useRowProperty";
import StructureDialog from "./structures/StructureDialog";
import StatesDialog from "./rules/Dialogs/StatesDialog";
Expand Down Expand Up @@ -119,9 +119,10 @@ export default class App extends React.Component<Props, State> {
const lines = JSON.parse(message.text);
const logFileText = JSON.stringify(lines, null, 2);
const logEntryCharIndexMaps = useGetCharIndicesForLogEntries(logFileText);
const logFile = LogFile.create(lines, rules);
logFile.setSelectedColumns(this.state.selectedColumns, this.state.selectedColumnsMini);
this.extractHeaderColumnTypes(logFile, rules);
let logFile = LogFile.create(lines, rules);
// if (this.previousSession)
// logFile.setSelectedColumns(this.previousSession.selectedColumns, this.previousSession.selectedColumnsMini);
this.extractHeaderColumnTypes(logFile);
this.setState({
rules,
logFile,
Expand All @@ -136,15 +137,16 @@ export default class App extends React.Component<Props, State> {
this.setState({ rowProperties: newRowsProps });
}
else {
const showFlagsDialog = this.previousSession.showFlagsDialog;
const showStatesDialog = this.previousSession.showStatesDialog;
const showStructureDialog = this.previousSession.showStructureDialog;
this.setState({ showFlagsDialog, showStatesDialog, showStructureDialog });
this.setState({
showFlagsDialog: this.previousSession.showFlagsDialog,
showStatesDialog: this.previousSession.showStatesDialog,
showStructureDialog: this.previousSession.showStructureDialog,
});
}
}
}

extractHeaderColumnTypes(logFile: LogFile, rules: Rule[]) {
extractHeaderColumnTypes(logFile: LogFile) {
logHeaderColumnTypes = [];
for (let h = 0; h < logFile.headers.length; h++) {
let headerType = StructureHeaderColumnType.Selected;
Expand Down Expand Up @@ -246,7 +248,7 @@ export default class App extends React.Component<Props, State> {
if (isClosing === true) {
this.handleStructureUpdate(isClosing);
} else {
const { logFile, rowProperties, rules, showStructureDialog } = this.state;
const { logFile, rowProperties, showStructureDialog } = this.state;

const selectedLogRows = logFile.rows.filter(
(v, i) => rowProperties[i].rowType === SelectedRowType.UserSelect,
Expand All @@ -257,7 +259,7 @@ export default class App extends React.Component<Props, State> {
}

if (!showStructureDialog) {
this.extractHeaderColumnTypes(logFile, rules);
this.extractHeaderColumnTypes(logFile);
this.setState({ showStructureDialog: true });
}

Expand Down

0 comments on commit 34f7d74

Please sign in to comment.