Skip to content

Commit 57cf654

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 <1079143+vitormattos@users.noreply.github.com>
1 parent 38d8cfc commit 57cf654

File tree

1 file changed

+44
-9
lines changed

1 file changed

+44
-9
lines changed

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>
@@ -239,8 +249,10 @@ export default {
239249
240250
const visibleElements = getVisibleElementsFromDocument(document)
241251
.filter(row => {
242-
return this.signatureElementsStore.hasSignatureOfType(row.type)
243-
&& signRequestIds.has(String(row.signRequestId))
252+
// Access signatureElementsStore.signs[row.type] directly to ensure reactivity
253+
const signatureData = this.signatureElementsStore.signs[row.type]
254+
const hasSignature = signatureData && signatureData.createdAt && signatureData.createdAt.length > 0
255+
return hasSignature && signRequestIds.has(String(row.signRequestId))
244256
})
245257
return visibleElements
246258
},
@@ -535,6 +547,29 @@ export default {
535547
</script>
536548
537549
<style lang="scss" scoped>
550+
.progress-indicator {
551+
font-weight: bold;
552+
color: var(--color-primary-element);
553+
text-align: center;
554+
margin-bottom: 16px;
555+
padding: 8px;
556+
background-color: var(--color-primary-element-light);
557+
border-radius: var(--border-radius-large);
558+
}
559+
560+
.step-explanation {
561+
margin-bottom: 16px;
562+
color: var(--color-text-maxcontrast);
563+
line-height: 1.5;
564+
}
565+
566+
.confirmation-text {
567+
margin-bottom: 16px;
568+
color: var(--color-text-maxcontrast);
569+
line-height: 1.5;
570+
text-align: center;
571+
}
572+
538573
.no-signature-warning {
539574
margin-top: 1em;
540575
}

0 commit comments

Comments
 (0)