diff --git a/src/calc2/components/editorBase.tsx b/src/calc2/components/editorBase.tsx index f8e7a06e..f14c71ba 100644 --- a/src/calc2/components/editorBase.tsx +++ b/src/calc2/components/editorBase.tsx @@ -316,7 +316,6 @@ class Relation { attributes: Attribute[]; constructor() { - console.log('called constructor...'); this.name = ''; this.attributes = []; } @@ -330,7 +329,6 @@ class Relation { str = '{ '; } const rows = new Array(); - console.log(this.attributes); for (let i = 0; i < (1 + this.attributes[0].data.length); i++) { rows.push(''); } @@ -404,7 +402,6 @@ class Relation { this.attributes.push(attribute); } } - console.log(this.attributes); } } @@ -1304,7 +1301,6 @@ export class EditorBase extends React.Component { const { result } = this.props.execFunction(this, query, offset); const end = Date.now() - start; this.getResultForCsv(result.props.root); - console.log(result); this.setState({ execResult: result, execTime: end, diff --git a/src/calc2/components/editorRelalg.tsx b/src/calc2/components/editorRelalg.tsx index 70d48b15..630b6c2f 100644 --- a/src/calc2/components/editorRelalg.tsx +++ b/src/calc2/components/editorRelalg.tsx @@ -128,9 +128,7 @@ export class EditorRelalg extends React.Component { // replace text (text-magic) if (editor.getDoc().somethingSelected() === false) { const cursorOld: { line: number, ch: number } = editor.getDoc().getCursor(); - const { query, cursor } = queryWithReplacedOperatorsFromAst(text, ast.operatorPositions, { line: cursorOld.line + 1, column: cursorOld.ch + 1 }, autoreplaceOperatorsMode); - if (query !== text) { editor.setValue(query); editor.getDoc().setCursor({ line: cursor.line - 1, ch: cursor.column - 1 }); diff --git a/src/calc2/components/editorSql.tsx b/src/calc2/components/editorSql.tsx index 46ffedaf..94805b65 100644 --- a/src/calc2/components/editorSql.tsx +++ b/src/calc2/components/editorSql.tsx @@ -64,7 +64,6 @@ export class EditorSql extends React.Component { execFunction={(self: EditorBase, text: string, offset) => { const ast = parseSQLSelect(text); replaceVariables(ast, relations); - console.log(self.state) if (ast.child === null) { if (ast.assignments.length > 0) { diff --git a/src/calc2/components/result.tsx b/src/calc2/components/result.tsx index aa7e18d8..3de4f1d5 100644 --- a/src/calc2/components/result.tsx +++ b/src/calc2/components/result.tsx @@ -61,9 +61,8 @@ export class Result extends React.Component { } render() { - const { root, numTreeLabelColors,execTime } = this.props; + const { root, numTreeLabelColors, execTime } = this.props; const { activeNode } = this.state; - console.log(this.props) const result = this.result(activeNode); diff --git a/src/calc2/views/landing.tsx b/src/calc2/views/landing.tsx index d3177334..99c50382 100644 --- a/src/calc2/views/landing.tsx +++ b/src/calc2/views/landing.tsx @@ -407,6 +407,11 @@ export class Landing extends React.Component {

Changelog

    +
  • 0.24 - Released 17.06.2022 +
      +
    • Fixed problem when replacing multiple operators | #174
    • +
    +
  • 0.23 - Released 16.06.2022
    • Added dataset from OTH Regensburg - Webshop
    • diff --git a/src/db/relalg.ts b/src/db/relalg.ts index 86ac5c67..e3f57f39 100644 --- a/src/db/relalg.ts +++ b/src/db/relalg.ts @@ -82,11 +82,10 @@ export function queryWithReplacedOperatorsFromAst( 'fullOuterJoinOperator': '⟗', }, }; - for (let i = operatorPositions.length - 1; i >= 0; i--) { const op = operatorPositions[i]; const location = op.location; // = location without surrounding whitespace - const left = query.substr(0, location.start.offset); + const left = query.substr(0, location.start.offset - 1); // fixed offset | #174 const right = query.substring(location.end.offset); const newOperator = (newOperators[mode] as any)[op.name]; // TODO: fix typings const oldOperator = query.substring(location.start.offset, location.end.offset); @@ -121,7 +120,6 @@ export function queryWithReplacedOperatorsFromAst( cursor.line -= location.end.line - location.start.line; } } - // update query query = left + newOperator + right; }