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>
<span translate>Show entire motion text</span>
</button>
<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>
<!-- Delete -->
<button mat-menu-item class="red-warning-text" (click)="deleteMotionButton()">
@ -557,7 +560,10 @@
<div class="form-id-title">
<!-- 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">
<input
matInput
@ -628,8 +634,9 @@
<editor formControlName="text" [init]="tinyMceSettings" required></editor>
<div
*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"
translate
>
@ -642,17 +649,20 @@
<section *ngFor="let paragraph of contentForm.value.selected_paragraphs">
<h4>
<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">
{{ 'Line' | translate }} {{ paragraph.lineFrom }} - {{ paragraph.lineTo - 1 }}</span>&nbsp;
{{ 'Line' | translate }} {{ paragraph.lineFrom }} - {{ paragraph.lineTo - 1 }}</span
>&nbsp;
<span>*</span>
</h4>
<editor [formControlName]="'text_' + paragraph.paragraphNo" [init]="tinyMceSettings" required></editor>
<div
*ngIf="contentForm.get('text_' + paragraph.paragraphNo).invalid && (
contentForm.get('text_' + paragraph.paragraphNo).dirty ||
contentForm.get('text_' + paragraph.paragraphNo).touched
)"
*ngIf="
contentForm.get('text_' + paragraph.paragraphNo).invalid &&
(contentForm.get('text_' + paragraph.paragraphNo).dirty ||
contentForm.get('text_' + paragraph.paragraphNo).touched)
"
class="red-warning-text"
translate
>
@ -720,7 +730,7 @@
</mat-list-item>
</mat-list>
</div>
<div *osPerms="'motions.can_manage';and:editMotion" class="shortened-selector">
<div *osPerms="'motions.can_manage'; and: editMotion" class="shortened-selector">
<os-search-value-selector
class="selector"
ngDefaultControl

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 {
const exportDialogRef = this.dialog.open(MotionExportDialogComponent, {
@ -210,9 +212,10 @@ export class MotionListComponent extends ListViewBaseComponent<ViewMotion, Motio
exportDialogRef.afterClosed().subscribe((result: any) => {
if (result && result.format) {
const data = this.isMultiSelect ? this.selectedRows : this.dataSource.filteredData;
if (result.format === 'pdf') {
this.pdfExport.exportMotionCatalog(
this.dataSource.filteredData,
data,
result.lnMode,
result.crMode,
result.content,
@ -220,13 +223,9 @@ export class MotionListComponent extends ListViewBaseComponent<ViewMotion, Motio
result.comments
);
} else if (result.format === 'csv') {
this.motionCsvExport.exportMotionList(
this.dataSource.filteredData,
result.content,
result.metaInfo
);
this.motionCsvExport.exportMotionList(data, result.content, result.metaInfo);
} else if (result.format === 'xlsx') {
this.motionXlsxExport.exportMotionList(this.dataSource.filteredData, result.metaInfo);
this.motionXlsxExport.exportMotionList(data, result.metaInfo);
}
}
});