Skip to content

Commit 64406a6

Browse files
authored
Merge pull request #7226 from LibreSign/hotfix/v12.3.2-requestsignaturetab-modal-urls
hotfix: v12.3.2 requestsignaturetab modal urls
2 parents ed1e105 + 8d65215 commit 64406a6

6 files changed

Lines changed: 48 additions & 10 deletions

File tree

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@ Types of changes:
1818

1919
<!-- changelog-linker -->
2020
<!-- changelog-linker -->
21+
## 12.3.3 - 2026-03-06
22+
23+
### Fixes
24+
- fix: avoid router resolution in request signature tab modal
25+
- test: cover modal urls in request signature tab
26+
2127
## 12.3.2 - 2026-03-06
2228

2329
### Fixes

appinfo/info.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Developed with ❤️ by [LibreCode](https://librecode.coop). Help us transform
2525
2626
* [Donate with GitHub Sponsor: ![Donate using GitHub Sponsor](https://img.shields.io/static/v1?label=Sponsor&message=%E2%9D%A4&logo=GitHub&color=%23fe8e86)](https://github.com/sponsors/libresign)
2727
]]></description>
28-
<version>12.3.2</version>
28+
<version>12.3.3</version>
2929
<licence>agpl</licence>
3030
<author mail="contact@librecode.coop" homepage="https://librecode.coop">LibreCode</author>
3131
<types>

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "libresign",
33
"description": "A app for signing documents",
4-
"version": "12.3.2",
4+
"version": "12.3.3",
55
"license": "agpl",
66
"private": true,
77
"scripts": {

src/components/RightSidebar/RequestSignatureTab.vue

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,6 @@ import svgSignal from '../../../img/logo-signal-app.svg?raw'
308308
import svgTelegram from '../../../img/logo-telegram-app.svg?raw'
309309
import { FILE_STATUS, SIGN_REQUEST_STATUS } from '../../constants.js'
310310
import { openDocument } from '../../utils/viewer.js'
311-
import router from '../../router/router'
312311
import { useFilesStore } from '../../store/files.js'
313312
import { useSidebarStore } from '../../store/sidebar.js'
314313
import { useSignStore } from '../../store/sign.js'
@@ -875,8 +874,7 @@ export default {
875874
}
876875
877876
if (this.useModal) {
878-
const route = router.resolve({ name: 'ValidationFileExternal', params: { uuid: targetUuid } })
879-
this.modalSrc = route.href
877+
this.modalSrc = generateUrl('/apps/libresign/p/validation/{uuid}', { uuid: targetUuid })
880878
return
881879
}
882880
this.$router.push({ name: 'ValidationFile', params: { uuid: targetUuid } })
@@ -1026,8 +1024,7 @@ export default {
10261024
10271025
const uuid = file.signUuid
10281026
if (this.useModal) {
1029-
const route = router.resolve({ name: 'SignPDFExternal', params: { uuid } })
1030-
this.modalSrc = route.href
1027+
this.modalSrc = generateUrl('/apps/libresign/p/sign/{uuid}/pdf', { uuid })
10311028
return
10321029
}
10331030
this.signStore.setFileToSign(this.filesStore.getFile())

src/tests/components/RightSidebar/RequestSignatureTab.spec.ts

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,18 @@ import type { useFilesStore as useFilesStoreType } from '../../../store/files.js
1010
let RequestSignatureTab: unknown
1111
import { FILE_STATUS } from '../../../constants.js'
1212

13+
const { generateUrlMock } = vi.hoisted(() => ({
14+
generateUrlMock: vi.fn((path: string, params?: Record<string, string | number>) => {
15+
if (!params) {
16+
return path
17+
}
18+
19+
return Object.entries(params).reduce((url, [key, value]) => {
20+
return url.replace(`{${key}}`, String(value))
21+
}, path)
22+
}),
23+
}))
24+
1325
// Mock translation function
1426
;(globalThis as typeof globalThis & { t: (app: string, msg: string) => string }).t = vi.fn((app: string, msg: string) => msg)
1527

@@ -46,7 +58,7 @@ vi.mock('@nextcloud/dialogs')
4658
vi.mock('@nextcloud/axios')
4759
vi.mock('@nextcloud/router', () => ({
4860
generateOcsUrl: vi.fn((path) => `/ocs${path}`),
49-
generateUrl: vi.fn((path) => path),
61+
generateUrl: (...args: Parameters<typeof generateUrlMock>) => generateUrlMock(...args),
5062
getRootUrl: vi.fn(() => ''),
5163
}))
5264

@@ -68,6 +80,7 @@ describe('RequestSignatureTab - Critical Business Rules', () => {
6880

6981
beforeEach(async () => {
7082
setActivePinia(createPinia())
83+
generateUrlMock.mockClear()
7184
RequestSignatureTab = (await import('../../../components/RightSidebar/RequestSignatureTab.vue')).default
7285
const { useFilesStore } = await import('../../../store/files.js')
7386
filesStore = useFilesStore()
@@ -351,6 +364,28 @@ describe('RequestSignatureTab - Critical Business Rules', () => {
351364
})
352365
})
353366

367+
describe('RULE: modal navigation uses absolute generated URLs', () => {
368+
it('uses generateUrl for validation modal links', async () => {
369+
await wrapper.setProps({ useModal: true })
370+
await updateFile({ uuid: 'validation-uuid' })
371+
372+
wrapper.vm.validationFile()
373+
374+
expect(generateUrlMock).toHaveBeenCalledWith('/apps/libresign/p/validation/{uuid}', { uuid: 'validation-uuid' })
375+
expect(wrapper.vm.modalSrc).toBe('/apps/libresign/p/validation/validation-uuid')
376+
})
377+
378+
it('uses generateUrl for signing modal links', async () => {
379+
await wrapper.setProps({ useModal: true })
380+
await updateFile({ signUuid: 'sign-uuid' })
381+
382+
await wrapper.vm.sign()
383+
384+
expect(generateUrlMock).toHaveBeenCalledWith('/apps/libresign/p/sign/{uuid}/pdf', { uuid: 'sign-uuid' })
385+
expect(wrapper.vm.modalSrc).toBe('/apps/libresign/p/sign/sign-uuid/pdf')
386+
})
387+
})
388+
354389
describe('RULE: canEditSigningOrder when using ordered flow', () => {
355390
beforeEach(async () => {
356391
await updateFile({

0 commit comments

Comments
 (0)