Skip to content

Commit

Permalink
feat: Added logic for handling unavailable images
Browse files Browse the repository at this point in the history
Refs: #307
  • Loading branch information
pbezliapovich committed Jan 9, 2025
1 parent bbc9a19 commit 6f642d4
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/main/resources/webapp/pdf-exporter/js/export-common.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,10 @@ const ExportCommon = {
console.log('Async PDF conversion: still in progress, retrying...');
this.pullAndGetResultPdf(url, successCallback, errorCallback);
} else if (request.status === 200) {
let attachment = request.getResponseHeader("Unavailable-Work-Items-Attachments")
if (attachment) {
let count = request.getResponseHeader("Unavailable-Work-Items-Attachments-Count");
let warningMessage;
let count = request.getResponseHeader("Unavailable-Work-Items-Attachments-Count");
if (count > 0) {
let attachment = request.getResponseHeader("Unavailable-Work-Items-Attachments")
warningMessage = `${count} image(s) in WI(s) ${attachment} were not exported. They were replaced with an image containing 'This image is not accessible'.`;
}
successCallback({
Expand Down

0 comments on commit 6f642d4

Please sign in to comment.