mirror of
https://github.com/LibreSign/libresign.git
synced 2025-12-18 05:20:45 +01:00
Merge pull request #5940 from LibreSign/fix/id-docs-open-file
fix: id docs open file
This commit is contained in:
commit
d0017cb12a
2 changed files with 34 additions and 2 deletions
|
|
@ -109,7 +109,7 @@ class IdDocsMapper extends QBMapper {
|
|||
$pagination->setCurrentPage($page);
|
||||
$currentPageResults = $pagination->getCurrentPageResults();
|
||||
|
||||
$url = $this->urlGenerator->linkToRoute('libresign.page.getPdfFile', ['uuid' => '_replace_']);
|
||||
$url = $this->urlGenerator->linkToRoute('libresign.page.getPdf', ['uuid' => '_replace_']);
|
||||
$url = str_replace('_replace_', '', $url);
|
||||
|
||||
$data = [];
|
||||
|
|
|
|||
|
|
@ -102,7 +102,13 @@
|
|||
</template>
|
||||
</td>
|
||||
<td class="id-docs-table__cell--frozen-right">
|
||||
<NcActions :force-name="true" :inline="3">
|
||||
<NcActions :force-name="true" :inline="4">
|
||||
<NcActionButton @click="openFile(doc)">
|
||||
<template #icon>
|
||||
<FileDocumentOutlineIcon :size="20" />
|
||||
</template>
|
||||
{{ t('libresign', 'Open file') }}
|
||||
</NcActionButton>
|
||||
<NcActionButton @click="openValidationURL(doc)">
|
||||
<template #icon>
|
||||
<EyeIcon :size="20" />
|
||||
|
|
@ -152,6 +158,7 @@ import CloseIcon from 'vue-material-design-icons/Close.vue'
|
|||
import DeleteIcon from 'vue-material-design-icons/Delete.vue'
|
||||
import EyeIcon from 'vue-material-design-icons/Eye.vue'
|
||||
import FileDocumentIcon from 'vue-material-design-icons/FileDocument.vue'
|
||||
import FileDocumentOutlineIcon from 'vue-material-design-icons/FileDocumentOutline.vue'
|
||||
import FilterIcon from 'vue-material-design-icons/Filter.vue'
|
||||
import PencilIcon from 'vue-material-design-icons/Pencil.vue'
|
||||
|
||||
|
|
@ -163,6 +170,7 @@ export default {
|
|||
ClockAlertIcon,
|
||||
CloseIcon,
|
||||
DeleteIcon,
|
||||
FileDocumentOutlineIcon,
|
||||
EyeIcon,
|
||||
FileDocumentIcon,
|
||||
FilterIcon,
|
||||
|
|
@ -259,6 +267,30 @@ export default {
|
|||
}
|
||||
},
|
||||
|
||||
openFile(doc) {
|
||||
const fileUrl = doc.file?.file?.url
|
||||
|
||||
if (!fileUrl) {
|
||||
showError(t('libresign', 'File not found'))
|
||||
return
|
||||
}
|
||||
|
||||
if (OCA?.Viewer !== undefined) {
|
||||
const fileInfo = {
|
||||
source: fileUrl,
|
||||
basename: doc.file.name,
|
||||
mime: 'application/pdf',
|
||||
fileid: doc.nodeId,
|
||||
}
|
||||
OCA.Viewer.open({
|
||||
fileInfo,
|
||||
list: [fileInfo],
|
||||
})
|
||||
} else {
|
||||
window.open(`${fileUrl}?_t=${Date.now()}`)
|
||||
}
|
||||
},
|
||||
|
||||
openValidationURL(doc) {
|
||||
const uuid = doc.file?.uuid || doc.uuid
|
||||
if (!uuid) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue