From 1a0e017f8091ef2f1e65097593420c327122d99f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20Ho=CC=88=C3=9Fl?= Date: Wed, 16 Sep 2020 19:51:07 +0200 Subject: [PATCH] Fix changed amendment in slides --- .../motions/motion-repository.service.ts | 16 +++++++ .../motion-detail-diff.component.ts | 14 +----- .../motion/motion-slide.component.html | 47 ++++++++++++++++++- .../motions/motion/motion-slide.component.ts | 38 +++++++++++++++ 4 files changed, 101 insertions(+), 14 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 a80da6d5c..209e8d189 100644 --- a/client/src/app/core/repositories/motions/motion-repository.service.ts +++ b/client/src/app/core/repositories/motions/motion-repository.service.ts @@ -1121,4 +1121,20 @@ export class MotionRepositoryService extends BaseIsAgendaItemAndListOfSpeakersCo } }); } + + public changeHasCollissions(change: ViewUnifiedChange, changes: ViewUnifiedChange[]): boolean { + return ( + changes.filter((otherChange: ViewUnifiedChange) => { + return ( + otherChange.getChangeId() !== change.getChangeId() && + ((otherChange.getLineFrom() >= change.getLineFrom() && + otherChange.getLineFrom() < change.getLineTo()) || + (otherChange.getLineTo() > change.getLineFrom() && + otherChange.getLineTo() <= change.getLineTo()) || + (otherChange.getLineFrom() < change.getLineFrom() && + otherChange.getLineTo() > change.getLineTo())) + ); + }).length > 0 + ); + } } diff --git a/client/src/app/site/motions/modules/motion-detail/components/motion-detail-diff/motion-detail-diff.component.ts b/client/src/app/site/motions/modules/motion-detail/components/motion-detail-diff/motion-detail-diff.component.ts index d0b084323..cfac1619b 100644 --- a/client/src/app/site/motions/modules/motion-detail/components/motion-detail-diff/motion-detail-diff.component.ts +++ b/client/src/app/site/motions/modules/motion-detail/components/motion-detail-diff/motion-detail-diff.component.ts @@ -155,19 +155,7 @@ export class MotionDetailDiffComponent extends BaseViewComponent implements Afte * @param {ViewUnifiedChange[]} changes */ public hasCollissions(change: ViewUnifiedChange, changes: ViewUnifiedChange[]): boolean { - return ( - changes.filter((otherChange: ViewUnifiedChange) => { - return ( - otherChange.getChangeId() !== change.getChangeId() && - ((otherChange.getLineFrom() >= change.getLineFrom() && - otherChange.getLineFrom() < change.getLineTo()) || - (otherChange.getLineTo() > change.getLineFrom() && - otherChange.getLineTo() <= change.getLineTo()) || - (otherChange.getLineFrom() < change.getLineFrom() && - otherChange.getLineTo() > change.getLineTo())) - ); - }).length > 0 - ); + return this.motionRepo.changeHasCollissions(change, changes); } /** diff --git a/client/src/app/slides/motions/motion/motion-slide.component.html b/client/src/app/slides/motions/motion/motion-slide.component.html index da4608861..5529bc8d4 100644 --- a/client/src/app/slides/motions/motion/motion-slide.component.html +++ b/client/src/app/slides/motions/motion/motion-slide.component.html @@ -105,7 +105,7 @@ > -
+
{{ 'No changes at the text.' | translate }}
@@ -127,6 +127,51 @@
+ +
+
+
+
+ {{ 'Rejected' | translate }} +
+ +
+
{{ 'Changed title' | translate }}:
+
+
+
+
+
+
+
+ {{ 'Rejected' | translate }} +
+ +
+ {{ change.amendment.identifier }} - {{ change.amendment.state.name | translate }} +
+ +
+
+
+
+

{{ 'Reason' | translate }}

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 103522400..813eeb8d8 100644 --- a/client/src/app/slides/motions/motion/motion-slide.component.ts +++ b/client/src/app/slides/motions/motion/motion-slide.component.ts @@ -446,4 +446,42 @@ export class MotionSlideComponent extends BaseMotionSlideComponent