@@ -134,9 +134,9 @@ import { useSidebarStore } from '../store/sidebar.js'
134134import type {
135135 LoadedValidationEnvelopeDocument ,
136136 LoadedValidationFileDocument ,
137- ValidationViewChildFile ,
138- ValidationViewDocument ,
139- ValidationViewSigner ,
137+ SignerDetailRecord ,
138+ ValidatedChildFileRecord ,
139+ ValidationFileRecord ,
140140} from ' ../types/index'
141141
142142defineOptions ({
@@ -155,7 +155,7 @@ type RouterState = {
155155}
156156
157157type ToggleOpenState = Record <number , boolean >
158- type ValidationStatus = ValidationViewDocument [' status' ]
158+ type ValidationStatus = ValidationFileRecord [' status' ]
159159type ValidationStatusInfo = {
160160 id? : number
161161 label? : string
@@ -164,7 +164,7 @@ type ValidationModificationInfo = {
164164 status? : number
165165 valid? : boolean
166166}
167- type ValidationDisplaySigner = ValidationViewSigner & {
167+ type ValidationDisplaySigner = SignerDetailRecord & {
168168 signature_validation? : ValidationStatusInfo
169169 certificate_validation? : ValidationStatusInfo
170170 modification_validation? : ValidationModificationInfo
@@ -215,21 +215,21 @@ function toValidationStatus(value: unknown): ValidationStatus | null {
215215 return null
216216}
217217
218- function normalizeValidationSigner(signer : unknown ): ValidationViewSigner | null {
218+ function normalizeValidationSigner(signer : unknown ): SignerDetailRecord | null {
219219 if (! isRecord (signer )) {
220220 return null
221221 }
222- return { ... signer } as ValidationViewSigner
222+ return { ... signer } as SignerDetailRecord
223223}
224224
225- function normalizeValidationChildFile(file : unknown ): ValidationViewChildFile | null {
225+ function normalizeValidationChildFile(file : unknown ): ValidatedChildFileRecord | null {
226226 if (! isRecord (file )) {
227227 return null
228228 }
229- return { ... file } as ValidationViewChildFile
229+ return { ... file } as ValidatedChildFileRecord
230230}
231231
232- function normalizeValidationDocument(data : unknown ): ValidationViewDocument | null {
232+ function normalizeValidationDocument(data : unknown ): ValidationFileRecord | null {
233233 if (! isRecord (data )) {
234234 return null
235235 }
@@ -241,12 +241,12 @@ function normalizeValidationDocument(data: unknown): ValidationViewDocument | nu
241241 const files = Array .isArray (data .files )
242242 ? data .files
243243 .map (normalizeValidationChildFile )
244- .filter ((file ): file is ValidationViewChildFile => file !== null )
244+ .filter ((file ): file is ValidatedChildFileRecord => file !== null )
245245 : undefined
246246 const signers = Array .isArray (data .signers )
247247 ? data .signers
248248 .map (normalizeValidationSigner )
249- .filter ((signer ): signer is ValidationViewSigner => signer !== null )
249+ .filter ((signer ): signer is SignerDetailRecord => signer !== null )
250250 : undefined
251251 const nodeType = data .nodeType === ' envelope'
252252 ? ' envelope'
@@ -261,7 +261,7 @@ function normalizeValidationDocument(data: unknown): ValidationViewDocument | nu
261261 }
262262
263263 return {
264- ... (data as ValidationViewDocument ),
264+ ... (data as ValidationFileRecord ),
265265 uuid ,
266266 name ,
267267 nodeId ,
@@ -279,11 +279,11 @@ function getValidationErrorMessage(response: ValidationErrorResponse | undefined
279279 return fallback
280280}
281281
282- function isLoadedValidationEnvelopeDocument(document : ValidationViewDocument | null ): document is LoadedValidationEnvelopeDocument {
282+ function isLoadedValidationEnvelopeDocument(document : ValidationFileRecord | null ): document is LoadedValidationEnvelopeDocument {
283283 return document ?.nodeType === ' envelope'
284284}
285285
286- function isLoadedValidationFileDocument(document : ValidationViewDocument | null ): document is LoadedValidationFileDocument {
286+ function isLoadedValidationFileDocument(document : ValidationFileRecord | null ): document is LoadedValidationFileDocument {
287287 return document ?.nodeType === ' file'
288288}
289289
@@ -299,7 +299,7 @@ const logo = ref(logoGray)
299299const uuidToValidate = ref (route .value .params ?.uuid ?? ' ' )
300300const hasInfo = ref (false )
301301const loading = ref (false )
302- const document = ref <ValidationViewDocument | null >(null )
302+ const document = ref <ValidationFileRecord | null >(null )
303303const legalInformation = ref (loadState (' libresign' , ' legal_information' , ' ' ))
304304const clickedValidate = ref (false )
305305const getUUID = ref (false )
@@ -417,14 +417,6 @@ function dateFromSqlAnsi(date: string) {
417417 return Moment (Date .parse (date )).format (' LL LTS' )
418418}
419419
420- function toggleDetail(signer : ValidationViewSigner ) {
421- signer .opened = ! signer .opened
422- }
423-
424- function toggleFileDetail(file : ValidationViewChildFile ) {
425- file .opened = ! file .opened
426- }
427-
428420function getSignerStatus(status : string ) {
429421 const statusMap: Record <string , string > = {
430422 pending: t (' libresign' , ' Pending' ),
@@ -734,12 +726,6 @@ function handleValidationSuccess(data: unknown) {
734726 })
735727 }
736728 document .value = normalizedDocument
737- document .value .signers ?.forEach (signer => {
738- signer .opened = false
739- })
740- document .value .files ?.forEach (file => {
741- file .opened = false
742- })
743729 hasInfo .value = true
744730 const isSignedStatus = (status : unknown ) => Number (status ) === FILE_STATUS .SIGNED
745731 const isSignedDoc = isSignedStatus (document .value ?.status )
@@ -837,10 +823,6 @@ if (!uuidToValidate.value) {
837823 document .value = null
838824 hasInfo .value = false
839825 void validate (uuidToValidate .value )
840- } else if (hasInfo .value && document .value .signers ) {
841- document .value .signers .forEach (signer => {
842- signer .opened = false
843- })
844826 } else if (uuidToValidate .value .length > 0 ) {
845827 void validate (uuidToValidate .value )
846828 }
@@ -905,8 +887,6 @@ defineExpose({
905887 upload ,
906888 uploadFile ,
907889 dateFromSqlAnsi ,
908- toggleDetail ,
909- toggleFileDetail ,
910890 getSignerStatus ,
911891 validate ,
912892 validateByUUID ,
0 commit comments