pnnl / Quality-Install-Tool

BSD 2-Clause "Simplified" License
2 stars 3 forks source link

Include street address in filename of pdf #109

Closed mvgeorgescu closed 1 year ago

mvgeorgescu commented 1 year ago

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.

charliepnnl commented 1 year ago

I had a follow up conversation with Edward about this. Here are my thoughts:

mvgeorgescu commented 1 year ago

@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.

charliepnnl commented 1 year ago

@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.

mvgeorgescu commented 1 year ago

@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

mvgeorgescu commented 1 year ago

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