Skip to content

Commit

Permalink
In pdf export of attachment trim trailing '/' of url setting (#3551)
Browse files Browse the repository at this point in the history
  • Loading branch information
reiterl authored Apr 26, 2024
1 parent 5309f17 commit f332307
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { Location } from '@angular/common';
import { Injectable } from '@angular/core';
import { TranslateService } from '@ngx-translate/core';
import { Content, ContentTable, ContentText, TableCell } from 'pdfmake/interfaces';
Expand Down Expand Up @@ -743,7 +744,7 @@ export class MotionPdfService {
private createAttachments(motion: ViewMotion): object {
let width = this.pdfDocumentService.pageSize === `A5` ? PDF_A5_POINTS_WIDTH : PDF_A4_POINTS_WIDTH;
width = width - this.pdfDocumentService.pageMarginPointsLeft - this.pdfDocumentService.pageMarginPointsRight;
const instancUrl = this.organizationSettingsService.instant(`url`);
const instanceUrl = this.organizationSettingsService.instant(`url`);

const attachments = [];
attachments.push({
Expand All @@ -763,11 +764,12 @@ export class MotionPdfService {
margin: [0, 0, 0, 10]
});
} else {
const link = Location.joinWithSlash(instanceUrl, fileUrl);
attachments.push({
ul: [
{
text: attachment.getTitle() + `: ` + instancUrl + fileUrl,
link: instancUrl + fileUrl,
text: attachment.getTitle() + `: ` + link,
link: link,
margin: [0, 0, 0, 5]
}
]
Expand Down

0 comments on commit f332307

Please sign in to comment.