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

[stable31] Fix disabled annotation edition in view only files #1124

Merged
merged 2 commits into from
Jan 30, 2025

Conversation

backportbot[bot]
Copy link

@backportbot backportbot bot commented Jan 30, 2025

Backport of #1108

@szaimen
Copy link
Collaborator

szaimen commented Jan 30, 2025

/compile

Copy link
Member

@danxuliu danxuliu left a comment

Choose a reason for hiding this comment

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

Ugh, let me amend the commit message 🙈

danxuliu and others added 2 commits January 30, 2025 12:19
When a PDF file was shared without edit permissions the annotation
editor buttons were hidden in the toolbar. Besides being a dirty trick,
it only prevented creating new annotations, but not editing existing
ones. Now the parameter "annotationEditorMode" of PDF.js set to
"AnnotationEditorType.DISABLE" is used instead, which properly disables
editing annotations and also takes care of removing the buttons from the
toolbar if needed.

Note that the editor mode separator is no longer hidden; it was hidden
back in the day when edition was not supported yet in the PDF viewer,
and once edition was added it should have been shown whenever the editor
buttons were shown, but it was not the case. Now it is shown by default
and hidden as needed by PDF.js itself when annotation edition is
disabled.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
@danxuliu danxuliu force-pushed the backport/1108/stable31 branch from e8c750d to 1db74cb Compare January 30, 2025 11:33
Copy link
Member

@danxuliu danxuliu left a comment

Choose a reason for hiding this comment

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

Tested and works 👍

@danxuliu danxuliu marked this pull request as ready for review January 30, 2025 11:36
@danxuliu danxuliu enabled auto-merge January 30, 2025 11:36
@blizzz blizzz mentioned this pull request Jan 30, 2025
1 task
@blizzz blizzz disabled auto-merge January 30, 2025 12:14
@blizzz blizzz merged commit 07cc8b3 into stable31 Jan 30, 2025
40 of 41 checks passed
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