<% content_for :title, 'CSV Upload Mapping' %> <% content_for :breadcrumbs do %> <% end %>

An Issue ID must be selected.

A Node Label must be selected to import evidence records.

<%= form_with url: project_upload_index_path(current_project, format: :js), method: :post, data: { behavior: 'mapping-form' } do |f| %> <%= hidden_field_tag 'log_uid', @log_uid %> <%= hidden_field_tag 'job_id', params[:job_id] %> <%= hidden_field_tag 'attachment', params[:attachment] %> <% @headers.each_with_index do |header, index| %> <% end %>
Column Header Entity Dradis Field
<%= header %>
<%= f.select "mappings[field_attributes][#{index}][type]", [['Issue Field', 'issue'], ['Issue ID', 'identifier'], ['Evidence Field', 'evidence'], ['Node', 'node'], ['─'.html_safe, 'divider'], ['Do Not Import','skip']], { disabled: 'divider' }, class: 'form-control custom-select w-75', data: { behavior: 'type-select' } %>
<% if @rtp_fields %>
<% issue_options = @rtp_fields[:issue].any? ? options_for_select(@rtp_fields[:issue]) : options_for_select([[header, header]], disabled: header, selected: header) %> <%= f.select "mappings[field_attributes][#{index}][field]", issue_options, {}, class: 'form-control custom-select w-75 field-select', data: { behavior: 'issue-field-select', header: header } %> <% evidence_options = @rtp_fields[:evidence].any? ? options_for_select(@rtp_fields[:evidence]) : options_for_select([[header, header]], disabled: header, selected: header) %> <%= f.select "mappings[field_attributes][#{index}][field]", evidence_options, {}, disabled: true, class: 'form-control custom-select w-75 field-select d-none', data: { behavior: 'evidence-field-select', header: header } %> <%= f.select "mappings[field_attributes][#{index}][field]", [['N/A', '']], {}, disabled: true, class: 'form-control custom-select w-75 field-select d-none', data: { behavior: 'empty-field-select', header: header } %>
<% else %> " ><%= header.delete(" \t\r\n") %> <% end %>
<%= f.submit 'Import CSV', class: 'btn btn-primary mr-1', data: { disable_with: false } %> or <%= link_to 'Cancel', main_app.project_upload_manager_path(current_project) %>
<% end %>

Output console

<%= content_tag :div, id: 'result', style: 'display:none', data: { url: main_app.status_console_index_path } do %>
<% end %>