Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
identifier: string;
title: string;
pageReference: string;
level?: number;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
level?: number;
isTopicSubitem?: boolean;

style?: StyleType;
fillColor?: string;
}
Expand Down Expand Up @@ -481,17 +482,26 @@
* @returns A line for the toc
*/
public createTocLine(
{ identifier, title, pageReference, fillColor = `` }: TocLineDefinition,
{ identifier, title, pageReference, level = 0, fillColor = `` }: TocLineDefinition,

Check failure on line 485 in client/src/app/gateways/export/pdf-document.service/pdf-document.service.ts

View workflow job for this annotation

GitHub Actions / build-and-test-dev-image

Delete `·`
...subTitle: Content[]
): Content[] {
const isSubItem = level > 0;
return [
{
text: identifier,
text: isSubItem ? `` : identifier,

Check failure on line 491 in client/src/app/gateways/export/pdf-document.service/pdf-document.service.ts

View workflow job for this annotation

GitHub Actions / build-and-test-dev-image

Delete `·`
noWrap: true,
style: `tocEntry`,
fillColor
},
{
text: [title, ...subTitle],
text: isSubItem
? [

Check failure on line 498 in client/src/app/gateways/export/pdf-document.service/pdf-document.service.ts

View workflow job for this annotation

GitHub Actions / build-and-test-dev-image

Replace `⏎························{·text:·identifier·?·`${identifier}···`·:·``},⏎························title,⏎························...subTitle⏎····················` with `{·text:·identifier·?·`${identifier}···`·:·``·},·title,·...subTitle`
{ text: identifier ? `${identifier} · ` : ``},
title,
...subTitle
]
: [title, ...subTitle],
margin: isSubItem ? [0, 0, 0, 0] : undefined,
style: `tocEntry`,
fillColor
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -598,7 +598,8 @@ export abstract class BasePollPdfService {
)) {
const tableLine = [
{
text: index
text: index,
noWrap: true
},
{
text: this.getUserNameForExport(date.user)
Expand Down Expand Up @@ -668,7 +669,8 @@ export abstract class BasePollPdfService {
}
const tableLine = [
{
text: index
text: index,
noWrap: true
},
{
text: name + represented
Expand All @@ -693,7 +695,7 @@ export abstract class BasePollPdfService {
return [
{
table: {
widths: showVoteWeight ? [`4%`, `32%`, `32%`, `32%`] : [`4%`, `48%`, `48%`],
widths: showVoteWeight ? [`4%`, `48%`, `24%`, `24%`] : [`4%`, `72%`, `24%`],
headerRows: 1,
body: pollTableBody
},
Expand All @@ -703,7 +705,7 @@ export abstract class BasePollPdfService {
}

private getUserNameForExport(user: ViewUser | undefined): string {
return user?.getShortName() ?? this.translate.instant(`Anonymous`);
return user?.getFullName() ?? this.translate.instant(`Anonymous`);
}

private getUserVoteWeightForExport(user: ViewUser | undefined): string {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,6 @@ export class AgendaPdfCatalogExportService {
// Initialize the header and the layout for border-style.
const header = this.getTocHeaderDefinition();
const layout = BorderType.LIGHT_HORIZONTAL_LINES;
// Create the toc title
const tocTitle = {
text: this.translate.instant(`Table of contents`),
style: `heading2`
};

// all agenda in the same table
const tocBody = [];
Expand All @@ -147,6 +142,7 @@ export class AgendaPdfCatalogExportService {
identifier: `${topic.item_number ? topic.item_number : ``}`,
title: topic.content_object?.title,
pageReference: `${topic.id}`,
level: topic.level,
style: StyleType.DEFAULT,
fillColor: (i + 1) % 2 ? TABLEROW_GREY : undefined
})
Expand All @@ -161,7 +157,7 @@ export class AgendaPdfCatalogExportService {
)
);

return [tocTitle, toc, this.pdfService.getPageBreak()];
return [toc, this.pdfService.getPageBreak()];
}

/**
Expand Down
Loading