3434 <ul class =" signing-progress__files-list" >
3535 <li
3636 v-for =" file in progress.files"
37- :key =" file.uuid "
37+ :key =" file.id "
3838 class =" signing-progress__file-item" >
3939 <div class =" signing-progress__file-status" >
40- <div v-if =" file.isSigned " class =" icon-checkmark" />
40+ <div v-if =" isProgressFileSigned( file) " class =" icon-checkmark" />
4141 <div v-else class =" icon-loading-small" />
4242 </div >
4343 <span class =" signing-progress__file-name" >{{ file.name }}</span >
4444 <span class =" signing-progress__file-progress" >
45- {{ file.signedCount }}/{{ file.totalSigners }}
45+ {{ file.statusText }}
4646 </span >
4747 </li >
4848 </ul >
5858 :key =" signer.id"
5959 class =" signing-progress__signer-item" >
6060 <div class =" signing-progress__signer-status" >
61- <div v-if =" signer.signed " class =" icon-checkmark" />
61+ <div v-if =" isProgressSignerSigned( signer) " class =" icon-checkmark" />
6262 <div v-else class =" icon-close" />
6363 </div >
6464 <span class =" signing-progress__signer-name" >{{ signer.displayName }}</span >
7373import { t } from ' @nextcloud/l10n'
7474import NcIconSvgWrapper from ' @nextcloud/vue/components/NcIconSvgWrapper'
7575import { computed } from ' vue'
76+ import type { components } from ' ../types/openapi/openapi'
7677
7778import { FILE_STATUS } from ' ../constants.js'
7879import { getStatusIcon } from ' ../utils/fileStatus.js'
@@ -81,22 +82,9 @@ defineOptions({
8182 name: ' RequestSigningProgress' ,
8283})
8384
84- type SigningProgress = {
85- total: number
86- signed: number
87- files? : Array <{
88- uuid: string
89- name: string
90- signedCount: number
91- totalSigners: number
92- isSigned: boolean
93- }>
94- signers? : Array <{
95- id: string | number
96- displayName: string
97- signed: boolean
98- }>
99- }
85+ type SigningProgress = components [' schemas' ][' ProgressPayload' ]
86+ type ProgressFile = components [' schemas' ][' ProgressFile' ]
87+ type ProgressSigner = components [' schemas' ][' ProgressSigner' ]
10088
10189const props = withDefaults (defineProps <{
10290 status: number
@@ -113,6 +101,14 @@ const isInProgress = computed(() => props.status === FILE_STATUS.SIGNING_IN_PROG
113101
114102const statusIconPath = computed (() => getStatusIcon (props .status ) || ' ' )
115103
104+ function isProgressFileSigned(file : ProgressFile ): boolean {
105+ return file .status === FILE_STATUS .SIGNED
106+ }
107+
108+ function isProgressSignerSigned(signer : ProgressSigner ): boolean {
109+ return signer .signed !== null
110+ }
111+
116112const progressPercentage = computed (() => {
117113 if (! props .progress || props .progress .total === 0 ) {
118114 return 0
@@ -123,6 +119,8 @@ const progressPercentage = computed(() => {
123119defineExpose ({
124120 isInProgress ,
125121 statusIconPath ,
122+ isProgressFileSigned ,
123+ isProgressSignerSigned ,
126124 progressPercentage ,
127125})
128126 </script >
0 commit comments