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

cool#9992 doc sign: hide sign button when user pref doesn't provide cert or key #10247

Merged
merged 1 commit into from
Oct 17, 2024

Conversation

vmiklos
Copy link
Contributor

@vmiklos vmiklos commented Oct 17, 2024

Have no sign keys configured, open a document, go to the File tab on the
notebookbar, the signature button clutters the UI but it provides no
actual functionality.

The JS UI already got the private user info in Control.UIManager.js
onUpdateViews(), where we initialize the Zotero UI.

Do something similar for the sign UI: keep it enabled by default, but
once we learn about the private user info and it has no signing
key/cert, then hide the button.

The notebookbar gets re-initialized from time to time, so best to do
this via showButton(), which can remember which buttons are shown/hidden
and gets maintained even after a rebuild of the notebookbar. (The
postmessage API uses the same code to hide a button from an
integration.)

Signed-off-by: Miklos Vajna vmiklos@collabora.com
Change-Id: Ifad78220a002ed19a5d822d8affed9aea6073737

…ert or key

Have no sign keys configured, open a document, go to the File tab on the
notebookbar, the signature button clutters the UI but it provides no
actual functionality.

The JS UI already got the private user info in Control.UIManager.js
onUpdateViews(), where we initialize the Zotero UI.

Do something similar for the sign UI: keep it enabled by default, but
once we learn about the private user info and it has no signing
key/cert, then hide the button.

The notebookbar gets re-initialized from time to time, so best to do
this via showButton(), which can remember which buttons are shown/hidden
and gets maintained even after a rebuild of the notebookbar. (The
postmessage API uses the same code to hide a button from an
integration.)

Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: Ifad78220a002ed19a5d822d8affed9aea6073737
@vmiklos
Copy link
Contributor Author

vmiklos commented Oct 17, 2024

https://cpci.cbg.collabora.co.uk:8080/job/github_online_master_debug_vs_co-24.04_cypress_mobile/1569/console

ah, we need to hide this button on the notebookbar when we have a notebookbar, which is not the case on mobile, let me fix.

@vmiklos vmiklos force-pushed the private/vmiklos/master branch from acf66fa to cb6ad40 Compare October 17, 2024 08:43
@vmiklos vmiklos requested a review from caolanm October 17, 2024 11:03
@vmiklos
Copy link
Contributor Author

vmiklos commented Oct 17, 2024

@caolanm could you please review this? Thanks.

Hides the button to not clutter the UI if it would not work; also don't send the sensitive data to the client without a reason, we just need to know if this data is configured on the server or not.

Copy link
Contributor

@caolanm caolanm left a comment

Choose a reason for hiding this comment

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

looks sensible to me

@caolanm caolanm merged commit 89213ce into master Oct 17, 2024
13 checks passed
@caolanm caolanm deleted the private/vmiklos/master branch October 17, 2024 11:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants