Merge pull request #5516 from tsiegleauq/no-final-may-decide

Hide motion preamble in final state
This commit is contained in:
Emanuel Schütze 2020-08-27 08:28:59 +02:00 committed by GitHub
commit 4960a8f115
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 19 additions and 5 deletions

View File

@ -142,6 +142,10 @@ export class ViewMotion extends BaseViewModelWithAgendaItemAndListOfSpeakers<Mot
return this.speakerAmount > 0;
}
public get showPreamble(): boolean {
return !this.state?.isFinalState ?? true;
}
/**
* Translate the state's css class into a color
*

View File

@ -40,7 +40,7 @@
<div *ngIf="changes.length === 0" class="no-changes">{{ 'No change recommendations yet' | translate }}</div>
</section>
<span class="text-prefix-label">{{ preamble | translate }}</span>
<span class="text-prefix-label" *ngIf="showPreamble">{{ preamble | translate }}</span>
<!-- The actual diff view -->
<div class="motion-text-with-diffs">
@ -126,7 +126,7 @@
<div class="status-row" *ngIf="isChangeRecommendation(change) && change.isRejected()">
<i class="grey">{{ 'Rejected' | translate }}</i>
</div>
<!-- If it's an amendment, only accepted ones will be passed to this component
by default (== !showAllAmendments). In this case, don't show the prefix.
However, if showAllAmendments === true, the prefix should be shown alwayes,

View File

@ -85,6 +85,10 @@ export class MotionDetailDiffComponent extends BaseViewComponent implements Afte
public preamble: string;
public get showPreamble(): boolean {
return this.motion.showPreamble;
}
/**
* @param title
* @param translate

View File

@ -667,7 +667,7 @@
</div>
<!-- Text (hide preamble, if diff mode. The preample is included in the motion-detail-diff component) -->
<span *ngIf="!isRecoMode(ChangeRecoMode.Diff)" class="text-prefix-label">{{ preamble | translate }}</span>
<span *ngIf="showPreamble && !isRecoMode(ChangeRecoMode.Diff)" class="text-prefix-label">{{ preamble | translate }}</span>
<!-- Regular motions or traditional amendments -->
<ng-container *ngIf="!editMotion && !motion.isStatuteAmendment() && !motion.isParagraphBasedAmendment()">

View File

@ -167,6 +167,10 @@ export class MotionDetailComponent extends BaseViewComponent implements OnInit,
);
}
public get showPreamble(): boolean {
return this.motion.showPreamble;
}
/**
* Saves the target motion. Accessed via the getter and setter.
*/

View File

@ -132,8 +132,10 @@ export class MotionPdfService {
}
if (!contentToExport || contentToExport.includes('text')) {
const preamble = this.createPreamble(motion);
motionPdfContent.push(preamble);
if (motion.showPreamble) {
const preamble = this.createPreamble(motion);
motionPdfContent.push(preamble);
}
const text = this.createText(motion, lineLength, lnMode, crMode);
motionPdfContent.push(text);
}