From 3e2e8dbbe93e366b1637f45eb856a11a16bfcaea Mon Sep 17 00:00:00 2001 From: Bastian Rihm Date: Fri, 19 Apr 2024 13:12:27 +0200 Subject: [PATCH] Add spokesperson to motion xlsx export --- .../motion-export-dialog.component.html | 3 +++ .../motion-export-dialog.component.ts | 15 +++++++++++++++ .../motion-xlsx-export.service.ts | 6 ++++++ 3 files changed, 24 insertions(+) diff --git a/client/src/app/site/pages/meetings/pages/motions/components/motion-export-dialog/components/motion-export-dialog/motion-export-dialog.component.html b/client/src/app/site/pages/meetings/pages/motions/components/motion-export-dialog/components/motion-export-dialog/motion-export-dialog.component.html index 1635d1b3f6..1206f58514 100644 --- a/client/src/app/site/pages/meetings/pages/motions/components/motion-export-dialog/components/motion-export-dialog/motion-export-dialog.component.html +++ b/client/src/app/site/pages/meetings/pages/motions/components/motion-export-dialog/components/motion-export-dialog/motion-export-dialog.component.html @@ -64,6 +64,9 @@

{{ 'Export motions' | translate }}

{{ 'Speakers' | translate }} + + {{ 'Spokesperson' | translate }} + {{ 'Voting result' | translate }} diff --git a/client/src/app/site/pages/meetings/pages/motions/components/motion-export-dialog/components/motion-export-dialog/motion-export-dialog.component.ts b/client/src/app/site/pages/meetings/pages/motions/components/motion-export-dialog/components/motion-export-dialog/motion-export-dialog.component.ts index cc04017755..41d4931357 100644 --- a/client/src/app/site/pages/meetings/pages/motions/components/motion-export-dialog/components/motion-export-dialog/motion-export-dialog.component.ts +++ b/client/src/app/site/pages/meetings/pages/motions/components/motion-export-dialog/components/motion-export-dialog/motion-export-dialog.component.ts @@ -53,6 +53,8 @@ export class MotionExportDialogComponent extends BaseUiComponent implements OnIn */ public exportForm!: UntypedFormGroup; + public workingGroupSpeakerActive: boolean; + /** * Store the subject to the ViewMotionCommentSection */ @@ -109,6 +111,12 @@ export class MotionExportDialogComponent extends BaseUiComponent implements OnIn @ViewChild(`speakersButton`) public speakersButton!: MatButtonToggle; + /** + * To deactivate the working group button. + */ + @ViewChild(`workingGroupSpeakerButton`) + public workingGroupSpeakerButton!: MatButtonToggle; + /** * To deactivate the toc button. */ @@ -137,6 +145,7 @@ export class MotionExportDialogComponent extends BaseUiComponent implements OnIn super(); this.defaults.lnMode = this.meetingSettingsService.instant(`motions_default_line_numbering`)!; this.defaults.crMode = this.meetingSettingsService.instant(`motions_recommendation_text_mode`)!; + this.workingGroupSpeakerActive = this.meetingSettingsService.instant(`motions_enable_working_group_speaker`)!; this.commentsSubject = this.commentRepo.getViewModelListObservable(); if (this.meetingSettingsService.instant(`motions_show_sequential_number`)) { this.defaults.metaInfo!.push(`id`); @@ -173,9 +182,15 @@ export class MotionExportDialogComponent extends BaseUiComponent implements OnIn if (format === ExportFileFormat.XLSX) { this.disableControl(`content`); this.changeStateOfButton(this.speakersButton, false); + if (this.workingGroupSpeakerButton) { + this.changeStateOfButton(this.workingGroupSpeakerButton, false); + } } else { this.enableControl(`content`); this.changeStateOfButton(this.speakersButton, true); + if (this.workingGroupSpeakerButton) { + this.changeStateOfButton(this.workingGroupSpeakerButton, true); + } } if (format === ExportFileFormat.CSV || format === ExportFileFormat.XLSX) { diff --git a/client/src/app/site/pages/meetings/pages/motions/services/export/motion-xlsx-export.service/motion-xlsx-export.service.ts b/client/src/app/site/pages/meetings/pages/motions/services/export/motion-xlsx-export.service/motion-xlsx-export.service.ts index dcd88ef25e..3113b5fa32 100644 --- a/client/src/app/site/pages/meetings/pages/motions/services/export/motion-xlsx-export.service/motion-xlsx-export.service.ts +++ b/client/src/app/site/pages/meetings/pages/motions/services/export/motion-xlsx-export.service/motion-xlsx-export.service.ts @@ -83,6 +83,9 @@ export class MotionXlsxExportService { const properties: string[] = infoToExport.includes(`speakers`) ? sortMotionPropertyList([`number`, `title`].concat(infoToExport)).concat(`speakers`) : sortMotionPropertyList([`number`, `title`].concat(infoToExport)); + if (infoToExport.includes(`working_group_speakers`)) { + properties.push(`working_group_speakers`); + } const worksheet = workbook.addWorksheet(this.translate.instant(`Motions`), { pageSetup: { @@ -114,6 +117,9 @@ export class MotionXlsxExportService { case `speakers`: propertyHeader = _(`Open requests to speak`); break; + case `working_group_speakers`: + propertyHeader = _(`Spokesperson`); + break; default: propertyHeader = property.charAt(0).toUpperCase() + property.slice(1).replace(`_`, ` `); }