Skip to content

Conditional report actions#276

Draft
TheSyscall wants to merge 3 commits into
mainfrom
conditional-actions
Draft

Conditional report actions#276
TheSyscall wants to merge 3 commits into
mainfrom
conditional-actions

Conversation

@TheSyscall

@TheSyscall TheSyscall commented Apr 16, 2026

Copy link
Copy Markdown
Contributor

Only show actions if there is actually an exporter for it.

Draft for now because of an issue that prevents PrintableHtmlDocument to be moved to icingaweb Icinga/icingaweb2#5510

  • Remove PDF download option and mail attachment type when there is no pdfexport hook implementation registered
  • Remove download dropdown and send button entirely if no export option is available

This serves as a step toward getting rid of pdfexport as a requirement for reporting, but does not get rid of this dependency entirely.

This combined with the changes made in #275 should allow us to remove pdfexport as a requirement. It is still not possible to use any module that implements the Pdfexport hook but at least the module is able to show reports in the web app and export to CSV and JSON.

@cla-bot cla-bot Bot added the cla/signed label Apr 16, 2026
@TheSyscall
TheSyscall requested a review from Al2Klimov April 16, 2026 12:15
Comment thread library/Reporting/Actions/SendMail.php Outdated
Comment thread application/controllers/ReportController.php Outdated
Comment thread application/controllers/ReportController.php
Al2Klimov

This comment was marked as resolved.

@TheSyscall
TheSyscall requested a review from Al2Klimov June 23, 2026 13:56
Al2Klimov
Al2Klimov previously approved these changes Jun 23, 2026
@TheSyscall
TheSyscall marked this pull request as draft June 25, 2026 08:33
@TheSyscall TheSyscall self-assigned this Jun 25, 2026
@flourish86

Copy link
Copy Markdown

I'm not sure about the whole context.

But have you considered just disabling the non-available actions and including a tool tip that clarifies the reason, e.g. "PDF-Export not configured"?

My assumption is users might be looking for certain actions and wonder why they suddenly disappear or just expect certain options, as they're available in other modules.

Here are a few questions, that are important for deciding, what the better option would be.

  • Are the actions unavailable temporary or permanently in the Icinga Web 2 instance, so users never expect them to be there?
  • Is there a way to solve it for regular users or does the Admin have to do it.

@TheSyscall

Copy link
Copy Markdown
Contributor Author

My assumption is users might be looking for certain actions and wonder why they suddenly disappear or just expect certain options, as they're available in other modules.

This PR just mimics the behavior of icingaweb itself, which hides the download as PDF button from the tab bar under similar conditions.

Are the actions unavailable temporary or permanently in the Icinga Web 2 instance, so users never expect them to be there?

There is no way to know that, the reason the PDF export button is not available is always the same though, there is no hook implementing the PdfExportHook. That might be because there is an issue with the hook implementation, or the hook failed to register, the admin disabled it, or it was never active in the first place.

Is there a way to solve it for regular users or does the Admin have to do it.

It is always on the admin to solve this.

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.

3 participants