|
12 | 12 | <Signers event="libresign:edit-signer" |
13 | 13 | @signing-order-changed="debouncedSave"> |
14 | 14 | <template #actions="{signer, closeActions}"> |
15 | | - <NcActionInput v-if="isOrderedNumeric && totalSigners > 1 && filesStore.canSave() && !signer.signed" |
| 15 | + <NcActionInput v-if="canEditSigningOrder(signer)" |
16 | 16 | :label="t('libresign', 'Signing order')" |
17 | 17 | type="number" |
18 | 18 | :value="signer.signingOrder || 1" |
|
23 | 23 | <OrderNumericAscending :size="20" /> |
24 | 24 | </template> |
25 | 25 | </NcActionInput> |
26 | | - <NcActionButton v-if="filesStore.canSave() && !signer.signed" |
| 26 | + <NcActionButton v-if="canDelete(signer)" |
27 | 27 | aria-label="Delete" |
28 | 28 | :close-after-click="true" |
29 | 29 | @click="filesStore.deleteSigner(signer)"> |
|
32 | 32 | </template> |
33 | 33 | {{ t('libresign', 'Delete') }} |
34 | 34 | </NcActionButton> |
35 | | - <NcActionButton v-if="filesStore.canRequestSign && !signer.signed && signer.signRequestId && !signer.me && signer.status === 0" |
| 35 | + <NcActionButton v-if="canRequestSignature(signer)" |
36 | 36 | :close-after-click="true" |
37 | 37 | @click="requestSignatureForSigner(signer)"> |
38 | 38 | <template #icon> |
39 | 39 | <Send :size="20" /> |
40 | 40 | </template> |
41 | 41 | {{ t('libresign', 'Request signature') }} |
42 | 42 | </NcActionButton> |
43 | | - <NcActionButton v-if="filesStore.canRequestSign && !signer.signed && signer.signRequestId && !signer.me && signer.status === 1" |
| 43 | + <NcActionButton v-if="canSendReminder(signer)" |
44 | 44 | icon="icon-comment" |
45 | 45 | :close-after-click="true" |
46 | 46 | @click="sendNotify(signer)"> |
@@ -248,6 +248,37 @@ export default { |
248 | 248 | isOrderedNumeric() { |
249 | 249 | return this.signatureFlow === 'ordered_numeric' |
250 | 250 | }, |
| 251 | + canEditSigningOrder() { |
| 252 | + return (signer) => { |
| 253 | + return this.isOrderedNumeric |
| 254 | + && this.totalSigners > 1 |
| 255 | + && this.filesStore.canSave() |
| 256 | + && !signer.signed |
| 257 | + } |
| 258 | + }, |
| 259 | + canDelete() { |
| 260 | + return (signer) => { |
| 261 | + return this.filesStore.canSave() && !signer.signed |
| 262 | + } |
| 263 | + }, |
| 264 | + canRequestSignature() { |
| 265 | + return (signer) => { |
| 266 | + return this.filesStore.canRequestSign |
| 267 | + && !signer.signed |
| 268 | + && signer.signRequestId |
| 269 | + && !signer.me |
| 270 | + && signer.status === 0 |
| 271 | + } |
| 272 | + }, |
| 273 | + canSendReminder() { |
| 274 | + return (signer) => { |
| 275 | + return this.filesStore.canRequestSign |
| 276 | + && !signer.signed |
| 277 | + && signer.signRequestId |
| 278 | + && !signer.me |
| 279 | + && signer.status === 1 |
| 280 | + } |
| 281 | + }, |
251 | 282 | showSaveButton() { |
252 | 283 | if (!this.filesStore.canSave()) { |
253 | 284 | return false |
|
0 commit comments