Closed mvgeorgescu closed 1 year ago
I had a follow up conversation with Edward about this. Here are my thoughts:
onPrintDialogClose
option that accepts a callback function that could be used to reset the original title.PrintSection
component. These both seem like reasonable pieces of information to add to the document's metadata_ field. We would then need to create a PrintSectionWrapper
component that passes the metadata to PrintSection
.@charliepnnl - I made updates to support the functionality you asked for. For create a default name for the PDF file, I took a shortcut and added a function that will parse this information form the URL. If you think it will be helpful to add it to the documents metadata_ for future uses, I can go back and do that.
@mvgeorgescu Yours is a very clever solution that I hadn't thought of. After thinking about it further, I do think it is worth the extra effort of adding the project and template names to metadata_. The biggest reason for this that this information will be important when we add the export feature that will allow users to export all the data and attachments for a project or projects. Secondarily, getting this info from the props keeps the implementation of PrintSection a little simpler.
@charliepnnl - This branch blew up on my when trying to merge main into it. I'm going to create a separate branch off of the current main
The diff in this PR got confusing after merging main
. I replicated the work here in https://github.com/pnnl/Quality-Install-Tool/pull/127
Some feedback from Edward Louie was that when working on multiple projects, it can be hard to organize reports since the tool prints everything to the same filename.
Unfortunately print-js doesn't allow one to specify a filename, so I added this hack to update the document title of the site to include the street address.