From 764a8695bbb15492bd246d5d481eb615af898c38 Mon Sep 17 00:00:00 2001 From: Ludwig Reiter Date: Thu, 8 Feb 2024 12:22:24 +0100 Subject: [PATCH 1/3] Switch to Diff mode after set change recommendation --- .../motion-highlight-form.component.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/client/src/app/site/pages/meetings/pages/motions/pages/motion-detail/components/motion-highlight-form/motion-highlight-form.component.ts b/client/src/app/site/pages/meetings/pages/motions/pages/motion-detail/components/motion-highlight-form/motion-highlight-form.component.ts index 6edd4fcc83..bfe2fb3794 100644 --- a/client/src/app/site/pages/meetings/pages/motions/pages/motion-detail/components/motion-highlight-form/motion-highlight-form.component.ts +++ b/client/src/app/site/pages/meetings/pages/motions/pages/motion-detail/components/motion-highlight-form/motion-highlight-form.component.ts @@ -268,6 +268,13 @@ export class MotionHighlightFormComponent extends BaseMotionDetailChildComponent this.setChangeRecoMode(this.determineCrMode(recoMode as ChangeRecoMode)); } } + if ( + this.isRecoMode(ChangeRecoMode.Original) && + current?.isParagraphBasedAmendment() && + this.hasChangeRecommendations + ) { + this.setChangeRecoMode(this.determineCrMode(ChangeRecoMode.Diff)); + } } /** From a35df38dcfe8d18e00b62983704aa67c064e968c Mon Sep 17 00:00:00 2001 From: Ludwig Reiter Date: Thu, 8 Feb 2024 14:01:51 +0100 Subject: [PATCH 2/3] Add an exists check to prevent null error --- .../motion-detail-original-change-recommendations.component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/src/app/site/pages/meetings/pages/motions/pages/motion-detail/components/motion-detail-original-change-recommendations/motion-detail-original-change-recommendations.component.ts b/client/src/app/site/pages/meetings/pages/motions/pages/motion-detail/components/motion-detail-original-change-recommendations/motion-detail-original-change-recommendations.component.ts index 7de93a40f8..dd788f697a 100644 --- a/client/src/app/site/pages/meetings/pages/motions/pages/motion-detail/components/motion-detail-original-change-recommendations/motion-detail-original-change-recommendations.component.ts +++ b/client/src/app/site/pages/meetings/pages/motions/pages/motion-detail/components/motion-detail-original-change-recommendations/motion-detail-original-change-recommendations.component.ts @@ -193,7 +193,7 @@ export class MotionDetailOriginalChangeRecommendationsComponent implements OnIni const from = ( this.element.querySelector(`.os-line-number.line-number-` + reco.getLineFrom().toString(10)) ); - return from.offsetTop.toString() + `px`; + return !!from ? from.offsetTop.toString() + `px`: `0px`; } /** From a28974bf7d4cd2bb7c54895cd67bb2f0791383d1 Mon Sep 17 00:00:00 2001 From: Ludwig Reiter Date: Thu, 8 Feb 2024 14:13:53 +0100 Subject: [PATCH 3/3] Fix layout --- .../motion-detail-original-change-recommendations.component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/src/app/site/pages/meetings/pages/motions/pages/motion-detail/components/motion-detail-original-change-recommendations/motion-detail-original-change-recommendations.component.ts b/client/src/app/site/pages/meetings/pages/motions/pages/motion-detail/components/motion-detail-original-change-recommendations/motion-detail-original-change-recommendations.component.ts index dd788f697a..264a5c7f00 100644 --- a/client/src/app/site/pages/meetings/pages/motions/pages/motion-detail/components/motion-detail-original-change-recommendations/motion-detail-original-change-recommendations.component.ts +++ b/client/src/app/site/pages/meetings/pages/motions/pages/motion-detail/components/motion-detail-original-change-recommendations/motion-detail-original-change-recommendations.component.ts @@ -193,7 +193,7 @@ export class MotionDetailOriginalChangeRecommendationsComponent implements OnIni const from = ( this.element.querySelector(`.os-line-number.line-number-` + reco.getLineFrom().toString(10)) ); - return !!from ? from.offsetTop.toString() + `px`: `0px`; + return !!from ? from.offsetTop.toString() + `px` : `0px`; } /**