From f33230798c84c878de6a4c0887b696dc5b0327e6 Mon Sep 17 00:00:00 2001 From: reiterl Date: Fri, 26 Apr 2024 13:23:16 +0200 Subject: [PATCH] In pdf export of attachment trim trailing '/' of url setting (#3551) --- .../export/motion-pdf.service/motion-pdf.service.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/client/src/app/site/pages/meetings/pages/motions/services/export/motion-pdf.service/motion-pdf.service.ts b/client/src/app/site/pages/meetings/pages/motions/services/export/motion-pdf.service/motion-pdf.service.ts index 61d3808595..097a21845b 100644 --- a/client/src/app/site/pages/meetings/pages/motions/services/export/motion-pdf.service/motion-pdf.service.ts +++ b/client/src/app/site/pages/meetings/pages/motions/services/export/motion-pdf.service/motion-pdf.service.ts @@ -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'; @@ -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({ @@ -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] } ]