Only show use_cached_job options if user has activated this feature in the user preferences

This commit is contained in:
mvdbeek
2017-12-31 18:06:49 +02:00
parent e973403ae5
commit 3f34764958
2 changed files with 37 additions and 29 deletions
@@ -314,24 +314,28 @@ var View = Backbone.View.extend({
/** Render job caching option */
_renderUseCachedJob: function() {
this.job_options_form = new Form({
cls: "ui-portlet-narrow",
title: "<b>Job re-use Options</b>",
inputs: [
{
type: "conditional",
name: "use_cached_job",
test_param: {
name: "check",
label: "BETA: Attempt to reuse jobs with identical parameters?",
type: "boolean",
value: "false",
help: "This may skip executing jobs that you have already run."
},
}
]
});
this._append(this.$steps, this.job_options_form.$el);
var extra_user_preferences = JSON.parse(Galaxy.user.attributes.preferences.extra_user_preferences);
var use_cached_job = 'use_cached_job|use_cached_job_checkbox' in extra_user_preferences ? extra_user_preferences['use_cached_job|use_cached_job_checkbox'] : false ;
if (use_cached_job === 'true'){
this.job_options_form = new Form({
cls: "ui-portlet-narrow",
title: "<b>Job re-use Options</b>",
inputs: [
{
type: "conditional",
name: "use_cached_job",
test_param: {
name: "check",
label: "BETA: Attempt to reuse jobs with identical parameters?",
type: "boolean",
value: "false",
help: "This may skip executing jobs that you have already run."
},
}
]
});
this._append(this.$steps, this.job_options_form.$el);
}
},
/** Render step */
+15 -11
View File
@@ -149,17 +149,21 @@ var View = Backbone.View.extend({
});
}
// Job Re-use Options
options.inputs.push({
label: "BETA: Attempt to re-use jobs with identical parameters ?",
help: "This may skip executing jobs that you have already run",
name: "use_cached_job",
type: "select",
display: "radio",
ignore: "__ignore__",
value: "__ignore__",
options: [["No", false], ["Yes", true]],
});
// Job Re-use Options
var extra_user_preferences = JSON.parse(Galaxy.user.attributes.preferences.extra_user_preferences);
var use_cached_job = 'use_cached_job|use_cached_job_checkbox' in extra_user_preferences ? extra_user_preferences['use_cached_job|use_cached_job_checkbox'] : false ;
if (use_cached_job === 'true'){
options.inputs.push({
label: "BETA: Attempt to re-use jobs with identical parameters ?",
help: "This may skip executing jobs that you have already run",
name: "use_cached_job",
type: "select",
display: "radio",
ignore: "__ignore__",
value: "__ignore__",
options: [["No", false], ["Yes", true]],
});
}
},
/** Submit a regular job.