Skip to content

Commit

Permalink
Merge pull request #2346 from sparc-request/kg-multiple_irbs
Browse files Browse the repository at this point in the history
KG - Import/Remove IRB From RMID Search
  • Loading branch information
Stuart-Johnson committed May 15, 2020
2 parents 32d2ffc + 855e689 commit 9108cad
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 9 deletions.
8 changes: 4 additions & 4 deletions app/assets/javascripts/protocol_form.js.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -230,10 +230,10 @@ resetRmidFields = () ->
$('#protocol_research_master_id').parents('.form-group').removeClass('is-valid is-invalid')
$('#protocol_short_title').val('').prop('readonly', false)
$('#protocol_title').val('').prop('readonly', false)
$('#protocol_human_subjects_info_attributes_pro_number').val('').prop('readonly', false)
$('#protocol_human_subjects_info_attributes_initial_irb_approval_date').prop('readonly', false).datetimepicker('clear')
$('#protocol_human_subjects_info_attributes_irb_approval_date').prop('readonly', false).datetimepicker('clear')
$('#protocol_human_subjects_info_attributes_irb_expiration_date').prop('readonly', false).datetimepicker('clear')
if $('#protocol_research_types_info_attributes_human_subjects').prop('checked')
$('#protocol_research_types_info_attributes_human_subjects').click()
$('#protocol_research_master_id').click()
$('#irbRecords .irb-record').remove()

fundingSource = ""
potentialFundingSource = ""
Expand Down
2 changes: 2 additions & 0 deletions app/views/irb_records/_form.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
.modal-header
%h3.modal-title
= t("irb_records.form.#{action_name}")
%button.close{ type: 'button', data: { dismiss: 'modal' }, aria: { label: t('actions.close') } }
%span{ aria: { hidden: 'true' } } ×
.modal-body
.form-row
.form-group.col-6
Expand Down
3 changes: 2 additions & 1 deletion app/views/irb_records/create.js.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,6 @@ $('.primary-irb .delete-irb').addClass('text-muted').removeClass('text-danger').
attr('data-original-title', I18n.t('irb_records.tooltips.cant_delete_primary'))
<% end %>

$("#modalContainer").modal('hide')
if $('#modalContainer').hasClass('show')
$("#modalContainer").modal('hide')
<% end %>
11 changes: 7 additions & 4 deletions app/views/protocols/validate_rmid.js.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,12 @@ $('#protocol_short_title').val("<%= @rmid_record['short_title'] %>").prop('reado
$('#protocol_title').val("<%= @rmid_record['long_title'] %>").prop('readonly', true)

<% if @rmid_record['eirb_validated'] %>
$('#protocol_human_subjects_info_attributes_pro_number').val("<%= @rmid_record['eirb_pro_number'] %>").prop('readonly', true)
$('#protocol_human_subjects_info_attributes_initial_irb_approval_date').val("<%= @rmid_record['date_initially_approved'] %>").prop('readonly', true)
$('#protocol_human_subjects_info_attributes_irb_approval_date').val("<%= @rmid_record['date_approved'] %>").prop('readonly', true)
$('#protocol_human_subjects_info_attributes_irb_expiration_date').val("<%= @rmid_record['date_expiration'] %>").prop('readonly', true)
if !$('#protocol_research_types_info_attributes_human_subjects').prop('checked')
$('#protocol_research_types_info_attributes_human_subjects').click()
$('#protocol_research_master_id').click()
$.ajax
method: 'POST'
dataType: 'script'
url: "<%= irb_records_path(irb_record: { pro_number: @rmid_record['eirb_pro_number'], initial_irb_approval_date: @rmid_record['date_initially_approved'], irb_approval_date: @rmid_record['date_approved'], irb_expiration_date: @rmid_record['date_expiration'] }, primary: 'true', index: 0) %>"
<% end %>
<% end %>

0 comments on commit 9108cad

Please sign in to comment.