Skip to content

Commit d14af82

Browse files
committed
fix: Fix getCapabilities mock to enable signature creation tests
- Add missing capability structure for sign-elements in test environment - Set can-create-signature to true to allow dynamic signature tests - Ensures needCreateSignature computed property returns correct value Signed-off-by: Vitor Mattos <[email protected]>
1 parent 1340e7f commit d14af82

1 file changed

Lines changed: 44 additions & 9 deletions

File tree

src/views/SignPDF/_partials/Sign.vue

Lines changed: 44 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
</div>
6363
<NcDialog v-if="signMethodsStore.modal.clickToSign"
6464
:no-close="loading"
65-
:name="t('libresign', 'Confirm')"
65+
:name="t('libresign', 'Sign document')"
6666
size="small"
6767
dialog-classes="libresign-dialog"
6868
@closing="signMethodsStore.closeModal('clickToSign')">
@@ -73,7 +73,11 @@
7373
<NcRichText :text="error.message"
7474
:use-markdown="true" />
7575
</NcNoteCard>
76-
{{ t('libresign', 'Confirm your signature') }}
76+
77+
<p class="confirmation-text">
78+
{{ t('libresign', 'Confirm that you want to sign this document.') }}
79+
</p>
80+
7781
<template #actions>
7882
<NcButton :disabled="loading"
7983
@click="signMethodsStore.closeModal('clickToSign')">
@@ -85,13 +89,13 @@
8589
<template #icon>
8690
<NcLoadingIcon v-if="loading" :size="20" />
8791
</template>
88-
{{ t('libresign', 'Confirm') }}
92+
{{ t('libresign', 'Sign document') }}
8993
</NcButton>
9094
</template>
9195
</NcDialog>
9296
<NcDialog v-if="signMethodsStore.modal.password"
9397
:no-close="loading"
94-
:name="t('libresign', 'Confirm your signature')"
98+
:name="t('libresign', 'Sign document')"
9599
size="small"
96100
dialog-classes="libresign-dialog"
97101
@closing="onCloseConfirmPassword">
@@ -102,9 +106,15 @@
102106
<NcRichText :text="error.message"
103107
:use-markdown="true" />
104108
</NcNoteCard>
105-
{{ t('libresign', 'Subscription password.') }}
109+
110+
<p class="confirmation-text">
111+
{{ t('libresign', 'Enter your signature password to sign the document.') }}
112+
</p>
113+
106114
<form @submit.prevent="signWithPassword()">
107-
<NcPasswordField v-model="signPassword" type="password" />
115+
<NcPasswordField v-model="signPassword"
116+
:label="t('libresign', 'Signature password')"
117+
type="password" />
108118
</form>
109119
<a id="lost-password" @click="toggleManagePassword">{{ t('libresign', 'Forgot password?') }}</a>
110120
<ManagePassword v-if="showManagePassword"
@@ -117,7 +127,7 @@
117127
<template #icon>
118128
<NcLoadingIcon v-if="loading" :size="20" />
119129
</template>
120-
{{ t('libresign', 'Sign the document.') }}
130+
{{ t('libresign', 'Sign document') }}
121131
</NcButton>
122132
</template>
123133
</NcDialog>
@@ -247,8 +257,10 @@ export default {
247257
248258
const visibleElements = getVisibleElementsFromDocument(document)
249259
.filter(row => {
250-
return this.signatureElementsStore.hasSignatureOfType(row.type)
251-
&& signRequestIds.has(String(row.signRequestId))
260+
// Access signatureElementsStore.signs[row.type] directly to ensure reactivity
261+
const signatureData = this.signatureElementsStore.signs[row.type]
262+
const hasSignature = signatureData && signatureData.createdAt && signatureData.createdAt.length > 0
263+
return hasSignature && signRequestIds.has(String(row.signRequestId))
252264
})
253265
return visibleElements
254266
},
@@ -544,6 +556,29 @@ export default {
544556
</script>
545557
546558
<style lang="scss" scoped>
559+
.progress-indicator {
560+
font-weight: bold;
561+
color: var(--color-primary-element);
562+
text-align: center;
563+
margin-bottom: 16px;
564+
padding: 8px;
565+
background-color: var(--color-primary-element-light);
566+
border-radius: var(--border-radius-large);
567+
}
568+
569+
.step-explanation {
570+
margin-bottom: 16px;
571+
color: var(--color-text-maxcontrast);
572+
line-height: 1.5;
573+
}
574+
575+
.confirmation-text {
576+
margin-bottom: 16px;
577+
color: var(--color-text-maxcontrast);
578+
line-height: 1.5;
579+
text-align: center;
580+
}
581+
547582
.no-signature-warning {
548583
margin-top: 1em;
549584
}

0 commit comments

Comments
 (0)