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 1/2] 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 Date: Thu, 17 Sep 2020 15:40:43 +0200 Subject: [PATCH 2/2] Hide diff-box in projector --- .../motion-detail-diff.component.scss-theme.scss | 16 +++++++++------- .../motion-detail-diff.component.ts | 5 +++-- .../motions/motion/motion-slide.component.scss | 4 ++-- 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/client/src/app/site/motions/modules/motion-detail/components/motion-detail-diff/motion-detail-diff.component.scss-theme.scss b/client/src/app/site/motions/modules/motion-detail/components/motion-detail-diff/motion-detail-diff.component.scss-theme.scss index 38b85c698..9ce9a2ab8 100644 --- a/client/src/app/site/motions/modules/motion-detail/components/motion-detail-diff/motion-detail-diff.component.scss-theme.scss +++ b/client/src/app/site/motions/modules/motion-detail/components/motion-detail-diff/motion-detail-diff.component.scss-theme.scss @@ -3,13 +3,15 @@ @mixin os-motion-detail-diff-style($theme) { $background: map-get($theme, background); - .change-recommendation-overview, - .diff-box { - background-color: mat-color($background, background); - border: 1px solid mat-color($background, selected-button); - } + .motion-text-with-diffs { + .change-recommendation-overview, + .diff-box { + background-color: mat-color($background, background); + border: 1px solid mat-color($background, selected-button); + } - .diff-box:hover { - background-color: mat-color($background, selected-button); + .diff-box:hover { + background-color: mat-color($background, selected-button); + } } } 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 cfac1619b..846c0b1a2 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 @@ -1,4 +1,4 @@ -import { AfterViewInit, Component, ElementRef, EventEmitter, Input, Output } from '@angular/core'; +import { AfterViewInit, Component, ElementRef, EventEmitter, Input, Output, ViewEncapsulation } from '@angular/core'; import { MatDialog } from '@angular/material/dialog'; import { MatSnackBar } from '@angular/material/snack-bar'; import { Title } from '@angular/platform-browser'; @@ -54,7 +54,8 @@ import { ViewMotionAmendedParagraph } from '../../../../models/view-motion-amend @Component({ selector: 'os-motion-detail-diff', templateUrl: './motion-detail-diff.component.html', - styleUrls: ['./motion-detail-diff.component.scss'] + styleUrls: ['./motion-detail-diff.component.scss'], + encapsulation: ViewEncapsulation.None }) export class MotionDetailDiffComponent extends BaseViewComponent implements AfterViewInit { /** diff --git a/client/src/app/slides/motions/motion/motion-slide.component.scss b/client/src/app/slides/motions/motion/motion-slide.component.scss index e2e7a640b..3be8894a4 100644 --- a/client/src/app/slides/motions/motion/motion-slide.component.scss +++ b/client/src/app/slides/motions/motion/motion-slide.component.scss @@ -67,8 +67,8 @@ &.line-numbers-outside { .os-line-number { &:after { - top: 17px; - font-size: 16px; + top: 17px !important; + font-size: 16px !important; } } }