mirror of
https://github.com/LibreSign/libresign.git
synced 2025-12-18 05:20:45 +01:00
Merge pull request #6160 from LibreSign/fix/individual-signer-status-control
fix: add ordering validation for signature request actions
This commit is contained in:
commit
9c6cebf5f5
1 changed files with 33 additions and 11 deletions
|
|
@ -263,20 +263,28 @@ export default {
|
||||||
},
|
},
|
||||||
canRequestSignature() {
|
canRequestSignature() {
|
||||||
return (signer) => {
|
return (signer) => {
|
||||||
return this.filesStore.canRequestSign
|
if (!this.filesStore.canRequestSign
|
||||||
&& !signer.signed
|
|| signer.signed
|
||||||
&& signer.signRequestId
|
|| !signer.signRequestId
|
||||||
&& !signer.me
|
|| signer.me
|
||||||
&& signer.status === 0
|
|| signer.status !== 0) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
return this.canSignerActInOrder(signer)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
canSendReminder() {
|
canSendReminder() {
|
||||||
return (signer) => {
|
return (signer) => {
|
||||||
return this.filesStore.canRequestSign
|
if (!this.filesStore.canRequestSign
|
||||||
&& !signer.signed
|
|| signer.signed
|
||||||
&& signer.signRequestId
|
|| !signer.signRequestId
|
||||||
&& !signer.me
|
|| signer.me
|
||||||
&& signer.status === 1
|
|| signer.status !== 1) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
return this.canSignerActInOrder(signer)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
showSaveButton() {
|
showSaveButton() {
|
||||||
|
|
@ -353,6 +361,21 @@ export default {
|
||||||
getSvgIcon(name) {
|
getSvgIcon(name) {
|
||||||
return iconMap[`svg${name.charAt(0).toUpperCase() + name.slice(1)}`] || iconMap.svgAccount
|
return iconMap[`svg${name.charAt(0).toUpperCase() + name.slice(1)}`] || iconMap.svgAccount
|
||||||
},
|
},
|
||||||
|
canSignerActInOrder(signer) {
|
||||||
|
if (!this.isOrderedNumeric) {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
const file = this.filesStore.getFile()
|
||||||
|
const signerOrder = signer.signingOrder || 1
|
||||||
|
|
||||||
|
const hasPendingLowerOrder = file.signers.some(s => {
|
||||||
|
const otherOrder = s.signingOrder || 1
|
||||||
|
return otherOrder < signerOrder && !s.signed
|
||||||
|
})
|
||||||
|
|
||||||
|
return !hasPendingLowerOrder
|
||||||
|
},
|
||||||
enabledMethods() {
|
enabledMethods() {
|
||||||
return this.methods.filter(method => method.enabled)
|
return this.methods.filter(method => method.enabled)
|
||||||
},
|
},
|
||||||
|
|
@ -473,7 +496,6 @@ export default {
|
||||||
await this.filesStore.updateSignatureRequest({
|
await this.filesStore.updateSignatureRequest({
|
||||||
visibleElements: [],
|
visibleElements: [],
|
||||||
signers,
|
signers,
|
||||||
status: 1,
|
|
||||||
})
|
})
|
||||||
showSuccess(t('libresign', 'Signature requested'))
|
showSuccess(t('libresign', 'Signature requested'))
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue