From 25839ea709b34b5f95139e01e7fb6f385c47eff8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20Ho=CC=88=C3=9Fl?= Date: Sat, 2 May 2020 17:23:52 +0200 Subject: [PATCH] Toggle to show all amendments in diff view --- .../models/view-motion-amended-paragraph.ts | 2 +- .../motion-detail-diff.component.html | 60 +++++++++++++++++-- .../motion-detail-diff.component.ts | 8 +++ .../motion-detail.component.html | 7 +++ .../motion-detail/motion-detail.component.ts | 11 +++- 5 files changed, 81 insertions(+), 7 deletions(-) diff --git a/client/src/app/site/motions/models/view-motion-amended-paragraph.ts b/client/src/app/site/motions/models/view-motion-amended-paragraph.ts index 1c365752b..145c65f77 100644 --- a/client/src/app/site/motions/models/view-motion-amended-paragraph.ts +++ b/client/src/app/site/motions/models/view-motion-amended-paragraph.ts @@ -15,7 +15,7 @@ export class ViewMotionAmendedParagraph implements ViewUnifiedChange { } public constructor( - private amendment: ViewMotion, + public amendment: ViewMotion, private paragraphNo: number, private newText: string, private lineRange: LineRange diff --git a/client/src/app/site/motions/modules/motion-detail/components/motion-detail-diff/motion-detail-diff.component.html b/client/src/app/site/motions/modules/motion-detail/components/motion-detail-diff/motion-detail-diff.component.html index 5d8c464e6..cfde3008a 100644 --- a/client/src/app/site/motions/modules/motion-detail/components/motion-detail-diff/motion-detail-diff.component.html +++ b/client/src/app/site/motions/modules/motion-detail/components/motion-detail-diff/motion-detail-diff.component.html @@ -26,10 +26,10 @@ --> - + {{ 'Rejected' | translate }} - + – {{ change.stateName | translate }} @@ -104,6 +104,15 @@ > more_horiz + -
+
{{ 'Rejected' | translate }}
+ + +
+ {{ change.amendment.identifier }} - {{ change.amendment.state.name | translate }} +
+ + + + + + + + + + + + + + +
@@ -681,6 +686,7 @@ [changes]="getChangesForDiffMode()" [scrollToChange]="scrollToChange" [highlightedLine]="highlightedLine" + [showAllAmendments]="showAllAmendments" [lineNumberingMode]="lnMode" (createChangeRecommendation)="createChangeRecommendation($event)" > @@ -904,6 +910,7 @@ [changes]="getChangesForDiffMode()" [scrollToChange]="scrollToChange" [highlightedLine]="highlightedLine" + [showAllAmendments]="showAllAmendments" [lineNumberingMode]="lnMode" (createChangeRecommendation)="createChangeRecommendation($event)" > diff --git a/client/src/app/site/motions/modules/motion-detail/components/motion-detail/motion-detail.component.ts b/client/src/app/site/motions/modules/motion-detail/components/motion-detail/motion-detail.component.ts index e5f10e195..d845cea7f 100644 --- a/client/src/app/site/motions/modules/motion-detail/components/motion-detail/motion-detail.component.ts +++ b/client/src/app/site/motions/modules/motion-detail/components/motion-detail/motion-detail.component.ts @@ -327,6 +327,11 @@ export class MotionDetailComponent extends BaseViewComponent implements OnInit, */ private amendmentTextMode: string; + /** + * Show all amendments in the text, not only the ones with the apropriate state + */ + public showAllAmendments = false; + /** * For using the enum constants from the template */ @@ -1005,7 +1010,11 @@ export class MotionDetailComponent extends BaseViewComponent implements OnInit, public getChangesForDiffMode(): ViewUnifiedChange[] { return this.allChangingObjects.filter(change => { - return change.showInDiffView(); + if (this.showAllAmendments) { + return true; + } else { + return change.showInDiffView(); + } }); }