Merge pull request #4593 from MaximilianKrambach/multiSelectMotionExport

Multi select motion export
This commit is contained in:
Maximilian Krambach 2019-04-15 13:33:05 +02:00 committed by GitHub
commit a831ccd2b2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 80 additions and 44 deletions

View File

@ -169,20 +169,20 @@
</button> </button>
<!-- Deselect all --> <!-- Deselect all -->
<button mat-menu-item (click)="deselectAll()"> <button mat-menu-item [disabled]="!selectedRows.length" (click)="deselectAll()">
<mat-icon>clear</mat-icon> <mat-icon>clear</mat-icon>
<span translate>Deselect all</span> <span translate>Deselect all</span>
</button> </button>
<mat-divider></mat-divider> <mat-divider></mat-divider>
<div *osPerms="'agenda.can_manage'"> <div *osPerms="'agenda.can_manage'">
<!-- Close selected --> <!-- Close selected -->
<button mat-menu-item (click)="setClosedSelected(true)"> <button mat-menu-item [disabled]="!selectedRows.length" (click)="setClosedSelected(true)">
<mat-icon>done</mat-icon> <mat-icon>done</mat-icon>
<span translate>Close</span> <span translate>Close</span>
</button> </button>
<!-- Open selected --> <!-- Open selected -->
<button mat-menu-item (click)="setClosedSelected(false)"> <button mat-menu-item [disabled]="!selectedRows.length" (click)="setClosedSelected(false)">
<mat-icon>redo</mat-icon> <mat-icon>redo</mat-icon>
<span translate>Open</span> <span translate>Open</span>
</button> </button>
@ -190,26 +190,26 @@
<mat-divider></mat-divider> <mat-divider></mat-divider>
<!-- Set multiple to public --> <!-- Set multiple to public -->
<button mat-menu-item (click)="setAgendaType(1)"> <button mat-menu-item [disabled]="!selectedRows.length" (click)="setAgendaType(1)">
<mat-icon>public</mat-icon> <mat-icon>public</mat-icon>
<span translate>Set public</span> <span translate>Set public</span>
</button> </button>
<!-- Set multiple to internal --> <!-- Set multiple to internal -->
<button mat-menu-item (click)="setAgendaType(2)"> <button mat-menu-item [disabled]="!selectedRows.length" (click)="setAgendaType(2)">
<mat-icon>visibility</mat-icon> <mat-icon>visibility</mat-icon>
<span translate>Set internal</span> <span translate>Set internal</span>
</button> </button>
<!-- Set multiple to hidden --> <!-- Set multiple to hidden -->
<button mat-menu-item (click)="setAgendaType(3)"> <button mat-menu-item [disabled]="!selectedRows.length" (click)="setAgendaType(3)">
<mat-icon>visibility_off</mat-icon> <mat-icon>visibility_off</mat-icon>
<span translate>Set hidden</span> <span translate>Set hidden</span>
</button> </button>
<mat-divider></mat-divider> <mat-divider></mat-divider>
<!-- Delete selected --> <!-- Delete selected -->
<button mat-menu-item class="red-warning-text" (click)="deleteSelected()"> <button mat-menu-item [disabled]="!selectedRows.length" class="red-warning-text" (click)="deleteSelected()">
<mat-icon>delete</mat-icon> <mat-icon>delete</mat-icon>
<span translate>Delete</span> <span translate>Delete</span>
</button> </button>

View File

@ -95,7 +95,7 @@
<mat-icon>done_all</mat-icon> <mat-icon>done_all</mat-icon>
<span translate>Select all</span> <span translate>Select all</span>
</button> </button>
<button mat-menu-item (click)="deselectAll()"> <button mat-menu-item [disabled]="!selectedRows.length" (click)="deselectAll()">
<mat-icon>clear</mat-icon> <mat-icon>clear</mat-icon>
<span translate>Deselect all</span> <span translate>Deselect all</span>
</button> </button>
@ -104,6 +104,7 @@
mat-menu-item mat-menu-item
class="red-warning-text" class="red-warning-text"
*osPerms="'assignment.can_manage'" *osPerms="'assignment.can_manage'"
[disabled]="!selectedRows.length"
(click)="deleteSelected()" (click)="deleteSelected()"
> >
<mat-icon>delete</mat-icon> <mat-icon>delete</mat-icon>

View File

