Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/fullcalendar/interaction/eventClick.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,5 +115,5 @@ function handleToDoClick(event, route, window, isWidget = false) {
return
}
const url = `apps/tasks/calendars/${encodeURIComponent(calendarId)}/tasks/${encodeURIComponent(taskId)}`
window.location.href = generateUrl(url)
window.open(generateUrl(url), '_blank')
}
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,7 @@ describe('fullcalendar/eventClick test suite', () => {
protocol: 'http:',
host: 'nextcloud.testing',
},
open: vi.fn(),
}

generateUrl
Expand All @@ -328,7 +329,8 @@ describe('fullcalendar/eventClick test suite', () => {
expect(generateUrl).toHaveBeenCalledTimes(1)
expect(generateUrl).toHaveBeenNthCalledWith(1, 'apps/tasks/calendars/reminders/tasks/EAFB112A-4556-404A-B807-B1E040D0F7A0.ics')

expect(window.location.href).toEqual('/generated-url')
expect(window.open).toHaveBeenCalledTimes(1)
expect(window.open).toHaveBeenNthCalledWith(1, '/generated-url', '_blank')
})

it('should do nothing when tasks is disabled and route is public', () => {
Expand Down Expand Up @@ -603,6 +605,7 @@ describe('fullcalendar/eventClick test suite', () => {
protocol: 'http:',
host: 'nextcloud.testing',
},
open: vi.fn(),
}

generateUrl.mockReturnValueOnce('/generated-url')
Expand All @@ -619,7 +622,8 @@ describe('fullcalendar/eventClick test suite', () => {

expect(generateUrl).toHaveBeenCalledTimes(1)
expect(generateUrl).toHaveBeenNthCalledWith(1, 'apps/tasks/calendars/calendar_shared_by_User%2520NAME/tasks/EAFB112A-4556-404A-B807-B1E040D0F7A0.ics')
expect(window.location.href).toEqual('/generated-url')
expect(window.open).toHaveBeenCalledTimes(1)
expect(window.open).toHaveBeenNthCalledWith(1, '/generated-url', '_blank')
})

it('should encode special characters in calendarId and taskId', () => {
Expand All @@ -641,6 +645,7 @@ describe('fullcalendar/eventClick test suite', () => {
protocol: 'http:',
host: 'nextcloud.testing',
},
open: vi.fn(),
}

generateUrl.mockReturnValueOnce('/generated-url')
Expand All @@ -657,6 +662,7 @@ describe('fullcalendar/eventClick test suite', () => {

expect(generateUrl).toHaveBeenCalledTimes(1)
expect(generateUrl).toHaveBeenNthCalledWith(1, 'apps/tasks/calendars/calendar%23special/tasks/task%3Ffile%26name.ics')
expect(window.location.href).toEqual('/generated-url')
expect(window.open).toHaveBeenCalledTimes(1)
expect(window.open).toHaveBeenNthCalledWith(1, '/generated-url', '_blank')
})
})
Loading