Skip to content

Commit 122b3ef

Browse files
committed
fix: show envelope documents count reliably on validation
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
1 parent 9ffbc3b commit 122b3ef

1 file changed

Lines changed: 19 additions & 2 deletions

File tree

src/components/validation/EnvelopeValidation.vue

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@
2929
{{ documentStatus }}
3030
</template>
3131
</NcListItem>
32-
<NcListItem v-if="document.filesCount" class="extra" compact>
32+
<NcListItem v-if="envelopeFilesCount !== null" class="extra" compact>
3333
<template #name>
3434
<strong>{{ t('libresign', 'Number of documents:') }}</strong>
35-
{{ document.filesCount }}
35+
{{ envelopeFilesCount }}
3636
</template>
3737
</NcListItem>
3838
<NcListItem v-if="document.signedDate" class="extra" compact>
@@ -161,6 +161,13 @@
161161
<script setup lang="ts">
162162
import { n, t } from '@nextcloud/l10n'
163163
import { generateUrl } from '@nextcloud/router'
164+
import NcActionButton from '@nextcloud/vue/components/NcActionButton'
165+
import NcAvatar from '@nextcloud/vue/components/NcAvatar'
166+
import NcButton from '@nextcloud/vue/components/NcButton'
167+
import NcIconSvgWrapper from '@nextcloud/vue/components/NcIconSvgWrapper'
168+
import NcListItem from '@nextcloud/vue/components/NcListItem'
169+
import NcNoteCard from '@nextcloud/vue/components/NcNoteCard'
170+
import NcRichText from '@nextcloud/vue/components/NcRichText'
164171
import { computed, ref, watch } from 'vue'
165172
166173
import {
@@ -215,6 +222,15 @@ const fileOpenState = ref<Record<number, boolean>>({})
215222
const signerOpenState = ref<Record<number, boolean>>({})
216223
217224
const documentStatus = computed(() => getStatusLabel(props.document.status))
225+
const envelopeFilesCount = computed(() => {
226+
if (typeof props.document.filesCount === 'number') {
227+
return props.document.filesCount
228+
}
229+
if (Array.isArray(props.document.files)) {
230+
return props.document.files.length
231+
}
232+
return null
233+
})
218234
219235
function resetDisclosureState() {
220236
fileOpenState.value = {}
@@ -274,6 +290,7 @@ watch(() => props.document, () => {
274290
defineExpose({
275291
isTouchDevice,
276292
documentStatus,
293+
envelopeFilesCount,
277294
isSignerOpen,
278295
isFileOpen,
279296
getFileStatusText,

0 commit comments

Comments
 (0)