multiselect motion export

This commit is contained in:
Maximilian Krambach 2019-04-12 13:59:50 +02:00
parent 48593acc25
commit 7d9ea4e55a
2 changed files with 28 additions and 19 deletions

View File

@ -92,8 +92,11 @@
<mat-icon>{{ !showAmendmentContext ? 'check_box_outline_blank' : 'check_box' }}</mat-icon> <mat-icon>{{ !showAmendmentContext ? 'check_box_outline_blank' : 'check_box' }}</mat-icon>
<span translate>Show entire motion text</span> <span translate>Show entire motion text</span>
</button> </button>
<div *ngIf="perms.isAllowed('manage')"> <div *ngIf="perms.isAllowed('manage')">
<button mat-menu-item [disabled]="!selectedRows.length" (click)="openExportDialog()">
<mat-icon>archive</mat-icon>
<span translate>Export selected motions</span>
</button>
<mat-divider></mat-divider> <mat-divider></mat-divider>
<!-- Delete --> <!-- Delete -->
<button mat-menu-item class="red-warning-text" (click)="deleteMotionButton()"> <button mat-menu-item class="red-warning-text" (click)="deleteMotionButton()">
@ -557,7 +560,10 @@
<div class="form-id-title"> <div class="form-id-title">
<!-- Identifier --> <!-- Identifier -->
<div *ngIf="editMotion && !newMotion && perms.isAllowed('change_metadata', motion)" class="content-field form-identifier"> <div
*ngIf="editMotion && !newMotion && perms.isAllowed('change_metadata', motion)"
class="content-field form-identifier"
>
<mat-form-field *ngIf="editMotion"> <mat-form-field *ngIf="editMotion">
<input <input
matInput matInput
@ -628,7 +634,8 @@
<editor formControlName="text" [init]="tinyMceSettings" required></editor> <editor formControlName="text" [init]="tinyMceSettings" required></editor>
<div <div
*ngIf=" *ngIf="
contentForm.get('text').invalid && (contentForm.get('text').dirty || contentForm.get('text').touched) contentForm.get('text').invalid &&
(contentForm.get('text').dirty || contentForm.get('text').touched)
" "
class="red-warning-text" class="red-warning-text"
translate translate
@ -642,17 +649,20 @@
<section *ngFor="let paragraph of contentForm.value.selected_paragraphs"> <section *ngFor="let paragraph of contentForm.value.selected_paragraphs">
<h4> <h4>
<span *ngIf="paragraph.lineFrom >= paragraph.lineTo - 1" class="line-number"> <span *ngIf="paragraph.lineFrom >= paragraph.lineTo - 1" class="line-number">
{{ 'Line' | translate }} {{ paragraph.lineFrom }}</span> {{ 'Line' | translate }} {{ paragraph.lineFrom }}</span
>
<span *ngIf="paragraph.lineFrom < paragraph.lineTo - 1" class="line-number"> <span *ngIf="paragraph.lineFrom < paragraph.lineTo - 1" class="line-number">
{{ 'Line' | translate }} {{ paragraph.lineFrom }} - {{ paragraph.lineTo - 1 }}</span>&nbsp; {{ 'Line' | translate }} {{ paragraph.lineFrom }} - {{ paragraph.lineTo - 1 }}</span
>&nbsp;
<span>*</span> <span>*</span>
</h4> </h4>
<editor [formControlName]="'text_' + paragraph.paragraphNo" [init]="tinyMceSettings" required></editor> <editor [formControlName]="'text_' + paragraph.paragraphNo" [init]="tinyMceSettings" required></editor>
<div <div
*ngIf="contentForm.get('text_' + paragraph.paragraphNo).invalid && ( *ngIf="
contentForm.get('text_' + paragraph.paragraphNo).dirty || contentForm.get('text_' + paragraph.paragraphNo).invalid &&
contentForm.get('text_' + paragraph.paragraphNo).touched (contentForm.get('text_' + paragraph.paragraphNo).dirty ||
)" contentForm.get('text_' + paragraph.paragraphNo).touched)
"
class="red-warning-text" class="red-warning-text"
translate translate
> >

View File

@ -198,7 +198,9 @@ export class MotionListComponent extends ListViewBaseComponent<ViewMotion, Motio
} }
/** /**
* Opens the export dialog * Opens the export dialog.
* The export will be limited to the selected data if multiselect modus is
* active and there are rows selected
*/ */
public openExportDialog(): void { public openExportDialog(): void {
const exportDialogRef = this.dialog.open(MotionExportDialogComponent, { const exportDialogRef = this.dialog.open(MotionExportDialogComponent, {
@ -210,9 +212,10 @@ export class MotionListComponent extends ListViewBaseComponent<ViewMotion, Motio
exportDialogRef.afterClosed().subscribe((result: any) => { exportDialogRef.afterClosed().subscribe((result: any) => {
if (result && result.format) { if (result && result.format) {
const data = this.isMultiSelect ? this.selectedRows : this.dataSource.filteredData;
if (result.format === 'pdf') { if (result.format === 'pdf') {
this.pdfExport.exportMotionCatalog( this.pdfExport.exportMotionCatalog(
this.dataSource.filteredData, data,
result.lnMode, result.lnMode,
result.crMode, result.crMode,
result.content, result.content,
@ -220,13 +223,9 @@ export class MotionListComponent extends ListViewBaseComponent<ViewMotion, Motio
result.comments result.comments
); );
} else if (result.format === 'csv') { } else if (result.format === 'csv') {
this.motionCsvExport.exportMotionList( this.motionCsvExport.exportMotionList(data, result.content, result.metaInfo);
this.dataSource.filteredData,
result.content,
result.metaInfo
);
} else if (result.format === 'xlsx') { } else if (result.format === 'xlsx') {
this.motionXlsxExport.exportMotionList(this.dataSource.filteredData, result.metaInfo); this.motionXlsxExport.exportMotionList(data, result.metaInfo);
} }
} }
}); });