Skip to content

Commit d6d09af

Browse files
committed
refactor: rename setDocumentToSign to setFileToSign
Improve semantics to work for both single files and envelopes. Update all call sites across the codebase. Signed-off-by: Vitor Mattos <[email protected]>
1 parent aed144a commit d6d09af

3 files changed

Lines changed: 9 additions & 9 deletions

File tree

src/Components/RightSidebar/RequestSignatureTab.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -903,7 +903,7 @@ export default {
903903
this.modalSrc = route.href
904904
return
905905
}
906-
this.signStore.setDocumentToSign(this.filesStore.getFile())
906+
this.signStore.setFileToSign(this.filesStore.getFile())
907907
this.$router.push({ name: 'SignPDF', params: { uuid } })
908908
},
909909

src/store/sign.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ const defaultState = {
2121
statusText: '',
2222
url: '',
2323
nodeId: 0,
24+
nodeType: 'file',
2425
uuid: '',
2526
signers: [],
2627
},
@@ -33,32 +34,31 @@ export const useSignStore = defineStore('sign', {
3334
actions: {
3435
initFromState() {
3536
this.errors = loadState('libresign', 'errors', [])
36-
const pdf = loadState('libresign', 'pdf', [])
37+
3738
const file = {
3839
name: loadState('libresign', 'filename', ''),
3940
description: loadState('libresign', 'description', ''),
4041
status: loadState('libresign', 'status', ''),
4142
statusText: loadState('libresign', 'statusText', ''),
42-
url: pdf.url,
4343
nodeId: loadState('libresign', 'nodeId', 0),
4444
uuid: loadState('libresign', 'uuid', null),
4545
signers: loadState('libresign', 'signers', []),
4646
}
47-
this.setDocumentToSign(file)
47+
this.setFileToSign(file)
4848
const filesStore = useFilesStore()
4949
filesStore.addFile(file)
5050
filesStore.selectedNodeId = file.nodeId
5151
},
52-
setDocumentToSign(document) {
53-
if (document) {
52+
setFileToSign(file) {
53+
if (file) {
5454
this.errors = []
55-
set(this, 'document', document)
55+
set(this, 'document', file)
5656

5757
const sidebarStore = useSidebarStore()
5858
sidebarStore.activeSignTab()
5959

6060
const signMethodsStore = useSignMethodsStore()
61-
const signer = document.signers.find(row => row.me) || {}
61+
const signer = file.signers.find(row => row.me) || {}
6262
signMethodsStore.settings = signer.signatureMethods
6363
return
6464
}

src/views/FilesList/FileEntry/FileEntryActions.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ export default {
191191
signer_uuid: signUuid,
192192
force_fetch: true,
193193
})
194-
this.signStore.setDocumentToSign(files[this.source.nodeId])
194+
this.signStore.setFileToSign(files[this.source.nodeId])
195195
this.$router.push({
196196
name: 'SignPDF',
197197
params: {

0 commit comments

Comments
 (0)