diff --git a/client/src/app/site/motions/components/motion-detail-diff/motion-detail-diff.component.spec.ts b/client/src/app/site/motions/components/motion-detail-diff/motion-detail-diff.component.spec.ts index ab29338c6..0a5bc2eac 100644 --- a/client/src/app/site/motions/components/motion-detail-diff/motion-detail-diff.component.spec.ts +++ b/client/src/app/site/motions/components/motion-detail-diff/motion-detail-diff.component.spec.ts @@ -2,7 +2,7 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { E2EImportsModule } from '../../../../../e2e-imports.module'; import { Component } from '@angular/core'; -import { ViewMotion } from '../../models/view-motion'; +import { LineNumberingMode, ViewMotion } from '../../models/view-motion'; import { MotionDetailDiffComponent } from './motion-detail-diff.component'; import { MotionDetailOriginalChangeRecommendationsComponent } from '../motion-detail-original-change-recommendations/motion-detail-original-change-recommendations.component'; import { ViewUnifiedChange } from '../../models/view-unified-change'; @@ -16,6 +16,7 @@ import { ViewMotionChangeRecommendation } from '../../models/view-change-recomme [changes]="changes" [highlightedLine]="highlightedLine" [scrollToChange]="scrollToChange" + [lineNumberingMode]="lnMode" (createChangeRecommendation)="createChangeRecommendation($event)" > @@ -24,6 +25,7 @@ import { ViewMotionChangeRecommendation } from '../../models/view-change-recomme class TestHostComponent { public motion: ViewMotion; public changes: ViewMotionChangeRecommendation[]; + public lnMode: LineNumberingMode = LineNumberingMode.Outside; public scrollToChange: ViewUnifiedChange = null; public constructor() { diff --git a/client/src/app/site/motions/components/motion-detail-diff/motion-detail-diff.component.ts b/client/src/app/site/motions/components/motion-detail-diff/motion-detail-diff.component.ts index 833deb168..63a958cb2 100644 --- a/client/src/app/site/motions/components/motion-detail-diff/motion-detail-diff.component.ts +++ b/client/src/app/site/motions/components/motion-detail-diff/motion-detail-diff.component.ts @@ -33,6 +33,7 @@ import { ConfigService } from 'app/core/ui-services/config.service'; * [changes]="changes" * [scrollToChange]="change" * [highlightedLine]="highlightedLine" + * [lineNumberingMode]="lnMode" * (createChangeRecommendation)="createChangeRecommendation($event)" * > * ``` @@ -51,15 +52,12 @@ export class MotionDetailDiffComponent extends BaseViewComponent implements Afte public scrollToChange: ViewUnifiedChange; @Input() public highlightedLine: number; + @Input() + public lineNumberingMode: LineNumberingMode; @Output() public createChangeRecommendation: EventEmitter = new EventEmitter(); - /** - * Indicates the LineNumberingMode Mode. - */ - public lnMode: LineNumberingMode; - /** * Indicates the maximum line length as defined in the configuration. */ @@ -89,9 +87,6 @@ export class MotionDetailDiffComponent extends BaseViewComponent implements Afte ) { super(title, translate, matSnackBar); - this.configService - .get('motions_default_line_numbering') - .subscribe(mode => (this.lnMode = mode)); this.configService.get('motions_line_length').subscribe(lineLength => (this.lineLength = lineLength)); } @@ -181,7 +176,7 @@ export class MotionDetailDiffComponent extends BaseViewComponent implements Afte * @returns whether there are line numbers at all */ public isLineNumberingNone(): boolean { - return this.lnMode === LineNumberingMode.None; + return this.lineNumberingMode === LineNumberingMode.None; } /** @@ -190,7 +185,7 @@ export class MotionDetailDiffComponent extends BaseViewComponent implements Afte * @returns whether the line numberings are inside */ public isLineNumberingInline(): boolean { - return this.lnMode === LineNumberingMode.Inside; + return this.lineNumberingMode === LineNumberingMode.Inside; } /** @@ -199,7 +194,7 @@ export class MotionDetailDiffComponent extends BaseViewComponent implements Afte * @returns whether the line numberings are outside */ public isLineNumberingOutside(): boolean { - return this.lnMode === LineNumberingMode.Outside; + return this.lineNumberingMode === LineNumberingMode.Outside; } /** diff --git a/client/src/app/site/motions/components/motion-detail/motion-detail.component.html b/client/src/app/site/motions/components/motion-detail/motion-detail.component.html index 99c88759f..7c4197846 100644 --- a/client/src/app/site/motions/components/motion-detail/motion-detail.component.html +++ b/client/src/app/site/motions/components/motion-detail/motion-detail.component.html @@ -595,6 +595,7 @@ [changes]="allChangingObjects" [scrollToChange]="scrollToChange" [highlightedLine]="highlightedLine" + [lineNumberingMode]="lnMode" (createChangeRecommendation)="createChangeRecommendation($event)" >