-
Notifications
You must be signed in to change notification settings - Fork 725
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: fix update of the signature widget in the status bar #10069
Conversation
https://cpci.cbg.collabora.co.uk:8080/job/github_online_master_debug_vs_co-24.04_cypress_desktop/3125/console failed in e.g. calc/bottom_bar_spec.js, but locally trying that fails with:
I'm not sure what is actionable here, let's re-try cypress-desktop first. Edit: local |
187901e
to
d1ecfba
Compare
https://cpci.cbg.collabora.co.uk:8080/job/github_online_master_debug_vs_co-24.04_cypress_desktop/3133/console fails in calc/scrolling_spec.js and calc/bottom_bar_spec.js, but locally trying:
works fine, hmm. Let's try once more. Edit: ah, the trouble with the scrolling is that once we have a signature widget for the "no signature" case, it changes what widgets are visible as you scroll in a small window. But I only want to have an empty widget after we already had a signature, so don't touch the statusbar in the no signatures -> no signatures transition. |
d1ecfba
to
9644e0b
Compare
https://cpci.cbg.collabora.co.uk:8080/job/github_online_master_debug_vs_co-24.04_cypress_multi_user/3139/console failed in writer/invalidations.spec, but local |
@caolanm could you please review this? Thanks. The mobile case is just a minimal fix, looks like signing on mobile is broken (app.map.mobileTopBar.showSigningItem is undefined), but I suggest let's worry about that minor problem once the normal desktop case is in a reasonable shape. Other than that, removing signatures should work reasonably well with this. |
browser/src/control/Signing.js
Outdated
var statusIcon = ''; | ||
// Have a non-empty status text by default, so a signatures -> no signatures | ||
// transition updates the status bar. | ||
var statusText = 'The document is not signed.'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this need the _() markup so it gets translated?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, let me fix.
Load a document with a signature, click on the status bar icon to open the signatures dialog, remove the signature, close the dialog. The status bar still claims the document has a signature, even it doesn't have one anymore. What happens is that the initial signature state is set based on the incoming 'signaturestatus:' message, but updates to the signature state is done via the 'statechanged: .uno:Signature=' message. Handle this in Control.StatusBar.js. Then Signing.js sets an empty status bar text for the "no signatures" case, extend that to do the same as on the desktop, so we attempt to call app.map.statusBar.showSigningItem() for the "had signatures" -> "no signatures" transition. Finally the update of the signstatus widget only worked once: we had code in place at _makeIdUnique() to make sure all widgets have a unique ID, but we didn't clear the ID of the old widget before building the new widget, so the replacement of the signstatus widget had a signstatus1 ID. The result was that next time we didn't find the widget to update. Signed-off-by: Miklos Vajna <vmiklos@collabora.com> Change-Id: I93a21d3969fcf4754e77ef295c8f3cd872300d01
9644e0b
to
d63bfd2
Compare
Load a document with a signature, click on the status bar icon to open
the signatures dialog, remove the signature, close the dialog. The
status bar still claims the document has a signature, even it doesn't
have one anymore.
What happens is that the initial signature state is set based on the
incoming 'signaturestatus:' message, but updates to the signature state
is done via the 'statechanged: .uno:Signature=' message. Handle this in
Control.StatusBar.js.
Then Signing.js sets an empty status bar text for the "no signatures"
case, extend that to do the same as on the desktop, so we attempt to
call app.map.statusBar.showSigningItem().
Finally the update of the signstatus widget only worked once: we had
code in place at _makeIdUnique() to make sure all widgets have a unique
ID, but we didn't clear the ID of the old widget before building the new
widget, so the replacement of the signstatus widget had a signstatus1
ID. The result was that next time we didn't find the widget to update.
Signed-off-by: Miklos Vajna vmiklos@collabora.com
Change-Id: I93a21d3969fcf4754e77ef295c8f3cd872300d01