Add "supporter" to motion export dialog

Allows PDF, CSV and XLSX to export the supporter manually
This commit is contained in:
Sean 2020-08-26 15:50:55 +02:00
parent aed17360e6
commit 0d16b487d5
2 changed files with 20 additions and 16 deletions

View File

@ -21,6 +21,7 @@ export const PERSONAL_NOTE_ID = -1;
*/ */
export type InfoToExport = export type InfoToExport =
| 'submitters' | 'submitters'
| 'supporters'
| 'state' | 'state'
| 'recommendation' | 'recommendation'
| 'category' | 'category'
@ -99,6 +100,7 @@ export enum MotionEditNotificationType {
export const motionImportExportHeaderOrder: string[] = [ export const motionImportExportHeaderOrder: string[] = [
'identifier', 'identifier',
'submitters', 'submitters',
'supporters',
'title', 'title',
'text', 'text',
'reason', 'reason',

View File

@ -245,8 +245,9 @@ export class MotionPdfService {
} }
// supporters // supporters
if (!infoToExport || infoToExport.includes('supporters')) {
const minSupporters = this.configService.instant<number>('motions_min_supporters'); const minSupporters = this.configService.instant<number>('motions_min_supporters');
if (minSupporters && motion.supporters.length > 0) { if (!!minSupporters && motion.supporters.length > 0) {
const supporters = motion.supporters const supporters = motion.supporters
.map(supporter => { .map(supporter => {
return supporter.full_name; return supporter.full_name;
@ -263,6 +264,7 @@ export class MotionPdfService {
} }
]); ]);
} }
}
// state // state
if (!infoToExport || infoToExport.includes('state')) { if (!infoToExport || infoToExport.includes('state')) {