Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions qiita_db/processing_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -628,7 +628,7 @@ def _complete_artifact_transformation(self, artifacts_data):
"""
validator_jobs = []
with qdb.sql_connection.TRN:
cmd = self.command
cmd_id = self.command.id
for out_name, a_data in viewitems(artifacts_data):
# Correct the format of the filepaths parameter so we can
# create a validate job
Expand Down Expand Up @@ -675,7 +675,7 @@ def _complete_artifact_transformation(self, artifacts_data):
sql = """SELECT command_output_id
FROM qiita.command_output
WHERE name = %s AND command_id = %s"""
qdb.sql_connection.TRN.add(sql, [out_name, cmd.id])
qdb.sql_connection.TRN.add(sql, [out_name, cmd_id])
cmd_out_id = qdb.sql_connection.TRN.execute_fetchlast()
naming_params = self.command.naming_order
if naming_params:
Expand Down
61 changes: 46 additions & 15 deletions qiita_pet/static/js/networkVue.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,42 @@ Vue.component('processing-graph', {
props: ['portal', 'graph-endpoint', 'jobs-endpoint', 'no-init-jobs-callback', 'is-analysis-pipeline'],
methods: {
/**
*
* Enables the graph interaction
*
**/
enableGraphInteraction: function () {
let vm = this;
$('#interaction-btn').removeClass('btn-danger').addClass('btn-success').html('Enabled');
options = {interaction: { dragNodes: false,
dragView: true,
zoomView: true,
selectConnectedEdges: true,
navigationButtons: true,
keyboard: false}};
vm.network.setOptions(options);
},

/**
*
* Disables the graph interaction
*
**/
disableGraphInteraction: function() {
let vm = this;
$('#interaction-btn').removeClass('btn-success').addClass('btn-danger').html('Disabled');
options = {interaction: { dragNodes: false,
dragView: false,
zoomView: false,
selectConnectedEdges: false,
navigationButtons: false,
keyboard: false}};
vm.network.setOptions(options);
},

/**
*
* Resets the zoom view of the graph
*
**/
resetZoom: function () {
Expand All @@ -57,28 +93,16 @@ Vue.component('processing-graph', {
/**
*
* Enables/Disables the interaction with the graph
*
**/
toggleGraphInteraction: function () {
let vm = this;
var options;
if ($('#interaction-btn').hasClass('btn-danger')) {
$('#interaction-btn').removeClass('btn-danger').addClass('btn-success').html('Enabled');
options = {interaction: { dragNodes: false,
dragView: true,
zoomView: true,
selectConnectedEdges: true,
navigationButtons: true,
keyboard: false}};
vm.enableGraphInteraction();
} else {
$('#interaction-btn').removeClass('btn-success').addClass('btn-danger').html('Disabled');
options = {interaction: { dragNodes: false,
dragView: false,
zoomView: false,
selectConnectedEdges: false,
navigationButtons: false,
keyboard: false}};
vm.disableGraphInteraction();
}
vm.network.setOptions(options);
},

/**
Expand Down Expand Up @@ -704,6 +728,13 @@ Vue.component('processing-graph', {
}
}
});

// Make sure that the button and the behavior matches
if ($('#interaction-btn').hasClass('btn-danger')) {
vm.disableGraphInteraction();
} else {
vm.enableGraphInteraction();
}
},

/**
Expand Down