|
29 | 29 | {{ documentStatus }} |
30 | 30 | </template> |
31 | 31 | </NcListItem> |
32 | | - <NcListItem v-if="document.filesCount" class="extra" compact> |
| 32 | + <NcListItem v-if="envelopeFilesCount !== null" class="extra" compact> |
33 | 33 | <template #name> |
34 | 34 | <strong>{{ t('libresign', 'Number of documents:') }}</strong> |
35 | | - {{ document.filesCount }} |
| 35 | + {{ envelopeFilesCount }} |
36 | 36 | </template> |
37 | 37 | </NcListItem> |
38 | 38 | <NcListItem v-if="document.signedDate" class="extra" compact> |
|
161 | 161 | <script setup lang="ts"> |
162 | 162 | import { n, t } from '@nextcloud/l10n' |
163 | 163 | 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' |
164 | 171 | import { computed, ref, watch } from 'vue' |
165 | 172 |
|
166 | 173 | import { |
@@ -215,6 +222,15 @@ const fileOpenState = ref<Record<number, boolean>>({}) |
215 | 222 | const signerOpenState = ref<Record<number, boolean>>({}) |
216 | 223 |
|
217 | 224 | 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 | +}) |
218 | 234 |
|
219 | 235 | function resetDisclosureState() { |
220 | 236 | fileOpenState.value = {} |
@@ -274,6 +290,7 @@ watch(() => props.document, () => { |
274 | 290 | defineExpose({ |
275 | 291 | isTouchDevice, |
276 | 292 | documentStatus, |
| 293 | + envelopeFilesCount, |
277 | 294 | isSignerOpen, |
278 | 295 | isFileOpen, |
279 | 296 | getFileStatusText, |
|
0 commit comments