diff --git a/app/controllers/ui_job_wizard_controller.rb b/app/controllers/ui_job_wizard_controller.rb index b9ae20f8d..0e56ad784 100644 --- a/app/controllers/ui_job_wizard_controller.rb +++ b/app/controllers/ui_job_wizard_controller.rb @@ -64,7 +64,10 @@ def job_invocation job = JobInvocation.authorized.find(params[:id]) composer = JobInvocationComposer.from_job_invocation(job, params).params job_template_inputs = JobTemplate.authorized.find(composer[:template_invocations][0][:template_id]).template_inputs_with_foreign - inputs = Hash[job_template_inputs.map { |input| ["inputs[#{input[:name]}]", {:advanced => input[:advanced], :value => (composer[:template_invocations][0][:input_values].find { |value| value[:template_input_id] == input[:id] }).try(:[], :value)}] }] + job_template_inputs_hash = Hash[job_template_inputs.map { |input| ["inputs[#{input[:name]}]", {:advanced => input[:advanced], :value => (composer[:template_invocations][0][:input_values].find { |value| value[:template_input_id] == input[:id] }).try(:[], :value)}] }] + provider_inputs = composer[:template_invocations][0][:provider_input_values] + provider_inputs_hash = Hash[provider_inputs.map { |input| ["inputs[#{input[:name]}]", {:advanced => true, :value => input[:value]}] }] + inputs = job_template_inputs_hash.merge(provider_inputs_hash) job_organization = Taxonomy.find_by(id: job.task.input[:current_organization_id]) job_location = Taxonomy.find_by(id: job.task.input[:current_location_id]) render :json => { diff --git a/app/models/job_invocation_composer.rb b/app/models/job_invocation_composer.rb index 3916697e7..185b80a22 100644 --- a/app/models/job_invocation_composer.rb +++ b/app/models/job_invocation_composer.rb @@ -271,6 +271,7 @@ def template_invocations_params job_invocation.pattern_template_invocations.map do |template_invocation| params = template_invocation.attributes.slice('template_id', 'effective_user') params['input_values'] = template_invocation.input_values.map { |v| v.attributes.slice('template_input_id', 'value') } + params['provider_input_values'] = template_invocation.provider_input_values.map { |v| v.attributes.slice('name', 'value') } params end end