fix: update modal title to reflect edit vs add signer action

The modal dialog was displaying 'Add new signer' title when clicking
an existing signer to edit, which was confusing. Added a computed
property 'modalTitle' that dynamically returns 'Edit signer' when
editing an existing signer or 'Add new signer' when adding a new one.

The logic checks if signerToEdit object has properties to determine
the correct context.

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
This commit is contained in:
Vitor Mattos 2025-12-12 13:38:03 -03:00
parent 3eff421a84
commit 562cb296d1
No known key found for this signature in database
GPG key ID: 6FECE2AD4809003A

View file

@ -117,9 +117,9 @@
<NcDialog v-if="filesStore.identifyingSigner"
id="request-signature-identify-signer"
:size="size"
:name="t('libresign', 'Add new signer')"
:name="modalTitle"
@closing="filesStore.disableIdentifySigner()">
<NcAppSidebar :name="t('libresign', 'Add new signer')">
<NcAppSidebar :name="modalTitle">
<NcAppSidebarTab v-for="method in enabledMethods()"
:id="`tab-${method.name}`"
:key="method.name"
@ -314,6 +314,12 @@ export default {
size() {
return window.matchMedia('(max-width: 512px)').matches ? 'full' : 'normal'
},
modalTitle() {
if (Object.keys(this.signerToEdit).length > 0) {
return this.t('libresign', 'Edit signer')
}
return this.t('libresign', 'Add new signer')
},
},
watch: {
signers(signers) {