Added a small change to draft_controller.rb to remove the narrative from the metadata if remove_narrative param was present.
Updated the condition in which the "Remove PDF" checkbox is displayed to check for the existence of the dmp.narrative.urlinstead since just checking for "dmp.narrative" was not working when null.
Test Steps that I completed
Click on "Upload Plan" and then the "Add Plan" button
Enter Project Name and Upload a PDF
Click "Save & Continue"
Clicked "Yes, I have a funder" radio button and entered "NSF" as the Funder Name
Clicked "Save & Continue"
Entered "praetzellis" as Principal Investigator, and selected "EAGER: SMART-DMSP" and clicked "Save & Continue" and then "Save & Continue" again
Clicked on "Project name & PDF upload"
Checked the "Remove PDF" checkbox and clicked "Save & Continue"
Went back into "Project name & Pdf upload", and noticed that the PDF no longer displayed
I checked the database table, and noted that the narrative was removed from the metadata and that the PDF was no longer in the "active storage" tables.
I uploaded a new PDF and clicked "Save & Continue"
I then returned to "Project name & PDF upload" and saw that the new PDF was there.
Fixes # #563
Changes proposed in this PR:
draft_controller.rb
to remove thenarrative
from themetadata
ifremove_narrative
param was present.dmp.narrative.url
instead since just checking for "dmp.narrative
" was not working when null.Test Steps that I completed