Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use the browser's native printing for asynchronously generated saved reports #4201

Merged
merged 4 commits into from
Jun 29, 2018

Conversation

skateman
Copy link
Member

@skateman skateman commented Jun 25, 2018

Saved report PDFs are being generated asynchronously due to their size, the most time-consuming operation (except of the PDF generation itself) was the joining the sub-reports together. As we're moving the PDF generation to the client, I modified the asynchronous task to return with the html_rows only. This is later being used in the rendering the print view using the @data instance variable.

To have a new window for printing, the :popup => true was not effective due to the wait_for_task so I also had to add an exception for opening PDF reports in a new window. I know that the code is ugly, but it is now consistent with the other printing views in the UI. I will refactor this in the future in a separate PR.

4codogqpid6paqugqoglrzlsmm-y0bg7gfo0kqpp9h8

@miq-bot add_label pending core, gaprindashvili/no, reporting, enhancement
@miq-bot add_reviewer @martinpovolny
@miq-bot add_reviewer @epwinchell

Depends on: ManageIQ/manageiq#17632
Closes: #4113

https://bugzilla.redhat.com/show_bug.cgi?id=1588072

@miq-bot
Copy link
Member

miq-bot commented Jun 25, 2018

@skateman Cannot apply the following label because they are not recognized: reporting

Copy link
Contributor

@epwinchell epwinchell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested. Looks good

@report = @result.report
@data = @result.get_generated_result(@sb[:render_type])
# We need the last_run_on time from the original result
last_run_on = MiqReportResult.find(session[:report_result_id]).last_run_on
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does this fetch the whole record and then take a single columnt or does it fetch just the single column from the db?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice catch, fixed

@miq-bot
Copy link
Member

miq-bot commented Jun 26, 2018

Checked commits skateman/manageiq-ui-classic@e4f2ead~...2da362c with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0
2 files checked, 0 offenses detected
Everything looks fine. 🍪

@martinpovolny martinpovolny self-assigned this Jun 29, 2018
@martinpovolny martinpovolny added this to the Sprint 89 Ending Jul 2, 2018 milestone Jun 29, 2018
@martinpovolny martinpovolny merged commit 3ae47e8 into ManageIQ:master Jun 29, 2018
@skateman skateman deleted the pdf-saved-reports branch June 29, 2018 18:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants