feat: explain when signer has no visible signature field - #8373
Conversation
Signed-off-by: Maximilian Mayer <office@maximilianmayer.at>
Signed-off-by: Maximilian Mayer <office@maximilianmayer.at>
| <NcRichText :text="error.message" | ||
| :use-markdown="true" /> | ||
| </NcNoteCard> | ||
| <NcNoteCard v-if="!hasVisibleSignatureField" |
There was a problem hiding this comment.
Could we avoid showing this notice when signing is blocked by a non-retriable error?
The issue says this message should be shown when the signer has no visible element and is in a valid signing flow. In the blocking error state, the user cannot sign at that moment, so showing “Your digital signature will still be added” together with “Signing is blocked” can be confusing.
I think the notice should be hidden when hasBlockingSignError is true, and the existing API error test should continue expecting only the blocking error card.
| }) | ||
| }) | ||
|
|
||
| describe('Sign.vue - no visible signature notice', () => { |
There was a problem hiding this comment.
Could we cover the behavior requested by the issue at the component level instead of checking only the exposed computed value?
We should verify the rendered notice for these cases:
- another signer has a visible element, but the current signer does not → notice is shown;
- the current signer has a visible element, but another signer does not → notice is not shown;
- when the notice is shown,
Sign documentis still available.
This is important because the matching by signRequestId is the main behavior we want to protect here. Checking wrapper.vm.hasVisibleSignatureField alone would still pass if the template condition were changed or removed by mistake.
There was a problem hiding this comment.
Done. The tests now assert the rendered notice instead of the exposed computed,
using two signers.
- only the other signer has a visible element -> notice is shown
- the current signer has a visible element -> notice is not shown
- while the notice is shown, "Sign document" is still rendered
I also removed hasVisibleSignatureField from defineExpose, since nothing reads
it anymore.
There was a problem hiding this comment.
The notice is now hidden when hasBlockingSignError is true, and the API
error test expects one card again.
Signed-off-by: Maximilian Mayer <office@maximilianmayer.at>
|
Codecov Report✅ All modified and coverable lines are covered by tests.
... and 220 files with indirect coverage changes 🚀 New features to boost your workflow:
|
Resolves: #8325
📝 Summary
Shows an NcNoteCard in the signing sidebar when the current signer has no visible signature field, so the page does not look incomplete.
Reuses hasVisibleElementsForCurrentUser(). I could not reuse needCreateSignature, it also returns false when the instance disallows creating signatures or when the user already has one.
The card is a sibling of the existing v-if chain, not part of it, so "Sign document" stays available.
🧪 How to test
🎨 UI / Front-end changes
Tests: component tests for both cases in Sign.spec.ts, and extended sign-herself-with-click-to-sign which already signs without a visible field.
One thing worth your review: the card also shows while a non-retriable certificate error blocks signing, so "Sign.vue - API error handling" now expects 2 note cards instead of 1. The issue describes the condition without exceptions so I kept it, but tell me if you want it hidden there.
✅ Checklist
🤖 AI (if applicable)