@ -196,12 +196,17 @@
<mat-icon>done_all</mat-icon> <mat-icon>done_all</mat-icon>
<span translate>Select all</span> <span translate>Select all</span>
</button> </button>
<button mat-menu-item (click)="deselectAll()"> <button mat-menu-item [disabled]="!selectedRows.length" (click)="deselectAll()">
<mat-icon>clear</mat-icon> <mat-icon>clear</mat-icon>
<span translate>Deselect all</span> <span translate>Deselect all</span>
</button> </button>
<mat-divider></mat-divider> <mat-divider></mat-divider>
<button mat-menu-item *osPerms="'mediafiles.can_manage'" (click)="deleteSelected()"> <button
mat-menu-item
*osPerms="'mediafiles.can_manage'"
[disabled]="!selectedRows.length"
(click)="deleteSelected()"
>
<mat-icon>delete</mat-icon> <mat-icon>delete</mat-icon>
<span translate>Delete</span> <span translate>Delete</span>
</button> </button>

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
> >
@ -720,7 +730,7 @@
</mat-list-item> </mat-list-item>
</mat-list> </mat-list>
</div> </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 <os-search-value-selector
class="selector" class="selector"
ngDefaultControl ngDefaultControl

View File

@ -215,22 +215,23 @@
<mat-icon>done_all</mat-icon> <mat-icon>done_all</mat-icon>
<span translate>Select all</span> <span translate>Select all</span>
</button> </button>
<button mat-menu-item (click)="deselectAll()"> <button mat-menu-item [disabled]="!selectedRows.length" (click)="deselectAll()">
<mat-icon>clear</mat-icon> <mat-icon>clear</mat-icon>
<span translate>Deselect all</span> <span translate>Deselect all</span>
</button> </button>
<div *ngIf="perms.isAllowed('change_metadata')"> <div *ngIf="perms.isAllowed('change_metadata')">
<mat-divider></mat-divider> <mat-divider></mat-divider>
<button mat-menu-item (click)="multiselectWrapper(multiselectService.bulkToggleFavorite(selectedRows))"> <button mat-menu-item [disabled]="!selectedRows.length" (click)="multiselectWrapper(multiselectService.bulkSetFavorite(selectedRows))">
<mat-icon>star</mat-icon> <mat-icon>star</mat-icon>
<span translate>Set/unset Favorite</span> <span translate>Set/unset Favorite</span>
</button> </button>
<button mat-menu-item (click)="multiselectWrapper(multiselectService.setStateOfMultiple(selectedRows))"> <button mat-menu-item [disabled]="!selectedRows.length" (click)="multiselectWrapper(multiselectService.setStateOfMultiple(selectedRows))">
<mat-icon>label</mat-icon> <mat-icon>label</mat-icon>
<span translate>Set status</span> <span translate>Set status</span>
</button> </button>
<button <button
*ngIf="recomendationEnabled" *ngIf="recomendationEnabled"
[disabled]="!selectedRows.length"
mat-menu-item mat-menu-item
(click)="multiselectWrapper(multiselectService.setRecommendation(selectedRows))" (click)="multiselectWrapper(multiselectService.setRecommendation(selectedRows))"
> >
@ -240,6 +241,7 @@
</button> </button>
<button <button
mat-menu-item mat-menu-item
[disabled]="!selectedRows.length"
*ngIf="categories.length" *ngIf="categories.length"
(click)="multiselectWrapper(multiselectService.setCategory(selectedRows))" (click)="multiselectWrapper(multiselectService.setCategory(selectedRows))"
> >
@ -250,6 +252,7 @@
<button <button
mat-menu-item mat-menu-item
*ngIf="motionBlocks.length" *ngIf="motionBlocks.length"
[disabled]="!selectedRows.length"
(click)="multiselectWrapper(multiselectService.setMotionBlock(selectedRows))" (click)="multiselectWrapper(multiselectService.setMotionBlock(selectedRows))"
> >
<mat-icon>widgets</mat-icon> <mat-icon>widgets</mat-icon>
@ -257,7 +260,9 @@
<span translate>Set motion block</span> <span translate>Set motion block</span>
</button> </button>
<button mat-menu-item (click)="multiselectWrapper(multiselectService.changeSubmitters(selectedRows))"> <button mat-menu-item
[disabled]="!selectedRows.length"
(click)="multiselectWrapper(multiselectService.changeSubmitters(selectedRows))">
<mat-icon>person_add</mat-icon> <mat-icon>person_add</mat-icon>
<!-- TODO: icon --> <!-- TODO: icon -->
<span translate>Add/remove submitters</span> <span translate>Add/remove submitters</span>
@ -265,17 +270,22 @@
<button <button
mat-menu-item mat-menu-item
*ngIf="tags.length" *ngIf="tags.length"
[disabled]="!selectedRows.length"
(click)="multiselectWrapper(multiselectService.changeTags(selectedRows))" (click)="multiselectWrapper(multiselectService.changeTags(selectedRows))"
> >
<mat-icon>bookmarks</mat-icon> <mat-icon>bookmarks</mat-icon>
<!-- TODO: icon --> <!-- TODO: icon -->
<span translate>Add/remove tags</span> <span translate>Add/remove tags</span>
</button> </button>
<button mat-menu-item (click)="multiselectWrapper(multiselectService.moveToItem(selectedRows))"> <button mat-menu-item
[disabled]="!selectedRows.length"
(click)="multiselectWrapper(multiselectService.moveToItem(selectedRows))">
<mat-icon>sort</mat-icon> <mat-icon>sort</mat-icon>
<span translate>Move to agenda item</span> <span translate>Move to agenda item</span>
</button> </button>
<button mat-menu-item (click)="multiselectWrapper(multiselectService.bulkMoveItems(selectedRows))"> <button mat-menu-item
[disabled]="!selectedRows.length"
(click)="multiselectWrapper(multiselectService.bulkMoveItems(selectedRows))">
<mat-icon>format_indent_increase</mat-icon> <mat-icon>format_indent_increase</mat-icon>
<span translate>Move in call list</span> <span translate>Move in call list</span>
</button> </button>
@ -285,6 +295,7 @@
<button <button
mat-menu-item mat-menu-item
class="red-warning-text" class="red-warning-text"
[disabled]="!selectedRows.length"
(click)="multiselectService.delete(selectedRows); toggleMultiSelect()" (click)="multiselectService.delete(selectedRows); toggleMultiSelect()"
> >
<mat-icon>delete</mat-icon> <mat-icon>delete</mat-icon>

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);
} }
} }
}); });

