Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of the issue/feature this PR addresses
This PR allows to hook in actions into the SENAITE IMPRESS preview like e.g. the PDF download button.
Possible Use-Cases:
New actions are registered via an adapter that implements the
senaite.impress.interfaces.ICustomActionProvider
interface.The adapter has to provide the following attributes:
available
: Boolean True/False if the action should be rendered or nottitle
: Title of the buttonname
: Name of the (input-)button (must be unique)url
: URL of a view that renders a modal (similar tosenaite.core.browser.modals
) and/or the form action handler where the data can be POSTed directlymodal
: Boolean True/False if a modal should be rendered first or the data should be directly posted to☝️ NOTE: The form data will always contain a
pdf
key with the generated report PDF before either the modal is rendered or directly posted to the given URL.Current behavior before PR
Only static actions were supported
Desired behavior after PR is merged
Custom actions are allowed
--
I confirm I have tested this PR thoroughly and coded it according to PEP8
and Plone's Python styleguide standards.