Bugfix: missing text in PDF-exported diff view
This commit is contained in:
parent
2bdba5ac8e
commit
e5a27205d3
@ -537,39 +537,38 @@ export class MotionRepositoryService extends BaseIsAgendaItemAndListOfSpeakersCo
|
||||
return this.diff.getTextWithChanges(targetMotion.text, changes, lineLength, highlightLine);
|
||||
case ChangeRecoMode.Diff:
|
||||
let text = '';
|
||||
changes
|
||||
.filter(change => {
|
||||
return change.showInDiffView();
|
||||
})
|
||||
.forEach((change: ViewUnifiedChange, idx: number) => {
|
||||
if (idx === 0) {
|
||||
text += this.diff.extractMotionLineRange(
|
||||
targetMotion.text,
|
||||
{
|
||||
from: 1,
|
||||
to: change.getLineFrom()
|
||||
},
|
||||
true,
|
||||
lineLength,
|
||||
highlightLine
|
||||
);
|
||||
} else if (changes[idx - 1].getLineTo() < change.getLineFrom()) {
|
||||
text += this.diff.extractMotionLineRange(
|
||||
targetMotion.text,
|
||||
{
|
||||
from: changes[idx - 1].getLineTo(),
|
||||
to: change.getLineFrom()
|
||||
},
|
||||
true,
|
||||
lineLength,
|
||||
highlightLine
|
||||
);
|
||||
}
|
||||
text += this.diff.getChangeDiff(targetMotion.text, change, lineLength, highlightLine);
|
||||
});
|
||||
const changesToShow = changes.filter(change => {
|
||||
return change.showInDiffView();
|
||||
});
|
||||
changesToShow.forEach((change: ViewUnifiedChange, idx: number) => {
|
||||
if (idx === 0) {
|
||||
text += this.diff.extractMotionLineRange(
|
||||
targetMotion.text,
|
||||
{
|
||||
from: 1,
|
||||
to: change.getLineFrom()
|
||||
},
|
||||
true,
|
||||
lineLength,
|
||||
highlightLine
|
||||
);
|
||||
} else if (changes[idx - 1].getLineTo() < change.getLineFrom()) {
|
||||
text += this.diff.extractMotionLineRange(
|
||||
targetMotion.text,
|
||||
{
|
||||
from: changes[idx - 1].getLineTo(),
|
||||
to: change.getLineFrom()
|
||||
},
|
||||
true,
|
||||
lineLength,
|
||||
highlightLine
|
||||
);
|
||||
}
|
||||
text += this.diff.getChangeDiff(targetMotion.text, change, lineLength, highlightLine);
|
||||
});
|
||||
text += this.diff.getTextRemainderAfterLastChange(
|
||||
targetMotion.text,
|
||||
changes,
|
||||
changesToShow,
|
||||
lineLength,
|
||||
highlightLine
|
||||
);
|
||||
|
@ -612,7 +612,6 @@ export class MotionPdfService {
|
||||
motionText = this.motionRepo.formatStatuteAmendment(statutes, motion, lineLength);
|
||||
} else {
|
||||
// lead motion or normal amendments
|
||||
// TODO: Consider tile change recommendation
|
||||
|
||||
const changes = this.getUnifiedChanges(motion, lineLength);
|
||||
const textChanges = changes.filter(change => !change.isTitleChange());
|
||||
|
Loading…
Reference in New Issue
Block a user