Skip to content

Commit

Permalink
ELEMENTS-1722: preview for Office files in the Attachments
Browse files Browse the repository at this point in the history
  • Loading branch information
rakeshkumar1019 committed Apr 18, 2024
1 parent ee09dbc commit f3c2769
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions ui/nuxeo-document-preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,14 @@ import './viewers/nuxeo-video-viewer.js';
<nuxeo-pdf-viewer src="[[_computeRendition(document, xpath, 'pdf')]]"></nuxeo-pdf-viewer>
</template>
<template mime-pattern=".*">
<template mime-pattern="application/zip">
<object id="frame" data="[[_computeObjectSource(_blob)]]"></object>
</template>
<template mime-pattern=".*">
<nuxeo-pdf-viewer src="[[_computeObjectSource(_blob)]]"></nuxeo-pdf-viewer>
</template>
<div id="preview"></div>
`;
}
Expand Down Expand Up @@ -364,7 +368,9 @@ import './viewers/nuxeo-video-viewer.js';
if (!viewUrl) {
viewUrl = this.document.contextParameters.preview.url;
}
if (this.xpath !== 'file:content') {
if (this.xpath !== 'file:content' && this._blob['mime-type'] !== 'application/zip') {
viewUrl = viewUrl.replace('/@preview/', `/@blob/${this.xpath}/@convert?converter=any2pdf&`);
} else {
viewUrl = viewUrl.replace('/@preview/', `/@blob/${this.xpath}/@preview/`);
}
return viewUrl;
Expand Down

0 comments on commit f3c2769

Please sign in to comment.