From b0ec5afaa55ab11b1bf7de21c7ebe1955eac530a Mon Sep 17 00:00:00 2001 From: Bastian Rihm Date: Mon, 5 Aug 2024 16:08:49 +0200 Subject: [PATCH 1/3] Add new forward parameter for crs --- .../motion-repository.service/motion-repository.service.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/client/src/app/gateways/repositories/motions/motion-repository.service/motion-repository.service.ts b/client/src/app/gateways/repositories/motions/motion-repository.service/motion-repository.service.ts index 2a8132cf6b..2c5ae68d7a 100644 --- a/client/src/app/gateways/repositories/motions/motion-repository.service/motion-repository.service.ts +++ b/client/src/app/gateways/repositories/motions/motion-repository.service/motion-repository.service.ts @@ -72,6 +72,7 @@ export class MotionRepositoryService extends BaseAgendaItemAndListOfSpeakersCont use_original_submitter: useOriginalSubmitter, use_original_number: useOriginalNumber, with_amendments: useOriginalVersion, + with_change_recommendations: useOriginalVersion, ...motion }; }) From ae15b311b5b1528f65817fb0b3f46848d698d8f6 Mon Sep 17 00:00:00 2001 From: Bastian Rihm Date: Wed, 14 Aug 2024 11:09:10 +0200 Subject: [PATCH 2/3] Fix wrong motion text sent --- .../motion-repository.service.ts | 3 ++- .../services/motion-forward-dialog.service.ts | 5 ++++- .../motion-format.service/motion-format.service.ts | 13 ++++++++----- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/client/src/app/gateways/repositories/motions/motion-repository.service/motion-repository.service.ts b/client/src/app/gateways/repositories/motions/motion-repository.service/motion-repository.service.ts index 2c5ae68d7a..80919d8b28 100644 --- a/client/src/app/gateways/repositories/motions/motion-repository.service/motion-repository.service.ts +++ b/client/src/app/gateways/repositories/motions/motion-repository.service/motion-repository.service.ts @@ -7,6 +7,7 @@ import { TreeIdNode } from 'src/app/infrastructure/definitions/tree'; import { NullablePartial } from 'src/app/infrastructure/utils'; import { AgendaListTitle } from 'src/app/site/pages/meetings/pages/agenda'; import { ViewMotion } from 'src/app/site/pages/meetings/pages/motions'; +import { MotionFormatResult } from 'src/app/site/pages/meetings/pages/motions/services/common/motion-format.service'; import { TreeService } from 'src/app/ui/modules/sorting/modules/sorting-tree/services'; import { Motion } from '../../../../domain/models/motions/motion'; @@ -61,7 +62,7 @@ export class MotionRepositoryService extends BaseAgendaItemAndListOfSpeakersCont useOriginalSubmitter: boolean, useOriginalNumber: boolean, useOriginalVersion: boolean, - ...motions: any[] + ...motions: MotionFormatResult[] ): Promise<{ success: number; partial: number }> { const payloads: any[][] = []; motions.forEach(motion => { diff --git a/client/src/app/site/pages/meetings/pages/motions/components/motion-forward-dialog/services/motion-forward-dialog.service.ts b/client/src/app/site/pages/meetings/pages/motions/components/motion-forward-dialog/services/motion-forward-dialog.service.ts index 630c0f0338..6e0718c477 100644 --- a/client/src/app/site/pages/meetings/pages/motions/components/motion-forward-dialog/services/motion-forward-dialog.service.ts +++ b/client/src/app/site/pages/meetings/pages/motions/components/motion-forward-dialog/services/motion-forward-dialog.service.ts @@ -93,7 +93,10 @@ export class MotionForwardDialogService extends BaseDialogService< const motionIds = toForward.map(motion => motion.id); await this.modelRequest.fetch(getMotionForwardDataSubscriptionConfig(...motionIds)); const forwardMotions = toForward.map(motion => - this.formatService.formatMotionForForward(this.repo.getViewModel(motion.id)) + this.formatService.formatMotionForForward( + this.repo.getViewModel(motion.id), + dialogData.useOriginalVersion + ) ); const result = await this.repo.createForwarded( toMeetingIds, diff --git a/client/src/app/site/pages/meetings/pages/motions/services/common/motion-format.service/motion-format.service.ts b/client/src/app/site/pages/meetings/pages/motions/services/common/motion-format.service/motion-format.service.ts index 586ba427e1..56951e3aea 100644 --- a/client/src/app/site/pages/meetings/pages/motions/services/common/motion-format.service/motion-format.service.ts +++ b/client/src/app/site/pages/meetings/pages/motions/services/common/motion-format.service/motion-format.service.ts @@ -14,7 +14,7 @@ import { ViewMotion } from '../../../view-models'; import { AmendmentControllerService } from '../amendment-controller.service'; import { MotionLineNumberingService } from '../motion-line-numbering.service'; -interface MotionFormatResult { +export interface MotionFormatResult { origin_id: Id; title: string; text: string; @@ -114,16 +114,19 @@ export class MotionFormatService { * Format the motion for forwarding, tries to get the mod final version or the * final version with all unified changes */ - public formatMotionForForward(motion: ViewMotion): MotionFormatResult { + public formatMotionForForward(motion: ViewMotion, useOriginal?: boolean): MotionFormatResult { const lineLength = this.settings.instant(`motions_line_length`); - const finalMotionText = this.getFinalMotionText(motion, lineLength!); - const textWithoutLines = this.lineNumberingService.stripLineNumbers(finalMotionText); + let text = motion.text; + if (!useOriginal) { + const finalMotionText = this.getFinalMotionText(motion, lineLength!); + text = this.lineNumberingService.stripLineNumbers(finalMotionText); + } return { origin_id: motion.id, title: this.getFinalTitle(motion, lineLength), reason: motion.reason || ``, - text: textWithoutLines + text }; } From 6f8ae6d1059d520613ed082ce5314e5e125a2268 Mon Sep 17 00:00:00 2001 From: Bastian Rihm Date: Thu, 22 Aug 2024 12:05:57 +0200 Subject: [PATCH 3/3] Fix title crs --- .../common/motion-format.service/motion-format.service.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/client/src/app/site/pages/meetings/pages/motions/services/common/motion-format.service/motion-format.service.ts b/client/src/app/site/pages/meetings/pages/motions/services/common/motion-format.service/motion-format.service.ts index 56951e3aea..db488b18bd 100644 --- a/client/src/app/site/pages/meetings/pages/motions/services/common/motion-format.service/motion-format.service.ts +++ b/client/src/app/site/pages/meetings/pages/motions/services/common/motion-format.service/motion-format.service.ts @@ -116,16 +116,18 @@ export class MotionFormatService { */ public formatMotionForForward(motion: ViewMotion, useOriginal?: boolean): MotionFormatResult { const lineLength = this.settings.instant(`motions_line_length`); + let title = motion.title; let text = motion.text; if (!useOriginal) { + title = this.getFinalTitle(motion, lineLength); const finalMotionText = this.getFinalMotionText(motion, lineLength!); text = this.lineNumberingService.stripLineNumbers(finalMotionText); } return { origin_id: motion.id, - title: this.getFinalTitle(motion, lineLength), reason: motion.reason || ``, + title, text }; }