From 6be23c8d9de7cbf1a8271164322d711fa2229e1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20Ho=CC=88=C3=9Fl?= Date: Thu, 12 Sep 2019 10:36:54 +0200 Subject: [PATCH] Don't include amendments into changed view --- .../motions/motion-repository.service.ts | 12 ++++++++++-- .../slides/motions/motion/motion-slide.component.ts | 7 +++++-- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/client/src/app/core/repositories/motions/motion-repository.service.ts b/client/src/app/core/repositories/motions/motion-repository.service.ts index e20d1c0b3..9ea15f1f8 100644 --- a/client/src/app/core/repositories/motions/motion-repository.service.ts +++ b/client/src/app/core/repositories/motions/motion-repository.service.ts @@ -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 => { diff --git a/client/src/app/slides/motions/motion/motion-slide.component.ts b/client/src/app/slides/motions/motion/motion-slide.component.ts index 86dfe4681..de62d207f 100644 --- a/client/src/app/slides/motions/motion/motion-slide.component.ts +++ b/client/src/app/slides/motions/motion/motion-slide.component.ts @@ -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 change.getChangeType() === ViewUnifiedChangeType.TYPE_CHANGE_RECOMMENDATION + ); return this.diff.getTextWithChanges( motion.text, - this.getAllTextChangingObjects(), + changeRecommendations, this.lineLength, this.highlightedLine );