Merge pull request #4934 from tsiegleauq/firefox-exporter-comment-bug

Fix firefox comment export
This commit is contained in:
Emanuel Schütze 2019-08-21 14:43:30 +02:00 committed by GitHub
commit ae110b9db1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3,6 +3,7 @@ import { FormBuilder, FormGroup } from '@angular/forms';
import { MatButtonToggle } from '@angular/material/button-toggle'; import { MatButtonToggle } from '@angular/material/button-toggle';
import { MatDialogRef } from '@angular/material/dialog'; import { MatDialogRef } from '@angular/material/dialog';
import { BehaviorSubject } from 'rxjs';
import { auditTime } from 'rxjs/operators'; import { auditTime } from 'rxjs/operators';
import { StorageService } from 'app/core/core-services/storage.service'; import { StorageService } from 'app/core/core-services/storage.service';
@ -42,6 +43,11 @@ export class MotionExportDialogComponent implements OnInit {
*/ */
public exportForm: FormGroup; public exportForm: FormGroup;
/**
* Store the subject to the ViewMotionCommentSection
*/
private commentsSubject: BehaviorSubject<ViewMotionCommentSection[]>;
/** /**
* The default export values in contrast to the restored values * The default export values in contrast to the restored values
*/ */
@ -58,10 +64,10 @@ export class MotionExportDialogComponent implements OnInit {
public metaInfoExportOrder: string[]; public metaInfoExportOrder: string[];
/** /**
* @returns a list of availavble commentSections * @returns a list of available commentSections
*/ */
public get commentsToExport(): ViewMotionCommentSection[] { public get commentsToExport(): ViewMotionCommentSection[] {
return this.commentRepo.getViewModelList(); return this.commentsSubject ? this.commentsSubject.value : [];
} }
/** /**
@ -96,6 +102,7 @@ export class MotionExportDialogComponent implements OnInit {
) { ) {
this.defaults.lnMode = this.configService.instant('motions_default_line_numbering'); this.defaults.lnMode = this.configService.instant('motions_default_line_numbering');
this.defaults.crMode = this.configService.instant('motions_recommendation_text_mode'); this.defaults.crMode = this.configService.instant('motions_recommendation_text_mode');
this.commentsSubject = this.commentRepo.getViewModelListBehaviorSubject();
if (this.configService.instant('motions_show_sequential_numbers')) { if (this.configService.instant('motions_show_sequential_numbers')) {
this.defaults.metaInfo.push('id'); this.defaults.metaInfo.push('id');
} }