Bugfix: missing text in PDF-exported diff view

This commit is contained in:
Tobias Hößl 2019-07-14 08:43:19 +02:00
parent 2bdba5ac8e
commit e5a27205d3
No known key found for this signature in database
GPG Key ID: 1D780C7599C2D2A2
2 changed files with 30 additions and 32 deletions

View File

@ -537,39 +537,38 @@ export class MotionRepositoryService extends BaseIsAgendaItemAndListOfSpeakersCo
return this.diff.getTextWithChanges(targetMotion.text, changes, lineLength, highlightLine); return this.diff.getTextWithChanges(targetMotion.text, changes, lineLength, highlightLine);
case ChangeRecoMode.Diff: case ChangeRecoMode.Diff:
let text = ''; let text = '';
changes const changesToShow = changes.filter(change => {
.filter(change => { return change.showInDiffView();
return change.showInDiffView(); });
}) changesToShow.forEach((change: ViewUnifiedChange, idx: number) => {
.forEach((change: ViewUnifiedChange, idx: number) => { if (idx === 0) {
if (idx === 0) { text += this.diff.extractMotionLineRange(
text += this.diff.extractMotionLineRange( targetMotion.text,
targetMotion.text, {
{ from: 1,
from: 1, to: change.getLineFrom()
to: change.getLineFrom() },
}, true,
true, lineLength,
lineLength, highlightLine
highlightLine );
); } else if (changes[idx - 1].getLineTo() < change.getLineFrom()) {
} else if (changes[idx - 1].getLineTo() < change.getLineFrom()) { text += this.diff.extractMotionLineRange(
text += this.diff.extractMotionLineRange( targetMotion.text,
targetMotion.text, {
{ from: changes[idx - 1].getLineTo(),
from: changes[idx - 1].getLineTo(), to: change.getLineFrom()
to: change.getLineFrom() },
}, true,
true, lineLength,
lineLength, highlightLine
highlightLine );
); }
} text += this.diff.getChangeDiff(targetMotion.text, change, lineLength, highlightLine);
text += this.diff.getChangeDiff(targetMotion.text, change, lineLength, highlightLine); });
});
text += this.diff.getTextRemainderAfterLastChange( text += this.diff.getTextRemainderAfterLastChange(
targetMotion.text, targetMotion.text,
changes, changesToShow,
lineLength, lineLength,
highlightLine highlightLine
); );

View File

@ -612,7 +612,6 @@ export class MotionPdfService {
motionText = this.motionRepo.formatStatuteAmendment(statutes, motion, lineLength); motionText = this.motionRepo.formatStatuteAmendment(statutes, motion, lineLength);
} else { } else {
// lead motion or normal amendments // lead motion or normal amendments
// TODO: Consider tile change recommendation
const changes = this.getUnifiedChanges(motion, lineLength); const changes = this.getUnifiedChanges(motion, lineLength);
const textChanges = changes.filter(change => !change.isTitleChange()); const textChanges = changes.filter(change => !change.isTitleChange());