Merge pull request #5467 from tsiegleauq/pdf-error-free-text-amendment
Fix PDF generation for motion with free amendments
This commit is contained in:
commit
271ccdd46a
@ -630,17 +630,26 @@ export class MotionPdfService {
|
|||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
private getUnifiedChanges(motion: ViewMotion, lineLength: number): ViewUnifiedChange[] {
|
private getUnifiedChanges(motion: ViewMotion, lineLength: number): ViewUnifiedChange[] {
|
||||||
return this.changeRecoRepo
|
const changeRecosOfMotion = this.changeRecoRepo.getChangeRecoOfMotion(motion.id);
|
||||||
.getChangeRecoOfMotion(motion.id)
|
|
||||||
|
if (changeRecosOfMotion && changeRecosOfMotion.length) {
|
||||||
|
return changeRecosOfMotion
|
||||||
.concat(
|
.concat(
|
||||||
this.motionRepo.getAmendmentsInstantly(motion.id).flatMap((amendment: ViewMotion) => {
|
this.motionRepo.getAmendmentsInstantly(motion.id).flatMap((amendment: ViewMotion) => {
|
||||||
const changeRecos = this.changeRecoRepo
|
const changeRecos = this.changeRecoRepo
|
||||||
.getChangeRecoOfMotion(amendment.id)
|
.getChangeRecoOfMotion(amendment.id)
|
||||||
.filter(reco => reco.showInFinalView());
|
.filter(reco => reco.showInFinalView());
|
||||||
|
if (changeRecos && changeRecos.length) {
|
||||||
return this.motionRepo.getAmendmentAmendedParagraphs(amendment, lineLength, changeRecos);
|
return this.motionRepo.getAmendmentAmendedParagraphs(amendment, lineLength, changeRecos);
|
||||||
|
}
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
.sort((a, b) => a.getLineFrom() - b.getLineFrom()) as ViewUnifiedChange[];
|
.sort((a, b) => {
|
||||||
|
return a.getLineFrom() - b.getLineFrom();
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user