Don't include amendments into changed view

This commit is contained in:
Tobias Hößl 2019-09-12 10:36:54 +02:00
parent b0460931bb
commit 6be23c8d9d
No known key found for this signature in database
GPG Key ID: 1D780C7599C2D2A2
2 changed files with 15 additions and 4 deletions

View File

@ -17,7 +17,7 @@ import { TreeIdNode } from 'app/core/ui-services/tree.service';
import { Motion } from 'app/shared/models/motions/motion';
import { MotionPoll } from 'app/shared/models/motions/motion-poll';
import { Submitter } from 'app/shared/models/motions/submitter';
import { ViewUnifiedChange } from 'app/shared/models/motions/view-unified-change';
import { ViewUnifiedChange, ViewUnifiedChangeType } from 'app/shared/models/motions/view-unified-change';
import { PersonalNoteContent } from 'app/shared/models/users/personal-note';
import { ViewMediafile } from 'app/site/mediafiles/models/view-mediafile';
import { ViewCategory } from 'app/site/motions/models/view-category';
@ -577,7 +577,15 @@ export class MotionRepositoryService extends BaseIsAgendaItemAndListOfSpeakersCo
case ChangeRecoMode.Original:
return this.lineNumbering.insertLineNumbers(targetMotion.text, lineLength, highlightLine);
case ChangeRecoMode.Changed:
return this.diff.getTextWithChanges(targetMotion.text, changes, lineLength, highlightLine);
const changeRecommendations = changes.filter(
change => change.getChangeType() === ViewUnifiedChangeType.TYPE_CHANGE_RECOMMENDATION
);
return this.diff.getTextWithChanges(
targetMotion.text,
changeRecommendations,
lineLength,
highlightLine
);
case ChangeRecoMode.Diff:
let text = '';
const changesToShow = changes.filter(change => {

View File

@ -8,7 +8,7 @@ import { ChangeRecommendationRepositoryService } from 'app/core/repositories/mot
import { MotionRepositoryService } from 'app/core/repositories/motions/motion-repository.service';
import { DiffLinesInParagraph, DiffService, LineRange } from 'app/core/ui-services/diff.service';
import { LinenumberingService } from 'app/core/ui-services/linenumbering.service';
import { ViewUnifiedChange } from 'app/shared/models/motions/view-unified-change';
import { ViewUnifiedChange, ViewUnifiedChangeType } from 'app/shared/models/motions/view-unified-change';
import { ChangeRecoMode, LineNumberingMode, MotionTitleInformation } from 'app/site/motions/models/view-motion';
import { IBaseScaleScrollSlideComponent } from 'app/slides/base-scale-scroll-slide-component';
import { BaseMotionSlideComponent } from '../base/base-motion-slide';
@ -331,9 +331,12 @@ export class MotionSlideComponent extends BaseMotionSlideComponent<MotionSlideDa
case ChangeRecoMode.Original:
return this.lineNumbering.insertLineNumbers(motion.text, this.lineLength, this.highlightedLine);
case ChangeRecoMode.Changed:
const changeRecommendations = this.getAllTextChangingObjects().filter(
change => change.getChangeType() === ViewUnifiedChangeType.TYPE_CHANGE_RECOMMENDATION
);
return this.diff.getTextWithChanges(
motion.text,
this.getAllTextChangingObjects(),
changeRecommendations,
this.lineLength,
this.highlightedLine
);