Skip to content

Commit

Permalink
Fix #294 (#295)
Browse files Browse the repository at this point in the history
* Fix console issue
  • Loading branch information
mboudet committed Oct 18, 2021
1 parent 8295f28 commit bf06552
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
4 changes: 3 additions & 1 deletion askomics/api/results.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ def get_graph_and_sparql_query():
# Get all graphs and endpoint, and mark as selected the used one
query = SparqlQuery(current_app, session)
graphs, endpoints = query.get_graphs_and_endpoints(selected_graphs=graphs, selected_endpoints=endpoints)
console_enabled = can_access(session['user'])

except Exception as e:
traceback.print_exc(file=sys.stdout)
Expand All @@ -186,7 +187,8 @@ def get_graph_and_sparql_query():
'endpoints': endpoints,
'diskSpace': disk_space,
'error': False,
'errorMessage': ''
'errorMessage': '',
'console_enabled': console_enabled
})


Expand Down
7 changes: 5 additions & 2 deletions askomics/react/src/routes/ask/ask.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ export default class Ask extends Component {
dropdownOpen: false,
selectedEndpoint: [],
frontMessage: "",
redirectFormBuilder: false
redirectFormBuilder: false,
console_enabled: false
}
this.utils = new Utils()
this.cancelRequest
Expand Down Expand Up @@ -155,6 +156,7 @@ export default class Ask extends Component {
graphs: response.data.graphs,
endpoints_sparql: response.data.endpoints,
diskSpace: response.data.diskSpace,
console_enabled: response.data.console_enabled
})
}
})
Expand Down Expand Up @@ -276,7 +278,8 @@ export default class Ask extends Component {
graphs: this.state.graphs,
endpoints: this.state.endpoints_sparql,
diskSpace: this.state.diskSpace,
config: this.props.config
config: this.props.config,
console_enabled: this.state.console_enabled
}
}} />
}
Expand Down
3 changes: 2 additions & 1 deletion askomics/react/src/routes/results/resultsfilestable.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ export default class ResultsFilesTable extends Component {
status: null,
modalTracebackTitle: "",
modalTracebackContent: "",
modalTraceback: false
modalTraceback: false,
console_enabled: false
}
this.utils = new Utils()
this.handleSelection = this.handleSelection.bind(this)
Expand Down
3 changes: 2 additions & 1 deletion tests/results/sparql_and_graph.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
},
"error": false,
"errorMessage": "",
"console_enabled": true,
"graphState": {
"attr": [
{
Expand Down Expand Up @@ -435,4 +436,4 @@
}
},
"sparqlQuery": null
}
}

0 comments on commit bf06552

Please sign in to comment.