77 <NcNoteCard v-if =" showDocMdpWarning" type =" warning" >
88 {{ t('libresign', 'This document has been certified with no changes allowed. You cannot add more signers to this document.') }}
99 </NcNoteCard >
10+ <NcNoteCard v-if =" hasSignersWithDisabledMethods" type =" warning" >
11+ {{ t('libresign', 'Some signers use identification methods that have been disabled. Please remove or update them before requesting signatures.') }}
12+ </NcNoteCard >
1013 <NcButton v-if =" filesStore.canAddSigner()"
1114 :variant =" hasSigners ? 'secondary' : 'primary'"
1215 @click =" addSigner" >
132135 :size =" size"
133136 :name =" modalTitle"
134137 @closing =" filesStore.disableIdentifySigner()" >
135- <NcNoteCard v-if =" isSignerMethodDisabled" type =" warning" >
136- {{ t('libresign', 'The identification method "{method}" used by this signer has been disabled by the system administrator.', { method: disabledMethodName }) }}
137- </NcNoteCard >
138- <NcAppSidebar v-else
139- :name =" modalTitle"
138+ <NcAppSidebar :name =" modalTitle"
140139 :active =" activeTab"
141140 @update:active =" onTabChange" >
142141 <NcAppSidebarTab v-for =" method in enabledMethods"
150149 <IdentifySigner :signer-to-edit =" signerToEdit"
151150 :placeholder =" method.friendly_name"
152151 :method =" method.name"
153- :methods =" methods" />
152+ :methods =" methods"
153+ :disabled =" isSignerMethodDisabled" />
154154 </NcAppSidebarTab >
155155 </NcAppSidebar >
156156 </NcDialog >
@@ -348,6 +348,10 @@ export default {
348348 return false
349349 }
350350
351+ if (! this .canSignerActInOrder (signer)) {
352+ return false
353+ }
354+
351355 return !! method
352356 }
353357 },
@@ -377,6 +381,24 @@ export default {
377381 return this .canSignerActInOrder (signer)
378382 }
379383 },
384+ hasSignersWithDisabledMethods () {
385+ const file = this .filesStore .getFile ()
386+ if (! file? .signers ) {
387+ return false
388+ }
389+
390+ return file .signers .some (signer => {
391+ if (signer .signed ) {
392+ return false
393+ }
394+ const method = signer .identifyMethods ? .[0 ]? .method
395+ if (! method) {
396+ return false
397+ }
398+ const methodConfig = this .methods .find (m => m .name === method)
399+ return ! methodConfig? .enabled
400+ })
401+ },
380402 showSaveButton () {
381403 if (! this .filesStore .canSave ()) {
382404 return false
@@ -392,12 +414,19 @@ export default {
392414 return false
393415 }
394416
417+ if (this .hasSignersWithDisabledMethods ) {
418+ return false
419+ }
420+
395421 return true
396422 },
397423 showRequestButton () {
398424 if (! this .filesStore .canSave ()) {
399425 return false
400426 }
427+ if (this .hasSignersWithDisabledMethods ) {
428+ return false
429+ }
401430 return this .hasDraftSigners
402431 },
403432 hasDraftSigners () {
@@ -429,14 +458,16 @@ export default {
429458 return this .t (' libresign' , ' Add new signer' )
430459 },
431460 enabledMethods () {
432- const enabledMethods = this .methods .filter (method => method .enabled )
433-
434461 if (Object .keys (this .signerToEdit ).length > 0 && this .signerToEdit .identifyMethods ? .length ) {
435462 const signerMethod = this .signerToEdit .identifyMethods [0 ].method
436- return enabledMethods .filter (method => method .name === signerMethod)
463+ const signerMethodConfig = this .methods .find (m => m .name === signerMethod)
464+
465+ if (signerMethodConfig) {
466+ return [signerMethodConfig]
467+ }
437468 }
438469
439- return enabledMethods
470+ return this . methods . filter ( method => method . enabled )
440471 },
441472 isSignerMethodDisabled () {
442473 if (Object .keys (this .signerToEdit ).length > 0 && this .signerToEdit .identifyMethods ? .length ) {
@@ -494,6 +525,14 @@ export default {
494525 return iconMap[` svg${ name .charAt (0 ).toUpperCase () + name .slice (1 )} ` ] || iconMap .svgAccount
495526 },
496527 canSignerActInOrder (signer ) {
528+ const method = signer .identifyMethods ? .[0 ]? .method
529+ if (method) {
530+ const methodConfig = this .methods .find (m => m .name === method)
531+ if (! methodConfig? .enabled ) {
532+ return false
533+ }
534+ }
535+
497536 if (! this .isOrderedNumeric ) {
498537 return true
499538 }
0 commit comments