Export Modified Final Version over exporter

- Adjusts the motion exporter to prefer modified final versions
over "just" final versions
- enhance the change detection of motion detail a little
(editor and viewport changes)
This commit is contained in:
Sean Engelhardt 2019-11-20 11:39:10 +01:00
parent 4451fe979e
commit e97292afdd
3 changed files with 17 additions and 2 deletions

View File

@ -672,6 +672,7 @@
formControlName="modified_final_version" formControlName="modified_final_version"
[init]="tinyMceSettings" [init]="tinyMceSettings"
required required
(onChange)="detectChanges()"
></editor> ></editor>
<div <div
*ngIf=" *ngIf="
@ -696,7 +697,7 @@
<!-- The HTML Editor for motions and traditional amendments --> <!-- The HTML Editor for motions and traditional amendments -->
<ng-container *ngIf="motion && editMotion && !motion.isParagraphBasedAmendment()"> <ng-container *ngIf="motion && editMotion && !motion.isParagraphBasedAmendment()">
<editor formControlName="text" [init]="tinyMceSettings" required></editor> <editor formControlName="text" [init]="tinyMceSettings" (onChange)="detectChanges()" required></editor>
<div <div
*ngIf=" *ngIf="
contentForm.get('text').invalid && contentForm.get('text').invalid &&

View File

@ -523,6 +523,13 @@ export class MotionDetailComponent extends BaseViewComponent implements OnInit,
} }
}) })
); );
/**
* Check for changes of the viewport subject changes
*/
this.vp.isMobileSubject.subscribe(() => {
this.cd.markForCheck();
});
} }
/** /**
@ -1612,4 +1619,11 @@ export class MotionDetailComponent extends BaseViewComponent implements OnInit,
public removeFromAgenda(): void { public removeFromAgenda(): void {
this.itemRepo.removeFromAgenda(this.motion.item).catch(this.raiseError); this.itemRepo.removeFromAgenda(this.motion.item).catch(this.raiseError);
} }
/**
* Helper function so UI elements can call to detect changes
*/
public detectChanges(): void {
this.cd.markForCheck();
}
} }

View File

@ -31,7 +31,7 @@
<mat-button-toggle [value]="crMode.Diff" #diffVersionButton> <mat-button-toggle [value]="crMode.Diff" #diffVersionButton>
<span translate>Diff version</span> <span translate>Diff version</span>
</mat-button-toggle> </mat-button-toggle>
<mat-button-toggle [value]="crMode.Final"> <span translate>Final version</span> </mat-button-toggle> <mat-button-toggle [value]="crMode.ModifiedFinal"> <span translate>Final version</span> </mat-button-toggle>
</mat-button-toggle-group> </mat-button-toggle-group>
</div> </div>