feat: show warning when DocMDP prevents adding signers

- Add NcNoteCard warning message for DocMDP level 1
- Add showDocMdpWarning computed property
- Warning only shows when button is hidden
- Prevents UI flash during state transitions
- Uses consistent error message with backend

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
This commit is contained in:
Vitor Mattos 2025-12-14 16:14:09 -03:00
parent 99e2c0258a
commit 5689200ba3
No known key found for this signature in database
GPG key ID: 6FECE2AD4809003A

View file

@ -4,6 +4,9 @@
-->
<template>
<div id="request-signature-tab">
<NcNoteCard v-if="showDocMdpWarning" type="warning">
{{ t('libresign', 'This document has been certified with no changes allowed. You cannot add more signers to this document.') }}
</NcNoteCard>
<NcButton v-if="filesStore.canAddSigner()"
:variant="hasSigners ? 'secondary' : 'primary'"
@click="addSigner">
@ -209,6 +212,7 @@ import NcDialog from '@nextcloud/vue/components/NcDialog'
import NcIconSvgWrapper from '@nextcloud/vue/components/NcIconSvgWrapper'
import NcLoadingIcon from '@nextcloud/vue/components/NcLoadingIcon'
import NcModal from '@nextcloud/vue/components/NcModal'
import NcNoteCard from '@nextcloud/vue/components/NcNoteCard'
import IdentifySigner from '../Request/IdentifySigner.vue'
import VisibleElements from '../Request/VisibleElements.vue'
@ -247,6 +251,7 @@ export default {
NcIconSvgWrapper,
NcLoadingIcon,
NcModal,
NcNoteCard,
NcDialog,
Delete,
Draw,
@ -292,6 +297,9 @@ export default {
isOrderedNumeric() {
return this.signatureFlow === 'ordered_numeric'
},
showDocMdpWarning() {
return this.filesStore.isDocMdpNoChangesAllowed() && !this.filesStore.canAddSigner()
},
canEditSigningOrder() {
return (signer) => {
return this.isOrderedNumeric