View File

@ -152,20 +152,25 @@
<span translate>Select all</span> <span translate>Select all</span>
</button> </button>
<button mat-menu-item (click)="deselectAll()"> <button mat-menu-item [disabled]="!selectedRows.length" (click)="deselectAll()">
<mat-icon>clear</mat-icon> <mat-icon>clear</mat-icon>
<span translate>Deselect all</span> <span translate>Deselect all</span>
</button> </button>
<div *osPerms="'users.can_manage'"> <div *osPerms="'users.can_manage'">
<mat-divider></mat-divider> <mat-divider></mat-divider>
<button mat-menu-item (click)="setGroupSelected()"> <button mat-menu-item [disabled]="!selectedRows.length" (click)="setGroupSelected()">
<mat-icon>people</mat-icon> <mat-icon>people</mat-icon>
<span translate>Add/remove groups ...</span> <span translate>Add/remove groups ...</span>
</button> </button>
<div *ngIf="presenceViewConfigured"> <div *ngIf="presenceViewConfigured">
<button mat-menu-item *osPerms="'users.can_manage'" routerLink="presence"> <button
mat-menu-item
*osPerms="'users.can_manage'"
[disabled]="!selectedRows.length"
routerLink="presence"
>
<mat-icon>transfer_within_a_station</mat-icon> <mat-icon>transfer_within_a_station</mat-icon>
<span translate>Presence</span> <span translate>Presence</span>
</button> </button>
@ -179,34 +184,39 @@
<div *osPerms="'users.can_manage'"> <div *osPerms="'users.can_manage'">
<mat-divider></mat-divider> <mat-divider></mat-divider>
<button mat-menu-item (click)="setActiveSelected()"> <button mat-menu-item [disabled]="!selectedRows.length" (click)="setActiveSelected()">
<mat-icon>block</mat-icon> <mat-icon>block</mat-icon>
<span translate>Enable/disable account ...</span> <span translate>Enable/disable account ...</span>
</button> </button>
<button mat-menu-item (click)="setPresentSelected()"> <button mat-menu-item [disabled]="!selectedRows.length" (click)="setPresentSelected()">
<mat-icon>check_box</mat-icon> <mat-icon>check_box</mat-icon>
<span translate>Set presence ...</span> <span translate>Set presence ...</span>
</button> </button>
<button mat-menu-item (click)="setCommitteeSelected()"> <button mat-menu-item [disabled]="!selectedRows.length" (click)="setCommitteeSelected()">
<mat-icon>account_balance</mat-icon> <mat-icon>account_balance</mat-icon>
<span translate>Set committee ...</span> <span translate>Set committee ...</span>
</button> </button>
<mat-divider></mat-divider> <mat-divider></mat-divider>
<button mat-menu-item (click)="sendInvitationEmailSelected()"> <button mat-menu-item [disabled]="!selectedRows.length" (click)="sendInvitationEmailSelected()">
<mat-icon>mail</mat-icon> <mat-icon>mail</mat-icon>
<span translate>Send invitation email</span> <span translate>Send invitation email</span>
</button> </button>
<button mat-menu-item (click)="resetPasswordsSelected()"> <button mat-menu-item [disabled]="!selectedRows.length" (click)="resetPasswordsSelected()">
<mat-icon>vpn_key</mat-icon> <mat-icon>vpn_key</mat-icon>
<span translate>Generate new passwords</span> <span translate>Generate new passwords</span>
</button> </button>
<mat-divider></mat-divider> <mat-divider></mat-divider>
<button mat-menu-item class="red-warning-text" (click)="deleteSelected()"> <button
mat-menu-item
class="red-warning-text"
[disabled]="!selectedRows.length"
(click)="deleteSelected()"
>
<mat-icon>delete</mat-icon> <mat-icon>delete</mat-icon>
<span translate>Delete</span> <span translate>Delete</span>
</button> </button>