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.
This addresses a couple of issues:
With this PR, the web app loads the
Figure_To_Pdf.py
script from within the Django app (using relative path fromviews.py
->../scripts/omero/Figure_Scripts/Figure_To_Pdf.py
and uploads it to the server using the script service (if the current user is an Admin).We also add a
FIGURE_VERSION
parameter to theFigure_To_Pdf.py
script, with the default value being set to the release version of OMERO.figure. This allows the web app to use the script service to query the script parameters and get theFIGURE_VERSION
from the script. Scripts from before this PR won't have this parameter, so the version will be "unknown". If theFIGURE_VERSION
from the script doesn't match the version of the app, all users will see a warning, and if user is an Admin, they can update the script with a single button click!For regular users:
For admin users:
Upload Script
button.Update Script
button.Testing info, see below...
To test:
$ omero script list
to get the ID of theFigure_To_Pdf.py
and then delete it with$ omero delete OriginalFile:ID
.Export Pdf
button will be disabled as before. You should now see a warning button (top right) with appropriate tooltip. Click the button to show dialog (first screenshot above). Click "Upload Script" to upload to the server. Should see success message andExport Pdf
button will be enabled etc.Figure_To_Pdf.py
(e.g. from last release). Make sure it is in the correct pathomero/figure_scripts/Figure_To_Pdf.py
so that is replaces the existing script.NB: for devs: this PR adds usage of https://www.npmjs.com/package/vite-plugin-html-inject so we can include html files into index.html. This will allow us to move all the dialogs into separate html files (as I've done for the new dialog here).