From dddc1a68b4dba778558423335ce1aebbf2a4fdab Mon Sep 17 00:00:00 2001 From: ckitsanelis Date: Thu, 28 Sep 2023 15:52:31 +0200 Subject: [PATCH 1/8] Fix issue in flag edit and prohibit empty names --- src/viewer/App.tsx | 1 - src/viewer/rules/Dialogs/FlagsDialog.tsx | 13 +++++++++---- src/viewer/rules/Dialogs/StatesDialog.tsx | 12 ++++++++---- 3 files changed, 17 insertions(+), 9 deletions(-) diff --git a/src/viewer/App.tsx b/src/viewer/App.tsx index 93aea12..48aea66 100644 --- a/src/viewer/App.tsx +++ b/src/viewer/App.tsx @@ -113,7 +113,6 @@ export default class App extends React.Component { currentStructureMatch: [], lastSelectedRow: undefined, collapsibleRows: {}, - // collapsibleRows: { 1: constructNewSegment(1, 10, 0), 2: constructNewSegment(2, 6, 1), 5: constructNewSegment(5, 15, 0), 7: constructNewSegment(7, 10, 1), 0 : constructNewSegment(0, 20, 2)}, }; this.onMessage = this.onMessage.bind(this); diff --git a/src/viewer/rules/Dialogs/FlagsDialog.tsx b/src/viewer/rules/Dialogs/FlagsDialog.tsx index 84933d0..05b4fd8 100644 --- a/src/viewer/rules/Dialogs/FlagsDialog.tsx +++ b/src/viewer/rules/Dialogs/FlagsDialog.tsx @@ -175,7 +175,6 @@ export default class FlagsDialog extends React.Component { const userColumns = this.state.rules .map((r, i) => r.column) .filter((name) => name != rule.column); - const defaultRuleColumn = `FlagRule${ruleIndex + 1}`; const keyWidth = "100px"; const textFieldWidth = "250px"; const rows = [ @@ -186,7 +185,7 @@ export default class FlagsDialog extends React.Component { value={rule.column} key="Name" onInput={(e) => - this.updateRule(rule.setColumn(e.target.value || defaultRuleColumn), ruleIndex) + this.updateRule(rule.setColumn(e.target.value), ruleIndex) } />, ], @@ -262,14 +261,20 @@ export default class FlagsDialog extends React.Component { {this.state.showEdit &&
Edit Flag Annotation Column
} {this.state.showEdit && ( this.onDialogClick(false)} > + )} - this.onDialogClick(true)}> + this.onDialogClick(true)} + > diff --git a/src/viewer/rules/Dialogs/StatesDialog.tsx b/src/viewer/rules/Dialogs/StatesDialog.tsx index e7cb070..04da64c 100644 --- a/src/viewer/rules/Dialogs/StatesDialog.tsx +++ b/src/viewer/rules/Dialogs/StatesDialog.tsx @@ -154,7 +154,6 @@ export default class StatesDialog extends React.Component { const userColumns = this.state.rules .map((r, i) => r.column) .filter((name) => name != rule.column); - const defaultRuleColumn = `StateRule${ruleIndex + 1}`; const keyWidth = "100px"; const textFieldWidth = "250px"; const rows = [ @@ -165,7 +164,7 @@ export default class StatesDialog extends React.Component { value={rule.column} key="Name" onInput={(e) => - this.updateRule(rule.setColumn(e.target.value || defaultRuleColumn), ruleIndex) + this.updateRule(rule.setColumn(e.target.value), ruleIndex) } />, ], @@ -219,14 +218,19 @@ export default class StatesDialog extends React.Component { )} {this.state.showEdit && ( this.onDialogClick(false)} > )} - this.onDialogClick(true)}> + this.onDialogClick(true)} + > From 31f5f81fff27e3f08798367fd561cecd4b55950f Mon Sep 17 00:00:00 2001 From: ckitsanelis Date: Fri, 29 Sep 2023 10:57:52 +0200 Subject: [PATCH 2/8] Show that naming an annotation is required --- src/viewer/rules/Dialogs/FlagsDialog.tsx | 1 + src/viewer/rules/Dialogs/StatesDialog.tsx | 1 + 2 files changed, 2 insertions(+) diff --git a/src/viewer/rules/Dialogs/FlagsDialog.tsx b/src/viewer/rules/Dialogs/FlagsDialog.tsx index 05b4fd8..7dac8b9 100644 --- a/src/viewer/rules/Dialogs/FlagsDialog.tsx +++ b/src/viewer/rules/Dialogs/FlagsDialog.tsx @@ -184,6 +184,7 @@ export default class FlagsDialog extends React.Component { style={{ width: textFieldWidth, marginBottom: "2px" }} value={rule.column} key="Name" + placeholder="Required" onInput={(e) => this.updateRule(rule.setColumn(e.target.value), ruleIndex) } diff --git a/src/viewer/rules/Dialogs/StatesDialog.tsx b/src/viewer/rules/Dialogs/StatesDialog.tsx index 04da64c..d85437c 100644 --- a/src/viewer/rules/Dialogs/StatesDialog.tsx +++ b/src/viewer/rules/Dialogs/StatesDialog.tsx @@ -163,6 +163,7 @@ export default class StatesDialog extends React.Component { style={{ width: textFieldWidth, marginBottom: "2px" }} value={rule.column} key="Name" + placeholder="Required" onInput={(e) => this.updateRule(rule.setColumn(e.target.value), ruleIndex) } From 041b42550e13767b14ecbee726ffefd74f69c15d Mon Sep 17 00:00:00 2001 From: ckitsanelis Date: Mon, 2 Oct 2023 15:35:14 +0200 Subject: [PATCH 3/8] Streamline naming convention of dialog actions --- src/viewer/App.tsx | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/viewer/App.tsx b/src/viewer/App.tsx index 83f26cc..0920b64 100644 --- a/src/viewer/App.tsx +++ b/src/viewer/App.tsx @@ -195,12 +195,12 @@ export default class App extends React.Component { } } - handleDialogActions(newRules: Rule[], is_close: boolean) { + handleAnnotationDialog(newRules: Rule[], is_close: boolean) { this.vscode.postMessage({ type: "saveRules", rules: newRules.map((r) => r.toJSON()) }); if (is_close === true) this.setState({ rules: newRules, - logFile: this.state.logFile.update(newRules), + logFile: this.state.logFile.updateRules(newRules), showStatesDialog: false, showFlagsDialog: false, }); @@ -217,7 +217,7 @@ export default class App extends React.Component { } } - handleStructureDialogActions(isClosing: boolean) { + handleStructureDialog(isClosing: boolean) { if (isClosing === true) { logHeaderColumnTypes = []; this.handleStructureUpdate(isClosing); @@ -605,7 +605,7 @@ export default class App extends React.Component { > this.handleStructureDialogActions(false)} + onClick={() => this.handleStructureDialog(false)} > @@ -655,16 +655,16 @@ export default class App extends React.Component { this.handleDialogActions(newRules, true)} - onReturn={(newRules) => this.handleDialogActions(newRules, false)} + onClose={(newRules) => this.handleAnnotationDialog(newRules, true)} + onReturn={(newRules) => this.handleAnnotationDialog(newRules, false)} /> )} {this.state.showFlagsDialog && ( this.handleDialogActions(newRules, true)} - onReturn={(newRules) => this.handleDialogActions(newRules, false)} + onClose={(newRules) => this.handleAnnotationDialog(newRules, true)} + onReturn={(newRules) => this.handleAnnotationDialog(newRules, false)} /> )} {this.state.showSelectDialog && ( @@ -687,7 +687,7 @@ export default class App extends React.Component { logSelectedRows={this.state.selectedLogRows} currentStructureMatchIndex={this.state.currentStructureMatchIndex} numberOfMatches={this.state.structureMatches.length} - onClose={() => this.handleStructureDialogActions(true)} + onClose={() => this.handleStructureDialog(true)} onStructureUpdate={() => this.handleStructureUpdate(false)} onMatchStructure={(expression) => this.handleStructureMatching(expression)} onDefineSegment={(entryExpression, exitExpression) => From bd19e068be99a4550bfdb698bd8105b422e671cc Mon Sep 17 00:00:00 2001 From: ckitsanelis Date: Mon, 2 Oct 2023 15:36:18 +0200 Subject: [PATCH 4/8] Fix issue with selected columns on logfile update --- src/viewer/LogFile.tsx | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/src/viewer/LogFile.tsx b/src/viewer/LogFile.tsx index 469a5fe..ddd12ee 100644 --- a/src/viewer/LogFile.tsx +++ b/src/viewer/LogFile.tsx @@ -39,13 +39,32 @@ export default class LogFile { return logFile; } - update(rules: Rule[]): LogFile { + updateRules(rules: Rule[]): LogFile { + this.updateSelectedColumns(rules); this.updateHeaders(rules); this.computeRulesValuesAndColors(rules); - this.setSelectedColumns(this.selectedColumns, this.selectedColumnsMini); //only show the selected columns after updating the rules return this; } + updateSelectedColumns(rules: Rule[]) { + let existingHeaders = this.headers.map(h => h.name); + let updatedSelected = this.selectedColumns.slice(0, this.contentHeaders.length); + let updatedSelectedMini = this.selectedColumnsMini.slice(0, this.contentHeaders.length); + + for (let i = 0; i < rules.length; i++) { + let existingIndex = existingHeaders.indexOf(rules[i].column); + if (existingIndex > -1) { + updatedSelected.push(this.selectedColumns[existingIndex]); + updatedSelectedMini.push(this.selectedColumnsMini[existingIndex]); + } + else { + updatedSelected.push(true); + updatedSelectedMini.push(true); + } + } + this.setSelectedColumns(updatedSelected, updatedSelectedMini); + } + setSelectedColumns(selected: boolean[], selectedMini: boolean[]) { for (let column = 0; column < this.selectedColumns.length; column++) { if (selected[column] !== undefined) { From 30ca9184c1ac12067145d2f4fb695085b2f93c54 Mon Sep 17 00:00:00 2001 From: ckitsanelis Date: Mon, 2 Oct 2023 16:39:58 +0200 Subject: [PATCH 5/8] Minor fix on state update --- src/viewer/App.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/viewer/App.tsx b/src/viewer/App.tsx index 0920b64..2b9b807 100644 --- a/src/viewer/App.tsx +++ b/src/viewer/App.tsx @@ -211,6 +211,7 @@ export default class App extends React.Component { if (is_close === true) { this.setState({ selectedColumns: selectedCols, + selectedColumnsMini: selectedColsMini, logFile: this.state.logFile.setSelectedColumns(selectedCols, selectedColsMini), showSelectDialog: false, }); From 6b43630f623dfb76e0002e59604f2b9e116b5f4b Mon Sep 17 00:00:00 2001 From: ckitsanelis Date: Mon, 2 Oct 2023 20:47:21 +0200 Subject: [PATCH 6/8] Sub-optimal solution for rule update --- src/viewer/LogFile.tsx | 14 ++++++++++++++ 1 file changed, 14 insertions(+) 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; From ff7c3b781e82375bf41a225c9ba4ef9343ce1238 Mon Sep 17 00:00:00 2001 From: ckitsanelis Date: Tue, 3 Oct 2023 09:29:08 +0200 Subject: [PATCH 7/8] Update selected columns on rule update --- src/viewer/LogFile.tsx | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/src/viewer/LogFile.tsx b/src/viewer/LogFile.tsx index 4dd0c72..7b29987 100644 --- a/src/viewer/LogFile.tsx +++ b/src/viewer/LogFile.tsx @@ -40,17 +40,20 @@ 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); - return this; + // Slower solution + let [updatedSelected, updatedSelectedMini] = this.updateSelectedColumns(rules) + const headers = LogFile.getHeaders(this.contentHeaders, rules); + let logFile = new LogFile(this.contentHeaders, headers, this.rows); + logFile.copyDefaultColumnColors(this.columnsColors); + logFile.computeRulesValuesAndColors(rules); + logFile = logFile.setSelectedColumns(updatedSelected, updatedSelectedMini); + return logFile; + + // Old solution + // this.updateSelectedColumns(rules); + // this.updateHeaders(rules); + // this.computeRulesValuesAndColors(rules); + // return this; } updateSelectedColumns(rules: Rule[]) { @@ -69,7 +72,7 @@ export default class LogFile { updatedSelectedMini.push(true); } } - this.setSelectedColumns(updatedSelected, updatedSelectedMini); + return [updatedSelected, updatedSelectedMini] } setSelectedColumns(selected: boolean[], selectedMini: boolean[]) { @@ -125,11 +128,10 @@ export default class LogFile { } } - private copyDefaultColumnColors(logFile: LogFile, colours: string[][]) { + private copyDefaultColumnColors(colours: string[][]) { for (let i = 0; i < this.contentHeaders.length; i++) { - logFile.columnsColors[i] = colours[i]; + this.columnsColors[i] = colours[i]; } - return logFile } private computeRulesValuesAndColors(rules: Rule[]) { From c8ce613e7e30475d65ef8cf98d23213adacc5178 Mon Sep 17 00:00:00 2001 From: ckitsanelis Date: Tue, 3 Oct 2023 10:50:24 +0200 Subject: [PATCH 8/8] Fix naming convention --- src/viewer/App.tsx | 8 ++++---- src/viewer/LogFile.tsx | 15 +++++++-------- src/viewer/log/SelectColDialog.tsx | 4 ++-- src/viewer/rules/Dialogs/FlagsDialog.tsx | 16 ++++++++-------- src/viewer/rules/Dialogs/StatesDialog.tsx | 14 +++++++------- src/viewer/rules/StateBasedRule.tsx | 6 +++--- src/viewer/rules/Tables/FlagTable.tsx | 6 +++--- src/viewer/rules/Tables/TransitionTable.tsx | 6 +++--- 8 files changed, 37 insertions(+), 38 deletions(-) diff --git a/src/viewer/App.tsx b/src/viewer/App.tsx index a307a9a..0424772 100644 --- a/src/viewer/App.tsx +++ b/src/viewer/App.tsx @@ -196,9 +196,9 @@ export default class App extends React.Component { } } - handleAnnotationDialog(newRules: Rule[], is_close: boolean) { + handleAnnotationDialog(newRules: Rule[], isClose: boolean) { this.vscode.postMessage({ type: "saveRules", rules: newRules.map((r) => r.toJSON()) }); - if (is_close === true) + if (isClose === true) this.setState({ rules: newRules, logFile: this.state.logFile.updateRules(newRules), @@ -208,8 +208,8 @@ export default class App extends React.Component { else this.setState({ rules: newRules }); } - handleSelectDialog(selectedCols: boolean[], selectedColsMini: boolean[], is_close: boolean) { - if (is_close === true) { + handleSelectDialog(selectedCols: boolean[], selectedColsMini: boolean[], isClose: boolean) { + if (isClose === true) { this.setState({ selectedColumns: selectedCols, selectedColumnsMini: selectedColsMini, diff --git a/src/viewer/LogFile.tsx b/src/viewer/LogFile.tsx index 7b29987..ab9dfde 100644 --- a/src/viewer/LogFile.tsx +++ b/src/viewer/LogFile.tsx @@ -41,13 +41,12 @@ export default class LogFile { updateRules(rules: Rule[]): LogFile { // Slower solution - let [updatedSelected, updatedSelectedMini] = this.updateSelectedColumns(rules) + const [updatedSelected, updatedSelectedMini] = this.updateSelectedColumns(rules) const headers = LogFile.getHeaders(this.contentHeaders, rules); - let logFile = new LogFile(this.contentHeaders, headers, this.rows); + const logFile = new LogFile(this.contentHeaders, headers, this.rows); logFile.copyDefaultColumnColors(this.columnsColors); logFile.computeRulesValuesAndColors(rules); - logFile = logFile.setSelectedColumns(updatedSelected, updatedSelectedMini); - return logFile; + return logFile.setSelectedColumns(updatedSelected, updatedSelectedMini); // Old solution // this.updateSelectedColumns(rules); @@ -57,12 +56,12 @@ export default class LogFile { } updateSelectedColumns(rules: Rule[]) { - let existingHeaders = this.headers.map(h => h.name); - let updatedSelected = this.selectedColumns.slice(0, this.contentHeaders.length); - let updatedSelectedMini = this.selectedColumnsMini.slice(0, this.contentHeaders.length); + const existingHeaders = this.headers.map(h => h.name); + const updatedSelected = this.selectedColumns.slice(0, this.contentHeaders.length); + const updatedSelectedMini = this.selectedColumnsMini.slice(0, this.contentHeaders.length); for (let i = 0; i < rules.length; i++) { - let existingIndex = existingHeaders.indexOf(rules[i].column); + const existingIndex = existingHeaders.indexOf(rules[i].column); if (existingIndex > -1) { updatedSelected.push(this.selectedColumns[existingIndex]); updatedSelectedMini.push(this.selectedColumnsMini[existingIndex]); diff --git a/src/viewer/log/SelectColDialog.tsx b/src/viewer/log/SelectColDialog.tsx index b258676..4d98705 100644 --- a/src/viewer/log/SelectColDialog.tsx +++ b/src/viewer/log/SelectColDialog.tsx @@ -94,9 +94,9 @@ export default class SelectColDialog extends React.Component { ); } - onDialogClick(is_close: boolean) { + onDialogClick(isClose: boolean) { this.setState({ showDialog: false }, () => { - if (is_close === true) this.props.onClose(this.state.selectedCol, this.state.selectedColMini); + if (isClose === true) this.props.onClose(this.state.selectedCol, this.state.selectedColMini); }); } diff --git a/src/viewer/rules/Dialogs/FlagsDialog.tsx b/src/viewer/rules/Dialogs/FlagsDialog.tsx index 7dac8b9..d6b3eec 100644 --- a/src/viewer/rules/Dialogs/FlagsDialog.tsx +++ b/src/viewer/rules/Dialogs/FlagsDialog.tsx @@ -95,14 +95,14 @@ export default class FlagsDialog extends React.Component { this.setState({ rules }); } - onDialogClick(is_close: boolean) { + onDialogClick(isClose: boolean) { const ruleIndex = this.state.selectedRule; if (ruleIndex !== -1) { const rule = this.state.rules[ruleIndex].reset(); this.updateRule(rule, ruleIndex); } this.setState({ showEdit: false }, () => { - if (is_close === true) this.props.onClose(this.state.rules); + if (isClose === true) this.props.onClose(this.state.rules); else this.props.onReturn(this.state.rules); }); } @@ -124,16 +124,16 @@ export default class FlagsDialog extends React.Component { }); }; - const onEditAction = (table_index: number) => { + const onEditAction = (tableIndex: number) => { const index = this.state.rules.findIndex( - (x) => x === this.state.rules.filter((r) => r.ruleType === "Flag rule")[table_index], + (x) => x === this.state.rules.filter((r) => r.ruleType === "Flag rule")[tableIndex], ); this.setState({ showEdit: true, selectedRule: index }); }; - const onDeleteAction = (table_index: number) => { + const onDeleteAction = (tableIndex: number) => { const index = this.state.rules.findIndex( - (x) => x === this.state.rules.filter((r) => r.ruleType === "Flag rule")[table_index], + (x) => x === this.state.rules.filter((r) => r.ruleType === "Flag rule")[tableIndex], ); if (this.state.selectedRule === index) this.setState({ selectedRule: -1 }); this.setState({ rules: this.state.rules.filter((r, i) => i !== index) }); @@ -202,7 +202,7 @@ export default class FlagsDialog extends React.Component { [ "Type", 0 ? true : false} + disabled={ruleAsFlag.flags.length > 0} style={{ width: textFieldWidth, marginBottom: "2px" }} value={flagType} key="Type" @@ -264,7 +264,7 @@ export default class FlagsDialog extends React.Component { this.onDialogClick(false)} > diff --git a/src/viewer/rules/Dialogs/StatesDialog.tsx b/src/viewer/rules/Dialogs/StatesDialog.tsx index d85437c..e8410d2 100644 --- a/src/viewer/rules/Dialogs/StatesDialog.tsx +++ b/src/viewer/rules/Dialogs/StatesDialog.tsx @@ -82,14 +82,14 @@ export default class StatesDialog extends React.Component { this.setState({ rules }); } - onDialogClick(is_close: boolean) { + onDialogClick(isClose: boolean) { const ruleIndex = this.state.selectedRule; if (ruleIndex !== -1) { const rule = this.state.rules[ruleIndex].reset(); this.updateRule(rule, ruleIndex); } this.setState({ showEdit: false }, () => { - if (is_close === true) this.props.onClose(this.state.rules); + if (isClose === true) this.props.onClose(this.state.rules); else this.props.onReturn(this.state.rules); }); } @@ -111,16 +111,16 @@ export default class StatesDialog extends React.Component { }); }; - const onEditAction = (table_index: number) => { + const onEditAction = (tableIndex: number) => { const index = this.state.rules.findIndex( - (x) => x === this.state.rules.filter((r) => r.ruleType === "State based rule")[table_index], + (x) => x === this.state.rules.filter((r) => r.ruleType === "State based rule")[tableIndex], ); this.setState({ showEdit: true, selectedRule: index }); }; - const onDeleteAction = (table_index: number) => { + const onDeleteAction = (tableIndex: number) => { const index = this.state.rules.findIndex( - (x) => x === this.state.rules.filter((r) => r.ruleType === "State based rule")[table_index], + (x) => x === this.state.rules.filter((r) => r.ruleType === "State based rule")[tableIndex], ); if (this.state.selectedRule === index) this.setState({ selectedRule: -1 }); this.setState({ rules: this.state.rules.filter((r, i) => i !== index) }); @@ -221,7 +221,7 @@ export default class StatesDialog extends React.Component { this.onDialogClick(false)} > diff --git a/src/viewer/rules/StateBasedRule.tsx b/src/viewer/rules/StateBasedRule.tsx index 966a3ec..2fadb9b 100644 --- a/src/viewer/rules/StateBasedRule.tsx +++ b/src/viewer/rules/StateBasedRule.tsx @@ -132,16 +132,16 @@ export default class StateBasedRule extends Rule { user_columns: string[], logFile: LogFile, ) { - const editStateName = (state_index: number, value: string) => { + const editStateName = (stateIndex: number, value: string) => { const states = [...this.ruleStates]; - const previousName = states[state_index].name; + const previousName = states[stateIndex].name; for (let i = 0; i < states.length; i++) { for (let j = 0; j < states[i].transitions.length; j++) { if (states[i].transitions[j].destination === previousName) states[i].transitions[j].destination = value; } } - states[state_index] = { ...states[state_index], ["name"]: value }; + states[stateIndex] = { ...states[stateIndex], ["name"]: value }; onEdit(this.setStates(states, this.initialStateIndex)); }; diff --git a/src/viewer/rules/Tables/FlagTable.tsx b/src/viewer/rules/Tables/FlagTable.tsx index 78d740d..2a22840 100644 --- a/src/viewer/rules/Tables/FlagTable.tsx +++ b/src/viewer/rules/Tables/FlagTable.tsx @@ -7,10 +7,10 @@ interface Props { hideHeader?: boolean; noRowsText?: string; highlightRow?: number | null; - onAddSubconditionAction?: (condition_index: number) => void; - onDeleteSubconditionAction?: (condition_index: number, sub_index: number) => void; + onAddSubconditionAction?: (conditionIndex: number) => void; + onDeleteSubconditionAction?: (conditionIndex: number, subconditionIndex: number) => void; onAddConditionAction?: () => void; - onDeleteConditionAction?: (condition_index: number) => void; + onDeleteConditionAction?: (conditionIndex: number) => void; } const ACTIONS_WIDTH = "50px"; diff --git a/src/viewer/rules/Tables/TransitionTable.tsx b/src/viewer/rules/Tables/TransitionTable.tsx index 76a3ee0..b1615a0 100644 --- a/src/viewer/rules/Tables/TransitionTable.tsx +++ b/src/viewer/rules/Tables/TransitionTable.tsx @@ -7,10 +7,10 @@ interface Props { hideHeader?: boolean; noRowsText?: string; highlightRow?: number | null; - onAddConditionAction?: (transition_index: number) => void; - onDeleteConditionAction?: (transition_index: number, condition_index: number) => void; + onAddConditionAction?: (transitionIndex: number) => void; + onDeleteConditionAction?: (transitionIndex: number, conditionIndex: number) => void; onAddTransitionAction?: () => void; - onDeleteTransitionAction?: (transition_index: number) => void; + onDeleteTransitionAction?: (transitionIndex: number) => void; } const ACTIONS_WIDTH = "50px";