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

[stable30] Fix disabled annotation edition in view only files #1123

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:25
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 <[email protected]>
Signed-off-by: nextcloud-command <[email protected]>
@danxuliu danxuliu force-pushed the backport/1108/stable30 branch from 5d3e077 to dc34111 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:37
@danxuliu danxuliu merged commit 8199f26 into stable30 Jan 30, 2025
38 checks passed
@Altahrim Altahrim mentioned this pull request Feb 5, 2025
15 tasks
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